From 64f6aa97db4b7ae1fcf4413c5b5eb87198977fb6 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 21 Oct 2021 20:13:06 +0200 Subject: [PATCH] wip #4832 @1 --- src/app/Magic/Fields/Files.php | 2 +- src/public/dropzone/dropzone.js | 12046 ++++++++++++---- src/public/sortable/sortable.js | 231 +- .../views/fields/dropzone_media.blade.php | 72 +- 4 files changed, 9638 insertions(+), 2713 deletions(-) diff --git a/src/app/Magic/Fields/Files.php b/src/app/Magic/Fields/Files.php index c9809cf..c86be49 100644 --- a/src/app/Magic/Fields/Files.php +++ b/src/app/Magic/Fields/Files.php @@ -31,7 +31,7 @@ class Files extends Field 'thumbnailHeight' => 120, 'thumbnailWidth' => 120, 'maxFilesize' => 1024, - 'addRemoveLinks' => true, + //'addRemoveLinks' => true, 'createImageThumbnails' => true, 'maxFiles' => $this->_maxFiles ] diff --git a/src/public/dropzone/dropzone.js b/src/public/dropzone/dropzone.js index 0743dfd..19884b7 100644 --- a/src/public/dropzone/dropzone.js +++ b/src/public/dropzone/dropzone.js @@ -1,189 +1,7013 @@ -"use strict"; - -var _createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else { + var a = factory(); + for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } +})(self, function() { + return /******/ (function() { // webpackBootstrap + /******/ var __webpack_modules__ = ({ - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); + /***/ 3099: + /***/ (function(module) { -function _possibleConstructorReturn(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self; -} + module.exports = function (it) { + if (typeof it != 'function') { + throw TypeError(String(it) + ' is not a function'); + } return it; + }; + + + /***/ }), + + /***/ 6077: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var isObject = __webpack_require__(111); + + module.exports = function (it) { + if (!isObject(it) && it !== null) { + throw TypeError("Can't set " + String(it) + ' as a prototype'); + } return it; + }; + + + /***/ }), + + /***/ 1223: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var wellKnownSymbol = __webpack_require__(5112); + var create = __webpack_require__(30); + var definePropertyModule = __webpack_require__(3070); + + var UNSCOPABLES = wellKnownSymbol('unscopables'); + var ArrayPrototype = Array.prototype; + +// Array.prototype[@@unscopables] +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + if (ArrayPrototype[UNSCOPABLES] == undefined) { + definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { + configurable: true, + value: create(null) + }); + } + +// add a key to Array.prototype[@@unscopables] + module.exports = function (key) { + ArrayPrototype[UNSCOPABLES][key] = true; + }; + + + /***/ }), + + /***/ 1530: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var charAt = __webpack_require__(8710).charAt; + +// `AdvanceStringIndex` abstract operation +// https://tc39.es/ecma262/#sec-advancestringindex + module.exports = function (S, index, unicode) { + return index + (unicode ? charAt(S, index).length : 1); + }; + + + /***/ }), + + /***/ 5787: + /***/ (function(module) { + + module.exports = function (it, Constructor, name) { + if (!(it instanceof Constructor)) { + throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); + } return it; + }; + + + /***/ }), + + /***/ 9670: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var isObject = __webpack_require__(111); + + module.exports = function (it) { + if (!isObject(it)) { + throw TypeError(String(it) + ' is not an object'); + } return it; + }; + + + /***/ }), + + /***/ 4019: + /***/ (function(module) { + + module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined'; + + + /***/ }), + + /***/ 260: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var NATIVE_ARRAY_BUFFER = __webpack_require__(4019); + var DESCRIPTORS = __webpack_require__(9781); + var global = __webpack_require__(7854); + var isObject = __webpack_require__(111); + var has = __webpack_require__(6656); + var classof = __webpack_require__(648); + var createNonEnumerableProperty = __webpack_require__(8880); + var redefine = __webpack_require__(1320); + var defineProperty = __webpack_require__(3070).f; + var getPrototypeOf = __webpack_require__(9518); + var setPrototypeOf = __webpack_require__(7674); + var wellKnownSymbol = __webpack_require__(5112); + var uid = __webpack_require__(9711); + + var Int8Array = global.Int8Array; + var Int8ArrayPrototype = Int8Array && Int8Array.prototype; + var Uint8ClampedArray = global.Uint8ClampedArray; + var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; + var TypedArray = Int8Array && getPrototypeOf(Int8Array); + var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); + var ObjectPrototype = Object.prototype; + var isPrototypeOf = ObjectPrototype.isPrototypeOf; + + var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); +// Fixing native typed arrays in Opera Presto crashes the browser, see #595 + var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; + var TYPED_ARRAY_TAG_REQIRED = false; + var NAME; + + var TypedArrayConstructorsList = { + Int8Array: 1, + Uint8Array: 1, + Uint8ClampedArray: 1, + Int16Array: 2, + Uint16Array: 2, + Int32Array: 4, + Uint32Array: 4, + Float32Array: 4, + Float64Array: 8 + }; + + var BigIntArrayConstructorsList = { + BigInt64Array: 8, + BigUint64Array: 8 + }; + + var isView = function isView(it) { + if (!isObject(it)) return false; + var klass = classof(it); + return klass === 'DataView' + || has(TypedArrayConstructorsList, klass) + || has(BigIntArrayConstructorsList, klass); + }; + + var isTypedArray = function (it) { + if (!isObject(it)) return false; + var klass = classof(it); + return has(TypedArrayConstructorsList, klass) + || has(BigIntArrayConstructorsList, klass); + }; + + var aTypedArray = function (it) { + if (isTypedArray(it)) return it; + throw TypeError('Target is not a typed array'); + }; + + var aTypedArrayConstructor = function (C) { + if (setPrototypeOf) { + if (isPrototypeOf.call(TypedArray, C)) return C; + } else for (var ARRAY in TypedArrayConstructorsList) if (has(TypedArrayConstructorsList, NAME)) { + var TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && (C === TypedArrayConstructor || isPrototypeOf.call(TypedArrayConstructor, C))) { + return C; + } + } throw TypeError('Target is not a typed array constructor'); + }; + + var exportTypedArrayMethod = function (KEY, property, forced) { + if (!DESCRIPTORS) return; + if (forced) for (var ARRAY in TypedArrayConstructorsList) { + var TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) { + delete TypedArrayConstructor.prototype[KEY]; + } + } + if (!TypedArrayPrototype[KEY] || forced) { + redefine(TypedArrayPrototype, KEY, forced ? property + : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property); + } + }; + + var exportTypedArrayStaticMethod = function (KEY, property, forced) { + var ARRAY, TypedArrayConstructor; + if (!DESCRIPTORS) return; + if (setPrototypeOf) { + if (forced) for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) { + delete TypedArrayConstructor[KEY]; + } + } + if (!TypedArray[KEY] || forced) { + // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable + try { + return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY] || property); + } catch (error) { /* empty */ } + } else return; + } + for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { + redefine(TypedArrayConstructor, KEY, property); + } + } + }; + + for (NAME in TypedArrayConstructorsList) { + if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false; + } + +// WebKit bug - typed arrays constructors prototype is Object.prototype + if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) { + // eslint-disable-next-line no-shadow -- safe + TypedArray = function TypedArray() { + throw TypeError('Incorrect invocation'); + }; + if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); + } + } + + if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { + TypedArrayPrototype = TypedArray.prototype; + if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); + } + } + +// WebKit bug - one more object in Uint8ClampedArray prototype chain + if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { + setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); + } + + if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) { + TYPED_ARRAY_TAG_REQIRED = true; + defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () { + return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; + } }); + for (NAME in TypedArrayConstructorsList) if (global[NAME]) { + createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME); + } + } + + module.exports = { + NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, + TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, + aTypedArray: aTypedArray, + aTypedArrayConstructor: aTypedArrayConstructor, + exportTypedArrayMethod: exportTypedArrayMethod, + exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, + isView: isView, + isTypedArray: isTypedArray, + TypedArray: TypedArray, + TypedArrayPrototype: TypedArrayPrototype + }; + + + /***/ }), + + /***/ 3331: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var global = __webpack_require__(7854); + var DESCRIPTORS = __webpack_require__(9781); + var NATIVE_ARRAY_BUFFER = __webpack_require__(4019); + var createNonEnumerableProperty = __webpack_require__(8880); + var redefineAll = __webpack_require__(2248); + var fails = __webpack_require__(7293); + var anInstance = __webpack_require__(5787); + var toInteger = __webpack_require__(9958); + var toLength = __webpack_require__(7466); + var toIndex = __webpack_require__(7067); + var IEEE754 = __webpack_require__(1179); + var getPrototypeOf = __webpack_require__(9518); + var setPrototypeOf = __webpack_require__(7674); + var getOwnPropertyNames = __webpack_require__(8006).f; + var defineProperty = __webpack_require__(3070).f; + var arrayFill = __webpack_require__(1285); + var setToStringTag = __webpack_require__(8003); + var InternalStateModule = __webpack_require__(9909); + + var getInternalState = InternalStateModule.get; + var setInternalState = InternalStateModule.set; + var ARRAY_BUFFER = 'ArrayBuffer'; + var DATA_VIEW = 'DataView'; + var PROTOTYPE = 'prototype'; + var WRONG_LENGTH = 'Wrong length'; + var WRONG_INDEX = 'Wrong index'; + var NativeArrayBuffer = global[ARRAY_BUFFER]; + var $ArrayBuffer = NativeArrayBuffer; + var $DataView = global[DATA_VIEW]; + var $DataViewPrototype = $DataView && $DataView[PROTOTYPE]; + var ObjectPrototype = Object.prototype; + var RangeError = global.RangeError; + + var packIEEE754 = IEEE754.pack; + var unpackIEEE754 = IEEE754.unpack; + + var packInt8 = function (number) { + return [number & 0xFF]; + }; + + var packInt16 = function (number) { + return [number & 0xFF, number >> 8 & 0xFF]; + }; + + var packInt32 = function (number) { + return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF]; + }; + + var unpackInt32 = function (buffer) { + return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; + }; + + var packFloat32 = function (number) { + return packIEEE754(number, 23, 4); + }; + + var packFloat64 = function (number) { + return packIEEE754(number, 52, 8); + }; + + var addGetter = function (Constructor, key) { + defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } }); + }; + + var get = function (view, count, index, isLittleEndian) { + var intIndex = toIndex(index); + var store = getInternalState(view); + if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); + var bytes = getInternalState(store.buffer).bytes; + var start = intIndex + store.byteOffset; + var pack = bytes.slice(start, start + count); + return isLittleEndian ? pack : pack.reverse(); + }; + + var set = function (view, count, index, conversion, value, isLittleEndian) { + var intIndex = toIndex(index); + var store = getInternalState(view); + if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); + var bytes = getInternalState(store.buffer).bytes; + var start = intIndex + store.byteOffset; + var pack = conversion(+value); + for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; + }; + + if (!NATIVE_ARRAY_BUFFER) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + setInternalState(this, { + bytes: arrayFill.call(new Array(byteLength), 0), + byteLength: byteLength + }); + if (!DESCRIPTORS) this.byteLength = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = getInternalState(buffer).byteLength; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + setInternalState(this, { + buffer: buffer, + byteLength: byteLength, + byteOffset: offset + }); + if (!DESCRIPTORS) { + this.buffer = buffer; + this.byteLength = byteLength; + this.byteOffset = offset; + } + }; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, 'byteLength'); + addGetter($DataView, 'buffer'); + addGetter($DataView, 'byteLength'); + addGetter($DataView, 'byteOffset'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined); + } + }); + } else { + /* eslint-disable no-new -- required for testing */ + if (!fails(function () { + NativeArrayBuffer(1); + }) || !fails(function () { + new NativeArrayBuffer(-1); + }) || fails(function () { + new NativeArrayBuffer(); + new NativeArrayBuffer(1.5); + new NativeArrayBuffer(NaN); + return NativeArrayBuffer.name != ARRAY_BUFFER; + })) { + /* eslint-enable no-new -- required for testing */ + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new NativeArrayBuffer(toIndex(length)); + }; + var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE]; + for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) { + createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]); + } + } + ArrayBufferPrototype.constructor = $ArrayBuffer; + } + + // WebKit bug - the same parent prototype for typed arrays and data view + if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) { + setPrototypeOf($DataViewPrototype, ObjectPrototype); + } + + // iOS Safari 7.x bug + var testView = new $DataView(new $ArrayBuffer(2)); + var nativeSetInt8 = $DataViewPrototype.setInt8; + testView.setInt8(0, 2147483648); + testView.setInt8(1, 2147483649); + if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, { + setInt8: function setInt8(byteOffset, value) { + nativeSetInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + nativeSetInt8.call(this, byteOffset, value << 24 >> 24); + } + }, { unsafe: true }); + } + + setToStringTag($ArrayBuffer, ARRAY_BUFFER); + setToStringTag($DataView, DATA_VIEW); + + module.exports = { + ArrayBuffer: $ArrayBuffer, + DataView: $DataView + }; + + + /***/ }), + + /***/ 1048: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var toObject = __webpack_require__(7908); + var toAbsoluteIndex = __webpack_require__(1400); + var toLength = __webpack_require__(7466); + + var min = Math.min; + +// `Array.prototype.copyWithin` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.copywithin + module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; + }; + + + /***/ }), + + /***/ 1285: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var toObject = __webpack_require__(7908); + var toAbsoluteIndex = __webpack_require__(1400); + var toLength = __webpack_require__(7466); + +// `Array.prototype.fill` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.fill + module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var argumentsLength = arguments.length; + var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); + var end = argumentsLength > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; + }; + + + /***/ }), + + /***/ 8533: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $forEach = __webpack_require__(2092).forEach; + var arrayMethodIsStrict = __webpack_require__(9341); + + var STRICT_METHOD = arrayMethodIsStrict('forEach'); + +// `Array.prototype.forEach` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.foreach + module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } : [].forEach; + + + /***/ }), + + /***/ 8457: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var bind = __webpack_require__(9974); + var toObject = __webpack_require__(7908); + var callWithSafeIterationClosing = __webpack_require__(3411); + var isArrayIteratorMethod = __webpack_require__(7659); + var toLength = __webpack_require__(7466); + var createProperty = __webpack_require__(6135); + var getIteratorMethod = __webpack_require__(1246); + +// `Array.from` method implementation +// https://tc39.es/ecma262/#sec-array.from + module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iteratorMethod = getIteratorMethod(O); + var index = 0; + var length, result, step, iterator, next, value; + if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); + // if the target is not iterable or it's an array with the default iterator - use a simple case + if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { + iterator = iteratorMethod.call(O); + next = iterator.next; + result = new C(); + for (;!(step = next.call(iterator)).done; index++) { + value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; + createProperty(result, index, value); + } + } else { + length = toLength(O.length); + result = new C(length); + for (;length > index; index++) { + value = mapping ? mapfn(O[index], index) : O[index]; + createProperty(result, index, value); + } + } + result.length = index; + return result; + }; + + + /***/ }), + + /***/ 1318: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var toIndexedObject = __webpack_require__(5656); + var toLength = __webpack_require__(7466); + var toAbsoluteIndex = __webpack_require__(1400); + +// `Array.prototype.{ indexOf, includes }` methods implementation + var createMethod = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIndexedObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare -- NaN check + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare -- NaN check + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) { + if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; + }; + + module.exports = { + // `Array.prototype.includes` method + // https://tc39.es/ecma262/#sec-array.prototype.includes + includes: createMethod(true), + // `Array.prototype.indexOf` method + // https://tc39.es/ecma262/#sec-array.prototype.indexof + indexOf: createMethod(false) + }; + + + /***/ }), + + /***/ 2092: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var bind = __webpack_require__(9974); + var IndexedObject = __webpack_require__(8361); + var toObject = __webpack_require__(7908); + var toLength = __webpack_require__(7466); + var arraySpeciesCreate = __webpack_require__(5417); + + var push = [].push; + +// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation + var createMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var IS_FILTER_OUT = TYPE == 7; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + return function ($this, callbackfn, that, specificCreate) { + var O = toObject($this); + var self = IndexedObject(O); + var boundFunction = bind(callbackfn, that, 3); + var length = toLength(self.length); + var index = 0; + var create = specificCreate || arraySpeciesCreate; + var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined; + var value, result; + for (;length > index; index++) if (NO_HOLES || index in self) { + value = self[index]; + result = boundFunction(value, index, O); + if (TYPE) { + if (IS_MAP) target[index] = result; // map + else if (result) switch (TYPE) { + case 3: return true; // some + case 5: return value; // find + case 6: return index; // findIndex + case 2: push.call(target, value); // filter + } else switch (TYPE) { + case 4: return false; // every + case 7: push.call(target, value); // filterOut + } + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; + }; + }; + + module.exports = { + // `Array.prototype.forEach` method + // https://tc39.es/ecma262/#sec-array.prototype.foreach + forEach: createMethod(0), + // `Array.prototype.map` method + // https://tc39.es/ecma262/#sec-array.prototype.map + map: createMethod(1), + // `Array.prototype.filter` method + // https://tc39.es/ecma262/#sec-array.prototype.filter + filter: createMethod(2), + // `Array.prototype.some` method + // https://tc39.es/ecma262/#sec-array.prototype.some + some: createMethod(3), + // `Array.prototype.every` method + // https://tc39.es/ecma262/#sec-array.prototype.every + every: createMethod(4), + // `Array.prototype.find` method + // https://tc39.es/ecma262/#sec-array.prototype.find + find: createMethod(5), + // `Array.prototype.findIndex` method + // https://tc39.es/ecma262/#sec-array.prototype.findIndex + findIndex: createMethod(6), + // `Array.prototype.filterOut` method + // https://github.com/tc39/proposal-array-filtering + filterOut: createMethod(7) + }; + + + /***/ }), + + /***/ 6583: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var toIndexedObject = __webpack_require__(5656); + var toInteger = __webpack_require__(9958); + var toLength = __webpack_require__(7466); + var arrayMethodIsStrict = __webpack_require__(9341); + + var min = Math.min; + var nativeLastIndexOf = [].lastIndexOf; + var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; + var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf'); + var FORCED = NEGATIVE_ZERO || !STRICT_METHOD; + +// `Array.prototype.lastIndexOf` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.lastindexof + module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0; + var O = toIndexedObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; + return -1; + } : nativeLastIndexOf; + + + /***/ }), + + /***/ 1194: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var fails = __webpack_require__(7293); + var wellKnownSymbol = __webpack_require__(5112); + var V8_VERSION = __webpack_require__(7392); + + var SPECIES = wellKnownSymbol('species'); + + module.exports = function (METHOD_NAME) { + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/677 + return V8_VERSION >= 51 || !fails(function () { + var array = []; + var constructor = array.constructor = {}; + constructor[SPECIES] = function () { + return { foo: 1 }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }); + }; + + + /***/ }), + + /***/ 9341: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var fails = __webpack_require__(7293); + + module.exports = function (METHOD_NAME, argument) { + var method = [][METHOD_NAME]; + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing + method.call(null, argument || function () { throw 1; }, 1); + }); + }; + + + /***/ }), + + /***/ 3671: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var aFunction = __webpack_require__(3099); + var toObject = __webpack_require__(7908); + var IndexedObject = __webpack_require__(8361); + var toLength = __webpack_require__(7466); + +// `Array.prototype.{ reduce, reduceRight }` methods implementation + var createMethod = function (IS_RIGHT) { + return function (that, callbackfn, argumentsLength, memo) { + aFunction(callbackfn); + var O = toObject(that); + var self = IndexedObject(O); + var length = toLength(O.length); + var index = IS_RIGHT ? length - 1 : 0; + var i = IS_RIGHT ? -1 : 1; + if (argumentsLength < 2) while (true) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (IS_RIGHT ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; + }; + }; + + module.exports = { + // `Array.prototype.reduce` method + // https://tc39.es/ecma262/#sec-array.prototype.reduce + left: createMethod(false), + // `Array.prototype.reduceRight` method + // https://tc39.es/ecma262/#sec-array.prototype.reduceright + right: createMethod(true) + }; + + + /***/ }), + + /***/ 5417: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var isObject = __webpack_require__(111); + var isArray = __webpack_require__(3157); + var wellKnownSymbol = __webpack_require__(5112); + + var SPECIES = wellKnownSymbol('species'); + +// `ArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#sec-arrayspeciescreate + module.exports = function (originalArray, length) { + var C; + if (isArray(originalArray)) { + C = originalArray.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + else if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); + }; + + + /***/ }), + + /***/ 3411: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var anObject = __webpack_require__(9670); + var iteratorClose = __webpack_require__(9212); + +// call something on iterator step with safe closing on error + module.exports = function (iterator, fn, value, ENTRIES) { + try { + return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (error) { + iteratorClose(iterator); + throw error; + } + }; + + + /***/ }), + + /***/ 7072: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var wellKnownSymbol = __webpack_require__(5112); + + var ITERATOR = wellKnownSymbol('iterator'); + var SAFE_CLOSING = false; + + try { + var called = 0; + var iteratorWithReturn = { + next: function () { + return { done: !!called++ }; + }, + 'return': function () { + SAFE_CLOSING = true; + } + }; + iteratorWithReturn[ITERATOR] = function () { + return this; + }; + // eslint-disable-next-line no-throw-literal -- required for testing + Array.from(iteratorWithReturn, function () { throw 2; }); + } catch (error) { /* empty */ } + + module.exports = function (exec, SKIP_CLOSING) { + if (!SKIP_CLOSING && !SAFE_CLOSING) return false; + var ITERATION_SUPPORT = false; + try { + var object = {}; + object[ITERATOR] = function () { + return { + next: function () { + return { done: ITERATION_SUPPORT = true }; + } + }; + }; + exec(object); + } catch (error) { /* empty */ } + return ITERATION_SUPPORT; + }; + + + /***/ }), + + /***/ 4326: + /***/ (function(module) { + + var toString = {}.toString; + + module.exports = function (it) { + return toString.call(it).slice(8, -1); + }; + + + /***/ }), + + /***/ 648: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var TO_STRING_TAG_SUPPORT = __webpack_require__(1694); + var classofRaw = __webpack_require__(4326); + var wellKnownSymbol = __webpack_require__(5112); + + var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +// ES3 wrong here + var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error + var tryGet = function (it, key) { + try { + return it[key]; + } catch (error) { /* empty */ } + }; + +// getting tag from ES6+ `Object.prototype.toString` + module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { + var O, tag, result; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag + // builtinTag case + : CORRECT_ARGUMENTS ? classofRaw(O) + // ES3 arguments fallback + : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; + }; + + + /***/ }), + + /***/ 9920: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var has = __webpack_require__(6656); + var ownKeys = __webpack_require__(3887); + var getOwnPropertyDescriptorModule = __webpack_require__(1236); + var definePropertyModule = __webpack_require__(3070); + + module.exports = function (target, source) { + var keys = ownKeys(source); + var defineProperty = definePropertyModule.f; + var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); + } + }; + + + /***/ }), + + /***/ 8544: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var fails = __webpack_require__(7293); + + module.exports = !fails(function () { + function F() { /* empty */ } + F.prototype.constructor = null; + return Object.getPrototypeOf(new F()) !== F.prototype; + }); + + + /***/ }), + + /***/ 4994: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var IteratorPrototype = __webpack_require__(3383).IteratorPrototype; + var create = __webpack_require__(30); + var createPropertyDescriptor = __webpack_require__(9114); + var setToStringTag = __webpack_require__(8003); + var Iterators = __webpack_require__(7497); + + var returnThis = function () { return this; }; + + module.exports = function (IteratorConstructor, NAME, next) { + var TO_STRING_TAG = NAME + ' Iterator'; + IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); + setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); + Iterators[TO_STRING_TAG] = returnThis; + return IteratorConstructor; + }; + + + /***/ }), + + /***/ 8880: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var DESCRIPTORS = __webpack_require__(9781); + var definePropertyModule = __webpack_require__(3070); + var createPropertyDescriptor = __webpack_require__(9114); + + module.exports = DESCRIPTORS ? function (object, key, value) { + return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); + } : function (object, key, value) { + object[key] = value; + return object; + }; + + + /***/ }), + + /***/ 9114: + /***/ (function(module) { + + module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; + }; + + + /***/ }), + + /***/ 6135: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var toPrimitive = __webpack_require__(7593); + var definePropertyModule = __webpack_require__(3070); + var createPropertyDescriptor = __webpack_require__(9114); + + module.exports = function (object, key, value) { + var propertyKey = toPrimitive(key); + if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); + else object[propertyKey] = value; + }; + + + /***/ }), + + /***/ 654: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var createIteratorConstructor = __webpack_require__(4994); + var getPrototypeOf = __webpack_require__(9518); + var setPrototypeOf = __webpack_require__(7674); + var setToStringTag = __webpack_require__(8003); + var createNonEnumerableProperty = __webpack_require__(8880); + var redefine = __webpack_require__(1320); + var wellKnownSymbol = __webpack_require__(5112); + var IS_PURE = __webpack_require__(1913); + var Iterators = __webpack_require__(7497); + var IteratorsCore = __webpack_require__(3383); + + var IteratorPrototype = IteratorsCore.IteratorPrototype; + var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; + var ITERATOR = wellKnownSymbol('iterator'); + var KEYS = 'keys'; + var VALUES = 'values'; + var ENTRIES = 'entries'; + + var returnThis = function () { return this; }; + + module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { + createIteratorConstructor(IteratorConstructor, NAME, next); + + var getIterationMethod = function (KIND) { + if (KIND === DEFAULT && defaultIterator) return defaultIterator; + if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; + switch (KIND) { + case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; + case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; + case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; + } return function () { return new IteratorConstructor(this); }; + }; + + var TO_STRING_TAG = NAME + ' Iterator'; + var INCORRECT_VALUES_NAME = false; + var IterablePrototype = Iterable.prototype; + var nativeIterator = IterablePrototype[ITERATOR] + || IterablePrototype['@@iterator'] + || DEFAULT && IterablePrototype[DEFAULT]; + var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); + var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; + var CurrentIteratorPrototype, methods, KEY; + + // fix native + if (anyNativeIterator) { + CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); + if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { + if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { + if (setPrototypeOf) { + setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); + } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { + createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis); + } + } + // Set @@toStringTag to native iterators + setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); + if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; + } + } + + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { + INCORRECT_VALUES_NAME = true; + defaultIterator = function values() { return nativeIterator.call(this); }; + } + + // define iterator + if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { + createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator); + } + Iterators[NAME] = defaultIterator; + + // export additional methods + if (DEFAULT) { + methods = { + values: getIterationMethod(VALUES), + keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), + entries: getIterationMethod(ENTRIES) + }; + if (FORCED) for (KEY in methods) { + if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { + redefine(IterablePrototype, KEY, methods[KEY]); + } + } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); + } + + return methods; + }; + + + /***/ }), + + /***/ 9781: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var fails = __webpack_require__(7293); + +// Detect IE8's incomplete defineProperty implementation + module.exports = !fails(function () { + return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; + }); + + + /***/ }), + + /***/ 317: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + var isObject = __webpack_require__(111); + + var document = global.document; +// typeof document.createElement is 'object' in old IE + var EXISTS = isObject(document) && isObject(document.createElement); + + module.exports = function (it) { + return EXISTS ? document.createElement(it) : {}; + }; + + + /***/ }), + + /***/ 8324: + /***/ (function(module) { + +// iterable DOM collections +// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods + module.exports = { + CSSRuleList: 0, + CSSStyleDeclaration: 0, + CSSValueList: 0, + ClientRectList: 0, + DOMRectList: 0, + DOMStringList: 0, + DOMTokenList: 1, + DataTransferItemList: 0, + FileList: 0, + HTMLAllCollection: 0, + HTMLCollection: 0, + HTMLFormElement: 0, + HTMLSelectElement: 0, + MediaList: 0, + MimeTypeArray: 0, + NamedNodeMap: 0, + NodeList: 1, + PaintRequestList: 0, + Plugin: 0, + PluginArray: 0, + SVGLengthList: 0, + SVGNumberList: 0, + SVGPathSegList: 0, + SVGPointList: 0, + SVGStringList: 0, + SVGTransformList: 0, + SourceBufferList: 0, + StyleSheetList: 0, + TextTrackCueList: 0, + TextTrackList: 0, + TouchList: 0 + }; + + + /***/ }), + + /***/ 8113: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var getBuiltIn = __webpack_require__(5005); + + module.exports = getBuiltIn('navigator', 'userAgent') || ''; + + + /***/ }), + + /***/ 7392: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + var userAgent = __webpack_require__(8113); + + var process = global.process; + var versions = process && process.versions; + var v8 = versions && versions.v8; + var match, version; + + if (v8) { + match = v8.split('.'); + version = match[0] + match[1]; + } else if (userAgent) { + match = userAgent.match(/Edge\/(\d+)/); + if (!match || match[1] >= 74) { + match = userAgent.match(/Chrome\/(\d+)/); + if (match) version = match[1]; + } + } + + module.exports = version && +version; + + + /***/ }), + + /***/ 748: + /***/ (function(module) { + +// IE8- don't enum bug keys + module.exports = [ + 'constructor', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'toLocaleString', + 'toString', + 'valueOf' + ]; + + + /***/ }), + + /***/ 2109: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + var getOwnPropertyDescriptor = __webpack_require__(1236).f; + var createNonEnumerableProperty = __webpack_require__(8880); + var redefine = __webpack_require__(1320); + var setGlobal = __webpack_require__(3505); + var copyConstructorProperties = __webpack_require__(9920); + var isForced = __webpack_require__(4705); + + /* + options.target - name of the target object + options.global - target is the global object + options.stat - export as static methods of target + options.proto - export as prototype methods of target + options.real - real prototype method for the `pure` version + options.forced - export even if the native feature is available + options.bind - bind methods to the target, required for the `pure` version + options.wrap - wrap constructors to preventing global pollution, required for the `pure` version + options.unsafe - use the simple assignment of property instead of delete + defineProperty + options.sham - add a flag to not completely full polyfills + options.enumerable - export as enumerable property + options.noTargetGet - prevent calling a getter on target +*/ + module.exports = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var FORCED, target, key, targetProperty, sourceProperty, descriptor; + if (GLOBAL) { + target = global; + } else if (STATIC) { + target = global[TARGET] || setGlobal(TARGET, {}); + } else { + target = (global[TARGET] || {}).prototype; + } + if (target) for (key in source) { + sourceProperty = source[key]; + if (options.noTargetGet) { + descriptor = getOwnPropertyDescriptor(target, key); + targetProperty = descriptor && descriptor.value; + } else targetProperty = target[key]; + FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); + // contained in target + if (!FORCED && targetProperty !== undefined) { + if (typeof sourceProperty === typeof targetProperty) continue; + copyConstructorProperties(sourceProperty, targetProperty); + } + // add a flag to not completely full polyfills + if (options.sham || (targetProperty && targetProperty.sham)) { + createNonEnumerableProperty(sourceProperty, 'sham', true); + } + // extend global + redefine(target, key, sourceProperty, options); + } + }; + + + /***/ }), + + /***/ 7293: + /***/ (function(module) { + + module.exports = function (exec) { + try { + return !!exec(); + } catch (error) { + return true; + } + }; + + + /***/ }), + + /***/ 7007: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + +// TODO: Remove from `core-js@4` since it's moved to entry points + __webpack_require__(4916); + var redefine = __webpack_require__(1320); + var fails = __webpack_require__(7293); + var wellKnownSymbol = __webpack_require__(5112); + var regexpExec = __webpack_require__(2261); + var createNonEnumerableProperty = __webpack_require__(8880); + + var SPECIES = wellKnownSymbol('species'); + + var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { + // #replace needs built-in support for named groups. + // #match works fine because it just return the exec results, even if it has + // a "grops" property. + var re = /./; + re.exec = function () { + var result = []; + result.groups = { a: '7' }; + return result; + }; + return ''.replace(re, '$') !== '7'; + }); + +// IE <= 11 replaces $0 with the whole match, as if it was $& +// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 + var REPLACE_KEEPS_$0 = (function () { + return 'a'.replace(/./, '$0') === '$0'; + })(); + + var REPLACE = wellKnownSymbol('replace'); +// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string + var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { + if (/./[REPLACE]) { + return /./[REPLACE]('a', '$0') === ''; + } + return false; + })(); + +// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec +// Weex JS has frozen built-in prototypes, so use try / catch wrapper + var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { + // eslint-disable-next-line regexp/no-empty-group -- required for testing + var re = /(?:)/; + var originalExec = re.exec; + re.exec = function () { return originalExec.apply(this, arguments); }; + var result = 'ab'.split(re); + return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; + }); + + module.exports = function (KEY, length, exec, sham) { + var SYMBOL = wellKnownSymbol(KEY); + + var DELEGATES_TO_SYMBOL = !fails(function () { + // String methods call symbol-named RegEp methods + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + }); + + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { + // Symbol-named RegExp methods call .exec + var execCalled = false; + var re = /a/; + + if (KEY === 'split') { + // We can't use real regex here since it causes deoptimization + // and serious performance degradation in V8 + // https://github.com/zloirock/core-js/issues/306 + re = {}; + // RegExp[@@split] doesn't call the regex's exec method, but first creates + // a new one. We need to return the patched regex when creating the new one. + re.constructor = {}; + re.constructor[SPECIES] = function () { return re; }; + re.flags = ''; + re[SYMBOL] = /./[SYMBOL]; + } + + re.exec = function () { execCalled = true; return null; }; + + re[SYMBOL](''); + return !execCalled; + }); + + if ( + !DELEGATES_TO_SYMBOL || + !DELEGATES_TO_EXEC || + (KEY === 'replace' && !( + REPLACE_SUPPORTS_NAMED_GROUPS && + REPLACE_KEEPS_$0 && + !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE + )) || + (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) + ) { + var nativeRegExpMethod = /./[SYMBOL]; + var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { + if (regexp.exec === regexpExec) { + if (DELEGATES_TO_SYMBOL && !forceStringMethod) { + // The native String method already delegates to @@method (this + // polyfilled function), leasing to infinite recursion. + // We avoid it by directly calling the native @@method method. + return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; + } + return { done: true, value: nativeMethod.call(str, regexp, arg2) }; + } + return { done: false }; + }, { + REPLACE_KEEPS_$0: REPLACE_KEEPS_$0, + REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE + }); + var stringMethod = methods[0]; + var regexMethod = methods[1]; + + redefine(String.prototype, KEY, stringMethod); + redefine(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return regexMethod.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return regexMethod.call(string, this); } + ); + } + + if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true); + }; + + + /***/ }), + + /***/ 9974: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var aFunction = __webpack_require__(3099); + +// optional / simple context binding + module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 0: return function () { + return fn.call(that); + }; + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; + }; + + + /***/ }), + + /***/ 5005: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var path = __webpack_require__(857); + var global = __webpack_require__(7854); + + var aFunction = function (variable) { + return typeof variable == 'function' ? variable : undefined; + }; + + module.exports = function (namespace, method) { + return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) + : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; + }; + + + /***/ }), + + /***/ 1246: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var classof = __webpack_require__(648); + var Iterators = __webpack_require__(7497); + var wellKnownSymbol = __webpack_require__(5112); + + var ITERATOR = wellKnownSymbol('iterator'); + + module.exports = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; + }; + + + /***/ }), + + /***/ 8554: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var anObject = __webpack_require__(9670); + var getIteratorMethod = __webpack_require__(1246); + + module.exports = function (it) { + var iteratorMethod = getIteratorMethod(it); + if (typeof iteratorMethod != 'function') { + throw TypeError(String(it) + ' is not iterable'); + } return anObject(iteratorMethod.call(it)); + }; + + + /***/ }), + + /***/ 647: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var toObject = __webpack_require__(7908); + + var floor = Math.floor; + var replace = ''.replace; + var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; + var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; + +// https://tc39.es/ecma262/#sec-getsubstitution + module.exports = function (matched, str, position, captures, namedCaptures, replacement) { + var tailPos = position + matched.length; + var m = captures.length; + var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; + if (namedCaptures !== undefined) { + namedCaptures = toObject(namedCaptures); + symbols = SUBSTITUTION_SYMBOLS; + } + return replace.call(replacement, symbols, function (match, ch) { + var capture; + switch (ch.charAt(0)) { + case '$': return '$'; + case '&': return matched; + case '`': return str.slice(0, position); + case "'": return str.slice(tailPos); + case '<': + capture = namedCaptures[ch.slice(1, -1)]; + break; + default: // \d\d? + var n = +ch; + if (n === 0) return match; + if (n > m) { + var f = floor(n / 10); + if (f === 0) return match; + if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); + return match; + } + capture = captures[n - 1]; + } + return capture === undefined ? '' : capture; + }); + }; + + + /***/ }), + + /***/ 7854: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var check = function (it) { + return it && it.Math == Math && it; + }; + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + module.exports = + /* global globalThis -- safe */ + check(typeof globalThis == 'object' && globalThis) || + check(typeof window == 'object' && window) || + check(typeof self == 'object' && self) || + check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) || + // eslint-disable-next-line no-new-func -- fallback + (function () { return this; })() || Function('return this')(); + + + /***/ }), + + /***/ 6656: + /***/ (function(module) { + + var hasOwnProperty = {}.hasOwnProperty; + + module.exports = function (it, key) { + return hasOwnProperty.call(it, key); + }; + + + /***/ }), + + /***/ 3501: + /***/ (function(module) { + + module.exports = {}; + + + /***/ }), + + /***/ 490: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var getBuiltIn = __webpack_require__(5005); + + module.exports = getBuiltIn('document', 'documentElement'); + + + /***/ }), + + /***/ 4664: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var DESCRIPTORS = __webpack_require__(9781); + var fails = __webpack_require__(7293); + var createElement = __webpack_require__(317); + +// Thank's IE8 for his funny defineProperty + module.exports = !DESCRIPTORS && !fails(function () { + return Object.defineProperty(createElement('div'), 'a', { + get: function () { return 7; } + }).a != 7; + }); + + + /***/ }), + + /***/ 1179: + /***/ (function(module) { + +// IEEE754 conversions based on https://github.com/feross/ieee754 + var abs = Math.abs; + var pow = Math.pow; + var floor = Math.floor; + var log = Math.log; + var LN2 = Math.LN2; + + var pack = function (number, mantissaLength, bytes) { + var buffer = new Array(bytes); + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; + var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; + var index = 0; + var exponent, mantissa, c; + number = abs(number); + // eslint-disable-next-line no-self-compare -- NaN check + if (number != number || number === Infinity) { + // eslint-disable-next-line no-self-compare -- NaN check + mantissa = number != number ? 1 : 0; + exponent = eMax; + } else { + exponent = floor(log(number) / LN2); + if (number * (c = pow(2, -exponent)) < 1) { + exponent--; + c *= 2; + } + if (exponent + eBias >= 1) { + number += rt / c; + } else { + number += rt * pow(2, 1 - eBias); + } + if (number * c >= 2) { + exponent++; + c /= 2; + } + if (exponent + eBias >= eMax) { + mantissa = 0; + exponent = eMax; + } else if (exponent + eBias >= 1) { + mantissa = (number * c - 1) * pow(2, mantissaLength); + exponent = exponent + eBias; + } else { + mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); + exponent = 0; + } + } + for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8); + exponent = exponent << mantissaLength | mantissa; + exponentLength += mantissaLength; + for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8); + buffer[--index] |= sign * 128; + return buffer; + }; + + var unpack = function (buffer, mantissaLength) { + var bytes = buffer.length; + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var nBits = exponentLength - 7; + var index = bytes - 1; + var sign = buffer[index--]; + var exponent = sign & 127; + var mantissa; + sign >>= 7; + for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8); + mantissa = exponent & (1 << -nBits) - 1; + exponent >>= -nBits; + nBits += mantissaLength; + for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8); + if (exponent === 0) { + exponent = 1 - eBias; + } else if (exponent === eMax) { + return mantissa ? NaN : sign ? -Infinity : Infinity; + } else { + mantissa = mantissa + pow(2, mantissaLength); + exponent = exponent - eBias; + } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); + }; + + module.exports = { + pack: pack, + unpack: unpack + }; + + + /***/ }), + + /***/ 8361: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var fails = __webpack_require__(7293); + var classof = __webpack_require__(4326); + + var split = ''.split; + +// fallback for non-array-like ES3 and non-enumerable old V8 strings + module.exports = fails(function () { + // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 + // eslint-disable-next-line no-prototype-builtins -- safe + return !Object('z').propertyIsEnumerable(0); + }) ? function (it) { + return classof(it) == 'String' ? split.call(it, '') : Object(it); + } : Object; + + + /***/ }), + + /***/ 9587: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var isObject = __webpack_require__(111); + var setPrototypeOf = __webpack_require__(7674); + +// makes subclassing work correct for wrapped built-ins + module.exports = function ($this, dummy, Wrapper) { + var NewTarget, NewTargetPrototype; + if ( + // it can work only with native `setPrototypeOf` + setPrototypeOf && + // we haven't completely correct pre-ES6 way for getting `new.target`, so use this + typeof (NewTarget = dummy.constructor) == 'function' && + NewTarget !== Wrapper && + isObject(NewTargetPrototype = NewTarget.prototype) && + NewTargetPrototype !== Wrapper.prototype + ) setPrototypeOf($this, NewTargetPrototype); + return $this; + }; + + + /***/ }), + + /***/ 2788: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var store = __webpack_require__(5465); + + var functionToString = Function.toString; + +// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper + if (typeof store.inspectSource != 'function') { + store.inspectSource = function (it) { + return functionToString.call(it); + }; + } + + module.exports = store.inspectSource; + + + /***/ }), + + /***/ 9909: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var NATIVE_WEAK_MAP = __webpack_require__(8536); + var global = __webpack_require__(7854); + var isObject = __webpack_require__(111); + var createNonEnumerableProperty = __webpack_require__(8880); + var objectHas = __webpack_require__(6656); + var shared = __webpack_require__(5465); + var sharedKey = __webpack_require__(6200); + var hiddenKeys = __webpack_require__(3501); + + var WeakMap = global.WeakMap; + var set, get, has; + + var enforce = function (it) { + return has(it) ? get(it) : set(it, {}); + }; + + var getterFor = function (TYPE) { + return function (it) { + var state; + if (!isObject(it) || (state = get(it)).type !== TYPE) { + throw TypeError('Incompatible receiver, ' + TYPE + ' required'); + } return state; + }; + }; + + if (NATIVE_WEAK_MAP) { + var store = shared.state || (shared.state = new WeakMap()); + var wmget = store.get; + var wmhas = store.has; + var wmset = store.set; + set = function (it, metadata) { + metadata.facade = it; + wmset.call(store, it, metadata); + return metadata; + }; + get = function (it) { + return wmget.call(store, it) || {}; + }; + has = function (it) { + return wmhas.call(store, it); + }; + } else { + var STATE = sharedKey('state'); + hiddenKeys[STATE] = true; + set = function (it, metadata) { + metadata.facade = it; + createNonEnumerableProperty(it, STATE, metadata); + return metadata; + }; + get = function (it) { + return objectHas(it, STATE) ? it[STATE] : {}; + }; + has = function (it) { + return objectHas(it, STATE); + }; + } + + module.exports = { + set: set, + get: get, + has: has, + enforce: enforce, + getterFor: getterFor + }; + + + /***/ }), + + /***/ 7659: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var wellKnownSymbol = __webpack_require__(5112); + var Iterators = __webpack_require__(7497); + + var ITERATOR = wellKnownSymbol('iterator'); + var ArrayPrototype = Array.prototype; + +// check on default Array iterator + module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); + }; + + + /***/ }), + + /***/ 3157: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var classof = __webpack_require__(4326); + +// `IsArray` abstract operation +// https://tc39.es/ecma262/#sec-isarray + module.exports = Array.isArray || function isArray(arg) { + return classof(arg) == 'Array'; + }; + + + /***/ }), + + /***/ 4705: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var fails = __webpack_require__(7293); + + var replacement = /#|\.prototype\./; + + var isForced = function (feature, detection) { + var value = data[normalize(feature)]; + return value == POLYFILL ? true + : value == NATIVE ? false + : typeof detection == 'function' ? fails(detection) + : !!detection; + }; + + var normalize = isForced.normalize = function (string) { + return String(string).replace(replacement, '.').toLowerCase(); + }; + + var data = isForced.data = {}; + var NATIVE = isForced.NATIVE = 'N'; + var POLYFILL = isForced.POLYFILL = 'P'; + + module.exports = isForced; + + + /***/ }), + + /***/ 111: + /***/ (function(module) { + + module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + + + /***/ }), + + /***/ 1913: + /***/ (function(module) { + + module.exports = false; + + + /***/ }), + + /***/ 7850: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var isObject = __webpack_require__(111); + var classof = __webpack_require__(4326); + var wellKnownSymbol = __webpack_require__(5112); + + var MATCH = wellKnownSymbol('match'); + +// `IsRegExp` abstract operation +// https://tc39.es/ecma262/#sec-isregexp + module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp'); + }; + + + /***/ }), + + /***/ 9212: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var anObject = __webpack_require__(9670); + + module.exports = function (iterator) { + var returnMethod = iterator['return']; + if (returnMethod !== undefined) { + return anObject(returnMethod.call(iterator)).value; + } + }; + + + /***/ }), + + /***/ 3383: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var fails = __webpack_require__(7293); + var getPrototypeOf = __webpack_require__(9518); + var createNonEnumerableProperty = __webpack_require__(8880); + var has = __webpack_require__(6656); + var wellKnownSymbol = __webpack_require__(5112); + var IS_PURE = __webpack_require__(1913); + + var ITERATOR = wellKnownSymbol('iterator'); + var BUGGY_SAFARI_ITERATORS = false; + + var returnThis = function () { return this; }; + +// `%IteratorPrototype%` object +// https://tc39.es/ecma262/#sec-%iteratorprototype%-object + var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; + + if ([].keys) { + arrayIterator = [].keys(); + // Safari 8 has buggy iterators w/o `next` + if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; + else { + PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); + if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; + } + } + + var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () { + var test = {}; + // FF44- legacy iterators case + return IteratorPrototype[ITERATOR].call(test) !== test; + }); + + if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + if ((!IS_PURE || NEW_ITERATOR_PROTOTYPE) && !has(IteratorPrototype, ITERATOR)) { + createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis); + } + + module.exports = { + IteratorPrototype: IteratorPrototype, + BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS + }; + + + /***/ }), + + /***/ 7497: + /***/ (function(module) { + + module.exports = {}; + + + /***/ }), + + /***/ 133: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var fails = __webpack_require__(7293); + + module.exports = !!Object.getOwnPropertySymbols && !fails(function () { + // Chrome 38 Symbol has incorrect toString conversion + /* global Symbol -- required for testing */ + return !String(Symbol()); + }); + + + /***/ }), + + /***/ 590: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var fails = __webpack_require__(7293); + var wellKnownSymbol = __webpack_require__(5112); + var IS_PURE = __webpack_require__(1913); + + var ITERATOR = wellKnownSymbol('iterator'); + + module.exports = !fails(function () { + var url = new URL('b?a=1&b=2&c=3', 'http://a'); + var searchParams = url.searchParams; + var result = ''; + url.pathname = 'c%20d'; + searchParams.forEach(function (value, key) { + searchParams['delete']('b'); + result += key + value; + }); + return (IS_PURE && !url.toJSON) + || !searchParams.sort + || url.href !== 'http://a/c%20d?a=1&c=3' + || searchParams.get('c') !== '3' + || String(new URLSearchParams('?a=1')) !== 'a=1' + || !searchParams[ITERATOR] + // throws in Edge + || new URL('https://a@b').username !== 'a' + || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' + // not punycoded in Edge + || new URL('http://тест').host !== 'xn--e1aybc' + // not escaped in Chrome 62- + || new URL('http://a#б').hash !== '#%D0%B1' + // fails in Chrome 66- + || result !== 'a1c3' + // throws in Safari + || new URL('http://x', undefined).host !== 'x'; + }); + + + /***/ }), + + /***/ 8536: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + var inspectSource = __webpack_require__(2788); + + var WeakMap = global.WeakMap; + + module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); + + + /***/ }), + + /***/ 1574: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var DESCRIPTORS = __webpack_require__(9781); + var fails = __webpack_require__(7293); + var objectKeys = __webpack_require__(1956); + var getOwnPropertySymbolsModule = __webpack_require__(5181); + var propertyIsEnumerableModule = __webpack_require__(5296); + var toObject = __webpack_require__(7908); + var IndexedObject = __webpack_require__(8361); + + var nativeAssign = Object.assign; + var defineProperty = Object.defineProperty; + +// `Object.assign` method +// https://tc39.es/ecma262/#sec-object.assign + module.exports = !nativeAssign || fails(function () { + // should have correct order of operations (Edge bug) + if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', { + enumerable: true, + get: function () { + defineProperty(this, 'b', { + value: 3, + enumerable: false + }); + } + }), { b: 2 })).b !== 1) return true; + // should work with symbols and should have deterministic property order (V8 bug) + var A = {}; + var B = {}; + /* global Symbol -- required for testing */ + var symbol = Symbol(); + var alphabet = 'abcdefghijklmnopqrst'; + A[symbol] = 7; + alphabet.split('').forEach(function (chr) { B[chr] = chr; }); + return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; + }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` + var T = toObject(target); + var argumentsLength = arguments.length; + var index = 1; + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + var propertyIsEnumerable = propertyIsEnumerableModule.f; + while (argumentsLength > index) { + var S = IndexedObject(arguments[index++]); + var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) { + key = keys[j++]; + if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key]; + } + } return T; + } : nativeAssign; + + + /***/ }), + + /***/ 30: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var anObject = __webpack_require__(9670); + var defineProperties = __webpack_require__(6048); + var enumBugKeys = __webpack_require__(748); + var hiddenKeys = __webpack_require__(3501); + var html = __webpack_require__(490); + var documentCreateElement = __webpack_require__(317); + var sharedKey = __webpack_require__(6200); + + var GT = '>'; + var LT = '<'; + var PROTOTYPE = 'prototype'; + var SCRIPT = 'script'; + var IE_PROTO = sharedKey('IE_PROTO'); + + var EmptyConstructor = function () { /* empty */ }; + + var scriptTag = function (content) { + return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; + }; + +// Create object with fake `null` prototype: use ActiveX Object with cleared prototype + var NullProtoObjectViaActiveX = function (activeXDocument) { + activeXDocument.write(scriptTag('')); + activeXDocument.close(); + var temp = activeXDocument.parentWindow.Object; + activeXDocument = null; // avoid memory leak + return temp; + }; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype + var NullProtoObjectViaIFrame = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = documentCreateElement('iframe'); + var JS = 'java' + SCRIPT + ':'; + var iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + // https://github.com/zloirock/core-js/issues/475 + iframe.src = String(JS); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(scriptTag('document.F=Object')); + iframeDocument.close(); + return iframeDocument.F; + }; + +// Check for document.domain and active x support +// No need to use active x approach when document.domain is not set +// see https://github.com/es-shims/es5-shim/issues/150 +// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 +// avoid IE GC bug + var activeXDocument; + var NullProtoObject = function () { + try { + /* global ActiveXObject -- old IE */ + activeXDocument = document.domain && new ActiveXObject('htmlfile'); + } catch (error) { /* ignore */ } + NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); + var length = enumBugKeys.length; + while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; + return NullProtoObject(); + }; + + hiddenKeys[IE_PROTO] = true; + +// `Object.create` method +// https://tc39.es/ecma262/#sec-object.create + module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + EmptyConstructor[PROTOTYPE] = anObject(O); + result = new EmptyConstructor(); + EmptyConstructor[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = NullProtoObject(); + return Properties === undefined ? result : defineProperties(result, Properties); + }; + + + /***/ }), + + /***/ 6048: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var DESCRIPTORS = __webpack_require__(9781); + var definePropertyModule = __webpack_require__(3070); + var anObject = __webpack_require__(9670); + var objectKeys = __webpack_require__(1956); + +// `Object.defineProperties` method +// https://tc39.es/ecma262/#sec-object.defineproperties + module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = objectKeys(Properties); + var length = keys.length; + var index = 0; + var key; + while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); + return O; + }; + + + /***/ }), + + /***/ 3070: + /***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + var DESCRIPTORS = __webpack_require__(9781); + var IE8_DOM_DEFINE = __webpack_require__(4664); + var anObject = __webpack_require__(9670); + var toPrimitive = __webpack_require__(7593); + + var nativeDefineProperty = Object.defineProperty; + +// `Object.defineProperty` method +// https://tc39.es/ecma262/#sec-object.defineproperty + exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return nativeDefineProperty(O, P, Attributes); + } catch (error) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; + }; + + + /***/ }), + + /***/ 1236: + /***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + var DESCRIPTORS = __webpack_require__(9781); + var propertyIsEnumerableModule = __webpack_require__(5296); + var createPropertyDescriptor = __webpack_require__(9114); + var toIndexedObject = __webpack_require__(5656); + var toPrimitive = __webpack_require__(7593); + var has = __webpack_require__(6656); + var IE8_DOM_DEFINE = __webpack_require__(4664); + + var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// `Object.getOwnPropertyDescriptor` method +// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor + exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { + O = toIndexedObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return nativeGetOwnPropertyDescriptor(O, P); + } catch (error) { /* empty */ } + if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); + }; + + + /***/ }), + + /***/ 8006: + /***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + var internalObjectKeys = __webpack_require__(6324); + var enumBugKeys = __webpack_require__(748); + + var hiddenKeys = enumBugKeys.concat('length', 'prototype'); + +// `Object.getOwnPropertyNames` method +// https://tc39.es/ecma262/#sec-object.getownpropertynames + exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return internalObjectKeys(O, hiddenKeys); + }; + + + /***/ }), + + /***/ 5181: + /***/ (function(__unused_webpack_module, exports) { + + exports.f = Object.getOwnPropertySymbols; + + + /***/ }), + + /***/ 9518: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var has = __webpack_require__(6656); + var toObject = __webpack_require__(7908); + var sharedKey = __webpack_require__(6200); + var CORRECT_PROTOTYPE_GETTER = __webpack_require__(8544); + + var IE_PROTO = sharedKey('IE_PROTO'); + var ObjectPrototype = Object.prototype; + +// `Object.getPrototypeOf` method +// https://tc39.es/ecma262/#sec-object.getprototypeof + module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectPrototype : null; + }; + + + /***/ }), + + /***/ 6324: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var has = __webpack_require__(6656); + var toIndexedObject = __webpack_require__(5656); + var indexOf = __webpack_require__(1318).indexOf; + var hiddenKeys = __webpack_require__(3501); + + module.exports = function (object, names) { + var O = toIndexedObject(object); + var i = 0; + var result = []; + var key; + for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~indexOf(result, key) || result.push(key); + } + return result; + }; + + + /***/ }), + + /***/ 1956: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var internalObjectKeys = __webpack_require__(6324); + var enumBugKeys = __webpack_require__(748); + +// `Object.keys` method +// https://tc39.es/ecma262/#sec-object.keys + module.exports = Object.keys || function keys(O) { + return internalObjectKeys(O, enumBugKeys); + }; + + + /***/ }), + + /***/ 5296: + /***/ (function(__unused_webpack_module, exports) { + + "use strict"; + + var nativePropertyIsEnumerable = {}.propertyIsEnumerable; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// Nashorn ~ JDK8 bug + var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); + +// `Object.prototype.propertyIsEnumerable` method implementation +// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable + exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { + var descriptor = getOwnPropertyDescriptor(this, V); + return !!descriptor && descriptor.enumerable; + } : nativePropertyIsEnumerable; + + + /***/ }), + + /***/ 7674: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + /* eslint-disable no-proto -- safe */ + var anObject = __webpack_require__(9670); + var aPossiblePrototype = __webpack_require__(6077); + +// `Object.setPrototypeOf` method +// https://tc39.es/ecma262/#sec-object.setprototypeof +// Works with __proto__ only. Old v8 can't work with null proto objects. + module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { + var CORRECT_SETTER = false; + var test = {}; + var setter; + try { + setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; + setter.call(test, []); + CORRECT_SETTER = test instanceof Array; + } catch (error) { /* empty */ } + return function setPrototypeOf(O, proto) { + anObject(O); + aPossiblePrototype(proto); + if (CORRECT_SETTER) setter.call(O, proto); + else O.__proto__ = proto; + return O; + }; + }() : undefined); + + + /***/ }), + + /***/ 288: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var TO_STRING_TAG_SUPPORT = __webpack_require__(1694); + var classof = __webpack_require__(648); + +// `Object.prototype.toString` method implementation +// https://tc39.es/ecma262/#sec-object.prototype.tostring + module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { + return '[object ' + classof(this) + ']'; + }; + + + /***/ }), + + /***/ 3887: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var getBuiltIn = __webpack_require__(5005); + var getOwnPropertyNamesModule = __webpack_require__(8006); + var getOwnPropertySymbolsModule = __webpack_require__(5181); + var anObject = __webpack_require__(9670); + +// all object keys, includes non-enumerable and symbols + module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { + var keys = getOwnPropertyNamesModule.f(anObject(it)); + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; + }; + + + /***/ }), + + /***/ 857: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + + module.exports = global; + + + /***/ }), + + /***/ 2248: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var redefine = __webpack_require__(1320); + + module.exports = function (target, src, options) { + for (var key in src) redefine(target, key, src[key], options); + return target; + }; + + + /***/ }), + + /***/ 1320: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + var createNonEnumerableProperty = __webpack_require__(8880); + var has = __webpack_require__(6656); + var setGlobal = __webpack_require__(3505); + var inspectSource = __webpack_require__(2788); + var InternalStateModule = __webpack_require__(9909); + + var getInternalState = InternalStateModule.get; + var enforceInternalState = InternalStateModule.enforce; + var TEMPLATE = String(String).split('String'); + + (module.exports = function (O, key, value, options) { + var unsafe = options ? !!options.unsafe : false; + var simple = options ? !!options.enumerable : false; + var noTargetGet = options ? !!options.noTargetGet : false; + var state; + if (typeof value == 'function') { + if (typeof key == 'string' && !has(value, 'name')) { + createNonEnumerableProperty(value, 'name', key); + } + state = enforceInternalState(value); + if (!state.source) { + state.source = TEMPLATE.join(typeof key == 'string' ? key : ''); + } + } + if (O === global) { + if (simple) O[key] = value; + else setGlobal(key, value); + return; + } else if (!unsafe) { + delete O[key]; + } else if (!noTargetGet && O[key]) { + simple = true; + } + if (simple) O[key] = value; + else createNonEnumerableProperty(O, key, value); +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative + })(Function.prototype, 'toString', function toString() { + return typeof this == 'function' && getInternalState(this).source || inspectSource(this); + }); + + + /***/ }), + + /***/ 7651: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var classof = __webpack_require__(4326); + var regexpExec = __webpack_require__(2261); + +// `RegExpExec` abstract operation +// https://tc39.es/ecma262/#sec-regexpexec + module.exports = function (R, S) { + var exec = R.exec; + if (typeof exec === 'function') { + var result = exec.call(R, S); + if (typeof result !== 'object') { + throw TypeError('RegExp exec method returned something other than an Object or null'); + } + return result; + } + + if (classof(R) !== 'RegExp') { + throw TypeError('RegExp#exec called on incompatible receiver'); + } + + return regexpExec.call(R, S); + }; + + + + /***/ }), + + /***/ 2261: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var regexpFlags = __webpack_require__(7066); + var stickyHelpers = __webpack_require__(2999); + + var nativeExec = RegExp.prototype.exec; +// This always refers to the native implementation, because the +// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, +// which loads this file before patching the method. + var nativeReplace = String.prototype.replace; + + var patchedExec = nativeExec; + + var UPDATES_LAST_INDEX_WRONG = (function () { + var re1 = /a/; + var re2 = /b*/g; + nativeExec.call(re1, 'a'); + nativeExec.call(re2, 'a'); + return re1.lastIndex !== 0 || re2.lastIndex !== 0; + })(); + + var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET; + +// nonparticipating capturing group, copied from es5-shim's String#split patch. +// eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing + var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; + + var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y; + + if (PATCH) { + patchedExec = function exec(str) { + var re = this; + var lastIndex, reCopy, match, i; + var sticky = UNSUPPORTED_Y && re.sticky; + var flags = regexpFlags.call(re); + var source = re.source; + var charsAdded = 0; + var strCopy = str; + + if (sticky) { + flags = flags.replace('y', ''); + if (flags.indexOf('g') === -1) { + flags += 'g'; + } + + strCopy = String(str).slice(re.lastIndex); + // Support anchored sticky behavior. + if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) { + source = '(?: ' + source + ')'; + strCopy = ' ' + strCopy; + charsAdded++; + } + // ^(? + rx + ) is needed, in combination with some str slicing, to + // simulate the 'y' flag. + reCopy = new RegExp('^(?:' + source + ')', flags); + } + + if (NPCG_INCLUDED) { + reCopy = new RegExp('^' + source + '$(?!\\s)', flags); + } + if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; + + match = nativeExec.call(sticky ? reCopy : re, strCopy); + + if (sticky) { + if (match) { + match.input = match.input.slice(charsAdded); + match[0] = match[0].slice(charsAdded); + match.index = re.lastIndex; + re.lastIndex += match[0].length; + } else re.lastIndex = 0; + } else if (UPDATES_LAST_INDEX_WRONG && match) { + re.lastIndex = re.global ? match.index + match[0].length : lastIndex; + } + if (NPCG_INCLUDED && match && match.length > 1) { + // Fix browsers whose `exec` methods don't consistently return `undefined` + // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ + nativeReplace.call(match[0], reCopy, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; + } + }); + } + + return match; + }; + } + + module.exports = patchedExec; + + + /***/ }), + + /***/ 7066: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var anObject = __webpack_require__(9670); + +// `RegExp.prototype.flags` getter implementation +// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags + module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.dotAll) result += 's'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; + }; + + + /***/ }), + + /***/ 2999: + /***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + "use strict"; + + + var fails = __webpack_require__(7293); + +// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError, +// so we use an intermediate function. + function RE(s, f) { + return RegExp(s, f); + } + + exports.UNSUPPORTED_Y = fails(function () { + // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError + var re = RE('a', 'y'); + re.lastIndex = 2; + return re.exec('abcd') != null; + }); + + exports.BROKEN_CARET = fails(function () { + // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 + var re = RE('^r', 'gy'); + re.lastIndex = 2; + return re.exec('str') != null; + }); + + + /***/ }), + + /***/ 4488: + /***/ (function(module) { + +// `RequireObjectCoercible` abstract operation +// https://tc39.es/ecma262/#sec-requireobjectcoercible + module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; + }; + + + /***/ }), + + /***/ 3505: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + var createNonEnumerableProperty = __webpack_require__(8880); + + module.exports = function (key, value) { + try { + createNonEnumerableProperty(global, key, value); + } catch (error) { + global[key] = value; + } return value; + }; + + + /***/ }), + + /***/ 6340: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var getBuiltIn = __webpack_require__(5005); + var definePropertyModule = __webpack_require__(3070); + var wellKnownSymbol = __webpack_require__(5112); + var DESCRIPTORS = __webpack_require__(9781); + + var SPECIES = wellKnownSymbol('species'); + + module.exports = function (CONSTRUCTOR_NAME) { + var Constructor = getBuiltIn(CONSTRUCTOR_NAME); + var defineProperty = definePropertyModule.f; + + if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { + defineProperty(Constructor, SPECIES, { + configurable: true, + get: function () { return this; } + }); + } + }; + + + /***/ }), + + /***/ 8003: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var defineProperty = __webpack_require__(3070).f; + var has = __webpack_require__(6656); + var wellKnownSymbol = __webpack_require__(5112); + + var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + + module.exports = function (it, TAG, STATIC) { + if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { + defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); + } + }; + + + /***/ }), + + /***/ 6200: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var shared = __webpack_require__(2309); + var uid = __webpack_require__(9711); + + var keys = shared('keys'); + + module.exports = function (key) { + return keys[key] || (keys[key] = uid(key)); + }; + + + /***/ }), + + /***/ 5465: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + var setGlobal = __webpack_require__(3505); + + var SHARED = '__core-js_shared__'; + var store = global[SHARED] || setGlobal(SHARED, {}); + + module.exports = store; + + + /***/ }), + + /***/ 2309: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var IS_PURE = __webpack_require__(1913); + var store = __webpack_require__(5465); + + (module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); + })('versions', []).push({ + version: '3.9.0', + mode: IS_PURE ? 'pure' : 'global', + copyright: '© 2021 Denis Pushkarev (zloirock.ru)' + }); + + + /***/ }), + + /***/ 6707: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var anObject = __webpack_require__(9670); + var aFunction = __webpack_require__(3099); + var wellKnownSymbol = __webpack_require__(5112); + + var SPECIES = wellKnownSymbol('species'); + +// `SpeciesConstructor` abstract operation +// https://tc39.es/ecma262/#sec-speciesconstructor + module.exports = function (O, defaultConstructor) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S); + }; + + + /***/ }), + + /***/ 8710: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var toInteger = __webpack_require__(9958); + var requireObjectCoercible = __webpack_require__(4488); + +// `String.prototype.{ codePointAt, at }` methods implementation + var createMethod = function (CONVERT_TO_STRING) { + return function ($this, pos) { + var S = String(requireObjectCoercible($this)); + var position = toInteger(pos); + var size = S.length; + var first, second; + if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; + first = S.charCodeAt(position); + return first < 0xD800 || first > 0xDBFF || position + 1 === size + || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF + ? CONVERT_TO_STRING ? S.charAt(position) : first + : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; + }; + }; + + module.exports = { + // `String.prototype.codePointAt` method + // https://tc39.es/ecma262/#sec-string.prototype.codepointat + codeAt: createMethod(false), + // `String.prototype.at` method + // https://github.com/mathiasbynens/String.prototype.at + charAt: createMethod(true) + }; + + + /***/ }), + + /***/ 3197: + /***/ (function(module) { + + "use strict"; + +// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js + var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + var base = 36; + var tMin = 1; + var tMax = 26; + var skew = 38; + var damp = 700; + var initialBias = 72; + var initialN = 128; // 0x80 + var delimiter = '-'; // '\x2D' + var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars + var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process'; + var baseMinusTMin = base - tMin; + var floor = Math.floor; + var stringFromCharCode = String.fromCharCode; + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + */ + var ucs2decode = function (string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + }; + + /** + * Converts a digit/integer into a basic code point. + */ + var digitToBasic = function (digit) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26); + }; + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + */ + var adapt = function (delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + }; + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + */ +// eslint-disable-next-line max-statements -- TODO + var encode = function (input) { + var output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + var inputLength = input.length; + + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + var i, currentValue; + + // Handle the basic code points. + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + var basicLength = output.length; // number of basic code points. + var handledCPCount = basicLength; // number of code points that have been handled; + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + // All non-basic code points < n have been handled already. Find the next larger one: + var m = maxInt; + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , but guard against overflow. + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + throw RangeError(OVERFLOW_ERROR); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue < n && ++delta > maxInt) { + throw RangeError(OVERFLOW_ERROR); + } + if (currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base; /* no condition */; k += base) { + var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) break; + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + } + return output.join(''); + }; + + module.exports = function (input) { + var encoded = []; + var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.'); + var i, label; + for (i = 0; i < labels.length; i++) { + label = labels[i]; + encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label); + } + return encoded.join('.'); + }; + + + /***/ }), + + /***/ 6091: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var fails = __webpack_require__(7293); + var whitespaces = __webpack_require__(1361); + + var non = '\u200B\u0085\u180E'; + +// check that a method works with the correct list +// of whitespaces and has a correct name + module.exports = function (METHOD_NAME) { + return fails(function () { + return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME; + }); + }; + + + /***/ }), + + /***/ 3111: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var requireObjectCoercible = __webpack_require__(4488); + var whitespaces = __webpack_require__(1361); + + var whitespace = '[' + whitespaces + ']'; + var ltrim = RegExp('^' + whitespace + whitespace + '*'); + var rtrim = RegExp(whitespace + whitespace + '*$'); + +// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation + var createMethod = function (TYPE) { + return function ($this) { + var string = String(requireObjectCoercible($this)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; + }; + }; + + module.exports = { + // `String.prototype.{ trimLeft, trimStart }` methods + // https://tc39.es/ecma262/#sec-string.prototype.trimstart + start: createMethod(1), + // `String.prototype.{ trimRight, trimEnd }` methods + // https://tc39.es/ecma262/#sec-string.prototype.trimend + end: createMethod(2), + // `String.prototype.trim` method + // https://tc39.es/ecma262/#sec-string.prototype.trim + trim: createMethod(3) + }; + + + /***/ }), + + /***/ 1400: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var toInteger = __webpack_require__(9958); + + var max = Math.max; + var min = Math.min; + +// Helper for a popular repeating case of the spec: +// Let integer be ? ToInteger(index). +// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). + module.exports = function (index, length) { + var integer = toInteger(index); + return integer < 0 ? max(integer + length, 0) : min(integer, length); + }; + + + /***/ }), + + /***/ 7067: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var toInteger = __webpack_require__(9958); + var toLength = __webpack_require__(7466); + +// `ToIndex` abstract operation +// https://tc39.es/ecma262/#sec-toindex + module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length or index'); + return length; + }; + + + /***/ }), + + /***/ 5656: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// toObject with fallback for non-array-like ES3 strings + var IndexedObject = __webpack_require__(8361); + var requireObjectCoercible = __webpack_require__(4488); + + module.exports = function (it) { + return IndexedObject(requireObjectCoercible(it)); + }; + + + /***/ }), + + /***/ 9958: + /***/ (function(module) { + + var ceil = Math.ceil; + var floor = Math.floor; + +// `ToInteger` abstract operation +// https://tc39.es/ecma262/#sec-tointeger + module.exports = function (argument) { + return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); + }; + + + /***/ }), + + /***/ 7466: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var toInteger = __webpack_require__(9958); + + var min = Math.min; + +// `ToLength` abstract operation +// https://tc39.es/ecma262/#sec-tolength + module.exports = function (argument) { + return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 + }; + + + /***/ }), + + /***/ 7908: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var requireObjectCoercible = __webpack_require__(4488); + +// `ToObject` abstract operation +// https://tc39.es/ecma262/#sec-toobject + module.exports = function (argument) { + return Object(requireObjectCoercible(argument)); + }; + + + /***/ }), + + /***/ 4590: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var toPositiveInteger = __webpack_require__(3002); + + module.exports = function (it, BYTES) { + var offset = toPositiveInteger(it); + if (offset % BYTES) throw RangeError('Wrong offset'); + return offset; + }; + + + /***/ }), + + /***/ 3002: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var toInteger = __webpack_require__(9958); + + module.exports = function (it) { + var result = toInteger(it); + if (result < 0) throw RangeError("The argument can't be less than 0"); + return result; + }; + + + /***/ }), + + /***/ 7593: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var isObject = __webpack_require__(111); + +// `ToPrimitive` abstract operation +// https://tc39.es/ecma262/#sec-toprimitive +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string + module.exports = function (input, PREFERRED_STRING) { + if (!isObject(input)) return input; + var fn, val; + if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; + if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; + if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; + throw TypeError("Can't convert object to primitive value"); + }; + + + /***/ }), + + /***/ 1694: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var wellKnownSymbol = __webpack_require__(5112); + + var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + var test = {}; + + test[TO_STRING_TAG] = 'z'; + + module.exports = String(test) === '[object z]'; + + + /***/ }), + + /***/ 9843: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var global = __webpack_require__(7854); + var DESCRIPTORS = __webpack_require__(9781); + var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(3832); + var ArrayBufferViewCore = __webpack_require__(260); + var ArrayBufferModule = __webpack_require__(3331); + var anInstance = __webpack_require__(5787); + var createPropertyDescriptor = __webpack_require__(9114); + var createNonEnumerableProperty = __webpack_require__(8880); + var toLength = __webpack_require__(7466); + var toIndex = __webpack_require__(7067); + var toOffset = __webpack_require__(4590); + var toPrimitive = __webpack_require__(7593); + var has = __webpack_require__(6656); + var classof = __webpack_require__(648); + var isObject = __webpack_require__(111); + var create = __webpack_require__(30); + var setPrototypeOf = __webpack_require__(7674); + var getOwnPropertyNames = __webpack_require__(8006).f; + var typedArrayFrom = __webpack_require__(7321); + var forEach = __webpack_require__(2092).forEach; + var setSpecies = __webpack_require__(6340); + var definePropertyModule = __webpack_require__(3070); + var getOwnPropertyDescriptorModule = __webpack_require__(1236); + var InternalStateModule = __webpack_require__(9909); + var inheritIfRequired = __webpack_require__(9587); + + var getInternalState = InternalStateModule.get; + var setInternalState = InternalStateModule.set; + var nativeDefineProperty = definePropertyModule.f; + var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + var round = Math.round; + var RangeError = global.RangeError; + var ArrayBuffer = ArrayBufferModule.ArrayBuffer; + var DataView = ArrayBufferModule.DataView; + var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; + var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG; + var TypedArray = ArrayBufferViewCore.TypedArray; + var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype; + var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; + var isTypedArray = ArrayBufferViewCore.isTypedArray; + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; + var WRONG_LENGTH = 'Wrong length'; + + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C))(length); + while (length > index) result[index] = list[index++]; + return result; + }; + + var addGetter = function (it, key) { + nativeDefineProperty(it, key, { get: function () { + return getInternalState(this)[key]; + } }); + }; + + var isArrayBuffer = function (it) { + var klass; + return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer'; + }; + + var isTypedArrayIndex = function (target, key) { + return isTypedArray(target) + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + + var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { + return isTypedArrayIndex(target, key = toPrimitive(key, true)) + ? createPropertyDescriptor(2, target[key]) + : nativeGetOwnPropertyDescriptor(target, key); + }; + + var wrappedDefineProperty = function defineProperty(target, key, descriptor) { + if (isTypedArrayIndex(target, key = toPrimitive(key, true)) + && isObject(descriptor) + && has(descriptor, 'value') + && !has(descriptor, 'get') + && !has(descriptor, 'set') + // TODO: add validation descriptor w/o calling accessors + && !descriptor.configurable + && (!has(descriptor, 'writable') || descriptor.writable) + && (!has(descriptor, 'enumerable') || descriptor.enumerable) + ) { + target[key] = descriptor.value; + return target; + } return nativeDefineProperty(target, key, descriptor); + }; + + if (DESCRIPTORS) { + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; + definePropertyModule.f = wrappedDefineProperty; + addGetter(TypedArrayPrototype, 'buffer'); + addGetter(TypedArrayPrototype, 'byteOffset'); + addGetter(TypedArrayPrototype, 'byteLength'); + addGetter(TypedArrayPrototype, 'length'); + } + + $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { + getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, + defineProperty: wrappedDefineProperty + }); + + module.exports = function (TYPE, wrapper, CLAMPED) { + var BYTES = TYPE.match(/\d+$/)[0] / 8; + var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + TYPE; + var SETTER = 'set' + TYPE; + var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME]; + var TypedArrayConstructor = NativeTypedArrayConstructor; + var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; + var exported = {}; + + var getter = function (that, index) { + var data = getInternalState(that); + return data.view[GETTER](index * BYTES + data.byteOffset, true); + }; + + var setter = function (that, index, value) { + var data = getInternalState(that); + if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF; + data.view[SETTER](index * BYTES + data.byteOffset, value, true); + }; + + var addElement = function (that, index) { + nativeDefineProperty(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + TypedArrayConstructor = wrapper(function (that, data, offset, $length) { + anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME); + var index = 0; + var byteOffset = 0; + var buffer, byteLength, length; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new ArrayBuffer(byteLength); + } else if (isArrayBuffer(data)) { + buffer = data; + byteOffset = toOffset(offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - byteOffset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (isTypedArray(data)) { + return fromList(TypedArrayConstructor, data); + } else { + return typedArrayFrom.call(TypedArrayConstructor, data); + } + setInternalState(that, { + buffer: buffer, + byteOffset: byteOffset, + byteLength: byteLength, + length: length, + view: new DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + + if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); + TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype); + } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { + TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { + anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME); + return inheritIfRequired(function () { + if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data)); + if (isArrayBuffer(data)) return $length !== undefined + ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) + : typedArrayOffset !== undefined + ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) + : new NativeTypedArrayConstructor(data); + if (isTypedArray(data)) return fromList(TypedArrayConstructor, data); + return typedArrayFrom.call(TypedArrayConstructor, data); + }(), dummy, TypedArrayConstructor); + }); + + if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); + forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) { + if (!(key in TypedArrayConstructor)) { + createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]); + } + }); + TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; + } + + if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); + } + + if (TYPED_ARRAY_TAG) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); + } + + exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; + + $({ + global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS + }, exported); + + if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { + createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); + } + + if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); + } + + setSpecies(CONSTRUCTOR_NAME); + }; + } else module.exports = function () { /* empty */ }; + + + /***/ }), + + /***/ 3832: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + /* eslint-disable no-new -- required for testing */ + var global = __webpack_require__(7854); + var fails = __webpack_require__(7293); + var checkCorrectnessOfIteration = __webpack_require__(7072); + var NATIVE_ARRAY_BUFFER_VIEWS = __webpack_require__(260).NATIVE_ARRAY_BUFFER_VIEWS; + + var ArrayBuffer = global.ArrayBuffer; + var Int8Array = global.Int8Array; + + module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { + Int8Array(1); + }) || !fails(function () { + new Int8Array(-1); + }) || !checkCorrectnessOfIteration(function (iterable) { + new Int8Array(); + new Int8Array(null); + new Int8Array(1.5); + new Int8Array(iterable); + }, true) || fails(function () { + // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill + return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1; + }); + + + /***/ }), + + /***/ 3074: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var aTypedArrayConstructor = __webpack_require__(260).aTypedArrayConstructor; + var speciesConstructor = __webpack_require__(6707); + + module.exports = function (instance, list) { + var C = speciesConstructor(instance, instance.constructor); + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C))(length); + while (length > index) result[index] = list[index++]; + return result; + }; + + + /***/ }), + + /***/ 7321: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var toObject = __webpack_require__(7908); + var toLength = __webpack_require__(7466); + var getIteratorMethod = __webpack_require__(1246); + var isArrayIteratorMethod = __webpack_require__(7659); + var bind = __webpack_require__(9974); + var aTypedArrayConstructor = __webpack_require__(260).aTypedArrayConstructor; + + module.exports = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iteratorMethod = getIteratorMethod(O); + var i, length, result, step, iterator, next; + if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) { + iterator = iteratorMethod.call(O); + next = iterator.next; + O = []; + while (!(step = next.call(iterator)).done) { + O.push(step.value); + } + } + if (mapping && argumentsLength > 2) { + mapfn = bind(mapfn, arguments[2], 2); + } + length = toLength(O.length); + result = new (aTypedArrayConstructor(this))(length); + for (i = 0; length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + + /***/ }), + + /***/ 9711: + /***/ (function(module) { + + var id = 0; + var postfix = Math.random(); + + module.exports = function (key) { + return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); + }; + + + /***/ }), + + /***/ 3307: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var NATIVE_SYMBOL = __webpack_require__(133); + + module.exports = NATIVE_SYMBOL + /* global Symbol -- safe */ + && !Symbol.sham + && typeof Symbol.iterator == 'symbol'; + + + /***/ }), + + /***/ 5112: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + var shared = __webpack_require__(2309); + var has = __webpack_require__(6656); + var uid = __webpack_require__(9711); + var NATIVE_SYMBOL = __webpack_require__(133); + var USE_SYMBOL_AS_UID = __webpack_require__(3307); + + var WellKnownSymbolsStore = shared('wks'); + var Symbol = global.Symbol; + var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; + + module.exports = function (name) { + if (!has(WellKnownSymbolsStore, name)) { + if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name]; + else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); + } return WellKnownSymbolsStore[name]; + }; + + + /***/ }), + + /***/ 1361: + /***/ (function(module) { + +// a string of all valid unicode whitespaces + module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + + + /***/ }), + + /***/ 8264: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var global = __webpack_require__(7854); + var arrayBufferModule = __webpack_require__(3331); + var setSpecies = __webpack_require__(6340); + + var ARRAY_BUFFER = 'ArrayBuffer'; + var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER]; + var NativeArrayBuffer = global[ARRAY_BUFFER]; + +// `ArrayBuffer` constructor +// https://tc39.es/ecma262/#sec-arraybuffer-constructor + $({ global: true, forced: NativeArrayBuffer !== ArrayBuffer }, { + ArrayBuffer: ArrayBuffer + }); + + setSpecies(ARRAY_BUFFER); + + + /***/ }), + + /***/ 2222: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var fails = __webpack_require__(7293); + var isArray = __webpack_require__(3157); + var isObject = __webpack_require__(111); + var toObject = __webpack_require__(7908); + var toLength = __webpack_require__(7466); + var createProperty = __webpack_require__(6135); + var arraySpeciesCreate = __webpack_require__(5417); + var arrayMethodHasSpeciesSupport = __webpack_require__(1194); + var wellKnownSymbol = __webpack_require__(5112); + var V8_VERSION = __webpack_require__(7392); + + var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); + var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; + var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; + +// We can't use this feature detection in V8 since it causes +// deoptimization and serious performance degradation +// https://github.com/zloirock/core-js/issues/679 + var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { + var array = []; + array[IS_CONCAT_SPREADABLE] = false; + return array.concat()[0] !== array; + }); + + var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); + + var isConcatSpreadable = function (O) { + if (!isObject(O)) return false; + var spreadable = O[IS_CONCAT_SPREADABLE]; + return spreadable !== undefined ? !!spreadable : isArray(O); + }; + + var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; + +// `Array.prototype.concat` method +// https://tc39.es/ecma262/#sec-array.prototype.concat +// with adding support of @@isConcatSpreadable and @@species + $({ target: 'Array', proto: true, forced: FORCED }, { + // eslint-disable-next-line no-unused-vars -- required for `.length` + concat: function concat(arg) { + var O = toObject(this); + var A = arraySpeciesCreate(O, 0); + var n = 0; + var i, k, length, len, E; + for (i = -1, length = arguments.length; i < length; i++) { + E = i === -1 ? O : arguments[i]; + if (isConcatSpreadable(E)) { + len = toLength(E.length); + if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); + } else { + if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + createProperty(A, n++, E); + } + } + A.length = n; + return A; + } + }); + + + /***/ }), + + /***/ 7327: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var $filter = __webpack_require__(2092).filter; + var arrayMethodHasSpeciesSupport = __webpack_require__(1194); + + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); + +// `Array.prototype.filter` method +// https://tc39.es/ecma262/#sec-array.prototype.filter +// with adding support of @@species + $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + + /***/ }), + + /***/ 2772: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var $indexOf = __webpack_require__(1318).indexOf; + var arrayMethodIsStrict = __webpack_require__(9341); + + var nativeIndexOf = [].indexOf; + + var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; + var STRICT_METHOD = arrayMethodIsStrict('indexOf'); + +// `Array.prototype.indexOf` method +// https://tc39.es/ecma262/#sec-array.prototype.indexof + $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, { + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? nativeIndexOf.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + + /***/ }), + + /***/ 6992: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var toIndexedObject = __webpack_require__(5656); + var addToUnscopables = __webpack_require__(1223); + var Iterators = __webpack_require__(7497); + var InternalStateModule = __webpack_require__(9909); + var defineIterator = __webpack_require__(654); + + var ARRAY_ITERATOR = 'Array Iterator'; + var setInternalState = InternalStateModule.set; + var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); + +// `Array.prototype.entries` method +// https://tc39.es/ecma262/#sec-array.prototype.entries +// `Array.prototype.keys` method +// https://tc39.es/ecma262/#sec-array.prototype.keys +// `Array.prototype.values` method +// https://tc39.es/ecma262/#sec-array.prototype.values +// `Array.prototype[@@iterator]` method +// https://tc39.es/ecma262/#sec-array.prototype-@@iterator +// `CreateArrayIterator` internal method +// https://tc39.es/ecma262/#sec-createarrayiterator + module.exports = defineIterator(Array, 'Array', function (iterated, kind) { + setInternalState(this, { + type: ARRAY_ITERATOR, + target: toIndexedObject(iterated), // target + index: 0, // next index + kind: kind // kind + }); +// `%ArrayIteratorPrototype%.next` method +// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next + }, function () { + var state = getInternalState(this); + var target = state.target; + var kind = state.kind; + var index = state.index++; + if (!target || index >= target.length) { + state.target = undefined; + return { value: undefined, done: true }; + } + if (kind == 'keys') return { value: index, done: false }; + if (kind == 'values') return { value: target[index], done: false }; + return { value: [index, target[index]], done: false }; + }, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% +// https://tc39.es/ecma262/#sec-createunmappedargumentsobject +// https://tc39.es/ecma262/#sec-createmappedargumentsobject + Iterators.Arguments = Iterators.Array; + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('keys'); + addToUnscopables('values'); + addToUnscopables('entries'); + + + /***/ }), + + /***/ 1249: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var $map = __webpack_require__(2092).map; + var arrayMethodHasSpeciesSupport = __webpack_require__(1194); + + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); + +// `Array.prototype.map` method +// https://tc39.es/ecma262/#sec-array.prototype.map +// with adding support of @@species + $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + + /***/ }), + + /***/ 7042: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var isObject = __webpack_require__(111); + var isArray = __webpack_require__(3157); + var toAbsoluteIndex = __webpack_require__(1400); + var toLength = __webpack_require__(7466); + var toIndexedObject = __webpack_require__(5656); + var createProperty = __webpack_require__(6135); + var wellKnownSymbol = __webpack_require__(5112); + var arrayMethodHasSpeciesSupport = __webpack_require__(1194); + + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice'); + + var SPECIES = wellKnownSymbol('species'); + var nativeSlice = [].slice; + var max = Math.max; + +// `Array.prototype.slice` method +// https://tc39.es/ecma262/#sec-array.prototype.slice +// fallback for not array-like ES3 strings and DOM objects + $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + slice: function slice(start, end) { + var O = toIndexedObject(this); + var length = toLength(O.length); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible + var Constructor, result, n; + if (isArray(O)) { + Constructor = O.constructor; + // cross-realm fallback + if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { + Constructor = undefined; + } else if (isObject(Constructor)) { + Constructor = Constructor[SPECIES]; + if (Constructor === null) Constructor = undefined; + } + if (Constructor === Array || Constructor === undefined) { + return nativeSlice.call(O, k, fin); + } + } + result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0)); + for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); + result.length = n; + return result; + } + }); + + + /***/ }), + + /***/ 561: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var toAbsoluteIndex = __webpack_require__(1400); + var toInteger = __webpack_require__(9958); + var toLength = __webpack_require__(7466); + var toObject = __webpack_require__(7908); + var arraySpeciesCreate = __webpack_require__(5417); + var createProperty = __webpack_require__(6135); + var arrayMethodHasSpeciesSupport = __webpack_require__(1194); + + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); + + var max = Math.max; + var min = Math.min; + var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; + var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; + +// `Array.prototype.splice` method +// https://tc39.es/ecma262/#sec-array.prototype.splice +// with adding support of @@species + $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + splice: function splice(start, deleteCount /* , ...items */) { + var O = toObject(this); + var len = toLength(O.length); + var actualStart = toAbsoluteIndex(start, len); + var argumentsLength = arguments.length; + var insertCount, actualDeleteCount, A, k, from, to; + if (argumentsLength === 0) { + insertCount = actualDeleteCount = 0; + } else if (argumentsLength === 1) { + insertCount = 0; + actualDeleteCount = len - actualStart; + } else { + insertCount = argumentsLength - 2; + actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart); + } + if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { + throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); + } + A = arraySpeciesCreate(O, actualDeleteCount); + for (k = 0; k < actualDeleteCount; k++) { + from = actualStart + k; + if (from in O) createProperty(A, k, O[from]); + } + A.length = actualDeleteCount; + if (insertCount < actualDeleteCount) { + for (k = actualStart; k < len - actualDeleteCount; k++) { + from = k + actualDeleteCount; + to = k + insertCount; + if (from in O) O[to] = O[from]; + else delete O[to]; + } + for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1]; + } else if (insertCount > actualDeleteCount) { + for (k = len - actualDeleteCount; k > actualStart; k--) { + from = k + actualDeleteCount - 1; + to = k + insertCount - 1; + if (from in O) O[to] = O[from]; + else delete O[to]; + } + } + for (k = 0; k < insertCount; k++) { + O[k + actualStart] = arguments[k + 2]; + } + O.length = len - actualDeleteCount + insertCount; + return A; + } + }); + + + /***/ }), + + /***/ 8309: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + var DESCRIPTORS = __webpack_require__(9781); + var defineProperty = __webpack_require__(3070).f; + + var FunctionPrototype = Function.prototype; + var FunctionPrototypeToString = FunctionPrototype.toString; + var nameRE = /^\s*function ([^ (]*)/; + var NAME = 'name'; + +// Function instances `.name` property +// https://tc39.es/ecma262/#sec-function-instances-name + if (DESCRIPTORS && !(NAME in FunctionPrototype)) { + defineProperty(FunctionPrototype, NAME, { + configurable: true, + get: function () { + try { + return FunctionPrototypeToString.call(this).match(nameRE)[1]; + } catch (error) { + return ''; + } + } + }); + } + + + /***/ }), + + /***/ 489: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + var $ = __webpack_require__(2109); + var fails = __webpack_require__(7293); + var toObject = __webpack_require__(7908); + var nativeGetPrototypeOf = __webpack_require__(9518); + var CORRECT_PROTOTYPE_GETTER = __webpack_require__(8544); + + var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); }); + +// `Object.getPrototypeOf` method +// https://tc39.es/ecma262/#sec-object.getprototypeof + $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, { + getPrototypeOf: function getPrototypeOf(it) { + return nativeGetPrototypeOf(toObject(it)); + } + }); + + + + /***/ }), + + /***/ 1539: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + var TO_STRING_TAG_SUPPORT = __webpack_require__(1694); + var redefine = __webpack_require__(1320); + var toString = __webpack_require__(288); + +// `Object.prototype.toString` method +// https://tc39.es/ecma262/#sec-object.prototype.tostring + if (!TO_STRING_TAG_SUPPORT) { + redefine(Object.prototype, 'toString', toString, { unsafe: true }); + } + + + /***/ }), + + /***/ 4916: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var exec = __webpack_require__(2261); + +// `RegExp.prototype.exec` method +// https://tc39.es/ecma262/#sec-regexp.prototype.exec + $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { + exec: exec + }); + + + /***/ }), + + /***/ 9714: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var redefine = __webpack_require__(1320); + var anObject = __webpack_require__(9670); + var fails = __webpack_require__(7293); + var flags = __webpack_require__(7066); + + var TO_STRING = 'toString'; + var RegExpPrototype = RegExp.prototype; + var nativeToString = RegExpPrototype[TO_STRING]; + + var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); +// FF44- RegExp#toString has a wrong name + var INCORRECT_NAME = nativeToString.name != TO_STRING; + +// `RegExp.prototype.toString` method +// https://tc39.es/ecma262/#sec-regexp.prototype.tostring + if (NOT_GENERIC || INCORRECT_NAME) { + redefine(RegExp.prototype, TO_STRING, function toString() { + var R = anObject(this); + var p = String(R.source); + var rf = R.flags; + var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); + return '/' + p + '/' + f; + }, { unsafe: true }); + } + + + /***/ }), + + /***/ 8783: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var charAt = __webpack_require__(8710).charAt; + var InternalStateModule = __webpack_require__(9909); + var defineIterator = __webpack_require__(654); + + var STRING_ITERATOR = 'String Iterator'; + var setInternalState = InternalStateModule.set; + var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); + +// `String.prototype[@@iterator]` method +// https://tc39.es/ecma262/#sec-string.prototype-@@iterator + defineIterator(String, 'String', function (iterated) { + setInternalState(this, { + type: STRING_ITERATOR, + string: String(iterated), + index: 0 + }); +// `%StringIteratorPrototype%.next` method +// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next + }, function next() { + var state = getInternalState(this); + var string = state.string; + var index = state.index; + var point; + if (index >= string.length) return { value: undefined, done: true }; + point = charAt(string, index); + state.index += point.length; + return { value: point, done: false }; + }); + + + /***/ }), + + /***/ 4723: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var fixRegExpWellKnownSymbolLogic = __webpack_require__(7007); + var anObject = __webpack_require__(9670); + var toLength = __webpack_require__(7466); + var requireObjectCoercible = __webpack_require__(4488); + var advanceStringIndex = __webpack_require__(1530); + var regExpExec = __webpack_require__(7651); + +// @@match logic + fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { + return [ + // `String.prototype.match` method + // https://tc39.es/ecma262/#sec-string.prototype.match + function match(regexp) { + var O = requireObjectCoercible(this); + var matcher = regexp == undefined ? undefined : regexp[MATCH]; + return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, + // `RegExp.prototype[@@match]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@match + function (regexp) { + var res = maybeCallNative(nativeMatch, regexp, this); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + + if (!rx.global) return regExpExec(rx, S); + + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + var A = []; + var n = 0; + var result; + while ((result = regExpExec(rx, S)) !== null) { + var matchStr = String(result[0]); + A[n] = matchStr; + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + n++; + } + return n === 0 ? null : A; + } + ]; + }); + + + /***/ }), + + /***/ 5306: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var fixRegExpWellKnownSymbolLogic = __webpack_require__(7007); + var anObject = __webpack_require__(9670); + var toLength = __webpack_require__(7466); + var toInteger = __webpack_require__(9958); + var requireObjectCoercible = __webpack_require__(4488); + var advanceStringIndex = __webpack_require__(1530); + var getSubstitution = __webpack_require__(647); + var regExpExec = __webpack_require__(7651); + + var max = Math.max; + var min = Math.min; + + var maybeToString = function (it) { + return it === undefined ? it : String(it); + }; + +// @@replace logic + fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) { + var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE; + var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0; + var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; + + return [ + // `String.prototype.replace` method + // https://tc39.es/ecma262/#sec-string.prototype.replace + function replace(searchValue, replaceValue) { + var O = requireObjectCoercible(this); + var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; + return replacer !== undefined + ? replacer.call(searchValue, O, replaceValue) + : nativeReplace.call(String(O), searchValue, replaceValue); + }, + // `RegExp.prototype[@@replace]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace + function (regexp, replaceValue) { + if ( + (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) || + (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1) + ) { + var res = maybeCallNative(nativeReplace, regexp, this, replaceValue); + if (res.done) return res.value; + } + + var rx = anObject(regexp); + var S = String(this); + + var functionalReplace = typeof replaceValue === 'function'; + if (!functionalReplace) replaceValue = String(replaceValue); + + var global = rx.global; + if (global) { + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + } + var results = []; + while (true) { + var result = regExpExec(rx, S); + if (result === null) break; + + results.push(result); + if (!global) break; + + var matchStr = String(result[0]); + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + } + + var accumulatedResult = ''; + var nextSourcePosition = 0; + for (var i = 0; i < results.length; i++) { + result = results[i]; + + var matched = String(result[0]); + var position = max(min(toInteger(result.index), S.length), 0); + var captures = []; + // NOTE: This is equivalent to + // captures = result.slice(1).map(maybeToString) + // but for some reason `nativeSlice.call(result, 1, result.length)` (called in + // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and + // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. + for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); + var namedCaptures = result.groups; + if (functionalReplace) { + var replacerArgs = [matched].concat(captures, position, S); + if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); + var replacement = String(replaceValue.apply(undefined, replacerArgs)); + } else { + replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); + } + if (position >= nextSourcePosition) { + accumulatedResult += S.slice(nextSourcePosition, position) + replacement; + nextSourcePosition = position + matched.length; + } + } + return accumulatedResult + S.slice(nextSourcePosition); + } + ]; + }); + + + /***/ }), + + /***/ 3123: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var fixRegExpWellKnownSymbolLogic = __webpack_require__(7007); + var isRegExp = __webpack_require__(7850); + var anObject = __webpack_require__(9670); + var requireObjectCoercible = __webpack_require__(4488); + var speciesConstructor = __webpack_require__(6707); + var advanceStringIndex = __webpack_require__(1530); + var toLength = __webpack_require__(7466); + var callRegExpExec = __webpack_require__(7651); + var regexpExec = __webpack_require__(2261); + var fails = __webpack_require__(7293); + + var arrayPush = [].push; + var min = Math.min; + var MAX_UINT32 = 0xFFFFFFFF; + +// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError + var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); }); + +// @@split logic + fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) { + var internalSplit; + if ( + 'abbc'.split(/(b)*/)[1] == 'c' || + // eslint-disable-next-line regexp/no-empty-group -- required for testing + 'test'.split(/(?:)/, -1).length != 4 || + 'ab'.split(/(?:ab)*/).length != 2 || + '.'.split(/(.?)(.?)/).length != 4 || + // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing + '.'.split(/()()/).length > 1 || + ''.split(/.?/).length + ) { + // based on es5-shim implementation, need to rework it + internalSplit = function (separator, limit) { + var string = String(requireObjectCoercible(this)); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (separator === undefined) return [string]; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) { + return nativeSplit.call(string, separator, lim); + } + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var match, lastIndex, lastLength; + while (match = regexpExec.call(separatorCopy, string)) { + lastIndex = separatorCopy.lastIndex; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1)); + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= lim) break; + } + if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop + } + if (lastLastIndex === string.length) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output.length > lim ? output.slice(0, lim) : output; + }; + // Chakra, V8 + } else if ('0'.split(undefined, 0).length) { + internalSplit = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit); + }; + } else internalSplit = nativeSplit; + + return [ + // `String.prototype.split` method + // https://tc39.es/ecma262/#sec-string.prototype.split + function split(separator, limit) { + var O = requireObjectCoercible(this); + var splitter = separator == undefined ? undefined : separator[SPLIT]; + return splitter !== undefined + ? splitter.call(separator, O, limit) + : internalSplit.call(String(O), separator, limit); + }, + // `RegExp.prototype[@@split]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@split + // + // NOTE: This cannot be properly polyfilled in engines that don't support + // the 'y' flag. + function (regexp, limit) { + var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + var C = speciesConstructor(rx, RegExp); + + var unicodeMatching = rx.unicode; + var flags = (rx.ignoreCase ? 'i' : '') + + (rx.multiline ? 'm' : '') + + (rx.unicode ? 'u' : '') + + (SUPPORTS_Y ? 'y' : 'g'); + + // ^(? + rx + ) is needed, in combination with some S slicing, to + // simulate the 'y' flag. + var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; + var p = 0; + var q = 0; + var A = []; + while (q < S.length) { + splitter.lastIndex = SUPPORTS_Y ? q : 0; + var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); + var e; + if ( + z === null || + (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p + ) { + q = advanceStringIndex(S, q, unicodeMatching); + } else { + A.push(S.slice(p, q)); + if (A.length === lim) return A; + for (var i = 1; i <= z.length - 1; i++) { + A.push(z[i]); + if (A.length === lim) return A; + } + q = p = e; + } + } + A.push(S.slice(p)); + return A; + } + ]; + }, !SUPPORTS_Y); + + + /***/ }), + + /***/ 3210: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var $ = __webpack_require__(2109); + var $trim = __webpack_require__(3111).trim; + var forcedStringTrimMethod = __webpack_require__(6091); + +// `String.prototype.trim` method +// https://tc39.es/ecma262/#sec-string.prototype.trim + $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { + trim: function trim() { + return $trim(this); + } + }); + + + /***/ }), + + /***/ 2990: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $copyWithin = __webpack_require__(1048); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.copyWithin` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin + exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) { + return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }); + + + /***/ }), + + /***/ 8927: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $every = __webpack_require__(2092).every; + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.every` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every + exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) { + return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }); + + + /***/ }), + + /***/ 3105: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $fill = __webpack_require__(1285); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.fill` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill +// eslint-disable-next-line no-unused-vars -- required for `.length` + exportTypedArrayMethod('fill', function fill(value /* , start, end */) { + return $fill.apply(aTypedArray(this), arguments); + }); + + + /***/ }), + + /***/ 5035: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $filter = __webpack_require__(2092).filter; + var fromSpeciesAndList = __webpack_require__(3074); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.filter` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter + exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) { + var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + return fromSpeciesAndList(this, list); + }); + + + /***/ }), + + /***/ 7174: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $findIndex = __webpack_require__(2092).findIndex; + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.findIndex` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex + exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) { + return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }); + + + /***/ }), + + /***/ 4345: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $find = __webpack_require__(2092).find; + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.find` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find + exportTypedArrayMethod('find', function find(predicate /* , thisArg */) { + return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }); + + + /***/ }), + + /***/ 2846: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $forEach = __webpack_require__(2092).forEach; + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.forEach` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach + exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) { + $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }); + + + /***/ }), + + /***/ 4731: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $includes = __webpack_require__(1318).includes; + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.includes` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes + exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) { + return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }); + + + /***/ }), + + /***/ 7209: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $indexOf = __webpack_require__(1318).indexOf; + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.indexOf` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof + exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) { + return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }); + + + /***/ }), + + /***/ 6319: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var global = __webpack_require__(7854); + var ArrayBufferViewCore = __webpack_require__(260); + var ArrayIterators = __webpack_require__(6992); + var wellKnownSymbol = __webpack_require__(5112); + + var ITERATOR = wellKnownSymbol('iterator'); + var Uint8Array = global.Uint8Array; + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR]; + + var CORRECT_ITER_NAME = !!nativeTypedArrayIterator + && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined); + + var typedArrayValues = function values() { + return arrayValues.call(aTypedArray(this)); + }; + +// `%TypedArray%.prototype.entries` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries + exportTypedArrayMethod('entries', function entries() { + return arrayEntries.call(aTypedArray(this)); + }); +// `%TypedArray%.prototype.keys` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys + exportTypedArrayMethod('keys', function keys() { + return arrayKeys.call(aTypedArray(this)); + }); +// `%TypedArray%.prototype.values` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.values + exportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME); +// `%TypedArray%.prototype[@@iterator]` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator + exportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME); + + + /***/ }), + + /***/ 8867: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var $join = [].join; + +// `%TypedArray%.prototype.join` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join +// eslint-disable-next-line no-unused-vars -- required for `.length` + exportTypedArrayMethod('join', function join(separator) { + return $join.apply(aTypedArray(this), arguments); + }); + + + /***/ }), + + /***/ 7789: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $lastIndexOf = __webpack_require__(6583); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.lastIndexOf` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof +// eslint-disable-next-line no-unused-vars -- required for `.length` + exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { + return $lastIndexOf.apply(aTypedArray(this), arguments); + }); + + + /***/ }), + + /***/ 3739: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $map = __webpack_require__(2092).map; + var speciesConstructor = __webpack_require__(6707); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.map` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map + exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) { + return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { + return new (aTypedArrayConstructor(speciesConstructor(O, O.constructor)))(length); + }); + }); + + + /***/ }), + + /***/ 4483: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $reduceRight = __webpack_require__(3671).right; + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.reduceRicht` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright + exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) { + return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + }); + + + /***/ }), + + /***/ 9368: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $reduce = __webpack_require__(3671).left; + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.reduce` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce + exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) { + return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + }); + + + /***/ }), + + /***/ 2056: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var floor = Math.floor; + +// `%TypedArray%.prototype.reverse` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse + exportTypedArrayMethod('reverse', function reverse() { + var that = this; + var length = aTypedArray(that).length; + var middle = floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }); + + + /***/ }), + + /***/ 3462: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var toLength = __webpack_require__(7466); + var toOffset = __webpack_require__(4590); + var toObject = __webpack_require__(7908); + var fails = __webpack_require__(7293); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + + var FORCED = fails(function () { + /* global Int8Array -- safe */ + new Int8Array(1).set({}); + }); + +// `%TypedArray%.prototype.set` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set + exportTypedArrayMethod('set', function set(arrayLike /* , offset */) { + aTypedArray(this); + var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError('Wrong length'); + while (index < len) this[offset + index] = src[index++]; + }, FORCED); + + + /***/ }), + + /***/ 678: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var speciesConstructor = __webpack_require__(6707); + var fails = __webpack_require__(7293); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var $slice = [].slice; + + var FORCED = fails(function () { + /* global Int8Array -- safe */ + new Int8Array(1).slice(); + }); + +// `%TypedArray%.prototype.slice` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice + exportTypedArrayMethod('slice', function slice(start, end) { + var list = $slice.call(aTypedArray(this), start, end); + var C = speciesConstructor(this, this.constructor); + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C))(length); + while (length > index) result[index] = list[index++]; + return result; + }, FORCED); + + + /***/ }), + + /***/ 7462: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var $some = __webpack_require__(2092).some; + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.some` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some + exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) { + return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }); + + + /***/ }), + + /***/ 3824: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var $sort = [].sort; + +// `%TypedArray%.prototype.sort` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort + exportTypedArrayMethod('sort', function sort(comparefn) { + return $sort.call(aTypedArray(this), comparefn); + }); + + + /***/ }), + + /***/ 5021: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var ArrayBufferViewCore = __webpack_require__(260); + var toLength = __webpack_require__(7466); + var toAbsoluteIndex = __webpack_require__(1400); + var speciesConstructor = __webpack_require__(6707); + + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.subarray` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray + exportTypedArrayMethod('subarray', function subarray(begin, end) { + var O = aTypedArray(this); + var length = O.length; + var beginIndex = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O.constructor))( + O.buffer, + O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex) + ); + }); + + + /***/ }), + + /***/ 2974: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var global = __webpack_require__(7854); + var ArrayBufferViewCore = __webpack_require__(260); + var fails = __webpack_require__(7293); + + var Int8Array = global.Int8Array; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var $toLocaleString = [].toLocaleString; + var $slice = [].slice; + +// iOS Safari 6.x fails here + var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () { + $toLocaleString.call(new Int8Array(1)); + }); + + var FORCED = fails(function () { + return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString(); + }) || !fails(function () { + Int8Array.prototype.toLocaleString.call([1, 2]); + }); + +// `%TypedArray%.prototype.toLocaleString` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring + exportTypedArrayMethod('toLocaleString', function toLocaleString() { + return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments); + }, FORCED); + + + /***/ }), + + /***/ 5016: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + + var exportTypedArrayMethod = __webpack_require__(260).exportTypedArrayMethod; + var fails = __webpack_require__(7293); + var global = __webpack_require__(7854); + + var Uint8Array = global.Uint8Array; + var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {}; + var arrayToString = [].toString; + var arrayJoin = [].join; + + if (fails(function () { arrayToString.call({}); })) { + arrayToString = function toString() { + return arrayJoin.call(this); + }; + } + + var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; + +// `%TypedArray%.prototype.toString` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring + exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD); + + + /***/ }), + + /***/ 2472: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + var createTypedArrayConstructor = __webpack_require__(9843); + +// `Uint8Array` constructor +// https://tc39.es/ecma262/#sec-typedarray-objects + createTypedArrayConstructor('Uint8', function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + + + /***/ }), + + /***/ 4747: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + var DOMIterables = __webpack_require__(8324); + var forEach = __webpack_require__(8533); + var createNonEnumerableProperty = __webpack_require__(8880); + + for (var COLLECTION_NAME in DOMIterables) { + var Collection = global[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { + createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach); + } catch (error) { + CollectionPrototype.forEach = forEach; + } + } + + + /***/ }), + + /***/ 3948: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + var global = __webpack_require__(7854); + var DOMIterables = __webpack_require__(8324); + var ArrayIteratorMethods = __webpack_require__(6992); + var createNonEnumerableProperty = __webpack_require__(8880); + var wellKnownSymbol = __webpack_require__(5112); + + var ITERATOR = wellKnownSymbol('iterator'); + var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + var ArrayValues = ArrayIteratorMethods.values; + + for (var COLLECTION_NAME in DOMIterables) { + var Collection = global[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + if (CollectionPrototype) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[ITERATOR] !== ArrayValues) try { + createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues); + } catch (error) { + CollectionPrototype[ITERATOR] = ArrayValues; + } + if (!CollectionPrototype[TO_STRING_TAG]) { + createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); + } + if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { + createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); + } catch (error) { + CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; + } + } + } + } + + + /***/ }), + + /***/ 1637: + /***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + +// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` + __webpack_require__(6992); + var $ = __webpack_require__(2109); + var getBuiltIn = __webpack_require__(5005); + var USE_NATIVE_URL = __webpack_require__(590); + var redefine = __webpack_require__(1320); + var redefineAll = __webpack_require__(2248); + var setToStringTag = __webpack_require__(8003); + var createIteratorConstructor = __webpack_require__(4994); + var InternalStateModule = __webpack_require__(9909); + var anInstance = __webpack_require__(5787); + var hasOwn = __webpack_require__(6656); + var bind = __webpack_require__(9974); + var classof = __webpack_require__(648); + var anObject = __webpack_require__(9670); + var isObject = __webpack_require__(111); + var create = __webpack_require__(30); + var createPropertyDescriptor = __webpack_require__(9114); + var getIterator = __webpack_require__(8554); + var getIteratorMethod = __webpack_require__(1246); + var wellKnownSymbol = __webpack_require__(5112); + + var $fetch = getBuiltIn('fetch'); + var Headers = getBuiltIn('Headers'); + var ITERATOR = wellKnownSymbol('iterator'); + var URL_SEARCH_PARAMS = 'URLSearchParams'; + var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator'; + var setInternalState = InternalStateModule.set; + var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS); + var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR); + + var plus = /\+/g; + var sequences = Array(4); + + var percentSequence = function (bytes) { + return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi')); + }; + + var percentDecode = function (sequence) { + try { + return decodeURIComponent(sequence); + } catch (error) { + return sequence; + } + }; + + var deserialize = function (it) { + var result = it.replace(plus, ' '); + var bytes = 4; + try { + return decodeURIComponent(result); + } catch (error) { + while (bytes) { + result = result.replace(percentSequence(bytes--), percentDecode); + } + return result; + } + }; -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} + var find = /[!'()~]|%20/g; -/* - * - * More info at [www.dropzonejs.com](http://www.dropzonejs.com) - * - * Copyright (c) 2012, Matias Meno - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ + var replace = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+' + }; + + var replacer = function (match) { + return replace[match]; + }; + + var serialize = function (it) { + return encodeURIComponent(it).replace(find, replacer); + }; + + var parseSearchParams = function (result, query) { + if (query) { + var attributes = query.split('&'); + var index = 0; + var attribute, entry; + while (index < attributes.length) { + attribute = attributes[index++]; + if (attribute.length) { + entry = attribute.split('='); + result.push({ + key: deserialize(entry.shift()), + value: deserialize(entry.join('=')) + }); + } + } + } + }; + + var updateSearchParams = function (query) { + this.entries.length = 0; + parseSearchParams(this.entries, query); + }; + + var validateArgumentsLength = function (passed, required) { + if (passed < required) throw TypeError('Not enough arguments'); + }; + + var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) { + setInternalState(this, { + type: URL_SEARCH_PARAMS_ITERATOR, + iterator: getIterator(getInternalParamsState(params).entries), + kind: kind + }); + }, 'Iterator', function next() { + var state = getInternalIteratorState(this); + var kind = state.kind; + var step = state.iterator.next(); + var entry = step.value; + if (!step.done) { + step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value]; + } return step; + }); + +// `URLSearchParams` constructor +// https://url.spec.whatwg.org/#interface-urlsearchparams + var URLSearchParamsConstructor = function URLSearchParams(/* init */) { + anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS); + var init = arguments.length > 0 ? arguments[0] : undefined; + var that = this; + var entries = []; + var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key; + + setInternalState(that, { + type: URL_SEARCH_PARAMS, + entries: entries, + updateURL: function () { /* empty */ }, + updateSearchParams: updateSearchParams + }); + + if (init !== undefined) { + if (isObject(init)) { + iteratorMethod = getIteratorMethod(init); + if (typeof iteratorMethod === 'function') { + iterator = iteratorMethod.call(init); + next = iterator.next; + while (!(step = next.call(iterator)).done) { + entryIterator = getIterator(anObject(step.value)); + entryNext = entryIterator.next; + if ( + (first = entryNext.call(entryIterator)).done || + (second = entryNext.call(entryIterator)).done || + !entryNext.call(entryIterator).done + ) throw TypeError('Expected sequence with length 2'); + entries.push({ key: first.value + '', value: second.value + '' }); + } + } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' }); + } else { + parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + ''); + } + } + }; + + var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; + + redefineAll(URLSearchParamsPrototype, { + // `URLSearchParams.prototype.append` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-append + append: function append(name, value) { + validateArgumentsLength(arguments.length, 2); + var state = getInternalParamsState(this); + state.entries.push({ key: name + '', value: value + '' }); + state.updateURL(); + }, + // `URLSearchParams.prototype.delete` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-delete + 'delete': function (name) { + validateArgumentsLength(arguments.length, 1); + var state = getInternalParamsState(this); + var entries = state.entries; + var key = name + ''; + var index = 0; + while (index < entries.length) { + if (entries[index].key === key) entries.splice(index, 1); + else index++; + } + state.updateURL(); + }, + // `URLSearchParams.prototype.get` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-get + get: function get(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ''; + var index = 0; + for (; index < entries.length; index++) { + if (entries[index].key === key) return entries[index].value; + } + return null; + }, + // `URLSearchParams.prototype.getAll` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-getall + getAll: function getAll(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ''; + var result = []; + var index = 0; + for (; index < entries.length; index++) { + if (entries[index].key === key) result.push(entries[index].value); + } + return result; + }, + // `URLSearchParams.prototype.has` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-has + has: function has(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ''; + var index = 0; + while (index < entries.length) { + if (entries[index++].key === key) return true; + } + return false; + }, + // `URLSearchParams.prototype.set` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-set + set: function set(name, value) { + validateArgumentsLength(arguments.length, 1); + var state = getInternalParamsState(this); + var entries = state.entries; + var found = false; + var key = name + ''; + var val = value + ''; + var index = 0; + var entry; + for (; index < entries.length; index++) { + entry = entries[index]; + if (entry.key === key) { + if (found) entries.splice(index--, 1); + else { + found = true; + entry.value = val; + } + } + } + if (!found) entries.push({ key: key, value: val }); + state.updateURL(); + }, + // `URLSearchParams.prototype.sort` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-sort + sort: function sort() { + var state = getInternalParamsState(this); + var entries = state.entries; + // Array#sort is not stable in some engines + var slice = entries.slice(); + var entry, entriesIndex, sliceIndex; + entries.length = 0; + for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) { + entry = slice[sliceIndex]; + for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) { + if (entries[entriesIndex].key > entry.key) { + entries.splice(entriesIndex, 0, entry); + break; + } + } + if (entriesIndex === sliceIndex) entries.push(entry); + } + state.updateURL(); + }, + // `URLSearchParams.prototype.forEach` method + forEach: function forEach(callback /* , thisArg */) { + var entries = getInternalParamsState(this).entries; + var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3); + var index = 0; + var entry; + while (index < entries.length) { + entry = entries[index++]; + boundFunction(entry.value, entry.key, this); + } + }, + // `URLSearchParams.prototype.keys` method + keys: function keys() { + return new URLSearchParamsIterator(this, 'keys'); + }, + // `URLSearchParams.prototype.values` method + values: function values() { + return new URLSearchParamsIterator(this, 'values'); + }, + // `URLSearchParams.prototype.entries` method + entries: function entries() { + return new URLSearchParamsIterator(this, 'entries'); + } + }, { enumerable: true }); + +// `URLSearchParams.prototype[@@iterator]` method + redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries); + +// `URLSearchParams.prototype.toString` method +// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior + redefine(URLSearchParamsPrototype, 'toString', function toString() { + var entries = getInternalParamsState(this).entries; + var result = []; + var index = 0; + var entry; + while (index < entries.length) { + entry = entries[index++]; + result.push(serialize(entry.key) + '=' + serialize(entry.value)); + } return result.join('&'); + }, { enumerable: true }); + + setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS); + + $({ global: true, forced: !USE_NATIVE_URL }, { + URLSearchParams: URLSearchParamsConstructor + }); + +// Wrap `fetch` for correct work with polyfilled `URLSearchParams` +// https://github.com/zloirock/core-js/issues/674 + if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') { + $({ global: true, enumerable: true, forced: true }, { + fetch: function fetch(input /* , init */) { + var args = [input]; + var init, body, headers; + if (arguments.length > 1) { + init = arguments[1]; + if (isObject(init)) { + body = init.body; + if (classof(body) === URL_SEARCH_PARAMS) { + headers = init.headers ? new Headers(init.headers) : new Headers(); + if (!headers.has('content-type')) { + headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + init = create(init, { + body: createPropertyDescriptor(0, String(body)), + headers: createPropertyDescriptor(0, headers) + }); + } + } + args.push(init); + } return $fetch.apply(this, args); + } + }); + } + + module.exports = { + URLSearchParams: URLSearchParamsConstructor, + getState: getInternalParamsState + }; + + + /***/ }), + + /***/ 285: + /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + "use strict"; + +// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` + __webpack_require__(8783); + var $ = __webpack_require__(2109); + var DESCRIPTORS = __webpack_require__(9781); + var USE_NATIVE_URL = __webpack_require__(590); + var global = __webpack_require__(7854); + var defineProperties = __webpack_require__(6048); + var redefine = __webpack_require__(1320); + var anInstance = __webpack_require__(5787); + var has = __webpack_require__(6656); + var assign = __webpack_require__(1574); + var arrayFrom = __webpack_require__(8457); + var codeAt = __webpack_require__(8710).codeAt; + var toASCII = __webpack_require__(3197); + var setToStringTag = __webpack_require__(8003); + var URLSearchParamsModule = __webpack_require__(1637); + var InternalStateModule = __webpack_require__(9909); + + var NativeURL = global.URL; + var URLSearchParams = URLSearchParamsModule.URLSearchParams; + var getInternalSearchParamsState = URLSearchParamsModule.getState; + var setInternalState = InternalStateModule.set; + var getInternalURLState = InternalStateModule.getterFor('URL'); + var floor = Math.floor; + var pow = Math.pow; + + var INVALID_AUTHORITY = 'Invalid authority'; + var INVALID_SCHEME = 'Invalid scheme'; + var INVALID_HOST = 'Invalid host'; + var INVALID_PORT = 'Invalid port'; + + var ALPHA = /[A-Za-z]/; + var ALPHANUMERIC = /[\d+-.A-Za-z]/; + var DIGIT = /\d/; + var HEX_START = /^(0x|0X)/; + var OCT = /^[0-7]+$/; + var DEC = /^\d+$/; + var HEX = /^[\dA-Fa-f]+$/; + /* eslint-disable no-control-regex -- safe */ + var FORBIDDEN_HOST_CODE_POINT = /[\u0000\t\u000A\u000D #%/:?@[\\]]/; + var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\t\u000A\u000D #/:?@[\\]]/; + var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g; + var TAB_AND_NEW_LINE = /[\t\u000A\u000D]/g; + /* eslint-enable no-control-regex -- safe */ + var EOF; + + var parseHost = function (url, input) { + var result, codePoints, index; + if (input.charAt(0) == '[') { + if (input.charAt(input.length - 1) != ']') return INVALID_HOST; + result = parseIPv6(input.slice(1, -1)); + if (!result) return INVALID_HOST; + url.host = result; + // opaque host + } else if (!isSpecial(url)) { + if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST; + result = ''; + codePoints = arrayFrom(input); + for (index = 0; index < codePoints.length; index++) { + result += percentEncode(codePoints[index], C0ControlPercentEncodeSet); + } + url.host = result; + } else { + input = toASCII(input); + if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST; + result = parseIPv4(input); + if (result === null) return INVALID_HOST; + url.host = result; + } + }; + + var parseIPv4 = function (input) { + var parts = input.split('.'); + var partsLength, numbers, index, part, radix, number, ipv4; + if (parts.length && parts[parts.length - 1] == '') { + parts.pop(); + } + partsLength = parts.length; + if (partsLength > 4) return input; + numbers = []; + for (index = 0; index < partsLength; index++) { + part = parts[index]; + if (part == '') return input; + radix = 10; + if (part.length > 1 && part.charAt(0) == '0') { + radix = HEX_START.test(part) ? 16 : 8; + part = part.slice(radix == 8 ? 1 : 2); + } + if (part === '') { + number = 0; + } else { + if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input; + number = parseInt(part, radix); + } + numbers.push(number); + } + for (index = 0; index < partsLength; index++) { + number = numbers[index]; + if (index == partsLength - 1) { + if (number >= pow(256, 5 - partsLength)) return null; + } else if (number > 255) return null; + } + ipv4 = numbers.pop(); + for (index = 0; index < numbers.length; index++) { + ipv4 += numbers[index] * pow(256, 3 - index); + } + return ipv4; + }; + +// eslint-disable-next-line max-statements -- TODO + var parseIPv6 = function (input) { + var address = [0, 0, 0, 0, 0, 0, 0, 0]; + var pieceIndex = 0; + var compress = null; + var pointer = 0; + var value, length, numbersSeen, ipv4Piece, number, swaps, swap; + + var char = function () { + return input.charAt(pointer); + }; + + if (char() == ':') { + if (input.charAt(1) != ':') return; + pointer += 2; + pieceIndex++; + compress = pieceIndex; + } + while (char()) { + if (pieceIndex == 8) return; + if (char() == ':') { + if (compress !== null) return; + pointer++; + pieceIndex++; + compress = pieceIndex; + continue; + } + value = length = 0; + while (length < 4 && HEX.test(char())) { + value = value * 16 + parseInt(char(), 16); + pointer++; + length++; + } + if (char() == '.') { + if (length == 0) return; + pointer -= length; + if (pieceIndex > 6) return; + numbersSeen = 0; + while (char()) { + ipv4Piece = null; + if (numbersSeen > 0) { + if (char() == '.' && numbersSeen < 4) pointer++; + else return; + } + if (!DIGIT.test(char())) return; + while (DIGIT.test(char())) { + number = parseInt(char(), 10); + if (ipv4Piece === null) ipv4Piece = number; + else if (ipv4Piece == 0) return; + else ipv4Piece = ipv4Piece * 10 + number; + if (ipv4Piece > 255) return; + pointer++; + } + address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; + numbersSeen++; + if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; + } + if (numbersSeen != 4) return; + break; + } else if (char() == ':') { + pointer++; + if (!char()) return; + } else if (char()) return; + address[pieceIndex++] = value; + } + if (compress !== null) { + swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex != 0 && swaps > 0) { + swap = address[pieceIndex]; + address[pieceIndex--] = address[compress + swaps - 1]; + address[compress + --swaps] = swap; + } + } else if (pieceIndex != 8) return; + return address; + }; + + var findLongestZeroSequence = function (ipv6) { + var maxIndex = null; + var maxLength = 1; + var currStart = null; + var currLength = 0; + var index = 0; + for (; index < 8; index++) { + if (ipv6[index] !== 0) { + if (currLength > maxLength) { + maxIndex = currStart; + maxLength = currLength; + } + currStart = null; + currLength = 0; + } else { + if (currStart === null) currStart = index; + ++currLength; + } + } + if (currLength > maxLength) { + maxIndex = currStart; + maxLength = currLength; + } + return maxIndex; + }; + + var serializeHost = function (host) { + var result, index, compress, ignore0; + // ipv4 + if (typeof host == 'number') { + result = []; + for (index = 0; index < 4; index++) { + result.unshift(host % 256); + host = floor(host / 256); + } return result.join('.'); + // ipv6 + } else if (typeof host == 'object') { + result = ''; + compress = findLongestZeroSequence(host); + for (index = 0; index < 8; index++) { + if (ignore0 && host[index] === 0) continue; + if (ignore0) ignore0 = false; + if (compress === index) { + result += index ? ':' : '::'; + ignore0 = true; + } else { + result += host[index].toString(16); + if (index < 7) result += ':'; + } + } + return '[' + result + ']'; + } return host; + }; + + var C0ControlPercentEncodeSet = {}; + var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { + ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1 + }); + var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, { + '#': 1, '?': 1, '{': 1, '}': 1 + }); + var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { + '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1 + }); + + var percentEncode = function (char, set) { + var code = codeAt(char, 0); + return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char); + }; + + var specialSchemes = { + ftp: 21, + file: null, + http: 80, + https: 443, + ws: 80, + wss: 443 + }; + + var isSpecial = function (url) { + return has(specialSchemes, url.scheme); + }; + + var includesCredentials = function (url) { + return url.username != '' || url.password != ''; + }; + + var cannotHaveUsernamePasswordPort = function (url) { + return !url.host || url.cannotBeABaseURL || url.scheme == 'file'; + }; + + var isWindowsDriveLetter = function (string, normalized) { + var second; + return string.length == 2 && ALPHA.test(string.charAt(0)) + && ((second = string.charAt(1)) == ':' || (!normalized && second == '|')); + }; + + var startsWithWindowsDriveLetter = function (string) { + var third; + return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && ( + string.length == 2 || + ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#') + ); + }; + + var shortenURLsPath = function (url) { + var path = url.path; + var pathSize = path.length; + if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) { + path.pop(); + } + }; + + var isSingleDot = function (segment) { + return segment === '.' || segment.toLowerCase() === '%2e'; + }; + + var isDoubleDot = function (segment) { + segment = segment.toLowerCase(); + return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e'; + }; + +// States: + var SCHEME_START = {}; + var SCHEME = {}; + var NO_SCHEME = {}; + var SPECIAL_RELATIVE_OR_AUTHORITY = {}; + var PATH_OR_AUTHORITY = {}; + var RELATIVE = {}; + var RELATIVE_SLASH = {}; + var SPECIAL_AUTHORITY_SLASHES = {}; + var SPECIAL_AUTHORITY_IGNORE_SLASHES = {}; + var AUTHORITY = {}; + var HOST = {}; + var HOSTNAME = {}; + var PORT = {}; + var FILE = {}; + var FILE_SLASH = {}; + var FILE_HOST = {}; + var PATH_START = {}; + var PATH = {}; + var CANNOT_BE_A_BASE_URL_PATH = {}; + var QUERY = {}; + var FRAGMENT = {}; + +// eslint-disable-next-line max-statements -- TODO + var parseURL = function (url, input, stateOverride, base) { + var state = stateOverride || SCHEME_START; + var pointer = 0; + var buffer = ''; + var seenAt = false; + var seenBracket = false; + var seenPasswordToken = false; + var codePoints, char, bufferCodePoints, failure; + + if (!stateOverride) { + url.scheme = ''; + url.username = ''; + url.password = ''; + url.host = null; + url.port = null; + url.path = []; + url.query = null; + url.fragment = null; + url.cannotBeABaseURL = false; + input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, ''); + } + + input = input.replace(TAB_AND_NEW_LINE, ''); + + codePoints = arrayFrom(input); + + while (pointer <= codePoints.length) { + char = codePoints[pointer]; + switch (state) { + case SCHEME_START: + if (char && ALPHA.test(char)) { + buffer += char.toLowerCase(); + state = SCHEME; + } else if (!stateOverride) { + state = NO_SCHEME; + continue; + } else return INVALID_SCHEME; + break; + + case SCHEME: + if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) { + buffer += char.toLowerCase(); + } else if (char == ':') { + if (stateOverride && ( + (isSpecial(url) != has(specialSchemes, buffer)) || + (buffer == 'file' && (includesCredentials(url) || url.port !== null)) || + (url.scheme == 'file' && !url.host) + )) return; + url.scheme = buffer; + if (stateOverride) { + if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null; + return; + } + buffer = ''; + if (url.scheme == 'file') { + state = FILE; + } else if (isSpecial(url) && base && base.scheme == url.scheme) { + state = SPECIAL_RELATIVE_OR_AUTHORITY; + } else if (isSpecial(url)) { + state = SPECIAL_AUTHORITY_SLASHES; + } else if (codePoints[pointer + 1] == '/') { + state = PATH_OR_AUTHORITY; + pointer++; + } else { + url.cannotBeABaseURL = true; + url.path.push(''); + state = CANNOT_BE_A_BASE_URL_PATH; + } + } else if (!stateOverride) { + buffer = ''; + state = NO_SCHEME; + pointer = 0; + continue; + } else return INVALID_SCHEME; + break; + + case NO_SCHEME: + if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME; + if (base.cannotBeABaseURL && char == '#') { + url.scheme = base.scheme; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ''; + url.cannotBeABaseURL = true; + state = FRAGMENT; + break; + } + state = base.scheme == 'file' ? FILE : RELATIVE; + continue; + + case SPECIAL_RELATIVE_OR_AUTHORITY: + if (char == '/' && codePoints[pointer + 1] == '/') { + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + pointer++; + } else { + state = RELATIVE; + continue; + } break; + + case PATH_OR_AUTHORITY: + if (char == '/') { + state = AUTHORITY; + break; + } else { + state = PATH; + continue; + } + + case RELATIVE: + url.scheme = base.scheme; + if (char == EOF) { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = base.query; + } else if (char == '/' || (char == '\\' && isSpecial(url))) { + state = RELATIVE_SLASH; + } else if (char == '?') { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ''; + state = FRAGMENT; + } else { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.path.pop(); + state = PATH; + continue; + } break; + + case RELATIVE_SLASH: + if (isSpecial(url) && (char == '/' || char == '\\')) { + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + } else if (char == '/') { + state = AUTHORITY; + } else { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + state = PATH; + continue; + } break; + + case SPECIAL_AUTHORITY_SLASHES: + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + if (char != '/' || buffer.charAt(pointer + 1) != '/') continue; + pointer++; + break; + + case SPECIAL_AUTHORITY_IGNORE_SLASHES: + if (char != '/' && char != '\\') { + state = AUTHORITY; + continue; + } break; + + case AUTHORITY: + if (char == '@') { + if (seenAt) buffer = '%40' + buffer; + seenAt = true; + bufferCodePoints = arrayFrom(buffer); + for (var i = 0; i < bufferCodePoints.length; i++) { + var codePoint = bufferCodePoints[i]; + if (codePoint == ':' && !seenPasswordToken) { + seenPasswordToken = true; + continue; + } + var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet); + if (seenPasswordToken) url.password += encodedCodePoints; + else url.username += encodedCodePoints; + } + buffer = ''; + } else if ( + char == EOF || char == '/' || char == '?' || char == '#' || + (char == '\\' && isSpecial(url)) + ) { + if (seenAt && buffer == '') return INVALID_AUTHORITY; + pointer -= arrayFrom(buffer).length + 1; + buffer = ''; + state = HOST; + } else buffer += char; + break; + + case HOST: + case HOSTNAME: + if (stateOverride && url.scheme == 'file') { + state = FILE_HOST; + continue; + } else if (char == ':' && !seenBracket) { + if (buffer == '') return INVALID_HOST; + failure = parseHost(url, buffer); + if (failure) return failure; + buffer = ''; + state = PORT; + if (stateOverride == HOSTNAME) return; + } else if ( + char == EOF || char == '/' || char == '?' || char == '#' || + (char == '\\' && isSpecial(url)) + ) { + if (isSpecial(url) && buffer == '') return INVALID_HOST; + if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return; + failure = parseHost(url, buffer); + if (failure) return failure; + buffer = ''; + state = PATH_START; + if (stateOverride) return; + continue; + } else { + if (char == '[') seenBracket = true; + else if (char == ']') seenBracket = false; + buffer += char; + } break; + + case PORT: + if (DIGIT.test(char)) { + buffer += char; + } else if ( + char == EOF || char == '/' || char == '?' || char == '#' || + (char == '\\' && isSpecial(url)) || + stateOverride + ) { + if (buffer != '') { + var port = parseInt(buffer, 10); + if (port > 0xFFFF) return INVALID_PORT; + url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port; + buffer = ''; + } + if (stateOverride) return; + state = PATH_START; + continue; + } else return INVALID_PORT; + break; + + case FILE: + url.scheme = 'file'; + if (char == '/' || char == '\\') state = FILE_SLASH; + else if (base && base.scheme == 'file') { + if (char == EOF) { + url.host = base.host; + url.path = base.path.slice(); + url.query = base.query; + } else if (char == '?') { + url.host = base.host; + url.path = base.path.slice(); + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.host = base.host; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ''; + state = FRAGMENT; + } else { + if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { + url.host = base.host; + url.path = base.path.slice(); + shortenURLsPath(url); + } + state = PATH; + continue; + } + } else { + state = PATH; + continue; + } break; + + case FILE_SLASH: + if (char == '/' || char == '\\') { + state = FILE_HOST; + break; + } + if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { + if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]); + else url.host = base.host; + } + state = PATH; + continue; + + case FILE_HOST: + if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') { + if (!stateOverride && isWindowsDriveLetter(buffer)) { + state = PATH; + } else if (buffer == '') { + url.host = ''; + if (stateOverride) return; + state = PATH_START; + } else { + failure = parseHost(url, buffer); + if (failure) return failure; + if (url.host == 'localhost') url.host = ''; + if (stateOverride) return; + buffer = ''; + state = PATH_START; + } continue; + } else buffer += char; + break; + + case PATH_START: + if (isSpecial(url)) { + state = PATH; + if (char != '/' && char != '\\') continue; + } else if (!stateOverride && char == '?') { + url.query = ''; + state = QUERY; + } else if (!stateOverride && char == '#') { + url.fragment = ''; + state = FRAGMENT; + } else if (char != EOF) { + state = PATH; + if (char != '/') continue; + } break; + + case PATH: + if ( + char == EOF || char == '/' || + (char == '\\' && isSpecial(url)) || + (!stateOverride && (char == '?' || char == '#')) + ) { + if (isDoubleDot(buffer)) { + shortenURLsPath(url); + if (char != '/' && !(char == '\\' && isSpecial(url))) { + url.path.push(''); + } + } else if (isSingleDot(buffer)) { + if (char != '/' && !(char == '\\' && isSpecial(url))) { + url.path.push(''); + } + } else { + if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) { + if (url.host) url.host = ''; + buffer = buffer.charAt(0) + ':'; // normalize windows drive letter + } + url.path.push(buffer); + } + buffer = ''; + if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) { + while (url.path.length > 1 && url.path[0] === '') { + url.path.shift(); + } + } + if (char == '?') { + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.fragment = ''; + state = FRAGMENT; + } + } else { + buffer += percentEncode(char, pathPercentEncodeSet); + } break; + + case CANNOT_BE_A_BASE_URL_PATH: + if (char == '?') { + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.fragment = ''; + state = FRAGMENT; + } else if (char != EOF) { + url.path[0] += percentEncode(char, C0ControlPercentEncodeSet); + } break; + + case QUERY: + if (!stateOverride && char == '#') { + url.fragment = ''; + state = FRAGMENT; + } else if (char != EOF) { + if (char == "'" && isSpecial(url)) url.query += '%27'; + else if (char == '#') url.query += '%23'; + else url.query += percentEncode(char, C0ControlPercentEncodeSet); + } break; + + case FRAGMENT: + if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet); + break; + } + + pointer++; + } + }; + +// `URL` constructor +// https://url.spec.whatwg.org/#url-class + var URLConstructor = function URL(url /* , base */) { + var that = anInstance(this, URLConstructor, 'URL'); + var base = arguments.length > 1 ? arguments[1] : undefined; + var urlString = String(url); + var state = setInternalState(that, { type: 'URL' }); + var baseState, failure; + if (base !== undefined) { + if (base instanceof URLConstructor) baseState = getInternalURLState(base); + else { + failure = parseURL(baseState = {}, String(base)); + if (failure) throw TypeError(failure); + } + } + failure = parseURL(state, urlString, null, baseState); + if (failure) throw TypeError(failure); + var searchParams = state.searchParams = new URLSearchParams(); + var searchParamsState = getInternalSearchParamsState(searchParams); + searchParamsState.updateSearchParams(state.query); + searchParamsState.updateURL = function () { + state.query = String(searchParams) || null; + }; + if (!DESCRIPTORS) { + that.href = serializeURL.call(that); + that.origin = getOrigin.call(that); + that.protocol = getProtocol.call(that); + that.username = getUsername.call(that); + that.password = getPassword.call(that); + that.host = getHost.call(that); + that.hostname = getHostname.call(that); + that.port = getPort.call(that); + that.pathname = getPathname.call(that); + that.search = getSearch.call(that); + that.searchParams = getSearchParams.call(that); + that.hash = getHash.call(that); + } + }; + + var URLPrototype = URLConstructor.prototype; + + var serializeURL = function () { + var url = getInternalURLState(this); + var scheme = url.scheme; + var username = url.username; + var password = url.password; + var host = url.host; + var port = url.port; + var path = url.path; + var query = url.query; + var fragment = url.fragment; + var output = scheme + ':'; + if (host !== null) { + output += '//'; + if (includesCredentials(url)) { + output += username + (password ? ':' + password : '') + '@'; + } + output += serializeHost(host); + if (port !== null) output += ':' + port; + } else if (scheme == 'file') output += '//'; + output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; + if (query !== null) output += '?' + query; + if (fragment !== null) output += '#' + fragment; + return output; + }; + + var getOrigin = function () { + var url = getInternalURLState(this); + var scheme = url.scheme; + var port = url.port; + if (scheme == 'blob') try { + return new URL(scheme.path[0]).origin; + } catch (error) { + return 'null'; + } + if (scheme == 'file' || !isSpecial(url)) return 'null'; + return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : ''); + }; + + var getProtocol = function () { + return getInternalURLState(this).scheme + ':'; + }; + + var getUsername = function () { + return getInternalURLState(this).username; + }; + + var getPassword = function () { + return getInternalURLState(this).password; + }; + + var getHost = function () { + var url = getInternalURLState(this); + var host = url.host; + var port = url.port; + return host === null ? '' + : port === null ? serializeHost(host) + : serializeHost(host) + ':' + port; + }; + + var getHostname = function () { + var host = getInternalURLState(this).host; + return host === null ? '' : serializeHost(host); + }; + + var getPort = function () { + var port = getInternalURLState(this).port; + return port === null ? '' : String(port); + }; + + var getPathname = function () { + var url = getInternalURLState(this); + var path = url.path; + return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; + }; + + var getSearch = function () { + var query = getInternalURLState(this).query; + return query ? '?' + query : ''; + }; + + var getSearchParams = function () { + return getInternalURLState(this).searchParams; + }; + + var getHash = function () { + var fragment = getInternalURLState(this).fragment; + return fragment ? '#' + fragment : ''; + }; + + var accessorDescriptor = function (getter, setter) { + return { get: getter, set: setter, configurable: true, enumerable: true }; + }; + + if (DESCRIPTORS) { + defineProperties(URLPrototype, { + // `URL.prototype.href` accessors pair + // https://url.spec.whatwg.org/#dom-url-href + href: accessorDescriptor(serializeURL, function (href) { + var url = getInternalURLState(this); + var urlString = String(href); + var failure = parseURL(url, urlString); + if (failure) throw TypeError(failure); + getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); + }), + // `URL.prototype.origin` getter + // https://url.spec.whatwg.org/#dom-url-origin + origin: accessorDescriptor(getOrigin), + // `URL.prototype.protocol` accessors pair + // https://url.spec.whatwg.org/#dom-url-protocol + protocol: accessorDescriptor(getProtocol, function (protocol) { + var url = getInternalURLState(this); + parseURL(url, String(protocol) + ':', SCHEME_START); + }), + // `URL.prototype.username` accessors pair + // https://url.spec.whatwg.org/#dom-url-username + username: accessorDescriptor(getUsername, function (username) { + var url = getInternalURLState(this); + var codePoints = arrayFrom(String(username)); + if (cannotHaveUsernamePasswordPort(url)) return; + url.username = ''; + for (var i = 0; i < codePoints.length; i++) { + url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); + } + }), + // `URL.prototype.password` accessors pair + // https://url.spec.whatwg.org/#dom-url-password + password: accessorDescriptor(getPassword, function (password) { + var url = getInternalURLState(this); + var codePoints = arrayFrom(String(password)); + if (cannotHaveUsernamePasswordPort(url)) return; + url.password = ''; + for (var i = 0; i < codePoints.length; i++) { + url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); + } + }), + // `URL.prototype.host` accessors pair + // https://url.spec.whatwg.org/#dom-url-host + host: accessorDescriptor(getHost, function (host) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + parseURL(url, String(host), HOST); + }), + // `URL.prototype.hostname` accessors pair + // https://url.spec.whatwg.org/#dom-url-hostname + hostname: accessorDescriptor(getHostname, function (hostname) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + parseURL(url, String(hostname), HOSTNAME); + }), + // `URL.prototype.port` accessors pair + // https://url.spec.whatwg.org/#dom-url-port + port: accessorDescriptor(getPort, function (port) { + var url = getInternalURLState(this); + if (cannotHaveUsernamePasswordPort(url)) return; + port = String(port); + if (port == '') url.port = null; + else parseURL(url, port, PORT); + }), + // `URL.prototype.pathname` accessors pair + // https://url.spec.whatwg.org/#dom-url-pathname + pathname: accessorDescriptor(getPathname, function (pathname) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + url.path = []; + parseURL(url, pathname + '', PATH_START); + }), + // `URL.prototype.search` accessors pair + // https://url.spec.whatwg.org/#dom-url-search + search: accessorDescriptor(getSearch, function (search) { + var url = getInternalURLState(this); + search = String(search); + if (search == '') { + url.query = null; + } else { + if ('?' == search.charAt(0)) search = search.slice(1); + url.query = ''; + parseURL(url, search, QUERY); + } + getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); + }), + // `URL.prototype.searchParams` getter + // https://url.spec.whatwg.org/#dom-url-searchparams + searchParams: accessorDescriptor(getSearchParams), + // `URL.prototype.hash` accessors pair + // https://url.spec.whatwg.org/#dom-url-hash + hash: accessorDescriptor(getHash, function (hash) { + var url = getInternalURLState(this); + hash = String(hash); + if (hash == '') { + url.fragment = null; + return; + } + if ('#' == hash.charAt(0)) hash = hash.slice(1); + url.fragment = ''; + parseURL(url, hash, FRAGMENT); + }) + }); + } + +// `URL.prototype.toJSON` method +// https://url.spec.whatwg.org/#dom-url-tojson + redefine(URLPrototype, 'toJSON', function toJSON() { + return serializeURL.call(this); + }, { enumerable: true }); + +// `URL.prototype.toString` method +// https://url.spec.whatwg.org/#URL-stringification-behavior + redefine(URLPrototype, 'toString', function toString() { + return serializeURL.call(this); + }, { enumerable: true }); + + if (NativeURL) { + var nativeCreateObjectURL = NativeURL.createObjectURL; + var nativeRevokeObjectURL = NativeURL.revokeObjectURL; + // `URL.createObjectURL` method + // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL + // eslint-disable-next-line no-unused-vars -- required for `.length` + if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) { + return nativeCreateObjectURL.apply(NativeURL, arguments); + }); + // `URL.revokeObjectURL` method + // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL + // eslint-disable-next-line no-unused-vars -- required for `.length` + if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) { + return nativeRevokeObjectURL.apply(NativeURL, arguments); + }); + } + + setToStringTag(URLConstructor, 'URL'); + + $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, { + URL: URLConstructor + }); + + + /***/ }) + + /******/ }); + /************************************************************************/ + /******/ // The module cache + /******/ var __webpack_module_cache__ = {}; + /******/ + /******/ // The require function + /******/ function __webpack_require__(moduleId) { + /******/ // Check if module is in cache + /******/ if(__webpack_module_cache__[moduleId]) { + /******/ return __webpack_module_cache__[moduleId].exports; + /******/ } + /******/ // Create a new module (and put it into the cache) + /******/ var module = __webpack_module_cache__[moduleId] = { + /******/ // no module.id needed + /******/ // no module.loaded needed + /******/ exports: {} + /******/ }; + /******/ + /******/ // Execute the module function + /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); + /******/ + /******/ // Return the exports of the module + /******/ return module.exports; + /******/ } + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/define property getters */ + /******/ !function() { + /******/ // define getter functions for harmony exports + /******/ __webpack_require__.d = function(exports, definition) { + /******/ for(var key in definition) { + /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { + /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); + /******/ } + /******/ } + /******/ }; + /******/ }(); + /******/ + /******/ /* webpack/runtime/global */ + /******/ !function() { + /******/ __webpack_require__.g = (function() { + /******/ if (typeof globalThis === 'object') return globalThis; + /******/ try { + /******/ return this || new Function('return this')(); + /******/ } catch (e) { + /******/ if (typeof window === 'object') return window; + /******/ } + /******/ })(); + /******/ }(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ !function() { + /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } + /******/ }(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ !function() { + /******/ // define __esModule on exports + /******/ __webpack_require__.r = function(exports) { + /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { + /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + /******/ } + /******/ Object.defineProperty(exports, '__esModule', { value: true }); + /******/ }; + /******/ }(); + /******/ + /************************************************************************/ + var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. + !function() { + "use strict"; +// ESM COMPAT FLAG + __webpack_require__.r(__webpack_exports__); + +// EXPORTS + __webpack_require__.d(__webpack_exports__, { + "Dropzone": function() { return /* reexport */ Dropzone; }, + "default": function() { return /* binding */ dropzone_dist; } + }); + +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js + var es_array_concat = __webpack_require__(2222); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js + var es_array_filter = __webpack_require__(7327); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.index-of.js + var es_array_index_of = __webpack_require__(2772); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js + var es_array_iterator = __webpack_require__(6992); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js + var es_array_map = __webpack_require__(1249); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js + var es_array_slice = __webpack_require__(7042); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js + var es_array_splice = __webpack_require__(561); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array-buffer.constructor.js + var es_array_buffer_constructor = __webpack_require__(8264); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js + var es_function_name = __webpack_require__(8309); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-prototype-of.js + var es_object_get_prototype_of = __webpack_require__(489); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js + var es_object_to_string = __webpack_require__(1539); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js + var es_regexp_exec = __webpack_require__(4916); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js + var es_regexp_to_string = __webpack_require__(9714); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js + var es_string_iterator = __webpack_require__(8783); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js + var es_string_match = __webpack_require__(4723); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js + var es_string_replace = __webpack_require__(5306); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js + var es_string_split = __webpack_require__(3123); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js + var es_string_trim = __webpack_require__(3210); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.uint8-array.js + var es_typed_array_uint8_array = __webpack_require__(2472); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.copy-within.js + var es_typed_array_copy_within = __webpack_require__(2990); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.every.js + var es_typed_array_every = __webpack_require__(8927); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.fill.js + var es_typed_array_fill = __webpack_require__(3105); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.filter.js + var es_typed_array_filter = __webpack_require__(5035); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.find.js + var es_typed_array_find = __webpack_require__(4345); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.find-index.js + var es_typed_array_find_index = __webpack_require__(7174); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.for-each.js + var es_typed_array_for_each = __webpack_require__(2846); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.includes.js + var es_typed_array_includes = __webpack_require__(4731); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.index-of.js + var es_typed_array_index_of = __webpack_require__(7209); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.iterator.js + var es_typed_array_iterator = __webpack_require__(6319); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.join.js + var es_typed_array_join = __webpack_require__(8867); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.last-index-of.js + var es_typed_array_last_index_of = __webpack_require__(7789); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.map.js + var es_typed_array_map = __webpack_require__(3739); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.reduce.js + var es_typed_array_reduce = __webpack_require__(9368); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.reduce-right.js + var es_typed_array_reduce_right = __webpack_require__(4483); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.reverse.js + var es_typed_array_reverse = __webpack_require__(2056); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.set.js + var es_typed_array_set = __webpack_require__(3462); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.slice.js + var es_typed_array_slice = __webpack_require__(678); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.some.js + var es_typed_array_some = __webpack_require__(7462); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.sort.js + var es_typed_array_sort = __webpack_require__(3824); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.subarray.js + var es_typed_array_subarray = __webpack_require__(5021); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.to-locale-string.js + var es_typed_array_to_locale_string = __webpack_require__(2974); +// EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.to-string.js + var es_typed_array_to_string = __webpack_require__(5016); +// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js + var web_dom_collections_for_each = __webpack_require__(4747); +// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js + var web_dom_collections_iterator = __webpack_require__(3948); +// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js + var web_url = __webpack_require__(285); + ;// CONCATENATED MODULE: ./src/emitter.js + + + function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } // The Emitter class provides the ability to call `.on()` on Dropzone to listen // to events. // It is strongly based on component's emitter class, and I removed the // functionality because of the dependency hell with different frameworks. -var Emitter = function () { - function Emitter() { - _classCallCheck(this, Emitter); - } + var Emitter = /*#__PURE__*/function () { + function Emitter() { + _classCallCheck(this, Emitter); + } - _createClass(Emitter, [{ - key: "on", + _createClass(Emitter, [{ + key: "on", + value: // Add an event listener for given event + function on(event, fn) { + this._callbacks = this._callbacks || {}; // Create namespace for this event - // Add an event listener for given event - value: function on(event, fn) { - this._callbacks = this._callbacks || {}; - // Create namespace for this event - if (!this._callbacks[event]) { - this._callbacks[event] = []; - } - this._callbacks[event].push(fn); - return this; - } - }, { - key: "emit", - value: function emit(event) { - this._callbacks = this._callbacks || {}; - var callbacks = this._callbacks[event]; - - if (callbacks) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } + if (!this._callbacks[event]) { + this._callbacks[event] = []; + } - for (var _iterator = callbacks, _isArray = true, _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { - var _ref; + this._callbacks[event].push(fn); - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; + return this; + } + }, { + key: "emit", + value: function emit(event) { + this._callbacks = this._callbacks || {}; + var callbacks = this._callbacks[event]; + + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + if (callbacks) { + var _iterator = _createForOfIteratorHelper(callbacks, true), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var callback = _step.value; + callback.apply(this, args); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } // trigger a corresponding DOM event + + + if (this.element) { + this.element.dispatchEvent(this.makeEvent("dropzone:" + event, { + args: args + })); + } + + return this; } + }, { + key: "makeEvent", + value: function makeEvent(eventName, detail) { + var params = { + bubbles: true, + cancelable: true, + detail: detail + }; + + if (typeof window.CustomEvent === "function") { + return new CustomEvent(eventName, params); + } else { + // IE 11 support + // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent + var evt = document.createEvent("CustomEvent"); + evt.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail); + return evt; + } + } // Remove event listener for given event. If fn is not provided, all event + // listeners for that event will be removed. If neither is provided, all + // event listeners will be removed. + + }, { + key: "off", + value: function off(event, fn) { + if (!this._callbacks || arguments.length === 0) { + this._callbacks = {}; + return this; + } // specific event - var callback = _ref; - callback.apply(this, args); - } - } + var callbacks = this._callbacks[event]; + + if (!callbacks) { + return this; + } // remove all handlers + + + if (arguments.length === 1) { + delete this._callbacks[event]; + return this; + } // remove specific handler + + + for (var i = 0; i < callbacks.length; i++) { + var callback = callbacks[i]; + + if (callback === fn) { + callbacks.splice(i, 1); + break; + } + } + + return this; + } + }]); - return this; - } + return Emitter; + }(); - // Remove event listener for given event. If fn is not provided, all event - // listeners for that event will be removed. If neither is provided, all - // event listeners will be removed. - }, { - key: "off", - value: function off(event, fn) { - if (!this._callbacks || arguments.length === 0) { - this._callbacks = {}; - return this; - } + ;// CONCATENATED MODULE: ./src/preview-template.html +// Module + var code = "
Check
Error
"; +// Exports + /* harmony default export */ var preview_template = (code); + ;// CONCATENATED MODULE: ./src/options.js - // specific event - var callbacks = this._callbacks[event]; - if (!callbacks) { - return this; - } - // remove all handlers - if (arguments.length === 1) { - delete this._callbacks[event]; - return this; - } - // remove specific handler - for (var i = 0; i < callbacks.length; i++) { - var callback = callbacks[i]; - if (callback === fn) { - callbacks.splice(i, 1); - break; - } - } - return this; - } - }]); - return Emitter; -}(); + function options_createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = options_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } -var Dropzone = function (_Emitter) { - _inherits(Dropzone, _Emitter); + function options_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return options_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return options_arrayLikeToArray(o, minLen); } - _createClass(Dropzone, null, [{ - key: "initClass", - value: function initClass() { + function options_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - // Exposing the emitter class, mainly for tests - this.prototype.Emitter = Emitter; - /* - This is a list of all available events you can register on a dropzone object. - You can register an event handler like this: - dropzone.on("dragEnter", function() { }); - */ - this.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"]; - this.prototype.defaultOptions = { + var defaultOptions = { /** * Has to be specified on elements other than form (or when the form * doesn't have an `action` attribute). You can also @@ -205,12 +7029,13 @@ var Dropzone = function (_Emitter) { /** * The timeout for the XHR requests in milliseconds (since `v4.4.0`). + * If set to null or 0, no timeout is going to be set. */ - timeout: 30000, + timeout: null, /** * How many file uploads to process in parallel (See the - * Enqueuing file uploads* documentation section for more info) + * Enqueuing file uploads documentation section for more info) */ parallelUploads: 2, @@ -259,9 +7084,7 @@ var Dropzone = function (_Emitter) { retryChunksLimit: 3, /** - * If not `null` defines how many files this Dropzone handles. If it exceeds, - * the event `maxfilesexceeded` will be called. The dropzone element gets the - * class `dz-max-files-reached` accordingly so you can provide visual feedback. + * The maximum filesize (in bytes) that is allowed to be uploaded. */ maxFilesize: 256, @@ -296,7 +7119,7 @@ var Dropzone = function (_Emitter) { * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided. * Can be either `contain` or `crop`. */ - thumbnailMethod: 'crop', + thumbnailMethod: "crop", /** * If set, images will be resized to these dimensions before being **uploaded**. @@ -329,18 +7152,22 @@ var Dropzone = function (_Emitter) { * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided. * Can be either `contain` or `crop`. */ - resizeMethod: 'contain', + resizeMethod: "contain", /** - * The base that is used to calculate the filesize. You can change this to - * 1024 if you would rather display kibibytes, mebibytes, etc... - * 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte` not `1 kilobyte`. - * You can change this to `1024` if you don't care about validity. + * The base that is used to calculate the **displayed** filesize. You can + * change this to 1024 if you would rather display kibibytes, mebibytes, + * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte` + * not `1 kilobyte`. You can change this to `1024` if you don't care about + * validity. */ filesizeBase: 1000, /** - * Can be used to limit the maximum number of files that will be handled by this Dropzone + * If not `null` defines how many files this Dropzone handles. If it exceeds, + * the event `maxfilesexceeded` will be called. The dropzone element gets the + * class `dz-max-files-reached` accordingly so you can provide visual + * feedback. */ maxFiles: null, @@ -409,8 +7236,6 @@ var Dropzone = function (_Emitter) { */ addRemoveLinks: false, - addDownloadLinks: false, - /** * Defines where to display the file previews – if `null` the * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS @@ -419,6 +7244,11 @@ var Dropzone = function (_Emitter) { */ previewsContainer: null, + /** + * Set this to `true` if you don't want previews to be shown. + */ + disablePreviews: false, + /** * This is the element the hidden input field (which is used when clicking on the * dropzone to trigger file selection) will be appended to. This might @@ -527,14 +7357,19 @@ var Dropzone = function (_Emitter) { * Allows you to translate the different units. Starting with `tb` for terabytes and going down to * `b` for bytes. */ - dictFileSizeUnits: {tb: "TB", gb: "GB", mb: "MB", kb: "KB", b: "b"}, + dictFileSizeUnits: { + tb: "TB", + gb: "GB", + mb: "MB", + kb: "KB", + b: "b" + }, + /** * Called when dropzone initialized * You can add event listeners here */ - init: function init() { - }, - + init: function init() {}, /** * Can be an **object** of additional parameters to transfer to the server, **or** a `Function` @@ -559,7 +7394,6 @@ var Dropzone = function (_Emitter) { } }, - /** * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File) * and a `done` function as parameters. @@ -573,7 +7407,6 @@ var Dropzone = function (_Emitter) { return done(); }, - /** * The callback that will be invoked when all chunks have been uploaded for a file. * It gets the file for which the chunks have been uploaded as the first parameter, @@ -591,35 +7424,36 @@ var Dropzone = function (_Emitter) { */ fallback: function fallback() { // This code should pass in IE7... :( - var messageElement = void 0; - this.element.className = this.element.className + " dz-browser-not-supported"; + var messageElement; + this.element.className = "".concat(this.element.className, " dz-browser-not-supported"); - for (var _iterator2 = this.element.getElementsByTagName("div"), _isArray2 = true, _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { - var _ref2; + var _iterator = options_createForOfIteratorHelper(this.element.getElementsByTagName("div"), true), + _step; - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var child = _step.value; - var child = _ref2; + if (/(^| )dz-message($| )/.test(child.className)) { + messageElement = child; + child.className = "dz-message"; // Removes the 'dz-default' class - if (/(^| )dz-message($| )/.test(child.className)) { - messageElement = child; - child.className = "dz-message"; // Removes the 'dz-default' class - break; + break; + } } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } + if (!messageElement) { - messageElement = Dropzone.createElement("
"); + messageElement = Dropzone.createElement('
'); this.element.appendChild(messageElement); } var span = messageElement.getElementsByTagName("span")[0]; + if (span) { if (span.textContent != null) { span.textContent = this.options.dictFallbackMessage; @@ -631,7 +7465,6 @@ var Dropzone = function (_Emitter) { return this.element.appendChild(this.getFallbackForm()); }, - /** * Gets called to calculate the thumbnail dimensions. * @@ -651,10 +7484,8 @@ var Dropzone = function (_Emitter) { srcWidth: file.width, srcHeight: file.height }; + var srcRatio = file.width / file.height; // Automatically calculate dimensions if not specified - var srcRatio = file.width / file.height; - - // Automatically calculate dimensions if not specified if (width == null && height == null) { width = info.srcWidth; height = info.srcHeight; @@ -662,17 +7493,16 @@ var Dropzone = function (_Emitter) { width = height * srcRatio; } else if (height == null) { height = width / srcRatio; - } + } // Make sure images aren't upscaled + - // Make sure images aren't upscaled width = Math.min(width, info.srcWidth); height = Math.min(height, info.srcHeight); - var trgRatio = width / height; if (info.srcWidth > width || info.srcHeight > height) { // Image is bigger and needs rescaling - if (resizeMethod === 'crop') { + if (resizeMethod === "crop") { if (srcRatio > trgRatio) { info.srcHeight = file.height; info.srcWidth = info.srcHeight * trgRatio; @@ -680,7 +7510,7 @@ var Dropzone = function (_Emitter) { info.srcWidth = file.width; info.srcHeight = info.srcWidth / trgRatio; } - } else if (resizeMethod === 'contain') { + } else if (resizeMethod === "contain") { // Method 'contain' if (srcRatio > trgRatio) { height = width / srcRatio; @@ -688,20 +7518,17 @@ var Dropzone = function (_Emitter) { width = height * srcRatio; } } else { - throw new Error("Unknown resizeMethod '" + resizeMethod + "'"); + throw new Error("Unknown resizeMethod '".concat(resizeMethod, "'")); } } info.srcX = (file.width - info.srcWidth) / 2; info.srcY = (file.height - info.srcHeight) / 2; - info.trgWidth = width; info.trgHeight = height; - return info; }, - /** * Can be used to transform the file (for example, resize an image if necessary). * @@ -719,7 +7546,6 @@ var Dropzone = function (_Emitter) { } }, - /** * A string that contains the template used for each dropped * file. Change it to fulfill your needs but make sure to properly @@ -734,27 +7560,21 @@ var Dropzone = function (_Emitter) { * .innerHTML * */ - previewTemplate: "
\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
", - - // END OPTIONS - // (Required by the dropzone documentation parser) - + previewTemplate: preview_template, /* - Those functions register themselves to the events on init and handle all - the user interface specific stuff. Overwriting them won't break the upload - but can break the way it's displayed. - You can overwrite them if you don't like the default behavior. If you just - want to add an additional event handler, register it on the dropzone object - and don't overwrite those options. - */ - + Those functions register themselves to the events on init and handle all + the user interface specific stuff. Overwriting them won't break the upload + but can break the way it's displayed. + You can overwrite them if you don't like the default behavior. If you just + want to add an additional event handler, register it on the dropzone object + and don't overwrite those options. + */ // Those are self explanatory and simply concern the DragnDrop. drop: function drop(e) { return this.element.classList.remove("dz-drag-hover"); }, - dragstart: function dragstart(e) { - }, + dragstart: function dragstart(e) {}, dragend: function dragend(e) { return this.element.classList.remove("dz-drag-hover"); }, @@ -767,158 +7587,121 @@ var Dropzone = function (_Emitter) { dragleave: function dragleave(e) { return this.element.classList.remove("dz-drag-hover"); }, - paste: function paste(e) { - }, - - + paste: function paste(e) {}, // Called whenever there are no files left in the dropzone anymore, and the // dropzone should be displayed as if in the initial state. reset: function reset() { return this.element.classList.remove("dz-started"); }, - - // Called when a file is added to the queue // Receives `file` addedfile: function addedfile(file) { - var _this2 = this; + var _this = this; if (this.element === this.previewsContainer) { this.element.classList.add("dz-started"); } - if (this.previewsContainer) { + if (this.previewsContainer && !this.options.disablePreviews) { file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim()); file.previewTemplate = file.previewElement; // Backwards compatibility this.previewsContainer.appendChild(file.previewElement); - for (var _iterator3 = file.previewElement.querySelectorAll("[data-dz-name]"), _isArray3 = true, _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ;) { - var _ref3; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref3 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref3 = _i3.value; + var _iterator2 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-name]"), true), + _step2; + + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var node = _step2.value; + node.textContent = file.name; } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } - var node = _ref3; + var _iterator3 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-size]"), true), + _step3; - node.textContent = file.name; - } - for (var _iterator4 = file.previewElement.querySelectorAll("[data-dz-size]"), _isArray4 = true, _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator](); ;) { - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - node = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - node = _i4.value; + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + node = _step3.value; + node.innerHTML = this.filesize(file.size); } - - node.innerHTML = this.filesize(file.size); + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); } if (this.options.addRemoveLinks) { - file._removeLink = Dropzone.createElement("
" + this.options.dictRemoveFile + ""); + file._removeLink = Dropzone.createElement("".concat(this.options.dictRemoveFile, "")); file.previewElement.appendChild(file._removeLink); } - if (this.options.addDownloadLinks) { - file._downloadLink = Dropzone.createElement("" + this.options.dictRemoveFile + ""); - file.previewElement.appendChild(file._downloadLink); - } var removeFileEvent = function removeFileEvent(e) { e.preventDefault(); e.stopPropagation(); + if (file.status === Dropzone.UPLOADING) { - return Dropzone.confirm(_this2.options.dictCancelUploadConfirmation, function () { - return _this2.removeFile(file); + return Dropzone.confirm(_this.options.dictCancelUploadConfirmation, function () { + return _this.removeFile(file); }); } else { - if (_this2.options.dictRemoveFileConfirmation) { - return Dropzone.confirm(_this2.options.dictRemoveFileConfirmation, function () { - return _this2.removeFile(file); + if (_this.options.dictRemoveFileConfirmation) { + return Dropzone.confirm(_this.options.dictRemoveFileConfirmation, function () { + return _this.removeFile(file); }); } else { - return _this2.removeFile(file); + return _this.removeFile(file); } } }; - for (var _iterator5 = file.previewElement.querySelectorAll("[data-dz-remove]"), _isArray5 = true, _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator](); ;) { - var _ref4; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref4 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref4 = _i5.value; - } - - var removeLink = _ref4; - - removeLink.addEventListener("click", removeFileEvent); - } - - for (var _iterator6 = file.previewElement.querySelectorAll("[data-dz-download]"), _isArray6 = true, _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator](); ;) { - var _ref6; + var _iterator4 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-remove]"), true), + _step4; - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref6 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref6 = _i6.value; + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var removeLink = _step4.value; + removeLink.addEventListener("click", removeFileEvent); } - - var downloadLink = _ref6; - - downloadLink.addEventListener("click", function removeFileEvent(e) { - e.preventDefault(); - e.stopPropagation(); - window.open(file.full_url, '_blank'); - }); + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); } } }, - - // Called whenever a file is removed. removedfile: function removedfile(file) { if (file.previewElement != null && file.previewElement.parentNode != null) { file.previewElement.parentNode.removeChild(file.previewElement); } + return this._updateMaxFilesReachedClass(); }, - - // Called when a thumbnail has been generated // Receives `file` and `dataUrl` thumbnail: function thumbnail(file, dataUrl) { if (file.previewElement) { file.previewElement.classList.remove("dz-file-preview"); - for (var _iterator6 = file.previewElement.querySelectorAll("[data-dz-thumbnail]"), _isArray6 = true, _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator](); ;) { - var _ref5; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref5 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref5 = _i6.value; - } - var thumbnailElement = _ref5; + var _iterator5 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-thumbnail]"), true), + _step5; - thumbnailElement.alt = file.name; - thumbnailElement.src = dataUrl; + try { + for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { + var thumbnailElement = _step5.value; + thumbnailElement.alt = file.name; + thumbnailElement.src = dataUrl; + } + } catch (err) { + _iterator5.e(err); + } finally { + _iterator5.f(); } return setTimeout(function () { @@ -926,2614 +7709,2639 @@ var Dropzone = function (_Emitter) { }, 1); } }, - - // Called whenever an error occurs // Receives `file` and `message` error: function error(file, message) { if (file.previewElement) { file.previewElement.classList.add("dz-error"); - if (typeof message !== "String" && message.error) { + + if (typeof message !== "string" && message.error) { message = message.error; } - for (var _iterator7 = file.previewElement.querySelectorAll("[data-dz-errormessage]"), _isArray7 = true, _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator](); ;) { - var _ref6; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref6 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref6 = _i7.value; - } - var node = _ref6; + var _iterator6 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-errormessage]"), true), + _step6; - node.textContent = message; + try { + for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { + var node = _step6.value; + node.textContent = message; + } + } catch (err) { + _iterator6.e(err); + } finally { + _iterator6.f(); } } }, - errormultiple: function errormultiple() { - }, - - + errormultiple: function errormultiple() {}, // Called when a file gets processed. Since there is a cue, not all added // files are processed immediately. // Receives `file` processing: function processing(file) { if (file.previewElement) { file.previewElement.classList.add("dz-processing"); + if (file._removeLink) { return file._removeLink.innerHTML = this.options.dictCancelUpload; } } }, - processingmultiple: function processingmultiple() { - }, - - + processingmultiple: function processingmultiple() {}, // Called whenever the upload progress gets updated. // Receives `file`, `progress` (percentage 0-100) and `bytesSent`. // To get the total number of bytes of the file, use `file.size` uploadprogress: function uploadprogress(file, progress, bytesSent) { if (file.previewElement) { - for (var _iterator8 = file.previewElement.querySelectorAll("[data-dz-uploadprogress]"), _isArray8 = true, _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator](); ;) { - var _ref7; + var _iterator7 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-uploadprogress]"), true), + _step7; + + try { + for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) { + var node = _step7.value; + node.nodeName === "PROGRESS" ? node.value = progress : node.style.width = "".concat(progress, "%"); + } + } catch (err) { + _iterator7.e(err); + } finally { + _iterator7.f(); + } + } + }, + // Called whenever the total upload progress gets updated. + // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent + totaluploadprogress: function totaluploadprogress() {}, + // Called just before the file is sent. Gets the `xhr` object as second + // parameter, so you can modify it (for example to add a CSRF token) and a + // `formData` object to add additional information. + sending: function sending() {}, + sendingmultiple: function sendingmultiple() {}, + // When the complete upload is finished and successful + // Receives `file` + success: function success(file) { + if (file.previewElement) { + return file.previewElement.classList.add("dz-success"); + } + }, + successmultiple: function successmultiple() {}, + // When the upload is canceled. + canceled: function canceled(file) { + return this.emit("error", file, this.options.dictUploadCanceled); + }, + canceledmultiple: function canceledmultiple() {}, + // When the upload is finished, either with success or an error. + // Receives `file` + complete: function complete(file) { + if (file._removeLink) { + file._removeLink.innerHTML = this.options.dictRemoveFile; + } + + if (file.previewElement) { + return file.previewElement.classList.add("dz-complete"); + } + }, + completemultiple: function completemultiple() {}, + maxfilesexceeded: function maxfilesexceeded() {}, + maxfilesreached: function maxfilesreached() {}, + queuecomplete: function queuecomplete() {}, + addedfiles: function addedfiles() {} + }; + /* harmony default export */ var src_options = (defaultOptions); + ;// CONCATENATED MODULE: ./src/dropzone.js + function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + function dropzone_createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = dropzone_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + + function dropzone_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return dropzone_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return dropzone_arrayLikeToArray(o, minLen); } + + function dropzone_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function dropzone_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function dropzone_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + + function dropzone_createClass(Constructor, protoProps, staticProps) { if (protoProps) dropzone_defineProperties(Constructor.prototype, protoProps); if (staticProps) dropzone_defineProperties(Constructor, staticProps); return Constructor; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + + function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + + function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + + function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + + function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + + + + + var Dropzone = /*#__PURE__*/function (_Emitter) { + _inherits(Dropzone, _Emitter); + + var _super = _createSuper(Dropzone); + + function Dropzone(el, options) { + var _this; + + dropzone_classCallCheck(this, Dropzone); + + _this = _super.call(this); + var fallback, left; + _this.element = el; // For backwards compatibility since the version was in the prototype previously + + _this.version = Dropzone.version; + _this.clickableElements = []; + _this.listeners = []; + _this.files = []; // All files + + if (typeof _this.element === "string") { + _this.element = document.querySelector(_this.element); + } // Not checking if instance of HTMLElement or Element since IE9 is extremely weird. + + + if (!_this.element || _this.element.nodeType == null) { + throw new Error("Invalid dropzone element."); + } + + if (_this.element.dropzone) { + throw new Error("Dropzone already attached."); + } // Now add this dropzone to the instances. + + + Dropzone.instances.push(_assertThisInitialized(_this)); // Put the dropzone inside the element itself. + + _this.element.dropzone = _assertThisInitialized(_this); + var elementOptions = (left = Dropzone.optionsForElement(_this.element)) != null ? left : {}; + _this.options = Dropzone.extend({}, src_options, elementOptions, options != null ? options : {}); + _this.options.previewTemplate = _this.options.previewTemplate.replace(/\n*/g, ""); // If the browser failed, just call the fallback and leave + + if (_this.options.forceFallback || !Dropzone.isBrowserSupported()) { + return _possibleConstructorReturn(_this, _this.options.fallback.call(_assertThisInitialized(_this))); + } // @options.url = @element.getAttribute "action" unless @options.url? + + + if (_this.options.url == null) { + _this.options.url = _this.element.getAttribute("action"); + } + + if (!_this.options.url) { + throw new Error("No URL provided."); + } + + if (_this.options.acceptedFiles && _this.options.acceptedMimeTypes) { + throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated."); + } + + if (_this.options.uploadMultiple && _this.options.chunking) { + throw new Error("You cannot set both: uploadMultiple and chunking."); + } // Backwards compatibility + + + if (_this.options.acceptedMimeTypes) { + _this.options.acceptedFiles = _this.options.acceptedMimeTypes; + delete _this.options.acceptedMimeTypes; + } // Backwards compatibility + + + if (_this.options.renameFilename != null) { + _this.options.renameFile = function (file) { + return _this.options.renameFilename.call(_assertThisInitialized(_this), file.name, file); + }; + } + + if (typeof _this.options.method === "string") { + _this.options.method = _this.options.method.toUpperCase(); + } + + if ((fallback = _this.getExistingFallback()) && fallback.parentNode) { + // Remove the fallback + fallback.parentNode.removeChild(fallback); + } // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false + + + if (_this.options.previewsContainer !== false) { + if (_this.options.previewsContainer) { + _this.previewsContainer = Dropzone.getElement(_this.options.previewsContainer, "previewsContainer"); + } else { + _this.previewsContainer = _this.element; + } + } + + if (_this.options.clickable) { + if (_this.options.clickable === true) { + _this.clickableElements = [_this.element]; + } else { + _this.clickableElements = Dropzone.getElements(_this.options.clickable, "clickable"); + } + } + + _this.init(); + + return _this; + } // Returns all files that have been accepted + + + dropzone_createClass(Dropzone, [{ + key: "getAcceptedFiles", + value: function getAcceptedFiles() { + return this.files.filter(function (file) { + return file.accepted; + }).map(function (file) { + return file; + }); + } // Returns all files that have been rejected + // Not sure when that's going to be useful, but added for completeness. + + }, { + key: "getRejectedFiles", + value: function getRejectedFiles() { + return this.files.filter(function (file) { + return !file.accepted; + }).map(function (file) { + return file; + }); + } + }, { + key: "getFilesWithStatus", + value: function getFilesWithStatus(status) { + return this.files.filter(function (file) { + return file.status === status; + }).map(function (file) { + return file; + }); + } // Returns all files that are in the queue + + }, { + key: "getQueuedFiles", + value: function getQueuedFiles() { + return this.getFilesWithStatus(Dropzone.QUEUED); + } + }, { + key: "getUploadingFiles", + value: function getUploadingFiles() { + return this.getFilesWithStatus(Dropzone.UPLOADING); + } + }, { + key: "getAddedFiles", + value: function getAddedFiles() { + return this.getFilesWithStatus(Dropzone.ADDED); + } // Files that are either queued or uploading + + }, { + key: "getActiveFiles", + value: function getActiveFiles() { + return this.files.filter(function (file) { + return file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED; + }).map(function (file) { + return file; + }); + } // The function that gets called when Dropzone is initialized. You + // can (and should) setup event listeners inside this function. + + }, { + key: "init", + value: function init() { + var _this2 = this; + + // In case it isn't set already + if (this.element.tagName === "form") { + this.element.setAttribute("enctype", "multipart/form-data"); + } + + if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) { + this.element.appendChild(Dropzone.createElement("
"))); + } + + if (this.clickableElements.length) { + var setupHiddenFileInput = function setupHiddenFileInput() { + if (_this2.hiddenFileInput) { + _this2.hiddenFileInput.parentNode.removeChild(_this2.hiddenFileInput); + } + + _this2.hiddenFileInput = document.createElement("input"); + + _this2.hiddenFileInput.setAttribute("type", "file"); - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref7 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref7 = _i8.value; - } + if (_this2.options.maxFiles === null || _this2.options.maxFiles > 1) { + _this2.hiddenFileInput.setAttribute("multiple", "multiple"); + } - var node = _ref7; + _this2.hiddenFileInput.className = "dz-hidden-input"; - node.nodeName === 'PROGRESS' ? node.value = progress : node.style.width = progress + "%"; - } - } - }, + if (_this2.options.acceptedFiles !== null) { + _this2.hiddenFileInput.setAttribute("accept", _this2.options.acceptedFiles); + } + if (_this2.options.capture !== null) { + _this2.hiddenFileInput.setAttribute("capture", _this2.options.capture); + } // Making sure that no one can "tab" into this field. - // Called whenever the total upload progress gets updated. - // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent - totaluploadprogress: function totaluploadprogress() { - }, + _this2.hiddenFileInput.setAttribute("tabindex", "-1"); // Not setting `display="none"` because some browsers don't accept clicks + // on elements that aren't displayed. - // Called just before the file is sent. Gets the `xhr` object as second - // parameter, so you can modify it (for example to add a CSRF token) and a - // `formData` object to add additional information. - sending: function sending() { - }, - sendingmultiple: function sendingmultiple() { - }, + _this2.hiddenFileInput.style.visibility = "hidden"; + _this2.hiddenFileInput.style.position = "absolute"; + _this2.hiddenFileInput.style.top = "0"; + _this2.hiddenFileInput.style.left = "0"; + _this2.hiddenFileInput.style.height = "0"; + _this2.hiddenFileInput.style.width = "0"; + Dropzone.getElement(_this2.options.hiddenInputContainer, "hiddenInputContainer").appendChild(_this2.hiddenFileInput); - // When the complete upload is finished and successful - // Receives `file` - success: function success(file) { - if (file.previewElement) { - return file.previewElement.classList.add("dz-success"); - } - }, - successmultiple: function successmultiple() { - }, + _this2.hiddenFileInput.addEventListener("change", function () { + var files = _this2.hiddenFileInput.files; + if (files.length) { + var _iterator = dropzone_createForOfIteratorHelper(files, true), + _step; - // When the upload is canceled. - canceled: function canceled(file) { - return this.emit("error", file, this.options.dictUploadCanceled); - }, - canceledmultiple: function canceledmultiple() { - }, + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var file = _step.value; + _this2.addFile(file); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } - // When the upload is finished, either with success or an error. - // Receives `file` - complete: function complete(file) { - if (file._removeLink) { - file._removeLink.innerHTML = this.options.dictRemoveFile; - } - if (file.previewElement) { - return file.previewElement.classList.add("dz-complete"); - } - }, - completemultiple: function completemultiple() { - }, - maxfilesexceeded: function maxfilesexceeded() { - }, - maxfilesreached: function maxfilesreached() { - }, - queuecomplete: function queuecomplete() { - }, - addedfiles: function addedfiles() { - } - }; + _this2.emit("addedfiles", files); - this.prototype._thumbnailQueue = []; - this.prototype._processingThumbnail = false; - } + setupHiddenFileInput(); + }); + }; - // global utility + setupHiddenFileInput(); + } - }, { - key: "extend", - value: function extend(target) { - for (var _len2 = arguments.length, objects = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - objects[_key2 - 1] = arguments[_key2]; - } + this.URL = window.URL !== null ? window.URL : window.webkitURL; // Setup all event listeners on the Dropzone object itself. + // They're not in @setupEventListeners() because they shouldn't be removed + // again when the dropzone gets disabled. - for (var _iterator9 = objects, _isArray9 = true, _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator](); ;) { - var _ref8; + var _iterator2 = dropzone_createForOfIteratorHelper(this.events, true), + _step2; - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref8 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref8 = _i9.value; - } + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var eventName = _step2.value; + this.on(eventName, this.options[eventName]); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + + this.on("uploadprogress", function () { + return _this2.updateTotalUploadProgress(); + }); + this.on("removedfile", function () { + return _this2.updateTotalUploadProgress(); + }); + this.on("canceled", function (file) { + return _this2.emit("complete", file); + }); // Emit a `queuecomplete` event if all files finished uploading. + + this.on("complete", function (file) { + if (_this2.getAddedFiles().length === 0 && _this2.getUploadingFiles().length === 0 && _this2.getQueuedFiles().length === 0) { + // This needs to be deferred so that `queuecomplete` really triggers after `complete` + return setTimeout(function () { + return _this2.emit("queuecomplete"); + }, 0); + } + }); + + var containsFiles = function containsFiles(e) { + if (e.dataTransfer.types) { + // Because e.dataTransfer.types is an Object in + // IE, we need to iterate like this instead of + // using e.dataTransfer.types.some() + for (var i = 0; i < e.dataTransfer.types.length; i++) { + if (e.dataTransfer.types[i] === "Files") return true; + } + } - var object = _ref8; + return false; + }; - for (var key in object) { - var val = object[key]; - target[key] = val; - } - } - return target; - } - }]); + var noPropagation = function noPropagation(e) { + // If there are no files, we don't want to stop + // propagation so we don't interfere with other + // drag and drop behaviour. + if (!containsFiles(e)) return; + e.stopPropagation(); - function Dropzone(el, options) { - _classCallCheck(this, Dropzone); + if (e.preventDefault) { + return e.preventDefault(); + } else { + return e.returnValue = false; + } + }; // Create the listeners + + + this.listeners = [{ + element: this.element, + events: { + dragstart: function dragstart(e) { + return _this2.emit("dragstart", e); + }, + dragenter: function dragenter(e) { + noPropagation(e); + return _this2.emit("dragenter", e); + }, + dragover: function dragover(e) { + // Makes it possible to drag files from chrome's download bar + // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar + // Try is required to prevent bug in Internet Explorer 11 (SCRIPT65535 exception) + var efct; + + try { + efct = e.dataTransfer.effectAllowed; + } catch (error) {} + + e.dataTransfer.dropEffect = "move" === efct || "linkMove" === efct ? "move" : "copy"; + noPropagation(e); + return _this2.emit("dragover", e); + }, + dragleave: function dragleave(e) { + return _this2.emit("dragleave", e); + }, + drop: function drop(e) { + noPropagation(e); + return _this2.drop(e); + }, + dragend: function dragend(e) { + return _this2.emit("dragend", e); + } + } // This is disabled right now, because the browsers don't implement it properly. + // "paste": (e) => + // noPropagation e + // @paste e + + }]; + this.clickableElements.forEach(function (clickableElement) { + return _this2.listeners.push({ + element: clickableElement, + events: { + click: function click(evt) { + // Only the actual dropzone or the message element should trigger file selection + if (clickableElement !== _this2.element || evt.target === _this2.element || Dropzone.elementInside(evt.target, _this2.element.querySelector(".dz-message"))) { + _this2.hiddenFileInput.click(); // Forward the click + + } + + return true; + } + } + }); + }); + this.enable(); + return this.options.init.call(this); + } // Not fully tested yet + + }, { + key: "destroy", + value: function destroy() { + this.disable(); + this.removeAllFiles(true); + + if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) { + this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput); + this.hiddenFileInput = null; + } - var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this)); + delete this.element.dropzone; + return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1); + } + }, { + key: "updateTotalUploadProgress", + value: function updateTotalUploadProgress() { + var totalUploadProgress; + var totalBytesSent = 0; + var totalBytes = 0; + var activeFiles = this.getActiveFiles(); + + if (activeFiles.length) { + var _iterator3 = dropzone_createForOfIteratorHelper(this.getActiveFiles(), true), + _step3; + + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var file = _step3.value; + totalBytesSent += file.upload.bytesSent; + totalBytes += file.upload.total; + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } - var fallback = void 0, - left = void 0; - _this.element = el; - // For backwards compatibility since the version was in the prototype previously - _this.version = Dropzone.version; + totalUploadProgress = 100 * totalBytesSent / totalBytes; + } else { + totalUploadProgress = 100; + } - _this.defaultOptions.previewTemplate = _this.defaultOptions.previewTemplate.replace(/\n*/g, ""); + return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent); + } // @options.paramName can be a function taking one parameter rather than a string. + // A parameter name for a file is obtained simply by calling this with an index number. - _this.clickableElements = []; - _this.listeners = []; - _this.files = []; // All files + }, { + key: "_getParamName", + value: function _getParamName(n) { + if (typeof this.options.paramName === "function") { + return this.options.paramName(n); + } else { + return "".concat(this.options.paramName).concat(this.options.uploadMultiple ? "[".concat(n, "]") : ""); + } + } // If @options.renameFile is a function, + // the function will be used to rename the file.name before appending it to the formData + + }, { + key: "_renameFile", + value: function _renameFile(file) { + if (typeof this.options.renameFile !== "function") { + return file.name; + } - if (typeof _this.element === "string") { - _this.element = document.querySelector(_this.element); - } + return this.options.renameFile(file); + } // Returns a form that can be used as fallback if the browser does not support DragnDrop + // + // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided. + // This code has to pass in IE7 :( - // Not checking if instance of HTMLElement or Element since IE9 is extremely weird. - if (!_this.element || _this.element.nodeType == null) { - throw new Error("Invalid dropzone element."); - } + }, { + key: "getFallbackForm", + value: function getFallbackForm() { + var existingFallback, form; - if (_this.element.dropzone) { - throw new Error("Dropzone already attached."); - } + if (existingFallback = this.getExistingFallback()) { + return existingFallback; + } - // Now add this dropzone to the instances. - Dropzone.instances.push(_this); + var fieldsString = '
'; - // Put the dropzone inside the element itself. - _this.element.dropzone = _this; + if (this.options.dictFallbackText) { + fieldsString += "

".concat(this.options.dictFallbackText, "

"); + } - var elementOptions = (left = Dropzone.optionsForElement(_this.element)) != null ? left : {}; + fieldsString += "
"); + var fields = Dropzone.createElement(fieldsString); - _this.options = Dropzone.extend({}, _this.defaultOptions, elementOptions, options != null ? options : {}); + if (this.element.tagName !== "FORM") { + form = Dropzone.createElement("
")); + form.appendChild(fields); + } else { + // Make sure that the enctype and method attributes are set properly + this.element.setAttribute("enctype", "multipart/form-data"); + this.element.setAttribute("method", this.options.method); + } - // If the browser failed, just call the fallback and leave - if (_this.options.forceFallback || !Dropzone.isBrowserSupported()) { - var _ret; + return form != null ? form : fields; + } // Returns the fallback elements if they exist already + // + // This code has to pass in IE7 :( - return _ret = _this.options.fallback.call(_this), _possibleConstructorReturn(_this, _ret); - } + }, { + key: "getExistingFallback", + value: function getExistingFallback() { + var getFallback = function getFallback(elements) { + var _iterator4 = dropzone_createForOfIteratorHelper(elements, true), + _step4; - // @options.url = @element.getAttribute "action" unless @options.url? - if (_this.options.url == null) { - _this.options.url = _this.element.getAttribute("action"); - } + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var el = _step4.value; - if (!_this.options.url) { - throw new Error("No URL provided."); - } + if (/(^| )fallback($| )/.test(el.className)) { + return el; + } + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + }; - if (_this.options.acceptedFiles && _this.options.acceptedMimeTypes) { - throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated."); - } + for (var _i = 0, _arr = ["div", "form"]; _i < _arr.length; _i++) { + var tagName = _arr[_i]; + var fallback; - if (_this.options.uploadMultiple && _this.options.chunking) { - throw new Error('You cannot set both: uploadMultiple and chunking.'); - } + if (fallback = getFallback(this.element.getElementsByTagName(tagName))) { + return fallback; + } + } + } // Activates all listeners stored in @listeners + + }, { + key: "setupEventListeners", + value: function setupEventListeners() { + return this.listeners.map(function (elementListeners) { + return function () { + var result = []; + + for (var event in elementListeners.events) { + var listener = elementListeners.events[event]; + result.push(elementListeners.element.addEventListener(event, listener, false)); + } - // Backwards compatibility - if (_this.options.acceptedMimeTypes) { - _this.options.acceptedFiles = _this.options.acceptedMimeTypes; - delete _this.options.acceptedMimeTypes; - } + return result; + }(); + }); + } // Deactivates all listeners stored in @listeners + + }, { + key: "removeEventListeners", + value: function removeEventListeners() { + return this.listeners.map(function (elementListeners) { + return function () { + var result = []; + + for (var event in elementListeners.events) { + var listener = elementListeners.events[event]; + result.push(elementListeners.element.removeEventListener(event, listener, false)); + } - // Backwards compatibility - if (_this.options.renameFilename != null) { - _this.options.renameFile = function (file) { - return _this.options.renameFilename.call(_this, file.name, file); - }; - } + return result; + }(); + }); + } // Removes all event listeners and cancels all files in the queue or being processed. - _this.options.method = _this.options.method.toUpperCase(); + }, { + key: "disable", + value: function disable() { + var _this3 = this; - if ((fallback = _this.getExistingFallback()) && fallback.parentNode) { - // Remove the fallback - fallback.parentNode.removeChild(fallback); - } + this.clickableElements.forEach(function (element) { + return element.classList.remove("dz-clickable"); + }); + this.removeEventListeners(); + this.disabled = true; + return this.files.map(function (file) { + return _this3.cancelUpload(file); + }); + } + }, { + key: "enable", + value: function enable() { + delete this.disabled; + this.clickableElements.forEach(function (element) { + return element.classList.add("dz-clickable"); + }); + return this.setupEventListeners(); + } // Returns a nicely formatted filesize + + }, { + key: "filesize", + value: function filesize(size) { + var selectedSize = 0; + var selectedUnit = "b"; + + if (size > 0) { + var units = ["tb", "gb", "mb", "kb", "b"]; + + for (var i = 0; i < units.length; i++) { + var unit = units[i]; + var cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10; + + if (size >= cutoff) { + selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i); + selectedUnit = unit; + break; + } + } - // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false - if (_this.options.previewsContainer !== false) { - if (_this.options.previewsContainer) { - _this.previewsContainer = Dropzone.getElement(_this.options.previewsContainer, "previewsContainer"); - } else { - _this.previewsContainer = _this.element; - } - } + selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits + } - if (_this.options.clickable) { - if (_this.options.clickable === true) { - _this.clickableElements = [_this.element]; - } else { - _this.clickableElements = Dropzone.getElements(_this.options.clickable, "clickable"); - } - } + return "".concat(selectedSize, " ").concat(this.options.dictFileSizeUnits[selectedUnit]); + } // Adds or removes the `dz-max-files-reached` class from the form. - _this.init(); - return _this; - } + }, { + key: "_updateMaxFilesReachedClass", + value: function _updateMaxFilesReachedClass() { + if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { + if (this.getAcceptedFiles().length === this.options.maxFiles) { + this.emit("maxfilesreached", this.files); + } - // Returns all files that have been accepted + return this.element.classList.add("dz-max-files-reached"); + } else { + return this.element.classList.remove("dz-max-files-reached"); + } + } + }, { + key: "drop", + value: function drop(e) { + if (!e.dataTransfer) { + return; + } + this.emit("drop", e); // Convert the FileList to an Array + // This is necessary for IE11 - _createClass(Dropzone, [{ - key: "getAcceptedFiles", - value: function getAcceptedFiles() { - return this.files.filter(function (file) { - return file.accepted; - }).map(function (file) { - return file; - }); - } - - // Returns all files that have been rejected - // Not sure when that's going to be useful, but added for completeness. - - }, { - key: "getRejectedFiles", - value: function getRejectedFiles() { - return this.files.filter(function (file) { - return !file.accepted; - }).map(function (file) { - return file; - }); - } - }, { - key: "getFilesWithStatus", - value: function getFilesWithStatus(status) { - return this.files.filter(function (file) { - return file.status === status; - }).map(function (file) { - return file; - }); - } - - // Returns all files that are in the queue - - }, { - key: "getQueuedFiles", - value: function getQueuedFiles() { - return this.getFilesWithStatus(Dropzone.QUEUED); - } - }, { - key: "getUploadingFiles", - value: function getUploadingFiles() { - return this.getFilesWithStatus(Dropzone.UPLOADING); - } - }, { - key: "getAddedFiles", - value: function getAddedFiles() { - return this.getFilesWithStatus(Dropzone.ADDED); - } - - // Files that are either queued or uploading - - }, { - key: "getActiveFiles", - value: function getActiveFiles() { - return this.files.filter(function (file) { - return file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED; - }).map(function (file) { - return file; - }); - } + var files = []; - // The function that gets called when Dropzone is initialized. You - // can (and should) setup event listeners inside this function. + for (var i = 0; i < e.dataTransfer.files.length; i++) { + files[i] = e.dataTransfer.files[i]; + } // Even if it's a folder, files.length will contain the folders. - }, { - key: "init", - value: function init() { - var _this3 = this; - // In case it isn't set already - if (this.element.tagName === "form") { - this.element.setAttribute("enctype", "multipart/form-data"); - } + if (files.length) { + var items = e.dataTransfer.items; - if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) { - this.element.appendChild(Dropzone.createElement("
" + this.options.dictDefaultMessage + "
")); - } + if (items && items.length && items[0].webkitGetAsEntry != null) { + // The browser supports dropping of folders, so handle items instead of files + this._addFilesFromItems(items); + } else { + this.handleFiles(files); + } + } - if (this.clickableElements.length) { - var setupHiddenFileInput = function setupHiddenFileInput() { - if (_this3.hiddenFileInput) { - _this3.hiddenFileInput.parentNode.removeChild(_this3.hiddenFileInput); - } - _this3.hiddenFileInput = document.createElement("input"); - _this3.hiddenFileInput.setAttribute("type", "file"); - if (_this3.options.maxFiles === null || _this3.options.maxFiles > 1) { - _this3.hiddenFileInput.setAttribute("multiple", "multiple"); + this.emit("addedfiles", files); } - _this3.hiddenFileInput.className = "dz-hidden-input"; + }, { + key: "paste", + value: function paste(e) { + if (__guard__(e != null ? e.clipboardData : undefined, function (x) { + return x.items; + }) == null) { + return; + } - if (_this3.options.acceptedFiles !== null) { - _this3.hiddenFileInput.setAttribute("accept", _this3.options.acceptedFiles); - } - if (_this3.options.capture !== null) { - _this3.hiddenFileInput.setAttribute("capture", _this3.options.capture); + this.emit("paste", e); + var items = e.clipboardData.items; + + if (items.length) { + return this._addFilesFromItems(items); + } } + }, { + key: "handleFiles", + value: function handleFiles(files) { + var _iterator5 = dropzone_createForOfIteratorHelper(files, true), + _step5; + + try { + for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { + var file = _step5.value; + this.addFile(file); + } + } catch (err) { + _iterator5.e(err); + } finally { + _iterator5.f(); + } + } // When a folder is dropped (or files are pasted), items must be handled + // instead of files. + + }, { + key: "_addFilesFromItems", + value: function _addFilesFromItems(items) { + var _this4 = this; + + return function () { + var result = []; + + var _iterator6 = dropzone_createForOfIteratorHelper(items, true), + _step6; + + try { + for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { + var item = _step6.value; + var entry; + + if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) { + if (entry.isFile) { + result.push(_this4.addFile(item.getAsFile())); + } else if (entry.isDirectory) { + // Append all files from that directory to files + result.push(_this4._addFilesFromDirectory(entry, entry.name)); + } else { + result.push(undefined); + } + } else if (item.getAsFile != null) { + if (item.kind == null || item.kind === "file") { + result.push(_this4.addFile(item.getAsFile())); + } else { + result.push(undefined); + } + } else { + result.push(undefined); + } + } + } catch (err) { + _iterator6.e(err); + } finally { + _iterator6.f(); + } - // Not setting `display="none"` because some browsers don't accept clicks - // on elements that aren't displayed. - _this3.hiddenFileInput.style.visibility = "hidden"; - _this3.hiddenFileInput.style.position = "absolute"; - _this3.hiddenFileInput.style.top = "0"; - _this3.hiddenFileInput.style.left = "0"; - _this3.hiddenFileInput.style.height = "0"; - _this3.hiddenFileInput.style.width = "0"; - Dropzone.getElement(_this3.options.hiddenInputContainer, 'hiddenInputContainer').appendChild(_this3.hiddenFileInput); - return _this3.hiddenFileInput.addEventListener("change", function () { - var files = _this3.hiddenFileInput.files; + return result; + }(); + } // Goes through the directory, and adds each file it finds recursively - if (files.length) { - for (var _iterator10 = files, _isArray10 = true, _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator](); ;) { - var _ref9; + }, { + key: "_addFilesFromDirectory", + value: function _addFilesFromDirectory(directory, path) { + var _this5 = this; - if (_isArray10) { - if (_i10 >= _iterator10.length) break; - _ref9 = _iterator10[_i10++]; - } else { - _i10 = _iterator10.next(); - if (_i10.done) break; - _ref9 = _i10.value; + var dirReader = directory.createReader(); + + var errorHandler = function errorHandler(error) { + return __guardMethod__(console, "log", function (o) { + return o.log(error); + }); + }; + + var readEntries = function readEntries() { + return dirReader.readEntries(function (entries) { + if (entries.length > 0) { + var _iterator7 = dropzone_createForOfIteratorHelper(entries, true), + _step7; + + try { + for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) { + var entry = _step7.value; + + if (entry.isFile) { + entry.file(function (file) { + if (_this5.options.ignoreHiddenFiles && file.name.substring(0, 1) === ".") { + return; + } + + file.fullPath = "".concat(path, "/").concat(file.name); + return _this5.addFile(file); + }); + } else if (entry.isDirectory) { + _this5._addFilesFromDirectory(entry, "".concat(path, "/").concat(entry.name)); + } + } // Recursively call readEntries() again, since browser only handle + // the first 100 entries. + // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries + + } catch (err) { + _iterator7.e(err); + } finally { + _iterator7.f(); + } + + readEntries(); } - var file = _ref9; + return null; + }, errorHandler); + }; - _this3.addFile(file); - } + return readEntries(); + } // If `done()` is called without argument the file is accepted + // If you call it with an error message, the file is rejected + // (This allows for asynchronous validation) + // + // This function checks the filesize, and if the file.type passes the + // `acceptedFiles` check. + + }, { + key: "accept", + value: function accept(file, done) { + if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1024 * 1024) { + done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize)); + } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) { + done(this.options.dictInvalidFileType); + } else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { + done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles)); + this.emit("maxfilesexceeded", file); + } else { + this.options.accept.call(this, file, done); } - _this3.emit("addedfiles", files); - return setupHiddenFileInput(); - }); - }; - setupHiddenFileInput(); - } + } + }, { + key: "addFile", + value: function addFile(file) { + var _this6 = this; - this.URL = window.URL !== null ? window.URL : window.webkitURL; + file.upload = { + uuid: Dropzone.uuidv4(), + progress: 0, + // Setting the total upload size to file.size for the beginning + // It's actual different than the size to be transmitted. + total: file.size, + bytesSent: 0, + filename: this._renameFile(file) // Not setting chunking information here, because the acutal data — and + // thus the chunks — might change if `options.transformFile` is set + // and does something to the data. - // Setup all event listeners on the Dropzone object itself. - // They're not in @setupEventListeners() because they shouldn't be removed - // again when the dropzone gets disabled. - for (var _iterator11 = this.events, _isArray11 = true, _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator](); ;) { - var _ref10; + }; + this.files.push(file); + file.status = Dropzone.ADDED; + this.emit("addedfile", file); - if (_isArray11) { - if (_i11 >= _iterator11.length) break; - _ref10 = _iterator11[_i11++]; - } else { - _i11 = _iterator11.next(); - if (_i11.done) break; - _ref10 = _i11.value; - } + this._enqueueThumbnail(file); - var eventName = _ref10; + this.accept(file, function (error) { + if (error) { + file.accepted = false; - this.on(eventName, this.options[eventName]); - } + _this6._errorProcessing([file], error); // Will set the file.status - this.on("uploadprogress", function () { - return _this3.updateTotalUploadProgress(); - }); + } else { + file.accepted = true; - this.on("removedfile", function () { - return _this3.updateTotalUploadProgress(); - }); + if (_this6.options.autoQueue) { + _this6.enqueueFile(file); + } // Will set .accepted = true - this.on("canceled", function (file) { - return _this3.emit("complete", file); - }); + } - // Emit a `queuecomplete` event if all files finished uploading. - this.on("complete", function (file) { - if (_this3.getAddedFiles().length === 0 && _this3.getUploadingFiles().length === 0 && _this3.getQueuedFiles().length === 0) { - // This needs to be deferred so that `queuecomplete` really triggers after `complete` - return setTimeout(function () { - return _this3.emit("queuecomplete"); - }, 0); - } - }); + _this6._updateMaxFilesReachedClass(); + }); + } // Wrapper for enqueueFile - var noPropagation = function noPropagation(e) { - e.stopPropagation(); - if (e.preventDefault) { - return e.preventDefault(); - } else { - return e.returnValue = false; - } - }; + }, { + key: "enqueueFiles", + value: function enqueueFiles(files) { + var _iterator8 = dropzone_createForOfIteratorHelper(files, true), + _step8; - // Create the listeners - this.listeners = [{ - element: this.element, - events: { - "dragstart": function dragstart(e) { - return _this3.emit("dragstart", e); - }, - "dragenter": function dragenter(e) { - noPropagation(e); - return _this3.emit("dragenter", e); - }, - "dragover": function dragover(e) { - // Makes it possible to drag files from chrome's download bar - // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar - // Try is required to prevent bug in Internet Explorer 11 (SCRIPT65535 exception) - var efct = void 0; try { - efct = e.dataTransfer.effectAllowed; - } catch (error) { + for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) { + var file = _step8.value; + this.enqueueFile(file); + } + } catch (err) { + _iterator8.e(err); + } finally { + _iterator8.f(); } - e.dataTransfer.dropEffect = 'move' === efct || 'linkMove' === efct ? 'move' : 'copy'; - noPropagation(e); - return _this3.emit("dragover", e); - }, - "dragleave": function dragleave(e) { - return _this3.emit("dragleave", e); - }, - "drop": function drop(e) { - noPropagation(e); - return _this3.drop(e); - }, - "dragend": function dragend(e) { - return _this3.emit("dragend", e); + return null; + } + }, { + key: "enqueueFile", + value: function enqueueFile(file) { + var _this7 = this; + + if (file.status === Dropzone.ADDED && file.accepted === true) { + file.status = Dropzone.QUEUED; + + if (this.options.autoProcessQueue) { + return setTimeout(function () { + return _this7.processQueue(); + }, 0); // Deferring the call + } + } else { + throw new Error("This file can't be queued because it has already been processed or was rejected."); + } } + }, { + key: "_enqueueThumbnail", + value: function _enqueueThumbnail(file) { + var _this8 = this; - // This is disabled right now, because the browsers don't implement it properly. - // "paste": (e) => - // noPropagation e - // @paste e - } - }]; + if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) { + this._thumbnailQueue.push(file); - this.clickableElements.forEach(function (clickableElement) { - return _this3.listeners.push({ - element: clickableElement, - events: { - "click": function click(evt) { - // Only the actual dropzone or the message element should trigger file selection - if (clickableElement !== _this3.element || evt.target === _this3.element || Dropzone.elementInside(evt.target, _this3.element.querySelector(".dz-message"))) { - _this3.hiddenFileInput.click(); // Forward the click - } - return true; + return setTimeout(function () { + return _this8._processThumbnailQueue(); + }, 0); // Deferring the call } } - }); - }); + }, { + key: "_processThumbnailQueue", + value: function _processThumbnailQueue() { + var _this9 = this; - this.enable(); + if (this._processingThumbnail || this._thumbnailQueue.length === 0) { + return; + } - return this.options.init.call(this); - } + this._processingThumbnail = true; - // Not fully tested yet + var file = this._thumbnailQueue.shift(); - }, { - key: "destroy", - value: function destroy() { - this.disable(); - this.removeAllFiles(true); - if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) { - this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput); - this.hiddenFileInput = null; - } - delete this.element.dropzone; - return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1); - } - }, { - key: "updateTotalUploadProgress", - value: function updateTotalUploadProgress() { - var totalUploadProgress = void 0; - var totalBytesSent = 0; - var totalBytes = 0; - - var activeFiles = this.getActiveFiles(); - - if (activeFiles.length) { - for (var _iterator12 = this.getActiveFiles(), _isArray12 = true, _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator](); ;) { - var _ref11; - - if (_isArray12) { - if (_i12 >= _iterator12.length) break; - _ref11 = _iterator12[_i12++]; - } else { - _i12 = _iterator12.next(); - if (_i12.done) break; - _ref11 = _i12.value; - } + return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, function (dataUrl) { + _this9.emit("thumbnail", file, dataUrl); - var file = _ref11; + _this9._processingThumbnail = false; + return _this9._processThumbnailQueue(); + }); + } // Can be called by the user to remove a file - totalBytesSent += file.upload.bytesSent; - totalBytes += file.upload.total; - } - totalUploadProgress = 100 * totalBytesSent / totalBytes; - } else { - totalUploadProgress = 100; - } + }, { + key: "removeFile", + value: function removeFile(file) { + if (file.status === Dropzone.UPLOADING) { + this.cancelUpload(file); + } - return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent); - } + this.files = without(this.files, file); + this.emit("removedfile", file); - // @options.paramName can be a function taking one parameter rather than a string. - // A parameter name for a file is obtained simply by calling this with an index number. + if (this.files.length === 0) { + return this.emit("reset"); + } + } // Removes all files that aren't currently processed from the list + + }, { + key: "removeAllFiles", + value: function removeAllFiles(cancelIfNecessary) { + // Create a copy of files since removeFile() changes the @files array. + if (cancelIfNecessary == null) { + cancelIfNecessary = false; + } - }, { - key: "_getParamName", - value: function _getParamName(n) { - if (typeof this.options.paramName === "function") { - return this.options.paramName(n); - } else { - return "" + this.options.paramName + (this.options.uploadMultiple ? "[" + n + "]" : ""); - } - } + var _iterator9 = dropzone_createForOfIteratorHelper(this.files.slice(), true), + _step9; - // If @options.renameFile is a function, - // the function will be used to rename the file.name before appending it to the formData + try { + for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) { + var file = _step9.value; - }, { - key: "_renameFile", - value: function _renameFile(file) { - if (typeof this.options.renameFile !== "function") { - return file.name; - } - return this.options.renameFile(file); - } - - // Returns a form that can be used as fallback if the browser does not support DragnDrop - // - // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided. - // This code has to pass in IE7 :( - - }, { - key: "getFallbackForm", - value: function getFallbackForm() { - var existingFallback = void 0, - form = void 0; - if (existingFallback = this.getExistingFallback()) { - return existingFallback; - } + if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) { + this.removeFile(file); + } + } + } catch (err) { + _iterator9.e(err); + } finally { + _iterator9.f(); + } - var fieldsString = "
"; - if (this.options.dictFallbackText) { - fieldsString += "

" + this.options.dictFallbackText + "

"; - } - fieldsString += "
"; - - var fields = Dropzone.createElement(fieldsString); - if (this.element.tagName !== "FORM") { - form = Dropzone.createElement("
"); - form.appendChild(fields); - } else { - // Make sure that the enctype and method attributes are set properly - this.element.setAttribute("enctype", "multipart/form-data"); - this.element.setAttribute("method", this.options.method); - } - return form != null ? form : fields; - } - - // Returns the fallback elements if they exist already - // - // This code has to pass in IE7 :( - - }, { - key: "getExistingFallback", - value: function getExistingFallback() { - var getFallback = function getFallback(elements) { - for (var _iterator13 = elements, _isArray13 = true, _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator](); ;) { - var _ref12; - - if (_isArray13) { - if (_i13 >= _iterator13.length) break; - _ref12 = _iterator13[_i13++]; - } else { - _i13 = _iterator13.next(); - if (_i13.done) break; - _ref12 = _i13.value; - } + return null; + } // Resizes an image before it gets sent to the server. This function is the default behavior of + // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with + // the resized blob. - var el = _ref12; + }, { + key: "resizeImage", + value: function resizeImage(file, width, height, resizeMethod, callback) { + var _this10 = this; - if (/(^| )fallback($| )/.test(el.className)) { - return el; - } - } - }; + return this.createThumbnail(file, width, height, resizeMethod, true, function (dataUrl, canvas) { + if (canvas == null) { + // The image has not been resized + return callback(file); + } else { + var resizeMimeType = _this10.options.resizeMimeType; - var _arr = ["div", "form"]; - for (var _i14 = 0; _i14 < _arr.length; _i14++) { - var tagName = _arr[_i14]; - var fallback; - if (fallback = getFallback(this.element.getElementsByTagName(tagName))) { - return fallback; - } - } - } + if (resizeMimeType == null) { + resizeMimeType = file.type; + } - // Activates all listeners stored in @listeners + var resizedDataURL = canvas.toDataURL(resizeMimeType, _this10.options.resizeQuality); - }, { - key: "setupEventListeners", - value: function setupEventListeners() { - return this.listeners.map(function (elementListeners) { - return function () { - var result = []; - for (var event in elementListeners.events) { - var listener = elementListeners.events[event]; - result.push(elementListeners.element.addEventListener(event, listener, false)); + if (resizeMimeType === "image/jpeg" || resizeMimeType === "image/jpg") { + // Now add the original EXIF information + resizedDataURL = ExifRestore.restore(file.dataURL, resizedDataURL); + } + + return callback(Dropzone.dataURItoBlob(resizedDataURL)); + } + }); } - return result; - }(); - }); - } + }, { + key: "createThumbnail", + value: function createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) { + var _this11 = this; - // Deactivates all listeners stored in @listeners + var fileReader = new FileReader(); - }, { - key: "removeEventListeners", - value: function removeEventListeners() { - return this.listeners.map(function (elementListeners) { - return function () { - var result = []; - for (var event in elementListeners.events) { - var listener = elementListeners.events[event]; - result.push(elementListeners.element.removeEventListener(event, listener, false)); - } - return result; - }(); - }); - } + fileReader.onload = function () { + file.dataURL = fileReader.result; // Don't bother creating a thumbnail for SVG images since they're vector + + if (file.type === "image/svg+xml") { + if (callback != null) { + callback(fileReader.result); + } - // Removes all event listeners and cancels all files in the queue or being processed. + return; + } - }, { - key: "disable", - value: function disable() { - var _this4 = this; + _this11.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback); + }; - this.clickableElements.forEach(function (element) { - return element.classList.remove("dz-clickable"); - }); - this.removeEventListeners(); - this.disabled = true; + fileReader.readAsDataURL(file); + } // `mockFile` needs to have these attributes: + // + // { name: 'name', size: 12345, imageUrl: '' } + // + // `callback` will be invoked when the image has been downloaded and displayed. + // `crossOrigin` will be added to the `img` tag when accessing the file. + + }, { + key: "displayExistingFile", + value: function displayExistingFile(mockFile, imageUrl, callback, crossOrigin) { + var _this12 = this; + + var resizeThumbnail = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; + this.emit("addedfile", mockFile); + this.emit("complete", mockFile); + + if (!resizeThumbnail) { + this.emit("thumbnail", mockFile, imageUrl); + if (callback) callback(); + } else { + var onDone = function onDone(thumbnail) { + _this12.emit("thumbnail", mockFile, thumbnail); - return this.files.map(function (file) { - return _this4.cancelUpload(file); - }); - } - }, { - key: "enable", - value: function enable() { - delete this.disabled; - this.clickableElements.forEach(function (element) { - return element.classList.add("dz-clickable"); - }); - return this.setupEventListeners(); - } + if (callback) callback(); + }; - // Returns a nicely formatted filesize + mockFile.dataURL = imageUrl; + this.createThumbnailFromUrl(mockFile, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, this.options.fixOrientation, onDone, crossOrigin); + } + } + }, { + key: "createThumbnailFromUrl", + value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) { + var _this13 = this; - }, { - key: "filesize", - value: function filesize(size) { - var selectedSize = 0; - var selectedUnit = "b"; + // Not using `new Image` here because of a bug in latest Chrome versions. + // See https://github.com/enyo/dropzone/pull/226 + var img = document.createElement("img"); - if (size > 0) { - var units = ['tb', 'gb', 'mb', 'kb', 'b']; + if (crossOrigin) { + img.crossOrigin = crossOrigin; + } // fixOrientation is not needed anymore with browsers handling imageOrientation - for (var i = 0; i < units.length; i++) { - var unit = units[i]; - var cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10; - if (size >= cutoff) { - selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i); - selectedUnit = unit; - break; - } - } + fixOrientation = getComputedStyle(document.body)["imageOrientation"] == "from-image" ? false : fixOrientation; - selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits - } + img.onload = function () { + var loadExif = function loadExif(callback) { + return callback(1); + }; - return "" + selectedSize + " " + this.options.dictFileSizeUnits[selectedUnit]; - } + if (typeof EXIF !== "undefined" && EXIF !== null && fixOrientation) { + loadExif = function loadExif(callback) { + return EXIF.getData(img, function () { + return callback(EXIF.getTag(this, "Orientation")); + }); + }; + } - // Adds or removes the `dz-max-files-reached` class from the form. + return loadExif(function (orientation) { + file.width = img.width; + file.height = img.height; - }, { - key: "_updateMaxFilesReachedClass", - value: function _updateMaxFilesReachedClass() { - if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { - if (this.getAcceptedFiles().length === this.options.maxFiles) { - this.emit('maxfilesreached', this.files); - } - return this.element.classList.add("dz-max-files-reached"); - } else { - return this.element.classList.remove("dz-max-files-reached"); - } - } - }, { - key: "drop", - value: function drop(e) { - if (!e.dataTransfer) { - return; - } - this.emit("drop", e); + var resizeInfo = _this13.options.resize.call(_this13, file, width, height, resizeMethod); - // Convert the FileList to an Array - // This is necessary for IE11 - var files = []; - for (var i = 0; i < e.dataTransfer.files.length; i++) { - files[i] = e.dataTransfer.files[i]; - } + var canvas = document.createElement("canvas"); + var ctx = canvas.getContext("2d"); + canvas.width = resizeInfo.trgWidth; + canvas.height = resizeInfo.trgHeight; - this.emit("addedfiles", files); + if (orientation > 4) { + canvas.width = resizeInfo.trgHeight; + canvas.height = resizeInfo.trgWidth; + } - // Even if it's a folder, files.length will contain the folders. - if (files.length) { - var items = e.dataTransfer.items; + switch (orientation) { + case 2: + // horizontal flip + ctx.translate(canvas.width, 0); + ctx.scale(-1, 1); + break; + + case 3: + // 180° rotate left + ctx.translate(canvas.width, canvas.height); + ctx.rotate(Math.PI); + break; + + case 4: + // vertical flip + ctx.translate(0, canvas.height); + ctx.scale(1, -1); + break; + + case 5: + // vertical flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.scale(1, -1); + break; + + case 6: + // 90° rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(0, -canvas.width); + break; + + case 7: + // horizontal flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(canvas.height, -canvas.width); + ctx.scale(-1, 1); + break; + + case 8: + // 90° rotate left + ctx.rotate(-0.5 * Math.PI); + ctx.translate(-canvas.height, 0); + break; + } // This is a bugfix for iOS' scaling bug. + + + drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight); + var thumbnail = canvas.toDataURL("image/png"); + + if (callback != null) { + return callback(thumbnail, canvas); + } + }); + }; - if (items && items.length && items[0].webkitGetAsEntry != null) { - // The browser supports dropping of folders, so handle items instead of files - this._addFilesFromItems(items); - } else { - this.handleFiles(files); - } - } - } - }, { - key: "paste", - value: function paste(e) { - if (__guard__(e != null ? e.clipboardData : undefined, function (x) { - return x.items; - }) == null) { - return; - } + if (callback != null) { + img.onerror = callback; + } - this.emit("paste", e); - var items = e.clipboardData.items; + return img.src = file.dataURL; + } // Goes through the queue and processes files if there aren't too many already. + }, { + key: "processQueue", + value: function processQueue() { + var parallelUploads = this.options.parallelUploads; + var processingLength = this.getUploadingFiles().length; + var i = processingLength; // There are already at least as many files uploading than should be - if (items.length) { - return this._addFilesFromItems(items); - } - } - }, { - key: "handleFiles", - value: function handleFiles(files) { - for (var _iterator14 = files, _isArray14 = true, _i15 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator](); ;) { - var _ref13; - - if (_isArray14) { - if (_i15 >= _iterator14.length) break; - _ref13 = _iterator14[_i15++]; - } else { - _i15 = _iterator14.next(); - if (_i15.done) break; - _ref13 = _i15.value; - } + if (processingLength >= parallelUploads) { + return; + } - var file = _ref13; + var queuedFiles = this.getQueuedFiles(); + + if (!(queuedFiles.length > 0)) { + return; + } - this.addFile(file); - } - } + if (this.options.uploadMultiple) { + // The files should be uploaded in one request + return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength)); + } else { + while (i < parallelUploads) { + if (!queuedFiles.length) { + return; + } // Nothing left to process - // When a folder is dropped (or files are pasted), items must be handled - // instead of files. - }, { - key: "_addFilesFromItems", - value: function _addFilesFromItems(items) { - var _this5 = this; + this.processFile(queuedFiles.shift()); + i++; + } + } + } // Wrapper for `processFiles` - return function () { - var result = []; - for (var _iterator15 = items, _isArray15 = true, _i16 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator](); ;) { - var _ref14; + }, { + key: "processFile", + value: function processFile(file) { + return this.processFiles([file]); + } // Loads the file, then calls finishedLoading() - if (_isArray15) { - if (_i16 >= _iterator15.length) break; - _ref14 = _iterator15[_i16++]; - } else { - _i16 = _iterator15.next(); - if (_i16.done) break; - _ref14 = _i16.value; - } + }, { + key: "processFiles", + value: function processFiles(files) { + var _iterator10 = dropzone_createForOfIteratorHelper(files, true), + _step10; - var item = _ref14; + try { + for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) { + var file = _step10.value; + file.processing = true; // Backwards compatibility - var entry; - if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) { - if (entry.isFile) { - result.push(_this5.addFile(item.getAsFile())); - } else if (entry.isDirectory) { - // Append all files from that directory to files - result.push(_this5._addFilesFromDirectory(entry, entry.name)); - } else { - result.push(undefined); - } - } else if (item.getAsFile != null) { - if (item.kind == null || item.kind === "file") { - result.push(_this5.addFile(item.getAsFile())); - } else { - result.push(undefined); + file.status = Dropzone.UPLOADING; + this.emit("processing", file); + } + } catch (err) { + _iterator10.e(err); + } finally { + _iterator10.f(); } - } else { - result.push(undefined); - } - } - return result; - }(); - } - // Goes through the directory, and adds each file it finds recursively - - }, { - key: "_addFilesFromDirectory", - value: function _addFilesFromDirectory(directory, path) { - var _this6 = this; + if (this.options.uploadMultiple) { + this.emit("processingmultiple", files); + } - var dirReader = directory.createReader(); + return this.uploadFiles(files); + } + }, { + key: "_getFilesWithXhr", + value: function _getFilesWithXhr(xhr) { + var files; + return files = this.files.filter(function (file) { + return file.xhr === xhr; + }).map(function (file) { + return file; + }); + } // Cancels the file upload and sets the status to CANCELED + // **if** the file is actually being uploaded. + // If it's still in the queue, the file is being removed from it and the status + // set to CANCELED. + + }, { + key: "cancelUpload", + value: function cancelUpload(file) { + if (file.status === Dropzone.UPLOADING) { + var groupedFiles = this._getFilesWithXhr(file.xhr); + + var _iterator11 = dropzone_createForOfIteratorHelper(groupedFiles, true), + _step11; + + try { + for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) { + var groupedFile = _step11.value; + groupedFile.status = Dropzone.CANCELED; + } + } catch (err) { + _iterator11.e(err); + } finally { + _iterator11.f(); + } - var errorHandler = function errorHandler(error) { - return __guardMethod__(console, 'log', function (o) { - return o.log(error); - }); - }; + if (typeof file.xhr !== "undefined") { + file.xhr.abort(); + } - var readEntries = function readEntries() { - return dirReader.readEntries(function (entries) { - if (entries.length > 0) { - for (var _iterator16 = entries, _isArray16 = true, _i17 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator](); ;) { - var _ref15; + var _iterator12 = dropzone_createForOfIteratorHelper(groupedFiles, true), + _step12; - if (_isArray16) { - if (_i17 >= _iterator16.length) break; - _ref15 = _iterator16[_i17++]; - } else { - _i17 = _iterator16.next(); - if (_i17.done) break; - _ref15 = _i17.value; + try { + for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) { + var _groupedFile = _step12.value; + this.emit("canceled", _groupedFile); + } + } catch (err) { + _iterator12.e(err); + } finally { + _iterator12.f(); } - var entry = _ref15; + if (this.options.uploadMultiple) { + this.emit("canceledmultiple", groupedFiles); + } + } else if (file.status === Dropzone.ADDED || file.status === Dropzone.QUEUED) { + file.status = Dropzone.CANCELED; + this.emit("canceled", file); - if (entry.isFile) { - entry.file(function (file) { - if (_this6.options.ignoreHiddenFiles && file.name.substring(0, 1) === '.') { - return; - } - file.fullPath = path + "/" + file.name; - return _this6.addFile(file); - }); - } else if (entry.isDirectory) { - _this6._addFilesFromDirectory(entry, path + "/" + entry.name); + if (this.options.uploadMultiple) { + this.emit("canceledmultiple", [file]); } } - // Recursively call readEntries() again, since browser only handle - // the first 100 entries. - // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries - readEntries(); + if (this.options.autoProcessQueue) { + return this.processQueue(); + } } - return null; - }, errorHandler); - }; + }, { + key: "resolveOption", + value: function resolveOption(option) { + if (typeof option === "function") { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - return readEntries(); - } - - // If `done()` is called without argument the file is accepted - // If you call it with an error message, the file is rejected - // (This allows for asynchronous validation) - // - // This function checks the filesize, and if the file.type passes the - // `acceptedFiles` check. - - }, { - key: "accept", - value: function accept(file, done) { - if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1024 * 1024) { - return done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize)); - } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) { - return done(this.options.dictInvalidFileType); - } else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { - done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles)); - return this.emit("maxfilesexceeded", file); - } else { - return this.options.accept.call(this, file, done); - } - } - }, { - key: "addFile", - value: function addFile(file) { - var _this7 = this; - - file.upload = { - uuid: Dropzone.uuidv4(), - progress: 0, - // Setting the total upload size to file.size for the beginning - // It's actual different than the size to be transmitted. - total: file.size, - bytesSent: 0, - filename: this._renameFile(file), - chunked: this.options.chunking && (this.options.forceChunking || file.size > this.options.chunkSize), - totalChunkCount: Math.ceil(file.size / this.options.chunkSize) - }; - this.files.push(file); + return option.apply(this, args); + } - file.status = Dropzone.ADDED; + return option; + } + }, { + key: "uploadFile", + value: function uploadFile(file) { + return this.uploadFiles([file]); + } + }, { + key: "uploadFiles", + value: function uploadFiles(files) { + var _this14 = this; + + this._transformFiles(files, function (transformedFiles) { + if (_this14.options.chunking) { + // Chunking is not allowed to be used with `uploadMultiple` so we know + // that there is only __one__file. + var transformedFile = transformedFiles[0]; + files[0].upload.chunked = _this14.options.chunking && (_this14.options.forceChunking || transformedFile.size > _this14.options.chunkSize); + files[0].upload.totalChunkCount = Math.ceil(transformedFile.size / _this14.options.chunkSize); + } - this.emit("addedfile", file); + if (files[0].upload.chunked) { + // This file should be sent in chunks! + // If the chunking option is set, we **know** that there can only be **one** file, since + // uploadMultiple is not allowed with this option. + var file = files[0]; + var _transformedFile = transformedFiles[0]; + var startedChunkCount = 0; + file.upload.chunks = []; + + var handleNextChunk = function handleNextChunk() { + var chunkIndex = 0; // Find the next item in file.upload.chunks that is not defined yet. + + while (file.upload.chunks[chunkIndex] !== undefined) { + chunkIndex++; + } // This means, that all chunks have already been started. + + + if (chunkIndex >= file.upload.totalChunkCount) return; + startedChunkCount++; + var start = chunkIndex * _this14.options.chunkSize; + var end = Math.min(start + _this14.options.chunkSize, _transformedFile.size); + var dataBlock = { + name: _this14._getParamName(0), + data: _transformedFile.webkitSlice ? _transformedFile.webkitSlice(start, end) : _transformedFile.slice(start, end), + filename: file.upload.filename, + chunkIndex: chunkIndex + }; + file.upload.chunks[chunkIndex] = { + file: file, + index: chunkIndex, + dataBlock: dataBlock, + // In case we want to retry. + status: Dropzone.UPLOADING, + progress: 0, + retries: 0 // The number of times this block has been retried. + + }; + + _this14._uploadData(files, [dataBlock]); + }; + + file.upload.finishedChunkUpload = function (chunk, response) { + var allFinished = true; + chunk.status = Dropzone.SUCCESS; // Clear the data from the chunk + + chunk.dataBlock = null; // Leaving this reference to xhr intact here will cause memory leaks in some browsers + + chunk.xhr = null; + + for (var i = 0; i < file.upload.totalChunkCount; i++) { + if (file.upload.chunks[i] === undefined) { + return handleNextChunk(); + } + + if (file.upload.chunks[i].status !== Dropzone.SUCCESS) { + allFinished = false; + } + } - this._enqueueThumbnail(file); + if (allFinished) { + _this14.options.chunksUploaded(file, function () { + _this14._finished(files, response, null); + }); + } + }; - return this.accept(file, function (error) { - if (error) { - file.accepted = false; - _this7._errorProcessing([file], error); // Will set the file.status - } else { - file.accepted = true; - if (_this7.options.autoQueue) { - _this7.enqueueFile(file); - } // Will set .accepted = true - } - return _this7._updateMaxFilesReachedClass(); - }); - } + if (_this14.options.parallelChunkUploads) { + for (var i = 0; i < file.upload.totalChunkCount; i++) { + handleNextChunk(); + } + } else { + handleNextChunk(); + } + } else { + var dataBlocks = []; + + for (var _i2 = 0; _i2 < files.length; _i2++) { + dataBlocks[_i2] = { + name: _this14._getParamName(_i2), + data: transformedFiles[_i2], + filename: files[_i2].upload.filename + }; + } - // Wrapper for enqueueFile + _this14._uploadData(files, dataBlocks); + } + }); + } /// Returns the right chunk for given file and xhr - }, { - key: "enqueueFiles", - value: function enqueueFiles(files) { - for (var _iterator17 = files, _isArray17 = true, _i18 = 0, _iterator17 = _isArray17 ? _iterator17 : _iterator17[Symbol.iterator](); ;) { - var _ref16; + }, { + key: "_getChunk", + value: function _getChunk(file, xhr) { + for (var i = 0; i < file.upload.totalChunkCount; i++) { + if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) { + return file.upload.chunks[i]; + } + } + } // This function actually uploads the file(s) to the server. + // If dataBlocks contains the actual data to upload (meaning, that this could either be transformed + // files, or individual chunks for chunked upload). - if (_isArray17) { - if (_i18 >= _iterator17.length) break; - _ref16 = _iterator17[_i18++]; - } else { - _i18 = _iterator17.next(); - if (_i18.done) break; - _ref16 = _i18.value; - } + }, { + key: "_uploadData", + value: function _uploadData(files, dataBlocks) { + var _this15 = this; - var file = _ref16; + var xhr = new XMLHttpRequest(); // Put the xhr object in the file objects to be able to reference it later. - this.enqueueFile(file); - } - return null; - } - }, { - key: "enqueueFile", - value: function enqueueFile(file) { - var _this8 = this; - - if (file.status === Dropzone.ADDED && file.accepted === true) { - file.status = Dropzone.QUEUED; - if (this.options.autoProcessQueue) { - return setTimeout(function () { - return _this8.processQueue(); - }, 0); // Deferring the call - } - } else { - throw new Error("This file can't be queued because it has already been processed or was rejected."); - } - } - }, { - key: "_enqueueThumbnail", - value: function _enqueueThumbnail(file) { - var _this9 = this; - - if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) { - this._thumbnailQueue.push(file); - return setTimeout(function () { - return _this9._processThumbnailQueue(); - }, 0); // Deferring the call - } - } - }, { - key: "_processThumbnailQueue", - value: function _processThumbnailQueue() { - var _this10 = this; - - if (this._processingThumbnail || this._thumbnailQueue.length === 0) { - return; - } + var _iterator13 = dropzone_createForOfIteratorHelper(files, true), + _step13; - this._processingThumbnail = true; - var file = this._thumbnailQueue.shift(); - return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, function (dataUrl) { - _this10.emit("thumbnail", file, dataUrl); - _this10._processingThumbnail = false; - return _this10._processThumbnailQueue(); - }); - } + try { + for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) { + var file = _step13.value; + file.xhr = xhr; + } + } catch (err) { + _iterator13.e(err); + } finally { + _iterator13.f(); + } - // Can be called by the user to remove a file + if (files[0].upload.chunked) { + // Put the xhr object in the right chunk object, so it can be associated later, and found with _getChunk + files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr; + } - }, { - key: "removeFile", - value: function removeFile(file) { - if (file.status === Dropzone.UPLOADING) { - this.cancelUpload(file); - } - this.files = without(this.files, file); + var method = this.resolveOption(this.options.method, files); + var url = this.resolveOption(this.options.url, files); + xhr.open(method, url, true); // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8 - this.emit("removedfile", file); - if (this.files.length === 0) { - return this.emit("reset"); - } - } + var timeout = this.resolveOption(this.options.timeout, files); + if (timeout) xhr.timeout = this.resolveOption(this.options.timeout, files); // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179 - // Removes all files that aren't currently processed from the list + xhr.withCredentials = !!this.options.withCredentials; - }, { - key: "removeAllFiles", - value: function removeAllFiles(cancelIfNecessary) { - // Create a copy of files since removeFile() changes the @files array. - if (cancelIfNecessary == null) { - cancelIfNecessary = false; - } - for (var _iterator18 = this.files.slice(), _isArray18 = true, _i19 = 0, _iterator18 = _isArray18 ? _iterator18 : _iterator18[Symbol.iterator](); ;) { - var _ref17; + xhr.onload = function (e) { + _this15._finishedUploading(files, xhr, e); + }; - if (_isArray18) { - if (_i19 >= _iterator18.length) break; - _ref17 = _iterator18[_i19++]; - } else { - _i19 = _iterator18.next(); - if (_i19.done) break; - _ref17 = _i19.value; - } + xhr.ontimeout = function () { + _this15._handleUploadError(files, xhr, "Request timedout after ".concat(_this15.options.timeout / 1000, " seconds")); + }; - var file = _ref17; + xhr.onerror = function () { + _this15._handleUploadError(files, xhr); + }; // Some browsers do not have the .upload property - if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) { - this.removeFile(file); - } - } - return null; - } - - // Resizes an image before it gets sent to the server. This function is the default behavior of - // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with - // the resized blob. - - }, { - key: "resizeImage", - value: function resizeImage(file, width, height, resizeMethod, callback) { - var _this11 = this; - - return this.createThumbnail(file, width, height, resizeMethod, true, function (dataUrl, canvas) { - if (canvas == null) { - // The image has not been resized - return callback(file); - } else { - var resizeMimeType = _this11.options.resizeMimeType; - if (resizeMimeType == null) { - resizeMimeType = file.type; - } - var resizedDataURL = canvas.toDataURL(resizeMimeType, _this11.options.resizeQuality); - if (resizeMimeType === 'image/jpeg' || resizeMimeType === 'image/jpg') { - // Now add the original EXIF information - resizedDataURL = ExifRestore.restore(file.dataURL, resizedDataURL); - } - return callback(Dropzone.dataURItoBlob(resizedDataURL)); - } - }); - } - }, { - key: "createThumbnail", - value: function createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) { - var _this12 = this; + var progressObj = xhr.upload != null ? xhr.upload : xhr; - var fileReader = new FileReader(); + progressObj.onprogress = function (e) { + return _this15._updateFilesUploadProgress(files, xhr, e); + }; - fileReader.onload = function () { + var headers = { + Accept: "application/json", + "Cache-Control": "no-cache", + "X-Requested-With": "XMLHttpRequest" + }; - file.dataURL = fileReader.result; + if (this.options.headers) { + Dropzone.extend(headers, this.options.headers); + } - // Don't bother creating a thumbnail for SVG images since they're vector - if (file.type === "image/svg+xml") { - if (callback != null) { - callback(fileReader.result); - } - return; - } + for (var headerName in headers) { + var headerValue = headers[headerName]; - return _this12.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback); - }; + if (headerValue) { + xhr.setRequestHeader(headerName, headerValue); + } + } - return fileReader.readAsDataURL(file); - } - }, { - key: "createThumbnailFromUrl", - value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) { - var _this13 = this; + var formData = new FormData(); // Adding all @options parameters - // Not using `new Image` here because of a bug in latest Chrome versions. - // See https://github.com/enyo/dropzone/pull/226 - var img = document.createElement("img"); + if (this.options.params) { + var additionalParams = this.options.params; - if (crossOrigin) { - img.crossOrigin = crossOrigin; - } + if (typeof additionalParams === "function") { + additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null); + } - img.onload = function () { - var loadExif = function loadExif(callback) { - return callback(1); - }; - if (typeof EXIF !== 'undefined' && EXIF !== null && fixOrientation) { - loadExif = function loadExif(callback) { - return EXIF.getData(img, function () { - return callback(EXIF.getTag(this, 'Orientation')); - }); - }; - } + for (var key in additionalParams) { + var value = additionalParams[key]; - return loadExif(function (orientation) { - file.width = img.width; - file.height = img.height; + if (Array.isArray(value)) { + // The additional parameter contains an array, + // so lets iterate over it to attach each value + // individually. + for (var i = 0; i < value.length; i++) { + formData.append(key, value[i]); + } + } else { + formData.append(key, value); + } + } + } // Let the user add additional data if necessary - var resizeInfo = _this13.options.resize.call(_this13, file, width, height, resizeMethod); - var canvas = document.createElement("canvas"); - var ctx = canvas.getContext("2d"); + var _iterator14 = dropzone_createForOfIteratorHelper(files, true), + _step14; - canvas.width = resizeInfo.trgWidth; - canvas.height = resizeInfo.trgHeight; + try { + for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) { + var _file = _step14.value; + this.emit("sending", _file, xhr, formData); + } + } catch (err) { + _iterator14.e(err); + } finally { + _iterator14.f(); + } - if (orientation > 4) { - canvas.width = resizeInfo.trgHeight; - canvas.height = resizeInfo.trgWidth; - } + if (this.options.uploadMultiple) { + this.emit("sendingmultiple", files, xhr, formData); + } - switch (orientation) { - case 2: - // horizontal flip - ctx.translate(canvas.width, 0); - ctx.scale(-1, 1); - break; - case 3: - // 180° rotate left - ctx.translate(canvas.width, canvas.height); - ctx.rotate(Math.PI); - break; - case 4: - // vertical flip - ctx.translate(0, canvas.height); - ctx.scale(1, -1); - break; - case 5: - // vertical flip + 90 rotate right - ctx.rotate(0.5 * Math.PI); - ctx.scale(1, -1); - break; - case 6: - // 90° rotate right - ctx.rotate(0.5 * Math.PI); - ctx.translate(0, -canvas.width); - break; - case 7: - // horizontal flip + 90 rotate right - ctx.rotate(0.5 * Math.PI); - ctx.translate(canvas.height, -canvas.width); - ctx.scale(-1, 1); - break; - case 8: - // 90° rotate left - ctx.rotate(-0.5 * Math.PI); - ctx.translate(-canvas.height, 0); - break; - } + this._addFormElementData(formData); // Finally add the files + // Has to be last because some servers (eg: S3) expect the file to be the last parameter - // This is a bugfix for iOS' scaling bug. - drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight); - var thumbnail = canvas.toDataURL("image/png"); + for (var _i3 = 0; _i3 < dataBlocks.length; _i3++) { + var dataBlock = dataBlocks[_i3]; + formData.append(dataBlock.name, dataBlock.data, dataBlock.filename); + } - if (callback != null) { - return callback(thumbnail, canvas); - } - }); - }; + this.submitRequest(xhr, formData, files); + } // Transforms all files with this.options.transformFile and invokes done with the transformed files when done. - if (callback != null) { - img.onerror = callback; - } + }, { + key: "_transformFiles", + value: function _transformFiles(files, done) { + var _this16 = this; - return img.src = file.dataURL; - } + var transformedFiles = []; // Clumsy way of handling asynchronous calls, until I get to add a proper Future library. - // Goes through the queue and processes files if there aren't too many already. + var doneCounter = 0; - }, { - key: "processQueue", - value: function processQueue() { - var parallelUploads = this.options.parallelUploads; + var _loop = function _loop(i) { + _this16.options.transformFile.call(_this16, files[i], function (transformedFile) { + transformedFiles[i] = transformedFile; - var processingLength = this.getUploadingFiles().length; - var i = processingLength; + if (++doneCounter === files.length) { + done(transformedFiles); + } + }); + }; - // There are already at least as many files uploading than should be - if (processingLength >= parallelUploads) { - return; - } + for (var i = 0; i < files.length; i++) { + _loop(i); + } + } // Takes care of adding other input elements of the form to the AJAX request + + }, { + key: "_addFormElementData", + value: function _addFormElementData(formData) { + // Take care of other input elements + if (this.element.tagName === "FORM") { + var _iterator15 = dropzone_createForOfIteratorHelper(this.element.querySelectorAll("input, textarea, select, button"), true), + _step15; + + try { + for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) { + var input = _step15.value; + var inputName = input.getAttribute("name"); + var inputType = input.getAttribute("type"); + if (inputType) inputType = inputType.toLowerCase(); // If the input doesn't have a name, we can't use it. + + if (typeof inputName === "undefined" || inputName === null) continue; + + if (input.tagName === "SELECT" && input.hasAttribute("multiple")) { + // Possibly multiple values + var _iterator16 = dropzone_createForOfIteratorHelper(input.options, true), + _step16; + + try { + for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) { + var option = _step16.value; + + if (option.selected) { + formData.append(inputName, option.value); + } + } + } catch (err) { + _iterator16.e(err); + } finally { + _iterator16.f(); + } + } else if (!inputType || inputType !== "checkbox" && inputType !== "radio" || input.checked) { + formData.append(inputName, input.value); + } + } + } catch (err) { + _iterator15.e(err); + } finally { + _iterator15.f(); + } + } + } // Invoked when there is new progress information about given files. + // If e is not provided, it is assumed that the upload is finished. + + }, { + key: "_updateFilesUploadProgress", + value: function _updateFilesUploadProgress(files, xhr, e) { + if (!files[0].upload.chunked) { + // Handle file uploads without chunking + var _iterator17 = dropzone_createForOfIteratorHelper(files, true), + _step17; + + try { + for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) { + var file = _step17.value; + + if (file.upload.total && file.upload.bytesSent && file.upload.bytesSent == file.upload.total) { + // If both, the `total` and `bytesSent` have already been set, and + // they are equal (meaning progress is at 100%), we can skip this + // file, since an upload progress shouldn't go down. + continue; + } - var queuedFiles = this.getQueuedFiles(); + if (e) { + file.upload.progress = 100 * e.loaded / e.total; + file.upload.total = e.total; + file.upload.bytesSent = e.loaded; + } else { + // No event, so we're at 100% + file.upload.progress = 100; + file.upload.bytesSent = file.upload.total; + } - if (!(queuedFiles.length > 0)) { - return; - } + this.emit("uploadprogress", file, file.upload.progress, file.upload.bytesSent); + } + } catch (err) { + _iterator17.e(err); + } finally { + _iterator17.f(); + } + } else { + // Handle chunked file uploads + // Chunked upload is not compatible with uploading multiple files in one + // request, so we know there's only one file. + var _file2 = files[0]; // Since this is a chunked upload, we need to update the appropriate chunk + // progress. + + var chunk = this._getChunk(_file2, xhr); + + if (e) { + chunk.progress = 100 * e.loaded / e.total; + chunk.total = e.total; + chunk.bytesSent = e.loaded; + } else { + // No event, so we're at 100% + chunk.progress = 100; + chunk.bytesSent = chunk.total; + } // Now tally the *file* upload progress from its individual chunks - if (this.options.uploadMultiple) { - // The files should be uploaded in one request - return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength)); - } else { - while (i < parallelUploads) { - if (!queuedFiles.length) { - return; - } // Nothing left to process - this.processFile(queuedFiles.shift()); - i++; - } - } - } - // Wrapper for `processFiles` + _file2.upload.progress = 0; + _file2.upload.total = 0; + _file2.upload.bytesSent = 0; - }, { - key: "processFile", - value: function processFile(file) { - return this.processFiles([file]); - } + for (var i = 0; i < _file2.upload.totalChunkCount; i++) { + if (_file2.upload.chunks[i] && typeof _file2.upload.chunks[i].progress !== "undefined") { + _file2.upload.progress += _file2.upload.chunks[i].progress; + _file2.upload.total += _file2.upload.chunks[i].total; + _file2.upload.bytesSent += _file2.upload.chunks[i].bytesSent; + } + } // Since the process is a percentage, we need to divide by the amount of + // chunks we've used. - // Loads the file, then calls finishedLoading() - }, { - key: "processFiles", - value: function processFiles(files) { - for (var _iterator19 = files, _isArray19 = true, _i20 = 0, _iterator19 = _isArray19 ? _iterator19 : _iterator19[Symbol.iterator](); ;) { - var _ref18; + _file2.upload.progress = _file2.upload.progress / _file2.upload.totalChunkCount; + this.emit("uploadprogress", _file2, _file2.upload.progress, _file2.upload.bytesSent); + } + } + }, { + key: "_finishedUploading", + value: function _finishedUploading(files, xhr, e) { + var response; - if (_isArray19) { - if (_i20 >= _iterator19.length) break; - _ref18 = _iterator19[_i20++]; - } else { - _i20 = _iterator19.next(); - if (_i20.done) break; - _ref18 = _i20.value; - } + if (files[0].status === Dropzone.CANCELED) { + return; + } - var file = _ref18; + if (xhr.readyState !== 4) { + return; + } - file.processing = true; // Backwards compatibility - file.status = Dropzone.UPLOADING; + if (xhr.responseType !== "arraybuffer" && xhr.responseType !== "blob") { + response = xhr.responseText; - this.emit("processing", file); - } + if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) { + try { + response = JSON.parse(response); + } catch (error) { + e = error; + response = "Invalid JSON response from server."; + } + } + } - if (this.options.uploadMultiple) { - this.emit("processingmultiple", files); - } + this._updateFilesUploadProgress(files, xhr); - return this.uploadFiles(files); - } - }, { - key: "_getFilesWithXhr", - value: function _getFilesWithXhr(xhr) { - var files = void 0; - return files = this.files.filter(function (file) { - return file.xhr === xhr; - }).map(function (file) { - return file; - }); - } - - // Cancels the file upload and sets the status to CANCELED - // **if** the file is actually being uploaded. - // If it's still in the queue, the file is being removed from it and the status - // set to CANCELED. - - }, { - key: "cancelUpload", - value: function cancelUpload(file) { - if (file.status === Dropzone.UPLOADING) { - var groupedFiles = this._getFilesWithXhr(file.xhr); - for (var _iterator20 = groupedFiles, _isArray20 = true, _i21 = 0, _iterator20 = _isArray20 ? _iterator20 : _iterator20[Symbol.iterator](); ;) { - var _ref19; - - if (_isArray20) { - if (_i21 >= _iterator20.length) break; - _ref19 = _iterator20[_i21++]; - } else { - _i21 = _iterator20.next(); - if (_i21.done) break; - _ref19 = _i21.value; + if (!(200 <= xhr.status && xhr.status < 300)) { + this._handleUploadError(files, xhr, response); + } else { + if (files[0].upload.chunked) { + files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr), response); + } else { + this._finished(files, response, e); + } + } } + }, { + key: "_handleUploadError", + value: function _handleUploadError(files, xhr, response) { + if (files[0].status === Dropzone.CANCELED) { + return; + } - var groupedFile = _ref19; - - groupedFile.status = Dropzone.CANCELED; - } - if (typeof file.xhr !== 'undefined') { - file.xhr.abort(); - } - for (var _iterator21 = groupedFiles, _isArray21 = true, _i22 = 0, _iterator21 = _isArray21 ? _iterator21 : _iterator21[Symbol.iterator](); ;) { - var _ref20; + if (files[0].upload.chunked && this.options.retryChunks) { + var chunk = this._getChunk(files[0], xhr); - if (_isArray21) { - if (_i22 >= _iterator21.length) break; - _ref20 = _iterator21[_i22++]; - } else { - _i22 = _iterator21.next(); - if (_i22.done) break; - _ref20 = _i22.value; - } + if (chunk.retries++ < this.options.retryChunksLimit) { + this._uploadData(files, [chunk.dataBlock]); - var _groupedFile = _ref20; + return; + } else { + console.warn("Retried this chunk too often. Giving up."); + } + } - this.emit("canceled", _groupedFile); - } - if (this.options.uploadMultiple) { - this.emit("canceledmultiple", groupedFiles); - } - } else if (file.status === Dropzone.ADDED || file.status === Dropzone.QUEUED) { - file.status = Dropzone.CANCELED; - this.emit("canceled", file); - if (this.options.uploadMultiple) { - this.emit("canceledmultiple", [file]); - } - } + this._errorProcessing(files, response || this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr); + } + }, { + key: "submitRequest", + value: function submitRequest(xhr, formData, files) { + if (xhr.readyState != 1) { + console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED."); + return; + } - if (this.options.autoProcessQueue) { - return this.processQueue(); - } - } - }, { - key: "resolveOption", - value: function resolveOption(option) { - if (typeof option === 'function') { - for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { - args[_key3 - 1] = arguments[_key3]; - } + xhr.send(formData); + } // Called internally when processing is finished. + // Individual callbacks have to be called in the appropriate sections. - return option.apply(this, args); - } - return option; - } - }, { - key: "uploadFile", - value: function uploadFile(file) { - return this.uploadFiles([file]); - } - }, { - key: "uploadFiles", - value: function uploadFiles(files) { - var _this14 = this; - - this._transformFiles(files, function (transformedFiles) { - if (files[0].upload.chunked) { - // This file should be sent in chunks! - - // If the chunking option is set, we **know** that there can only be **one** file, since - // uploadMultiple is not allowed with this option. - var file = files[0]; - var transformedFile = transformedFiles[0]; - var startedChunkCount = 0; - - file.upload.chunks = []; - - var handleNextChunk = function handleNextChunk() { - var chunkIndex = 0; - - // Find the next item in file.upload.chunks that is not defined yet. - while (file.upload.chunks[chunkIndex] !== undefined) { - chunkIndex++; - } - - // This means, that all chunks have already been started. - if (chunkIndex >= file.upload.totalChunkCount) return; - - startedChunkCount++; - - var start = chunkIndex * _this14.options.chunkSize; - var end = Math.min(start + _this14.options.chunkSize, file.size); - - var dataBlock = { - name: _this14._getParamName(0), - data: transformedFile.webkitSlice ? transformedFile.webkitSlice(start, end) : transformedFile.slice(start, end), - filename: file.upload.filename, - chunkIndex: chunkIndex - }; + }, { + key: "_finished", + value: function _finished(files, responseText, e) { + var _iterator18 = dropzone_createForOfIteratorHelper(files, true), + _step18; - file.upload.chunks[chunkIndex] = { - file: file, - index: chunkIndex, - dataBlock: dataBlock, // In case we want to retry. - status: Dropzone.UPLOADING, - progress: 0, - retries: 0 // The number of times this block has been retried. - }; + try { + for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) { + var file = _step18.value; + file.status = Dropzone.SUCCESS; + this.emit("success", file, responseText, e); + this.emit("complete", file); + } + } catch (err) { + _iterator18.e(err); + } finally { + _iterator18.f(); + } - _this14._uploadData(files, [dataBlock]); - }; + if (this.options.uploadMultiple) { + this.emit("successmultiple", files, responseText, e); + this.emit("completemultiple", files); + } - file.upload.finishedChunkUpload = function (chunk) { - var allFinished = true; - chunk.status = Dropzone.SUCCESS; + if (this.options.autoProcessQueue) { + return this.processQueue(); + } + } // Called internally when processing is finished. + // Individual callbacks have to be called in the appropriate sections. - // Clear the data from the chunk - chunk.dataBlock = null; - // Leaving this reference to xhr intact here will cause memory leaks in some browsers - chunk.xhr = null; + }, { + key: "_errorProcessing", + value: function _errorProcessing(files, message, xhr) { + var _iterator19 = dropzone_createForOfIteratorHelper(files, true), + _step19; - for (var i = 0; i < file.upload.totalChunkCount; i++) { - if (file.upload.chunks[i] === undefined) { - return handleNextChunk(); - } - if (file.upload.chunks[i].status !== Dropzone.SUCCESS) { - allFinished = false; + try { + for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) { + var file = _step19.value; + file.status = Dropzone.ERROR; + this.emit("error", file, message, xhr); + this.emit("complete", file); } + } catch (err) { + _iterator19.e(err); + } finally { + _iterator19.f(); } - if (allFinished) { - _this14.options.chunksUploaded(file, function () { - _this14._finished(files, '', null); - }); + if (this.options.uploadMultiple) { + this.emit("errormultiple", files, message, xhr); + this.emit("completemultiple", files); } - }; - if (_this14.options.parallelChunkUploads) { - for (var i = 0; i < file.upload.totalChunkCount; i++) { - handleNextChunk(); + if (this.options.autoProcessQueue) { + return this.processQueue(); } - } else { - handleNextChunk(); } - } else { - var dataBlocks = []; - for (var _i23 = 0; _i23 < files.length; _i23++) { - dataBlocks[_i23] = { - name: _this14._getParamName(_i23), - data: transformedFiles[_i23], - filename: files[_i23].upload.filename - }; + }], [{ + key: "initClass", + value: function initClass() { + // Exposing the emitter class, mainly for tests + this.prototype.Emitter = Emitter; + /* + This is a list of all available events you can register on a dropzone object. + You can register an event handler like this: + dropzone.on("dragEnter", function() { }); + */ + + this.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"]; + this.prototype._thumbnailQueue = []; + this.prototype._processingThumbnail = false; + } // global utility + + }, { + key: "extend", + value: function extend(target) { + for (var _len2 = arguments.length, objects = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + objects[_key2 - 1] = arguments[_key2]; + } + + for (var _i4 = 0, _objects = objects; _i4 < _objects.length; _i4++) { + var object = _objects[_i4]; + + for (var key in object) { + var val = object[key]; + target[key] = val; + } + } + + return target; } - _this14._uploadData(files, dataBlocks); + }, { + key: "uuidv4", + value: function uuidv4() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, + v = c === "x" ? r : r & 0x3 | 0x8; + return v.toString(16); + }); + } + }]); + + return Dropzone; + }(Emitter); + + + Dropzone.initClass(); + Dropzone.version = "5.9.3"; // This is a map of options for your different dropzones. Add configurations +// to this object for your different dropzone elemens. +// +// Example: +// +// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 }; +// +// To disable autoDiscover for a specific element, you can set `false` as an option: +// +// Dropzone.options.myDisabledElementId = false; +// +// And in html: +// +//
+ + Dropzone.options = {}; // Returns the options for an element or undefined if none available. + + Dropzone.optionsForElement = function (element) { + // Get the `Dropzone.options.elementId` for this element if it exists + if (element.getAttribute("id")) { + return Dropzone.options[camelize(element.getAttribute("id"))]; + } else { + return undefined; } - }); - } + }; // Holds a list of all dropzone instances - /// Returns the right chunk for given file and xhr - }, { - key: "_getChunk", - value: function _getChunk(file, xhr) { - for (var i = 0; i < file.upload.totalChunkCount; i++) { - if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) { - return file.upload.chunks[i]; + Dropzone.instances = []; // Returns the dropzone for given element if any + + Dropzone.forElement = function (element) { + if (typeof element === "string") { + element = document.querySelector(element); } - } - } - // This function actually uploads the file(s) to the server. - // If dataBlocks contains the actual data to upload (meaning, that this could either be transformed - // files, or individual chunks for chunked upload). + if ((element != null ? element.dropzone : undefined) == null) { + throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone."); + } + + return element.dropzone; + }; // Set to false if you don't want Dropzone to automatically find and attach to .dropzone elements. - }, { - key: "_uploadData", - value: function _uploadData(files, dataBlocks) { - var _this15 = this; - var xhr = new XMLHttpRequest(); + Dropzone.autoDiscover = true; // Looks for all .dropzone elements and creates a dropzone for them - // Put the xhr object in the file objects to be able to reference it later. - for (var _iterator22 = files, _isArray22 = true, _i24 = 0, _iterator22 = _isArray22 ? _iterator22 : _iterator22[Symbol.iterator](); ;) { - var _ref21; + Dropzone.discover = function () { + var dropzones; - if (_isArray22) { - if (_i24 >= _iterator22.length) break; - _ref21 = _iterator22[_i24++]; + if (document.querySelectorAll) { + dropzones = document.querySelectorAll(".dropzone"); } else { - _i24 = _iterator22.next(); - if (_i24.done) break; - _ref21 = _i24.value; - } + dropzones = []; // IE :( - var file = _ref21; + var checkElements = function checkElements(elements) { + return function () { + var result = []; - file.xhr = xhr; - } - if (files[0].upload.chunked) { - // Put the xhr object in the right chunk object, so it can be associated later, and found with _getChunk - files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr; - } + var _iterator20 = dropzone_createForOfIteratorHelper(elements, true), + _step20; - var method = this.resolveOption(this.options.method, files); - var url = this.resolveOption(this.options.url, files); - xhr.open(method, url, true); + try { + for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) { + var el = _step20.value; - // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8 - xhr.timeout = this.resolveOption(this.options.timeout, files); + if (/(^| )dropzone($| )/.test(el.className)) { + result.push(dropzones.push(el)); + } else { + result.push(undefined); + } + } + } catch (err) { + _iterator20.e(err); + } finally { + _iterator20.f(); + } - // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179 - xhr.withCredentials = !!this.options.withCredentials; + return result; + }(); + }; - xhr.onload = function (e) { - _this15._finishedUploading(files, xhr, e); - }; + checkElements(document.getElementsByTagName("div")); + checkElements(document.getElementsByTagName("form")); + } - xhr.onerror = function () { - _this15._handleUploadError(files, xhr); - }; + return function () { + var result = []; - // Some browsers do not have the .upload property - var progressObj = xhr.upload != null ? xhr.upload : xhr; - progressObj.onprogress = function (e) { - return _this15._updateFilesUploadProgress(files, xhr, e); - }; + var _iterator21 = dropzone_createForOfIteratorHelper(dropzones, true), + _step21; - var headers = { - "Accept": "application/json", - "Cache-Control": "no-cache", - "X-Requested-With": "XMLHttpRequest" - }; + try { + for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) { + var dropzone = _step21.value; - if (this.options.headers) { - Dropzone.extend(headers, this.options.headers); - } + // Create a dropzone unless auto discover has been disabled for specific element + if (Dropzone.optionsForElement(dropzone) !== false) { + result.push(new Dropzone(dropzone)); + } else { + result.push(undefined); + } + } + } catch (err) { + _iterator21.e(err); + } finally { + _iterator21.f(); + } - for (var headerName in headers) { - var headerValue = headers[headerName]; - if (headerValue) { - xhr.setRequestHeader(headerName, headerValue); - } - } + return result; + }(); + }; // Some browsers support drag and drog functionality, but not correctly. +// +// So I created a blocklist of userAgents. Yes, yes. Browser sniffing, I know. +// But what to do when browsers *theoretically* support an API, but crash +// when using it. +// +// This is a list of regular expressions tested against navigator.userAgent +// +// ** It should only be used on browser that *do* support the API, but +// incorrectly ** + + + Dropzone.blockedBrowsers = [// The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API. + /opera.*(Macintosh|Windows Phone).*version\/12/i]; // Checks if the browser is supported - var formData = new FormData(); + Dropzone.isBrowserSupported = function () { + var capableBrowser = true; - // Adding all @options parameters - if (this.options.params) { - var additionalParams = this.options.params; - if (typeof additionalParams === 'function') { - additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null); - } + if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) { + if (!("classList" in document.createElement("a"))) { + capableBrowser = false; + } else { + if (Dropzone.blacklistedBrowsers !== undefined) { + // Since this has been renamed, this makes sure we don't break older + // configuration. + Dropzone.blockedBrowsers = Dropzone.blacklistedBrowsers; + } // The browser supports the API, but may be blocked. - for (var key in additionalParams) { - var value = additionalParams[key]; - formData.append(key, value); - } - } - // Let the user add additional data if necessary - for (var _iterator23 = files, _isArray23 = true, _i25 = 0, _iterator23 = _isArray23 ? _iterator23 : _iterator23[Symbol.iterator](); ;) { - var _ref22; + var _iterator22 = dropzone_createForOfIteratorHelper(Dropzone.blockedBrowsers, true), + _step22; - if (_isArray23) { - if (_i25 >= _iterator23.length) break; - _ref22 = _iterator23[_i25++]; + try { + for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) { + var regex = _step22.value; + + if (regex.test(navigator.userAgent)) { + capableBrowser = false; + continue; + } + } + } catch (err) { + _iterator22.e(err); + } finally { + _iterator22.f(); + } + } } else { - _i25 = _iterator23.next(); - if (_i25.done) break; - _ref22 = _i25.value; + capableBrowser = false; } - var _file = _ref22; - - this.emit("sending", _file, xhr, formData); - } - if (this.options.uploadMultiple) { - this.emit("sendingmultiple", files, xhr, formData); - } - - this._addFormElementData(formData); + return capableBrowser; + }; - // Finally add the files - // Has to be last because some servers (eg: S3) expect the file to be the last parameter - for (var i = 0; i < dataBlocks.length; i++) { - var dataBlock = dataBlocks[i]; - formData.append(dataBlock.name, dataBlock.data, dataBlock.filename); - } + Dropzone.dataURItoBlob = function (dataURI) { + // convert base64 to raw binary data held in a string + // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this + var byteString = atob(dataURI.split(",")[1]); // separate out the mime component - this.submitRequest(xhr, formData, files); - } + var mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0]; // write the bytes of the string to an ArrayBuffer - // Transforms all files with this.options.transformFile and invokes done with the transformed files when done. + var ab = new ArrayBuffer(byteString.length); + var ia = new Uint8Array(ab); - }, { - key: "_transformFiles", - value: function _transformFiles(files, done) { - var _this16 = this; + for (var i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--) { + ia[i] = byteString.charCodeAt(i); + } // write the ArrayBuffer to a blob - var transformedFiles = []; - // Clumsy way of handling asynchronous calls, until I get to add a proper Future library. - var doneCounter = 0; - var _loop = function _loop(i) { - _this16.options.transformFile.call(_this16, files[i], function (transformedFile) { - transformedFiles[i] = transformedFile; - if (++doneCounter === files.length) { - done(transformedFiles); - } + return new Blob([ab], { + type: mimeString }); - }; - - for (var i = 0; i < files.length; i++) { - _loop(i); - } - } + }; // Returns an array without the rejected item - // Takes care of adding other input elements of the form to the AJAX request - }, { - key: "_addFormElementData", - value: function _addFormElementData(formData) { - // Take care of other input elements - if (this.element.tagName === "FORM") { - for (var _iterator24 = this.element.querySelectorAll("input, textarea, select, button"), _isArray24 = true, _i26 = 0, _iterator24 = _isArray24 ? _iterator24 : _iterator24[Symbol.iterator](); ;) { - var _ref23; + var without = function without(list, rejectedItem) { + return list.filter(function (item) { + return item !== rejectedItem; + }).map(function (item) { + return item; + }); + }; // abc-def_ghi -> abcDefGhi - if (_isArray24) { - if (_i26 >= _iterator24.length) break; - _ref23 = _iterator24[_i26++]; - } else { - _i26 = _iterator24.next(); - if (_i26.done) break; - _ref23 = _i26.value; - } - var input = _ref23; + var camelize = function camelize(str) { + return str.replace(/[\-_](\w)/g, function (match) { + return match.charAt(1).toUpperCase(); + }); + }; // Creates an element from string - var inputName = input.getAttribute("name"); - var inputType = input.getAttribute("type"); - if (inputType) inputType = inputType.toLowerCase(); - // If the input doesn't have a name, we can't use it. - if (typeof inputName === 'undefined' || inputName === null) continue; + Dropzone.createElement = function (string) { + var div = document.createElement("div"); + div.innerHTML = string; + return div.childNodes[0]; + }; // Tests if given element is inside (or simply is) the container - if (input.tagName === "SELECT" && input.hasAttribute("multiple")) { - // Possibly multiple values - for (var _iterator25 = input.options, _isArray25 = true, _i27 = 0, _iterator25 = _isArray25 ? _iterator25 : _iterator25[Symbol.iterator](); ;) { - var _ref24; - if (_isArray25) { - if (_i27 >= _iterator25.length) break; - _ref24 = _iterator25[_i27++]; - } else { - _i27 = _iterator25.next(); - if (_i27.done) break; - _ref24 = _i27.value; - } + Dropzone.elementInside = function (element, container) { + if (element === container) { + return true; + } // Coffeescript doesn't support do/while loops - var option = _ref24; - if (option.selected) { - formData.append(inputName, option.value); - } - } - } else if (!inputType || inputType !== "checkbox" && inputType !== "radio" || input.checked) { - formData.append(inputName, input.value); + while (element = element.parentNode) { + if (element === container) { + return true; } } - } - } - - // Invoked when there is new progress information about given files. - // If e is not provided, it is assumed that the upload is finished. - - }, { - key: "_updateFilesUploadProgress", - value: function _updateFilesUploadProgress(files, xhr, e) { - var progress = void 0; - if (typeof e !== 'undefined') { - progress = 100 * e.loaded / e.total; - - if (files[0].upload.chunked) { - var file = files[0]; - // Since this is a chunked upload, we need to update the appropriate chunk progress. - var chunk = this._getChunk(file, xhr); - chunk.progress = progress; - chunk.total = e.total; - chunk.bytesSent = e.loaded; - var fileProgress = 0, - fileTotal = void 0, - fileBytesSent = void 0; - file.upload.progress = 0; - file.upload.total = 0; - file.upload.bytesSent = 0; - for (var i = 0; i < file.upload.totalChunkCount; i++) { - if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].progress !== undefined) { - file.upload.progress += file.upload.chunks[i].progress; - file.upload.total += file.upload.chunks[i].total; - file.upload.bytesSent += file.upload.chunks[i].bytesSent; - } - } - file.upload.progress = file.upload.progress / file.upload.totalChunkCount; - } else { - for (var _iterator26 = files, _isArray26 = true, _i28 = 0, _iterator26 = _isArray26 ? _iterator26 : _iterator26[Symbol.iterator](); ;) { - var _ref25; - if (_isArray26) { - if (_i28 >= _iterator26.length) break; - _ref25 = _iterator26[_i28++]; - } else { - _i28 = _iterator26.next(); - if (_i28.done) break; - _ref25 = _i28.value; - } + return false; + }; - var _file2 = _ref25; + Dropzone.getElement = function (el, name) { + var element; - _file2.upload.progress = progress; - _file2.upload.total = e.total; - _file2.upload.bytesSent = e.loaded; - } + if (typeof el === "string") { + element = document.querySelector(el); + } else if (el.nodeType != null) { + element = el; } - for (var _iterator27 = files, _isArray27 = true, _i29 = 0, _iterator27 = _isArray27 ? _iterator27 : _iterator27[Symbol.iterator](); ;) { - var _ref26; - - if (_isArray27) { - if (_i29 >= _iterator27.length) break; - _ref26 = _iterator27[_i29++]; - } else { - _i29 = _iterator27.next(); - if (_i29.done) break; - _ref26 = _i29.value; - } - var _file3 = _ref26; - - this.emit("uploadprogress", _file3, _file3.upload.progress, _file3.upload.bytesSent); + if (element == null) { + throw new Error("Invalid `".concat(name, "` option provided. Please provide a CSS selector or a plain HTML element.")); } - } else { - // Called when the file finished uploading - - var allFilesFinished = true; - progress = 100; + return element; + }; - for (var _iterator28 = files, _isArray28 = true, _i30 = 0, _iterator28 = _isArray28 ? _iterator28 : _iterator28[Symbol.iterator](); ;) { - var _ref27; + Dropzone.getElements = function (els, name) { + var el, elements; - if (_isArray28) { - if (_i30 >= _iterator28.length) break; - _ref27 = _iterator28[_i30++]; - } else { - _i30 = _iterator28.next(); - if (_i30.done) break; - _ref27 = _i30.value; - } + if (els instanceof Array) { + elements = []; - var _file4 = _ref27; + try { + var _iterator23 = dropzone_createForOfIteratorHelper(els, true), + _step23; - if (_file4.upload.progress !== 100 || _file4.upload.bytesSent !== _file4.upload.total) { - allFilesFinished = false; + try { + for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) { + el = _step23.value; + elements.push(this.getElement(el, name)); + } + } catch (err) { + _iterator23.e(err); + } finally { + _iterator23.f(); + } + } catch (e) { + elements = null; } - _file4.upload.progress = progress; - _file4.upload.bytesSent = _file4.upload.total; - } + } else if (typeof els === "string") { + elements = []; - // Nothing to do, all files already at 100% - if (allFilesFinished) { - return; - } - - for (var _iterator29 = files, _isArray29 = true, _i31 = 0, _iterator29 = _isArray29 ? _iterator29 : _iterator29[Symbol.iterator](); ;) { - var _ref28; + var _iterator24 = dropzone_createForOfIteratorHelper(document.querySelectorAll(els), true), + _step24; - if (_isArray29) { - if (_i31 >= _iterator29.length) break; - _ref28 = _iterator29[_i31++]; - } else { - _i31 = _iterator29.next(); - if (_i31.done) break; - _ref28 = _i31.value; + try { + for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) { + el = _step24.value; + elements.push(el); + } + } catch (err) { + _iterator24.e(err); + } finally { + _iterator24.f(); } + } else if (els.nodeType != null) { + elements = [els]; + } - var _file5 = _ref28; - - this.emit("uploadprogress", _file5, progress, _file5.upload.bytesSent); + if (elements == null || !elements.length) { + throw new Error("Invalid `".concat(name, "` option provided. Please provide a CSS selector, a plain HTML element or a list of those.")); } - } - } - }, { - key: "_finishedUploading", - value: function _finishedUploading(files, xhr, e) { - var response = void 0; - - if (files[0].status === Dropzone.CANCELED) { - return; - } - if (xhr.readyState !== 4) { - return; - } + return elements; + }; // Asks the user the question and calls accepted or rejected accordingly +// +// The default implementation just uses `window.confirm` and then calls the +// appropriate callback. - if (xhr.responseType !== 'arraybuffer' && xhr.responseType !== 'blob') { - response = xhr.responseText; - if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) { - try { - response = JSON.parse(response); - } catch (error) { - e = error; - response = "Invalid JSON response from server."; - } + Dropzone.confirm = function (question, accepted, rejected) { + if (window.confirm(question)) { + return accepted(); + } else if (rejected != null) { + return rejected(); } - } + }; // Validates the mime type like this: +// +// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept - this._updateFilesUploadProgress(files); - if (!(200 <= xhr.status && xhr.status < 300)) { - this._handleUploadError(files, xhr, response); - } else { - if (files[0].upload.chunked) { - files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr)); - } else { - this._finished(files, response, e); - } - } - } - }, { - key: "_handleUploadError", - value: function _handleUploadError(files, xhr, response) { - if (files[0].status === Dropzone.CANCELED) { - return; - } + Dropzone.isValidFile = function (file, acceptedFiles) { + if (!acceptedFiles) { + return true; + } // If there are no accepted mime types, it's OK - if (files[0].upload.chunked && this.options.retryChunks) { - var chunk = this._getChunk(files[0], xhr); - if (chunk.retries++ < this.options.retryChunksLimit) { - this._uploadData(files, [chunk.dataBlock]); - return; - } else { - console.warn('Retried this chunk too often. Giving up.'); - } - } - for (var _iterator30 = files, _isArray30 = true, _i32 = 0, _iterator30 = _isArray30 ? _iterator30 : _iterator30[Symbol.iterator](); ;) { - var _ref29; + acceptedFiles = acceptedFiles.split(","); + var mimeType = file.type; + var baseMimeType = mimeType.replace(/\/.*$/, ""); - if (_isArray30) { - if (_i32 >= _iterator30.length) break; - _ref29 = _iterator30[_i32++]; - } else { - _i32 = _iterator30.next(); - if (_i32.done) break; - _ref29 = _i32.value; - } + var _iterator25 = dropzone_createForOfIteratorHelper(acceptedFiles, true), + _step25; - var file = _ref29; + try { + for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) { + var validType = _step25.value; + validType = validType.trim(); - this._errorProcessing(files, response || this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr); - } - } - }, { - key: "submitRequest", - value: function submitRequest(xhr, formData, files) { - xhr.send(formData); - } - - // Called internally when processing is finished. - // Individual callbacks have to be called in the appropriate sections. - - }, { - key: "_finished", - value: function _finished(files, responseText, e) { - for (var _iterator31 = files, _isArray31 = true, _i33 = 0, _iterator31 = _isArray31 ? _iterator31 : _iterator31[Symbol.iterator](); ;) { - var _ref30; - - if (_isArray31) { - if (_i33 >= _iterator31.length) break; - _ref30 = _iterator31[_i33++]; - } else { - _i33 = _iterator31.next(); - if (_i33.done) break; - _ref30 = _i33.value; + if (validType.charAt(0) === ".") { + if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) { + return true; + } + } else if (/\/\*$/.test(validType)) { + // This is something like a image/* mime type + if (baseMimeType === validType.replace(/\/.*$/, "")) { + return true; + } + } else { + if (mimeType === validType) { + return true; + } + } + } + } catch (err) { + _iterator25.e(err); + } finally { + _iterator25.f(); } - var file = _ref30; + return false; + }; // Augment jQuery - file.status = Dropzone.SUCCESS; - this.emit("success", file, responseText, e); - this.emit("complete", file); - } - if (this.options.uploadMultiple) { - this.emit("successmultiple", files, responseText, e); - this.emit("completemultiple", files); - } - if (this.options.autoProcessQueue) { - return this.processQueue(); - } - } + if (typeof jQuery !== "undefined" && jQuery !== null) { + jQuery.fn.dropzone = function (options) { + return this.each(function () { + return new Dropzone(this, options); + }); + }; + } // Dropzone file status codes - // Called internally when processing is finished. - // Individual callbacks have to be called in the appropriate sections. - }, { - key: "_errorProcessing", - value: function _errorProcessing(files, message, xhr) { - for (var _iterator32 = files, _isArray32 = true, _i34 = 0, _iterator32 = _isArray32 ? _iterator32 : _iterator32[Symbol.iterator](); ;) { - var _ref31; + Dropzone.ADDED = "added"; + Dropzone.QUEUED = "queued"; // For backwards compatibility. Now, if a file is accepted, it's either queued +// or uploading. - if (_isArray32) { - if (_i34 >= _iterator32.length) break; - _ref31 = _iterator32[_i34++]; - } else { - _i34 = _iterator32.next(); - if (_i34.done) break; - _ref31 = _i34.value; - } + Dropzone.ACCEPTED = Dropzone.QUEUED; + Dropzone.UPLOADING = "uploading"; + Dropzone.PROCESSING = Dropzone.UPLOADING; // alias - var file = _ref31; + Dropzone.CANCELED = "canceled"; + Dropzone.ERROR = "error"; + Dropzone.SUCCESS = "success"; + /* - file.status = Dropzone.ERROR; - this.emit("error", file, message, xhr); - this.emit("complete", file); - } - if (this.options.uploadMultiple) { - this.emit("errormultiple", files, message, xhr); - this.emit("completemultiple", files); - } + Bugfix for iOS 6 and 7 + Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios + based on the work of https://github.com/stomita/ios-imagefile-megapixel - if (this.options.autoProcessQueue) { - return this.processQueue(); - } - } - }], [{ - key: "uuidv4", - value: function uuidv4() { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = Math.random() * 16 | 0, - v = c === 'x' ? r : r & 0x3 | 0x8; - return v.toString(16); - }); - } - }]); + */ +// Detecting vertical squash in loaded image. +// Fixes a bug which squash image vertically while drawing into canvas for some images. +// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel - return Dropzone; -}(Emitter); + var detectVerticalSquash = function detectVerticalSquash(img) { + var iw = img.naturalWidth; + var ih = img.naturalHeight; + var canvas = document.createElement("canvas"); + canvas.width = 1; + canvas.height = ih; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); -Dropzone.initClass(); + var _ctx$getImageData = ctx.getImageData(1, 0, 1, ih), + data = _ctx$getImageData.data; // search image edge pixel position in case it is squashed vertically. -Dropzone.version = "5.5.1"; -// This is a map of options for your different dropzones. Add configurations -// to this object for your different dropzone elemens. -// -// Example: -// -// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 }; -// -// To disable autoDiscover for a specific element, you can set `false` as an option: -// -// Dropzone.options.myDisabledElementId = false; -// -// And in html: -// -//
-Dropzone.options = {}; - -// Returns the options for an element or undefined if none available. -Dropzone.optionsForElement = function (element) { - // Get the `Dropzone.options.elementId` for this element if it exists - if (element.getAttribute("id")) { - return Dropzone.options[camelize(element.getAttribute("id"))]; - } else { - return undefined; - } -}; + var sy = 0; + var ey = ih; + var py = ih; -// Holds a list of all dropzone instances -Dropzone.instances = []; + while (py > sy) { + var alpha = data[(py - 1) * 4 + 3]; -// Returns the dropzone for given element if any -Dropzone.forElement = function (element) { - if (typeof element === "string") { - element = document.querySelector(element); - } - if ((element != null ? element.dropzone : undefined) == null) { - throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone."); - } - return element.dropzone; -}; - -// Set to false if you don't want Dropzone to automatically find and attach to .dropzone elements. -Dropzone.autoDiscover = true; - -// Looks for all .dropzone elements and creates a dropzone for them -Dropzone.discover = function () { - var dropzones = void 0; - if (document.querySelectorAll) { - dropzones = document.querySelectorAll(".dropzone"); - } else { - dropzones = []; - // IE :( - var checkElements = function checkElements(elements) { - return function () { - var result = []; - for (var _iterator33 = elements, _isArray33 = true, _i35 = 0, _iterator33 = _isArray33 ? _iterator33 : _iterator33[Symbol.iterator](); ;) { - var _ref32; - - if (_isArray33) { - if (_i35 >= _iterator33.length) break; - _ref32 = _iterator33[_i35++]; + if (alpha === 0) { + ey = py; } else { - _i35 = _iterator33.next(); - if (_i35.done) break; - _ref32 = _i35.value; + sy = py; } - var el = _ref32; - - if (/(^| )dropzone($| )/.test(el.className)) { - result.push(dropzones.push(el)); - } else { - result.push(undefined); - } + py = ey + sy >> 1; } - return result; - }(); - }; - checkElements(document.getElementsByTagName("div")); - checkElements(document.getElementsByTagName("form")); - } - - return function () { - var result = []; - for (var _iterator34 = dropzones, _isArray34 = true, _i36 = 0, _iterator34 = _isArray34 ? _iterator34 : _iterator34[Symbol.iterator](); ;) { - var _ref33; - - if (_isArray34) { - if (_i36 >= _iterator34.length) break; - _ref33 = _iterator34[_i36++]; - } else { - _i36 = _iterator34.next(); - if (_i36.done) break; - _ref33 = _i36.value; - } - var dropzone = _ref33; + var ratio = py / ih; - // Create a dropzone unless auto discover has been disabled for specific element - if (Dropzone.optionsForElement(dropzone) !== false) { - result.push(new Dropzone(dropzone)); - } else { - result.push(undefined); - } - } - return result; - }(); -}; - -// Since the whole Drag'n'Drop API is pretty new, some browsers implement it, -// but not correctly. -// So I created a blacklist of userAgents. Yes, yes. Browser sniffing, I know. -// But what to do when browsers *theoretically* support an API, but crash -// when using it. -// -// This is a list of regular expressions tested against navigator.userAgent -// -// ** It should only be used on browser that *do* support the API, but -// incorrectly ** -// -Dropzone.blacklistedBrowsers = [ -// The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API. - /opera.*(Macintosh|Windows Phone).*version\/12/i]; - -// Checks if the browser is supported -Dropzone.isBrowserSupported = function () { - var capableBrowser = true; - - if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) { - if (!("classList" in document.createElement("a"))) { - capableBrowser = false; - } else { - // The browser supports the API, but may be blacklisted. - for (var _iterator35 = Dropzone.blacklistedBrowsers, _isArray35 = true, _i37 = 0, _iterator35 = _isArray35 ? _iterator35 : _iterator35[Symbol.iterator](); ;) { - var _ref34; - - if (_isArray35) { - if (_i37 >= _iterator35.length) break; - _ref34 = _iterator35[_i37++]; + if (ratio === 0) { + return 1; } else { - _i37 = _iterator35.next(); - if (_i37.done) break; - _ref34 = _i37.value; + return ratio; } + }; // A replacement for context.drawImage +// (args are for source and destination). - var regex = _ref34; - - if (regex.test(navigator.userAgent)) { - capableBrowser = false; - continue; - } - } - } - } else { - capableBrowser = false; - } - return capableBrowser; -}; + var drawImageIOSFix = function drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) { + var vertSquashRatio = detectVerticalSquash(img); + return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio); + }; // Based on MinifyJpeg +// Source: http://www.perry.cz/files/ExifRestorer.js +// http://elicon.blog57.fc2.com/blog-entry-206.html -Dropzone.dataURItoBlob = function (dataURI) { - // convert base64 to raw binary data held in a string - // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this - var byteString = atob(dataURI.split(',')[1]); - // separate out the mime component - var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; + var ExifRestore = /*#__PURE__*/function () { + function ExifRestore() { + dropzone_classCallCheck(this, ExifRestore); + } - // write the bytes of the string to an ArrayBuffer - var ab = new ArrayBuffer(byteString.length); - var ia = new Uint8Array(ab); - for (var i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--) { - ia[i] = byteString.charCodeAt(i); - } + dropzone_createClass(ExifRestore, null, [{ + key: "initClass", + value: function initClass() { + this.KEY_STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + } + }, { + key: "encode64", + value: function encode64(input) { + var output = ""; + var chr1 = undefined; + var chr2 = undefined; + var chr3 = ""; + var enc1 = undefined; + var enc2 = undefined; + var enc3 = undefined; + var enc4 = ""; + var i = 0; + + while (true) { + chr1 = input[i++]; + chr2 = input[i++]; + chr3 = input[i++]; + enc1 = chr1 >> 2; + enc2 = (chr1 & 3) << 4 | chr2 >> 4; + enc3 = (chr2 & 15) << 2 | chr3 >> 6; + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } - // write the ArrayBuffer to a blob - return new Blob([ab], {type: mimeString}); -}; - -// Returns an array without the rejected item -var without = function without(list, rejectedItem) { - return list.filter(function (item) { - return item !== rejectedItem; - }).map(function (item) { - return item; - }); -}; - -// abc-def_ghi -> abcDefGhi -var camelize = function camelize(str) { - return str.replace(/[\-_](\w)/g, function (match) { - return match.charAt(1).toUpperCase(); - }); -}; - -// Creates an element from string -Dropzone.createElement = function (string) { - var div = document.createElement("div"); - div.innerHTML = string; - return div.childNodes[0]; -}; - -// Tests if given element is inside (or simply is) the container -Dropzone.elementInside = function (element, container) { - if (element === container) { - return true; - } // Coffeescript doesn't support do/while loops - while (element = element.parentNode) { - if (element === container) { - return true; - } - } - return false; -}; - -Dropzone.getElement = function (el, name) { - var element = void 0; - if (typeof el === "string") { - element = document.querySelector(el); - } else if (el.nodeType != null) { - element = el; - } - if (element == null) { - throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector or a plain HTML element."); - } - return element; -}; - -Dropzone.getElements = function (els, name) { - var el = void 0, - elements = void 0; - if (els instanceof Array) { - elements = []; - try { - for (var _iterator36 = els, _isArray36 = true, _i38 = 0, _iterator36 = _isArray36 ? _iterator36 : _iterator36[Symbol.iterator](); ;) { - if (_isArray36) { - if (_i38 >= _iterator36.length) break; - el = _iterator36[_i38++]; - } else { - _i38 = _iterator36.next(); - if (_i38.done) break; - el = _i38.value; - } + output = output + this.KEY_STR.charAt(enc1) + this.KEY_STR.charAt(enc2) + this.KEY_STR.charAt(enc3) + this.KEY_STR.charAt(enc4); + chr1 = chr2 = chr3 = ""; + enc1 = enc2 = enc3 = enc4 = ""; - elements.push(this.getElement(el, name)); - } - } catch (e) { - elements = null; - } - } else if (typeof els === "string") { - elements = []; - for (var _iterator37 = document.querySelectorAll(els), _isArray37 = true, _i39 = 0, _iterator37 = _isArray37 ? _iterator37 : _iterator37[Symbol.iterator](); ;) { - if (_isArray37) { - if (_i39 >= _iterator37.length) break; - el = _iterator37[_i39++]; - } else { - _i39 = _iterator37.next(); - if (_i39.done) break; - el = _i39.value; - } + if (!(i < input.length)) { + break; + } + } - elements.push(el); - } - } else if (els.nodeType != null) { - elements = [els]; - } + return output; + } + }, { + key: "restore", + value: function restore(origFileBase64, resizedFileBase64) { + if (!origFileBase64.match("data:image/jpeg;base64,")) { + return resizedFileBase64; + } - if (elements == null || !elements.length) { - throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector, a plain HTML element or a list of those."); - } + var rawImage = this.decode64(origFileBase64.replace("data:image/jpeg;base64,", "")); + var segments = this.slice2Segments(rawImage); + var image = this.exifManipulation(resizedFileBase64, segments); + return "data:image/jpeg;base64,".concat(this.encode64(image)); + } + }, { + key: "exifManipulation", + value: function exifManipulation(resizedFileBase64, segments) { + var exifArray = this.getExifArray(segments); + var newImageArray = this.insertExif(resizedFileBase64, exifArray); + var aBuffer = new Uint8Array(newImageArray); + return aBuffer; + } + }, { + key: "getExifArray", + value: function getExifArray(segments) { + var seg = undefined; + var x = 0; - return elements; -}; + while (x < segments.length) { + seg = segments[x]; -// Asks the user the question and calls accepted or rejected accordingly -// -// The default implementation just uses `window.confirm` and then calls the -// appropriate callback. -Dropzone.confirm = function (question, accepted, rejected) { - if (window.confirm(question)) { - return accepted(); - } else if (rejected != null) { - return rejected(); - } -}; + if (seg[0] === 255 & seg[1] === 225) { + return seg; + } -// Validates the mime type like this: -// -// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept -Dropzone.isValidFile = function (file, acceptedFiles) { - if (!acceptedFiles) { - return true; - } // If there are no accepted mime types, it's OK - acceptedFiles = acceptedFiles.split(","); - - var mimeType = file.type; - var baseMimeType = mimeType.replace(/\/.*$/, ""); - - for (var _iterator38 = acceptedFiles, _isArray38 = true, _i40 = 0, _iterator38 = _isArray38 ? _iterator38 : _iterator38[Symbol.iterator](); ;) { - var _ref35; - - if (_isArray38) { - if (_i40 >= _iterator38.length) break; - _ref35 = _iterator38[_i40++]; - } else { - _i40 = _iterator38.next(); - if (_i40.done) break; - _ref35 = _i40.value; - } - - var validType = _ref35; - - validType = validType.trim(); - if (validType.charAt(0) === ".") { - if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) { - return true; - } - } else if (/\/\*$/.test(validType)) { - // This is something like a image/* mime type - if (baseMimeType === validType.replace(/\/.*$/, "")) { - return true; - } - } else { - if (mimeType === validType) { - return true; - } - } - } + x++; + } - return false; -}; - -// Augment jQuery -if (typeof jQuery !== 'undefined' && jQuery !== null) { - jQuery.fn.dropzone = function (options) { - return this.each(function () { - return new Dropzone(this, options); - }); - }; -} - -if (typeof module !== 'undefined' && module !== null) { - module.exports = Dropzone; -} else { - window.Dropzone = Dropzone; -} - -// Dropzone file status codes -Dropzone.ADDED = "added"; - -Dropzone.QUEUED = "queued"; -// For backwards compatibility. Now, if a file is accepted, it's either queued -// or uploading. -Dropzone.ACCEPTED = Dropzone.QUEUED; + return []; + } + }, { + key: "insertExif", + value: function insertExif(resizedFileBase64, exifArray) { + var imageData = resizedFileBase64.replace("data:image/jpeg;base64,", ""); + var buf = this.decode64(imageData); + var separatePoint = buf.indexOf(255, 3); + var mae = buf.slice(0, separatePoint); + var ato = buf.slice(separatePoint); + var array = mae; + array = array.concat(exifArray); + array = array.concat(ato); + return array; + } + }, { + key: "slice2Segments", + value: function slice2Segments(rawImageArray) { + var head = 0; + var segments = []; -Dropzone.UPLOADING = "uploading"; -Dropzone.PROCESSING = Dropzone.UPLOADING; // alias + while (true) { + var length; -Dropzone.CANCELED = "canceled"; -Dropzone.ERROR = "error"; -Dropzone.SUCCESS = "success"; + if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 218) { + break; + } -/* + if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 216) { + head += 2; + } else { + length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3]; + var endPoint = head + length + 2; + var seg = rawImageArray.slice(head, endPoint); + segments.push(seg); + head = endPoint; + } - Bugfix for iOS 6 and 7 - Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios - based on the work of https://github.com/stomita/ios-imagefile-megapixel + if (head > rawImageArray.length) { + break; + } + } - */ + return segments; + } + }, { + key: "decode64", + value: function decode64(input) { + var output = ""; + var chr1 = undefined; + var chr2 = undefined; + var chr3 = ""; + var enc1 = undefined; + var enc2 = undefined; + var enc3 = undefined; + var enc4 = ""; + var i = 0; + var buf = []; // remove all characters that are not A-Z, a-z, 0-9, +, /, or = + + var base64test = /[^A-Za-z0-9\+\/\=]/g; + + if (base64test.exec(input)) { + console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."); + } -// Detecting vertical squash in loaded image. -// Fixes a bug which squash image vertically while drawing into canvas for some images. -// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel -var detectVerticalSquash = function detectVerticalSquash(img) { - var iw = img.naturalWidth; - var ih = img.naturalHeight; - var canvas = document.createElement("canvas"); - canvas.width = 1; - canvas.height = ih; - var ctx = canvas.getContext("2d"); - ctx.drawImage(img, 0, 0); - - var _ctx$getImageData = ctx.getImageData(1, 0, 1, ih), - data = _ctx$getImageData.data; - - // search image edge pixel position in case it is squashed vertically. - - - var sy = 0; - var ey = ih; - var py = ih; - while (py > sy) { - var alpha = data[(py - 1) * 4 + 3]; - - if (alpha === 0) { - ey = py; - } else { - sy = py; - } - - py = ey + sy >> 1; - } - var ratio = py / ih; + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - if (ratio === 0) { - return 1; - } else { - return ratio; - } -}; + while (true) { + enc1 = this.KEY_STR.indexOf(input.charAt(i++)); + enc2 = this.KEY_STR.indexOf(input.charAt(i++)); + enc3 = this.KEY_STR.indexOf(input.charAt(i++)); + enc4 = this.KEY_STR.indexOf(input.charAt(i++)); + chr1 = enc1 << 2 | enc2 >> 4; + chr2 = (enc2 & 15) << 4 | enc3 >> 2; + chr3 = (enc3 & 3) << 6 | enc4; + buf.push(chr1); -// A replacement for context.drawImage -// (args are for source and destination). -var drawImageIOSFix = function drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) { - var vertSquashRatio = detectVerticalSquash(img); - return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio); -}; + if (enc3 !== 64) { + buf.push(chr2); + } -// Based on MinifyJpeg -// Source: http://www.perry.cz/files/ExifRestorer.js -// http://elicon.blog57.fc2.com/blog-entry-206.html + if (enc4 !== 64) { + buf.push(chr3); + } -var ExifRestore = function () { - function ExifRestore() { - _classCallCheck(this, ExifRestore); - } + chr1 = chr2 = chr3 = ""; + enc1 = enc2 = enc3 = enc4 = ""; - _createClass(ExifRestore, null, [{ - key: "initClass", - value: function initClass() { - this.KEY_STR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - } - }, { - key: "encode64", - value: function encode64(input) { - var output = ''; - var chr1 = undefined; - var chr2 = undefined; - var chr3 = ''; - var enc1 = undefined; - var enc2 = undefined; - var enc3 = undefined; - var enc4 = ''; - var i = 0; - while (true) { - chr1 = input[i++]; - chr2 = input[i++]; - chr3 = input[i++]; - enc1 = chr1 >> 2; - enc2 = (chr1 & 3) << 4 | chr2 >> 4; - enc3 = (chr2 & 15) << 2 | chr3 >> 6; - enc4 = chr3 & 63; - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } - output = output + this.KEY_STR.charAt(enc1) + this.KEY_STR.charAt(enc2) + this.KEY_STR.charAt(enc3) + this.KEY_STR.charAt(enc4); - chr1 = chr2 = chr3 = ''; - enc1 = enc2 = enc3 = enc4 = ''; - if (!(i < input.length)) { - break; - } - } - return output; - } - }, { - key: "restore", - value: function restore(origFileBase64, resizedFileBase64) { - if (!origFileBase64.match('data:image/jpeg;base64,')) { - return resizedFileBase64; - } - var rawImage = this.decode64(origFileBase64.replace('data:image/jpeg;base64,', '')); - var segments = this.slice2Segments(rawImage); - var image = this.exifManipulation(resizedFileBase64, segments); - return "data:image/jpeg;base64," + this.encode64(image); - } - }, { - key: "exifManipulation", - value: function exifManipulation(resizedFileBase64, segments) { - var exifArray = this.getExifArray(segments); - var newImageArray = this.insertExif(resizedFileBase64, exifArray); - var aBuffer = new Uint8Array(newImageArray); - return aBuffer; - } - }, { - key: "getExifArray", - value: function getExifArray(segments) { - var seg = undefined; - var x = 0; - while (x < segments.length) { - seg = segments[x]; - if (seg[0] === 255 & seg[1] === 225) { - return seg; - } - x++; - } - return []; - } - }, { - key: "insertExif", - value: function insertExif(resizedFileBase64, exifArray) { - var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', ''); - var buf = this.decode64(imageData); - var separatePoint = buf.indexOf(255, 3); - var mae = buf.slice(0, separatePoint); - var ato = buf.slice(separatePoint); - var array = mae; - array = array.concat(exifArray); - array = array.concat(ato); - return array; - } - }, { - key: "slice2Segments", - value: function slice2Segments(rawImageArray) { - var head = 0; - var segments = []; - while (true) { - var length; - if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 218) { - break; - } - if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 216) { - head += 2; - } else { - length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3]; - var endPoint = head + length + 2; - var seg = rawImageArray.slice(head, endPoint); - segments.push(seg); - head = endPoint; - } - if (head > rawImageArray.length) { - break; - } - } - return segments; - } - }, { - key: "decode64", - value: function decode64(input) { - var output = ''; - var chr1 = undefined; - var chr2 = undefined; - var chr3 = ''; - var enc1 = undefined; - var enc2 = undefined; - var enc3 = undefined; - var enc4 = ''; - var i = 0; - var buf = []; - // remove all characters that are not A-Z, a-z, 0-9, +, /, or = - var base64test = /[^A-Za-z0-9\+\/\=]/g; - if (base64test.exec(input)) { - console.warn('There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, \'+\', \'/\',and \'=\'\nExpect errors in decoding.'); - } - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); - while (true) { - enc1 = this.KEY_STR.indexOf(input.charAt(i++)); - enc2 = this.KEY_STR.indexOf(input.charAt(i++)); - enc3 = this.KEY_STR.indexOf(input.charAt(i++)); - enc4 = this.KEY_STR.indexOf(input.charAt(i++)); - chr1 = enc1 << 2 | enc2 >> 4; - chr2 = (enc2 & 15) << 4 | enc3 >> 2; - chr3 = (enc3 & 3) << 6 | enc4; - buf.push(chr1); - if (enc3 !== 64) { - buf.push(chr2); - } - if (enc4 !== 64) { - buf.push(chr3); - } - chr1 = chr2 = chr3 = ''; - enc1 = enc2 = enc3 = enc4 = ''; - if (!(i < input.length)) { - break; - } - } - return buf; - } - }]); + if (!(i < input.length)) { + break; + } + } - return ExifRestore; -}(); + return buf; + } + }]); -ExifRestore.initClass(); + return ExifRestore; + }(); -/* + ExifRestore.initClass(); + /* * contentloaded.js * * Author: Diego Perini (diego.perini at gmail.com) @@ -3546,70 +10354,88 @@ ExifRestore.initClass(); * http://javascript.nwbox.com/ContentLoaded/ * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE */ - // @win window reference // @fn function reference -var contentLoaded = function contentLoaded(win, fn) { - var done = false; - var top = true; - var doc = win.document; - var root = doc.documentElement; - var add = doc.addEventListener ? "addEventListener" : "attachEvent"; - var rem = doc.addEventListener ? "removeEventListener" : "detachEvent"; - var pre = doc.addEventListener ? "" : "on"; - var init = function init(e) { - if (e.type === "readystatechange" && doc.readyState !== "complete") { - return; - } - (e.type === "load" ? win : doc)[rem](pre + e.type, init, false); - if (!done && (done = true)) { - return fn.call(win, e.type || e); - } - }; - - var poll = function poll() { - try { - root.doScroll("left"); - } catch (e) { - setTimeout(poll, 50); - return; - } - return init("poll"); - }; - - if (doc.readyState !== "complete") { - if (doc.createEventObject && root.doScroll) { - try { - top = !win.frameElement; - } catch (error) { + + var contentLoaded = function contentLoaded(win, fn) { + var done = false; + var top = true; + var doc = win.document; + var root = doc.documentElement; + var add = doc.addEventListener ? "addEventListener" : "attachEvent"; + var rem = doc.addEventListener ? "removeEventListener" : "detachEvent"; + var pre = doc.addEventListener ? "" : "on"; + + var init = function init(e) { + if (e.type === "readystatechange" && doc.readyState !== "complete") { + return; + } + + (e.type === "load" ? win : doc)[rem](pre + e.type, init, false); + + if (!done && (done = true)) { + return fn.call(win, e.type || e); + } + }; + + var poll = function poll() { + try { + root.doScroll("left"); + } catch (e) { + setTimeout(poll, 50); + return; + } + + return init("poll"); + }; + + if (doc.readyState !== "complete") { + if (doc.createEventObject && root.doScroll) { + try { + top = !win.frameElement; + } catch (error) {} + + if (top) { + poll(); + } + } + + doc[add](pre + "DOMContentLoaded", init, false); + doc[add](pre + "readystatechange", init, false); + return win[add](pre + "load", init, false); + } + }; // As a single function to be able to write tests. + + + Dropzone._autoDiscoverFunction = function () { + if (Dropzone.autoDiscover) { + return Dropzone.discover(); + } + }; + + contentLoaded(window, Dropzone._autoDiscoverFunction); + + function __guard__(value, transform) { + return typeof value !== "undefined" && value !== null ? transform(value) : undefined; } - if (top) { - poll(); + + function __guardMethod__(obj, methodName, transform) { + if (typeof obj !== "undefined" && obj !== null && typeof obj[methodName] === "function") { + return transform(obj, methodName); + } else { + return undefined; + } } - } - doc[add](pre + "DOMContentLoaded", init, false); - doc[add](pre + "readystatechange", init, false); - return win[add](pre + "load", init, false); - } -}; -// As a single function to be able to write tests. -Dropzone._autoDiscoverFunction = function () { - if (Dropzone.autoDiscover) { - return Dropzone.discover(); - } -}; -contentLoaded(window, Dropzone._autoDiscoverFunction); - -function __guard__(value, transform) { - return typeof value !== 'undefined' && value !== null ? transform(value) : undefined; -} - -function __guardMethod__(obj, methodName, transform) { - if (typeof obj !== 'undefined' && obj !== null && typeof obj[methodName] === 'function') { - return transform(obj, methodName); - } else { - return undefined; - } -} + ;// CONCATENATED MODULE: ./tool/dropzone.dist.js + /// Make Dropzone a global variable. + + window.Dropzone = Dropzone; + /* harmony default export */ var dropzone_dist = (Dropzone); + + }(); + /******/ return __webpack_exports__; + /******/ })() + ; +}); diff --git a/src/public/sortable/sortable.js b/src/public/sortable/sortable.js index 8ee227b..fdbd904 100644 --- a/src/public/sortable/sortable.js +++ b/src/public/sortable/sortable.js @@ -1,16 +1,57 @@ /**! - * Sortable 1.10.1 - * @author RubaXa - * @author owenm + * Sortable 1.14.0 + * @author RubaXa + * @author owenm * @license MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.Sortable = factory()); -}(this, function () { 'use strict'; +}(this, (function () { + 'use strict'; + + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } + + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; + } function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; @@ -57,25 +98,6 @@ return _extends.apply(this, arguments); } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } - - return target; - } - function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; @@ -113,32 +135,43 @@ } function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } + if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; } function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - var version = "1.10.1"; + var version = "1.14.0"; function userAgent(pattern) { if (typeof window !== 'undefined' && window.navigator) { - return !! - /*@__PURE__*/ - navigator.userAgent.match(pattern); + return !! /*@__PURE__*/navigator.userAgent.match(pattern); } } @@ -266,7 +299,7 @@ } while (!selfOnly && (el = el.parentNode)); } - var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix; + var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix; /*jshint -W056 */ return matrixFn && new matrixFn(appliedTransforms); @@ -291,12 +324,15 @@ } function getWindowScrollingElement() { - if (IE11OrLess) { - return document.documentElement; + var scrollingElement = document.scrollingElement; + + if (scrollingElement) { + return scrollingElement; } else { - return document.scrollingElement; + return document.documentElement; } } + /** * Returns the "bounding client rect" of given element * @param {HTMLElement} el The element whose boundingClientRect is wanted @@ -312,7 +348,7 @@ if (!el.getBoundingClientRect && el !== window) return; var elRect, top, left, bottom, right, height, width; - if (el !== window && el !== getWindowScrollingElement()) { + if (el !== window && el.parentNode && el !== getWindowScrollingElement()) { elRect = el.getBoundingClientRect(); top = elRect.top; left = elRect.left; @@ -376,6 +412,7 @@ height: height }; } + /** * Checks if a side of an element is scrolled past a side of its parents * @param {HTMLElement} el The element who's side being scrolled out of view is in question @@ -407,6 +444,7 @@ return false; } + /** * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible) * and non-draggable elements @@ -417,13 +455,13 @@ */ - function getChild(el, childNum, options) { + function getChild(el, childNum, options, includeDragEl) { var currentChild = 0, i = 0, children = el.children; while (i < children.length) { - if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && children[i] !== Sortable.dragged && closest(children[i], options.draggable, el, false)) { + if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) { if (currentChild === childNum) { return children[i]; } @@ -436,6 +474,7 @@ return null; } + /** * Gets the last child in the el, ignoring ghostEl or invisible elements (clones) * @param {HTMLElement} el Parent element @@ -453,6 +492,7 @@ return last || null; } + /** * Returns the index of an element within its parent for a selected set of * elements @@ -479,6 +519,7 @@ return index; } + /** * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements. * The value is returned in real pixels. @@ -504,6 +545,7 @@ return [offsetLeft, offsetTop]; } + /** * Returns the index of the object within the given array * @param {Array} arr Array that may or may not hold the object @@ -641,7 +683,7 @@ rect: getRect(child) }); - var fromRect = _objectSpread({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation + var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation if (child.thisAnimationDuration) { @@ -752,7 +794,7 @@ target.animatingX = !!translateX; target.animatingY = !!translateY; css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)'); - repaint(target); // repaint + this.forRepaintDummy = repaint(target); // repaint css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : '')); css(target, 'transform', 'translate3d(0,0,0)'); @@ -790,6 +832,11 @@ } } + plugins.forEach(function (p) { + if (p.pluginName === plugin.pluginName) { + throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once"); + } + }); plugins.push(plugin); }, pluginEvent: function pluginEvent(eventName, sortable, evt) { @@ -806,7 +853,7 @@ if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable if (sortable[plugin.pluginName][eventNameGlobal]) { - sortable[plugin.pluginName][eventNameGlobal](_objectSpread({ + sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({ sortable: sortable }, evt)); } // Only fire plugin event if plugin is enabled in this sortable, @@ -814,7 +861,7 @@ if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) { - sortable[plugin.pluginName][eventName](_objectSpread({ + sortable[plugin.pluginName][eventName](_objectSpread2({ sortable: sortable }, evt)); } @@ -906,7 +953,7 @@ evt.originalEvent = originalEvent; evt.pullMode = putSortable ? putSortable.lastPutMode : undefined; - var allEventProperties = _objectSpread({}, extraEventProperties, PluginManager.getEventProperties(name, sortable)); + var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable)); for (var option in allEventProperties) { evt[option] = allEventProperties[option]; @@ -921,12 +968,14 @@ } } + var _excluded = ["evt"]; + var pluginEvent = function pluginEvent(eventName, sortable) { var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, originalEvent = _ref.evt, - data = _objectWithoutProperties(_ref, ["evt"]); + data = _objectWithoutProperties(_ref, _excluded); - PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread({ + PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({ dragEl: dragEl, parentEl: parentEl, ghostEl: ghostEl, @@ -962,7 +1011,7 @@ }; function _dispatchEvent(info) { - dispatchEvent(_objectSpread({ + dispatchEvent(_objectSpread2({ putSortable: putSortable, cloneEl: cloneEl, targetEl: dragEl, @@ -1071,13 +1120,13 @@ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) { var ret; sortables.some(function (sortable) { - if (lastChild(sortable)) return; + var threshold = sortable[expando].options.emptyInsertThreshold; + if (!threshold || lastChild(sortable)) return; var rect = getRect(sortable), - threshold = sortable[expando].options.emptyInsertThreshold, insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold; - if (threshold && insideHorizontally && insideVertically) { + if (insideHorizontally && insideVertically) { return ret = sortable; } }); @@ -1174,6 +1223,7 @@ dragEl.parentNode[expando]._isOutsideThisEl(evt.target); } }; + /** * @class Sortable * @param {HTMLElement} el @@ -1233,7 +1283,7 @@ x: 0, y: 0 }, - supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window, + supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari, emptyInsertThreshold: 5 }; PluginManager.initializePlugins(this, el, defaults); // Set default options @@ -1320,6 +1370,11 @@ if (originalTarget.isContentEditable) { return; + } // Safari ignores further event handling after mousedown + + + if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') { + return; } target = closest(target, options.draggable, el, false); @@ -1549,7 +1604,8 @@ } else { window.getSelection().removeAllRanges(); } - } catch (err) {} + } catch (err) { + } }, _dragStarted: function _dragStarted(fallback, evt) { @@ -1631,7 +1687,7 @@ fallbackTolerance = options.fallbackTolerance, fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, - ghostMatrix = ghostEl && matrix(ghostEl), + ghostMatrix = ghostEl && matrix(ghostEl, true), scaleX = ghostEl && ghostMatrix && ghostMatrix.a, scaleY = ghostEl && ghostMatrix && ghostMatrix.d, relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent), @@ -1823,7 +1879,7 @@ if (_silent) return; function dragOverEvent(name, extra) { - pluginEvent(name, _this, _objectSpread({ + pluginEvent(name, _this, _objectSpread2({ evt: evt, isOwner: isOwner, axis: vertical ? 'vertical' : 'horizontal', @@ -1940,7 +1996,7 @@ ignoreNextClick = false; - if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list + if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) { vertical = this._getDirection(evt, target) === 'vertical'; dragRect = getRect(dragEl); @@ -1970,10 +2026,11 @@ var elLastChild = lastChild(el, options.draggable); if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) { + // Insert to end of list // If already at end of list: Do not insert if (elLastChild === dragEl) { return completed(false); - } // assign target only if condition is true + } // if there is a last element, it is the target if (elLastChild && el === evt.target) { @@ -1989,6 +2046,25 @@ el.appendChild(dragEl); parentEl = el; // actualization + changed(); + return completed(true); + } + } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) { + // Insert to start of list + var firstChild = getChild(el, 0, options, true); + + if (firstChild === dragEl) { + return completed(false); + } + + target = firstChild; + targetRect = getRect(target); + + if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) { + capture(); + el.insertBefore(dragEl, firstChild); + parentEl = el; // actualization + changed(); return completed(true); } @@ -2136,6 +2212,8 @@ css(document.body, 'user-select', ''); } + css(dragEl, 'transform', ''); + if (evt) { if (moved) { evt.cancelable && evt.preventDefault(); @@ -2315,7 +2393,7 @@ * Sorts the elements according to the array. * @param {String[]} order order of the items */ - sort: function sort(order) { + sort: function sort(order, useAnimation) { var items = {}, rootEl = this.el; this.toArray().forEach(function (id, i) { @@ -2325,12 +2403,14 @@ items[id] = el; } }, this); + useAnimation && this.captureAnimationState(); order.forEach(function (id) { if (items[id]) { rootEl.removeChild(items[id]); rootEl.appendChild(items[id]); } }); + useAnimation && this.animateAll(); }, /** @@ -2400,6 +2480,8 @@ this._onDrop(); + this._disableDelayedDragEvents(); + sortables.splice(sortables.indexOf(this.el), 1); this.el = el = null; }, @@ -2427,7 +2509,7 @@ pluginEvent('showClone', this); if (Sortable.eventCanceled) return; // show clone at dragEl or original position - if (rootEl.contains(dragEl) && !this.options.group.revertClone) { + if (dragEl.parentNode == rootEl && !this.options.group.revertClone) { rootEl.insertBefore(cloneEl, dragEl); } else if (nextEl) { rootEl.insertBefore(cloneEl, nextEl); @@ -2496,6 +2578,12 @@ _silent = false; } + function _ghostIsFirst(evt, vertical, sortable) { + var rect = getRect(getChild(sortable.el, 0, sortable.options, true)); + var spacer = 10; + return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left; + } + function _ghostIsLast(evt, vertical, sortable) { var rect = getRect(lastChild(sortable.el, sortable.options.draggable)); var spacer = 10; @@ -2547,6 +2635,7 @@ return 0; } + /** * Gets the direction dragEl must be swapped relative to target in order to make it * seem that dragEl has been "inserted" into that element's position @@ -2562,6 +2651,7 @@ return -1; } } + /** * Generate id * @param {HTMLElement} el @@ -2656,7 +2746,7 @@ throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin)); } - if (plugin.utils) Sortable.utils = _objectSpread({}, Sortable.utils, plugin.utils); + if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils); PluginManager.mount(plugin); }); }; @@ -2687,6 +2777,7 @@ function AutoScroll() { this.defaults = { scroll: true, + forceAutoScrollFallback: false, scrollSensitivity: 30, scrollSpeed: 10, bubbleScroll: true @@ -2754,7 +2845,7 @@ // MACOS Safari does not have autoscroll, // Firefox and Chrome are good - if (fallback || Edge || IE11OrLess || Safari) { + if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) { autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change var ogElemScroller = getParentAutoScrollElement(elem, true); @@ -2927,7 +3018,8 @@ } }; - function Revert() {} + function Revert() { + } Revert.prototype = { startIndex: null, @@ -2965,7 +3057,8 @@ pluginName: 'revertOnSpill' }); - function Remove() {} + function Remove() { + } Remove.prototype = { onSpill: function onSpill(_ref4) { @@ -3454,7 +3547,8 @@ if (dragStarted && this.isMultiDrag) { - // Do not "unfold" after around dragEl if reverted + folding = false; // Do not "unfold" after around dragEl if reverted + if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) { var dragRect = getRect(dragEl$1), multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')'); @@ -3540,7 +3634,7 @@ off(document, 'keyup', this._checkKeyUp); }, _deselectMultiDrag: function _deselectMultiDrag(evt) { - if (dragStarted) return; // Only deselect if selection is in this sortable + if (typeof dragStarted !== "undefined" && dragStarted) return; // Only deselect if selection is in this sortable if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable @@ -3666,6 +3760,7 @@ } }); } + /** * Insert multi-drag clones * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted @@ -3700,4 +3795,4 @@ return Sortable; -})); +}))); diff --git a/src/resources/views/fields/dropzone_media.blade.php b/src/resources/views/fields/dropzone_media.blade.php index e626599..da35f62 100644 --- a/src/resources/views/fields/dropzone_media.blade.php +++ b/src/resources/views/fields/dropzone_media.blade.php @@ -223,7 +223,7 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? var collection = $(el).prev().val(); var dOptions = { url: base_url, - previewTemplate: $("#dz-template-container").html(), + previewTemplate: document.getElementById("dz-template-container").innerHTML, init: function () { var files = f_{{$filesrand}}[collection]; if (files === undefined) { @@ -269,39 +269,38 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $.ajax({ url: base_url + '/' + file.media.id, type: 'DELETE' - }) - .done(function (response) { - var notification_type; + }).done(function (response) { + console.log(response); + var notification_type; - if (response.success == true) { - notification_type = 'success'; + if (response.success == true) { + notification_type = 'success'; - if (file.previewElement != null && file.previewElement.parentNode != null) { - file.previewElement.parentNode.removeChild(file.previewElement); - } - } else { - notification_type = 'error'; + if (file.previewElement != null && file.previewElement.parentNode != null) { + file.previewElement.parentNode.removeChild(file.previewElement); } + } else { + notification_type = 'error'; + } - new Noty({ - text: response.message, - type: notification_type, - icon: false - }); - }) - .fail(function (xhr) { - var message = 'Deletion failed'; + var n = new Noty({ + text: response.message, + type: notification_type, + icon: false + }).show(); + }).fail(function (xhr) { + var message = 'Deletion failed'; - if (xhr.responseJSON != 'undefined' && xhr.responseJSON.message != 'undefined') { - message = xhr.responseJSON.message; - } + if (xhr.responseJSON != 'undefined' && xhr.responseJSON.message != 'undefined') { + message = xhr.responseJSON.message; + } - new Noty({ - text: message, - type: 'error', - icon: false - }); - }); + new Noty({ + text: message, + type: 'error', + icon: false + }).show(); + }); $(this.element).trigger('change'); return this._updateMaxFilesReachedClass(); } @@ -314,11 +313,18 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? }, }; + var options = jQuery.extend(dOptions, $(el).data('options')); + console.log(options); + var dropzone = new Dropzone("#" + el_id, options); + - var dropzone = new Dropzone("#" + el_id, jQuery.extend(dOptions, $(el).data('option'))); dropzone.on("maxfilesexceeded", function (file) { this.removeFile(file); - alert('You can\'t add new files !') + new Noty({ + text: 'Unable to add a new file: field limit is reached.', + type: 'error', + icon: false + }).show(); }); @@ -350,10 +356,8 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? text: message, type: 'error', icon: false - }); + }).show(); } - - }) .fail(function (xhr) { var message = 'Order failed'; @@ -366,7 +370,7 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? text: message, type: 'error', icon: false - }); + }).show(); }); } } -- 2.39.5