UNPKG

@wangeditor-next/editor

Version:
1 lines 1.54 MB
{"version":3,"file":"core.mjs","sources":["../src/utils/browser-polyfill.ts","../src/utils/node-polyfill.ts","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/loggers.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/getTimeStamp.js","../../../node_modules/.pnpm/nanoid@3.3.11/node_modules/nanoid/non-secure/index.cjs","../../../node_modules/.pnpm/@transloadit+prettier-bytes@0.0.7/node_modules/@transloadit/prettier-bytes/prettierBytes.js","../../../node_modules/.pnpm/wildcard@1.1.2/node_modules/wildcard/index.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/Restricter.js","../../../node_modules/.pnpm/mime-match@1.0.2/node_modules/mime-match/index.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/hasProperty.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/Translator.js","../../../node_modules/.pnpm/namespace-emitter@2.0.1/node_modules/namespace-emitter/index.js","../../../node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js","../../../node_modules/.pnpm/@uppy+store-default@2.1.1/node_modules/@uppy/store-default/lib/index.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/getFileNameAndExtension.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/mimeTypes.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/Uppy.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/getFileType.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/generateFileID.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/supportsUploadProgress.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/getFileName.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/locale.js","../../../node_modules/.pnpm/preact@10.27.2/node_modules/preact/dist/preact.module.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/findDOMElement.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/isDOMElement.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/BasePlugin.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/UIPlugin.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/getTextDirection.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/index.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/NetworkError.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/RequestClient.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/fetchWithNetworkError.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/ErrorWithCause.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/AuthError.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/tokenStorage.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/index.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/Provider.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/SearchProvider.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/Socket.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/RateLimitedQueue.js","../../../node_modules/.pnpm/@uppy+xhr-upload@2.1.3_@uppy+core@2.3.4/node_modules/@uppy/xhr-upload/lib/locale.js","../../../node_modules/.pnpm/@uppy+xhr-upload@2.1.3_@uppy+core@2.3.4/node_modules/@uppy/xhr-upload/lib/index.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/emitSocketProgress.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/getSocketHost.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/settle.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/EventTracker.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/ProgressTimeout.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/isNetworkError.js","../../../node_modules/.pnpm/lodash.foreach@4.5.0/node_modules/lodash.foreach/index.js","../../core/src/utils/util.ts","../../../node_modules/.pnpm/slate@0.123.0/node_modules/slate/dist/index.es.js","../../../node_modules/.pnpm/slate-history@0.115.0_slate@0.123.0/node_modules/slate-history/dist/index.es.js","../../../node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js","../../core/src/utils/sanitize-html.ts","../../core/src/config/register.ts","../../core/src/config/interface.ts","../../core/src/menus/register.ts","../../core/src/utils/weak-maps.ts","../../core/src/editor/plugins/with-config.ts","../../core/src/constants/index.ts","../../../node_modules/.pnpm/ssr-window@4.0.2/node_modules/ssr-window/ssr-window.esm.js","../../../node_modules/.pnpm/dom7@4.0.6/node_modules/dom7/dom7.esm.js","../../../node_modules/.pnpm/html-void-elements@3.0.0/node_modules/html-void-elements/index.js","../../core/src/utils/dom.ts","../../core/src/parse-html/helper.ts","../../core/src/parse-html/index.ts","../../core/src/parse-html/parse-common-elem-html.ts","../../core/src/parse-html/parse-text-elem-html.ts","../../core/src/parse-html/parse-elem-html.ts","../../core/src/create/helper.ts","../../core/src/render/helper.ts","../../core/src/to-html/index.ts","../../core/src/to-html/elem2html.ts","../../../node_modules/.pnpm/lodash.toarray@4.4.0/node_modules/lodash.toarray/index.js","../../core/src/utils/key.ts","../../core/src/utils/ua.ts","../../core/src/editor/dom-editor.ts","../../core/src/to-html/node2html.ts","../../core/src/to-html/text2html.ts","../../core/src/utils/line.ts","../../core/src/editor/plugins/with-content.ts","../../core/src/editor/plugins/with-dom.ts","../../../node_modules/.pnpm/type@2.7.3/node_modules/type/value/is.js","../../../node_modules/.pnpm/type@2.7.3/node_modules/type/prototype/is.js","../../../node_modules/.pnpm/type@2.7.3/node_modules/type/object/is.js","../../../node_modules/.pnpm/type@2.7.3/node_modules/type/plain-function/is.js","../../../node_modules/.pnpm/type@2.7.3/node_modules/type/function/is.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/is-value.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/function/noop.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/keys/index.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/keys/is-implemented.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/keys/shim.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/assign/shim.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/valid-value.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/assign/index.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/assign/is-implemented.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/#/contains/index.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/#/contains/is-implemented.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/string/#/contains/shim.js","../../../node_modules/.pnpm/d@1.0.2/node_modules/d/index.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/normalize-options.js","../../../node_modules/.pnpm/event-emitter@0.3.5/node_modules/event-emitter/index.js","../../../node_modules/.pnpm/es5-ext@0.10.64/node_modules/es5-ext/object/valid-callable.js","../../core/src/editor/plugins/with-emitter.ts","../../core/src/editor/plugins/with-event-data.ts","../../core/src/editor/plugins/with-max-length.ts","../../core/src/menus/helpers/position.ts","../../core/src/editor/plugins/with-selection.ts","../../../node_modules/.pnpm/lodash.debounce@4.0.8/node_modules/lodash.debounce/index.js","../../../node_modules/.pnpm/i18next@23.16.8/node_modules/i18next/dist/esm/i18next.js","../../core/src/i18n/index.ts","../../core/src/menus/helpers/helpers.ts","../../core/src/constants/svg.ts","../../core/src/menus/bar-item/tooltip.ts","../../core/src/menus/bar-item/BaseButton.ts","../../core/src/menus/bar-item/SimpleButton.ts","../../core/src/menus/panel-and-modal/BaseClass.ts","../../core/src/menus/panel-and-modal/DropPanel.ts","../../core/src/menus/bar-item/DropPanelButton.ts","../../core/src/menus/panel-and-modal/Modal.ts","../../core/src/menus/bar-item/ModalButton.ts","../../core/src/menus/panel-and-modal/SelectList.ts","../../core/src/menus/bar-item/Select.ts","../../core/src/menus/bar-item/GroupButton.ts","../../core/src/menus/bar-item/index.ts","../../core/src/menus/bar/HoverBar.ts","../../core/src/text-area/helpers.ts","../../../node_modules/.pnpm/compute-scroll-into-view@3.1.1/node_modules/compute-scroll-into-view/dist/index.js","../../../node_modules/.pnpm/scroll-into-view-if-needed@3.1.0/node_modules/scroll-into-view-if-needed/dist/index.js","../../core/src/text-area/syncSelection.ts","../../core/src/text-area/event-handlers/composition.ts","../../../node_modules/.pnpm/is-hotkey@0.2.0/node_modules/is-hotkey/lib/index.js","../../core/src/utils/hotkeys.ts","../../core/src/text-area/event-handlers/keydown.ts","../../core/src/text-area/event-handlers/index.ts","../../core/src/text-area/event-handlers/beforeInput.ts","../../core/src/text-area/event-handlers/blur.ts","../../core/src/text-area/event-handlers/focus.ts","../../core/src/text-area/event-handlers/click.ts","../../core/src/text-area/place-holder.ts","../../core/src/text-area/event-handlers/keypress.ts","../../core/src/text-area/event-handlers/copy.ts","../../core/src/text-area/event-handlers/cut.ts","../../core/src/text-area/event-handlers/paste.ts","../../core/src/text-area/event-handlers/drag.ts","../../core/src/text-area/event-handlers/drop.ts","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/htmldomapi.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/vnode.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/is.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/init.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/h.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/modules/attributes.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/modules/class.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/modules/dataset.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/modules/eventlisteners.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/modules/props.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/modules/style.js","../../../node_modules/.pnpm/snabbdom@3.6.3/node_modules/snabbdom/build/jsx.js","../../core/src/render/index.ts","../../core/src/render/element/getRenderElem.tsx","../../core/src/render/element/renderElement.tsx","../../core/src/render/element/renderStyle.ts","../../core/src/render/text/genVnode.tsx","../../core/src/render/text/renderText.tsx","../../core/src/render/text/renderStyle.ts","../../core/src/render/node2Vnode.ts","../../../node_modules/.pnpm/lodash.camelcase@4.3.0/node_modules/lodash.camelcase/index.js","../../core/src/utils/vdom.ts","../../core/src/text-area/update-view.ts","../../core/src/text-area/TextArea.ts","../../core/src/create/bind-node-relation.ts","../../core/src/create/create-editor.ts","../../core/src/config/index.ts","../../core/src/menus/bar/Toolbar.ts","../../core/src/create/create-toolbar.ts","../../core/src/config/style-mode.ts","../src/register-builtin-modules/register.ts","../src/locale/index.ts","../src/locale/en.ts","../src/locale/zh-CN.ts","../src/Boot.ts","../src/create.ts","../src/core.ts"],"sourcesContent":["/**\n * @description browser polyfill\n * @author wangfupeng\n */\n\n// @ts-nocheck\n\n// 必须是浏览器环境\nif (typeof global === 'undefined') {\n // 检查 IE 浏览器\n if ('ActiveXObject' in window) {\n let info = '抱歉,wangEditor V5+ 版本开始,不在支持 IE 浏览器'\n info += '\\n Sorry, wangEditor V5+ versions do not support IE browser.'\n console.error(info)\n }\n\n globalThisPolyfill()\n AggregateErrorPolyfill()\n} else if (global && global.navigator?.userAgent.match('QQBrowser')) {\n // 兼容 QQ 浏览器 AggregateError 报错\n globalThisPolyfill()\n AggregateErrorPolyfill()\n}\n\nfunction globalThisPolyfill() {\n // 部分浏览器不支持 globalThis\n if (typeof globalThis === 'undefined') {\n // @ts-ignore\n window.globalThis = window\n }\n}\n\nfunction AggregateErrorPolyfill() {\n if (typeof AggregateError === 'undefined') {\n window.AggregateError = function (errors, msg) {\n const err = new Error(msg)\n err.errors = errors\n return err\n }\n }\n}\n","/**\n * @description node polyfill\n * @author wangfupeng\n */\n\n// @ts-nocheck\n\n// 必须是 node 环境\nif (typeof global === 'object') {\n // 用于 nodejs ,避免报错\n const globalProperty = Object.getOwnPropertyDescriptor(global, 'window')\n\n // global.window 为空则直接写入\n // 部分框架下已经定义了global.window且是不可写属性\n if (!global.window || globalProperty.set) {\n global.window = global\n global.requestAnimationFrame = () => {}\n global.navigator = {\n userAgent: '',\n }\n global.location = {\n hostname: '0.0.0.0',\n port: 0,\n protocol: 'http:',\n }\n global.btoa = () => {}\n global.crypto = {\n getRandomValues: function (buffer: any) {\n return nodeCrypto.randomFillSync(buffer)\n },\n }\n }\n\n if (global.document != null) {\n // SSR 环境下可能会报错 (issue 4409)\n if (global.document.getElementsByTagName == null) {\n global.document.getElementsByTagName = () => []\n }\n }\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.justErrorsLogger = exports.debugLogger = void 0;\n\n/* eslint-disable no-console */\nconst getTimeStamp = require(\"@uppy/utils/lib/getTimeStamp\"); // Swallow all logs, except errors.\n// default if logger is not set or debug: false\n\n\nconst justErrorsLogger = {\n debug: () => {},\n warn: () => {},\n error: function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return console.error(`[Uppy] [${getTimeStamp()}]`, ...args);\n }\n}; // Print logs to console with namespace + timestamp,\n// set by logger: Uppy.debugLogger or debug: true\n\nexports.justErrorsLogger = justErrorsLogger;\nconst debugLogger = {\n debug: function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return console.debug(`[Uppy] [${getTimeStamp()}]`, ...args);\n },\n warn: function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return console.warn(`[Uppy] [${getTimeStamp()}]`, ...args);\n },\n error: function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return console.error(`[Uppy] [${getTimeStamp()}]`, ...args);\n }\n};\nexports.debugLogger = debugLogger;","\"use strict\";\n\n/**\n * Adds zero to strings shorter than two characters.\n *\n * @param {number} number\n * @returns {string}\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 */\n\n\nfunction 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\nmodule.exports = getTimeStamp;","// This alphabet uses `A-Za-z0-9_-` symbols.\n// The order of characters is optimized for better gzip and brotli compression.\n// References to the same file (works both for gzip and brotli):\n// `'use`, `andom`, and `rict'`\n// References to the brotli default dictionary:\n// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`\nlet urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n\nlet customAlphabet = (alphabet, defaultSize = 21) => {\n return (size = defaultSize) => {\n let id = ''\n // A compact alternative for `for (var i = 0; i < step; i++)`.\n let i = size | 0\n while (i--) {\n // `| 0` is more compact and faster than `Math.floor()`.\n id += alphabet[(Math.random() * alphabet.length) | 0]\n }\n return id\n }\n}\n\nlet nanoid = (size = 21) => {\n let id = ''\n // A compact alternative for `for (var i = 0; i < step; i++)`.\n let i = size | 0\n while (i--) {\n // `| 0` is more compact and faster than `Math.floor()`.\n id += urlAlphabet[(Math.random() * 64) | 0]\n }\n return id\n}\n\nmodule.exports = { nanoid, customAlphabet }\n","// 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\nmodule.exports = function prettierBytes (num) {\n if (typeof num !== 'number' || isNaN(num)) {\n throw new TypeError('Expected a number, got ' + typeof num)\n }\n\n var neg = num < 0\n var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n\n if (neg) {\n num = -num\n }\n\n if (num < 1) {\n return (neg ? '-' : '') + num + ' B'\n }\n\n var exponent = Math.min(Math.floor(Math.log(num) / Math.log(1024)), units.length - 1)\n num = Number(num / Math.pow(1024, exponent))\n var unit = units[exponent]\n\n if (num >= 10 || num % 1 === 0) {\n // Do not show decimals when the number is two-digit, or if the number has no\n // decimal component.\n return (neg ? '-' : '') + num.toFixed(0) + ' ' + unit\n } else {\n return (neg ? '-' : '') + num.toFixed(1) + ' ' + unit\n }\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","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.defaultOptions = exports.RestrictionError = exports.Restricter = void 0;\n\n/* eslint-disable max-classes-per-file, class-methods-use-this */\n\n/* global AggregateError */\nconst prettierBytes = require(\"@transloadit/prettier-bytes\");\n\nconst match = require(\"mime-match\");\n\nconst defaultOptions = {\n maxFileSize: null,\n minFileSize: null,\n maxTotalFileSize: null,\n maxNumberOfFiles: null,\n minNumberOfFiles: null,\n allowedFileTypes: null,\n requiredMetaFields: []\n};\nexports.defaultOptions = defaultOptions;\n\nclass RestrictionError extends Error {\n constructor() {\n super(...arguments);\n this.isRestriction = true;\n }\n\n}\n\nexports.RestrictionError = RestrictionError;\n\nif (typeof AggregateError === 'undefined') {\n // eslint-disable-next-line no-global-assign\n // TODO: remove this \"polyfill\" in the next major.\n globalThis.AggregateError = class AggregateError extends Error {\n constructor(errors, message) {\n super(message);\n this.errors = errors;\n }\n\n };\n}\n\nclass Restricter {\n constructor(getOpts, i18n) {\n this.i18n = i18n;\n\n this.getOpts = () => {\n const opts = getOpts();\n\n if (opts.restrictions.allowedFileTypes != null && !Array.isArray(opts.restrictions.allowedFileTypes)) {\n throw new TypeError('`restrictions.allowedFileTypes` must be an array');\n }\n\n return opts;\n };\n }\n\n validate(file, files) {\n const {\n maxFileSize,\n minFileSize,\n maxTotalFileSize,\n maxNumberOfFiles,\n allowedFileTypes\n } = this.getOpts().restrictions;\n\n if (maxNumberOfFiles) {\n const nonGhostFiles = files.filter(f => !f.isGhost);\n\n if (nonGhostFiles.length + 1 > maxNumberOfFiles) {\n throw new RestrictionError(`${this.i18n('youCanOnlyUploadX', {\n smart_count: maxNumberOfFiles\n })}`);\n }\n }\n\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) return false;\n return match(file.type.replace(/;.*?$/, ''), type);\n } // otherwise this is likely an extension\n\n\n if (type[0] === '.' && file.extension) {\n return file.extension.toLowerCase() === type.slice(1).toLowerCase();\n }\n\n return false;\n });\n\n if (!isCorrectFileType) {\n const allowedFileTypesString = allowedFileTypes.join(', ');\n throw new RestrictionError(this.i18n('youCanOnlyUploadFileTypes', {\n types: allowedFileTypesString\n }));\n }\n } // We can't check maxTotalFileSize if the size is unknown.\n\n\n if (maxTotalFileSize && file.size != null) {\n const totalFilesSize = files.reduce((total, f) => total + f.size, file.size);\n\n if (totalFilesSize > maxTotalFileSize) {\n throw new RestrictionError(this.i18n('exceedsSize', {\n size: prettierBytes(maxTotalFileSize),\n file: file.name\n }));\n }\n } // We can't check maxFileSize if the size is unknown.\n\n\n if (maxFileSize && file.size != null && file.size > maxFileSize) {\n throw new RestrictionError(this.i18n('exceedsSize', {\n size: prettierBytes(maxFileSize),\n file: file.name\n }));\n } // We can't check minFileSize if the size is unknown.\n\n\n if (minFileSize && file.size != null && file.size < minFileSize) {\n throw new RestrictionError(this.i18n('inferiorSize', {\n size: prettierBytes(minFileSize)\n }));\n }\n }\n\n validateMinNumberOfFiles(files) {\n const {\n minNumberOfFiles\n } = this.getOpts().restrictions;\n\n if (Object.keys(files).length < minNumberOfFiles) {\n throw new RestrictionError(this.i18n('youHaveToAtLeastSelectX', {\n smart_count: minNumberOfFiles\n }));\n }\n }\n\n getMissingRequiredMetaFields(file) {\n const error = new RestrictionError(this.i18n('missingRequiredMetaFieldOnFile', {\n fileName: file.name\n }));\n const {\n requiredMetaFields\n } = this.getOpts().restrictions; // TODO: migrate to Object.hasOwn in the next major.\n\n const own = Object.prototype.hasOwnProperty;\n const missingFields = [];\n\n for (const field of requiredMetaFields) {\n if (!own.call(file.meta, field) || file.meta[field] === '') {\n missingFields.push(field);\n }\n }\n\n return {\n missingFields,\n error\n };\n }\n\n}\n\nexports.Restricter = Restricter;","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","\"use strict\";\n\nfunction has(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nmodule.exports = has;","\"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 has = require(\"./hasProperty.js\");\n\nfunction 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’d get this: [object Object] hello [object Object] my <button>\n if (typeof chunk !== 'string') {\n return newParts.push(chunk);\n }\n\n return rx[Symbol.split](chunk).forEach((raw, i, list) => {\n if (raw !== '') {\n newParts.push(raw);\n } // Interlace with the `replacement` value\n\n\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 {string} phrase that needs interpolation, with placeholders\n * @param {object} options with values that will be used to replace placeholders\n * @returns {any[]} interpolated\n */\n\n\nfunction interpolate(phrase, options) {\n const dollarRegex = /\\$/g;\n const dollarBillsYall = '$$$$';\n let interpolated = [phrase];\n if (options == null) return interpolated;\n\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\n if (typeof replacement === 'string') {\n replacement = dollarRegex[Symbol.replace](replacement, dollarBillsYall);\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\n\n interpolated = insertReplacement(interpolated, new RegExp(`%\\\\{${arg}\\\\}`, 'g'), replacement);\n }\n }\n\n return interpolated;\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 */\n\n\nvar _apply = /*#__PURE__*/_classPrivateFieldLooseKey(\"apply\");\n\nclass Translator {\n /**\n * @param {object|Array<object>} locales - locale or list of locales.\n */\n constructor(locales) {\n Object.defineProperty(this, _apply, {\n value: _apply2\n });\n this.locale = {\n strings: {},\n\n pluralize(n) {\n if (n === 1) {\n return 0;\n }\n\n return 1;\n }\n\n };\n\n if (Array.isArray(locales)) {\n locales.forEach(_classPrivateFieldLooseBase(this, _apply)[_apply], this);\n } else {\n _classPrivateFieldLooseBase(this, _apply)[_apply](locales);\n }\n }\n\n /**\n * Public translate method\n *\n * @param {string} key\n * @param {object} 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 * @param {string} key\n * @param {object} options with values that will be used to replace placeholders\n * @returns {Array} The translated and interpolated parts, in order.\n */\n\n\n translateArray(key, options) {\n if (!has(this.locale.strings, key)) {\n throw new Error(`missing string: ${key}`);\n }\n\n const string = this.locale.strings[key];\n const hasPluralForms = typeof string === 'object';\n\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\n throw new Error('Attempted to use a string with plural forms, but no value was given for %{smart_count}');\n }\n\n return interpolate(string, options);\n }\n\n}\n\nfunction _apply2(locale) {\n if (!(locale != null && locale.strings)) {\n return;\n }\n\n const prevLocale = this.locale;\n this.locale = { ...prevLocale,\n strings: { ...prevLocale.strings,\n ...locale.strings\n }\n };\n this.locale.pluralize = locale.pluralize || prevLocale.pluralize;\n}\n\nmodule.exports = Translator;","/**\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 – the name of the event, with optional namespace\n * @param {...*} data – 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] – 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 * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\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/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\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\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 objectToString = objectProto.toString;\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 * 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\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 result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\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 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\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\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 && (type == 'object' || type == 'function');\n}\n\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 && typeof value == 'object';\n}\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) && objectToString.call(value) == symbolTag);\n}\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 = value.replace(reTrim, '');\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 = throttle;\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 packageJson = {\n \"version\": \"2.1.1\"\n};\n/**\n * Default store that keeps state in a simple object.\n */\n\nvar _publish = /*#__PURE__*/_classPrivateFieldLooseKey(\"publish\");\n\nclass DefaultStore {\n constructor() {\n Object.defineProperty(this, _publish, {\n value: _publish2\n });\n this.state = {};\n this.callbacks = []; // TODO: use a Set instead, make it a private prop\n }\n\n getState() {\n return this.state;\n }\n\n setState(patch) {\n const prevState = { ...this