UNPKG

908 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["AV"] = factory();
8 else
9 root["AV"] = factory();
10})(typeof self !== 'undefined' ? self : this, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, {
50/******/ configurable: false,
51/******/ enumerable: true,
52/******/ get: getter
53/******/ });
54/******/ }
55/******/ };
56/******/
57/******/ // getDefaultExport function for compatibility with non-harmony modules
58/******/ __webpack_require__.n = function(module) {
59/******/ var getter = module && module.__esModule ?
60/******/ function getDefault() { return module['default']; } :
61/******/ function getModuleExports() { return module; };
62/******/ __webpack_require__.d(getter, 'a', getter);
63/******/ return getter;
64/******/ };
65/******/
66/******/ // Object.prototype.hasOwnProperty.call
67/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
68/******/
69/******/ // __webpack_public_path__
70/******/ __webpack_require__.p = "";
71/******/
72/******/ // Load entry module and return exports
73/******/ return __webpack_require__(__webpack_require__.s = 245);
74/******/ })
75/************************************************************************/
76/******/ ([
77/* 0 */
78/***/ (function(module, exports, __webpack_require__) {
79
80"use strict";
81
82var global = __webpack_require__(9);
83var apply = __webpack_require__(71);
84var uncurryThis = __webpack_require__(4);
85var isCallable = __webpack_require__(8);
86var getOwnPropertyDescriptor = __webpack_require__(73).f;
87var isForced = __webpack_require__(148);
88var path = __webpack_require__(15);
89var bind = __webpack_require__(58);
90var createNonEnumerableProperty = __webpack_require__(39);
91var hasOwn = __webpack_require__(13);
92
93var wrapConstructor = function (NativeConstructor) {
94 var Wrapper = function (a, b, c) {
95 if (this instanceof Wrapper) {
96 switch (arguments.length) {
97 case 0: return new NativeConstructor();
98 case 1: return new NativeConstructor(a);
99 case 2: return new NativeConstructor(a, b);
100 } return new NativeConstructor(a, b, c);
101 } return apply(NativeConstructor, this, arguments);
102 };
103 Wrapper.prototype = NativeConstructor.prototype;
104 return Wrapper;
105};
106
107/*
108 options.target - name of the target object
109 options.global - target is the global object
110 options.stat - export as static methods of target
111 options.proto - export as prototype methods of target
112 options.real - real prototype method for the `pure` version
113 options.forced - export even if the native feature is available
114 options.bind - bind methods to the target, required for the `pure` version
115 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
116 options.unsafe - use the simple assignment of property instead of delete + defineProperty
117 options.sham - add a flag to not completely full polyfills
118 options.enumerable - export as enumerable property
119 options.dontCallGetSet - prevent calling a getter on target
120 options.name - the .name of the function if it does not match the key
121*/
122module.exports = function (options, source) {
123 var TARGET = options.target;
124 var GLOBAL = options.global;
125 var STATIC = options.stat;
126 var PROTO = options.proto;
127
128 var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;
129
130 var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];
131 var targetPrototype = target.prototype;
132
133 var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
134 var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
135
136 for (key in source) {
137 FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
138 // contains in native
139 USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);
140
141 targetProperty = target[key];
142
143 if (USE_NATIVE) if (options.dontCallGetSet) {
144 descriptor = getOwnPropertyDescriptor(nativeSource, key);
145 nativeProperty = descriptor && descriptor.value;
146 } else nativeProperty = nativeSource[key];
147
148 // export native or implementation
149 sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
150
151 if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
152
153 // bind timers to global for call from export context
154 if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
155 // wrap global constructors for prevent changs in this version
156 else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
157 // make static versions for prototype methods
158 else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);
159 // default case
160 else resultProperty = sourceProperty;
161
162 // add a flag to not completely full polyfills
163 if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {
164 createNonEnumerableProperty(resultProperty, 'sham', true);
165 }
166
167 createNonEnumerableProperty(target, key, resultProperty);
168
169 if (PROTO) {
170 VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
171 if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {
172 createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});
173 }
174 // export virtual prototype methods
175 createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);
176 // export real prototype methods
177 if (options.real && targetPrototype && !targetPrototype[key]) {
178 createNonEnumerableProperty(targetPrototype, key, sourceProperty);
179 }
180 }
181 }
182};
183
184
185/***/ }),
186/* 1 */
187/***/ (function(module, exports) {
188
189function _interopRequireDefault(obj) {
190 return obj && obj.__esModule ? obj : {
191 "default": obj
192 };
193}
194
195module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
196
197/***/ }),
198/* 2 */
199/***/ (function(module, __webpack_exports__, __webpack_require__) {
200
201"use strict";
202Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
203/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_default_js__ = __webpack_require__(288);
204/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__index_default_js__["a"]; });
205/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_js__ = __webpack_require__(124);
206/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["VERSION"]; });
207/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["restArguments"]; });
208/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isObject"]; });
209/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNull"]; });
210/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isUndefined"]; });
211/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isBoolean"]; });
212/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isElement"]; });
213/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isString"]; });
214/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNumber"]; });
215/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDate"]; });
216/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isRegExp"]; });
217/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isError"]; });
218/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSymbol"]; });
219/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArrayBuffer"]; });
220/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDataView"]; });
221/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArray"]; });
222/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFunction"]; });
223/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArguments"]; });
224/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFinite"]; });
225/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNaN"]; });
226/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isTypedArray"]; });
227/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEmpty"]; });
228/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMatch"]; });
229/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEqual"]; });
230/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMap"]; });
231/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakMap"]; });
232/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSet"]; });
233/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakSet"]; });
234/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["keys"]; });
235/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["allKeys"]; });
236/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["values"]; });
237/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pairs"]; });
238/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invert"]; });
239/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["functions"]; });
240/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["methods"]; });
241/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extend"]; });
242/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extendOwn"]; });
243/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["assign"]; });
244/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defaults"]; });
245/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["create"]; });
246/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["clone"]; });
247/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tap"]; });
248/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["get"]; });
249/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["has"]; });
250/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mapObject"]; });
251/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["identity"]; });
252/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["constant"]; });
253/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["noop"]; });
254/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toPath"]; });
255/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["property"]; });
256/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["propertyOf"]; });
257/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matcher"]; });
258/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matches"]; });
259/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["times"]; });
260/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["random"]; });
261/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["now"]; });
262/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["escape"]; });
263/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unescape"]; });
264/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["templateSettings"]; });
265/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["template"]; });
266/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["result"]; });
267/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniqueId"]; });
268/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chain"]; });
269/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["iteratee"]; });
270/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partial"]; });
271/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bind"]; });
272/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bindAll"]; });
273/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["memoize"]; });
274/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["delay"]; });
275/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defer"]; });
276/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["throttle"]; });
277/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["debounce"]; });
278/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["wrap"]; });
279/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["negate"]; });
280/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compose"]; });
281/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["after"]; });
282/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["before"]; });
283/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["once"]; });
284/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findKey"]; });
285/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findIndex"]; });
286/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findLastIndex"]; });
287/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortedIndex"]; });
288/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexOf"]; });
289/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["lastIndexOf"]; });
290/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["find"]; });
291/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["detect"]; });
292/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findWhere"]; });
293/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["each"]; });
294/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["forEach"]; });
295/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["map"]; });
296/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["collect"]; });
297/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduce"]; });
298/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldl"]; });
299/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["inject"]; });
300/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduceRight"]; });
301/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldr"]; });
302/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["filter"]; });
303/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["select"]; });
304/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reject"]; });
305/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["every"]; });
306/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["all"]; });
307/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["some"]; });
308/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["any"]; });
309/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["contains"]; });
310/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["includes"]; });
311/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["include"]; });
312/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invoke"]; });
313/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pluck"]; });
314/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["where"]; });
315/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["max"]; });
316/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["min"]; });
317/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["shuffle"]; });
318/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sample"]; });
319/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortBy"]; });
320/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["groupBy"]; });
321/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexBy"]; });
322/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["countBy"]; });
323/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partition"]; });
324/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toArray"]; });
325/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["size"]; });
326/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pick"]; });
327/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["omit"]; });
328/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["first"]; });
329/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["head"]; });
330/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["take"]; });
331/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["initial"]; });
332/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["last"]; });
333/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["rest"]; });
334/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tail"]; });
335/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["drop"]; });
336/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compact"]; });
337/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["flatten"]; });
338/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["without"]; });
339/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniq"]; });
340/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unique"]; });
341/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["union"]; });
342/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["intersection"]; });
343/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["difference"]; });
344/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unzip"]; });
345/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["transpose"]; });
346/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["zip"]; });
347/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["object"]; });
348/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["range"]; });
349/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chunk"]; });
350/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mixin"]; });
351// ESM Exports
352// ===========
353// This module is the package entry point for ES module users. In other words,
354// it is the module they are interfacing with when they import from the whole
355// package instead of from a submodule, like this:
356//
357// ```js
358// import { map } from 'underscore';
359// ```
360//
361// The difference with `./index-default`, which is the package entry point for
362// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and
363// default exports are considered to be siblings, so when you have a default
364// export, its properties are not automatically available as named exports. For
365// this reason, we re-export the named exports in addition to providing the same
366// default export as in `./index-default`.
367
368
369
370
371/***/ }),
372/* 3 */
373/***/ (function(module, exports) {
374
375module.exports = function (exec) {
376 try {
377 return !!exec();
378 } catch (error) {
379 return true;
380 }
381};
382
383
384/***/ }),
385/* 4 */
386/***/ (function(module, exports, __webpack_require__) {
387
388var NATIVE_BIND = __webpack_require__(72);
389
390var FunctionPrototype = Function.prototype;
391var bind = FunctionPrototype.bind;
392var call = FunctionPrototype.call;
393var uncurryThis = NATIVE_BIND && bind.bind(call, call);
394
395module.exports = NATIVE_BIND ? function (fn) {
396 return fn && uncurryThis(fn);
397} : function (fn) {
398 return fn && function () {
399 return call.apply(fn, arguments);
400 };
401};
402
403
404/***/ }),
405/* 5 */
406/***/ (function(module, exports, __webpack_require__) {
407
408var global = __webpack_require__(9);
409var shared = __webpack_require__(75);
410var hasOwn = __webpack_require__(13);
411var uid = __webpack_require__(112);
412var NATIVE_SYMBOL = __webpack_require__(55);
413var USE_SYMBOL_AS_UID = __webpack_require__(146);
414
415var WellKnownSymbolsStore = shared('wks');
416var Symbol = global.Symbol;
417var symbolFor = Symbol && Symbol['for'];
418var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
419
420module.exports = function (name) {
421 if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
422 var description = 'Symbol.' + name;
423 if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
424 WellKnownSymbolsStore[name] = Symbol[name];
425 } else if (USE_SYMBOL_AS_UID && symbolFor) {
426 WellKnownSymbolsStore[name] = symbolFor(description);
427 } else {
428 WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
429 }
430 } return WellKnownSymbolsStore[name];
431};
432
433
434/***/ }),
435/* 6 */
436/***/ (function(module, __webpack_exports__, __webpack_require__) {
437
438"use strict";
439/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; });
440/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return root; });
441/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; });
442/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; });
443/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; });
444/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return push; });
445/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return slice; });
446/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toString; });
447/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; });
448/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; });
449/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; });
450/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; });
451/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; });
452/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; });
453/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; });
454/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; });
455/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; });
456/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; });
457/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; });
458/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; });
459// Current version.
460var VERSION = '1.12.1';
461
462// Establish the root object, `window` (`self`) in the browser, `global`
463// on the server, or `this` in some virtual machines. We use `self`
464// instead of `window` for `WebWorker` support.
465var root = typeof self == 'object' && self.self === self && self ||
466 typeof global == 'object' && global.global === global && global ||
467 Function('return this')() ||
468 {};
469
470// Save bytes in the minified (but not gzipped) version:
471var ArrayProto = Array.prototype, ObjProto = Object.prototype;
472var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
473
474// Create quick reference variables for speed access to core prototypes.
475var push = ArrayProto.push,
476 slice = ArrayProto.slice,
477 toString = ObjProto.toString,
478 hasOwnProperty = ObjProto.hasOwnProperty;
479
480// Modern feature detection.
481var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
482 supportsDataView = typeof DataView !== 'undefined';
483
484// All **ECMAScript 5+** native function implementations that we hope to use
485// are declared here.
486var nativeIsArray = Array.isArray,
487 nativeKeys = Object.keys,
488 nativeCreate = Object.create,
489 nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
490
491// Create references to these builtin functions because we override them.
492var _isNaN = isNaN,
493 _isFinite = isFinite;
494
495// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
496var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
497var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
498 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
499
500// The largest integer that can be represented exactly.
501var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
502
503/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(108)))
504
505/***/ }),
506/* 7 */
507/***/ (function(module, exports, __webpack_require__) {
508
509var path = __webpack_require__(15);
510var hasOwn = __webpack_require__(13);
511var wrappedWellKnownSymbolModule = __webpack_require__(142);
512var defineProperty = __webpack_require__(34).f;
513
514module.exports = function (NAME) {
515 var Symbol = path.Symbol || (path.Symbol = {});
516 if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
517 value: wrappedWellKnownSymbolModule.f(NAME)
518 });
519};
520
521
522/***/ }),
523/* 8 */
524/***/ (function(module, exports) {
525
526// `IsCallable` abstract operation
527// https://tc39.es/ecma262/#sec-iscallable
528module.exports = function (argument) {
529 return typeof argument == 'function';
530};
531
532
533/***/ }),
534/* 9 */
535/***/ (function(module, exports, __webpack_require__) {
536
537/* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
538 return it && it.Math == Math && it;
539};
540
541// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
542module.exports =
543 // eslint-disable-next-line es-x/no-global-this -- safe
544 check(typeof globalThis == 'object' && globalThis) ||
545 check(typeof window == 'object' && window) ||
546 // eslint-disable-next-line no-restricted-globals -- safe
547 check(typeof self == 'object' && self) ||
548 check(typeof global == 'object' && global) ||
549 // eslint-disable-next-line no-new-func -- fallback
550 (function () { return this; })() || Function('return this')();
551
552/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(108)))
553
554/***/ }),
555/* 10 */
556/***/ (function(module, exports, __webpack_require__) {
557
558module.exports = __webpack_require__(248);
559
560/***/ }),
561/* 11 */
562/***/ (function(module, exports, __webpack_require__) {
563
564var NATIVE_BIND = __webpack_require__(72);
565
566var call = Function.prototype.call;
567
568module.exports = NATIVE_BIND ? call.bind(call) : function () {
569 return call.apply(call, arguments);
570};
571
572
573/***/ }),
574/* 12 */
575/***/ (function(module, exports, __webpack_require__) {
576
577var uncurryThis = __webpack_require__(4);
578
579module.exports = uncurryThis({}.isPrototypeOf);
580
581
582/***/ }),
583/* 13 */
584/***/ (function(module, exports, __webpack_require__) {
585
586var uncurryThis = __webpack_require__(4);
587var toObject = __webpack_require__(33);
588
589var hasOwnProperty = uncurryThis({}.hasOwnProperty);
590
591// `HasOwnProperty` abstract operation
592// https://tc39.es/ecma262/#sec-hasownproperty
593// eslint-disable-next-line es-x/no-object-hasown -- safe
594module.exports = Object.hasOwn || function hasOwn(it, key) {
595 return hasOwnProperty(toObject(it), key);
596};
597
598
599/***/ }),
600/* 14 */
601/***/ (function(module, __webpack_exports__, __webpack_require__) {
602
603"use strict";
604/* harmony export (immutable) */ __webpack_exports__["a"] = keys;
605/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(50);
606/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
607/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(41);
608/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(177);
609
610
611
612
613
614// Retrieve the names of an object's own properties.
615// Delegates to **ECMAScript 5**'s native `Object.keys`.
616function keys(obj) {
617 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
618 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */])(obj);
619 var keys = [];
620 for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, key)) keys.push(key);
621 // Ahem, IE < 9.
622 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" /* default */])(obj, keys);
623 return keys;
624}
625
626
627/***/ }),
628/* 15 */
629/***/ (function(module, exports) {
630
631module.exports = {};
632
633
634/***/ }),
635/* 16 */
636/***/ (function(module, __webpack_exports__, __webpack_require__) {
637
638"use strict";
639/* harmony export (immutable) */ __webpack_exports__["a"] = tagTester;
640/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
641
642
643// Internal function for creating a `toString`-based type tester.
644function tagTester(name) {
645 var tag = '[object ' + name + ']';
646 return function(obj) {
647 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === tag;
648 };
649}
650
651
652/***/ }),
653/* 17 */
654/***/ (function(module, exports, __webpack_require__) {
655
656var isCallable = __webpack_require__(8);
657
658module.exports = function (it) {
659 return typeof it == 'object' ? it !== null : isCallable(it);
660};
661
662
663/***/ }),
664/* 18 */
665/***/ (function(module, exports, __webpack_require__) {
666
667var path = __webpack_require__(15);
668var global = __webpack_require__(9);
669var isCallable = __webpack_require__(8);
670
671var aFunction = function (variable) {
672 return isCallable(variable) ? variable : undefined;
673};
674
675module.exports = function (namespace, method) {
676 return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
677 : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
678};
679
680
681/***/ }),
682/* 19 */
683/***/ (function(module, __webpack_exports__, __webpack_require__) {
684
685"use strict";
686/* harmony export (immutable) */ __webpack_exports__["a"] = cb;
687/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
688/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(187);
689/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(188);
690
691
692
693
694// The function we call internally to generate a callback. It invokes
695// `_.iteratee` if overridden, otherwise `baseIteratee`.
696function cb(value, context, argCount) {
697 if (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee !== __WEBPACK_IMPORTED_MODULE_2__iteratee_js__["a" /* default */]) return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee(value, context);
698 return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, argCount);
699}
700
701
702/***/ }),
703/* 20 */
704/***/ (function(module, exports, __webpack_require__) {
705
706var fails = __webpack_require__(3);
707
708// Detect IE8's incomplete defineProperty implementation
709module.exports = !fails(function () {
710 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
711 return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
712});
713
714
715/***/ }),
716/* 21 */
717/***/ (function(module, exports, __webpack_require__) {
718
719var isObject = __webpack_require__(17);
720
721var $String = String;
722var $TypeError = TypeError;
723
724// `Assert: Type(argument) is Object`
725module.exports = function (argument) {
726 if (isObject(argument)) return argument;
727 throw $TypeError($String(argument) + ' is not an object');
728};
729
730
731/***/ }),
732/* 22 */
733/***/ (function(module, __webpack_exports__, __webpack_require__) {
734
735"use strict";
736/* harmony export (immutable) */ __webpack_exports__["a"] = restArguments;
737// Some functions take a variable number of arguments, or a few expected
738// arguments at the beginning and then a variable number of values to operate
739// on. This helper accumulates all remaining arguments past the function’s
740// argument length (or an explicit `startIndex`), into an array that becomes
741// the last argument. Similar to ES6’s "rest parameter".
742function restArguments(func, startIndex) {
743 startIndex = startIndex == null ? func.length - 1 : +startIndex;
744 return function() {
745 var length = Math.max(arguments.length - startIndex, 0),
746 rest = Array(length),
747 index = 0;
748 for (; index < length; index++) {
749 rest[index] = arguments[index + startIndex];
750 }
751 switch (startIndex) {
752 case 0: return func.call(this, rest);
753 case 1: return func.call(this, arguments[0], rest);
754 case 2: return func.call(this, arguments[0], arguments[1], rest);
755 }
756 var args = Array(startIndex + 1);
757 for (index = 0; index < startIndex; index++) {
758 args[index] = arguments[index];
759 }
760 args[startIndex] = rest;
761 return func.apply(this, args);
762 };
763}
764
765
766/***/ }),
767/* 23 */
768/***/ (function(module, __webpack_exports__, __webpack_require__) {
769
770"use strict";
771/* harmony export (immutable) */ __webpack_exports__["a"] = _;
772/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
773
774
775// If Underscore is called as a function, it returns a wrapped object that can
776// be used OO-style. This wrapper holds altered versions of all functions added
777// through `_.mixin`. Wrapped objects may be chained.
778function _(obj) {
779 if (obj instanceof _) return obj;
780 if (!(this instanceof _)) return new _(obj);
781 this._wrapped = obj;
782}
783
784_.VERSION = __WEBPACK_IMPORTED_MODULE_0__setup_js__["e" /* VERSION */];
785
786// Extracts the result from a wrapped and chained object.
787_.prototype.value = function() {
788 return this._wrapped;
789};
790
791// Provide unwrapping proxies for some methods used in engine operations
792// such as arithmetic and JSON stringification.
793_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
794
795_.prototype.toString = function() {
796 return String(this._wrapped);
797};
798
799
800/***/ }),
801/* 24 */
802/***/ (function(module, __webpack_exports__, __webpack_require__) {
803
804"use strict";
805/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(175);
806/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(30);
807
808
809
810// Internal helper for collection methods to determine whether a collection
811// should be iterated as an array or as an object.
812// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
813// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
814/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]));
815
816
817/***/ }),
818/* 25 */
819/***/ (function(module, exports, __webpack_require__) {
820
821module.exports = __webpack_require__(360);
822
823/***/ }),
824/* 26 */
825/***/ (function(module, exports, __webpack_require__) {
826
827var path = __webpack_require__(15);
828
829module.exports = function (CONSTRUCTOR) {
830 return path[CONSTRUCTOR + 'Prototype'];
831};
832
833
834/***/ }),
835/* 27 */
836/***/ (function(module, exports, __webpack_require__) {
837
838"use strict";
839
840
841var _interopRequireDefault = __webpack_require__(1);
842
843var _concat = _interopRequireDefault(__webpack_require__(25));
844
845var _promise = _interopRequireDefault(__webpack_require__(10));
846
847var _ = __webpack_require__(2);
848
849var md5 = __webpack_require__(500);
850
851var _require = __webpack_require__(2),
852 extend = _require.extend;
853
854var AV = __webpack_require__(67);
855
856var AVError = __webpack_require__(43);
857
858var _require2 = __webpack_require__(31),
859 getSessionToken = _require2.getSessionToken;
860
861var ajax = __webpack_require__(106); // 计算 X-LC-Sign 的签名方法
862
863
864var sign = function sign(key, isMasterKey) {
865 var _context2;
866
867 var now = new Date().getTime();
868 var signature = md5(now + key);
869
870 if (isMasterKey) {
871 var _context;
872
873 return (0, _concat.default)(_context = "".concat(signature, ",")).call(_context, now, ",master");
874 }
875
876 return (0, _concat.default)(_context2 = "".concat(signature, ",")).call(_context2, now);
877};
878
879var setAppKey = function setAppKey(headers, signKey) {
880 if (signKey) {
881 headers['X-LC-Sign'] = sign(AV.applicationKey);
882 } else {
883 headers['X-LC-Key'] = AV.applicationKey;
884 }
885};
886
887var setHeaders = function setHeaders() {
888 var authOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
889 var signKey = arguments.length > 1 ? arguments[1] : undefined;
890 var headers = {
891 'X-LC-Id': AV.applicationId,
892 'Content-Type': 'application/json;charset=UTF-8'
893 };
894 var useMasterKey = false;
895
896 if (typeof authOptions.useMasterKey === 'boolean') {
897 useMasterKey = authOptions.useMasterKey;
898 } else if (typeof AV._config.useMasterKey === 'boolean') {
899 useMasterKey = AV._config.useMasterKey;
900 }
901
902 if (useMasterKey) {
903 if (AV.masterKey) {
904 if (signKey) {
905 headers['X-LC-Sign'] = sign(AV.masterKey, true);
906 } else {
907 headers['X-LC-Key'] = "".concat(AV.masterKey, ",master");
908 }
909 } else {
910 console.warn('masterKey is not set, fall back to use appKey');
911 setAppKey(headers, signKey);
912 }
913 } else {
914 setAppKey(headers, signKey);
915 }
916
917 if (AV.hookKey) {
918 headers['X-LC-Hook-Key'] = AV.hookKey;
919 }
920
921 if (AV._config.production !== null) {
922 headers['X-LC-Prod'] = String(AV._config.production);
923 }
924
925 headers[ false ? 'User-Agent' : 'X-LC-UA'] = AV._sharedConfig.userAgent;
926 return _promise.default.resolve().then(function () {
927 // Pass the session token
928 var sessionToken = getSessionToken(authOptions);
929
930 if (sessionToken) {
931 headers['X-LC-Session'] = sessionToken;
932 } else if (!AV._config.disableCurrentUser) {
933 return AV.User.currentAsync().then(function (currentUser) {
934 if (currentUser && currentUser._sessionToken) {
935 headers['X-LC-Session'] = currentUser._sessionToken;
936 }
937
938 return headers;
939 });
940 }
941
942 return headers;
943 });
944};
945
946var createApiUrl = function createApiUrl(_ref) {
947 var _ref$service = _ref.service,
948 service = _ref$service === void 0 ? 'api' : _ref$service,
949 _ref$version = _ref.version,
950 version = _ref$version === void 0 ? '1.1' : _ref$version,
951 path = _ref.path;
952 var apiURL = AV._config.serverURLs[service];
953 if (!apiURL) throw new Error("undefined server URL for ".concat(service));
954
955 if (apiURL.charAt(apiURL.length - 1) !== '/') {
956 apiURL += '/';
957 }
958
959 apiURL += version;
960
961 if (path) {
962 apiURL += path;
963 }
964
965 return apiURL;
966};
967/**
968 * Low level REST API client. Call REST endpoints with authorization headers.
969 * @function AV.request
970 * @since 3.0.0
971 * @param {Object} options
972 * @param {String} options.method HTTP method
973 * @param {String} options.path endpoint path, e.g. `/classes/Test/55759577e4b029ae6015ac20`
974 * @param {Object} [options.query] query string dict
975 * @param {Object} [options.data] HTTP body
976 * @param {AuthOptions} [options.authOptions]
977 * @param {String} [options.service = 'api']
978 * @param {String} [options.version = '1.1']
979 */
980
981
982var request = function request(_ref2) {
983 var service = _ref2.service,
984 version = _ref2.version,
985 method = _ref2.method,
986 path = _ref2.path,
987 query = _ref2.query,
988 data = _ref2.data,
989 authOptions = _ref2.authOptions,
990 _ref2$signKey = _ref2.signKey,
991 signKey = _ref2$signKey === void 0 ? true : _ref2$signKey;
992
993 if (!(AV.applicationId && (AV.applicationKey || AV.masterKey))) {
994 throw new Error('Not initialized');
995 }
996
997 if (AV._appRouter) {
998 AV._appRouter.refresh();
999 }
1000
1001 var timeout = AV._config.requestTimeout;
1002 var url = createApiUrl({
1003 service: service,
1004 path: path,
1005 version: version
1006 });
1007 return setHeaders(authOptions, signKey).then(function (headers) {
1008 return ajax({
1009 method: method,
1010 url: url,
1011 query: query,
1012 data: data,
1013 headers: headers,
1014 timeout: timeout
1015 }).catch(function (error) {
1016 var errorJSON = {
1017 code: error.code || -1,
1018 error: error.message || error.responseText
1019 };
1020
1021 if (error.response && error.response.code) {
1022 errorJSON = error.response;
1023 } else if (error.responseText) {
1024 try {
1025 errorJSON = JSON.parse(error.responseText);
1026 } catch (e) {// If we fail to parse the error text, that's okay.
1027 }
1028 }
1029
1030 errorJSON.rawMessage = errorJSON.rawMessage || errorJSON.error;
1031
1032 if (!AV._sharedConfig.keepErrorRawMessage) {
1033 var _context3, _context4;
1034
1035 errorJSON.error += (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = " [".concat(error.statusCode || 'N/A', " ")).call(_context4, method, " ")).call(_context3, url, "]");
1036 } // Transform the error into an instance of AVError by trying to parse
1037 // the error string as JSON.
1038
1039
1040 var err = new AVError(errorJSON.code, errorJSON.error);
1041 delete errorJSON.error;
1042 throw _.extend(err, errorJSON);
1043 });
1044 });
1045}; // lagecy request
1046
1047
1048var _request = function _request(route, className, objectId, method, data, authOptions, query) {
1049 var path = '';
1050 if (route) path += "/".concat(route);
1051 if (className) path += "/".concat(className);
1052 if (objectId) path += "/".concat(objectId); // for migeration
1053
1054 if (data && data._fetchWhenSave) throw new Error('_fetchWhenSave should be in the query');
1055 if (data && data._where) throw new Error('_where should be in the query');
1056
1057 if (method && method.toLowerCase() === 'get') {
1058 query = extend({}, query, data);
1059 data = null;
1060 }
1061
1062 return request({
1063 method: method,
1064 path: path,
1065 query: query,
1066 data: data,
1067 authOptions: authOptions
1068 });
1069};
1070
1071AV.request = request;
1072module.exports = {
1073 _request: _request,
1074 request: request
1075};
1076
1077/***/ }),
1078/* 28 */
1079/***/ (function(module, exports, __webpack_require__) {
1080
1081var isCallable = __webpack_require__(8);
1082var tryToString = __webpack_require__(57);
1083
1084var $TypeError = TypeError;
1085
1086// `Assert: IsCallable(argument) is true`
1087module.exports = function (argument) {
1088 if (isCallable(argument)) return argument;
1089 throw $TypeError(tryToString(argument) + ' is not a function');
1090};
1091
1092
1093/***/ }),
1094/* 29 */
1095/***/ (function(module, __webpack_exports__, __webpack_require__) {
1096
1097"use strict";
1098/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
1099/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
1100
1101
1102
1103var isFunction = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Function');
1104
1105// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
1106// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
1107var nodelist = __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document && __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document.childNodes;
1108if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
1109 isFunction = function(obj) {
1110 return typeof obj == 'function' || false;
1111 };
1112}
1113
1114/* harmony default export */ __webpack_exports__["a"] = (isFunction);
1115
1116
1117/***/ }),
1118/* 30 */
1119/***/ (function(module, __webpack_exports__, __webpack_require__) {
1120
1121"use strict";
1122/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(176);
1123
1124
1125// Internal helper to obtain the `length` property of an object.
1126/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('length'));
1127
1128
1129/***/ }),
1130/* 31 */
1131/***/ (function(module, exports, __webpack_require__) {
1132
1133"use strict";
1134
1135
1136var _interopRequireDefault = __webpack_require__(1);
1137
1138var _keys = _interopRequireDefault(__webpack_require__(53));
1139
1140var _getPrototypeOf = _interopRequireDefault(__webpack_require__(220));
1141
1142var _promise = _interopRequireDefault(__webpack_require__(10));
1143
1144var _ = __webpack_require__(2); // Helper function to check null or undefined.
1145
1146
1147var isNullOrUndefined = function isNullOrUndefined(x) {
1148 return _.isNull(x) || _.isUndefined(x);
1149};
1150
1151var ensureArray = function ensureArray(target) {
1152 if (_.isArray(target)) {
1153 return target;
1154 }
1155
1156 if (target === undefined || target === null) {
1157 return [];
1158 }
1159
1160 return [target];
1161};
1162
1163var transformFetchOptions = function transformFetchOptions() {
1164 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1165 keys = (0, _keys.default)(_ref),
1166 include = _ref.include,
1167 includeACL = _ref.includeACL;
1168
1169 var fetchOptions = {};
1170
1171 if (keys) {
1172 fetchOptions.keys = ensureArray(keys).join(',');
1173 }
1174
1175 if (include) {
1176 fetchOptions.include = ensureArray(include).join(',');
1177 }
1178
1179 if (includeACL) {
1180 fetchOptions.returnACL = includeACL;
1181 }
1182
1183 return fetchOptions;
1184};
1185
1186var getSessionToken = function getSessionToken(authOptions) {
1187 if (authOptions.sessionToken) {
1188 return authOptions.sessionToken;
1189 }
1190
1191 if (authOptions.user && typeof authOptions.user.getSessionToken === 'function') {
1192 return authOptions.user.getSessionToken();
1193 }
1194};
1195
1196var tap = function tap(interceptor) {
1197 return function (value) {
1198 return interceptor(value), value;
1199 };
1200}; // Shared empty constructor function to aid in prototype-chain creation.
1201
1202
1203var EmptyConstructor = function EmptyConstructor() {}; // Helper function to correctly set up the prototype chain, for subclasses.
1204// Similar to `goog.inherits`, but uses a hash of prototype properties and
1205// class properties to be extended.
1206
1207
1208var inherits = function inherits(parent, protoProps, staticProps) {
1209 var child; // The constructor function for the new subclass is either defined by you
1210 // (the "constructor" property in your `extend` definition), or defaulted
1211 // by us to simply call the parent's constructor.
1212
1213 if (protoProps && protoProps.hasOwnProperty('constructor')) {
1214 child = protoProps.constructor;
1215 } else {
1216 /** @ignore */
1217 child = function child() {
1218 parent.apply(this, arguments);
1219 };
1220 } // Inherit class (static) properties from parent.
1221
1222
1223 _.extend(child, parent); // Set the prototype chain to inherit from `parent`, without calling
1224 // `parent`'s constructor function.
1225
1226
1227 EmptyConstructor.prototype = parent.prototype;
1228 child.prototype = new EmptyConstructor(); // Add prototype properties (instance properties) to the subclass,
1229 // if supplied.
1230
1231 if (protoProps) {
1232 _.extend(child.prototype, protoProps);
1233 } // Add static properties to the constructor function, if supplied.
1234
1235
1236 if (staticProps) {
1237 _.extend(child, staticProps);
1238 } // Correctly set child's `prototype.constructor`.
1239
1240
1241 child.prototype.constructor = child; // Set a convenience property in case the parent's prototype is
1242 // needed later.
1243
1244 child.__super__ = parent.prototype;
1245 return child;
1246};
1247
1248var parseDate = function parseDate(iso8601) {
1249 return new Date(iso8601);
1250};
1251
1252var setValue = function setValue(target, key, value) {
1253 // '.' is not allowed in Class keys, escaping is not in concern now.
1254 var segs = key.split('.');
1255 var lastSeg = segs.pop();
1256 var currentTarget = target;
1257 segs.forEach(function (seg) {
1258 if (currentTarget[seg] === undefined) currentTarget[seg] = {};
1259 currentTarget = currentTarget[seg];
1260 });
1261 currentTarget[lastSeg] = value;
1262 return target;
1263};
1264
1265var findValue = function findValue(target, key) {
1266 var segs = key.split('.');
1267 var firstSeg = segs[0];
1268 var lastSeg = segs.pop();
1269 var currentTarget = target;
1270
1271 for (var i = 0; i < segs.length; i++) {
1272 currentTarget = currentTarget[segs[i]];
1273
1274 if (currentTarget === undefined) {
1275 return [undefined, undefined, lastSeg];
1276 }
1277 }
1278
1279 var value = currentTarget[lastSeg];
1280 return [value, currentTarget, lastSeg, firstSeg];
1281};
1282
1283var isPlainObject = function isPlainObject(obj) {
1284 return _.isObject(obj) && (0, _getPrototypeOf.default)(obj) === Object.prototype;
1285};
1286
1287var continueWhile = function continueWhile(predicate, asyncFunction) {
1288 if (predicate()) {
1289 return asyncFunction().then(function () {
1290 return continueWhile(predicate, asyncFunction);
1291 });
1292 }
1293
1294 return _promise.default.resolve();
1295};
1296
1297module.exports = {
1298 isNullOrUndefined: isNullOrUndefined,
1299 ensureArray: ensureArray,
1300 transformFetchOptions: transformFetchOptions,
1301 getSessionToken: getSessionToken,
1302 tap: tap,
1303 inherits: inherits,
1304 parseDate: parseDate,
1305 setValue: setValue,
1306 findValue: findValue,
1307 isPlainObject: isPlainObject,
1308 continueWhile: continueWhile
1309};
1310
1311/***/ }),
1312/* 32 */
1313/***/ (function(module, exports) {
1314
1315module.exports = true;
1316
1317
1318/***/ }),
1319/* 33 */
1320/***/ (function(module, exports, __webpack_require__) {
1321
1322var requireObjectCoercible = __webpack_require__(74);
1323
1324var $Object = Object;
1325
1326// `ToObject` abstract operation
1327// https://tc39.es/ecma262/#sec-toobject
1328module.exports = function (argument) {
1329 return $Object(requireObjectCoercible(argument));
1330};
1331
1332
1333/***/ }),
1334/* 34 */
1335/***/ (function(module, exports, __webpack_require__) {
1336
1337var DESCRIPTORS = __webpack_require__(20);
1338var IE8_DOM_DEFINE = __webpack_require__(147);
1339var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(149);
1340var anObject = __webpack_require__(21);
1341var toPropertyKey = __webpack_require__(88);
1342
1343var $TypeError = TypeError;
1344// eslint-disable-next-line es-x/no-object-defineproperty -- safe
1345var $defineProperty = Object.defineProperty;
1346// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
1347var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1348var ENUMERABLE = 'enumerable';
1349var CONFIGURABLE = 'configurable';
1350var WRITABLE = 'writable';
1351
1352// `Object.defineProperty` method
1353// https://tc39.es/ecma262/#sec-object.defineproperty
1354exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
1355 anObject(O);
1356 P = toPropertyKey(P);
1357 anObject(Attributes);
1358 if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
1359 var current = $getOwnPropertyDescriptor(O, P);
1360 if (current && current[WRITABLE]) {
1361 O[P] = Attributes.value;
1362 Attributes = {
1363 configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
1364 enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
1365 writable: false
1366 };
1367 }
1368 } return $defineProperty(O, P, Attributes);
1369} : $defineProperty : function defineProperty(O, P, Attributes) {
1370 anObject(O);
1371 P = toPropertyKey(P);
1372 anObject(Attributes);
1373 if (IE8_DOM_DEFINE) try {
1374 return $defineProperty(O, P, Attributes);
1375 } catch (error) { /* empty */ }
1376 if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
1377 if ('value' in Attributes) O[P] = Attributes.value;
1378 return O;
1379};
1380
1381
1382/***/ }),
1383/* 35 */
1384/***/ (function(module, exports, __webpack_require__) {
1385
1386// toObject with fallback for non-array-like ES3 strings
1387var IndexedObject = __webpack_require__(109);
1388var requireObjectCoercible = __webpack_require__(74);
1389
1390module.exports = function (it) {
1391 return IndexedObject(requireObjectCoercible(it));
1392};
1393
1394
1395/***/ }),
1396/* 36 */
1397/***/ (function(module, exports, __webpack_require__) {
1398
1399var toLength = __webpack_require__(259);
1400
1401// `LengthOfArrayLike` abstract operation
1402// https://tc39.es/ecma262/#sec-lengthofarraylike
1403module.exports = function (obj) {
1404 return toLength(obj.length);
1405};
1406
1407
1408/***/ }),
1409/* 37 */
1410/***/ (function(module, exports, __webpack_require__) {
1411
1412module.exports = __webpack_require__(372);
1413
1414/***/ }),
1415/* 38 */
1416/***/ (function(module, exports, __webpack_require__) {
1417
1418module.exports = __webpack_require__(227);
1419
1420/***/ }),
1421/* 39 */
1422/***/ (function(module, exports, __webpack_require__) {
1423
1424var DESCRIPTORS = __webpack_require__(20);
1425var definePropertyModule = __webpack_require__(34);
1426var createPropertyDescriptor = __webpack_require__(44);
1427
1428module.exports = DESCRIPTORS ? function (object, key, value) {
1429 return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
1430} : function (object, key, value) {
1431 object[key] = value;
1432 return object;
1433};
1434
1435
1436/***/ }),
1437/* 40 */
1438/***/ (function(module, exports, __webpack_require__) {
1439
1440var classof = __webpack_require__(47);
1441
1442var $String = String;
1443
1444module.exports = function (argument) {
1445 if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1446 return $String(argument);
1447};
1448
1449
1450/***/ }),
1451/* 41 */
1452/***/ (function(module, __webpack_exports__, __webpack_require__) {
1453
1454"use strict";
1455/* harmony export (immutable) */ __webpack_exports__["a"] = has;
1456/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
1457
1458
1459// Internal function to check whether `key` is an own property name of `obj`.
1460function has(obj, key) {
1461 return obj != null && __WEBPACK_IMPORTED_MODULE_0__setup_js__["i" /* hasOwnProperty */].call(obj, key);
1462}
1463
1464
1465/***/ }),
1466/* 42 */
1467/***/ (function(module, exports, __webpack_require__) {
1468
1469module.exports = __webpack_require__(365);
1470
1471/***/ }),
1472/* 43 */
1473/***/ (function(module, exports, __webpack_require__) {
1474
1475"use strict";
1476
1477
1478var _interopRequireDefault = __webpack_require__(1);
1479
1480var _setPrototypeOf = _interopRequireDefault(__webpack_require__(387));
1481
1482var _getPrototypeOf = _interopRequireDefault(__webpack_require__(220));
1483
1484var _ = __webpack_require__(2);
1485/**
1486 * @class AV.Error
1487 */
1488
1489
1490function AVError(code, message) {
1491 if (this instanceof AVError ? this.constructor : void 0) {
1492 var error = new Error(message);
1493 (0, _setPrototypeOf.default)(error, (0, _getPrototypeOf.default)(this));
1494 error.code = code;
1495 return error;
1496 }
1497
1498 return new AVError(code, message);
1499}
1500
1501AVError.prototype = Object.create(Error.prototype, {
1502 constructor: {
1503 value: Error,
1504 enumerable: false,
1505 writable: true,
1506 configurable: true
1507 }
1508});
1509(0, _setPrototypeOf.default)(AVError, Error);
1510
1511_.extend(AVError,
1512/** @lends AV.Error */
1513{
1514 /**
1515 * Error code indicating some error other than those enumerated here.
1516 * @constant
1517 */
1518 OTHER_CAUSE: -1,
1519
1520 /**
1521 * Error code indicating that something has gone wrong with the server.
1522 * If you get this error code, it is AV's fault.
1523 * @constant
1524 */
1525 INTERNAL_SERVER_ERROR: 1,
1526
1527 /**
1528 * Error code indicating the connection to the AV servers failed.
1529 * @constant
1530 */
1531 CONNECTION_FAILED: 100,
1532
1533 /**
1534 * Error code indicating the specified object doesn't exist.
1535 * @constant
1536 */
1537 OBJECT_NOT_FOUND: 101,
1538
1539 /**
1540 * Error code indicating you tried to query with a datatype that doesn't
1541 * support it, like exact matching an array or object.
1542 * @constant
1543 */
1544 INVALID_QUERY: 102,
1545
1546 /**
1547 * Error code indicating a missing or invalid classname. Classnames are
1548 * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
1549 * only valid characters.
1550 * @constant
1551 */
1552 INVALID_CLASS_NAME: 103,
1553
1554 /**
1555 * Error code indicating an unspecified object id.
1556 * @constant
1557 */
1558 MISSING_OBJECT_ID: 104,
1559
1560 /**
1561 * Error code indicating an invalid key name. Keys are case-sensitive. They
1562 * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
1563 * @constant
1564 */
1565 INVALID_KEY_NAME: 105,
1566
1567 /**
1568 * Error code indicating a malformed pointer. You should not see this unless
1569 * you have been mucking about changing internal AV code.
1570 * @constant
1571 */
1572 INVALID_POINTER: 106,
1573
1574 /**
1575 * Error code indicating that badly formed JSON was received upstream. This
1576 * either indicates you have done something unusual with modifying how
1577 * things encode to JSON, or the network is failing badly.
1578 * @constant
1579 */
1580 INVALID_JSON: 107,
1581
1582 /**
1583 * Error code indicating that the feature you tried to access is only
1584 * available internally for testing purposes.
1585 * @constant
1586 */
1587 COMMAND_UNAVAILABLE: 108,
1588
1589 /**
1590 * You must call AV.initialize before using the AV library.
1591 * @constant
1592 */
1593 NOT_INITIALIZED: 109,
1594
1595 /**
1596 * Error code indicating that a field was set to an inconsistent type.
1597 * @constant
1598 */
1599 INCORRECT_TYPE: 111,
1600
1601 /**
1602 * Error code indicating an invalid channel name. A channel name is either
1603 * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
1604 * characters.
1605 * @constant
1606 */
1607 INVALID_CHANNEL_NAME: 112,
1608
1609 /**
1610 * Error code indicating that push is misconfigured.
1611 * @constant
1612 */
1613 PUSH_MISCONFIGURED: 115,
1614
1615 /**
1616 * Error code indicating that the object is too large.
1617 * @constant
1618 */
1619 OBJECT_TOO_LARGE: 116,
1620
1621 /**
1622 * Error code indicating that the operation isn't allowed for clients.
1623 * @constant
1624 */
1625 OPERATION_FORBIDDEN: 119,
1626
1627 /**
1628 * Error code indicating the result was not found in the cache.
1629 * @constant
1630 */
1631 CACHE_MISS: 120,
1632
1633 /**
1634 * Error code indicating that an invalid key was used in a nested
1635 * JSONObject.
1636 * @constant
1637 */
1638 INVALID_NESTED_KEY: 121,
1639
1640 /**
1641 * Error code indicating that an invalid filename was used for AVFile.
1642 * A valid file name contains only a-zA-Z0-9_. characters and is between 1
1643 * and 128 characters.
1644 * @constant
1645 */
1646 INVALID_FILE_NAME: 122,
1647
1648 /**
1649 * Error code indicating an invalid ACL was provided.
1650 * @constant
1651 */
1652 INVALID_ACL: 123,
1653
1654 /**
1655 * Error code indicating that the request timed out on the server. Typically
1656 * this indicates that the request is too expensive to run.
1657 * @constant
1658 */
1659 TIMEOUT: 124,
1660
1661 /**
1662 * Error code indicating that the email address was invalid.
1663 * @constant
1664 */
1665 INVALID_EMAIL_ADDRESS: 125,
1666
1667 /**
1668 * Error code indicating a missing content type.
1669 * @constant
1670 */
1671 MISSING_CONTENT_TYPE: 126,
1672
1673 /**
1674 * Error code indicating a missing content length.
1675 * @constant
1676 */
1677 MISSING_CONTENT_LENGTH: 127,
1678
1679 /**
1680 * Error code indicating an invalid content length.
1681 * @constant
1682 */
1683 INVALID_CONTENT_LENGTH: 128,
1684
1685 /**
1686 * Error code indicating a file that was too large.
1687 * @constant
1688 */
1689 FILE_TOO_LARGE: 129,
1690
1691 /**
1692 * Error code indicating an error saving a file.
1693 * @constant
1694 */
1695 FILE_SAVE_ERROR: 130,
1696
1697 /**
1698 * Error code indicating an error deleting a file.
1699 * @constant
1700 */
1701 FILE_DELETE_ERROR: 153,
1702
1703 /**
1704 * Error code indicating that a unique field was given a value that is
1705 * already taken.
1706 * @constant
1707 */
1708 DUPLICATE_VALUE: 137,
1709
1710 /**
1711 * Error code indicating that a role's name is invalid.
1712 * @constant
1713 */
1714 INVALID_ROLE_NAME: 139,
1715
1716 /**
1717 * Error code indicating that an application quota was exceeded. Upgrade to
1718 * resolve.
1719 * @constant
1720 */
1721 EXCEEDED_QUOTA: 140,
1722
1723 /**
1724 * Error code indicating that a Cloud Code script failed.
1725 * @constant
1726 */
1727 SCRIPT_FAILED: 141,
1728
1729 /**
1730 * Error code indicating that a Cloud Code validation failed.
1731 * @constant
1732 */
1733 VALIDATION_ERROR: 142,
1734
1735 /**
1736 * Error code indicating that invalid image data was provided.
1737 * @constant
1738 */
1739 INVALID_IMAGE_DATA: 150,
1740
1741 /**
1742 * Error code indicating an unsaved file.
1743 * @constant
1744 */
1745 UNSAVED_FILE_ERROR: 151,
1746
1747 /**
1748 * Error code indicating an invalid push time.
1749 * @constant
1750 */
1751 INVALID_PUSH_TIME_ERROR: 152,
1752
1753 /**
1754 * Error code indicating that the username is missing or empty.
1755 * @constant
1756 */
1757 USERNAME_MISSING: 200,
1758
1759 /**
1760 * Error code indicating that the password is missing or empty.
1761 * @constant
1762 */
1763 PASSWORD_MISSING: 201,
1764
1765 /**
1766 * Error code indicating that the username has already been taken.
1767 * @constant
1768 */
1769 USERNAME_TAKEN: 202,
1770
1771 /**
1772 * Error code indicating that the email has already been taken.
1773 * @constant
1774 */
1775 EMAIL_TAKEN: 203,
1776
1777 /**
1778 * Error code indicating that the email is missing, but must be specified.
1779 * @constant
1780 */
1781 EMAIL_MISSING: 204,
1782
1783 /**
1784 * Error code indicating that a user with the specified email was not found.
1785 * @constant
1786 */
1787 EMAIL_NOT_FOUND: 205,
1788
1789 /**
1790 * Error code indicating that a user object without a valid session could
1791 * not be altered.
1792 * @constant
1793 */
1794 SESSION_MISSING: 206,
1795
1796 /**
1797 * Error code indicating that a user can only be created through signup.
1798 * @constant
1799 */
1800 MUST_CREATE_USER_THROUGH_SIGNUP: 207,
1801
1802 /**
1803 * Error code indicating that an an account being linked is already linked
1804 * to another user.
1805 * @constant
1806 */
1807 ACCOUNT_ALREADY_LINKED: 208,
1808
1809 /**
1810 * Error code indicating that a user cannot be linked to an account because
1811 * that account's id could not be found.
1812 * @constant
1813 */
1814 LINKED_ID_MISSING: 250,
1815
1816 /**
1817 * Error code indicating that a user with a linked (e.g. Facebook) account
1818 * has an invalid session.
1819 * @constant
1820 */
1821 INVALID_LINKED_SESSION: 251,
1822
1823 /**
1824 * Error code indicating that a service being linked (e.g. Facebook or
1825 * Twitter) is unsupported.
1826 * @constant
1827 */
1828 UNSUPPORTED_SERVICE: 252,
1829
1830 /**
1831 * Error code indicating a real error code is unavailable because
1832 * we had to use an XDomainRequest object to allow CORS requests in
1833 * Internet Explorer, which strips the body from HTTP responses that have
1834 * a non-2XX status code.
1835 * @constant
1836 */
1837 X_DOMAIN_REQUEST: 602
1838});
1839
1840module.exports = AVError;
1841
1842/***/ }),
1843/* 44 */
1844/***/ (function(module, exports) {
1845
1846module.exports = function (bitmap, value) {
1847 return {
1848 enumerable: !(bitmap & 1),
1849 configurable: !(bitmap & 2),
1850 writable: !(bitmap & 4),
1851 value: value
1852 };
1853};
1854
1855
1856/***/ }),
1857/* 45 */
1858/***/ (function(module, exports, __webpack_require__) {
1859
1860var getBuiltIn = __webpack_require__(18);
1861
1862module.exports = getBuiltIn('navigator', 'userAgent') || '';
1863
1864
1865/***/ }),
1866/* 46 */
1867/***/ (function(module, exports) {
1868
1869module.exports = {};
1870
1871
1872/***/ }),
1873/* 47 */
1874/***/ (function(module, exports, __webpack_require__) {
1875
1876var TO_STRING_TAG_SUPPORT = __webpack_require__(121);
1877var isCallable = __webpack_require__(8);
1878var classofRaw = __webpack_require__(54);
1879var wellKnownSymbol = __webpack_require__(5);
1880
1881var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1882var $Object = Object;
1883
1884// ES3 wrong here
1885var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1886
1887// fallback for IE11 Script Access Denied error
1888var tryGet = function (it, key) {
1889 try {
1890 return it[key];
1891 } catch (error) { /* empty */ }
1892};
1893
1894// getting tag from ES6+ `Object.prototype.toString`
1895module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1896 var O, tag, result;
1897 return it === undefined ? 'Undefined' : it === null ? 'Null'
1898 // @@toStringTag case
1899 : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1900 // builtinTag case
1901 : CORRECT_ARGUMENTS ? classofRaw(O)
1902 // ES3 arguments fallback
1903 : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1904};
1905
1906
1907/***/ }),
1908/* 48 */
1909/***/ (function(module, exports, __webpack_require__) {
1910
1911var createNonEnumerableProperty = __webpack_require__(39);
1912
1913module.exports = function (target, key, value, options) {
1914 if (options && options.enumerable) target[key] = value;
1915 else createNonEnumerableProperty(target, key, value);
1916 return target;
1917};
1918
1919
1920/***/ }),
1921/* 49 */
1922/***/ (function(module, exports, __webpack_require__) {
1923
1924"use strict";
1925
1926var aCallable = __webpack_require__(28);
1927
1928var PromiseCapability = function (C) {
1929 var resolve, reject;
1930 this.promise = new C(function ($$resolve, $$reject) {
1931 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
1932 resolve = $$resolve;
1933 reject = $$reject;
1934 });
1935 this.resolve = aCallable(resolve);
1936 this.reject = aCallable(reject);
1937};
1938
1939// `NewPromiseCapability` abstract operation
1940// https://tc39.es/ecma262/#sec-newpromisecapability
1941module.exports.f = function (C) {
1942 return new PromiseCapability(C);
1943};
1944
1945
1946/***/ }),
1947/* 50 */
1948/***/ (function(module, __webpack_exports__, __webpack_require__) {
1949
1950"use strict";
1951/* harmony export (immutable) */ __webpack_exports__["a"] = isObject;
1952// Is a given variable an object?
1953function isObject(obj) {
1954 var type = typeof obj;
1955 return type === 'function' || type === 'object' && !!obj;
1956}
1957
1958
1959/***/ }),
1960/* 51 */
1961/***/ (function(module, __webpack_exports__, __webpack_require__) {
1962
1963"use strict";
1964/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
1965/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(16);
1966
1967
1968
1969// Is a given value an array?
1970// Delegates to ECMA5's native `Array.isArray`.
1971/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["k" /* nativeIsArray */] || Object(__WEBPACK_IMPORTED_MODULE_1__tagTester_js__["a" /* default */])('Array'));
1972
1973
1974/***/ }),
1975/* 52 */
1976/***/ (function(module, __webpack_exports__, __webpack_require__) {
1977
1978"use strict";
1979/* harmony export (immutable) */ __webpack_exports__["a"] = each;
1980/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(83);
1981/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
1982/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(14);
1983
1984
1985
1986
1987// The cornerstone for collection functions, an `each`
1988// implementation, aka `forEach`.
1989// Handles raw objects in addition to array-likes. Treats all
1990// sparse array-likes as if they were dense.
1991function each(obj, iteratee, context) {
1992 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context);
1993 var i, length;
1994 if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj)) {
1995 for (i = 0, length = obj.length; i < length; i++) {
1996 iteratee(obj[i], i, obj);
1997 }
1998 } else {
1999 var _keys = Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj);
2000 for (i = 0, length = _keys.length; i < length; i++) {
2001 iteratee(obj[_keys[i]], _keys[i], obj);
2002 }
2003 }
2004 return obj;
2005}
2006
2007
2008/***/ }),
2009/* 53 */
2010/***/ (function(module, exports, __webpack_require__) {
2011
2012module.exports = __webpack_require__(378);
2013
2014/***/ }),
2015/* 54 */
2016/***/ (function(module, exports, __webpack_require__) {
2017
2018var uncurryThis = __webpack_require__(4);
2019
2020var toString = uncurryThis({}.toString);
2021var stringSlice = uncurryThis(''.slice);
2022
2023module.exports = function (it) {
2024 return stringSlice(toString(it), 8, -1);
2025};
2026
2027
2028/***/ }),
2029/* 55 */
2030/***/ (function(module, exports, __webpack_require__) {
2031
2032/* eslint-disable es-x/no-symbol -- required for testing */
2033var V8_VERSION = __webpack_require__(56);
2034var fails = __webpack_require__(3);
2035
2036// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
2037module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
2038 var symbol = Symbol();
2039 // Chrome 38 Symbol has incorrect toString conversion
2040 // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
2041 return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
2042 // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
2043 !Symbol.sham && V8_VERSION && V8_VERSION < 41;
2044});
2045
2046
2047/***/ }),
2048/* 56 */
2049/***/ (function(module, exports, __webpack_require__) {
2050
2051var global = __webpack_require__(9);
2052var userAgent = __webpack_require__(45);
2053
2054var process = global.process;
2055var Deno = global.Deno;
2056var versions = process && process.versions || Deno && Deno.version;
2057var v8 = versions && versions.v8;
2058var match, version;
2059
2060if (v8) {
2061 match = v8.split('.');
2062 // in old Chrome, versions of V8 isn't V8 = Chrome / 10
2063 // but their correct versions are not interesting for us
2064 version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
2065}
2066
2067// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
2068// so check `userAgent` even if `.v8` exists, but 0
2069if (!version && userAgent) {
2070 match = userAgent.match(/Edge\/(\d+)/);
2071 if (!match || match[1] >= 74) {
2072 match = userAgent.match(/Chrome\/(\d+)/);
2073 if (match) version = +match[1];
2074 }
2075}
2076
2077module.exports = version;
2078
2079
2080/***/ }),
2081/* 57 */
2082/***/ (function(module, exports) {
2083
2084var $String = String;
2085
2086module.exports = function (argument) {
2087 try {
2088 return $String(argument);
2089 } catch (error) {
2090 return 'Object';
2091 }
2092};
2093
2094
2095/***/ }),
2096/* 58 */
2097/***/ (function(module, exports, __webpack_require__) {
2098
2099var uncurryThis = __webpack_require__(4);
2100var aCallable = __webpack_require__(28);
2101var NATIVE_BIND = __webpack_require__(72);
2102
2103var bind = uncurryThis(uncurryThis.bind);
2104
2105// optional / simple context binding
2106module.exports = function (fn, that) {
2107 aCallable(fn);
2108 return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
2109 return fn.apply(that, arguments);
2110 };
2111};
2112
2113
2114/***/ }),
2115/* 59 */
2116/***/ (function(module, exports, __webpack_require__) {
2117
2118/* global ActiveXObject -- old IE, WSH */
2119var anObject = __webpack_require__(21);
2120var definePropertiesModule = __webpack_require__(152);
2121var enumBugKeys = __webpack_require__(118);
2122var hiddenKeys = __webpack_require__(93);
2123var html = __webpack_require__(153);
2124var documentCreateElement = __webpack_require__(113);
2125var sharedKey = __webpack_require__(91);
2126
2127var GT = '>';
2128var LT = '<';
2129var PROTOTYPE = 'prototype';
2130var SCRIPT = 'script';
2131var IE_PROTO = sharedKey('IE_PROTO');
2132
2133var EmptyConstructor = function () { /* empty */ };
2134
2135var scriptTag = function (content) {
2136 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
2137};
2138
2139// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
2140var NullProtoObjectViaActiveX = function (activeXDocument) {
2141 activeXDocument.write(scriptTag(''));
2142 activeXDocument.close();
2143 var temp = activeXDocument.parentWindow.Object;
2144 activeXDocument = null; // avoid memory leak
2145 return temp;
2146};
2147
2148// Create object with fake `null` prototype: use iframe Object with cleared prototype
2149var NullProtoObjectViaIFrame = function () {
2150 // Thrash, waste and sodomy: IE GC bug
2151 var iframe = documentCreateElement('iframe');
2152 var JS = 'java' + SCRIPT + ':';
2153 var iframeDocument;
2154 iframe.style.display = 'none';
2155 html.appendChild(iframe);
2156 // https://github.com/zloirock/core-js/issues/475
2157 iframe.src = String(JS);
2158 iframeDocument = iframe.contentWindow.document;
2159 iframeDocument.open();
2160 iframeDocument.write(scriptTag('document.F=Object'));
2161 iframeDocument.close();
2162 return iframeDocument.F;
2163};
2164
2165// Check for document.domain and active x support
2166// No need to use active x approach when document.domain is not set
2167// see https://github.com/es-shims/es5-shim/issues/150
2168// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
2169// avoid IE GC bug
2170var activeXDocument;
2171var NullProtoObject = function () {
2172 try {
2173 activeXDocument = new ActiveXObject('htmlfile');
2174 } catch (error) { /* ignore */ }
2175 NullProtoObject = typeof document != 'undefined'
2176 ? document.domain && activeXDocument
2177 ? NullProtoObjectViaActiveX(activeXDocument) // old IE
2178 : NullProtoObjectViaIFrame()
2179 : NullProtoObjectViaActiveX(activeXDocument); // WSH
2180 var length = enumBugKeys.length;
2181 while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
2182 return NullProtoObject();
2183};
2184
2185hiddenKeys[IE_PROTO] = true;
2186
2187// `Object.create` method
2188// https://tc39.es/ecma262/#sec-object.create
2189// eslint-disable-next-line es-x/no-object-create -- safe
2190module.exports = Object.create || function create(O, Properties) {
2191 var result;
2192 if (O !== null) {
2193 EmptyConstructor[PROTOTYPE] = anObject(O);
2194 result = new EmptyConstructor();
2195 EmptyConstructor[PROTOTYPE] = null;
2196 // add "__proto__" for Object.getPrototypeOf polyfill
2197 result[IE_PROTO] = O;
2198 } else result = NullProtoObject();
2199 return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
2200};
2201
2202
2203/***/ }),
2204/* 60 */
2205/***/ (function(module, exports, __webpack_require__) {
2206
2207"use strict";
2208
2209var toIndexedObject = __webpack_require__(35);
2210var addToUnscopables = __webpack_require__(122);
2211var Iterators = __webpack_require__(46);
2212var InternalStateModule = __webpack_require__(95);
2213var defineProperty = __webpack_require__(34).f;
2214var defineIterator = __webpack_require__(157);
2215var IS_PURE = __webpack_require__(32);
2216var DESCRIPTORS = __webpack_require__(20);
2217
2218var ARRAY_ITERATOR = 'Array Iterator';
2219var setInternalState = InternalStateModule.set;
2220var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
2221
2222// `Array.prototype.entries` method
2223// https://tc39.es/ecma262/#sec-array.prototype.entries
2224// `Array.prototype.keys` method
2225// https://tc39.es/ecma262/#sec-array.prototype.keys
2226// `Array.prototype.values` method
2227// https://tc39.es/ecma262/#sec-array.prototype.values
2228// `Array.prototype[@@iterator]` method
2229// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
2230// `CreateArrayIterator` internal method
2231// https://tc39.es/ecma262/#sec-createarrayiterator
2232module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
2233 setInternalState(this, {
2234 type: ARRAY_ITERATOR,
2235 target: toIndexedObject(iterated), // target
2236 index: 0, // next index
2237 kind: kind // kind
2238 });
2239// `%ArrayIteratorPrototype%.next` method
2240// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
2241}, function () {
2242 var state = getInternalState(this);
2243 var target = state.target;
2244 var kind = state.kind;
2245 var index = state.index++;
2246 if (!target || index >= target.length) {
2247 state.target = undefined;
2248 return { value: undefined, done: true };
2249 }
2250 if (kind == 'keys') return { value: index, done: false };
2251 if (kind == 'values') return { value: target[index], done: false };
2252 return { value: [index, target[index]], done: false };
2253}, 'values');
2254
2255// argumentsList[@@iterator] is %ArrayProto_values%
2256// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
2257// https://tc39.es/ecma262/#sec-createmappedargumentsobject
2258var values = Iterators.Arguments = Iterators.Array;
2259
2260// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2261addToUnscopables('keys');
2262addToUnscopables('values');
2263addToUnscopables('entries');
2264
2265// V8 ~ Chrome 45- bug
2266if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
2267 defineProperty(values, 'name', { value: 'values' });
2268} catch (error) { /* empty */ }
2269
2270
2271/***/ }),
2272/* 61 */
2273/***/ (function(module, exports, __webpack_require__) {
2274
2275var TO_STRING_TAG_SUPPORT = __webpack_require__(121);
2276var defineProperty = __webpack_require__(34).f;
2277var createNonEnumerableProperty = __webpack_require__(39);
2278var hasOwn = __webpack_require__(13);
2279var toString = __webpack_require__(266);
2280var wellKnownSymbol = __webpack_require__(5);
2281
2282var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2283
2284module.exports = function (it, TAG, STATIC, SET_METHOD) {
2285 if (it) {
2286 var target = STATIC ? it : it.prototype;
2287 if (!hasOwn(target, TO_STRING_TAG)) {
2288 defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
2289 }
2290 if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
2291 createNonEnumerableProperty(target, 'toString', toString);
2292 }
2293 }
2294};
2295
2296
2297/***/ }),
2298/* 62 */
2299/***/ (function(module, exports, __webpack_require__) {
2300
2301var global = __webpack_require__(9);
2302
2303module.exports = global.Promise;
2304
2305
2306/***/ }),
2307/* 63 */
2308/***/ (function(module, exports, __webpack_require__) {
2309
2310__webpack_require__(60);
2311var DOMIterables = __webpack_require__(287);
2312var global = __webpack_require__(9);
2313var classof = __webpack_require__(47);
2314var createNonEnumerableProperty = __webpack_require__(39);
2315var Iterators = __webpack_require__(46);
2316var wellKnownSymbol = __webpack_require__(5);
2317
2318var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2319
2320for (var COLLECTION_NAME in DOMIterables) {
2321 var Collection = global[COLLECTION_NAME];
2322 var CollectionPrototype = Collection && Collection.prototype;
2323 if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
2324 createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
2325 }
2326 Iterators[COLLECTION_NAME] = Iterators.Array;
2327}
2328
2329
2330/***/ }),
2331/* 64 */
2332/***/ (function(module, __webpack_exports__, __webpack_require__) {
2333
2334"use strict";
2335/* harmony export (immutable) */ __webpack_exports__["a"] = values;
2336/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(14);
2337
2338
2339// Retrieve the values of an object's properties.
2340function values(obj) {
2341 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
2342 var length = _keys.length;
2343 var values = Array(length);
2344 for (var i = 0; i < length; i++) {
2345 values[i] = obj[_keys[i]];
2346 }
2347 return values;
2348}
2349
2350
2351/***/ }),
2352/* 65 */
2353/***/ (function(module, __webpack_exports__, __webpack_require__) {
2354
2355"use strict";
2356/* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
2357/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(30);
2358/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
2359/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(51);
2360/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(127);
2361
2362
2363
2364
2365
2366// Internal implementation of a recursive `flatten` function.
2367function flatten(input, depth, strict, output) {
2368 output = output || [];
2369 if (!depth && depth !== 0) {
2370 depth = Infinity;
2371 } else if (depth <= 0) {
2372 return output.concat(input);
2373 }
2374 var idx = output.length;
2375 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(input); i < length; i++) {
2376 var value = input[i];
2377 if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(value) && (Object(__WEBPACK_IMPORTED_MODULE_2__isArray_js__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" /* default */])(value))) {
2378 // Flatten current level of array or arguments object.
2379 if (depth > 1) {
2380 flatten(value, depth - 1, strict, output);
2381 idx = output.length;
2382 } else {
2383 var j = 0, len = value.length;
2384 while (j < len) output[idx++] = value[j++];
2385 }
2386 } else if (!strict) {
2387 output[idx++] = value;
2388 }
2389 }
2390 return output;
2391}
2392
2393
2394/***/ }),
2395/* 66 */
2396/***/ (function(module, __webpack_exports__, __webpack_require__) {
2397
2398"use strict";
2399/* harmony export (immutable) */ __webpack_exports__["a"] = map;
2400/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(19);
2401/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
2402/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(14);
2403
2404
2405
2406
2407// Return the results of applying the iteratee to each element.
2408function map(obj, iteratee, context) {
2409 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
2410 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
2411 length = (_keys || obj).length,
2412 results = Array(length);
2413 for (var index = 0; index < length; index++) {
2414 var currentKey = _keys ? _keys[index] : index;
2415 results[index] = iteratee(obj[currentKey], currentKey, obj);
2416 }
2417 return results;
2418}
2419
2420
2421/***/ }),
2422/* 67 */
2423/***/ (function(module, exports, __webpack_require__) {
2424
2425"use strict";
2426/* WEBPACK VAR INJECTION */(function(global) {
2427
2428var _interopRequireDefault = __webpack_require__(1);
2429
2430var _promise = _interopRequireDefault(__webpack_require__(10));
2431
2432var _concat = _interopRequireDefault(__webpack_require__(25));
2433
2434var _map = _interopRequireDefault(__webpack_require__(42));
2435
2436var _keys = _interopRequireDefault(__webpack_require__(217));
2437
2438var _stringify = _interopRequireDefault(__webpack_require__(37));
2439
2440var _indexOf = _interopRequireDefault(__webpack_require__(68));
2441
2442var _keys2 = _interopRequireDefault(__webpack_require__(53));
2443
2444var _ = __webpack_require__(2);
2445
2446var uuid = __webpack_require__(219);
2447
2448var debug = __webpack_require__(69);
2449
2450var _require = __webpack_require__(31),
2451 inherits = _require.inherits,
2452 parseDate = _require.parseDate;
2453
2454var version = __webpack_require__(222);
2455
2456var _require2 = __webpack_require__(70),
2457 setAdapters = _require2.setAdapters,
2458 adapterManager = _require2.adapterManager;
2459
2460var AV = global.AV || {}; // All internal configuration items
2461
2462AV._config = {
2463 serverURLs: {},
2464 useMasterKey: false,
2465 production: null,
2466 realtime: null,
2467 requestTimeout: null
2468};
2469var initialUserAgent = "LeanCloud-JS-SDK/".concat(version); // configs shared by all AV instances
2470
2471AV._sharedConfig = {
2472 userAgent: initialUserAgent,
2473 liveQueryRealtime: null
2474};
2475adapterManager.on('platformInfo', function (platformInfo) {
2476 var ua = initialUserAgent;
2477
2478 if (platformInfo) {
2479 if (platformInfo.userAgent) {
2480 ua = platformInfo.userAgent;
2481 } else {
2482 var comments = platformInfo.name;
2483
2484 if (platformInfo.version) {
2485 comments += "/".concat(platformInfo.version);
2486 }
2487
2488 if (platformInfo.extra) {
2489 comments += "; ".concat(platformInfo.extra);
2490 }
2491
2492 ua += " (".concat(comments, ")");
2493 }
2494 }
2495
2496 AV._sharedConfig.userAgent = ua;
2497});
2498/**
2499 * Contains all AV API classes and functions.
2500 * @namespace AV
2501 */
2502
2503/**
2504 * Returns prefix for localStorage keys used by this instance of AV.
2505 * @param {String} path The relative suffix to append to it.
2506 * null or undefined is treated as the empty string.
2507 * @return {String} The full key name.
2508 * @private
2509 */
2510
2511AV._getAVPath = function (path) {
2512 if (!AV.applicationId) {
2513 throw new Error('You need to call AV.initialize before using AV.');
2514 }
2515
2516 if (!path) {
2517 path = '';
2518 }
2519
2520 if (!_.isString(path)) {
2521 throw new Error("Tried to get a localStorage path that wasn't a String.");
2522 }
2523
2524 if (path[0] === '/') {
2525 path = path.substring(1);
2526 }
2527
2528 return 'AV/' + AV.applicationId + '/' + path;
2529};
2530/**
2531 * Returns the unique string for this app on this machine.
2532 * Gets reset when localStorage is cleared.
2533 * @private
2534 */
2535
2536
2537AV._installationId = null;
2538
2539AV._getInstallationId = function () {
2540 // See if it's cached in RAM.
2541 if (AV._installationId) {
2542 return _promise.default.resolve(AV._installationId);
2543 } // Try to get it from localStorage.
2544
2545
2546 var path = AV._getAVPath('installationId');
2547
2548 return AV.localStorage.getItemAsync(path).then(function (_installationId) {
2549 AV._installationId = _installationId;
2550
2551 if (!AV._installationId) {
2552 // It wasn't in localStorage, so create a new one.
2553 AV._installationId = _installationId = uuid();
2554 return AV.localStorage.setItemAsync(path, _installationId).then(function () {
2555 return _installationId;
2556 });
2557 }
2558
2559 return _installationId;
2560 });
2561};
2562
2563AV._subscriptionId = null;
2564
2565AV._refreshSubscriptionId = function () {
2566 var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AV._getAVPath('subscriptionId');
2567 var subscriptionId = AV._subscriptionId = uuid();
2568 return AV.localStorage.setItemAsync(path, subscriptionId).then(function () {
2569 return subscriptionId;
2570 });
2571};
2572
2573AV._getSubscriptionId = function () {
2574 // See if it's cached in RAM.
2575 if (AV._subscriptionId) {
2576 return _promise.default.resolve(AV._subscriptionId);
2577 } // Try to get it from localStorage.
2578
2579
2580 var path = AV._getAVPath('subscriptionId');
2581
2582 return AV.localStorage.getItemAsync(path).then(function (_subscriptionId) {
2583 AV._subscriptionId = _subscriptionId;
2584
2585 if (!AV._subscriptionId) {
2586 // It wasn't in localStorage, so create a new one.
2587 _subscriptionId = AV._refreshSubscriptionId(path);
2588 }
2589
2590 return _subscriptionId;
2591 });
2592};
2593
2594AV._parseDate = parseDate; // A self-propagating extend function.
2595
2596AV._extend = function (protoProps, classProps) {
2597 var child = inherits(this, protoProps, classProps);
2598 child.extend = this.extend;
2599 return child;
2600};
2601/**
2602 * Converts a value in a AV Object into the appropriate representation.
2603 * This is the JS equivalent of Java's AV.maybeReferenceAndEncode(Object)
2604 * if seenObjects is falsey. Otherwise any AV.Objects not in
2605 * seenObjects will be fully embedded rather than encoded
2606 * as a pointer. This array will be used to prevent going into an infinite
2607 * loop because we have circular references. If <seenObjects>
2608 * is set, then none of the AV Objects that are serialized can be dirty.
2609 * @private
2610 */
2611
2612
2613AV._encode = function (value, seenObjects, disallowObjects) {
2614 var full = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
2615
2616 if (value instanceof AV.Object) {
2617 if (disallowObjects) {
2618 throw new Error('AV.Objects not allowed here');
2619 }
2620
2621 if (!seenObjects || _.include(seenObjects, value) || !value._hasData) {
2622 return value._toPointer();
2623 }
2624
2625 return value._toFullJSON((0, _concat.default)(seenObjects).call(seenObjects, value), full);
2626 }
2627
2628 if (value instanceof AV.ACL) {
2629 return value.toJSON();
2630 }
2631
2632 if (_.isDate(value)) {
2633 return full ? {
2634 __type: 'Date',
2635 iso: value.toJSON()
2636 } : value.toJSON();
2637 }
2638
2639 if (value instanceof AV.GeoPoint) {
2640 return value.toJSON();
2641 }
2642
2643 if (_.isArray(value)) {
2644 return (0, _map.default)(_).call(_, value, function (x) {
2645 return AV._encode(x, seenObjects, disallowObjects, full);
2646 });
2647 }
2648
2649 if (_.isRegExp(value)) {
2650 return value.source;
2651 }
2652
2653 if (value instanceof AV.Relation) {
2654 return value.toJSON();
2655 }
2656
2657 if (value instanceof AV.Op) {
2658 return value.toJSON();
2659 }
2660
2661 if (value instanceof AV.File) {
2662 if (!value.url() && !value.id) {
2663 throw new Error('Tried to save an object containing an unsaved file.');
2664 }
2665
2666 return value._toFullJSON(seenObjects, full);
2667 }
2668
2669 if (_.isObject(value)) {
2670 return _.mapObject(value, function (v, k) {
2671 return AV._encode(v, seenObjects, disallowObjects, full);
2672 });
2673 }
2674
2675 return value;
2676};
2677/**
2678 * The inverse function of AV._encode.
2679 * @private
2680 */
2681
2682
2683AV._decode = function (value, key) {
2684 if (!_.isObject(value) || _.isDate(value)) {
2685 return value;
2686 }
2687
2688 if (_.isArray(value)) {
2689 return (0, _map.default)(_).call(_, value, function (v) {
2690 return AV._decode(v);
2691 });
2692 }
2693
2694 if (value instanceof AV.Object) {
2695 return value;
2696 }
2697
2698 if (value instanceof AV.File) {
2699 return value;
2700 }
2701
2702 if (value instanceof AV.Op) {
2703 return value;
2704 }
2705
2706 if (value instanceof AV.GeoPoint) {
2707 return value;
2708 }
2709
2710 if (value instanceof AV.ACL) {
2711 return value;
2712 }
2713
2714 if (key === 'ACL') {
2715 return new AV.ACL(value);
2716 }
2717
2718 if (value.__op) {
2719 return AV.Op._decode(value);
2720 }
2721
2722 var className;
2723
2724 if (value.__type === 'Pointer') {
2725 className = value.className;
2726
2727 var pointer = AV.Object._create(className);
2728
2729 if ((0, _keys.default)(value).length > 3) {
2730 var v = _.clone(value);
2731
2732 delete v.__type;
2733 delete v.className;
2734
2735 pointer._finishFetch(v, true);
2736 } else {
2737 pointer._finishFetch({
2738 objectId: value.objectId
2739 }, false);
2740 }
2741
2742 return pointer;
2743 }
2744
2745 if (value.__type === 'Object') {
2746 // It's an Object included in a query result.
2747 className = value.className;
2748
2749 var _v = _.clone(value);
2750
2751 delete _v.__type;
2752 delete _v.className;
2753
2754 var object = AV.Object._create(className);
2755
2756 object._finishFetch(_v, true);
2757
2758 return object;
2759 }
2760
2761 if (value.__type === 'Date') {
2762 return AV._parseDate(value.iso);
2763 }
2764
2765 if (value.__type === 'GeoPoint') {
2766 return new AV.GeoPoint({
2767 latitude: value.latitude,
2768 longitude: value.longitude
2769 });
2770 }
2771
2772 if (value.__type === 'Relation') {
2773 if (!key) throw new Error('key missing decoding a Relation');
2774 var relation = new AV.Relation(null, key);
2775 relation.targetClassName = value.className;
2776 return relation;
2777 }
2778
2779 if (value.__type === 'File') {
2780 var file = new AV.File(value.name);
2781
2782 var _v2 = _.clone(value);
2783
2784 delete _v2.__type;
2785
2786 file._finishFetch(_v2);
2787
2788 return file;
2789 }
2790
2791 return _.mapObject(value, AV._decode);
2792};
2793/**
2794 * The inverse function of {@link AV.Object#toFullJSON}.
2795 * @since 3.0.0
2796 * @method
2797 * @param {Object}
2798 * return {AV.Object|AV.File|any}
2799 */
2800
2801
2802AV.parseJSON = AV._decode;
2803/**
2804 * Similar to JSON.parse, except that AV internal types will be used if possible.
2805 * Inverse to {@link AV.stringify}
2806 * @since 3.14.0
2807 * @param {string} text the string to parse.
2808 * @return {AV.Object|AV.File|any}
2809 */
2810
2811AV.parse = function (text) {
2812 return AV.parseJSON(JSON.parse(text));
2813};
2814/**
2815 * Serialize a target containing AV.Object, similar to JSON.stringify.
2816 * Inverse to {@link AV.parse}
2817 * @since 3.14.0
2818 * @return {string}
2819 */
2820
2821
2822AV.stringify = function (target) {
2823 return (0, _stringify.default)(AV._encode(target, [], false, true));
2824};
2825
2826AV._encodeObjectOrArray = function (value) {
2827 var encodeAVObject = function encodeAVObject(object) {
2828 if (object && object._toFullJSON) {
2829 object = object._toFullJSON([]);
2830 }
2831
2832 return _.mapObject(object, function (value) {
2833 return AV._encode(value, []);
2834 });
2835 };
2836
2837 if (_.isArray(value)) {
2838 return (0, _map.default)(value).call(value, function (object) {
2839 return encodeAVObject(object);
2840 });
2841 } else {
2842 return encodeAVObject(value);
2843 }
2844};
2845
2846AV._arrayEach = _.each;
2847/**
2848 * Does a deep traversal of every item in object, calling func on every one.
2849 * @param {Object} object The object or array to traverse deeply.
2850 * @param {Function} func The function to call for every item. It will
2851 * be passed the item as an argument. If it returns a truthy value, that
2852 * value will replace the item in its parent container.
2853 * @returns {} the result of calling func on the top-level object itself.
2854 * @private
2855 */
2856
2857AV._traverse = function (object, func, seen) {
2858 if (object instanceof AV.Object) {
2859 seen = seen || [];
2860
2861 if ((0, _indexOf.default)(_).call(_, seen, object) >= 0) {
2862 // We've already visited this object in this call.
2863 return;
2864 }
2865
2866 seen.push(object);
2867
2868 AV._traverse(object.attributes, func, seen);
2869
2870 return func(object);
2871 }
2872
2873 if (object instanceof AV.Relation || object instanceof AV.File) {
2874 // Nothing needs to be done, but we don't want to recurse into the
2875 // object's parent infinitely, so we catch this case.
2876 return func(object);
2877 }
2878
2879 if (_.isArray(object)) {
2880 _.each(object, function (child, index) {
2881 var newChild = AV._traverse(child, func, seen);
2882
2883 if (newChild) {
2884 object[index] = newChild;
2885 }
2886 });
2887
2888 return func(object);
2889 }
2890
2891 if (_.isObject(object)) {
2892 AV._each(object, function (child, key) {
2893 var newChild = AV._traverse(child, func, seen);
2894
2895 if (newChild) {
2896 object[key] = newChild;
2897 }
2898 });
2899
2900 return func(object);
2901 }
2902
2903 return func(object);
2904};
2905/**
2906 * This is like _.each, except:
2907 * * it doesn't work for so-called array-like objects,
2908 * * it does work for dictionaries with a "length" attribute.
2909 * @private
2910 */
2911
2912
2913AV._objectEach = AV._each = function (obj, callback) {
2914 if (_.isObject(obj)) {
2915 _.each((0, _keys2.default)(_).call(_, obj), function (key) {
2916 callback(obj[key], key);
2917 });
2918 } else {
2919 _.each(obj, callback);
2920 }
2921};
2922/**
2923 * @namespace
2924 * @since 3.14.0
2925 */
2926
2927
2928AV.debug = {
2929 /**
2930 * Enable debug
2931 */
2932 enable: function enable() {
2933 var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'leancloud*';
2934 return debug.enable(namespaces);
2935 },
2936
2937 /**
2938 * Disable debug
2939 */
2940 disable: debug.disable
2941};
2942/**
2943 * Specify Adapters
2944 * @since 4.4.0
2945 * @function
2946 * @param {Adapters} newAdapters See {@link https://url.leanapp.cn/adapter-type-definitions @leancloud/adapter-types} for detailed definitions.
2947 */
2948
2949AV.setAdapters = setAdapters;
2950module.exports = AV;
2951/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(108)))
2952
2953/***/ }),
2954/* 68 */
2955/***/ (function(module, exports, __webpack_require__) {
2956
2957module.exports = __webpack_require__(374);
2958
2959/***/ }),
2960/* 69 */
2961/***/ (function(module, exports, __webpack_require__) {
2962
2963"use strict";
2964
2965
2966function _typeof(obj) { 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); }
2967
2968/* eslint-env browser */
2969
2970/**
2971 * This is the web browser implementation of `debug()`.
2972 */
2973exports.log = log;
2974exports.formatArgs = formatArgs;
2975exports.save = save;
2976exports.load = load;
2977exports.useColors = useColors;
2978exports.storage = localstorage();
2979/**
2980 * Colors.
2981 */
2982
2983exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
2984/**
2985 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
2986 * and the Firebug extension (any Firefox version) are known
2987 * to support "%c" CSS customizations.
2988 *
2989 * TODO: add a `localStorage` variable to explicitly enable/disable colors
2990 */
2991// eslint-disable-next-line complexity
2992
2993function useColors() {
2994 // NB: In an Electron preload script, document will be defined but not fully
2995 // initialized. Since we know we're in Chrome, we'll just detect this case
2996 // explicitly
2997 if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
2998 return true;
2999 } // Internet Explorer and Edge do not support colors.
3000
3001
3002 if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
3003 return false;
3004 } // Is webkit? http://stackoverflow.com/a/16459606/376773
3005 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
3006
3007
3008 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
3009 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
3010 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
3011 typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
3012 typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
3013}
3014/**
3015 * Colorize log arguments if enabled.
3016 *
3017 * @api public
3018 */
3019
3020
3021function formatArgs(args) {
3022 args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
3023
3024 if (!this.useColors) {
3025 return;
3026 }
3027
3028 var c = 'color: ' + this.color;
3029 args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
3030 // arguments passed either before or after the %c, so we need to
3031 // figure out the correct index to insert the CSS into
3032
3033 var index = 0;
3034 var lastC = 0;
3035 args[0].replace(/%[a-zA-Z%]/g, function (match) {
3036 if (match === '%%') {
3037 return;
3038 }
3039
3040 index++;
3041
3042 if (match === '%c') {
3043 // We only are interested in the *last* %c
3044 // (the user may have provided their own)
3045 lastC = index;
3046 }
3047 });
3048 args.splice(lastC, 0, c);
3049}
3050/**
3051 * Invokes `console.log()` when available.
3052 * No-op when `console.log` is not a "function".
3053 *
3054 * @api public
3055 */
3056
3057
3058function log() {
3059 var _console;
3060
3061 // This hackery is required for IE8/9, where
3062 // the `console.log` function doesn't have 'apply'
3063 return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
3064}
3065/**
3066 * Save `namespaces`.
3067 *
3068 * @param {String} namespaces
3069 * @api private
3070 */
3071
3072
3073function save(namespaces) {
3074 try {
3075 if (namespaces) {
3076 exports.storage.setItem('debug', namespaces);
3077 } else {
3078 exports.storage.removeItem('debug');
3079 }
3080 } catch (error) {// Swallow
3081 // XXX (@Qix-) should we be logging these?
3082 }
3083}
3084/**
3085 * Load `namespaces`.
3086 *
3087 * @return {String} returns the previously persisted debug modes
3088 * @api private
3089 */
3090
3091
3092function load() {
3093 var r;
3094
3095 try {
3096 r = exports.storage.getItem('debug');
3097 } catch (error) {} // Swallow
3098 // XXX (@Qix-) should we be logging these?
3099 // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
3100
3101
3102 if (!r && typeof process !== 'undefined' && 'env' in process) {
3103 r = process.env.DEBUG;
3104 }
3105
3106 return r;
3107}
3108/**
3109 * Localstorage attempts to return the localstorage.
3110 *
3111 * This is necessary because safari throws
3112 * when a user disables cookies/localstorage
3113 * and you attempt to access it.
3114 *
3115 * @return {LocalStorage}
3116 * @api private
3117 */
3118
3119
3120function localstorage() {
3121 try {
3122 // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
3123 // The Browser also has localStorage in the global context.
3124 return localStorage;
3125 } catch (error) {// Swallow
3126 // XXX (@Qix-) should we be logging these?
3127 }
3128}
3129
3130module.exports = __webpack_require__(383)(exports);
3131var formatters = module.exports.formatters;
3132/**
3133 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
3134 */
3135
3136formatters.j = function (v) {
3137 try {
3138 return JSON.stringify(v);
3139 } catch (error) {
3140 return '[UnexpectedJSONParseError]: ' + error.message;
3141 }
3142};
3143
3144
3145
3146/***/ }),
3147/* 70 */
3148/***/ (function(module, exports, __webpack_require__) {
3149
3150"use strict";
3151
3152
3153var _interopRequireDefault = __webpack_require__(1);
3154
3155var _keys = _interopRequireDefault(__webpack_require__(53));
3156
3157var _ = __webpack_require__(2);
3158
3159var EventEmitter = __webpack_require__(223);
3160
3161var _require = __webpack_require__(31),
3162 inherits = _require.inherits;
3163
3164var AdapterManager = inherits(EventEmitter, {
3165 constructor: function constructor() {
3166 EventEmitter.apply(this);
3167 this._adapters = {};
3168 },
3169 getAdapter: function getAdapter(name) {
3170 var adapter = this._adapters[name];
3171
3172 if (adapter === undefined) {
3173 throw new Error("".concat(name, " adapter is not configured"));
3174 }
3175
3176 return adapter;
3177 },
3178 setAdapters: function setAdapters(newAdapters) {
3179 var _this = this;
3180
3181 _.extend(this._adapters, newAdapters);
3182
3183 (0, _keys.default)(_).call(_, newAdapters).forEach(function (name) {
3184 return _this.emit(name, newAdapters[name]);
3185 });
3186 }
3187});
3188var adapterManager = new AdapterManager();
3189module.exports = {
3190 getAdapter: adapterManager.getAdapter.bind(adapterManager),
3191 setAdapters: adapterManager.setAdapters.bind(adapterManager),
3192 adapterManager: adapterManager
3193};
3194
3195/***/ }),
3196/* 71 */
3197/***/ (function(module, exports, __webpack_require__) {
3198
3199var NATIVE_BIND = __webpack_require__(72);
3200
3201var FunctionPrototype = Function.prototype;
3202var apply = FunctionPrototype.apply;
3203var call = FunctionPrototype.call;
3204
3205// eslint-disable-next-line es-x/no-reflect -- safe
3206module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
3207 return call.apply(apply, arguments);
3208});
3209
3210
3211/***/ }),
3212/* 72 */
3213/***/ (function(module, exports, __webpack_require__) {
3214
3215var fails = __webpack_require__(3);
3216
3217module.exports = !fails(function () {
3218 // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
3219 var test = (function () { /* empty */ }).bind();
3220 // eslint-disable-next-line no-prototype-builtins -- safe
3221 return typeof test != 'function' || test.hasOwnProperty('prototype');
3222});
3223
3224
3225/***/ }),
3226/* 73 */
3227/***/ (function(module, exports, __webpack_require__) {
3228
3229var DESCRIPTORS = __webpack_require__(20);
3230var call = __webpack_require__(11);
3231var propertyIsEnumerableModule = __webpack_require__(145);
3232var createPropertyDescriptor = __webpack_require__(44);
3233var toIndexedObject = __webpack_require__(35);
3234var toPropertyKey = __webpack_require__(88);
3235var hasOwn = __webpack_require__(13);
3236var IE8_DOM_DEFINE = __webpack_require__(147);
3237
3238// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3239var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
3240
3241// `Object.getOwnPropertyDescriptor` method
3242// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
3243exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
3244 O = toIndexedObject(O);
3245 P = toPropertyKey(P);
3246 if (IE8_DOM_DEFINE) try {
3247 return $getOwnPropertyDescriptor(O, P);
3248 } catch (error) { /* empty */ }
3249 if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
3250};
3251
3252
3253/***/ }),
3254/* 74 */
3255/***/ (function(module, exports) {
3256
3257var $TypeError = TypeError;
3258
3259// `RequireObjectCoercible` abstract operation
3260// https://tc39.es/ecma262/#sec-requireobjectcoercible
3261module.exports = function (it) {
3262 if (it == undefined) throw $TypeError("Can't call method on " + it);
3263 return it;
3264};
3265
3266
3267/***/ }),
3268/* 75 */
3269/***/ (function(module, exports, __webpack_require__) {
3270
3271var IS_PURE = __webpack_require__(32);
3272var store = __webpack_require__(111);
3273
3274(module.exports = function (key, value) {
3275 return store[key] || (store[key] = value !== undefined ? value : {});
3276})('versions', []).push({
3277 version: '3.23.3',
3278 mode: IS_PURE ? 'pure' : 'global',
3279 copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
3280 license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
3281 source: 'https://github.com/zloirock/core-js'
3282});
3283
3284
3285/***/ }),
3286/* 76 */
3287/***/ (function(module, exports, __webpack_require__) {
3288
3289var bind = __webpack_require__(58);
3290var call = __webpack_require__(11);
3291var anObject = __webpack_require__(21);
3292var tryToString = __webpack_require__(57);
3293var isArrayIteratorMethod = __webpack_require__(154);
3294var lengthOfArrayLike = __webpack_require__(36);
3295var isPrototypeOf = __webpack_require__(12);
3296var getIterator = __webpack_require__(155);
3297var getIteratorMethod = __webpack_require__(94);
3298var iteratorClose = __webpack_require__(156);
3299
3300var $TypeError = TypeError;
3301
3302var Result = function (stopped, result) {
3303 this.stopped = stopped;
3304 this.result = result;
3305};
3306
3307var ResultPrototype = Result.prototype;
3308
3309module.exports = function (iterable, unboundFunction, options) {
3310 var that = options && options.that;
3311 var AS_ENTRIES = !!(options && options.AS_ENTRIES);
3312 var IS_ITERATOR = !!(options && options.IS_ITERATOR);
3313 var INTERRUPTED = !!(options && options.INTERRUPTED);
3314 var fn = bind(unboundFunction, that);
3315 var iterator, iterFn, index, length, result, next, step;
3316
3317 var stop = function (condition) {
3318 if (iterator) iteratorClose(iterator, 'normal', condition);
3319 return new Result(true, condition);
3320 };
3321
3322 var callFn = function (value) {
3323 if (AS_ENTRIES) {
3324 anObject(value);
3325 return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
3326 } return INTERRUPTED ? fn(value, stop) : fn(value);
3327 };
3328
3329 if (IS_ITERATOR) {
3330 iterator = iterable;
3331 } else {
3332 iterFn = getIteratorMethod(iterable);
3333 if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
3334 // optimisation for array iterators
3335 if (isArrayIteratorMethod(iterFn)) {
3336 for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
3337 result = callFn(iterable[index]);
3338 if (result && isPrototypeOf(ResultPrototype, result)) return result;
3339 } return new Result(false);
3340 }
3341 iterator = getIterator(iterable, iterFn);
3342 }
3343
3344 next = iterator.next;
3345 while (!(step = call(next, iterator)).done) {
3346 try {
3347 result = callFn(step.value);
3348 } catch (error) {
3349 iteratorClose(iterator, 'throw', error);
3350 }
3351 if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
3352 } return new Result(false);
3353};
3354
3355
3356/***/ }),
3357/* 77 */
3358/***/ (function(module, exports) {
3359
3360module.exports = function (exec) {
3361 try {
3362 return { error: false, value: exec() };
3363 } catch (error) {
3364 return { error: true, value: error };
3365 }
3366};
3367
3368
3369/***/ }),
3370/* 78 */
3371/***/ (function(module, exports, __webpack_require__) {
3372
3373var global = __webpack_require__(9);
3374var NativePromiseConstructor = __webpack_require__(62);
3375var isCallable = __webpack_require__(8);
3376var isForced = __webpack_require__(148);
3377var inspectSource = __webpack_require__(123);
3378var wellKnownSymbol = __webpack_require__(5);
3379var IS_BROWSER = __webpack_require__(277);
3380var IS_PURE = __webpack_require__(32);
3381var V8_VERSION = __webpack_require__(56);
3382
3383var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
3384var SPECIES = wellKnownSymbol('species');
3385var SUBCLASSING = false;
3386var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
3387
3388var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
3389 var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
3390 var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
3391 // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
3392 // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
3393 // We can't detect it synchronously, so just check versions
3394 if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
3395 // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution
3396 if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
3397 // We can't use @@species feature detection in V8 since it causes
3398 // deoptimization and performance degradation
3399 // https://github.com/zloirock/core-js/issues/679
3400 if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
3401 // Detect correctness of subclassing with @@species support
3402 var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
3403 var FakePromise = function (exec) {
3404 exec(function () { /* empty */ }, function () { /* empty */ });
3405 };
3406 var constructor = promise.constructor = {};
3407 constructor[SPECIES] = FakePromise;
3408 SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
3409 if (!SUBCLASSING) return true;
3410 // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
3411 return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
3412});
3413
3414module.exports = {
3415 CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
3416 REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
3417 SUBCLASSING: SUBCLASSING
3418};
3419
3420
3421/***/ }),
3422/* 79 */
3423/***/ (function(module, exports, __webpack_require__) {
3424
3425"use strict";
3426
3427var charAt = __webpack_require__(286).charAt;
3428var toString = __webpack_require__(40);
3429var InternalStateModule = __webpack_require__(95);
3430var defineIterator = __webpack_require__(157);
3431
3432var STRING_ITERATOR = 'String Iterator';
3433var setInternalState = InternalStateModule.set;
3434var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
3435
3436// `String.prototype[@@iterator]` method
3437// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
3438defineIterator(String, 'String', function (iterated) {
3439 setInternalState(this, {
3440 type: STRING_ITERATOR,
3441 string: toString(iterated),
3442 index: 0
3443 });
3444// `%StringIteratorPrototype%.next` method
3445// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
3446}, function next() {
3447 var state = getInternalState(this);
3448 var string = state.string;
3449 var index = state.index;
3450 var point;
3451 if (index >= string.length) return { value: undefined, done: true };
3452 point = charAt(string, index);
3453 state.index += point.length;
3454 return { value: point, done: false };
3455});
3456
3457
3458/***/ }),
3459/* 80 */
3460/***/ (function(module, __webpack_exports__, __webpack_require__) {
3461
3462"use strict";
3463/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasStringTagBug; });
3464/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isIE11; });
3465/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
3466/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__ = __webpack_require__(294);
3467
3468
3469
3470// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
3471// In IE 11, the most common among them, this problem also applies to
3472// `Map`, `WeakMap` and `Set`.
3473var hasStringTagBug = (
3474 __WEBPACK_IMPORTED_MODULE_0__setup_js__["s" /* supportsDataView */] && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new DataView(new ArrayBuffer(8)))
3475 ),
3476 isIE11 = (typeof Map !== 'undefined' && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new Map));
3477
3478
3479/***/ }),
3480/* 81 */
3481/***/ (function(module, __webpack_exports__, __webpack_require__) {
3482
3483"use strict";
3484/* harmony export (immutable) */ __webpack_exports__["a"] = allKeys;
3485/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(50);
3486/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
3487/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__ = __webpack_require__(177);
3488
3489
3490
3491
3492// Retrieve all the enumerable property names of an object.
3493function allKeys(obj) {
3494 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
3495 var keys = [];
3496 for (var key in obj) keys.push(key);
3497 // Ahem, IE < 9.
3498 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__["a" /* default */])(obj, keys);
3499 return keys;
3500}
3501
3502
3503/***/ }),
3504/* 82 */
3505/***/ (function(module, __webpack_exports__, __webpack_require__) {
3506
3507"use strict";
3508/* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
3509/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
3510/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(186);
3511
3512
3513
3514// Internal wrapper for `_.toPath` to enable minification.
3515// Similar to `cb` for `_.iteratee`.
3516function toPath(path) {
3517 return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath(path);
3518}
3519
3520
3521/***/ }),
3522/* 83 */
3523/***/ (function(module, __webpack_exports__, __webpack_require__) {
3524
3525"use strict";
3526/* harmony export (immutable) */ __webpack_exports__["a"] = optimizeCb;
3527// Internal function that returns an efficient (for current engines) version
3528// of the passed-in callback, to be repeatedly applied in other Underscore
3529// functions.
3530function optimizeCb(func, context, argCount) {
3531 if (context === void 0) return func;
3532 switch (argCount == null ? 3 : argCount) {
3533 case 1: return function(value) {
3534 return func.call(context, value);
3535 };
3536 // The 2-argument case is omitted because we’re not using it.
3537 case 3: return function(value, index, collection) {
3538 return func.call(context, value, index, collection);
3539 };
3540 case 4: return function(accumulator, value, index, collection) {
3541 return func.call(context, accumulator, value, index, collection);
3542 };
3543 }
3544 return function() {
3545 return func.apply(context, arguments);
3546 };
3547}
3548
3549
3550/***/ }),
3551/* 84 */
3552/***/ (function(module, __webpack_exports__, __webpack_require__) {
3553
3554"use strict";
3555/* harmony export (immutable) */ __webpack_exports__["a"] = filter;
3556/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(19);
3557/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(52);
3558
3559
3560
3561// Return all the elements that pass a truth test.
3562function filter(obj, predicate, context) {
3563 var results = [];
3564 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
3565 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index, list) {
3566 if (predicate(value, index, list)) results.push(value);
3567 });
3568 return results;
3569}
3570
3571
3572/***/ }),
3573/* 85 */
3574/***/ (function(module, __webpack_exports__, __webpack_require__) {
3575
3576"use strict";
3577/* harmony export (immutable) */ __webpack_exports__["a"] = contains;
3578/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
3579/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(64);
3580/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__indexOf_js__ = __webpack_require__(202);
3581
3582
3583
3584
3585// Determine if the array or object contains a given item (using `===`).
3586function contains(obj, item, fromIndex, guard) {
3587 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
3588 if (typeof fromIndex != 'number' || guard) fromIndex = 0;
3589 return Object(__WEBPACK_IMPORTED_MODULE_2__indexOf_js__["a" /* default */])(obj, item, fromIndex) >= 0;
3590}
3591
3592
3593/***/ }),
3594/* 86 */
3595/***/ (function(module, exports, __webpack_require__) {
3596
3597var classof = __webpack_require__(54);
3598
3599// `IsArray` abstract operation
3600// https://tc39.es/ecma262/#sec-isarray
3601// eslint-disable-next-line es-x/no-array-isarray -- safe
3602module.exports = Array.isArray || function isArray(argument) {
3603 return classof(argument) == 'Array';
3604};
3605
3606
3607/***/ }),
3608/* 87 */
3609/***/ (function(module, exports, __webpack_require__) {
3610
3611module.exports = __webpack_require__(230);
3612
3613/***/ }),
3614/* 88 */
3615/***/ (function(module, exports, __webpack_require__) {
3616
3617var toPrimitive = __webpack_require__(252);
3618var isSymbol = __webpack_require__(89);
3619
3620// `ToPropertyKey` abstract operation
3621// https://tc39.es/ecma262/#sec-topropertykey
3622module.exports = function (argument) {
3623 var key = toPrimitive(argument, 'string');
3624 return isSymbol(key) ? key : key + '';
3625};
3626
3627
3628/***/ }),
3629/* 89 */
3630/***/ (function(module, exports, __webpack_require__) {
3631
3632var getBuiltIn = __webpack_require__(18);
3633var isCallable = __webpack_require__(8);
3634var isPrototypeOf = __webpack_require__(12);
3635var USE_SYMBOL_AS_UID = __webpack_require__(146);
3636
3637var $Object = Object;
3638
3639module.exports = USE_SYMBOL_AS_UID ? function (it) {
3640 return typeof it == 'symbol';
3641} : function (it) {
3642 var $Symbol = getBuiltIn('Symbol');
3643 return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
3644};
3645
3646
3647/***/ }),
3648/* 90 */
3649/***/ (function(module, exports, __webpack_require__) {
3650
3651var hasOwn = __webpack_require__(13);
3652var isCallable = __webpack_require__(8);
3653var toObject = __webpack_require__(33);
3654var sharedKey = __webpack_require__(91);
3655var CORRECT_PROTOTYPE_GETTER = __webpack_require__(150);
3656
3657var IE_PROTO = sharedKey('IE_PROTO');
3658var $Object = Object;
3659var ObjectPrototype = $Object.prototype;
3660
3661// `Object.getPrototypeOf` method
3662// https://tc39.es/ecma262/#sec-object.getprototypeof
3663// eslint-disable-next-line es-x/no-object-getprototypeof -- safe
3664module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
3665 var object = toObject(O);
3666 if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
3667 var constructor = object.constructor;
3668 if (isCallable(constructor) && object instanceof constructor) {
3669 return constructor.prototype;
3670 } return object instanceof $Object ? ObjectPrototype : null;
3671};
3672
3673
3674/***/ }),
3675/* 91 */
3676/***/ (function(module, exports, __webpack_require__) {
3677
3678var shared = __webpack_require__(75);
3679var uid = __webpack_require__(112);
3680
3681var keys = shared('keys');
3682
3683module.exports = function (key) {
3684 return keys[key] || (keys[key] = uid(key));
3685};
3686
3687
3688/***/ }),
3689/* 92 */
3690/***/ (function(module, exports, __webpack_require__) {
3691
3692/* eslint-disable no-proto -- safe */
3693var uncurryThis = __webpack_require__(4);
3694var anObject = __webpack_require__(21);
3695var aPossiblePrototype = __webpack_require__(255);
3696
3697// `Object.setPrototypeOf` method
3698// https://tc39.es/ecma262/#sec-object.setprototypeof
3699// Works with __proto__ only. Old v8 can't work with null proto objects.
3700// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
3701module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3702 var CORRECT_SETTER = false;
3703 var test = {};
3704 var setter;
3705 try {
3706 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3707 setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
3708 setter(test, []);
3709 CORRECT_SETTER = test instanceof Array;
3710 } catch (error) { /* empty */ }
3711 return function setPrototypeOf(O, proto) {
3712 anObject(O);
3713 aPossiblePrototype(proto);
3714 if (CORRECT_SETTER) setter(O, proto);
3715 else O.__proto__ = proto;
3716 return O;
3717 };
3718}() : undefined);
3719
3720
3721/***/ }),
3722/* 93 */
3723/***/ (function(module, exports) {
3724
3725module.exports = {};
3726
3727
3728/***/ }),
3729/* 94 */
3730/***/ (function(module, exports, __webpack_require__) {
3731
3732var classof = __webpack_require__(47);
3733var getMethod = __webpack_require__(110);
3734var Iterators = __webpack_require__(46);
3735var wellKnownSymbol = __webpack_require__(5);
3736
3737var ITERATOR = wellKnownSymbol('iterator');
3738
3739module.exports = function (it) {
3740 if (it != undefined) return getMethod(it, ITERATOR)
3741 || getMethod(it, '@@iterator')
3742 || Iterators[classof(it)];
3743};
3744
3745
3746/***/ }),
3747/* 95 */
3748/***/ (function(module, exports, __webpack_require__) {
3749
3750var NATIVE_WEAK_MAP = __webpack_require__(264);
3751var global = __webpack_require__(9);
3752var uncurryThis = __webpack_require__(4);
3753var isObject = __webpack_require__(17);
3754var createNonEnumerableProperty = __webpack_require__(39);
3755var hasOwn = __webpack_require__(13);
3756var shared = __webpack_require__(111);
3757var sharedKey = __webpack_require__(91);
3758var hiddenKeys = __webpack_require__(93);
3759
3760var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
3761var TypeError = global.TypeError;
3762var WeakMap = global.WeakMap;
3763var set, get, has;
3764
3765var enforce = function (it) {
3766 return has(it) ? get(it) : set(it, {});
3767};
3768
3769var getterFor = function (TYPE) {
3770 return function (it) {
3771 var state;
3772 if (!isObject(it) || (state = get(it)).type !== TYPE) {
3773 throw TypeError('Incompatible receiver, ' + TYPE + ' required');
3774 } return state;
3775 };
3776};
3777
3778if (NATIVE_WEAK_MAP || shared.state) {
3779 var store = shared.state || (shared.state = new WeakMap());
3780 var wmget = uncurryThis(store.get);
3781 var wmhas = uncurryThis(store.has);
3782 var wmset = uncurryThis(store.set);
3783 set = function (it, metadata) {
3784 if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
3785 metadata.facade = it;
3786 wmset(store, it, metadata);
3787 return metadata;
3788 };
3789 get = function (it) {
3790 return wmget(store, it) || {};
3791 };
3792 has = function (it) {
3793 return wmhas(store, it);
3794 };
3795} else {
3796 var STATE = sharedKey('state');
3797 hiddenKeys[STATE] = true;
3798 set = function (it, metadata) {
3799 if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
3800 metadata.facade = it;
3801 createNonEnumerableProperty(it, STATE, metadata);
3802 return metadata;
3803 };
3804 get = function (it) {
3805 return hasOwn(it, STATE) ? it[STATE] : {};
3806 };
3807 has = function (it) {
3808 return hasOwn(it, STATE);
3809 };
3810}
3811
3812module.exports = {
3813 set: set,
3814 get: get,
3815 has: has,
3816 enforce: enforce,
3817 getterFor: getterFor
3818};
3819
3820
3821/***/ }),
3822/* 96 */
3823/***/ (function(module, exports) {
3824
3825// empty
3826
3827
3828/***/ }),
3829/* 97 */
3830/***/ (function(module, exports, __webpack_require__) {
3831
3832var classof = __webpack_require__(54);
3833var global = __webpack_require__(9);
3834
3835module.exports = classof(global.process) == 'process';
3836
3837
3838/***/ }),
3839/* 98 */
3840/***/ (function(module, exports, __webpack_require__) {
3841
3842var uncurryThis = __webpack_require__(4);
3843var fails = __webpack_require__(3);
3844var isCallable = __webpack_require__(8);
3845var classof = __webpack_require__(47);
3846var getBuiltIn = __webpack_require__(18);
3847var inspectSource = __webpack_require__(123);
3848
3849var noop = function () { /* empty */ };
3850var empty = [];
3851var construct = getBuiltIn('Reflect', 'construct');
3852var constructorRegExp = /^\s*(?:class|function)\b/;
3853var exec = uncurryThis(constructorRegExp.exec);
3854var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
3855
3856var isConstructorModern = function isConstructor(argument) {
3857 if (!isCallable(argument)) return false;
3858 try {
3859 construct(noop, empty, argument);
3860 return true;
3861 } catch (error) {
3862 return false;
3863 }
3864};
3865
3866var isConstructorLegacy = function isConstructor(argument) {
3867 if (!isCallable(argument)) return false;
3868 switch (classof(argument)) {
3869 case 'AsyncFunction':
3870 case 'GeneratorFunction':
3871 case 'AsyncGeneratorFunction': return false;
3872 }
3873 try {
3874 // we can't check .prototype since constructors produced by .bind haven't it
3875 // `Function#toString` throws on some built-it function in some legacy engines
3876 // (for example, `DOMQuad` and similar in FF41-)
3877 return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
3878 } catch (error) {
3879 return true;
3880 }
3881};
3882
3883isConstructorLegacy.sham = true;
3884
3885// `IsConstructor` abstract operation
3886// https://tc39.es/ecma262/#sec-isconstructor
3887module.exports = !construct || fails(function () {
3888 var called;
3889 return isConstructorModern(isConstructorModern.call)
3890 || !isConstructorModern(Object)
3891 || !isConstructorModern(function () { called = true; })
3892 || called;
3893}) ? isConstructorLegacy : isConstructorModern;
3894
3895
3896/***/ }),
3897/* 99 */
3898/***/ (function(module, exports, __webpack_require__) {
3899
3900var uncurryThis = __webpack_require__(4);
3901
3902module.exports = uncurryThis([].slice);
3903
3904
3905/***/ }),
3906/* 100 */
3907/***/ (function(module, __webpack_exports__, __webpack_require__) {
3908
3909"use strict";
3910/* harmony export (immutable) */ __webpack_exports__["a"] = matcher;
3911/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__extendOwn_js__ = __webpack_require__(131);
3912/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isMatch_js__ = __webpack_require__(178);
3913
3914
3915
3916// Returns a predicate for checking whether an object has a given set of
3917// `key:value` pairs.
3918function matcher(attrs) {
3919 attrs = Object(__WEBPACK_IMPORTED_MODULE_0__extendOwn_js__["a" /* default */])({}, attrs);
3920 return function(obj) {
3921 return Object(__WEBPACK_IMPORTED_MODULE_1__isMatch_js__["a" /* default */])(obj, attrs);
3922 };
3923}
3924
3925
3926/***/ }),
3927/* 101 */
3928/***/ (function(module, __webpack_exports__, __webpack_require__) {
3929
3930"use strict";
3931/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
3932/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__executeBound_js__ = __webpack_require__(194);
3933/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(23);
3934
3935
3936
3937
3938// Partially apply a function by creating a version that has had some of its
3939// arguments pre-filled, without changing its dynamic `this` context. `_` acts
3940// as a placeholder by default, allowing any combination of arguments to be
3941// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
3942var partial = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, boundArgs) {
3943 var placeholder = partial.placeholder;
3944 var bound = function() {
3945 var position = 0, length = boundArgs.length;
3946 var args = Array(length);
3947 for (var i = 0; i < length; i++) {
3948 args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
3949 }
3950 while (position < arguments.length) args.push(arguments[position++]);
3951 return Object(__WEBPACK_IMPORTED_MODULE_1__executeBound_js__["a" /* default */])(func, bound, this, this, args);
3952 };
3953 return bound;
3954});
3955
3956partial.placeholder = __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */];
3957/* harmony default export */ __webpack_exports__["a"] = (partial);
3958
3959
3960/***/ }),
3961/* 102 */
3962/***/ (function(module, __webpack_exports__, __webpack_require__) {
3963
3964"use strict";
3965/* harmony export (immutable) */ __webpack_exports__["a"] = group;
3966/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(19);
3967/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(52);
3968
3969
3970
3971// An internal function used for aggregate "group by" operations.
3972function group(behavior, partition) {
3973 return function(obj, iteratee, context) {
3974 var result = partition ? [[], []] : {};
3975 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
3976 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index) {
3977 var key = iteratee(value, index, obj);
3978 behavior(result, value, key);
3979 });
3980 return result;
3981 };
3982}
3983
3984
3985/***/ }),
3986/* 103 */
3987/***/ (function(module, exports, __webpack_require__) {
3988
3989"use strict";
3990
3991var toPropertyKey = __webpack_require__(88);
3992var definePropertyModule = __webpack_require__(34);
3993var createPropertyDescriptor = __webpack_require__(44);
3994
3995module.exports = function (object, key, value) {
3996 var propertyKey = toPropertyKey(key);
3997 if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
3998 else object[propertyKey] = value;
3999};
4000
4001
4002/***/ }),
4003/* 104 */
4004/***/ (function(module, exports, __webpack_require__) {
4005
4006var fails = __webpack_require__(3);
4007var wellKnownSymbol = __webpack_require__(5);
4008var V8_VERSION = __webpack_require__(56);
4009
4010var SPECIES = wellKnownSymbol('species');
4011
4012module.exports = function (METHOD_NAME) {
4013 // We can't use this feature detection in V8 since it causes
4014 // deoptimization and serious performance degradation
4015 // https://github.com/zloirock/core-js/issues/677
4016 return V8_VERSION >= 51 || !fails(function () {
4017 var array = [];
4018 var constructor = array.constructor = {};
4019 constructor[SPECIES] = function () {
4020 return { foo: 1 };
4021 };
4022 return array[METHOD_NAME](Boolean).foo !== 1;
4023 });
4024};
4025
4026
4027/***/ }),
4028/* 105 */
4029/***/ (function(module, exports, __webpack_require__) {
4030
4031var bind = __webpack_require__(58);
4032var uncurryThis = __webpack_require__(4);
4033var IndexedObject = __webpack_require__(109);
4034var toObject = __webpack_require__(33);
4035var lengthOfArrayLike = __webpack_require__(36);
4036var arraySpeciesCreate = __webpack_require__(216);
4037
4038var push = uncurryThis([].push);
4039
4040// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
4041var createMethod = function (TYPE) {
4042 var IS_MAP = TYPE == 1;
4043 var IS_FILTER = TYPE == 2;
4044 var IS_SOME = TYPE == 3;
4045 var IS_EVERY = TYPE == 4;
4046 var IS_FIND_INDEX = TYPE == 6;
4047 var IS_FILTER_REJECT = TYPE == 7;
4048 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
4049 return function ($this, callbackfn, that, specificCreate) {
4050 var O = toObject($this);
4051 var self = IndexedObject(O);
4052 var boundFunction = bind(callbackfn, that);
4053 var length = lengthOfArrayLike(self);
4054 var index = 0;
4055 var create = specificCreate || arraySpeciesCreate;
4056 var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
4057 var value, result;
4058 for (;length > index; index++) if (NO_HOLES || index in self) {
4059 value = self[index];
4060 result = boundFunction(value, index, O);
4061 if (TYPE) {
4062 if (IS_MAP) target[index] = result; // map
4063 else if (result) switch (TYPE) {
4064 case 3: return true; // some
4065 case 5: return value; // find
4066 case 6: return index; // findIndex
4067 case 2: push(target, value); // filter
4068 } else switch (TYPE) {
4069 case 4: return false; // every
4070 case 7: push(target, value); // filterReject
4071 }
4072 }
4073 }
4074 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
4075 };
4076};
4077
4078module.exports = {
4079 // `Array.prototype.forEach` method
4080 // https://tc39.es/ecma262/#sec-array.prototype.foreach
4081 forEach: createMethod(0),
4082 // `Array.prototype.map` method
4083 // https://tc39.es/ecma262/#sec-array.prototype.map
4084 map: createMethod(1),
4085 // `Array.prototype.filter` method
4086 // https://tc39.es/ecma262/#sec-array.prototype.filter
4087 filter: createMethod(2),
4088 // `Array.prototype.some` method
4089 // https://tc39.es/ecma262/#sec-array.prototype.some
4090 some: createMethod(3),
4091 // `Array.prototype.every` method
4092 // https://tc39.es/ecma262/#sec-array.prototype.every
4093 every: createMethod(4),
4094 // `Array.prototype.find` method
4095 // https://tc39.es/ecma262/#sec-array.prototype.find
4096 find: createMethod(5),
4097 // `Array.prototype.findIndex` method
4098 // https://tc39.es/ecma262/#sec-array.prototype.findIndex
4099 findIndex: createMethod(6),
4100 // `Array.prototype.filterReject` method
4101 // https://github.com/tc39/proposal-array-filtering
4102 filterReject: createMethod(7)
4103};
4104
4105
4106/***/ }),
4107/* 106 */
4108/***/ (function(module, exports, __webpack_require__) {
4109
4110"use strict";
4111
4112
4113var _interopRequireDefault = __webpack_require__(1);
4114
4115var _typeof2 = _interopRequireDefault(__webpack_require__(141));
4116
4117var _filter = _interopRequireDefault(__webpack_require__(436));
4118
4119var _map = _interopRequireDefault(__webpack_require__(42));
4120
4121var _keys = _interopRequireDefault(__webpack_require__(217));
4122
4123var _stringify = _interopRequireDefault(__webpack_require__(37));
4124
4125var _concat = _interopRequireDefault(__webpack_require__(25));
4126
4127var _ = __webpack_require__(2);
4128
4129var _require = __webpack_require__(441),
4130 timeout = _require.timeout;
4131
4132var debug = __webpack_require__(69);
4133
4134var debugRequest = debug('leancloud:request');
4135var debugRequestError = debug('leancloud:request:error');
4136
4137var _require2 = __webpack_require__(70),
4138 getAdapter = _require2.getAdapter;
4139
4140var requestsCount = 0;
4141
4142var ajax = function ajax(_ref) {
4143 var method = _ref.method,
4144 url = _ref.url,
4145 query = _ref.query,
4146 data = _ref.data,
4147 _ref$headers = _ref.headers,
4148 headers = _ref$headers === void 0 ? {} : _ref$headers,
4149 time = _ref.timeout,
4150 onprogress = _ref.onprogress;
4151
4152 if (query) {
4153 var _context, _context2, _context4;
4154
4155 var queryString = (0, _filter.default)(_context = (0, _map.default)(_context2 = (0, _keys.default)(query)).call(_context2, function (key) {
4156 var _context3;
4157
4158 var value = query[key];
4159 if (value === undefined) return undefined;
4160 var v = (0, _typeof2.default)(value) === 'object' ? (0, _stringify.default)(value) : value;
4161 return (0, _concat.default)(_context3 = "".concat(encodeURIComponent(key), "=")).call(_context3, encodeURIComponent(v));
4162 })).call(_context, function (qs) {
4163 return qs;
4164 }).join('&');
4165 url = (0, _concat.default)(_context4 = "".concat(url, "?")).call(_context4, queryString);
4166 }
4167
4168 var count = requestsCount++;
4169 debugRequest('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
4170 var request = getAdapter('request');
4171 var promise = request(url, {
4172 method: method,
4173 headers: headers,
4174 data: data,
4175 onprogress: onprogress
4176 }).then(function (response) {
4177 debugRequest('response(%d) %d %O %o', count, response.status, response.data || response.text, response.header);
4178
4179 if (response.ok === false) {
4180 var error = new Error();
4181 error.response = response;
4182 throw error;
4183 }
4184
4185 return response.data;
4186 }).catch(function (error) {
4187 if (error.response) {
4188 if (!debug.enabled('leancloud:request')) {
4189 debugRequestError('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
4190 }
4191
4192 debugRequestError('response(%d) %d %O %o', count, error.response.status, error.response.data || error.response.text, error.response.header);
4193 error.statusCode = error.response.status;
4194 error.responseText = error.response.text;
4195 error.response = error.response.data;
4196 }
4197
4198 throw error;
4199 });
4200 return time ? timeout(promise, time) : promise;
4201};
4202
4203module.exports = ajax;
4204
4205/***/ }),
4206/* 107 */
4207/***/ (function(module, exports, __webpack_require__) {
4208
4209module.exports = __webpack_require__(446);
4210
4211/***/ }),
4212/* 108 */
4213/***/ (function(module, exports) {
4214
4215var g;
4216
4217// This works in non-strict mode
4218g = (function() {
4219 return this;
4220})();
4221
4222try {
4223 // This works if eval is allowed (see CSP)
4224 g = g || Function("return this")() || (1,eval)("this");
4225} catch(e) {
4226 // This works if the window reference is available
4227 if(typeof window === "object")
4228 g = window;
4229}
4230
4231// g can still be undefined, but nothing to do about it...
4232// We return undefined, instead of nothing here, so it's
4233// easier to handle this case. if(!global) { ...}
4234
4235module.exports = g;
4236
4237
4238/***/ }),
4239/* 109 */
4240/***/ (function(module, exports, __webpack_require__) {
4241
4242var uncurryThis = __webpack_require__(4);
4243var fails = __webpack_require__(3);
4244var classof = __webpack_require__(54);
4245
4246var $Object = Object;
4247var split = uncurryThis(''.split);
4248
4249// fallback for non-array-like ES3 and non-enumerable old V8 strings
4250module.exports = fails(function () {
4251 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
4252 // eslint-disable-next-line no-prototype-builtins -- safe
4253 return !$Object('z').propertyIsEnumerable(0);
4254}) ? function (it) {
4255 return classof(it) == 'String' ? split(it, '') : $Object(it);
4256} : $Object;
4257
4258
4259/***/ }),
4260/* 110 */
4261/***/ (function(module, exports, __webpack_require__) {
4262
4263var aCallable = __webpack_require__(28);
4264
4265// `GetMethod` abstract operation
4266// https://tc39.es/ecma262/#sec-getmethod
4267module.exports = function (V, P) {
4268 var func = V[P];
4269 return func == null ? undefined : aCallable(func);
4270};
4271
4272
4273/***/ }),
4274/* 111 */
4275/***/ (function(module, exports, __webpack_require__) {
4276
4277var global = __webpack_require__(9);
4278var defineGlobalProperty = __webpack_require__(254);
4279
4280var SHARED = '__core-js_shared__';
4281var store = global[SHARED] || defineGlobalProperty(SHARED, {});
4282
4283module.exports = store;
4284
4285
4286/***/ }),
4287/* 112 */
4288/***/ (function(module, exports, __webpack_require__) {
4289
4290var uncurryThis = __webpack_require__(4);
4291
4292var id = 0;
4293var postfix = Math.random();
4294var toString = uncurryThis(1.0.toString);
4295
4296module.exports = function (key) {
4297 return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
4298};
4299
4300
4301/***/ }),
4302/* 113 */
4303/***/ (function(module, exports, __webpack_require__) {
4304
4305var global = __webpack_require__(9);
4306var isObject = __webpack_require__(17);
4307
4308var document = global.document;
4309// typeof document.createElement is 'object' in old IE
4310var EXISTS = isObject(document) && isObject(document.createElement);
4311
4312module.exports = function (it) {
4313 return EXISTS ? document.createElement(it) : {};
4314};
4315
4316
4317/***/ }),
4318/* 114 */
4319/***/ (function(module, exports, __webpack_require__) {
4320
4321var internalObjectKeys = __webpack_require__(151);
4322var enumBugKeys = __webpack_require__(118);
4323
4324var hiddenKeys = enumBugKeys.concat('length', 'prototype');
4325
4326// `Object.getOwnPropertyNames` method
4327// https://tc39.es/ecma262/#sec-object.getownpropertynames
4328// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
4329exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
4330 return internalObjectKeys(O, hiddenKeys);
4331};
4332
4333
4334/***/ }),
4335/* 115 */
4336/***/ (function(module, exports, __webpack_require__) {
4337
4338var toIndexedObject = __webpack_require__(35);
4339var toAbsoluteIndex = __webpack_require__(116);
4340var lengthOfArrayLike = __webpack_require__(36);
4341
4342// `Array.prototype.{ indexOf, includes }` methods implementation
4343var createMethod = function (IS_INCLUDES) {
4344 return function ($this, el, fromIndex) {
4345 var O = toIndexedObject($this);
4346 var length = lengthOfArrayLike(O);
4347 var index = toAbsoluteIndex(fromIndex, length);
4348 var value;
4349 // Array#includes uses SameValueZero equality algorithm
4350 // eslint-disable-next-line no-self-compare -- NaN check
4351 if (IS_INCLUDES && el != el) while (length > index) {
4352 value = O[index++];
4353 // eslint-disable-next-line no-self-compare -- NaN check
4354 if (value != value) return true;
4355 // Array#indexOf ignores holes, Array#includes - not
4356 } else for (;length > index; index++) {
4357 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
4358 } return !IS_INCLUDES && -1;
4359 };
4360};
4361
4362module.exports = {
4363 // `Array.prototype.includes` method
4364 // https://tc39.es/ecma262/#sec-array.prototype.includes
4365 includes: createMethod(true),
4366 // `Array.prototype.indexOf` method
4367 // https://tc39.es/ecma262/#sec-array.prototype.indexof
4368 indexOf: createMethod(false)
4369};
4370
4371
4372/***/ }),
4373/* 116 */
4374/***/ (function(module, exports, __webpack_require__) {
4375
4376var toIntegerOrInfinity = __webpack_require__(117);
4377
4378var max = Math.max;
4379var min = Math.min;
4380
4381// Helper for a popular repeating case of the spec:
4382// Let integer be ? ToInteger(index).
4383// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
4384module.exports = function (index, length) {
4385 var integer = toIntegerOrInfinity(index);
4386 return integer < 0 ? max(integer + length, 0) : min(integer, length);
4387};
4388
4389
4390/***/ }),
4391/* 117 */
4392/***/ (function(module, exports, __webpack_require__) {
4393
4394var trunc = __webpack_require__(258);
4395
4396// `ToIntegerOrInfinity` abstract operation
4397// https://tc39.es/ecma262/#sec-tointegerorinfinity
4398module.exports = function (argument) {
4399 var number = +argument;
4400 // eslint-disable-next-line no-self-compare -- NaN check
4401 return number !== number || number === 0 ? 0 : trunc(number);
4402};
4403
4404
4405/***/ }),
4406/* 118 */
4407/***/ (function(module, exports) {
4408
4409// IE8- don't enum bug keys
4410module.exports = [
4411 'constructor',
4412 'hasOwnProperty',
4413 'isPrototypeOf',
4414 'propertyIsEnumerable',
4415 'toLocaleString',
4416 'toString',
4417 'valueOf'
4418];
4419
4420
4421/***/ }),
4422/* 119 */
4423/***/ (function(module, exports) {
4424
4425// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
4426exports.f = Object.getOwnPropertySymbols;
4427
4428
4429/***/ }),
4430/* 120 */
4431/***/ (function(module, exports, __webpack_require__) {
4432
4433var internalObjectKeys = __webpack_require__(151);
4434var enumBugKeys = __webpack_require__(118);
4435
4436// `Object.keys` method
4437// https://tc39.es/ecma262/#sec-object.keys
4438// eslint-disable-next-line es-x/no-object-keys -- safe
4439module.exports = Object.keys || function keys(O) {
4440 return internalObjectKeys(O, enumBugKeys);
4441};
4442
4443
4444/***/ }),
4445/* 121 */
4446/***/ (function(module, exports, __webpack_require__) {
4447
4448var wellKnownSymbol = __webpack_require__(5);
4449
4450var TO_STRING_TAG = wellKnownSymbol('toStringTag');
4451var test = {};
4452
4453test[TO_STRING_TAG] = 'z';
4454
4455module.exports = String(test) === '[object z]';
4456
4457
4458/***/ }),
4459/* 122 */
4460/***/ (function(module, exports) {
4461
4462module.exports = function () { /* empty */ };
4463
4464
4465/***/ }),
4466/* 123 */
4467/***/ (function(module, exports, __webpack_require__) {
4468
4469var uncurryThis = __webpack_require__(4);
4470var isCallable = __webpack_require__(8);
4471var store = __webpack_require__(111);
4472
4473var functionToString = uncurryThis(Function.toString);
4474
4475// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
4476if (!isCallable(store.inspectSource)) {
4477 store.inspectSource = function (it) {
4478 return functionToString(it);
4479 };
4480}
4481
4482module.exports = store.inspectSource;
4483
4484
4485/***/ }),
4486/* 124 */
4487/***/ (function(module, __webpack_exports__, __webpack_require__) {
4488
4489"use strict";
4490Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
4491/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
4492/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__setup_js__["e"]; });
4493/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__restArguments_js__ = __webpack_require__(22);
4494/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__restArguments_js__["a"]; });
4495/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(50);
4496/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_2__isObject_js__["a"]; });
4497/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isNull_js__ = __webpack_require__(289);
4498/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_3__isNull_js__["a"]; });
4499/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__ = __webpack_require__(167);
4500/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__["a"]; });
4501/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__ = __webpack_require__(168);
4502/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__["a"]; });
4503/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isElement_js__ = __webpack_require__(290);
4504/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_6__isElement_js__["a"]; });
4505/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isString_js__ = __webpack_require__(125);
4506/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_7__isString_js__["a"]; });
4507/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__isNumber_js__ = __webpack_require__(169);
4508/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_8__isNumber_js__["a"]; });
4509/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__isDate_js__ = __webpack_require__(291);
4510/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_9__isDate_js__["a"]; });
4511/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__ = __webpack_require__(292);
4512/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__["a"]; });
4513/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__isError_js__ = __webpack_require__(293);
4514/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_11__isError_js__["a"]; });
4515/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__ = __webpack_require__(170);
4516/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__["a"]; });
4517/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__ = __webpack_require__(171);
4518/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__["a"]; });
4519/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__isDataView_js__ = __webpack_require__(126);
4520/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_14__isDataView_js__["a"]; });
4521/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__isArray_js__ = __webpack_require__(51);
4522/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_15__isArray_js__["a"]; });
4523/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__isFunction_js__ = __webpack_require__(29);
4524/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_16__isFunction_js__["a"]; });
4525/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__isArguments_js__ = __webpack_require__(127);
4526/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_17__isArguments_js__["a"]; });
4527/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__isFinite_js__ = __webpack_require__(295);
4528/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_18__isFinite_js__["a"]; });
4529/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isNaN_js__ = __webpack_require__(172);
4530/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_19__isNaN_js__["a"]; });
4531/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__ = __webpack_require__(173);
4532/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__["a"]; });
4533/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__ = __webpack_require__(297);
4534/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__["a"]; });
4535/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__isMatch_js__ = __webpack_require__(178);
4536/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_22__isMatch_js__["a"]; });
4537/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__isEqual_js__ = __webpack_require__(298);
4538/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_23__isEqual_js__["a"]; });
4539/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__isMap_js__ = __webpack_require__(300);
4540/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_24__isMap_js__["a"]; });
4541/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__ = __webpack_require__(301);
4542/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__["a"]; });
4543/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__isSet_js__ = __webpack_require__(302);
4544/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_26__isSet_js__["a"]; });
4545/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__ = __webpack_require__(303);
4546/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__["a"]; });
4547/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__keys_js__ = __webpack_require__(14);
4548/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_28__keys_js__["a"]; });
4549/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__allKeys_js__ = __webpack_require__(81);
4550/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_29__allKeys_js__["a"]; });
4551/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__values_js__ = __webpack_require__(64);
4552/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_30__values_js__["a"]; });
4553/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__pairs_js__ = __webpack_require__(304);
4554/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_31__pairs_js__["a"]; });
4555/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__invert_js__ = __webpack_require__(179);
4556/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_32__invert_js__["a"]; });
4557/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__functions_js__ = __webpack_require__(180);
4558/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
4559/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
4560/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__extend_js__ = __webpack_require__(181);
4561/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_34__extend_js__["a"]; });
4562/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__ = __webpack_require__(131);
4563/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
4564/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
4565/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__defaults_js__ = __webpack_require__(182);
4566/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_36__defaults_js__["a"]; });
4567/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__create_js__ = __webpack_require__(305);
4568/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_37__create_js__["a"]; });
4569/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__clone_js__ = __webpack_require__(184);
4570/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_38__clone_js__["a"]; });
4571/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__tap_js__ = __webpack_require__(306);
4572/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_39__tap_js__["a"]; });
4573/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__get_js__ = __webpack_require__(185);
4574/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_40__get_js__["a"]; });
4575/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__has_js__ = __webpack_require__(307);
4576/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_41__has_js__["a"]; });
4577/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__mapObject_js__ = __webpack_require__(308);
4578/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_42__mapObject_js__["a"]; });
4579/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__identity_js__ = __webpack_require__(133);
4580/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_43__identity_js__["a"]; });
4581/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__constant_js__ = __webpack_require__(174);
4582/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_44__constant_js__["a"]; });
4583/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__noop_js__ = __webpack_require__(189);
4584/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_45__noop_js__["a"]; });
4585/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__toPath_js__ = __webpack_require__(186);
4586/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_46__toPath_js__["a"]; });
4587/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__property_js__ = __webpack_require__(134);
4588/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_47__property_js__["a"]; });
4589/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__ = __webpack_require__(309);
4590/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__["a"]; });
4591/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__matcher_js__ = __webpack_require__(100);
4592/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
4593/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
4594/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__times_js__ = __webpack_require__(310);
4595/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_50__times_js__["a"]; });
4596/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__random_js__ = __webpack_require__(190);
4597/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_51__random_js__["a"]; });
4598/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__now_js__ = __webpack_require__(135);
4599/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_52__now_js__["a"]; });
4600/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__escape_js__ = __webpack_require__(311);
4601/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_53__escape_js__["a"]; });
4602/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__unescape_js__ = __webpack_require__(312);
4603/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_54__unescape_js__["a"]; });
4604/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__ = __webpack_require__(193);
4605/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__["a"]; });
4606/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__template_js__ = __webpack_require__(314);
4607/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_56__template_js__["a"]; });
4608/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__result_js__ = __webpack_require__(315);
4609/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_57__result_js__["a"]; });
4610/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__ = __webpack_require__(316);
4611/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__["a"]; });
4612/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__chain_js__ = __webpack_require__(317);
4613/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_59__chain_js__["a"]; });
4614/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__iteratee_js__ = __webpack_require__(188);
4615/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_60__iteratee_js__["a"]; });
4616/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__partial_js__ = __webpack_require__(101);
4617/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_61__partial_js__["a"]; });
4618/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__bind_js__ = __webpack_require__(195);
4619/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_62__bind_js__["a"]; });
4620/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__bindAll_js__ = __webpack_require__(318);
4621/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_63__bindAll_js__["a"]; });
4622/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__memoize_js__ = __webpack_require__(319);
4623/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_64__memoize_js__["a"]; });
4624/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__delay_js__ = __webpack_require__(196);
4625/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_65__delay_js__["a"]; });
4626/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__defer_js__ = __webpack_require__(320);
4627/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_66__defer_js__["a"]; });
4628/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__throttle_js__ = __webpack_require__(321);
4629/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_67__throttle_js__["a"]; });
4630/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__debounce_js__ = __webpack_require__(322);
4631/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_68__debounce_js__["a"]; });
4632/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__wrap_js__ = __webpack_require__(323);
4633/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_69__wrap_js__["a"]; });
4634/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__negate_js__ = __webpack_require__(136);
4635/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_70__negate_js__["a"]; });
4636/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__compose_js__ = __webpack_require__(324);
4637/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_71__compose_js__["a"]; });
4638/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__after_js__ = __webpack_require__(325);
4639/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_72__after_js__["a"]; });
4640/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__before_js__ = __webpack_require__(197);
4641/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_73__before_js__["a"]; });
4642/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__once_js__ = __webpack_require__(326);
4643/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_74__once_js__["a"]; });
4644/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__findKey_js__ = __webpack_require__(198);
4645/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_75__findKey_js__["a"]; });
4646/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__findIndex_js__ = __webpack_require__(137);
4647/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_76__findIndex_js__["a"]; });
4648/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__ = __webpack_require__(200);
4649/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__["a"]; });
4650/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__ = __webpack_require__(201);
4651/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__["a"]; });
4652/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__indexOf_js__ = __webpack_require__(202);
4653/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_79__indexOf_js__["a"]; });
4654/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__ = __webpack_require__(327);
4655/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__["a"]; });
4656/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__find_js__ = __webpack_require__(204);
4657/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
4658/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
4659/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__findWhere_js__ = __webpack_require__(328);
4660/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_82__findWhere_js__["a"]; });
4661/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__each_js__ = __webpack_require__(52);
4662/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
4663/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
4664/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__map_js__ = __webpack_require__(66);
4665/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
4666/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
4667/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__reduce_js__ = __webpack_require__(329);
4668/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4669/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4670/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4671/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__ = __webpack_require__(330);
4672/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
4673/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
4674/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__filter_js__ = __webpack_require__(84);
4675/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
4676/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
4677/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__reject_js__ = __webpack_require__(331);
4678/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_88__reject_js__["a"]; });
4679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__every_js__ = __webpack_require__(332);
4680/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
4681/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
4682/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__some_js__ = __webpack_require__(333);
4683/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
4684/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
4685/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__contains_js__ = __webpack_require__(85);
4686/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4687/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4688/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4689/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__invoke_js__ = __webpack_require__(334);
4690/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_92__invoke_js__["a"]; });
4691/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__pluck_js__ = __webpack_require__(138);
4692/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_93__pluck_js__["a"]; });
4693/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__where_js__ = __webpack_require__(335);
4694/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_94__where_js__["a"]; });
4695/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__max_js__ = __webpack_require__(206);
4696/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_95__max_js__["a"]; });
4697/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__min_js__ = __webpack_require__(336);
4698/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_96__min_js__["a"]; });
4699/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__shuffle_js__ = __webpack_require__(337);
4700/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_97__shuffle_js__["a"]; });
4701/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__sample_js__ = __webpack_require__(207);
4702/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_98__sample_js__["a"]; });
4703/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__sortBy_js__ = __webpack_require__(338);
4704/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_99__sortBy_js__["a"]; });
4705/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__groupBy_js__ = __webpack_require__(339);
4706/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_100__groupBy_js__["a"]; });
4707/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__indexBy_js__ = __webpack_require__(340);
4708/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_101__indexBy_js__["a"]; });
4709/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__countBy_js__ = __webpack_require__(341);
4710/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_102__countBy_js__["a"]; });
4711/* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__partition_js__ = __webpack_require__(342);
4712/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_103__partition_js__["a"]; });
4713/* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__toArray_js__ = __webpack_require__(343);
4714/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_104__toArray_js__["a"]; });
4715/* harmony import */ var __WEBPACK_IMPORTED_MODULE_105__size_js__ = __webpack_require__(344);
4716/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_105__size_js__["a"]; });
4717/* harmony import */ var __WEBPACK_IMPORTED_MODULE_106__pick_js__ = __webpack_require__(208);
4718/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_106__pick_js__["a"]; });
4719/* harmony import */ var __WEBPACK_IMPORTED_MODULE_107__omit_js__ = __webpack_require__(346);
4720/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_107__omit_js__["a"]; });
4721/* harmony import */ var __WEBPACK_IMPORTED_MODULE_108__first_js__ = __webpack_require__(347);
4722/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4723/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4724/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4725/* harmony import */ var __WEBPACK_IMPORTED_MODULE_109__initial_js__ = __webpack_require__(209);
4726/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_109__initial_js__["a"]; });
4727/* harmony import */ var __WEBPACK_IMPORTED_MODULE_110__last_js__ = __webpack_require__(348);
4728/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_110__last_js__["a"]; });
4729/* harmony import */ var __WEBPACK_IMPORTED_MODULE_111__rest_js__ = __webpack_require__(210);
4730/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4731/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4732/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4733/* harmony import */ var __WEBPACK_IMPORTED_MODULE_112__compact_js__ = __webpack_require__(349);
4734/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_112__compact_js__["a"]; });
4735/* harmony import */ var __WEBPACK_IMPORTED_MODULE_113__flatten_js__ = __webpack_require__(350);
4736/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_113__flatten_js__["a"]; });
4737/* harmony import */ var __WEBPACK_IMPORTED_MODULE_114__without_js__ = __webpack_require__(351);
4738/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_114__without_js__["a"]; });
4739/* harmony import */ var __WEBPACK_IMPORTED_MODULE_115__uniq_js__ = __webpack_require__(212);
4740/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
4741/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
4742/* harmony import */ var __WEBPACK_IMPORTED_MODULE_116__union_js__ = __webpack_require__(352);
4743/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_116__union_js__["a"]; });
4744/* harmony import */ var __WEBPACK_IMPORTED_MODULE_117__intersection_js__ = __webpack_require__(353);
4745/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_117__intersection_js__["a"]; });
4746/* harmony import */ var __WEBPACK_IMPORTED_MODULE_118__difference_js__ = __webpack_require__(211);
4747/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_118__difference_js__["a"]; });
4748/* harmony import */ var __WEBPACK_IMPORTED_MODULE_119__unzip_js__ = __webpack_require__(213);
4749/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
4750/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
4751/* harmony import */ var __WEBPACK_IMPORTED_MODULE_120__zip_js__ = __webpack_require__(354);
4752/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_120__zip_js__["a"]; });
4753/* harmony import */ var __WEBPACK_IMPORTED_MODULE_121__object_js__ = __webpack_require__(355);
4754/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_121__object_js__["a"]; });
4755/* harmony import */ var __WEBPACK_IMPORTED_MODULE_122__range_js__ = __webpack_require__(356);
4756/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_122__range_js__["a"]; });
4757/* harmony import */ var __WEBPACK_IMPORTED_MODULE_123__chunk_js__ = __webpack_require__(357);
4758/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_123__chunk_js__["a"]; });
4759/* harmony import */ var __WEBPACK_IMPORTED_MODULE_124__mixin_js__ = __webpack_require__(358);
4760/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_124__mixin_js__["a"]; });
4761/* harmony import */ var __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__ = __webpack_require__(359);
4762/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__["a"]; });
4763// Named Exports
4764// =============
4765
4766// Underscore.js 1.12.1
4767// https://underscorejs.org
4768// (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
4769// Underscore may be freely distributed under the MIT license.
4770
4771// Baseline setup.
4772
4773
4774
4775// Object Functions
4776// ----------------
4777// Our most fundamental functions operate on any JavaScript object.
4778// Most functions in Underscore depend on at least one function in this section.
4779
4780// A group of functions that check the types of core JavaScript values.
4781// These are often informally referred to as the "isType" functions.
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809// Functions that treat an object as a dictionary of key-value pairs.
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826// Utility Functions
4827// -----------------
4828// A bit of a grab bag: Predicate-generating functions for use with filters and
4829// loops, string escaping and templating, create random numbers and unique ids,
4830// and functions that facilitate Underscore's chaining and iteration conventions.
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850// Function (ahem) Functions
4851// -------------------------
4852// These functions take a function as an argument and return a new function
4853// as the result. Also known as higher-order functions.
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869// Finders
4870// -------
4871// Functions that extract (the position of) a single element from an object
4872// or array based on some criterion.
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882// Collection Functions
4883// --------------------
4884// Functions that work on any collection of elements: either an array, or
4885// an object of key-value pairs.
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910// `_.pick` and `_.omit` are actually object functions, but we put
4911// them here in order to create a more natural reading order in the
4912// monolithic build as they depend on `_.contains`.
4913
4914
4915
4916// Array Functions
4917// ---------------
4918// Functions that operate on arrays (and array-likes) only, because they’re
4919// expressed in terms of operations on an ordered list of values.
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937// OOP
4938// ---
4939// These modules support the "object-oriented" calling style. See also
4940// `underscore.js` and `index-default.js`.
4941
4942
4943
4944
4945/***/ }),
4946/* 125 */
4947/***/ (function(module, __webpack_exports__, __webpack_require__) {
4948
4949"use strict";
4950/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
4951
4952
4953/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('String'));
4954
4955
4956/***/ }),
4957/* 126 */
4958/***/ (function(module, __webpack_exports__, __webpack_require__) {
4959
4960"use strict";
4961/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
4962/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(29);
4963/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__ = __webpack_require__(171);
4964/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__ = __webpack_require__(80);
4965
4966
4967
4968
4969
4970var isDataView = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('DataView');
4971
4972// In IE 10 - Edge 13, we need a different heuristic
4973// to determine whether an object is a `DataView`.
4974function ie10IsDataView(obj) {
4975 return obj != null && Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj.getInt8) && Object(__WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__["a" /* default */])(obj.buffer);
4976}
4977
4978/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__["a" /* hasStringTagBug */] ? ie10IsDataView : isDataView);
4979
4980
4981/***/ }),
4982/* 127 */
4983/***/ (function(module, __webpack_exports__, __webpack_require__) {
4984
4985"use strict";
4986/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
4987/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(41);
4988
4989
4990
4991var isArguments = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Arguments');
4992
4993// Define a fallback version of the method in browsers (ahem, IE < 9), where
4994// there isn't any inspectable "Arguments" type.
4995(function() {
4996 if (!isArguments(arguments)) {
4997 isArguments = function(obj) {
4998 return Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(obj, 'callee');
4999 };
5000 }
5001}());
5002
5003/* harmony default export */ __webpack_exports__["a"] = (isArguments);
5004
5005
5006/***/ }),
5007/* 128 */
5008/***/ (function(module, __webpack_exports__, __webpack_require__) {
5009
5010"use strict";
5011/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(176);
5012
5013
5014// Internal helper to obtain the `byteLength` property of an object.
5015/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('byteLength'));
5016
5017
5018/***/ }),
5019/* 129 */
5020/***/ (function(module, __webpack_exports__, __webpack_require__) {
5021
5022"use strict";
5023/* harmony export (immutable) */ __webpack_exports__["a"] = ie11fingerprint;
5024/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mapMethods; });
5025/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return weakMapMethods; });
5026/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setMethods; });
5027/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(30);
5028/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(29);
5029/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__allKeys_js__ = __webpack_require__(81);
5030
5031
5032
5033
5034// Since the regular `Object.prototype.toString` type tests don't work for
5035// some types in IE 11, we use a fingerprinting heuristic instead, based
5036// on the methods. It's not great, but it's the best we got.
5037// The fingerprint method lists are defined below.
5038function ie11fingerprint(methods) {
5039 var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(methods);
5040 return function(obj) {
5041 if (obj == null) return false;
5042 // `Map`, `WeakMap` and `Set` have no enumerable keys.
5043 var keys = Object(__WEBPACK_IMPORTED_MODULE_2__allKeys_js__["a" /* default */])(obj);
5044 if (Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(keys)) return false;
5045 for (var i = 0; i < length; i++) {
5046 if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[methods[i]])) return false;
5047 }
5048 // If we are testing against `WeakMap`, we need to ensure that
5049 // `obj` doesn't have a `forEach` method in order to distinguish
5050 // it from a regular `Map`.
5051 return methods !== weakMapMethods || !Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[forEachName]);
5052 };
5053}
5054
5055// In the interest of compact minification, we write
5056// each string in the fingerprints only once.
5057var forEachName = 'forEach',
5058 hasName = 'has',
5059 commonInit = ['clear', 'delete'],
5060 mapTail = ['get', hasName, 'set'];
5061
5062// `Map`, `WeakMap` and `Set` each have slightly different
5063// combinations of the above sublists.
5064var mapMethods = commonInit.concat(forEachName, mapTail),
5065 weakMapMethods = commonInit.concat(mapTail),
5066 setMethods = ['add'].concat(commonInit, forEachName, hasName);
5067
5068
5069/***/ }),
5070/* 130 */
5071/***/ (function(module, __webpack_exports__, __webpack_require__) {
5072
5073"use strict";
5074/* harmony export (immutable) */ __webpack_exports__["a"] = createAssigner;
5075// An internal function for creating assigner functions.
5076function createAssigner(keysFunc, defaults) {
5077 return function(obj) {
5078 var length = arguments.length;
5079 if (defaults) obj = Object(obj);
5080 if (length < 2 || obj == null) return obj;
5081 for (var index = 1; index < length; index++) {
5082 var source = arguments[index],
5083 keys = keysFunc(source),
5084 l = keys.length;
5085 for (var i = 0; i < l; i++) {
5086 var key = keys[i];
5087 if (!defaults || obj[key] === void 0) obj[key] = source[key];
5088 }
5089 }
5090 return obj;
5091 };
5092}
5093
5094
5095/***/ }),
5096/* 131 */
5097/***/ (function(module, __webpack_exports__, __webpack_require__) {
5098
5099"use strict";
5100/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(130);
5101/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(14);
5102
5103
5104
5105// Assigns a given object with all the own properties in the passed-in
5106// object(s).
5107// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
5108/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */]));
5109
5110
5111/***/ }),
5112/* 132 */
5113/***/ (function(module, __webpack_exports__, __webpack_require__) {
5114
5115"use strict";
5116/* harmony export (immutable) */ __webpack_exports__["a"] = deepGet;
5117// Internal function to obtain a nested property in `obj` along `path`.
5118function deepGet(obj, path) {
5119 var length = path.length;
5120 for (var i = 0; i < length; i++) {
5121 if (obj == null) return void 0;
5122 obj = obj[path[i]];
5123 }
5124 return length ? obj : void 0;
5125}
5126
5127
5128/***/ }),
5129/* 133 */
5130/***/ (function(module, __webpack_exports__, __webpack_require__) {
5131
5132"use strict";
5133/* harmony export (immutable) */ __webpack_exports__["a"] = identity;
5134// Keep the identity function around for default iteratees.
5135function identity(value) {
5136 return value;
5137}
5138
5139
5140/***/ }),
5141/* 134 */
5142/***/ (function(module, __webpack_exports__, __webpack_require__) {
5143
5144"use strict";
5145/* harmony export (immutable) */ __webpack_exports__["a"] = property;
5146/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__deepGet_js__ = __webpack_require__(132);
5147/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(82);
5148
5149
5150
5151// Creates a function that, when passed an object, will traverse that object’s
5152// properties down the given `path`, specified as an array of keys or indices.
5153function property(path) {
5154 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
5155 return function(obj) {
5156 return Object(__WEBPACK_IMPORTED_MODULE_0__deepGet_js__["a" /* default */])(obj, path);
5157 };
5158}
5159
5160
5161/***/ }),
5162/* 135 */
5163/***/ (function(module, __webpack_exports__, __webpack_require__) {
5164
5165"use strict";
5166// A (possibly faster) way to get the current timestamp as an integer.
5167/* harmony default export */ __webpack_exports__["a"] = (Date.now || function() {
5168 return new Date().getTime();
5169});
5170
5171
5172/***/ }),
5173/* 136 */
5174/***/ (function(module, __webpack_exports__, __webpack_require__) {
5175
5176"use strict";
5177/* harmony export (immutable) */ __webpack_exports__["a"] = negate;
5178// Returns a negated version of the passed-in predicate.
5179function negate(predicate) {
5180 return function() {
5181 return !predicate.apply(this, arguments);
5182 };
5183}
5184
5185
5186/***/ }),
5187/* 137 */
5188/***/ (function(module, __webpack_exports__, __webpack_require__) {
5189
5190"use strict";
5191/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(199);
5192
5193
5194// Returns the first index on an array-like that passes a truth test.
5195/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(1));
5196
5197
5198/***/ }),
5199/* 138 */
5200/***/ (function(module, __webpack_exports__, __webpack_require__) {
5201
5202"use strict";
5203/* harmony export (immutable) */ __webpack_exports__["a"] = pluck;
5204/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__map_js__ = __webpack_require__(66);
5205/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__property_js__ = __webpack_require__(134);
5206
5207
5208
5209// Convenience version of a common use case of `_.map`: fetching a property.
5210function pluck(obj, key) {
5211 return Object(__WEBPACK_IMPORTED_MODULE_0__map_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__property_js__["a" /* default */])(key));
5212}
5213
5214
5215/***/ }),
5216/* 139 */
5217/***/ (function(module, exports, __webpack_require__) {
5218
5219"use strict";
5220
5221var fails = __webpack_require__(3);
5222
5223module.exports = function (METHOD_NAME, argument) {
5224 var method = [][METHOD_NAME];
5225 return !!method && fails(function () {
5226 // eslint-disable-next-line no-useless-call -- required for testing
5227 method.call(null, argument || function () { return 1; }, 1);
5228 });
5229};
5230
5231
5232/***/ }),
5233/* 140 */
5234/***/ (function(module, exports, __webpack_require__) {
5235
5236module.exports = __webpack_require__(228);
5237
5238/***/ }),
5239/* 141 */
5240/***/ (function(module, exports, __webpack_require__) {
5241
5242var _Symbol = __webpack_require__(229);
5243
5244var _Symbol$iterator = __webpack_require__(431);
5245
5246function _typeof(obj) {
5247 "@babel/helpers - typeof";
5248
5249 return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (obj) {
5250 return typeof obj;
5251 } : function (obj) {
5252 return obj && "function" == typeof _Symbol && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
5253 }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
5254}
5255
5256module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
5257
5258/***/ }),
5259/* 142 */
5260/***/ (function(module, exports, __webpack_require__) {
5261
5262var wellKnownSymbol = __webpack_require__(5);
5263
5264exports.f = wellKnownSymbol;
5265
5266
5267/***/ }),
5268/* 143 */
5269/***/ (function(module, exports, __webpack_require__) {
5270
5271module.exports = __webpack_require__(475);
5272
5273/***/ }),
5274/* 144 */
5275/***/ (function(module, exports, __webpack_require__) {
5276
5277module.exports = __webpack_require__(235);
5278
5279/***/ }),
5280/* 145 */
5281/***/ (function(module, exports, __webpack_require__) {
5282
5283"use strict";
5284
5285var $propertyIsEnumerable = {}.propertyIsEnumerable;
5286// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
5287var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
5288
5289// Nashorn ~ JDK8 bug
5290var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
5291
5292// `Object.prototype.propertyIsEnumerable` method implementation
5293// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
5294exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
5295 var descriptor = getOwnPropertyDescriptor(this, V);
5296 return !!descriptor && descriptor.enumerable;
5297} : $propertyIsEnumerable;
5298
5299
5300/***/ }),
5301/* 146 */
5302/***/ (function(module, exports, __webpack_require__) {
5303
5304/* eslint-disable es-x/no-symbol -- required for testing */
5305var NATIVE_SYMBOL = __webpack_require__(55);
5306
5307module.exports = NATIVE_SYMBOL
5308 && !Symbol.sham
5309 && typeof Symbol.iterator == 'symbol';
5310
5311
5312/***/ }),
5313/* 147 */
5314/***/ (function(module, exports, __webpack_require__) {
5315
5316var DESCRIPTORS = __webpack_require__(20);
5317var fails = __webpack_require__(3);
5318var createElement = __webpack_require__(113);
5319
5320// Thanks to IE8 for its funny defineProperty
5321module.exports = !DESCRIPTORS && !fails(function () {
5322 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
5323 return Object.defineProperty(createElement('div'), 'a', {
5324 get: function () { return 7; }
5325 }).a != 7;
5326});
5327
5328
5329/***/ }),
5330/* 148 */
5331/***/ (function(module, exports, __webpack_require__) {
5332
5333var fails = __webpack_require__(3);
5334var isCallable = __webpack_require__(8);
5335
5336var replacement = /#|\.prototype\./;
5337
5338var isForced = function (feature, detection) {
5339 var value = data[normalize(feature)];
5340 return value == POLYFILL ? true
5341 : value == NATIVE ? false
5342 : isCallable(detection) ? fails(detection)
5343 : !!detection;
5344};
5345
5346var normalize = isForced.normalize = function (string) {
5347 return String(string).replace(replacement, '.').toLowerCase();
5348};
5349
5350var data = isForced.data = {};
5351var NATIVE = isForced.NATIVE = 'N';
5352var POLYFILL = isForced.POLYFILL = 'P';
5353
5354module.exports = isForced;
5355
5356
5357/***/ }),
5358/* 149 */
5359/***/ (function(module, exports, __webpack_require__) {
5360
5361var DESCRIPTORS = __webpack_require__(20);
5362var fails = __webpack_require__(3);
5363
5364// V8 ~ Chrome 36-
5365// https://bugs.chromium.org/p/v8/issues/detail?id=3334
5366module.exports = DESCRIPTORS && fails(function () {
5367 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
5368 return Object.defineProperty(function () { /* empty */ }, 'prototype', {
5369 value: 42,
5370 writable: false
5371 }).prototype != 42;
5372});
5373
5374
5375/***/ }),
5376/* 150 */
5377/***/ (function(module, exports, __webpack_require__) {
5378
5379var fails = __webpack_require__(3);
5380
5381module.exports = !fails(function () {
5382 function F() { /* empty */ }
5383 F.prototype.constructor = null;
5384 // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
5385 return Object.getPrototypeOf(new F()) !== F.prototype;
5386});
5387
5388
5389/***/ }),
5390/* 151 */
5391/***/ (function(module, exports, __webpack_require__) {
5392
5393var uncurryThis = __webpack_require__(4);
5394var hasOwn = __webpack_require__(13);
5395var toIndexedObject = __webpack_require__(35);
5396var indexOf = __webpack_require__(115).indexOf;
5397var hiddenKeys = __webpack_require__(93);
5398
5399var push = uncurryThis([].push);
5400
5401module.exports = function (object, names) {
5402 var O = toIndexedObject(object);
5403 var i = 0;
5404 var result = [];
5405 var key;
5406 for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
5407 // Don't enum bug & hidden keys
5408 while (names.length > i) if (hasOwn(O, key = names[i++])) {
5409 ~indexOf(result, key) || push(result, key);
5410 }
5411 return result;
5412};
5413
5414
5415/***/ }),
5416/* 152 */
5417/***/ (function(module, exports, __webpack_require__) {
5418
5419var DESCRIPTORS = __webpack_require__(20);
5420var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(149);
5421var definePropertyModule = __webpack_require__(34);
5422var anObject = __webpack_require__(21);
5423var toIndexedObject = __webpack_require__(35);
5424var objectKeys = __webpack_require__(120);
5425
5426// `Object.defineProperties` method
5427// https://tc39.es/ecma262/#sec-object.defineproperties
5428// eslint-disable-next-line es-x/no-object-defineproperties -- safe
5429exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
5430 anObject(O);
5431 var props = toIndexedObject(Properties);
5432 var keys = objectKeys(Properties);
5433 var length = keys.length;
5434 var index = 0;
5435 var key;
5436 while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
5437 return O;
5438};
5439
5440
5441/***/ }),
5442/* 153 */
5443/***/ (function(module, exports, __webpack_require__) {
5444
5445var getBuiltIn = __webpack_require__(18);
5446
5447module.exports = getBuiltIn('document', 'documentElement');
5448
5449
5450/***/ }),
5451/* 154 */
5452/***/ (function(module, exports, __webpack_require__) {
5453
5454var wellKnownSymbol = __webpack_require__(5);
5455var Iterators = __webpack_require__(46);
5456
5457var ITERATOR = wellKnownSymbol('iterator');
5458var ArrayPrototype = Array.prototype;
5459
5460// check on default Array iterator
5461module.exports = function (it) {
5462 return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
5463};
5464
5465
5466/***/ }),
5467/* 155 */
5468/***/ (function(module, exports, __webpack_require__) {
5469
5470var call = __webpack_require__(11);
5471var aCallable = __webpack_require__(28);
5472var anObject = __webpack_require__(21);
5473var tryToString = __webpack_require__(57);
5474var getIteratorMethod = __webpack_require__(94);
5475
5476var $TypeError = TypeError;
5477
5478module.exports = function (argument, usingIterator) {
5479 var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
5480 if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
5481 throw $TypeError(tryToString(argument) + ' is not iterable');
5482};
5483
5484
5485/***/ }),
5486/* 156 */
5487/***/ (function(module, exports, __webpack_require__) {
5488
5489var call = __webpack_require__(11);
5490var anObject = __webpack_require__(21);
5491var getMethod = __webpack_require__(110);
5492
5493module.exports = function (iterator, kind, value) {
5494 var innerResult, innerError;
5495 anObject(iterator);
5496 try {
5497 innerResult = getMethod(iterator, 'return');
5498 if (!innerResult) {
5499 if (kind === 'throw') throw value;
5500 return value;
5501 }
5502 innerResult = call(innerResult, iterator);
5503 } catch (error) {
5504 innerError = true;
5505 innerResult = error;
5506 }
5507 if (kind === 'throw') throw value;
5508 if (innerError) throw innerResult;
5509 anObject(innerResult);
5510 return value;
5511};
5512
5513
5514/***/ }),
5515/* 157 */
5516/***/ (function(module, exports, __webpack_require__) {
5517
5518"use strict";
5519
5520var $ = __webpack_require__(0);
5521var call = __webpack_require__(11);
5522var IS_PURE = __webpack_require__(32);
5523var FunctionName = __webpack_require__(158);
5524var isCallable = __webpack_require__(8);
5525var createIteratorConstructor = __webpack_require__(265);
5526var getPrototypeOf = __webpack_require__(90);
5527var setPrototypeOf = __webpack_require__(92);
5528var setToStringTag = __webpack_require__(61);
5529var createNonEnumerableProperty = __webpack_require__(39);
5530var defineBuiltIn = __webpack_require__(48);
5531var wellKnownSymbol = __webpack_require__(5);
5532var Iterators = __webpack_require__(46);
5533var IteratorsCore = __webpack_require__(159);
5534
5535var PROPER_FUNCTION_NAME = FunctionName.PROPER;
5536var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
5537var IteratorPrototype = IteratorsCore.IteratorPrototype;
5538var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
5539var ITERATOR = wellKnownSymbol('iterator');
5540var KEYS = 'keys';
5541var VALUES = 'values';
5542var ENTRIES = 'entries';
5543
5544var returnThis = function () { return this; };
5545
5546module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
5547 createIteratorConstructor(IteratorConstructor, NAME, next);
5548
5549 var getIterationMethod = function (KIND) {
5550 if (KIND === DEFAULT && defaultIterator) return defaultIterator;
5551 if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
5552 switch (KIND) {
5553 case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
5554 case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
5555 case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
5556 } return function () { return new IteratorConstructor(this); };
5557 };
5558
5559 var TO_STRING_TAG = NAME + ' Iterator';
5560 var INCORRECT_VALUES_NAME = false;
5561 var IterablePrototype = Iterable.prototype;
5562 var nativeIterator = IterablePrototype[ITERATOR]
5563 || IterablePrototype['@@iterator']
5564 || DEFAULT && IterablePrototype[DEFAULT];
5565 var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
5566 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
5567 var CurrentIteratorPrototype, methods, KEY;
5568
5569 // fix native
5570 if (anyNativeIterator) {
5571 CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
5572 if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
5573 if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
5574 if (setPrototypeOf) {
5575 setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
5576 } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
5577 defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
5578 }
5579 }
5580 // Set @@toStringTag to native iterators
5581 setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
5582 if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
5583 }
5584 }
5585
5586 // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
5587 if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
5588 if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
5589 createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
5590 } else {
5591 INCORRECT_VALUES_NAME = true;
5592 defaultIterator = function values() { return call(nativeIterator, this); };
5593 }
5594 }
5595
5596 // export additional methods
5597 if (DEFAULT) {
5598 methods = {
5599 values: getIterationMethod(VALUES),
5600 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
5601 entries: getIterationMethod(ENTRIES)
5602 };
5603 if (FORCED) for (KEY in methods) {
5604 if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
5605 defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
5606 }
5607 } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
5608 }
5609
5610 // define iterator
5611 if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
5612 defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
5613 }
5614 Iterators[NAME] = defaultIterator;
5615
5616 return methods;
5617};
5618
5619
5620/***/ }),
5621/* 158 */
5622/***/ (function(module, exports, __webpack_require__) {
5623
5624var DESCRIPTORS = __webpack_require__(20);
5625var hasOwn = __webpack_require__(13);
5626
5627var FunctionPrototype = Function.prototype;
5628// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
5629var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
5630
5631var EXISTS = hasOwn(FunctionPrototype, 'name');
5632// additional protection from minified / mangled / dropped function names
5633var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
5634var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
5635
5636module.exports = {
5637 EXISTS: EXISTS,
5638 PROPER: PROPER,
5639 CONFIGURABLE: CONFIGURABLE
5640};
5641
5642
5643/***/ }),
5644/* 159 */
5645/***/ (function(module, exports, __webpack_require__) {
5646
5647"use strict";
5648
5649var fails = __webpack_require__(3);
5650var isCallable = __webpack_require__(8);
5651var create = __webpack_require__(59);
5652var getPrototypeOf = __webpack_require__(90);
5653var defineBuiltIn = __webpack_require__(48);
5654var wellKnownSymbol = __webpack_require__(5);
5655var IS_PURE = __webpack_require__(32);
5656
5657var ITERATOR = wellKnownSymbol('iterator');
5658var BUGGY_SAFARI_ITERATORS = false;
5659
5660// `%IteratorPrototype%` object
5661// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
5662var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
5663
5664/* eslint-disable es-x/no-array-prototype-keys -- safe */
5665if ([].keys) {
5666 arrayIterator = [].keys();
5667 // Safari 8 has buggy iterators w/o `next`
5668 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
5669 else {
5670 PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
5671 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
5672 }
5673}
5674
5675var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
5676 var test = {};
5677 // FF44- legacy iterators case
5678 return IteratorPrototype[ITERATOR].call(test) !== test;
5679});
5680
5681if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
5682else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
5683
5684// `%IteratorPrototype%[@@iterator]()` method
5685// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
5686if (!isCallable(IteratorPrototype[ITERATOR])) {
5687 defineBuiltIn(IteratorPrototype, ITERATOR, function () {
5688 return this;
5689 });
5690}
5691
5692module.exports = {
5693 IteratorPrototype: IteratorPrototype,
5694 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
5695};
5696
5697
5698/***/ }),
5699/* 160 */
5700/***/ (function(module, exports, __webpack_require__) {
5701
5702var anObject = __webpack_require__(21);
5703var aConstructor = __webpack_require__(161);
5704var wellKnownSymbol = __webpack_require__(5);
5705
5706var SPECIES = wellKnownSymbol('species');
5707
5708// `SpeciesConstructor` abstract operation
5709// https://tc39.es/ecma262/#sec-speciesconstructor
5710module.exports = function (O, defaultConstructor) {
5711 var C = anObject(O).constructor;
5712 var S;
5713 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
5714};
5715
5716
5717/***/ }),
5718/* 161 */
5719/***/ (function(module, exports, __webpack_require__) {
5720
5721var isConstructor = __webpack_require__(98);
5722var tryToString = __webpack_require__(57);
5723
5724var $TypeError = TypeError;
5725
5726// `Assert: IsConstructor(argument) is true`
5727module.exports = function (argument) {
5728 if (isConstructor(argument)) return argument;
5729 throw $TypeError(tryToString(argument) + ' is not a constructor');
5730};
5731
5732
5733/***/ }),
5734/* 162 */
5735/***/ (function(module, exports, __webpack_require__) {
5736
5737var global = __webpack_require__(9);
5738var apply = __webpack_require__(71);
5739var bind = __webpack_require__(58);
5740var isCallable = __webpack_require__(8);
5741var hasOwn = __webpack_require__(13);
5742var fails = __webpack_require__(3);
5743var html = __webpack_require__(153);
5744var arraySlice = __webpack_require__(99);
5745var createElement = __webpack_require__(113);
5746var validateArgumentsLength = __webpack_require__(271);
5747var IS_IOS = __webpack_require__(163);
5748var IS_NODE = __webpack_require__(97);
5749
5750var set = global.setImmediate;
5751var clear = global.clearImmediate;
5752var process = global.process;
5753var Dispatch = global.Dispatch;
5754var Function = global.Function;
5755var MessageChannel = global.MessageChannel;
5756var String = global.String;
5757var counter = 0;
5758var queue = {};
5759var ONREADYSTATECHANGE = 'onreadystatechange';
5760var location, defer, channel, port;
5761
5762try {
5763 // Deno throws a ReferenceError on `location` access without `--location` flag
5764 location = global.location;
5765} catch (error) { /* empty */ }
5766
5767var run = function (id) {
5768 if (hasOwn(queue, id)) {
5769 var fn = queue[id];
5770 delete queue[id];
5771 fn();
5772 }
5773};
5774
5775var runner = function (id) {
5776 return function () {
5777 run(id);
5778 };
5779};
5780
5781var listener = function (event) {
5782 run(event.data);
5783};
5784
5785var post = function (id) {
5786 // old engines have not location.origin
5787 global.postMessage(String(id), location.protocol + '//' + location.host);
5788};
5789
5790// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
5791if (!set || !clear) {
5792 set = function setImmediate(handler) {
5793 validateArgumentsLength(arguments.length, 1);
5794 var fn = isCallable(handler) ? handler : Function(handler);
5795 var args = arraySlice(arguments, 1);
5796 queue[++counter] = function () {
5797 apply(fn, undefined, args);
5798 };
5799 defer(counter);
5800 return counter;
5801 };
5802 clear = function clearImmediate(id) {
5803 delete queue[id];
5804 };
5805 // Node.js 0.8-
5806 if (IS_NODE) {
5807 defer = function (id) {
5808 process.nextTick(runner(id));
5809 };
5810 // Sphere (JS game engine) Dispatch API
5811 } else if (Dispatch && Dispatch.now) {
5812 defer = function (id) {
5813 Dispatch.now(runner(id));
5814 };
5815 // Browsers with MessageChannel, includes WebWorkers
5816 // except iOS - https://github.com/zloirock/core-js/issues/624
5817 } else if (MessageChannel && !IS_IOS) {
5818 channel = new MessageChannel();
5819 port = channel.port2;
5820 channel.port1.onmessage = listener;
5821 defer = bind(port.postMessage, port);
5822 // Browsers with postMessage, skip WebWorkers
5823 // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
5824 } else if (
5825 global.addEventListener &&
5826 isCallable(global.postMessage) &&
5827 !global.importScripts &&
5828 location && location.protocol !== 'file:' &&
5829 !fails(post)
5830 ) {
5831 defer = post;
5832 global.addEventListener('message', listener, false);
5833 // IE8-
5834 } else if (ONREADYSTATECHANGE in createElement('script')) {
5835 defer = function (id) {
5836 html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
5837 html.removeChild(this);
5838 run(id);
5839 };
5840 };
5841 // Rest old browsers
5842 } else {
5843 defer = function (id) {
5844 setTimeout(runner(id), 0);
5845 };
5846 }
5847}
5848
5849module.exports = {
5850 set: set,
5851 clear: clear
5852};
5853
5854
5855/***/ }),
5856/* 163 */
5857/***/ (function(module, exports, __webpack_require__) {
5858
5859var userAgent = __webpack_require__(45);
5860
5861module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
5862
5863
5864/***/ }),
5865/* 164 */
5866/***/ (function(module, exports, __webpack_require__) {
5867
5868var NativePromiseConstructor = __webpack_require__(62);
5869var checkCorrectnessOfIteration = __webpack_require__(165);
5870var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(78).CONSTRUCTOR;
5871
5872module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
5873 NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });
5874});
5875
5876
5877/***/ }),
5878/* 165 */
5879/***/ (function(module, exports, __webpack_require__) {
5880
5881var wellKnownSymbol = __webpack_require__(5);
5882
5883var ITERATOR = wellKnownSymbol('iterator');
5884var SAFE_CLOSING = false;
5885
5886try {
5887 var called = 0;
5888 var iteratorWithReturn = {
5889 next: function () {
5890 return { done: !!called++ };
5891 },
5892 'return': function () {
5893 SAFE_CLOSING = true;
5894 }
5895 };
5896 iteratorWithReturn[ITERATOR] = function () {
5897 return this;
5898 };
5899 // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
5900 Array.from(iteratorWithReturn, function () { throw 2; });
5901} catch (error) { /* empty */ }
5902
5903module.exports = function (exec, SKIP_CLOSING) {
5904 if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
5905 var ITERATION_SUPPORT = false;
5906 try {
5907 var object = {};
5908 object[ITERATOR] = function () {
5909 return {
5910 next: function () {
5911 return { done: ITERATION_SUPPORT = true };
5912 }
5913 };
5914 };
5915 exec(object);
5916 } catch (error) { /* empty */ }
5917 return ITERATION_SUPPORT;
5918};
5919
5920
5921/***/ }),
5922/* 166 */
5923/***/ (function(module, exports, __webpack_require__) {
5924
5925var anObject = __webpack_require__(21);
5926var isObject = __webpack_require__(17);
5927var newPromiseCapability = __webpack_require__(49);
5928
5929module.exports = function (C, x) {
5930 anObject(C);
5931 if (isObject(x) && x.constructor === C) return x;
5932 var promiseCapability = newPromiseCapability.f(C);
5933 var resolve = promiseCapability.resolve;
5934 resolve(x);
5935 return promiseCapability.promise;
5936};
5937
5938
5939/***/ }),
5940/* 167 */
5941/***/ (function(module, __webpack_exports__, __webpack_require__) {
5942
5943"use strict";
5944/* harmony export (immutable) */ __webpack_exports__["a"] = isUndefined;
5945// Is a given variable undefined?
5946function isUndefined(obj) {
5947 return obj === void 0;
5948}
5949
5950
5951/***/ }),
5952/* 168 */
5953/***/ (function(module, __webpack_exports__, __webpack_require__) {
5954
5955"use strict";
5956/* harmony export (immutable) */ __webpack_exports__["a"] = isBoolean;
5957/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
5958
5959
5960// Is a given value a boolean?
5961function isBoolean(obj) {
5962 return obj === true || obj === false || __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === '[object Boolean]';
5963}
5964
5965
5966/***/ }),
5967/* 169 */
5968/***/ (function(module, __webpack_exports__, __webpack_require__) {
5969
5970"use strict";
5971/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
5972
5973
5974/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Number'));
5975
5976
5977/***/ }),
5978/* 170 */
5979/***/ (function(module, __webpack_exports__, __webpack_require__) {
5980
5981"use strict";
5982/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
5983
5984
5985/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Symbol'));
5986
5987
5988/***/ }),
5989/* 171 */
5990/***/ (function(module, __webpack_exports__, __webpack_require__) {
5991
5992"use strict";
5993/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
5994
5995
5996/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('ArrayBuffer'));
5997
5998
5999/***/ }),
6000/* 172 */
6001/***/ (function(module, __webpack_exports__, __webpack_require__) {
6002
6003"use strict";
6004/* harmony export (immutable) */ __webpack_exports__["a"] = isNaN;
6005/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
6006/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isNumber_js__ = __webpack_require__(169);
6007
6008
6009
6010// Is the given value `NaN`?
6011function isNaN(obj) {
6012 return Object(__WEBPACK_IMPORTED_MODULE_1__isNumber_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["g" /* _isNaN */])(obj);
6013}
6014
6015
6016/***/ }),
6017/* 173 */
6018/***/ (function(module, __webpack_exports__, __webpack_require__) {
6019
6020"use strict";
6021/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
6022/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isDataView_js__ = __webpack_require__(126);
6023/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constant_js__ = __webpack_require__(174);
6024/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__ = __webpack_require__(296);
6025
6026
6027
6028
6029
6030// Is a given value a typed array?
6031var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
6032function isTypedArray(obj) {
6033 // `ArrayBuffer.isView` is the most future-proof, so use it when available.
6034 // Otherwise, fall back on the above regular expression.
6035 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["l" /* nativeIsView */] ? (Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["l" /* nativeIsView */])(obj) && !Object(__WEBPACK_IMPORTED_MODULE_1__isDataView_js__["a" /* default */])(obj)) :
6036 Object(__WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__["a" /* default */])(obj) && typedArrayPattern.test(__WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj));
6037}
6038
6039/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["r" /* supportsArrayBuffer */] ? isTypedArray : Object(__WEBPACK_IMPORTED_MODULE_2__constant_js__["a" /* default */])(false));
6040
6041
6042/***/ }),
6043/* 174 */
6044/***/ (function(module, __webpack_exports__, __webpack_require__) {
6045
6046"use strict";
6047/* harmony export (immutable) */ __webpack_exports__["a"] = constant;
6048// Predicate-generating function. Often useful outside of Underscore.
6049function constant(value) {
6050 return function() {
6051 return value;
6052 };
6053}
6054
6055
6056/***/ }),
6057/* 175 */
6058/***/ (function(module, __webpack_exports__, __webpack_require__) {
6059
6060"use strict";
6061/* harmony export (immutable) */ __webpack_exports__["a"] = createSizePropertyCheck;
6062/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
6063
6064
6065// Common internal logic for `isArrayLike` and `isBufferLike`.
6066function createSizePropertyCheck(getSizeProperty) {
6067 return function(collection) {
6068 var sizeProperty = getSizeProperty(collection);
6069 return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= __WEBPACK_IMPORTED_MODULE_0__setup_js__["b" /* MAX_ARRAY_INDEX */];
6070 }
6071}
6072
6073
6074/***/ }),
6075/* 176 */
6076/***/ (function(module, __webpack_exports__, __webpack_require__) {
6077
6078"use strict";
6079/* harmony export (immutable) */ __webpack_exports__["a"] = shallowProperty;
6080// Internal helper to generate a function to obtain property `key` from `obj`.
6081function shallowProperty(key) {
6082 return function(obj) {
6083 return obj == null ? void 0 : obj[key];
6084 };
6085}
6086
6087
6088/***/ }),
6089/* 177 */
6090/***/ (function(module, __webpack_exports__, __webpack_require__) {
6091
6092"use strict";
6093/* harmony export (immutable) */ __webpack_exports__["a"] = collectNonEnumProps;
6094/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
6095/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(29);
6096/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(41);
6097
6098
6099
6100
6101// Internal helper to create a simple lookup structure.
6102// `collectNonEnumProps` used to depend on `_.contains`, but this led to
6103// circular imports. `emulatedSet` is a one-off solution that only works for
6104// arrays of strings.
6105function emulatedSet(keys) {
6106 var hash = {};
6107 for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
6108 return {
6109 contains: function(key) { return hash[key]; },
6110 push: function(key) {
6111 hash[key] = true;
6112 return keys.push(key);
6113 }
6114 };
6115}
6116
6117// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
6118// be iterated by `for key in ...` and thus missed. Extends `keys` in place if
6119// needed.
6120function collectNonEnumProps(obj, keys) {
6121 keys = emulatedSet(keys);
6122 var nonEnumIdx = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */].length;
6123 var constructor = obj.constructor;
6124 var proto = Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(constructor) && constructor.prototype || __WEBPACK_IMPORTED_MODULE_0__setup_js__["c" /* ObjProto */];
6125
6126 // Constructor is a special case.
6127 var prop = 'constructor';
6128 if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, prop) && !keys.contains(prop)) keys.push(prop);
6129
6130 while (nonEnumIdx--) {
6131 prop = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */][nonEnumIdx];
6132 if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
6133 keys.push(prop);
6134 }
6135 }
6136}
6137
6138
6139/***/ }),
6140/* 178 */
6141/***/ (function(module, __webpack_exports__, __webpack_require__) {
6142
6143"use strict";
6144/* harmony export (immutable) */ __webpack_exports__["a"] = isMatch;
6145/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(14);
6146
6147
6148// Returns whether an object has a given set of `key:value` pairs.
6149function isMatch(object, attrs) {
6150 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(attrs), length = _keys.length;
6151 if (object == null) return !length;
6152 var obj = Object(object);
6153 for (var i = 0; i < length; i++) {
6154 var key = _keys[i];
6155 if (attrs[key] !== obj[key] || !(key in obj)) return false;
6156 }
6157 return true;
6158}
6159
6160
6161/***/ }),
6162/* 179 */
6163/***/ (function(module, __webpack_exports__, __webpack_require__) {
6164
6165"use strict";
6166/* harmony export (immutable) */ __webpack_exports__["a"] = invert;
6167/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(14);
6168
6169
6170// Invert the keys and values of an object. The values must be serializable.
6171function invert(obj) {
6172 var result = {};
6173 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
6174 for (var i = 0, length = _keys.length; i < length; i++) {
6175 result[obj[_keys[i]]] = _keys[i];
6176 }
6177 return result;
6178}
6179
6180
6181/***/ }),
6182/* 180 */
6183/***/ (function(module, __webpack_exports__, __webpack_require__) {
6184
6185"use strict";
6186/* harmony export (immutable) */ __webpack_exports__["a"] = functions;
6187/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(29);
6188
6189
6190// Return a sorted list of the function names available on the object.
6191function functions(obj) {
6192 var names = [];
6193 for (var key in obj) {
6194 if (Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(obj[key])) names.push(key);
6195 }
6196 return names.sort();
6197}
6198
6199
6200/***/ }),
6201/* 181 */
6202/***/ (function(module, __webpack_exports__, __webpack_require__) {
6203
6204"use strict";
6205/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(130);
6206/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(81);
6207
6208
6209
6210// Extend a given object with all the properties in passed-in object(s).
6211/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */]));
6212
6213
6214/***/ }),
6215/* 182 */
6216/***/ (function(module, __webpack_exports__, __webpack_require__) {
6217
6218"use strict";
6219/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(130);
6220/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(81);
6221
6222
6223
6224// Fill in a given object with default properties.
6225/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */], true));
6226
6227
6228/***/ }),
6229/* 183 */
6230/***/ (function(module, __webpack_exports__, __webpack_require__) {
6231
6232"use strict";
6233/* harmony export (immutable) */ __webpack_exports__["a"] = baseCreate;
6234/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(50);
6235/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
6236
6237
6238
6239// Create a naked function reference for surrogate-prototype-swapping.
6240function ctor() {
6241 return function(){};
6242}
6243
6244// An internal function for creating a new object that inherits from another.
6245function baseCreate(prototype) {
6246 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(prototype)) return {};
6247 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */])(prototype);
6248 var Ctor = ctor();
6249 Ctor.prototype = prototype;
6250 var result = new Ctor;
6251 Ctor.prototype = null;
6252 return result;
6253}
6254
6255
6256/***/ }),
6257/* 184 */
6258/***/ (function(module, __webpack_exports__, __webpack_require__) {
6259
6260"use strict";
6261/* harmony export (immutable) */ __webpack_exports__["a"] = clone;
6262/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(50);
6263/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(51);
6264/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__extend_js__ = __webpack_require__(181);
6265
6266
6267
6268
6269// Create a (shallow-cloned) duplicate of an object.
6270function clone(obj) {
6271 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return obj;
6272 return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) ? obj.slice() : Object(__WEBPACK_IMPORTED_MODULE_2__extend_js__["a" /* default */])({}, obj);
6273}
6274
6275
6276/***/ }),
6277/* 185 */
6278/***/ (function(module, __webpack_exports__, __webpack_require__) {
6279
6280"use strict";
6281/* harmony export (immutable) */ __webpack_exports__["a"] = get;
6282/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__toPath_js__ = __webpack_require__(82);
6283/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deepGet_js__ = __webpack_require__(132);
6284/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isUndefined_js__ = __webpack_require__(167);
6285
6286
6287
6288
6289// Get the value of the (deep) property on `path` from `object`.
6290// If any property in `path` does not exist or if the value is
6291// `undefined`, return `defaultValue` instead.
6292// The `path` is normalized through `_.toPath`.
6293function get(object, path, defaultValue) {
6294 var value = Object(__WEBPACK_IMPORTED_MODULE_1__deepGet_js__["a" /* default */])(object, Object(__WEBPACK_IMPORTED_MODULE_0__toPath_js__["a" /* default */])(path));
6295 return Object(__WEBPACK_IMPORTED_MODULE_2__isUndefined_js__["a" /* default */])(value) ? defaultValue : value;
6296}
6297
6298
6299/***/ }),
6300/* 186 */
6301/***/ (function(module, __webpack_exports__, __webpack_require__) {
6302
6303"use strict";
6304/* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
6305/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6306/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(51);
6307
6308
6309
6310// Normalize a (deep) property `path` to array.
6311// Like `_.iteratee`, this function can be customized.
6312function toPath(path) {
6313 return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(path) ? path : [path];
6314}
6315__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath = toPath;
6316
6317
6318/***/ }),
6319/* 187 */
6320/***/ (function(module, __webpack_exports__, __webpack_require__) {
6321
6322"use strict";
6323/* harmony export (immutable) */ __webpack_exports__["a"] = baseIteratee;
6324/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(133);
6325/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(29);
6326/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(50);
6327/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(51);
6328/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matcher_js__ = __webpack_require__(100);
6329/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__property_js__ = __webpack_require__(134);
6330/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__ = __webpack_require__(83);
6331
6332
6333
6334
6335
6336
6337
6338
6339// An internal function to generate callbacks that can be applied to each
6340// element in a collection, returning the desired result — either `_.identity`,
6341// an arbitrary callback, a property matcher, or a property accessor.
6342function baseIteratee(value, context, argCount) {
6343 if (value == null) return __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" /* default */];
6344 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__["a" /* default */])(value, context, argCount);
6345 if (Object(__WEBPACK_IMPORTED_MODULE_2__isObject_js__["a" /* default */])(value) && !Object(__WEBPACK_IMPORTED_MODULE_3__isArray_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_4__matcher_js__["a" /* default */])(value);
6346 return Object(__WEBPACK_IMPORTED_MODULE_5__property_js__["a" /* default */])(value);
6347}
6348
6349
6350/***/ }),
6351/* 188 */
6352/***/ (function(module, __webpack_exports__, __webpack_require__) {
6353
6354"use strict";
6355/* harmony export (immutable) */ __webpack_exports__["a"] = iteratee;
6356/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6357/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(187);
6358
6359
6360
6361// External wrapper for our callback generator. Users may customize
6362// `_.iteratee` if they want additional predicate/iteratee shorthand styles.
6363// This abstraction hides the internal-only `argCount` argument.
6364function iteratee(value, context) {
6365 return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, Infinity);
6366}
6367__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee = iteratee;
6368
6369
6370/***/ }),
6371/* 189 */
6372/***/ (function(module, __webpack_exports__, __webpack_require__) {
6373
6374"use strict";
6375/* harmony export (immutable) */ __webpack_exports__["a"] = noop;
6376// Predicate-generating function. Often useful outside of Underscore.
6377function noop(){}
6378
6379
6380/***/ }),
6381/* 190 */
6382/***/ (function(module, __webpack_exports__, __webpack_require__) {
6383
6384"use strict";
6385/* harmony export (immutable) */ __webpack_exports__["a"] = random;
6386// Return a random integer between `min` and `max` (inclusive).
6387function random(min, max) {
6388 if (max == null) {
6389 max = min;
6390 min = 0;
6391 }
6392 return min + Math.floor(Math.random() * (max - min + 1));
6393}
6394
6395
6396/***/ }),
6397/* 191 */
6398/***/ (function(module, __webpack_exports__, __webpack_require__) {
6399
6400"use strict";
6401/* harmony export (immutable) */ __webpack_exports__["a"] = createEscaper;
6402/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(14);
6403
6404
6405// Internal helper to generate functions for escaping and unescaping strings
6406// to/from HTML interpolation.
6407function createEscaper(map) {
6408 var escaper = function(match) {
6409 return map[match];
6410 };
6411 // Regexes for identifying a key that needs to be escaped.
6412 var source = '(?:' + Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(map).join('|') + ')';
6413 var testRegexp = RegExp(source);
6414 var replaceRegexp = RegExp(source, 'g');
6415 return function(string) {
6416 string = string == null ? '' : '' + string;
6417 return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
6418 };
6419}
6420
6421
6422/***/ }),
6423/* 192 */
6424/***/ (function(module, __webpack_exports__, __webpack_require__) {
6425
6426"use strict";
6427// Internal list of HTML entities for escaping.
6428/* harmony default export */ __webpack_exports__["a"] = ({
6429 '&': '&amp;',
6430 '<': '&lt;',
6431 '>': '&gt;',
6432 '"': '&quot;',
6433 "'": '&#x27;',
6434 '`': '&#x60;'
6435});
6436
6437
6438/***/ }),
6439/* 193 */
6440/***/ (function(module, __webpack_exports__, __webpack_require__) {
6441
6442"use strict";
6443/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6444
6445
6446// By default, Underscore uses ERB-style template delimiters. Change the
6447// following template settings to use alternative delimiters.
6448/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].templateSettings = {
6449 evaluate: /<%([\s\S]+?)%>/g,
6450 interpolate: /<%=([\s\S]+?)%>/g,
6451 escape: /<%-([\s\S]+?)%>/g
6452});
6453
6454
6455/***/ }),
6456/* 194 */
6457/***/ (function(module, __webpack_exports__, __webpack_require__) {
6458
6459"use strict";
6460/* harmony export (immutable) */ __webpack_exports__["a"] = executeBound;
6461/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(183);
6462/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(50);
6463
6464
6465
6466// Internal function to execute `sourceFunc` bound to `context` with optional
6467// `args`. Determines whether to execute a function as a constructor or as a
6468// normal function.
6469function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
6470 if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
6471 var self = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(sourceFunc.prototype);
6472 var result = sourceFunc.apply(self, args);
6473 if (Object(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" /* default */])(result)) return result;
6474 return self;
6475}
6476
6477
6478/***/ }),
6479/* 195 */
6480/***/ (function(module, __webpack_exports__, __webpack_require__) {
6481
6482"use strict";
6483/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6484/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(29);
6485/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__executeBound_js__ = __webpack_require__(194);
6486
6487
6488
6489
6490// Create a function bound to a given object (assigning `this`, and arguments,
6491// optionally).
6492/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, context, args) {
6493 if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(func)) throw new TypeError('Bind must be called on a function');
6494 var bound = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(callArgs) {
6495 return Object(__WEBPACK_IMPORTED_MODULE_2__executeBound_js__["a" /* default */])(func, bound, context, this, args.concat(callArgs));
6496 });
6497 return bound;
6498}));
6499
6500
6501/***/ }),
6502/* 196 */
6503/***/ (function(module, __webpack_exports__, __webpack_require__) {
6504
6505"use strict";
6506/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6507
6508
6509// Delays a function for the given number of milliseconds, and then calls
6510// it with the arguments supplied.
6511/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, wait, args) {
6512 return setTimeout(function() {
6513 return func.apply(null, args);
6514 }, wait);
6515}));
6516
6517
6518/***/ }),
6519/* 197 */
6520/***/ (function(module, __webpack_exports__, __webpack_require__) {
6521
6522"use strict";
6523/* harmony export (immutable) */ __webpack_exports__["a"] = before;
6524// Returns a function that will only be executed up to (but not including) the
6525// Nth call.
6526function before(times, func) {
6527 var memo;
6528 return function() {
6529 if (--times > 0) {
6530 memo = func.apply(this, arguments);
6531 }
6532 if (times <= 1) func = null;
6533 return memo;
6534 };
6535}
6536
6537
6538/***/ }),
6539/* 198 */
6540/***/ (function(module, __webpack_exports__, __webpack_require__) {
6541
6542"use strict";
6543/* harmony export (immutable) */ __webpack_exports__["a"] = findKey;
6544/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(19);
6545/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(14);
6546
6547
6548
6549// Returns the first key on an object that passes a truth test.
6550function findKey(obj, predicate, context) {
6551 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
6552 var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj), key;
6553 for (var i = 0, length = _keys.length; i < length; i++) {
6554 key = _keys[i];
6555 if (predicate(obj[key], key, obj)) return key;
6556 }
6557}
6558
6559
6560/***/ }),
6561/* 199 */
6562/***/ (function(module, __webpack_exports__, __webpack_require__) {
6563
6564"use strict";
6565/* harmony export (immutable) */ __webpack_exports__["a"] = createPredicateIndexFinder;
6566/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(19);
6567/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(30);
6568
6569
6570
6571// Internal function to generate `_.findIndex` and `_.findLastIndex`.
6572function createPredicateIndexFinder(dir) {
6573 return function(array, predicate, context) {
6574 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
6575 var length = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
6576 var index = dir > 0 ? 0 : length - 1;
6577 for (; index >= 0 && index < length; index += dir) {
6578 if (predicate(array[index], index, array)) return index;
6579 }
6580 return -1;
6581 };
6582}
6583
6584
6585/***/ }),
6586/* 200 */
6587/***/ (function(module, __webpack_exports__, __webpack_require__) {
6588
6589"use strict";
6590/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(199);
6591
6592
6593// Returns the last index on an array-like that passes a truth test.
6594/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(-1));
6595
6596
6597/***/ }),
6598/* 201 */
6599/***/ (function(module, __webpack_exports__, __webpack_require__) {
6600
6601"use strict";
6602/* harmony export (immutable) */ __webpack_exports__["a"] = sortedIndex;
6603/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(19);
6604/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(30);
6605
6606
6607
6608// Use a comparator function to figure out the smallest index at which
6609// an object should be inserted so as to maintain order. Uses binary search.
6610function sortedIndex(array, obj, iteratee, context) {
6611 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context, 1);
6612 var value = iteratee(obj);
6613 var low = 0, high = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
6614 while (low < high) {
6615 var mid = Math.floor((low + high) / 2);
6616 if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
6617 }
6618 return low;
6619}
6620
6621
6622/***/ }),
6623/* 202 */
6624/***/ (function(module, __webpack_exports__, __webpack_require__) {
6625
6626"use strict";
6627/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__ = __webpack_require__(201);
6628/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(137);
6629/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__ = __webpack_require__(203);
6630
6631
6632
6633
6634// Return the position of the first occurrence of an item in an array,
6635// or -1 if the item is not included in the array.
6636// If the array is large and already in sort order, pass `true`
6637// for **isSorted** to use binary search.
6638/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__["a" /* default */])(1, __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" /* default */], __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__["a" /* default */]));
6639
6640
6641/***/ }),
6642/* 203 */
6643/***/ (function(module, __webpack_exports__, __webpack_require__) {
6644
6645"use strict";
6646/* harmony export (immutable) */ __webpack_exports__["a"] = createIndexFinder;
6647/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(30);
6648/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
6649/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isNaN_js__ = __webpack_require__(172);
6650
6651
6652
6653
6654// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
6655function createIndexFinder(dir, predicateFind, sortedIndex) {
6656 return function(array, item, idx) {
6657 var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array);
6658 if (typeof idx == 'number') {
6659 if (dir > 0) {
6660 i = idx >= 0 ? idx : Math.max(idx + length, i);
6661 } else {
6662 length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
6663 }
6664 } else if (sortedIndex && idx && length) {
6665 idx = sortedIndex(array, item);
6666 return array[idx] === item ? idx : -1;
6667 }
6668 if (item !== item) {
6669 idx = predicateFind(__WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(array, i, length), __WEBPACK_IMPORTED_MODULE_2__isNaN_js__["a" /* default */]);
6670 return idx >= 0 ? idx + i : -1;
6671 }
6672 for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
6673 if (array[idx] === item) return idx;
6674 }
6675 return -1;
6676 };
6677}
6678
6679
6680/***/ }),
6681/* 204 */
6682/***/ (function(module, __webpack_exports__, __webpack_require__) {
6683
6684"use strict";
6685/* harmony export (immutable) */ __webpack_exports__["a"] = find;
6686/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6687/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(137);
6688/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__findKey_js__ = __webpack_require__(198);
6689
6690
6691
6692
6693// Return the first value which passes a truth test.
6694function find(obj, predicate, context) {
6695 var keyFinder = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" /* default */] : __WEBPACK_IMPORTED_MODULE_2__findKey_js__["a" /* default */];
6696 var key = keyFinder(obj, predicate, context);
6697 if (key !== void 0 && key !== -1) return obj[key];
6698}
6699
6700
6701/***/ }),
6702/* 205 */
6703/***/ (function(module, __webpack_exports__, __webpack_require__) {
6704
6705"use strict";
6706/* harmony export (immutable) */ __webpack_exports__["a"] = createReduce;
6707/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6708/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(14);
6709/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(83);
6710
6711
6712
6713
6714// Internal helper to create a reducing function, iterating left or right.
6715function createReduce(dir) {
6716 // Wrap code that reassigns argument variables in a separate function than
6717 // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
6718 var reducer = function(obj, iteratee, memo, initial) {
6719 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
6720 length = (_keys || obj).length,
6721 index = dir > 0 ? 0 : length - 1;
6722 if (!initial) {
6723 memo = obj[_keys ? _keys[index] : index];
6724 index += dir;
6725 }
6726 for (; index >= 0 && index < length; index += dir) {
6727 var currentKey = _keys ? _keys[index] : index;
6728 memo = iteratee(memo, obj[currentKey], currentKey, obj);
6729 }
6730 return memo;
6731 };
6732
6733 return function(obj, iteratee, memo, context) {
6734 var initial = arguments.length >= 3;
6735 return reducer(obj, Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, context, 4), memo, initial);
6736 };
6737}
6738
6739
6740/***/ }),
6741/* 206 */
6742/***/ (function(module, __webpack_exports__, __webpack_require__) {
6743
6744"use strict";
6745/* harmony export (immutable) */ __webpack_exports__["a"] = max;
6746/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6747/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(64);
6748/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(19);
6749/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(52);
6750
6751
6752
6753
6754
6755// Return the maximum element (or element-based computation).
6756function max(obj, iteratee, context) {
6757 var result = -Infinity, lastComputed = -Infinity,
6758 value, computed;
6759 if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
6760 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
6761 for (var i = 0, length = obj.length; i < length; i++) {
6762 value = obj[i];
6763 if (value != null && value > result) {
6764 result = value;
6765 }
6766 }
6767 } else {
6768 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
6769 Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
6770 computed = iteratee(v, index, list);
6771 if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
6772 result = v;
6773 lastComputed = computed;
6774 }
6775 });
6776 }
6777 return result;
6778}
6779
6780
6781/***/ }),
6782/* 207 */
6783/***/ (function(module, __webpack_exports__, __webpack_require__) {
6784
6785"use strict";
6786/* harmony export (immutable) */ __webpack_exports__["a"] = sample;
6787/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6788/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_js__ = __webpack_require__(184);
6789/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__values_js__ = __webpack_require__(64);
6790/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__getLength_js__ = __webpack_require__(30);
6791/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__random_js__ = __webpack_require__(190);
6792
6793
6794
6795
6796
6797
6798// Sample **n** random values from a collection using the modern version of the
6799// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
6800// If **n** is not specified, returns a single random element.
6801// The internal `guard` argument allows it to work with `_.map`.
6802function sample(obj, n, guard) {
6803 if (n == null || guard) {
6804 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
6805 return obj[Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(obj.length - 1)];
6806 }
6807 var sample = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? Object(__WEBPACK_IMPORTED_MODULE_1__clone_js__["a" /* default */])(obj) : Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
6808 var length = Object(__WEBPACK_IMPORTED_MODULE_3__getLength_js__["a" /* default */])(sample);
6809 n = Math.max(Math.min(n, length), 0);
6810 var last = length - 1;
6811 for (var index = 0; index < n; index++) {
6812 var rand = Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(index, last);
6813 var temp = sample[index];
6814 sample[index] = sample[rand];
6815 sample[rand] = temp;
6816 }
6817 return sample.slice(0, n);
6818}
6819
6820
6821/***/ }),
6822/* 208 */
6823/***/ (function(module, __webpack_exports__, __webpack_require__) {
6824
6825"use strict";
6826/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6827/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(29);
6828/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(83);
6829/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__allKeys_js__ = __webpack_require__(81);
6830/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__ = __webpack_require__(345);
6831/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__flatten_js__ = __webpack_require__(65);
6832
6833
6834
6835
6836
6837
6838
6839// Return a copy of the object only containing the allowed properties.
6840/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
6841 var result = {}, iteratee = keys[0];
6842 if (obj == null) return result;
6843 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
6844 if (keys.length > 1) iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, keys[1]);
6845 keys = Object(__WEBPACK_IMPORTED_MODULE_3__allKeys_js__["a" /* default */])(obj);
6846 } else {
6847 iteratee = __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__["a" /* default */];
6848 keys = Object(__WEBPACK_IMPORTED_MODULE_5__flatten_js__["a" /* default */])(keys, false, false);
6849 obj = Object(obj);
6850 }
6851 for (var i = 0, length = keys.length; i < length; i++) {
6852 var key = keys[i];
6853 var value = obj[key];
6854 if (iteratee(value, key, obj)) result[key] = value;
6855 }
6856 return result;
6857}));
6858
6859
6860/***/ }),
6861/* 209 */
6862/***/ (function(module, __webpack_exports__, __webpack_require__) {
6863
6864"use strict";
6865/* harmony export (immutable) */ __webpack_exports__["a"] = initial;
6866/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
6867
6868
6869// Returns everything but the last entry of the array. Especially useful on
6870// the arguments object. Passing **n** will return all the values in
6871// the array, excluding the last N.
6872function initial(array, n, guard) {
6873 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
6874}
6875
6876
6877/***/ }),
6878/* 210 */
6879/***/ (function(module, __webpack_exports__, __webpack_require__) {
6880
6881"use strict";
6882/* harmony export (immutable) */ __webpack_exports__["a"] = rest;
6883/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
6884
6885
6886// Returns everything but the first entry of the `array`. Especially useful on
6887// the `arguments` object. Passing an **n** will return the rest N values in the
6888// `array`.
6889function rest(array, n, guard) {
6890 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, n == null || guard ? 1 : n);
6891}
6892
6893
6894/***/ }),
6895/* 211 */
6896/***/ (function(module, __webpack_exports__, __webpack_require__) {
6897
6898"use strict";
6899/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6900/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(65);
6901/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_js__ = __webpack_require__(84);
6902/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(85);
6903
6904
6905
6906
6907
6908// Take the difference between one array and a number of other arrays.
6909// Only the elements present in just the first array will remain.
6910/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, rest) {
6911 rest = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(rest, true, true);
6912 return Object(__WEBPACK_IMPORTED_MODULE_2__filter_js__["a" /* default */])(array, function(value){
6913 return !Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(rest, value);
6914 });
6915}));
6916
6917
6918/***/ }),
6919/* 212 */
6920/***/ (function(module, __webpack_exports__, __webpack_require__) {
6921
6922"use strict";
6923/* harmony export (immutable) */ __webpack_exports__["a"] = uniq;
6924/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isBoolean_js__ = __webpack_require__(168);
6925/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cb_js__ = __webpack_require__(19);
6926/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getLength_js__ = __webpack_require__(30);
6927/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(85);
6928
6929
6930
6931
6932
6933// Produce a duplicate-free version of the array. If the array has already
6934// been sorted, you have the option of using a faster algorithm.
6935// The faster algorithm will not work with an iteratee if the iteratee
6936// is not a one-to-one function, so providing an iteratee will disable
6937// the faster algorithm.
6938function uniq(array, isSorted, iteratee, context) {
6939 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isBoolean_js__["a" /* default */])(isSorted)) {
6940 context = iteratee;
6941 iteratee = isSorted;
6942 isSorted = false;
6943 }
6944 if (iteratee != null) iteratee = Object(__WEBPACK_IMPORTED_MODULE_1__cb_js__["a" /* default */])(iteratee, context);
6945 var result = [];
6946 var seen = [];
6947 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_2__getLength_js__["a" /* default */])(array); i < length; i++) {
6948 var value = array[i],
6949 computed = iteratee ? iteratee(value, i, array) : value;
6950 if (isSorted && !iteratee) {
6951 if (!i || seen !== computed) result.push(value);
6952 seen = computed;
6953 } else if (iteratee) {
6954 if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(seen, computed)) {
6955 seen.push(computed);
6956 result.push(value);
6957 }
6958 } else if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(result, value)) {
6959 result.push(value);
6960 }
6961 }
6962 return result;
6963}
6964
6965
6966/***/ }),
6967/* 213 */
6968/***/ (function(module, __webpack_exports__, __webpack_require__) {
6969
6970"use strict";
6971/* harmony export (immutable) */ __webpack_exports__["a"] = unzip;
6972/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__max_js__ = __webpack_require__(206);
6973/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(30);
6974/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pluck_js__ = __webpack_require__(138);
6975
6976
6977
6978
6979// Complement of zip. Unzip accepts an array of arrays and groups
6980// each array's elements on shared indices.
6981function unzip(array) {
6982 var length = array && Object(__WEBPACK_IMPORTED_MODULE_0__max_js__["a" /* default */])(array, __WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]).length || 0;
6983 var result = Array(length);
6984
6985 for (var index = 0; index < length; index++) {
6986 result[index] = Object(__WEBPACK_IMPORTED_MODULE_2__pluck_js__["a" /* default */])(array, index);
6987 }
6988 return result;
6989}
6990
6991
6992/***/ }),
6993/* 214 */
6994/***/ (function(module, __webpack_exports__, __webpack_require__) {
6995
6996"use strict";
6997/* harmony export (immutable) */ __webpack_exports__["a"] = chainResult;
6998/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6999
7000
7001// Helper function to continue chaining intermediate results.
7002function chainResult(instance, obj) {
7003 return instance._chain ? Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj).chain() : obj;
7004}
7005
7006
7007/***/ }),
7008/* 215 */
7009/***/ (function(module, exports, __webpack_require__) {
7010
7011"use strict";
7012
7013var $ = __webpack_require__(0);
7014var fails = __webpack_require__(3);
7015var isArray = __webpack_require__(86);
7016var isObject = __webpack_require__(17);
7017var toObject = __webpack_require__(33);
7018var lengthOfArrayLike = __webpack_require__(36);
7019var doesNotExceedSafeInteger = __webpack_require__(363);
7020var createProperty = __webpack_require__(103);
7021var arraySpeciesCreate = __webpack_require__(216);
7022var arrayMethodHasSpeciesSupport = __webpack_require__(104);
7023var wellKnownSymbol = __webpack_require__(5);
7024var V8_VERSION = __webpack_require__(56);
7025
7026var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
7027
7028// We can't use this feature detection in V8 since it causes
7029// deoptimization and serious performance degradation
7030// https://github.com/zloirock/core-js/issues/679
7031var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
7032 var array = [];
7033 array[IS_CONCAT_SPREADABLE] = false;
7034 return array.concat()[0] !== array;
7035});
7036
7037var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
7038
7039var isConcatSpreadable = function (O) {
7040 if (!isObject(O)) return false;
7041 var spreadable = O[IS_CONCAT_SPREADABLE];
7042 return spreadable !== undefined ? !!spreadable : isArray(O);
7043};
7044
7045var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
7046
7047// `Array.prototype.concat` method
7048// https://tc39.es/ecma262/#sec-array.prototype.concat
7049// with adding support of @@isConcatSpreadable and @@species
7050$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
7051 // eslint-disable-next-line no-unused-vars -- required for `.length`
7052 concat: function concat(arg) {
7053 var O = toObject(this);
7054 var A = arraySpeciesCreate(O, 0);
7055 var n = 0;
7056 var i, k, length, len, E;
7057 for (i = -1, length = arguments.length; i < length; i++) {
7058 E = i === -1 ? O : arguments[i];
7059 if (isConcatSpreadable(E)) {
7060 len = lengthOfArrayLike(E);
7061 doesNotExceedSafeInteger(n + len);
7062 for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
7063 } else {
7064 doesNotExceedSafeInteger(n + 1);
7065 createProperty(A, n++, E);
7066 }
7067 }
7068 A.length = n;
7069 return A;
7070 }
7071});
7072
7073
7074/***/ }),
7075/* 216 */
7076/***/ (function(module, exports, __webpack_require__) {
7077
7078var arraySpeciesConstructor = __webpack_require__(364);
7079
7080// `ArraySpeciesCreate` abstract operation
7081// https://tc39.es/ecma262/#sec-arrayspeciescreate
7082module.exports = function (originalArray, length) {
7083 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
7084};
7085
7086
7087/***/ }),
7088/* 217 */
7089/***/ (function(module, exports, __webpack_require__) {
7090
7091module.exports = __webpack_require__(369);
7092
7093/***/ }),
7094/* 218 */
7095/***/ (function(module, exports, __webpack_require__) {
7096
7097var $ = __webpack_require__(0);
7098var getBuiltIn = __webpack_require__(18);
7099var apply = __webpack_require__(71);
7100var call = __webpack_require__(11);
7101var uncurryThis = __webpack_require__(4);
7102var fails = __webpack_require__(3);
7103var isArray = __webpack_require__(86);
7104var isCallable = __webpack_require__(8);
7105var isObject = __webpack_require__(17);
7106var isSymbol = __webpack_require__(89);
7107var arraySlice = __webpack_require__(99);
7108var NATIVE_SYMBOL = __webpack_require__(55);
7109
7110var $stringify = getBuiltIn('JSON', 'stringify');
7111var exec = uncurryThis(/./.exec);
7112var charAt = uncurryThis(''.charAt);
7113var charCodeAt = uncurryThis(''.charCodeAt);
7114var replace = uncurryThis(''.replace);
7115var numberToString = uncurryThis(1.0.toString);
7116
7117var tester = /[\uD800-\uDFFF]/g;
7118var low = /^[\uD800-\uDBFF]$/;
7119var hi = /^[\uDC00-\uDFFF]$/;
7120
7121var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
7122 var symbol = getBuiltIn('Symbol')();
7123 // MS Edge converts symbol values to JSON as {}
7124 return $stringify([symbol]) != '[null]'
7125 // WebKit converts symbol values to JSON as null
7126 || $stringify({ a: symbol }) != '{}'
7127 // V8 throws on boxed symbols
7128 || $stringify(Object(symbol)) != '{}';
7129});
7130
7131// https://github.com/tc39/proposal-well-formed-stringify
7132var ILL_FORMED_UNICODE = fails(function () {
7133 return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
7134 || $stringify('\uDEAD') !== '"\\udead"';
7135});
7136
7137var stringifyWithSymbolsFix = function (it, replacer) {
7138 var args = arraySlice(arguments);
7139 var $replacer = replacer;
7140 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
7141 if (!isArray(replacer)) replacer = function (key, value) {
7142 if (isCallable($replacer)) value = call($replacer, this, key, value);
7143 if (!isSymbol(value)) return value;
7144 };
7145 args[1] = replacer;
7146 return apply($stringify, null, args);
7147};
7148
7149var fixIllFormed = function (match, offset, string) {
7150 var prev = charAt(string, offset - 1);
7151 var next = charAt(string, offset + 1);
7152 if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
7153 return '\\u' + numberToString(charCodeAt(match, 0), 16);
7154 } return match;
7155};
7156
7157if ($stringify) {
7158 // `JSON.stringify` method
7159 // https://tc39.es/ecma262/#sec-json.stringify
7160 $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
7161 // eslint-disable-next-line no-unused-vars -- required for `.length`
7162 stringify: function stringify(it, replacer, space) {
7163 var args = arraySlice(arguments);
7164 var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
7165 return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
7166 }
7167 });
7168}
7169
7170
7171/***/ }),
7172/* 219 */
7173/***/ (function(module, exports, __webpack_require__) {
7174
7175var rng = __webpack_require__(381);
7176var bytesToUuid = __webpack_require__(382);
7177
7178function v4(options, buf, offset) {
7179 var i = buf && offset || 0;
7180
7181 if (typeof(options) == 'string') {
7182 buf = options === 'binary' ? new Array(16) : null;
7183 options = null;
7184 }
7185 options = options || {};
7186
7187 var rnds = options.random || (options.rng || rng)();
7188
7189 // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
7190 rnds[6] = (rnds[6] & 0x0f) | 0x40;
7191 rnds[8] = (rnds[8] & 0x3f) | 0x80;
7192
7193 // Copy bytes to buffer, if provided
7194 if (buf) {
7195 for (var ii = 0; ii < 16; ++ii) {
7196 buf[i + ii] = rnds[ii];
7197 }
7198 }
7199
7200 return buf || bytesToUuid(rnds);
7201}
7202
7203module.exports = v4;
7204
7205
7206/***/ }),
7207/* 220 */
7208/***/ (function(module, exports, __webpack_require__) {
7209
7210module.exports = __webpack_require__(221);
7211
7212/***/ }),
7213/* 221 */
7214/***/ (function(module, exports, __webpack_require__) {
7215
7216var parent = __webpack_require__(385);
7217
7218module.exports = parent;
7219
7220
7221/***/ }),
7222/* 222 */
7223/***/ (function(module, exports, __webpack_require__) {
7224
7225"use strict";
7226
7227
7228module.exports = '4.13.4';
7229
7230/***/ }),
7231/* 223 */
7232/***/ (function(module, exports, __webpack_require__) {
7233
7234"use strict";
7235
7236
7237var has = Object.prototype.hasOwnProperty
7238 , prefix = '~';
7239
7240/**
7241 * Constructor to create a storage for our `EE` objects.
7242 * An `Events` instance is a plain object whose properties are event names.
7243 *
7244 * @constructor
7245 * @api private
7246 */
7247function Events() {}
7248
7249//
7250// We try to not inherit from `Object.prototype`. In some engines creating an
7251// instance in this way is faster than calling `Object.create(null)` directly.
7252// If `Object.create(null)` is not supported we prefix the event names with a
7253// character to make sure that the built-in object properties are not
7254// overridden or used as an attack vector.
7255//
7256if (Object.create) {
7257 Events.prototype = Object.create(null);
7258
7259 //
7260 // This hack is needed because the `__proto__` property is still inherited in
7261 // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
7262 //
7263 if (!new Events().__proto__) prefix = false;
7264}
7265
7266/**
7267 * Representation of a single event listener.
7268 *
7269 * @param {Function} fn The listener function.
7270 * @param {Mixed} context The context to invoke the listener with.
7271 * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
7272 * @constructor
7273 * @api private
7274 */
7275function EE(fn, context, once) {
7276 this.fn = fn;
7277 this.context = context;
7278 this.once = once || false;
7279}
7280
7281/**
7282 * Minimal `EventEmitter` interface that is molded against the Node.js
7283 * `EventEmitter` interface.
7284 *
7285 * @constructor
7286 * @api public
7287 */
7288function EventEmitter() {
7289 this._events = new Events();
7290 this._eventsCount = 0;
7291}
7292
7293/**
7294 * Return an array listing the events for which the emitter has registered
7295 * listeners.
7296 *
7297 * @returns {Array}
7298 * @api public
7299 */
7300EventEmitter.prototype.eventNames = function eventNames() {
7301 var names = []
7302 , events
7303 , name;
7304
7305 if (this._eventsCount === 0) return names;
7306
7307 for (name in (events = this._events)) {
7308 if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
7309 }
7310
7311 if (Object.getOwnPropertySymbols) {
7312 return names.concat(Object.getOwnPropertySymbols(events));
7313 }
7314
7315 return names;
7316};
7317
7318/**
7319 * Return the listeners registered for a given event.
7320 *
7321 * @param {String|Symbol} event The event name.
7322 * @param {Boolean} exists Only check if there are listeners.
7323 * @returns {Array|Boolean}
7324 * @api public
7325 */
7326EventEmitter.prototype.listeners = function listeners(event, exists) {
7327 var evt = prefix ? prefix + event : event
7328 , available = this._events[evt];
7329
7330 if (exists) return !!available;
7331 if (!available) return [];
7332 if (available.fn) return [available.fn];
7333
7334 for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
7335 ee[i] = available[i].fn;
7336 }
7337
7338 return ee;
7339};
7340
7341/**
7342 * Calls each of the listeners registered for a given event.
7343 *
7344 * @param {String|Symbol} event The event name.
7345 * @returns {Boolean} `true` if the event had listeners, else `false`.
7346 * @api public
7347 */
7348EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
7349 var evt = prefix ? prefix + event : event;
7350
7351 if (!this._events[evt]) return false;
7352
7353 var listeners = this._events[evt]
7354 , len = arguments.length
7355 , args
7356 , i;
7357
7358 if (listeners.fn) {
7359 if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
7360
7361 switch (len) {
7362 case 1: return listeners.fn.call(listeners.context), true;
7363 case 2: return listeners.fn.call(listeners.context, a1), true;
7364 case 3: return listeners.fn.call(listeners.context, a1, a2), true;
7365 case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
7366 case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
7367 case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
7368 }
7369
7370 for (i = 1, args = new Array(len -1); i < len; i++) {
7371 args[i - 1] = arguments[i];
7372 }
7373
7374 listeners.fn.apply(listeners.context, args);
7375 } else {
7376 var length = listeners.length
7377 , j;
7378
7379 for (i = 0; i < length; i++) {
7380 if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
7381
7382 switch (len) {
7383 case 1: listeners[i].fn.call(listeners[i].context); break;
7384 case 2: listeners[i].fn.call(listeners[i].context, a1); break;
7385 case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
7386 case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
7387 default:
7388 if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
7389 args[j - 1] = arguments[j];
7390 }
7391
7392 listeners[i].fn.apply(listeners[i].context, args);
7393 }
7394 }
7395 }
7396
7397 return true;
7398};
7399
7400/**
7401 * Add a listener for a given event.
7402 *
7403 * @param {String|Symbol} event The event name.
7404 * @param {Function} fn The listener function.
7405 * @param {Mixed} [context=this] The context to invoke the listener with.
7406 * @returns {EventEmitter} `this`.
7407 * @api public
7408 */
7409EventEmitter.prototype.on = function on(event, fn, context) {
7410 var listener = new EE(fn, context || this)
7411 , evt = prefix ? prefix + event : event;
7412
7413 if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
7414 else if (!this._events[evt].fn) this._events[evt].push(listener);
7415 else this._events[evt] = [this._events[evt], listener];
7416
7417 return this;
7418};
7419
7420/**
7421 * Add a one-time listener for a given event.
7422 *
7423 * @param {String|Symbol} event The event name.
7424 * @param {Function} fn The listener function.
7425 * @param {Mixed} [context=this] The context to invoke the listener with.
7426 * @returns {EventEmitter} `this`.
7427 * @api public
7428 */
7429EventEmitter.prototype.once = function once(event, fn, context) {
7430 var listener = new EE(fn, context || this, true)
7431 , evt = prefix ? prefix + event : event;
7432
7433 if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
7434 else if (!this._events[evt].fn) this._events[evt].push(listener);
7435 else this._events[evt] = [this._events[evt], listener];
7436
7437 return this;
7438};
7439
7440/**
7441 * Remove the listeners of a given event.
7442 *
7443 * @param {String|Symbol} event The event name.
7444 * @param {Function} fn Only remove the listeners that match this function.
7445 * @param {Mixed} context Only remove the listeners that have this context.
7446 * @param {Boolean} once Only remove one-time listeners.
7447 * @returns {EventEmitter} `this`.
7448 * @api public
7449 */
7450EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
7451 var evt = prefix ? prefix + event : event;
7452
7453 if (!this._events[evt]) return this;
7454 if (!fn) {
7455 if (--this._eventsCount === 0) this._events = new Events();
7456 else delete this._events[evt];
7457 return this;
7458 }
7459
7460 var listeners = this._events[evt];
7461
7462 if (listeners.fn) {
7463 if (
7464 listeners.fn === fn
7465 && (!once || listeners.once)
7466 && (!context || listeners.context === context)
7467 ) {
7468 if (--this._eventsCount === 0) this._events = new Events();
7469 else delete this._events[evt];
7470 }
7471 } else {
7472 for (var i = 0, events = [], length = listeners.length; i < length; i++) {
7473 if (
7474 listeners[i].fn !== fn
7475 || (once && !listeners[i].once)
7476 || (context && listeners[i].context !== context)
7477 ) {
7478 events.push(listeners[i]);
7479 }
7480 }
7481
7482 //
7483 // Reset the array, or remove it completely if we have no more listeners.
7484 //
7485 if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
7486 else if (--this._eventsCount === 0) this._events = new Events();
7487 else delete this._events[evt];
7488 }
7489
7490 return this;
7491};
7492
7493/**
7494 * Remove all listeners, or those of the specified event.
7495 *
7496 * @param {String|Symbol} [event] The event name.
7497 * @returns {EventEmitter} `this`.
7498 * @api public
7499 */
7500EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
7501 var evt;
7502
7503 if (event) {
7504 evt = prefix ? prefix + event : event;
7505 if (this._events[evt]) {
7506 if (--this._eventsCount === 0) this._events = new Events();
7507 else delete this._events[evt];
7508 }
7509 } else {
7510 this._events = new Events();
7511 this._eventsCount = 0;
7512 }
7513
7514 return this;
7515};
7516
7517//
7518// Alias methods names because people roll like that.
7519//
7520EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
7521EventEmitter.prototype.addListener = EventEmitter.prototype.on;
7522
7523//
7524// This function doesn't apply anymore.
7525//
7526EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
7527 return this;
7528};
7529
7530//
7531// Expose the prefix.
7532//
7533EventEmitter.prefixed = prefix;
7534
7535//
7536// Allow `EventEmitter` to be imported as module namespace.
7537//
7538EventEmitter.EventEmitter = EventEmitter;
7539
7540//
7541// Expose the module.
7542//
7543if (true) {
7544 module.exports = EventEmitter;
7545}
7546
7547
7548/***/ }),
7549/* 224 */
7550/***/ (function(module, exports, __webpack_require__) {
7551
7552"use strict";
7553
7554
7555var _interopRequireDefault = __webpack_require__(1);
7556
7557var _promise = _interopRequireDefault(__webpack_require__(10));
7558
7559var _require = __webpack_require__(70),
7560 getAdapter = _require.getAdapter;
7561
7562var syncApiNames = ['getItem', 'setItem', 'removeItem', 'clear'];
7563var localStorage = {
7564 get async() {
7565 return getAdapter('storage').async;
7566 }
7567
7568}; // wrap sync apis with async ones.
7569
7570syncApiNames.forEach(function (apiName) {
7571 localStorage[apiName + 'Async'] = function () {
7572 var storage = getAdapter('storage');
7573 return _promise.default.resolve(storage[apiName].apply(storage, arguments));
7574 };
7575
7576 localStorage[apiName] = function () {
7577 var storage = getAdapter('storage');
7578
7579 if (!storage.async) {
7580 return storage[apiName].apply(storage, arguments);
7581 }
7582
7583 var error = new Error('Synchronous API [' + apiName + '] is not available in this runtime.');
7584 error.code = 'SYNC_API_NOT_AVAILABLE';
7585 throw error;
7586 };
7587});
7588module.exports = localStorage;
7589
7590/***/ }),
7591/* 225 */
7592/***/ (function(module, exports, __webpack_require__) {
7593
7594"use strict";
7595
7596
7597var _interopRequireDefault = __webpack_require__(1);
7598
7599var _concat = _interopRequireDefault(__webpack_require__(25));
7600
7601var _stringify = _interopRequireDefault(__webpack_require__(37));
7602
7603var storage = __webpack_require__(224);
7604
7605var AV = __webpack_require__(67);
7606
7607var removeAsync = exports.removeAsync = storage.removeItemAsync.bind(storage);
7608
7609var getCacheData = function getCacheData(cacheData, key) {
7610 try {
7611 cacheData = JSON.parse(cacheData);
7612 } catch (e) {
7613 return null;
7614 }
7615
7616 if (cacheData) {
7617 var expired = cacheData.expiredAt && cacheData.expiredAt < Date.now();
7618
7619 if (!expired) {
7620 return cacheData.value;
7621 }
7622
7623 return removeAsync(key).then(function () {
7624 return null;
7625 });
7626 }
7627
7628 return null;
7629};
7630
7631exports.getAsync = function (key) {
7632 var _context;
7633
7634 key = (0, _concat.default)(_context = "AV/".concat(AV.applicationId, "/")).call(_context, key);
7635 return storage.getItemAsync(key).then(function (cache) {
7636 return getCacheData(cache, key);
7637 });
7638};
7639
7640exports.setAsync = function (key, value, ttl) {
7641 var _context2;
7642
7643 var cache = {
7644 value: value
7645 };
7646
7647 if (typeof ttl === 'number') {
7648 cache.expiredAt = Date.now() + ttl;
7649 }
7650
7651 return storage.setItemAsync((0, _concat.default)(_context2 = "AV/".concat(AV.applicationId, "/")).call(_context2, key), (0, _stringify.default)(cache));
7652};
7653
7654/***/ }),
7655/* 226 */
7656/***/ (function(module, exports, __webpack_require__) {
7657
7658var parent = __webpack_require__(388);
7659
7660module.exports = parent;
7661
7662
7663/***/ }),
7664/* 227 */
7665/***/ (function(module, exports, __webpack_require__) {
7666
7667var parent = __webpack_require__(391);
7668
7669module.exports = parent;
7670
7671
7672/***/ }),
7673/* 228 */
7674/***/ (function(module, exports, __webpack_require__) {
7675
7676var parent = __webpack_require__(394);
7677
7678module.exports = parent;
7679
7680
7681/***/ }),
7682/* 229 */
7683/***/ (function(module, exports, __webpack_require__) {
7684
7685module.exports = __webpack_require__(397);
7686
7687/***/ }),
7688/* 230 */
7689/***/ (function(module, exports, __webpack_require__) {
7690
7691var parent = __webpack_require__(400);
7692__webpack_require__(63);
7693
7694module.exports = parent;
7695
7696
7697/***/ }),
7698/* 231 */
7699/***/ (function(module, exports, __webpack_require__) {
7700
7701var toAbsoluteIndex = __webpack_require__(116);
7702var lengthOfArrayLike = __webpack_require__(36);
7703var createProperty = __webpack_require__(103);
7704
7705var $Array = Array;
7706var max = Math.max;
7707
7708module.exports = function (O, start, end) {
7709 var length = lengthOfArrayLike(O);
7710 var k = toAbsoluteIndex(start, length);
7711 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
7712 var result = $Array(max(fin - k, 0));
7713 for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
7714 result.length = n;
7715 return result;
7716};
7717
7718
7719/***/ }),
7720/* 232 */
7721/***/ (function(module, exports, __webpack_require__) {
7722
7723var call = __webpack_require__(11);
7724var getBuiltIn = __webpack_require__(18);
7725var wellKnownSymbol = __webpack_require__(5);
7726var defineBuiltIn = __webpack_require__(48);
7727
7728module.exports = function () {
7729 var Symbol = getBuiltIn('Symbol');
7730 var SymbolPrototype = Symbol && Symbol.prototype;
7731 var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
7732 var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
7733
7734 if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
7735 // `Symbol.prototype[@@toPrimitive]` method
7736 // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
7737 // eslint-disable-next-line no-unused-vars -- required for .length
7738 defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
7739 return call(valueOf, this);
7740 }, { arity: 1 });
7741 }
7742};
7743
7744
7745/***/ }),
7746/* 233 */
7747/***/ (function(module, exports, __webpack_require__) {
7748
7749var NATIVE_SYMBOL = __webpack_require__(55);
7750
7751/* eslint-disable es-x/no-symbol -- safe */
7752module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
7753
7754
7755/***/ }),
7756/* 234 */
7757/***/ (function(module, exports, __webpack_require__) {
7758
7759var defineWellKnownSymbol = __webpack_require__(7);
7760
7761// `Symbol.iterator` well-known symbol
7762// https://tc39.es/ecma262/#sec-symbol.iterator
7763defineWellKnownSymbol('iterator');
7764
7765
7766/***/ }),
7767/* 235 */
7768/***/ (function(module, exports, __webpack_require__) {
7769
7770var parent = __webpack_require__(435);
7771__webpack_require__(63);
7772
7773module.exports = parent;
7774
7775
7776/***/ }),
7777/* 236 */
7778/***/ (function(module, exports, __webpack_require__) {
7779
7780module.exports = __webpack_require__(237);
7781
7782/***/ }),
7783/* 237 */
7784/***/ (function(module, exports, __webpack_require__) {
7785
7786var parent = __webpack_require__(454);
7787
7788module.exports = parent;
7789
7790
7791/***/ }),
7792/* 238 */
7793/***/ (function(module, exports, __webpack_require__) {
7794
7795module.exports = __webpack_require__(458);
7796
7797/***/ }),
7798/* 239 */
7799/***/ (function(module, exports, __webpack_require__) {
7800
7801"use strict";
7802
7803var uncurryThis = __webpack_require__(4);
7804var aCallable = __webpack_require__(28);
7805var isObject = __webpack_require__(17);
7806var hasOwn = __webpack_require__(13);
7807var arraySlice = __webpack_require__(99);
7808var NATIVE_BIND = __webpack_require__(72);
7809
7810var $Function = Function;
7811var concat = uncurryThis([].concat);
7812var join = uncurryThis([].join);
7813var factories = {};
7814
7815var construct = function (C, argsLength, args) {
7816 if (!hasOwn(factories, argsLength)) {
7817 for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
7818 factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
7819 } return factories[argsLength](C, args);
7820};
7821
7822// `Function.prototype.bind` method implementation
7823// https://tc39.es/ecma262/#sec-function.prototype.bind
7824module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
7825 var F = aCallable(this);
7826 var Prototype = F.prototype;
7827 var partArgs = arraySlice(arguments, 1);
7828 var boundFunction = function bound(/* args... */) {
7829 var args = concat(partArgs, arraySlice(arguments));
7830 return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
7831 };
7832 if (isObject(Prototype)) boundFunction.prototype = Prototype;
7833 return boundFunction;
7834};
7835
7836
7837/***/ }),
7838/* 240 */
7839/***/ (function(module, exports, __webpack_require__) {
7840
7841module.exports = __webpack_require__(479);
7842
7843/***/ }),
7844/* 241 */
7845/***/ (function(module, exports, __webpack_require__) {
7846
7847module.exports = __webpack_require__(482);
7848
7849/***/ }),
7850/* 242 */
7851/***/ (function(module, exports) {
7852
7853var charenc = {
7854 // UTF-8 encoding
7855 utf8: {
7856 // Convert a string to a byte array
7857 stringToBytes: function(str) {
7858 return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
7859 },
7860
7861 // Convert a byte array to a string
7862 bytesToString: function(bytes) {
7863 return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
7864 }
7865 },
7866
7867 // Binary encoding
7868 bin: {
7869 // Convert a string to a byte array
7870 stringToBytes: function(str) {
7871 for (var bytes = [], i = 0; i < str.length; i++)
7872 bytes.push(str.charCodeAt(i) & 0xFF);
7873 return bytes;
7874 },
7875
7876 // Convert a byte array to a string
7877 bytesToString: function(bytes) {
7878 for (var str = [], i = 0; i < bytes.length; i++)
7879 str.push(String.fromCharCode(bytes[i]));
7880 return str.join('');
7881 }
7882 }
7883};
7884
7885module.exports = charenc;
7886
7887
7888/***/ }),
7889/* 243 */
7890/***/ (function(module, exports) {
7891
7892// a string of all valid unicode whitespaces
7893module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
7894 '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
7895
7896
7897/***/ }),
7898/* 244 */
7899/***/ (function(module, exports, __webpack_require__) {
7900
7901"use strict";
7902
7903
7904var _interopRequireDefault = __webpack_require__(1);
7905
7906var _symbol = _interopRequireDefault(__webpack_require__(87));
7907
7908var _iterator = _interopRequireDefault(__webpack_require__(144));
7909
7910function _typeof(obj) {
7911 "@babel/helpers - typeof";
7912
7913 if (typeof _symbol.default === "function" && typeof _iterator.default === "symbol") {
7914 _typeof = function _typeof(obj) {
7915 return typeof obj;
7916 };
7917 } else {
7918 _typeof = function _typeof(obj) {
7919 return obj && typeof _symbol.default === "function" && obj.constructor === _symbol.default && obj !== _symbol.default.prototype ? "symbol" : typeof obj;
7920 };
7921 }
7922
7923 return _typeof(obj);
7924}
7925/**
7926 * Check if `obj` is an object.
7927 *
7928 * @param {Object} obj
7929 * @return {Boolean}
7930 * @api private
7931 */
7932
7933
7934function isObject(obj) {
7935 return obj !== null && _typeof(obj) === 'object';
7936}
7937
7938module.exports = isObject;
7939
7940/***/ }),
7941/* 245 */
7942/***/ (function(module, exports, __webpack_require__) {
7943
7944"use strict";
7945
7946
7947var AV = __webpack_require__(246);
7948
7949var useAdatpers = __webpack_require__(544);
7950
7951module.exports = useAdatpers(AV);
7952
7953/***/ }),
7954/* 246 */
7955/***/ (function(module, exports, __webpack_require__) {
7956
7957"use strict";
7958
7959
7960module.exports = __webpack_require__(247);
7961
7962/***/ }),
7963/* 247 */
7964/***/ (function(module, exports, __webpack_require__) {
7965
7966"use strict";
7967
7968
7969var _interopRequireDefault = __webpack_require__(1);
7970
7971var _promise = _interopRequireDefault(__webpack_require__(10));
7972
7973/*!
7974 * LeanCloud JavaScript SDK
7975 * https://leancloud.cn
7976 *
7977 * Copyright 2016 LeanCloud.cn, Inc.
7978 * The LeanCloud JavaScript SDK is freely distributable under the MIT license.
7979 */
7980var _ = __webpack_require__(2);
7981
7982var AV = __webpack_require__(67);
7983
7984AV._ = _;
7985AV.version = __webpack_require__(222);
7986AV.Promise = _promise.default;
7987AV.localStorage = __webpack_require__(224);
7988AV.Cache = __webpack_require__(225);
7989AV.Error = __webpack_require__(43);
7990
7991__webpack_require__(390);
7992
7993__webpack_require__(442)(AV);
7994
7995__webpack_require__(443)(AV);
7996
7997__webpack_require__(444)(AV);
7998
7999__webpack_require__(445)(AV);
8000
8001__webpack_require__(450)(AV);
8002
8003__webpack_require__(451)(AV);
8004
8005__webpack_require__(504)(AV);
8006
8007__webpack_require__(530)(AV);
8008
8009__webpack_require__(531)(AV);
8010
8011__webpack_require__(533)(AV);
8012
8013__webpack_require__(534)(AV);
8014
8015__webpack_require__(535)(AV);
8016
8017__webpack_require__(536)(AV);
8018
8019__webpack_require__(537)(AV);
8020
8021__webpack_require__(538)(AV);
8022
8023__webpack_require__(539)(AV);
8024
8025__webpack_require__(540)(AV);
8026
8027__webpack_require__(541)(AV);
8028
8029AV.Conversation = __webpack_require__(542);
8030
8031__webpack_require__(543);
8032
8033module.exports = AV;
8034/**
8035 * Options to controll the authentication for an operation
8036 * @typedef {Object} AuthOptions
8037 * @property {String} [sessionToken] Specify a user to excute the operation as.
8038 * @property {AV.User} [user] Specify a user to excute the operation as. The user must have _sessionToken. This option will be ignored if sessionToken option provided.
8039 * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
8040 */
8041
8042/**
8043 * Options to controll the authentication for an SMS operation
8044 * @typedef {Object} SMSAuthOptions
8045 * @property {String} [sessionToken] Specify a user to excute the operation as.
8046 * @property {AV.User} [user] Specify a user to excute the operation as. The user must have _sessionToken. This option will be ignored if sessionToken option provided.
8047 * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
8048 * @property {String} [validateToken] a validate token returned by {@link AV.Cloud.verifyCaptcha}
8049 */
8050
8051/***/ }),
8052/* 248 */
8053/***/ (function(module, exports, __webpack_require__) {
8054
8055var parent = __webpack_require__(249);
8056__webpack_require__(63);
8057
8058module.exports = parent;
8059
8060
8061/***/ }),
8062/* 249 */
8063/***/ (function(module, exports, __webpack_require__) {
8064
8065__webpack_require__(250);
8066__webpack_require__(60);
8067__webpack_require__(96);
8068__webpack_require__(267);
8069__webpack_require__(283);
8070__webpack_require__(284);
8071__webpack_require__(285);
8072__webpack_require__(79);
8073var path = __webpack_require__(15);
8074
8075module.exports = path.Promise;
8076
8077
8078/***/ }),
8079/* 250 */
8080/***/ (function(module, exports, __webpack_require__) {
8081
8082// TODO: Remove this module from `core-js@4` since it's replaced to module below
8083__webpack_require__(251);
8084
8085
8086/***/ }),
8087/* 251 */
8088/***/ (function(module, exports, __webpack_require__) {
8089
8090"use strict";
8091
8092var $ = __webpack_require__(0);
8093var isPrototypeOf = __webpack_require__(12);
8094var getPrototypeOf = __webpack_require__(90);
8095var setPrototypeOf = __webpack_require__(92);
8096var copyConstructorProperties = __webpack_require__(256);
8097var create = __webpack_require__(59);
8098var createNonEnumerableProperty = __webpack_require__(39);
8099var createPropertyDescriptor = __webpack_require__(44);
8100var clearErrorStack = __webpack_require__(260);
8101var installErrorCause = __webpack_require__(261);
8102var iterate = __webpack_require__(76);
8103var normalizeStringArgument = __webpack_require__(262);
8104var wellKnownSymbol = __webpack_require__(5);
8105var ERROR_STACK_INSTALLABLE = __webpack_require__(263);
8106
8107var TO_STRING_TAG = wellKnownSymbol('toStringTag');
8108var $Error = Error;
8109var push = [].push;
8110
8111var $AggregateError = function AggregateError(errors, message /* , options */) {
8112 var options = arguments.length > 2 ? arguments[2] : undefined;
8113 var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
8114 var that;
8115 if (setPrototypeOf) {
8116 that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
8117 } else {
8118 that = isInstance ? this : create(AggregateErrorPrototype);
8119 createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
8120 }
8121 if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
8122 if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
8123 installErrorCause(that, options);
8124 var errorsArray = [];
8125 iterate(errors, push, { that: errorsArray });
8126 createNonEnumerableProperty(that, 'errors', errorsArray);
8127 return that;
8128};
8129
8130if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
8131else copyConstructorProperties($AggregateError, $Error, { name: true });
8132
8133var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
8134 constructor: createPropertyDescriptor(1, $AggregateError),
8135 message: createPropertyDescriptor(1, ''),
8136 name: createPropertyDescriptor(1, 'AggregateError')
8137});
8138
8139// `AggregateError` constructor
8140// https://tc39.es/ecma262/#sec-aggregate-error-constructor
8141$({ global: true, constructor: true, arity: 2 }, {
8142 AggregateError: $AggregateError
8143});
8144
8145
8146/***/ }),
8147/* 252 */
8148/***/ (function(module, exports, __webpack_require__) {
8149
8150var call = __webpack_require__(11);
8151var isObject = __webpack_require__(17);
8152var isSymbol = __webpack_require__(89);
8153var getMethod = __webpack_require__(110);
8154var ordinaryToPrimitive = __webpack_require__(253);
8155var wellKnownSymbol = __webpack_require__(5);
8156
8157var $TypeError = TypeError;
8158var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
8159
8160// `ToPrimitive` abstract operation
8161// https://tc39.es/ecma262/#sec-toprimitive
8162module.exports = function (input, pref) {
8163 if (!isObject(input) || isSymbol(input)) return input;
8164 var exoticToPrim = getMethod(input, TO_PRIMITIVE);
8165 var result;
8166 if (exoticToPrim) {
8167 if (pref === undefined) pref = 'default';
8168 result = call(exoticToPrim, input, pref);
8169 if (!isObject(result) || isSymbol(result)) return result;
8170 throw $TypeError("Can't convert object to primitive value");
8171 }
8172 if (pref === undefined) pref = 'number';
8173 return ordinaryToPrimitive(input, pref);
8174};
8175
8176
8177/***/ }),
8178/* 253 */
8179/***/ (function(module, exports, __webpack_require__) {
8180
8181var call = __webpack_require__(11);
8182var isCallable = __webpack_require__(8);
8183var isObject = __webpack_require__(17);
8184
8185var $TypeError = TypeError;
8186
8187// `OrdinaryToPrimitive` abstract operation
8188// https://tc39.es/ecma262/#sec-ordinarytoprimitive
8189module.exports = function (input, pref) {
8190 var fn, val;
8191 if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
8192 if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
8193 if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
8194 throw $TypeError("Can't convert object to primitive value");
8195};
8196
8197
8198/***/ }),
8199/* 254 */
8200/***/ (function(module, exports, __webpack_require__) {
8201
8202var global = __webpack_require__(9);
8203
8204// eslint-disable-next-line es-x/no-object-defineproperty -- safe
8205var defineProperty = Object.defineProperty;
8206
8207module.exports = function (key, value) {
8208 try {
8209 defineProperty(global, key, { value: value, configurable: true, writable: true });
8210 } catch (error) {
8211 global[key] = value;
8212 } return value;
8213};
8214
8215
8216/***/ }),
8217/* 255 */
8218/***/ (function(module, exports, __webpack_require__) {
8219
8220var isCallable = __webpack_require__(8);
8221
8222var $String = String;
8223var $TypeError = TypeError;
8224
8225module.exports = function (argument) {
8226 if (typeof argument == 'object' || isCallable(argument)) return argument;
8227 throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
8228};
8229
8230
8231/***/ }),
8232/* 256 */
8233/***/ (function(module, exports, __webpack_require__) {
8234
8235var hasOwn = __webpack_require__(13);
8236var ownKeys = __webpack_require__(257);
8237var getOwnPropertyDescriptorModule = __webpack_require__(73);
8238var definePropertyModule = __webpack_require__(34);
8239
8240module.exports = function (target, source, exceptions) {
8241 var keys = ownKeys(source);
8242 var defineProperty = definePropertyModule.f;
8243 var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
8244 for (var i = 0; i < keys.length; i++) {
8245 var key = keys[i];
8246 if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
8247 defineProperty(target, key, getOwnPropertyDescriptor(source, key));
8248 }
8249 }
8250};
8251
8252
8253/***/ }),
8254/* 257 */
8255/***/ (function(module, exports, __webpack_require__) {
8256
8257var getBuiltIn = __webpack_require__(18);
8258var uncurryThis = __webpack_require__(4);
8259var getOwnPropertyNamesModule = __webpack_require__(114);
8260var getOwnPropertySymbolsModule = __webpack_require__(119);
8261var anObject = __webpack_require__(21);
8262
8263var concat = uncurryThis([].concat);
8264
8265// all object keys, includes non-enumerable and symbols
8266module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
8267 var keys = getOwnPropertyNamesModule.f(anObject(it));
8268 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
8269 return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
8270};
8271
8272
8273/***/ }),
8274/* 258 */
8275/***/ (function(module, exports) {
8276
8277var ceil = Math.ceil;
8278var floor = Math.floor;
8279
8280// `Math.trunc` method
8281// https://tc39.es/ecma262/#sec-math.trunc
8282// eslint-disable-next-line es-x/no-math-trunc -- safe
8283module.exports = Math.trunc || function trunc(x) {
8284 var n = +x;
8285 return (n > 0 ? floor : ceil)(n);
8286};
8287
8288
8289/***/ }),
8290/* 259 */
8291/***/ (function(module, exports, __webpack_require__) {
8292
8293var toIntegerOrInfinity = __webpack_require__(117);
8294
8295var min = Math.min;
8296
8297// `ToLength` abstract operation
8298// https://tc39.es/ecma262/#sec-tolength
8299module.exports = function (argument) {
8300 return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
8301};
8302
8303
8304/***/ }),
8305/* 260 */
8306/***/ (function(module, exports, __webpack_require__) {
8307
8308var uncurryThis = __webpack_require__(4);
8309
8310var $Error = Error;
8311var replace = uncurryThis(''.replace);
8312
8313var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
8314var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
8315var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
8316
8317module.exports = function (stack, dropEntries) {
8318 if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
8319 while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
8320 } return stack;
8321};
8322
8323
8324/***/ }),
8325/* 261 */
8326/***/ (function(module, exports, __webpack_require__) {
8327
8328var isObject = __webpack_require__(17);
8329var createNonEnumerableProperty = __webpack_require__(39);
8330
8331// `InstallErrorCause` abstract operation
8332// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
8333module.exports = function (O, options) {
8334 if (isObject(options) && 'cause' in options) {
8335 createNonEnumerableProperty(O, 'cause', options.cause);
8336 }
8337};
8338
8339
8340/***/ }),
8341/* 262 */
8342/***/ (function(module, exports, __webpack_require__) {
8343
8344var toString = __webpack_require__(40);
8345
8346module.exports = function (argument, $default) {
8347 return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
8348};
8349
8350
8351/***/ }),
8352/* 263 */
8353/***/ (function(module, exports, __webpack_require__) {
8354
8355var fails = __webpack_require__(3);
8356var createPropertyDescriptor = __webpack_require__(44);
8357
8358module.exports = !fails(function () {
8359 var error = Error('a');
8360 if (!('stack' in error)) return true;
8361 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
8362 Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
8363 return error.stack !== 7;
8364});
8365
8366
8367/***/ }),
8368/* 264 */
8369/***/ (function(module, exports, __webpack_require__) {
8370
8371var global = __webpack_require__(9);
8372var isCallable = __webpack_require__(8);
8373var inspectSource = __webpack_require__(123);
8374
8375var WeakMap = global.WeakMap;
8376
8377module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
8378
8379
8380/***/ }),
8381/* 265 */
8382/***/ (function(module, exports, __webpack_require__) {
8383
8384"use strict";
8385
8386var IteratorPrototype = __webpack_require__(159).IteratorPrototype;
8387var create = __webpack_require__(59);
8388var createPropertyDescriptor = __webpack_require__(44);
8389var setToStringTag = __webpack_require__(61);
8390var Iterators = __webpack_require__(46);
8391
8392var returnThis = function () { return this; };
8393
8394module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
8395 var TO_STRING_TAG = NAME + ' Iterator';
8396 IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
8397 setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
8398 Iterators[TO_STRING_TAG] = returnThis;
8399 return IteratorConstructor;
8400};
8401
8402
8403/***/ }),
8404/* 266 */
8405/***/ (function(module, exports, __webpack_require__) {
8406
8407"use strict";
8408
8409var TO_STRING_TAG_SUPPORT = __webpack_require__(121);
8410var classof = __webpack_require__(47);
8411
8412// `Object.prototype.toString` method implementation
8413// https://tc39.es/ecma262/#sec-object.prototype.tostring
8414module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
8415 return '[object ' + classof(this) + ']';
8416};
8417
8418
8419/***/ }),
8420/* 267 */
8421/***/ (function(module, exports, __webpack_require__) {
8422
8423// TODO: Remove this module from `core-js@4` since it's split to modules listed below
8424__webpack_require__(268);
8425__webpack_require__(278);
8426__webpack_require__(279);
8427__webpack_require__(280);
8428__webpack_require__(281);
8429__webpack_require__(282);
8430
8431
8432/***/ }),
8433/* 268 */
8434/***/ (function(module, exports, __webpack_require__) {
8435
8436"use strict";
8437
8438var $ = __webpack_require__(0);
8439var IS_PURE = __webpack_require__(32);
8440var IS_NODE = __webpack_require__(97);
8441var global = __webpack_require__(9);
8442var call = __webpack_require__(11);
8443var defineBuiltIn = __webpack_require__(48);
8444var setPrototypeOf = __webpack_require__(92);
8445var setToStringTag = __webpack_require__(61);
8446var setSpecies = __webpack_require__(269);
8447var aCallable = __webpack_require__(28);
8448var isCallable = __webpack_require__(8);
8449var isObject = __webpack_require__(17);
8450var anInstance = __webpack_require__(270);
8451var speciesConstructor = __webpack_require__(160);
8452var task = __webpack_require__(162).set;
8453var microtask = __webpack_require__(272);
8454var hostReportErrors = __webpack_require__(275);
8455var perform = __webpack_require__(77);
8456var Queue = __webpack_require__(276);
8457var InternalStateModule = __webpack_require__(95);
8458var NativePromiseConstructor = __webpack_require__(62);
8459var PromiseConstructorDetection = __webpack_require__(78);
8460var newPromiseCapabilityModule = __webpack_require__(49);
8461
8462var PROMISE = 'Promise';
8463var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
8464var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
8465var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
8466var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
8467var setInternalState = InternalStateModule.set;
8468var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
8469var PromiseConstructor = NativePromiseConstructor;
8470var PromisePrototype = NativePromisePrototype;
8471var TypeError = global.TypeError;
8472var document = global.document;
8473var process = global.process;
8474var newPromiseCapability = newPromiseCapabilityModule.f;
8475var newGenericPromiseCapability = newPromiseCapability;
8476
8477var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
8478var UNHANDLED_REJECTION = 'unhandledrejection';
8479var REJECTION_HANDLED = 'rejectionhandled';
8480var PENDING = 0;
8481var FULFILLED = 1;
8482var REJECTED = 2;
8483var HANDLED = 1;
8484var UNHANDLED = 2;
8485
8486var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
8487
8488// helpers
8489var isThenable = function (it) {
8490 var then;
8491 return isObject(it) && isCallable(then = it.then) ? then : false;
8492};
8493
8494var callReaction = function (reaction, state) {
8495 var value = state.value;
8496 var ok = state.state == FULFILLED;
8497 var handler = ok ? reaction.ok : reaction.fail;
8498 var resolve = reaction.resolve;
8499 var reject = reaction.reject;
8500 var domain = reaction.domain;
8501 var result, then, exited;
8502 try {
8503 if (handler) {
8504 if (!ok) {
8505 if (state.rejection === UNHANDLED) onHandleUnhandled(state);
8506 state.rejection = HANDLED;
8507 }
8508 if (handler === true) result = value;
8509 else {
8510 if (domain) domain.enter();
8511 result = handler(value); // can throw
8512 if (domain) {
8513 domain.exit();
8514 exited = true;
8515 }
8516 }
8517 if (result === reaction.promise) {
8518 reject(TypeError('Promise-chain cycle'));
8519 } else if (then = isThenable(result)) {
8520 call(then, result, resolve, reject);
8521 } else resolve(result);
8522 } else reject(value);
8523 } catch (error) {
8524 if (domain && !exited) domain.exit();
8525 reject(error);
8526 }
8527};
8528
8529var notify = function (state, isReject) {
8530 if (state.notified) return;
8531 state.notified = true;
8532 microtask(function () {
8533 var reactions = state.reactions;
8534 var reaction;
8535 while (reaction = reactions.get()) {
8536 callReaction(reaction, state);
8537 }
8538 state.notified = false;
8539 if (isReject && !state.rejection) onUnhandled(state);
8540 });
8541};
8542
8543var dispatchEvent = function (name, promise, reason) {
8544 var event, handler;
8545 if (DISPATCH_EVENT) {
8546 event = document.createEvent('Event');
8547 event.promise = promise;
8548 event.reason = reason;
8549 event.initEvent(name, false, true);
8550 global.dispatchEvent(event);
8551 } else event = { promise: promise, reason: reason };
8552 if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
8553 else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
8554};
8555
8556var onUnhandled = function (state) {
8557 call(task, global, function () {
8558 var promise = state.facade;
8559 var value = state.value;
8560 var IS_UNHANDLED = isUnhandled(state);
8561 var result;
8562 if (IS_UNHANDLED) {
8563 result = perform(function () {
8564 if (IS_NODE) {
8565 process.emit('unhandledRejection', value, promise);
8566 } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
8567 });
8568 // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
8569 state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
8570 if (result.error) throw result.value;
8571 }
8572 });
8573};
8574
8575var isUnhandled = function (state) {
8576 return state.rejection !== HANDLED && !state.parent;
8577};
8578
8579var onHandleUnhandled = function (state) {
8580 call(task, global, function () {
8581 var promise = state.facade;
8582 if (IS_NODE) {
8583 process.emit('rejectionHandled', promise);
8584 } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
8585 });
8586};
8587
8588var bind = function (fn, state, unwrap) {
8589 return function (value) {
8590 fn(state, value, unwrap);
8591 };
8592};
8593
8594var internalReject = function (state, value, unwrap) {
8595 if (state.done) return;
8596 state.done = true;
8597 if (unwrap) state = unwrap;
8598 state.value = value;
8599 state.state = REJECTED;
8600 notify(state, true);
8601};
8602
8603var internalResolve = function (state, value, unwrap) {
8604 if (state.done) return;
8605 state.done = true;
8606 if (unwrap) state = unwrap;
8607 try {
8608 if (state.facade === value) throw TypeError("Promise can't be resolved itself");
8609 var then = isThenable(value);
8610 if (then) {
8611 microtask(function () {
8612 var wrapper = { done: false };
8613 try {
8614 call(then, value,
8615 bind(internalResolve, wrapper, state),
8616 bind(internalReject, wrapper, state)
8617 );
8618 } catch (error) {
8619 internalReject(wrapper, error, state);
8620 }
8621 });
8622 } else {
8623 state.value = value;
8624 state.state = FULFILLED;
8625 notify(state, false);
8626 }
8627 } catch (error) {
8628 internalReject({ done: false }, error, state);
8629 }
8630};
8631
8632// constructor polyfill
8633if (FORCED_PROMISE_CONSTRUCTOR) {
8634 // 25.4.3.1 Promise(executor)
8635 PromiseConstructor = function Promise(executor) {
8636 anInstance(this, PromisePrototype);
8637 aCallable(executor);
8638 call(Internal, this);
8639 var state = getInternalPromiseState(this);
8640 try {
8641 executor(bind(internalResolve, state), bind(internalReject, state));
8642 } catch (error) {
8643 internalReject(state, error);
8644 }
8645 };
8646
8647 PromisePrototype = PromiseConstructor.prototype;
8648
8649 // eslint-disable-next-line no-unused-vars -- required for `.length`
8650 Internal = function Promise(executor) {
8651 setInternalState(this, {
8652 type: PROMISE,
8653 done: false,
8654 notified: false,
8655 parent: false,
8656 reactions: new Queue(),
8657 rejection: false,
8658 state: PENDING,
8659 value: undefined
8660 });
8661 };
8662
8663 // `Promise.prototype.then` method
8664 // https://tc39.es/ecma262/#sec-promise.prototype.then
8665 Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
8666 var state = getInternalPromiseState(this);
8667 var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
8668 state.parent = true;
8669 reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
8670 reaction.fail = isCallable(onRejected) && onRejected;
8671 reaction.domain = IS_NODE ? process.domain : undefined;
8672 if (state.state == PENDING) state.reactions.add(reaction);
8673 else microtask(function () {
8674 callReaction(reaction, state);
8675 });
8676 return reaction.promise;
8677 });
8678
8679 OwnPromiseCapability = function () {
8680 var promise = new Internal();
8681 var state = getInternalPromiseState(promise);
8682 this.promise = promise;
8683 this.resolve = bind(internalResolve, state);
8684 this.reject = bind(internalReject, state);
8685 };
8686
8687 newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
8688 return C === PromiseConstructor || C === PromiseWrapper
8689 ? new OwnPromiseCapability(C)
8690 : newGenericPromiseCapability(C);
8691 };
8692
8693 if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
8694 nativeThen = NativePromisePrototype.then;
8695
8696 if (!NATIVE_PROMISE_SUBCLASSING) {
8697 // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
8698 defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
8699 var that = this;
8700 return new PromiseConstructor(function (resolve, reject) {
8701 call(nativeThen, that, resolve, reject);
8702 }).then(onFulfilled, onRejected);
8703 // https://github.com/zloirock/core-js/issues/640
8704 }, { unsafe: true });
8705 }
8706
8707 // make `.constructor === Promise` work for native promise-based APIs
8708 try {
8709 delete NativePromisePrototype.constructor;
8710 } catch (error) { /* empty */ }
8711
8712 // make `instanceof Promise` work for native promise-based APIs
8713 if (setPrototypeOf) {
8714 setPrototypeOf(NativePromisePrototype, PromisePrototype);
8715 }
8716 }
8717}
8718
8719$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
8720 Promise: PromiseConstructor
8721});
8722
8723setToStringTag(PromiseConstructor, PROMISE, false, true);
8724setSpecies(PROMISE);
8725
8726
8727/***/ }),
8728/* 269 */
8729/***/ (function(module, exports, __webpack_require__) {
8730
8731"use strict";
8732
8733var getBuiltIn = __webpack_require__(18);
8734var definePropertyModule = __webpack_require__(34);
8735var wellKnownSymbol = __webpack_require__(5);
8736var DESCRIPTORS = __webpack_require__(20);
8737
8738var SPECIES = wellKnownSymbol('species');
8739
8740module.exports = function (CONSTRUCTOR_NAME) {
8741 var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
8742 var defineProperty = definePropertyModule.f;
8743
8744 if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
8745 defineProperty(Constructor, SPECIES, {
8746 configurable: true,
8747 get: function () { return this; }
8748 });
8749 }
8750};
8751
8752
8753/***/ }),
8754/* 270 */
8755/***/ (function(module, exports, __webpack_require__) {
8756
8757var isPrototypeOf = __webpack_require__(12);
8758
8759var $TypeError = TypeError;
8760
8761module.exports = function (it, Prototype) {
8762 if (isPrototypeOf(Prototype, it)) return it;
8763 throw $TypeError('Incorrect invocation');
8764};
8765
8766
8767/***/ }),
8768/* 271 */
8769/***/ (function(module, exports) {
8770
8771var $TypeError = TypeError;
8772
8773module.exports = function (passed, required) {
8774 if (passed < required) throw $TypeError('Not enough arguments');
8775 return passed;
8776};
8777
8778
8779/***/ }),
8780/* 272 */
8781/***/ (function(module, exports, __webpack_require__) {
8782
8783var global = __webpack_require__(9);
8784var bind = __webpack_require__(58);
8785var getOwnPropertyDescriptor = __webpack_require__(73).f;
8786var macrotask = __webpack_require__(162).set;
8787var IS_IOS = __webpack_require__(163);
8788var IS_IOS_PEBBLE = __webpack_require__(273);
8789var IS_WEBOS_WEBKIT = __webpack_require__(274);
8790var IS_NODE = __webpack_require__(97);
8791
8792var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
8793var document = global.document;
8794var process = global.process;
8795var Promise = global.Promise;
8796// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
8797var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
8798var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
8799
8800var flush, head, last, notify, toggle, node, promise, then;
8801
8802// modern engines have queueMicrotask method
8803if (!queueMicrotask) {
8804 flush = function () {
8805 var parent, fn;
8806 if (IS_NODE && (parent = process.domain)) parent.exit();
8807 while (head) {
8808 fn = head.fn;
8809 head = head.next;
8810 try {
8811 fn();
8812 } catch (error) {
8813 if (head) notify();
8814 else last = undefined;
8815 throw error;
8816 }
8817 } last = undefined;
8818 if (parent) parent.enter();
8819 };
8820
8821 // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
8822 // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
8823 if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
8824 toggle = true;
8825 node = document.createTextNode('');
8826 new MutationObserver(flush).observe(node, { characterData: true });
8827 notify = function () {
8828 node.data = toggle = !toggle;
8829 };
8830 // environments with maybe non-completely correct, but existent Promise
8831 } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
8832 // Promise.resolve without an argument throws an error in LG WebOS 2
8833 promise = Promise.resolve(undefined);
8834 // workaround of WebKit ~ iOS Safari 10.1 bug
8835 promise.constructor = Promise;
8836 then = bind(promise.then, promise);
8837 notify = function () {
8838 then(flush);
8839 };
8840 // Node.js without promises
8841 } else if (IS_NODE) {
8842 notify = function () {
8843 process.nextTick(flush);
8844 };
8845 // for other environments - macrotask based on:
8846 // - setImmediate
8847 // - MessageChannel
8848 // - window.postMessage
8849 // - onreadystatechange
8850 // - setTimeout
8851 } else {
8852 // strange IE + webpack dev server bug - use .bind(global)
8853 macrotask = bind(macrotask, global);
8854 notify = function () {
8855 macrotask(flush);
8856 };
8857 }
8858}
8859
8860module.exports = queueMicrotask || function (fn) {
8861 var task = { fn: fn, next: undefined };
8862 if (last) last.next = task;
8863 if (!head) {
8864 head = task;
8865 notify();
8866 } last = task;
8867};
8868
8869
8870/***/ }),
8871/* 273 */
8872/***/ (function(module, exports, __webpack_require__) {
8873
8874var userAgent = __webpack_require__(45);
8875var global = __webpack_require__(9);
8876
8877module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
8878
8879
8880/***/ }),
8881/* 274 */
8882/***/ (function(module, exports, __webpack_require__) {
8883
8884var userAgent = __webpack_require__(45);
8885
8886module.exports = /web0s(?!.*chrome)/i.test(userAgent);
8887
8888
8889/***/ }),
8890/* 275 */
8891/***/ (function(module, exports, __webpack_require__) {
8892
8893var global = __webpack_require__(9);
8894
8895module.exports = function (a, b) {
8896 var console = global.console;
8897 if (console && console.error) {
8898 arguments.length == 1 ? console.error(a) : console.error(a, b);
8899 }
8900};
8901
8902
8903/***/ }),
8904/* 276 */
8905/***/ (function(module, exports) {
8906
8907var Queue = function () {
8908 this.head = null;
8909 this.tail = null;
8910};
8911
8912Queue.prototype = {
8913 add: function (item) {
8914 var entry = { item: item, next: null };
8915 if (this.head) this.tail.next = entry;
8916 else this.head = entry;
8917 this.tail = entry;
8918 },
8919 get: function () {
8920 var entry = this.head;
8921 if (entry) {
8922 this.head = entry.next;
8923 if (this.tail === entry) this.tail = null;
8924 return entry.item;
8925 }
8926 }
8927};
8928
8929module.exports = Queue;
8930
8931
8932/***/ }),
8933/* 277 */
8934/***/ (function(module, exports) {
8935
8936module.exports = typeof window == 'object' && typeof Deno != 'object';
8937
8938
8939/***/ }),
8940/* 278 */
8941/***/ (function(module, exports, __webpack_require__) {
8942
8943"use strict";
8944
8945var $ = __webpack_require__(0);
8946var call = __webpack_require__(11);
8947var aCallable = __webpack_require__(28);
8948var newPromiseCapabilityModule = __webpack_require__(49);
8949var perform = __webpack_require__(77);
8950var iterate = __webpack_require__(76);
8951var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(164);
8952
8953// `Promise.all` method
8954// https://tc39.es/ecma262/#sec-promise.all
8955$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
8956 all: function all(iterable) {
8957 var C = this;
8958 var capability = newPromiseCapabilityModule.f(C);
8959 var resolve = capability.resolve;
8960 var reject = capability.reject;
8961 var result = perform(function () {
8962 var $promiseResolve = aCallable(C.resolve);
8963 var values = [];
8964 var counter = 0;
8965 var remaining = 1;
8966 iterate(iterable, function (promise) {
8967 var index = counter++;
8968 var alreadyCalled = false;
8969 remaining++;
8970 call($promiseResolve, C, promise).then(function (value) {
8971 if (alreadyCalled) return;
8972 alreadyCalled = true;
8973 values[index] = value;
8974 --remaining || resolve(values);
8975 }, reject);
8976 });
8977 --remaining || resolve(values);
8978 });
8979 if (result.error) reject(result.value);
8980 return capability.promise;
8981 }
8982});
8983
8984
8985/***/ }),
8986/* 279 */
8987/***/ (function(module, exports, __webpack_require__) {
8988
8989"use strict";
8990
8991var $ = __webpack_require__(0);
8992var IS_PURE = __webpack_require__(32);
8993var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(78).CONSTRUCTOR;
8994var NativePromiseConstructor = __webpack_require__(62);
8995var getBuiltIn = __webpack_require__(18);
8996var isCallable = __webpack_require__(8);
8997var defineBuiltIn = __webpack_require__(48);
8998
8999var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
9000
9001// `Promise.prototype.catch` method
9002// https://tc39.es/ecma262/#sec-promise.prototype.catch
9003$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
9004 'catch': function (onRejected) {
9005 return this.then(undefined, onRejected);
9006 }
9007});
9008
9009// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
9010if (!IS_PURE && isCallable(NativePromiseConstructor)) {
9011 var method = getBuiltIn('Promise').prototype['catch'];
9012 if (NativePromisePrototype['catch'] !== method) {
9013 defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
9014 }
9015}
9016
9017
9018/***/ }),
9019/* 280 */
9020/***/ (function(module, exports, __webpack_require__) {
9021
9022"use strict";
9023
9024var $ = __webpack_require__(0);
9025var call = __webpack_require__(11);
9026var aCallable = __webpack_require__(28);
9027var newPromiseCapabilityModule = __webpack_require__(49);
9028var perform = __webpack_require__(77);
9029var iterate = __webpack_require__(76);
9030var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(164);
9031
9032// `Promise.race` method
9033// https://tc39.es/ecma262/#sec-promise.race
9034$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
9035 race: function race(iterable) {
9036 var C = this;
9037 var capability = newPromiseCapabilityModule.f(C);
9038 var reject = capability.reject;
9039 var result = perform(function () {
9040 var $promiseResolve = aCallable(C.resolve);
9041 iterate(iterable, function (promise) {
9042 call($promiseResolve, C, promise).then(capability.resolve, reject);
9043 });
9044 });
9045 if (result.error) reject(result.value);
9046 return capability.promise;
9047 }
9048});
9049
9050
9051/***/ }),
9052/* 281 */
9053/***/ (function(module, exports, __webpack_require__) {
9054
9055"use strict";
9056
9057var $ = __webpack_require__(0);
9058var call = __webpack_require__(11);
9059var newPromiseCapabilityModule = __webpack_require__(49);
9060var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(78).CONSTRUCTOR;
9061
9062// `Promise.reject` method
9063// https://tc39.es/ecma262/#sec-promise.reject
9064$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
9065 reject: function reject(r) {
9066 var capability = newPromiseCapabilityModule.f(this);
9067 call(capability.reject, undefined, r);
9068 return capability.promise;
9069 }
9070});
9071
9072
9073/***/ }),
9074/* 282 */
9075/***/ (function(module, exports, __webpack_require__) {
9076
9077"use strict";
9078
9079var $ = __webpack_require__(0);
9080var getBuiltIn = __webpack_require__(18);
9081var IS_PURE = __webpack_require__(32);
9082var NativePromiseConstructor = __webpack_require__(62);
9083var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(78).CONSTRUCTOR;
9084var promiseResolve = __webpack_require__(166);
9085
9086var PromiseConstructorWrapper = getBuiltIn('Promise');
9087var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
9088
9089// `Promise.resolve` method
9090// https://tc39.es/ecma262/#sec-promise.resolve
9091$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
9092 resolve: function resolve(x) {
9093 return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
9094 }
9095});
9096
9097
9098/***/ }),
9099/* 283 */
9100/***/ (function(module, exports, __webpack_require__) {
9101
9102"use strict";
9103
9104var $ = __webpack_require__(0);
9105var call = __webpack_require__(11);
9106var aCallable = __webpack_require__(28);
9107var newPromiseCapabilityModule = __webpack_require__(49);
9108var perform = __webpack_require__(77);
9109var iterate = __webpack_require__(76);
9110
9111// `Promise.allSettled` method
9112// https://tc39.es/ecma262/#sec-promise.allsettled
9113$({ target: 'Promise', stat: true }, {
9114 allSettled: function allSettled(iterable) {
9115 var C = this;
9116 var capability = newPromiseCapabilityModule.f(C);
9117 var resolve = capability.resolve;
9118 var reject = capability.reject;
9119 var result = perform(function () {
9120 var promiseResolve = aCallable(C.resolve);
9121 var values = [];
9122 var counter = 0;
9123 var remaining = 1;
9124 iterate(iterable, function (promise) {
9125 var index = counter++;
9126 var alreadyCalled = false;
9127 remaining++;
9128 call(promiseResolve, C, promise).then(function (value) {
9129 if (alreadyCalled) return;
9130 alreadyCalled = true;
9131 values[index] = { status: 'fulfilled', value: value };
9132 --remaining || resolve(values);
9133 }, function (error) {
9134 if (alreadyCalled) return;
9135 alreadyCalled = true;
9136 values[index] = { status: 'rejected', reason: error };
9137 --remaining || resolve(values);
9138 });
9139 });
9140 --remaining || resolve(values);
9141 });
9142 if (result.error) reject(result.value);
9143 return capability.promise;
9144 }
9145});
9146
9147
9148/***/ }),
9149/* 284 */
9150/***/ (function(module, exports, __webpack_require__) {
9151
9152"use strict";
9153
9154var $ = __webpack_require__(0);
9155var call = __webpack_require__(11);
9156var aCallable = __webpack_require__(28);
9157var getBuiltIn = __webpack_require__(18);
9158var newPromiseCapabilityModule = __webpack_require__(49);
9159var perform = __webpack_require__(77);
9160var iterate = __webpack_require__(76);
9161
9162var PROMISE_ANY_ERROR = 'No one promise resolved';
9163
9164// `Promise.any` method
9165// https://tc39.es/ecma262/#sec-promise.any
9166$({ target: 'Promise', stat: true }, {
9167 any: function any(iterable) {
9168 var C = this;
9169 var AggregateError = getBuiltIn('AggregateError');
9170 var capability = newPromiseCapabilityModule.f(C);
9171 var resolve = capability.resolve;
9172 var reject = capability.reject;
9173 var result = perform(function () {
9174 var promiseResolve = aCallable(C.resolve);
9175 var errors = [];
9176 var counter = 0;
9177 var remaining = 1;
9178 var alreadyResolved = false;
9179 iterate(iterable, function (promise) {
9180 var index = counter++;
9181 var alreadyRejected = false;
9182 remaining++;
9183 call(promiseResolve, C, promise).then(function (value) {
9184 if (alreadyRejected || alreadyResolved) return;
9185 alreadyResolved = true;
9186 resolve(value);
9187 }, function (error) {
9188 if (alreadyRejected || alreadyResolved) return;
9189 alreadyRejected = true;
9190 errors[index] = error;
9191 --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
9192 });
9193 });
9194 --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
9195 });
9196 if (result.error) reject(result.value);
9197 return capability.promise;
9198 }
9199});
9200
9201
9202/***/ }),
9203/* 285 */
9204/***/ (function(module, exports, __webpack_require__) {
9205
9206"use strict";
9207
9208var $ = __webpack_require__(0);
9209var IS_PURE = __webpack_require__(32);
9210var NativePromiseConstructor = __webpack_require__(62);
9211var fails = __webpack_require__(3);
9212var getBuiltIn = __webpack_require__(18);
9213var isCallable = __webpack_require__(8);
9214var speciesConstructor = __webpack_require__(160);
9215var promiseResolve = __webpack_require__(166);
9216var defineBuiltIn = __webpack_require__(48);
9217
9218var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
9219
9220// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
9221var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
9222 // eslint-disable-next-line unicorn/no-thenable -- required for testing
9223 NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
9224});
9225
9226// `Promise.prototype.finally` method
9227// https://tc39.es/ecma262/#sec-promise.prototype.finally
9228$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
9229 'finally': function (onFinally) {
9230 var C = speciesConstructor(this, getBuiltIn('Promise'));
9231 var isFunction = isCallable(onFinally);
9232 return this.then(
9233 isFunction ? function (x) {
9234 return promiseResolve(C, onFinally()).then(function () { return x; });
9235 } : onFinally,
9236 isFunction ? function (e) {
9237 return promiseResolve(C, onFinally()).then(function () { throw e; });
9238 } : onFinally
9239 );
9240 }
9241});
9242
9243// makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
9244if (!IS_PURE && isCallable(NativePromiseConstructor)) {
9245 var method = getBuiltIn('Promise').prototype['finally'];
9246 if (NativePromisePrototype['finally'] !== method) {
9247 defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
9248 }
9249}
9250
9251
9252/***/ }),
9253/* 286 */
9254/***/ (function(module, exports, __webpack_require__) {
9255
9256var uncurryThis = __webpack_require__(4);
9257var toIntegerOrInfinity = __webpack_require__(117);
9258var toString = __webpack_require__(40);
9259var requireObjectCoercible = __webpack_require__(74);
9260
9261var charAt = uncurryThis(''.charAt);
9262var charCodeAt = uncurryThis(''.charCodeAt);
9263var stringSlice = uncurryThis(''.slice);
9264
9265var createMethod = function (CONVERT_TO_STRING) {
9266 return function ($this, pos) {
9267 var S = toString(requireObjectCoercible($this));
9268 var position = toIntegerOrInfinity(pos);
9269 var size = S.length;
9270 var first, second;
9271 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
9272 first = charCodeAt(S, position);
9273 return first < 0xD800 || first > 0xDBFF || position + 1 === size
9274 || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
9275 ? CONVERT_TO_STRING
9276 ? charAt(S, position)
9277 : first
9278 : CONVERT_TO_STRING
9279 ? stringSlice(S, position, position + 2)
9280 : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
9281 };
9282};
9283
9284module.exports = {
9285 // `String.prototype.codePointAt` method
9286 // https://tc39.es/ecma262/#sec-string.prototype.codepointat
9287 codeAt: createMethod(false),
9288 // `String.prototype.at` method
9289 // https://github.com/mathiasbynens/String.prototype.at
9290 charAt: createMethod(true)
9291};
9292
9293
9294/***/ }),
9295/* 287 */
9296/***/ (function(module, exports) {
9297
9298// iterable DOM collections
9299// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
9300module.exports = {
9301 CSSRuleList: 0,
9302 CSSStyleDeclaration: 0,
9303 CSSValueList: 0,
9304 ClientRectList: 0,
9305 DOMRectList: 0,
9306 DOMStringList: 0,
9307 DOMTokenList: 1,
9308 DataTransferItemList: 0,
9309 FileList: 0,
9310 HTMLAllCollection: 0,
9311 HTMLCollection: 0,
9312 HTMLFormElement: 0,
9313 HTMLSelectElement: 0,
9314 MediaList: 0,
9315 MimeTypeArray: 0,
9316 NamedNodeMap: 0,
9317 NodeList: 1,
9318 PaintRequestList: 0,
9319 Plugin: 0,
9320 PluginArray: 0,
9321 SVGLengthList: 0,
9322 SVGNumberList: 0,
9323 SVGPathSegList: 0,
9324 SVGPointList: 0,
9325 SVGStringList: 0,
9326 SVGTransformList: 0,
9327 SourceBufferList: 0,
9328 StyleSheetList: 0,
9329 TextTrackCueList: 0,
9330 TextTrackList: 0,
9331 TouchList: 0
9332};
9333
9334
9335/***/ }),
9336/* 288 */
9337/***/ (function(module, __webpack_exports__, __webpack_require__) {
9338
9339"use strict";
9340/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_js__ = __webpack_require__(124);
9341// Default Export
9342// ==============
9343// In this module, we mix our bundled exports into the `_` object and export
9344// the result. This is analogous to setting `module.exports = _` in CommonJS.
9345// Hence, this module is also the entry point of our UMD bundle and the package
9346// entry point for CommonJS and AMD users. In other words, this is (the source
9347// of) the module you are interfacing with when you do any of the following:
9348//
9349// ```js
9350// // CommonJS
9351// var _ = require('underscore');
9352//
9353// // AMD
9354// define(['underscore'], function(_) {...});
9355//
9356// // UMD in the browser
9357// // _ is available as a global variable
9358// ```
9359
9360
9361
9362// Add all of the Underscore functions to the wrapper object.
9363var _ = Object(__WEBPACK_IMPORTED_MODULE_0__index_js__["mixin"])(__WEBPACK_IMPORTED_MODULE_0__index_js__);
9364// Legacy Node.js API.
9365_._ = _;
9366// Export the Underscore API.
9367/* harmony default export */ __webpack_exports__["a"] = (_);
9368
9369
9370/***/ }),
9371/* 289 */
9372/***/ (function(module, __webpack_exports__, __webpack_require__) {
9373
9374"use strict";
9375/* harmony export (immutable) */ __webpack_exports__["a"] = isNull;
9376// Is a given value equal to null?
9377function isNull(obj) {
9378 return obj === null;
9379}
9380
9381
9382/***/ }),
9383/* 290 */
9384/***/ (function(module, __webpack_exports__, __webpack_require__) {
9385
9386"use strict";
9387/* harmony export (immutable) */ __webpack_exports__["a"] = isElement;
9388// Is a given value a DOM element?
9389function isElement(obj) {
9390 return !!(obj && obj.nodeType === 1);
9391}
9392
9393
9394/***/ }),
9395/* 291 */
9396/***/ (function(module, __webpack_exports__, __webpack_require__) {
9397
9398"use strict";
9399/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
9400
9401
9402/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Date'));
9403
9404
9405/***/ }),
9406/* 292 */
9407/***/ (function(module, __webpack_exports__, __webpack_require__) {
9408
9409"use strict";
9410/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
9411
9412
9413/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('RegExp'));
9414
9415
9416/***/ }),
9417/* 293 */
9418/***/ (function(module, __webpack_exports__, __webpack_require__) {
9419
9420"use strict";
9421/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
9422
9423
9424/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Error'));
9425
9426
9427/***/ }),
9428/* 294 */
9429/***/ (function(module, __webpack_exports__, __webpack_require__) {
9430
9431"use strict";
9432/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
9433
9434
9435/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Object'));
9436
9437
9438/***/ }),
9439/* 295 */
9440/***/ (function(module, __webpack_exports__, __webpack_require__) {
9441
9442"use strict";
9443/* harmony export (immutable) */ __webpack_exports__["a"] = isFinite;
9444/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
9445/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(170);
9446
9447
9448
9449// Is a given object a finite number?
9450function isFinite(obj) {
9451 return !Object(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["f" /* _isFinite */])(obj) && !isNaN(parseFloat(obj));
9452}
9453
9454
9455/***/ }),
9456/* 296 */
9457/***/ (function(module, __webpack_exports__, __webpack_require__) {
9458
9459"use strict";
9460/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(175);
9461/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getByteLength_js__ = __webpack_require__(128);
9462
9463
9464
9465// Internal helper to determine whether we should spend extensive checks against
9466// `ArrayBuffer` et al.
9467/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getByteLength_js__["a" /* default */]));
9468
9469
9470/***/ }),
9471/* 297 */
9472/***/ (function(module, __webpack_exports__, __webpack_require__) {
9473
9474"use strict";
9475/* harmony export (immutable) */ __webpack_exports__["a"] = isEmpty;
9476/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(30);
9477/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(51);
9478/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(125);
9479/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(127);
9480/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keys_js__ = __webpack_require__(14);
9481
9482
9483
9484
9485
9486
9487// Is a given array, string, or object empty?
9488// An "empty" object has no enumerable own-properties.
9489function isEmpty(obj) {
9490 if (obj == null) return true;
9491 // Skip the more expensive `toString`-based type checks if `obj` has no
9492 // `.length`.
9493 var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(obj);
9494 if (typeof length == 'number' && (
9495 Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) || Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" /* default */])(obj)
9496 )) return length === 0;
9497 return Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__keys_js__["a" /* default */])(obj)) === 0;
9498}
9499
9500
9501/***/ }),
9502/* 298 */
9503/***/ (function(module, __webpack_exports__, __webpack_require__) {
9504
9505"use strict";
9506/* harmony export (immutable) */ __webpack_exports__["a"] = isEqual;
9507/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
9508/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
9509/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getByteLength_js__ = __webpack_require__(128);
9510/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__ = __webpack_require__(173);
9511/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isFunction_js__ = __webpack_require__(29);
9512/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__ = __webpack_require__(80);
9513/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isDataView_js__ = __webpack_require__(126);
9514/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__keys_js__ = __webpack_require__(14);
9515/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__has_js__ = __webpack_require__(41);
9516/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__toBufferView_js__ = __webpack_require__(299);
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528// We use this string twice, so give it a name for minification.
9529var tagDataView = '[object DataView]';
9530
9531// Internal recursive comparison function for `_.isEqual`.
9532function eq(a, b, aStack, bStack) {
9533 // Identical objects are equal. `0 === -0`, but they aren't identical.
9534 // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
9535 if (a === b) return a !== 0 || 1 / a === 1 / b;
9536 // `null` or `undefined` only equal to itself (strict comparison).
9537 if (a == null || b == null) return false;
9538 // `NaN`s are equivalent, but non-reflexive.
9539 if (a !== a) return b !== b;
9540 // Exhaust primitive checks
9541 var type = typeof a;
9542 if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
9543 return deepEq(a, b, aStack, bStack);
9544}
9545
9546// Internal recursive comparison function for `_.isEqual`.
9547function deepEq(a, b, aStack, bStack) {
9548 // Unwrap any wrapped objects.
9549 if (a instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) a = a._wrapped;
9550 if (b instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) b = b._wrapped;
9551 // Compare `[[Class]]` names.
9552 var className = __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(a);
9553 if (className !== __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(b)) return false;
9554 // Work around a bug in IE 10 - Edge 13.
9555 if (__WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__["a" /* hasStringTagBug */] && className == '[object Object]' && Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(a)) {
9556 if (!Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(b)) return false;
9557 className = tagDataView;
9558 }
9559 switch (className) {
9560 // These types are compared by value.
9561 case '[object RegExp]':
9562 // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
9563 case '[object String]':
9564 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
9565 // equivalent to `new String("5")`.
9566 return '' + a === '' + b;
9567 case '[object Number]':
9568 // `NaN`s are equivalent, but non-reflexive.
9569 // Object(NaN) is equivalent to NaN.
9570 if (+a !== +a) return +b !== +b;
9571 // An `egal` comparison is performed for other numeric values.
9572 return +a === 0 ? 1 / +a === 1 / b : +a === +b;
9573 case '[object Date]':
9574 case '[object Boolean]':
9575 // Coerce dates and booleans to numeric primitive values. Dates are compared by their
9576 // millisecond representations. Note that invalid dates with millisecond representations
9577 // of `NaN` are not equivalent.
9578 return +a === +b;
9579 case '[object Symbol]':
9580 return __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(a) === __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(b);
9581 case '[object ArrayBuffer]':
9582 case tagDataView:
9583 // Coerce to typed array so we can fall through.
9584 return deepEq(Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(a), Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(b), aStack, bStack);
9585 }
9586
9587 var areArrays = className === '[object Array]';
9588 if (!areArrays && Object(__WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__["a" /* default */])(a)) {
9589 var byteLength = Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(a);
9590 if (byteLength !== Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(b)) return false;
9591 if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
9592 areArrays = true;
9593 }
9594 if (!areArrays) {
9595 if (typeof a != 'object' || typeof b != 'object') return false;
9596
9597 // Objects with different constructors are not equivalent, but `Object`s or `Array`s
9598 // from different frames are.
9599 var aCtor = a.constructor, bCtor = b.constructor;
9600 if (aCtor !== bCtor && !(Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(aCtor) && aCtor instanceof aCtor &&
9601 Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(bCtor) && bCtor instanceof bCtor)
9602 && ('constructor' in a && 'constructor' in b)) {
9603 return false;
9604 }
9605 }
9606 // Assume equality for cyclic structures. The algorithm for detecting cyclic
9607 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
9608
9609 // Initializing stack of traversed objects.
9610 // It's done here since we only need them for objects and arrays comparison.
9611 aStack = aStack || [];
9612 bStack = bStack || [];
9613 var length = aStack.length;
9614 while (length--) {
9615 // Linear search. Performance is inversely proportional to the number of
9616 // unique nested structures.
9617 if (aStack[length] === a) return bStack[length] === b;
9618 }
9619
9620 // Add the first object to the stack of traversed objects.
9621 aStack.push(a);
9622 bStack.push(b);
9623
9624 // Recursively compare objects and arrays.
9625 if (areArrays) {
9626 // Compare array lengths to determine if a deep comparison is necessary.
9627 length = a.length;
9628 if (length !== b.length) return false;
9629 // Deep compare the contents, ignoring non-numeric properties.
9630 while (length--) {
9631 if (!eq(a[length], b[length], aStack, bStack)) return false;
9632 }
9633 } else {
9634 // Deep compare objects.
9635 var _keys = Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(a), key;
9636 length = _keys.length;
9637 // Ensure that both objects contain the same number of properties before comparing deep equality.
9638 if (Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(b).length !== length) return false;
9639 while (length--) {
9640 // Deep compare each member
9641 key = _keys[length];
9642 if (!(Object(__WEBPACK_IMPORTED_MODULE_8__has_js__["a" /* default */])(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
9643 }
9644 }
9645 // Remove the first object from the stack of traversed objects.
9646 aStack.pop();
9647 bStack.pop();
9648 return true;
9649}
9650
9651// Perform a deep comparison to check if two objects are equal.
9652function isEqual(a, b) {
9653 return eq(a, b);
9654}
9655
9656
9657/***/ }),
9658/* 299 */
9659/***/ (function(module, __webpack_exports__, __webpack_require__) {
9660
9661"use strict";
9662/* harmony export (immutable) */ __webpack_exports__["a"] = toBufferView;
9663/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getByteLength_js__ = __webpack_require__(128);
9664
9665
9666// Internal function to wrap or shallow-copy an ArrayBuffer,
9667// typed array or DataView to a new view, reusing the buffer.
9668function toBufferView(bufferSource) {
9669 return new Uint8Array(
9670 bufferSource.buffer || bufferSource,
9671 bufferSource.byteOffset || 0,
9672 Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__["a" /* default */])(bufferSource)
9673 );
9674}
9675
9676
9677/***/ }),
9678/* 300 */
9679/***/ (function(module, __webpack_exports__, __webpack_require__) {
9680
9681"use strict";
9682/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
9683/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(80);
9684/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(129);
9685
9686
9687
9688
9689/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["b" /* mapMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Map'));
9690
9691
9692/***/ }),
9693/* 301 */
9694/***/ (function(module, __webpack_exports__, __webpack_require__) {
9695
9696"use strict";
9697/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
9698/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(80);
9699/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(129);
9700
9701
9702
9703
9704/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["d" /* weakMapMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakMap'));
9705
9706
9707/***/ }),
9708/* 302 */
9709/***/ (function(module, __webpack_exports__, __webpack_require__) {
9710
9711"use strict";
9712/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
9713/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(80);
9714/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(129);
9715
9716
9717
9718
9719/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["c" /* setMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Set'));
9720
9721
9722/***/ }),
9723/* 303 */
9724/***/ (function(module, __webpack_exports__, __webpack_require__) {
9725
9726"use strict";
9727/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(16);
9728
9729
9730/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakSet'));
9731
9732
9733/***/ }),
9734/* 304 */
9735/***/ (function(module, __webpack_exports__, __webpack_require__) {
9736
9737"use strict";
9738/* harmony export (immutable) */ __webpack_exports__["a"] = pairs;
9739/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(14);
9740
9741
9742// Convert an object into a list of `[key, value]` pairs.
9743// The opposite of `_.object` with one argument.
9744function pairs(obj) {
9745 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
9746 var length = _keys.length;
9747 var pairs = Array(length);
9748 for (var i = 0; i < length; i++) {
9749 pairs[i] = [_keys[i], obj[_keys[i]]];
9750 }
9751 return pairs;
9752}
9753
9754
9755/***/ }),
9756/* 305 */
9757/***/ (function(module, __webpack_exports__, __webpack_require__) {
9758
9759"use strict";
9760/* harmony export (immutable) */ __webpack_exports__["a"] = create;
9761/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(183);
9762/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__extendOwn_js__ = __webpack_require__(131);
9763
9764
9765
9766// Creates an object that inherits from the given prototype object.
9767// If additional properties are provided then they will be added to the
9768// created object.
9769function create(prototype, props) {
9770 var result = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(prototype);
9771 if (props) Object(__WEBPACK_IMPORTED_MODULE_1__extendOwn_js__["a" /* default */])(result, props);
9772 return result;
9773}
9774
9775
9776/***/ }),
9777/* 306 */
9778/***/ (function(module, __webpack_exports__, __webpack_require__) {
9779
9780"use strict";
9781/* harmony export (immutable) */ __webpack_exports__["a"] = tap;
9782// Invokes `interceptor` with the `obj` and then returns `obj`.
9783// The primary purpose of this method is to "tap into" a method chain, in
9784// order to perform operations on intermediate results within the chain.
9785function tap(obj, interceptor) {
9786 interceptor(obj);
9787 return obj;
9788}
9789
9790
9791/***/ }),
9792/* 307 */
9793/***/ (function(module, __webpack_exports__, __webpack_require__) {
9794
9795"use strict";
9796/* harmony export (immutable) */ __webpack_exports__["a"] = has;
9797/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(41);
9798/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(82);
9799
9800
9801
9802// Shortcut function for checking if an object has a given property directly on
9803// itself (in other words, not on a prototype). Unlike the internal `has`
9804// function, this public version can also traverse nested properties.
9805function has(obj, path) {
9806 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
9807 var length = path.length;
9808 for (var i = 0; i < length; i++) {
9809 var key = path[i];
9810 if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(obj, key)) return false;
9811 obj = obj[key];
9812 }
9813 return !!length;
9814}
9815
9816
9817/***/ }),
9818/* 308 */
9819/***/ (function(module, __webpack_exports__, __webpack_require__) {
9820
9821"use strict";
9822/* harmony export (immutable) */ __webpack_exports__["a"] = mapObject;
9823/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(19);
9824/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(14);
9825
9826
9827
9828// Returns the results of applying the `iteratee` to each element of `obj`.
9829// In contrast to `_.map` it returns an object.
9830function mapObject(obj, iteratee, context) {
9831 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
9832 var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
9833 length = _keys.length,
9834 results = {};
9835 for (var index = 0; index < length; index++) {
9836 var currentKey = _keys[index];
9837 results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
9838 }
9839 return results;
9840}
9841
9842
9843/***/ }),
9844/* 309 */
9845/***/ (function(module, __webpack_exports__, __webpack_require__) {
9846
9847"use strict";
9848/* harmony export (immutable) */ __webpack_exports__["a"] = propertyOf;
9849/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__noop_js__ = __webpack_require__(189);
9850/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(185);
9851
9852
9853
9854// Generates a function for a given object that returns a given property.
9855function propertyOf(obj) {
9856 if (obj == null) return __WEBPACK_IMPORTED_MODULE_0__noop_js__["a" /* default */];
9857 return function(path) {
9858 return Object(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" /* default */])(obj, path);
9859 };
9860}
9861
9862
9863/***/ }),
9864/* 310 */
9865/***/ (function(module, __webpack_exports__, __webpack_require__) {
9866
9867"use strict";
9868/* harmony export (immutable) */ __webpack_exports__["a"] = times;
9869/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(83);
9870
9871
9872// Run a function **n** times.
9873function times(n, iteratee, context) {
9874 var accum = Array(Math.max(0, n));
9875 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context, 1);
9876 for (var i = 0; i < n; i++) accum[i] = iteratee(i);
9877 return accum;
9878}
9879
9880
9881/***/ }),
9882/* 311 */
9883/***/ (function(module, __webpack_exports__, __webpack_require__) {
9884
9885"use strict";
9886/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(191);
9887/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(192);
9888
9889
9890
9891// Function for escaping strings to HTML interpolation.
9892/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
9893
9894
9895/***/ }),
9896/* 312 */
9897/***/ (function(module, __webpack_exports__, __webpack_require__) {
9898
9899"use strict";
9900/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(191);
9901/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__ = __webpack_require__(313);
9902
9903
9904
9905// Function for unescaping strings from HTML interpolation.
9906/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__["a" /* default */]));
9907
9908
9909/***/ }),
9910/* 313 */
9911/***/ (function(module, __webpack_exports__, __webpack_require__) {
9912
9913"use strict";
9914/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__invert_js__ = __webpack_require__(179);
9915/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(192);
9916
9917
9918
9919// Internal list of HTML entities for unescaping.
9920/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__invert_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
9921
9922
9923/***/ }),
9924/* 314 */
9925/***/ (function(module, __webpack_exports__, __webpack_require__) {
9926
9927"use strict";
9928/* harmony export (immutable) */ __webpack_exports__["a"] = template;
9929/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defaults_js__ = __webpack_require__(182);
9930/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__underscore_js__ = __webpack_require__(23);
9931/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__templateSettings_js__ = __webpack_require__(193);
9932
9933
9934
9935
9936// When customizing `_.templateSettings`, if you don't want to define an
9937// interpolation, evaluation or escaping regex, we need one that is
9938// guaranteed not to match.
9939var noMatch = /(.)^/;
9940
9941// Certain characters need to be escaped so that they can be put into a
9942// string literal.
9943var escapes = {
9944 "'": "'",
9945 '\\': '\\',
9946 '\r': 'r',
9947 '\n': 'n',
9948 '\u2028': 'u2028',
9949 '\u2029': 'u2029'
9950};
9951
9952var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
9953
9954function escapeChar(match) {
9955 return '\\' + escapes[match];
9956}
9957
9958var bareIdentifier = /^\s*(\w|\$)+\s*$/;
9959
9960// JavaScript micro-templating, similar to John Resig's implementation.
9961// Underscore templating handles arbitrary delimiters, preserves whitespace,
9962// and correctly escapes quotes within interpolated code.
9963// NB: `oldSettings` only exists for backwards compatibility.
9964function template(text, settings, oldSettings) {
9965 if (!settings && oldSettings) settings = oldSettings;
9966 settings = Object(__WEBPACK_IMPORTED_MODULE_0__defaults_js__["a" /* default */])({}, settings, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */].templateSettings);
9967
9968 // Combine delimiters into one regular expression via alternation.
9969 var matcher = RegExp([
9970 (settings.escape || noMatch).source,
9971 (settings.interpolate || noMatch).source,
9972 (settings.evaluate || noMatch).source
9973 ].join('|') + '|$', 'g');
9974
9975 // Compile the template source, escaping string literals appropriately.
9976 var index = 0;
9977 var source = "__p+='";
9978 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
9979 source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
9980 index = offset + match.length;
9981
9982 if (escape) {
9983 source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
9984 } else if (interpolate) {
9985 source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
9986 } else if (evaluate) {
9987 source += "';\n" + evaluate + "\n__p+='";
9988 }
9989
9990 // Adobe VMs need the match returned to produce the correct offset.
9991 return match;
9992 });
9993 source += "';\n";
9994
9995 var argument = settings.variable;
9996 if (argument) {
9997 if (!bareIdentifier.test(argument)) throw new Error(argument);
9998 } else {
9999 // If a variable is not specified, place data values in local scope.
10000 source = 'with(obj||{}){\n' + source + '}\n';
10001 argument = 'obj';
10002 }
10003
10004 source = "var __t,__p='',__j=Array.prototype.join," +
10005 "print=function(){__p+=__j.call(arguments,'');};\n" +
10006 source + 'return __p;\n';
10007
10008 var render;
10009 try {
10010 render = new Function(argument, '_', source);
10011 } catch (e) {
10012 e.source = source;
10013 throw e;
10014 }
10015
10016 var template = function(data) {
10017 return render.call(this, data, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */]);
10018 };
10019
10020 // Provide the compiled source as a convenience for precompilation.
10021 template.source = 'function(' + argument + '){\n' + source + '}';
10022
10023 return template;
10024}
10025
10026
10027/***/ }),
10028/* 315 */
10029/***/ (function(module, __webpack_exports__, __webpack_require__) {
10030
10031"use strict";
10032/* harmony export (immutable) */ __webpack_exports__["a"] = result;
10033/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(29);
10034/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(82);
10035
10036
10037
10038// Traverses the children of `obj` along `path`. If a child is a function, it
10039// is invoked with its parent as context. Returns the value of the final
10040// child, or `fallback` if any child is undefined.
10041function result(obj, path, fallback) {
10042 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
10043 var length = path.length;
10044 if (!length) {
10045 return Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(fallback) ? fallback.call(obj) : fallback;
10046 }
10047 for (var i = 0; i < length; i++) {
10048 var prop = obj == null ? void 0 : obj[path[i]];
10049 if (prop === void 0) {
10050 prop = fallback;
10051 i = length; // Ensure we don't continue iterating.
10052 }
10053 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(prop) ? prop.call(obj) : prop;
10054 }
10055 return obj;
10056}
10057
10058
10059/***/ }),
10060/* 316 */
10061/***/ (function(module, __webpack_exports__, __webpack_require__) {
10062
10063"use strict";
10064/* harmony export (immutable) */ __webpack_exports__["a"] = uniqueId;
10065// Generate a unique integer id (unique within the entire client session).
10066// Useful for temporary DOM ids.
10067var idCounter = 0;
10068function uniqueId(prefix) {
10069 var id = ++idCounter + '';
10070 return prefix ? prefix + id : id;
10071}
10072
10073
10074/***/ }),
10075/* 317 */
10076/***/ (function(module, __webpack_exports__, __webpack_require__) {
10077
10078"use strict";
10079/* harmony export (immutable) */ __webpack_exports__["a"] = chain;
10080/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
10081
10082
10083// Start chaining a wrapped Underscore object.
10084function chain(obj) {
10085 var instance = Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj);
10086 instance._chain = true;
10087 return instance;
10088}
10089
10090
10091/***/ }),
10092/* 318 */
10093/***/ (function(module, __webpack_exports__, __webpack_require__) {
10094
10095"use strict";
10096/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10097/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(65);
10098/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bind_js__ = __webpack_require__(195);
10099
10100
10101
10102
10103// Bind a number of an object's methods to that object. Remaining arguments
10104// are the method names to be bound. Useful for ensuring that all callbacks
10105// defined on an object belong to it.
10106/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
10107 keys = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(keys, false, false);
10108 var index = keys.length;
10109 if (index < 1) throw new Error('bindAll must be passed function names');
10110 while (index--) {
10111 var key = keys[index];
10112 obj[key] = Object(__WEBPACK_IMPORTED_MODULE_2__bind_js__["a" /* default */])(obj[key], obj);
10113 }
10114 return obj;
10115}));
10116
10117
10118/***/ }),
10119/* 319 */
10120/***/ (function(module, __webpack_exports__, __webpack_require__) {
10121
10122"use strict";
10123/* harmony export (immutable) */ __webpack_exports__["a"] = memoize;
10124/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(41);
10125
10126
10127// Memoize an expensive function by storing its results.
10128function memoize(func, hasher) {
10129 var memoize = function(key) {
10130 var cache = memoize.cache;
10131 var address = '' + (hasher ? hasher.apply(this, arguments) : key);
10132 if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(cache, address)) cache[address] = func.apply(this, arguments);
10133 return cache[address];
10134 };
10135 memoize.cache = {};
10136 return memoize;
10137}
10138
10139
10140/***/ }),
10141/* 320 */
10142/***/ (function(module, __webpack_exports__, __webpack_require__) {
10143
10144"use strict";
10145/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(101);
10146/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__delay_js__ = __webpack_require__(196);
10147/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(23);
10148
10149
10150
10151
10152// Defers a function, scheduling it to run after the current call stack has
10153// cleared.
10154/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__delay_js__["a" /* default */], __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */], 1));
10155
10156
10157/***/ }),
10158/* 321 */
10159/***/ (function(module, __webpack_exports__, __webpack_require__) {
10160
10161"use strict";
10162/* harmony export (immutable) */ __webpack_exports__["a"] = throttle;
10163/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__now_js__ = __webpack_require__(135);
10164
10165
10166// Returns a function, that, when invoked, will only be triggered at most once
10167// during a given window of time. Normally, the throttled function will run
10168// as much as it can, without ever going more than once per `wait` duration;
10169// but if you'd like to disable the execution on the leading edge, pass
10170// `{leading: false}`. To disable execution on the trailing edge, ditto.
10171function throttle(func, wait, options) {
10172 var timeout, context, args, result;
10173 var previous = 0;
10174 if (!options) options = {};
10175
10176 var later = function() {
10177 previous = options.leading === false ? 0 : Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
10178 timeout = null;
10179 result = func.apply(context, args);
10180 if (!timeout) context = args = null;
10181 };
10182
10183 var throttled = function() {
10184 var _now = Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
10185 if (!previous && options.leading === false) previous = _now;
10186 var remaining = wait - (_now - previous);
10187 context = this;
10188 args = arguments;
10189 if (remaining <= 0 || remaining > wait) {
10190 if (timeout) {
10191 clearTimeout(timeout);
10192 timeout = null;
10193 }
10194 previous = _now;
10195 result = func.apply(context, args);
10196 if (!timeout) context = args = null;
10197 } else if (!timeout && options.trailing !== false) {
10198 timeout = setTimeout(later, remaining);
10199 }
10200 return result;
10201 };
10202
10203 throttled.cancel = function() {
10204 clearTimeout(timeout);
10205 previous = 0;
10206 timeout = context = args = null;
10207 };
10208
10209 return throttled;
10210}
10211
10212
10213/***/ }),
10214/* 322 */
10215/***/ (function(module, __webpack_exports__, __webpack_require__) {
10216
10217"use strict";
10218/* harmony export (immutable) */ __webpack_exports__["a"] = debounce;
10219/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10220/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__now_js__ = __webpack_require__(135);
10221
10222
10223
10224// When a sequence of calls of the returned function ends, the argument
10225// function is triggered. The end of a sequence is defined by the `wait`
10226// parameter. If `immediate` is passed, the argument function will be
10227// triggered at the beginning of the sequence instead of at the end.
10228function debounce(func, wait, immediate) {
10229 var timeout, previous, args, result, context;
10230
10231 var later = function() {
10232 var passed = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])() - previous;
10233 if (wait > passed) {
10234 timeout = setTimeout(later, wait - passed);
10235 } else {
10236 timeout = null;
10237 if (!immediate) result = func.apply(context, args);
10238 // This check is needed because `func` can recursively invoke `debounced`.
10239 if (!timeout) args = context = null;
10240 }
10241 };
10242
10243 var debounced = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(_args) {
10244 context = this;
10245 args = _args;
10246 previous = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])();
10247 if (!timeout) {
10248 timeout = setTimeout(later, wait);
10249 if (immediate) result = func.apply(context, args);
10250 }
10251 return result;
10252 });
10253
10254 debounced.cancel = function() {
10255 clearTimeout(timeout);
10256 timeout = args = context = null;
10257 };
10258
10259 return debounced;
10260}
10261
10262
10263/***/ }),
10264/* 323 */
10265/***/ (function(module, __webpack_exports__, __webpack_require__) {
10266
10267"use strict";
10268/* harmony export (immutable) */ __webpack_exports__["a"] = wrap;
10269/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(101);
10270
10271
10272// Returns the first function passed as an argument to the second,
10273// allowing you to adjust arguments, run code before and after, and
10274// conditionally execute the original function.
10275function wrap(func, wrapper) {
10276 return Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(wrapper, func);
10277}
10278
10279
10280/***/ }),
10281/* 324 */
10282/***/ (function(module, __webpack_exports__, __webpack_require__) {
10283
10284"use strict";
10285/* harmony export (immutable) */ __webpack_exports__["a"] = compose;
10286// Returns a function that is the composition of a list of functions, each
10287// consuming the return value of the function that follows.
10288function compose() {
10289 var args = arguments;
10290 var start = args.length - 1;
10291 return function() {
10292 var i = start;
10293 var result = args[start].apply(this, arguments);
10294 while (i--) result = args[i].call(this, result);
10295 return result;
10296 };
10297}
10298
10299
10300/***/ }),
10301/* 325 */
10302/***/ (function(module, __webpack_exports__, __webpack_require__) {
10303
10304"use strict";
10305/* harmony export (immutable) */ __webpack_exports__["a"] = after;
10306// Returns a function that will only be executed on and after the Nth call.
10307function after(times, func) {
10308 return function() {
10309 if (--times < 1) {
10310 return func.apply(this, arguments);
10311 }
10312 };
10313}
10314
10315
10316/***/ }),
10317/* 326 */
10318/***/ (function(module, __webpack_exports__, __webpack_require__) {
10319
10320"use strict";
10321/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(101);
10322/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__before_js__ = __webpack_require__(197);
10323
10324
10325
10326// Returns a function that will be executed at most one time, no matter how
10327// often you call it. Useful for lazy initialization.
10328/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__before_js__["a" /* default */], 2));
10329
10330
10331/***/ }),
10332/* 327 */
10333/***/ (function(module, __webpack_exports__, __webpack_require__) {
10334
10335"use strict";
10336/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__ = __webpack_require__(200);
10337/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__ = __webpack_require__(203);
10338
10339
10340
10341// Return the position of the last occurrence of an item in an array,
10342// or -1 if the item is not included in the array.
10343/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__["a" /* default */])(-1, __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__["a" /* default */]));
10344
10345
10346/***/ }),
10347/* 328 */
10348/***/ (function(module, __webpack_exports__, __webpack_require__) {
10349
10350"use strict";
10351/* harmony export (immutable) */ __webpack_exports__["a"] = findWhere;
10352/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__find_js__ = __webpack_require__(204);
10353/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(100);
10354
10355
10356
10357// Convenience version of a common use case of `_.find`: getting the first
10358// object containing specific `key:value` pairs.
10359function findWhere(obj, attrs) {
10360 return Object(__WEBPACK_IMPORTED_MODULE_0__find_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
10361}
10362
10363
10364/***/ }),
10365/* 329 */
10366/***/ (function(module, __webpack_exports__, __webpack_require__) {
10367
10368"use strict";
10369/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(205);
10370
10371
10372// **Reduce** builds up a single result from a list of values, aka `inject`,
10373// or `foldl`.
10374/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(1));
10375
10376
10377/***/ }),
10378/* 330 */
10379/***/ (function(module, __webpack_exports__, __webpack_require__) {
10380
10381"use strict";
10382/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(205);
10383
10384
10385// The right-associative version of reduce, also known as `foldr`.
10386/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(-1));
10387
10388
10389/***/ }),
10390/* 331 */
10391/***/ (function(module, __webpack_exports__, __webpack_require__) {
10392
10393"use strict";
10394/* harmony export (immutable) */ __webpack_exports__["a"] = reject;
10395/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(84);
10396/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__negate_js__ = __webpack_require__(136);
10397/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(19);
10398
10399
10400
10401
10402// Return all the elements for which a truth test fails.
10403function reject(obj, predicate, context) {
10404 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__negate_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(predicate)), context);
10405}
10406
10407
10408/***/ }),
10409/* 332 */
10410/***/ (function(module, __webpack_exports__, __webpack_require__) {
10411
10412"use strict";
10413/* harmony export (immutable) */ __webpack_exports__["a"] = every;
10414/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(19);
10415/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
10416/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(14);
10417
10418
10419
10420
10421// Determine whether all of the elements pass a truth test.
10422function every(obj, predicate, context) {
10423 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
10424 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
10425 length = (_keys || obj).length;
10426 for (var index = 0; index < length; index++) {
10427 var currentKey = _keys ? _keys[index] : index;
10428 if (!predicate(obj[currentKey], currentKey, obj)) return false;
10429 }
10430 return true;
10431}
10432
10433
10434/***/ }),
10435/* 333 */
10436/***/ (function(module, __webpack_exports__, __webpack_require__) {
10437
10438"use strict";
10439/* harmony export (immutable) */ __webpack_exports__["a"] = some;
10440/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(19);
10441/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
10442/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(14);
10443
10444
10445
10446
10447// Determine if at least one element in the object passes a truth test.
10448function some(obj, predicate, context) {
10449 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
10450 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
10451 length = (_keys || obj).length;
10452 for (var index = 0; index < length; index++) {
10453 var currentKey = _keys ? _keys[index] : index;
10454 if (predicate(obj[currentKey], currentKey, obj)) return true;
10455 }
10456 return false;
10457}
10458
10459
10460/***/ }),
10461/* 334 */
10462/***/ (function(module, __webpack_exports__, __webpack_require__) {
10463
10464"use strict";
10465/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10466/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(29);
10467/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(66);
10468/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__deepGet_js__ = __webpack_require__(132);
10469/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__toPath_js__ = __webpack_require__(82);
10470
10471
10472
10473
10474
10475
10476// Invoke a method (with arguments) on every item in a collection.
10477/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, path, args) {
10478 var contextPath, func;
10479 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(path)) {
10480 func = path;
10481 } else {
10482 path = Object(__WEBPACK_IMPORTED_MODULE_4__toPath_js__["a" /* default */])(path);
10483 contextPath = path.slice(0, -1);
10484 path = path[path.length - 1];
10485 }
10486 return Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(context) {
10487 var method = func;
10488 if (!method) {
10489 if (contextPath && contextPath.length) {
10490 context = Object(__WEBPACK_IMPORTED_MODULE_3__deepGet_js__["a" /* default */])(context, contextPath);
10491 }
10492 if (context == null) return void 0;
10493 method = context[path];
10494 }
10495 return method == null ? method : method.apply(context, args);
10496 });
10497}));
10498
10499
10500/***/ }),
10501/* 335 */
10502/***/ (function(module, __webpack_exports__, __webpack_require__) {
10503
10504"use strict";
10505/* harmony export (immutable) */ __webpack_exports__["a"] = where;
10506/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(84);
10507/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(100);
10508
10509
10510
10511// Convenience version of a common use case of `_.filter`: selecting only
10512// objects containing specific `key:value` pairs.
10513function where(obj, attrs) {
10514 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
10515}
10516
10517
10518/***/ }),
10519/* 336 */
10520/***/ (function(module, __webpack_exports__, __webpack_require__) {
10521
10522"use strict";
10523/* harmony export (immutable) */ __webpack_exports__["a"] = min;
10524/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
10525/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(64);
10526/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(19);
10527/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(52);
10528
10529
10530
10531
10532
10533// Return the minimum element (or element-based computation).
10534function min(obj, iteratee, context) {
10535 var result = Infinity, lastComputed = Infinity,
10536 value, computed;
10537 if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
10538 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
10539 for (var i = 0, length = obj.length; i < length; i++) {
10540 value = obj[i];
10541 if (value != null && value < result) {
10542 result = value;
10543 }
10544 }
10545 } else {
10546 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
10547 Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
10548 computed = iteratee(v, index, list);
10549 if (computed < lastComputed || computed === Infinity && result === Infinity) {
10550 result = v;
10551 lastComputed = computed;
10552 }
10553 });
10554 }
10555 return result;
10556}
10557
10558
10559/***/ }),
10560/* 337 */
10561/***/ (function(module, __webpack_exports__, __webpack_require__) {
10562
10563"use strict";
10564/* harmony export (immutable) */ __webpack_exports__["a"] = shuffle;
10565/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sample_js__ = __webpack_require__(207);
10566
10567
10568// Shuffle a collection.
10569function shuffle(obj) {
10570 return Object(__WEBPACK_IMPORTED_MODULE_0__sample_js__["a" /* default */])(obj, Infinity);
10571}
10572
10573
10574/***/ }),
10575/* 338 */
10576/***/ (function(module, __webpack_exports__, __webpack_require__) {
10577
10578"use strict";
10579/* harmony export (immutable) */ __webpack_exports__["a"] = sortBy;
10580/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(19);
10581/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pluck_js__ = __webpack_require__(138);
10582/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(66);
10583
10584
10585
10586
10587// Sort the object's values by a criterion produced by an iteratee.
10588function sortBy(obj, iteratee, context) {
10589 var index = 0;
10590 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
10591 return Object(__WEBPACK_IMPORTED_MODULE_1__pluck_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(value, key, list) {
10592 return {
10593 value: value,
10594 index: index++,
10595 criteria: iteratee(value, key, list)
10596 };
10597 }).sort(function(left, right) {
10598 var a = left.criteria;
10599 var b = right.criteria;
10600 if (a !== b) {
10601 if (a > b || a === void 0) return 1;
10602 if (a < b || b === void 0) return -1;
10603 }
10604 return left.index - right.index;
10605 }), 'value');
10606}
10607
10608
10609/***/ }),
10610/* 339 */
10611/***/ (function(module, __webpack_exports__, __webpack_require__) {
10612
10613"use strict";
10614/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(102);
10615/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(41);
10616
10617
10618
10619// Groups the object's values by a criterion. Pass either a string attribute
10620// to group by, or a function that returns the criterion.
10621/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10622 if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key].push(value); else result[key] = [value];
10623}));
10624
10625
10626/***/ }),
10627/* 340 */
10628/***/ (function(module, __webpack_exports__, __webpack_require__) {
10629
10630"use strict";
10631/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(102);
10632
10633
10634// Indexes the object's values by a criterion, similar to `_.groupBy`, but for
10635// when you know that your index values will be unique.
10636/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10637 result[key] = value;
10638}));
10639
10640
10641/***/ }),
10642/* 341 */
10643/***/ (function(module, __webpack_exports__, __webpack_require__) {
10644
10645"use strict";
10646/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(102);
10647/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(41);
10648
10649
10650
10651// Counts instances of an object that group by a certain criterion. Pass
10652// either a string attribute to count by, or a function that returns the
10653// criterion.
10654/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10655 if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key]++; else result[key] = 1;
10656}));
10657
10658
10659/***/ }),
10660/* 342 */
10661/***/ (function(module, __webpack_exports__, __webpack_require__) {
10662
10663"use strict";
10664/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(102);
10665
10666
10667// Split a collection into two arrays: one whose elements all pass the given
10668// truth test, and one whose elements all do not pass the truth test.
10669/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, pass) {
10670 result[pass ? 0 : 1].push(value);
10671}, true));
10672
10673
10674/***/ }),
10675/* 343 */
10676/***/ (function(module, __webpack_exports__, __webpack_require__) {
10677
10678"use strict";
10679/* harmony export (immutable) */ __webpack_exports__["a"] = toArray;
10680/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(51);
10681/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
10682/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(125);
10683/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__ = __webpack_require__(24);
10684/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map_js__ = __webpack_require__(66);
10685/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__identity_js__ = __webpack_require__(133);
10686/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__values_js__ = __webpack_require__(64);
10687
10688
10689
10690
10691
10692
10693
10694
10695// Safely create a real, live array from anything iterable.
10696var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
10697function toArray(obj) {
10698 if (!obj) return [];
10699 if (Object(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" /* default */])(obj)) return __WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(obj);
10700 if (Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj)) {
10701 // Keep surrogate pair characters together.
10702 return obj.match(reStrSymbol);
10703 }
10704 if (Object(__WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__["a" /* default */])(obj)) return Object(__WEBPACK_IMPORTED_MODULE_4__map_js__["a" /* default */])(obj, __WEBPACK_IMPORTED_MODULE_5__identity_js__["a" /* default */]);
10705 return Object(__WEBPACK_IMPORTED_MODULE_6__values_js__["a" /* default */])(obj);
10706}
10707
10708
10709/***/ }),
10710/* 344 */
10711/***/ (function(module, __webpack_exports__, __webpack_require__) {
10712
10713"use strict";
10714/* harmony export (immutable) */ __webpack_exports__["a"] = size;
10715/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
10716/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(14);
10717
10718
10719
10720// Return the number of elements in a collection.
10721function size(obj) {
10722 if (obj == null) return 0;
10723 return Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj.length : Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj).length;
10724}
10725
10726
10727/***/ }),
10728/* 345 */
10729/***/ (function(module, __webpack_exports__, __webpack_require__) {
10730
10731"use strict";
10732/* harmony export (immutable) */ __webpack_exports__["a"] = keyInObj;
10733// Internal `_.pick` helper function to determine whether `key` is an enumerable
10734// property name of `obj`.
10735function keyInObj(value, key, obj) {
10736 return key in obj;
10737}
10738
10739
10740/***/ }),
10741/* 346 */
10742/***/ (function(module, __webpack_exports__, __webpack_require__) {
10743
10744"use strict";
10745/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10746/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(29);
10747/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__negate_js__ = __webpack_require__(136);
10748/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__map_js__ = __webpack_require__(66);
10749/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__flatten_js__ = __webpack_require__(65);
10750/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__contains_js__ = __webpack_require__(85);
10751/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pick_js__ = __webpack_require__(208);
10752
10753
10754
10755
10756
10757
10758
10759
10760// Return a copy of the object without the disallowed properties.
10761/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
10762 var iteratee = keys[0], context;
10763 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
10764 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__negate_js__["a" /* default */])(iteratee);
10765 if (keys.length > 1) context = keys[1];
10766 } else {
10767 keys = Object(__WEBPACK_IMPORTED_MODULE_3__map_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__flatten_js__["a" /* default */])(keys, false, false), String);
10768 iteratee = function(value, key) {
10769 return !Object(__WEBPACK_IMPORTED_MODULE_5__contains_js__["a" /* default */])(keys, key);
10770 };
10771 }
10772 return Object(__WEBPACK_IMPORTED_MODULE_6__pick_js__["a" /* default */])(obj, iteratee, context);
10773}));
10774
10775
10776/***/ }),
10777/* 347 */
10778/***/ (function(module, __webpack_exports__, __webpack_require__) {
10779
10780"use strict";
10781/* harmony export (immutable) */ __webpack_exports__["a"] = first;
10782/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__initial_js__ = __webpack_require__(209);
10783
10784
10785// Get the first element of an array. Passing **n** will return the first N
10786// values in the array. The **guard** check allows it to work with `_.map`.
10787function first(array, n, guard) {
10788 if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
10789 if (n == null || guard) return array[0];
10790 return Object(__WEBPACK_IMPORTED_MODULE_0__initial_js__["a" /* default */])(array, array.length - n);
10791}
10792
10793
10794/***/ }),
10795/* 348 */
10796/***/ (function(module, __webpack_exports__, __webpack_require__) {
10797
10798"use strict";
10799/* harmony export (immutable) */ __webpack_exports__["a"] = last;
10800/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rest_js__ = __webpack_require__(210);
10801
10802
10803// Get the last element of an array. Passing **n** will return the last N
10804// values in the array.
10805function last(array, n, guard) {
10806 if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
10807 if (n == null || guard) return array[array.length - 1];
10808 return Object(__WEBPACK_IMPORTED_MODULE_0__rest_js__["a" /* default */])(array, Math.max(0, array.length - n));
10809}
10810
10811
10812/***/ }),
10813/* 349 */
10814/***/ (function(module, __webpack_exports__, __webpack_require__) {
10815
10816"use strict";
10817/* harmony export (immutable) */ __webpack_exports__["a"] = compact;
10818/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(84);
10819
10820
10821// Trim out all falsy values from an array.
10822function compact(array) {
10823 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(array, Boolean);
10824}
10825
10826
10827/***/ }),
10828/* 350 */
10829/***/ (function(module, __webpack_exports__, __webpack_require__) {
10830
10831"use strict";
10832/* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
10833/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__flatten_js__ = __webpack_require__(65);
10834
10835
10836// Flatten out an array, either recursively (by default), or up to `depth`.
10837// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
10838function flatten(array, depth) {
10839 return Object(__WEBPACK_IMPORTED_MODULE_0__flatten_js__["a" /* default */])(array, depth, false);
10840}
10841
10842
10843/***/ }),
10844/* 351 */
10845/***/ (function(module, __webpack_exports__, __webpack_require__) {
10846
10847"use strict";
10848/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10849/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__difference_js__ = __webpack_require__(211);
10850
10851
10852
10853// Return a version of the array that does not contain the specified value(s).
10854/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, otherArrays) {
10855 return Object(__WEBPACK_IMPORTED_MODULE_1__difference_js__["a" /* default */])(array, otherArrays);
10856}));
10857
10858
10859/***/ }),
10860/* 352 */
10861/***/ (function(module, __webpack_exports__, __webpack_require__) {
10862
10863"use strict";
10864/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10865/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__uniq_js__ = __webpack_require__(212);
10866/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__flatten_js__ = __webpack_require__(65);
10867
10868
10869
10870
10871// Produce an array that contains the union: each distinct element from all of
10872// the passed-in arrays.
10873/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(arrays) {
10874 return Object(__WEBPACK_IMPORTED_MODULE_1__uniq_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__flatten_js__["a" /* default */])(arrays, true, true));
10875}));
10876
10877
10878/***/ }),
10879/* 353 */
10880/***/ (function(module, __webpack_exports__, __webpack_require__) {
10881
10882"use strict";
10883/* harmony export (immutable) */ __webpack_exports__["a"] = intersection;
10884/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(30);
10885/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__contains_js__ = __webpack_require__(85);
10886
10887
10888
10889// Produce an array that contains every item shared between all the
10890// passed-in arrays.
10891function intersection(array) {
10892 var result = [];
10893 var argsLength = arguments.length;
10894 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array); i < length; i++) {
10895 var item = array[i];
10896 if (Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(result, item)) continue;
10897 var j;
10898 for (j = 1; j < argsLength; j++) {
10899 if (!Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(arguments[j], item)) break;
10900 }
10901 if (j === argsLength) result.push(item);
10902 }
10903 return result;
10904}
10905
10906
10907/***/ }),
10908/* 354 */
10909/***/ (function(module, __webpack_exports__, __webpack_require__) {
10910
10911"use strict";
10912/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10913/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unzip_js__ = __webpack_require__(213);
10914
10915
10916
10917// Zip together multiple lists into a single array -- elements that share
10918// an index go together.
10919/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unzip_js__["a" /* default */]));
10920
10921
10922/***/ }),
10923/* 355 */
10924/***/ (function(module, __webpack_exports__, __webpack_require__) {
10925
10926"use strict";
10927/* harmony export (immutable) */ __webpack_exports__["a"] = object;
10928/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(30);
10929
10930
10931// Converts lists into objects. Pass either a single array of `[key, value]`
10932// pairs, or two parallel arrays of the same length -- one of keys, and one of
10933// the corresponding values. Passing by pairs is the reverse of `_.pairs`.
10934function object(list, values) {
10935 var result = {};
10936 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(list); i < length; i++) {
10937 if (values) {
10938 result[list[i]] = values[i];
10939 } else {
10940 result[list[i][0]] = list[i][1];
10941 }
10942 }
10943 return result;
10944}
10945
10946
10947/***/ }),
10948/* 356 */
10949/***/ (function(module, __webpack_exports__, __webpack_require__) {
10950
10951"use strict";
10952/* harmony export (immutable) */ __webpack_exports__["a"] = range;
10953// Generate an integer Array containing an arithmetic progression. A port of
10954// the native Python `range()` function. See
10955// [the Python documentation](https://docs.python.org/library/functions.html#range).
10956function range(start, stop, step) {
10957 if (stop == null) {
10958 stop = start || 0;
10959 start = 0;
10960 }
10961 if (!step) {
10962 step = stop < start ? -1 : 1;
10963 }
10964
10965 var length = Math.max(Math.ceil((stop - start) / step), 0);
10966 var range = Array(length);
10967
10968 for (var idx = 0; idx < length; idx++, start += step) {
10969 range[idx] = start;
10970 }
10971
10972 return range;
10973}
10974
10975
10976/***/ }),
10977/* 357 */
10978/***/ (function(module, __webpack_exports__, __webpack_require__) {
10979
10980"use strict";
10981/* harmony export (immutable) */ __webpack_exports__["a"] = chunk;
10982/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
10983
10984
10985// Chunk a single array into multiple arrays, each containing `count` or fewer
10986// items.
10987function chunk(array, count) {
10988 if (count == null || count < 1) return [];
10989 var result = [];
10990 var i = 0, length = array.length;
10991 while (i < length) {
10992 result.push(__WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, i, i += count));
10993 }
10994 return result;
10995}
10996
10997
10998/***/ }),
10999/* 358 */
11000/***/ (function(module, __webpack_exports__, __webpack_require__) {
11001
11002"use strict";
11003/* harmony export (immutable) */ __webpack_exports__["a"] = mixin;
11004/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
11005/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(52);
11006/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__functions_js__ = __webpack_require__(180);
11007/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__setup_js__ = __webpack_require__(6);
11008/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__chainResult_js__ = __webpack_require__(214);
11009
11010
11011
11012
11013
11014
11015// Add your own custom functions to the Underscore object.
11016function mixin(obj) {
11017 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__functions_js__["a" /* default */])(obj), function(name) {
11018 var func = __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */][name] = obj[name];
11019 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
11020 var args = [this._wrapped];
11021 __WEBPACK_IMPORTED_MODULE_3__setup_js__["o" /* push */].apply(args, arguments);
11022 return Object(__WEBPACK_IMPORTED_MODULE_4__chainResult_js__["a" /* default */])(this, func.apply(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */], args));
11023 };
11024 });
11025 return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */];
11026}
11027
11028
11029/***/ }),
11030/* 359 */
11031/***/ (function(module, __webpack_exports__, __webpack_require__) {
11032
11033"use strict";
11034/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
11035/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(52);
11036/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__setup_js__ = __webpack_require__(6);
11037/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chainResult_js__ = __webpack_require__(214);
11038
11039
11040
11041
11042
11043// Add all mutator `Array` functions to the wrapper.
11044Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
11045 var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
11046 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
11047 var obj = this._wrapped;
11048 if (obj != null) {
11049 method.apply(obj, arguments);
11050 if ((name === 'shift' || name === 'splice') && obj.length === 0) {
11051 delete obj[0];
11052 }
11053 }
11054 return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
11055 };
11056});
11057
11058// Add all accessor `Array` functions to the wrapper.
11059Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['concat', 'join', 'slice'], function(name) {
11060 var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
11061 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
11062 var obj = this._wrapped;
11063 if (obj != null) obj = method.apply(obj, arguments);
11064 return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
11065 };
11066});
11067
11068/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]);
11069
11070
11071/***/ }),
11072/* 360 */
11073/***/ (function(module, exports, __webpack_require__) {
11074
11075var parent = __webpack_require__(361);
11076
11077module.exports = parent;
11078
11079
11080/***/ }),
11081/* 361 */
11082/***/ (function(module, exports, __webpack_require__) {
11083
11084var isPrototypeOf = __webpack_require__(12);
11085var method = __webpack_require__(362);
11086
11087var ArrayPrototype = Array.prototype;
11088
11089module.exports = function (it) {
11090 var own = it.concat;
11091 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;
11092};
11093
11094
11095/***/ }),
11096/* 362 */
11097/***/ (function(module, exports, __webpack_require__) {
11098
11099__webpack_require__(215);
11100var entryVirtual = __webpack_require__(26);
11101
11102module.exports = entryVirtual('Array').concat;
11103
11104
11105/***/ }),
11106/* 363 */
11107/***/ (function(module, exports) {
11108
11109var $TypeError = TypeError;
11110var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
11111
11112module.exports = function (it) {
11113 if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
11114 return it;
11115};
11116
11117
11118/***/ }),
11119/* 364 */
11120/***/ (function(module, exports, __webpack_require__) {
11121
11122var isArray = __webpack_require__(86);
11123var isConstructor = __webpack_require__(98);
11124var isObject = __webpack_require__(17);
11125var wellKnownSymbol = __webpack_require__(5);
11126
11127var SPECIES = wellKnownSymbol('species');
11128var $Array = Array;
11129
11130// a part of `ArraySpeciesCreate` abstract operation
11131// https://tc39.es/ecma262/#sec-arrayspeciescreate
11132module.exports = function (originalArray) {
11133 var C;
11134 if (isArray(originalArray)) {
11135 C = originalArray.constructor;
11136 // cross-realm fallback
11137 if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
11138 else if (isObject(C)) {
11139 C = C[SPECIES];
11140 if (C === null) C = undefined;
11141 }
11142 } return C === undefined ? $Array : C;
11143};
11144
11145
11146/***/ }),
11147/* 365 */
11148/***/ (function(module, exports, __webpack_require__) {
11149
11150var parent = __webpack_require__(366);
11151
11152module.exports = parent;
11153
11154
11155/***/ }),
11156/* 366 */
11157/***/ (function(module, exports, __webpack_require__) {
11158
11159var isPrototypeOf = __webpack_require__(12);
11160var method = __webpack_require__(367);
11161
11162var ArrayPrototype = Array.prototype;
11163
11164module.exports = function (it) {
11165 var own = it.map;
11166 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;
11167};
11168
11169
11170/***/ }),
11171/* 367 */
11172/***/ (function(module, exports, __webpack_require__) {
11173
11174__webpack_require__(368);
11175var entryVirtual = __webpack_require__(26);
11176
11177module.exports = entryVirtual('Array').map;
11178
11179
11180/***/ }),
11181/* 368 */
11182/***/ (function(module, exports, __webpack_require__) {
11183
11184"use strict";
11185
11186var $ = __webpack_require__(0);
11187var $map = __webpack_require__(105).map;
11188var arrayMethodHasSpeciesSupport = __webpack_require__(104);
11189
11190var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
11191
11192// `Array.prototype.map` method
11193// https://tc39.es/ecma262/#sec-array.prototype.map
11194// with adding support of @@species
11195$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
11196 map: function map(callbackfn /* , thisArg */) {
11197 return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
11198 }
11199});
11200
11201
11202/***/ }),
11203/* 369 */
11204/***/ (function(module, exports, __webpack_require__) {
11205
11206var parent = __webpack_require__(370);
11207
11208module.exports = parent;
11209
11210
11211/***/ }),
11212/* 370 */
11213/***/ (function(module, exports, __webpack_require__) {
11214
11215__webpack_require__(371);
11216var path = __webpack_require__(15);
11217
11218module.exports = path.Object.keys;
11219
11220
11221/***/ }),
11222/* 371 */
11223/***/ (function(module, exports, __webpack_require__) {
11224
11225var $ = __webpack_require__(0);
11226var toObject = __webpack_require__(33);
11227var nativeKeys = __webpack_require__(120);
11228var fails = __webpack_require__(3);
11229
11230var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
11231
11232// `Object.keys` method
11233// https://tc39.es/ecma262/#sec-object.keys
11234$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
11235 keys: function keys(it) {
11236 return nativeKeys(toObject(it));
11237 }
11238});
11239
11240
11241/***/ }),
11242/* 372 */
11243/***/ (function(module, exports, __webpack_require__) {
11244
11245var parent = __webpack_require__(373);
11246
11247module.exports = parent;
11248
11249
11250/***/ }),
11251/* 373 */
11252/***/ (function(module, exports, __webpack_require__) {
11253
11254__webpack_require__(218);
11255var path = __webpack_require__(15);
11256var apply = __webpack_require__(71);
11257
11258// eslint-disable-next-line es-x/no-json -- safe
11259if (!path.JSON) path.JSON = { stringify: JSON.stringify };
11260
11261// eslint-disable-next-line no-unused-vars -- required for `.length`
11262module.exports = function stringify(it, replacer, space) {
11263 return apply(path.JSON.stringify, null, arguments);
11264};
11265
11266
11267/***/ }),
11268/* 374 */
11269/***/ (function(module, exports, __webpack_require__) {
11270
11271var parent = __webpack_require__(375);
11272
11273module.exports = parent;
11274
11275
11276/***/ }),
11277/* 375 */
11278/***/ (function(module, exports, __webpack_require__) {
11279
11280var isPrototypeOf = __webpack_require__(12);
11281var method = __webpack_require__(376);
11282
11283var ArrayPrototype = Array.prototype;
11284
11285module.exports = function (it) {
11286 var own = it.indexOf;
11287 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;
11288};
11289
11290
11291/***/ }),
11292/* 376 */
11293/***/ (function(module, exports, __webpack_require__) {
11294
11295__webpack_require__(377);
11296var entryVirtual = __webpack_require__(26);
11297
11298module.exports = entryVirtual('Array').indexOf;
11299
11300
11301/***/ }),
11302/* 377 */
11303/***/ (function(module, exports, __webpack_require__) {
11304
11305"use strict";
11306
11307/* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
11308var $ = __webpack_require__(0);
11309var uncurryThis = __webpack_require__(4);
11310var $IndexOf = __webpack_require__(115).indexOf;
11311var arrayMethodIsStrict = __webpack_require__(139);
11312
11313var un$IndexOf = uncurryThis([].indexOf);
11314
11315var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
11316var STRICT_METHOD = arrayMethodIsStrict('indexOf');
11317
11318// `Array.prototype.indexOf` method
11319// https://tc39.es/ecma262/#sec-array.prototype.indexof
11320$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
11321 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
11322 var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
11323 return NEGATIVE_ZERO
11324 // convert -0 to +0
11325 ? un$IndexOf(this, searchElement, fromIndex) || 0
11326 : $IndexOf(this, searchElement, fromIndex);
11327 }
11328});
11329
11330
11331/***/ }),
11332/* 378 */
11333/***/ (function(module, exports, __webpack_require__) {
11334
11335__webpack_require__(63);
11336var classof = __webpack_require__(47);
11337var hasOwn = __webpack_require__(13);
11338var isPrototypeOf = __webpack_require__(12);
11339var method = __webpack_require__(379);
11340
11341var ArrayPrototype = Array.prototype;
11342
11343var DOMIterables = {
11344 DOMTokenList: true,
11345 NodeList: true
11346};
11347
11348module.exports = function (it) {
11349 var own = it.keys;
11350 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
11351 || hasOwn(DOMIterables, classof(it)) ? method : own;
11352};
11353
11354
11355/***/ }),
11356/* 379 */
11357/***/ (function(module, exports, __webpack_require__) {
11358
11359var parent = __webpack_require__(380);
11360
11361module.exports = parent;
11362
11363
11364/***/ }),
11365/* 380 */
11366/***/ (function(module, exports, __webpack_require__) {
11367
11368__webpack_require__(60);
11369__webpack_require__(96);
11370var entryVirtual = __webpack_require__(26);
11371
11372module.exports = entryVirtual('Array').keys;
11373
11374
11375/***/ }),
11376/* 381 */
11377/***/ (function(module, exports) {
11378
11379// Unique ID creation requires a high quality random # generator. In the
11380// browser this is a little complicated due to unknown quality of Math.random()
11381// and inconsistent support for the `crypto` API. We do the best we can via
11382// feature-detection
11383
11384// getRandomValues needs to be invoked in a context where "this" is a Crypto
11385// implementation. Also, find the complete implementation of crypto on IE11.
11386var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
11387 (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
11388
11389if (getRandomValues) {
11390 // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
11391 var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
11392
11393 module.exports = function whatwgRNG() {
11394 getRandomValues(rnds8);
11395 return rnds8;
11396 };
11397} else {
11398 // Math.random()-based (RNG)
11399 //
11400 // If all else fails, use Math.random(). It's fast, but is of unspecified
11401 // quality.
11402 var rnds = new Array(16);
11403
11404 module.exports = function mathRNG() {
11405 for (var i = 0, r; i < 16; i++) {
11406 if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
11407 rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
11408 }
11409
11410 return rnds;
11411 };
11412}
11413
11414
11415/***/ }),
11416/* 382 */
11417/***/ (function(module, exports) {
11418
11419/**
11420 * Convert array of 16 byte values to UUID string format of the form:
11421 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
11422 */
11423var byteToHex = [];
11424for (var i = 0; i < 256; ++i) {
11425 byteToHex[i] = (i + 0x100).toString(16).substr(1);
11426}
11427
11428function bytesToUuid(buf, offset) {
11429 var i = offset || 0;
11430 var bth = byteToHex;
11431 // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
11432 return ([bth[buf[i++]], bth[buf[i++]],
11433 bth[buf[i++]], bth[buf[i++]], '-',
11434 bth[buf[i++]], bth[buf[i++]], '-',
11435 bth[buf[i++]], bth[buf[i++]], '-',
11436 bth[buf[i++]], bth[buf[i++]], '-',
11437 bth[buf[i++]], bth[buf[i++]],
11438 bth[buf[i++]], bth[buf[i++]],
11439 bth[buf[i++]], bth[buf[i++]]]).join('');
11440}
11441
11442module.exports = bytesToUuid;
11443
11444
11445/***/ }),
11446/* 383 */
11447/***/ (function(module, exports, __webpack_require__) {
11448
11449"use strict";
11450
11451
11452/**
11453 * This is the common logic for both the Node.js and web browser
11454 * implementations of `debug()`.
11455 */
11456function setup(env) {
11457 createDebug.debug = createDebug;
11458 createDebug.default = createDebug;
11459 createDebug.coerce = coerce;
11460 createDebug.disable = disable;
11461 createDebug.enable = enable;
11462 createDebug.enabled = enabled;
11463 createDebug.humanize = __webpack_require__(384);
11464 Object.keys(env).forEach(function (key) {
11465 createDebug[key] = env[key];
11466 });
11467 /**
11468 * Active `debug` instances.
11469 */
11470
11471 createDebug.instances = [];
11472 /**
11473 * The currently active debug mode names, and names to skip.
11474 */
11475
11476 createDebug.names = [];
11477 createDebug.skips = [];
11478 /**
11479 * Map of special "%n" handling functions, for the debug "format" argument.
11480 *
11481 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
11482 */
11483
11484 createDebug.formatters = {};
11485 /**
11486 * Selects a color for a debug namespace
11487 * @param {String} namespace The namespace string for the for the debug instance to be colored
11488 * @return {Number|String} An ANSI color code for the given namespace
11489 * @api private
11490 */
11491
11492 function selectColor(namespace) {
11493 var hash = 0;
11494
11495 for (var i = 0; i < namespace.length; i++) {
11496 hash = (hash << 5) - hash + namespace.charCodeAt(i);
11497 hash |= 0; // Convert to 32bit integer
11498 }
11499
11500 return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
11501 }
11502
11503 createDebug.selectColor = selectColor;
11504 /**
11505 * Create a debugger with the given `namespace`.
11506 *
11507 * @param {String} namespace
11508 * @return {Function}
11509 * @api public
11510 */
11511
11512 function createDebug(namespace) {
11513 var prevTime;
11514
11515 function debug() {
11516 // Disabled?
11517 if (!debug.enabled) {
11518 return;
11519 }
11520
11521 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11522 args[_key] = arguments[_key];
11523 }
11524
11525 var self = debug; // Set `diff` timestamp
11526
11527 var curr = Number(new Date());
11528 var ms = curr - (prevTime || curr);
11529 self.diff = ms;
11530 self.prev = prevTime;
11531 self.curr = curr;
11532 prevTime = curr;
11533 args[0] = createDebug.coerce(args[0]);
11534
11535 if (typeof args[0] !== 'string') {
11536 // Anything else let's inspect with %O
11537 args.unshift('%O');
11538 } // Apply any `formatters` transformations
11539
11540
11541 var index = 0;
11542 args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
11543 // If we encounter an escaped % then don't increase the array index
11544 if (match === '%%') {
11545 return match;
11546 }
11547
11548 index++;
11549 var formatter = createDebug.formatters[format];
11550
11551 if (typeof formatter === 'function') {
11552 var val = args[index];
11553 match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
11554
11555 args.splice(index, 1);
11556 index--;
11557 }
11558
11559 return match;
11560 }); // Apply env-specific formatting (colors, etc.)
11561
11562 createDebug.formatArgs.call(self, args);
11563 var logFn = self.log || createDebug.log;
11564 logFn.apply(self, args);
11565 }
11566
11567 debug.namespace = namespace;
11568 debug.enabled = createDebug.enabled(namespace);
11569 debug.useColors = createDebug.useColors();
11570 debug.color = selectColor(namespace);
11571 debug.destroy = destroy;
11572 debug.extend = extend; // Debug.formatArgs = formatArgs;
11573 // debug.rawLog = rawLog;
11574 // env-specific initialization logic for debug instances
11575
11576 if (typeof createDebug.init === 'function') {
11577 createDebug.init(debug);
11578 }
11579
11580 createDebug.instances.push(debug);
11581 return debug;
11582 }
11583
11584 function destroy() {
11585 var index = createDebug.instances.indexOf(this);
11586
11587 if (index !== -1) {
11588 createDebug.instances.splice(index, 1);
11589 return true;
11590 }
11591
11592 return false;
11593 }
11594
11595 function extend(namespace, delimiter) {
11596 return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
11597 }
11598 /**
11599 * Enables a debug mode by namespaces. This can include modes
11600 * separated by a colon and wildcards.
11601 *
11602 * @param {String} namespaces
11603 * @api public
11604 */
11605
11606
11607 function enable(namespaces) {
11608 createDebug.save(namespaces);
11609 createDebug.names = [];
11610 createDebug.skips = [];
11611 var i;
11612 var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
11613 var len = split.length;
11614
11615 for (i = 0; i < len; i++) {
11616 if (!split[i]) {
11617 // ignore empty strings
11618 continue;
11619 }
11620
11621 namespaces = split[i].replace(/\*/g, '.*?');
11622
11623 if (namespaces[0] === '-') {
11624 createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
11625 } else {
11626 createDebug.names.push(new RegExp('^' + namespaces + '$'));
11627 }
11628 }
11629
11630 for (i = 0; i < createDebug.instances.length; i++) {
11631 var instance = createDebug.instances[i];
11632 instance.enabled = createDebug.enabled(instance.namespace);
11633 }
11634 }
11635 /**
11636 * Disable debug output.
11637 *
11638 * @api public
11639 */
11640
11641
11642 function disable() {
11643 createDebug.enable('');
11644 }
11645 /**
11646 * Returns true if the given mode name is enabled, false otherwise.
11647 *
11648 * @param {String} name
11649 * @return {Boolean}
11650 * @api public
11651 */
11652
11653
11654 function enabled(name) {
11655 if (name[name.length - 1] === '*') {
11656 return true;
11657 }
11658
11659 var i;
11660 var len;
11661
11662 for (i = 0, len = createDebug.skips.length; i < len; i++) {
11663 if (createDebug.skips[i].test(name)) {
11664 return false;
11665 }
11666 }
11667
11668 for (i = 0, len = createDebug.names.length; i < len; i++) {
11669 if (createDebug.names[i].test(name)) {
11670 return true;
11671 }
11672 }
11673
11674 return false;
11675 }
11676 /**
11677 * Coerce `val`.
11678 *
11679 * @param {Mixed} val
11680 * @return {Mixed}
11681 * @api private
11682 */
11683
11684
11685 function coerce(val) {
11686 if (val instanceof Error) {
11687 return val.stack || val.message;
11688 }
11689
11690 return val;
11691 }
11692
11693 createDebug.enable(createDebug.load());
11694 return createDebug;
11695}
11696
11697module.exports = setup;
11698
11699
11700
11701/***/ }),
11702/* 384 */
11703/***/ (function(module, exports) {
11704
11705/**
11706 * Helpers.
11707 */
11708
11709var s = 1000;
11710var m = s * 60;
11711var h = m * 60;
11712var d = h * 24;
11713var w = d * 7;
11714var y = d * 365.25;
11715
11716/**
11717 * Parse or format the given `val`.
11718 *
11719 * Options:
11720 *
11721 * - `long` verbose formatting [false]
11722 *
11723 * @param {String|Number} val
11724 * @param {Object} [options]
11725 * @throws {Error} throw an error if val is not a non-empty string or a number
11726 * @return {String|Number}
11727 * @api public
11728 */
11729
11730module.exports = function(val, options) {
11731 options = options || {};
11732 var type = typeof val;
11733 if (type === 'string' && val.length > 0) {
11734 return parse(val);
11735 } else if (type === 'number' && isFinite(val)) {
11736 return options.long ? fmtLong(val) : fmtShort(val);
11737 }
11738 throw new Error(
11739 'val is not a non-empty string or a valid number. val=' +
11740 JSON.stringify(val)
11741 );
11742};
11743
11744/**
11745 * Parse the given `str` and return milliseconds.
11746 *
11747 * @param {String} str
11748 * @return {Number}
11749 * @api private
11750 */
11751
11752function parse(str) {
11753 str = String(str);
11754 if (str.length > 100) {
11755 return;
11756 }
11757 var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
11758 str
11759 );
11760 if (!match) {
11761 return;
11762 }
11763 var n = parseFloat(match[1]);
11764 var type = (match[2] || 'ms').toLowerCase();
11765 switch (type) {
11766 case 'years':
11767 case 'year':
11768 case 'yrs':
11769 case 'yr':
11770 case 'y':
11771 return n * y;
11772 case 'weeks':
11773 case 'week':
11774 case 'w':
11775 return n * w;
11776 case 'days':
11777 case 'day':
11778 case 'd':
11779 return n * d;
11780 case 'hours':
11781 case 'hour':
11782 case 'hrs':
11783 case 'hr':
11784 case 'h':
11785 return n * h;
11786 case 'minutes':
11787 case 'minute':
11788 case 'mins':
11789 case 'min':
11790 case 'm':
11791 return n * m;
11792 case 'seconds':
11793 case 'second':
11794 case 'secs':
11795 case 'sec':
11796 case 's':
11797 return n * s;
11798 case 'milliseconds':
11799 case 'millisecond':
11800 case 'msecs':
11801 case 'msec':
11802 case 'ms':
11803 return n;
11804 default:
11805 return undefined;
11806 }
11807}
11808
11809/**
11810 * Short format for `ms`.
11811 *
11812 * @param {Number} ms
11813 * @return {String}
11814 * @api private
11815 */
11816
11817function fmtShort(ms) {
11818 var msAbs = Math.abs(ms);
11819 if (msAbs >= d) {
11820 return Math.round(ms / d) + 'd';
11821 }
11822 if (msAbs >= h) {
11823 return Math.round(ms / h) + 'h';
11824 }
11825 if (msAbs >= m) {
11826 return Math.round(ms / m) + 'm';
11827 }
11828 if (msAbs >= s) {
11829 return Math.round(ms / s) + 's';
11830 }
11831 return ms + 'ms';
11832}
11833
11834/**
11835 * Long format for `ms`.
11836 *
11837 * @param {Number} ms
11838 * @return {String}
11839 * @api private
11840 */
11841
11842function fmtLong(ms) {
11843 var msAbs = Math.abs(ms);
11844 if (msAbs >= d) {
11845 return plural(ms, msAbs, d, 'day');
11846 }
11847 if (msAbs >= h) {
11848 return plural(ms, msAbs, h, 'hour');
11849 }
11850 if (msAbs >= m) {
11851 return plural(ms, msAbs, m, 'minute');
11852 }
11853 if (msAbs >= s) {
11854 return plural(ms, msAbs, s, 'second');
11855 }
11856 return ms + ' ms';
11857}
11858
11859/**
11860 * Pluralization helper.
11861 */
11862
11863function plural(ms, msAbs, n, name) {
11864 var isPlural = msAbs >= n * 1.5;
11865 return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
11866}
11867
11868
11869/***/ }),
11870/* 385 */
11871/***/ (function(module, exports, __webpack_require__) {
11872
11873__webpack_require__(386);
11874var path = __webpack_require__(15);
11875
11876module.exports = path.Object.getPrototypeOf;
11877
11878
11879/***/ }),
11880/* 386 */
11881/***/ (function(module, exports, __webpack_require__) {
11882
11883var $ = __webpack_require__(0);
11884var fails = __webpack_require__(3);
11885var toObject = __webpack_require__(33);
11886var nativeGetPrototypeOf = __webpack_require__(90);
11887var CORRECT_PROTOTYPE_GETTER = __webpack_require__(150);
11888
11889var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
11890
11891// `Object.getPrototypeOf` method
11892// https://tc39.es/ecma262/#sec-object.getprototypeof
11893$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
11894 getPrototypeOf: function getPrototypeOf(it) {
11895 return nativeGetPrototypeOf(toObject(it));
11896 }
11897});
11898
11899
11900
11901/***/ }),
11902/* 387 */
11903/***/ (function(module, exports, __webpack_require__) {
11904
11905module.exports = __webpack_require__(226);
11906
11907/***/ }),
11908/* 388 */
11909/***/ (function(module, exports, __webpack_require__) {
11910
11911__webpack_require__(389);
11912var path = __webpack_require__(15);
11913
11914module.exports = path.Object.setPrototypeOf;
11915
11916
11917/***/ }),
11918/* 389 */
11919/***/ (function(module, exports, __webpack_require__) {
11920
11921var $ = __webpack_require__(0);
11922var setPrototypeOf = __webpack_require__(92);
11923
11924// `Object.setPrototypeOf` method
11925// https://tc39.es/ecma262/#sec-object.setprototypeof
11926$({ target: 'Object', stat: true }, {
11927 setPrototypeOf: setPrototypeOf
11928});
11929
11930
11931/***/ }),
11932/* 390 */
11933/***/ (function(module, exports, __webpack_require__) {
11934
11935"use strict";
11936
11937
11938var _interopRequireDefault = __webpack_require__(1);
11939
11940var _slice = _interopRequireDefault(__webpack_require__(38));
11941
11942var _concat = _interopRequireDefault(__webpack_require__(25));
11943
11944var _defineProperty = _interopRequireDefault(__webpack_require__(140));
11945
11946var AV = __webpack_require__(67);
11947
11948var AppRouter = __webpack_require__(396);
11949
11950var _require = __webpack_require__(31),
11951 isNullOrUndefined = _require.isNullOrUndefined;
11952
11953var _require2 = __webpack_require__(2),
11954 extend = _require2.extend,
11955 isObject = _require2.isObject,
11956 isEmpty = _require2.isEmpty;
11957
11958var isCNApp = function isCNApp(appId) {
11959 return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
11960};
11961
11962var fillServerURLs = function fillServerURLs(url) {
11963 return {
11964 push: url,
11965 stats: url,
11966 engine: url,
11967 api: url,
11968 rtm: url
11969 };
11970};
11971
11972function getDefaultServerURLs(appId) {
11973 var _context, _context2, _context3, _context4, _context5;
11974
11975 if (isCNApp(appId)) {
11976 return {};
11977 }
11978
11979 var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
11980 var domain = 'lncldglobal.com';
11981 return {
11982 push: (0, _concat.default)(_context = "https://".concat(id, ".push.")).call(_context, domain),
11983 stats: (0, _concat.default)(_context2 = "https://".concat(id, ".stats.")).call(_context2, domain),
11984 engine: (0, _concat.default)(_context3 = "https://".concat(id, ".engine.")).call(_context3, domain),
11985 api: (0, _concat.default)(_context4 = "https://".concat(id, ".api.")).call(_context4, domain),
11986 rtm: (0, _concat.default)(_context5 = "https://".concat(id, ".rtm.")).call(_context5, domain)
11987 };
11988}
11989
11990var _disableAppRouter = false;
11991var _initialized = false;
11992/**
11993 * URLs for services
11994 * @typedef {Object} ServerURLs
11995 * @property {String} [api] serverURL for API service
11996 * @property {String} [engine] serverURL for engine service
11997 * @property {String} [stats] serverURL for stats service
11998 * @property {String} [push] serverURL for push service
11999 * @property {String} [rtm] serverURL for LiveQuery service
12000 */
12001
12002/**
12003 * Call this method first to set up your authentication tokens for AV.
12004 * You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .
12005 * @function AV.init
12006 * @param {Object} options
12007 * @param {String} options.appId application id
12008 * @param {String} options.appKey application key
12009 * @param {String} [options.masterKey] application master key
12010 * @param {Boolean} [options.production]
12011 * @param {String|ServerURLs} [options.serverURL] URLs for services. if a string was given, it will be applied for all services.
12012 * @param {Boolean} [options.disableCurrentUser]
12013 */
12014
12015AV.init = function init(options) {
12016 if (!isObject(options)) {
12017 return AV.init({
12018 appId: options,
12019 appKey: arguments.length <= 1 ? undefined : arguments[1],
12020 masterKey: arguments.length <= 2 ? undefined : arguments[2]
12021 });
12022 }
12023
12024 var appId = options.appId,
12025 appKey = options.appKey,
12026 masterKey = options.masterKey,
12027 hookKey = options.hookKey,
12028 serverURL = options.serverURL,
12029 _options$serverURLs = options.serverURLs,
12030 serverURLs = _options$serverURLs === void 0 ? serverURL : _options$serverURLs,
12031 disableCurrentUser = options.disableCurrentUser,
12032 production = options.production,
12033 realtime = options.realtime;
12034 if (_initialized) console.warn('Initializing LeanCloud Storage SDK which has already been initialized. Reinitializing the SDK might cause problems like unexpected cross-app data writing and invalid relations.');
12035 if (!appId) throw new TypeError('appId must be a string');
12036 if (!appKey) throw new TypeError('appKey must be a string');
12037 if ("Browser" !== 'NODE_JS' && masterKey) console.warn('MasterKey is not supposed to be used at client side.');
12038
12039 if (isCNApp(appId)) {
12040 if (!serverURLs && isEmpty(AV._config.serverURLs)) {
12041 throw new TypeError("serverURL option is required for apps from CN region");
12042 }
12043 }
12044
12045 if (appId !== AV._config.applicationId) {
12046 // overwrite all keys when reinitializing as a new app
12047 AV._config.masterKey = masterKey;
12048 AV._config.hookKey = hookKey;
12049 } else {
12050 if (masterKey) AV._config.masterKey = masterKey;
12051 if (hookKey) AV._config.hookKey = hookKey;
12052 }
12053
12054 AV._config.applicationId = appId;
12055 AV._config.applicationKey = appKey;
12056
12057 if (!isNullOrUndefined(production)) {
12058 AV.setProduction(production);
12059 }
12060
12061 if (typeof disableCurrentUser !== 'undefined') AV._config.disableCurrentUser = disableCurrentUser;
12062 var disableAppRouter = _disableAppRouter || typeof serverURLs !== 'undefined';
12063
12064 if (!disableAppRouter) {
12065 AV._appRouter = new AppRouter(AV);
12066 }
12067
12068 AV._setServerURLs(extend({}, getDefaultServerURLs(appId), AV._config.serverURLs, typeof serverURLs === 'string' ? fillServerURLs(serverURLs) : serverURLs), disableAppRouter);
12069
12070 if (realtime) {
12071 AV._config.realtime = realtime;
12072 } else if (AV._sharedConfig.liveQueryRealtime) {
12073 var _AV$_config$serverURL = AV._config.serverURLs,
12074 api = _AV$_config$serverURL.api,
12075 rtm = _AV$_config$serverURL.rtm;
12076 AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
12077 appId: appId,
12078 appKey: appKey,
12079 server: {
12080 api: api,
12081 RTMRouter: rtm
12082 }
12083 });
12084 }
12085
12086 _initialized = true;
12087}; // If we're running in node.js, allow using the master key.
12088
12089
12090if (false) {
12091 AV.Cloud = AV.Cloud || {};
12092 /**
12093 * Switches the LeanCloud SDK to using the Master key. The Master key grants
12094 * priveleged access to the data in LeanCloud and can be used to bypass ACLs and
12095 * other restrictions that are applied to the client SDKs.
12096 * <p><strong><em>Available in Cloud Code and Node.js only.</em></strong>
12097 * </p>
12098 */
12099
12100 AV.Cloud.useMasterKey = function () {
12101 AV._config.useMasterKey = true;
12102 };
12103}
12104/**
12105 * Call this method to set production environment variable.
12106 * @function AV.setProduction
12107 * @param {Boolean} production True is production environment,and
12108 * it's true by default.
12109 */
12110
12111
12112AV.setProduction = function (production) {
12113 if (!isNullOrUndefined(production)) {
12114 AV._config.production = production ? 1 : 0;
12115 } else {
12116 // change to default value
12117 AV._config.production = null;
12118 }
12119};
12120
12121AV._setServerURLs = function (urls) {
12122 var disableAppRouter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
12123
12124 if (typeof urls !== 'string') {
12125 extend(AV._config.serverURLs, urls);
12126 } else {
12127 AV._config.serverURLs = fillServerURLs(urls);
12128 }
12129
12130 if (disableAppRouter) {
12131 if (AV._appRouter) {
12132 AV._appRouter.disable();
12133 } else {
12134 _disableAppRouter = true;
12135 }
12136 }
12137};
12138/**
12139 * Set server URLs for services.
12140 * @function AV.setServerURL
12141 * @since 4.3.0
12142 * @param {String|ServerURLs} urls URLs for services. if a string was given, it will be applied for all services.
12143 * You can also set them when initializing SDK with `options.serverURL`
12144 */
12145
12146
12147AV.setServerURL = function (urls) {
12148 return AV._setServerURLs(urls);
12149};
12150
12151AV.setServerURLs = AV.setServerURL;
12152
12153AV.keepErrorRawMessage = function (value) {
12154 AV._sharedConfig.keepErrorRawMessage = value;
12155};
12156/**
12157 * Set a deadline for requests to complete.
12158 * Note that file upload requests are not affected.
12159 * @function AV.setRequestTimeout
12160 * @since 3.6.0
12161 * @param {number} ms
12162 */
12163
12164
12165AV.setRequestTimeout = function (ms) {
12166 AV._config.requestTimeout = ms;
12167}; // backword compatible
12168
12169
12170AV.initialize = AV.init;
12171
12172var defineConfig = function defineConfig(property) {
12173 return (0, _defineProperty.default)(AV, property, {
12174 get: function get() {
12175 return AV._config[property];
12176 },
12177 set: function set(value) {
12178 AV._config[property] = value;
12179 }
12180 });
12181};
12182
12183['applicationId', 'applicationKey', 'masterKey', 'hookKey'].forEach(defineConfig);
12184
12185/***/ }),
12186/* 391 */
12187/***/ (function(module, exports, __webpack_require__) {
12188
12189var isPrototypeOf = __webpack_require__(12);
12190var method = __webpack_require__(392);
12191
12192var ArrayPrototype = Array.prototype;
12193
12194module.exports = function (it) {
12195 var own = it.slice;
12196 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
12197};
12198
12199
12200/***/ }),
12201/* 392 */
12202/***/ (function(module, exports, __webpack_require__) {
12203
12204__webpack_require__(393);
12205var entryVirtual = __webpack_require__(26);
12206
12207module.exports = entryVirtual('Array').slice;
12208
12209
12210/***/ }),
12211/* 393 */
12212/***/ (function(module, exports, __webpack_require__) {
12213
12214"use strict";
12215
12216var $ = __webpack_require__(0);
12217var isArray = __webpack_require__(86);
12218var isConstructor = __webpack_require__(98);
12219var isObject = __webpack_require__(17);
12220var toAbsoluteIndex = __webpack_require__(116);
12221var lengthOfArrayLike = __webpack_require__(36);
12222var toIndexedObject = __webpack_require__(35);
12223var createProperty = __webpack_require__(103);
12224var wellKnownSymbol = __webpack_require__(5);
12225var arrayMethodHasSpeciesSupport = __webpack_require__(104);
12226var un$Slice = __webpack_require__(99);
12227
12228var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
12229
12230var SPECIES = wellKnownSymbol('species');
12231var $Array = Array;
12232var max = Math.max;
12233
12234// `Array.prototype.slice` method
12235// https://tc39.es/ecma262/#sec-array.prototype.slice
12236// fallback for not array-like ES3 strings and DOM objects
12237$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
12238 slice: function slice(start, end) {
12239 var O = toIndexedObject(this);
12240 var length = lengthOfArrayLike(O);
12241 var k = toAbsoluteIndex(start, length);
12242 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
12243 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
12244 var Constructor, result, n;
12245 if (isArray(O)) {
12246 Constructor = O.constructor;
12247 // cross-realm fallback
12248 if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
12249 Constructor = undefined;
12250 } else if (isObject(Constructor)) {
12251 Constructor = Constructor[SPECIES];
12252 if (Constructor === null) Constructor = undefined;
12253 }
12254 if (Constructor === $Array || Constructor === undefined) {
12255 return un$Slice(O, k, fin);
12256 }
12257 }
12258 result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
12259 for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
12260 result.length = n;
12261 return result;
12262 }
12263});
12264
12265
12266/***/ }),
12267/* 394 */
12268/***/ (function(module, exports, __webpack_require__) {
12269
12270__webpack_require__(395);
12271var path = __webpack_require__(15);
12272
12273var Object = path.Object;
12274
12275var defineProperty = module.exports = function defineProperty(it, key, desc) {
12276 return Object.defineProperty(it, key, desc);
12277};
12278
12279if (Object.defineProperty.sham) defineProperty.sham = true;
12280
12281
12282/***/ }),
12283/* 395 */
12284/***/ (function(module, exports, __webpack_require__) {
12285
12286var $ = __webpack_require__(0);
12287var DESCRIPTORS = __webpack_require__(20);
12288var defineProperty = __webpack_require__(34).f;
12289
12290// `Object.defineProperty` method
12291// https://tc39.es/ecma262/#sec-object.defineproperty
12292// eslint-disable-next-line es-x/no-object-defineproperty -- safe
12293$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
12294 defineProperty: defineProperty
12295});
12296
12297
12298/***/ }),
12299/* 396 */
12300/***/ (function(module, exports, __webpack_require__) {
12301
12302"use strict";
12303
12304
12305var ajax = __webpack_require__(106);
12306
12307var Cache = __webpack_require__(225);
12308
12309function AppRouter(AV) {
12310 var _this = this;
12311
12312 this.AV = AV;
12313 this.lockedUntil = 0;
12314 Cache.getAsync('serverURLs').then(function (data) {
12315 if (_this.disabled) return;
12316 if (!data) return _this.lock(0);
12317 var serverURLs = data.serverURLs,
12318 lockedUntil = data.lockedUntil;
12319
12320 _this.AV._setServerURLs(serverURLs, false);
12321
12322 _this.lockedUntil = lockedUntil;
12323 }).catch(function () {
12324 return _this.lock(0);
12325 });
12326}
12327
12328AppRouter.prototype.disable = function disable() {
12329 this.disabled = true;
12330};
12331
12332AppRouter.prototype.lock = function lock(ttl) {
12333 this.lockedUntil = Date.now() + ttl;
12334};
12335
12336AppRouter.prototype.refresh = function refresh() {
12337 var _this2 = this;
12338
12339 if (this.disabled) return;
12340 if (Date.now() < this.lockedUntil) return;
12341 this.lock(10);
12342 var url = 'https://app-router.com/2/route';
12343 return ajax({
12344 method: 'get',
12345 url: url,
12346 query: {
12347 appId: this.AV.applicationId
12348 }
12349 }).then(function (servers) {
12350 if (_this2.disabled) return;
12351 var ttl = servers.ttl;
12352 if (!ttl) throw new Error('missing ttl');
12353 ttl = ttl * 1000;
12354 var protocal = 'https://';
12355 var serverURLs = {
12356 push: protocal + servers.push_server,
12357 stats: protocal + servers.stats_server,
12358 engine: protocal + servers.engine_server,
12359 api: protocal + servers.api_server
12360 };
12361
12362 _this2.AV._setServerURLs(serverURLs, false);
12363
12364 _this2.lock(ttl);
12365
12366 return Cache.setAsync('serverURLs', {
12367 serverURLs: serverURLs,
12368 lockedUntil: _this2.lockedUntil
12369 }, ttl);
12370 }).catch(function (error) {
12371 // bypass all errors
12372 console.warn("refresh server URLs failed: ".concat(error.message));
12373
12374 _this2.lock(600);
12375 });
12376};
12377
12378module.exports = AppRouter;
12379
12380/***/ }),
12381/* 397 */
12382/***/ (function(module, exports, __webpack_require__) {
12383
12384module.exports = __webpack_require__(398);
12385
12386
12387/***/ }),
12388/* 398 */
12389/***/ (function(module, exports, __webpack_require__) {
12390
12391var parent = __webpack_require__(399);
12392__webpack_require__(423);
12393__webpack_require__(424);
12394__webpack_require__(425);
12395__webpack_require__(426);
12396__webpack_require__(427);
12397// TODO: Remove from `core-js@4`
12398__webpack_require__(428);
12399__webpack_require__(429);
12400__webpack_require__(430);
12401
12402module.exports = parent;
12403
12404
12405/***/ }),
12406/* 399 */
12407/***/ (function(module, exports, __webpack_require__) {
12408
12409var parent = __webpack_require__(230);
12410
12411module.exports = parent;
12412
12413
12414/***/ }),
12415/* 400 */
12416/***/ (function(module, exports, __webpack_require__) {
12417
12418__webpack_require__(215);
12419__webpack_require__(96);
12420__webpack_require__(401);
12421__webpack_require__(407);
12422__webpack_require__(408);
12423__webpack_require__(409);
12424__webpack_require__(410);
12425__webpack_require__(234);
12426__webpack_require__(411);
12427__webpack_require__(412);
12428__webpack_require__(413);
12429__webpack_require__(414);
12430__webpack_require__(415);
12431__webpack_require__(416);
12432__webpack_require__(417);
12433__webpack_require__(418);
12434__webpack_require__(419);
12435__webpack_require__(420);
12436__webpack_require__(421);
12437__webpack_require__(422);
12438var path = __webpack_require__(15);
12439
12440module.exports = path.Symbol;
12441
12442
12443/***/ }),
12444/* 401 */
12445/***/ (function(module, exports, __webpack_require__) {
12446
12447// TODO: Remove this module from `core-js@4` since it's split to modules listed below
12448__webpack_require__(402);
12449__webpack_require__(404);
12450__webpack_require__(405);
12451__webpack_require__(218);
12452__webpack_require__(406);
12453
12454
12455/***/ }),
12456/* 402 */
12457/***/ (function(module, exports, __webpack_require__) {
12458
12459"use strict";
12460
12461var $ = __webpack_require__(0);
12462var global = __webpack_require__(9);
12463var call = __webpack_require__(11);
12464var uncurryThis = __webpack_require__(4);
12465var IS_PURE = __webpack_require__(32);
12466var DESCRIPTORS = __webpack_require__(20);
12467var NATIVE_SYMBOL = __webpack_require__(55);
12468var fails = __webpack_require__(3);
12469var hasOwn = __webpack_require__(13);
12470var isPrototypeOf = __webpack_require__(12);
12471var anObject = __webpack_require__(21);
12472var toIndexedObject = __webpack_require__(35);
12473var toPropertyKey = __webpack_require__(88);
12474var $toString = __webpack_require__(40);
12475var createPropertyDescriptor = __webpack_require__(44);
12476var nativeObjectCreate = __webpack_require__(59);
12477var objectKeys = __webpack_require__(120);
12478var getOwnPropertyNamesModule = __webpack_require__(114);
12479var getOwnPropertyNamesExternal = __webpack_require__(403);
12480var getOwnPropertySymbolsModule = __webpack_require__(119);
12481var getOwnPropertyDescriptorModule = __webpack_require__(73);
12482var definePropertyModule = __webpack_require__(34);
12483var definePropertiesModule = __webpack_require__(152);
12484var propertyIsEnumerableModule = __webpack_require__(145);
12485var defineBuiltIn = __webpack_require__(48);
12486var shared = __webpack_require__(75);
12487var sharedKey = __webpack_require__(91);
12488var hiddenKeys = __webpack_require__(93);
12489var uid = __webpack_require__(112);
12490var wellKnownSymbol = __webpack_require__(5);
12491var wrappedWellKnownSymbolModule = __webpack_require__(142);
12492var defineWellKnownSymbol = __webpack_require__(7);
12493var defineSymbolToPrimitive = __webpack_require__(232);
12494var setToStringTag = __webpack_require__(61);
12495var InternalStateModule = __webpack_require__(95);
12496var $forEach = __webpack_require__(105).forEach;
12497
12498var HIDDEN = sharedKey('hidden');
12499var SYMBOL = 'Symbol';
12500var PROTOTYPE = 'prototype';
12501
12502var setInternalState = InternalStateModule.set;
12503var getInternalState = InternalStateModule.getterFor(SYMBOL);
12504
12505var ObjectPrototype = Object[PROTOTYPE];
12506var $Symbol = global.Symbol;
12507var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
12508var TypeError = global.TypeError;
12509var QObject = global.QObject;
12510var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
12511var nativeDefineProperty = definePropertyModule.f;
12512var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
12513var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
12514var push = uncurryThis([].push);
12515
12516var AllSymbols = shared('symbols');
12517var ObjectPrototypeSymbols = shared('op-symbols');
12518var WellKnownSymbolsStore = shared('wks');
12519
12520// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
12521var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
12522
12523// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
12524var setSymbolDescriptor = DESCRIPTORS && fails(function () {
12525 return nativeObjectCreate(nativeDefineProperty({}, 'a', {
12526 get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
12527 })).a != 7;
12528}) ? function (O, P, Attributes) {
12529 var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
12530 if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
12531 nativeDefineProperty(O, P, Attributes);
12532 if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
12533 nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
12534 }
12535} : nativeDefineProperty;
12536
12537var wrap = function (tag, description) {
12538 var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
12539 setInternalState(symbol, {
12540 type: SYMBOL,
12541 tag: tag,
12542 description: description
12543 });
12544 if (!DESCRIPTORS) symbol.description = description;
12545 return symbol;
12546};
12547
12548var $defineProperty = function defineProperty(O, P, Attributes) {
12549 if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
12550 anObject(O);
12551 var key = toPropertyKey(P);
12552 anObject(Attributes);
12553 if (hasOwn(AllSymbols, key)) {
12554 if (!Attributes.enumerable) {
12555 if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
12556 O[HIDDEN][key] = true;
12557 } else {
12558 if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
12559 Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
12560 } return setSymbolDescriptor(O, key, Attributes);
12561 } return nativeDefineProperty(O, key, Attributes);
12562};
12563
12564var $defineProperties = function defineProperties(O, Properties) {
12565 anObject(O);
12566 var properties = toIndexedObject(Properties);
12567 var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
12568 $forEach(keys, function (key) {
12569 if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
12570 });
12571 return O;
12572};
12573
12574var $create = function create(O, Properties) {
12575 return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
12576};
12577
12578var $propertyIsEnumerable = function propertyIsEnumerable(V) {
12579 var P = toPropertyKey(V);
12580 var enumerable = call(nativePropertyIsEnumerable, this, P);
12581 if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
12582 return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
12583 ? enumerable : true;
12584};
12585
12586var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
12587 var it = toIndexedObject(O);
12588 var key = toPropertyKey(P);
12589 if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
12590 var descriptor = nativeGetOwnPropertyDescriptor(it, key);
12591 if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
12592 descriptor.enumerable = true;
12593 }
12594 return descriptor;
12595};
12596
12597var $getOwnPropertyNames = function getOwnPropertyNames(O) {
12598 var names = nativeGetOwnPropertyNames(toIndexedObject(O));
12599 var result = [];
12600 $forEach(names, function (key) {
12601 if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
12602 });
12603 return result;
12604};
12605
12606var $getOwnPropertySymbols = function (O) {
12607 var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
12608 var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
12609 var result = [];
12610 $forEach(names, function (key) {
12611 if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
12612 push(result, AllSymbols[key]);
12613 }
12614 });
12615 return result;
12616};
12617
12618// `Symbol` constructor
12619// https://tc39.es/ecma262/#sec-symbol-constructor
12620if (!NATIVE_SYMBOL) {
12621 $Symbol = function Symbol() {
12622 if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
12623 var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
12624 var tag = uid(description);
12625 var setter = function (value) {
12626 if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
12627 if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
12628 setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
12629 };
12630 if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
12631 return wrap(tag, description);
12632 };
12633
12634 SymbolPrototype = $Symbol[PROTOTYPE];
12635
12636 defineBuiltIn(SymbolPrototype, 'toString', function toString() {
12637 return getInternalState(this).tag;
12638 });
12639
12640 defineBuiltIn($Symbol, 'withoutSetter', function (description) {
12641 return wrap(uid(description), description);
12642 });
12643
12644 propertyIsEnumerableModule.f = $propertyIsEnumerable;
12645 definePropertyModule.f = $defineProperty;
12646 definePropertiesModule.f = $defineProperties;
12647 getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
12648 getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
12649 getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
12650
12651 wrappedWellKnownSymbolModule.f = function (name) {
12652 return wrap(wellKnownSymbol(name), name);
12653 };
12654
12655 if (DESCRIPTORS) {
12656 // https://github.com/tc39/proposal-Symbol-description
12657 nativeDefineProperty(SymbolPrototype, 'description', {
12658 configurable: true,
12659 get: function description() {
12660 return getInternalState(this).description;
12661 }
12662 });
12663 if (!IS_PURE) {
12664 defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
12665 }
12666 }
12667}
12668
12669$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
12670 Symbol: $Symbol
12671});
12672
12673$forEach(objectKeys(WellKnownSymbolsStore), function (name) {
12674 defineWellKnownSymbol(name);
12675});
12676
12677$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
12678 useSetter: function () { USE_SETTER = true; },
12679 useSimple: function () { USE_SETTER = false; }
12680});
12681
12682$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
12683 // `Object.create` method
12684 // https://tc39.es/ecma262/#sec-object.create
12685 create: $create,
12686 // `Object.defineProperty` method
12687 // https://tc39.es/ecma262/#sec-object.defineproperty
12688 defineProperty: $defineProperty,
12689 // `Object.defineProperties` method
12690 // https://tc39.es/ecma262/#sec-object.defineproperties
12691 defineProperties: $defineProperties,
12692 // `Object.getOwnPropertyDescriptor` method
12693 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
12694 getOwnPropertyDescriptor: $getOwnPropertyDescriptor
12695});
12696
12697$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
12698 // `Object.getOwnPropertyNames` method
12699 // https://tc39.es/ecma262/#sec-object.getownpropertynames
12700 getOwnPropertyNames: $getOwnPropertyNames
12701});
12702
12703// `Symbol.prototype[@@toPrimitive]` method
12704// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
12705defineSymbolToPrimitive();
12706
12707// `Symbol.prototype[@@toStringTag]` property
12708// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
12709setToStringTag($Symbol, SYMBOL);
12710
12711hiddenKeys[HIDDEN] = true;
12712
12713
12714/***/ }),
12715/* 403 */
12716/***/ (function(module, exports, __webpack_require__) {
12717
12718/* eslint-disable es-x/no-object-getownpropertynames -- safe */
12719var classof = __webpack_require__(54);
12720var toIndexedObject = __webpack_require__(35);
12721var $getOwnPropertyNames = __webpack_require__(114).f;
12722var arraySlice = __webpack_require__(231);
12723
12724var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
12725 ? Object.getOwnPropertyNames(window) : [];
12726
12727var getWindowNames = function (it) {
12728 try {
12729 return $getOwnPropertyNames(it);
12730 } catch (error) {
12731 return arraySlice(windowNames);
12732 }
12733};
12734
12735// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
12736module.exports.f = function getOwnPropertyNames(it) {
12737 return windowNames && classof(it) == 'Window'
12738 ? getWindowNames(it)
12739 : $getOwnPropertyNames(toIndexedObject(it));
12740};
12741
12742
12743/***/ }),
12744/* 404 */
12745/***/ (function(module, exports, __webpack_require__) {
12746
12747var $ = __webpack_require__(0);
12748var getBuiltIn = __webpack_require__(18);
12749var hasOwn = __webpack_require__(13);
12750var toString = __webpack_require__(40);
12751var shared = __webpack_require__(75);
12752var NATIVE_SYMBOL_REGISTRY = __webpack_require__(233);
12753
12754var StringToSymbolRegistry = shared('string-to-symbol-registry');
12755var SymbolToStringRegistry = shared('symbol-to-string-registry');
12756
12757// `Symbol.for` method
12758// https://tc39.es/ecma262/#sec-symbol.for
12759$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
12760 'for': function (key) {
12761 var string = toString(key);
12762 if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
12763 var symbol = getBuiltIn('Symbol')(string);
12764 StringToSymbolRegistry[string] = symbol;
12765 SymbolToStringRegistry[symbol] = string;
12766 return symbol;
12767 }
12768});
12769
12770
12771/***/ }),
12772/* 405 */
12773/***/ (function(module, exports, __webpack_require__) {
12774
12775var $ = __webpack_require__(0);
12776var hasOwn = __webpack_require__(13);
12777var isSymbol = __webpack_require__(89);
12778var tryToString = __webpack_require__(57);
12779var shared = __webpack_require__(75);
12780var NATIVE_SYMBOL_REGISTRY = __webpack_require__(233);
12781
12782var SymbolToStringRegistry = shared('symbol-to-string-registry');
12783
12784// `Symbol.keyFor` method
12785// https://tc39.es/ecma262/#sec-symbol.keyfor
12786$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
12787 keyFor: function keyFor(sym) {
12788 if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');
12789 if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
12790 }
12791});
12792
12793
12794/***/ }),
12795/* 406 */
12796/***/ (function(module, exports, __webpack_require__) {
12797
12798var $ = __webpack_require__(0);
12799var NATIVE_SYMBOL = __webpack_require__(55);
12800var fails = __webpack_require__(3);
12801var getOwnPropertySymbolsModule = __webpack_require__(119);
12802var toObject = __webpack_require__(33);
12803
12804// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
12805// https://bugs.chromium.org/p/v8/issues/detail?id=3443
12806var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
12807
12808// `Object.getOwnPropertySymbols` method
12809// https://tc39.es/ecma262/#sec-object.getownpropertysymbols
12810$({ target: 'Object', stat: true, forced: FORCED }, {
12811 getOwnPropertySymbols: function getOwnPropertySymbols(it) {
12812 var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
12813 return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
12814 }
12815});
12816
12817
12818/***/ }),
12819/* 407 */
12820/***/ (function(module, exports, __webpack_require__) {
12821
12822var defineWellKnownSymbol = __webpack_require__(7);
12823
12824// `Symbol.asyncIterator` well-known symbol
12825// https://tc39.es/ecma262/#sec-symbol.asynciterator
12826defineWellKnownSymbol('asyncIterator');
12827
12828
12829/***/ }),
12830/* 408 */
12831/***/ (function(module, exports) {
12832
12833// empty
12834
12835
12836/***/ }),
12837/* 409 */
12838/***/ (function(module, exports, __webpack_require__) {
12839
12840var defineWellKnownSymbol = __webpack_require__(7);
12841
12842// `Symbol.hasInstance` well-known symbol
12843// https://tc39.es/ecma262/#sec-symbol.hasinstance
12844defineWellKnownSymbol('hasInstance');
12845
12846
12847/***/ }),
12848/* 410 */
12849/***/ (function(module, exports, __webpack_require__) {
12850
12851var defineWellKnownSymbol = __webpack_require__(7);
12852
12853// `Symbol.isConcatSpreadable` well-known symbol
12854// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
12855defineWellKnownSymbol('isConcatSpreadable');
12856
12857
12858/***/ }),
12859/* 411 */
12860/***/ (function(module, exports, __webpack_require__) {
12861
12862var defineWellKnownSymbol = __webpack_require__(7);
12863
12864// `Symbol.match` well-known symbol
12865// https://tc39.es/ecma262/#sec-symbol.match
12866defineWellKnownSymbol('match');
12867
12868
12869/***/ }),
12870/* 412 */
12871/***/ (function(module, exports, __webpack_require__) {
12872
12873var defineWellKnownSymbol = __webpack_require__(7);
12874
12875// `Symbol.matchAll` well-known symbol
12876// https://tc39.es/ecma262/#sec-symbol.matchall
12877defineWellKnownSymbol('matchAll');
12878
12879
12880/***/ }),
12881/* 413 */
12882/***/ (function(module, exports, __webpack_require__) {
12883
12884var defineWellKnownSymbol = __webpack_require__(7);
12885
12886// `Symbol.replace` well-known symbol
12887// https://tc39.es/ecma262/#sec-symbol.replace
12888defineWellKnownSymbol('replace');
12889
12890
12891/***/ }),
12892/* 414 */
12893/***/ (function(module, exports, __webpack_require__) {
12894
12895var defineWellKnownSymbol = __webpack_require__(7);
12896
12897// `Symbol.search` well-known symbol
12898// https://tc39.es/ecma262/#sec-symbol.search
12899defineWellKnownSymbol('search');
12900
12901
12902/***/ }),
12903/* 415 */
12904/***/ (function(module, exports, __webpack_require__) {
12905
12906var defineWellKnownSymbol = __webpack_require__(7);
12907
12908// `Symbol.species` well-known symbol
12909// https://tc39.es/ecma262/#sec-symbol.species
12910defineWellKnownSymbol('species');
12911
12912
12913/***/ }),
12914/* 416 */
12915/***/ (function(module, exports, __webpack_require__) {
12916
12917var defineWellKnownSymbol = __webpack_require__(7);
12918
12919// `Symbol.split` well-known symbol
12920// https://tc39.es/ecma262/#sec-symbol.split
12921defineWellKnownSymbol('split');
12922
12923
12924/***/ }),
12925/* 417 */
12926/***/ (function(module, exports, __webpack_require__) {
12927
12928var defineWellKnownSymbol = __webpack_require__(7);
12929var defineSymbolToPrimitive = __webpack_require__(232);
12930
12931// `Symbol.toPrimitive` well-known symbol
12932// https://tc39.es/ecma262/#sec-symbol.toprimitive
12933defineWellKnownSymbol('toPrimitive');
12934
12935// `Symbol.prototype[@@toPrimitive]` method
12936// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
12937defineSymbolToPrimitive();
12938
12939
12940/***/ }),
12941/* 418 */
12942/***/ (function(module, exports, __webpack_require__) {
12943
12944var getBuiltIn = __webpack_require__(18);
12945var defineWellKnownSymbol = __webpack_require__(7);
12946var setToStringTag = __webpack_require__(61);
12947
12948// `Symbol.toStringTag` well-known symbol
12949// https://tc39.es/ecma262/#sec-symbol.tostringtag
12950defineWellKnownSymbol('toStringTag');
12951
12952// `Symbol.prototype[@@toStringTag]` property
12953// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
12954setToStringTag(getBuiltIn('Symbol'), 'Symbol');
12955
12956
12957/***/ }),
12958/* 419 */
12959/***/ (function(module, exports, __webpack_require__) {
12960
12961var defineWellKnownSymbol = __webpack_require__(7);
12962
12963// `Symbol.unscopables` well-known symbol
12964// https://tc39.es/ecma262/#sec-symbol.unscopables
12965defineWellKnownSymbol('unscopables');
12966
12967
12968/***/ }),
12969/* 420 */
12970/***/ (function(module, exports, __webpack_require__) {
12971
12972var global = __webpack_require__(9);
12973var setToStringTag = __webpack_require__(61);
12974
12975// JSON[@@toStringTag] property
12976// https://tc39.es/ecma262/#sec-json-@@tostringtag
12977setToStringTag(global.JSON, 'JSON', true);
12978
12979
12980/***/ }),
12981/* 421 */
12982/***/ (function(module, exports) {
12983
12984// empty
12985
12986
12987/***/ }),
12988/* 422 */
12989/***/ (function(module, exports) {
12990
12991// empty
12992
12993
12994/***/ }),
12995/* 423 */
12996/***/ (function(module, exports, __webpack_require__) {
12997
12998var defineWellKnownSymbol = __webpack_require__(7);
12999
13000// `Symbol.asyncDispose` well-known symbol
13001// https://github.com/tc39/proposal-using-statement
13002defineWellKnownSymbol('asyncDispose');
13003
13004
13005/***/ }),
13006/* 424 */
13007/***/ (function(module, exports, __webpack_require__) {
13008
13009var defineWellKnownSymbol = __webpack_require__(7);
13010
13011// `Symbol.dispose` well-known symbol
13012// https://github.com/tc39/proposal-using-statement
13013defineWellKnownSymbol('dispose');
13014
13015
13016/***/ }),
13017/* 425 */
13018/***/ (function(module, exports, __webpack_require__) {
13019
13020var defineWellKnownSymbol = __webpack_require__(7);
13021
13022// `Symbol.matcher` well-known symbol
13023// https://github.com/tc39/proposal-pattern-matching
13024defineWellKnownSymbol('matcher');
13025
13026
13027/***/ }),
13028/* 426 */
13029/***/ (function(module, exports, __webpack_require__) {
13030
13031var defineWellKnownSymbol = __webpack_require__(7);
13032
13033// `Symbol.metadataKey` well-known symbol
13034// https://github.com/tc39/proposal-decorator-metadata
13035defineWellKnownSymbol('metadataKey');
13036
13037
13038/***/ }),
13039/* 427 */
13040/***/ (function(module, exports, __webpack_require__) {
13041
13042var defineWellKnownSymbol = __webpack_require__(7);
13043
13044// `Symbol.observable` well-known symbol
13045// https://github.com/tc39/proposal-observable
13046defineWellKnownSymbol('observable');
13047
13048
13049/***/ }),
13050/* 428 */
13051/***/ (function(module, exports, __webpack_require__) {
13052
13053// TODO: Remove from `core-js@4`
13054var defineWellKnownSymbol = __webpack_require__(7);
13055
13056// `Symbol.metadata` well-known symbol
13057// https://github.com/tc39/proposal-decorators
13058defineWellKnownSymbol('metadata');
13059
13060
13061/***/ }),
13062/* 429 */
13063/***/ (function(module, exports, __webpack_require__) {
13064
13065// TODO: remove from `core-js@4`
13066var defineWellKnownSymbol = __webpack_require__(7);
13067
13068// `Symbol.patternMatch` well-known symbol
13069// https://github.com/tc39/proposal-pattern-matching
13070defineWellKnownSymbol('patternMatch');
13071
13072
13073/***/ }),
13074/* 430 */
13075/***/ (function(module, exports, __webpack_require__) {
13076
13077// TODO: remove from `core-js@4`
13078var defineWellKnownSymbol = __webpack_require__(7);
13079
13080defineWellKnownSymbol('replaceAll');
13081
13082
13083/***/ }),
13084/* 431 */
13085/***/ (function(module, exports, __webpack_require__) {
13086
13087module.exports = __webpack_require__(432);
13088
13089/***/ }),
13090/* 432 */
13091/***/ (function(module, exports, __webpack_require__) {
13092
13093module.exports = __webpack_require__(433);
13094
13095
13096/***/ }),
13097/* 433 */
13098/***/ (function(module, exports, __webpack_require__) {
13099
13100var parent = __webpack_require__(434);
13101
13102module.exports = parent;
13103
13104
13105/***/ }),
13106/* 434 */
13107/***/ (function(module, exports, __webpack_require__) {
13108
13109var parent = __webpack_require__(235);
13110
13111module.exports = parent;
13112
13113
13114/***/ }),
13115/* 435 */
13116/***/ (function(module, exports, __webpack_require__) {
13117
13118__webpack_require__(60);
13119__webpack_require__(96);
13120__webpack_require__(79);
13121__webpack_require__(234);
13122var WrappedWellKnownSymbolModule = __webpack_require__(142);
13123
13124module.exports = WrappedWellKnownSymbolModule.f('iterator');
13125
13126
13127/***/ }),
13128/* 436 */
13129/***/ (function(module, exports, __webpack_require__) {
13130
13131module.exports = __webpack_require__(437);
13132
13133/***/ }),
13134/* 437 */
13135/***/ (function(module, exports, __webpack_require__) {
13136
13137var parent = __webpack_require__(438);
13138
13139module.exports = parent;
13140
13141
13142/***/ }),
13143/* 438 */
13144/***/ (function(module, exports, __webpack_require__) {
13145
13146var isPrototypeOf = __webpack_require__(12);
13147var method = __webpack_require__(439);
13148
13149var ArrayPrototype = Array.prototype;
13150
13151module.exports = function (it) {
13152 var own = it.filter;
13153 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;
13154};
13155
13156
13157/***/ }),
13158/* 439 */
13159/***/ (function(module, exports, __webpack_require__) {
13160
13161__webpack_require__(440);
13162var entryVirtual = __webpack_require__(26);
13163
13164module.exports = entryVirtual('Array').filter;
13165
13166
13167/***/ }),
13168/* 440 */
13169/***/ (function(module, exports, __webpack_require__) {
13170
13171"use strict";
13172
13173var $ = __webpack_require__(0);
13174var $filter = __webpack_require__(105).filter;
13175var arrayMethodHasSpeciesSupport = __webpack_require__(104);
13176
13177var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
13178
13179// `Array.prototype.filter` method
13180// https://tc39.es/ecma262/#sec-array.prototype.filter
13181// with adding support of @@species
13182$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
13183 filter: function filter(callbackfn /* , thisArg */) {
13184 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
13185 }
13186});
13187
13188
13189/***/ }),
13190/* 441 */
13191/***/ (function(module, exports, __webpack_require__) {
13192
13193"use strict";
13194// Copyright (c) 2015-2017 David M. Lee, II
13195
13196
13197/**
13198 * Local reference to TimeoutError
13199 * @private
13200 */
13201var TimeoutError;
13202
13203/**
13204 * Rejects a promise with a {@link TimeoutError} if it does not settle within
13205 * the specified timeout.
13206 *
13207 * @param {Promise} promise The promise.
13208 * @param {number} timeoutMillis Number of milliseconds to wait on settling.
13209 * @returns {Promise} Either resolves/rejects with `promise`, or rejects with
13210 * `TimeoutError`, whichever settles first.
13211 */
13212var timeout = module.exports.timeout = function(promise, timeoutMillis) {
13213 var error = new TimeoutError(),
13214 timeout;
13215
13216 return Promise.race([
13217 promise,
13218 new Promise(function(resolve, reject) {
13219 timeout = setTimeout(function() {
13220 reject(error);
13221 }, timeoutMillis);
13222 }),
13223 ]).then(function(v) {
13224 clearTimeout(timeout);
13225 return v;
13226 }, function(err) {
13227 clearTimeout(timeout);
13228 throw err;
13229 });
13230};
13231
13232/**
13233 * Exception indicating that the timeout expired.
13234 */
13235TimeoutError = module.exports.TimeoutError = function() {
13236 Error.call(this)
13237 this.stack = Error().stack
13238 this.message = 'Timeout';
13239};
13240
13241TimeoutError.prototype = Object.create(Error.prototype);
13242TimeoutError.prototype.name = "TimeoutError";
13243
13244
13245/***/ }),
13246/* 442 */
13247/***/ (function(module, exports, __webpack_require__) {
13248
13249"use strict";
13250
13251
13252var _interopRequireDefault = __webpack_require__(1);
13253
13254var _slice = _interopRequireDefault(__webpack_require__(38));
13255
13256var _keys = _interopRequireDefault(__webpack_require__(53));
13257
13258var _concat = _interopRequireDefault(__webpack_require__(25));
13259
13260var _ = __webpack_require__(2);
13261
13262module.exports = function (AV) {
13263 var eventSplitter = /\s+/;
13264 var slice = (0, _slice.default)(Array.prototype);
13265 /**
13266 * @class
13267 *
13268 * <p>AV.Events is a fork of Backbone's Events module, provided for your
13269 * convenience.</p>
13270 *
13271 * <p>A module that can be mixed in to any object in order to provide
13272 * it with custom events. You may bind callback functions to an event
13273 * with `on`, or remove these functions with `off`.
13274 * Triggering an event fires all callbacks in the order that `on` was
13275 * called.
13276 *
13277 * @private
13278 * @example
13279 * var object = {};
13280 * _.extend(object, AV.Events);
13281 * object.on('expand', function(){ alert('expanded'); });
13282 * object.trigger('expand');</pre></p>
13283 *
13284 */
13285
13286 AV.Events = {
13287 /**
13288 * Bind one or more space separated events, `events`, to a `callback`
13289 * function. Passing `"all"` will bind the callback to all events fired.
13290 */
13291 on: function on(events, callback, context) {
13292 var calls, event, node, tail, list;
13293
13294 if (!callback) {
13295 return this;
13296 }
13297
13298 events = events.split(eventSplitter);
13299 calls = this._callbacks || (this._callbacks = {}); // Create an immutable callback list, allowing traversal during
13300 // modification. The tail is an empty object that will always be used
13301 // as the next node.
13302
13303 event = events.shift();
13304
13305 while (event) {
13306 list = calls[event];
13307 node = list ? list.tail : {};
13308 node.next = tail = {};
13309 node.context = context;
13310 node.callback = callback;
13311 calls[event] = {
13312 tail: tail,
13313 next: list ? list.next : node
13314 };
13315 event = events.shift();
13316 }
13317
13318 return this;
13319 },
13320
13321 /**
13322 * Remove one or many callbacks. If `context` is null, removes all callbacks
13323 * with that function. If `callback` is null, removes all callbacks for the
13324 * event. If `events` is null, removes all bound callbacks for all events.
13325 */
13326 off: function off(events, callback, context) {
13327 var event, calls, node, tail, cb, ctx; // No events, or removing *all* events.
13328
13329 if (!(calls = this._callbacks)) {
13330 return;
13331 }
13332
13333 if (!(events || callback || context)) {
13334 delete this._callbacks;
13335 return this;
13336 } // Loop through the listed events and contexts, splicing them out of the
13337 // linked list of callbacks if appropriate.
13338
13339
13340 events = events ? events.split(eventSplitter) : (0, _keys.default)(_).call(_, calls);
13341 event = events.shift();
13342
13343 while (event) {
13344 node = calls[event];
13345 delete calls[event];
13346
13347 if (!node || !(callback || context)) {
13348 continue;
13349 } // Create a new list, omitting the indicated callbacks.
13350
13351
13352 tail = node.tail;
13353 node = node.next;
13354
13355 while (node !== tail) {
13356 cb = node.callback;
13357 ctx = node.context;
13358
13359 if (callback && cb !== callback || context && ctx !== context) {
13360 this.on(event, cb, ctx);
13361 }
13362
13363 node = node.next;
13364 }
13365
13366 event = events.shift();
13367 }
13368
13369 return this;
13370 },
13371
13372 /**
13373 * Trigger one or many events, firing all bound callbacks. Callbacks are
13374 * passed the same arguments as `trigger` is, apart from the event name
13375 * (unless you're listening on `"all"`, which will cause your callback to
13376 * receive the true name of the event as the first argument).
13377 */
13378 trigger: function trigger(events) {
13379 var event, node, calls, tail, args, all, rest;
13380
13381 if (!(calls = this._callbacks)) {
13382 return this;
13383 }
13384
13385 all = calls.all;
13386 events = events.split(eventSplitter);
13387 rest = slice.call(arguments, 1); // For each event, walk through the linked list of callbacks twice,
13388 // first to trigger the event, then to trigger any `"all"` callbacks.
13389
13390 event = events.shift();
13391
13392 while (event) {
13393 node = calls[event];
13394
13395 if (node) {
13396 tail = node.tail;
13397
13398 while ((node = node.next) !== tail) {
13399 node.callback.apply(node.context || this, rest);
13400 }
13401 }
13402
13403 node = all;
13404
13405 if (node) {
13406 var _context;
13407
13408 tail = node.tail;
13409 args = (0, _concat.default)(_context = [event]).call(_context, rest);
13410
13411 while ((node = node.next) !== tail) {
13412 node.callback.apply(node.context || this, args);
13413 }
13414 }
13415
13416 event = events.shift();
13417 }
13418
13419 return this;
13420 }
13421 };
13422 /**
13423 * @function
13424 */
13425
13426 AV.Events.bind = AV.Events.on;
13427 /**
13428 * @function
13429 */
13430
13431 AV.Events.unbind = AV.Events.off;
13432};
13433
13434/***/ }),
13435/* 443 */
13436/***/ (function(module, exports, __webpack_require__) {
13437
13438"use strict";
13439
13440
13441var _interopRequireDefault = __webpack_require__(1);
13442
13443var _promise = _interopRequireDefault(__webpack_require__(10));
13444
13445var _ = __webpack_require__(2);
13446/*global navigator: false */
13447
13448
13449module.exports = function (AV) {
13450 /**
13451 * Creates a new GeoPoint with any of the following forms:<br>
13452 * @example
13453 * new GeoPoint(otherGeoPoint)
13454 * new GeoPoint(30, 30)
13455 * new GeoPoint([30, 30])
13456 * new GeoPoint({latitude: 30, longitude: 30})
13457 * new GeoPoint() // defaults to (0, 0)
13458 * @class
13459 *
13460 * <p>Represents a latitude / longitude point that may be associated
13461 * with a key in a AVObject or used as a reference point for geo queries.
13462 * This allows proximity-based queries on the key.</p>
13463 *
13464 * <p>Only one key in a class may contain a GeoPoint.</p>
13465 *
13466 * <p>Example:<pre>
13467 * var point = new AV.GeoPoint(30.0, -20.0);
13468 * var object = new AV.Object("PlaceObject");
13469 * object.set("location", point);
13470 * object.save();</pre></p>
13471 */
13472 AV.GeoPoint = function (arg1, arg2) {
13473 if (_.isArray(arg1)) {
13474 AV.GeoPoint._validate(arg1[0], arg1[1]);
13475
13476 this.latitude = arg1[0];
13477 this.longitude = arg1[1];
13478 } else if (_.isObject(arg1)) {
13479 AV.GeoPoint._validate(arg1.latitude, arg1.longitude);
13480
13481 this.latitude = arg1.latitude;
13482 this.longitude = arg1.longitude;
13483 } else if (_.isNumber(arg1) && _.isNumber(arg2)) {
13484 AV.GeoPoint._validate(arg1, arg2);
13485
13486 this.latitude = arg1;
13487 this.longitude = arg2;
13488 } else {
13489 this.latitude = 0;
13490 this.longitude = 0;
13491 } // Add properties so that anyone using Webkit or Mozilla will get an error
13492 // if they try to set values that are out of bounds.
13493
13494
13495 var self = this;
13496
13497 if (this.__defineGetter__ && this.__defineSetter__) {
13498 // Use _latitude and _longitude to actually store the values, and add
13499 // getters and setters for latitude and longitude.
13500 this._latitude = this.latitude;
13501 this._longitude = this.longitude;
13502
13503 this.__defineGetter__('latitude', function () {
13504 return self._latitude;
13505 });
13506
13507 this.__defineGetter__('longitude', function () {
13508 return self._longitude;
13509 });
13510
13511 this.__defineSetter__('latitude', function (val) {
13512 AV.GeoPoint._validate(val, self.longitude);
13513
13514 self._latitude = val;
13515 });
13516
13517 this.__defineSetter__('longitude', function (val) {
13518 AV.GeoPoint._validate(self.latitude, val);
13519
13520 self._longitude = val;
13521 });
13522 }
13523 };
13524 /**
13525 * @lends AV.GeoPoint.prototype
13526 * @property {float} latitude North-south portion of the coordinate, in range
13527 * [-90, 90]. Throws an exception if set out of range in a modern browser.
13528 * @property {float} longitude East-west portion of the coordinate, in range
13529 * [-180, 180]. Throws if set out of range in a modern browser.
13530 */
13531
13532 /**
13533 * Throws an exception if the given lat-long is out of bounds.
13534 * @private
13535 */
13536
13537
13538 AV.GeoPoint._validate = function (latitude, longitude) {
13539 if (latitude < -90.0) {
13540 throw new Error('AV.GeoPoint latitude ' + latitude + ' < -90.0.');
13541 }
13542
13543 if (latitude > 90.0) {
13544 throw new Error('AV.GeoPoint latitude ' + latitude + ' > 90.0.');
13545 }
13546
13547 if (longitude < -180.0) {
13548 throw new Error('AV.GeoPoint longitude ' + longitude + ' < -180.0.');
13549 }
13550
13551 if (longitude > 180.0) {
13552 throw new Error('AV.GeoPoint longitude ' + longitude + ' > 180.0.');
13553 }
13554 };
13555 /**
13556 * Creates a GeoPoint with the user's current location, if available.
13557 * @return {Promise.<AV.GeoPoint>}
13558 */
13559
13560
13561 AV.GeoPoint.current = function () {
13562 return new _promise.default(function (resolve, reject) {
13563 navigator.geolocation.getCurrentPosition(function (location) {
13564 resolve(new AV.GeoPoint({
13565 latitude: location.coords.latitude,
13566 longitude: location.coords.longitude
13567 }));
13568 }, reject);
13569 });
13570 };
13571
13572 _.extend(AV.GeoPoint.prototype,
13573 /** @lends AV.GeoPoint.prototype */
13574 {
13575 /**
13576 * Returns a JSON representation of the GeoPoint, suitable for AV.
13577 * @return {Object}
13578 */
13579 toJSON: function toJSON() {
13580 AV.GeoPoint._validate(this.latitude, this.longitude);
13581
13582 return {
13583 __type: 'GeoPoint',
13584 latitude: this.latitude,
13585 longitude: this.longitude
13586 };
13587 },
13588
13589 /**
13590 * Returns the distance from this GeoPoint to another in radians.
13591 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13592 * @return {Number}
13593 */
13594 radiansTo: function radiansTo(point) {
13595 var d2r = Math.PI / 180.0;
13596 var lat1rad = this.latitude * d2r;
13597 var long1rad = this.longitude * d2r;
13598 var lat2rad = point.latitude * d2r;
13599 var long2rad = point.longitude * d2r;
13600 var deltaLat = lat1rad - lat2rad;
13601 var deltaLong = long1rad - long2rad;
13602 var sinDeltaLatDiv2 = Math.sin(deltaLat / 2);
13603 var sinDeltaLongDiv2 = Math.sin(deltaLong / 2); // Square of half the straight line chord distance between both points.
13604
13605 var a = sinDeltaLatDiv2 * sinDeltaLatDiv2 + Math.cos(lat1rad) * Math.cos(lat2rad) * sinDeltaLongDiv2 * sinDeltaLongDiv2;
13606 a = Math.min(1.0, a);
13607 return 2 * Math.asin(Math.sqrt(a));
13608 },
13609
13610 /**
13611 * Returns the distance from this GeoPoint to another in kilometers.
13612 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13613 * @return {Number}
13614 */
13615 kilometersTo: function kilometersTo(point) {
13616 return this.radiansTo(point) * 6371.0;
13617 },
13618
13619 /**
13620 * Returns the distance from this GeoPoint to another in miles.
13621 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13622 * @return {Number}
13623 */
13624 milesTo: function milesTo(point) {
13625 return this.radiansTo(point) * 3958.8;
13626 }
13627 });
13628};
13629
13630/***/ }),
13631/* 444 */
13632/***/ (function(module, exports, __webpack_require__) {
13633
13634"use strict";
13635
13636
13637var _ = __webpack_require__(2);
13638
13639module.exports = function (AV) {
13640 var PUBLIC_KEY = '*';
13641 /**
13642 * Creates a new ACL.
13643 * If no argument is given, the ACL has no permissions for anyone.
13644 * If the argument is a AV.User, the ACL will have read and write
13645 * permission for only that user.
13646 * If the argument is any other JSON object, that object will be interpretted
13647 * as a serialized ACL created with toJSON().
13648 * @see AV.Object#setACL
13649 * @class
13650 *
13651 * <p>An ACL, or Access Control List can be added to any
13652 * <code>AV.Object</code> to restrict access to only a subset of users
13653 * of your application.</p>
13654 */
13655
13656 AV.ACL = function (arg1) {
13657 var self = this;
13658 self.permissionsById = {};
13659
13660 if (_.isObject(arg1)) {
13661 if (arg1 instanceof AV.User) {
13662 self.setReadAccess(arg1, true);
13663 self.setWriteAccess(arg1, true);
13664 } else {
13665 if (_.isFunction(arg1)) {
13666 throw new Error('AV.ACL() called with a function. Did you forget ()?');
13667 }
13668
13669 AV._objectEach(arg1, function (accessList, userId) {
13670 if (!_.isString(userId)) {
13671 throw new Error('Tried to create an ACL with an invalid userId.');
13672 }
13673
13674 self.permissionsById[userId] = {};
13675
13676 AV._objectEach(accessList, function (allowed, permission) {
13677 if (permission !== 'read' && permission !== 'write') {
13678 throw new Error('Tried to create an ACL with an invalid permission type.');
13679 }
13680
13681 if (!_.isBoolean(allowed)) {
13682 throw new Error('Tried to create an ACL with an invalid permission value.');
13683 }
13684
13685 self.permissionsById[userId][permission] = allowed;
13686 });
13687 });
13688 }
13689 }
13690 };
13691 /**
13692 * Returns a JSON-encoded version of the ACL.
13693 * @return {Object}
13694 */
13695
13696
13697 AV.ACL.prototype.toJSON = function () {
13698 return _.clone(this.permissionsById);
13699 };
13700
13701 AV.ACL.prototype._setAccess = function (accessType, userId, allowed) {
13702 if (userId instanceof AV.User) {
13703 userId = userId.id;
13704 } else if (userId instanceof AV.Role) {
13705 userId = 'role:' + userId.getName();
13706 }
13707
13708 if (!_.isString(userId)) {
13709 throw new Error('userId must be a string.');
13710 }
13711
13712 if (!_.isBoolean(allowed)) {
13713 throw new Error('allowed must be either true or false.');
13714 }
13715
13716 var permissions = this.permissionsById[userId];
13717
13718 if (!permissions) {
13719 if (!allowed) {
13720 // The user already doesn't have this permission, so no action needed.
13721 return;
13722 } else {
13723 permissions = {};
13724 this.permissionsById[userId] = permissions;
13725 }
13726 }
13727
13728 if (allowed) {
13729 this.permissionsById[userId][accessType] = true;
13730 } else {
13731 delete permissions[accessType];
13732
13733 if (_.isEmpty(permissions)) {
13734 delete this.permissionsById[userId];
13735 }
13736 }
13737 };
13738
13739 AV.ACL.prototype._getAccess = function (accessType, userId) {
13740 if (userId instanceof AV.User) {
13741 userId = userId.id;
13742 } else if (userId instanceof AV.Role) {
13743 userId = 'role:' + userId.getName();
13744 }
13745
13746 var permissions = this.permissionsById[userId];
13747
13748 if (!permissions) {
13749 return false;
13750 }
13751
13752 return permissions[accessType] ? true : false;
13753 };
13754 /**
13755 * Set whether the given user is allowed to read this object.
13756 * @param userId An instance of AV.User or its objectId.
13757 * @param {Boolean} allowed Whether that user should have read access.
13758 */
13759
13760
13761 AV.ACL.prototype.setReadAccess = function (userId, allowed) {
13762 this._setAccess('read', userId, allowed);
13763 };
13764 /**
13765 * Get whether the given user id is *explicitly* allowed to read this object.
13766 * Even if this returns false, the user may still be able to access it if
13767 * getPublicReadAccess returns true or a role that the user belongs to has
13768 * write access.
13769 * @param userId An instance of AV.User or its objectId, or a AV.Role.
13770 * @return {Boolean}
13771 */
13772
13773
13774 AV.ACL.prototype.getReadAccess = function (userId) {
13775 return this._getAccess('read', userId);
13776 };
13777 /**
13778 * Set whether the given user id is allowed to write this object.
13779 * @param userId An instance of AV.User or its objectId, or a AV.Role..
13780 * @param {Boolean} allowed Whether that user should have write access.
13781 */
13782
13783
13784 AV.ACL.prototype.setWriteAccess = function (userId, allowed) {
13785 this._setAccess('write', userId, allowed);
13786 };
13787 /**
13788 * Get whether the given user id is *explicitly* allowed to write this object.
13789 * Even if this returns false, the user may still be able to write it if
13790 * getPublicWriteAccess returns true or a role that the user belongs to has
13791 * write access.
13792 * @param userId An instance of AV.User or its objectId, or a AV.Role.
13793 * @return {Boolean}
13794 */
13795
13796
13797 AV.ACL.prototype.getWriteAccess = function (userId) {
13798 return this._getAccess('write', userId);
13799 };
13800 /**
13801 * Set whether the public is allowed to read this object.
13802 * @param {Boolean} allowed
13803 */
13804
13805
13806 AV.ACL.prototype.setPublicReadAccess = function (allowed) {
13807 this.setReadAccess(PUBLIC_KEY, allowed);
13808 };
13809 /**
13810 * Get whether the public is allowed to read this object.
13811 * @return {Boolean}
13812 */
13813
13814
13815 AV.ACL.prototype.getPublicReadAccess = function () {
13816 return this.getReadAccess(PUBLIC_KEY);
13817 };
13818 /**
13819 * Set whether the public is allowed to write this object.
13820 * @param {Boolean} allowed
13821 */
13822
13823
13824 AV.ACL.prototype.setPublicWriteAccess = function (allowed) {
13825 this.setWriteAccess(PUBLIC_KEY, allowed);
13826 };
13827 /**
13828 * Get whether the public is allowed to write this object.
13829 * @return {Boolean}
13830 */
13831
13832
13833 AV.ACL.prototype.getPublicWriteAccess = function () {
13834 return this.getWriteAccess(PUBLIC_KEY);
13835 };
13836 /**
13837 * Get whether users belonging to the given role are allowed
13838 * to read this object. Even if this returns false, the role may
13839 * still be able to write it if a parent role has read access.
13840 *
13841 * @param role The name of the role, or a AV.Role object.
13842 * @return {Boolean} true if the role has read access. false otherwise.
13843 * @throws {String} If role is neither a AV.Role nor a String.
13844 */
13845
13846
13847 AV.ACL.prototype.getRoleReadAccess = function (role) {
13848 if (role instanceof AV.Role) {
13849 // Normalize to the String name
13850 role = role.getName();
13851 }
13852
13853 if (_.isString(role)) {
13854 return this.getReadAccess('role:' + role);
13855 }
13856
13857 throw new Error('role must be a AV.Role or a String');
13858 };
13859 /**
13860 * Get whether users belonging to the given role are allowed
13861 * to write this object. Even if this returns false, the role may
13862 * still be able to write it if a parent role has write access.
13863 *
13864 * @param role The name of the role, or a AV.Role object.
13865 * @return {Boolean} true if the role has write access. false otherwise.
13866 * @throws {String} If role is neither a AV.Role nor a String.
13867 */
13868
13869
13870 AV.ACL.prototype.getRoleWriteAccess = function (role) {
13871 if (role instanceof AV.Role) {
13872 // Normalize to the String name
13873 role = role.getName();
13874 }
13875
13876 if (_.isString(role)) {
13877 return this.getWriteAccess('role:' + role);
13878 }
13879
13880 throw new Error('role must be a AV.Role or a String');
13881 };
13882 /**
13883 * Set whether users belonging to the given role are allowed
13884 * to read this object.
13885 *
13886 * @param role The name of the role, or a AV.Role object.
13887 * @param {Boolean} allowed Whether the given role can read this object.
13888 * @throws {String} If role is neither a AV.Role nor a String.
13889 */
13890
13891
13892 AV.ACL.prototype.setRoleReadAccess = function (role, allowed) {
13893 if (role instanceof AV.Role) {
13894 // Normalize to the String name
13895 role = role.getName();
13896 }
13897
13898 if (_.isString(role)) {
13899 this.setReadAccess('role:' + role, allowed);
13900 return;
13901 }
13902
13903 throw new Error('role must be a AV.Role or a String');
13904 };
13905 /**
13906 * Set whether users belonging to the given role are allowed
13907 * to write this object.
13908 *
13909 * @param role The name of the role, or a AV.Role object.
13910 * @param {Boolean} allowed Whether the given role can write this object.
13911 * @throws {String} If role is neither a AV.Role nor a String.
13912 */
13913
13914
13915 AV.ACL.prototype.setRoleWriteAccess = function (role, allowed) {
13916 if (role instanceof AV.Role) {
13917 // Normalize to the String name
13918 role = role.getName();
13919 }
13920
13921 if (_.isString(role)) {
13922 this.setWriteAccess('role:' + role, allowed);
13923 return;
13924 }
13925
13926 throw new Error('role must be a AV.Role or a String');
13927 };
13928};
13929
13930/***/ }),
13931/* 445 */
13932/***/ (function(module, exports, __webpack_require__) {
13933
13934"use strict";
13935
13936
13937var _interopRequireDefault = __webpack_require__(1);
13938
13939var _concat = _interopRequireDefault(__webpack_require__(25));
13940
13941var _find = _interopRequireDefault(__webpack_require__(107));
13942
13943var _indexOf = _interopRequireDefault(__webpack_require__(68));
13944
13945var _map = _interopRequireDefault(__webpack_require__(42));
13946
13947var _ = __webpack_require__(2);
13948
13949module.exports = function (AV) {
13950 /**
13951 * @private
13952 * @class
13953 * A AV.Op is an atomic operation that can be applied to a field in a
13954 * AV.Object. For example, calling <code>object.set("foo", "bar")</code>
13955 * is an example of a AV.Op.Set. Calling <code>object.unset("foo")</code>
13956 * is a AV.Op.Unset. These operations are stored in a AV.Object and
13957 * sent to the server as part of <code>object.save()</code> operations.
13958 * Instances of AV.Op should be immutable.
13959 *
13960 * You should not create subclasses of AV.Op or instantiate AV.Op
13961 * directly.
13962 */
13963 AV.Op = function () {
13964 this._initialize.apply(this, arguments);
13965 };
13966
13967 _.extend(AV.Op.prototype,
13968 /** @lends AV.Op.prototype */
13969 {
13970 _initialize: function _initialize() {}
13971 });
13972
13973 _.extend(AV.Op, {
13974 /**
13975 * To create a new Op, call AV.Op._extend();
13976 * @private
13977 */
13978 _extend: AV._extend,
13979 // A map of __op string to decoder function.
13980 _opDecoderMap: {},
13981
13982 /**
13983 * Registers a function to convert a json object with an __op field into an
13984 * instance of a subclass of AV.Op.
13985 * @private
13986 */
13987 _registerDecoder: function _registerDecoder(opName, decoder) {
13988 AV.Op._opDecoderMap[opName] = decoder;
13989 },
13990
13991 /**
13992 * Converts a json object into an instance of a subclass of AV.Op.
13993 * @private
13994 */
13995 _decode: function _decode(json) {
13996 var decoder = AV.Op._opDecoderMap[json.__op];
13997
13998 if (decoder) {
13999 return decoder(json);
14000 } else {
14001 return undefined;
14002 }
14003 }
14004 });
14005 /*
14006 * Add a handler for Batch ops.
14007 */
14008
14009
14010 AV.Op._registerDecoder('Batch', function (json) {
14011 var op = null;
14012
14013 AV._arrayEach(json.ops, function (nextOp) {
14014 nextOp = AV.Op._decode(nextOp);
14015 op = nextOp._mergeWithPrevious(op);
14016 });
14017
14018 return op;
14019 });
14020 /**
14021 * @private
14022 * @class
14023 * A Set operation indicates that either the field was changed using
14024 * AV.Object.set, or it is a mutable container that was detected as being
14025 * changed.
14026 */
14027
14028
14029 AV.Op.Set = AV.Op._extend(
14030 /** @lends AV.Op.Set.prototype */
14031 {
14032 _initialize: function _initialize(value) {
14033 this._value = value;
14034 },
14035
14036 /**
14037 * Returns the new value of this field after the set.
14038 */
14039 value: function value() {
14040 return this._value;
14041 },
14042
14043 /**
14044 * Returns a JSON version of the operation suitable for sending to AV.
14045 * @return {Object}
14046 */
14047 toJSON: function toJSON() {
14048 return AV._encode(this.value());
14049 },
14050 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14051 return this;
14052 },
14053 _estimate: function _estimate(oldValue) {
14054 return this.value();
14055 }
14056 });
14057 /**
14058 * A sentinel value that is returned by AV.Op.Unset._estimate to
14059 * indicate the field should be deleted. Basically, if you find _UNSET as a
14060 * value in your object, you should remove that key.
14061 */
14062
14063 AV.Op._UNSET = {};
14064 /**
14065 * @private
14066 * @class
14067 * An Unset operation indicates that this field has been deleted from the
14068 * object.
14069 */
14070
14071 AV.Op.Unset = AV.Op._extend(
14072 /** @lends AV.Op.Unset.prototype */
14073 {
14074 /**
14075 * Returns a JSON version of the operation suitable for sending to AV.
14076 * @return {Object}
14077 */
14078 toJSON: function toJSON() {
14079 return {
14080 __op: 'Delete'
14081 };
14082 },
14083 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14084 return this;
14085 },
14086 _estimate: function _estimate(oldValue) {
14087 return AV.Op._UNSET;
14088 }
14089 });
14090
14091 AV.Op._registerDecoder('Delete', function (json) {
14092 return new AV.Op.Unset();
14093 });
14094 /**
14095 * @private
14096 * @class
14097 * An Increment is an atomic operation where the numeric value for the field
14098 * will be increased by a given amount.
14099 */
14100
14101
14102 AV.Op.Increment = AV.Op._extend(
14103 /** @lends AV.Op.Increment.prototype */
14104 {
14105 _initialize: function _initialize(amount) {
14106 this._amount = amount;
14107 },
14108
14109 /**
14110 * Returns the amount to increment by.
14111 * @return {Number} the amount to increment by.
14112 */
14113 amount: function amount() {
14114 return this._amount;
14115 },
14116
14117 /**
14118 * Returns a JSON version of the operation suitable for sending to AV.
14119 * @return {Object}
14120 */
14121 toJSON: function toJSON() {
14122 return {
14123 __op: 'Increment',
14124 amount: this._amount
14125 };
14126 },
14127 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14128 if (!previous) {
14129 return this;
14130 } else if (previous instanceof AV.Op.Unset) {
14131 return new AV.Op.Set(this.amount());
14132 } else if (previous instanceof AV.Op.Set) {
14133 return new AV.Op.Set(previous.value() + this.amount());
14134 } else if (previous instanceof AV.Op.Increment) {
14135 return new AV.Op.Increment(this.amount() + previous.amount());
14136 } else {
14137 throw new Error('Op is invalid after previous op.');
14138 }
14139 },
14140 _estimate: function _estimate(oldValue) {
14141 if (!oldValue) {
14142 return this.amount();
14143 }
14144
14145 return oldValue + this.amount();
14146 }
14147 });
14148
14149 AV.Op._registerDecoder('Increment', function (json) {
14150 return new AV.Op.Increment(json.amount);
14151 });
14152 /**
14153 * @private
14154 * @class
14155 * BitAnd is an atomic operation where the given value will be bit and to the
14156 * value than is stored in this field.
14157 */
14158
14159
14160 AV.Op.BitAnd = AV.Op._extend(
14161 /** @lends AV.Op.BitAnd.prototype */
14162 {
14163 _initialize: function _initialize(value) {
14164 this._value = value;
14165 },
14166 value: function value() {
14167 return this._value;
14168 },
14169
14170 /**
14171 * Returns a JSON version of the operation suitable for sending to AV.
14172 * @return {Object}
14173 */
14174 toJSON: function toJSON() {
14175 return {
14176 __op: 'BitAnd',
14177 value: this.value()
14178 };
14179 },
14180 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14181 if (!previous) {
14182 return this;
14183 } else if (previous instanceof AV.Op.Unset) {
14184 return new AV.Op.Set(0);
14185 } else if (previous instanceof AV.Op.Set) {
14186 return new AV.Op.Set(previous.value() & this.value());
14187 } else {
14188 throw new Error('Op is invalid after previous op.');
14189 }
14190 },
14191 _estimate: function _estimate(oldValue) {
14192 return oldValue & this.value();
14193 }
14194 });
14195
14196 AV.Op._registerDecoder('BitAnd', function (json) {
14197 return new AV.Op.BitAnd(json.value);
14198 });
14199 /**
14200 * @private
14201 * @class
14202 * BitOr is an atomic operation where the given value will be bit and to the
14203 * value than is stored in this field.
14204 */
14205
14206
14207 AV.Op.BitOr = AV.Op._extend(
14208 /** @lends AV.Op.BitOr.prototype */
14209 {
14210 _initialize: function _initialize(value) {
14211 this._value = value;
14212 },
14213 value: function value() {
14214 return this._value;
14215 },
14216
14217 /**
14218 * Returns a JSON version of the operation suitable for sending to AV.
14219 * @return {Object}
14220 */
14221 toJSON: function toJSON() {
14222 return {
14223 __op: 'BitOr',
14224 value: this.value()
14225 };
14226 },
14227 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14228 if (!previous) {
14229 return this;
14230 } else if (previous instanceof AV.Op.Unset) {
14231 return new AV.Op.Set(this.value());
14232 } else if (previous instanceof AV.Op.Set) {
14233 return new AV.Op.Set(previous.value() | this.value());
14234 } else {
14235 throw new Error('Op is invalid after previous op.');
14236 }
14237 },
14238 _estimate: function _estimate(oldValue) {
14239 return oldValue | this.value();
14240 }
14241 });
14242
14243 AV.Op._registerDecoder('BitOr', function (json) {
14244 return new AV.Op.BitOr(json.value);
14245 });
14246 /**
14247 * @private
14248 * @class
14249 * BitXor is an atomic operation where the given value will be bit and to the
14250 * value than is stored in this field.
14251 */
14252
14253
14254 AV.Op.BitXor = AV.Op._extend(
14255 /** @lends AV.Op.BitXor.prototype */
14256 {
14257 _initialize: function _initialize(value) {
14258 this._value = value;
14259 },
14260 value: function value() {
14261 return this._value;
14262 },
14263
14264 /**
14265 * Returns a JSON version of the operation suitable for sending to AV.
14266 * @return {Object}
14267 */
14268 toJSON: function toJSON() {
14269 return {
14270 __op: 'BitXor',
14271 value: this.value()
14272 };
14273 },
14274 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14275 if (!previous) {
14276 return this;
14277 } else if (previous instanceof AV.Op.Unset) {
14278 return new AV.Op.Set(this.value());
14279 } else if (previous instanceof AV.Op.Set) {
14280 return new AV.Op.Set(previous.value() ^ this.value());
14281 } else {
14282 throw new Error('Op is invalid after previous op.');
14283 }
14284 },
14285 _estimate: function _estimate(oldValue) {
14286 return oldValue ^ this.value();
14287 }
14288 });
14289
14290 AV.Op._registerDecoder('BitXor', function (json) {
14291 return new AV.Op.BitXor(json.value);
14292 });
14293 /**
14294 * @private
14295 * @class
14296 * Add is an atomic operation where the given objects will be appended to the
14297 * array that is stored in this field.
14298 */
14299
14300
14301 AV.Op.Add = AV.Op._extend(
14302 /** @lends AV.Op.Add.prototype */
14303 {
14304 _initialize: function _initialize(objects) {
14305 this._objects = objects;
14306 },
14307
14308 /**
14309 * Returns the objects to be added to the array.
14310 * @return {Array} The objects to be added to the array.
14311 */
14312 objects: function objects() {
14313 return this._objects;
14314 },
14315
14316 /**
14317 * Returns a JSON version of the operation suitable for sending to AV.
14318 * @return {Object}
14319 */
14320 toJSON: function toJSON() {
14321 return {
14322 __op: 'Add',
14323 objects: AV._encode(this.objects())
14324 };
14325 },
14326 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14327 if (!previous) {
14328 return this;
14329 } else if (previous instanceof AV.Op.Unset) {
14330 return new AV.Op.Set(this.objects());
14331 } else if (previous instanceof AV.Op.Set) {
14332 return new AV.Op.Set(this._estimate(previous.value()));
14333 } else if (previous instanceof AV.Op.Add) {
14334 var _context;
14335
14336 return new AV.Op.Add((0, _concat.default)(_context = previous.objects()).call(_context, this.objects()));
14337 } else {
14338 throw new Error('Op is invalid after previous op.');
14339 }
14340 },
14341 _estimate: function _estimate(oldValue) {
14342 if (!oldValue) {
14343 return _.clone(this.objects());
14344 } else {
14345 return (0, _concat.default)(oldValue).call(oldValue, this.objects());
14346 }
14347 }
14348 });
14349
14350 AV.Op._registerDecoder('Add', function (json) {
14351 return new AV.Op.Add(AV._decode(json.objects));
14352 });
14353 /**
14354 * @private
14355 * @class
14356 * AddUnique is an atomic operation where the given items will be appended to
14357 * the array that is stored in this field only if they were not already
14358 * present in the array.
14359 */
14360
14361
14362 AV.Op.AddUnique = AV.Op._extend(
14363 /** @lends AV.Op.AddUnique.prototype */
14364 {
14365 _initialize: function _initialize(objects) {
14366 this._objects = _.uniq(objects);
14367 },
14368
14369 /**
14370 * Returns the objects to be added to the array.
14371 * @return {Array} The objects to be added to the array.
14372 */
14373 objects: function objects() {
14374 return this._objects;
14375 },
14376
14377 /**
14378 * Returns a JSON version of the operation suitable for sending to AV.
14379 * @return {Object}
14380 */
14381 toJSON: function toJSON() {
14382 return {
14383 __op: 'AddUnique',
14384 objects: AV._encode(this.objects())
14385 };
14386 },
14387 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14388 if (!previous) {
14389 return this;
14390 } else if (previous instanceof AV.Op.Unset) {
14391 return new AV.Op.Set(this.objects());
14392 } else if (previous instanceof AV.Op.Set) {
14393 return new AV.Op.Set(this._estimate(previous.value()));
14394 } else if (previous instanceof AV.Op.AddUnique) {
14395 return new AV.Op.AddUnique(this._estimate(previous.objects()));
14396 } else {
14397 throw new Error('Op is invalid after previous op.');
14398 }
14399 },
14400 _estimate: function _estimate(oldValue) {
14401 if (!oldValue) {
14402 return _.clone(this.objects());
14403 } else {
14404 // We can't just take the _.uniq(_.union(...)) of oldValue and
14405 // this.objects, because the uniqueness may not apply to oldValue
14406 // (especially if the oldValue was set via .set())
14407 var newValue = _.clone(oldValue);
14408
14409 AV._arrayEach(this.objects(), function (obj) {
14410 if (obj instanceof AV.Object && obj.id) {
14411 var matchingObj = (0, _find.default)(_).call(_, newValue, function (anObj) {
14412 return anObj instanceof AV.Object && anObj.id === obj.id;
14413 });
14414
14415 if (!matchingObj) {
14416 newValue.push(obj);
14417 } else {
14418 var index = (0, _indexOf.default)(_).call(_, newValue, matchingObj);
14419 newValue[index] = obj;
14420 }
14421 } else if (!_.contains(newValue, obj)) {
14422 newValue.push(obj);
14423 }
14424 });
14425
14426 return newValue;
14427 }
14428 }
14429 });
14430
14431 AV.Op._registerDecoder('AddUnique', function (json) {
14432 return new AV.Op.AddUnique(AV._decode(json.objects));
14433 });
14434 /**
14435 * @private
14436 * @class
14437 * Remove is an atomic operation where the given objects will be removed from
14438 * the array that is stored in this field.
14439 */
14440
14441
14442 AV.Op.Remove = AV.Op._extend(
14443 /** @lends AV.Op.Remove.prototype */
14444 {
14445 _initialize: function _initialize(objects) {
14446 this._objects = _.uniq(objects);
14447 },
14448
14449 /**
14450 * Returns the objects to be removed from the array.
14451 * @return {Array} The objects to be removed from the array.
14452 */
14453 objects: function objects() {
14454 return this._objects;
14455 },
14456
14457 /**
14458 * Returns a JSON version of the operation suitable for sending to AV.
14459 * @return {Object}
14460 */
14461 toJSON: function toJSON() {
14462 return {
14463 __op: 'Remove',
14464 objects: AV._encode(this.objects())
14465 };
14466 },
14467 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14468 if (!previous) {
14469 return this;
14470 } else if (previous instanceof AV.Op.Unset) {
14471 return previous;
14472 } else if (previous instanceof AV.Op.Set) {
14473 return new AV.Op.Set(this._estimate(previous.value()));
14474 } else if (previous instanceof AV.Op.Remove) {
14475 return new AV.Op.Remove(_.union(previous.objects(), this.objects()));
14476 } else {
14477 throw new Error('Op is invalid after previous op.');
14478 }
14479 },
14480 _estimate: function _estimate(oldValue) {
14481 if (!oldValue) {
14482 return [];
14483 } else {
14484 var newValue = _.difference(oldValue, this.objects()); // If there are saved AV Objects being removed, also remove them.
14485
14486
14487 AV._arrayEach(this.objects(), function (obj) {
14488 if (obj instanceof AV.Object && obj.id) {
14489 newValue = _.reject(newValue, function (other) {
14490 return other instanceof AV.Object && other.id === obj.id;
14491 });
14492 }
14493 });
14494
14495 return newValue;
14496 }
14497 }
14498 });
14499
14500 AV.Op._registerDecoder('Remove', function (json) {
14501 return new AV.Op.Remove(AV._decode(json.objects));
14502 });
14503 /**
14504 * @private
14505 * @class
14506 * A Relation operation indicates that the field is an instance of
14507 * AV.Relation, and objects are being added to, or removed from, that
14508 * relation.
14509 */
14510
14511
14512 AV.Op.Relation = AV.Op._extend(
14513 /** @lends AV.Op.Relation.prototype */
14514 {
14515 _initialize: function _initialize(adds, removes) {
14516 this._targetClassName = null;
14517 var self = this;
14518
14519 var pointerToId = function pointerToId(object) {
14520 if (object instanceof AV.Object) {
14521 if (!object.id) {
14522 throw new Error("You can't add an unsaved AV.Object to a relation.");
14523 }
14524
14525 if (!self._targetClassName) {
14526 self._targetClassName = object.className;
14527 }
14528
14529 if (self._targetClassName !== object.className) {
14530 throw new Error('Tried to create a AV.Relation with 2 different types: ' + self._targetClassName + ' and ' + object.className + '.');
14531 }
14532
14533 return object.id;
14534 }
14535
14536 return object;
14537 };
14538
14539 this.relationsToAdd = _.uniq((0, _map.default)(_).call(_, adds, pointerToId));
14540 this.relationsToRemove = _.uniq((0, _map.default)(_).call(_, removes, pointerToId));
14541 },
14542
14543 /**
14544 * Returns an array of unfetched AV.Object that are being added to the
14545 * relation.
14546 * @return {Array}
14547 */
14548 added: function added() {
14549 var self = this;
14550 return (0, _map.default)(_).call(_, this.relationsToAdd, function (objectId) {
14551 var object = AV.Object._create(self._targetClassName);
14552
14553 object.id = objectId;
14554 return object;
14555 });
14556 },
14557
14558 /**
14559 * Returns an array of unfetched AV.Object that are being removed from
14560 * the relation.
14561 * @return {Array}
14562 */
14563 removed: function removed() {
14564 var self = this;
14565 return (0, _map.default)(_).call(_, this.relationsToRemove, function (objectId) {
14566 var object = AV.Object._create(self._targetClassName);
14567
14568 object.id = objectId;
14569 return object;
14570 });
14571 },
14572
14573 /**
14574 * Returns a JSON version of the operation suitable for sending to AV.
14575 * @return {Object}
14576 */
14577 toJSON: function toJSON() {
14578 var adds = null;
14579 var removes = null;
14580 var self = this;
14581
14582 var idToPointer = function idToPointer(id) {
14583 return {
14584 __type: 'Pointer',
14585 className: self._targetClassName,
14586 objectId: id
14587 };
14588 };
14589
14590 var pointers = null;
14591
14592 if (this.relationsToAdd.length > 0) {
14593 pointers = (0, _map.default)(_).call(_, this.relationsToAdd, idToPointer);
14594 adds = {
14595 __op: 'AddRelation',
14596 objects: pointers
14597 };
14598 }
14599
14600 if (this.relationsToRemove.length > 0) {
14601 pointers = (0, _map.default)(_).call(_, this.relationsToRemove, idToPointer);
14602 removes = {
14603 __op: 'RemoveRelation',
14604 objects: pointers
14605 };
14606 }
14607
14608 if (adds && removes) {
14609 return {
14610 __op: 'Batch',
14611 ops: [adds, removes]
14612 };
14613 }
14614
14615 return adds || removes || {};
14616 },
14617 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14618 if (!previous) {
14619 return this;
14620 } else if (previous instanceof AV.Op.Unset) {
14621 throw new Error("You can't modify a relation after deleting it.");
14622 } else if (previous instanceof AV.Op.Relation) {
14623 if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
14624 throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + this._targetClassName + ' was passed in.');
14625 }
14626
14627 var newAdd = _.union(_.difference(previous.relationsToAdd, this.relationsToRemove), this.relationsToAdd);
14628
14629 var newRemove = _.union(_.difference(previous.relationsToRemove, this.relationsToAdd), this.relationsToRemove);
14630
14631 var newRelation = new AV.Op.Relation(newAdd, newRemove);
14632 newRelation._targetClassName = this._targetClassName;
14633 return newRelation;
14634 } else {
14635 throw new Error('Op is invalid after previous op.');
14636 }
14637 },
14638 _estimate: function _estimate(oldValue, object, key) {
14639 if (!oldValue) {
14640 var relation = new AV.Relation(object, key);
14641 relation.targetClassName = this._targetClassName;
14642 } else if (oldValue instanceof AV.Relation) {
14643 if (this._targetClassName) {
14644 if (oldValue.targetClassName) {
14645 if (oldValue.targetClassName !== this._targetClassName) {
14646 throw new Error('Related object must be a ' + oldValue.targetClassName + ', but a ' + this._targetClassName + ' was passed in.');
14647 }
14648 } else {
14649 oldValue.targetClassName = this._targetClassName;
14650 }
14651 }
14652
14653 return oldValue;
14654 } else {
14655 throw new Error('Op is invalid after previous op.');
14656 }
14657 }
14658 });
14659
14660 AV.Op._registerDecoder('AddRelation', function (json) {
14661 return new AV.Op.Relation(AV._decode(json.objects), []);
14662 });
14663
14664 AV.Op._registerDecoder('RemoveRelation', function (json) {
14665 return new AV.Op.Relation([], AV._decode(json.objects));
14666 });
14667};
14668
14669/***/ }),
14670/* 446 */
14671/***/ (function(module, exports, __webpack_require__) {
14672
14673var parent = __webpack_require__(447);
14674
14675module.exports = parent;
14676
14677
14678/***/ }),
14679/* 447 */
14680/***/ (function(module, exports, __webpack_require__) {
14681
14682var isPrototypeOf = __webpack_require__(12);
14683var method = __webpack_require__(448);
14684
14685var ArrayPrototype = Array.prototype;
14686
14687module.exports = function (it) {
14688 var own = it.find;
14689 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;
14690};
14691
14692
14693/***/ }),
14694/* 448 */
14695/***/ (function(module, exports, __webpack_require__) {
14696
14697__webpack_require__(449);
14698var entryVirtual = __webpack_require__(26);
14699
14700module.exports = entryVirtual('Array').find;
14701
14702
14703/***/ }),
14704/* 449 */
14705/***/ (function(module, exports, __webpack_require__) {
14706
14707"use strict";
14708
14709var $ = __webpack_require__(0);
14710var $find = __webpack_require__(105).find;
14711var addToUnscopables = __webpack_require__(122);
14712
14713var FIND = 'find';
14714var SKIPS_HOLES = true;
14715
14716// Shouldn't skip holes
14717if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
14718
14719// `Array.prototype.find` method
14720// https://tc39.es/ecma262/#sec-array.prototype.find
14721$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
14722 find: function find(callbackfn /* , that = undefined */) {
14723 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
14724 }
14725});
14726
14727// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
14728addToUnscopables(FIND);
14729
14730
14731/***/ }),
14732/* 450 */
14733/***/ (function(module, exports, __webpack_require__) {
14734
14735"use strict";
14736
14737
14738var _ = __webpack_require__(2);
14739
14740module.exports = function (AV) {
14741 /**
14742 * Creates a new Relation for the given parent object and key. This
14743 * constructor should rarely be used directly, but rather created by
14744 * {@link AV.Object#relation}.
14745 * @param {AV.Object} parent The parent of this relation.
14746 * @param {String} key The key for this relation on the parent.
14747 * @see AV.Object#relation
14748 * @class
14749 *
14750 * <p>
14751 * A class that is used to access all of the children of a many-to-many
14752 * relationship. Each instance of AV.Relation is associated with a
14753 * particular parent object and key.
14754 * </p>
14755 */
14756 AV.Relation = function (parent, key) {
14757 if (!_.isString(key)) {
14758 throw new TypeError('key must be a string');
14759 }
14760
14761 this.parent = parent;
14762 this.key = key;
14763 this.targetClassName = null;
14764 };
14765 /**
14766 * Creates a query that can be used to query the parent objects in this relation.
14767 * @param {String} parentClass The parent class or name.
14768 * @param {String} relationKey The relation field key in parent.
14769 * @param {AV.Object} child The child object.
14770 * @return {AV.Query}
14771 */
14772
14773
14774 AV.Relation.reverseQuery = function (parentClass, relationKey, child) {
14775 var query = new AV.Query(parentClass);
14776 query.equalTo(relationKey, child._toPointer());
14777 return query;
14778 };
14779
14780 _.extend(AV.Relation.prototype,
14781 /** @lends AV.Relation.prototype */
14782 {
14783 /**
14784 * Makes sure that this relation has the right parent and key.
14785 * @private
14786 */
14787 _ensureParentAndKey: function _ensureParentAndKey(parent, key) {
14788 this.parent = this.parent || parent;
14789 this.key = this.key || key;
14790
14791 if (this.parent !== parent) {
14792 throw new Error('Internal Error. Relation retrieved from two different Objects.');
14793 }
14794
14795 if (this.key !== key) {
14796 throw new Error('Internal Error. Relation retrieved from two different keys.');
14797 }
14798 },
14799
14800 /**
14801 * Adds a AV.Object or an array of AV.Objects to the relation.
14802 * @param {AV.Object|AV.Object[]} objects The item or items to add.
14803 */
14804 add: function add(objects) {
14805 if (!_.isArray(objects)) {
14806 objects = [objects];
14807 }
14808
14809 var change = new AV.Op.Relation(objects, []);
14810 this.parent.set(this.key, change);
14811 this.targetClassName = change._targetClassName;
14812 },
14813
14814 /**
14815 * Removes a AV.Object or an array of AV.Objects from this relation.
14816 * @param {AV.Object|AV.Object[]} objects The item or items to remove.
14817 */
14818 remove: function remove(objects) {
14819 if (!_.isArray(objects)) {
14820 objects = [objects];
14821 }
14822
14823 var change = new AV.Op.Relation([], objects);
14824 this.parent.set(this.key, change);
14825 this.targetClassName = change._targetClassName;
14826 },
14827
14828 /**
14829 * Returns a JSON version of the object suitable for saving to disk.
14830 * @return {Object}
14831 */
14832 toJSON: function toJSON() {
14833 return {
14834 __type: 'Relation',
14835 className: this.targetClassName
14836 };
14837 },
14838
14839 /**
14840 * Returns a AV.Query that is limited to objects in this
14841 * relation.
14842 * @return {AV.Query}
14843 */
14844 query: function query() {
14845 var targetClass;
14846 var query;
14847
14848 if (!this.targetClassName) {
14849 targetClass = AV.Object._getSubclass(this.parent.className);
14850 query = new AV.Query(targetClass);
14851 query._defaultParams.redirectClassNameForKey = this.key;
14852 } else {
14853 targetClass = AV.Object._getSubclass(this.targetClassName);
14854 query = new AV.Query(targetClass);
14855 }
14856
14857 query._addCondition('$relatedTo', 'object', this.parent._toPointer());
14858
14859 query._addCondition('$relatedTo', 'key', this.key);
14860
14861 return query;
14862 }
14863 });
14864};
14865
14866/***/ }),
14867/* 451 */
14868/***/ (function(module, exports, __webpack_require__) {
14869
14870"use strict";
14871
14872
14873var _interopRequireDefault = __webpack_require__(1);
14874
14875var _promise = _interopRequireDefault(__webpack_require__(10));
14876
14877var _ = __webpack_require__(2);
14878
14879var cos = __webpack_require__(452);
14880
14881var qiniu = __webpack_require__(453);
14882
14883var s3 = __webpack_require__(499);
14884
14885var AVError = __webpack_require__(43);
14886
14887var _require = __webpack_require__(27),
14888 request = _require.request,
14889 AVRequest = _require._request;
14890
14891var _require2 = __webpack_require__(31),
14892 tap = _require2.tap,
14893 transformFetchOptions = _require2.transformFetchOptions;
14894
14895var debug = __webpack_require__(69)('leancloud:file');
14896
14897var parseBase64 = __webpack_require__(503);
14898
14899module.exports = function (AV) {
14900 // port from browserify path module
14901 // since react-native packager won't shim node modules.
14902 var extname = function extname(path) {
14903 if (!_.isString(path)) return '';
14904 return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
14905 };
14906
14907 var b64Digit = function b64Digit(number) {
14908 if (number < 26) {
14909 return String.fromCharCode(65 + number);
14910 }
14911
14912 if (number < 52) {
14913 return String.fromCharCode(97 + (number - 26));
14914 }
14915
14916 if (number < 62) {
14917 return String.fromCharCode(48 + (number - 52));
14918 }
14919
14920 if (number === 62) {
14921 return '+';
14922 }
14923
14924 if (number === 63) {
14925 return '/';
14926 }
14927
14928 throw new Error('Tried to encode large digit ' + number + ' in base64.');
14929 };
14930
14931 var encodeBase64 = function encodeBase64(array) {
14932 var chunks = [];
14933 chunks.length = Math.ceil(array.length / 3);
14934
14935 _.times(chunks.length, function (i) {
14936 var b1 = array[i * 3];
14937 var b2 = array[i * 3 + 1] || 0;
14938 var b3 = array[i * 3 + 2] || 0;
14939 var has2 = i * 3 + 1 < array.length;
14940 var has3 = i * 3 + 2 < array.length;
14941 chunks[i] = [b64Digit(b1 >> 2 & 0x3f), b64Digit(b1 << 4 & 0x30 | b2 >> 4 & 0x0f), has2 ? b64Digit(b2 << 2 & 0x3c | b3 >> 6 & 0x03) : '=', has3 ? b64Digit(b3 & 0x3f) : '='].join('');
14942 });
14943
14944 return chunks.join('');
14945 };
14946 /**
14947 * An AV.File is a local representation of a file that is saved to the AV
14948 * cloud.
14949 * @param name {String} The file's name. This will change to a unique value
14950 * once the file has finished saving.
14951 * @param data {Array} The data for the file, as either:
14952 * 1. an Array of byte value Numbers, or
14953 * 2. an Object like { base64: "..." } with a base64-encoded String.
14954 * 3. a Blob(File) selected with a file upload control in a browser.
14955 * 4. an Object like { blob: {uri: "..."} } that mimics Blob
14956 * in some non-browser environments such as React Native.
14957 * 5. a Buffer in Node.js runtime.
14958 * 6. a Stream in Node.js runtime.
14959 *
14960 * For example:<pre>
14961 * var fileUploadControl = $("#profilePhotoFileUpload")[0];
14962 * if (fileUploadControl.files.length > 0) {
14963 * var file = fileUploadControl.files[0];
14964 * var name = "photo.jpg";
14965 * var file = new AV.File(name, file);
14966 * file.save().then(function() {
14967 * // The file has been saved to AV.
14968 * }, function(error) {
14969 * // The file either could not be read, or could not be saved to AV.
14970 * });
14971 * }</pre>
14972 *
14973 * @class
14974 * @param [mimeType] {String} Content-Type header to use for the file. If
14975 * this is omitted, the content type will be inferred from the name's
14976 * extension.
14977 */
14978
14979
14980 AV.File = function (name, data, mimeType) {
14981 this.attributes = {
14982 name: name,
14983 url: '',
14984 metaData: {},
14985 // 用来存储转换后要上传的 base64 String
14986 base64: ''
14987 };
14988
14989 if (_.isString(data)) {
14990 throw new TypeError('Creating an AV.File from a String is not yet supported.');
14991 }
14992
14993 if (_.isArray(data)) {
14994 this.attributes.metaData.size = data.length;
14995 data = {
14996 base64: encodeBase64(data)
14997 };
14998 }
14999
15000 this._extName = '';
15001 this._data = data;
15002 this._uploadHeaders = {};
15003
15004 if (data && data.blob && typeof data.blob.uri === 'string') {
15005 this._extName = extname(data.blob.uri);
15006 }
15007
15008 if (typeof Blob !== 'undefined' && data instanceof Blob) {
15009 if (data.size) {
15010 this.attributes.metaData.size = data.size;
15011 }
15012
15013 if (data.name) {
15014 this._extName = extname(data.name);
15015 }
15016 }
15017
15018 var owner;
15019
15020 if (data && data.owner) {
15021 owner = data.owner;
15022 } else if (!AV._config.disableCurrentUser) {
15023 try {
15024 owner = AV.User.current();
15025 } catch (error) {
15026 if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
15027 throw error;
15028 }
15029 }
15030 }
15031
15032 this.attributes.metaData.owner = owner ? owner.id : 'unknown';
15033 this.set('mime_type', mimeType);
15034 };
15035 /**
15036 * Creates a fresh AV.File object with exists url for saving to AVOS Cloud.
15037 * @param {String} name the file name
15038 * @param {String} url the file url.
15039 * @param {Object} [metaData] the file metadata object.
15040 * @param {String} [type] Content-Type header to use for the file. If
15041 * this is omitted, the content type will be inferred from the name's
15042 * extension.
15043 * @return {AV.File} the file object
15044 */
15045
15046
15047 AV.File.withURL = function (name, url, metaData, type) {
15048 if (!name || !url) {
15049 throw new Error('Please provide file name and url');
15050 }
15051
15052 var file = new AV.File(name, null, type); //copy metaData properties to file.
15053
15054 if (metaData) {
15055 for (var prop in metaData) {
15056 if (!file.attributes.metaData[prop]) file.attributes.metaData[prop] = metaData[prop];
15057 }
15058 }
15059
15060 file.attributes.url = url; //Mark the file is from external source.
15061
15062 file.attributes.metaData.__source = 'external';
15063 file.attributes.metaData.size = 0;
15064 return file;
15065 };
15066 /**
15067 * Creates a file object with exists objectId.
15068 * @param {String} objectId The objectId string
15069 * @return {AV.File} the file object
15070 */
15071
15072
15073 AV.File.createWithoutData = function (objectId) {
15074 if (!objectId) {
15075 throw new TypeError('The objectId must be provided');
15076 }
15077
15078 var file = new AV.File();
15079 file.id = objectId;
15080 return file;
15081 };
15082 /**
15083 * Request file censor.
15084 * @since 4.13.0
15085 * @param {String} objectId
15086 * @return {Promise.<string>}
15087 */
15088
15089
15090 AV.File.censor = function (objectId) {
15091 if (!AV._config.masterKey) {
15092 throw new Error('Cannot censor a file without masterKey');
15093 }
15094
15095 return request({
15096 method: 'POST',
15097 path: "/files/".concat(objectId, "/censor"),
15098 authOptions: {
15099 useMasterKey: true
15100 }
15101 }).then(function (res) {
15102 return res.censorResult;
15103 });
15104 };
15105
15106 _.extend(AV.File.prototype,
15107 /** @lends AV.File.prototype */
15108 {
15109 className: '_File',
15110 _toFullJSON: function _toFullJSON(seenObjects) {
15111 var _this = this;
15112
15113 var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
15114
15115 var json = _.clone(this.attributes);
15116
15117 AV._objectEach(json, function (val, key) {
15118 json[key] = AV._encode(val, seenObjects, undefined, full);
15119 });
15120
15121 AV._objectEach(this._operations, function (val, key) {
15122 json[key] = val;
15123 });
15124
15125 if (_.has(this, 'id')) {
15126 json.objectId = this.id;
15127 }
15128
15129 ['createdAt', 'updatedAt'].forEach(function (key) {
15130 if (_.has(_this, key)) {
15131 var val = _this[key];
15132 json[key] = _.isDate(val) ? val.toJSON() : val;
15133 }
15134 });
15135
15136 if (full) {
15137 json.__type = 'File';
15138 }
15139
15140 return json;
15141 },
15142
15143 /**
15144 * Returns a JSON version of the file with meta data.
15145 * Inverse to {@link AV.parseJSON}
15146 * @since 3.0.0
15147 * @return {Object}
15148 */
15149 toFullJSON: function toFullJSON() {
15150 var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
15151 return this._toFullJSON(seenObjects);
15152 },
15153
15154 /**
15155 * Returns a JSON version of the object.
15156 * @return {Object}
15157 */
15158 toJSON: function toJSON(key, holder) {
15159 var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [this];
15160 return this._toFullJSON(seenObjects, false);
15161 },
15162
15163 /**
15164 * Gets a Pointer referencing this file.
15165 * @private
15166 */
15167 _toPointer: function _toPointer() {
15168 return {
15169 __type: 'Pointer',
15170 className: this.className,
15171 objectId: this.id
15172 };
15173 },
15174
15175 /**
15176 * Returns the ACL for this file.
15177 * @returns {AV.ACL} An instance of AV.ACL.
15178 */
15179 getACL: function getACL() {
15180 return this._acl;
15181 },
15182
15183 /**
15184 * Sets the ACL to be used for this file.
15185 * @param {AV.ACL} acl An instance of AV.ACL.
15186 */
15187 setACL: function setACL(acl) {
15188 if (!(acl instanceof AV.ACL)) {
15189 return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
15190 }
15191
15192 this._acl = acl;
15193 return this;
15194 },
15195
15196 /**
15197 * Gets the name of the file. Before save is called, this is the filename
15198 * given by the user. After save is called, that name gets prefixed with a
15199 * unique identifier.
15200 */
15201 name: function name() {
15202 return this.get('name');
15203 },
15204
15205 /**
15206 * Gets the url of the file. It is only available after you save the file or
15207 * after you get the file from a AV.Object.
15208 * @return {String}
15209 */
15210 url: function url() {
15211 return this.get('url');
15212 },
15213
15214 /**
15215 * Gets the attributs of the file object.
15216 * @param {String} The attribute name which want to get.
15217 * @returns {Any}
15218 */
15219 get: function get(attrName) {
15220 switch (attrName) {
15221 case 'objectId':
15222 return this.id;
15223
15224 case 'url':
15225 case 'name':
15226 case 'mime_type':
15227 case 'metaData':
15228 case 'createdAt':
15229 case 'updatedAt':
15230 return this.attributes[attrName];
15231
15232 default:
15233 return this.attributes.metaData[attrName];
15234 }
15235 },
15236
15237 /**
15238 * Set the metaData of the file object.
15239 * @param {Object} Object is an key value Object for setting metaData.
15240 * @param {String} attr is an optional metadata key.
15241 * @param {Object} value is an optional metadata value.
15242 * @returns {String|Number|Array|Object}
15243 */
15244 set: function set() {
15245 var _this2 = this;
15246
15247 var set = function set(attrName, value) {
15248 switch (attrName) {
15249 case 'name':
15250 case 'url':
15251 case 'mime_type':
15252 case 'base64':
15253 case 'metaData':
15254 _this2.attributes[attrName] = value;
15255 break;
15256
15257 default:
15258 // File 并非一个 AVObject,不能完全自定义其他属性,所以只能都放在 metaData 上面
15259 _this2.attributes.metaData[attrName] = value;
15260 break;
15261 }
15262 };
15263
15264 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15265 args[_key] = arguments[_key];
15266 }
15267
15268 switch (args.length) {
15269 case 1:
15270 // 传入一个 Object
15271 for (var k in args[0]) {
15272 set(k, args[0][k]);
15273 }
15274
15275 break;
15276
15277 case 2:
15278 set(args[0], args[1]);
15279 break;
15280 }
15281
15282 return this;
15283 },
15284
15285 /**
15286 * Set a header for the upload request.
15287 * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
15288 *
15289 * @param {String} key header key
15290 * @param {String} value header value
15291 * @return {AV.File} this
15292 */
15293 setUploadHeader: function setUploadHeader(key, value) {
15294 this._uploadHeaders[key] = value;
15295 return this;
15296 },
15297
15298 /**
15299 * <p>Returns the file's metadata JSON object if no arguments is given.Returns the
15300 * metadata value if a key is given.Set metadata value if key and value are both given.</p>
15301 * <p><pre>
15302 * var metadata = file.metaData(); //Get metadata JSON object.
15303 * var size = file.metaData('size'); // Get the size metadata value.
15304 * file.metaData('format', 'jpeg'); //set metadata attribute and value.
15305 *</pre></p>
15306 * @return {Object} The file's metadata JSON object.
15307 * @param {String} attr an optional metadata key.
15308 * @param {Object} value an optional metadata value.
15309 **/
15310 metaData: function metaData(attr, value) {
15311 if (attr && value) {
15312 this.attributes.metaData[attr] = value;
15313 return this;
15314 } else if (attr && !value) {
15315 return this.attributes.metaData[attr];
15316 } else {
15317 return this.attributes.metaData;
15318 }
15319 },
15320
15321 /**
15322 * 如果文件是图片,获取图片的缩略图URL。可以传入宽度、高度、质量、格式等参数。
15323 * @return {String} 缩略图URL
15324 * @param {Number} width 宽度,单位:像素
15325 * @param {Number} heigth 高度,单位:像素
15326 * @param {Number} quality 质量,1-100的数字,默认100
15327 * @param {Number} scaleToFit 是否将图片自适应大小。默认为true。
15328 * @param {String} fmt 格式,默认为png,也可以为jpeg,gif等格式。
15329 */
15330 thumbnailURL: function thumbnailURL(width, height) {
15331 var quality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
15332 var scaleToFit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
15333 var fmt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'png';
15334 var url = this.attributes.url;
15335
15336 if (!url) {
15337 throw new Error('Invalid url.');
15338 }
15339
15340 if (!width || !height || width <= 0 || height <= 0) {
15341 throw new Error('Invalid width or height value.');
15342 }
15343
15344 if (quality <= 0 || quality > 100) {
15345 throw new Error('Invalid quality value.');
15346 }
15347
15348 var mode = scaleToFit ? 2 : 1;
15349 return url + '?imageView/' + mode + '/w/' + width + '/h/' + height + '/q/' + quality + '/format/' + fmt;
15350 },
15351
15352 /**
15353 * Returns the file's size.
15354 * @return {Number} The file's size in bytes.
15355 **/
15356 size: function size() {
15357 return this.metaData().size;
15358 },
15359
15360 /**
15361 * Returns the file's owner.
15362 * @return {String} The file's owner id.
15363 */
15364 ownerId: function ownerId() {
15365 return this.metaData().owner;
15366 },
15367
15368 /**
15369 * Destroy the file.
15370 * @param {AuthOptions} options
15371 * @return {Promise} A promise that is fulfilled when the destroy
15372 * completes.
15373 */
15374 destroy: function destroy(options) {
15375 if (!this.id) {
15376 return _promise.default.reject(new Error('The file id does not eixst.'));
15377 }
15378
15379 var request = AVRequest('files', null, this.id, 'DELETE', null, options);
15380 return request;
15381 },
15382
15383 /**
15384 * Request Qiniu upload token
15385 * @param {string} type
15386 * @return {Promise} Resolved with the response
15387 * @private
15388 */
15389 _fileToken: function _fileToken(type, authOptions) {
15390 var name = this.attributes.name;
15391 var extName = extname(name);
15392
15393 if (!extName && this._extName) {
15394 name += this._extName;
15395 extName = this._extName;
15396 }
15397
15398 var data = {
15399 name: name,
15400 keep_file_name: authOptions.keepFileName,
15401 key: authOptions.key,
15402 ACL: this._acl,
15403 mime_type: type,
15404 metaData: this.attributes.metaData
15405 };
15406 return AVRequest('fileTokens', null, null, 'POST', data, authOptions);
15407 },
15408
15409 /**
15410 * @callback UploadProgressCallback
15411 * @param {XMLHttpRequestProgressEvent} event - The progress event with 'loaded' and 'total' attributes
15412 */
15413
15414 /**
15415 * Saves the file to the AV cloud.
15416 * @param {AuthOptions} [options] AuthOptions plus:
15417 * @param {UploadProgressCallback} [options.onprogress] 文件上传进度,在 Node.js 中无效,回调参数说明详见 {@link UploadProgressCallback}。
15418 * @param {boolean} [options.keepFileName = false] 保留下载文件的文件名。
15419 * @param {string} [options.key] 指定文件的 key。设置该选项需要使用 masterKey
15420 * @return {Promise} Promise that is resolved when the save finishes.
15421 */
15422 save: function save() {
15423 var _this3 = this;
15424
15425 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15426
15427 if (this.id) {
15428 throw new Error('File is already saved.');
15429 }
15430
15431 if (!this._previousSave) {
15432 if (this._data) {
15433 var mimeType = this.get('mime_type');
15434 this._previousSave = this._fileToken(mimeType, options).then(function (uploadInfo) {
15435 if (uploadInfo.mime_type) {
15436 mimeType = uploadInfo.mime_type;
15437
15438 _this3.set('mime_type', mimeType);
15439 }
15440
15441 _this3._token = uploadInfo.token;
15442 return _promise.default.resolve().then(function () {
15443 var data = _this3._data;
15444
15445 if (data && data.base64) {
15446 return parseBase64(data.base64, mimeType);
15447 }
15448
15449 if (data && data.blob) {
15450 if (!data.blob.type && mimeType) {
15451 data.blob.type = mimeType;
15452 }
15453
15454 if (!data.blob.name) {
15455 data.blob.name = _this3.get('name');
15456 }
15457
15458 return data.blob;
15459 }
15460
15461 if (typeof Blob !== 'undefined' && data instanceof Blob) {
15462 return data;
15463 }
15464
15465 throw new TypeError('malformed file data');
15466 }).then(function (data) {
15467 var _options = _.extend({}, options); // filter out download progress events
15468
15469
15470 if (options.onprogress) {
15471 _options.onprogress = function (event) {
15472 if (event.direction === 'download') return;
15473 return options.onprogress(event);
15474 };
15475 }
15476
15477 switch (uploadInfo.provider) {
15478 case 's3':
15479 return s3(uploadInfo, data, _this3, _options);
15480
15481 case 'qcloud':
15482 return cos(uploadInfo, data, _this3, _options);
15483
15484 case 'qiniu':
15485 default:
15486 return qiniu(uploadInfo, data, _this3, _options);
15487 }
15488 }).then(tap(function () {
15489 return _this3._callback(true);
15490 }), function (error) {
15491 _this3._callback(false);
15492
15493 throw error;
15494 });
15495 });
15496 } else if (this.attributes.url && this.attributes.metaData.__source === 'external') {
15497 // external link file.
15498 var data = {
15499 name: this.attributes.name,
15500 ACL: this._acl,
15501 metaData: this.attributes.metaData,
15502 mime_type: this.mimeType,
15503 url: this.attributes.url
15504 };
15505 this._previousSave = AVRequest('files', null, null, 'post', data, options).then(function (response) {
15506 _this3.id = response.objectId;
15507 return _this3;
15508 });
15509 }
15510 }
15511
15512 return this._previousSave;
15513 },
15514 _callback: function _callback(success) {
15515 AVRequest('fileCallback', null, null, 'post', {
15516 token: this._token,
15517 result: success
15518 }).catch(debug);
15519 delete this._token;
15520 delete this._data;
15521 },
15522
15523 /**
15524 * fetch the file from server. If the server's representation of the
15525 * model differs from its current attributes, they will be overriden,
15526 * @param {Object} fetchOptions Optional options to set 'keys',
15527 * 'include' and 'includeACL' option.
15528 * @param {AuthOptions} options
15529 * @return {Promise} A promise that is fulfilled when the fetch
15530 * completes.
15531 */
15532 fetch: function fetch(fetchOptions, options) {
15533 if (!this.id) {
15534 throw new Error('Cannot fetch unsaved file');
15535 }
15536
15537 var request = AVRequest('files', null, this.id, 'GET', transformFetchOptions(fetchOptions), options);
15538 return request.then(this._finishFetch.bind(this));
15539 },
15540 _finishFetch: function _finishFetch(response) {
15541 var value = AV.Object.prototype.parse(response);
15542 value.attributes = {
15543 name: value.name,
15544 url: value.url,
15545 mime_type: value.mime_type,
15546 bucket: value.bucket
15547 };
15548 value.attributes.metaData = value.metaData || {};
15549 value.id = value.objectId; // clean
15550
15551 delete value.objectId;
15552 delete value.metaData;
15553 delete value.url;
15554 delete value.name;
15555 delete value.mime_type;
15556 delete value.bucket;
15557
15558 _.extend(this, value);
15559
15560 return this;
15561 },
15562
15563 /**
15564 * Request file censor
15565 * @since 4.13.0
15566 * @return {Promise.<string>}
15567 */
15568 censor: function censor() {
15569 if (!this.id) {
15570 throw new Error('Cannot censor an unsaved file');
15571 }
15572
15573 return AV.File.censor(this.id);
15574 }
15575 });
15576};
15577
15578/***/ }),
15579/* 452 */
15580/***/ (function(module, exports, __webpack_require__) {
15581
15582"use strict";
15583
15584
15585var _require = __webpack_require__(70),
15586 getAdapter = _require.getAdapter;
15587
15588var debug = __webpack_require__(69)('cos');
15589
15590module.exports = function (uploadInfo, data, file) {
15591 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15592 var url = uploadInfo.upload_url + '?sign=' + encodeURIComponent(uploadInfo.token);
15593 var fileFormData = {
15594 field: 'fileContent',
15595 data: data,
15596 name: file.attributes.name
15597 };
15598 var options = {
15599 headers: file._uploadHeaders,
15600 data: {
15601 op: 'upload'
15602 },
15603 onprogress: saveOptions.onprogress
15604 };
15605 debug('url: %s, file: %o, options: %o', url, fileFormData, options);
15606 var upload = getAdapter('upload');
15607 return upload(url, fileFormData, options).then(function (response) {
15608 debug(response.status, response.data);
15609
15610 if (response.ok === false) {
15611 var error = new Error(response.status);
15612 error.response = response;
15613 throw error;
15614 }
15615
15616 file.attributes.url = uploadInfo.url;
15617 file._bucket = uploadInfo.bucket;
15618 file.id = uploadInfo.objectId;
15619 return file;
15620 }, function (error) {
15621 var response = error.response;
15622
15623 if (response) {
15624 debug(response.status, response.data);
15625 error.statusCode = response.status;
15626 error.response = response.data;
15627 }
15628
15629 throw error;
15630 });
15631};
15632
15633/***/ }),
15634/* 453 */
15635/***/ (function(module, exports, __webpack_require__) {
15636
15637"use strict";
15638
15639
15640var _sliceInstanceProperty2 = __webpack_require__(38);
15641
15642var _Array$from = __webpack_require__(236);
15643
15644var _Symbol = __webpack_require__(87);
15645
15646var _getIteratorMethod = __webpack_require__(238);
15647
15648var _Reflect$construct = __webpack_require__(463);
15649
15650var _interopRequireDefault = __webpack_require__(1);
15651
15652var _inherits2 = _interopRequireDefault(__webpack_require__(467));
15653
15654var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(489));
15655
15656var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(491));
15657
15658var _classCallCheck2 = _interopRequireDefault(__webpack_require__(496));
15659
15660var _createClass2 = _interopRequireDefault(__webpack_require__(497));
15661
15662var _stringify = _interopRequireDefault(__webpack_require__(37));
15663
15664var _concat = _interopRequireDefault(__webpack_require__(25));
15665
15666var _promise = _interopRequireDefault(__webpack_require__(10));
15667
15668var _slice = _interopRequireDefault(__webpack_require__(38));
15669
15670function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
15671
15672function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
15673
15674function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { 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 = it.call(o); }, 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; } } }; }
15675
15676function _unsupportedIterableToArray(o, minLen) { var _context8; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty2(_context8 = Object.prototype.toString.call(o)).call(_context8, 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); }
15677
15678function _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; }
15679
15680var _require = __webpack_require__(70),
15681 getAdapter = _require.getAdapter;
15682
15683var debug = __webpack_require__(69)('leancloud:qiniu');
15684
15685var ajax = __webpack_require__(106);
15686
15687var btoa = __webpack_require__(498);
15688
15689var SHARD_THRESHOLD = 1024 * 1024 * 64;
15690var CHUNK_SIZE = 1024 * 1024 * 16;
15691
15692function upload(uploadInfo, data, file) {
15693 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15694 // Get the uptoken to upload files to qiniu.
15695 var uptoken = uploadInfo.token;
15696 var url = uploadInfo.upload_url || 'https://upload.qiniup.com';
15697 var fileFormData = {
15698 field: 'file',
15699 data: data,
15700 name: file.attributes.name
15701 };
15702 var options = {
15703 headers: file._uploadHeaders,
15704 data: {
15705 name: file.attributes.name,
15706 key: uploadInfo.key,
15707 token: uptoken
15708 },
15709 onprogress: saveOptions.onprogress
15710 };
15711 debug('url: %s, file: %o, options: %o', url, fileFormData, options);
15712 var upload = getAdapter('upload');
15713 return upload(url, fileFormData, options).then(function (response) {
15714 debug(response.status, response.data);
15715
15716 if (response.ok === false) {
15717 var message = response.status;
15718
15719 if (response.data) {
15720 if (response.data.error) {
15721 message = response.data.error;
15722 } else {
15723 message = (0, _stringify.default)(response.data);
15724 }
15725 }
15726
15727 var error = new Error(message);
15728 error.response = response;
15729 throw error;
15730 }
15731
15732 file.attributes.url = uploadInfo.url;
15733 file._bucket = uploadInfo.bucket;
15734 file.id = uploadInfo.objectId;
15735 return file;
15736 }, function (error) {
15737 var response = error.response;
15738
15739 if (response) {
15740 debug(response.status, response.data);
15741 error.statusCode = response.status;
15742 error.response = response.data;
15743 }
15744
15745 throw error;
15746 });
15747}
15748
15749function urlSafeBase64(string) {
15750 var base64 = btoa(unescape(encodeURIComponent(string)));
15751 var result = '';
15752
15753 var _iterator = _createForOfIteratorHelper(base64),
15754 _step;
15755
15756 try {
15757 for (_iterator.s(); !(_step = _iterator.n()).done;) {
15758 var ch = _step.value;
15759
15760 switch (ch) {
15761 case '+':
15762 result += '-';
15763 break;
15764
15765 case '/':
15766 result += '_';
15767 break;
15768
15769 default:
15770 result += ch;
15771 }
15772 }
15773 } catch (err) {
15774 _iterator.e(err);
15775 } finally {
15776 _iterator.f();
15777 }
15778
15779 return result;
15780}
15781
15782var ShardUploader = /*#__PURE__*/function () {
15783 function ShardUploader(uploadInfo, data, file, saveOptions) {
15784 var _context,
15785 _context2,
15786 _this = this;
15787
15788 (0, _classCallCheck2.default)(this, ShardUploader);
15789 this.uploadInfo = uploadInfo;
15790 this.data = data;
15791 this.file = file;
15792 this.size = undefined;
15793 this.offset = 0;
15794 this.uploadedChunks = 0;
15795 var key = urlSafeBase64(uploadInfo.key);
15796 var uploadURL = uploadInfo.upload_url || 'https://upload.qiniup.com';
15797 this.baseURL = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(uploadURL, "/buckets/")).call(_context2, uploadInfo.bucket, "/objects/")).call(_context, key, "/uploads");
15798 this.upToken = 'UpToken ' + uploadInfo.token;
15799 this.uploaded = 0;
15800
15801 if (saveOptions && saveOptions.onprogress) {
15802 this.onProgress = function (_ref) {
15803 var loaded = _ref.loaded;
15804 loaded += _this.uploadedChunks * CHUNK_SIZE;
15805
15806 if (loaded <= _this.uploaded) {
15807 return;
15808 }
15809
15810 if (_this.size) {
15811 saveOptions.onprogress({
15812 loaded: loaded,
15813 total: _this.size,
15814 percent: loaded / _this.size * 100
15815 });
15816 } else {
15817 saveOptions.onprogress({
15818 loaded: loaded
15819 });
15820 }
15821
15822 _this.uploaded = loaded;
15823 };
15824 }
15825 }
15826 /**
15827 * @returns {Promise<string>}
15828 */
15829
15830
15831 (0, _createClass2.default)(ShardUploader, [{
15832 key: "getUploadId",
15833 value: function getUploadId() {
15834 return ajax({
15835 method: 'POST',
15836 url: this.baseURL,
15837 headers: {
15838 Authorization: this.upToken
15839 }
15840 }).then(function (res) {
15841 return res.uploadId;
15842 });
15843 }
15844 }, {
15845 key: "getChunk",
15846 value: function getChunk() {
15847 throw new Error('Not implemented');
15848 }
15849 /**
15850 * @param {string} uploadId
15851 * @param {number} partNumber
15852 * @param {any} data
15853 * @returns {Promise<{ partNumber: number, etag: string }>}
15854 */
15855
15856 }, {
15857 key: "uploadPart",
15858 value: function uploadPart(uploadId, partNumber, data) {
15859 var _context3, _context4;
15860
15861 return ajax({
15862 method: 'PUT',
15863 url: (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.baseURL, "/")).call(_context4, uploadId, "/")).call(_context3, partNumber),
15864 headers: {
15865 Authorization: this.upToken
15866 },
15867 data: data,
15868 onprogress: this.onProgress
15869 }).then(function (_ref2) {
15870 var etag = _ref2.etag;
15871 return {
15872 partNumber: partNumber,
15873 etag: etag
15874 };
15875 });
15876 }
15877 }, {
15878 key: "stopUpload",
15879 value: function stopUpload(uploadId) {
15880 var _context5;
15881
15882 return ajax({
15883 method: 'DELETE',
15884 url: (0, _concat.default)(_context5 = "".concat(this.baseURL, "/")).call(_context5, uploadId),
15885 headers: {
15886 Authorization: this.upToken
15887 }
15888 });
15889 }
15890 }, {
15891 key: "upload",
15892 value: function upload() {
15893 var _this2 = this;
15894
15895 var parts = [];
15896 return this.getUploadId().then(function (uploadId) {
15897 var uploadPart = function uploadPart() {
15898 return _promise.default.resolve(_this2.getChunk()).then(function (chunk) {
15899 if (!chunk) {
15900 return;
15901 }
15902
15903 var partNumber = parts.length + 1;
15904 return _this2.uploadPart(uploadId, partNumber, chunk).then(function (part) {
15905 parts.push(part);
15906 _this2.uploadedChunks++;
15907 return uploadPart();
15908 });
15909 }).catch(function (error) {
15910 return _this2.stopUpload(uploadId).then(function () {
15911 return _promise.default.reject(error);
15912 });
15913 });
15914 };
15915
15916 return uploadPart().then(function () {
15917 var _context6;
15918
15919 return ajax({
15920 method: 'POST',
15921 url: (0, _concat.default)(_context6 = "".concat(_this2.baseURL, "/")).call(_context6, uploadId),
15922 headers: {
15923 Authorization: _this2.upToken
15924 },
15925 data: {
15926 parts: parts,
15927 fname: _this2.file.attributes.name,
15928 mimeType: _this2.file.attributes.mime_type
15929 }
15930 });
15931 });
15932 }).then(function () {
15933 _this2.file.attributes.url = _this2.uploadInfo.url;
15934 _this2.file._bucket = _this2.uploadInfo.bucket;
15935 _this2.file.id = _this2.uploadInfo.objectId;
15936 return _this2.file;
15937 });
15938 }
15939 }]);
15940 return ShardUploader;
15941}();
15942
15943var BlobUploader = /*#__PURE__*/function (_ShardUploader) {
15944 (0, _inherits2.default)(BlobUploader, _ShardUploader);
15945
15946 var _super = _createSuper(BlobUploader);
15947
15948 function BlobUploader(uploadInfo, data, file, saveOptions) {
15949 var _this3;
15950
15951 (0, _classCallCheck2.default)(this, BlobUploader);
15952 _this3 = _super.call(this, uploadInfo, data, file, saveOptions);
15953 _this3.size = data.size;
15954 return _this3;
15955 }
15956 /**
15957 * @returns {Blob | null}
15958 */
15959
15960
15961 (0, _createClass2.default)(BlobUploader, [{
15962 key: "getChunk",
15963 value: function getChunk() {
15964 var _context7;
15965
15966 if (this.offset >= this.size) {
15967 return null;
15968 }
15969
15970 var chunk = (0, _slice.default)(_context7 = this.data).call(_context7, this.offset, this.offset + CHUNK_SIZE);
15971 this.offset += chunk.size;
15972 return chunk;
15973 }
15974 }]);
15975 return BlobUploader;
15976}(ShardUploader);
15977
15978function isBlob(data) {
15979 return typeof Blob !== 'undefined' && data instanceof Blob;
15980}
15981
15982module.exports = function (uploadInfo, data, file) {
15983 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15984
15985 if (isBlob(data) && data.size >= SHARD_THRESHOLD) {
15986 return new BlobUploader(uploadInfo, data, file, saveOptions).upload();
15987 }
15988
15989 return upload(uploadInfo, data, file, saveOptions);
15990};
15991
15992/***/ }),
15993/* 454 */
15994/***/ (function(module, exports, __webpack_require__) {
15995
15996__webpack_require__(79);
15997__webpack_require__(455);
15998var path = __webpack_require__(15);
15999
16000module.exports = path.Array.from;
16001
16002
16003/***/ }),
16004/* 455 */
16005/***/ (function(module, exports, __webpack_require__) {
16006
16007var $ = __webpack_require__(0);
16008var from = __webpack_require__(456);
16009var checkCorrectnessOfIteration = __webpack_require__(165);
16010
16011var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
16012 // eslint-disable-next-line es-x/no-array-from -- required for testing
16013 Array.from(iterable);
16014});
16015
16016// `Array.from` method
16017// https://tc39.es/ecma262/#sec-array.from
16018$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
16019 from: from
16020});
16021
16022
16023/***/ }),
16024/* 456 */
16025/***/ (function(module, exports, __webpack_require__) {
16026
16027"use strict";
16028
16029var bind = __webpack_require__(58);
16030var call = __webpack_require__(11);
16031var toObject = __webpack_require__(33);
16032var callWithSafeIterationClosing = __webpack_require__(457);
16033var isArrayIteratorMethod = __webpack_require__(154);
16034var isConstructor = __webpack_require__(98);
16035var lengthOfArrayLike = __webpack_require__(36);
16036var createProperty = __webpack_require__(103);
16037var getIterator = __webpack_require__(155);
16038var getIteratorMethod = __webpack_require__(94);
16039
16040var $Array = Array;
16041
16042// `Array.from` method implementation
16043// https://tc39.es/ecma262/#sec-array.from
16044module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
16045 var O = toObject(arrayLike);
16046 var IS_CONSTRUCTOR = isConstructor(this);
16047 var argumentsLength = arguments.length;
16048 var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
16049 var mapping = mapfn !== undefined;
16050 if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
16051 var iteratorMethod = getIteratorMethod(O);
16052 var index = 0;
16053 var length, result, step, iterator, next, value;
16054 // if the target is not iterable or it's an array with the default iterator - use a simple case
16055 if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
16056 iterator = getIterator(O, iteratorMethod);
16057 next = iterator.next;
16058 result = IS_CONSTRUCTOR ? new this() : [];
16059 for (;!(step = call(next, iterator)).done; index++) {
16060 value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
16061 createProperty(result, index, value);
16062 }
16063 } else {
16064 length = lengthOfArrayLike(O);
16065 result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
16066 for (;length > index; index++) {
16067 value = mapping ? mapfn(O[index], index) : O[index];
16068 createProperty(result, index, value);
16069 }
16070 }
16071 result.length = index;
16072 return result;
16073};
16074
16075
16076/***/ }),
16077/* 457 */
16078/***/ (function(module, exports, __webpack_require__) {
16079
16080var anObject = __webpack_require__(21);
16081var iteratorClose = __webpack_require__(156);
16082
16083// call something on iterator step with safe closing on error
16084module.exports = function (iterator, fn, value, ENTRIES) {
16085 try {
16086 return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
16087 } catch (error) {
16088 iteratorClose(iterator, 'throw', error);
16089 }
16090};
16091
16092
16093/***/ }),
16094/* 458 */
16095/***/ (function(module, exports, __webpack_require__) {
16096
16097module.exports = __webpack_require__(459);
16098
16099
16100/***/ }),
16101/* 459 */
16102/***/ (function(module, exports, __webpack_require__) {
16103
16104var parent = __webpack_require__(460);
16105
16106module.exports = parent;
16107
16108
16109/***/ }),
16110/* 460 */
16111/***/ (function(module, exports, __webpack_require__) {
16112
16113var parent = __webpack_require__(461);
16114
16115module.exports = parent;
16116
16117
16118/***/ }),
16119/* 461 */
16120/***/ (function(module, exports, __webpack_require__) {
16121
16122var parent = __webpack_require__(462);
16123__webpack_require__(63);
16124
16125module.exports = parent;
16126
16127
16128/***/ }),
16129/* 462 */
16130/***/ (function(module, exports, __webpack_require__) {
16131
16132__webpack_require__(60);
16133__webpack_require__(79);
16134var getIteratorMethod = __webpack_require__(94);
16135
16136module.exports = getIteratorMethod;
16137
16138
16139/***/ }),
16140/* 463 */
16141/***/ (function(module, exports, __webpack_require__) {
16142
16143module.exports = __webpack_require__(464);
16144
16145/***/ }),
16146/* 464 */
16147/***/ (function(module, exports, __webpack_require__) {
16148
16149var parent = __webpack_require__(465);
16150
16151module.exports = parent;
16152
16153
16154/***/ }),
16155/* 465 */
16156/***/ (function(module, exports, __webpack_require__) {
16157
16158__webpack_require__(466);
16159var path = __webpack_require__(15);
16160
16161module.exports = path.Reflect.construct;
16162
16163
16164/***/ }),
16165/* 466 */
16166/***/ (function(module, exports, __webpack_require__) {
16167
16168var $ = __webpack_require__(0);
16169var getBuiltIn = __webpack_require__(18);
16170var apply = __webpack_require__(71);
16171var bind = __webpack_require__(239);
16172var aConstructor = __webpack_require__(161);
16173var anObject = __webpack_require__(21);
16174var isObject = __webpack_require__(17);
16175var create = __webpack_require__(59);
16176var fails = __webpack_require__(3);
16177
16178var nativeConstruct = getBuiltIn('Reflect', 'construct');
16179var ObjectPrototype = Object.prototype;
16180var push = [].push;
16181
16182// `Reflect.construct` method
16183// https://tc39.es/ecma262/#sec-reflect.construct
16184// MS Edge supports only 2 arguments and argumentsList argument is optional
16185// FF Nightly sets third argument as `new.target`, but does not create `this` from it
16186var NEW_TARGET_BUG = fails(function () {
16187 function F() { /* empty */ }
16188 return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
16189});
16190
16191var ARGS_BUG = !fails(function () {
16192 nativeConstruct(function () { /* empty */ });
16193});
16194
16195var FORCED = NEW_TARGET_BUG || ARGS_BUG;
16196
16197$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
16198 construct: function construct(Target, args /* , newTarget */) {
16199 aConstructor(Target);
16200 anObject(args);
16201 var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
16202 if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
16203 if (Target == newTarget) {
16204 // w/o altered newTarget, optimization for 0-4 arguments
16205 switch (args.length) {
16206 case 0: return new Target();
16207 case 1: return new Target(args[0]);
16208 case 2: return new Target(args[0], args[1]);
16209 case 3: return new Target(args[0], args[1], args[2]);
16210 case 4: return new Target(args[0], args[1], args[2], args[3]);
16211 }
16212 // w/o altered newTarget, lot of arguments case
16213 var $args = [null];
16214 apply(push, $args, args);
16215 return new (apply(bind, Target, $args))();
16216 }
16217 // with altered newTarget, not support built-in constructors
16218 var proto = newTarget.prototype;
16219 var instance = create(isObject(proto) ? proto : ObjectPrototype);
16220 var result = apply(Target, instance, args);
16221 return isObject(result) ? result : instance;
16222 }
16223});
16224
16225
16226/***/ }),
16227/* 467 */
16228/***/ (function(module, exports, __webpack_require__) {
16229
16230var _Object$create = __webpack_require__(468);
16231
16232var _Object$defineProperty = __webpack_require__(143);
16233
16234var setPrototypeOf = __webpack_require__(478);
16235
16236function _inherits(subClass, superClass) {
16237 if (typeof superClass !== "function" && superClass !== null) {
16238 throw new TypeError("Super expression must either be null or a function");
16239 }
16240
16241 subClass.prototype = _Object$create(superClass && superClass.prototype, {
16242 constructor: {
16243 value: subClass,
16244 writable: true,
16245 configurable: true
16246 }
16247 });
16248
16249 _Object$defineProperty(subClass, "prototype", {
16250 writable: false
16251 });
16252
16253 if (superClass) setPrototypeOf(subClass, superClass);
16254}
16255
16256module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
16257
16258/***/ }),
16259/* 468 */
16260/***/ (function(module, exports, __webpack_require__) {
16261
16262module.exports = __webpack_require__(469);
16263
16264/***/ }),
16265/* 469 */
16266/***/ (function(module, exports, __webpack_require__) {
16267
16268module.exports = __webpack_require__(470);
16269
16270
16271/***/ }),
16272/* 470 */
16273/***/ (function(module, exports, __webpack_require__) {
16274
16275var parent = __webpack_require__(471);
16276
16277module.exports = parent;
16278
16279
16280/***/ }),
16281/* 471 */
16282/***/ (function(module, exports, __webpack_require__) {
16283
16284var parent = __webpack_require__(472);
16285
16286module.exports = parent;
16287
16288
16289/***/ }),
16290/* 472 */
16291/***/ (function(module, exports, __webpack_require__) {
16292
16293var parent = __webpack_require__(473);
16294
16295module.exports = parent;
16296
16297
16298/***/ }),
16299/* 473 */
16300/***/ (function(module, exports, __webpack_require__) {
16301
16302__webpack_require__(474);
16303var path = __webpack_require__(15);
16304
16305var Object = path.Object;
16306
16307module.exports = function create(P, D) {
16308 return Object.create(P, D);
16309};
16310
16311
16312/***/ }),
16313/* 474 */
16314/***/ (function(module, exports, __webpack_require__) {
16315
16316// TODO: Remove from `core-js@4`
16317var $ = __webpack_require__(0);
16318var DESCRIPTORS = __webpack_require__(20);
16319var create = __webpack_require__(59);
16320
16321// `Object.create` method
16322// https://tc39.es/ecma262/#sec-object.create
16323$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
16324 create: create
16325});
16326
16327
16328/***/ }),
16329/* 475 */
16330/***/ (function(module, exports, __webpack_require__) {
16331
16332module.exports = __webpack_require__(476);
16333
16334
16335/***/ }),
16336/* 476 */
16337/***/ (function(module, exports, __webpack_require__) {
16338
16339var parent = __webpack_require__(477);
16340
16341module.exports = parent;
16342
16343
16344/***/ }),
16345/* 477 */
16346/***/ (function(module, exports, __webpack_require__) {
16347
16348var parent = __webpack_require__(228);
16349
16350module.exports = parent;
16351
16352
16353/***/ }),
16354/* 478 */
16355/***/ (function(module, exports, __webpack_require__) {
16356
16357var _Object$setPrototypeOf = __webpack_require__(240);
16358
16359var _bindInstanceProperty = __webpack_require__(241);
16360
16361function _setPrototypeOf(o, p) {
16362 var _context;
16363
16364 module.exports = _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
16365 o.__proto__ = p;
16366 return o;
16367 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
16368 return _setPrototypeOf(o, p);
16369}
16370
16371module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
16372
16373/***/ }),
16374/* 479 */
16375/***/ (function(module, exports, __webpack_require__) {
16376
16377module.exports = __webpack_require__(480);
16378
16379
16380/***/ }),
16381/* 480 */
16382/***/ (function(module, exports, __webpack_require__) {
16383
16384var parent = __webpack_require__(481);
16385
16386module.exports = parent;
16387
16388
16389/***/ }),
16390/* 481 */
16391/***/ (function(module, exports, __webpack_require__) {
16392
16393var parent = __webpack_require__(226);
16394
16395module.exports = parent;
16396
16397
16398/***/ }),
16399/* 482 */
16400/***/ (function(module, exports, __webpack_require__) {
16401
16402module.exports = __webpack_require__(483);
16403
16404
16405/***/ }),
16406/* 483 */
16407/***/ (function(module, exports, __webpack_require__) {
16408
16409var parent = __webpack_require__(484);
16410
16411module.exports = parent;
16412
16413
16414/***/ }),
16415/* 484 */
16416/***/ (function(module, exports, __webpack_require__) {
16417
16418var parent = __webpack_require__(485);
16419
16420module.exports = parent;
16421
16422
16423/***/ }),
16424/* 485 */
16425/***/ (function(module, exports, __webpack_require__) {
16426
16427var parent = __webpack_require__(486);
16428
16429module.exports = parent;
16430
16431
16432/***/ }),
16433/* 486 */
16434/***/ (function(module, exports, __webpack_require__) {
16435
16436var isPrototypeOf = __webpack_require__(12);
16437var method = __webpack_require__(487);
16438
16439var FunctionPrototype = Function.prototype;
16440
16441module.exports = function (it) {
16442 var own = it.bind;
16443 return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;
16444};
16445
16446
16447/***/ }),
16448/* 487 */
16449/***/ (function(module, exports, __webpack_require__) {
16450
16451__webpack_require__(488);
16452var entryVirtual = __webpack_require__(26);
16453
16454module.exports = entryVirtual('Function').bind;
16455
16456
16457/***/ }),
16458/* 488 */
16459/***/ (function(module, exports, __webpack_require__) {
16460
16461// TODO: Remove from `core-js@4`
16462var $ = __webpack_require__(0);
16463var bind = __webpack_require__(239);
16464
16465// `Function.prototype.bind` method
16466// https://tc39.es/ecma262/#sec-function.prototype.bind
16467$({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
16468 bind: bind
16469});
16470
16471
16472/***/ }),
16473/* 489 */
16474/***/ (function(module, exports, __webpack_require__) {
16475
16476var _typeof = __webpack_require__(141)["default"];
16477
16478var assertThisInitialized = __webpack_require__(490);
16479
16480function _possibleConstructorReturn(self, call) {
16481 if (call && (_typeof(call) === "object" || typeof call === "function")) {
16482 return call;
16483 } else if (call !== void 0) {
16484 throw new TypeError("Derived constructors may only return object or undefined");
16485 }
16486
16487 return assertThisInitialized(self);
16488}
16489
16490module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
16491
16492/***/ }),
16493/* 490 */
16494/***/ (function(module, exports) {
16495
16496function _assertThisInitialized(self) {
16497 if (self === void 0) {
16498 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
16499 }
16500
16501 return self;
16502}
16503
16504module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
16505
16506/***/ }),
16507/* 491 */
16508/***/ (function(module, exports, __webpack_require__) {
16509
16510var _Object$setPrototypeOf = __webpack_require__(240);
16511
16512var _bindInstanceProperty = __webpack_require__(241);
16513
16514var _Object$getPrototypeOf = __webpack_require__(492);
16515
16516function _getPrototypeOf(o) {
16517 var _context;
16518
16519 module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
16520 return o.__proto__ || _Object$getPrototypeOf(o);
16521 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
16522 return _getPrototypeOf(o);
16523}
16524
16525module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
16526
16527/***/ }),
16528/* 492 */
16529/***/ (function(module, exports, __webpack_require__) {
16530
16531module.exports = __webpack_require__(493);
16532
16533/***/ }),
16534/* 493 */
16535/***/ (function(module, exports, __webpack_require__) {
16536
16537module.exports = __webpack_require__(494);
16538
16539
16540/***/ }),
16541/* 494 */
16542/***/ (function(module, exports, __webpack_require__) {
16543
16544var parent = __webpack_require__(495);
16545
16546module.exports = parent;
16547
16548
16549/***/ }),
16550/* 495 */
16551/***/ (function(module, exports, __webpack_require__) {
16552
16553var parent = __webpack_require__(221);
16554
16555module.exports = parent;
16556
16557
16558/***/ }),
16559/* 496 */
16560/***/ (function(module, exports) {
16561
16562function _classCallCheck(instance, Constructor) {
16563 if (!(instance instanceof Constructor)) {
16564 throw new TypeError("Cannot call a class as a function");
16565 }
16566}
16567
16568module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
16569
16570/***/ }),
16571/* 497 */
16572/***/ (function(module, exports, __webpack_require__) {
16573
16574var _Object$defineProperty = __webpack_require__(143);
16575
16576function _defineProperties(target, props) {
16577 for (var i = 0; i < props.length; i++) {
16578 var descriptor = props[i];
16579 descriptor.enumerable = descriptor.enumerable || false;
16580 descriptor.configurable = true;
16581 if ("value" in descriptor) descriptor.writable = true;
16582
16583 _Object$defineProperty(target, descriptor.key, descriptor);
16584 }
16585}
16586
16587function _createClass(Constructor, protoProps, staticProps) {
16588 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
16589 if (staticProps) _defineProperties(Constructor, staticProps);
16590
16591 _Object$defineProperty(Constructor, "prototype", {
16592 writable: false
16593 });
16594
16595 return Constructor;
16596}
16597
16598module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
16599
16600/***/ }),
16601/* 498 */
16602/***/ (function(module, exports, __webpack_require__) {
16603
16604"use strict";
16605
16606
16607var _interopRequireDefault = __webpack_require__(1);
16608
16609var _slice = _interopRequireDefault(__webpack_require__(38));
16610
16611// base64 character set, plus padding character (=)
16612var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
16613
16614module.exports = function (string) {
16615 var result = '';
16616
16617 for (var i = 0; i < string.length;) {
16618 var a = string.charCodeAt(i++);
16619 var b = string.charCodeAt(i++);
16620 var c = string.charCodeAt(i++);
16621
16622 if (a > 255 || b > 255 || c > 255) {
16623 throw new TypeError('Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.');
16624 }
16625
16626 var bitmap = a << 16 | b << 8 | c;
16627 result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
16628 } // To determine the final padding
16629
16630
16631 var rest = string.length % 3; // If there's need of padding, replace the last 'A's with equal signs
16632
16633 return rest ? (0, _slice.default)(result).call(result, 0, rest - 3) + '==='.substring(rest) : result;
16634};
16635
16636/***/ }),
16637/* 499 */
16638/***/ (function(module, exports, __webpack_require__) {
16639
16640"use strict";
16641
16642
16643var _ = __webpack_require__(2);
16644
16645var ajax = __webpack_require__(106);
16646
16647module.exports = function upload(uploadInfo, data, file) {
16648 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
16649 return ajax({
16650 url: uploadInfo.upload_url,
16651 method: 'PUT',
16652 data: data,
16653 headers: _.extend({
16654 'Content-Type': file.get('mime_type'),
16655 'Cache-Control': 'public, max-age=31536000'
16656 }, file._uploadHeaders),
16657 onprogress: saveOptions.onprogress
16658 }).then(function () {
16659 file.attributes.url = uploadInfo.url;
16660 file._bucket = uploadInfo.bucket;
16661 file.id = uploadInfo.objectId;
16662 return file;
16663 });
16664};
16665
16666/***/ }),
16667/* 500 */
16668/***/ (function(module, exports, __webpack_require__) {
16669
16670(function(){
16671 var crypt = __webpack_require__(501),
16672 utf8 = __webpack_require__(242).utf8,
16673 isBuffer = __webpack_require__(502),
16674 bin = __webpack_require__(242).bin,
16675
16676 // The core
16677 md5 = function (message, options) {
16678 // Convert to byte array
16679 if (message.constructor == String)
16680 if (options && options.encoding === 'binary')
16681 message = bin.stringToBytes(message);
16682 else
16683 message = utf8.stringToBytes(message);
16684 else if (isBuffer(message))
16685 message = Array.prototype.slice.call(message, 0);
16686 else if (!Array.isArray(message))
16687 message = message.toString();
16688 // else, assume byte array already
16689
16690 var m = crypt.bytesToWords(message),
16691 l = message.length * 8,
16692 a = 1732584193,
16693 b = -271733879,
16694 c = -1732584194,
16695 d = 271733878;
16696
16697 // Swap endian
16698 for (var i = 0; i < m.length; i++) {
16699 m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
16700 ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
16701 }
16702
16703 // Padding
16704 m[l >>> 5] |= 0x80 << (l % 32);
16705 m[(((l + 64) >>> 9) << 4) + 14] = l;
16706
16707 // Method shortcuts
16708 var FF = md5._ff,
16709 GG = md5._gg,
16710 HH = md5._hh,
16711 II = md5._ii;
16712
16713 for (var i = 0; i < m.length; i += 16) {
16714
16715 var aa = a,
16716 bb = b,
16717 cc = c,
16718 dd = d;
16719
16720 a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
16721 d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
16722 c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
16723 b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
16724 a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
16725 d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
16726 c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
16727 b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
16728 a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
16729 d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
16730 c = FF(c, d, a, b, m[i+10], 17, -42063);
16731 b = FF(b, c, d, a, m[i+11], 22, -1990404162);
16732 a = FF(a, b, c, d, m[i+12], 7, 1804603682);
16733 d = FF(d, a, b, c, m[i+13], 12, -40341101);
16734 c = FF(c, d, a, b, m[i+14], 17, -1502002290);
16735 b = FF(b, c, d, a, m[i+15], 22, 1236535329);
16736
16737 a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
16738 d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
16739 c = GG(c, d, a, b, m[i+11], 14, 643717713);
16740 b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
16741 a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
16742 d = GG(d, a, b, c, m[i+10], 9, 38016083);
16743 c = GG(c, d, a, b, m[i+15], 14, -660478335);
16744 b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
16745 a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
16746 d = GG(d, a, b, c, m[i+14], 9, -1019803690);
16747 c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
16748 b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
16749 a = GG(a, b, c, d, m[i+13], 5, -1444681467);
16750 d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
16751 c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
16752 b = GG(b, c, d, a, m[i+12], 20, -1926607734);
16753
16754 a = HH(a, b, c, d, m[i+ 5], 4, -378558);
16755 d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
16756 c = HH(c, d, a, b, m[i+11], 16, 1839030562);
16757 b = HH(b, c, d, a, m[i+14], 23, -35309556);
16758 a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
16759 d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
16760 c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
16761 b = HH(b, c, d, a, m[i+10], 23, -1094730640);
16762 a = HH(a, b, c, d, m[i+13], 4, 681279174);
16763 d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
16764 c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
16765 b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
16766 a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
16767 d = HH(d, a, b, c, m[i+12], 11, -421815835);
16768 c = HH(c, d, a, b, m[i+15], 16, 530742520);
16769 b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
16770
16771 a = II(a, b, c, d, m[i+ 0], 6, -198630844);
16772 d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
16773 c = II(c, d, a, b, m[i+14], 15, -1416354905);
16774 b = II(b, c, d, a, m[i+ 5], 21, -57434055);
16775 a = II(a, b, c, d, m[i+12], 6, 1700485571);
16776 d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
16777 c = II(c, d, a, b, m[i+10], 15, -1051523);
16778 b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
16779 a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
16780 d = II(d, a, b, c, m[i+15], 10, -30611744);
16781 c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
16782 b = II(b, c, d, a, m[i+13], 21, 1309151649);
16783 a = II(a, b, c, d, m[i+ 4], 6, -145523070);
16784 d = II(d, a, b, c, m[i+11], 10, -1120210379);
16785 c = II(c, d, a, b, m[i+ 2], 15, 718787259);
16786 b = II(b, c, d, a, m[i+ 9], 21, -343485551);
16787
16788 a = (a + aa) >>> 0;
16789 b = (b + bb) >>> 0;
16790 c = (c + cc) >>> 0;
16791 d = (d + dd) >>> 0;
16792 }
16793
16794 return crypt.endian([a, b, c, d]);
16795 };
16796
16797 // Auxiliary functions
16798 md5._ff = function (a, b, c, d, x, s, t) {
16799 var n = a + (b & c | ~b & d) + (x >>> 0) + t;
16800 return ((n << s) | (n >>> (32 - s))) + b;
16801 };
16802 md5._gg = function (a, b, c, d, x, s, t) {
16803 var n = a + (b & d | c & ~d) + (x >>> 0) + t;
16804 return ((n << s) | (n >>> (32 - s))) + b;
16805 };
16806 md5._hh = function (a, b, c, d, x, s, t) {
16807 var n = a + (b ^ c ^ d) + (x >>> 0) + t;
16808 return ((n << s) | (n >>> (32 - s))) + b;
16809 };
16810 md5._ii = function (a, b, c, d, x, s, t) {
16811 var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
16812 return ((n << s) | (n >>> (32 - s))) + b;
16813 };
16814
16815 // Package private blocksize
16816 md5._blocksize = 16;
16817 md5._digestsize = 16;
16818
16819 module.exports = function (message, options) {
16820 if (message === undefined || message === null)
16821 throw new Error('Illegal argument ' + message);
16822
16823 var digestbytes = crypt.wordsToBytes(md5(message, options));
16824 return options && options.asBytes ? digestbytes :
16825 options && options.asString ? bin.bytesToString(digestbytes) :
16826 crypt.bytesToHex(digestbytes);
16827 };
16828
16829})();
16830
16831
16832/***/ }),
16833/* 501 */
16834/***/ (function(module, exports) {
16835
16836(function() {
16837 var base64map
16838 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
16839
16840 crypt = {
16841 // Bit-wise rotation left
16842 rotl: function(n, b) {
16843 return (n << b) | (n >>> (32 - b));
16844 },
16845
16846 // Bit-wise rotation right
16847 rotr: function(n, b) {
16848 return (n << (32 - b)) | (n >>> b);
16849 },
16850
16851 // Swap big-endian to little-endian and vice versa
16852 endian: function(n) {
16853 // If number given, swap endian
16854 if (n.constructor == Number) {
16855 return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
16856 }
16857
16858 // Else, assume array and swap all items
16859 for (var i = 0; i < n.length; i++)
16860 n[i] = crypt.endian(n[i]);
16861 return n;
16862 },
16863
16864 // Generate an array of any length of random bytes
16865 randomBytes: function(n) {
16866 for (var bytes = []; n > 0; n--)
16867 bytes.push(Math.floor(Math.random() * 256));
16868 return bytes;
16869 },
16870
16871 // Convert a byte array to big-endian 32-bit words
16872 bytesToWords: function(bytes) {
16873 for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
16874 words[b >>> 5] |= bytes[i] << (24 - b % 32);
16875 return words;
16876 },
16877
16878 // Convert big-endian 32-bit words to a byte array
16879 wordsToBytes: function(words) {
16880 for (var bytes = [], b = 0; b < words.length * 32; b += 8)
16881 bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
16882 return bytes;
16883 },
16884
16885 // Convert a byte array to a hex string
16886 bytesToHex: function(bytes) {
16887 for (var hex = [], i = 0; i < bytes.length; i++) {
16888 hex.push((bytes[i] >>> 4).toString(16));
16889 hex.push((bytes[i] & 0xF).toString(16));
16890 }
16891 return hex.join('');
16892 },
16893
16894 // Convert a hex string to a byte array
16895 hexToBytes: function(hex) {
16896 for (var bytes = [], c = 0; c < hex.length; c += 2)
16897 bytes.push(parseInt(hex.substr(c, 2), 16));
16898 return bytes;
16899 },
16900
16901 // Convert a byte array to a base-64 string
16902 bytesToBase64: function(bytes) {
16903 for (var base64 = [], i = 0; i < bytes.length; i += 3) {
16904 var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
16905 for (var j = 0; j < 4; j++)
16906 if (i * 8 + j * 6 <= bytes.length * 8)
16907 base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
16908 else
16909 base64.push('=');
16910 }
16911 return base64.join('');
16912 },
16913
16914 // Convert a base-64 string to a byte array
16915 base64ToBytes: function(base64) {
16916 // Remove non-base-64 characters
16917 base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
16918
16919 for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
16920 imod4 = ++i % 4) {
16921 if (imod4 == 0) continue;
16922 bytes.push(((base64map.indexOf(base64.charAt(i - 1))
16923 & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
16924 | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
16925 }
16926 return bytes;
16927 }
16928 };
16929
16930 module.exports = crypt;
16931})();
16932
16933
16934/***/ }),
16935/* 502 */
16936/***/ (function(module, exports) {
16937
16938/*!
16939 * Determine if an object is a Buffer
16940 *
16941 * @author Feross Aboukhadijeh <https://feross.org>
16942 * @license MIT
16943 */
16944
16945// The _isBuffer check is for Safari 5-7 support, because it's missing
16946// Object.prototype.constructor. Remove this eventually
16947module.exports = function (obj) {
16948 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
16949}
16950
16951function isBuffer (obj) {
16952 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
16953}
16954
16955// For Node v0.10 support. Remove this eventually.
16956function isSlowBuffer (obj) {
16957 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
16958}
16959
16960
16961/***/ }),
16962/* 503 */
16963/***/ (function(module, exports, __webpack_require__) {
16964
16965"use strict";
16966
16967
16968var _interopRequireDefault = __webpack_require__(1);
16969
16970var _indexOf = _interopRequireDefault(__webpack_require__(68));
16971
16972var dataURItoBlob = function dataURItoBlob(dataURI, type) {
16973 var _context;
16974
16975 var byteString; // 传入的 base64,不是 dataURL
16976
16977 if ((0, _indexOf.default)(dataURI).call(dataURI, 'base64') < 0) {
16978 byteString = atob(dataURI);
16979 } else if ((0, _indexOf.default)(_context = dataURI.split(',')[0]).call(_context, 'base64') >= 0) {
16980 type = type || dataURI.split(',')[0].split(':')[1].split(';')[0];
16981 byteString = atob(dataURI.split(',')[1]);
16982 } else {
16983 byteString = unescape(dataURI.split(',')[1]);
16984 }
16985
16986 var ia = new Uint8Array(byteString.length);
16987
16988 for (var i = 0; i < byteString.length; i++) {
16989 ia[i] = byteString.charCodeAt(i);
16990 }
16991
16992 return new Blob([ia], {
16993 type: type
16994 });
16995};
16996
16997module.exports = dataURItoBlob;
16998
16999/***/ }),
17000/* 504 */
17001/***/ (function(module, exports, __webpack_require__) {
17002
17003"use strict";
17004
17005
17006var _interopRequireDefault = __webpack_require__(1);
17007
17008var _slicedToArray2 = _interopRequireDefault(__webpack_require__(505));
17009
17010var _map = _interopRequireDefault(__webpack_require__(42));
17011
17012var _indexOf = _interopRequireDefault(__webpack_require__(68));
17013
17014var _find = _interopRequireDefault(__webpack_require__(107));
17015
17016var _promise = _interopRequireDefault(__webpack_require__(10));
17017
17018var _concat = _interopRequireDefault(__webpack_require__(25));
17019
17020var _keys2 = _interopRequireDefault(__webpack_require__(53));
17021
17022var _stringify = _interopRequireDefault(__webpack_require__(37));
17023
17024var _defineProperty = _interopRequireDefault(__webpack_require__(140));
17025
17026var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(526));
17027
17028var _ = __webpack_require__(2);
17029
17030var AVError = __webpack_require__(43);
17031
17032var _require = __webpack_require__(27),
17033 _request = _require._request;
17034
17035var _require2 = __webpack_require__(31),
17036 isNullOrUndefined = _require2.isNullOrUndefined,
17037 ensureArray = _require2.ensureArray,
17038 transformFetchOptions = _require2.transformFetchOptions,
17039 setValue = _require2.setValue,
17040 findValue = _require2.findValue,
17041 isPlainObject = _require2.isPlainObject,
17042 continueWhile = _require2.continueWhile;
17043
17044var recursiveToPointer = function recursiveToPointer(value) {
17045 if (_.isArray(value)) return (0, _map.default)(value).call(value, recursiveToPointer);
17046 if (isPlainObject(value)) return _.mapObject(value, recursiveToPointer);
17047 if (_.isObject(value) && value._toPointer) return value._toPointer();
17048 return value;
17049};
17050
17051var RESERVED_KEYS = ['objectId', 'createdAt', 'updatedAt'];
17052
17053var checkReservedKey = function checkReservedKey(key) {
17054 if ((0, _indexOf.default)(RESERVED_KEYS).call(RESERVED_KEYS, key) !== -1) {
17055 throw new Error("key[".concat(key, "] is reserved"));
17056 }
17057};
17058
17059var handleBatchResults = function handleBatchResults(results) {
17060 var firstError = (0, _find.default)(_).call(_, results, function (result) {
17061 return result instanceof Error;
17062 });
17063
17064 if (!firstError) {
17065 return results;
17066 }
17067
17068 var error = new AVError(firstError.code, firstError.message);
17069 error.results = results;
17070 throw error;
17071}; // Helper function to get a value from a Backbone object as a property
17072// or as a function.
17073
17074
17075function getValue(object, prop) {
17076 if (!(object && object[prop])) {
17077 return null;
17078 }
17079
17080 return _.isFunction(object[prop]) ? object[prop]() : object[prop];
17081} // AV.Object is analogous to the Java AVObject.
17082// It also implements the same interface as a Backbone model.
17083
17084
17085module.exports = function (AV) {
17086 /**
17087 * Creates a new model with defined attributes. A client id (cid) is
17088 * automatically generated and assigned for you.
17089 *
17090 * <p>You won't normally call this method directly. It is recommended that
17091 * you use a subclass of <code>AV.Object</code> instead, created by calling
17092 * <code>extend</code>.</p>
17093 *
17094 * <p>However, if you don't want to use a subclass, or aren't sure which
17095 * subclass is appropriate, you can use this form:<pre>
17096 * var object = new AV.Object("ClassName");
17097 * </pre>
17098 * That is basically equivalent to:<pre>
17099 * var MyClass = AV.Object.extend("ClassName");
17100 * var object = new MyClass();
17101 * </pre></p>
17102 *
17103 * @param {Object} attributes The initial set of data to store in the object.
17104 * @param {Object} options A set of Backbone-like options for creating the
17105 * object. The only option currently supported is "collection".
17106 * @see AV.Object.extend
17107 *
17108 * @class
17109 *
17110 * <p>The fundamental unit of AV data, which implements the Backbone Model
17111 * interface.</p>
17112 */
17113 AV.Object = function (attributes, options) {
17114 // Allow new AV.Object("ClassName") as a shortcut to _create.
17115 if (_.isString(attributes)) {
17116 return AV.Object._create.apply(this, arguments);
17117 }
17118
17119 attributes = attributes || {};
17120
17121 if (options && options.parse) {
17122 attributes = this.parse(attributes);
17123 attributes = this._mergeMagicFields(attributes);
17124 }
17125
17126 var defaults = getValue(this, 'defaults');
17127
17128 if (defaults) {
17129 attributes = _.extend({}, defaults, attributes);
17130 }
17131
17132 if (options && options.collection) {
17133 this.collection = options.collection;
17134 }
17135
17136 this._serverData = {}; // The last known data for this object from cloud.
17137
17138 this._opSetQueue = [{}]; // List of sets of changes to the data.
17139
17140 this._flags = {};
17141 this.attributes = {}; // The best estimate of this's current data.
17142
17143 this._hashedJSON = {}; // Hash of values of containers at last save.
17144
17145 this._escapedAttributes = {};
17146 this.cid = _.uniqueId('c');
17147 this.changed = {};
17148 this._silent = {};
17149 this._pending = {};
17150 this.set(attributes, {
17151 silent: true
17152 });
17153 this.changed = {};
17154 this._silent = {};
17155 this._pending = {};
17156 this._hasData = true;
17157 this._previousAttributes = _.clone(this.attributes);
17158 this.initialize.apply(this, arguments);
17159 };
17160 /**
17161 * @lends AV.Object.prototype
17162 * @property {String} id The objectId of the AV Object.
17163 */
17164
17165 /**
17166 * Saves the given list of AV.Object.
17167 * If any error is encountered, stops and calls the error handler.
17168 *
17169 * @example
17170 * AV.Object.saveAll([object1, object2, ...]).then(function(list) {
17171 * // All the objects were saved.
17172 * }, function(error) {
17173 * // An error occurred while saving one of the objects.
17174 * });
17175 *
17176 * @param {Array} list A list of <code>AV.Object</code>.
17177 */
17178
17179
17180 AV.Object.saveAll = function (list, options) {
17181 return AV.Object._deepSaveAsync(list, null, options);
17182 };
17183 /**
17184 * Fetch the given list of AV.Object.
17185 *
17186 * @param {AV.Object[]} objects A list of <code>AV.Object</code>
17187 * @param {AuthOptions} options
17188 * @return {Promise.<AV.Object[]>} The given list of <code>AV.Object</code>, updated
17189 */
17190
17191
17192 AV.Object.fetchAll = function (objects, options) {
17193 return _promise.default.resolve().then(function () {
17194 return _request('batch', null, null, 'POST', {
17195 requests: (0, _map.default)(_).call(_, objects, function (object) {
17196 var _context;
17197
17198 if (!object.className) throw new Error('object must have className to fetch');
17199 if (!object.id) throw new Error('object must have id to fetch');
17200 if (object.dirty()) throw new Error('object is modified but not saved');
17201 return {
17202 method: 'GET',
17203 path: (0, _concat.default)(_context = "/1.1/classes/".concat(object.className, "/")).call(_context, object.id)
17204 };
17205 })
17206 }, options);
17207 }).then(function (response) {
17208 var results = (0, _map.default)(_).call(_, objects, function (object, i) {
17209 if (response[i].success) {
17210 var fetchedAttrs = object.parse(response[i].success);
17211
17212 object._cleanupUnsetKeys(fetchedAttrs);
17213
17214 object._finishFetch(fetchedAttrs);
17215
17216 return object;
17217 }
17218
17219 if (response[i].success === null) {
17220 return new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
17221 }
17222
17223 return new AVError(response[i].error.code, response[i].error.error);
17224 });
17225 return handleBatchResults(results);
17226 });
17227 }; // Attach all inheritable methods to the AV.Object prototype.
17228
17229
17230 _.extend(AV.Object.prototype, AV.Events,
17231 /** @lends AV.Object.prototype */
17232 {
17233 _fetchWhenSave: false,
17234
17235 /**
17236 * Initialize is an empty function by default. Override it with your own
17237 * initialization logic.
17238 */
17239 initialize: function initialize() {},
17240
17241 /**
17242 * Set whether to enable fetchWhenSave option when updating object.
17243 * When set true, SDK would fetch the latest object after saving.
17244 * Default is false.
17245 *
17246 * @deprecated use AV.Object#save with options.fetchWhenSave instead
17247 * @param {boolean} enable true to enable fetchWhenSave option.
17248 */
17249 fetchWhenSave: function fetchWhenSave(enable) {
17250 console.warn('AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead.');
17251
17252 if (!_.isBoolean(enable)) {
17253 throw new Error('Expect boolean value for fetchWhenSave');
17254 }
17255
17256 this._fetchWhenSave = enable;
17257 },
17258
17259 /**
17260 * Returns the object's objectId.
17261 * @return {String} the objectId.
17262 */
17263 getObjectId: function getObjectId() {
17264 return this.id;
17265 },
17266
17267 /**
17268 * Returns the object's createdAt attribute.
17269 * @return {Date}
17270 */
17271 getCreatedAt: function getCreatedAt() {
17272 return this.createdAt;
17273 },
17274
17275 /**
17276 * Returns the object's updatedAt attribute.
17277 * @return {Date}
17278 */
17279 getUpdatedAt: function getUpdatedAt() {
17280 return this.updatedAt;
17281 },
17282
17283 /**
17284 * Returns a JSON version of the object.
17285 * @return {Object}
17286 */
17287 toJSON: function toJSON(key, holder) {
17288 var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
17289 return this._toFullJSON(seenObjects, false);
17290 },
17291
17292 /**
17293 * Returns a JSON version of the object with meta data.
17294 * Inverse to {@link AV.parseJSON}
17295 * @since 3.0.0
17296 * @return {Object}
17297 */
17298 toFullJSON: function toFullJSON() {
17299 var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
17300 return this._toFullJSON(seenObjects);
17301 },
17302 _toFullJSON: function _toFullJSON(seenObjects) {
17303 var _this = this;
17304
17305 var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
17306
17307 var json = _.clone(this.attributes);
17308
17309 if (_.isArray(seenObjects)) {
17310 var newSeenObjects = (0, _concat.default)(seenObjects).call(seenObjects, this);
17311 }
17312
17313 AV._objectEach(json, function (val, key) {
17314 json[key] = AV._encode(val, newSeenObjects, undefined, full);
17315 });
17316
17317 AV._objectEach(this._operations, function (val, key) {
17318 json[key] = val;
17319 });
17320
17321 if (_.has(this, 'id')) {
17322 json.objectId = this.id;
17323 }
17324
17325 ['createdAt', 'updatedAt'].forEach(function (key) {
17326 if (_.has(_this, key)) {
17327 var val = _this[key];
17328 json[key] = _.isDate(val) ? val.toJSON() : val;
17329 }
17330 });
17331
17332 if (full) {
17333 json.__type = 'Object';
17334 if (_.isArray(seenObjects) && seenObjects.length) json.__type = 'Pointer';
17335 json.className = this.className;
17336 }
17337
17338 return json;
17339 },
17340
17341 /**
17342 * Updates _hashedJSON to reflect the current state of this object.
17343 * Adds any changed hash values to the set of pending changes.
17344 * @private
17345 */
17346 _refreshCache: function _refreshCache() {
17347 var self = this;
17348
17349 if (self._refreshingCache) {
17350 return;
17351 }
17352
17353 self._refreshingCache = true;
17354
17355 AV._objectEach(this.attributes, function (value, key) {
17356 if (value instanceof AV.Object) {
17357 value._refreshCache();
17358 } else if (_.isObject(value)) {
17359 if (self._resetCacheForKey(key)) {
17360 self.set(key, new AV.Op.Set(value), {
17361 silent: true
17362 });
17363 }
17364 }
17365 });
17366
17367 delete self._refreshingCache;
17368 },
17369
17370 /**
17371 * Returns true if this object has been modified since its last
17372 * save/refresh. If an attribute is specified, it returns true only if that
17373 * particular attribute has been modified since the last save/refresh.
17374 * @param {String} attr An attribute name (optional).
17375 * @return {Boolean}
17376 */
17377 dirty: function dirty(attr) {
17378 this._refreshCache();
17379
17380 var currentChanges = _.last(this._opSetQueue);
17381
17382 if (attr) {
17383 return currentChanges[attr] ? true : false;
17384 }
17385
17386 if (!this.id) {
17387 return true;
17388 }
17389
17390 if ((0, _keys2.default)(_).call(_, currentChanges).length > 0) {
17391 return true;
17392 }
17393
17394 return false;
17395 },
17396
17397 /**
17398 * Returns the keys of the modified attribute since its last save/refresh.
17399 * @return {String[]}
17400 */
17401 dirtyKeys: function dirtyKeys() {
17402 this._refreshCache();
17403
17404 var currentChanges = _.last(this._opSetQueue);
17405
17406 return (0, _keys2.default)(_).call(_, currentChanges);
17407 },
17408
17409 /**
17410 * Gets a Pointer referencing this Object.
17411 * @private
17412 */
17413 _toPointer: function _toPointer() {
17414 // if (!this.id) {
17415 // throw new Error("Can't serialize an unsaved AV.Object");
17416 // }
17417 return {
17418 __type: 'Pointer',
17419 className: this.className,
17420 objectId: this.id
17421 };
17422 },
17423
17424 /**
17425 * Gets the value of an attribute.
17426 * @param {String} attr The string name of an attribute.
17427 */
17428 get: function get(attr) {
17429 switch (attr) {
17430 case 'objectId':
17431 return this.id;
17432
17433 case 'createdAt':
17434 case 'updatedAt':
17435 return this[attr];
17436
17437 default:
17438 return this.attributes[attr];
17439 }
17440 },
17441
17442 /**
17443 * Gets a relation on the given class for the attribute.
17444 * @param {String} attr The attribute to get the relation for.
17445 * @return {AV.Relation}
17446 */
17447 relation: function relation(attr) {
17448 var value = this.get(attr);
17449
17450 if (value) {
17451 if (!(value instanceof AV.Relation)) {
17452 throw new Error('Called relation() on non-relation field ' + attr);
17453 }
17454
17455 value._ensureParentAndKey(this, attr);
17456
17457 return value;
17458 } else {
17459 return new AV.Relation(this, attr);
17460 }
17461 },
17462
17463 /**
17464 * Gets the HTML-escaped value of an attribute.
17465 */
17466 escape: function escape(attr) {
17467 var html = this._escapedAttributes[attr];
17468
17469 if (html) {
17470 return html;
17471 }
17472
17473 var val = this.attributes[attr];
17474 var escaped;
17475
17476 if (isNullOrUndefined(val)) {
17477 escaped = '';
17478 } else {
17479 escaped = _.escape(val.toString());
17480 }
17481
17482 this._escapedAttributes[attr] = escaped;
17483 return escaped;
17484 },
17485
17486 /**
17487 * Returns <code>true</code> if the attribute contains a value that is not
17488 * null or undefined.
17489 * @param {String} attr The string name of the attribute.
17490 * @return {Boolean}
17491 */
17492 has: function has(attr) {
17493 return !isNullOrUndefined(this.attributes[attr]);
17494 },
17495
17496 /**
17497 * Pulls "special" fields like objectId, createdAt, etc. out of attrs
17498 * and puts them on "this" directly. Removes them from attrs.
17499 * @param attrs - A dictionary with the data for this AV.Object.
17500 * @private
17501 */
17502 _mergeMagicFields: function _mergeMagicFields(attrs) {
17503 // Check for changes of magic fields.
17504 var model = this;
17505 var specialFields = ['objectId', 'createdAt', 'updatedAt'];
17506
17507 AV._arrayEach(specialFields, function (attr) {
17508 if (attrs[attr]) {
17509 if (attr === 'objectId') {
17510 model.id = attrs[attr];
17511 } else if ((attr === 'createdAt' || attr === 'updatedAt') && !_.isDate(attrs[attr])) {
17512 model[attr] = AV._parseDate(attrs[attr]);
17513 } else {
17514 model[attr] = attrs[attr];
17515 }
17516
17517 delete attrs[attr];
17518 }
17519 });
17520
17521 return attrs;
17522 },
17523
17524 /**
17525 * Returns the json to be sent to the server.
17526 * @private
17527 */
17528 _startSave: function _startSave() {
17529 this._opSetQueue.push({});
17530 },
17531
17532 /**
17533 * Called when a save fails because of an error. Any changes that were part
17534 * of the save need to be merged with changes made after the save. This
17535 * might throw an exception is you do conflicting operations. For example,
17536 * if you do:
17537 * object.set("foo", "bar");
17538 * object.set("invalid field name", "baz");
17539 * object.save();
17540 * object.increment("foo");
17541 * then this will throw when the save fails and the client tries to merge
17542 * "bar" with the +1.
17543 * @private
17544 */
17545 _cancelSave: function _cancelSave() {
17546 var failedChanges = _.first(this._opSetQueue);
17547
17548 this._opSetQueue = _.rest(this._opSetQueue);
17549
17550 var nextChanges = _.first(this._opSetQueue);
17551
17552 AV._objectEach(failedChanges, function (op, key) {
17553 var op1 = failedChanges[key];
17554 var op2 = nextChanges[key];
17555
17556 if (op1 && op2) {
17557 nextChanges[key] = op2._mergeWithPrevious(op1);
17558 } else if (op1) {
17559 nextChanges[key] = op1;
17560 }
17561 });
17562
17563 this._saving = this._saving - 1;
17564 },
17565
17566 /**
17567 * Called when a save completes successfully. This merges the changes that
17568 * were saved into the known server data, and overrides it with any data
17569 * sent directly from the server.
17570 * @private
17571 */
17572 _finishSave: function _finishSave(serverData) {
17573 var _context2;
17574
17575 // Grab a copy of any object referenced by this object. These instances
17576 // may have already been fetched, and we don't want to lose their data.
17577 // Note that doing it like this means we will unify separate copies of the
17578 // same object, but that's a risk we have to take.
17579 var fetchedObjects = {};
17580
17581 AV._traverse(this.attributes, function (object) {
17582 if (object instanceof AV.Object && object.id && object._hasData) {
17583 fetchedObjects[object.id] = object;
17584 }
17585 });
17586
17587 var savedChanges = _.first(this._opSetQueue);
17588
17589 this._opSetQueue = _.rest(this._opSetQueue);
17590
17591 this._applyOpSet(savedChanges, this._serverData);
17592
17593 this._mergeMagicFields(serverData);
17594
17595 var self = this;
17596
17597 AV._objectEach(serverData, function (value, key) {
17598 self._serverData[key] = AV._decode(value, key); // Look for any objects that might have become unfetched and fix them
17599 // by replacing their values with the previously observed values.
17600
17601 var fetched = AV._traverse(self._serverData[key], function (object) {
17602 if (object instanceof AV.Object && fetchedObjects[object.id]) {
17603 return fetchedObjects[object.id];
17604 }
17605 });
17606
17607 if (fetched) {
17608 self._serverData[key] = fetched;
17609 }
17610 });
17611
17612 this._rebuildAllEstimatedData();
17613
17614 var opSetQueue = (0, _map.default)(_context2 = this._opSetQueue).call(_context2, _.clone);
17615
17616 this._refreshCache();
17617
17618 this._opSetQueue = opSetQueue;
17619 this._saving = this._saving - 1;
17620 },
17621
17622 /**
17623 * Called when a fetch or login is complete to set the known server data to
17624 * the given object.
17625 * @private
17626 */
17627 _finishFetch: function _finishFetch(serverData, hasData) {
17628 // Clear out any changes the user might have made previously.
17629 this._opSetQueue = [{}]; // Bring in all the new server data.
17630
17631 this._mergeMagicFields(serverData);
17632
17633 var self = this;
17634
17635 AV._objectEach(serverData, function (value, key) {
17636 self._serverData[key] = AV._decode(value, key);
17637 }); // Refresh the attributes.
17638
17639
17640 this._rebuildAllEstimatedData(); // Clear out the cache of mutable containers.
17641
17642
17643 this._refreshCache();
17644
17645 this._opSetQueue = [{}];
17646 this._hasData = hasData;
17647 },
17648
17649 /**
17650 * Applies the set of AV.Op in opSet to the object target.
17651 * @private
17652 */
17653 _applyOpSet: function _applyOpSet(opSet, target) {
17654 var self = this;
17655
17656 AV._objectEach(opSet, function (change, key) {
17657 var _findValue = findValue(target, key),
17658 _findValue2 = (0, _slicedToArray2.default)(_findValue, 3),
17659 value = _findValue2[0],
17660 actualTarget = _findValue2[1],
17661 actualKey = _findValue2[2];
17662
17663 setValue(target, key, change._estimate(value, self, key));
17664
17665 if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
17666 delete actualTarget[actualKey];
17667 }
17668 });
17669 },
17670
17671 /**
17672 * Replaces the cached value for key with the current value.
17673 * Returns true if the new value is different than the old value.
17674 * @private
17675 */
17676 _resetCacheForKey: function _resetCacheForKey(key) {
17677 var value = this.attributes[key];
17678
17679 if (_.isObject(value) && !(value instanceof AV.Object) && !(value instanceof AV.File)) {
17680 var json = (0, _stringify.default)(recursiveToPointer(value));
17681
17682 if (this._hashedJSON[key] !== json) {
17683 var wasSet = !!this._hashedJSON[key];
17684 this._hashedJSON[key] = json;
17685 return wasSet;
17686 }
17687 }
17688
17689 return false;
17690 },
17691
17692 /**
17693 * Populates attributes[key] by starting with the last known data from the
17694 * server, and applying all of the local changes that have been made to that
17695 * key since then.
17696 * @private
17697 */
17698 _rebuildEstimatedDataForKey: function _rebuildEstimatedDataForKey(key) {
17699 var self = this;
17700 delete this.attributes[key];
17701
17702 if (this._serverData[key]) {
17703 this.attributes[key] = this._serverData[key];
17704 }
17705
17706 AV._arrayEach(this._opSetQueue, function (opSet) {
17707 var op = opSet[key];
17708
17709 if (op) {
17710 var _findValue3 = findValue(self.attributes, key),
17711 _findValue4 = (0, _slicedToArray2.default)(_findValue3, 4),
17712 value = _findValue4[0],
17713 actualTarget = _findValue4[1],
17714 actualKey = _findValue4[2],
17715 firstKey = _findValue4[3];
17716
17717 setValue(self.attributes, key, op._estimate(value, self, key));
17718
17719 if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
17720 delete actualTarget[actualKey];
17721 }
17722
17723 self._resetCacheForKey(firstKey);
17724 }
17725 });
17726 },
17727
17728 /**
17729 * Populates attributes by starting with the last known data from the
17730 * server, and applying all of the local changes that have been made since
17731 * then.
17732 * @private
17733 */
17734 _rebuildAllEstimatedData: function _rebuildAllEstimatedData() {
17735 var self = this;
17736
17737 var previousAttributes = _.clone(this.attributes);
17738
17739 this.attributes = _.clone(this._serverData);
17740
17741 AV._arrayEach(this._opSetQueue, function (opSet) {
17742 self._applyOpSet(opSet, self.attributes);
17743
17744 AV._objectEach(opSet, function (op, key) {
17745 self._resetCacheForKey(key);
17746 });
17747 }); // Trigger change events for anything that changed because of the fetch.
17748
17749
17750 AV._objectEach(previousAttributes, function (oldValue, key) {
17751 if (self.attributes[key] !== oldValue) {
17752 self.trigger('change:' + key, self, self.attributes[key], {});
17753 }
17754 });
17755
17756 AV._objectEach(this.attributes, function (newValue, key) {
17757 if (!_.has(previousAttributes, key)) {
17758 self.trigger('change:' + key, self, newValue, {});
17759 }
17760 });
17761 },
17762
17763 /**
17764 * Sets a hash of model attributes on the object, firing
17765 * <code>"change"</code> unless you choose to silence it.
17766 *
17767 * <p>You can call it with an object containing keys and values, or with one
17768 * key and value. For example:</p>
17769 *
17770 * @example
17771 * gameTurn.set({
17772 * player: player1,
17773 * diceRoll: 2
17774 * });
17775 *
17776 * game.set("currentPlayer", player2);
17777 *
17778 * game.set("finished", true);
17779 *
17780 * @param {String} key The key to set.
17781 * @param {Any} value The value to give it.
17782 * @param {Object} [options]
17783 * @param {Boolean} [options.silent]
17784 * @return {AV.Object} self if succeeded, throws if the value is not valid.
17785 * @see AV.Object#validate
17786 */
17787 set: function set(key, value, options) {
17788 var attrs;
17789
17790 if (_.isObject(key) || isNullOrUndefined(key)) {
17791 attrs = _.mapObject(key, function (v, k) {
17792 checkReservedKey(k);
17793 return AV._decode(v, k);
17794 });
17795 options = value;
17796 } else {
17797 attrs = {};
17798 checkReservedKey(key);
17799 attrs[key] = AV._decode(value, key);
17800 } // Extract attributes and options.
17801
17802
17803 options = options || {};
17804
17805 if (!attrs) {
17806 return this;
17807 }
17808
17809 if (attrs instanceof AV.Object) {
17810 attrs = attrs.attributes;
17811 } // If the unset option is used, every attribute should be a Unset.
17812
17813
17814 if (options.unset) {
17815 AV._objectEach(attrs, function (unused_value, key) {
17816 attrs[key] = new AV.Op.Unset();
17817 });
17818 } // Apply all the attributes to get the estimated values.
17819
17820
17821 var dataToValidate = _.clone(attrs);
17822
17823 var self = this;
17824
17825 AV._objectEach(dataToValidate, function (value, key) {
17826 if (value instanceof AV.Op) {
17827 dataToValidate[key] = value._estimate(self.attributes[key], self, key);
17828
17829 if (dataToValidate[key] === AV.Op._UNSET) {
17830 delete dataToValidate[key];
17831 }
17832 }
17833 }); // Run validation.
17834
17835
17836 this._validate(attrs, options);
17837
17838 options.changes = {};
17839 var escaped = this._escapedAttributes; // Update attributes.
17840
17841 AV._arrayEach((0, _keys2.default)(_).call(_, attrs), function (attr) {
17842 var val = attrs[attr]; // If this is a relation object we need to set the parent correctly,
17843 // since the location where it was parsed does not have access to
17844 // this object.
17845
17846 if (val instanceof AV.Relation) {
17847 val.parent = self;
17848 }
17849
17850 if (!(val instanceof AV.Op)) {
17851 val = new AV.Op.Set(val);
17852 } // See if this change will actually have any effect.
17853
17854
17855 var isRealChange = true;
17856
17857 if (val instanceof AV.Op.Set && _.isEqual(self.attributes[attr], val.value)) {
17858 isRealChange = false;
17859 }
17860
17861 if (isRealChange) {
17862 delete escaped[attr];
17863
17864 if (options.silent) {
17865 self._silent[attr] = true;
17866 } else {
17867 options.changes[attr] = true;
17868 }
17869 }
17870
17871 var currentChanges = _.last(self._opSetQueue);
17872
17873 currentChanges[attr] = val._mergeWithPrevious(currentChanges[attr]);
17874
17875 self._rebuildEstimatedDataForKey(attr);
17876
17877 if (isRealChange) {
17878 self.changed[attr] = self.attributes[attr];
17879
17880 if (!options.silent) {
17881 self._pending[attr] = true;
17882 }
17883 } else {
17884 delete self.changed[attr];
17885 delete self._pending[attr];
17886 }
17887 });
17888
17889 if (!options.silent) {
17890 this.change(options);
17891 }
17892
17893 return this;
17894 },
17895
17896 /**
17897 * Remove an attribute from the model, firing <code>"change"</code> unless
17898 * you choose to silence it. This is a noop if the attribute doesn't
17899 * exist.
17900 * @param key {String} The key.
17901 */
17902 unset: function unset(attr, options) {
17903 options = options || {};
17904 options.unset = true;
17905 return this.set(attr, null, options);
17906 },
17907
17908 /**
17909 * Atomically increments the value of the given attribute the next time the
17910 * object is saved. If no amount is specified, 1 is used by default.
17911 *
17912 * @param key {String} The key.
17913 * @param amount {Number} The amount to increment by.
17914 */
17915 increment: function increment(attr, amount) {
17916 if (_.isUndefined(amount) || _.isNull(amount)) {
17917 amount = 1;
17918 }
17919
17920 return this.set(attr, new AV.Op.Increment(amount));
17921 },
17922
17923 /**
17924 * Atomically add an object to the end of the array associated with a given
17925 * key.
17926 * @param key {String} The key.
17927 * @param item {} The item to add.
17928 */
17929 add: function add(attr, item) {
17930 return this.set(attr, new AV.Op.Add(ensureArray(item)));
17931 },
17932
17933 /**
17934 * Atomically add an object to the array associated with a given key, only
17935 * if it is not already present in the array. The position of the insert is
17936 * not guaranteed.
17937 *
17938 * @param key {String} The key.
17939 * @param item {} The object to add.
17940 */
17941 addUnique: function addUnique(attr, item) {
17942 return this.set(attr, new AV.Op.AddUnique(ensureArray(item)));
17943 },
17944
17945 /**
17946 * Atomically remove all instances of an object from the array associated
17947 * with a given key.
17948 *
17949 * @param key {String} The key.
17950 * @param item {} The object to remove.
17951 */
17952 remove: function remove(attr, item) {
17953 return this.set(attr, new AV.Op.Remove(ensureArray(item)));
17954 },
17955
17956 /**
17957 * Atomically apply a "bit and" operation on the value associated with a
17958 * given key.
17959 *
17960 * @param key {String} The key.
17961 * @param value {Number} The value to apply.
17962 */
17963 bitAnd: function bitAnd(attr, value) {
17964 return this.set(attr, new AV.Op.BitAnd(value));
17965 },
17966
17967 /**
17968 * Atomically apply a "bit or" operation on the value associated with a
17969 * given key.
17970 *
17971 * @param key {String} The key.
17972 * @param value {Number} The value to apply.
17973 */
17974 bitOr: function bitOr(attr, value) {
17975 return this.set(attr, new AV.Op.BitOr(value));
17976 },
17977
17978 /**
17979 * Atomically apply a "bit xor" operation on the value associated with a
17980 * given key.
17981 *
17982 * @param key {String} The key.
17983 * @param value {Number} The value to apply.
17984 */
17985 bitXor: function bitXor(attr, value) {
17986 return this.set(attr, new AV.Op.BitXor(value));
17987 },
17988
17989 /**
17990 * Returns an instance of a subclass of AV.Op describing what kind of
17991 * modification has been performed on this field since the last time it was
17992 * saved. For example, after calling object.increment("x"), calling
17993 * object.op("x") would return an instance of AV.Op.Increment.
17994 *
17995 * @param key {String} The key.
17996 * @returns {AV.Op} The operation, or undefined if none.
17997 */
17998 op: function op(attr) {
17999 return _.last(this._opSetQueue)[attr];
18000 },
18001
18002 /**
18003 * Clear all attributes on the model, firing <code>"change"</code> unless
18004 * you choose to silence it.
18005 */
18006 clear: function clear(options) {
18007 options = options || {};
18008 options.unset = true;
18009
18010 var keysToClear = _.extend(this.attributes, this._operations);
18011
18012 return this.set(keysToClear, options);
18013 },
18014
18015 /**
18016 * Clears any (or specific) changes to the model made since the last save.
18017 * @param {string|string[]} [keys] specify keys to revert.
18018 */
18019 revert: function revert(keys) {
18020 var lastOp = _.last(this._opSetQueue);
18021
18022 var _keys = ensureArray(keys || (0, _keys2.default)(_).call(_, lastOp));
18023
18024 _keys.forEach(function (key) {
18025 delete lastOp[key];
18026 });
18027
18028 this._rebuildAllEstimatedData();
18029
18030 return this;
18031 },
18032
18033 /**
18034 * Returns a JSON-encoded set of operations to be sent with the next save
18035 * request.
18036 * @private
18037 */
18038 _getSaveJSON: function _getSaveJSON() {
18039 var json = _.clone(_.first(this._opSetQueue));
18040
18041 AV._objectEach(json, function (op, key) {
18042 json[key] = op.toJSON();
18043 });
18044
18045 return json;
18046 },
18047
18048 /**
18049 * Returns true if this object can be serialized for saving.
18050 * @private
18051 */
18052 _canBeSerialized: function _canBeSerialized() {
18053 return AV.Object._canBeSerializedAsValue(this.attributes);
18054 },
18055
18056 /**
18057 * Fetch the model from the server. If the server's representation of the
18058 * model differs from its current attributes, they will be overriden,
18059 * triggering a <code>"change"</code> event.
18060 * @param {Object} fetchOptions Optional options to set 'keys',
18061 * 'include' and 'includeACL' option.
18062 * @param {AuthOptions} options
18063 * @return {Promise} A promise that is fulfilled when the fetch
18064 * completes.
18065 */
18066 fetch: function fetch() {
18067 var fetchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18068 var options = arguments.length > 1 ? arguments[1] : undefined;
18069
18070 if (!this.id) {
18071 throw new Error('Cannot fetch unsaved object');
18072 }
18073
18074 var self = this;
18075
18076 var request = _request('classes', this.className, this.id, 'GET', transformFetchOptions(fetchOptions), options);
18077
18078 return request.then(function (response) {
18079 var fetchedAttrs = self.parse(response);
18080
18081 self._cleanupUnsetKeys(fetchedAttrs, (0, _keys2.default)(fetchOptions) ? ensureArray((0, _keys2.default)(fetchOptions)).join(',').split(',') : undefined);
18082
18083 self._finishFetch(fetchedAttrs, true);
18084
18085 return self;
18086 });
18087 },
18088 _cleanupUnsetKeys: function _cleanupUnsetKeys(fetchedAttrs) {
18089 var _this2 = this;
18090
18091 var fetchedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _keys2.default)(_).call(_, this._serverData);
18092
18093 _.forEach(fetchedKeys, function (key) {
18094 if (fetchedAttrs[key] === undefined) delete _this2._serverData[key];
18095 });
18096 },
18097
18098 /**
18099 * Set a hash of model attributes, and save the model to the server.
18100 * updatedAt will be updated when the request returns.
18101 * You can either call it as:<pre>
18102 * object.save();</pre>
18103 * or<pre>
18104 * object.save(null, options);</pre>
18105 * or<pre>
18106 * object.save(attrs, options);</pre>
18107 * or<pre>
18108 * object.save(key, value, options);</pre>
18109 *
18110 * @example
18111 * gameTurn.save({
18112 * player: "Jake Cutter",
18113 * diceRoll: 2
18114 * }).then(function(gameTurnAgain) {
18115 * // The save was successful.
18116 * }, function(error) {
18117 * // The save failed. Error is an instance of AVError.
18118 * });
18119 *
18120 * @param {AuthOptions} options AuthOptions plus:
18121 * @param {Boolean} options.fetchWhenSave fetch and update object after save succeeded
18122 * @param {AV.Query} options.query Save object only when it matches the query
18123 * @return {Promise} A promise that is fulfilled when the save
18124 * completes.
18125 * @see AVError
18126 */
18127 save: function save(arg1, arg2, arg3) {
18128 var attrs, current, options;
18129
18130 if (_.isObject(arg1) || isNullOrUndefined(arg1)) {
18131 attrs = arg1;
18132 options = arg2;
18133 } else {
18134 attrs = {};
18135 attrs[arg1] = arg2;
18136 options = arg3;
18137 }
18138
18139 options = _.clone(options) || {};
18140
18141 if (options.wait) {
18142 current = _.clone(this.attributes);
18143 }
18144
18145 var setOptions = _.clone(options) || {};
18146
18147 if (setOptions.wait) {
18148 setOptions.silent = true;
18149 }
18150
18151 if (attrs) {
18152 this.set(attrs, setOptions);
18153 }
18154
18155 var model = this;
18156 var unsavedChildren = [];
18157 var unsavedFiles = [];
18158
18159 AV.Object._findUnsavedChildren(model, unsavedChildren, unsavedFiles);
18160
18161 if (unsavedChildren.length + unsavedFiles.length > 1) {
18162 return AV.Object._deepSaveAsync(this, model, options);
18163 }
18164
18165 this._startSave();
18166
18167 this._saving = (this._saving || 0) + 1;
18168 this._allPreviousSaves = this._allPreviousSaves || _promise.default.resolve();
18169 this._allPreviousSaves = this._allPreviousSaves.catch(function (e) {}).then(function () {
18170 var method = model.id ? 'PUT' : 'POST';
18171
18172 var json = model._getSaveJSON();
18173
18174 var query = {};
18175
18176 if (model._fetchWhenSave || options.fetchWhenSave) {
18177 query['new'] = 'true';
18178 } // user login option
18179
18180
18181 if (options._failOnNotExist) {
18182 query.failOnNotExist = 'true';
18183 }
18184
18185 if (options.query) {
18186 var queryParams;
18187
18188 if (typeof options.query._getParams === 'function') {
18189 queryParams = options.query._getParams();
18190
18191 if (queryParams) {
18192 query.where = queryParams.where;
18193 }
18194 }
18195
18196 if (!query.where) {
18197 var error = new Error('options.query is not an AV.Query');
18198 throw error;
18199 }
18200 }
18201
18202 _.extend(json, model._flags);
18203
18204 var route = 'classes';
18205 var className = model.className;
18206
18207 if (model.className === '_User' && !model.id) {
18208 // Special-case user sign-up.
18209 route = 'users';
18210 className = null;
18211 } //hook makeRequest in options.
18212
18213
18214 var makeRequest = options._makeRequest || _request;
18215 var requestPromise = makeRequest(route, className, model.id, method, json, options, query);
18216 requestPromise = requestPromise.then(function (resp) {
18217 var serverAttrs = model.parse(resp);
18218
18219 if (options.wait) {
18220 serverAttrs = _.extend(attrs || {}, serverAttrs);
18221 }
18222
18223 model._finishSave(serverAttrs);
18224
18225 if (options.wait) {
18226 model.set(current, setOptions);
18227 }
18228
18229 return model;
18230 }, function (error) {
18231 model._cancelSave();
18232
18233 throw error;
18234 });
18235 return requestPromise;
18236 });
18237 return this._allPreviousSaves;
18238 },
18239
18240 /**
18241 * Destroy this model on the server if it was already persisted.
18242 * Optimistically removes the model from its collection, if it has one.
18243 * @param {AuthOptions} options AuthOptions plus:
18244 * @param {Boolean} [options.wait] wait for the server to respond
18245 * before removal.
18246 *
18247 * @return {Promise} A promise that is fulfilled when the destroy
18248 * completes.
18249 */
18250 destroy: function destroy(options) {
18251 options = options || {};
18252 var model = this;
18253
18254 var triggerDestroy = function triggerDestroy() {
18255 model.trigger('destroy', model, model.collection, options);
18256 };
18257
18258 if (!this.id) {
18259 return triggerDestroy();
18260 }
18261
18262 if (!options.wait) {
18263 triggerDestroy();
18264 }
18265
18266 var request = _request('classes', this.className, this.id, 'DELETE', this._flags, options);
18267
18268 return request.then(function () {
18269 if (options.wait) {
18270 triggerDestroy();
18271 }
18272
18273 return model;
18274 });
18275 },
18276
18277 /**
18278 * Converts a response into the hash of attributes to be set on the model.
18279 * @ignore
18280 */
18281 parse: function parse(resp) {
18282 var output = _.clone(resp);
18283
18284 ['createdAt', 'updatedAt'].forEach(function (key) {
18285 if (output[key]) {
18286 output[key] = AV._parseDate(output[key]);
18287 }
18288 });
18289
18290 if (output.createdAt && !output.updatedAt) {
18291 output.updatedAt = output.createdAt;
18292 }
18293
18294 return output;
18295 },
18296
18297 /**
18298 * Creates a new model with identical attributes to this one.
18299 * @return {AV.Object}
18300 */
18301 clone: function clone() {
18302 return new this.constructor(this.attributes);
18303 },
18304
18305 /**
18306 * Returns true if this object has never been saved to AV.
18307 * @return {Boolean}
18308 */
18309 isNew: function isNew() {
18310 return !this.id;
18311 },
18312
18313 /**
18314 * Call this method to manually fire a `"change"` event for this model and
18315 * a `"change:attribute"` event for each changed attribute.
18316 * Calling this will cause all objects observing the model to update.
18317 */
18318 change: function change(options) {
18319 options = options || {};
18320 var changing = this._changing;
18321 this._changing = true; // Silent changes become pending changes.
18322
18323 var self = this;
18324
18325 AV._objectEach(this._silent, function (attr) {
18326 self._pending[attr] = true;
18327 }); // Silent changes are triggered.
18328
18329
18330 var changes = _.extend({}, options.changes, this._silent);
18331
18332 this._silent = {};
18333
18334 AV._objectEach(changes, function (unused_value, attr) {
18335 self.trigger('change:' + attr, self, self.get(attr), options);
18336 });
18337
18338 if (changing) {
18339 return this;
18340 } // This is to get around lint not letting us make a function in a loop.
18341
18342
18343 var deleteChanged = function deleteChanged(value, attr) {
18344 if (!self._pending[attr] && !self._silent[attr]) {
18345 delete self.changed[attr];
18346 }
18347 }; // Continue firing `"change"` events while there are pending changes.
18348
18349
18350 while (!_.isEmpty(this._pending)) {
18351 this._pending = {};
18352 this.trigger('change', this, options); // Pending and silent changes still remain.
18353
18354 AV._objectEach(this.changed, deleteChanged);
18355
18356 self._previousAttributes = _.clone(this.attributes);
18357 }
18358
18359 this._changing = false;
18360 return this;
18361 },
18362
18363 /**
18364 * Gets the previous value of an attribute, recorded at the time the last
18365 * <code>"change"</code> event was fired.
18366 * @param {String} attr Name of the attribute to get.
18367 */
18368 previous: function previous(attr) {
18369 if (!arguments.length || !this._previousAttributes) {
18370 return null;
18371 }
18372
18373 return this._previousAttributes[attr];
18374 },
18375
18376 /**
18377 * Gets all of the attributes of the model at the time of the previous
18378 * <code>"change"</code> event.
18379 * @return {Object}
18380 */
18381 previousAttributes: function previousAttributes() {
18382 return _.clone(this._previousAttributes);
18383 },
18384
18385 /**
18386 * Checks if the model is currently in a valid state. It's only possible to
18387 * get into an *invalid* state if you're using silent changes.
18388 * @return {Boolean}
18389 */
18390 isValid: function isValid() {
18391 try {
18392 this.validate(this.attributes);
18393 } catch (error) {
18394 return false;
18395 }
18396
18397 return true;
18398 },
18399
18400 /**
18401 * You should not call this function directly unless you subclass
18402 * <code>AV.Object</code>, in which case you can override this method
18403 * to provide additional validation on <code>set</code> and
18404 * <code>save</code>. Your implementation should throw an Error if
18405 * the attrs is invalid
18406 *
18407 * @param {Object} attrs The current data to validate.
18408 * @see AV.Object#set
18409 */
18410 validate: function validate(attrs) {
18411 if (_.has(attrs, 'ACL') && !(attrs.ACL instanceof AV.ACL)) {
18412 throw new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
18413 }
18414 },
18415
18416 /**
18417 * Run validation against a set of incoming attributes, returning `true`
18418 * if all is well. If a specific `error` callback has been passed,
18419 * call that instead of firing the general `"error"` event.
18420 * @private
18421 */
18422 _validate: function _validate(attrs, options) {
18423 if (options.silent || !this.validate) {
18424 return;
18425 }
18426
18427 attrs = _.extend({}, this.attributes, attrs);
18428 this.validate(attrs);
18429 },
18430
18431 /**
18432 * Returns the ACL for this object.
18433 * @returns {AV.ACL} An instance of AV.ACL.
18434 * @see AV.Object#get
18435 */
18436 getACL: function getACL() {
18437 return this.get('ACL');
18438 },
18439
18440 /**
18441 * Sets the ACL to be used for this object.
18442 * @param {AV.ACL} acl An instance of AV.ACL.
18443 * @param {Object} options Optional Backbone-like options object to be
18444 * passed in to set.
18445 * @return {AV.Object} self
18446 * @see AV.Object#set
18447 */
18448 setACL: function setACL(acl, options) {
18449 return this.set('ACL', acl, options);
18450 },
18451 disableBeforeHook: function disableBeforeHook() {
18452 this.ignoreHook('beforeSave');
18453 this.ignoreHook('beforeUpdate');
18454 this.ignoreHook('beforeDelete');
18455 },
18456 disableAfterHook: function disableAfterHook() {
18457 this.ignoreHook('afterSave');
18458 this.ignoreHook('afterUpdate');
18459 this.ignoreHook('afterDelete');
18460 },
18461 ignoreHook: function ignoreHook(hookName) {
18462 if (!_.contains(['beforeSave', 'afterSave', 'beforeUpdate', 'afterUpdate', 'beforeDelete', 'afterDelete'], hookName)) {
18463 throw new Error('Unsupported hookName: ' + hookName);
18464 }
18465
18466 if (!AV.hookKey) {
18467 throw new Error('ignoreHook required hookKey');
18468 }
18469
18470 if (!this._flags.__ignore_hooks) {
18471 this._flags.__ignore_hooks = [];
18472 }
18473
18474 this._flags.__ignore_hooks.push(hookName);
18475 }
18476 });
18477 /**
18478 * Creates an instance of a subclass of AV.Object for the give classname
18479 * and id.
18480 * @param {String|Function} class the className or a subclass of AV.Object.
18481 * @param {String} id The object id of this model.
18482 * @return {AV.Object} A new subclass instance of AV.Object.
18483 */
18484
18485
18486 AV.Object.createWithoutData = function (klass, id, hasData) {
18487 var _klass;
18488
18489 if (_.isString(klass)) {
18490 _klass = AV.Object._getSubclass(klass);
18491 } else if (klass.prototype && klass.prototype instanceof AV.Object) {
18492 _klass = klass;
18493 } else {
18494 throw new Error('class must be a string or a subclass of AV.Object.');
18495 }
18496
18497 if (!id) {
18498 throw new TypeError('The objectId must be provided');
18499 }
18500
18501 var object = new _klass();
18502 object.id = id;
18503 object._hasData = hasData;
18504 return object;
18505 };
18506 /**
18507 * Delete objects in batch.
18508 * @param {AV.Object[]} objects The <code>AV.Object</code> array to be deleted.
18509 * @param {AuthOptions} options
18510 * @return {Promise} A promise that is fulfilled when the save
18511 * completes.
18512 */
18513
18514
18515 AV.Object.destroyAll = function (objects) {
18516 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
18517
18518 if (!objects || objects.length === 0) {
18519 return _promise.default.resolve();
18520 }
18521
18522 var objectsByClassNameAndFlags = _.groupBy(objects, function (object) {
18523 return (0, _stringify.default)({
18524 className: object.className,
18525 flags: object._flags
18526 });
18527 });
18528
18529 var body = {
18530 requests: (0, _map.default)(_).call(_, objectsByClassNameAndFlags, function (objects) {
18531 var _context3;
18532
18533 var ids = (0, _map.default)(_).call(_, objects, 'id').join(',');
18534 return {
18535 method: 'DELETE',
18536 path: (0, _concat.default)(_context3 = "/1.1/classes/".concat(objects[0].className, "/")).call(_context3, ids),
18537 body: objects[0]._flags
18538 };
18539 })
18540 };
18541 return _request('batch', null, null, 'POST', body, options).then(function (response) {
18542 var firstError = (0, _find.default)(_).call(_, response, function (result) {
18543 return !result.success;
18544 });
18545 if (firstError) throw new AVError(firstError.error.code, firstError.error.error);
18546 return undefined;
18547 });
18548 };
18549 /**
18550 * Returns the appropriate subclass for making new instances of the given
18551 * className string.
18552 * @private
18553 */
18554
18555
18556 AV.Object._getSubclass = function (className) {
18557 if (!_.isString(className)) {
18558 throw new Error('AV.Object._getSubclass requires a string argument.');
18559 }
18560
18561 var ObjectClass = AV.Object._classMap[className];
18562
18563 if (!ObjectClass) {
18564 ObjectClass = AV.Object.extend(className);
18565 AV.Object._classMap[className] = ObjectClass;
18566 }
18567
18568 return ObjectClass;
18569 };
18570 /**
18571 * Creates an instance of a subclass of AV.Object for the given classname.
18572 * @private
18573 */
18574
18575
18576 AV.Object._create = function (className, attributes, options) {
18577 var ObjectClass = AV.Object._getSubclass(className);
18578
18579 return new ObjectClass(attributes, options);
18580 }; // Set up a map of className to class so that we can create new instances of
18581 // AV Objects from JSON automatically.
18582
18583
18584 AV.Object._classMap = {};
18585 AV.Object._extend = AV._extend;
18586 /**
18587 * Creates a new model with defined attributes,
18588 * It's the same with
18589 * <pre>
18590 * new AV.Object(attributes, options);
18591 * </pre>
18592 * @param {Object} attributes The initial set of data to store in the object.
18593 * @param {Object} options A set of Backbone-like options for creating the
18594 * object. The only option currently supported is "collection".
18595 * @return {AV.Object}
18596 * @since v0.4.4
18597 * @see AV.Object
18598 * @see AV.Object.extend
18599 */
18600
18601 AV.Object['new'] = function (attributes, options) {
18602 return new AV.Object(attributes, options);
18603 };
18604 /**
18605 * Creates a new subclass of AV.Object for the given AV class name.
18606 *
18607 * <p>Every extension of a AV class will inherit from the most recent
18608 * previous extension of that class. When a AV.Object is automatically
18609 * created by parsing JSON, it will use the most recent extension of that
18610 * class.</p>
18611 *
18612 * @example
18613 * var MyClass = AV.Object.extend("MyClass", {
18614 * // Instance properties
18615 * }, {
18616 * // Class properties
18617 * });
18618 *
18619 * @param {String} className The name of the AV class backing this model.
18620 * @param {Object} protoProps Instance properties to add to instances of the
18621 * class returned from this method.
18622 * @param {Object} classProps Class properties to add the class returned from
18623 * this method.
18624 * @return {Class} A new subclass of AV.Object.
18625 */
18626
18627
18628 AV.Object.extend = function (className, protoProps, classProps) {
18629 // Handle the case with only two args.
18630 if (!_.isString(className)) {
18631 if (className && _.has(className, 'className')) {
18632 return AV.Object.extend(className.className, className, protoProps);
18633 } else {
18634 throw new Error("AV.Object.extend's first argument should be the className.");
18635 }
18636 } // If someone tries to subclass "User", coerce it to the right type.
18637
18638
18639 if (className === 'User') {
18640 className = '_User';
18641 }
18642
18643 var NewClassObject = null;
18644
18645 if (_.has(AV.Object._classMap, className)) {
18646 var OldClassObject = AV.Object._classMap[className]; // This new subclass has been told to extend both from "this" and from
18647 // OldClassObject. This is multiple inheritance, which isn't supported.
18648 // For now, let's just pick one.
18649
18650 if (protoProps || classProps) {
18651 NewClassObject = OldClassObject._extend(protoProps, classProps);
18652 } else {
18653 return OldClassObject;
18654 }
18655 } else {
18656 protoProps = protoProps || {};
18657 protoProps._className = className;
18658 NewClassObject = this._extend(protoProps, classProps);
18659 } // Extending a subclass should reuse the classname automatically.
18660
18661
18662 NewClassObject.extend = function (arg0) {
18663 var _context4;
18664
18665 if (_.isString(arg0) || arg0 && _.has(arg0, 'className')) {
18666 return AV.Object.extend.apply(NewClassObject, arguments);
18667 }
18668
18669 var newArguments = (0, _concat.default)(_context4 = [className]).call(_context4, _.toArray(arguments));
18670 return AV.Object.extend.apply(NewClassObject, newArguments);
18671 }; // Add the query property descriptor.
18672
18673
18674 (0, _defineProperty.default)(NewClassObject, 'query', (0, _getOwnPropertyDescriptor.default)(AV.Object, 'query'));
18675
18676 NewClassObject['new'] = function (attributes, options) {
18677 return new NewClassObject(attributes, options);
18678 };
18679
18680 AV.Object._classMap[className] = NewClassObject;
18681 return NewClassObject;
18682 }; // ES6 class syntax support
18683
18684
18685 (0, _defineProperty.default)(AV.Object.prototype, 'className', {
18686 get: function get() {
18687 var className = this._className || this.constructor._LCClassName || this.constructor.name; // If someone tries to subclass "User", coerce it to the right type.
18688
18689 if (className === 'User') {
18690 return '_User';
18691 }
18692
18693 return className;
18694 }
18695 });
18696 /**
18697 * Register a class.
18698 * If a subclass of <code>AV.Object</code> is defined with your own implement
18699 * rather then <code>AV.Object.extend</code>, the subclass must be registered.
18700 * @param {Function} klass A subclass of <code>AV.Object</code>
18701 * @param {String} [name] Specify the name of the class. Useful when the class might be uglified.
18702 * @example
18703 * class Person extend AV.Object {}
18704 * AV.Object.register(Person);
18705 */
18706
18707 AV.Object.register = function (klass, name) {
18708 if (!(klass.prototype instanceof AV.Object)) {
18709 throw new Error('registered class is not a subclass of AV.Object');
18710 }
18711
18712 var className = name || klass.name;
18713
18714 if (!className.length) {
18715 throw new Error('registered class must be named');
18716 }
18717
18718 if (name) {
18719 klass._LCClassName = name;
18720 }
18721
18722 AV.Object._classMap[className] = klass;
18723 };
18724 /**
18725 * Get a new Query of the current class
18726 * @name query
18727 * @memberof AV.Object
18728 * @type AV.Query
18729 * @readonly
18730 * @since v3.1.0
18731 * @example
18732 * const Post = AV.Object.extend('Post');
18733 * Post.query.equalTo('author', 'leancloud').find().then();
18734 */
18735
18736
18737 (0, _defineProperty.default)(AV.Object, 'query', {
18738 get: function get() {
18739 return new AV.Query(this.prototype.className);
18740 }
18741 });
18742
18743 AV.Object._findUnsavedChildren = function (objects, children, files) {
18744 AV._traverse(objects, function (object) {
18745 if (object instanceof AV.Object) {
18746 if (object.dirty()) {
18747 children.push(object);
18748 }
18749
18750 return;
18751 }
18752
18753 if (object instanceof AV.File) {
18754 if (!object.id) {
18755 files.push(object);
18756 }
18757
18758 return;
18759 }
18760 });
18761 };
18762
18763 AV.Object._canBeSerializedAsValue = function (object) {
18764 var canBeSerializedAsValue = true;
18765
18766 if (object instanceof AV.Object || object instanceof AV.File) {
18767 canBeSerializedAsValue = !!object.id;
18768 } else if (_.isArray(object)) {
18769 AV._arrayEach(object, function (child) {
18770 if (!AV.Object._canBeSerializedAsValue(child)) {
18771 canBeSerializedAsValue = false;
18772 }
18773 });
18774 } else if (_.isObject(object)) {
18775 AV._objectEach(object, function (child) {
18776 if (!AV.Object._canBeSerializedAsValue(child)) {
18777 canBeSerializedAsValue = false;
18778 }
18779 });
18780 }
18781
18782 return canBeSerializedAsValue;
18783 };
18784
18785 AV.Object._deepSaveAsync = function (object, model, options) {
18786 var unsavedChildren = [];
18787 var unsavedFiles = [];
18788
18789 AV.Object._findUnsavedChildren(object, unsavedChildren, unsavedFiles);
18790
18791 unsavedFiles = _.uniq(unsavedFiles);
18792
18793 var promise = _promise.default.resolve();
18794
18795 _.each(unsavedFiles, function (file) {
18796 promise = promise.then(function () {
18797 return file.save();
18798 });
18799 });
18800
18801 var objects = _.uniq(unsavedChildren);
18802
18803 var remaining = _.uniq(objects);
18804
18805 return promise.then(function () {
18806 return continueWhile(function () {
18807 return remaining.length > 0;
18808 }, function () {
18809 // Gather up all the objects that can be saved in this batch.
18810 var batch = [];
18811 var newRemaining = [];
18812
18813 AV._arrayEach(remaining, function (object) {
18814 if (object._canBeSerialized()) {
18815 batch.push(object);
18816 } else {
18817 newRemaining.push(object);
18818 }
18819 });
18820
18821 remaining = newRemaining; // If we can't save any objects, there must be a circular reference.
18822
18823 if (batch.length === 0) {
18824 return _promise.default.reject(new AVError(AVError.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
18825 } // Reserve a spot in every object's save queue.
18826
18827
18828 var readyToStart = _promise.default.resolve((0, _map.default)(_).call(_, batch, function (object) {
18829 return object._allPreviousSaves || _promise.default.resolve();
18830 })); // Save a single batch, whether previous saves succeeded or failed.
18831
18832
18833 var bathSavePromise = readyToStart.then(function () {
18834 return _request('batch', null, null, 'POST', {
18835 requests: (0, _map.default)(_).call(_, batch, function (object) {
18836 var method = object.id ? 'PUT' : 'POST';
18837
18838 var json = object._getSaveJSON();
18839
18840 _.extend(json, object._flags);
18841
18842 var route = 'classes';
18843 var className = object.className;
18844 var path = "/".concat(route, "/").concat(className);
18845
18846 if (object.className === '_User' && !object.id) {
18847 // Special-case user sign-up.
18848 path = '/users';
18849 }
18850
18851 var path = "/1.1".concat(path);
18852
18853 if (object.id) {
18854 path = path + '/' + object.id;
18855 }
18856
18857 object._startSave();
18858
18859 return {
18860 method: method,
18861 path: path,
18862 body: json,
18863 params: options && options.fetchWhenSave ? {
18864 fetchWhenSave: true
18865 } : undefined
18866 };
18867 })
18868 }, options).then(function (response) {
18869 var results = (0, _map.default)(_).call(_, batch, function (object, i) {
18870 if (response[i].success) {
18871 object._finishSave(object.parse(response[i].success));
18872
18873 return object;
18874 }
18875
18876 object._cancelSave();
18877
18878 return new AVError(response[i].error.code, response[i].error.error);
18879 });
18880 return handleBatchResults(results);
18881 });
18882 });
18883
18884 AV._arrayEach(batch, function (object) {
18885 object._allPreviousSaves = bathSavePromise;
18886 });
18887
18888 return bathSavePromise;
18889 });
18890 }).then(function () {
18891 return object;
18892 });
18893 };
18894};
18895
18896/***/ }),
18897/* 505 */
18898/***/ (function(module, exports, __webpack_require__) {
18899
18900var arrayWithHoles = __webpack_require__(506);
18901
18902var iterableToArrayLimit = __webpack_require__(514);
18903
18904var unsupportedIterableToArray = __webpack_require__(515);
18905
18906var nonIterableRest = __webpack_require__(525);
18907
18908function _slicedToArray(arr, i) {
18909 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
18910}
18911
18912module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
18913
18914/***/ }),
18915/* 506 */
18916/***/ (function(module, exports, __webpack_require__) {
18917
18918var _Array$isArray = __webpack_require__(507);
18919
18920function _arrayWithHoles(arr) {
18921 if (_Array$isArray(arr)) return arr;
18922}
18923
18924module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
18925
18926/***/ }),
18927/* 507 */
18928/***/ (function(module, exports, __webpack_require__) {
18929
18930module.exports = __webpack_require__(508);
18931
18932/***/ }),
18933/* 508 */
18934/***/ (function(module, exports, __webpack_require__) {
18935
18936module.exports = __webpack_require__(509);
18937
18938
18939/***/ }),
18940/* 509 */
18941/***/ (function(module, exports, __webpack_require__) {
18942
18943var parent = __webpack_require__(510);
18944
18945module.exports = parent;
18946
18947
18948/***/ }),
18949/* 510 */
18950/***/ (function(module, exports, __webpack_require__) {
18951
18952var parent = __webpack_require__(511);
18953
18954module.exports = parent;
18955
18956
18957/***/ }),
18958/* 511 */
18959/***/ (function(module, exports, __webpack_require__) {
18960
18961var parent = __webpack_require__(512);
18962
18963module.exports = parent;
18964
18965
18966/***/ }),
18967/* 512 */
18968/***/ (function(module, exports, __webpack_require__) {
18969
18970__webpack_require__(513);
18971var path = __webpack_require__(15);
18972
18973module.exports = path.Array.isArray;
18974
18975
18976/***/ }),
18977/* 513 */
18978/***/ (function(module, exports, __webpack_require__) {
18979
18980var $ = __webpack_require__(0);
18981var isArray = __webpack_require__(86);
18982
18983// `Array.isArray` method
18984// https://tc39.es/ecma262/#sec-array.isarray
18985$({ target: 'Array', stat: true }, {
18986 isArray: isArray
18987});
18988
18989
18990/***/ }),
18991/* 514 */
18992/***/ (function(module, exports, __webpack_require__) {
18993
18994var _Symbol = __webpack_require__(229);
18995
18996var _getIteratorMethod = __webpack_require__(238);
18997
18998function _iterableToArrayLimit(arr, i) {
18999 var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"];
19000
19001 if (_i == null) return;
19002 var _arr = [];
19003 var _n = true;
19004 var _d = false;
19005
19006 var _s, _e;
19007
19008 try {
19009 for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
19010 _arr.push(_s.value);
19011
19012 if (i && _arr.length === i) break;
19013 }
19014 } catch (err) {
19015 _d = true;
19016 _e = err;
19017 } finally {
19018 try {
19019 if (!_n && _i["return"] != null) _i["return"]();
19020 } finally {
19021 if (_d) throw _e;
19022 }
19023 }
19024
19025 return _arr;
19026}
19027
19028module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
19029
19030/***/ }),
19031/* 515 */
19032/***/ (function(module, exports, __webpack_require__) {
19033
19034var _sliceInstanceProperty = __webpack_require__(516);
19035
19036var _Array$from = __webpack_require__(520);
19037
19038var arrayLikeToArray = __webpack_require__(524);
19039
19040function _unsupportedIterableToArray(o, minLen) {
19041 var _context;
19042
19043 if (!o) return;
19044 if (typeof o === "string") return arrayLikeToArray(o, minLen);
19045
19046 var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
19047
19048 if (n === "Object" && o.constructor) n = o.constructor.name;
19049 if (n === "Map" || n === "Set") return _Array$from(o);
19050 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
19051}
19052
19053module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
19054
19055/***/ }),
19056/* 516 */
19057/***/ (function(module, exports, __webpack_require__) {
19058
19059module.exports = __webpack_require__(517);
19060
19061/***/ }),
19062/* 517 */
19063/***/ (function(module, exports, __webpack_require__) {
19064
19065module.exports = __webpack_require__(518);
19066
19067
19068/***/ }),
19069/* 518 */
19070/***/ (function(module, exports, __webpack_require__) {
19071
19072var parent = __webpack_require__(519);
19073
19074module.exports = parent;
19075
19076
19077/***/ }),
19078/* 519 */
19079/***/ (function(module, exports, __webpack_require__) {
19080
19081var parent = __webpack_require__(227);
19082
19083module.exports = parent;
19084
19085
19086/***/ }),
19087/* 520 */
19088/***/ (function(module, exports, __webpack_require__) {
19089
19090module.exports = __webpack_require__(521);
19091
19092/***/ }),
19093/* 521 */
19094/***/ (function(module, exports, __webpack_require__) {
19095
19096module.exports = __webpack_require__(522);
19097
19098
19099/***/ }),
19100/* 522 */
19101/***/ (function(module, exports, __webpack_require__) {
19102
19103var parent = __webpack_require__(523);
19104
19105module.exports = parent;
19106
19107
19108/***/ }),
19109/* 523 */
19110/***/ (function(module, exports, __webpack_require__) {
19111
19112var parent = __webpack_require__(237);
19113
19114module.exports = parent;
19115
19116
19117/***/ }),
19118/* 524 */
19119/***/ (function(module, exports) {
19120
19121function _arrayLikeToArray(arr, len) {
19122 if (len == null || len > arr.length) len = arr.length;
19123
19124 for (var i = 0, arr2 = new Array(len); i < len; i++) {
19125 arr2[i] = arr[i];
19126 }
19127
19128 return arr2;
19129}
19130
19131module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
19132
19133/***/ }),
19134/* 525 */
19135/***/ (function(module, exports) {
19136
19137function _nonIterableRest() {
19138 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
19139}
19140
19141module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
19142
19143/***/ }),
19144/* 526 */
19145/***/ (function(module, exports, __webpack_require__) {
19146
19147module.exports = __webpack_require__(527);
19148
19149/***/ }),
19150/* 527 */
19151/***/ (function(module, exports, __webpack_require__) {
19152
19153var parent = __webpack_require__(528);
19154
19155module.exports = parent;
19156
19157
19158/***/ }),
19159/* 528 */
19160/***/ (function(module, exports, __webpack_require__) {
19161
19162__webpack_require__(529);
19163var path = __webpack_require__(15);
19164
19165var Object = path.Object;
19166
19167var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
19168 return Object.getOwnPropertyDescriptor(it, key);
19169};
19170
19171if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
19172
19173
19174/***/ }),
19175/* 529 */
19176/***/ (function(module, exports, __webpack_require__) {
19177
19178var $ = __webpack_require__(0);
19179var fails = __webpack_require__(3);
19180var toIndexedObject = __webpack_require__(35);
19181var nativeGetOwnPropertyDescriptor = __webpack_require__(73).f;
19182var DESCRIPTORS = __webpack_require__(20);
19183
19184var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
19185var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
19186
19187// `Object.getOwnPropertyDescriptor` method
19188// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
19189$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
19190 getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
19191 return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
19192 }
19193});
19194
19195
19196/***/ }),
19197/* 530 */
19198/***/ (function(module, exports, __webpack_require__) {
19199
19200"use strict";
19201
19202
19203var _ = __webpack_require__(2);
19204
19205var AVError = __webpack_require__(43);
19206
19207module.exports = function (AV) {
19208 AV.Role = AV.Object.extend('_Role',
19209 /** @lends AV.Role.prototype */
19210 {
19211 // Instance Methods
19212
19213 /**
19214 * Represents a Role on the AV server. Roles represent groupings of
19215 * Users for the purposes of granting permissions (e.g. specifying an ACL
19216 * for an Object). Roles are specified by their sets of child users and
19217 * child roles, all of which are granted any permissions that the parent
19218 * role has.
19219 *
19220 * <p>Roles must have a name (which cannot be changed after creation of the
19221 * role), and must specify an ACL.</p>
19222 * An AV.Role is a local representation of a role persisted to the AV
19223 * cloud.
19224 * @class AV.Role
19225 * @param {String} name The name of the Role to create.
19226 * @param {AV.ACL} acl The ACL for this role.
19227 */
19228 constructor: function constructor(name, acl) {
19229 if (_.isString(name)) {
19230 AV.Object.prototype.constructor.call(this, null, null);
19231 this.setName(name);
19232 } else {
19233 AV.Object.prototype.constructor.call(this, name, acl);
19234 }
19235
19236 if (acl) {
19237 if (!(acl instanceof AV.ACL)) {
19238 throw new TypeError('acl must be an instance of AV.ACL');
19239 } else {
19240 this.setACL(acl);
19241 }
19242 }
19243 },
19244
19245 /**
19246 * Gets the name of the role. You can alternatively call role.get("name")
19247 *
19248 * @return {String} the name of the role.
19249 */
19250 getName: function getName() {
19251 return this.get('name');
19252 },
19253
19254 /**
19255 * Sets the name for a role. This value must be set before the role has
19256 * been saved to the server, and cannot be set once the role has been
19257 * saved.
19258 *
19259 * <p>
19260 * A role's name can only contain alphanumeric characters, _, -, and
19261 * spaces.
19262 * </p>
19263 *
19264 * <p>This is equivalent to calling role.set("name", name)</p>
19265 *
19266 * @param {String} name The name of the role.
19267 */
19268 setName: function setName(name, options) {
19269 return this.set('name', name, options);
19270 },
19271
19272 /**
19273 * Gets the AV.Relation for the AV.Users that are direct
19274 * children of this role. These users are granted any privileges that this
19275 * role has been granted (e.g. read or write access through ACLs). You can
19276 * add or remove users from the role through this relation.
19277 *
19278 * <p>This is equivalent to calling role.relation("users")</p>
19279 *
19280 * @return {AV.Relation} the relation for the users belonging to this
19281 * role.
19282 */
19283 getUsers: function getUsers() {
19284 return this.relation('users');
19285 },
19286
19287 /**
19288 * Gets the AV.Relation for the AV.Roles that are direct
19289 * children of this role. These roles' users are granted any privileges that
19290 * this role has been granted (e.g. read or write access through ACLs). You
19291 * can add or remove child roles from this role through this relation.
19292 *
19293 * <p>This is equivalent to calling role.relation("roles")</p>
19294 *
19295 * @return {AV.Relation} the relation for the roles belonging to this
19296 * role.
19297 */
19298 getRoles: function getRoles() {
19299 return this.relation('roles');
19300 },
19301
19302 /**
19303 * @ignore
19304 */
19305 validate: function validate(attrs, options) {
19306 if ('name' in attrs && attrs.name !== this.getName()) {
19307 var newName = attrs.name;
19308
19309 if (this.id && this.id !== attrs.objectId) {
19310 // Check to see if the objectId being set matches this.id.
19311 // This happens during a fetch -- the id is set before calling fetch.
19312 // Let the name be set in this case.
19313 return new AVError(AVError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
19314 }
19315
19316 if (!_.isString(newName)) {
19317 return new AVError(AVError.OTHER_CAUSE, "A role's name must be a String.");
19318 }
19319
19320 if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
19321 return new AVError(AVError.OTHER_CAUSE, "A role's name can only contain alphanumeric characters, _," + ' -, and spaces.');
19322 }
19323 }
19324
19325 if (AV.Object.prototype.validate) {
19326 return AV.Object.prototype.validate.call(this, attrs, options);
19327 }
19328
19329 return false;
19330 }
19331 });
19332};
19333
19334/***/ }),
19335/* 531 */
19336/***/ (function(module, exports, __webpack_require__) {
19337
19338"use strict";
19339
19340
19341var _interopRequireDefault = __webpack_require__(1);
19342
19343var _defineProperty2 = _interopRequireDefault(__webpack_require__(532));
19344
19345var _promise = _interopRequireDefault(__webpack_require__(10));
19346
19347var _map = _interopRequireDefault(__webpack_require__(42));
19348
19349var _find = _interopRequireDefault(__webpack_require__(107));
19350
19351var _stringify = _interopRequireDefault(__webpack_require__(37));
19352
19353var _ = __webpack_require__(2);
19354
19355var uuid = __webpack_require__(219);
19356
19357var AVError = __webpack_require__(43);
19358
19359var _require = __webpack_require__(27),
19360 AVRequest = _require._request,
19361 request = _require.request;
19362
19363var _require2 = __webpack_require__(70),
19364 getAdapter = _require2.getAdapter;
19365
19366var PLATFORM_ANONYMOUS = 'anonymous';
19367var PLATFORM_QQAPP = 'lc_qqapp';
19368
19369var mergeUnionDataIntoAuthData = function mergeUnionDataIntoAuthData() {
19370 var defaultUnionIdPlatform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'weixin';
19371 return function (authData, unionId) {
19372 var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
19373 _ref$unionIdPlatform = _ref.unionIdPlatform,
19374 unionIdPlatform = _ref$unionIdPlatform === void 0 ? defaultUnionIdPlatform : _ref$unionIdPlatform,
19375 _ref$asMainAccount = _ref.asMainAccount,
19376 asMainAccount = _ref$asMainAccount === void 0 ? false : _ref$asMainAccount;
19377
19378 if (typeof unionId !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionId is not a string');
19379 if (typeof unionIdPlatform !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionIdPlatform is not a string');
19380 return _.extend({}, authData, {
19381 platform: unionIdPlatform,
19382 unionid: unionId,
19383 main_account: Boolean(asMainAccount)
19384 });
19385 };
19386};
19387
19388module.exports = function (AV) {
19389 /**
19390 * @class
19391 *
19392 * <p>An AV.User object is a local representation of a user persisted to the
19393 * LeanCloud server. This class is a subclass of an AV.Object, and retains the
19394 * same functionality of an AV.Object, but also extends it with various
19395 * user specific methods, like authentication, signing up, and validation of
19396 * uniqueness.</p>
19397 */
19398 AV.User = AV.Object.extend('_User',
19399 /** @lends AV.User.prototype */
19400 {
19401 // Instance Variables
19402 _isCurrentUser: false,
19403 // Instance Methods
19404
19405 /**
19406 * Internal method to handle special fields in a _User response.
19407 * @private
19408 */
19409 _mergeMagicFields: function _mergeMagicFields(attrs) {
19410 if (attrs.sessionToken) {
19411 this._sessionToken = attrs.sessionToken;
19412 delete attrs.sessionToken;
19413 }
19414
19415 return AV.User.__super__._mergeMagicFields.call(this, attrs);
19416 },
19417
19418 /**
19419 * Removes null values from authData (which exist temporarily for
19420 * unlinking)
19421 * @private
19422 */
19423 _cleanupAuthData: function _cleanupAuthData() {
19424 if (!this.isCurrent()) {
19425 return;
19426 }
19427
19428 var authData = this.get('authData');
19429
19430 if (!authData) {
19431 return;
19432 }
19433
19434 AV._objectEach(this.get('authData'), function (value, key) {
19435 if (!authData[key]) {
19436 delete authData[key];
19437 }
19438 });
19439 },
19440
19441 /**
19442 * Synchronizes authData for all providers.
19443 * @private
19444 */
19445 _synchronizeAllAuthData: function _synchronizeAllAuthData() {
19446 var authData = this.get('authData');
19447
19448 if (!authData) {
19449 return;
19450 }
19451
19452 var self = this;
19453
19454 AV._objectEach(this.get('authData'), function (value, key) {
19455 self._synchronizeAuthData(key);
19456 });
19457 },
19458
19459 /**
19460 * Synchronizes auth data for a provider (e.g. puts the access token in the
19461 * right place to be used by the Facebook SDK).
19462 * @private
19463 */
19464 _synchronizeAuthData: function _synchronizeAuthData(provider) {
19465 if (!this.isCurrent()) {
19466 return;
19467 }
19468
19469 var authType;
19470
19471 if (_.isString(provider)) {
19472 authType = provider;
19473 provider = AV.User._authProviders[authType];
19474 } else {
19475 authType = provider.getAuthType();
19476 }
19477
19478 var authData = this.get('authData');
19479
19480 if (!authData || !provider) {
19481 return;
19482 }
19483
19484 var success = provider.restoreAuthentication(authData[authType]);
19485
19486 if (!success) {
19487 this.dissociateAuthData(provider);
19488 }
19489 },
19490 _handleSaveResult: function _handleSaveResult(makeCurrent) {
19491 // Clean up and synchronize the authData object, removing any unset values
19492 if (makeCurrent && !AV._config.disableCurrentUser) {
19493 this._isCurrentUser = true;
19494 }
19495
19496 this._cleanupAuthData();
19497
19498 this._synchronizeAllAuthData(); // Don't keep the password around.
19499
19500
19501 delete this._serverData.password;
19502
19503 this._rebuildEstimatedDataForKey('password');
19504
19505 this._refreshCache();
19506
19507 if ((makeCurrent || this.isCurrent()) && !AV._config.disableCurrentUser) {
19508 // Some old version of leanengine-node-sdk will overwrite
19509 // AV.User._saveCurrentUser which returns no Promise.
19510 // So we need a Promise wrapper.
19511 return _promise.default.resolve(AV.User._saveCurrentUser(this));
19512 } else {
19513 return _promise.default.resolve();
19514 }
19515 },
19516
19517 /**
19518 * Unlike in the Android/iOS SDKs, logInWith is unnecessary, since you can
19519 * call linkWith on the user (even if it doesn't exist yet on the server).
19520 * @private
19521 */
19522 _linkWith: function _linkWith(provider, data) {
19523 var _this = this;
19524
19525 var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
19526 _ref2$failOnNotExist = _ref2.failOnNotExist,
19527 failOnNotExist = _ref2$failOnNotExist === void 0 ? false : _ref2$failOnNotExist;
19528
19529 var authType;
19530
19531 if (_.isString(provider)) {
19532 authType = provider;
19533 provider = AV.User._authProviders[provider];
19534 } else {
19535 authType = provider.getAuthType();
19536 }
19537
19538 if (data) {
19539 return this.save({
19540 authData: (0, _defineProperty2.default)({}, authType, data)
19541 }, {
19542 fetchWhenSave: !!this.get('authData'),
19543 _failOnNotExist: failOnNotExist
19544 }).then(function (model) {
19545 return model._handleSaveResult(true).then(function () {
19546 return model;
19547 });
19548 });
19549 } else {
19550 return provider.authenticate().then(function (result) {
19551 return _this._linkWith(provider, result);
19552 });
19553 }
19554 },
19555
19556 /**
19557 * Associate the user with a third party authData.
19558 * @since 3.3.0
19559 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
19560 * @param {string} platform Available platform for sign up.
19561 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
19562 * @example user.associateWithAuthData({
19563 * openid: 'abc123',
19564 * access_token: '123abc',
19565 * expires_in: 1382686496
19566 * }, 'weixin').then(function(user) {
19567 * //Access user here
19568 * }).catch(function(error) {
19569 * //console.error("error: ", error);
19570 * });
19571 */
19572 associateWithAuthData: function associateWithAuthData(authData, platform) {
19573 return this._linkWith(platform, authData);
19574 },
19575
19576 /**
19577 * Associate the user with a third party authData and unionId.
19578 * @since 3.5.0
19579 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
19580 * @param {string} platform Available platform for sign up.
19581 * @param {string} unionId
19582 * @param {Object} [unionLoginOptions]
19583 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
19584 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19585 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
19586 * @example user.associateWithAuthDataAndUnionId({
19587 * openid: 'abc123',
19588 * access_token: '123abc',
19589 * expires_in: 1382686496
19590 * }, 'weixin', 'union123', {
19591 * unionIdPlatform: 'weixin',
19592 * asMainAccount: true,
19593 * }).then(function(user) {
19594 * //Access user here
19595 * }).catch(function(error) {
19596 * //console.error("error: ", error);
19597 * });
19598 */
19599 associateWithAuthDataAndUnionId: function associateWithAuthDataAndUnionId(authData, platform, unionId, unionOptions) {
19600 return this._linkWith(platform, mergeUnionDataIntoAuthData()(authData, unionId, unionOptions));
19601 },
19602
19603 /**
19604 * Associate the user with the identity of the current mini-app.
19605 * @since 4.6.0
19606 * @param {Object} [authInfo]
19607 * @param {Object} [option]
19608 * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
19609 * @return {Promise<AV.User>}
19610 */
19611 associateWithMiniApp: function associateWithMiniApp(authInfo, option) {
19612 var _this2 = this;
19613
19614 if (authInfo === undefined) {
19615 var getAuthInfo = getAdapter('getAuthInfo');
19616 return getAuthInfo().then(function (authInfo) {
19617 return _this2._linkWith(authInfo.provider, authInfo.authData, option);
19618 });
19619 }
19620
19621 return this._linkWith(authInfo.provider, authInfo.authData, option);
19622 },
19623
19624 /**
19625 * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的微信帐号。
19626 * 仅在 QQ 小程序中可用。
19627 *
19628 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19629 * @since 4.2.0
19630 * @param {Object} [options]
19631 * @param {boolean} [options.preferUnionId = false] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
19632 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
19633 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19634 * @return {Promise<AV.User>}
19635 */
19636 associateWithQQApp: function associateWithQQApp() {
19637 var _this3 = this;
19638
19639 var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19640 _ref3$preferUnionId = _ref3.preferUnionId,
19641 preferUnionId = _ref3$preferUnionId === void 0 ? false : _ref3$preferUnionId,
19642 _ref3$unionIdPlatform = _ref3.unionIdPlatform,
19643 unionIdPlatform = _ref3$unionIdPlatform === void 0 ? 'qq' : _ref3$unionIdPlatform,
19644 _ref3$asMainAccount = _ref3.asMainAccount,
19645 asMainAccount = _ref3$asMainAccount === void 0 ? true : _ref3$asMainAccount;
19646
19647 var getAuthInfo = getAdapter('getAuthInfo');
19648 return getAuthInfo({
19649 preferUnionId: preferUnionId,
19650 asMainAccount: asMainAccount,
19651 platform: unionIdPlatform
19652 }).then(function (authInfo) {
19653 authInfo.provider = PLATFORM_QQAPP;
19654 return _this3.associateWithMiniApp(authInfo);
19655 });
19656 },
19657
19658 /**
19659 * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
19660 * 仅在微信小程序中可用。
19661 *
19662 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19663 * @since 3.13.0
19664 * @param {Object} [options]
19665 * @param {boolean} [options.preferUnionId = false] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否将 UnionId 保存在用户账号中。
19666 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
19667 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19668 * @return {Promise<AV.User>}
19669 */
19670 associateWithWeapp: function associateWithWeapp() {
19671 var _this4 = this;
19672
19673 var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19674 _ref4$preferUnionId = _ref4.preferUnionId,
19675 preferUnionId = _ref4$preferUnionId === void 0 ? false : _ref4$preferUnionId,
19676 _ref4$unionIdPlatform = _ref4.unionIdPlatform,
19677 unionIdPlatform = _ref4$unionIdPlatform === void 0 ? 'weixin' : _ref4$unionIdPlatform,
19678 _ref4$asMainAccount = _ref4.asMainAccount,
19679 asMainAccount = _ref4$asMainAccount === void 0 ? true : _ref4$asMainAccount;
19680
19681 var getAuthInfo = getAdapter('getAuthInfo');
19682 return getAuthInfo({
19683 preferUnionId: preferUnionId,
19684 asMainAccount: asMainAccount,
19685 platform: unionIdPlatform
19686 }).then(function (authInfo) {
19687 return _this4.associateWithMiniApp(authInfo);
19688 });
19689 },
19690
19691 /**
19692 * @deprecated renamed to {@link AV.User#associateWithWeapp}
19693 * @return {Promise<AV.User>}
19694 */
19695 linkWithWeapp: function linkWithWeapp(options) {
19696 console.warn('DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替');
19697 return this.associateWithWeapp(options);
19698 },
19699
19700 /**
19701 * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的 QQ 帐号。
19702 * 仅在 QQ 小程序中可用。
19703 *
19704 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19705 * @since 4.2.0
19706 * @param {string} unionId
19707 * @param {Object} [unionOptions]
19708 * @param {string} [unionOptions.unionIdPlatform = 'qq'] unionId platform
19709 * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19710 * @return {Promise<AV.User>}
19711 */
19712 associateWithQQAppWithUnionId: function associateWithQQAppWithUnionId(unionId) {
19713 var _this5 = this;
19714
19715 var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19716 _ref5$unionIdPlatform = _ref5.unionIdPlatform,
19717 unionIdPlatform = _ref5$unionIdPlatform === void 0 ? 'qq' : _ref5$unionIdPlatform,
19718 _ref5$asMainAccount = _ref5.asMainAccount,
19719 asMainAccount = _ref5$asMainAccount === void 0 ? false : _ref5$asMainAccount;
19720
19721 var getAuthInfo = getAdapter('getAuthInfo');
19722 return getAuthInfo({
19723 platform: unionIdPlatform
19724 }).then(function (authInfo) {
19725 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19726 asMainAccount: asMainAccount
19727 });
19728 authInfo.provider = PLATFORM_QQAPP;
19729 return _this5.associateWithMiniApp(authInfo);
19730 });
19731 },
19732
19733 /**
19734 * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
19735 * 仅在微信小程序中可用。
19736 *
19737 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19738 * @since 3.13.0
19739 * @param {string} unionId
19740 * @param {Object} [unionOptions]
19741 * @param {string} [unionOptions.unionIdPlatform = 'weixin'] unionId platform
19742 * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19743 * @return {Promise<AV.User>}
19744 */
19745 associateWithWeappWithUnionId: function associateWithWeappWithUnionId(unionId) {
19746 var _this6 = this;
19747
19748 var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19749 _ref6$unionIdPlatform = _ref6.unionIdPlatform,
19750 unionIdPlatform = _ref6$unionIdPlatform === void 0 ? 'weixin' : _ref6$unionIdPlatform,
19751 _ref6$asMainAccount = _ref6.asMainAccount,
19752 asMainAccount = _ref6$asMainAccount === void 0 ? false : _ref6$asMainAccount;
19753
19754 var getAuthInfo = getAdapter('getAuthInfo');
19755 return getAuthInfo({
19756 platform: unionIdPlatform
19757 }).then(function (authInfo) {
19758 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19759 asMainAccount: asMainAccount
19760 });
19761 return _this6.associateWithMiniApp(authInfo);
19762 });
19763 },
19764
19765 /**
19766 * Unlinks a user from a service.
19767 * @param {string} platform
19768 * @return {Promise<AV.User>}
19769 * @since 3.3.0
19770 */
19771 dissociateAuthData: function dissociateAuthData(provider) {
19772 this.unset("authData.".concat(provider));
19773 return this.save().then(function (model) {
19774 return model._handleSaveResult(true).then(function () {
19775 return model;
19776 });
19777 });
19778 },
19779
19780 /**
19781 * @private
19782 * @deprecated
19783 */
19784 _unlinkFrom: function _unlinkFrom(provider) {
19785 console.warn('DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替');
19786 return this.dissociateAuthData(provider);
19787 },
19788
19789 /**
19790 * Checks whether a user is linked to a service.
19791 * @private
19792 */
19793 _isLinked: function _isLinked(provider) {
19794 var authType;
19795
19796 if (_.isString(provider)) {
19797 authType = provider;
19798 } else {
19799 authType = provider.getAuthType();
19800 }
19801
19802 var authData = this.get('authData') || {};
19803 return !!authData[authType];
19804 },
19805
19806 /**
19807 * Checks whether a user is anonymous.
19808 * @since 3.9.0
19809 * @return {boolean}
19810 */
19811 isAnonymous: function isAnonymous() {
19812 return this._isLinked(PLATFORM_ANONYMOUS);
19813 },
19814 logOut: function logOut() {
19815 this._logOutWithAll();
19816
19817 this._isCurrentUser = false;
19818 },
19819
19820 /**
19821 * Deauthenticates all providers.
19822 * @private
19823 */
19824 _logOutWithAll: function _logOutWithAll() {
19825 var authData = this.get('authData');
19826
19827 if (!authData) {
19828 return;
19829 }
19830
19831 var self = this;
19832
19833 AV._objectEach(this.get('authData'), function (value, key) {
19834 self._logOutWith(key);
19835 });
19836 },
19837
19838 /**
19839 * Deauthenticates a single provider (e.g. removing access tokens from the
19840 * Facebook SDK).
19841 * @private
19842 */
19843 _logOutWith: function _logOutWith(provider) {
19844 if (!this.isCurrent()) {
19845 return;
19846 }
19847
19848 if (_.isString(provider)) {
19849 provider = AV.User._authProviders[provider];
19850 }
19851
19852 if (provider && provider.deauthenticate) {
19853 provider.deauthenticate();
19854 }
19855 },
19856
19857 /**
19858 * Signs up a new user. You should call this instead of save for
19859 * new AV.Users. This will create a new AV.User on the server, and
19860 * also persist the session on disk so that you can access the user using
19861 * <code>current</code>.
19862 *
19863 * <p>A username and password must be set before calling signUp.</p>
19864 *
19865 * @param {Object} attrs Extra fields to set on the new user, or null.
19866 * @param {AuthOptions} options
19867 * @return {Promise} A promise that is fulfilled when the signup
19868 * finishes.
19869 * @see AV.User.signUp
19870 */
19871 signUp: function signUp(attrs, options) {
19872 var error;
19873 var username = attrs && attrs.username || this.get('username');
19874
19875 if (!username || username === '') {
19876 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty name.');
19877 throw error;
19878 }
19879
19880 var password = attrs && attrs.password || this.get('password');
19881
19882 if (!password || password === '') {
19883 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty password.');
19884 throw error;
19885 }
19886
19887 return this.save(attrs, options).then(function (model) {
19888 if (model.isAnonymous()) {
19889 model.unset("authData.".concat(PLATFORM_ANONYMOUS));
19890 model._opSetQueue = [{}];
19891 }
19892
19893 return model._handleSaveResult(true).then(function () {
19894 return model;
19895 });
19896 });
19897 },
19898
19899 /**
19900 * Signs up a new user with mobile phone and sms code.
19901 * You should call this instead of save for
19902 * new AV.Users. This will create a new AV.User on the server, and
19903 * also persist the session on disk so that you can access the user using
19904 * <code>current</code>.
19905 *
19906 * <p>A username and password must be set before calling signUp.</p>
19907 *
19908 * @param {Object} attrs Extra fields to set on the new user, or null.
19909 * @param {AuthOptions} options
19910 * @return {Promise} A promise that is fulfilled when the signup
19911 * finishes.
19912 * @see AV.User.signUpOrlogInWithMobilePhone
19913 * @see AV.Cloud.requestSmsCode
19914 */
19915 signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(attrs) {
19916 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
19917 var error;
19918 var mobilePhoneNumber = attrs && attrs.mobilePhoneNumber || this.get('mobilePhoneNumber');
19919
19920 if (!mobilePhoneNumber || mobilePhoneNumber === '') {
19921 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty mobilePhoneNumber.');
19922 throw error;
19923 }
19924
19925 var smsCode = attrs && attrs.smsCode || this.get('smsCode');
19926
19927 if (!smsCode || smsCode === '') {
19928 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty smsCode.');
19929 throw error;
19930 }
19931
19932 options._makeRequest = function (route, className, id, method, json) {
19933 return AVRequest('usersByMobilePhone', null, null, 'POST', json);
19934 };
19935
19936 return this.save(attrs, options).then(function (model) {
19937 delete model.attributes.smsCode;
19938 delete model._serverData.smsCode;
19939 return model._handleSaveResult(true).then(function () {
19940 return model;
19941 });
19942 });
19943 },
19944
19945 /**
19946 * The same with {@link AV.User.loginWithAuthData}, except that you can set attributes before login.
19947 * @since 3.7.0
19948 */
19949 loginWithAuthData: function loginWithAuthData(authData, platform, options) {
19950 return this._linkWith(platform, authData, options);
19951 },
19952
19953 /**
19954 * The same with {@link AV.User.loginWithAuthDataAndUnionId}, except that you can set attributes before login.
19955 * @since 3.7.0
19956 */
19957 loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
19958 return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
19959 },
19960
19961 /**
19962 * The same with {@link AV.User.loginWithWeapp}, except that you can set attributes before login.
19963 * @deprecated please use {@link AV.User#loginWithMiniApp}
19964 * @since 3.7.0
19965 * @param {Object} [options]
19966 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
19967 * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
19968 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
19969 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19970 * @return {Promise<AV.User>}
19971 */
19972 loginWithWeapp: function loginWithWeapp() {
19973 var _this7 = this;
19974
19975 var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19976 _ref7$preferUnionId = _ref7.preferUnionId,
19977 preferUnionId = _ref7$preferUnionId === void 0 ? false : _ref7$preferUnionId,
19978 _ref7$unionIdPlatform = _ref7.unionIdPlatform,
19979 unionIdPlatform = _ref7$unionIdPlatform === void 0 ? 'weixin' : _ref7$unionIdPlatform,
19980 _ref7$asMainAccount = _ref7.asMainAccount,
19981 asMainAccount = _ref7$asMainAccount === void 0 ? true : _ref7$asMainAccount,
19982 _ref7$failOnNotExist = _ref7.failOnNotExist,
19983 failOnNotExist = _ref7$failOnNotExist === void 0 ? false : _ref7$failOnNotExist;
19984
19985 var getAuthInfo = getAdapter('getAuthInfo');
19986 return getAuthInfo({
19987 preferUnionId: preferUnionId,
19988 asMainAccount: asMainAccount,
19989 platform: unionIdPlatform
19990 }).then(function (authInfo) {
19991 return _this7.loginWithMiniApp(authInfo, {
19992 failOnNotExist: failOnNotExist
19993 });
19994 });
19995 },
19996
19997 /**
19998 * The same with {@link AV.User.loginWithWeappWithUnionId}, except that you can set attributes before login.
19999 * @deprecated please use {@link AV.User#loginWithMiniApp}
20000 * @since 3.13.0
20001 */
20002 loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
20003 var _this8 = this;
20004
20005 var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20006 _ref8$unionIdPlatform = _ref8.unionIdPlatform,
20007 unionIdPlatform = _ref8$unionIdPlatform === void 0 ? 'weixin' : _ref8$unionIdPlatform,
20008 _ref8$asMainAccount = _ref8.asMainAccount,
20009 asMainAccount = _ref8$asMainAccount === void 0 ? false : _ref8$asMainAccount,
20010 _ref8$failOnNotExist = _ref8.failOnNotExist,
20011 failOnNotExist = _ref8$failOnNotExist === void 0 ? false : _ref8$failOnNotExist;
20012
20013 var getAuthInfo = getAdapter('getAuthInfo');
20014 return getAuthInfo({
20015 platform: unionIdPlatform
20016 }).then(function (authInfo) {
20017 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20018 asMainAccount: asMainAccount
20019 });
20020 return _this8.loginWithMiniApp(authInfo, {
20021 failOnNotExist: failOnNotExist
20022 });
20023 });
20024 },
20025
20026 /**
20027 * The same with {@link AV.User.loginWithQQApp}, except that you can set attributes before login.
20028 * @deprecated please use {@link AV.User#loginWithMiniApp}
20029 * @since 4.2.0
20030 * @param {Object} [options]
20031 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20032 * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
20033 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
20034 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20035 */
20036 loginWithQQApp: function loginWithQQApp() {
20037 var _this9 = this;
20038
20039 var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20040 _ref9$preferUnionId = _ref9.preferUnionId,
20041 preferUnionId = _ref9$preferUnionId === void 0 ? false : _ref9$preferUnionId,
20042 _ref9$unionIdPlatform = _ref9.unionIdPlatform,
20043 unionIdPlatform = _ref9$unionIdPlatform === void 0 ? 'qq' : _ref9$unionIdPlatform,
20044 _ref9$asMainAccount = _ref9.asMainAccount,
20045 asMainAccount = _ref9$asMainAccount === void 0 ? true : _ref9$asMainAccount,
20046 _ref9$failOnNotExist = _ref9.failOnNotExist,
20047 failOnNotExist = _ref9$failOnNotExist === void 0 ? false : _ref9$failOnNotExist;
20048
20049 var getAuthInfo = getAdapter('getAuthInfo');
20050 return getAuthInfo({
20051 preferUnionId: preferUnionId,
20052 asMainAccount: asMainAccount,
20053 platform: unionIdPlatform
20054 }).then(function (authInfo) {
20055 authInfo.provider = PLATFORM_QQAPP;
20056 return _this9.loginWithMiniApp(authInfo, {
20057 failOnNotExist: failOnNotExist
20058 });
20059 });
20060 },
20061
20062 /**
20063 * The same with {@link AV.User.loginWithQQAppWithUnionId}, except that you can set attributes before login.
20064 * @deprecated please use {@link AV.User#loginWithMiniApp}
20065 * @since 4.2.0
20066 */
20067 loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
20068 var _this10 = this;
20069
20070 var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20071 _ref10$unionIdPlatfor = _ref10.unionIdPlatform,
20072 unionIdPlatform = _ref10$unionIdPlatfor === void 0 ? 'qq' : _ref10$unionIdPlatfor,
20073 _ref10$asMainAccount = _ref10.asMainAccount,
20074 asMainAccount = _ref10$asMainAccount === void 0 ? false : _ref10$asMainAccount,
20075 _ref10$failOnNotExist = _ref10.failOnNotExist,
20076 failOnNotExist = _ref10$failOnNotExist === void 0 ? false : _ref10$failOnNotExist;
20077
20078 var getAuthInfo = getAdapter('getAuthInfo');
20079 return getAuthInfo({
20080 platform: unionIdPlatform
20081 }).then(function (authInfo) {
20082 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20083 asMainAccount: asMainAccount
20084 });
20085 authInfo.provider = PLATFORM_QQAPP;
20086 return _this10.loginWithMiniApp(authInfo, {
20087 failOnNotExist: failOnNotExist
20088 });
20089 });
20090 },
20091
20092 /**
20093 * The same with {@link AV.User.loginWithMiniApp}, except that you can set attributes before login.
20094 * @since 4.6.0
20095 */
20096 loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
20097 var _this11 = this;
20098
20099 if (authInfo === undefined) {
20100 var getAuthInfo = getAdapter('getAuthInfo');
20101 return getAuthInfo().then(function (authInfo) {
20102 return _this11.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20103 });
20104 }
20105
20106 return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20107 },
20108
20109 /**
20110 * Logs in a AV.User. On success, this saves the session to localStorage,
20111 * so you can retrieve the currently logged in user using
20112 * <code>current</code>.
20113 *
20114 * <p>A username and password must be set before calling logIn.</p>
20115 *
20116 * @see AV.User.logIn
20117 * @return {Promise} A promise that is fulfilled with the user when
20118 * the login is complete.
20119 */
20120 logIn: function logIn() {
20121 var model = this;
20122 var request = AVRequest('login', null, null, 'POST', this.toJSON());
20123 return request.then(function (resp) {
20124 var serverAttrs = model.parse(resp);
20125
20126 model._finishFetch(serverAttrs);
20127
20128 return model._handleSaveResult(true).then(function () {
20129 if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
20130 return model;
20131 });
20132 });
20133 },
20134
20135 /**
20136 * @see AV.Object#save
20137 */
20138 save: function save(arg1, arg2, arg3) {
20139 var attrs, options;
20140
20141 if (_.isObject(arg1) || _.isNull(arg1) || _.isUndefined(arg1)) {
20142 attrs = arg1;
20143 options = arg2;
20144 } else {
20145 attrs = {};
20146 attrs[arg1] = arg2;
20147 options = arg3;
20148 }
20149
20150 options = options || {};
20151 return AV.Object.prototype.save.call(this, attrs, options).then(function (model) {
20152 return model._handleSaveResult(false).then(function () {
20153 return model;
20154 });
20155 });
20156 },
20157
20158 /**
20159 * Follow a user
20160 * @since 0.3.0
20161 * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
20162 * @param {AV.User | String} options.user The target user or user's objectId to follow.
20163 * @param {Object} [options.attributes] key-value attributes dictionary to be used as
20164 * conditions of followerQuery/followeeQuery.
20165 * @param {AuthOptions} [authOptions]
20166 */
20167 follow: function follow(options, authOptions) {
20168 if (!this.id) {
20169 throw new Error('Please signin.');
20170 }
20171
20172 var user;
20173 var attributes;
20174
20175 if (options.user) {
20176 user = options.user;
20177 attributes = options.attributes;
20178 } else {
20179 user = options;
20180 }
20181
20182 var userObjectId = _.isString(user) ? user : user.id;
20183
20184 if (!userObjectId) {
20185 throw new Error('Invalid target user.');
20186 }
20187
20188 var route = 'users/' + this.id + '/friendship/' + userObjectId;
20189 var request = AVRequest(route, null, null, 'POST', AV._encode(attributes), authOptions);
20190 return request;
20191 },
20192
20193 /**
20194 * Unfollow a user.
20195 * @since 0.3.0
20196 * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
20197 * @param {AV.User | String} options.user The target user or user's objectId to unfollow.
20198 * @param {AuthOptions} [authOptions]
20199 */
20200 unfollow: function unfollow(options, authOptions) {
20201 if (!this.id) {
20202 throw new Error('Please signin.');
20203 }
20204
20205 var user;
20206
20207 if (options.user) {
20208 user = options.user;
20209 } else {
20210 user = options;
20211 }
20212
20213 var userObjectId = _.isString(user) ? user : user.id;
20214
20215 if (!userObjectId) {
20216 throw new Error('Invalid target user.');
20217 }
20218
20219 var route = 'users/' + this.id + '/friendship/' + userObjectId;
20220 var request = AVRequest(route, null, null, 'DELETE', null, authOptions);
20221 return request;
20222 },
20223
20224 /**
20225 * Get the user's followers and followees.
20226 * @since 4.8.0
20227 * @param {Object} [options]
20228 * @param {Number} [options.skip]
20229 * @param {Number} [options.limit]
20230 * @param {AuthOptions} [authOptions]
20231 */
20232 getFollowersAndFollowees: function getFollowersAndFollowees(options, authOptions) {
20233 if (!this.id) {
20234 throw new Error('Please signin.');
20235 }
20236
20237 return request({
20238 method: 'GET',
20239 path: "/users/".concat(this.id, "/followersAndFollowees"),
20240 query: {
20241 skip: options && options.skip,
20242 limit: options && options.limit,
20243 include: 'follower,followee',
20244 keys: 'follower,followee'
20245 },
20246 authOptions: authOptions
20247 }).then(function (_ref11) {
20248 var followers = _ref11.followers,
20249 followees = _ref11.followees;
20250 return {
20251 followers: (0, _map.default)(followers).call(followers, function (_ref12) {
20252 var follower = _ref12.follower;
20253 return AV._decode(follower);
20254 }),
20255 followees: (0, _map.default)(followees).call(followees, function (_ref13) {
20256 var followee = _ref13.followee;
20257 return AV._decode(followee);
20258 })
20259 };
20260 });
20261 },
20262
20263 /**
20264 *Create a follower query to query the user's followers.
20265 * @since 0.3.0
20266 * @see AV.User#followerQuery
20267 */
20268 followerQuery: function followerQuery() {
20269 return AV.User.followerQuery(this.id);
20270 },
20271
20272 /**
20273 *Create a followee query to query the user's followees.
20274 * @since 0.3.0
20275 * @see AV.User#followeeQuery
20276 */
20277 followeeQuery: function followeeQuery() {
20278 return AV.User.followeeQuery(this.id);
20279 },
20280
20281 /**
20282 * @see AV.Object#fetch
20283 */
20284 fetch: function fetch(fetchOptions, options) {
20285 return AV.Object.prototype.fetch.call(this, fetchOptions, options).then(function (model) {
20286 return model._handleSaveResult(false).then(function () {
20287 return model;
20288 });
20289 });
20290 },
20291
20292 /**
20293 * Update user's new password safely based on old password.
20294 * @param {String} oldPassword the old password.
20295 * @param {String} newPassword the new password.
20296 * @param {AuthOptions} options
20297 */
20298 updatePassword: function updatePassword(oldPassword, newPassword, options) {
20299 var _this12 = this;
20300
20301 var route = 'users/' + this.id + '/updatePassword';
20302 var params = {
20303 old_password: oldPassword,
20304 new_password: newPassword
20305 };
20306 var request = AVRequest(route, null, null, 'PUT', params, options);
20307 return request.then(function (resp) {
20308 _this12._finishFetch(_this12.parse(resp));
20309
20310 return _this12._handleSaveResult(true).then(function () {
20311 return resp;
20312 });
20313 });
20314 },
20315
20316 /**
20317 * Returns true if <code>current</code> would return this user.
20318 * @see AV.User#current
20319 */
20320 isCurrent: function isCurrent() {
20321 return this._isCurrentUser;
20322 },
20323
20324 /**
20325 * Returns get("username").
20326 * @return {String}
20327 * @see AV.Object#get
20328 */
20329 getUsername: function getUsername() {
20330 return this.get('username');
20331 },
20332
20333 /**
20334 * Returns get("mobilePhoneNumber").
20335 * @return {String}
20336 * @see AV.Object#get
20337 */
20338 getMobilePhoneNumber: function getMobilePhoneNumber() {
20339 return this.get('mobilePhoneNumber');
20340 },
20341
20342 /**
20343 * Calls set("mobilePhoneNumber", phoneNumber, options) and returns the result.
20344 * @param {String} mobilePhoneNumber
20345 * @return {Boolean}
20346 * @see AV.Object#set
20347 */
20348 setMobilePhoneNumber: function setMobilePhoneNumber(phone, options) {
20349 return this.set('mobilePhoneNumber', phone, options);
20350 },
20351
20352 /**
20353 * Calls set("username", username, options) and returns the result.
20354 * @param {String} username
20355 * @return {Boolean}
20356 * @see AV.Object#set
20357 */
20358 setUsername: function setUsername(username, options) {
20359 return this.set('username', username, options);
20360 },
20361
20362 /**
20363 * Calls set("password", password, options) and returns the result.
20364 * @param {String} password
20365 * @return {Boolean}
20366 * @see AV.Object#set
20367 */
20368 setPassword: function setPassword(password, options) {
20369 return this.set('password', password, options);
20370 },
20371
20372 /**
20373 * Returns get("email").
20374 * @return {String}
20375 * @see AV.Object#get
20376 */
20377 getEmail: function getEmail() {
20378 return this.get('email');
20379 },
20380
20381 /**
20382 * Calls set("email", email, options) and returns the result.
20383 * @param {String} email
20384 * @param {AuthOptions} options
20385 * @return {Boolean}
20386 * @see AV.Object#set
20387 */
20388 setEmail: function setEmail(email, options) {
20389 return this.set('email', email, options);
20390 },
20391
20392 /**
20393 * Checks whether this user is the current user and has been authenticated.
20394 * @deprecated 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),
20395 * 如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id
20396 * @return (Boolean) whether this user is the current user and is logged in.
20397 */
20398 authenticated: function authenticated() {
20399 console.warn('DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。');
20400 return !!this._sessionToken && !AV._config.disableCurrentUser && AV.User.current() && AV.User.current().id === this.id;
20401 },
20402
20403 /**
20404 * Detects if current sessionToken is valid.
20405 *
20406 * @since 2.0.0
20407 * @return Promise.<Boolean>
20408 */
20409 isAuthenticated: function isAuthenticated() {
20410 var _this13 = this;
20411
20412 return _promise.default.resolve().then(function () {
20413 return !!_this13._sessionToken && AV.User._fetchUserBySessionToken(_this13._sessionToken).then(function () {
20414 return true;
20415 }, function (error) {
20416 if (error.code === 211) {
20417 return false;
20418 }
20419
20420 throw error;
20421 });
20422 });
20423 },
20424
20425 /**
20426 * Get sessionToken of current user.
20427 * @return {String} sessionToken
20428 */
20429 getSessionToken: function getSessionToken() {
20430 return this._sessionToken;
20431 },
20432
20433 /**
20434 * Refresh sessionToken of current user.
20435 * @since 2.1.0
20436 * @param {AuthOptions} [options]
20437 * @return {Promise.<AV.User>} user with refreshed sessionToken
20438 */
20439 refreshSessionToken: function refreshSessionToken(options) {
20440 var _this14 = this;
20441
20442 return AVRequest("users/".concat(this.id, "/refreshSessionToken"), null, null, 'PUT', null, options).then(function (response) {
20443 _this14._finishFetch(response);
20444
20445 return _this14._handleSaveResult(true).then(function () {
20446 return _this14;
20447 });
20448 });
20449 },
20450
20451 /**
20452 * Get this user's Roles.
20453 * @param {AuthOptions} [options]
20454 * @return {Promise.<AV.Role[]>} A promise that is fulfilled with the roles when
20455 * the query is complete.
20456 */
20457 getRoles: function getRoles(options) {
20458 var _context;
20459
20460 return (0, _find.default)(_context = AV.Relation.reverseQuery('_Role', 'users', this)).call(_context, options);
20461 }
20462 },
20463 /** @lends AV.User */
20464 {
20465 // Class Variables
20466 // The currently logged-in user.
20467 _currentUser: null,
20468 // Whether currentUser is known to match the serialized version on disk.
20469 // This is useful for saving a localstorage check if you try to load
20470 // _currentUser frequently while there is none stored.
20471 _currentUserMatchesDisk: false,
20472 // The localStorage key suffix that the current user is stored under.
20473 _CURRENT_USER_KEY: 'currentUser',
20474 // The mapping of auth provider names to actual providers
20475 _authProviders: {},
20476 // Class Methods
20477
20478 /**
20479 * Signs up a new user with a username (or email) and password.
20480 * This will create a new AV.User on the server, and also persist the
20481 * session in localStorage so that you can access the user using
20482 * {@link #current}.
20483 *
20484 * @param {String} username The username (or email) to sign up with.
20485 * @param {String} password The password to sign up with.
20486 * @param {Object} [attrs] Extra fields to set on the new user.
20487 * @param {AuthOptions} [options]
20488 * @return {Promise} A promise that is fulfilled with the user when
20489 * the signup completes.
20490 * @see AV.User#signUp
20491 */
20492 signUp: function signUp(username, password, attrs, options) {
20493 attrs = attrs || {};
20494 attrs.username = username;
20495 attrs.password = password;
20496
20497 var user = AV.Object._create('_User');
20498
20499 return user.signUp(attrs, options);
20500 },
20501
20502 /**
20503 * Logs in a user with a username (or email) and password. On success, this
20504 * saves the session to disk, so you can retrieve the currently logged in
20505 * user using <code>current</code>.
20506 *
20507 * @param {String} username The username (or email) to log in with.
20508 * @param {String} password The password to log in with.
20509 * @return {Promise} A promise that is fulfilled with the user when
20510 * the login completes.
20511 * @see AV.User#logIn
20512 */
20513 logIn: function logIn(username, password) {
20514 var user = AV.Object._create('_User');
20515
20516 user._finishFetch({
20517 username: username,
20518 password: password
20519 });
20520
20521 return user.logIn();
20522 },
20523
20524 /**
20525 * Logs in a user with a session token. On success, this saves the session
20526 * to disk, so you can retrieve the currently logged in user using
20527 * <code>current</code>.
20528 *
20529 * @param {String} sessionToken The sessionToken to log in with.
20530 * @return {Promise} A promise that is fulfilled with the user when
20531 * the login completes.
20532 */
20533 become: function become(sessionToken) {
20534 return this._fetchUserBySessionToken(sessionToken).then(function (user) {
20535 return user._handleSaveResult(true).then(function () {
20536 return user;
20537 });
20538 });
20539 },
20540 _fetchUserBySessionToken: function _fetchUserBySessionToken(sessionToken) {
20541 if (sessionToken === undefined) {
20542 return _promise.default.reject(new Error('The sessionToken cannot be undefined'));
20543 }
20544
20545 var user = AV.Object._create('_User');
20546
20547 return request({
20548 method: 'GET',
20549 path: '/users/me',
20550 authOptions: {
20551 sessionToken: sessionToken
20552 }
20553 }).then(function (resp) {
20554 var serverAttrs = user.parse(resp);
20555
20556 user._finishFetch(serverAttrs);
20557
20558 return user;
20559 });
20560 },
20561
20562 /**
20563 * Logs in a user with a mobile phone number and sms code sent by
20564 * AV.User.requestLoginSmsCode.On success, this
20565 * saves the session to disk, so you can retrieve the currently logged in
20566 * user using <code>current</code>.
20567 *
20568 * @param {String} mobilePhone The user's mobilePhoneNumber
20569 * @param {String} smsCode The sms code sent by AV.User.requestLoginSmsCode
20570 * @return {Promise} A promise that is fulfilled with the user when
20571 * the login completes.
20572 * @see AV.User#logIn
20573 */
20574 logInWithMobilePhoneSmsCode: function logInWithMobilePhoneSmsCode(mobilePhone, smsCode) {
20575 var user = AV.Object._create('_User');
20576
20577 user._finishFetch({
20578 mobilePhoneNumber: mobilePhone,
20579 smsCode: smsCode
20580 });
20581
20582 return user.logIn();
20583 },
20584
20585 /**
20586 * Signs up or logs in a user with a mobilePhoneNumber and smsCode.
20587 * On success, this saves the session to disk, so you can retrieve the currently
20588 * logged in user using <code>current</code>.
20589 *
20590 * @param {String} mobilePhoneNumber The user's mobilePhoneNumber.
20591 * @param {String} smsCode The sms code sent by AV.Cloud.requestSmsCode
20592 * @param {Object} attributes The user's other attributes such as username etc.
20593 * @param {AuthOptions} options
20594 * @return {Promise} A promise that is fulfilled with the user when
20595 * the login completes.
20596 * @see AV.User#signUpOrlogInWithMobilePhone
20597 * @see AV.Cloud.requestSmsCode
20598 */
20599 signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attrs, options) {
20600 attrs = attrs || {};
20601 attrs.mobilePhoneNumber = mobilePhoneNumber;
20602 attrs.smsCode = smsCode;
20603
20604 var user = AV.Object._create('_User');
20605
20606 return user.signUpOrlogInWithMobilePhone(attrs, options);
20607 },
20608
20609 /**
20610 * Logs in a user with a mobile phone number and password. On success, this
20611 * saves the session to disk, so you can retrieve the currently logged in
20612 * user using <code>current</code>.
20613 *
20614 * @param {String} mobilePhone The user's mobilePhoneNumber
20615 * @param {String} password The password to log in with.
20616 * @return {Promise} A promise that is fulfilled with the user when
20617 * the login completes.
20618 * @see AV.User#logIn
20619 */
20620 logInWithMobilePhone: function logInWithMobilePhone(mobilePhone, password) {
20621 var user = AV.Object._create('_User');
20622
20623 user._finishFetch({
20624 mobilePhoneNumber: mobilePhone,
20625 password: password
20626 });
20627
20628 return user.logIn();
20629 },
20630
20631 /**
20632 * Logs in a user with email and password.
20633 *
20634 * @since 3.13.0
20635 * @param {String} email The user's email.
20636 * @param {String} password The password to log in with.
20637 * @return {Promise} A promise that is fulfilled with the user when
20638 * the login completes.
20639 */
20640 loginWithEmail: function loginWithEmail(email, password) {
20641 var user = AV.Object._create('_User');
20642
20643 user._finishFetch({
20644 email: email,
20645 password: password
20646 });
20647
20648 return user.logIn();
20649 },
20650
20651 /**
20652 * Signs up or logs in a user with a third party auth data(AccessToken).
20653 * On success, this saves the session to disk, so you can retrieve the currently
20654 * logged in user using <code>current</code>.
20655 *
20656 * @since 3.7.0
20657 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
20658 * @param {string} platform Available platform for sign up.
20659 * @param {Object} [options]
20660 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20661 * @return {Promise} A promise that is fulfilled with the user when
20662 * the login completes.
20663 * @example AV.User.loginWithAuthData({
20664 * openid: 'abc123',
20665 * access_token: '123abc',
20666 * expires_in: 1382686496
20667 * }, 'weixin').then(function(user) {
20668 * //Access user here
20669 * }).catch(function(error) {
20670 * //console.error("error: ", error);
20671 * });
20672 * @see {@link https://leancloud.cn/docs/js_guide.html#绑定第三方平台账户}
20673 */
20674 loginWithAuthData: function loginWithAuthData(authData, platform, options) {
20675 return AV.User._logInWith(platform, authData, options);
20676 },
20677
20678 /**
20679 * @deprecated renamed to {@link AV.User.loginWithAuthData}
20680 */
20681 signUpOrlogInWithAuthData: function signUpOrlogInWithAuthData() {
20682 console.warn('DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替');
20683 return this.loginWithAuthData.apply(this, arguments);
20684 },
20685
20686 /**
20687 * Signs up or logs in a user with a third party authData and unionId.
20688 * @since 3.7.0
20689 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
20690 * @param {string} platform Available platform for sign up.
20691 * @param {string} unionId
20692 * @param {Object} [unionLoginOptions]
20693 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
20694 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20695 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20696 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
20697 * @example AV.User.loginWithAuthDataAndUnionId({
20698 * openid: 'abc123',
20699 * access_token: '123abc',
20700 * expires_in: 1382686496
20701 * }, 'weixin', 'union123', {
20702 * unionIdPlatform: 'weixin',
20703 * asMainAccount: true,
20704 * }).then(function(user) {
20705 * //Access user here
20706 * }).catch(function(error) {
20707 * //console.error("error: ", error);
20708 * });
20709 */
20710 loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
20711 return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
20712 },
20713
20714 /**
20715 * @deprecated renamed to {@link AV.User.loginWithAuthDataAndUnionId}
20716 * @since 3.5.0
20717 */
20718 signUpOrlogInWithAuthDataAndUnionId: function signUpOrlogInWithAuthDataAndUnionId() {
20719 console.warn('DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替');
20720 return this.loginWithAuthDataAndUnionId.apply(this, arguments);
20721 },
20722
20723 /**
20724 * Merge unionId into authInfo.
20725 * @since 4.6.0
20726 * @param {Object} authInfo
20727 * @param {String} unionId
20728 * @param {Object} [unionIdOption]
20729 * @param {Boolean} [unionIdOption.asMainAccount] If true, the unionId will be associated with the user.
20730 */
20731 mergeUnionId: function mergeUnionId(authInfo, unionId) {
20732 var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
20733 _ref14$asMainAccount = _ref14.asMainAccount,
20734 asMainAccount = _ref14$asMainAccount === void 0 ? false : _ref14$asMainAccount;
20735
20736 authInfo = JSON.parse((0, _stringify.default)(authInfo));
20737 var _authInfo = authInfo,
20738 authData = _authInfo.authData,
20739 platform = _authInfo.platform;
20740 authData.platform = platform;
20741 authData.main_account = asMainAccount;
20742 authData.unionid = unionId;
20743 return authInfo;
20744 },
20745
20746 /**
20747 * 使用当前使用微信小程序的微信用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
20748 * 仅在微信小程序中可用。
20749 *
20750 * @deprecated please use {@link AV.User.loginWithMiniApp}
20751 * @since 2.0.0
20752 * @param {Object} [options]
20753 * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
20754 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
20755 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20756 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
20757 * @return {Promise.<AV.User>}
20758 */
20759 loginWithWeapp: function loginWithWeapp() {
20760 var _this15 = this;
20761
20762 var _ref15 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20763 _ref15$preferUnionId = _ref15.preferUnionId,
20764 preferUnionId = _ref15$preferUnionId === void 0 ? false : _ref15$preferUnionId,
20765 _ref15$unionIdPlatfor = _ref15.unionIdPlatform,
20766 unionIdPlatform = _ref15$unionIdPlatfor === void 0 ? 'weixin' : _ref15$unionIdPlatfor,
20767 _ref15$asMainAccount = _ref15.asMainAccount,
20768 asMainAccount = _ref15$asMainAccount === void 0 ? true : _ref15$asMainAccount,
20769 _ref15$failOnNotExist = _ref15.failOnNotExist,
20770 failOnNotExist = _ref15$failOnNotExist === void 0 ? false : _ref15$failOnNotExist;
20771
20772 var getAuthInfo = getAdapter('getAuthInfo');
20773 return getAuthInfo({
20774 preferUnionId: preferUnionId,
20775 asMainAccount: asMainAccount,
20776 platform: unionIdPlatform
20777 }).then(function (authInfo) {
20778 return _this15.loginWithMiniApp(authInfo, {
20779 failOnNotExist: failOnNotExist
20780 });
20781 });
20782 },
20783
20784 /**
20785 * 使用当前使用微信小程序的微信用户身份注册或登录,
20786 * 仅在微信小程序中可用。
20787 *
20788 * @deprecated please use {@link AV.User.loginWithMiniApp}
20789 * @since 3.13.0
20790 * @param {Object} [unionLoginOptions]
20791 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
20792 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20793 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists. * @return {Promise.<AV.User>}
20794 */
20795 loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
20796 var _this16 = this;
20797
20798 var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20799 _ref16$unionIdPlatfor = _ref16.unionIdPlatform,
20800 unionIdPlatform = _ref16$unionIdPlatfor === void 0 ? 'weixin' : _ref16$unionIdPlatfor,
20801 _ref16$asMainAccount = _ref16.asMainAccount,
20802 asMainAccount = _ref16$asMainAccount === void 0 ? false : _ref16$asMainAccount,
20803 _ref16$failOnNotExist = _ref16.failOnNotExist,
20804 failOnNotExist = _ref16$failOnNotExist === void 0 ? false : _ref16$failOnNotExist;
20805
20806 var getAuthInfo = getAdapter('getAuthInfo');
20807 return getAuthInfo({
20808 platform: unionIdPlatform
20809 }).then(function (authInfo) {
20810 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20811 asMainAccount: asMainAccount
20812 });
20813 return _this16.loginWithMiniApp(authInfo, {
20814 failOnNotExist: failOnNotExist
20815 });
20816 });
20817 },
20818
20819 /**
20820 * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
20821 * 仅在 QQ 小程序中可用。
20822 *
20823 * @deprecated please use {@link AV.User.loginWithMiniApp}
20824 * @since 4.2.0
20825 * @param {Object} [options]
20826 * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
20827 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
20828 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20829 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
20830 * @return {Promise.<AV.User>}
20831 */
20832 loginWithQQApp: function loginWithQQApp() {
20833 var _this17 = this;
20834
20835 var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20836 _ref17$preferUnionId = _ref17.preferUnionId,
20837 preferUnionId = _ref17$preferUnionId === void 0 ? false : _ref17$preferUnionId,
20838 _ref17$unionIdPlatfor = _ref17.unionIdPlatform,
20839 unionIdPlatform = _ref17$unionIdPlatfor === void 0 ? 'qq' : _ref17$unionIdPlatfor,
20840 _ref17$asMainAccount = _ref17.asMainAccount,
20841 asMainAccount = _ref17$asMainAccount === void 0 ? true : _ref17$asMainAccount,
20842 _ref17$failOnNotExist = _ref17.failOnNotExist,
20843 failOnNotExist = _ref17$failOnNotExist === void 0 ? false : _ref17$failOnNotExist;
20844
20845 var getAuthInfo = getAdapter('getAuthInfo');
20846 return getAuthInfo({
20847 preferUnionId: preferUnionId,
20848 asMainAccount: asMainAccount,
20849 platform: unionIdPlatform
20850 }).then(function (authInfo) {
20851 authInfo.provider = PLATFORM_QQAPP;
20852 return _this17.loginWithMiniApp(authInfo, {
20853 failOnNotExist: failOnNotExist
20854 });
20855 });
20856 },
20857
20858 /**
20859 * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,
20860 * 仅在 QQ 小程序中可用。
20861 *
20862 * @deprecated please use {@link AV.User.loginWithMiniApp}
20863 * @since 4.2.0
20864 * @param {Object} [unionLoginOptions]
20865 * @param {string} [unionLoginOptions.unionIdPlatform = 'qq'] unionId platform
20866 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20867 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20868 * @return {Promise.<AV.User>}
20869 */
20870 loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
20871 var _this18 = this;
20872
20873 var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20874 _ref18$unionIdPlatfor = _ref18.unionIdPlatform,
20875 unionIdPlatform = _ref18$unionIdPlatfor === void 0 ? 'qq' : _ref18$unionIdPlatfor,
20876 _ref18$asMainAccount = _ref18.asMainAccount,
20877 asMainAccount = _ref18$asMainAccount === void 0 ? false : _ref18$asMainAccount,
20878 _ref18$failOnNotExist = _ref18.failOnNotExist,
20879 failOnNotExist = _ref18$failOnNotExist === void 0 ? false : _ref18$failOnNotExist;
20880
20881 var getAuthInfo = getAdapter('getAuthInfo');
20882 return getAuthInfo({
20883 platform: unionIdPlatform
20884 }).then(function (authInfo) {
20885 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20886 asMainAccount: asMainAccount
20887 });
20888 authInfo.provider = PLATFORM_QQAPP;
20889 return _this18.loginWithMiniApp(authInfo, {
20890 failOnNotExist: failOnNotExist
20891 });
20892 });
20893 },
20894
20895 /**
20896 * Register or login using the identity of the current mini-app.
20897 * @param {Object} authInfo
20898 * @param {Object} [option]
20899 * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
20900 */
20901 loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
20902 var _this19 = this;
20903
20904 if (authInfo === undefined) {
20905 var getAuthInfo = getAdapter('getAuthInfo');
20906 return getAuthInfo().then(function (authInfo) {
20907 return _this19.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20908 });
20909 }
20910
20911 return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20912 },
20913
20914 /**
20915 * Only use for DI in tests to produce deterministic IDs.
20916 */
20917 _genId: function _genId() {
20918 return uuid();
20919 },
20920
20921 /**
20922 * Creates an anonymous user.
20923 *
20924 * @since 3.9.0
20925 * @return {Promise.<AV.User>}
20926 */
20927 loginAnonymously: function loginAnonymously() {
20928 return this.loginWithAuthData({
20929 id: AV.User._genId()
20930 }, 'anonymous');
20931 },
20932 associateWithAuthData: function associateWithAuthData(userObj, platform, authData) {
20933 console.warn('DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替');
20934 return userObj._linkWith(platform, authData);
20935 },
20936
20937 /**
20938 * Logs out the currently logged in user session. This will remove the
20939 * session from disk, log out of linked services, and future calls to
20940 * <code>current</code> will return <code>null</code>.
20941 * @return {Promise}
20942 */
20943 logOut: function logOut() {
20944 if (AV._config.disableCurrentUser) {
20945 console.warn('AV.User.current() was disabled in multi-user environment, call logOut() from user object instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
20946 return _promise.default.resolve(null);
20947 }
20948
20949 if (AV.User._currentUser !== null) {
20950 AV.User._currentUser._logOutWithAll();
20951
20952 AV.User._currentUser._isCurrentUser = false;
20953 }
20954
20955 AV.User._currentUserMatchesDisk = true;
20956 AV.User._currentUser = null;
20957 return AV.localStorage.removeItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function () {
20958 return AV._refreshSubscriptionId();
20959 });
20960 },
20961
20962 /**
20963 *Create a follower query for special user to query the user's followers.
20964 * @param {String} userObjectId The user object id.
20965 * @return {AV.FriendShipQuery}
20966 * @since 0.3.0
20967 */
20968 followerQuery: function followerQuery(userObjectId) {
20969 if (!userObjectId || !_.isString(userObjectId)) {
20970 throw new Error('Invalid user object id.');
20971 }
20972
20973 var query = new AV.FriendShipQuery('_Follower');
20974 query._friendshipTag = 'follower';
20975 query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
20976 return query;
20977 },
20978
20979 /**
20980 *Create a followee query for special user to query the user's followees.
20981 * @param {String} userObjectId The user object id.
20982 * @return {AV.FriendShipQuery}
20983 * @since 0.3.0
20984 */
20985 followeeQuery: function followeeQuery(userObjectId) {
20986 if (!userObjectId || !_.isString(userObjectId)) {
20987 throw new Error('Invalid user object id.');
20988 }
20989
20990 var query = new AV.FriendShipQuery('_Followee');
20991 query._friendshipTag = 'followee';
20992 query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
20993 return query;
20994 },
20995
20996 /**
20997 * Requests a password reset email to be sent to the specified email address
20998 * associated with the user account. This email allows the user to securely
20999 * reset their password on the AV site.
21000 *
21001 * @param {String} email The email address associated with the user that
21002 * forgot their password.
21003 * @return {Promise}
21004 */
21005 requestPasswordReset: function requestPasswordReset(email) {
21006 var json = {
21007 email: email
21008 };
21009 var request = AVRequest('requestPasswordReset', null, null, 'POST', json);
21010 return request;
21011 },
21012
21013 /**
21014 * Requests a verify email to be sent to the specified email address
21015 * associated with the user account. This email allows the user to securely
21016 * verify their email address on the AV site.
21017 *
21018 * @param {String} email The email address associated with the user that
21019 * doesn't verify their email address.
21020 * @return {Promise}
21021 */
21022 requestEmailVerify: function requestEmailVerify(email) {
21023 var json = {
21024 email: email
21025 };
21026 var request = AVRequest('requestEmailVerify', null, null, 'POST', json);
21027 return request;
21028 },
21029
21030 /**
21031 * Requests a verify sms code to be sent to the specified mobile phone
21032 * number associated with the user account. This sms code allows the user to
21033 * verify their mobile phone number by calling AV.User.verifyMobilePhone
21034 *
21035 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21036 * user that doesn't verify their mobile phone number.
21037 * @param {SMSAuthOptions} [options]
21038 * @return {Promise}
21039 */
21040 requestMobilePhoneVerify: function requestMobilePhoneVerify(mobilePhoneNumber) {
21041 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21042 var data = {
21043 mobilePhoneNumber: mobilePhoneNumber
21044 };
21045
21046 if (options.validateToken) {
21047 data.validate_token = options.validateToken;
21048 }
21049
21050 var request = AVRequest('requestMobilePhoneVerify', null, null, 'POST', data, options);
21051 return request;
21052 },
21053
21054 /**
21055 * Requests a reset password sms code to be sent to the specified mobile phone
21056 * number associated with the user account. This sms code allows the user to
21057 * reset their account's password by calling AV.User.resetPasswordBySmsCode
21058 *
21059 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21060 * user that doesn't verify their mobile phone number.
21061 * @param {SMSAuthOptions} [options]
21062 * @return {Promise}
21063 */
21064 requestPasswordResetBySmsCode: function requestPasswordResetBySmsCode(mobilePhoneNumber) {
21065 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21066 var data = {
21067 mobilePhoneNumber: mobilePhoneNumber
21068 };
21069
21070 if (options.validateToken) {
21071 data.validate_token = options.validateToken;
21072 }
21073
21074 var request = AVRequest('requestPasswordResetBySmsCode', null, null, 'POST', data, options);
21075 return request;
21076 },
21077
21078 /**
21079 * Requests a change mobile phone number sms code to be sent to the mobilePhoneNumber.
21080 * This sms code allows current user to reset it's mobilePhoneNumber by
21081 * calling {@link AV.User.changePhoneNumber}
21082 * @since 4.7.0
21083 * @param {String} mobilePhoneNumber
21084 * @param {Number} [ttl] ttl of sms code (default is 6 minutes)
21085 * @param {SMSAuthOptions} [options]
21086 * @return {Promise}
21087 */
21088 requestChangePhoneNumber: function requestChangePhoneNumber(mobilePhoneNumber, ttl, options) {
21089 var data = {
21090 mobilePhoneNumber: mobilePhoneNumber
21091 };
21092
21093 if (ttl) {
21094 data.ttl = options.ttl;
21095 }
21096
21097 if (options && options.validateToken) {
21098 data.validate_token = options.validateToken;
21099 }
21100
21101 return AVRequest('requestChangePhoneNumber', null, null, 'POST', data, options);
21102 },
21103
21104 /**
21105 * Makes a call to reset user's account mobilePhoneNumber by sms code.
21106 * The sms code is sent by {@link AV.User.requestChangePhoneNumber}
21107 * @since 4.7.0
21108 * @param {String} mobilePhoneNumber
21109 * @param {String} code The sms code.
21110 * @return {Promise}
21111 */
21112 changePhoneNumber: function changePhoneNumber(mobilePhoneNumber, code) {
21113 var data = {
21114 mobilePhoneNumber: mobilePhoneNumber,
21115 code: code
21116 };
21117 return AVRequest('changePhoneNumber', null, null, 'POST', data);
21118 },
21119
21120 /**
21121 * Makes a call to reset user's account password by sms code and new password.
21122 * The sms code is sent by AV.User.requestPasswordResetBySmsCode.
21123 * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
21124 * @param {String} password The new password.
21125 * @return {Promise} A promise that will be resolved with the result
21126 * of the function.
21127 */
21128 resetPasswordBySmsCode: function resetPasswordBySmsCode(code, password) {
21129 var json = {
21130 password: password
21131 };
21132 var request = AVRequest('resetPasswordBySmsCode', null, code, 'PUT', json);
21133 return request;
21134 },
21135
21136 /**
21137 * Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode
21138 * If verify successfully,the user mobilePhoneVerified attribute will be true.
21139 * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
21140 * @return {Promise} A promise that will be resolved with the result
21141 * of the function.
21142 */
21143 verifyMobilePhone: function verifyMobilePhone(code) {
21144 var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
21145 return request;
21146 },
21147
21148 /**
21149 * Requests a logIn sms code to be sent to the specified mobile phone
21150 * number associated with the user account. This sms code allows the user to
21151 * login by AV.User.logInWithMobilePhoneSmsCode function.
21152 *
21153 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21154 * user that want to login by AV.User.logInWithMobilePhoneSmsCode
21155 * @param {SMSAuthOptions} [options]
21156 * @return {Promise}
21157 */
21158 requestLoginSmsCode: function requestLoginSmsCode(mobilePhoneNumber) {
21159 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21160 var data = {
21161 mobilePhoneNumber: mobilePhoneNumber
21162 };
21163
21164 if (options.validateToken) {
21165 data.validate_token = options.validateToken;
21166 }
21167
21168 var request = AVRequest('requestLoginSmsCode', null, null, 'POST', data, options);
21169 return request;
21170 },
21171
21172 /**
21173 * Retrieves the currently logged in AVUser with a valid session,
21174 * either from memory or localStorage, if necessary.
21175 * @return {Promise.<AV.User>} resolved with the currently logged in AV.User.
21176 */
21177 currentAsync: function currentAsync() {
21178 if (AV._config.disableCurrentUser) {
21179 console.warn('AV.User.currentAsync() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
21180 return _promise.default.resolve(null);
21181 }
21182
21183 if (AV.User._currentUser) {
21184 return _promise.default.resolve(AV.User._currentUser);
21185 }
21186
21187 if (AV.User._currentUserMatchesDisk) {
21188 return _promise.default.resolve(AV.User._currentUser);
21189 }
21190
21191 return AV.localStorage.getItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function (userData) {
21192 if (!userData) {
21193 return null;
21194 } // Load the user from local storage.
21195
21196
21197 AV.User._currentUserMatchesDisk = true;
21198 AV.User._currentUser = AV.Object._create('_User');
21199 AV.User._currentUser._isCurrentUser = true;
21200 var json = JSON.parse(userData);
21201 AV.User._currentUser.id = json._id;
21202 delete json._id;
21203 AV.User._currentUser._sessionToken = json._sessionToken;
21204 delete json._sessionToken;
21205
21206 AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
21207
21208
21209 AV.User._currentUser._synchronizeAllAuthData();
21210
21211 AV.User._currentUser._refreshCache();
21212
21213 AV.User._currentUser._opSetQueue = [{}];
21214 return AV.User._currentUser;
21215 });
21216 },
21217
21218 /**
21219 * Retrieves the currently logged in AVUser with a valid session,
21220 * either from memory or localStorage, if necessary.
21221 * @return {AV.User} The currently logged in AV.User.
21222 */
21223 current: function current() {
21224 if (AV._config.disableCurrentUser) {
21225 console.warn('AV.User.current() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
21226 return null;
21227 }
21228
21229 if (AV.localStorage.async) {
21230 var error = new Error('Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.');
21231 error.code = 'SYNC_API_NOT_AVAILABLE';
21232 throw error;
21233 }
21234
21235 if (AV.User._currentUser) {
21236 return AV.User._currentUser;
21237 }
21238
21239 if (AV.User._currentUserMatchesDisk) {
21240 return AV.User._currentUser;
21241 } // Load the user from local storage.
21242
21243
21244 AV.User._currentUserMatchesDisk = true;
21245 var userData = AV.localStorage.getItem(AV._getAVPath(AV.User._CURRENT_USER_KEY));
21246
21247 if (!userData) {
21248 return null;
21249 }
21250
21251 AV.User._currentUser = AV.Object._create('_User');
21252 AV.User._currentUser._isCurrentUser = true;
21253 var json = JSON.parse(userData);
21254 AV.User._currentUser.id = json._id;
21255 delete json._id;
21256 AV.User._currentUser._sessionToken = json._sessionToken;
21257 delete json._sessionToken;
21258
21259 AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
21260
21261
21262 AV.User._currentUser._synchronizeAllAuthData();
21263
21264 AV.User._currentUser._refreshCache();
21265
21266 AV.User._currentUser._opSetQueue = [{}];
21267 return AV.User._currentUser;
21268 },
21269
21270 /**
21271 * Persists a user as currentUser to localStorage, and into the singleton.
21272 * @private
21273 */
21274 _saveCurrentUser: function _saveCurrentUser(user) {
21275 var promise;
21276
21277 if (AV.User._currentUser !== user) {
21278 promise = AV.User.logOut();
21279 } else {
21280 promise = _promise.default.resolve();
21281 }
21282
21283 return promise.then(function () {
21284 user._isCurrentUser = true;
21285 AV.User._currentUser = user;
21286
21287 var json = user._toFullJSON();
21288
21289 json._id = user.id;
21290 json._sessionToken = user._sessionToken;
21291 return AV.localStorage.setItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY), (0, _stringify.default)(json)).then(function () {
21292 AV.User._currentUserMatchesDisk = true;
21293 return AV._refreshSubscriptionId();
21294 });
21295 });
21296 },
21297 _registerAuthenticationProvider: function _registerAuthenticationProvider(provider) {
21298 AV.User._authProviders[provider.getAuthType()] = provider; // Synchronize the current user with the auth provider.
21299
21300 if (!AV._config.disableCurrentUser && AV.User.current()) {
21301 AV.User.current()._synchronizeAuthData(provider.getAuthType());
21302 }
21303 },
21304 _logInWith: function _logInWith(provider, authData, options) {
21305 var user = AV.Object._create('_User');
21306
21307 return user._linkWith(provider, authData, options);
21308 }
21309 });
21310};
21311
21312/***/ }),
21313/* 532 */
21314/***/ (function(module, exports, __webpack_require__) {
21315
21316var _Object$defineProperty = __webpack_require__(143);
21317
21318function _defineProperty(obj, key, value) {
21319 if (key in obj) {
21320 _Object$defineProperty(obj, key, {
21321 value: value,
21322 enumerable: true,
21323 configurable: true,
21324 writable: true
21325 });
21326 } else {
21327 obj[key] = value;
21328 }
21329
21330 return obj;
21331}
21332
21333module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
21334
21335/***/ }),
21336/* 533 */
21337/***/ (function(module, exports, __webpack_require__) {
21338
21339"use strict";
21340
21341
21342var _interopRequireDefault = __webpack_require__(1);
21343
21344var _map = _interopRequireDefault(__webpack_require__(42));
21345
21346var _promise = _interopRequireDefault(__webpack_require__(10));
21347
21348var _keys = _interopRequireDefault(__webpack_require__(53));
21349
21350var _stringify = _interopRequireDefault(__webpack_require__(37));
21351
21352var _find = _interopRequireDefault(__webpack_require__(107));
21353
21354var _concat = _interopRequireDefault(__webpack_require__(25));
21355
21356var _ = __webpack_require__(2);
21357
21358var debug = __webpack_require__(69)('leancloud:query');
21359
21360var AVError = __webpack_require__(43);
21361
21362var _require = __webpack_require__(27),
21363 _request = _require._request,
21364 request = _require.request;
21365
21366var _require2 = __webpack_require__(31),
21367 ensureArray = _require2.ensureArray,
21368 transformFetchOptions = _require2.transformFetchOptions,
21369 continueWhile = _require2.continueWhile;
21370
21371var requires = function requires(value, message) {
21372 if (value === undefined) {
21373 throw new Error(message);
21374 }
21375}; // AV.Query is a way to create a list of AV.Objects.
21376
21377
21378module.exports = function (AV) {
21379 /**
21380 * Creates a new AV.Query for the given AV.Object subclass.
21381 * @param {Class|String} objectClass An instance of a subclass of AV.Object, or a AV className string.
21382 * @class
21383 *
21384 * <p>AV.Query defines a query that is used to fetch AV.Objects. The
21385 * most common use case is finding all objects that match a query through the
21386 * <code>find</code> method. For example, this sample code fetches all objects
21387 * of class <code>MyClass</code>. It calls a different function depending on
21388 * whether the fetch succeeded or not.
21389 *
21390 * <pre>
21391 * var query = new AV.Query(MyClass);
21392 * query.find().then(function(results) {
21393 * // results is an array of AV.Object.
21394 * }, function(error) {
21395 * // error is an instance of AVError.
21396 * });</pre></p>
21397 *
21398 * <p>An AV.Query can also be used to retrieve a single object whose id is
21399 * known, through the get method. For example, this sample code fetches an
21400 * object of class <code>MyClass</code> and id <code>myId</code>. It calls a
21401 * different function depending on whether the fetch succeeded or not.
21402 *
21403 * <pre>
21404 * var query = new AV.Query(MyClass);
21405 * query.get(myId).then(function(object) {
21406 * // object is an instance of AV.Object.
21407 * }, function(error) {
21408 * // error is an instance of AVError.
21409 * });</pre></p>
21410 *
21411 * <p>An AV.Query can also be used to count the number of objects that match
21412 * the query without retrieving all of those objects. For example, this
21413 * sample code counts the number of objects of the class <code>MyClass</code>
21414 * <pre>
21415 * var query = new AV.Query(MyClass);
21416 * query.count().then(function(number) {
21417 * // There are number instances of MyClass.
21418 * }, function(error) {
21419 * // error is an instance of AVError.
21420 * });</pre></p>
21421 */
21422 AV.Query = function (objectClass) {
21423 if (_.isString(objectClass)) {
21424 objectClass = AV.Object._getSubclass(objectClass);
21425 }
21426
21427 this.objectClass = objectClass;
21428 this.className = objectClass.prototype.className;
21429 this._where = {};
21430 this._include = [];
21431 this._select = [];
21432 this._limit = -1; // negative limit means, do not send a limit
21433
21434 this._skip = 0;
21435 this._defaultParams = {};
21436 };
21437 /**
21438 * Constructs a AV.Query that is the OR of the passed in queries. For
21439 * example:
21440 * <pre>var compoundQuery = AV.Query.or(query1, query2, query3);</pre>
21441 *
21442 * will create a compoundQuery that is an or of the query1, query2, and
21443 * query3.
21444 * @param {...AV.Query} var_args The list of queries to OR.
21445 * @return {AV.Query} The query that is the OR of the passed in queries.
21446 */
21447
21448
21449 AV.Query.or = function () {
21450 var queries = _.toArray(arguments);
21451
21452 var className = null;
21453
21454 AV._arrayEach(queries, function (q) {
21455 if (_.isNull(className)) {
21456 className = q.className;
21457 }
21458
21459 if (className !== q.className) {
21460 throw new Error('All queries must be for the same class');
21461 }
21462 });
21463
21464 var query = new AV.Query(className);
21465
21466 query._orQuery(queries);
21467
21468 return query;
21469 };
21470 /**
21471 * Constructs a AV.Query that is the AND of the passed in queries. For
21472 * example:
21473 * <pre>var compoundQuery = AV.Query.and(query1, query2, query3);</pre>
21474 *
21475 * will create a compoundQuery that is an 'and' of the query1, query2, and
21476 * query3.
21477 * @param {...AV.Query} var_args The list of queries to AND.
21478 * @return {AV.Query} The query that is the AND of the passed in queries.
21479 */
21480
21481
21482 AV.Query.and = function () {
21483 var queries = _.toArray(arguments);
21484
21485 var className = null;
21486
21487 AV._arrayEach(queries, function (q) {
21488 if (_.isNull(className)) {
21489 className = q.className;
21490 }
21491
21492 if (className !== q.className) {
21493 throw new Error('All queries must be for the same class');
21494 }
21495 });
21496
21497 var query = new AV.Query(className);
21498
21499 query._andQuery(queries);
21500
21501 return query;
21502 };
21503 /**
21504 * Retrieves a list of AVObjects that satisfy the CQL.
21505 * CQL syntax please see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
21506 *
21507 * @param {String} cql A CQL string, see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
21508 * @param {Array} pvalues An array contains placeholder values.
21509 * @param {AuthOptions} options
21510 * @return {Promise} A promise that is resolved with the results when
21511 * the query completes.
21512 */
21513
21514
21515 AV.Query.doCloudQuery = function (cql, pvalues, options) {
21516 var params = {
21517 cql: cql
21518 };
21519
21520 if (_.isArray(pvalues)) {
21521 params.pvalues = pvalues;
21522 } else {
21523 options = pvalues;
21524 }
21525
21526 var request = _request('cloudQuery', null, null, 'GET', params, options);
21527
21528 return request.then(function (response) {
21529 //query to process results.
21530 var query = new AV.Query(response.className);
21531 var results = (0, _map.default)(_).call(_, response.results, function (json) {
21532 var obj = query._newObject(response);
21533
21534 if (obj._finishFetch) {
21535 obj._finishFetch(query._processResult(json), true);
21536 }
21537
21538 return obj;
21539 });
21540 return {
21541 results: results,
21542 count: response.count,
21543 className: response.className
21544 };
21545 });
21546 };
21547 /**
21548 * Return a query with conditions from json.
21549 * This can be useful to send a query from server side to client side.
21550 * @since 4.0.0
21551 * @param {Object} json from {@link AV.Query#toJSON}
21552 * @return {AV.Query}
21553 */
21554
21555
21556 AV.Query.fromJSON = function (_ref) {
21557 var className = _ref.className,
21558 where = _ref.where,
21559 include = _ref.include,
21560 select = _ref.select,
21561 includeACL = _ref.includeACL,
21562 limit = _ref.limit,
21563 skip = _ref.skip,
21564 order = _ref.order;
21565
21566 if (typeof className !== 'string') {
21567 throw new TypeError('Invalid Query JSON, className must be a String.');
21568 }
21569
21570 var query = new AV.Query(className);
21571
21572 _.extend(query, {
21573 _where: where,
21574 _include: include,
21575 _select: select,
21576 _includeACL: includeACL,
21577 _limit: limit,
21578 _skip: skip,
21579 _order: order
21580 });
21581
21582 return query;
21583 };
21584
21585 AV.Query._extend = AV._extend;
21586
21587 _.extend(AV.Query.prototype,
21588 /** @lends AV.Query.prototype */
21589 {
21590 //hook to iterate result. Added by dennis<xzhuang@avoscloud.com>.
21591 _processResult: function _processResult(obj) {
21592 return obj;
21593 },
21594
21595 /**
21596 * Constructs an AV.Object whose id is already known by fetching data from
21597 * the server.
21598 *
21599 * @param {String} objectId The id of the object to be fetched.
21600 * @param {AuthOptions} options
21601 * @return {Promise.<AV.Object>}
21602 */
21603 get: function get(objectId, options) {
21604 if (!_.isString(objectId)) {
21605 throw new Error('objectId must be a string');
21606 }
21607
21608 if (objectId === '') {
21609 return _promise.default.reject(new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.'));
21610 }
21611
21612 var obj = this._newObject();
21613
21614 obj.id = objectId;
21615
21616 var queryJSON = this._getParams();
21617
21618 var fetchOptions = {};
21619 if ((0, _keys.default)(queryJSON)) fetchOptions.keys = (0, _keys.default)(queryJSON);
21620 if (queryJSON.include) fetchOptions.include = queryJSON.include;
21621 if (queryJSON.includeACL) fetchOptions.includeACL = queryJSON.includeACL;
21622 return _request('classes', this.className, objectId, 'GET', transformFetchOptions(fetchOptions), options).then(function (response) {
21623 if (_.isEmpty(response)) throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
21624
21625 obj._finishFetch(obj.parse(response), true);
21626
21627 return obj;
21628 });
21629 },
21630
21631 /**
21632 * Returns a JSON representation of this query.
21633 * @return {Object}
21634 */
21635 toJSON: function toJSON() {
21636 var className = this.className,
21637 where = this._where,
21638 include = this._include,
21639 select = this._select,
21640 includeACL = this._includeACL,
21641 limit = this._limit,
21642 skip = this._skip,
21643 order = this._order;
21644 return {
21645 className: className,
21646 where: where,
21647 include: include,
21648 select: select,
21649 includeACL: includeACL,
21650 limit: limit,
21651 skip: skip,
21652 order: order
21653 };
21654 },
21655 _getParams: function _getParams() {
21656 var params = _.extend({}, this._defaultParams, {
21657 where: this._where
21658 });
21659
21660 if (this._include.length > 0) {
21661 params.include = this._include.join(',');
21662 }
21663
21664 if (this._select.length > 0) {
21665 params.keys = this._select.join(',');
21666 }
21667
21668 if (this._includeACL !== undefined) {
21669 params.returnACL = this._includeACL;
21670 }
21671
21672 if (this._limit >= 0) {
21673 params.limit = this._limit;
21674 }
21675
21676 if (this._skip > 0) {
21677 params.skip = this._skip;
21678 }
21679
21680 if (this._order !== undefined) {
21681 params.order = this._order;
21682 }
21683
21684 return params;
21685 },
21686 _newObject: function _newObject(response) {
21687 var obj;
21688
21689 if (response && response.className) {
21690 obj = new AV.Object(response.className);
21691 } else {
21692 obj = new this.objectClass();
21693 }
21694
21695 return obj;
21696 },
21697 _createRequest: function _createRequest() {
21698 var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getParams();
21699 var options = arguments.length > 1 ? arguments[1] : undefined;
21700 var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "/classes/".concat(this.className);
21701
21702 if (encodeURIComponent((0, _stringify.default)(params)).length > 2000) {
21703 var body = {
21704 requests: [{
21705 method: 'GET',
21706 path: "/1.1".concat(path),
21707 params: params
21708 }]
21709 };
21710 return request({
21711 path: '/batch',
21712 method: 'POST',
21713 data: body,
21714 authOptions: options
21715 }).then(function (response) {
21716 var result = response[0];
21717
21718 if (result.success) {
21719 return result.success;
21720 }
21721
21722 var error = new AVError(result.error.code, result.error.error || 'Unknown batch error');
21723 throw error;
21724 });
21725 }
21726
21727 return request({
21728 method: 'GET',
21729 path: path,
21730 query: params,
21731 authOptions: options
21732 });
21733 },
21734 _parseResponse: function _parseResponse(response) {
21735 var _this = this;
21736
21737 return (0, _map.default)(_).call(_, response.results, function (json) {
21738 var obj = _this._newObject(response);
21739
21740 if (obj._finishFetch) {
21741 obj._finishFetch(_this._processResult(json), true);
21742 }
21743
21744 return obj;
21745 });
21746 },
21747
21748 /**
21749 * Retrieves a list of AVObjects that satisfy this query.
21750 *
21751 * @param {AuthOptions} options
21752 * @return {Promise} A promise that is resolved with the results when
21753 * the query completes.
21754 */
21755 find: function find(options) {
21756 var request = this._createRequest(undefined, options);
21757
21758 return request.then(this._parseResponse.bind(this));
21759 },
21760
21761 /**
21762 * Retrieves both AVObjects and total count.
21763 *
21764 * @since 4.12.0
21765 * @param {AuthOptions} options
21766 * @return {Promise} A tuple contains results and count.
21767 */
21768 findAndCount: function findAndCount(options) {
21769 var _this2 = this;
21770
21771 var params = this._getParams();
21772
21773 params.count = 1;
21774
21775 var request = this._createRequest(params, options);
21776
21777 return request.then(function (response) {
21778 return [_this2._parseResponse(response), response.count];
21779 });
21780 },
21781
21782 /**
21783 * scan a Query. masterKey required.
21784 *
21785 * @since 2.1.0
21786 * @param {object} [options]
21787 * @param {string} [options.orderedBy] specify the key to sort
21788 * @param {number} [options.batchSize] specify the batch size for each request
21789 * @param {AuthOptions} [authOptions]
21790 * @return {AsyncIterator.<AV.Object>}
21791 * @example const testIterator = {
21792 * [Symbol.asyncIterator]() {
21793 * return new Query('Test').scan(undefined, { useMasterKey: true });
21794 * },
21795 * };
21796 * for await (const test of testIterator) {
21797 * console.log(test.id);
21798 * }
21799 */
21800 scan: function scan() {
21801 var _this3 = this;
21802
21803 var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
21804 orderedBy = _ref2.orderedBy,
21805 batchSize = _ref2.batchSize;
21806
21807 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
21808
21809 var condition = this._getParams();
21810
21811 debug('scan %O', condition);
21812
21813 if (condition.order) {
21814 console.warn('The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan.');
21815 delete condition.order;
21816 }
21817
21818 if (condition.skip) {
21819 console.warn('The skip option of the query is ignored for Query#scan.');
21820 delete condition.skip;
21821 }
21822
21823 if (condition.limit) {
21824 console.warn('The limit option of the query is ignored for Query#scan.');
21825 delete condition.limit;
21826 }
21827
21828 if (orderedBy) condition.scan_key = orderedBy;
21829 if (batchSize) condition.limit = batchSize;
21830 var cursor;
21831 var remainResults = [];
21832 return {
21833 next: function next() {
21834 if (remainResults.length) {
21835 return _promise.default.resolve({
21836 done: false,
21837 value: remainResults.shift()
21838 });
21839 }
21840
21841 if (cursor === null) {
21842 return _promise.default.resolve({
21843 done: true
21844 });
21845 }
21846
21847 return _request('scan/classes', _this3.className, null, 'GET', cursor ? _.extend({}, condition, {
21848 cursor: cursor
21849 }) : condition, authOptions).then(function (response) {
21850 cursor = response.cursor;
21851
21852 if (response.results.length) {
21853 var results = _this3._parseResponse(response);
21854
21855 results.forEach(function (result) {
21856 return remainResults.push(result);
21857 });
21858 }
21859
21860 if (cursor === null && remainResults.length === 0) {
21861 return {
21862 done: true
21863 };
21864 }
21865
21866 return {
21867 done: false,
21868 value: remainResults.shift()
21869 };
21870 });
21871 }
21872 };
21873 },
21874
21875 /**
21876 * Delete objects retrieved by this query.
21877 * @param {AuthOptions} options
21878 * @return {Promise} A promise that is fulfilled when the save
21879 * completes.
21880 */
21881 destroyAll: function destroyAll(options) {
21882 var self = this;
21883 return (0, _find.default)(self).call(self, options).then(function (objects) {
21884 return AV.Object.destroyAll(objects, options);
21885 });
21886 },
21887
21888 /**
21889 * Counts the number of objects that match this query.
21890 *
21891 * @param {AuthOptions} options
21892 * @return {Promise} A promise that is resolved with the count when
21893 * the query completes.
21894 */
21895 count: function count(options) {
21896 var params = this._getParams();
21897
21898 params.limit = 0;
21899 params.count = 1;
21900
21901 var request = this._createRequest(params, options);
21902
21903 return request.then(function (response) {
21904 return response.count;
21905 });
21906 },
21907
21908 /**
21909 * Retrieves at most one AV.Object that satisfies this query.
21910 *
21911 * @param {AuthOptions} options
21912 * @return {Promise} A promise that is resolved with the object when
21913 * the query completes.
21914 */
21915 first: function first(options) {
21916 var self = this;
21917
21918 var params = this._getParams();
21919
21920 params.limit = 1;
21921
21922 var request = this._createRequest(params, options);
21923
21924 return request.then(function (response) {
21925 return (0, _map.default)(_).call(_, response.results, function (json) {
21926 var obj = self._newObject();
21927
21928 if (obj._finishFetch) {
21929 obj._finishFetch(self._processResult(json), true);
21930 }
21931
21932 return obj;
21933 })[0];
21934 });
21935 },
21936
21937 /**
21938 * Sets the number of results to skip before returning any results.
21939 * This is useful for pagination.
21940 * Default is to skip zero results.
21941 * @param {Number} n the number of results to skip.
21942 * @return {AV.Query} Returns the query, so you can chain this call.
21943 */
21944 skip: function skip(n) {
21945 requires(n, 'undefined is not a valid skip value');
21946 this._skip = n;
21947 return this;
21948 },
21949
21950 /**
21951 * Sets the limit of the number of results to return. The default limit is
21952 * 100, with a maximum of 1000 results being returned at a time.
21953 * @param {Number} n the number of results to limit to.
21954 * @return {AV.Query} Returns the query, so you can chain this call.
21955 */
21956 limit: function limit(n) {
21957 requires(n, 'undefined is not a valid limit value');
21958 this._limit = n;
21959 return this;
21960 },
21961
21962 /**
21963 * Add a constraint to the query that requires a particular key's value to
21964 * be equal to the provided value.
21965 * @param {String} key The key to check.
21966 * @param value The value that the AV.Object must contain.
21967 * @return {AV.Query} Returns the query, so you can chain this call.
21968 */
21969 equalTo: function equalTo(key, value) {
21970 requires(key, 'undefined is not a valid key');
21971 requires(value, 'undefined is not a valid value');
21972 this._where[key] = AV._encode(value);
21973 return this;
21974 },
21975
21976 /**
21977 * Helper for condition queries
21978 * @private
21979 */
21980 _addCondition: function _addCondition(key, condition, value) {
21981 requires(key, 'undefined is not a valid condition key');
21982 requires(condition, 'undefined is not a valid condition');
21983 requires(value, 'undefined is not a valid condition value'); // Check if we already have a condition
21984
21985 if (!this._where[key]) {
21986 this._where[key] = {};
21987 }
21988
21989 this._where[key][condition] = AV._encode(value);
21990 return this;
21991 },
21992
21993 /**
21994 * Add a constraint to the query that requires a particular
21995 * <strong>array</strong> key's length to be equal to the provided value.
21996 * @param {String} key The array key to check.
21997 * @param {number} value The length value.
21998 * @return {AV.Query} Returns the query, so you can chain this call.
21999 */
22000 sizeEqualTo: function sizeEqualTo(key, value) {
22001 this._addCondition(key, '$size', value);
22002
22003 return this;
22004 },
22005
22006 /**
22007 * Add a constraint to the query that requires a particular key's value to
22008 * be not equal to the provided value.
22009 * @param {String} key The key to check.
22010 * @param value The value that must not be equalled.
22011 * @return {AV.Query} Returns the query, so you can chain this call.
22012 */
22013 notEqualTo: function notEqualTo(key, value) {
22014 this._addCondition(key, '$ne', value);
22015
22016 return this;
22017 },
22018
22019 /**
22020 * Add a constraint to the query that requires a particular key's value to
22021 * be less than the provided value.
22022 * @param {String} key The key to check.
22023 * @param value The value that provides an upper bound.
22024 * @return {AV.Query} Returns the query, so you can chain this call.
22025 */
22026 lessThan: function lessThan(key, value) {
22027 this._addCondition(key, '$lt', value);
22028
22029 return this;
22030 },
22031
22032 /**
22033 * Add a constraint to the query that requires a particular key's value to
22034 * be greater than the provided value.
22035 * @param {String} key The key to check.
22036 * @param value The value that provides an lower bound.
22037 * @return {AV.Query} Returns the query, so you can chain this call.
22038 */
22039 greaterThan: function greaterThan(key, value) {
22040 this._addCondition(key, '$gt', value);
22041
22042 return this;
22043 },
22044
22045 /**
22046 * Add a constraint to the query that requires a particular key's value to
22047 * be less than or equal to the provided value.
22048 * @param {String} key The key to check.
22049 * @param value The value that provides an upper bound.
22050 * @return {AV.Query} Returns the query, so you can chain this call.
22051 */
22052 lessThanOrEqualTo: function lessThanOrEqualTo(key, value) {
22053 this._addCondition(key, '$lte', value);
22054
22055 return this;
22056 },
22057
22058 /**
22059 * Add a constraint to the query that requires a particular key's value to
22060 * be greater than or equal to the provided value.
22061 * @param {String} key The key to check.
22062 * @param value The value that provides an lower bound.
22063 * @return {AV.Query} Returns the query, so you can chain this call.
22064 */
22065 greaterThanOrEqualTo: function greaterThanOrEqualTo(key, value) {
22066 this._addCondition(key, '$gte', value);
22067
22068 return this;
22069 },
22070
22071 /**
22072 * Add a constraint to the query that requires a particular key's value to
22073 * be contained in the provided list of values.
22074 * @param {String} key The key to check.
22075 * @param {Array} values The values that will match.
22076 * @return {AV.Query} Returns the query, so you can chain this call.
22077 */
22078 containedIn: function containedIn(key, values) {
22079 this._addCondition(key, '$in', values);
22080
22081 return this;
22082 },
22083
22084 /**
22085 * Add a constraint to the query that requires a particular key's value to
22086 * not be contained in the provided list of values.
22087 * @param {String} key The key to check.
22088 * @param {Array} values The values that will not match.
22089 * @return {AV.Query} Returns the query, so you can chain this call.
22090 */
22091 notContainedIn: function notContainedIn(key, values) {
22092 this._addCondition(key, '$nin', values);
22093
22094 return this;
22095 },
22096
22097 /**
22098 * Add a constraint to the query that requires a particular key's value to
22099 * contain each one of the provided list of values.
22100 * @param {String} key The key to check. This key's value must be an array.
22101 * @param {Array} values The values that will match.
22102 * @return {AV.Query} Returns the query, so you can chain this call.
22103 */
22104 containsAll: function containsAll(key, values) {
22105 this._addCondition(key, '$all', values);
22106
22107 return this;
22108 },
22109
22110 /**
22111 * Add a constraint for finding objects that contain the given key.
22112 * @param {String} key The key that should exist.
22113 * @return {AV.Query} Returns the query, so you can chain this call.
22114 */
22115 exists: function exists(key) {
22116 this._addCondition(key, '$exists', true);
22117
22118 return this;
22119 },
22120
22121 /**
22122 * Add a constraint for finding objects that do not contain a given key.
22123 * @param {String} key The key that should not exist
22124 * @return {AV.Query} Returns the query, so you can chain this call.
22125 */
22126 doesNotExist: function doesNotExist(key) {
22127 this._addCondition(key, '$exists', false);
22128
22129 return this;
22130 },
22131
22132 /**
22133 * Add a regular expression constraint for finding string values that match
22134 * the provided regular expression.
22135 * This may be slow for large datasets.
22136 * @param {String} key The key that the string to match is stored in.
22137 * @param {RegExp} regex The regular expression pattern to match.
22138 * @return {AV.Query} Returns the query, so you can chain this call.
22139 */
22140 matches: function matches(key, regex, modifiers) {
22141 this._addCondition(key, '$regex', regex);
22142
22143 if (!modifiers) {
22144 modifiers = '';
22145 } // Javascript regex options support mig as inline options but store them
22146 // as properties of the object. We support mi & should migrate them to
22147 // modifiers
22148
22149
22150 if (regex.ignoreCase) {
22151 modifiers += 'i';
22152 }
22153
22154 if (regex.multiline) {
22155 modifiers += 'm';
22156 }
22157
22158 if (modifiers && modifiers.length) {
22159 this._addCondition(key, '$options', modifiers);
22160 }
22161
22162 return this;
22163 },
22164
22165 /**
22166 * Add a constraint that requires that a key's value matches a AV.Query
22167 * constraint.
22168 * @param {String} key The key that the contains the object to match the
22169 * query.
22170 * @param {AV.Query} query The query that should match.
22171 * @return {AV.Query} Returns the query, so you can chain this call.
22172 */
22173 matchesQuery: function matchesQuery(key, query) {
22174 var queryJSON = query._getParams();
22175
22176 queryJSON.className = query.className;
22177
22178 this._addCondition(key, '$inQuery', queryJSON);
22179
22180 return this;
22181 },
22182
22183 /**
22184 * Add a constraint that requires that a key's value not matches a
22185 * AV.Query constraint.
22186 * @param {String} key The key that the contains the object to match the
22187 * query.
22188 * @param {AV.Query} query The query that should not match.
22189 * @return {AV.Query} Returns the query, so you can chain this call.
22190 */
22191 doesNotMatchQuery: function doesNotMatchQuery(key, query) {
22192 var queryJSON = query._getParams();
22193
22194 queryJSON.className = query.className;
22195
22196 this._addCondition(key, '$notInQuery', queryJSON);
22197
22198 return this;
22199 },
22200
22201 /**
22202 * Add a constraint that requires that a key's value matches a value in
22203 * an object returned by a different AV.Query.
22204 * @param {String} key The key that contains the value that is being
22205 * matched.
22206 * @param {String} queryKey The key in the objects returned by the query to
22207 * match against.
22208 * @param {AV.Query} query The query to run.
22209 * @return {AV.Query} Returns the query, so you can chain this call.
22210 */
22211 matchesKeyInQuery: function matchesKeyInQuery(key, queryKey, query) {
22212 var queryJSON = query._getParams();
22213
22214 queryJSON.className = query.className;
22215
22216 this._addCondition(key, '$select', {
22217 key: queryKey,
22218 query: queryJSON
22219 });
22220
22221 return this;
22222 },
22223
22224 /**
22225 * Add a constraint that requires that a key's value not match a value in
22226 * an object returned by a different AV.Query.
22227 * @param {String} key The key that contains the value that is being
22228 * excluded.
22229 * @param {String} queryKey The key in the objects returned by the query to
22230 * match against.
22231 * @param {AV.Query} query The query to run.
22232 * @return {AV.Query} Returns the query, so you can chain this call.
22233 */
22234 doesNotMatchKeyInQuery: function doesNotMatchKeyInQuery(key, queryKey, query) {
22235 var queryJSON = query._getParams();
22236
22237 queryJSON.className = query.className;
22238
22239 this._addCondition(key, '$dontSelect', {
22240 key: queryKey,
22241 query: queryJSON
22242 });
22243
22244 return this;
22245 },
22246
22247 /**
22248 * Add constraint that at least one of the passed in queries matches.
22249 * @param {Array} queries
22250 * @return {AV.Query} Returns the query, so you can chain this call.
22251 * @private
22252 */
22253 _orQuery: function _orQuery(queries) {
22254 var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
22255 return q._getParams().where;
22256 });
22257 this._where.$or = queryJSON;
22258 return this;
22259 },
22260
22261 /**
22262 * Add constraint that both of the passed in queries matches.
22263 * @param {Array} queries
22264 * @return {AV.Query} Returns the query, so you can chain this call.
22265 * @private
22266 */
22267 _andQuery: function _andQuery(queries) {
22268 var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
22269 return q._getParams().where;
22270 });
22271 this._where.$and = queryJSON;
22272 return this;
22273 },
22274
22275 /**
22276 * Converts a string into a regex that matches it.
22277 * Surrounding with \Q .. \E does this, we just need to escape \E's in
22278 * the text separately.
22279 * @private
22280 */
22281 _quote: function _quote(s) {
22282 return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
22283 },
22284
22285 /**
22286 * Add a constraint for finding string values that contain a provided
22287 * string. This may be slow for large datasets.
22288 * @param {String} key The key that the string to match is stored in.
22289 * @param {String} substring The substring that the value must contain.
22290 * @return {AV.Query} Returns the query, so you can chain this call.
22291 */
22292 contains: function contains(key, value) {
22293 this._addCondition(key, '$regex', this._quote(value));
22294
22295 return this;
22296 },
22297
22298 /**
22299 * Add a constraint for finding string values that start with a provided
22300 * string. This query will use the backend index, so it will be fast even
22301 * for large datasets.
22302 * @param {String} key The key that the string to match is stored in.
22303 * @param {String} prefix The substring that the value must start with.
22304 * @return {AV.Query} Returns the query, so you can chain this call.
22305 */
22306 startsWith: function startsWith(key, value) {
22307 this._addCondition(key, '$regex', '^' + this._quote(value));
22308
22309 return this;
22310 },
22311
22312 /**
22313 * Add a constraint for finding string values that end with a provided
22314 * string. This will be slow for large datasets.
22315 * @param {String} key The key that the string to match is stored in.
22316 * @param {String} suffix The substring that the value must end with.
22317 * @return {AV.Query} Returns the query, so you can chain this call.
22318 */
22319 endsWith: function endsWith(key, value) {
22320 this._addCondition(key, '$regex', this._quote(value) + '$');
22321
22322 return this;
22323 },
22324
22325 /**
22326 * Sorts the results in ascending order by the given key.
22327 *
22328 * @param {String} key The key to order by.
22329 * @return {AV.Query} Returns the query, so you can chain this call.
22330 */
22331 ascending: function ascending(key) {
22332 requires(key, 'undefined is not a valid key');
22333 this._order = key;
22334 return this;
22335 },
22336
22337 /**
22338 * Also sorts the results in ascending order by the given key. The previous sort keys have
22339 * precedence over this key.
22340 *
22341 * @param {String} key The key to order by
22342 * @return {AV.Query} Returns the query so you can chain this call.
22343 */
22344 addAscending: function addAscending(key) {
22345 requires(key, 'undefined is not a valid key');
22346 if (this._order) this._order += ',' + key;else this._order = key;
22347 return this;
22348 },
22349
22350 /**
22351 * Sorts the results in descending order by the given key.
22352 *
22353 * @param {String} key The key to order by.
22354 * @return {AV.Query} Returns the query, so you can chain this call.
22355 */
22356 descending: function descending(key) {
22357 requires(key, 'undefined is not a valid key');
22358 this._order = '-' + key;
22359 return this;
22360 },
22361
22362 /**
22363 * Also sorts the results in descending order by the given key. The previous sort keys have
22364 * precedence over this key.
22365 *
22366 * @param {String} key The key to order by
22367 * @return {AV.Query} Returns the query so you can chain this call.
22368 */
22369 addDescending: function addDescending(key) {
22370 requires(key, 'undefined is not a valid key');
22371 if (this._order) this._order += ',-' + key;else this._order = '-' + key;
22372 return this;
22373 },
22374
22375 /**
22376 * Add a proximity based constraint for finding objects with key point
22377 * values near the point given.
22378 * @param {String} key The key that the AV.GeoPoint is stored in.
22379 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22380 * @return {AV.Query} Returns the query, so you can chain this call.
22381 */
22382 near: function near(key, point) {
22383 if (!(point instanceof AV.GeoPoint)) {
22384 // Try to cast it to a GeoPoint, so that near("loc", [20,30]) works.
22385 point = new AV.GeoPoint(point);
22386 }
22387
22388 this._addCondition(key, '$nearSphere', point);
22389
22390 return this;
22391 },
22392
22393 /**
22394 * Add a proximity based constraint for finding objects with key point
22395 * values near the point given and within the maximum distance given.
22396 * @param {String} key The key that the AV.GeoPoint is stored in.
22397 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22398 * @param maxDistance Maximum distance (in radians) of results to return.
22399 * @return {AV.Query} Returns the query, so you can chain this call.
22400 */
22401 withinRadians: function withinRadians(key, point, distance) {
22402 this.near(key, point);
22403
22404 this._addCondition(key, '$maxDistance', distance);
22405
22406 return this;
22407 },
22408
22409 /**
22410 * Add a proximity based constraint for finding objects with key point
22411 * values near the point given and within the maximum distance given.
22412 * Radius of earth used is 3958.8 miles.
22413 * @param {String} key The key that the AV.GeoPoint is stored in.
22414 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22415 * @param {Number} maxDistance Maximum distance (in miles) of results to
22416 * return.
22417 * @return {AV.Query} Returns the query, so you can chain this call.
22418 */
22419 withinMiles: function withinMiles(key, point, distance) {
22420 return this.withinRadians(key, point, distance / 3958.8);
22421 },
22422
22423 /**
22424 * Add a proximity based constraint for finding objects with key point
22425 * values near the point given and within the maximum distance given.
22426 * Radius of earth used is 6371.0 kilometers.
22427 * @param {String} key The key that the AV.GeoPoint is stored in.
22428 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22429 * @param {Number} maxDistance Maximum distance (in kilometers) of results
22430 * to return.
22431 * @return {AV.Query} Returns the query, so you can chain this call.
22432 */
22433 withinKilometers: function withinKilometers(key, point, distance) {
22434 return this.withinRadians(key, point, distance / 6371.0);
22435 },
22436
22437 /**
22438 * Add a constraint to the query that requires a particular key's
22439 * coordinates be contained within a given rectangular geographic bounding
22440 * box.
22441 * @param {String} key The key to be constrained.
22442 * @param {AV.GeoPoint} southwest
22443 * The lower-left inclusive corner of the box.
22444 * @param {AV.GeoPoint} northeast
22445 * The upper-right inclusive corner of the box.
22446 * @return {AV.Query} Returns the query, so you can chain this call.
22447 */
22448 withinGeoBox: function withinGeoBox(key, southwest, northeast) {
22449 if (!(southwest instanceof AV.GeoPoint)) {
22450 southwest = new AV.GeoPoint(southwest);
22451 }
22452
22453 if (!(northeast instanceof AV.GeoPoint)) {
22454 northeast = new AV.GeoPoint(northeast);
22455 }
22456
22457 this._addCondition(key, '$within', {
22458 $box: [southwest, northeast]
22459 });
22460
22461 return this;
22462 },
22463
22464 /**
22465 * Include nested AV.Objects for the provided key. You can use dot
22466 * notation to specify which fields in the included object are also fetch.
22467 * @param {String[]} keys The name of the key to include.
22468 * @return {AV.Query} Returns the query, so you can chain this call.
22469 */
22470 include: function include(keys) {
22471 var _this4 = this;
22472
22473 requires(keys, 'undefined is not a valid key');
22474
22475 _.forEach(arguments, function (keys) {
22476 var _context;
22477
22478 _this4._include = (0, _concat.default)(_context = _this4._include).call(_context, ensureArray(keys));
22479 });
22480
22481 return this;
22482 },
22483
22484 /**
22485 * Include the ACL.
22486 * @param {Boolean} [value=true] Whether to include the ACL
22487 * @return {AV.Query} Returns the query, so you can chain this call.
22488 */
22489 includeACL: function includeACL() {
22490 var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
22491 this._includeACL = value;
22492 return this;
22493 },
22494
22495 /**
22496 * Restrict the fields of the returned AV.Objects to include only the
22497 * provided keys. If this is called multiple times, then all of the keys
22498 * specified in each of the calls will be included.
22499 * @param {String[]} keys The names of the keys to include.
22500 * @return {AV.Query} Returns the query, so you can chain this call.
22501 */
22502 select: function select(keys) {
22503 var _this5 = this;
22504
22505 requires(keys, 'undefined is not a valid key');
22506
22507 _.forEach(arguments, function (keys) {
22508 var _context2;
22509
22510 _this5._select = (0, _concat.default)(_context2 = _this5._select).call(_context2, ensureArray(keys));
22511 });
22512
22513 return this;
22514 },
22515
22516 /**
22517 * Iterates over each result of a query, calling a callback for each one. If
22518 * the callback returns a promise, the iteration will not continue until
22519 * that promise has been fulfilled. If the callback returns a rejected
22520 * promise, then iteration will stop with that error. The items are
22521 * processed in an unspecified order. The query may not have any sort order,
22522 * and may not use limit or skip.
22523 * @param callback {Function} Callback that will be called with each result
22524 * of the query.
22525 * @return {Promise} A promise that will be fulfilled once the
22526 * iteration has completed.
22527 */
22528 each: function each(callback) {
22529 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22530
22531 if (this._order || this._skip || this._limit >= 0) {
22532 var error = new Error('Cannot iterate on a query with sort, skip, or limit.');
22533 return _promise.default.reject(error);
22534 }
22535
22536 var query = new AV.Query(this.objectClass); // We can override the batch size from the options.
22537 // This is undocumented, but useful for testing.
22538
22539 query._limit = options.batchSize || 100;
22540 query._where = _.clone(this._where);
22541 query._include = _.clone(this._include);
22542 query.ascending('objectId');
22543 var finished = false;
22544 return continueWhile(function () {
22545 return !finished;
22546 }, function () {
22547 return (0, _find.default)(query).call(query, options).then(function (results) {
22548 var callbacksDone = _promise.default.resolve();
22549
22550 _.each(results, function (result) {
22551 callbacksDone = callbacksDone.then(function () {
22552 return callback(result);
22553 });
22554 });
22555
22556 return callbacksDone.then(function () {
22557 if (results.length >= query._limit) {
22558 query.greaterThan('objectId', results[results.length - 1].id);
22559 } else {
22560 finished = true;
22561 }
22562 });
22563 });
22564 });
22565 },
22566
22567 /**
22568 * Subscribe the changes of this query.
22569 *
22570 * LiveQuery is not included in the default bundle: {@link https://url.leanapp.cn/enable-live-query}.
22571 *
22572 * @since 3.0.0
22573 * @return {AV.LiveQuery} An eventemitter which can be used to get LiveQuery updates;
22574 */
22575 subscribe: function subscribe(options) {
22576 return AV.LiveQuery.init(this, options);
22577 }
22578 });
22579
22580 AV.FriendShipQuery = AV.Query._extend({
22581 _newObject: function _newObject() {
22582 var UserClass = AV.Object._getSubclass('_User');
22583
22584 return new UserClass();
22585 },
22586 _processResult: function _processResult(json) {
22587 if (json && json[this._friendshipTag]) {
22588 var user = json[this._friendshipTag];
22589
22590 if (user.__type === 'Pointer' && user.className === '_User') {
22591 delete user.__type;
22592 delete user.className;
22593 }
22594
22595 return user;
22596 } else {
22597 return null;
22598 }
22599 }
22600 });
22601};
22602
22603/***/ }),
22604/* 534 */
22605/***/ (function(module, exports, __webpack_require__) {
22606
22607"use strict";
22608
22609
22610var _interopRequireDefault = __webpack_require__(1);
22611
22612var _promise = _interopRequireDefault(__webpack_require__(10));
22613
22614var _keys = _interopRequireDefault(__webpack_require__(53));
22615
22616var _ = __webpack_require__(2);
22617
22618var EventEmitter = __webpack_require__(223);
22619
22620var _require = __webpack_require__(31),
22621 inherits = _require.inherits;
22622
22623var _require2 = __webpack_require__(27),
22624 request = _require2.request;
22625
22626var subscribe = function subscribe(queryJSON, subscriptionId) {
22627 return request({
22628 method: 'POST',
22629 path: '/LiveQuery/subscribe',
22630 data: {
22631 query: queryJSON,
22632 id: subscriptionId
22633 }
22634 });
22635};
22636
22637module.exports = function (AV) {
22638 var requireRealtime = function requireRealtime() {
22639 if (!AV._config.realtime) {
22640 throw new Error('LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query');
22641 }
22642 };
22643 /**
22644 * @class
22645 * A LiveQuery, created by {@link AV.Query#subscribe} is an EventEmitter notifies changes of the Query.
22646 * @since 3.0.0
22647 */
22648
22649
22650 AV.LiveQuery = inherits(EventEmitter,
22651 /** @lends AV.LiveQuery.prototype */
22652 {
22653 constructor: function constructor(id, client, queryJSON, subscriptionId) {
22654 var _this = this;
22655
22656 EventEmitter.apply(this);
22657 this.id = id;
22658 this._client = client;
22659
22660 this._client.register(this);
22661
22662 this._queryJSON = queryJSON;
22663 this._subscriptionId = subscriptionId;
22664 this._onMessage = this._dispatch.bind(this);
22665
22666 this._onReconnect = function () {
22667 subscribe(_this._queryJSON, _this._subscriptionId).catch(function (error) {
22668 return console.error("LiveQuery resubscribe error: ".concat(error.message));
22669 });
22670 };
22671
22672 client.on('message', this._onMessage);
22673 client.on('reconnect', this._onReconnect);
22674 },
22675 _dispatch: function _dispatch(message) {
22676 var _this2 = this;
22677
22678 message.forEach(function (_ref) {
22679 var op = _ref.op,
22680 object = _ref.object,
22681 queryId = _ref.query_id,
22682 updatedKeys = _ref.updatedKeys;
22683 if (queryId !== _this2.id) return;
22684 var target = AV.parseJSON(_.extend({
22685 __type: object.className === '_File' ? 'File' : 'Object'
22686 }, object));
22687
22688 if (updatedKeys) {
22689 /**
22690 * An existing AV.Object which fulfills the Query you subscribe is updated.
22691 * @event AV.LiveQuery#update
22692 * @param {AV.Object|AV.File} target updated object
22693 * @param {String[]} updatedKeys updated keys
22694 */
22695
22696 /**
22697 * An existing AV.Object which doesn't fulfill the Query is updated and now it fulfills the Query.
22698 * @event AV.LiveQuery#enter
22699 * @param {AV.Object|AV.File} target updated object
22700 * @param {String[]} updatedKeys updated keys
22701 */
22702
22703 /**
22704 * An existing AV.Object which fulfills the Query is updated and now it doesn't fulfill the Query.
22705 * @event AV.LiveQuery#leave
22706 * @param {AV.Object|AV.File} target updated object
22707 * @param {String[]} updatedKeys updated keys
22708 */
22709 _this2.emit(op, target, updatedKeys);
22710 } else {
22711 /**
22712 * A new AV.Object which fulfills the Query you subscribe is created.
22713 * @event AV.LiveQuery#create
22714 * @param {AV.Object|AV.File} target updated object
22715 */
22716
22717 /**
22718 * An existing AV.Object which fulfills the Query you subscribe is deleted.
22719 * @event AV.LiveQuery#delete
22720 * @param {AV.Object|AV.File} target updated object
22721 */
22722 _this2.emit(op, target);
22723 }
22724 });
22725 },
22726
22727 /**
22728 * unsubscribe the query
22729 *
22730 * @return {Promise}
22731 */
22732 unsubscribe: function unsubscribe() {
22733 var client = this._client;
22734 client.off('message', this._onMessage);
22735 client.off('reconnect', this._onReconnect);
22736 client.deregister(this);
22737 return request({
22738 method: 'POST',
22739 path: '/LiveQuery/unsubscribe',
22740 data: {
22741 id: client.id,
22742 query_id: this.id
22743 }
22744 });
22745 }
22746 },
22747 /** @lends AV.LiveQuery */
22748 {
22749 init: function init(query) {
22750 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
22751 _ref2$subscriptionId = _ref2.subscriptionId,
22752 userDefinedSubscriptionId = _ref2$subscriptionId === void 0 ? AV._getSubscriptionId() : _ref2$subscriptionId;
22753
22754 requireRealtime();
22755 if (!(query instanceof AV.Query)) throw new TypeError('LiveQuery must be inited with a Query');
22756 return _promise.default.resolve(userDefinedSubscriptionId).then(function (subscriptionId) {
22757 return AV._config.realtime.createLiveQueryClient(subscriptionId).then(function (liveQueryClient) {
22758 var _query$_getParams = query._getParams(),
22759 where = _query$_getParams.where,
22760 keys = (0, _keys.default)(_query$_getParams),
22761 returnACL = _query$_getParams.returnACL;
22762
22763 var queryJSON = {
22764 where: where,
22765 keys: keys,
22766 returnACL: returnACL,
22767 className: query.className
22768 };
22769 var promise = subscribe(queryJSON, subscriptionId).then(function (_ref3) {
22770 var queryId = _ref3.query_id;
22771 return new AV.LiveQuery(queryId, liveQueryClient, queryJSON, subscriptionId);
22772 }).finally(function () {
22773 liveQueryClient.deregister(promise);
22774 });
22775 liveQueryClient.register(promise);
22776 return promise;
22777 });
22778 });
22779 },
22780
22781 /**
22782 * Pause the LiveQuery connection. This is useful to deactivate the SDK when the app is swtiched to background.
22783 * @static
22784 * @return void
22785 */
22786 pause: function pause() {
22787 requireRealtime();
22788 return AV._config.realtime.pause();
22789 },
22790
22791 /**
22792 * Resume the LiveQuery connection. All subscriptions will be restored after reconnection.
22793 * @static
22794 * @return void
22795 */
22796 resume: function resume() {
22797 requireRealtime();
22798 return AV._config.realtime.resume();
22799 }
22800 });
22801};
22802
22803/***/ }),
22804/* 535 */
22805/***/ (function(module, exports, __webpack_require__) {
22806
22807"use strict";
22808
22809
22810var _ = __webpack_require__(2);
22811
22812var _require = __webpack_require__(31),
22813 tap = _require.tap;
22814
22815module.exports = function (AV) {
22816 /**
22817 * @class
22818 * @example
22819 * AV.Captcha.request().then(captcha => {
22820 * captcha.bind({
22821 * textInput: 'code', // the id for textInput
22822 * image: 'captcha',
22823 * verifyButton: 'verify',
22824 * }, {
22825 * success: (validateCode) => {}, // next step
22826 * error: (error) => {}, // present error.message to user
22827 * });
22828 * });
22829 */
22830 AV.Captcha = function Captcha(options, authOptions) {
22831 this._options = options;
22832 this._authOptions = authOptions;
22833 /**
22834 * The image url of the captcha
22835 * @type string
22836 */
22837
22838 this.url = undefined;
22839 /**
22840 * The captchaToken of the captcha.
22841 * @type string
22842 */
22843
22844 this.captchaToken = undefined;
22845 /**
22846 * The validateToken of the captcha.
22847 * @type string
22848 */
22849
22850 this.validateToken = undefined;
22851 };
22852 /**
22853 * Refresh the captcha
22854 * @return {Promise.<string>} a new capcha url
22855 */
22856
22857
22858 AV.Captcha.prototype.refresh = function refresh() {
22859 var _this = this;
22860
22861 return AV.Cloud._requestCaptcha(this._options, this._authOptions).then(function (_ref) {
22862 var captchaToken = _ref.captchaToken,
22863 url = _ref.url;
22864
22865 _.extend(_this, {
22866 captchaToken: captchaToken,
22867 url: url
22868 });
22869
22870 return url;
22871 });
22872 };
22873 /**
22874 * Verify the captcha
22875 * @param {String} code The code from user input
22876 * @return {Promise.<string>} validateToken if the code is valid
22877 */
22878
22879
22880 AV.Captcha.prototype.verify = function verify(code) {
22881 var _this2 = this;
22882
22883 return AV.Cloud.verifyCaptcha(code, this.captchaToken).then(tap(function (validateToken) {
22884 return _this2.validateToken = validateToken;
22885 }));
22886 };
22887
22888 if (true) {
22889 /**
22890 * Bind the captcha to HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
22891 * @param [elements]
22892 * @param {String|HTMLInputElement} [elements.textInput] An input element typed text, or the id for the element.
22893 * @param {String|HTMLImageElement} [elements.image] An image element, or the id for the element.
22894 * @param {String|HTMLElement} [elements.verifyButton] A button element, or the id for the element.
22895 * @param [callbacks]
22896 * @param {Function} [callbacks.success] Success callback will be called if the code is verified. The param `validateCode` can be used for further SMS request.
22897 * @param {Function} [callbacks.error] Error callback will be called if something goes wrong, detailed in param `error.message`.
22898 */
22899 AV.Captcha.prototype.bind = function bind(_ref2, _ref3) {
22900 var _this3 = this;
22901
22902 var textInput = _ref2.textInput,
22903 image = _ref2.image,
22904 verifyButton = _ref2.verifyButton;
22905 var success = _ref3.success,
22906 error = _ref3.error;
22907
22908 if (typeof textInput === 'string') {
22909 textInput = document.getElementById(textInput);
22910 if (!textInput) throw new Error("textInput with id ".concat(textInput, " not found"));
22911 }
22912
22913 if (typeof image === 'string') {
22914 image = document.getElementById(image);
22915 if (!image) throw new Error("image with id ".concat(image, " not found"));
22916 }
22917
22918 if (typeof verifyButton === 'string') {
22919 verifyButton = document.getElementById(verifyButton);
22920 if (!verifyButton) throw new Error("verifyButton with id ".concat(verifyButton, " not found"));
22921 }
22922
22923 this.__refresh = function () {
22924 return _this3.refresh().then(function (url) {
22925 image.src = url;
22926
22927 if (textInput) {
22928 textInput.value = '';
22929 textInput.focus();
22930 }
22931 }).catch(function (err) {
22932 return console.warn("refresh captcha fail: ".concat(err.message));
22933 });
22934 };
22935
22936 if (image) {
22937 this.__image = image;
22938 image.src = this.url;
22939 image.addEventListener('click', this.__refresh);
22940 }
22941
22942 this.__verify = function () {
22943 var code = textInput.value;
22944
22945 _this3.verify(code).catch(function (err) {
22946 _this3.__refresh();
22947
22948 throw err;
22949 }).then(success, error).catch(function (err) {
22950 return console.warn("verify captcha fail: ".concat(err.message));
22951 });
22952 };
22953
22954 if (textInput && verifyButton) {
22955 this.__verifyButton = verifyButton;
22956 verifyButton.addEventListener('click', this.__verify);
22957 }
22958 };
22959 /**
22960 * unbind the captcha from HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
22961 */
22962
22963
22964 AV.Captcha.prototype.unbind = function unbind() {
22965 if (this.__image) this.__image.removeEventListener('click', this.__refresh);
22966 if (this.__verifyButton) this.__verifyButton.removeEventListener('click', this.__verify);
22967 };
22968 }
22969 /**
22970 * Request a captcha
22971 * @param [options]
22972 * @param {Number} [options.width] width(px) of the captcha, ranged 60-200
22973 * @param {Number} [options.height] height(px) of the captcha, ranged 30-100
22974 * @param {Number} [options.size=4] length of the captcha, ranged 3-6. MasterKey required.
22975 * @param {Number} [options.ttl=60] time to live(s), ranged 10-180. MasterKey required.
22976 * @return {Promise.<AV.Captcha>}
22977 */
22978
22979
22980 AV.Captcha.request = function (options, authOptions) {
22981 var captcha = new AV.Captcha(options, authOptions);
22982 return captcha.refresh().then(function () {
22983 return captcha;
22984 });
22985 };
22986};
22987
22988/***/ }),
22989/* 536 */
22990/***/ (function(module, exports, __webpack_require__) {
22991
22992"use strict";
22993
22994
22995var _interopRequireDefault = __webpack_require__(1);
22996
22997var _promise = _interopRequireDefault(__webpack_require__(10));
22998
22999var _ = __webpack_require__(2);
23000
23001var _require = __webpack_require__(27),
23002 _request = _require._request,
23003 request = _require.request;
23004
23005module.exports = function (AV) {
23006 /**
23007 * Contains functions for calling and declaring
23008 * <p><strong><em>
23009 * Some functions are only available from Cloud Code.
23010 * </em></strong></p>
23011 *
23012 * @namespace
23013 * @borrows AV.Captcha.request as requestCaptcha
23014 */
23015 AV.Cloud = AV.Cloud || {};
23016
23017 _.extend(AV.Cloud,
23018 /** @lends AV.Cloud */
23019 {
23020 /**
23021 * Makes a call to a cloud function.
23022 * @param {String} name The function name.
23023 * @param {Object} [data] The parameters to send to the cloud function.
23024 * @param {AuthOptions} [options]
23025 * @return {Promise} A promise that will be resolved with the result
23026 * of the function.
23027 */
23028 run: function run(name, data, options) {
23029 return request({
23030 service: 'engine',
23031 method: 'POST',
23032 path: "/functions/".concat(name),
23033 data: AV._encode(data, null, true),
23034 authOptions: options
23035 }).then(function (resp) {
23036 return AV._decode(resp).result;
23037 });
23038 },
23039
23040 /**
23041 * Makes a call to a cloud function, you can send {AV.Object} as param or a field of param; the response
23042 * from server will also be parsed as an {AV.Object}, array of {AV.Object}, or object includes {AV.Object}
23043 * @param {String} name The function name.
23044 * @param {Object} [data] The parameters to send to the cloud function.
23045 * @param {AuthOptions} [options]
23046 * @return {Promise} A promise that will be resolved with the result of the function.
23047 */
23048 rpc: function rpc(name, data, options) {
23049 if (_.isArray(data)) {
23050 return _promise.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK."));
23051 }
23052
23053 return request({
23054 service: 'engine',
23055 method: 'POST',
23056 path: "/call/".concat(name),
23057 data: AV._encodeObjectOrArray(data),
23058 authOptions: options
23059 }).then(function (resp) {
23060 return AV._decode(resp).result;
23061 });
23062 },
23063
23064 /**
23065 * Make a call to request server date time.
23066 * @return {Promise.<Date>} A promise that will be resolved with the result
23067 * of the function.
23068 * @since 0.5.9
23069 */
23070 getServerDate: function getServerDate() {
23071 return _request('date', null, null, 'GET').then(function (resp) {
23072 return AV._decode(resp);
23073 });
23074 },
23075
23076 /**
23077 * Makes a call to request an sms code for operation verification.
23078 * @param {String|Object} data The mobile phone number string or a JSON
23079 * object that contains mobilePhoneNumber,template,sign,op,ttl,name etc.
23080 * @param {String} data.mobilePhoneNumber
23081 * @param {String} [data.template] sms template name
23082 * @param {String} [data.sign] sms signature name
23083 * @param {String} [data.smsType] sending code by `sms` (default) or `voice` call
23084 * @param {SMSAuthOptions} [options]
23085 * @return {Promise} A promise that will be resolved if the request succeed
23086 */
23087 requestSmsCode: function requestSmsCode(data) {
23088 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23089
23090 if (_.isString(data)) {
23091 data = {
23092 mobilePhoneNumber: data
23093 };
23094 }
23095
23096 if (!data.mobilePhoneNumber) {
23097 throw new Error('Missing mobilePhoneNumber.');
23098 }
23099
23100 if (options.validateToken) {
23101 data = _.extend({}, data, {
23102 validate_token: options.validateToken
23103 });
23104 }
23105
23106 return _request('requestSmsCode', null, null, 'POST', data, options);
23107 },
23108
23109 /**
23110 * Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
23111 * @param {String} code The sms code sent by AV.Cloud.requestSmsCode
23112 * @param {phone} phone The mobile phoner number.
23113 * @return {Promise} A promise that will be resolved with the result
23114 * of the function.
23115 */
23116 verifySmsCode: function verifySmsCode(code, phone) {
23117 if (!code) throw new Error('Missing sms code.');
23118 var params = {};
23119
23120 if (_.isString(phone)) {
23121 params['mobilePhoneNumber'] = phone;
23122 }
23123
23124 return _request('verifySmsCode', code, null, 'POST', params);
23125 },
23126 _requestCaptcha: function _requestCaptcha(options, authOptions) {
23127 return _request('requestCaptcha', null, null, 'GET', options, authOptions).then(function (_ref) {
23128 var url = _ref.captcha_url,
23129 captchaToken = _ref.captcha_token;
23130 return {
23131 captchaToken: captchaToken,
23132 url: url
23133 };
23134 });
23135 },
23136
23137 /**
23138 * Request a captcha.
23139 */
23140 requestCaptcha: AV.Captcha.request,
23141
23142 /**
23143 * Verify captcha code. This is the low-level API for captcha.
23144 * Checkout {@link AV.Captcha} for high abstract APIs.
23145 * @param {String} code the code from user input
23146 * @param {String} captchaToken captchaToken returned by {@link AV.Cloud.requestCaptcha}
23147 * @return {Promise.<String>} validateToken if the code is valid
23148 */
23149 verifyCaptcha: function verifyCaptcha(code, captchaToken) {
23150 return _request('verifyCaptcha', null, null, 'POST', {
23151 captcha_code: code,
23152 captcha_token: captchaToken
23153 }).then(function (_ref2) {
23154 var validateToken = _ref2.validate_token;
23155 return validateToken;
23156 });
23157 }
23158 });
23159};
23160
23161/***/ }),
23162/* 537 */
23163/***/ (function(module, exports, __webpack_require__) {
23164
23165"use strict";
23166
23167
23168var request = __webpack_require__(27).request;
23169
23170module.exports = function (AV) {
23171 AV.Installation = AV.Object.extend('_Installation');
23172 /**
23173 * @namespace
23174 */
23175
23176 AV.Push = AV.Push || {};
23177 /**
23178 * Sends a push notification.
23179 * @param {Object} data The data of the push notification.
23180 * @param {String[]} [data.channels] An Array of channels to push to.
23181 * @param {Date} [data.push_time] A Date object for when to send the push.
23182 * @param {Date} [data.expiration_time] A Date object for when to expire
23183 * the push.
23184 * @param {Number} [data.expiration_interval] The seconds from now to expire the push.
23185 * @param {Number} [data.flow_control] The clients to notify per second
23186 * @param {AV.Query} [data.where] An AV.Query over AV.Installation that is used to match
23187 * a set of installations to push to.
23188 * @param {String} [data.cql] A CQL statement over AV.Installation that is used to match
23189 * a set of installations to push to.
23190 * @param {Object} data.data The data to send as part of the push.
23191 More details: https://url.leanapp.cn/pushData
23192 * @param {AuthOptions} [options]
23193 * @return {Promise}
23194 */
23195
23196 AV.Push.send = function (data, options) {
23197 if (data.where) {
23198 data.where = data.where._getParams().where;
23199 }
23200
23201 if (data.where && data.cql) {
23202 throw new Error("Both where and cql can't be set");
23203 }
23204
23205 if (data.push_time) {
23206 data.push_time = data.push_time.toJSON();
23207 }
23208
23209 if (data.expiration_time) {
23210 data.expiration_time = data.expiration_time.toJSON();
23211 }
23212
23213 if (data.expiration_time && data.expiration_interval) {
23214 throw new Error("Both expiration_time and expiration_interval can't be set");
23215 }
23216
23217 return request({
23218 service: 'push',
23219 method: 'POST',
23220 path: '/push',
23221 data: data,
23222 authOptions: options
23223 });
23224 };
23225};
23226
23227/***/ }),
23228/* 538 */
23229/***/ (function(module, exports, __webpack_require__) {
23230
23231"use strict";
23232
23233
23234var _interopRequireDefault = __webpack_require__(1);
23235
23236var _promise = _interopRequireDefault(__webpack_require__(10));
23237
23238var _typeof2 = _interopRequireDefault(__webpack_require__(141));
23239
23240var _ = __webpack_require__(2);
23241
23242var AVRequest = __webpack_require__(27)._request;
23243
23244var _require = __webpack_require__(31),
23245 getSessionToken = _require.getSessionToken;
23246
23247module.exports = function (AV) {
23248 var getUser = function getUser() {
23249 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23250 var sessionToken = getSessionToken(options);
23251
23252 if (sessionToken) {
23253 return AV.User._fetchUserBySessionToken(getSessionToken(options));
23254 }
23255
23256 return AV.User.currentAsync();
23257 };
23258
23259 var getUserPointer = function getUserPointer(options) {
23260 return getUser(options).then(function (currUser) {
23261 return AV.Object.createWithoutData('_User', currUser.id)._toPointer();
23262 });
23263 };
23264 /**
23265 * Contains functions to deal with Status in LeanCloud.
23266 * @class
23267 */
23268
23269
23270 AV.Status = function (imageUrl, message) {
23271 this.data = {};
23272 this.inboxType = 'default';
23273 this.query = null;
23274
23275 if (imageUrl && (0, _typeof2.default)(imageUrl) === 'object') {
23276 this.data = imageUrl;
23277 } else {
23278 if (imageUrl) {
23279 this.data.image = imageUrl;
23280 }
23281
23282 if (message) {
23283 this.data.message = message;
23284 }
23285 }
23286
23287 return this;
23288 };
23289
23290 _.extend(AV.Status.prototype,
23291 /** @lends AV.Status.prototype */
23292 {
23293 /**
23294 * Gets the value of an attribute in status data.
23295 * @param {String} attr The string name of an attribute.
23296 */
23297 get: function get(attr) {
23298 return this.data[attr];
23299 },
23300
23301 /**
23302 * Sets a hash of model attributes on the status data.
23303 * @param {String} key The key to set.
23304 * @param {any} value The value to give it.
23305 */
23306 set: function set(key, value) {
23307 this.data[key] = value;
23308 return this;
23309 },
23310
23311 /**
23312 * Destroy this status,then it will not be avaiable in other user's inboxes.
23313 * @param {AuthOptions} options
23314 * @return {Promise} A promise that is fulfilled when the destroy
23315 * completes.
23316 */
23317 destroy: function destroy(options) {
23318 if (!this.id) return _promise.default.reject(new Error('The status id is not exists.'));
23319 var request = AVRequest('statuses', null, this.id, 'DELETE', options);
23320 return request;
23321 },
23322
23323 /**
23324 * Cast the AV.Status object to an AV.Object pointer.
23325 * @return {AV.Object} A AV.Object pointer.
23326 */
23327 toObject: function toObject() {
23328 if (!this.id) return null;
23329 return AV.Object.createWithoutData('_Status', this.id);
23330 },
23331 _getDataJSON: function _getDataJSON() {
23332 var json = _.clone(this.data);
23333
23334 return AV._encode(json);
23335 },
23336
23337 /**
23338 * Send a status by a AV.Query object.
23339 * @since 0.3.0
23340 * @param {AuthOptions} options
23341 * @return {Promise} A promise that is fulfilled when the send
23342 * completes.
23343 * @example
23344 * // send a status to male users
23345 * var status = new AVStatus('image url', 'a message');
23346 * status.query = new AV.Query('_User');
23347 * status.query.equalTo('gender', 'male');
23348 * status.send().then(function(){
23349 * //send status successfully.
23350 * }, function(err){
23351 * //an error threw.
23352 * console.dir(err);
23353 * });
23354 */
23355 send: function send() {
23356 var _this = this;
23357
23358 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23359
23360 if (!getSessionToken(options) && !AV.User.current()) {
23361 throw new Error('Please signin an user.');
23362 }
23363
23364 if (!this.query) {
23365 return AV.Status.sendStatusToFollowers(this, options);
23366 }
23367
23368 return getUserPointer(options).then(function (currUser) {
23369 var query = _this.query._getParams();
23370
23371 query.className = _this.query.className;
23372 var data = {};
23373 data.query = query;
23374 _this.data = _this.data || {};
23375 _this.data.source = _this.data.source || currUser;
23376 data.data = _this._getDataJSON();
23377 data.inboxType = _this.inboxType || 'default';
23378 return AVRequest('statuses', null, null, 'POST', data, options);
23379 }).then(function (response) {
23380 _this.id = response.objectId;
23381 _this.createdAt = AV._parseDate(response.createdAt);
23382 return _this;
23383 });
23384 },
23385 _finishFetch: function _finishFetch(serverData) {
23386 this.id = serverData.objectId;
23387 this.createdAt = AV._parseDate(serverData.createdAt);
23388 this.updatedAt = AV._parseDate(serverData.updatedAt);
23389 this.messageId = serverData.messageId;
23390 delete serverData.messageId;
23391 delete serverData.objectId;
23392 delete serverData.createdAt;
23393 delete serverData.updatedAt;
23394 this.data = AV._decode(serverData);
23395 }
23396 });
23397 /**
23398 * Send a status to current signined user's followers.
23399 * @since 0.3.0
23400 * @param {AV.Status} status A status object to be send to followers.
23401 * @param {AuthOptions} options
23402 * @return {Promise} A promise that is fulfilled when the send
23403 * completes.
23404 * @example
23405 * var status = new AVStatus('image url', 'a message');
23406 * AV.Status.sendStatusToFollowers(status).then(function(){
23407 * //send status successfully.
23408 * }, function(err){
23409 * //an error threw.
23410 * console.dir(err);
23411 * });
23412 */
23413
23414
23415 AV.Status.sendStatusToFollowers = function (status) {
23416 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23417
23418 if (!getSessionToken(options) && !AV.User.current()) {
23419 throw new Error('Please signin an user.');
23420 }
23421
23422 return getUserPointer(options).then(function (currUser) {
23423 var query = {};
23424 query.className = '_Follower';
23425 query.keys = 'follower';
23426 query.where = {
23427 user: currUser
23428 };
23429 var data = {};
23430 data.query = query;
23431 status.data = status.data || {};
23432 status.data.source = status.data.source || currUser;
23433 data.data = status._getDataJSON();
23434 data.inboxType = status.inboxType || 'default';
23435 var request = AVRequest('statuses', null, null, 'POST', data, options);
23436 return request.then(function (response) {
23437 status.id = response.objectId;
23438 status.createdAt = AV._parseDate(response.createdAt);
23439 return status;
23440 });
23441 });
23442 };
23443 /**
23444 * <p>Send a status from current signined user to other user's private status inbox.</p>
23445 * @since 0.3.0
23446 * @param {AV.Status} status A status object to be send to followers.
23447 * @param {String} target The target user or user's objectId.
23448 * @param {AuthOptions} options
23449 * @return {Promise} A promise that is fulfilled when the send
23450 * completes.
23451 * @example
23452 * // send a private status to user '52e84e47e4b0f8de283b079b'
23453 * var status = new AVStatus('image url', 'a message');
23454 * AV.Status.sendPrivateStatus(status, '52e84e47e4b0f8de283b079b').then(function(){
23455 * //send status successfully.
23456 * }, function(err){
23457 * //an error threw.
23458 * console.dir(err);
23459 * });
23460 */
23461
23462
23463 AV.Status.sendPrivateStatus = function (status, target) {
23464 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23465
23466 if (!getSessionToken(options) && !AV.User.current()) {
23467 throw new Error('Please signin an user.');
23468 }
23469
23470 if (!target) {
23471 throw new Error('Invalid target user.');
23472 }
23473
23474 var userObjectId = _.isString(target) ? target : target.id;
23475
23476 if (!userObjectId) {
23477 throw new Error('Invalid target user.');
23478 }
23479
23480 return getUserPointer(options).then(function (currUser) {
23481 var query = {};
23482 query.className = '_User';
23483 query.where = {
23484 objectId: userObjectId
23485 };
23486 var data = {};
23487 data.query = query;
23488 status.data = status.data || {};
23489 status.data.source = status.data.source || currUser;
23490 data.data = status._getDataJSON();
23491 data.inboxType = 'private';
23492 status.inboxType = 'private';
23493 var request = AVRequest('statuses', null, null, 'POST', data, options);
23494 return request.then(function (response) {
23495 status.id = response.objectId;
23496 status.createdAt = AV._parseDate(response.createdAt);
23497 return status;
23498 });
23499 });
23500 };
23501 /**
23502 * Count unread statuses in someone's inbox.
23503 * @since 0.3.0
23504 * @param {AV.User} owner The status owner.
23505 * @param {String} inboxType The inbox type, 'default' by default.
23506 * @param {AuthOptions} options
23507 * @return {Promise} A promise that is fulfilled when the count
23508 * completes.
23509 * @example
23510 * AV.Status.countUnreadStatuses(AV.User.current()).then(function(response){
23511 * console.log(response.unread); //unread statuses number.
23512 * console.log(response.total); //total statuses number.
23513 * });
23514 */
23515
23516
23517 AV.Status.countUnreadStatuses = function (owner) {
23518 var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
23519 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23520 if (!_.isString(inboxType)) options = inboxType;
23521
23522 if (!getSessionToken(options) && owner == null && !AV.User.current()) {
23523 throw new Error('Please signin an user or pass the owner objectId.');
23524 }
23525
23526 return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
23527 var params = {};
23528 params.inboxType = AV._encode(inboxType);
23529 params.owner = AV._encode(owner);
23530 return AVRequest('subscribe/statuses/count', null, null, 'GET', params, options);
23531 });
23532 };
23533 /**
23534 * reset unread statuses count in someone's inbox.
23535 * @since 2.1.0
23536 * @param {AV.User} owner The status owner.
23537 * @param {String} inboxType The inbox type, 'default' by default.
23538 * @param {AuthOptions} options
23539 * @return {Promise} A promise that is fulfilled when the reset
23540 * completes.
23541 * @example
23542 * AV.Status.resetUnreadCount(AV.User.current()).then(function(response){
23543 * console.log(response.unread); //unread statuses number.
23544 * console.log(response.total); //total statuses number.
23545 * });
23546 */
23547
23548
23549 AV.Status.resetUnreadCount = function (owner) {
23550 var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
23551 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23552 if (!_.isString(inboxType)) options = inboxType;
23553
23554 if (!getSessionToken(options) && owner == null && !AV.User.current()) {
23555 throw new Error('Please signin an user or pass the owner objectId.');
23556 }
23557
23558 return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
23559 var params = {};
23560 params.inboxType = AV._encode(inboxType);
23561 params.owner = AV._encode(owner);
23562 return AVRequest('subscribe/statuses/resetUnreadCount', null, null, 'POST', params, options);
23563 });
23564 };
23565 /**
23566 * Create a status query to find someone's published statuses.
23567 * @since 0.3.0
23568 * @param {AV.User} source The status source, typically the publisher.
23569 * @return {AV.Query} The query object for status.
23570 * @example
23571 * //Find current user's published statuses.
23572 * var query = AV.Status.statusQuery(AV.User.current());
23573 * query.find().then(function(statuses){
23574 * //process statuses
23575 * });
23576 */
23577
23578
23579 AV.Status.statusQuery = function (source) {
23580 var query = new AV.Query('_Status');
23581
23582 if (source) {
23583 query.equalTo('source', source);
23584 }
23585
23586 return query;
23587 };
23588 /**
23589 * <p>AV.InboxQuery defines a query that is used to fetch somebody's inbox statuses.</p>
23590 * @class
23591 */
23592
23593
23594 AV.InboxQuery = AV.Query._extend(
23595 /** @lends AV.InboxQuery.prototype */
23596 {
23597 _objectClass: AV.Status,
23598 _sinceId: 0,
23599 _maxId: 0,
23600 _inboxType: 'default',
23601 _owner: null,
23602 _newObject: function _newObject() {
23603 return new AV.Status();
23604 },
23605 _createRequest: function _createRequest(params, options) {
23606 return AV.InboxQuery.__super__._createRequest.call(this, params, options, '/subscribe/statuses');
23607 },
23608
23609 /**
23610 * Sets the messageId of results to skip before returning any results.
23611 * This is useful for pagination.
23612 * Default is zero.
23613 * @param {Number} n the mesage id.
23614 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23615 */
23616 sinceId: function sinceId(id) {
23617 this._sinceId = id;
23618 return this;
23619 },
23620
23621 /**
23622 * Sets the maximal messageId of results。
23623 * This is useful for pagination.
23624 * Default is zero that is no limition.
23625 * @param {Number} n the mesage id.
23626 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23627 */
23628 maxId: function maxId(id) {
23629 this._maxId = id;
23630 return this;
23631 },
23632
23633 /**
23634 * Sets the owner of the querying inbox.
23635 * @param {AV.User} owner The inbox owner.
23636 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23637 */
23638 owner: function owner(_owner) {
23639 this._owner = _owner;
23640 return this;
23641 },
23642
23643 /**
23644 * Sets the querying inbox type.default is 'default'.
23645 * @param {String} type The inbox type.
23646 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23647 */
23648 inboxType: function inboxType(type) {
23649 this._inboxType = type;
23650 return this;
23651 },
23652 _getParams: function _getParams() {
23653 var params = AV.InboxQuery.__super__._getParams.call(this);
23654
23655 params.owner = AV._encode(this._owner);
23656 params.inboxType = AV._encode(this._inboxType);
23657 params.sinceId = AV._encode(this._sinceId);
23658 params.maxId = AV._encode(this._maxId);
23659 return params;
23660 }
23661 });
23662 /**
23663 * Create a inbox status query to find someone's inbox statuses.
23664 * @since 0.3.0
23665 * @param {AV.User} owner The inbox's owner
23666 * @param {String} inboxType The inbox type,'default' by default.
23667 * @return {AV.InboxQuery} The inbox query object.
23668 * @see AV.InboxQuery
23669 * @example
23670 * //Find current user's default inbox statuses.
23671 * var query = AV.Status.inboxQuery(AV.User.current());
23672 * //find the statuses after the last message id
23673 * query.sinceId(lastMessageId);
23674 * query.find().then(function(statuses){
23675 * //process statuses
23676 * });
23677 */
23678
23679 AV.Status.inboxQuery = function (owner, inboxType) {
23680 var query = new AV.InboxQuery(AV.Status);
23681
23682 if (owner) {
23683 query._owner = owner;
23684 }
23685
23686 if (inboxType) {
23687 query._inboxType = inboxType;
23688 }
23689
23690 return query;
23691 };
23692};
23693
23694/***/ }),
23695/* 539 */
23696/***/ (function(module, exports, __webpack_require__) {
23697
23698"use strict";
23699
23700
23701var _interopRequireDefault = __webpack_require__(1);
23702
23703var _stringify = _interopRequireDefault(__webpack_require__(37));
23704
23705var _map = _interopRequireDefault(__webpack_require__(42));
23706
23707var _ = __webpack_require__(2);
23708
23709var AVRequest = __webpack_require__(27)._request;
23710
23711module.exports = function (AV) {
23712 /**
23713 * A builder to generate sort string for app searching.For example:
23714 * @class
23715 * @since 0.5.1
23716 * @example
23717 * var builder = new AV.SearchSortBuilder();
23718 * builder.ascending('key1').descending('key2','max');
23719 * var query = new AV.SearchQuery('Player');
23720 * query.sortBy(builder);
23721 * query.find().then();
23722 */
23723 AV.SearchSortBuilder = function () {
23724 this._sortFields = [];
23725 };
23726
23727 _.extend(AV.SearchSortBuilder.prototype,
23728 /** @lends AV.SearchSortBuilder.prototype */
23729 {
23730 _addField: function _addField(key, order, mode, missing) {
23731 var field = {};
23732 field[key] = {
23733 order: order || 'asc',
23734 mode: mode || 'avg',
23735 missing: '_' + (missing || 'last')
23736 };
23737
23738 this._sortFields.push(field);
23739
23740 return this;
23741 },
23742
23743 /**
23744 * Sorts the results in ascending order by the given key and options.
23745 *
23746 * @param {String} key The key to order by.
23747 * @param {String} mode The sort mode, default is 'avg', you can choose
23748 * 'max' or 'min' too.
23749 * @param {String} missing The missing key behaviour, default is 'last',
23750 * you can choose 'first' too.
23751 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23752 */
23753 ascending: function ascending(key, mode, missing) {
23754 return this._addField(key, 'asc', mode, missing);
23755 },
23756
23757 /**
23758 * Sorts the results in descending order by the given key and options.
23759 *
23760 * @param {String} key The key to order by.
23761 * @param {String} mode The sort mode, default is 'avg', you can choose
23762 * 'max' or 'min' too.
23763 * @param {String} missing The missing key behaviour, default is 'last',
23764 * you can choose 'first' too.
23765 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23766 */
23767 descending: function descending(key, mode, missing) {
23768 return this._addField(key, 'desc', mode, missing);
23769 },
23770
23771 /**
23772 * Add a proximity based constraint for finding objects with key point
23773 * values near the point given.
23774 * @param {String} key The key that the AV.GeoPoint is stored in.
23775 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
23776 * @param {Object} options The other options such as mode,order, unit etc.
23777 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23778 */
23779 whereNear: function whereNear(key, point, options) {
23780 options = options || {};
23781 var field = {};
23782 var geo = {
23783 lat: point.latitude,
23784 lon: point.longitude
23785 };
23786 var m = {
23787 order: options.order || 'asc',
23788 mode: options.mode || 'avg',
23789 unit: options.unit || 'km'
23790 };
23791 m[key] = geo;
23792 field['_geo_distance'] = m;
23793
23794 this._sortFields.push(field);
23795
23796 return this;
23797 },
23798
23799 /**
23800 * Build a sort string by configuration.
23801 * @return {String} the sort string.
23802 */
23803 build: function build() {
23804 return (0, _stringify.default)(AV._encode(this._sortFields));
23805 }
23806 });
23807 /**
23808 * App searching query.Use just like AV.Query:
23809 *
23810 * Visit <a href='https://leancloud.cn/docs/app_search_guide.html'>App Searching Guide</a>
23811 * for more details.
23812 * @class
23813 * @since 0.5.1
23814 * @example
23815 * var query = new AV.SearchQuery('Player');
23816 * query.queryString('*');
23817 * query.find().then(function(results) {
23818 * console.log('Found %d objects', query.hits());
23819 * //Process results
23820 * });
23821 */
23822
23823
23824 AV.SearchQuery = AV.Query._extend(
23825 /** @lends AV.SearchQuery.prototype */
23826 {
23827 _sid: null,
23828 _hits: 0,
23829 _queryString: null,
23830 _highlights: null,
23831 _sortBuilder: null,
23832 _clazz: null,
23833 constructor: function constructor(className) {
23834 if (className) {
23835 this._clazz = className;
23836 } else {
23837 className = '__INVALID_CLASS';
23838 }
23839
23840 AV.Query.call(this, className);
23841 },
23842 _createRequest: function _createRequest(params, options) {
23843 return AVRequest('search/select', null, null, 'GET', params || this._getParams(), options);
23844 },
23845
23846 /**
23847 * Sets the sid of app searching query.Default is null.
23848 * @param {String} sid Scroll id for searching.
23849 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23850 */
23851 sid: function sid(_sid) {
23852 this._sid = _sid;
23853 return this;
23854 },
23855
23856 /**
23857 * Sets the query string of app searching.
23858 * @param {String} q The query string.
23859 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23860 */
23861 queryString: function queryString(q) {
23862 this._queryString = q;
23863 return this;
23864 },
23865
23866 /**
23867 * Sets the highlight fields. Such as
23868 * <pre><code>
23869 * query.highlights('title');
23870 * //or pass an array.
23871 * query.highlights(['title', 'content'])
23872 * </code></pre>
23873 * @param {String|String[]} highlights a list of fields.
23874 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23875 */
23876 highlights: function highlights(_highlights) {
23877 var objects;
23878
23879 if (_highlights && _.isString(_highlights)) {
23880 objects = _.toArray(arguments);
23881 } else {
23882 objects = _highlights;
23883 }
23884
23885 this._highlights = objects;
23886 return this;
23887 },
23888
23889 /**
23890 * Sets the sort builder for this query.
23891 * @see AV.SearchSortBuilder
23892 * @param { AV.SearchSortBuilder} builder The sort builder.
23893 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23894 *
23895 */
23896 sortBy: function sortBy(builder) {
23897 this._sortBuilder = builder;
23898 return this;
23899 },
23900
23901 /**
23902 * Returns the number of objects that match this query.
23903 * @return {Number}
23904 */
23905 hits: function hits() {
23906 if (!this._hits) {
23907 this._hits = 0;
23908 }
23909
23910 return this._hits;
23911 },
23912 _processResult: function _processResult(json) {
23913 delete json['className'];
23914 delete json['_app_url'];
23915 delete json['_deeplink'];
23916 return json;
23917 },
23918
23919 /**
23920 * Returns true when there are more documents can be retrieved by this
23921 * query instance, you can call find function to get more results.
23922 * @see AV.SearchQuery#find
23923 * @return {Boolean}
23924 */
23925 hasMore: function hasMore() {
23926 return !this._hitEnd;
23927 },
23928
23929 /**
23930 * Reset current query instance state(such as sid, hits etc) except params
23931 * for a new searching. After resetting, hasMore() will return true.
23932 */
23933 reset: function reset() {
23934 this._hitEnd = false;
23935 this._sid = null;
23936 this._hits = 0;
23937 },
23938
23939 /**
23940 * Retrieves a list of AVObjects that satisfy this query.
23941 * Either options.success or options.error is called when the find
23942 * completes.
23943 *
23944 * @see AV.Query#find
23945 * @param {AuthOptions} options
23946 * @return {Promise} A promise that is resolved with the results when
23947 * the query completes.
23948 */
23949 find: function find(options) {
23950 var self = this;
23951
23952 var request = this._createRequest(undefined, options);
23953
23954 return request.then(function (response) {
23955 //update sid for next querying.
23956 if (response.sid) {
23957 self._oldSid = self._sid;
23958 self._sid = response.sid;
23959 } else {
23960 self._sid = null;
23961 self._hitEnd = true;
23962 }
23963
23964 self._hits = response.hits || 0;
23965 return (0, _map.default)(_).call(_, response.results, function (json) {
23966 if (json.className) {
23967 response.className = json.className;
23968 }
23969
23970 var obj = self._newObject(response);
23971
23972 obj.appURL = json['_app_url'];
23973
23974 obj._finishFetch(self._processResult(json), true);
23975
23976 return obj;
23977 });
23978 });
23979 },
23980 _getParams: function _getParams() {
23981 var params = AV.SearchQuery.__super__._getParams.call(this);
23982
23983 delete params.where;
23984
23985 if (this._clazz) {
23986 params.clazz = this.className;
23987 }
23988
23989 if (this._sid) {
23990 params.sid = this._sid;
23991 }
23992
23993 if (!this._queryString) {
23994 throw new Error('Please set query string.');
23995 } else {
23996 params.q = this._queryString;
23997 }
23998
23999 if (this._highlights) {
24000 params.highlights = this._highlights.join(',');
24001 }
24002
24003 if (this._sortBuilder && params.order) {
24004 throw new Error('sort and order can not be set at same time.');
24005 }
24006
24007 if (this._sortBuilder) {
24008 params.sort = this._sortBuilder.build();
24009 }
24010
24011 return params;
24012 }
24013 });
24014};
24015/**
24016 * Sorts the results in ascending order by the given key.
24017 *
24018 * @method AV.SearchQuery#ascending
24019 * @param {String} key The key to order by.
24020 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24021 */
24022
24023/**
24024 * Also sorts the results in ascending order by the given key. The previous sort keys have
24025 * precedence over this key.
24026 *
24027 * @method AV.SearchQuery#addAscending
24028 * @param {String} key The key to order by
24029 * @return {AV.SearchQuery} Returns the query so you can chain this call.
24030 */
24031
24032/**
24033 * Sorts the results in descending order by the given key.
24034 *
24035 * @method AV.SearchQuery#descending
24036 * @param {String} key The key to order by.
24037 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24038 */
24039
24040/**
24041 * Also sorts the results in descending order by the given key. The previous sort keys have
24042 * precedence over this key.
24043 *
24044 * @method AV.SearchQuery#addDescending
24045 * @param {String} key The key to order by
24046 * @return {AV.SearchQuery} Returns the query so you can chain this call.
24047 */
24048
24049/**
24050 * Include nested AV.Objects for the provided key. You can use dot
24051 * notation to specify which fields in the included object are also fetch.
24052 * @method AV.SearchQuery#include
24053 * @param {String[]} keys The name of the key to include.
24054 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24055 */
24056
24057/**
24058 * Sets the number of results to skip before returning any results.
24059 * This is useful for pagination.
24060 * Default is to skip zero results.
24061 * @method AV.SearchQuery#skip
24062 * @param {Number} n the number of results to skip.
24063 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24064 */
24065
24066/**
24067 * Sets the limit of the number of results to return. The default limit is
24068 * 100, with a maximum of 1000 results being returned at a time.
24069 * @method AV.SearchQuery#limit
24070 * @param {Number} n the number of results to limit to.
24071 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24072 */
24073
24074/***/ }),
24075/* 540 */
24076/***/ (function(module, exports, __webpack_require__) {
24077
24078"use strict";
24079
24080
24081var _interopRequireDefault = __webpack_require__(1);
24082
24083var _promise = _interopRequireDefault(__webpack_require__(10));
24084
24085var _ = __webpack_require__(2);
24086
24087var AVError = __webpack_require__(43);
24088
24089var _require = __webpack_require__(27),
24090 request = _require.request;
24091
24092module.exports = function (AV) {
24093 /**
24094 * 包含了使用了 LeanCloud
24095 * <a href='/docs/leaninsight_guide.html'>离线数据分析功能</a>的函数。
24096 * <p><strong><em>
24097 * 仅在云引擎运行环境下有效。
24098 * </em></strong></p>
24099 * @namespace
24100 */
24101 AV.Insight = AV.Insight || {};
24102
24103 _.extend(AV.Insight,
24104 /** @lends AV.Insight */
24105 {
24106 /**
24107 * 开始一个 Insight 任务。结果里将返回 Job id,你可以拿得到的 id 使用
24108 * AV.Insight.JobQuery 查询任务状态和结果。
24109 * @param {Object} jobConfig 任务配置的 JSON 对象,例如:<code><pre>
24110 * { "sql" : "select count(*) as c,gender from _User group by gender",
24111 * "saveAs": {
24112 * "className" : "UserGender",
24113 * "limit": 1
24114 * }
24115 * }
24116 * </pre></code>
24117 * sql 指定任务执行的 SQL 语句, saveAs(可选) 指定将结果保存在哪张表里,limit 最大 1000。
24118 * @param {AuthOptions} [options]
24119 * @return {Promise} A promise that will be resolved with the result
24120 * of the function.
24121 */
24122 startJob: function startJob(jobConfig, options) {
24123 if (!jobConfig || !jobConfig.sql) {
24124 throw new Error('Please provide the sql to run the job.');
24125 }
24126
24127 var data = {
24128 jobConfig: jobConfig,
24129 appId: AV.applicationId
24130 };
24131 return request({
24132 path: '/bigquery/jobs',
24133 method: 'POST',
24134 data: AV._encode(data, null, true),
24135 authOptions: options,
24136 signKey: false
24137 }).then(function (resp) {
24138 return AV._decode(resp).id;
24139 });
24140 },
24141
24142 /**
24143 * 监听 Insight 任务事件(未来推出独立部署的离线分析服务后开放)
24144 * <p><strong><em>
24145 * 仅在云引擎运行环境下有效。
24146 * </em></strong></p>
24147 * @param {String} event 监听的事件,目前尚不支持。
24148 * @param {Function} 监听回调函数,接收 (err, id) 两个参数,err 表示错误信息,
24149 * id 表示任务 id。接下来你可以拿这个 id 使用AV.Insight.JobQuery 查询任务状态和结果。
24150 *
24151 */
24152 on: function on(event, cb) {}
24153 });
24154 /**
24155 * 创建一个对象,用于查询 Insight 任务状态和结果。
24156 * @class
24157 * @param {String} id 任务 id
24158 * @since 0.5.5
24159 */
24160
24161
24162 AV.Insight.JobQuery = function (id, className) {
24163 if (!id) {
24164 throw new Error('Please provide the job id.');
24165 }
24166
24167 this.id = id;
24168 this.className = className;
24169 this._skip = 0;
24170 this._limit = 100;
24171 };
24172
24173 _.extend(AV.Insight.JobQuery.prototype,
24174 /** @lends AV.Insight.JobQuery.prototype */
24175 {
24176 /**
24177 * Sets the number of results to skip before returning any results.
24178 * This is useful for pagination.
24179 * Default is to skip zero results.
24180 * @param {Number} n the number of results to skip.
24181 * @return {AV.Query} Returns the query, so you can chain this call.
24182 */
24183 skip: function skip(n) {
24184 this._skip = n;
24185 return this;
24186 },
24187
24188 /**
24189 * Sets the limit of the number of results to return. The default limit is
24190 * 100, with a maximum of 1000 results being returned at a time.
24191 * @param {Number} n the number of results to limit to.
24192 * @return {AV.Query} Returns the query, so you can chain this call.
24193 */
24194 limit: function limit(n) {
24195 this._limit = n;
24196 return this;
24197 },
24198
24199 /**
24200 * 查询任务状态和结果,任务结果为一个 JSON 对象,包括 status 表示任务状态, totalCount 表示总数,
24201 * results 数组表示任务结果数组,previewCount 表示可以返回的结果总数,任务的开始和截止时间
24202 * startTime、endTime 等信息。
24203 *
24204 * @param {AuthOptions} [options]
24205 * @return {Promise} A promise that will be resolved with the result
24206 * of the function.
24207 *
24208 */
24209 find: function find(options) {
24210 var params = {
24211 skip: this._skip,
24212 limit: this._limit
24213 };
24214 return request({
24215 path: "/bigquery/jobs/".concat(this.id),
24216 method: 'GET',
24217 query: params,
24218 authOptions: options,
24219 signKey: false
24220 }).then(function (response) {
24221 if (response.error) {
24222 return _promise.default.reject(new AVError(response.code, response.error));
24223 }
24224
24225 return _promise.default.resolve(response);
24226 });
24227 }
24228 });
24229};
24230
24231/***/ }),
24232/* 541 */
24233/***/ (function(module, exports, __webpack_require__) {
24234
24235"use strict";
24236
24237
24238var _interopRequireDefault = __webpack_require__(1);
24239
24240var _promise = _interopRequireDefault(__webpack_require__(10));
24241
24242var _ = __webpack_require__(2);
24243
24244var _require = __webpack_require__(27),
24245 LCRequest = _require.request;
24246
24247var _require2 = __webpack_require__(31),
24248 getSessionToken = _require2.getSessionToken;
24249
24250module.exports = function (AV) {
24251 var getUserWithSessionToken = function getUserWithSessionToken(authOptions) {
24252 if (authOptions.user) {
24253 if (!authOptions.user._sessionToken) {
24254 throw new Error('authOptions.user is not signed in.');
24255 }
24256
24257 return _promise.default.resolve(authOptions.user);
24258 }
24259
24260 if (authOptions.sessionToken) {
24261 return AV.User._fetchUserBySessionToken(authOptions.sessionToken);
24262 }
24263
24264 return AV.User.currentAsync();
24265 };
24266
24267 var getSessionTokenAsync = function getSessionTokenAsync(authOptions) {
24268 var sessionToken = getSessionToken(authOptions);
24269
24270 if (sessionToken) {
24271 return _promise.default.resolve(sessionToken);
24272 }
24273
24274 return AV.User.currentAsync().then(function (user) {
24275 if (user) {
24276 return user.getSessionToken();
24277 }
24278 });
24279 };
24280 /**
24281 * Contains functions to deal with Friendship in LeanCloud.
24282 * @class
24283 */
24284
24285
24286 AV.Friendship = {
24287 /**
24288 * Request friendship.
24289 * @since 4.8.0
24290 * @param {String | AV.User | Object} options if an AV.User or string is given, it will be used as the friend.
24291 * @param {AV.User | string} options.friend The friend (or friend's objectId) to follow.
24292 * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of followeeQuery.
24293 * @param {AuthOptions} [authOptions]
24294 * @return {Promise<void>}
24295 */
24296 request: function request(options) {
24297 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24298 var friend;
24299 var attributes;
24300
24301 if (options.friend) {
24302 friend = options.friend;
24303 attributes = options.attributes;
24304 } else {
24305 friend = options;
24306 }
24307
24308 var friendObj = _.isString(friend) ? AV.Object.createWithoutData('_User', friend) : friend;
24309 return getUserWithSessionToken(authOptions).then(function (userObj) {
24310 if (!userObj) {
24311 throw new Error('Please signin an user.');
24312 }
24313
24314 return LCRequest({
24315 method: 'POST',
24316 path: '/users/friendshipRequests',
24317 data: {
24318 user: userObj._toPointer(),
24319 friend: friendObj._toPointer(),
24320 friendship: attributes
24321 },
24322 authOptions: authOptions
24323 });
24324 });
24325 },
24326
24327 /**
24328 * Accept a friendship request.
24329 * @since 4.8.0
24330 * @param {AV.Object | string | Object} options if an AV.Object or string is given, it will be used as the request in _FriendshipRequest.
24331 * @param {AV.Object} options.request The request (or it's objectId) to be accepted.
24332 * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of {@link AV#followeeQuery}.
24333 * @param {AuthOptions} [authOptions]
24334 * @return {Promise<void>}
24335 */
24336 acceptRequest: function acceptRequest(options) {
24337 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24338 var request;
24339 var attributes;
24340
24341 if (options.request) {
24342 request = options.request;
24343 attributes = options.attributes;
24344 } else {
24345 request = options;
24346 }
24347
24348 var requestId = _.isString(request) ? request : request.id;
24349 return getSessionTokenAsync(authOptions).then(function (sessionToken) {
24350 if (!sessionToken) {
24351 throw new Error('Please signin an user.');
24352 }
24353
24354 return LCRequest({
24355 method: 'PUT',
24356 path: '/users/friendshipRequests/' + requestId + '/accept',
24357 data: {
24358 friendship: AV._encode(attributes)
24359 },
24360 authOptions: authOptions
24361 });
24362 });
24363 },
24364
24365 /**
24366 * Decline a friendship request.
24367 * @param {AV.Object | string} request The request (or it's objectId) to be declined.
24368 * @param {AuthOptions} [authOptions]
24369 * @return {Promise<void>}
24370 */
24371 declineRequest: function declineRequest(request) {
24372 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24373 var requestId = _.isString(request) ? request : request.id;
24374 return getSessionTokenAsync(authOptions).then(function (sessionToken) {
24375 if (!sessionToken) {
24376 throw new Error('Please signin an user.');
24377 }
24378
24379 return LCRequest({
24380 method: 'PUT',
24381 path: '/users/friendshipRequests/' + requestId + '/decline',
24382 authOptions: authOptions
24383 });
24384 });
24385 }
24386 };
24387};
24388
24389/***/ }),
24390/* 542 */
24391/***/ (function(module, exports, __webpack_require__) {
24392
24393"use strict";
24394
24395
24396var _interopRequireDefault = __webpack_require__(1);
24397
24398var _stringify = _interopRequireDefault(__webpack_require__(37));
24399
24400var _ = __webpack_require__(2);
24401
24402var _require = __webpack_require__(27),
24403 _request = _require._request;
24404
24405var AV = __webpack_require__(67);
24406
24407var serializeMessage = function serializeMessage(message) {
24408 if (typeof message === 'string') {
24409 return message;
24410 }
24411
24412 if (typeof message.getPayload === 'function') {
24413 return (0, _stringify.default)(message.getPayload());
24414 }
24415
24416 return (0, _stringify.default)(message);
24417};
24418/**
24419 * <p>An AV.Conversation is a local representation of a LeanCloud realtime's
24420 * conversation. This class is a subclass of AV.Object, and retains the
24421 * same functionality of an AV.Object, but also extends it with various
24422 * conversation specific methods, like get members, creators of this conversation.
24423 * </p>
24424 *
24425 * @class AV.Conversation
24426 * @param {String} name The name of the Role to create.
24427 * @param {Object} [options]
24428 * @param {Boolean} [options.isSystem] Set this conversation as system conversation.
24429 * @param {Boolean} [options.isTransient] Set this conversation as transient conversation.
24430 */
24431
24432
24433module.exports = AV.Object.extend('_Conversation',
24434/** @lends AV.Conversation.prototype */
24435{
24436 constructor: function constructor(name) {
24437 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24438 AV.Object.prototype.constructor.call(this, null, null);
24439 this.set('name', name);
24440
24441 if (options.isSystem !== undefined) {
24442 this.set('sys', options.isSystem ? true : false);
24443 }
24444
24445 if (options.isTransient !== undefined) {
24446 this.set('tr', options.isTransient ? true : false);
24447 }
24448 },
24449
24450 /**
24451 * Get current conversation's creator.
24452 *
24453 * @return {String}
24454 */
24455 getCreator: function getCreator() {
24456 return this.get('c');
24457 },
24458
24459 /**
24460 * Get the last message's time.
24461 *
24462 * @return {Date}
24463 */
24464 getLastMessageAt: function getLastMessageAt() {
24465 return this.get('lm');
24466 },
24467
24468 /**
24469 * Get this conversation's members
24470 *
24471 * @return {String[]}
24472 */
24473 getMembers: function getMembers() {
24474 return this.get('m');
24475 },
24476
24477 /**
24478 * Add a member to this conversation
24479 *
24480 * @param {String} member
24481 */
24482 addMember: function addMember(member) {
24483 return this.add('m', member);
24484 },
24485
24486 /**
24487 * Get this conversation's members who set this conversation as muted.
24488 *
24489 * @return {String[]}
24490 */
24491 getMutedMembers: function getMutedMembers() {
24492 return this.get('mu');
24493 },
24494
24495 /**
24496 * Get this conversation's name field.
24497 *
24498 * @return String
24499 */
24500 getName: function getName() {
24501 return this.get('name');
24502 },
24503
24504 /**
24505 * Returns true if this conversation is transient conversation.
24506 *
24507 * @return {Boolean}
24508 */
24509 isTransient: function isTransient() {
24510 return this.get('tr');
24511 },
24512
24513 /**
24514 * Returns true if this conversation is system conversation.
24515 *
24516 * @return {Boolean}
24517 */
24518 isSystem: function isSystem() {
24519 return this.get('sys');
24520 },
24521
24522 /**
24523 * Send realtime message to this conversation, using HTTP request.
24524 *
24525 * @param {String} fromClient Sender's client id.
24526 * @param {String|Object} message The message which will send to conversation.
24527 * It could be a raw string, or an object with a `toJSON` method, like a
24528 * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}
24529 * @param {Object} [options]
24530 * @param {Boolean} [options.transient] Whether send this message as transient message or not.
24531 * @param {String[]} [options.toClients] Ids of clients to send to. This option can be used only in system conversation.
24532 * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}
24533 * @param {AuthOptions} [authOptions]
24534 * @return {Promise}
24535 */
24536 send: function send(fromClient, message) {
24537 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24538 var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24539 var data = {
24540 from_peer: fromClient,
24541 conv_id: this.id,
24542 transient: false,
24543 message: serializeMessage(message)
24544 };
24545
24546 if (options.toClients !== undefined) {
24547 data.to_peers = options.toClients;
24548 }
24549
24550 if (options.transient !== undefined) {
24551 data.transient = options.transient ? true : false;
24552 }
24553
24554 if (options.pushData !== undefined) {
24555 data.push_data = options.pushData;
24556 }
24557
24558 return _request('rtm', 'messages', null, 'POST', data, authOptions);
24559 },
24560
24561 /**
24562 * Send realtime broadcast message to all clients, via this conversation, using HTTP request.
24563 *
24564 * @param {String} fromClient Sender's client id.
24565 * @param {String|Object} message The message which will send to conversation.
24566 * It could be a raw string, or an object with a `toJSON` method, like a
24567 * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}.
24568 * @param {Object} [options]
24569 * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}.
24570 * @param {Object} [options.validTill] The message will valid till this time.
24571 * @param {AuthOptions} [authOptions]
24572 * @return {Promise}
24573 */
24574 broadcast: function broadcast(fromClient, message) {
24575 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24576 var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24577 var data = {
24578 from_peer: fromClient,
24579 conv_id: this.id,
24580 message: serializeMessage(message)
24581 };
24582
24583 if (options.pushData !== undefined) {
24584 data.push = options.pushData;
24585 }
24586
24587 if (options.validTill !== undefined) {
24588 var ts = options.validTill;
24589
24590 if (_.isDate(ts)) {
24591 ts = ts.getTime();
24592 }
24593
24594 options.valid_till = ts;
24595 }
24596
24597 return _request('rtm', 'broadcast', null, 'POST', data, authOptions);
24598 }
24599});
24600
24601/***/ }),
24602/* 543 */
24603/***/ (function(module, exports, __webpack_require__) {
24604
24605"use strict";
24606
24607
24608var _interopRequireDefault = __webpack_require__(1);
24609
24610var _promise = _interopRequireDefault(__webpack_require__(10));
24611
24612var _map = _interopRequireDefault(__webpack_require__(42));
24613
24614var _concat = _interopRequireDefault(__webpack_require__(25));
24615
24616var _ = __webpack_require__(2);
24617
24618var _require = __webpack_require__(27),
24619 request = _require.request;
24620
24621var _require2 = __webpack_require__(31),
24622 ensureArray = _require2.ensureArray,
24623 parseDate = _require2.parseDate;
24624
24625var AV = __webpack_require__(67);
24626/**
24627 * The version change interval for Leaderboard
24628 * @enum
24629 */
24630
24631
24632AV.LeaderboardVersionChangeInterval = {
24633 NEVER: 'never',
24634 DAY: 'day',
24635 WEEK: 'week',
24636 MONTH: 'month'
24637};
24638/**
24639 * The order of the leaderboard results
24640 * @enum
24641 */
24642
24643AV.LeaderboardOrder = {
24644 ASCENDING: 'ascending',
24645 DESCENDING: 'descending'
24646};
24647/**
24648 * The update strategy for Leaderboard
24649 * @enum
24650 */
24651
24652AV.LeaderboardUpdateStrategy = {
24653 /** Only keep the best statistic. If the leaderboard is in descending order, the best statistic is the highest one. */
24654 BETTER: 'better',
24655
24656 /** Keep the last updated statistic */
24657 LAST: 'last',
24658
24659 /** Keep the sum of all updated statistics */
24660 SUM: 'sum'
24661};
24662/**
24663 * @typedef {Object} Ranking
24664 * @property {number} rank Starts at 0
24665 * @property {number} value the statistic value of this ranking
24666 * @property {AV.User} user The user of this ranking
24667 * @property {Statistic[]} [includedStatistics] Other statistics of the user, specified by the `includeStatistic` option of `AV.Leaderboard.getResults()`
24668 */
24669
24670/**
24671 * @typedef {Object} LeaderboardArchive
24672 * @property {string} statisticName
24673 * @property {number} version version of the leaderboard
24674 * @property {string} status
24675 * @property {string} url URL for the downloadable archive
24676 * @property {Date} activatedAt time when this version became active
24677 * @property {Date} deactivatedAt time when this version was deactivated by a version incrementing
24678 */
24679
24680/**
24681 * @class
24682 */
24683
24684function Statistic(_ref) {
24685 var name = _ref.name,
24686 value = _ref.value,
24687 version = _ref.version;
24688
24689 /**
24690 * @type {string}
24691 */
24692 this.name = name;
24693 /**
24694 * @type {number}
24695 */
24696
24697 this.value = value;
24698 /**
24699 * @type {number?}
24700 */
24701
24702 this.version = version;
24703}
24704
24705var parseStatisticData = function parseStatisticData(statisticData) {
24706 var _AV$_decode = AV._decode(statisticData),
24707 name = _AV$_decode.statisticName,
24708 value = _AV$_decode.statisticValue,
24709 version = _AV$_decode.version;
24710
24711 return new Statistic({
24712 name: name,
24713 value: value,
24714 version: version
24715 });
24716};
24717/**
24718 * @class
24719 */
24720
24721
24722AV.Leaderboard = function Leaderboard(statisticName) {
24723 /**
24724 * @type {string}
24725 */
24726 this.statisticName = statisticName;
24727 /**
24728 * @type {AV.LeaderboardOrder}
24729 */
24730
24731 this.order = undefined;
24732 /**
24733 * @type {AV.LeaderboardUpdateStrategy}
24734 */
24735
24736 this.updateStrategy = undefined;
24737 /**
24738 * @type {AV.LeaderboardVersionChangeInterval}
24739 */
24740
24741 this.versionChangeInterval = undefined;
24742 /**
24743 * @type {number}
24744 */
24745
24746 this.version = undefined;
24747 /**
24748 * @type {Date?}
24749 */
24750
24751 this.nextResetAt = undefined;
24752 /**
24753 * @type {Date?}
24754 */
24755
24756 this.createdAt = undefined;
24757};
24758
24759var Leaderboard = AV.Leaderboard;
24760/**
24761 * Create an instance of Leaderboard for the give statistic name.
24762 * @param {string} statisticName
24763 * @return {AV.Leaderboard}
24764 */
24765
24766AV.Leaderboard.createWithoutData = function (statisticName) {
24767 return new Leaderboard(statisticName);
24768};
24769/**
24770 * (masterKey required) Create a new Leaderboard.
24771 * @param {Object} options
24772 * @param {string} options.statisticName
24773 * @param {AV.LeaderboardOrder} options.order
24774 * @param {AV.LeaderboardVersionChangeInterval} [options.versionChangeInterval] default to WEEK
24775 * @param {AV.LeaderboardUpdateStrategy} [options.updateStrategy] default to BETTER
24776 * @param {AuthOptions} [authOptions]
24777 * @return {Promise<AV.Leaderboard>}
24778 */
24779
24780
24781AV.Leaderboard.createLeaderboard = function (_ref2, authOptions) {
24782 var statisticName = _ref2.statisticName,
24783 order = _ref2.order,
24784 versionChangeInterval = _ref2.versionChangeInterval,
24785 updateStrategy = _ref2.updateStrategy;
24786 return request({
24787 method: 'POST',
24788 path: '/leaderboard/leaderboards',
24789 data: {
24790 statisticName: statisticName,
24791 order: order,
24792 versionChangeInterval: versionChangeInterval,
24793 updateStrategy: updateStrategy
24794 },
24795 authOptions: authOptions
24796 }).then(function (data) {
24797 var leaderboard = new Leaderboard(statisticName);
24798 return leaderboard._finishFetch(data);
24799 });
24800};
24801/**
24802 * Get the Leaderboard with the specified statistic name.
24803 * @param {string} statisticName
24804 * @param {AuthOptions} [authOptions]
24805 * @return {Promise<AV.Leaderboard>}
24806 */
24807
24808
24809AV.Leaderboard.getLeaderboard = function (statisticName, authOptions) {
24810 return Leaderboard.createWithoutData(statisticName).fetch(authOptions);
24811};
24812/**
24813 * Get Statistics for the specified user.
24814 * @param {AV.User} user The specified AV.User pointer.
24815 * @param {Object} [options]
24816 * @param {string[]} [options.statisticNames] Specify the statisticNames. If not set, all statistics of the user will be fetched.
24817 * @param {AuthOptions} [authOptions]
24818 * @return {Promise<Statistic[]>}
24819 */
24820
24821
24822AV.Leaderboard.getStatistics = function (user) {
24823 var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
24824 statisticNames = _ref3.statisticNames;
24825
24826 var authOptions = arguments.length > 2 ? arguments[2] : undefined;
24827 return _promise.default.resolve().then(function () {
24828 if (!(user && user.id)) throw new Error('user must be an AV.User');
24829 return request({
24830 method: 'GET',
24831 path: "/leaderboard/users/".concat(user.id, "/statistics"),
24832 query: {
24833 statistics: statisticNames ? ensureArray(statisticNames).join(',') : undefined
24834 },
24835 authOptions: authOptions
24836 }).then(function (_ref4) {
24837 var results = _ref4.results;
24838 return (0, _map.default)(results).call(results, parseStatisticData);
24839 });
24840 });
24841};
24842/**
24843 * Update Statistics for the specified user.
24844 * @param {AV.User} user The specified AV.User pointer.
24845 * @param {Object} statistics A name-value pair representing the statistics to update.
24846 * @param {AuthOptions} [options] AuthOptions plus:
24847 * @param {boolean} [options.overwrite] Wethere to overwrite these statistics disregarding the updateStrategy of there leaderboards
24848 * @return {Promise<Statistic[]>}
24849 */
24850
24851
24852AV.Leaderboard.updateStatistics = function (user, statistics) {
24853 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24854 return _promise.default.resolve().then(function () {
24855 if (!(user && user.id)) throw new Error('user must be an AV.User');
24856 var data = (0, _map.default)(_).call(_, statistics, function (value, key) {
24857 return {
24858 statisticName: key,
24859 statisticValue: value
24860 };
24861 });
24862 var overwrite = options.overwrite;
24863 return request({
24864 method: 'POST',
24865 path: "/leaderboard/users/".concat(user.id, "/statistics"),
24866 query: {
24867 overwrite: overwrite ? 1 : undefined
24868 },
24869 data: data,
24870 authOptions: options
24871 }).then(function (_ref5) {
24872 var results = _ref5.results;
24873 return (0, _map.default)(results).call(results, parseStatisticData);
24874 });
24875 });
24876};
24877/**
24878 * Delete Statistics for the specified user.
24879 * @param {AV.User} user The specified AV.User pointer.
24880 * @param {Object} statistics A name-value pair representing the statistics to delete.
24881 * @param {AuthOptions} [options]
24882 * @return {Promise<void>}
24883 */
24884
24885
24886AV.Leaderboard.deleteStatistics = function (user, statisticNames, authOptions) {
24887 return _promise.default.resolve().then(function () {
24888 if (!(user && user.id)) throw new Error('user must be an AV.User');
24889 return request({
24890 method: 'DELETE',
24891 path: "/leaderboard/users/".concat(user.id, "/statistics"),
24892 query: {
24893 statistics: ensureArray(statisticNames).join(',')
24894 },
24895 authOptions: authOptions
24896 }).then(function () {
24897 return undefined;
24898 });
24899 });
24900};
24901
24902_.extend(Leaderboard.prototype,
24903/** @lends AV.Leaderboard.prototype */
24904{
24905 _finishFetch: function _finishFetch(data) {
24906 var _this = this;
24907
24908 _.forEach(data, function (value, key) {
24909 if (key === 'updatedAt' || key === 'objectId') return;
24910
24911 if (key === 'expiredAt') {
24912 key = 'nextResetAt';
24913 }
24914
24915 if (key === 'createdAt') {
24916 value = parseDate(value);
24917 }
24918
24919 if (value && value.__type === 'Date') {
24920 value = parseDate(value.iso);
24921 }
24922
24923 _this[key] = value;
24924 });
24925
24926 return this;
24927 },
24928
24929 /**
24930 * Fetch data from the srever.
24931 * @param {AuthOptions} [authOptions]
24932 * @return {Promise<AV.Leaderboard>}
24933 */
24934 fetch: function fetch(authOptions) {
24935 var _this2 = this;
24936
24937 return request({
24938 method: 'GET',
24939 path: "/leaderboard/leaderboards/".concat(this.statisticName),
24940 authOptions: authOptions
24941 }).then(function (data) {
24942 return _this2._finishFetch(data);
24943 });
24944 },
24945
24946 /**
24947 * Counts the number of users participated in this leaderboard
24948 * @param {Object} [options]
24949 * @param {number} [options.version] Specify the version of the leaderboard
24950 * @param {AuthOptions} [authOptions]
24951 * @return {Promise<number>}
24952 */
24953 count: function count() {
24954 var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
24955 version = _ref6.version;
24956
24957 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
24958 return request({
24959 method: 'GET',
24960 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks"),
24961 query: {
24962 count: 1,
24963 limit: 0,
24964 version: version
24965 },
24966 authOptions: authOptions
24967 }).then(function (_ref7) {
24968 var count = _ref7.count;
24969 return count;
24970 });
24971 },
24972 _getResults: function _getResults(_ref8, authOptions, userId) {
24973 var _context;
24974
24975 var skip = _ref8.skip,
24976 limit = _ref8.limit,
24977 selectUserKeys = _ref8.selectUserKeys,
24978 includeUserKeys = _ref8.includeUserKeys,
24979 includeStatistics = _ref8.includeStatistics,
24980 version = _ref8.version;
24981 return request({
24982 method: 'GET',
24983 path: (0, _concat.default)(_context = "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks")).call(_context, userId ? "/".concat(userId) : ''),
24984 query: {
24985 skip: skip,
24986 limit: limit,
24987 selectUserKeys: _.union(ensureArray(selectUserKeys), ensureArray(includeUserKeys)).join(',') || undefined,
24988 includeUser: includeUserKeys ? ensureArray(includeUserKeys).join(',') : undefined,
24989 includeStatistics: includeStatistics ? ensureArray(includeStatistics).join(',') : undefined,
24990 version: version
24991 },
24992 authOptions: authOptions
24993 }).then(function (_ref9) {
24994 var rankings = _ref9.results;
24995 return (0, _map.default)(rankings).call(rankings, function (rankingData) {
24996 var _AV$_decode2 = AV._decode(rankingData),
24997 user = _AV$_decode2.user,
24998 value = _AV$_decode2.statisticValue,
24999 rank = _AV$_decode2.rank,
25000 _AV$_decode2$statisti = _AV$_decode2.statistics,
25001 statistics = _AV$_decode2$statisti === void 0 ? [] : _AV$_decode2$statisti;
25002
25003 return {
25004 user: user,
25005 value: value,
25006 rank: rank,
25007 includedStatistics: (0, _map.default)(statistics).call(statistics, parseStatisticData)
25008 };
25009 });
25010 });
25011 },
25012
25013 /**
25014 * Retrieve a list of ranked users for this Leaderboard.
25015 * @param {Object} [options]
25016 * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
25017 * @param {number} [options.limit] The limit of the number of results.
25018 * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
25019 * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
25020 * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
25021 * @param {number} [options.version] Specify the version of the leaderboard
25022 * @param {AuthOptions} [authOptions]
25023 * @return {Promise<Ranking[]>}
25024 */
25025 getResults: function getResults() {
25026 var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25027 skip = _ref10.skip,
25028 limit = _ref10.limit,
25029 selectUserKeys = _ref10.selectUserKeys,
25030 includeUserKeys = _ref10.includeUserKeys,
25031 includeStatistics = _ref10.includeStatistics,
25032 version = _ref10.version;
25033
25034 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25035 return this._getResults({
25036 skip: skip,
25037 limit: limit,
25038 selectUserKeys: selectUserKeys,
25039 includeUserKeys: includeUserKeys,
25040 includeStatistics: includeStatistics,
25041 version: version
25042 }, authOptions);
25043 },
25044
25045 /**
25046 * Retrieve a list of ranked users for this Leaderboard, centered on the specified user.
25047 * @param {AV.User} user The specified AV.User pointer.
25048 * @param {Object} [options]
25049 * @param {number} [options.limit] The limit of the number of results.
25050 * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
25051 * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
25052 * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
25053 * @param {number} [options.version] Specify the version of the leaderboard
25054 * @param {AuthOptions} [authOptions]
25055 * @return {Promise<Ranking[]>}
25056 */
25057 getResultsAroundUser: function getResultsAroundUser(user) {
25058 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25059 var authOptions = arguments.length > 2 ? arguments[2] : undefined;
25060
25061 // getResultsAroundUser(options, authOptions)
25062 if (user && typeof user.id !== 'string') {
25063 return this.getResultsAroundUser(undefined, user, options);
25064 }
25065
25066 var limit = options.limit,
25067 selectUserKeys = options.selectUserKeys,
25068 includeUserKeys = options.includeUserKeys,
25069 includeStatistics = options.includeStatistics,
25070 version = options.version;
25071 return this._getResults({
25072 limit: limit,
25073 selectUserKeys: selectUserKeys,
25074 includeUserKeys: includeUserKeys,
25075 includeStatistics: includeStatistics,
25076 version: version
25077 }, authOptions, user ? user.id : 'self');
25078 },
25079 _update: function _update(data, authOptions) {
25080 var _this3 = this;
25081
25082 return request({
25083 method: 'PUT',
25084 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25085 data: data,
25086 authOptions: authOptions
25087 }).then(function (result) {
25088 return _this3._finishFetch(result);
25089 });
25090 },
25091
25092 /**
25093 * (masterKey required) Update the version change interval of the Leaderboard.
25094 * @param {AV.LeaderboardVersionChangeInterval} versionChangeInterval
25095 * @param {AuthOptions} [authOptions]
25096 * @return {Promise<AV.Leaderboard>}
25097 */
25098 updateVersionChangeInterval: function updateVersionChangeInterval(versionChangeInterval, authOptions) {
25099 return this._update({
25100 versionChangeInterval: versionChangeInterval
25101 }, authOptions);
25102 },
25103
25104 /**
25105 * (masterKey required) Update the version change interval of the Leaderboard.
25106 * @param {AV.LeaderboardUpdateStrategy} updateStrategy
25107 * @param {AuthOptions} [authOptions]
25108 * @return {Promise<AV.Leaderboard>}
25109 */
25110 updateUpdateStrategy: function updateUpdateStrategy(updateStrategy, authOptions) {
25111 return this._update({
25112 updateStrategy: updateStrategy
25113 }, authOptions);
25114 },
25115
25116 /**
25117 * (masterKey required) Reset the Leaderboard. The version of the Leaderboard will be incremented by 1.
25118 * @param {AuthOptions} [authOptions]
25119 * @return {Promise<AV.Leaderboard>}
25120 */
25121 reset: function reset(authOptions) {
25122 var _this4 = this;
25123
25124 return request({
25125 method: 'PUT',
25126 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/incrementVersion"),
25127 authOptions: authOptions
25128 }).then(function (data) {
25129 return _this4._finishFetch(data);
25130 });
25131 },
25132
25133 /**
25134 * (masterKey required) Delete the Leaderboard and its all archived versions.
25135 * @param {AuthOptions} [authOptions]
25136 * @return {void}
25137 */
25138 destroy: function destroy(authOptions) {
25139 return AV.request({
25140 method: 'DELETE',
25141 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25142 authOptions: authOptions
25143 }).then(function () {
25144 return undefined;
25145 });
25146 },
25147
25148 /**
25149 * (masterKey required) Get archived versions.
25150 * @param {Object} [options]
25151 * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
25152 * @param {number} [options.limit] The limit of the number of results.
25153 * @param {AuthOptions} [authOptions]
25154 * @return {Promise<LeaderboardArchive[]>}
25155 */
25156 getArchives: function getArchives() {
25157 var _this5 = this;
25158
25159 var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25160 skip = _ref11.skip,
25161 limit = _ref11.limit;
25162
25163 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25164 return request({
25165 method: 'GET',
25166 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/archives"),
25167 query: {
25168 skip: skip,
25169 limit: limit
25170 },
25171 authOptions: authOptions
25172 }).then(function (_ref12) {
25173 var results = _ref12.results;
25174 return (0, _map.default)(results).call(results, function (_ref13) {
25175 var version = _ref13.version,
25176 status = _ref13.status,
25177 url = _ref13.url,
25178 activatedAt = _ref13.activatedAt,
25179 deactivatedAt = _ref13.deactivatedAt;
25180 return {
25181 statisticName: _this5.statisticName,
25182 version: version,
25183 status: status,
25184 url: url,
25185 activatedAt: parseDate(activatedAt.iso),
25186 deactivatedAt: parseDate(deactivatedAt.iso)
25187 };
25188 });
25189 });
25190 }
25191});
25192
25193/***/ }),
25194/* 544 */
25195/***/ (function(module, exports, __webpack_require__) {
25196
25197"use strict";
25198
25199
25200var adapters = __webpack_require__(545);
25201
25202module.exports = function (AV) {
25203 AV.setAdapters(adapters);
25204 return AV;
25205};
25206
25207/***/ }),
25208/* 545 */
25209/***/ (function(module, exports, __webpack_require__) {
25210
25211"use strict";
25212
25213
25214var _Object$defineProperty = __webpack_require__(140);
25215
25216_Object$defineProperty(exports, "__esModule", {
25217 value: true
25218});
25219
25220exports.platformInfo = exports.WebSocket = void 0;
25221
25222_Object$defineProperty(exports, "request", {
25223 enumerable: true,
25224 get: function get() {
25225 return _adaptersSuperagent.request;
25226 }
25227});
25228
25229exports.storage = void 0;
25230
25231_Object$defineProperty(exports, "upload", {
25232 enumerable: true,
25233 get: function get() {
25234 return _adaptersSuperagent.upload;
25235 }
25236});
25237
25238var _adaptersSuperagent = __webpack_require__(546);
25239
25240var storage = window.localStorage;
25241exports.storage = storage;
25242var WebSocket = window.WebSocket;
25243exports.WebSocket = WebSocket;
25244var platformInfo = {
25245 name: "Browser"
25246};
25247exports.platformInfo = platformInfo;
25248
25249/***/ }),
25250/* 546 */
25251/***/ (function(module, exports, __webpack_require__) {
25252
25253"use strict";
25254
25255var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
25256 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
25257 return new (P || (P = Promise))(function (resolve, reject) {
25258 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25259 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
25260 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
25261 step((generator = generator.apply(thisArg, _arguments || [])).next());
25262 });
25263};
25264var __generator = (this && this.__generator) || function (thisArg, body) {
25265 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
25266 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25267 function verb(n) { return function (v) { return step([n, v]); }; }
25268 function step(op) {
25269 if (f) throw new TypeError("Generator is already executing.");
25270 while (_) try {
25271 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
25272 if (y = 0, t) op = [op[0] & 2, t.value];
25273 switch (op[0]) {
25274 case 0: case 1: t = op; break;
25275 case 4: _.label++; return { value: op[1], done: false };
25276 case 5: _.label++; y = op[1]; op = [0]; continue;
25277 case 7: op = _.ops.pop(); _.trys.pop(); continue;
25278 default:
25279 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
25280 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
25281 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
25282 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
25283 if (t[2]) _.ops.pop();
25284 _.trys.pop(); continue;
25285 }
25286 op = body.call(thisArg, _);
25287 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
25288 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
25289 }
25290};
25291Object.defineProperty(exports, "__esModule", { value: true });
25292exports.upload = exports.request = void 0;
25293var adapter_utils_1 = __webpack_require__(547);
25294var superagent = __webpack_require__(548);
25295function convertResponse(res) {
25296 return {
25297 ok: res.ok,
25298 status: res.status,
25299 headers: res.header,
25300 data: res.body,
25301 };
25302}
25303var request = function (url, options) {
25304 if (options === void 0) { options = {}; }
25305 return __awaiter(void 0, void 0, void 0, function () {
25306 var _a, method, data, headers, onprogress, signal, req, aborted, onAbort, res, error_1;
25307 return __generator(this, function (_b) {
25308 switch (_b.label) {
25309 case 0:
25310 _a = options.method, method = _a === void 0 ? "GET" : _a, data = options.data, headers = options.headers, onprogress = options.onprogress, signal = options.signal;
25311 if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
25312 throw new adapter_utils_1.AbortError("Request aborted");
25313 }
25314 req = superagent(method, url).ok(function () { return true; });
25315 if (headers) {
25316 req.set(headers);
25317 }
25318 if (onprogress) {
25319 req.on("progress", onprogress);
25320 }
25321 aborted = false;
25322 onAbort = function () {
25323 aborted = true;
25324 req.abort();
25325 };
25326 signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", onAbort);
25327 _b.label = 1;
25328 case 1:
25329 _b.trys.push([1, 3, 4, 5]);
25330 return [4 /*yield*/, req.send(data)];
25331 case 2:
25332 res = _b.sent();
25333 return [2 /*return*/, convertResponse(res)];
25334 case 3:
25335 error_1 = _b.sent();
25336 if (aborted) {
25337 throw new adapter_utils_1.AbortError("Request aborted");
25338 }
25339 throw error_1;
25340 case 4:
25341 signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", onAbort);
25342 return [7 /*endfinally*/];
25343 case 5: return [2 /*return*/];
25344 }
25345 });
25346 });
25347};
25348exports.request = request;
25349var upload = function (url, file, options) {
25350 if (options === void 0) { options = {}; }
25351 return __awaiter(void 0, void 0, void 0, function () {
25352 var _a, method, data, headers, onprogress, signal, req, aborted, onAbort, res, error_2;
25353 return __generator(this, function (_b) {
25354 switch (_b.label) {
25355 case 0:
25356 _a = options.method, method = _a === void 0 ? "POST" : _a, data = options.data, headers = options.headers, onprogress = options.onprogress, signal = options.signal;
25357 if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
25358 throw new adapter_utils_1.AbortError("Request aborted");
25359 }
25360 req = superagent(method, url)
25361 .ok(function () { return true; })
25362 .attach(file.field, file.data, file.name);
25363 if (data) {
25364 req.field(data);
25365 }
25366 if (headers) {
25367 req.set(headers);
25368 }
25369 if (onprogress) {
25370 req.on("progress", onprogress);
25371 }
25372 aborted = false;
25373 onAbort = function () {
25374 aborted = true;
25375 req.abort();
25376 };
25377 signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", onAbort);
25378 _b.label = 1;
25379 case 1:
25380 _b.trys.push([1, 3, 4, 5]);
25381 return [4 /*yield*/, req];
25382 case 2:
25383 res = _b.sent();
25384 return [2 /*return*/, convertResponse(res)];
25385 case 3:
25386 error_2 = _b.sent();
25387 if (aborted) {
25388 throw new adapter_utils_1.AbortError("Request aborted");
25389 }
25390 throw error_2;
25391 case 4:
25392 signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", onAbort);
25393 return [7 /*endfinally*/];
25394 case 5: return [2 /*return*/];
25395 }
25396 });
25397 });
25398};
25399exports.upload = upload;
25400//# sourceMappingURL=index.js.map
25401
25402/***/ }),
25403/* 547 */
25404/***/ (function(module, __webpack_exports__, __webpack_require__) {
25405
25406"use strict";
25407Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
25408/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbortError", function() { return AbortError; });
25409/*! *****************************************************************************
25410Copyright (c) Microsoft Corporation.
25411
25412Permission to use, copy, modify, and/or distribute this software for any
25413purpose with or without fee is hereby granted.
25414
25415THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
25416REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25417AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25418INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
25419LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25420OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25421PERFORMANCE OF THIS SOFTWARE.
25422***************************************************************************** */
25423/* global Reflect, Promise */
25424
25425var extendStatics = function(d, b) {
25426 extendStatics = Object.setPrototypeOf ||
25427 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25428 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
25429 return extendStatics(d, b);
25430};
25431
25432function __extends(d, b) {
25433 extendStatics(d, b);
25434 function __() { this.constructor = d; }
25435 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
25436}
25437
25438var AbortError = /** @class */ (function (_super) {
25439 __extends(AbortError, _super);
25440 function AbortError() {
25441 var _this = _super !== null && _super.apply(this, arguments) || this;
25442 _this.name = "AbortError";
25443 return _this;
25444 }
25445 return AbortError;
25446}(Error));
25447
25448
25449//# sourceMappingURL=index.es.js.map
25450
25451
25452/***/ }),
25453/* 548 */
25454/***/ (function(module, exports, __webpack_require__) {
25455
25456"use strict";
25457
25458
25459var _interopRequireDefault = __webpack_require__(1);
25460
25461var _symbol = _interopRequireDefault(__webpack_require__(87));
25462
25463var _iterator = _interopRequireDefault(__webpack_require__(144));
25464
25465var _trim = _interopRequireDefault(__webpack_require__(549));
25466
25467var _concat = _interopRequireDefault(__webpack_require__(25));
25468
25469var _indexOf = _interopRequireDefault(__webpack_require__(68));
25470
25471var _slice = _interopRequireDefault(__webpack_require__(38));
25472
25473function _typeof(obj) {
25474 "@babel/helpers - typeof";
25475
25476 if (typeof _symbol.default === "function" && typeof _iterator.default === "symbol") {
25477 _typeof = function _typeof(obj) {
25478 return typeof obj;
25479 };
25480 } else {
25481 _typeof = function _typeof(obj) {
25482 return obj && typeof _symbol.default === "function" && obj.constructor === _symbol.default && obj !== _symbol.default.prototype ? "symbol" : typeof obj;
25483 };
25484 }
25485
25486 return _typeof(obj);
25487}
25488/**
25489 * Root reference for iframes.
25490 */
25491
25492
25493var root;
25494
25495if (typeof window !== 'undefined') {
25496 // Browser window
25497 root = window;
25498} else if (typeof self === 'undefined') {
25499 // Other environments
25500 console.warn('Using browser-only version of superagent in non-browser environment');
25501 root = void 0;
25502} else {
25503 // Web Worker
25504 root = self;
25505}
25506
25507var Emitter = __webpack_require__(556);
25508
25509var safeStringify = __webpack_require__(557);
25510
25511var RequestBase = __webpack_require__(558);
25512
25513var isObject = __webpack_require__(244);
25514
25515var ResponseBase = __webpack_require__(579);
25516
25517var Agent = __webpack_require__(587);
25518/**
25519 * Noop.
25520 */
25521
25522
25523function noop() {}
25524/**
25525 * Expose `request`.
25526 */
25527
25528
25529module.exports = function (method, url) {
25530 // callback
25531 if (typeof url === 'function') {
25532 return new exports.Request('GET', method).end(url);
25533 } // url first
25534
25535
25536 if (arguments.length === 1) {
25537 return new exports.Request('GET', method);
25538 }
25539
25540 return new exports.Request(method, url);
25541};
25542
25543exports = module.exports;
25544var request = exports;
25545exports.Request = Request;
25546/**
25547 * Determine XHR.
25548 */
25549
25550request.getXHR = function () {
25551 if (root.XMLHttpRequest && (!root.location || root.location.protocol !== 'file:' || !root.ActiveXObject)) {
25552 return new XMLHttpRequest();
25553 }
25554
25555 try {
25556 return new ActiveXObject('Microsoft.XMLHTTP');
25557 } catch (_unused) {}
25558
25559 try {
25560 return new ActiveXObject('Msxml2.XMLHTTP.6.0');
25561 } catch (_unused2) {}
25562
25563 try {
25564 return new ActiveXObject('Msxml2.XMLHTTP.3.0');
25565 } catch (_unused3) {}
25566
25567 try {
25568 return new ActiveXObject('Msxml2.XMLHTTP');
25569 } catch (_unused4) {}
25570
25571 throw new Error('Browser-only version of superagent could not find XHR');
25572};
25573/**
25574 * Removes leading and trailing whitespace, added to support IE.
25575 *
25576 * @param {String} s
25577 * @return {String}
25578 * @api private
25579 */
25580
25581
25582var trim = (0, _trim.default)('') ? function (s) {
25583 return (0, _trim.default)(s).call(s);
25584} : function (s) {
25585 return s.replace(/(^\s*|\s*$)/g, '');
25586};
25587/**
25588 * Serialize the given `obj`.
25589 *
25590 * @param {Object} obj
25591 * @return {String}
25592 * @api private
25593 */
25594
25595function serialize(obj) {
25596 if (!isObject(obj)) return obj;
25597 var pairs = [];
25598
25599 for (var key in obj) {
25600 if (Object.prototype.hasOwnProperty.call(obj, key)) pushEncodedKeyValuePair(pairs, key, obj[key]);
25601 }
25602
25603 return pairs.join('&');
25604}
25605/**
25606 * Helps 'serialize' with serializing arrays.
25607 * Mutates the pairs array.
25608 *
25609 * @param {Array} pairs
25610 * @param {String} key
25611 * @param {Mixed} val
25612 */
25613
25614
25615function pushEncodedKeyValuePair(pairs, key, val) {
25616 if (val === undefined) return;
25617
25618 if (val === null) {
25619 pairs.push(encodeURI(key));
25620 return;
25621 }
25622
25623 if (Array.isArray(val)) {
25624 val.forEach(function (v) {
25625 pushEncodedKeyValuePair(pairs, key, v);
25626 });
25627 } else if (isObject(val)) {
25628 for (var subkey in val) {
25629 var _context;
25630
25631 if (Object.prototype.hasOwnProperty.call(val, subkey)) pushEncodedKeyValuePair(pairs, (0, _concat.default)(_context = "".concat(key, "[")).call(_context, subkey, "]"), val[subkey]);
25632 }
25633 } else {
25634 pairs.push(encodeURI(key) + '=' + encodeURIComponent(val));
25635 }
25636}
25637/**
25638 * Expose serialization method.
25639 */
25640
25641
25642request.serializeObject = serialize;
25643/**
25644 * Parse the given x-www-form-urlencoded `str`.
25645 *
25646 * @param {String} str
25647 * @return {Object}
25648 * @api private
25649 */
25650
25651function parseString(str) {
25652 var obj = {};
25653 var pairs = str.split('&');
25654 var pair;
25655 var pos;
25656
25657 for (var i = 0, len = pairs.length; i < len; ++i) {
25658 pair = pairs[i];
25659 pos = (0, _indexOf.default)(pair).call(pair, '=');
25660
25661 if (pos === -1) {
25662 obj[decodeURIComponent(pair)] = '';
25663 } else {
25664 obj[decodeURIComponent((0, _slice.default)(pair).call(pair, 0, pos))] = decodeURIComponent((0, _slice.default)(pair).call(pair, pos + 1));
25665 }
25666 }
25667
25668 return obj;
25669}
25670/**
25671 * Expose parser.
25672 */
25673
25674
25675request.parseString = parseString;
25676/**
25677 * Default MIME type map.
25678 *
25679 * superagent.types.xml = 'application/xml';
25680 *
25681 */
25682
25683request.types = {
25684 html: 'text/html',
25685 json: 'application/json',
25686 xml: 'text/xml',
25687 urlencoded: 'application/x-www-form-urlencoded',
25688 form: 'application/x-www-form-urlencoded',
25689 'form-data': 'application/x-www-form-urlencoded'
25690};
25691/**
25692 * Default serialization map.
25693 *
25694 * superagent.serialize['application/xml'] = function(obj){
25695 * return 'generated xml here';
25696 * };
25697 *
25698 */
25699
25700request.serialize = {
25701 'application/x-www-form-urlencoded': serialize,
25702 'application/json': safeStringify
25703};
25704/**
25705 * Default parsers.
25706 *
25707 * superagent.parse['application/xml'] = function(str){
25708 * return { object parsed from str };
25709 * };
25710 *
25711 */
25712
25713request.parse = {
25714 'application/x-www-form-urlencoded': parseString,
25715 'application/json': JSON.parse
25716};
25717/**
25718 * Parse the given header `str` into
25719 * an object containing the mapped fields.
25720 *
25721 * @param {String} str
25722 * @return {Object}
25723 * @api private
25724 */
25725
25726function parseHeader(str) {
25727 var lines = str.split(/\r?\n/);
25728 var fields = {};
25729 var index;
25730 var line;
25731 var field;
25732 var val;
25733
25734 for (var i = 0, len = lines.length; i < len; ++i) {
25735 line = lines[i];
25736 index = (0, _indexOf.default)(line).call(line, ':');
25737
25738 if (index === -1) {
25739 // could be empty line, just skip it
25740 continue;
25741 }
25742
25743 field = (0, _slice.default)(line).call(line, 0, index).toLowerCase();
25744 val = trim((0, _slice.default)(line).call(line, index + 1));
25745 fields[field] = val;
25746 }
25747
25748 return fields;
25749}
25750/**
25751 * Check if `mime` is json or has +json structured syntax suffix.
25752 *
25753 * @param {String} mime
25754 * @return {Boolean}
25755 * @api private
25756 */
25757
25758
25759function isJSON(mime) {
25760 // should match /json or +json
25761 // but not /json-seq
25762 return /[/+]json($|[^-\w])/.test(mime);
25763}
25764/**
25765 * Initialize a new `Response` with the given `xhr`.
25766 *
25767 * - set flags (.ok, .error, etc)
25768 * - parse header
25769 *
25770 * Examples:
25771 *
25772 * Aliasing `superagent` as `request` is nice:
25773 *
25774 * request = superagent;
25775 *
25776 * We can use the promise-like API, or pass callbacks:
25777 *
25778 * request.get('/').end(function(res){});
25779 * request.get('/', function(res){});
25780 *
25781 * Sending data can be chained:
25782 *
25783 * request
25784 * .post('/user')
25785 * .send({ name: 'tj' })
25786 * .end(function(res){});
25787 *
25788 * Or passed to `.send()`:
25789 *
25790 * request
25791 * .post('/user')
25792 * .send({ name: 'tj' }, function(res){});
25793 *
25794 * Or passed to `.post()`:
25795 *
25796 * request
25797 * .post('/user', { name: 'tj' })
25798 * .end(function(res){});
25799 *
25800 * Or further reduced to a single call for simple cases:
25801 *
25802 * request
25803 * .post('/user', { name: 'tj' }, function(res){});
25804 *
25805 * @param {XMLHTTPRequest} xhr
25806 * @param {Object} options
25807 * @api private
25808 */
25809
25810
25811function Response(req) {
25812 this.req = req;
25813 this.xhr = this.req.xhr; // responseText is accessible only if responseType is '' or 'text' and on older browsers
25814
25815 this.text = this.req.method !== 'HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text') || typeof this.xhr.responseType === 'undefined' ? this.xhr.responseText : null;
25816 this.statusText = this.req.xhr.statusText;
25817 var status = this.xhr.status; // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request
25818
25819 if (status === 1223) {
25820 status = 204;
25821 }
25822
25823 this._setStatusProperties(status);
25824
25825 this.headers = parseHeader(this.xhr.getAllResponseHeaders());
25826 this.header = this.headers; // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but
25827 // getResponseHeader still works. so we get content-type even if getting
25828 // other headers fails.
25829
25830 this.header['content-type'] = this.xhr.getResponseHeader('content-type');
25831
25832 this._setHeaderProperties(this.header);
25833
25834 if (this.text === null && req._responseType) {
25835 this.body = this.xhr.response;
25836 } else {
25837 this.body = this.req.method === 'HEAD' ? null : this._parseBody(this.text ? this.text : this.xhr.response);
25838 }
25839} // eslint-disable-next-line new-cap
25840
25841
25842ResponseBase(Response.prototype);
25843/**
25844 * Parse the given body `str`.
25845 *
25846 * Used for auto-parsing of bodies. Parsers
25847 * are defined on the `superagent.parse` object.
25848 *
25849 * @param {String} str
25850 * @return {Mixed}
25851 * @api private
25852 */
25853
25854Response.prototype._parseBody = function (str) {
25855 var parse = request.parse[this.type];
25856
25857 if (this.req._parser) {
25858 return this.req._parser(this, str);
25859 }
25860
25861 if (!parse && isJSON(this.type)) {
25862 parse = request.parse['application/json'];
25863 }
25864
25865 return parse && str && (str.length > 0 || str instanceof Object) ? parse(str) : null;
25866};
25867/**
25868 * Return an `Error` representative of this response.
25869 *
25870 * @return {Error}
25871 * @api public
25872 */
25873
25874
25875Response.prototype.toError = function () {
25876 var _context2, _context3;
25877
25878 var req = this.req;
25879 var method = req.method;
25880 var url = req.url;
25881 var msg = (0, _concat.default)(_context2 = (0, _concat.default)(_context3 = "cannot ".concat(method, " ")).call(_context3, url, " (")).call(_context2, this.status, ")");
25882 var err = new Error(msg);
25883 err.status = this.status;
25884 err.method = method;
25885 err.url = url;
25886 return err;
25887};
25888/**
25889 * Expose `Response`.
25890 */
25891
25892
25893request.Response = Response;
25894/**
25895 * Initialize a new `Request` with the given `method` and `url`.
25896 *
25897 * @param {String} method
25898 * @param {String} url
25899 * @api public
25900 */
25901
25902function Request(method, url) {
25903 var self = this;
25904 this._query = this._query || [];
25905 this.method = method;
25906 this.url = url;
25907 this.header = {}; // preserves header name case
25908
25909 this._header = {}; // coerces header names to lowercase
25910
25911 this.on('end', function () {
25912 var err = null;
25913 var res = null;
25914
25915 try {
25916 res = new Response(self);
25917 } catch (err_) {
25918 err = new Error('Parser is unable to parse the response');
25919 err.parse = true;
25920 err.original = err_; // issue #675: return the raw response if the response parsing fails
25921
25922 if (self.xhr) {
25923 // ie9 doesn't have 'response' property
25924 err.rawResponse = typeof self.xhr.responseType === 'undefined' ? self.xhr.responseText : self.xhr.response; // issue #876: return the http status code if the response parsing fails
25925
25926 err.status = self.xhr.status ? self.xhr.status : null;
25927 err.statusCode = err.status; // backwards-compat only
25928 } else {
25929 err.rawResponse = null;
25930 err.status = null;
25931 }
25932
25933 return self.callback(err);
25934 }
25935
25936 self.emit('response', res);
25937 var new_err;
25938
25939 try {
25940 if (!self._isResponseOK(res)) {
25941 new_err = new Error(res.statusText || res.text || 'Unsuccessful HTTP response');
25942 }
25943 } catch (err_) {
25944 new_err = err_; // ok() callback can throw
25945 } // #1000 don't catch errors from the callback to avoid double calling it
25946
25947
25948 if (new_err) {
25949 new_err.original = err;
25950 new_err.response = res;
25951 new_err.status = res.status;
25952 self.callback(new_err, res);
25953 } else {
25954 self.callback(null, res);
25955 }
25956 });
25957}
25958/**
25959 * Mixin `Emitter` and `RequestBase`.
25960 */
25961// eslint-disable-next-line new-cap
25962
25963
25964Emitter(Request.prototype); // eslint-disable-next-line new-cap
25965
25966RequestBase(Request.prototype);
25967/**
25968 * Set Content-Type to `type`, mapping values from `request.types`.
25969 *
25970 * Examples:
25971 *
25972 * superagent.types.xml = 'application/xml';
25973 *
25974 * request.post('/')
25975 * .type('xml')
25976 * .send(xmlstring)
25977 * .end(callback);
25978 *
25979 * request.post('/')
25980 * .type('application/xml')
25981 * .send(xmlstring)
25982 * .end(callback);
25983 *
25984 * @param {String} type
25985 * @return {Request} for chaining
25986 * @api public
25987 */
25988
25989Request.prototype.type = function (type) {
25990 this.set('Content-Type', request.types[type] || type);
25991 return this;
25992};
25993/**
25994 * Set Accept to `type`, mapping values from `request.types`.
25995 *
25996 * Examples:
25997 *
25998 * superagent.types.json = 'application/json';
25999 *
26000 * request.get('/agent')
26001 * .accept('json')
26002 * .end(callback);
26003 *
26004 * request.get('/agent')
26005 * .accept('application/json')
26006 * .end(callback);
26007 *
26008 * @param {String} accept
26009 * @return {Request} for chaining
26010 * @api public
26011 */
26012
26013
26014Request.prototype.accept = function (type) {
26015 this.set('Accept', request.types[type] || type);
26016 return this;
26017};
26018/**
26019 * Set Authorization field value with `user` and `pass`.
26020 *
26021 * @param {String} user
26022 * @param {String} [pass] optional in case of using 'bearer' as type
26023 * @param {Object} options with 'type' property 'auto', 'basic' or 'bearer' (default 'basic')
26024 * @return {Request} for chaining
26025 * @api public
26026 */
26027
26028
26029Request.prototype.auth = function (user, pass, options) {
26030 if (arguments.length === 1) pass = '';
26031
26032 if (_typeof(pass) === 'object' && pass !== null) {
26033 // pass is optional and can be replaced with options
26034 options = pass;
26035 pass = '';
26036 }
26037
26038 if (!options) {
26039 options = {
26040 type: typeof btoa === 'function' ? 'basic' : 'auto'
26041 };
26042 }
26043
26044 var encoder = function encoder(string) {
26045 if (typeof btoa === 'function') {
26046 return btoa(string);
26047 }
26048
26049 throw new Error('Cannot use basic auth, btoa is not a function');
26050 };
26051
26052 return this._auth(user, pass, options, encoder);
26053};
26054/**
26055 * Add query-string `val`.
26056 *
26057 * Examples:
26058 *
26059 * request.get('/shoes')
26060 * .query('size=10')
26061 * .query({ color: 'blue' })
26062 *
26063 * @param {Object|String} val
26064 * @return {Request} for chaining
26065 * @api public
26066 */
26067
26068
26069Request.prototype.query = function (val) {
26070 if (typeof val !== 'string') val = serialize(val);
26071 if (val) this._query.push(val);
26072 return this;
26073};
26074/**
26075 * Queue the given `file` as an attachment to the specified `field`,
26076 * with optional `options` (or filename).
26077 *
26078 * ``` js
26079 * request.post('/upload')
26080 * .attach('content', new Blob(['<a id="a"><b id="b">hey!</b></a>'], { type: "text/html"}))
26081 * .end(callback);
26082 * ```
26083 *
26084 * @param {String} field
26085 * @param {Blob|File} file
26086 * @param {String|Object} options
26087 * @return {Request} for chaining
26088 * @api public
26089 */
26090
26091
26092Request.prototype.attach = function (field, file, options) {
26093 if (file) {
26094 if (this._data) {
26095 throw new Error("superagent can't mix .send() and .attach()");
26096 }
26097
26098 this._getFormData().append(field, file, options || file.name);
26099 }
26100
26101 return this;
26102};
26103
26104Request.prototype._getFormData = function () {
26105 if (!this._formData) {
26106 this._formData = new root.FormData();
26107 }
26108
26109 return this._formData;
26110};
26111/**
26112 * Invoke the callback with `err` and `res`
26113 * and handle arity check.
26114 *
26115 * @param {Error} err
26116 * @param {Response} res
26117 * @api private
26118 */
26119
26120
26121Request.prototype.callback = function (err, res) {
26122 if (this._shouldRetry(err, res)) {
26123 return this._retry();
26124 }
26125
26126 var fn = this._callback;
26127 this.clearTimeout();
26128
26129 if (err) {
26130 if (this._maxRetries) err.retries = this._retries - 1;
26131 this.emit('error', err);
26132 }
26133
26134 fn(err, res);
26135};
26136/**
26137 * Invoke callback with x-domain error.
26138 *
26139 * @api private
26140 */
26141
26142
26143Request.prototype.crossDomainError = function () {
26144 var err = new Error('Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.');
26145 err.crossDomain = true;
26146 err.status = this.status;
26147 err.method = this.method;
26148 err.url = this.url;
26149 this.callback(err);
26150}; // This only warns, because the request is still likely to work
26151
26152
26153Request.prototype.agent = function () {
26154 console.warn('This is not supported in browser version of superagent');
26155 return this;
26156};
26157
26158Request.prototype.ca = Request.prototype.agent;
26159Request.prototype.buffer = Request.prototype.ca; // This throws, because it can't send/receive data as expected
26160
26161Request.prototype.write = function () {
26162 throw new Error('Streaming is not supported in browser version of superagent');
26163};
26164
26165Request.prototype.pipe = Request.prototype.write;
26166/**
26167 * Check if `obj` is a host object,
26168 * we don't want to serialize these :)
26169 *
26170 * @param {Object} obj host object
26171 * @return {Boolean} is a host object
26172 * @api private
26173 */
26174
26175Request.prototype._isHost = function (obj) {
26176 // Native objects stringify to [object File], [object Blob], [object FormData], etc.
26177 return obj && _typeof(obj) === 'object' && !Array.isArray(obj) && Object.prototype.toString.call(obj) !== '[object Object]';
26178};
26179/**
26180 * Initiate request, invoking callback `fn(res)`
26181 * with an instanceof `Response`.
26182 *
26183 * @param {Function} fn
26184 * @return {Request} for chaining
26185 * @api public
26186 */
26187
26188
26189Request.prototype.end = function (fn) {
26190 if (this._endCalled) {
26191 console.warn('Warning: .end() was called twice. This is not supported in superagent');
26192 }
26193
26194 this._endCalled = true; // store callback
26195
26196 this._callback = fn || noop; // querystring
26197
26198 this._finalizeQueryString();
26199
26200 this._end();
26201};
26202
26203Request.prototype._setUploadTimeout = function () {
26204 var self = this; // upload timeout it's wokrs only if deadline timeout is off
26205
26206 if (this._uploadTimeout && !this._uploadTimeoutTimer) {
26207 this._uploadTimeoutTimer = setTimeout(function () {
26208 self._timeoutError('Upload timeout of ', self._uploadTimeout, 'ETIMEDOUT');
26209 }, this._uploadTimeout);
26210 }
26211}; // eslint-disable-next-line complexity
26212
26213
26214Request.prototype._end = function () {
26215 if (this._aborted) return this.callback(new Error('The request has been aborted even before .end() was called'));
26216 var self = this;
26217 this.xhr = request.getXHR();
26218 var xhr = this.xhr;
26219 var data = this._formData || this._data;
26220
26221 this._setTimeouts(); // state change
26222
26223
26224 xhr.onreadystatechange = function () {
26225 var readyState = xhr.readyState;
26226
26227 if (readyState >= 2 && self._responseTimeoutTimer) {
26228 clearTimeout(self._responseTimeoutTimer);
26229 }
26230
26231 if (readyState !== 4) {
26232 return;
26233 } // In IE9, reads to any property (e.g. status) off of an aborted XHR will
26234 // result in the error "Could not complete the operation due to error c00c023f"
26235
26236
26237 var status;
26238
26239 try {
26240 status = xhr.status;
26241 } catch (_unused5) {
26242 status = 0;
26243 }
26244
26245 if (!status) {
26246 if (self.timedout || self._aborted) return;
26247 return self.crossDomainError();
26248 }
26249
26250 self.emit('end');
26251 }; // progress
26252
26253
26254 var handleProgress = function handleProgress(direction, e) {
26255 if (e.total > 0) {
26256 e.percent = e.loaded / e.total * 100;
26257
26258 if (e.percent === 100) {
26259 clearTimeout(self._uploadTimeoutTimer);
26260 }
26261 }
26262
26263 e.direction = direction;
26264 self.emit('progress', e);
26265 };
26266
26267 if (this.hasListeners('progress')) {
26268 try {
26269 xhr.addEventListener('progress', handleProgress.bind(null, 'download'));
26270
26271 if (xhr.upload) {
26272 xhr.upload.addEventListener('progress', handleProgress.bind(null, 'upload'));
26273 }
26274 } catch (_unused6) {// Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist.
26275 // Reported here:
26276 // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context
26277 }
26278 }
26279
26280 if (xhr.upload) {
26281 this._setUploadTimeout();
26282 } // initiate request
26283
26284
26285 try {
26286 if (this.username && this.password) {
26287 xhr.open(this.method, this.url, true, this.username, this.password);
26288 } else {
26289 xhr.open(this.method, this.url, true);
26290 }
26291 } catch (err) {
26292 // see #1149
26293 return this.callback(err);
26294 } // CORS
26295
26296
26297 if (this._withCredentials) xhr.withCredentials = true; // body
26298
26299 if (!this._formData && this.method !== 'GET' && this.method !== 'HEAD' && typeof data !== 'string' && !this._isHost(data)) {
26300 // serialize stuff
26301 var contentType = this._header['content-type'];
26302
26303 var _serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : ''];
26304
26305 if (!_serialize && isJSON(contentType)) {
26306 _serialize = request.serialize['application/json'];
26307 }
26308
26309 if (_serialize) data = _serialize(data);
26310 } // set header fields
26311
26312
26313 for (var field in this.header) {
26314 if (this.header[field] === null) continue;
26315 if (Object.prototype.hasOwnProperty.call(this.header, field)) xhr.setRequestHeader(field, this.header[field]);
26316 }
26317
26318 if (this._responseType) {
26319 xhr.responseType = this._responseType;
26320 } // send stuff
26321
26322
26323 this.emit('request', this); // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing)
26324 // We need null here if data is undefined
26325
26326 xhr.send(typeof data === 'undefined' ? null : data);
26327};
26328
26329request.agent = function () {
26330 return new Agent();
26331};
26332
26333['GET', 'POST', 'OPTIONS', 'PATCH', 'PUT', 'DELETE'].forEach(function (method) {
26334 Agent.prototype[method.toLowerCase()] = function (url, fn) {
26335 var req = new request.Request(method, url);
26336
26337 this._setDefaults(req);
26338
26339 if (fn) {
26340 req.end(fn);
26341 }
26342
26343 return req;
26344 };
26345});
26346Agent.prototype.del = Agent.prototype.delete;
26347/**
26348 * GET `url` with optional callback `fn(res)`.
26349 *
26350 * @param {String} url
26351 * @param {Mixed|Function} [data] or fn
26352 * @param {Function} [fn]
26353 * @return {Request}
26354 * @api public
26355 */
26356
26357request.get = function (url, data, fn) {
26358 var req = request('GET', url);
26359
26360 if (typeof data === 'function') {
26361 fn = data;
26362 data = null;
26363 }
26364
26365 if (data) req.query(data);
26366 if (fn) req.end(fn);
26367 return req;
26368};
26369/**
26370 * HEAD `url` with optional callback `fn(res)`.
26371 *
26372 * @param {String} url
26373 * @param {Mixed|Function} [data] or fn
26374 * @param {Function} [fn]
26375 * @return {Request}
26376 * @api public
26377 */
26378
26379
26380request.head = function (url, data, fn) {
26381 var req = request('HEAD', url);
26382
26383 if (typeof data === 'function') {
26384 fn = data;
26385 data = null;
26386 }
26387
26388 if (data) req.query(data);
26389 if (fn) req.end(fn);
26390 return req;
26391};
26392/**
26393 * OPTIONS query to `url` with optional callback `fn(res)`.
26394 *
26395 * @param {String} url
26396 * @param {Mixed|Function} [data] or fn
26397 * @param {Function} [fn]
26398 * @return {Request}
26399 * @api public
26400 */
26401
26402
26403request.options = function (url, data, fn) {
26404 var req = request('OPTIONS', url);
26405
26406 if (typeof data === 'function') {
26407 fn = data;
26408 data = null;
26409 }
26410
26411 if (data) req.send(data);
26412 if (fn) req.end(fn);
26413 return req;
26414};
26415/**
26416 * DELETE `url` with optional `data` and callback `fn(res)`.
26417 *
26418 * @param {String} url
26419 * @param {Mixed} [data]
26420 * @param {Function} [fn]
26421 * @return {Request}
26422 * @api public
26423 */
26424
26425
26426function del(url, data, fn) {
26427 var req = request('DELETE', url);
26428
26429 if (typeof data === 'function') {
26430 fn = data;
26431 data = null;
26432 }
26433
26434 if (data) req.send(data);
26435 if (fn) req.end(fn);
26436 return req;
26437}
26438
26439request.del = del;
26440request.delete = del;
26441/**
26442 * PATCH `url` with optional `data` and callback `fn(res)`.
26443 *
26444 * @param {String} url
26445 * @param {Mixed} [data]
26446 * @param {Function} [fn]
26447 * @return {Request}
26448 * @api public
26449 */
26450
26451request.patch = function (url, data, fn) {
26452 var req = request('PATCH', url);
26453
26454 if (typeof data === 'function') {
26455 fn = data;
26456 data = null;
26457 }
26458
26459 if (data) req.send(data);
26460 if (fn) req.end(fn);
26461 return req;
26462};
26463/**
26464 * POST `url` with optional `data` and callback `fn(res)`.
26465 *
26466 * @param {String} url
26467 * @param {Mixed} [data]
26468 * @param {Function} [fn]
26469 * @return {Request}
26470 * @api public
26471 */
26472
26473
26474request.post = function (url, data, fn) {
26475 var req = request('POST', url);
26476
26477 if (typeof data === 'function') {
26478 fn = data;
26479 data = null;
26480 }
26481
26482 if (data) req.send(data);
26483 if (fn) req.end(fn);
26484 return req;
26485};
26486/**
26487 * PUT `url` with optional `data` and callback `fn(res)`.
26488 *
26489 * @param {String} url
26490 * @param {Mixed|Function} [data] or fn
26491 * @param {Function} [fn]
26492 * @return {Request}
26493 * @api public
26494 */
26495
26496
26497request.put = function (url, data, fn) {
26498 var req = request('PUT', url);
26499
26500 if (typeof data === 'function') {
26501 fn = data;
26502 data = null;
26503 }
26504
26505 if (data) req.send(data);
26506 if (fn) req.end(fn);
26507 return req;
26508};
26509
26510/***/ }),
26511/* 549 */
26512/***/ (function(module, exports, __webpack_require__) {
26513
26514module.exports = __webpack_require__(550);
26515
26516/***/ }),
26517/* 550 */
26518/***/ (function(module, exports, __webpack_require__) {
26519
26520var parent = __webpack_require__(551);
26521
26522module.exports = parent;
26523
26524
26525/***/ }),
26526/* 551 */
26527/***/ (function(module, exports, __webpack_require__) {
26528
26529var isPrototypeOf = __webpack_require__(12);
26530var method = __webpack_require__(552);
26531
26532var StringPrototype = String.prototype;
26533
26534module.exports = function (it) {
26535 var own = it.trim;
26536 return typeof it == 'string' || it === StringPrototype
26537 || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.trim) ? method : own;
26538};
26539
26540
26541/***/ }),
26542/* 552 */
26543/***/ (function(module, exports, __webpack_require__) {
26544
26545__webpack_require__(553);
26546var entryVirtual = __webpack_require__(26);
26547
26548module.exports = entryVirtual('String').trim;
26549
26550
26551/***/ }),
26552/* 553 */
26553/***/ (function(module, exports, __webpack_require__) {
26554
26555"use strict";
26556
26557var $ = __webpack_require__(0);
26558var $trim = __webpack_require__(554).trim;
26559var forcedStringTrimMethod = __webpack_require__(555);
26560
26561// `String.prototype.trim` method
26562// https://tc39.es/ecma262/#sec-string.prototype.trim
26563$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
26564 trim: function trim() {
26565 return $trim(this);
26566 }
26567});
26568
26569
26570/***/ }),
26571/* 554 */
26572/***/ (function(module, exports, __webpack_require__) {
26573
26574var uncurryThis = __webpack_require__(4);
26575var requireObjectCoercible = __webpack_require__(74);
26576var toString = __webpack_require__(40);
26577var whitespaces = __webpack_require__(243);
26578
26579var replace = uncurryThis(''.replace);
26580var whitespace = '[' + whitespaces + ']';
26581var ltrim = RegExp('^' + whitespace + whitespace + '*');
26582var rtrim = RegExp(whitespace + whitespace + '*$');
26583
26584// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
26585var createMethod = function (TYPE) {
26586 return function ($this) {
26587 var string = toString(requireObjectCoercible($this));
26588 if (TYPE & 1) string = replace(string, ltrim, '');
26589 if (TYPE & 2) string = replace(string, rtrim, '');
26590 return string;
26591 };
26592};
26593
26594module.exports = {
26595 // `String.prototype.{ trimLeft, trimStart }` methods
26596 // https://tc39.es/ecma262/#sec-string.prototype.trimstart
26597 start: createMethod(1),
26598 // `String.prototype.{ trimRight, trimEnd }` methods
26599 // https://tc39.es/ecma262/#sec-string.prototype.trimend
26600 end: createMethod(2),
26601 // `String.prototype.trim` method
26602 // https://tc39.es/ecma262/#sec-string.prototype.trim
26603 trim: createMethod(3)
26604};
26605
26606
26607/***/ }),
26608/* 555 */
26609/***/ (function(module, exports, __webpack_require__) {
26610
26611var PROPER_FUNCTION_NAME = __webpack_require__(158).PROPER;
26612var fails = __webpack_require__(3);
26613var whitespaces = __webpack_require__(243);
26614
26615var non = '\u200B\u0085\u180E';
26616
26617// check that a method works with the correct list
26618// of whitespaces and has a correct name
26619module.exports = function (METHOD_NAME) {
26620 return fails(function () {
26621 return !!whitespaces[METHOD_NAME]()
26622 || non[METHOD_NAME]() !== non
26623 || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
26624 });
26625};
26626
26627
26628/***/ }),
26629/* 556 */
26630/***/ (function(module, exports, __webpack_require__) {
26631
26632
26633/**
26634 * Expose `Emitter`.
26635 */
26636
26637if (true) {
26638 module.exports = Emitter;
26639}
26640
26641/**
26642 * Initialize a new `Emitter`.
26643 *
26644 * @api public
26645 */
26646
26647function Emitter(obj) {
26648 if (obj) return mixin(obj);
26649};
26650
26651/**
26652 * Mixin the emitter properties.
26653 *
26654 * @param {Object} obj
26655 * @return {Object}
26656 * @api private
26657 */
26658
26659function mixin(obj) {
26660 for (var key in Emitter.prototype) {
26661 obj[key] = Emitter.prototype[key];
26662 }
26663 return obj;
26664}
26665
26666/**
26667 * Listen on the given `event` with `fn`.
26668 *
26669 * @param {String} event
26670 * @param {Function} fn
26671 * @return {Emitter}
26672 * @api public
26673 */
26674
26675Emitter.prototype.on =
26676Emitter.prototype.addEventListener = function(event, fn){
26677 this._callbacks = this._callbacks || {};
26678 (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
26679 .push(fn);
26680 return this;
26681};
26682
26683/**
26684 * Adds an `event` listener that will be invoked a single
26685 * time then automatically removed.
26686 *
26687 * @param {String} event
26688 * @param {Function} fn
26689 * @return {Emitter}
26690 * @api public
26691 */
26692
26693Emitter.prototype.once = function(event, fn){
26694 function on() {
26695 this.off(event, on);
26696 fn.apply(this, arguments);
26697 }
26698
26699 on.fn = fn;
26700 this.on(event, on);
26701 return this;
26702};
26703
26704/**
26705 * Remove the given callback for `event` or all
26706 * registered callbacks.
26707 *
26708 * @param {String} event
26709 * @param {Function} fn
26710 * @return {Emitter}
26711 * @api public
26712 */
26713
26714Emitter.prototype.off =
26715Emitter.prototype.removeListener =
26716Emitter.prototype.removeAllListeners =
26717Emitter.prototype.removeEventListener = function(event, fn){
26718 this._callbacks = this._callbacks || {};
26719
26720 // all
26721 if (0 == arguments.length) {
26722 this._callbacks = {};
26723 return this;
26724 }
26725
26726 // specific event
26727 var callbacks = this._callbacks['$' + event];
26728 if (!callbacks) return this;
26729
26730 // remove all handlers
26731 if (1 == arguments.length) {
26732 delete this._callbacks['$' + event];
26733 return this;
26734 }
26735
26736 // remove specific handler
26737 var cb;
26738 for (var i = 0; i < callbacks.length; i++) {
26739 cb = callbacks[i];
26740 if (cb === fn || cb.fn === fn) {
26741 callbacks.splice(i, 1);
26742 break;
26743 }
26744 }
26745
26746 // Remove event specific arrays for event types that no
26747 // one is subscribed for to avoid memory leak.
26748 if (callbacks.length === 0) {
26749 delete this._callbacks['$' + event];
26750 }
26751
26752 return this;
26753};
26754
26755/**
26756 * Emit `event` with the given args.
26757 *
26758 * @param {String} event
26759 * @param {Mixed} ...
26760 * @return {Emitter}
26761 */
26762
26763Emitter.prototype.emit = function(event){
26764 this._callbacks = this._callbacks || {};
26765
26766 var args = new Array(arguments.length - 1)
26767 , callbacks = this._callbacks['$' + event];
26768
26769 for (var i = 1; i < arguments.length; i++) {
26770 args[i - 1] = arguments[i];
26771 }
26772
26773 if (callbacks) {
26774 callbacks = callbacks.slice(0);
26775 for (var i = 0, len = callbacks.length; i < len; ++i) {
26776 callbacks[i].apply(this, args);
26777 }
26778 }
26779
26780 return this;
26781};
26782
26783/**
26784 * Return array of callbacks for `event`.
26785 *
26786 * @param {String} event
26787 * @return {Array}
26788 * @api public
26789 */
26790
26791Emitter.prototype.listeners = function(event){
26792 this._callbacks = this._callbacks || {};
26793 return this._callbacks['$' + event] || [];
26794};
26795
26796/**
26797 * Check if this emitter has `event` handlers.
26798 *
26799 * @param {String} event
26800 * @return {Boolean}
26801 * @api public
26802 */
26803
26804Emitter.prototype.hasListeners = function(event){
26805 return !! this.listeners(event).length;
26806};
26807
26808
26809/***/ }),
26810/* 557 */
26811/***/ (function(module, exports) {
26812
26813module.exports = stringify
26814stringify.default = stringify
26815stringify.stable = deterministicStringify
26816stringify.stableStringify = deterministicStringify
26817
26818var LIMIT_REPLACE_NODE = '[...]'
26819var CIRCULAR_REPLACE_NODE = '[Circular]'
26820
26821var arr = []
26822var replacerStack = []
26823
26824function defaultOptions () {
26825 return {
26826 depthLimit: Number.MAX_SAFE_INTEGER,
26827 edgesLimit: Number.MAX_SAFE_INTEGER
26828 }
26829}
26830
26831// Regular stringify
26832function stringify (obj, replacer, spacer, options) {
26833 if (typeof options === 'undefined') {
26834 options = defaultOptions()
26835 }
26836
26837 decirc(obj, '', 0, [], undefined, 0, options)
26838 var res
26839 try {
26840 if (replacerStack.length === 0) {
26841 res = JSON.stringify(obj, replacer, spacer)
26842 } else {
26843 res = JSON.stringify(obj, replaceGetterValues(replacer), spacer)
26844 }
26845 } catch (_) {
26846 return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]')
26847 } finally {
26848 while (arr.length !== 0) {
26849 var part = arr.pop()
26850 if (part.length === 4) {
26851 Object.defineProperty(part[0], part[1], part[3])
26852 } else {
26853 part[0][part[1]] = part[2]
26854 }
26855 }
26856 }
26857 return res
26858}
26859
26860function setReplace (replace, val, k, parent) {
26861 var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k)
26862 if (propertyDescriptor.get !== undefined) {
26863 if (propertyDescriptor.configurable) {
26864 Object.defineProperty(parent, k, { value: replace })
26865 arr.push([parent, k, val, propertyDescriptor])
26866 } else {
26867 replacerStack.push([val, k, replace])
26868 }
26869 } else {
26870 parent[k] = replace
26871 arr.push([parent, k, val])
26872 }
26873}
26874
26875function decirc (val, k, edgeIndex, stack, parent, depth, options) {
26876 depth += 1
26877 var i
26878 if (typeof val === 'object' && val !== null) {
26879 for (i = 0; i < stack.length; i++) {
26880 if (stack[i] === val) {
26881 setReplace(CIRCULAR_REPLACE_NODE, val, k, parent)
26882 return
26883 }
26884 }
26885
26886 if (
26887 typeof options.depthLimit !== 'undefined' &&
26888 depth > options.depthLimit
26889 ) {
26890 setReplace(LIMIT_REPLACE_NODE, val, k, parent)
26891 return
26892 }
26893
26894 if (
26895 typeof options.edgesLimit !== 'undefined' &&
26896 edgeIndex + 1 > options.edgesLimit
26897 ) {
26898 setReplace(LIMIT_REPLACE_NODE, val, k, parent)
26899 return
26900 }
26901
26902 stack.push(val)
26903 // Optimize for Arrays. Big arrays could kill the performance otherwise!
26904 if (Array.isArray(val)) {
26905 for (i = 0; i < val.length; i++) {
26906 decirc(val[i], i, i, stack, val, depth, options)
26907 }
26908 } else {
26909 var keys = Object.keys(val)
26910 for (i = 0; i < keys.length; i++) {
26911 var key = keys[i]
26912 decirc(val[key], key, i, stack, val, depth, options)
26913 }
26914 }
26915 stack.pop()
26916 }
26917}
26918
26919// Stable-stringify
26920function compareFunction (a, b) {
26921 if (a < b) {
26922 return -1
26923 }
26924 if (a > b) {
26925 return 1
26926 }
26927 return 0
26928}
26929
26930function deterministicStringify (obj, replacer, spacer, options) {
26931 if (typeof options === 'undefined') {
26932 options = defaultOptions()
26933 }
26934
26935 var tmp = deterministicDecirc(obj, '', 0, [], undefined, 0, options) || obj
26936 var res
26937 try {
26938 if (replacerStack.length === 0) {
26939 res = JSON.stringify(tmp, replacer, spacer)
26940 } else {
26941 res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer)
26942 }
26943 } catch (_) {
26944 return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]')
26945 } finally {
26946 // Ensure that we restore the object as it was.
26947 while (arr.length !== 0) {
26948 var part = arr.pop()
26949 if (part.length === 4) {
26950 Object.defineProperty(part[0], part[1], part[3])
26951 } else {
26952 part[0][part[1]] = part[2]
26953 }
26954 }
26955 }
26956 return res
26957}
26958
26959function deterministicDecirc (val, k, edgeIndex, stack, parent, depth, options) {
26960 depth += 1
26961 var i
26962 if (typeof val === 'object' && val !== null) {
26963 for (i = 0; i < stack.length; i++) {
26964 if (stack[i] === val) {
26965 setReplace(CIRCULAR_REPLACE_NODE, val, k, parent)
26966 return
26967 }
26968 }
26969 try {
26970 if (typeof val.toJSON === 'function') {
26971 return
26972 }
26973 } catch (_) {
26974 return
26975 }
26976
26977 if (
26978 typeof options.depthLimit !== 'undefined' &&
26979 depth > options.depthLimit
26980 ) {
26981 setReplace(LIMIT_REPLACE_NODE, val, k, parent)
26982 return
26983 }
26984
26985 if (
26986 typeof options.edgesLimit !== 'undefined' &&
26987 edgeIndex + 1 > options.edgesLimit
26988 ) {
26989 setReplace(LIMIT_REPLACE_NODE, val, k, parent)
26990 return
26991 }
26992
26993 stack.push(val)
26994 // Optimize for Arrays. Big arrays could kill the performance otherwise!
26995 if (Array.isArray(val)) {
26996 for (i = 0; i < val.length; i++) {
26997 deterministicDecirc(val[i], i, i, stack, val, depth, options)
26998 }
26999 } else {
27000 // Create a temporary object in the required way
27001 var tmp = {}
27002 var keys = Object.keys(val).sort(compareFunction)
27003 for (i = 0; i < keys.length; i++) {
27004 var key = keys[i]
27005 deterministicDecirc(val[key], key, i, stack, val, depth, options)
27006 tmp[key] = val[key]
27007 }
27008 if (typeof parent !== 'undefined') {
27009 arr.push([parent, k, val])
27010 parent[k] = tmp
27011 } else {
27012 return tmp
27013 }
27014 }
27015 stack.pop()
27016 }
27017}
27018
27019// wraps replacer function to handle values we couldn't replace
27020// and mark them as replaced value
27021function replaceGetterValues (replacer) {
27022 replacer =
27023 typeof replacer !== 'undefined'
27024 ? replacer
27025 : function (k, v) {
27026 return v
27027 }
27028 return function (key, val) {
27029 if (replacerStack.length > 0) {
27030 for (var i = 0; i < replacerStack.length; i++) {
27031 var part = replacerStack[i]
27032 if (part[1] === key && part[0] === val) {
27033 val = part[2]
27034 replacerStack.splice(i, 1)
27035 break
27036 }
27037 }
27038 }
27039 return replacer.call(this, key, val)
27040 }
27041}
27042
27043
27044/***/ }),
27045/* 558 */
27046/***/ (function(module, exports, __webpack_require__) {
27047
27048"use strict";
27049
27050
27051var _interopRequireDefault = __webpack_require__(1);
27052
27053var _symbol = _interopRequireDefault(__webpack_require__(87));
27054
27055var _iterator = _interopRequireDefault(__webpack_require__(144));
27056
27057var _includes = _interopRequireDefault(__webpack_require__(559));
27058
27059var _promise = _interopRequireDefault(__webpack_require__(10));
27060
27061var _concat = _interopRequireDefault(__webpack_require__(25));
27062
27063var _indexOf = _interopRequireDefault(__webpack_require__(68));
27064
27065var _slice = _interopRequireDefault(__webpack_require__(38));
27066
27067var _sort = _interopRequireDefault(__webpack_require__(569));
27068
27069function _typeof(obj) {
27070 "@babel/helpers - typeof";
27071
27072 if (typeof _symbol.default === "function" && typeof _iterator.default === "symbol") {
27073 _typeof = function _typeof(obj) {
27074 return typeof obj;
27075 };
27076 } else {
27077 _typeof = function _typeof(obj) {
27078 return obj && typeof _symbol.default === "function" && obj.constructor === _symbol.default && obj !== _symbol.default.prototype ? "symbol" : typeof obj;
27079 };
27080 }
27081
27082 return _typeof(obj);
27083}
27084/**
27085 * Module of mixed-in functions shared between node and client code
27086 */
27087
27088
27089var isObject = __webpack_require__(244);
27090/**
27091 * Expose `RequestBase`.
27092 */
27093
27094
27095module.exports = RequestBase;
27096/**
27097 * Initialize a new `RequestBase`.
27098 *
27099 * @api public
27100 */
27101
27102function RequestBase(obj) {
27103 if (obj) return mixin(obj);
27104}
27105/**
27106 * Mixin the prototype properties.
27107 *
27108 * @param {Object} obj
27109 * @return {Object}
27110 * @api private
27111 */
27112
27113
27114function mixin(obj) {
27115 for (var key in RequestBase.prototype) {
27116 if (Object.prototype.hasOwnProperty.call(RequestBase.prototype, key)) obj[key] = RequestBase.prototype[key];
27117 }
27118
27119 return obj;
27120}
27121/**
27122 * Clear previous timeout.
27123 *
27124 * @return {Request} for chaining
27125 * @api public
27126 */
27127
27128
27129RequestBase.prototype.clearTimeout = function () {
27130 clearTimeout(this._timer);
27131 clearTimeout(this._responseTimeoutTimer);
27132 clearTimeout(this._uploadTimeoutTimer);
27133 delete this._timer;
27134 delete this._responseTimeoutTimer;
27135 delete this._uploadTimeoutTimer;
27136 return this;
27137};
27138/**
27139 * Override default response body parser
27140 *
27141 * This function will be called to convert incoming data into request.body
27142 *
27143 * @param {Function}
27144 * @api public
27145 */
27146
27147
27148RequestBase.prototype.parse = function (fn) {
27149 this._parser = fn;
27150 return this;
27151};
27152/**
27153 * Set format of binary response body.
27154 * In browser valid formats are 'blob' and 'arraybuffer',
27155 * which return Blob and ArrayBuffer, respectively.
27156 *
27157 * In Node all values result in Buffer.
27158 *
27159 * Examples:
27160 *
27161 * req.get('/')
27162 * .responseType('blob')
27163 * .end(callback);
27164 *
27165 * @param {String} val
27166 * @return {Request} for chaining
27167 * @api public
27168 */
27169
27170
27171RequestBase.prototype.responseType = function (val) {
27172 this._responseType = val;
27173 return this;
27174};
27175/**
27176 * Override default request body serializer
27177 *
27178 * This function will be called to convert data set via .send or .attach into payload to send
27179 *
27180 * @param {Function}
27181 * @api public
27182 */
27183
27184
27185RequestBase.prototype.serialize = function (fn) {
27186 this._serializer = fn;
27187 return this;
27188};
27189/**
27190 * Set timeouts.
27191 *
27192 * - response timeout is time between sending request and receiving the first byte of the response. Includes DNS and connection time.
27193 * - deadline is the time from start of the request to receiving response body in full. If the deadline is too short large files may not load at all on slow connections.
27194 * - upload is the time since last bit of data was sent or received. This timeout works only if deadline timeout is off
27195 *
27196 * Value of 0 or false means no timeout.
27197 *
27198 * @param {Number|Object} ms or {response, deadline}
27199 * @return {Request} for chaining
27200 * @api public
27201 */
27202
27203
27204RequestBase.prototype.timeout = function (options) {
27205 if (!options || _typeof(options) !== 'object') {
27206 this._timeout = options;
27207 this._responseTimeout = 0;
27208 this._uploadTimeout = 0;
27209 return this;
27210 }
27211
27212 for (var option in options) {
27213 if (Object.prototype.hasOwnProperty.call(options, option)) {
27214 switch (option) {
27215 case 'deadline':
27216 this._timeout = options.deadline;
27217 break;
27218
27219 case 'response':
27220 this._responseTimeout = options.response;
27221 break;
27222
27223 case 'upload':
27224 this._uploadTimeout = options.upload;
27225 break;
27226
27227 default:
27228 console.warn('Unknown timeout option', option);
27229 }
27230 }
27231 }
27232
27233 return this;
27234};
27235/**
27236 * Set number of retry attempts on error.
27237 *
27238 * Failed requests will be retried 'count' times if timeout or err.code >= 500.
27239 *
27240 * @param {Number} count
27241 * @param {Function} [fn]
27242 * @return {Request} for chaining
27243 * @api public
27244 */
27245
27246
27247RequestBase.prototype.retry = function (count, fn) {
27248 // Default to 1 if no count passed or true
27249 if (arguments.length === 0 || count === true) count = 1;
27250 if (count <= 0) count = 0;
27251 this._maxRetries = count;
27252 this._retries = 0;
27253 this._retryCallback = fn;
27254 return this;
27255};
27256
27257var ERROR_CODES = ['ECONNRESET', 'ETIMEDOUT', 'EADDRINFO', 'ESOCKETTIMEDOUT'];
27258/**
27259 * Determine if a request should be retried.
27260 * (Borrowed from segmentio/superagent-retry)
27261 *
27262 * @param {Error} err an error
27263 * @param {Response} [res] response
27264 * @returns {Boolean} if segment should be retried
27265 */
27266
27267RequestBase.prototype._shouldRetry = function (err, res) {
27268 if (!this._maxRetries || this._retries++ >= this._maxRetries) {
27269 return false;
27270 }
27271
27272 if (this._retryCallback) {
27273 try {
27274 var override = this._retryCallback(err, res);
27275
27276 if (override === true) return true;
27277 if (override === false) return false; // undefined falls back to defaults
27278 } catch (err_) {
27279 console.error(err_);
27280 }
27281 }
27282
27283 if (res && res.status && res.status >= 500 && res.status !== 501) return true;
27284
27285 if (err) {
27286 if (err.code && (0, _includes.default)(ERROR_CODES).call(ERROR_CODES, err.code)) return true; // Superagent timeout
27287
27288 if (err.timeout && err.code === 'ECONNABORTED') return true;
27289 if (err.crossDomain) return true;
27290 }
27291
27292 return false;
27293};
27294/**
27295 * Retry request
27296 *
27297 * @return {Request} for chaining
27298 * @api private
27299 */
27300
27301
27302RequestBase.prototype._retry = function () {
27303 this.clearTimeout(); // node
27304
27305 if (this.req) {
27306 this.req = null;
27307 this.req = this.request();
27308 }
27309
27310 this._aborted = false;
27311 this.timedout = false;
27312 this.timedoutError = null;
27313 return this._end();
27314};
27315/**
27316 * Promise support
27317 *
27318 * @param {Function} resolve
27319 * @param {Function} [reject]
27320 * @return {Request}
27321 */
27322
27323
27324RequestBase.prototype.then = function (resolve, reject) {
27325 var _this = this;
27326
27327 if (!this._fullfilledPromise) {
27328 var self = this;
27329
27330 if (this._endCalled) {
27331 console.warn('Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises');
27332 }
27333
27334 this._fullfilledPromise = new _promise.default(function (resolve, reject) {
27335 self.on('abort', function () {
27336 if (_this._maxRetries && _this._maxRetries > _this._retries) {
27337 return;
27338 }
27339
27340 if (_this.timedout && _this.timedoutError) {
27341 reject(_this.timedoutError);
27342 return;
27343 }
27344
27345 var err = new Error('Aborted');
27346 err.code = 'ABORTED';
27347 err.status = _this.status;
27348 err.method = _this.method;
27349 err.url = _this.url;
27350 reject(err);
27351 });
27352 self.end(function (err, res) {
27353 if (err) reject(err);else resolve(res);
27354 });
27355 });
27356 }
27357
27358 return this._fullfilledPromise.then(resolve, reject);
27359};
27360
27361RequestBase.prototype.catch = function (cb) {
27362 return this.then(undefined, cb);
27363};
27364/**
27365 * Allow for extension
27366 */
27367
27368
27369RequestBase.prototype.use = function (fn) {
27370 fn(this);
27371 return this;
27372};
27373
27374RequestBase.prototype.ok = function (cb) {
27375 if (typeof cb !== 'function') throw new Error('Callback required');
27376 this._okCallback = cb;
27377 return this;
27378};
27379
27380RequestBase.prototype._isResponseOK = function (res) {
27381 if (!res) {
27382 return false;
27383 }
27384
27385 if (this._okCallback) {
27386 return this._okCallback(res);
27387 }
27388
27389 return res.status >= 200 && res.status < 300;
27390};
27391/**
27392 * Get request header `field`.
27393 * Case-insensitive.
27394 *
27395 * @param {String} field
27396 * @return {String}
27397 * @api public
27398 */
27399
27400
27401RequestBase.prototype.get = function (field) {
27402 return this._header[field.toLowerCase()];
27403};
27404/**
27405 * Get case-insensitive header `field` value.
27406 * This is a deprecated internal API. Use `.get(field)` instead.
27407 *
27408 * (getHeader is no longer used internally by the superagent code base)
27409 *
27410 * @param {String} field
27411 * @return {String}
27412 * @api private
27413 * @deprecated
27414 */
27415
27416
27417RequestBase.prototype.getHeader = RequestBase.prototype.get;
27418/**
27419 * Set header `field` to `val`, or multiple fields with one object.
27420 * Case-insensitive.
27421 *
27422 * Examples:
27423 *
27424 * req.get('/')
27425 * .set('Accept', 'application/json')
27426 * .set('X-API-Key', 'foobar')
27427 * .end(callback);
27428 *
27429 * req.get('/')
27430 * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' })
27431 * .end(callback);
27432 *
27433 * @param {String|Object} field
27434 * @param {String} val
27435 * @return {Request} for chaining
27436 * @api public
27437 */
27438
27439RequestBase.prototype.set = function (field, val) {
27440 if (isObject(field)) {
27441 for (var key in field) {
27442 if (Object.prototype.hasOwnProperty.call(field, key)) this.set(key, field[key]);
27443 }
27444
27445 return this;
27446 }
27447
27448 this._header[field.toLowerCase()] = val;
27449 this.header[field] = val;
27450 return this;
27451};
27452/**
27453 * Remove header `field`.
27454 * Case-insensitive.
27455 *
27456 * Example:
27457 *
27458 * req.get('/')
27459 * .unset('User-Agent')
27460 * .end(callback);
27461 *
27462 * @param {String} field field name
27463 */
27464
27465
27466RequestBase.prototype.unset = function (field) {
27467 delete this._header[field.toLowerCase()];
27468 delete this.header[field];
27469 return this;
27470};
27471/**
27472 * Write the field `name` and `val`, or multiple fields with one object
27473 * for "multipart/form-data" request bodies.
27474 *
27475 * ``` js
27476 * request.post('/upload')
27477 * .field('foo', 'bar')
27478 * .end(callback);
27479 *
27480 * request.post('/upload')
27481 * .field({ foo: 'bar', baz: 'qux' })
27482 * .end(callback);
27483 * ```
27484 *
27485 * @param {String|Object} name name of field
27486 * @param {String|Blob|File|Buffer|fs.ReadStream} val value of field
27487 * @return {Request} for chaining
27488 * @api public
27489 */
27490
27491
27492RequestBase.prototype.field = function (name, val) {
27493 // name should be either a string or an object.
27494 if (name === null || undefined === name) {
27495 throw new Error('.field(name, val) name can not be empty');
27496 }
27497
27498 if (this._data) {
27499 throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");
27500 }
27501
27502 if (isObject(name)) {
27503 for (var key in name) {
27504 if (Object.prototype.hasOwnProperty.call(name, key)) this.field(key, name[key]);
27505 }
27506
27507 return this;
27508 }
27509
27510 if (Array.isArray(val)) {
27511 for (var i in val) {
27512 if (Object.prototype.hasOwnProperty.call(val, i)) this.field(name, val[i]);
27513 }
27514
27515 return this;
27516 } // val should be defined now
27517
27518
27519 if (val === null || undefined === val) {
27520 throw new Error('.field(name, val) val can not be empty');
27521 }
27522
27523 if (typeof val === 'boolean') {
27524 val = String(val);
27525 }
27526
27527 this._getFormData().append(name, val);
27528
27529 return this;
27530};
27531/**
27532 * Abort the request, and clear potential timeout.
27533 *
27534 * @return {Request} request
27535 * @api public
27536 */
27537
27538
27539RequestBase.prototype.abort = function () {
27540 if (this._aborted) {
27541 return this;
27542 }
27543
27544 this._aborted = true;
27545 if (this.xhr) this.xhr.abort(); // browser
27546
27547 if (this.req) this.req.abort(); // node
27548
27549 this.clearTimeout();
27550 this.emit('abort');
27551 return this;
27552};
27553
27554RequestBase.prototype._auth = function (user, pass, options, base64Encoder) {
27555 var _context;
27556
27557 switch (options.type) {
27558 case 'basic':
27559 this.set('Authorization', "Basic ".concat(base64Encoder((0, _concat.default)(_context = "".concat(user, ":")).call(_context, pass))));
27560 break;
27561
27562 case 'auto':
27563 this.username = user;
27564 this.password = pass;
27565 break;
27566
27567 case 'bearer':
27568 // usage would be .auth(accessToken, { type: 'bearer' })
27569 this.set('Authorization', "Bearer ".concat(user));
27570 break;
27571
27572 default:
27573 break;
27574 }
27575
27576 return this;
27577};
27578/**
27579 * Enable transmission of cookies with x-domain requests.
27580 *
27581 * Note that for this to work the origin must not be
27582 * using "Access-Control-Allow-Origin" with a wildcard,
27583 * and also must set "Access-Control-Allow-Credentials"
27584 * to "true".
27585 *
27586 * @api public
27587 */
27588
27589
27590RequestBase.prototype.withCredentials = function (on) {
27591 // This is browser-only functionality. Node side is no-op.
27592 if (on === undefined) on = true;
27593 this._withCredentials = on;
27594 return this;
27595};
27596/**
27597 * Set the max redirects to `n`. Does nothing in browser XHR implementation.
27598 *
27599 * @param {Number} n
27600 * @return {Request} for chaining
27601 * @api public
27602 */
27603
27604
27605RequestBase.prototype.redirects = function (n) {
27606 this._maxRedirects = n;
27607 return this;
27608};
27609/**
27610 * Maximum size of buffered response body, in bytes. Counts uncompressed size.
27611 * Default 200MB.
27612 *
27613 * @param {Number} n number of bytes
27614 * @return {Request} for chaining
27615 */
27616
27617
27618RequestBase.prototype.maxResponseSize = function (n) {
27619 if (typeof n !== 'number') {
27620 throw new TypeError('Invalid argument');
27621 }
27622
27623 this._maxResponseSize = n;
27624 return this;
27625};
27626/**
27627 * Convert to a plain javascript object (not JSON string) of scalar properties.
27628 * Note as this method is designed to return a useful non-this value,
27629 * it cannot be chained.
27630 *
27631 * @return {Object} describing method, url, and data of this request
27632 * @api public
27633 */
27634
27635
27636RequestBase.prototype.toJSON = function () {
27637 return {
27638 method: this.method,
27639 url: this.url,
27640 data: this._data,
27641 headers: this._header
27642 };
27643};
27644/**
27645 * Send `data` as the request body, defaulting the `.type()` to "json" when
27646 * an object is given.
27647 *
27648 * Examples:
27649 *
27650 * // manual json
27651 * request.post('/user')
27652 * .type('json')
27653 * .send('{"name":"tj"}')
27654 * .end(callback)
27655 *
27656 * // auto json
27657 * request.post('/user')
27658 * .send({ name: 'tj' })
27659 * .end(callback)
27660 *
27661 * // manual x-www-form-urlencoded
27662 * request.post('/user')
27663 * .type('form')
27664 * .send('name=tj')
27665 * .end(callback)
27666 *
27667 * // auto x-www-form-urlencoded
27668 * request.post('/user')
27669 * .type('form')
27670 * .send({ name: 'tj' })
27671 * .end(callback)
27672 *
27673 * // defaults to x-www-form-urlencoded
27674 * request.post('/user')
27675 * .send('name=tobi')
27676 * .send('species=ferret')
27677 * .end(callback)
27678 *
27679 * @param {String|Object} data
27680 * @return {Request} for chaining
27681 * @api public
27682 */
27683// eslint-disable-next-line complexity
27684
27685
27686RequestBase.prototype.send = function (data) {
27687 var isObj = isObject(data);
27688 var type = this._header['content-type'];
27689
27690 if (this._formData) {
27691 throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");
27692 }
27693
27694 if (isObj && !this._data) {
27695 if (Array.isArray(data)) {
27696 this._data = [];
27697 } else if (!this._isHost(data)) {
27698 this._data = {};
27699 }
27700 } else if (data && this._data && this._isHost(this._data)) {
27701 throw new Error("Can't merge these send calls");
27702 } // merge
27703
27704
27705 if (isObj && isObject(this._data)) {
27706 for (var key in data) {
27707 if (Object.prototype.hasOwnProperty.call(data, key)) this._data[key] = data[key];
27708 }
27709 } else if (typeof data === 'string') {
27710 // default to x-www-form-urlencoded
27711 if (!type) this.type('form');
27712 type = this._header['content-type'];
27713
27714 if (type === 'application/x-www-form-urlencoded') {
27715 var _context2;
27716
27717 this._data = this._data ? (0, _concat.default)(_context2 = "".concat(this._data, "&")).call(_context2, data) : data;
27718 } else {
27719 this._data = (this._data || '') + data;
27720 }
27721 } else {
27722 this._data = data;
27723 }
27724
27725 if (!isObj || this._isHost(data)) {
27726 return this;
27727 } // default to json
27728
27729
27730 if (!type) this.type('json');
27731 return this;
27732};
27733/**
27734 * Sort `querystring` by the sort function
27735 *
27736 *
27737 * Examples:
27738 *
27739 * // default order
27740 * request.get('/user')
27741 * .query('name=Nick')
27742 * .query('search=Manny')
27743 * .sortQuery()
27744 * .end(callback)
27745 *
27746 * // customized sort function
27747 * request.get('/user')
27748 * .query('name=Nick')
27749 * .query('search=Manny')
27750 * .sortQuery(function(a, b){
27751 * return a.length - b.length;
27752 * })
27753 * .end(callback)
27754 *
27755 *
27756 * @param {Function} sort
27757 * @return {Request} for chaining
27758 * @api public
27759 */
27760
27761
27762RequestBase.prototype.sortQuery = function (sort) {
27763 // _sort default to true but otherwise can be a function or boolean
27764 this._sort = typeof sort === 'undefined' ? true : sort;
27765 return this;
27766};
27767/**
27768 * Compose querystring to append to req.url
27769 *
27770 * @api private
27771 */
27772
27773
27774RequestBase.prototype._finalizeQueryString = function () {
27775 var query = this._query.join('&');
27776
27777 if (query) {
27778 var _context3;
27779
27780 this.url += ((0, _includes.default)(_context3 = this.url).call(_context3, '?') ? '&' : '?') + query;
27781 }
27782
27783 this._query.length = 0; // Makes the call idempotent
27784
27785 if (this._sort) {
27786 var _context4;
27787
27788 var index = (0, _indexOf.default)(_context4 = this.url).call(_context4, '?');
27789
27790 if (index >= 0) {
27791 var _context5, _context6;
27792
27793 var queryArr = (0, _slice.default)(_context5 = this.url).call(_context5, index + 1).split('&');
27794
27795 if (typeof this._sort === 'function') {
27796 (0, _sort.default)(queryArr).call(queryArr, this._sort);
27797 } else {
27798 (0, _sort.default)(queryArr).call(queryArr);
27799 }
27800
27801 this.url = (0, _slice.default)(_context6 = this.url).call(_context6, 0, index) + '?' + queryArr.join('&');
27802 }
27803 }
27804}; // For backwards compat only
27805
27806
27807RequestBase.prototype._appendQueryString = function () {
27808 console.warn('Unsupported');
27809};
27810/**
27811 * Invoke callback with timeout error.
27812 *
27813 * @api private
27814 */
27815
27816
27817RequestBase.prototype._timeoutError = function (reason, timeout, errno) {
27818 if (this._aborted) {
27819 return;
27820 }
27821
27822 var err = new Error("".concat(reason + timeout, "ms exceeded"));
27823 err.timeout = timeout;
27824 err.code = 'ECONNABORTED';
27825 err.errno = errno;
27826 this.timedout = true;
27827 this.timedoutError = err;
27828 this.abort();
27829 this.callback(err);
27830};
27831
27832RequestBase.prototype._setTimeouts = function () {
27833 var self = this; // deadline
27834
27835 if (this._timeout && !this._timer) {
27836 this._timer = setTimeout(function () {
27837 self._timeoutError('Timeout of ', self._timeout, 'ETIME');
27838 }, this._timeout);
27839 } // response timeout
27840
27841
27842 if (this._responseTimeout && !this._responseTimeoutTimer) {
27843 this._responseTimeoutTimer = setTimeout(function () {
27844 self._timeoutError('Response timeout of ', self._responseTimeout, 'ETIMEDOUT');
27845 }, this._responseTimeout);
27846 }
27847};
27848
27849/***/ }),
27850/* 559 */
27851/***/ (function(module, exports, __webpack_require__) {
27852
27853module.exports = __webpack_require__(560);
27854
27855/***/ }),
27856/* 560 */
27857/***/ (function(module, exports, __webpack_require__) {
27858
27859var parent = __webpack_require__(561);
27860
27861module.exports = parent;
27862
27863
27864/***/ }),
27865/* 561 */
27866/***/ (function(module, exports, __webpack_require__) {
27867
27868var isPrototypeOf = __webpack_require__(12);
27869var arrayMethod = __webpack_require__(562);
27870var stringMethod = __webpack_require__(564);
27871
27872var ArrayPrototype = Array.prototype;
27873var StringPrototype = String.prototype;
27874
27875module.exports = function (it) {
27876 var own = it.includes;
27877 if (it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.includes)) return arrayMethod;
27878 if (typeof it == 'string' || it === StringPrototype || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.includes)) {
27879 return stringMethod;
27880 } return own;
27881};
27882
27883
27884/***/ }),
27885/* 562 */
27886/***/ (function(module, exports, __webpack_require__) {
27887
27888__webpack_require__(563);
27889var entryVirtual = __webpack_require__(26);
27890
27891module.exports = entryVirtual('Array').includes;
27892
27893
27894/***/ }),
27895/* 563 */
27896/***/ (function(module, exports, __webpack_require__) {
27897
27898"use strict";
27899
27900var $ = __webpack_require__(0);
27901var $includes = __webpack_require__(115).includes;
27902var fails = __webpack_require__(3);
27903var addToUnscopables = __webpack_require__(122);
27904
27905// FF99+ bug
27906var BROKEN_ON_SPARSE = fails(function () {
27907 return !Array(1).includes();
27908});
27909
27910// `Array.prototype.includes` method
27911// https://tc39.es/ecma262/#sec-array.prototype.includes
27912$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
27913 includes: function includes(el /* , fromIndex = 0 */) {
27914 return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
27915 }
27916});
27917
27918// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
27919addToUnscopables('includes');
27920
27921
27922/***/ }),
27923/* 564 */
27924/***/ (function(module, exports, __webpack_require__) {
27925
27926__webpack_require__(565);
27927var entryVirtual = __webpack_require__(26);
27928
27929module.exports = entryVirtual('String').includes;
27930
27931
27932/***/ }),
27933/* 565 */
27934/***/ (function(module, exports, __webpack_require__) {
27935
27936"use strict";
27937
27938var $ = __webpack_require__(0);
27939var uncurryThis = __webpack_require__(4);
27940var notARegExp = __webpack_require__(566);
27941var requireObjectCoercible = __webpack_require__(74);
27942var toString = __webpack_require__(40);
27943var correctIsRegExpLogic = __webpack_require__(568);
27944
27945var stringIndexOf = uncurryThis(''.indexOf);
27946
27947// `String.prototype.includes` method
27948// https://tc39.es/ecma262/#sec-string.prototype.includes
27949$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
27950 includes: function includes(searchString /* , position = 0 */) {
27951 return !!~stringIndexOf(
27952 toString(requireObjectCoercible(this)),
27953 toString(notARegExp(searchString)),
27954 arguments.length > 1 ? arguments[1] : undefined
27955 );
27956 }
27957});
27958
27959
27960/***/ }),
27961/* 566 */
27962/***/ (function(module, exports, __webpack_require__) {
27963
27964var isRegExp = __webpack_require__(567);
27965
27966var $TypeError = TypeError;
27967
27968module.exports = function (it) {
27969 if (isRegExp(it)) {
27970 throw $TypeError("The method doesn't accept regular expressions");
27971 } return it;
27972};
27973
27974
27975/***/ }),
27976/* 567 */
27977/***/ (function(module, exports, __webpack_require__) {
27978
27979var isObject = __webpack_require__(17);
27980var classof = __webpack_require__(54);
27981var wellKnownSymbol = __webpack_require__(5);
27982
27983var MATCH = wellKnownSymbol('match');
27984
27985// `IsRegExp` abstract operation
27986// https://tc39.es/ecma262/#sec-isregexp
27987module.exports = function (it) {
27988 var isRegExp;
27989 return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
27990};
27991
27992
27993/***/ }),
27994/* 568 */
27995/***/ (function(module, exports, __webpack_require__) {
27996
27997var wellKnownSymbol = __webpack_require__(5);
27998
27999var MATCH = wellKnownSymbol('match');
28000
28001module.exports = function (METHOD_NAME) {
28002 var regexp = /./;
28003 try {
28004 '/./'[METHOD_NAME](regexp);
28005 } catch (error1) {
28006 try {
28007 regexp[MATCH] = false;
28008 return '/./'[METHOD_NAME](regexp);
28009 } catch (error2) { /* empty */ }
28010 } return false;
28011};
28012
28013
28014/***/ }),
28015/* 569 */
28016/***/ (function(module, exports, __webpack_require__) {
28017
28018module.exports = __webpack_require__(570);
28019
28020/***/ }),
28021/* 570 */
28022/***/ (function(module, exports, __webpack_require__) {
28023
28024var parent = __webpack_require__(571);
28025
28026module.exports = parent;
28027
28028
28029/***/ }),
28030/* 571 */
28031/***/ (function(module, exports, __webpack_require__) {
28032
28033var isPrototypeOf = __webpack_require__(12);
28034var method = __webpack_require__(572);
28035
28036var ArrayPrototype = Array.prototype;
28037
28038module.exports = function (it) {
28039 var own = it.sort;
28040 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.sort) ? method : own;
28041};
28042
28043
28044/***/ }),
28045/* 572 */
28046/***/ (function(module, exports, __webpack_require__) {
28047
28048__webpack_require__(573);
28049var entryVirtual = __webpack_require__(26);
28050
28051module.exports = entryVirtual('Array').sort;
28052
28053
28054/***/ }),
28055/* 573 */
28056/***/ (function(module, exports, __webpack_require__) {
28057
28058"use strict";
28059
28060var $ = __webpack_require__(0);
28061var uncurryThis = __webpack_require__(4);
28062var aCallable = __webpack_require__(28);
28063var toObject = __webpack_require__(33);
28064var lengthOfArrayLike = __webpack_require__(36);
28065var deletePropertyOrThrow = __webpack_require__(574);
28066var toString = __webpack_require__(40);
28067var fails = __webpack_require__(3);
28068var internalSort = __webpack_require__(575);
28069var arrayMethodIsStrict = __webpack_require__(139);
28070var FF = __webpack_require__(576);
28071var IE_OR_EDGE = __webpack_require__(577);
28072var V8 = __webpack_require__(56);
28073var WEBKIT = __webpack_require__(578);
28074
28075var test = [];
28076var un$Sort = uncurryThis(test.sort);
28077var push = uncurryThis(test.push);
28078
28079// IE8-
28080var FAILS_ON_UNDEFINED = fails(function () {
28081 test.sort(undefined);
28082});
28083// V8 bug
28084var FAILS_ON_NULL = fails(function () {
28085 test.sort(null);
28086});
28087// Old WebKit
28088var STRICT_METHOD = arrayMethodIsStrict('sort');
28089
28090var STABLE_SORT = !fails(function () {
28091 // feature detection can be too slow, so check engines versions
28092 if (V8) return V8 < 70;
28093 if (FF && FF > 3) return;
28094 if (IE_OR_EDGE) return true;
28095 if (WEBKIT) return WEBKIT < 603;
28096
28097 var result = '';
28098 var code, chr, value, index;
28099
28100 // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
28101 for (code = 65; code < 76; code++) {
28102 chr = String.fromCharCode(code);
28103
28104 switch (code) {
28105 case 66: case 69: case 70: case 72: value = 3; break;
28106 case 68: case 71: value = 4; break;
28107 default: value = 2;
28108 }
28109
28110 for (index = 0; index < 47; index++) {
28111 test.push({ k: chr + index, v: value });
28112 }
28113 }
28114
28115 test.sort(function (a, b) { return b.v - a.v; });
28116
28117 for (index = 0; index < test.length; index++) {
28118 chr = test[index].k.charAt(0);
28119 if (result.charAt(result.length - 1) !== chr) result += chr;
28120 }
28121
28122 return result !== 'DGBEFHACIJK';
28123});
28124
28125var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
28126
28127var getSortCompare = function (comparefn) {
28128 return function (x, y) {
28129 if (y === undefined) return -1;
28130 if (x === undefined) return 1;
28131 if (comparefn !== undefined) return +comparefn(x, y) || 0;
28132 return toString(x) > toString(y) ? 1 : -1;
28133 };
28134};
28135
28136// `Array.prototype.sort` method
28137// https://tc39.es/ecma262/#sec-array.prototype.sort
28138$({ target: 'Array', proto: true, forced: FORCED }, {
28139 sort: function sort(comparefn) {
28140 if (comparefn !== undefined) aCallable(comparefn);
28141
28142 var array = toObject(this);
28143
28144 if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
28145
28146 var items = [];
28147 var arrayLength = lengthOfArrayLike(array);
28148 var itemsLength, index;
28149
28150 for (index = 0; index < arrayLength; index++) {
28151 if (index in array) push(items, array[index]);
28152 }
28153
28154 internalSort(items, getSortCompare(comparefn));
28155
28156 itemsLength = items.length;
28157 index = 0;
28158
28159 while (index < itemsLength) array[index] = items[index++];
28160 while (index < arrayLength) deletePropertyOrThrow(array, index++);
28161
28162 return array;
28163 }
28164});
28165
28166
28167/***/ }),
28168/* 574 */
28169/***/ (function(module, exports, __webpack_require__) {
28170
28171"use strict";
28172
28173var tryToString = __webpack_require__(57);
28174
28175var $TypeError = TypeError;
28176
28177module.exports = function (O, P) {
28178 if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
28179};
28180
28181
28182/***/ }),
28183/* 575 */
28184/***/ (function(module, exports, __webpack_require__) {
28185
28186var arraySlice = __webpack_require__(231);
28187
28188var floor = Math.floor;
28189
28190var mergeSort = function (array, comparefn) {
28191 var length = array.length;
28192 var middle = floor(length / 2);
28193 return length < 8 ? insertionSort(array, comparefn) : merge(
28194 array,
28195 mergeSort(arraySlice(array, 0, middle), comparefn),
28196 mergeSort(arraySlice(array, middle), comparefn),
28197 comparefn
28198 );
28199};
28200
28201var insertionSort = function (array, comparefn) {
28202 var length = array.length;
28203 var i = 1;
28204 var element, j;
28205
28206 while (i < length) {
28207 j = i;
28208 element = array[i];
28209 while (j && comparefn(array[j - 1], element) > 0) {
28210 array[j] = array[--j];
28211 }
28212 if (j !== i++) array[j] = element;
28213 } return array;
28214};
28215
28216var merge = function (array, left, right, comparefn) {
28217 var llength = left.length;
28218 var rlength = right.length;
28219 var lindex = 0;
28220 var rindex = 0;
28221
28222 while (lindex < llength || rindex < rlength) {
28223 array[lindex + rindex] = (lindex < llength && rindex < rlength)
28224 ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
28225 : lindex < llength ? left[lindex++] : right[rindex++];
28226 } return array;
28227};
28228
28229module.exports = mergeSort;
28230
28231
28232/***/ }),
28233/* 576 */
28234/***/ (function(module, exports, __webpack_require__) {
28235
28236var userAgent = __webpack_require__(45);
28237
28238var firefox = userAgent.match(/firefox\/(\d+)/i);
28239
28240module.exports = !!firefox && +firefox[1];
28241
28242
28243/***/ }),
28244/* 577 */
28245/***/ (function(module, exports, __webpack_require__) {
28246
28247var UA = __webpack_require__(45);
28248
28249module.exports = /MSIE|Trident/.test(UA);
28250
28251
28252/***/ }),
28253/* 578 */
28254/***/ (function(module, exports, __webpack_require__) {
28255
28256var userAgent = __webpack_require__(45);
28257
28258var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
28259
28260module.exports = !!webkit && +webkit[1];
28261
28262
28263/***/ }),
28264/* 579 */
28265/***/ (function(module, exports, __webpack_require__) {
28266
28267"use strict";
28268
28269/**
28270 * Module dependencies.
28271 */
28272
28273var utils = __webpack_require__(580);
28274/**
28275 * Expose `ResponseBase`.
28276 */
28277
28278
28279module.exports = ResponseBase;
28280/**
28281 * Initialize a new `ResponseBase`.
28282 *
28283 * @api public
28284 */
28285
28286function ResponseBase(obj) {
28287 if (obj) return mixin(obj);
28288}
28289/**
28290 * Mixin the prototype properties.
28291 *
28292 * @param {Object} obj
28293 * @return {Object}
28294 * @api private
28295 */
28296
28297
28298function mixin(obj) {
28299 for (var key in ResponseBase.prototype) {
28300 if (Object.prototype.hasOwnProperty.call(ResponseBase.prototype, key)) obj[key] = ResponseBase.prototype[key];
28301 }
28302
28303 return obj;
28304}
28305/**
28306 * Get case-insensitive `field` value.
28307 *
28308 * @param {String} field
28309 * @return {String}
28310 * @api public
28311 */
28312
28313
28314ResponseBase.prototype.get = function (field) {
28315 return this.header[field.toLowerCase()];
28316};
28317/**
28318 * Set header related properties:
28319 *
28320 * - `.type` the content type without params
28321 *
28322 * A response of "Content-Type: text/plain; charset=utf-8"
28323 * will provide you with a `.type` of "text/plain".
28324 *
28325 * @param {Object} header
28326 * @api private
28327 */
28328
28329
28330ResponseBase.prototype._setHeaderProperties = function (header) {
28331 // TODO: moar!
28332 // TODO: make this a util
28333 // content-type
28334 var ct = header['content-type'] || '';
28335 this.type = utils.type(ct); // params
28336
28337 var params = utils.params(ct);
28338
28339 for (var key in params) {
28340 if (Object.prototype.hasOwnProperty.call(params, key)) this[key] = params[key];
28341 }
28342
28343 this.links = {}; // links
28344
28345 try {
28346 if (header.link) {
28347 this.links = utils.parseLinks(header.link);
28348 }
28349 } catch (_unused) {// ignore
28350 }
28351};
28352/**
28353 * Set flags such as `.ok` based on `status`.
28354 *
28355 * For example a 2xx response will give you a `.ok` of __true__
28356 * whereas 5xx will be __false__ and `.error` will be __true__. The
28357 * `.clientError` and `.serverError` are also available to be more
28358 * specific, and `.statusType` is the class of error ranging from 1..5
28359 * sometimes useful for mapping respond colors etc.
28360 *
28361 * "sugar" properties are also defined for common cases. Currently providing:
28362 *
28363 * - .noContent
28364 * - .badRequest
28365 * - .unauthorized
28366 * - .notAcceptable
28367 * - .notFound
28368 *
28369 * @param {Number} status
28370 * @api private
28371 */
28372
28373
28374ResponseBase.prototype._setStatusProperties = function (status) {
28375 var type = status / 100 | 0; // status / class
28376
28377 this.statusCode = status;
28378 this.status = this.statusCode;
28379 this.statusType = type; // basics
28380
28381 this.info = type === 1;
28382 this.ok = type === 2;
28383 this.redirect = type === 3;
28384 this.clientError = type === 4;
28385 this.serverError = type === 5;
28386 this.error = type === 4 || type === 5 ? this.toError() : false; // sugar
28387
28388 this.created = status === 201;
28389 this.accepted = status === 202;
28390 this.noContent = status === 204;
28391 this.badRequest = status === 400;
28392 this.unauthorized = status === 401;
28393 this.notAcceptable = status === 406;
28394 this.forbidden = status === 403;
28395 this.notFound = status === 404;
28396 this.unprocessableEntity = status === 422;
28397};
28398
28399/***/ }),
28400/* 580 */
28401/***/ (function(module, exports, __webpack_require__) {
28402
28403"use strict";
28404
28405/**
28406 * Return the mime type for the given `str`.
28407 *
28408 * @param {String} str
28409 * @return {String}
28410 * @api private
28411 */
28412
28413var _interopRequireDefault = __webpack_require__(1);
28414
28415var _reduce = _interopRequireDefault(__webpack_require__(581));
28416
28417var _slice = _interopRequireDefault(__webpack_require__(38));
28418
28419exports.type = function (str) {
28420 return str.split(/ *; */).shift();
28421};
28422/**
28423 * Return header field parameters.
28424 *
28425 * @param {String} str
28426 * @return {Object}
28427 * @api private
28428 */
28429
28430
28431exports.params = function (str) {
28432 var _context;
28433
28434 return (0, _reduce.default)(_context = str.split(/ *; */)).call(_context, function (obj, str) {
28435 var parts = str.split(/ *= */);
28436 var key = parts.shift();
28437 var val = parts.shift();
28438 if (key && val) obj[key] = val;
28439 return obj;
28440 }, {});
28441};
28442/**
28443 * Parse Link header fields.
28444 *
28445 * @param {String} str
28446 * @return {Object}
28447 * @api private
28448 */
28449
28450
28451exports.parseLinks = function (str) {
28452 var _context2;
28453
28454 return (0, _reduce.default)(_context2 = str.split(/ *, */)).call(_context2, function (obj, str) {
28455 var _context3, _context4;
28456
28457 var parts = str.split(/ *; */);
28458 var url = (0, _slice.default)(_context3 = parts[0]).call(_context3, 1, -1);
28459 var rel = (0, _slice.default)(_context4 = parts[1].split(/ *= */)[1]).call(_context4, 1, -1);
28460 obj[rel] = url;
28461 return obj;
28462 }, {});
28463};
28464/**
28465 * Strip content related fields from `header`.
28466 *
28467 * @param {Object} header
28468 * @return {Object} header
28469 * @api private
28470 */
28471
28472
28473exports.cleanHeader = function (header, changesOrigin) {
28474 delete header['content-type'];
28475 delete header['content-length'];
28476 delete header['transfer-encoding'];
28477 delete header.host; // secuirty
28478
28479 if (changesOrigin) {
28480 delete header.authorization;
28481 delete header.cookie;
28482 }
28483
28484 return header;
28485};
28486
28487/***/ }),
28488/* 581 */
28489/***/ (function(module, exports, __webpack_require__) {
28490
28491module.exports = __webpack_require__(582);
28492
28493/***/ }),
28494/* 582 */
28495/***/ (function(module, exports, __webpack_require__) {
28496
28497var parent = __webpack_require__(583);
28498
28499module.exports = parent;
28500
28501
28502/***/ }),
28503/* 583 */
28504/***/ (function(module, exports, __webpack_require__) {
28505
28506var isPrototypeOf = __webpack_require__(12);
28507var method = __webpack_require__(584);
28508
28509var ArrayPrototype = Array.prototype;
28510
28511module.exports = function (it) {
28512 var own = it.reduce;
28513 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.reduce) ? method : own;
28514};
28515
28516
28517/***/ }),
28518/* 584 */
28519/***/ (function(module, exports, __webpack_require__) {
28520
28521__webpack_require__(585);
28522var entryVirtual = __webpack_require__(26);
28523
28524module.exports = entryVirtual('Array').reduce;
28525
28526
28527/***/ }),
28528/* 585 */
28529/***/ (function(module, exports, __webpack_require__) {
28530
28531"use strict";
28532
28533var $ = __webpack_require__(0);
28534var $reduce = __webpack_require__(586).left;
28535var arrayMethodIsStrict = __webpack_require__(139);
28536var CHROME_VERSION = __webpack_require__(56);
28537var IS_NODE = __webpack_require__(97);
28538
28539var STRICT_METHOD = arrayMethodIsStrict('reduce');
28540// Chrome 80-82 has a critical bug
28541// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
28542var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
28543
28544// `Array.prototype.reduce` method
28545// https://tc39.es/ecma262/#sec-array.prototype.reduce
28546$({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
28547 reduce: function reduce(callbackfn /* , initialValue */) {
28548 var length = arguments.length;
28549 return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
28550 }
28551});
28552
28553
28554/***/ }),
28555/* 586 */
28556/***/ (function(module, exports, __webpack_require__) {
28557
28558var aCallable = __webpack_require__(28);
28559var toObject = __webpack_require__(33);
28560var IndexedObject = __webpack_require__(109);
28561var lengthOfArrayLike = __webpack_require__(36);
28562
28563var $TypeError = TypeError;
28564
28565// `Array.prototype.{ reduce, reduceRight }` methods implementation
28566var createMethod = function (IS_RIGHT) {
28567 return function (that, callbackfn, argumentsLength, memo) {
28568 aCallable(callbackfn);
28569 var O = toObject(that);
28570 var self = IndexedObject(O);
28571 var length = lengthOfArrayLike(O);
28572 var index = IS_RIGHT ? length - 1 : 0;
28573 var i = IS_RIGHT ? -1 : 1;
28574 if (argumentsLength < 2) while (true) {
28575 if (index in self) {
28576 memo = self[index];
28577 index += i;
28578 break;
28579 }
28580 index += i;
28581 if (IS_RIGHT ? index < 0 : length <= index) {
28582 throw $TypeError('Reduce of empty array with no initial value');
28583 }
28584 }
28585 for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
28586 memo = callbackfn(memo, self[index], index, O);
28587 }
28588 return memo;
28589 };
28590};
28591
28592module.exports = {
28593 // `Array.prototype.reduce` method
28594 // https://tc39.es/ecma262/#sec-array.prototype.reduce
28595 left: createMethod(false),
28596 // `Array.prototype.reduceRight` method
28597 // https://tc39.es/ecma262/#sec-array.prototype.reduceright
28598 right: createMethod(true)
28599};
28600
28601
28602/***/ }),
28603/* 587 */
28604/***/ (function(module, exports, __webpack_require__) {
28605
28606"use strict";
28607
28608
28609var _interopRequireDefault = __webpack_require__(1);
28610
28611var _slice = _interopRequireDefault(__webpack_require__(38));
28612
28613var _from = _interopRequireDefault(__webpack_require__(236));
28614
28615var _symbol = _interopRequireDefault(__webpack_require__(87));
28616
28617var _isIterable2 = _interopRequireDefault(__webpack_require__(588));
28618
28619function _toConsumableArray(arr) {
28620 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
28621}
28622
28623function _nonIterableSpread() {
28624 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
28625}
28626
28627function _unsupportedIterableToArray(o, minLen) {
28628 var _context;
28629
28630 if (!o) return;
28631 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
28632 var n = (0, _slice.default)(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
28633 if (n === "Object" && o.constructor) n = o.constructor.name;
28634 if (n === "Map" || n === "Set") return (0, _from.default)(o);
28635 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
28636}
28637
28638function _iterableToArray(iter) {
28639 if (typeof _symbol.default !== "undefined" && (0, _isIterable2.default)(Object(iter))) return (0, _from.default)(iter);
28640}
28641
28642function _arrayWithoutHoles(arr) {
28643 if (Array.isArray(arr)) return _arrayLikeToArray(arr);
28644}
28645
28646function _arrayLikeToArray(arr, len) {
28647 if (len == null || len > arr.length) len = arr.length;
28648
28649 for (var i = 0, arr2 = new Array(len); i < len; i++) {
28650 arr2[i] = arr[i];
28651 }
28652
28653 return arr2;
28654}
28655
28656function Agent() {
28657 this._defaults = [];
28658}
28659
28660['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts'].forEach(function (fn) {
28661 // Default setting for all requests from this agent
28662 Agent.prototype[fn] = function () {
28663 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28664 args[_key] = arguments[_key];
28665 }
28666
28667 this._defaults.push({
28668 fn: fn,
28669 args: args
28670 });
28671
28672 return this;
28673 };
28674});
28675
28676Agent.prototype._setDefaults = function (req) {
28677 this._defaults.forEach(function (def) {
28678 req[def.fn].apply(req, _toConsumableArray(def.args));
28679 });
28680};
28681
28682module.exports = Agent;
28683
28684/***/ }),
28685/* 588 */
28686/***/ (function(module, exports, __webpack_require__) {
28687
28688module.exports = __webpack_require__(589);
28689
28690/***/ }),
28691/* 589 */
28692/***/ (function(module, exports, __webpack_require__) {
28693
28694module.exports = __webpack_require__(590);
28695
28696
28697/***/ }),
28698/* 590 */
28699/***/ (function(module, exports, __webpack_require__) {
28700
28701var parent = __webpack_require__(591);
28702
28703module.exports = parent;
28704
28705
28706/***/ }),
28707/* 591 */
28708/***/ (function(module, exports, __webpack_require__) {
28709
28710var parent = __webpack_require__(592);
28711
28712module.exports = parent;
28713
28714
28715/***/ }),
28716/* 592 */
28717/***/ (function(module, exports, __webpack_require__) {
28718
28719var parent = __webpack_require__(593);
28720__webpack_require__(63);
28721
28722module.exports = parent;
28723
28724
28725/***/ }),
28726/* 593 */
28727/***/ (function(module, exports, __webpack_require__) {
28728
28729__webpack_require__(60);
28730__webpack_require__(79);
28731var isIterable = __webpack_require__(594);
28732
28733module.exports = isIterable;
28734
28735
28736/***/ }),
28737/* 594 */
28738/***/ (function(module, exports, __webpack_require__) {
28739
28740var classof = __webpack_require__(47);
28741var hasOwn = __webpack_require__(13);
28742var wellKnownSymbol = __webpack_require__(5);
28743var Iterators = __webpack_require__(46);
28744
28745var ITERATOR = wellKnownSymbol('iterator');
28746var $Object = Object;
28747
28748module.exports = function (it) {
28749 var O = $Object(it);
28750 return O[ITERATOR] !== undefined
28751 || '@@iterator' in O
28752 || hasOwn(Iterators, classof(O));
28753};
28754
28755
28756/***/ })
28757/******/ ]);
28758});
28759//# sourceMappingURL=av.js.map
\No newline at end of file