UNPKG

821 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 = 236);
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__(62);
84var uncurryThis = __webpack_require__(6);
85var isCallable = __webpack_require__(7);
86var getOwnPropertyDescriptor = __webpack_require__(64).f;
87var isForced = __webpack_require__(142);
88var path = __webpack_require__(13);
89var bind = __webpack_require__(50);
90var createNonEnumerableProperty = __webpack_require__(36);
91var hasOwn = __webpack_require__(14);
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, __webpack_exports__, __webpack_require__) {
188
189"use strict";
190Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
191/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_default_js__ = __webpack_require__(279);
192/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__index_default_js__["a"]; });
193/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_js__ = __webpack_require__(120);
194/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["VERSION"]; });
195/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["restArguments"]; });
196/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isObject"]; });
197/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNull"]; });
198/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isUndefined"]; });
199/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isBoolean"]; });
200/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isElement"]; });
201/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isString"]; });
202/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNumber"]; });
203/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDate"]; });
204/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isRegExp"]; });
205/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isError"]; });
206/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSymbol"]; });
207/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArrayBuffer"]; });
208/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDataView"]; });
209/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArray"]; });
210/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFunction"]; });
211/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArguments"]; });
212/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFinite"]; });
213/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNaN"]; });
214/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isTypedArray"]; });
215/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEmpty"]; });
216/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMatch"]; });
217/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEqual"]; });
218/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMap"]; });
219/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakMap"]; });
220/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSet"]; });
221/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakSet"]; });
222/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["keys"]; });
223/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["allKeys"]; });
224/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["values"]; });
225/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pairs"]; });
226/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invert"]; });
227/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["functions"]; });
228/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["methods"]; });
229/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extend"]; });
230/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extendOwn"]; });
231/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["assign"]; });
232/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defaults"]; });
233/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["create"]; });
234/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["clone"]; });
235/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tap"]; });
236/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["get"]; });
237/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["has"]; });
238/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mapObject"]; });
239/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["identity"]; });
240/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["constant"]; });
241/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["noop"]; });
242/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toPath"]; });
243/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["property"]; });
244/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["propertyOf"]; });
245/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matcher"]; });
246/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matches"]; });
247/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["times"]; });
248/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["random"]; });
249/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["now"]; });
250/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["escape"]; });
251/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unescape"]; });
252/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["templateSettings"]; });
253/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["template"]; });
254/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["result"]; });
255/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniqueId"]; });
256/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chain"]; });
257/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["iteratee"]; });
258/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partial"]; });
259/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bind"]; });
260/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bindAll"]; });
261/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["memoize"]; });
262/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["delay"]; });
263/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defer"]; });
264/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["throttle"]; });
265/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["debounce"]; });
266/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["wrap"]; });
267/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["negate"]; });
268/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compose"]; });
269/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["after"]; });
270/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["before"]; });
271/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["once"]; });
272/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findKey"]; });
273/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findIndex"]; });
274/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findLastIndex"]; });
275/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortedIndex"]; });
276/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexOf"]; });
277/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["lastIndexOf"]; });
278/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["find"]; });
279/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["detect"]; });
280/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findWhere"]; });
281/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["each"]; });
282/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["forEach"]; });
283/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["map"]; });
284/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["collect"]; });
285/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduce"]; });
286/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldl"]; });
287/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["inject"]; });
288/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduceRight"]; });
289/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldr"]; });
290/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["filter"]; });
291/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["select"]; });
292/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reject"]; });
293/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["every"]; });
294/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["all"]; });
295/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["some"]; });
296/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["any"]; });
297/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["contains"]; });
298/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["includes"]; });
299/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["include"]; });
300/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invoke"]; });
301/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pluck"]; });
302/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["where"]; });
303/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["max"]; });
304/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["min"]; });
305/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["shuffle"]; });
306/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sample"]; });
307/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortBy"]; });
308/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["groupBy"]; });
309/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexBy"]; });
310/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["countBy"]; });
311/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partition"]; });
312/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toArray"]; });
313/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["size"]; });
314/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pick"]; });
315/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["omit"]; });
316/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["first"]; });
317/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["head"]; });
318/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["take"]; });
319/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["initial"]; });
320/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["last"]; });
321/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["rest"]; });
322/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tail"]; });
323/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["drop"]; });
324/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compact"]; });
325/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["flatten"]; });
326/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["without"]; });
327/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniq"]; });
328/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unique"]; });
329/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["union"]; });
330/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["intersection"]; });
331/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["difference"]; });
332/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unzip"]; });
333/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["transpose"]; });
334/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["zip"]; });
335/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["object"]; });
336/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["range"]; });
337/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chunk"]; });
338/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mixin"]; });
339// ESM Exports
340// ===========
341// This module is the package entry point for ES module users. In other words,
342// it is the module they are interfacing with when they import from the whole
343// package instead of from a submodule, like this:
344//
345// ```js
346// import { map } from 'underscore';
347// ```
348//
349// The difference with `./index-default`, which is the package entry point for
350// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and
351// default exports are considered to be siblings, so when you have a default
352// export, its properties are not automatically available as named exports. For
353// this reason, we re-export the named exports in addition to providing the same
354// default export as in `./index-default`.
355
356
357
358
359/***/ }),
360/* 2 */
361/***/ (function(module, exports) {
362
363function _interopRequireDefault(obj) {
364 return obj && obj.__esModule ? obj : {
365 "default": obj
366 };
367}
368
369module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
370
371/***/ }),
372/* 3 */
373/***/ (function(module, __webpack_exports__, __webpack_require__) {
374
375"use strict";
376/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; });
377/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return root; });
378/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; });
379/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; });
380/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; });
381/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return push; });
382/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return slice; });
383/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toString; });
384/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; });
385/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; });
386/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; });
387/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; });
388/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; });
389/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; });
390/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; });
391/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; });
392/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; });
393/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; });
394/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; });
395/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; });
396// Current version.
397var VERSION = '1.12.1';
398
399// Establish the root object, `window` (`self`) in the browser, `global`
400// on the server, or `this` in some virtual machines. We use `self`
401// instead of `window` for `WebWorker` support.
402var root = typeof self == 'object' && self.self === self && self ||
403 typeof global == 'object' && global.global === global && global ||
404 Function('return this')() ||
405 {};
406
407// Save bytes in the minified (but not gzipped) version:
408var ArrayProto = Array.prototype, ObjProto = Object.prototype;
409var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
410
411// Create quick reference variables for speed access to core prototypes.
412var push = ArrayProto.push,
413 slice = ArrayProto.slice,
414 toString = ObjProto.toString,
415 hasOwnProperty = ObjProto.hasOwnProperty;
416
417// Modern feature detection.
418var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
419 supportsDataView = typeof DataView !== 'undefined';
420
421// All **ECMAScript 5+** native function implementations that we hope to use
422// are declared here.
423var nativeIsArray = Array.isArray,
424 nativeKeys = Object.keys,
425 nativeCreate = Object.create,
426 nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
427
428// Create references to these builtin functions because we override them.
429var _isNaN = isNaN,
430 _isFinite = isFinite;
431
432// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
433var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
434var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
435 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
436
437// The largest integer that can be represented exactly.
438var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
439
440/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(105)))
441
442/***/ }),
443/* 4 */
444/***/ (function(module, exports) {
445
446module.exports = function (exec) {
447 try {
448 return !!exec();
449 } catch (error) {
450 return true;
451 }
452};
453
454
455/***/ }),
456/* 5 */
457/***/ (function(module, exports, __webpack_require__) {
458
459var path = __webpack_require__(13);
460var hasOwn = __webpack_require__(14);
461var wrappedWellKnownSymbolModule = __webpack_require__(136);
462var defineProperty = __webpack_require__(32).f;
463
464module.exports = function (NAME) {
465 var Symbol = path.Symbol || (path.Symbol = {});
466 if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
467 value: wrappedWellKnownSymbolModule.f(NAME)
468 });
469};
470
471
472/***/ }),
473/* 6 */
474/***/ (function(module, exports, __webpack_require__) {
475
476var NATIVE_BIND = __webpack_require__(63);
477
478var FunctionPrototype = Function.prototype;
479var bind = FunctionPrototype.bind;
480var call = FunctionPrototype.call;
481var uncurryThis = NATIVE_BIND && bind.bind(call, call);
482
483module.exports = NATIVE_BIND ? function (fn) {
484 return fn && uncurryThis(fn);
485} : function (fn) {
486 return fn && function () {
487 return call.apply(fn, arguments);
488 };
489};
490
491
492/***/ }),
493/* 7 */
494/***/ (function(module, exports) {
495
496// `IsCallable` abstract operation
497// https://tc39.es/ecma262/#sec-iscallable
498module.exports = function (argument) {
499 return typeof argument == 'function';
500};
501
502
503/***/ }),
504/* 8 */
505/***/ (function(module, exports, __webpack_require__) {
506
507var global = __webpack_require__(9);
508var shared = __webpack_require__(67);
509var hasOwn = __webpack_require__(14);
510var uid = __webpack_require__(109);
511var NATIVE_SYMBOL = __webpack_require__(49);
512var USE_SYMBOL_AS_UID = __webpack_require__(140);
513
514var WellKnownSymbolsStore = shared('wks');
515var Symbol = global.Symbol;
516var symbolFor = Symbol && Symbol['for'];
517var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
518
519module.exports = function (name) {
520 if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
521 var description = 'Symbol.' + name;
522 if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
523 WellKnownSymbolsStore[name] = Symbol[name];
524 } else if (USE_SYMBOL_AS_UID && symbolFor) {
525 WellKnownSymbolsStore[name] = symbolFor(description);
526 } else {
527 WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
528 }
529 } return WellKnownSymbolsStore[name];
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__(105)))
553
554/***/ }),
555/* 10 */
556/***/ (function(module, exports, __webpack_require__) {
557
558module.exports = __webpack_require__(238);
559
560/***/ }),
561/* 11 */
562/***/ (function(module, exports, __webpack_require__) {
563
564var NATIVE_BIND = __webpack_require__(63);
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, __webpack_exports__, __webpack_require__) {
576
577"use strict";
578/* harmony export (immutable) */ __webpack_exports__["a"] = keys;
579/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(45);
580/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
581/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(37);
582/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(172);
583
584
585
586
587
588// Retrieve the names of an object's own properties.
589// Delegates to **ECMAScript 5**'s native `Object.keys`.
590function keys(obj) {
591 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
592 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */])(obj);
593 var keys = [];
594 for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, key)) keys.push(key);
595 // Ahem, IE < 9.
596 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" /* default */])(obj, keys);
597 return keys;
598}
599
600
601/***/ }),
602/* 13 */
603/***/ (function(module, exports) {
604
605module.exports = {};
606
607
608/***/ }),
609/* 14 */
610/***/ (function(module, exports, __webpack_require__) {
611
612var uncurryThis = __webpack_require__(6);
613var toObject = __webpack_require__(35);
614
615var hasOwnProperty = uncurryThis({}.hasOwnProperty);
616
617// `HasOwnProperty` abstract operation
618// https://tc39.es/ecma262/#sec-hasownproperty
619// eslint-disable-next-line es-x/no-object-hasown -- safe
620module.exports = Object.hasOwn || function hasOwn(it, key) {
621 return hasOwnProperty(toObject(it), key);
622};
623
624
625/***/ }),
626/* 15 */
627/***/ (function(module, __webpack_exports__, __webpack_require__) {
628
629"use strict";
630/* harmony export (immutable) */ __webpack_exports__["a"] = tagTester;
631/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
632
633
634// Internal function for creating a `toString`-based type tester.
635function tagTester(name) {
636 var tag = '[object ' + name + ']';
637 return function(obj) {
638 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === tag;
639 };
640}
641
642
643/***/ }),
644/* 16 */
645/***/ (function(module, exports, __webpack_require__) {
646
647var path = __webpack_require__(13);
648var global = __webpack_require__(9);
649var isCallable = __webpack_require__(7);
650
651var aFunction = function (variable) {
652 return isCallable(variable) ? variable : undefined;
653};
654
655module.exports = function (namespace, method) {
656 return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
657 : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
658};
659
660
661/***/ }),
662/* 17 */
663/***/ (function(module, exports, __webpack_require__) {
664
665var isCallable = __webpack_require__(7);
666
667module.exports = function (it) {
668 return typeof it == 'object' ? it !== null : isCallable(it);
669};
670
671
672/***/ }),
673/* 18 */
674/***/ (function(module, __webpack_exports__, __webpack_require__) {
675
676"use strict";
677/* harmony export (immutable) */ __webpack_exports__["a"] = cb;
678/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(182);
680/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(183);
681
682
683
684
685// The function we call internally to generate a callback. It invokes
686// `_.iteratee` if overridden, otherwise `baseIteratee`.
687function cb(value, context, argCount) {
688 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);
689 return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, argCount);
690}
691
692
693/***/ }),
694/* 19 */
695/***/ (function(module, exports, __webpack_require__) {
696
697var fails = __webpack_require__(4);
698
699// Detect IE8's incomplete defineProperty implementation
700module.exports = !fails(function () {
701 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
702 return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
703});
704
705
706/***/ }),
707/* 20 */
708/***/ (function(module, exports, __webpack_require__) {
709
710var uncurryThis = __webpack_require__(6);
711
712module.exports = uncurryThis({}.isPrototypeOf);
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__(3);
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__(170);
806/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(27);
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
821"use strict";
822
823
824var _interopRequireDefault = __webpack_require__(2);
825
826var _concat = _interopRequireDefault(__webpack_require__(29));
827
828var _promise = _interopRequireDefault(__webpack_require__(10));
829
830var _ = __webpack_require__(1);
831
832var md5 = __webpack_require__(496);
833
834var _require = __webpack_require__(1),
835 extend = _require.extend;
836
837var AV = __webpack_require__(59);
838
839var AVError = __webpack_require__(40);
840
841var _require2 = __webpack_require__(28),
842 getSessionToken = _require2.getSessionToken;
843
844var ajax = __webpack_require__(103); // 计算 X-LC-Sign 的签名方法
845
846
847var sign = function sign(key, isMasterKey) {
848 var _context2;
849
850 var now = new Date().getTime();
851 var signature = md5(now + key);
852
853 if (isMasterKey) {
854 var _context;
855
856 return (0, _concat.default)(_context = "".concat(signature, ",")).call(_context, now, ",master");
857 }
858
859 return (0, _concat.default)(_context2 = "".concat(signature, ",")).call(_context2, now);
860};
861
862var setAppKey = function setAppKey(headers, signKey) {
863 if (signKey) {
864 headers['X-LC-Sign'] = sign(AV.applicationKey);
865 } else {
866 headers['X-LC-Key'] = AV.applicationKey;
867 }
868};
869
870var setHeaders = function setHeaders() {
871 var authOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
872 var signKey = arguments.length > 1 ? arguments[1] : undefined;
873 var headers = {
874 'X-LC-Id': AV.applicationId,
875 'Content-Type': 'application/json;charset=UTF-8'
876 };
877 var useMasterKey = false;
878
879 if (typeof authOptions.useMasterKey === 'boolean') {
880 useMasterKey = authOptions.useMasterKey;
881 } else if (typeof AV._config.useMasterKey === 'boolean') {
882 useMasterKey = AV._config.useMasterKey;
883 }
884
885 if (useMasterKey) {
886 if (AV.masterKey) {
887 if (signKey) {
888 headers['X-LC-Sign'] = sign(AV.masterKey, true);
889 } else {
890 headers['X-LC-Key'] = "".concat(AV.masterKey, ",master");
891 }
892 } else {
893 console.warn('masterKey is not set, fall back to use appKey');
894 setAppKey(headers, signKey);
895 }
896 } else {
897 setAppKey(headers, signKey);
898 }
899
900 if (AV.hookKey) {
901 headers['X-LC-Hook-Key'] = AV.hookKey;
902 }
903
904 if (AV._config.production !== null) {
905 headers['X-LC-Prod'] = String(AV._config.production);
906 }
907
908 headers[undefined === 'NODE_JS' ? 'User-Agent' : 'X-LC-UA'] = AV._sharedConfig.userAgent;
909 return _promise.default.resolve().then(function () {
910 // Pass the session token
911 var sessionToken = getSessionToken(authOptions);
912
913 if (sessionToken) {
914 headers['X-LC-Session'] = sessionToken;
915 } else if (!AV._config.disableCurrentUser) {
916 return AV.User.currentAsync().then(function (currentUser) {
917 if (currentUser && currentUser._sessionToken) {
918 headers['X-LC-Session'] = currentUser._sessionToken;
919 }
920
921 return headers;
922 });
923 }
924
925 return headers;
926 });
927};
928
929var createApiUrl = function createApiUrl(_ref) {
930 var _ref$service = _ref.service,
931 service = _ref$service === void 0 ? 'api' : _ref$service,
932 _ref$version = _ref.version,
933 version = _ref$version === void 0 ? '1.1' : _ref$version,
934 path = _ref.path;
935 var apiURL = AV._config.serverURLs[service];
936 if (!apiURL) throw new Error("undefined server URL for ".concat(service));
937
938 if (apiURL.charAt(apiURL.length - 1) !== '/') {
939 apiURL += '/';
940 }
941
942 apiURL += version;
943
944 if (path) {
945 apiURL += path;
946 }
947
948 return apiURL;
949};
950/**
951 * Low level REST API client. Call REST endpoints with authorization headers.
952 * @function AV.request
953 * @since 3.0.0
954 * @param {Object} options
955 * @param {String} options.method HTTP method
956 * @param {String} options.path endpoint path, e.g. `/classes/Test/55759577e4b029ae6015ac20`
957 * @param {Object} [options.query] query string dict
958 * @param {Object} [options.data] HTTP body
959 * @param {AuthOptions} [options.authOptions]
960 * @param {String} [options.service = 'api']
961 * @param {String} [options.version = '1.1']
962 */
963
964
965var request = function request(_ref2) {
966 var service = _ref2.service,
967 version = _ref2.version,
968 method = _ref2.method,
969 path = _ref2.path,
970 query = _ref2.query,
971 data = _ref2.data,
972 authOptions = _ref2.authOptions,
973 _ref2$signKey = _ref2.signKey,
974 signKey = _ref2$signKey === void 0 ? true : _ref2$signKey;
975
976 if (!(AV.applicationId && (AV.applicationKey || AV.masterKey))) {
977 throw new Error('Not initialized');
978 }
979
980 if (AV._appRouter) {
981 AV._appRouter.refresh();
982 }
983
984 var timeout = AV._config.requestTimeout;
985 var url = createApiUrl({
986 service: service,
987 path: path,
988 version: version
989 });
990 return setHeaders(authOptions, signKey).then(function (headers) {
991 return ajax({
992 method: method,
993 url: url,
994 query: query,
995 data: data,
996 headers: headers,
997 timeout: timeout
998 }).catch(function (error) {
999 var errorJSON = {
1000 code: error.code || -1,
1001 error: error.message || error.responseText
1002 };
1003
1004 if (error.response && error.response.code) {
1005 errorJSON = error.response;
1006 } else if (error.responseText) {
1007 try {
1008 errorJSON = JSON.parse(error.responseText);
1009 } catch (e) {// If we fail to parse the error text, that's okay.
1010 }
1011 }
1012
1013 errorJSON.rawMessage = errorJSON.rawMessage || errorJSON.error;
1014
1015 if (!AV._sharedConfig.keepErrorRawMessage) {
1016 var _context3, _context4;
1017
1018 errorJSON.error += (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = " [".concat(error.statusCode || 'N/A', " ")).call(_context4, method, " ")).call(_context3, url, "]");
1019 } // Transform the error into an instance of AVError by trying to parse
1020 // the error string as JSON.
1021
1022
1023 var err = new AVError(errorJSON.code, errorJSON.error);
1024 delete errorJSON.error;
1025 throw _.extend(err, errorJSON);
1026 });
1027 });
1028}; // lagecy request
1029
1030
1031var _request = function _request(route, className, objectId, method, data, authOptions, query) {
1032 var path = '';
1033 if (route) path += "/".concat(route);
1034 if (className) path += "/".concat(className);
1035 if (objectId) path += "/".concat(objectId); // for migeration
1036
1037 if (data && data._fetchWhenSave) throw new Error('_fetchWhenSave should be in the query');
1038 if (data && data._where) throw new Error('_where should be in the query');
1039
1040 if (method && method.toLowerCase() === 'get') {
1041 query = extend({}, query, data);
1042 data = null;
1043 }
1044
1045 return request({
1046 method: method,
1047 path: path,
1048 query: query,
1049 data: data,
1050 authOptions: authOptions
1051 });
1052};
1053
1054AV.request = request;
1055module.exports = {
1056 _request: _request,
1057 request: request
1058};
1059
1060/***/ }),
1061/* 26 */
1062/***/ (function(module, __webpack_exports__, __webpack_require__) {
1063
1064"use strict";
1065/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
1066/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
1067
1068
1069
1070var isFunction = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Function');
1071
1072// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
1073// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
1074var nodelist = __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document && __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document.childNodes;
1075if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
1076 isFunction = function(obj) {
1077 return typeof obj == 'function' || false;
1078 };
1079}
1080
1081/* harmony default export */ __webpack_exports__["a"] = (isFunction);
1082
1083
1084/***/ }),
1085/* 27 */
1086/***/ (function(module, __webpack_exports__, __webpack_require__) {
1087
1088"use strict";
1089/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(171);
1090
1091
1092// Internal helper to obtain the `length` property of an object.
1093/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('length'));
1094
1095
1096/***/ }),
1097/* 28 */
1098/***/ (function(module, exports, __webpack_require__) {
1099
1100"use strict";
1101
1102
1103var _interopRequireDefault = __webpack_require__(2);
1104
1105var _keys = _interopRequireDefault(__webpack_require__(48));
1106
1107var _getPrototypeOf = _interopRequireDefault(__webpack_require__(215));
1108
1109var _promise = _interopRequireDefault(__webpack_require__(10));
1110
1111var _ = __webpack_require__(1); // Helper function to check null or undefined.
1112
1113
1114var isNullOrUndefined = function isNullOrUndefined(x) {
1115 return _.isNull(x) || _.isUndefined(x);
1116};
1117
1118var ensureArray = function ensureArray(target) {
1119 if (_.isArray(target)) {
1120 return target;
1121 }
1122
1123 if (target === undefined || target === null) {
1124 return [];
1125 }
1126
1127 return [target];
1128};
1129
1130var transformFetchOptions = function transformFetchOptions() {
1131 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1132 keys = (0, _keys.default)(_ref),
1133 include = _ref.include,
1134 includeACL = _ref.includeACL;
1135
1136 var fetchOptions = {};
1137
1138 if (keys) {
1139 fetchOptions.keys = ensureArray(keys).join(',');
1140 }
1141
1142 if (include) {
1143 fetchOptions.include = ensureArray(include).join(',');
1144 }
1145
1146 if (includeACL) {
1147 fetchOptions.returnACL = includeACL;
1148 }
1149
1150 return fetchOptions;
1151};
1152
1153var getSessionToken = function getSessionToken(authOptions) {
1154 if (authOptions.sessionToken) {
1155 return authOptions.sessionToken;
1156 }
1157
1158 if (authOptions.user && typeof authOptions.user.getSessionToken === 'function') {
1159 return authOptions.user.getSessionToken();
1160 }
1161};
1162
1163var tap = function tap(interceptor) {
1164 return function (value) {
1165 return interceptor(value), value;
1166 };
1167}; // Shared empty constructor function to aid in prototype-chain creation.
1168
1169
1170var EmptyConstructor = function EmptyConstructor() {}; // Helper function to correctly set up the prototype chain, for subclasses.
1171// Similar to `goog.inherits`, but uses a hash of prototype properties and
1172// class properties to be extended.
1173
1174
1175var inherits = function inherits(parent, protoProps, staticProps) {
1176 var child; // The constructor function for the new subclass is either defined by you
1177 // (the "constructor" property in your `extend` definition), or defaulted
1178 // by us to simply call the parent's constructor.
1179
1180 if (protoProps && protoProps.hasOwnProperty('constructor')) {
1181 child = protoProps.constructor;
1182 } else {
1183 /** @ignore */
1184 child = function child() {
1185 parent.apply(this, arguments);
1186 };
1187 } // Inherit class (static) properties from parent.
1188
1189
1190 _.extend(child, parent); // Set the prototype chain to inherit from `parent`, without calling
1191 // `parent`'s constructor function.
1192
1193
1194 EmptyConstructor.prototype = parent.prototype;
1195 child.prototype = new EmptyConstructor(); // Add prototype properties (instance properties) to the subclass,
1196 // if supplied.
1197
1198 if (protoProps) {
1199 _.extend(child.prototype, protoProps);
1200 } // Add static properties to the constructor function, if supplied.
1201
1202
1203 if (staticProps) {
1204 _.extend(child, staticProps);
1205 } // Correctly set child's `prototype.constructor`.
1206
1207
1208 child.prototype.constructor = child; // Set a convenience property in case the parent's prototype is
1209 // needed later.
1210
1211 child.__super__ = parent.prototype;
1212 return child;
1213}; // Suppress the date string format warning in Weixin DevTools
1214// Link: https://developers.weixin.qq.com/community/minihome/doc/00080c6f244718053550067736b401
1215
1216
1217var parseDate = typeof wx === 'undefined' ? function (iso8601) {
1218 return new Date(iso8601);
1219} : function (iso8601) {
1220 return new Date(Date.parse(iso8601));
1221};
1222
1223var setValue = function setValue(target, key, value) {
1224 // '.' is not allowed in Class keys, escaping is not in concern now.
1225 var segs = key.split('.');
1226 var lastSeg = segs.pop();
1227 var currentTarget = target;
1228 segs.forEach(function (seg) {
1229 if (currentTarget[seg] === undefined) currentTarget[seg] = {};
1230 currentTarget = currentTarget[seg];
1231 });
1232 currentTarget[lastSeg] = value;
1233 return target;
1234};
1235
1236var findValue = function findValue(target, key) {
1237 var segs = key.split('.');
1238 var firstSeg = segs[0];
1239 var lastSeg = segs.pop();
1240 var currentTarget = target;
1241
1242 for (var i = 0; i < segs.length; i++) {
1243 currentTarget = currentTarget[segs[i]];
1244
1245 if (currentTarget === undefined) {
1246 return [undefined, undefined, lastSeg];
1247 }
1248 }
1249
1250 var value = currentTarget[lastSeg];
1251 return [value, currentTarget, lastSeg, firstSeg];
1252};
1253
1254var isPlainObject = function isPlainObject(obj) {
1255 return _.isObject(obj) && (0, _getPrototypeOf.default)(obj) === Object.prototype;
1256};
1257
1258var continueWhile = function continueWhile(predicate, asyncFunction) {
1259 if (predicate()) {
1260 return asyncFunction().then(function () {
1261 return continueWhile(predicate, asyncFunction);
1262 });
1263 }
1264
1265 return _promise.default.resolve();
1266};
1267
1268module.exports = {
1269 isNullOrUndefined: isNullOrUndefined,
1270 ensureArray: ensureArray,
1271 transformFetchOptions: transformFetchOptions,
1272 getSessionToken: getSessionToken,
1273 tap: tap,
1274 inherits: inherits,
1275 parseDate: parseDate,
1276 setValue: setValue,
1277 findValue: findValue,
1278 isPlainObject: isPlainObject,
1279 continueWhile: continueWhile
1280};
1281
1282/***/ }),
1283/* 29 */
1284/***/ (function(module, exports, __webpack_require__) {
1285
1286module.exports = __webpack_require__(351);
1287
1288/***/ }),
1289/* 30 */
1290/***/ (function(module, exports, __webpack_require__) {
1291
1292var isCallable = __webpack_require__(7);
1293var tryToString = __webpack_require__(66);
1294
1295var $TypeError = TypeError;
1296
1297// `Assert: IsCallable(argument) is true`
1298module.exports = function (argument) {
1299 if (isCallable(argument)) return argument;
1300 throw $TypeError(tryToString(argument) + ' is not a function');
1301};
1302
1303
1304/***/ }),
1305/* 31 */
1306/***/ (function(module, exports) {
1307
1308module.exports = true;
1309
1310
1311/***/ }),
1312/* 32 */
1313/***/ (function(module, exports, __webpack_require__) {
1314
1315var DESCRIPTORS = __webpack_require__(19);
1316var IE8_DOM_DEFINE = __webpack_require__(141);
1317var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(143);
1318var anObject = __webpack_require__(21);
1319var toPropertyKey = __webpack_require__(82);
1320
1321var $TypeError = TypeError;
1322// eslint-disable-next-line es-x/no-object-defineproperty -- safe
1323var $defineProperty = Object.defineProperty;
1324// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
1325var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1326var ENUMERABLE = 'enumerable';
1327var CONFIGURABLE = 'configurable';
1328var WRITABLE = 'writable';
1329
1330// `Object.defineProperty` method
1331// https://tc39.es/ecma262/#sec-object.defineproperty
1332exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
1333 anObject(O);
1334 P = toPropertyKey(P);
1335 anObject(Attributes);
1336 if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
1337 var current = $getOwnPropertyDescriptor(O, P);
1338 if (current && current[WRITABLE]) {
1339 O[P] = Attributes.value;
1340 Attributes = {
1341 configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
1342 enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
1343 writable: false
1344 };
1345 }
1346 } return $defineProperty(O, P, Attributes);
1347} : $defineProperty : function defineProperty(O, P, Attributes) {
1348 anObject(O);
1349 P = toPropertyKey(P);
1350 anObject(Attributes);
1351 if (IE8_DOM_DEFINE) try {
1352 return $defineProperty(O, P, Attributes);
1353 } catch (error) { /* empty */ }
1354 if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
1355 if ('value' in Attributes) O[P] = Attributes.value;
1356 return O;
1357};
1358
1359
1360/***/ }),
1361/* 33 */
1362/***/ (function(module, exports, __webpack_require__) {
1363
1364// toObject with fallback for non-array-like ES3 strings
1365var IndexedObject = __webpack_require__(139);
1366var requireObjectCoercible = __webpack_require__(106);
1367
1368module.exports = function (it) {
1369 return IndexedObject(requireObjectCoercible(it));
1370};
1371
1372
1373/***/ }),
1374/* 34 */
1375/***/ (function(module, exports, __webpack_require__) {
1376
1377module.exports = __webpack_require__(363);
1378
1379/***/ }),
1380/* 35 */
1381/***/ (function(module, exports, __webpack_require__) {
1382
1383var requireObjectCoercible = __webpack_require__(106);
1384
1385var $Object = Object;
1386
1387// `ToObject` abstract operation
1388// https://tc39.es/ecma262/#sec-toobject
1389module.exports = function (argument) {
1390 return $Object(requireObjectCoercible(argument));
1391};
1392
1393
1394/***/ }),
1395/* 36 */
1396/***/ (function(module, exports, __webpack_require__) {
1397
1398var DESCRIPTORS = __webpack_require__(19);
1399var definePropertyModule = __webpack_require__(32);
1400var createPropertyDescriptor = __webpack_require__(41);
1401
1402module.exports = DESCRIPTORS ? function (object, key, value) {
1403 return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
1404} : function (object, key, value) {
1405 object[key] = value;
1406 return object;
1407};
1408
1409
1410/***/ }),
1411/* 37 */
1412/***/ (function(module, __webpack_exports__, __webpack_require__) {
1413
1414"use strict";
1415/* harmony export (immutable) */ __webpack_exports__["a"] = has;
1416/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
1417
1418
1419// Internal function to check whether `key` is an own property name of `obj`.
1420function has(obj, key) {
1421 return obj != null && __WEBPACK_IMPORTED_MODULE_0__setup_js__["i" /* hasOwnProperty */].call(obj, key);
1422}
1423
1424
1425/***/ }),
1426/* 38 */
1427/***/ (function(module, exports, __webpack_require__) {
1428
1429var path = __webpack_require__(13);
1430
1431module.exports = function (CONSTRUCTOR) {
1432 return path[CONSTRUCTOR + 'Prototype'];
1433};
1434
1435
1436/***/ }),
1437/* 39 */
1438/***/ (function(module, exports, __webpack_require__) {
1439
1440module.exports = __webpack_require__(356);
1441
1442/***/ }),
1443/* 40 */
1444/***/ (function(module, exports, __webpack_require__) {
1445
1446"use strict";
1447
1448
1449var _interopRequireDefault = __webpack_require__(2);
1450
1451var _setPrototypeOf = _interopRequireDefault(__webpack_require__(379));
1452
1453var _getPrototypeOf = _interopRequireDefault(__webpack_require__(215));
1454
1455var _ = __webpack_require__(1);
1456/**
1457 * @class AV.Error
1458 */
1459
1460
1461function AVError(code, message) {
1462 if (this instanceof AVError ? this.constructor : void 0) {
1463 var error = new Error(message);
1464 (0, _setPrototypeOf.default)(error, (0, _getPrototypeOf.default)(this));
1465 error.code = code;
1466 return error;
1467 }
1468
1469 return new AVError(code, message);
1470}
1471
1472AVError.prototype = Object.create(Error.prototype, {
1473 constructor: {
1474 value: Error,
1475 enumerable: false,
1476 writable: true,
1477 configurable: true
1478 }
1479});
1480(0, _setPrototypeOf.default)(AVError, Error);
1481
1482_.extend(AVError,
1483/** @lends AV.Error */
1484{
1485 /**
1486 * Error code indicating some error other than those enumerated here.
1487 * @constant
1488 */
1489 OTHER_CAUSE: -1,
1490
1491 /**
1492 * Error code indicating that something has gone wrong with the server.
1493 * If you get this error code, it is AV's fault.
1494 * @constant
1495 */
1496 INTERNAL_SERVER_ERROR: 1,
1497
1498 /**
1499 * Error code indicating the connection to the AV servers failed.
1500 * @constant
1501 */
1502 CONNECTION_FAILED: 100,
1503
1504 /**
1505 * Error code indicating the specified object doesn't exist.
1506 * @constant
1507 */
1508 OBJECT_NOT_FOUND: 101,
1509
1510 /**
1511 * Error code indicating you tried to query with a datatype that doesn't
1512 * support it, like exact matching an array or object.
1513 * @constant
1514 */
1515 INVALID_QUERY: 102,
1516
1517 /**
1518 * Error code indicating a missing or invalid classname. Classnames are
1519 * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
1520 * only valid characters.
1521 * @constant
1522 */
1523 INVALID_CLASS_NAME: 103,
1524
1525 /**
1526 * Error code indicating an unspecified object id.
1527 * @constant
1528 */
1529 MISSING_OBJECT_ID: 104,
1530
1531 /**
1532 * Error code indicating an invalid key name. Keys are case-sensitive. They
1533 * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
1534 * @constant
1535 */
1536 INVALID_KEY_NAME: 105,
1537
1538 /**
1539 * Error code indicating a malformed pointer. You should not see this unless
1540 * you have been mucking about changing internal AV code.
1541 * @constant
1542 */
1543 INVALID_POINTER: 106,
1544
1545 /**
1546 * Error code indicating that badly formed JSON was received upstream. This
1547 * either indicates you have done something unusual with modifying how
1548 * things encode to JSON, or the network is failing badly.
1549 * @constant
1550 */
1551 INVALID_JSON: 107,
1552
1553 /**
1554 * Error code indicating that the feature you tried to access is only
1555 * available internally for testing purposes.
1556 * @constant
1557 */
1558 COMMAND_UNAVAILABLE: 108,
1559
1560 /**
1561 * You must call AV.initialize before using the AV library.
1562 * @constant
1563 */
1564 NOT_INITIALIZED: 109,
1565
1566 /**
1567 * Error code indicating that a field was set to an inconsistent type.
1568 * @constant
1569 */
1570 INCORRECT_TYPE: 111,
1571
1572 /**
1573 * Error code indicating an invalid channel name. A channel name is either
1574 * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
1575 * characters.
1576 * @constant
1577 */
1578 INVALID_CHANNEL_NAME: 112,
1579
1580 /**
1581 * Error code indicating that push is misconfigured.
1582 * @constant
1583 */
1584 PUSH_MISCONFIGURED: 115,
1585
1586 /**
1587 * Error code indicating that the object is too large.
1588 * @constant
1589 */
1590 OBJECT_TOO_LARGE: 116,
1591
1592 /**
1593 * Error code indicating that the operation isn't allowed for clients.
1594 * @constant
1595 */
1596 OPERATION_FORBIDDEN: 119,
1597
1598 /**
1599 * Error code indicating the result was not found in the cache.
1600 * @constant
1601 */
1602 CACHE_MISS: 120,
1603
1604 /**
1605 * Error code indicating that an invalid key was used in a nested
1606 * JSONObject.
1607 * @constant
1608 */
1609 INVALID_NESTED_KEY: 121,
1610
1611 /**
1612 * Error code indicating that an invalid filename was used for AVFile.
1613 * A valid file name contains only a-zA-Z0-9_. characters and is between 1
1614 * and 128 characters.
1615 * @constant
1616 */
1617 INVALID_FILE_NAME: 122,
1618
1619 /**
1620 * Error code indicating an invalid ACL was provided.
1621 * @constant
1622 */
1623 INVALID_ACL: 123,
1624
1625 /**
1626 * Error code indicating that the request timed out on the server. Typically
1627 * this indicates that the request is too expensive to run.
1628 * @constant
1629 */
1630 TIMEOUT: 124,
1631
1632 /**
1633 * Error code indicating that the email address was invalid.
1634 * @constant
1635 */
1636 INVALID_EMAIL_ADDRESS: 125,
1637
1638 /**
1639 * Error code indicating a missing content type.
1640 * @constant
1641 */
1642 MISSING_CONTENT_TYPE: 126,
1643
1644 /**
1645 * Error code indicating a missing content length.
1646 * @constant
1647 */
1648 MISSING_CONTENT_LENGTH: 127,
1649
1650 /**
1651 * Error code indicating an invalid content length.
1652 * @constant
1653 */
1654 INVALID_CONTENT_LENGTH: 128,
1655
1656 /**
1657 * Error code indicating a file that was too large.
1658 * @constant
1659 */
1660 FILE_TOO_LARGE: 129,
1661
1662 /**
1663 * Error code indicating an error saving a file.
1664 * @constant
1665 */
1666 FILE_SAVE_ERROR: 130,
1667
1668 /**
1669 * Error code indicating an error deleting a file.
1670 * @constant
1671 */
1672 FILE_DELETE_ERROR: 153,
1673
1674 /**
1675 * Error code indicating that a unique field was given a value that is
1676 * already taken.
1677 * @constant
1678 */
1679 DUPLICATE_VALUE: 137,
1680
1681 /**
1682 * Error code indicating that a role's name is invalid.
1683 * @constant
1684 */
1685 INVALID_ROLE_NAME: 139,
1686
1687 /**
1688 * Error code indicating that an application quota was exceeded. Upgrade to
1689 * resolve.
1690 * @constant
1691 */
1692 EXCEEDED_QUOTA: 140,
1693
1694 /**
1695 * Error code indicating that a Cloud Code script failed.
1696 * @constant
1697 */
1698 SCRIPT_FAILED: 141,
1699
1700 /**
1701 * Error code indicating that a Cloud Code validation failed.
1702 * @constant
1703 */
1704 VALIDATION_ERROR: 142,
1705
1706 /**
1707 * Error code indicating that invalid image data was provided.
1708 * @constant
1709 */
1710 INVALID_IMAGE_DATA: 150,
1711
1712 /**
1713 * Error code indicating an unsaved file.
1714 * @constant
1715 */
1716 UNSAVED_FILE_ERROR: 151,
1717
1718 /**
1719 * Error code indicating an invalid push time.
1720 * @constant
1721 */
1722 INVALID_PUSH_TIME_ERROR: 152,
1723
1724 /**
1725 * Error code indicating that the username is missing or empty.
1726 * @constant
1727 */
1728 USERNAME_MISSING: 200,
1729
1730 /**
1731 * Error code indicating that the password is missing or empty.
1732 * @constant
1733 */
1734 PASSWORD_MISSING: 201,
1735
1736 /**
1737 * Error code indicating that the username has already been taken.
1738 * @constant
1739 */
1740 USERNAME_TAKEN: 202,
1741
1742 /**
1743 * Error code indicating that the email has already been taken.
1744 * @constant
1745 */
1746 EMAIL_TAKEN: 203,
1747
1748 /**
1749 * Error code indicating that the email is missing, but must be specified.
1750 * @constant
1751 */
1752 EMAIL_MISSING: 204,
1753
1754 /**
1755 * Error code indicating that a user with the specified email was not found.
1756 * @constant
1757 */
1758 EMAIL_NOT_FOUND: 205,
1759
1760 /**
1761 * Error code indicating that a user object without a valid session could
1762 * not be altered.
1763 * @constant
1764 */
1765 SESSION_MISSING: 206,
1766
1767 /**
1768 * Error code indicating that a user can only be created through signup.
1769 * @constant
1770 */
1771 MUST_CREATE_USER_THROUGH_SIGNUP: 207,
1772
1773 /**
1774 * Error code indicating that an an account being linked is already linked
1775 * to another user.
1776 * @constant
1777 */
1778 ACCOUNT_ALREADY_LINKED: 208,
1779
1780 /**
1781 * Error code indicating that a user cannot be linked to an account because
1782 * that account's id could not be found.
1783 * @constant
1784 */
1785 LINKED_ID_MISSING: 250,
1786
1787 /**
1788 * Error code indicating that a user with a linked (e.g. Facebook) account
1789 * has an invalid session.
1790 * @constant
1791 */
1792 INVALID_LINKED_SESSION: 251,
1793
1794 /**
1795 * Error code indicating that a service being linked (e.g. Facebook or
1796 * Twitter) is unsupported.
1797 * @constant
1798 */
1799 UNSUPPORTED_SERVICE: 252,
1800
1801 /**
1802 * Error code indicating a real error code is unavailable because
1803 * we had to use an XDomainRequest object to allow CORS requests in
1804 * Internet Explorer, which strips the body from HTTP responses that have
1805 * a non-2XX status code.
1806 * @constant
1807 */
1808 X_DOMAIN_REQUEST: 602
1809});
1810
1811module.exports = AVError;
1812
1813/***/ }),
1814/* 41 */
1815/***/ (function(module, exports) {
1816
1817module.exports = function (bitmap, value) {
1818 return {
1819 enumerable: !(bitmap & 1),
1820 configurable: !(bitmap & 2),
1821 writable: !(bitmap & 4),
1822 value: value
1823 };
1824};
1825
1826
1827/***/ }),
1828/* 42 */
1829/***/ (function(module, exports, __webpack_require__) {
1830
1831var toLength = __webpack_require__(249);
1832
1833// `LengthOfArrayLike` abstract operation
1834// https://tc39.es/ecma262/#sec-lengthofarraylike
1835module.exports = function (obj) {
1836 return toLength(obj.length);
1837};
1838
1839
1840/***/ }),
1841/* 43 */
1842/***/ (function(module, exports, __webpack_require__) {
1843
1844var createNonEnumerableProperty = __webpack_require__(36);
1845
1846module.exports = function (target, key, value, options) {
1847 if (options && options.enumerable) target[key] = value;
1848 else createNonEnumerableProperty(target, key, value);
1849 return target;
1850};
1851
1852
1853/***/ }),
1854/* 44 */
1855/***/ (function(module, exports, __webpack_require__) {
1856
1857"use strict";
1858
1859var aCallable = __webpack_require__(30);
1860
1861var PromiseCapability = function (C) {
1862 var resolve, reject;
1863 this.promise = new C(function ($$resolve, $$reject) {
1864 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
1865 resolve = $$resolve;
1866 reject = $$reject;
1867 });
1868 this.resolve = aCallable(resolve);
1869 this.reject = aCallable(reject);
1870};
1871
1872// `NewPromiseCapability` abstract operation
1873// https://tc39.es/ecma262/#sec-newpromisecapability
1874module.exports.f = function (C) {
1875 return new PromiseCapability(C);
1876};
1877
1878
1879/***/ }),
1880/* 45 */
1881/***/ (function(module, __webpack_exports__, __webpack_require__) {
1882
1883"use strict";
1884/* harmony export (immutable) */ __webpack_exports__["a"] = isObject;
1885// Is a given variable an object?
1886function isObject(obj) {
1887 var type = typeof obj;
1888 return type === 'function' || type === 'object' && !!obj;
1889}
1890
1891
1892/***/ }),
1893/* 46 */
1894/***/ (function(module, __webpack_exports__, __webpack_require__) {
1895
1896"use strict";
1897/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
1898/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(15);
1899
1900
1901
1902// Is a given value an array?
1903// Delegates to ECMA5's native `Array.isArray`.
1904/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["k" /* nativeIsArray */] || Object(__WEBPACK_IMPORTED_MODULE_1__tagTester_js__["a" /* default */])('Array'));
1905
1906
1907/***/ }),
1908/* 47 */
1909/***/ (function(module, __webpack_exports__, __webpack_require__) {
1910
1911"use strict";
1912/* harmony export (immutable) */ __webpack_exports__["a"] = each;
1913/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(77);
1914/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
1915/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(12);
1916
1917
1918
1919
1920// The cornerstone for collection functions, an `each`
1921// implementation, aka `forEach`.
1922// Handles raw objects in addition to array-likes. Treats all
1923// sparse array-likes as if they were dense.
1924function each(obj, iteratee, context) {
1925 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context);
1926 var i, length;
1927 if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj)) {
1928 for (i = 0, length = obj.length; i < length; i++) {
1929 iteratee(obj[i], i, obj);
1930 }
1931 } else {
1932 var _keys = Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj);
1933 for (i = 0, length = _keys.length; i < length; i++) {
1934 iteratee(obj[_keys[i]], _keys[i], obj);
1935 }
1936 }
1937 return obj;
1938}
1939
1940
1941/***/ }),
1942/* 48 */
1943/***/ (function(module, exports, __webpack_require__) {
1944
1945module.exports = __webpack_require__(370);
1946
1947/***/ }),
1948/* 49 */
1949/***/ (function(module, exports, __webpack_require__) {
1950
1951/* eslint-disable es-x/no-symbol -- required for testing */
1952var V8_VERSION = __webpack_require__(84);
1953var fails = __webpack_require__(4);
1954
1955// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
1956module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
1957 var symbol = Symbol();
1958 // Chrome 38 Symbol has incorrect toString conversion
1959 // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
1960 return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
1961 // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
1962 !Symbol.sham && V8_VERSION && V8_VERSION < 41;
1963});
1964
1965
1966/***/ }),
1967/* 50 */
1968/***/ (function(module, exports, __webpack_require__) {
1969
1970var uncurryThis = __webpack_require__(6);
1971var aCallable = __webpack_require__(30);
1972var NATIVE_BIND = __webpack_require__(63);
1973
1974var bind = uncurryThis(uncurryThis.bind);
1975
1976// optional / simple context binding
1977module.exports = function (fn, that) {
1978 aCallable(fn);
1979 return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
1980 return fn.apply(that, arguments);
1981 };
1982};
1983
1984
1985/***/ }),
1986/* 51 */
1987/***/ (function(module, exports, __webpack_require__) {
1988
1989/* global ActiveXObject -- old IE, WSH */
1990var anObject = __webpack_require__(21);
1991var definePropertiesModule = __webpack_require__(147);
1992var enumBugKeys = __webpack_require__(114);
1993var hiddenKeys = __webpack_require__(89);
1994var html = __webpack_require__(148);
1995var documentCreateElement = __webpack_require__(110);
1996var sharedKey = __webpack_require__(87);
1997
1998var GT = '>';
1999var LT = '<';
2000var PROTOTYPE = 'prototype';
2001var SCRIPT = 'script';
2002var IE_PROTO = sharedKey('IE_PROTO');
2003
2004var EmptyConstructor = function () { /* empty */ };
2005
2006var scriptTag = function (content) {
2007 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
2008};
2009
2010// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
2011var NullProtoObjectViaActiveX = function (activeXDocument) {
2012 activeXDocument.write(scriptTag(''));
2013 activeXDocument.close();
2014 var temp = activeXDocument.parentWindow.Object;
2015 activeXDocument = null; // avoid memory leak
2016 return temp;
2017};
2018
2019// Create object with fake `null` prototype: use iframe Object with cleared prototype
2020var NullProtoObjectViaIFrame = function () {
2021 // Thrash, waste and sodomy: IE GC bug
2022 var iframe = documentCreateElement('iframe');
2023 var JS = 'java' + SCRIPT + ':';
2024 var iframeDocument;
2025 iframe.style.display = 'none';
2026 html.appendChild(iframe);
2027 // https://github.com/zloirock/core-js/issues/475
2028 iframe.src = String(JS);
2029 iframeDocument = iframe.contentWindow.document;
2030 iframeDocument.open();
2031 iframeDocument.write(scriptTag('document.F=Object'));
2032 iframeDocument.close();
2033 return iframeDocument.F;
2034};
2035
2036// Check for document.domain and active x support
2037// No need to use active x approach when document.domain is not set
2038// see https://github.com/es-shims/es5-shim/issues/150
2039// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
2040// avoid IE GC bug
2041var activeXDocument;
2042var NullProtoObject = function () {
2043 try {
2044 activeXDocument = new ActiveXObject('htmlfile');
2045 } catch (error) { /* ignore */ }
2046 NullProtoObject = typeof document != 'undefined'
2047 ? document.domain && activeXDocument
2048 ? NullProtoObjectViaActiveX(activeXDocument) // old IE
2049 : NullProtoObjectViaIFrame()
2050 : NullProtoObjectViaActiveX(activeXDocument); // WSH
2051 var length = enumBugKeys.length;
2052 while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
2053 return NullProtoObject();
2054};
2055
2056hiddenKeys[IE_PROTO] = true;
2057
2058// `Object.create` method
2059// https://tc39.es/ecma262/#sec-object.create
2060// eslint-disable-next-line es-x/no-object-create -- safe
2061module.exports = Object.create || function create(O, Properties) {
2062 var result;
2063 if (O !== null) {
2064 EmptyConstructor[PROTOTYPE] = anObject(O);
2065 result = new EmptyConstructor();
2066 EmptyConstructor[PROTOTYPE] = null;
2067 // add "__proto__" for Object.getPrototypeOf polyfill
2068 result[IE_PROTO] = O;
2069 } else result = NullProtoObject();
2070 return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
2071};
2072
2073
2074/***/ }),
2075/* 52 */
2076/***/ (function(module, exports) {
2077
2078module.exports = {};
2079
2080
2081/***/ }),
2082/* 53 */
2083/***/ (function(module, exports, __webpack_require__) {
2084
2085var TO_STRING_TAG_SUPPORT = __webpack_require__(117);
2086var isCallable = __webpack_require__(7);
2087var classofRaw = __webpack_require__(65);
2088var wellKnownSymbol = __webpack_require__(8);
2089
2090var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2091var $Object = Object;
2092
2093// ES3 wrong here
2094var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2095
2096// fallback for IE11 Script Access Denied error
2097var tryGet = function (it, key) {
2098 try {
2099 return it[key];
2100 } catch (error) { /* empty */ }
2101};
2102
2103// getting tag from ES6+ `Object.prototype.toString`
2104module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2105 var O, tag, result;
2106 return it === undefined ? 'Undefined' : it === null ? 'Null'
2107 // @@toStringTag case
2108 : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
2109 // builtinTag case
2110 : CORRECT_ARGUMENTS ? classofRaw(O)
2111 // ES3 arguments fallback
2112 : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
2113};
2114
2115
2116/***/ }),
2117/* 54 */
2118/***/ (function(module, exports, __webpack_require__) {
2119
2120var TO_STRING_TAG_SUPPORT = __webpack_require__(117);
2121var defineProperty = __webpack_require__(32).f;
2122var createNonEnumerableProperty = __webpack_require__(36);
2123var hasOwn = __webpack_require__(14);
2124var toString = __webpack_require__(257);
2125var wellKnownSymbol = __webpack_require__(8);
2126
2127var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2128
2129module.exports = function (it, TAG, STATIC, SET_METHOD) {
2130 if (it) {
2131 var target = STATIC ? it : it.prototype;
2132 if (!hasOwn(target, TO_STRING_TAG)) {
2133 defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
2134 }
2135 if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
2136 createNonEnumerableProperty(target, 'toString', toString);
2137 }
2138 }
2139};
2140
2141
2142/***/ }),
2143/* 55 */
2144/***/ (function(module, exports, __webpack_require__) {
2145
2146var global = __webpack_require__(9);
2147
2148module.exports = global.Promise;
2149
2150
2151/***/ }),
2152/* 56 */
2153/***/ (function(module, __webpack_exports__, __webpack_require__) {
2154
2155"use strict";
2156/* harmony export (immutable) */ __webpack_exports__["a"] = values;
2157/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(12);
2158
2159
2160// Retrieve the values of an object's properties.
2161function values(obj) {
2162 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
2163 var length = _keys.length;
2164 var values = Array(length);
2165 for (var i = 0; i < length; i++) {
2166 values[i] = obj[_keys[i]];
2167 }
2168 return values;
2169}
2170
2171
2172/***/ }),
2173/* 57 */
2174/***/ (function(module, __webpack_exports__, __webpack_require__) {
2175
2176"use strict";
2177/* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
2178/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
2179/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
2180/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(46);
2181/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(123);
2182
2183
2184
2185
2186
2187// Internal implementation of a recursive `flatten` function.
2188function flatten(input, depth, strict, output) {
2189 output = output || [];
2190 if (!depth && depth !== 0) {
2191 depth = Infinity;
2192 } else if (depth <= 0) {
2193 return output.concat(input);
2194 }
2195 var idx = output.length;
2196 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(input); i < length; i++) {
2197 var value = input[i];
2198 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))) {
2199 // Flatten current level of array or arguments object.
2200 if (depth > 1) {
2201 flatten(value, depth - 1, strict, output);
2202 idx = output.length;
2203 } else {
2204 var j = 0, len = value.length;
2205 while (j < len) output[idx++] = value[j++];
2206 }
2207 } else if (!strict) {
2208 output[idx++] = value;
2209 }
2210 }
2211 return output;
2212}
2213
2214
2215/***/ }),
2216/* 58 */
2217/***/ (function(module, __webpack_exports__, __webpack_require__) {
2218
2219"use strict";
2220/* harmony export (immutable) */ __webpack_exports__["a"] = map;
2221/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
2222/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
2223/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(12);
2224
2225
2226
2227
2228// Return the results of applying the iteratee to each element.
2229function map(obj, iteratee, context) {
2230 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
2231 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
2232 length = (_keys || obj).length,
2233 results = Array(length);
2234 for (var index = 0; index < length; index++) {
2235 var currentKey = _keys ? _keys[index] : index;
2236 results[index] = iteratee(obj[currentKey], currentKey, obj);
2237 }
2238 return results;
2239}
2240
2241
2242/***/ }),
2243/* 59 */
2244/***/ (function(module, exports, __webpack_require__) {
2245
2246"use strict";
2247/* WEBPACK VAR INJECTION */(function(global) {
2248
2249var _interopRequireDefault = __webpack_require__(2);
2250
2251var _promise = _interopRequireDefault(__webpack_require__(10));
2252
2253var _concat = _interopRequireDefault(__webpack_require__(29));
2254
2255var _map = _interopRequireDefault(__webpack_require__(39));
2256
2257var _keys = _interopRequireDefault(__webpack_require__(212));
2258
2259var _stringify = _interopRequireDefault(__webpack_require__(34));
2260
2261var _indexOf = _interopRequireDefault(__webpack_require__(102));
2262
2263var _keys2 = _interopRequireDefault(__webpack_require__(48));
2264
2265var _ = __webpack_require__(1);
2266
2267var uuid = __webpack_require__(214);
2268
2269var debug = __webpack_require__(60);
2270
2271var _require = __webpack_require__(28),
2272 inherits = _require.inherits,
2273 parseDate = _require.parseDate;
2274
2275var version = __webpack_require__(217);
2276
2277var _require2 = __webpack_require__(61),
2278 setAdapters = _require2.setAdapters,
2279 adapterManager = _require2.adapterManager;
2280
2281var AV = global.AV || {}; // All internal configuration items
2282
2283AV._config = {
2284 serverURLs: {},
2285 useMasterKey: false,
2286 production: null,
2287 realtime: null,
2288 requestTimeout: null
2289};
2290var initialUserAgent = "LeanCloud-JS-SDK/".concat(version); // configs shared by all AV instances
2291
2292AV._sharedConfig = {
2293 userAgent: initialUserAgent,
2294 liveQueryRealtime: null
2295};
2296adapterManager.on('platformInfo', function (platformInfo) {
2297 var ua = initialUserAgent;
2298
2299 if (platformInfo) {
2300 if (platformInfo.userAgent) {
2301 ua = platformInfo.userAgent;
2302 } else {
2303 var comments = platformInfo.name;
2304
2305 if (platformInfo.version) {
2306 comments += "/".concat(platformInfo.version);
2307 }
2308
2309 if (platformInfo.extra) {
2310 comments += "; ".concat(platformInfo.extra);
2311 }
2312
2313 ua += " (".concat(comments, ")");
2314 }
2315 }
2316
2317 AV._sharedConfig.userAgent = ua;
2318});
2319/**
2320 * Contains all AV API classes and functions.
2321 * @namespace AV
2322 */
2323
2324/**
2325 * Returns prefix for localStorage keys used by this instance of AV.
2326 * @param {String} path The relative suffix to append to it.
2327 * null or undefined is treated as the empty string.
2328 * @return {String} The full key name.
2329 * @private
2330 */
2331
2332AV._getAVPath = function (path) {
2333 if (!AV.applicationId) {
2334 throw new Error('You need to call AV.initialize before using AV.');
2335 }
2336
2337 if (!path) {
2338 path = '';
2339 }
2340
2341 if (!_.isString(path)) {
2342 throw new Error("Tried to get a localStorage path that wasn't a String.");
2343 }
2344
2345 if (path[0] === '/') {
2346 path = path.substring(1);
2347 }
2348
2349 return 'AV/' + AV.applicationId + '/' + path;
2350};
2351/**
2352 * Returns the unique string for this app on this machine.
2353 * Gets reset when localStorage is cleared.
2354 * @private
2355 */
2356
2357
2358AV._installationId = null;
2359
2360AV._getInstallationId = function () {
2361 // See if it's cached in RAM.
2362 if (AV._installationId) {
2363 return _promise.default.resolve(AV._installationId);
2364 } // Try to get it from localStorage.
2365
2366
2367 var path = AV._getAVPath('installationId');
2368
2369 return AV.localStorage.getItemAsync(path).then(function (_installationId) {
2370 AV._installationId = _installationId;
2371
2372 if (!AV._installationId) {
2373 // It wasn't in localStorage, so create a new one.
2374 AV._installationId = _installationId = uuid();
2375 return AV.localStorage.setItemAsync(path, _installationId).then(function () {
2376 return _installationId;
2377 });
2378 }
2379
2380 return _installationId;
2381 });
2382};
2383
2384AV._subscriptionId = null;
2385
2386AV._refreshSubscriptionId = function () {
2387 var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AV._getAVPath('subscriptionId');
2388 var subscriptionId = AV._subscriptionId = uuid();
2389 return AV.localStorage.setItemAsync(path, subscriptionId).then(function () {
2390 return subscriptionId;
2391 });
2392};
2393
2394AV._getSubscriptionId = function () {
2395 // See if it's cached in RAM.
2396 if (AV._subscriptionId) {
2397 return _promise.default.resolve(AV._subscriptionId);
2398 } // Try to get it from localStorage.
2399
2400
2401 var path = AV._getAVPath('subscriptionId');
2402
2403 return AV.localStorage.getItemAsync(path).then(function (_subscriptionId) {
2404 AV._subscriptionId = _subscriptionId;
2405
2406 if (!AV._subscriptionId) {
2407 // It wasn't in localStorage, so create a new one.
2408 _subscriptionId = AV._refreshSubscriptionId(path);
2409 }
2410
2411 return _subscriptionId;
2412 });
2413};
2414
2415AV._parseDate = parseDate; // A self-propagating extend function.
2416
2417AV._extend = function (protoProps, classProps) {
2418 var child = inherits(this, protoProps, classProps);
2419 child.extend = this.extend;
2420 return child;
2421};
2422/**
2423 * Converts a value in a AV Object into the appropriate representation.
2424 * This is the JS equivalent of Java's AV.maybeReferenceAndEncode(Object)
2425 * if seenObjects is falsey. Otherwise any AV.Objects not in
2426 * seenObjects will be fully embedded rather than encoded
2427 * as a pointer. This array will be used to prevent going into an infinite
2428 * loop because we have circular references. If <seenObjects>
2429 * is set, then none of the AV Objects that are serialized can be dirty.
2430 * @private
2431 */
2432
2433
2434AV._encode = function (value, seenObjects, disallowObjects) {
2435 var full = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
2436
2437 if (value instanceof AV.Object) {
2438 if (disallowObjects) {
2439 throw new Error('AV.Objects not allowed here');
2440 }
2441
2442 if (!seenObjects || _.include(seenObjects, value) || !value._hasData) {
2443 return value._toPointer();
2444 }
2445
2446 return value._toFullJSON((0, _concat.default)(seenObjects).call(seenObjects, value), full);
2447 }
2448
2449 if (value instanceof AV.ACL) {
2450 return value.toJSON();
2451 }
2452
2453 if (_.isDate(value)) {
2454 return full ? {
2455 __type: 'Date',
2456 iso: value.toJSON()
2457 } : value.toJSON();
2458 }
2459
2460 if (value instanceof AV.GeoPoint) {
2461 return value.toJSON();
2462 }
2463
2464 if (_.isArray(value)) {
2465 return (0, _map.default)(_).call(_, value, function (x) {
2466 return AV._encode(x, seenObjects, disallowObjects, full);
2467 });
2468 }
2469
2470 if (_.isRegExp(value)) {
2471 return value.source;
2472 }
2473
2474 if (value instanceof AV.Relation) {
2475 return value.toJSON();
2476 }
2477
2478 if (value instanceof AV.Op) {
2479 return value.toJSON();
2480 }
2481
2482 if (value instanceof AV.File) {
2483 if (!value.url() && !value.id) {
2484 throw new Error('Tried to save an object containing an unsaved file.');
2485 }
2486
2487 return value._toFullJSON(seenObjects, full);
2488 }
2489
2490 if (_.isObject(value)) {
2491 return _.mapObject(value, function (v, k) {
2492 return AV._encode(v, seenObjects, disallowObjects, full);
2493 });
2494 }
2495
2496 return value;
2497};
2498/**
2499 * The inverse function of AV._encode.
2500 * @private
2501 */
2502
2503
2504AV._decode = function (value, key) {
2505 if (!_.isObject(value) || _.isDate(value)) {
2506 return value;
2507 }
2508
2509 if (_.isArray(value)) {
2510 return (0, _map.default)(_).call(_, value, function (v) {
2511 return AV._decode(v);
2512 });
2513 }
2514
2515 if (value instanceof AV.Object) {
2516 return value;
2517 }
2518
2519 if (value instanceof AV.File) {
2520 return value;
2521 }
2522
2523 if (value instanceof AV.Op) {
2524 return value;
2525 }
2526
2527 if (value instanceof AV.GeoPoint) {
2528 return value;
2529 }
2530
2531 if (value instanceof AV.ACL) {
2532 return value;
2533 }
2534
2535 if (key === 'ACL') {
2536 return new AV.ACL(value);
2537 }
2538
2539 if (value.__op) {
2540 return AV.Op._decode(value);
2541 }
2542
2543 var className;
2544
2545 if (value.__type === 'Pointer') {
2546 className = value.className;
2547
2548 var pointer = AV.Object._create(className);
2549
2550 if ((0, _keys.default)(value).length > 3) {
2551 var v = _.clone(value);
2552
2553 delete v.__type;
2554 delete v.className;
2555
2556 pointer._finishFetch(v, true);
2557 } else {
2558 pointer._finishFetch({
2559 objectId: value.objectId
2560 }, false);
2561 }
2562
2563 return pointer;
2564 }
2565
2566 if (value.__type === 'Object') {
2567 // It's an Object included in a query result.
2568 className = value.className;
2569
2570 var _v = _.clone(value);
2571
2572 delete _v.__type;
2573 delete _v.className;
2574
2575 var object = AV.Object._create(className);
2576
2577 object._finishFetch(_v, true);
2578
2579 return object;
2580 }
2581
2582 if (value.__type === 'Date') {
2583 return AV._parseDate(value.iso);
2584 }
2585
2586 if (value.__type === 'GeoPoint') {
2587 return new AV.GeoPoint({
2588 latitude: value.latitude,
2589 longitude: value.longitude
2590 });
2591 }
2592
2593 if (value.__type === 'Relation') {
2594 if (!key) throw new Error('key missing decoding a Relation');
2595 var relation = new AV.Relation(null, key);
2596 relation.targetClassName = value.className;
2597 return relation;
2598 }
2599
2600 if (value.__type === 'File') {
2601 var file = new AV.File(value.name);
2602
2603 var _v2 = _.clone(value);
2604
2605 delete _v2.__type;
2606
2607 file._finishFetch(_v2);
2608
2609 return file;
2610 }
2611
2612 return _.mapObject(value, AV._decode);
2613};
2614/**
2615 * The inverse function of {@link AV.Object#toFullJSON}.
2616 * @since 3.0.0
2617 * @method
2618 * @param {Object}
2619 * return {AV.Object|AV.File|any}
2620 */
2621
2622
2623AV.parseJSON = AV._decode;
2624/**
2625 * Similar to JSON.parse, except that AV internal types will be used if possible.
2626 * Inverse to {@link AV.stringify}
2627 * @since 3.14.0
2628 * @param {string} text the string to parse.
2629 * @return {AV.Object|AV.File|any}
2630 */
2631
2632AV.parse = function (text) {
2633 return AV.parseJSON(JSON.parse(text));
2634};
2635/**
2636 * Serialize a target containing AV.Object, similar to JSON.stringify.
2637 * Inverse to {@link AV.parse}
2638 * @since 3.14.0
2639 * @return {string}
2640 */
2641
2642
2643AV.stringify = function (target) {
2644 return (0, _stringify.default)(AV._encode(target, [], false, true));
2645};
2646
2647AV._encodeObjectOrArray = function (value) {
2648 var encodeAVObject = function encodeAVObject(object) {
2649 if (object && object._toFullJSON) {
2650 object = object._toFullJSON([]);
2651 }
2652
2653 return _.mapObject(object, function (value) {
2654 return AV._encode(value, []);
2655 });
2656 };
2657
2658 if (_.isArray(value)) {
2659 return (0, _map.default)(value).call(value, function (object) {
2660 return encodeAVObject(object);
2661 });
2662 } else {
2663 return encodeAVObject(value);
2664 }
2665};
2666
2667AV._arrayEach = _.each;
2668/**
2669 * Does a deep traversal of every item in object, calling func on every one.
2670 * @param {Object} object The object or array to traverse deeply.
2671 * @param {Function} func The function to call for every item. It will
2672 * be passed the item as an argument. If it returns a truthy value, that
2673 * value will replace the item in its parent container.
2674 * @returns {} the result of calling func on the top-level object itself.
2675 * @private
2676 */
2677
2678AV._traverse = function (object, func, seen) {
2679 if (object instanceof AV.Object) {
2680 seen = seen || [];
2681
2682 if ((0, _indexOf.default)(_).call(_, seen, object) >= 0) {
2683 // We've already visited this object in this call.
2684 return;
2685 }
2686
2687 seen.push(object);
2688
2689 AV._traverse(object.attributes, func, seen);
2690
2691 return func(object);
2692 }
2693
2694 if (object instanceof AV.Relation || object instanceof AV.File) {
2695 // Nothing needs to be done, but we don't want to recurse into the
2696 // object's parent infinitely, so we catch this case.
2697 return func(object);
2698 }
2699
2700 if (_.isArray(object)) {
2701 _.each(object, function (child, index) {
2702 var newChild = AV._traverse(child, func, seen);
2703
2704 if (newChild) {
2705 object[index] = newChild;
2706 }
2707 });
2708
2709 return func(object);
2710 }
2711
2712 if (_.isObject(object)) {
2713 AV._each(object, function (child, key) {
2714 var newChild = AV._traverse(child, func, seen);
2715
2716 if (newChild) {
2717 object[key] = newChild;
2718 }
2719 });
2720
2721 return func(object);
2722 }
2723
2724 return func(object);
2725};
2726/**
2727 * This is like _.each, except:
2728 * * it doesn't work for so-called array-like objects,
2729 * * it does work for dictionaries with a "length" attribute.
2730 * @private
2731 */
2732
2733
2734AV._objectEach = AV._each = function (obj, callback) {
2735 if (_.isObject(obj)) {
2736 _.each((0, _keys2.default)(_).call(_, obj), function (key) {
2737 callback(obj[key], key);
2738 });
2739 } else {
2740 _.each(obj, callback);
2741 }
2742};
2743/**
2744 * @namespace
2745 * @since 3.14.0
2746 */
2747
2748
2749AV.debug = {
2750 /**
2751 * Enable debug
2752 */
2753 enable: function enable() {
2754 var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'leancloud*';
2755 return debug.enable(namespaces);
2756 },
2757
2758 /**
2759 * Disable debug
2760 */
2761 disable: debug.disable
2762};
2763/**
2764 * Specify Adapters
2765 * @since 4.4.0
2766 * @function
2767 * @param {Adapters} newAdapters See {@link https://url.leanapp.cn/adapter-type-definitions @leancloud/adapter-types} for detailed definitions.
2768 */
2769
2770AV.setAdapters = setAdapters;
2771module.exports = AV;
2772/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(105)))
2773
2774/***/ }),
2775/* 60 */
2776/***/ (function(module, exports, __webpack_require__) {
2777
2778"use strict";
2779
2780
2781function _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); }
2782
2783/* eslint-env browser */
2784
2785/**
2786 * This is the web browser implementation of `debug()`.
2787 */
2788exports.log = log;
2789exports.formatArgs = formatArgs;
2790exports.save = save;
2791exports.load = load;
2792exports.useColors = useColors;
2793exports.storage = localstorage();
2794/**
2795 * Colors.
2796 */
2797
2798exports.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'];
2799/**
2800 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
2801 * and the Firebug extension (any Firefox version) are known
2802 * to support "%c" CSS customizations.
2803 *
2804 * TODO: add a `localStorage` variable to explicitly enable/disable colors
2805 */
2806// eslint-disable-next-line complexity
2807
2808function useColors() {
2809 // NB: In an Electron preload script, document will be defined but not fully
2810 // initialized. Since we know we're in Chrome, we'll just detect this case
2811 // explicitly
2812 if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
2813 return true;
2814 } // Internet Explorer and Edge do not support colors.
2815
2816
2817 if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
2818 return false;
2819 } // Is webkit? http://stackoverflow.com/a/16459606/376773
2820 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
2821
2822
2823 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
2824 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
2825 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
2826 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
2827 typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
2828}
2829/**
2830 * Colorize log arguments if enabled.
2831 *
2832 * @api public
2833 */
2834
2835
2836function formatArgs(args) {
2837 args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
2838
2839 if (!this.useColors) {
2840 return;
2841 }
2842
2843 var c = 'color: ' + this.color;
2844 args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
2845 // arguments passed either before or after the %c, so we need to
2846 // figure out the correct index to insert the CSS into
2847
2848 var index = 0;
2849 var lastC = 0;
2850 args[0].replace(/%[a-zA-Z%]/g, function (match) {
2851 if (match === '%%') {
2852 return;
2853 }
2854
2855 index++;
2856
2857 if (match === '%c') {
2858 // We only are interested in the *last* %c
2859 // (the user may have provided their own)
2860 lastC = index;
2861 }
2862 });
2863 args.splice(lastC, 0, c);
2864}
2865/**
2866 * Invokes `console.log()` when available.
2867 * No-op when `console.log` is not a "function".
2868 *
2869 * @api public
2870 */
2871
2872
2873function log() {
2874 var _console;
2875
2876 // This hackery is required for IE8/9, where
2877 // the `console.log` function doesn't have 'apply'
2878 return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
2879}
2880/**
2881 * Save `namespaces`.
2882 *
2883 * @param {String} namespaces
2884 * @api private
2885 */
2886
2887
2888function save(namespaces) {
2889 try {
2890 if (namespaces) {
2891 exports.storage.setItem('debug', namespaces);
2892 } else {
2893 exports.storage.removeItem('debug');
2894 }
2895 } catch (error) {// Swallow
2896 // XXX (@Qix-) should we be logging these?
2897 }
2898}
2899/**
2900 * Load `namespaces`.
2901 *
2902 * @return {String} returns the previously persisted debug modes
2903 * @api private
2904 */
2905
2906
2907function load() {
2908 var r;
2909
2910 try {
2911 r = exports.storage.getItem('debug');
2912 } catch (error) {} // Swallow
2913 // XXX (@Qix-) should we be logging these?
2914 // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
2915
2916
2917 if (!r && typeof process !== 'undefined' && 'env' in process) {
2918 r = process.env.DEBUG;
2919 }
2920
2921 return r;
2922}
2923/**
2924 * Localstorage attempts to return the localstorage.
2925 *
2926 * This is necessary because safari throws
2927 * when a user disables cookies/localstorage
2928 * and you attempt to access it.
2929 *
2930 * @return {LocalStorage}
2931 * @api private
2932 */
2933
2934
2935function localstorage() {
2936 try {
2937 // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
2938 // The Browser also has localStorage in the global context.
2939 return localStorage;
2940 } catch (error) {// Swallow
2941 // XXX (@Qix-) should we be logging these?
2942 }
2943}
2944
2945module.exports = __webpack_require__(375)(exports);
2946var formatters = module.exports.formatters;
2947/**
2948 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
2949 */
2950
2951formatters.j = function (v) {
2952 try {
2953 return JSON.stringify(v);
2954 } catch (error) {
2955 return '[UnexpectedJSONParseError]: ' + error.message;
2956 }
2957};
2958
2959
2960
2961/***/ }),
2962/* 61 */
2963/***/ (function(module, exports, __webpack_require__) {
2964
2965"use strict";
2966
2967
2968var _interopRequireDefault = __webpack_require__(2);
2969
2970var _keys = _interopRequireDefault(__webpack_require__(48));
2971
2972var _ = __webpack_require__(1);
2973
2974var EventEmitter = __webpack_require__(218);
2975
2976var _require = __webpack_require__(28),
2977 inherits = _require.inherits;
2978
2979var AdapterManager = inherits(EventEmitter, {
2980 constructor: function constructor() {
2981 EventEmitter.apply(this);
2982 this._adapters = {};
2983 },
2984 getAdapter: function getAdapter(name) {
2985 var adapter = this._adapters[name];
2986
2987 if (adapter === undefined) {
2988 throw new Error("".concat(name, " adapter is not configured"));
2989 }
2990
2991 return adapter;
2992 },
2993 setAdapters: function setAdapters(newAdapters) {
2994 var _this = this;
2995
2996 _.extend(this._adapters, newAdapters);
2997
2998 (0, _keys.default)(_).call(_, newAdapters).forEach(function (name) {
2999 return _this.emit(name, newAdapters[name]);
3000 });
3001 }
3002});
3003var adapterManager = new AdapterManager();
3004module.exports = {
3005 getAdapter: adapterManager.getAdapter.bind(adapterManager),
3006 setAdapters: adapterManager.setAdapters.bind(adapterManager),
3007 adapterManager: adapterManager
3008};
3009
3010/***/ }),
3011/* 62 */
3012/***/ (function(module, exports, __webpack_require__) {
3013
3014var NATIVE_BIND = __webpack_require__(63);
3015
3016var FunctionPrototype = Function.prototype;
3017var apply = FunctionPrototype.apply;
3018var call = FunctionPrototype.call;
3019
3020// eslint-disable-next-line es-x/no-reflect -- safe
3021module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
3022 return call.apply(apply, arguments);
3023});
3024
3025
3026/***/ }),
3027/* 63 */
3028/***/ (function(module, exports, __webpack_require__) {
3029
3030var fails = __webpack_require__(4);
3031
3032module.exports = !fails(function () {
3033 // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
3034 var test = (function () { /* empty */ }).bind();
3035 // eslint-disable-next-line no-prototype-builtins -- safe
3036 return typeof test != 'function' || test.hasOwnProperty('prototype');
3037});
3038
3039
3040/***/ }),
3041/* 64 */
3042/***/ (function(module, exports, __webpack_require__) {
3043
3044var DESCRIPTORS = __webpack_require__(19);
3045var call = __webpack_require__(11);
3046var propertyIsEnumerableModule = __webpack_require__(138);
3047var createPropertyDescriptor = __webpack_require__(41);
3048var toIndexedObject = __webpack_require__(33);
3049var toPropertyKey = __webpack_require__(82);
3050var hasOwn = __webpack_require__(14);
3051var IE8_DOM_DEFINE = __webpack_require__(141);
3052
3053// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3054var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
3055
3056// `Object.getOwnPropertyDescriptor` method
3057// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
3058exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
3059 O = toIndexedObject(O);
3060 P = toPropertyKey(P);
3061 if (IE8_DOM_DEFINE) try {
3062 return $getOwnPropertyDescriptor(O, P);
3063 } catch (error) { /* empty */ }
3064 if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
3065};
3066
3067
3068/***/ }),
3069/* 65 */
3070/***/ (function(module, exports, __webpack_require__) {
3071
3072var uncurryThis = __webpack_require__(6);
3073
3074var toString = uncurryThis({}.toString);
3075var stringSlice = uncurryThis(''.slice);
3076
3077module.exports = function (it) {
3078 return stringSlice(toString(it), 8, -1);
3079};
3080
3081
3082/***/ }),
3083/* 66 */
3084/***/ (function(module, exports) {
3085
3086var $String = String;
3087
3088module.exports = function (argument) {
3089 try {
3090 return $String(argument);
3091 } catch (error) {
3092 return 'Object';
3093 }
3094};
3095
3096
3097/***/ }),
3098/* 67 */
3099/***/ (function(module, exports, __webpack_require__) {
3100
3101var IS_PURE = __webpack_require__(31);
3102var store = __webpack_require__(108);
3103
3104(module.exports = function (key, value) {
3105 return store[key] || (store[key] = value !== undefined ? value : {});
3106})('versions', []).push({
3107 version: '3.23.3',
3108 mode: IS_PURE ? 'pure' : 'global',
3109 copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
3110 license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
3111 source: 'https://github.com/zloirock/core-js'
3112});
3113
3114
3115/***/ }),
3116/* 68 */
3117/***/ (function(module, exports, __webpack_require__) {
3118
3119var bind = __webpack_require__(50);
3120var call = __webpack_require__(11);
3121var anObject = __webpack_require__(21);
3122var tryToString = __webpack_require__(66);
3123var isArrayIteratorMethod = __webpack_require__(149);
3124var lengthOfArrayLike = __webpack_require__(42);
3125var isPrototypeOf = __webpack_require__(20);
3126var getIterator = __webpack_require__(150);
3127var getIteratorMethod = __webpack_require__(90);
3128var iteratorClose = __webpack_require__(151);
3129
3130var $TypeError = TypeError;
3131
3132var Result = function (stopped, result) {
3133 this.stopped = stopped;
3134 this.result = result;
3135};
3136
3137var ResultPrototype = Result.prototype;
3138
3139module.exports = function (iterable, unboundFunction, options) {
3140 var that = options && options.that;
3141 var AS_ENTRIES = !!(options && options.AS_ENTRIES);
3142 var IS_ITERATOR = !!(options && options.IS_ITERATOR);
3143 var INTERRUPTED = !!(options && options.INTERRUPTED);
3144 var fn = bind(unboundFunction, that);
3145 var iterator, iterFn, index, length, result, next, step;
3146
3147 var stop = function (condition) {
3148 if (iterator) iteratorClose(iterator, 'normal', condition);
3149 return new Result(true, condition);
3150 };
3151
3152 var callFn = function (value) {
3153 if (AS_ENTRIES) {
3154 anObject(value);
3155 return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
3156 } return INTERRUPTED ? fn(value, stop) : fn(value);
3157 };
3158
3159 if (IS_ITERATOR) {
3160 iterator = iterable;
3161 } else {
3162 iterFn = getIteratorMethod(iterable);
3163 if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
3164 // optimisation for array iterators
3165 if (isArrayIteratorMethod(iterFn)) {
3166 for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
3167 result = callFn(iterable[index]);
3168 if (result && isPrototypeOf(ResultPrototype, result)) return result;
3169 } return new Result(false);
3170 }
3171 iterator = getIterator(iterable, iterFn);
3172 }
3173
3174 next = iterator.next;
3175 while (!(step = call(next, iterator)).done) {
3176 try {
3177 result = callFn(step.value);
3178 } catch (error) {
3179 iteratorClose(iterator, 'throw', error);
3180 }
3181 if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
3182 } return new Result(false);
3183};
3184
3185
3186/***/ }),
3187/* 69 */
3188/***/ (function(module, exports, __webpack_require__) {
3189
3190var classof = __webpack_require__(53);
3191
3192var $String = String;
3193
3194module.exports = function (argument) {
3195 if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
3196 return $String(argument);
3197};
3198
3199
3200/***/ }),
3201/* 70 */
3202/***/ (function(module, exports, __webpack_require__) {
3203
3204"use strict";
3205
3206var toIndexedObject = __webpack_require__(33);
3207var addToUnscopables = __webpack_require__(152);
3208var Iterators = __webpack_require__(52);
3209var InternalStateModule = __webpack_require__(91);
3210var defineProperty = __webpack_require__(32).f;
3211var defineIterator = __webpack_require__(153);
3212var IS_PURE = __webpack_require__(31);
3213var DESCRIPTORS = __webpack_require__(19);
3214
3215var ARRAY_ITERATOR = 'Array Iterator';
3216var setInternalState = InternalStateModule.set;
3217var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
3218
3219// `Array.prototype.entries` method
3220// https://tc39.es/ecma262/#sec-array.prototype.entries
3221// `Array.prototype.keys` method
3222// https://tc39.es/ecma262/#sec-array.prototype.keys
3223// `Array.prototype.values` method
3224// https://tc39.es/ecma262/#sec-array.prototype.values
3225// `Array.prototype[@@iterator]` method
3226// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
3227// `CreateArrayIterator` internal method
3228// https://tc39.es/ecma262/#sec-createarrayiterator
3229module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
3230 setInternalState(this, {
3231 type: ARRAY_ITERATOR,
3232 target: toIndexedObject(iterated), // target
3233 index: 0, // next index
3234 kind: kind // kind
3235 });
3236// `%ArrayIteratorPrototype%.next` method
3237// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
3238}, function () {
3239 var state = getInternalState(this);
3240 var target = state.target;
3241 var kind = state.kind;
3242 var index = state.index++;
3243 if (!target || index >= target.length) {
3244 state.target = undefined;
3245 return { value: undefined, done: true };
3246 }
3247 if (kind == 'keys') return { value: index, done: false };
3248 if (kind == 'values') return { value: target[index], done: false };
3249 return { value: [index, target[index]], done: false };
3250}, 'values');
3251
3252// argumentsList[@@iterator] is %ArrayProto_values%
3253// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
3254// https://tc39.es/ecma262/#sec-createmappedargumentsobject
3255var values = Iterators.Arguments = Iterators.Array;
3256
3257// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3258addToUnscopables('keys');
3259addToUnscopables('values');
3260addToUnscopables('entries');
3261
3262// V8 ~ Chrome 45- bug
3263if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
3264 defineProperty(values, 'name', { value: 'values' });
3265} catch (error) { /* empty */ }
3266
3267
3268/***/ }),
3269/* 71 */
3270/***/ (function(module, exports) {
3271
3272module.exports = function (exec) {
3273 try {
3274 return { error: false, value: exec() };
3275 } catch (error) {
3276 return { error: true, value: error };
3277 }
3278};
3279
3280
3281/***/ }),
3282/* 72 */
3283/***/ (function(module, exports, __webpack_require__) {
3284
3285var global = __webpack_require__(9);
3286var NativePromiseConstructor = __webpack_require__(55);
3287var isCallable = __webpack_require__(7);
3288var isForced = __webpack_require__(142);
3289var inspectSource = __webpack_require__(118);
3290var wellKnownSymbol = __webpack_require__(8);
3291var IS_BROWSER = __webpack_require__(268);
3292var IS_PURE = __webpack_require__(31);
3293var V8_VERSION = __webpack_require__(84);
3294
3295var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
3296var SPECIES = wellKnownSymbol('species');
3297var SUBCLASSING = false;
3298var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
3299
3300var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
3301 var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
3302 var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
3303 // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
3304 // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
3305 // We can't detect it synchronously, so just check versions
3306 if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
3307 // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution
3308 if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
3309 // We can't use @@species feature detection in V8 since it causes
3310 // deoptimization and performance degradation
3311 // https://github.com/zloirock/core-js/issues/679
3312 if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
3313 // Detect correctness of subclassing with @@species support
3314 var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
3315 var FakePromise = function (exec) {
3316 exec(function () { /* empty */ }, function () { /* empty */ });
3317 };
3318 var constructor = promise.constructor = {};
3319 constructor[SPECIES] = FakePromise;
3320 SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
3321 if (!SUBCLASSING) return true;
3322 // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
3323 return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
3324});
3325
3326module.exports = {
3327 CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
3328 REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
3329 SUBCLASSING: SUBCLASSING
3330};
3331
3332
3333/***/ }),
3334/* 73 */
3335/***/ (function(module, exports, __webpack_require__) {
3336
3337__webpack_require__(70);
3338var DOMIterables = __webpack_require__(278);
3339var global = __webpack_require__(9);
3340var classof = __webpack_require__(53);
3341var createNonEnumerableProperty = __webpack_require__(36);
3342var Iterators = __webpack_require__(52);
3343var wellKnownSymbol = __webpack_require__(8);
3344
3345var TO_STRING_TAG = wellKnownSymbol('toStringTag');
3346
3347for (var COLLECTION_NAME in DOMIterables) {
3348 var Collection = global[COLLECTION_NAME];
3349 var CollectionPrototype = Collection && Collection.prototype;
3350 if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
3351 createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
3352 }
3353 Iterators[COLLECTION_NAME] = Iterators.Array;
3354}
3355
3356
3357/***/ }),
3358/* 74 */
3359/***/ (function(module, __webpack_exports__, __webpack_require__) {
3360
3361"use strict";
3362/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasStringTagBug; });
3363/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isIE11; });
3364/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
3365/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__ = __webpack_require__(285);
3366
3367
3368
3369// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
3370// In IE 11, the most common among them, this problem also applies to
3371// `Map`, `WeakMap` and `Set`.
3372var hasStringTagBug = (
3373 __WEBPACK_IMPORTED_MODULE_0__setup_js__["s" /* supportsDataView */] && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new DataView(new ArrayBuffer(8)))
3374 ),
3375 isIE11 = (typeof Map !== 'undefined' && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new Map));
3376
3377
3378/***/ }),
3379/* 75 */
3380/***/ (function(module, __webpack_exports__, __webpack_require__) {
3381
3382"use strict";
3383/* harmony export (immutable) */ __webpack_exports__["a"] = allKeys;
3384/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(45);
3385/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
3386/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__ = __webpack_require__(172);
3387
3388
3389
3390
3391// Retrieve all the enumerable property names of an object.
3392function allKeys(obj) {
3393 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
3394 var keys = [];
3395 for (var key in obj) keys.push(key);
3396 // Ahem, IE < 9.
3397 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__["a" /* default */])(obj, keys);
3398 return keys;
3399}
3400
3401
3402/***/ }),
3403/* 76 */
3404/***/ (function(module, __webpack_exports__, __webpack_require__) {
3405
3406"use strict";
3407/* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
3408/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
3409/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(181);
3410
3411
3412
3413// Internal wrapper for `_.toPath` to enable minification.
3414// Similar to `cb` for `_.iteratee`.
3415function toPath(path) {
3416 return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath(path);
3417}
3418
3419
3420/***/ }),
3421/* 77 */
3422/***/ (function(module, __webpack_exports__, __webpack_require__) {
3423
3424"use strict";
3425/* harmony export (immutable) */ __webpack_exports__["a"] = optimizeCb;
3426// Internal function that returns an efficient (for current engines) version
3427// of the passed-in callback, to be repeatedly applied in other Underscore
3428// functions.
3429function optimizeCb(func, context, argCount) {
3430 if (context === void 0) return func;
3431 switch (argCount == null ? 3 : argCount) {
3432 case 1: return function(value) {
3433 return func.call(context, value);
3434 };
3435 // The 2-argument case is omitted because we’re not using it.
3436 case 3: return function(value, index, collection) {
3437 return func.call(context, value, index, collection);
3438 };
3439 case 4: return function(accumulator, value, index, collection) {
3440 return func.call(context, accumulator, value, index, collection);
3441 };
3442 }
3443 return function() {
3444 return func.apply(context, arguments);
3445 };
3446}
3447
3448
3449/***/ }),
3450/* 78 */
3451/***/ (function(module, __webpack_exports__, __webpack_require__) {
3452
3453"use strict";
3454/* harmony export (immutable) */ __webpack_exports__["a"] = filter;
3455/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
3456/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(47);
3457
3458
3459
3460// Return all the elements that pass a truth test.
3461function filter(obj, predicate, context) {
3462 var results = [];
3463 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
3464 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index, list) {
3465 if (predicate(value, index, list)) results.push(value);
3466 });
3467 return results;
3468}
3469
3470
3471/***/ }),
3472/* 79 */
3473/***/ (function(module, __webpack_exports__, __webpack_require__) {
3474
3475"use strict";
3476/* harmony export (immutable) */ __webpack_exports__["a"] = contains;
3477/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
3478/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(56);
3479/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__indexOf_js__ = __webpack_require__(197);
3480
3481
3482
3483
3484// Determine if the array or object contains a given item (using `===`).
3485function contains(obj, item, fromIndex, guard) {
3486 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
3487 if (typeof fromIndex != 'number' || guard) fromIndex = 0;
3488 return Object(__WEBPACK_IMPORTED_MODULE_2__indexOf_js__["a" /* default */])(obj, item, fromIndex) >= 0;
3489}
3490
3491
3492/***/ }),
3493/* 80 */
3494/***/ (function(module, exports, __webpack_require__) {
3495
3496var classof = __webpack_require__(65);
3497
3498// `IsArray` abstract operation
3499// https://tc39.es/ecma262/#sec-isarray
3500// eslint-disable-next-line es-x/no-array-isarray -- safe
3501module.exports = Array.isArray || function isArray(argument) {
3502 return classof(argument) == 'Array';
3503};
3504
3505
3506/***/ }),
3507/* 81 */
3508/***/ (function(module, exports, __webpack_require__) {
3509
3510module.exports = __webpack_require__(222);
3511
3512/***/ }),
3513/* 82 */
3514/***/ (function(module, exports, __webpack_require__) {
3515
3516var toPrimitive = __webpack_require__(242);
3517var isSymbol = __webpack_require__(83);
3518
3519// `ToPropertyKey` abstract operation
3520// https://tc39.es/ecma262/#sec-topropertykey
3521module.exports = function (argument) {
3522 var key = toPrimitive(argument, 'string');
3523 return isSymbol(key) ? key : key + '';
3524};
3525
3526
3527/***/ }),
3528/* 83 */
3529/***/ (function(module, exports, __webpack_require__) {
3530
3531var getBuiltIn = __webpack_require__(16);
3532var isCallable = __webpack_require__(7);
3533var isPrototypeOf = __webpack_require__(20);
3534var USE_SYMBOL_AS_UID = __webpack_require__(140);
3535
3536var $Object = Object;
3537
3538module.exports = USE_SYMBOL_AS_UID ? function (it) {
3539 return typeof it == 'symbol';
3540} : function (it) {
3541 var $Symbol = getBuiltIn('Symbol');
3542 return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
3543};
3544
3545
3546/***/ }),
3547/* 84 */
3548/***/ (function(module, exports, __webpack_require__) {
3549
3550var global = __webpack_require__(9);
3551var userAgent = __webpack_require__(85);
3552
3553var process = global.process;
3554var Deno = global.Deno;
3555var versions = process && process.versions || Deno && Deno.version;
3556var v8 = versions && versions.v8;
3557var match, version;
3558
3559if (v8) {
3560 match = v8.split('.');
3561 // in old Chrome, versions of V8 isn't V8 = Chrome / 10
3562 // but their correct versions are not interesting for us
3563 version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
3564}
3565
3566// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
3567// so check `userAgent` even if `.v8` exists, but 0
3568if (!version && userAgent) {
3569 match = userAgent.match(/Edge\/(\d+)/);
3570 if (!match || match[1] >= 74) {
3571 match = userAgent.match(/Chrome\/(\d+)/);
3572 if (match) version = +match[1];
3573 }
3574}
3575
3576module.exports = version;
3577
3578
3579/***/ }),
3580/* 85 */
3581/***/ (function(module, exports, __webpack_require__) {
3582
3583var getBuiltIn = __webpack_require__(16);
3584
3585module.exports = getBuiltIn('navigator', 'userAgent') || '';
3586
3587
3588/***/ }),
3589/* 86 */
3590/***/ (function(module, exports, __webpack_require__) {
3591
3592var hasOwn = __webpack_require__(14);
3593var isCallable = __webpack_require__(7);
3594var toObject = __webpack_require__(35);
3595var sharedKey = __webpack_require__(87);
3596var CORRECT_PROTOTYPE_GETTER = __webpack_require__(144);
3597
3598var IE_PROTO = sharedKey('IE_PROTO');
3599var $Object = Object;
3600var ObjectPrototype = $Object.prototype;
3601
3602// `Object.getPrototypeOf` method
3603// https://tc39.es/ecma262/#sec-object.getprototypeof
3604// eslint-disable-next-line es-x/no-object-getprototypeof -- safe
3605module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
3606 var object = toObject(O);
3607 if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
3608 var constructor = object.constructor;
3609 if (isCallable(constructor) && object instanceof constructor) {
3610 return constructor.prototype;
3611 } return object instanceof $Object ? ObjectPrototype : null;
3612};
3613
3614
3615/***/ }),
3616/* 87 */
3617/***/ (function(module, exports, __webpack_require__) {
3618
3619var shared = __webpack_require__(67);
3620var uid = __webpack_require__(109);
3621
3622var keys = shared('keys');
3623
3624module.exports = function (key) {
3625 return keys[key] || (keys[key] = uid(key));
3626};
3627
3628
3629/***/ }),
3630/* 88 */
3631/***/ (function(module, exports, __webpack_require__) {
3632
3633/* eslint-disable no-proto -- safe */
3634var uncurryThis = __webpack_require__(6);
3635var anObject = __webpack_require__(21);
3636var aPossiblePrototype = __webpack_require__(245);
3637
3638// `Object.setPrototypeOf` method
3639// https://tc39.es/ecma262/#sec-object.setprototypeof
3640// Works with __proto__ only. Old v8 can't work with null proto objects.
3641// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
3642module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3643 var CORRECT_SETTER = false;
3644 var test = {};
3645 var setter;
3646 try {
3647 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3648 setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
3649 setter(test, []);
3650 CORRECT_SETTER = test instanceof Array;
3651 } catch (error) { /* empty */ }
3652 return function setPrototypeOf(O, proto) {
3653 anObject(O);
3654 aPossiblePrototype(proto);
3655 if (CORRECT_SETTER) setter(O, proto);
3656 else O.__proto__ = proto;
3657 return O;
3658 };
3659}() : undefined);
3660
3661
3662/***/ }),
3663/* 89 */
3664/***/ (function(module, exports) {
3665
3666module.exports = {};
3667
3668
3669/***/ }),
3670/* 90 */
3671/***/ (function(module, exports, __webpack_require__) {
3672
3673var classof = __webpack_require__(53);
3674var getMethod = __webpack_require__(107);
3675var Iterators = __webpack_require__(52);
3676var wellKnownSymbol = __webpack_require__(8);
3677
3678var ITERATOR = wellKnownSymbol('iterator');
3679
3680module.exports = function (it) {
3681 if (it != undefined) return getMethod(it, ITERATOR)
3682 || getMethod(it, '@@iterator')
3683 || Iterators[classof(it)];
3684};
3685
3686
3687/***/ }),
3688/* 91 */
3689/***/ (function(module, exports, __webpack_require__) {
3690
3691var NATIVE_WEAK_MAP = __webpack_require__(254);
3692var global = __webpack_require__(9);
3693var uncurryThis = __webpack_require__(6);
3694var isObject = __webpack_require__(17);
3695var createNonEnumerableProperty = __webpack_require__(36);
3696var hasOwn = __webpack_require__(14);
3697var shared = __webpack_require__(108);
3698var sharedKey = __webpack_require__(87);
3699var hiddenKeys = __webpack_require__(89);
3700
3701var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
3702var TypeError = global.TypeError;
3703var WeakMap = global.WeakMap;
3704var set, get, has;
3705
3706var enforce = function (it) {
3707 return has(it) ? get(it) : set(it, {});
3708};
3709
3710var getterFor = function (TYPE) {
3711 return function (it) {
3712 var state;
3713 if (!isObject(it) || (state = get(it)).type !== TYPE) {
3714 throw TypeError('Incompatible receiver, ' + TYPE + ' required');
3715 } return state;
3716 };
3717};
3718
3719if (NATIVE_WEAK_MAP || shared.state) {
3720 var store = shared.state || (shared.state = new WeakMap());
3721 var wmget = uncurryThis(store.get);
3722 var wmhas = uncurryThis(store.has);
3723 var wmset = uncurryThis(store.set);
3724 set = function (it, metadata) {
3725 if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
3726 metadata.facade = it;
3727 wmset(store, it, metadata);
3728 return metadata;
3729 };
3730 get = function (it) {
3731 return wmget(store, it) || {};
3732 };
3733 has = function (it) {
3734 return wmhas(store, it);
3735 };
3736} else {
3737 var STATE = sharedKey('state');
3738 hiddenKeys[STATE] = true;
3739 set = function (it, metadata) {
3740 if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
3741 metadata.facade = it;
3742 createNonEnumerableProperty(it, STATE, metadata);
3743 return metadata;
3744 };
3745 get = function (it) {
3746 return hasOwn(it, STATE) ? it[STATE] : {};
3747 };
3748 has = function (it) {
3749 return hasOwn(it, STATE);
3750 };
3751}
3752
3753module.exports = {
3754 set: set,
3755 get: get,
3756 has: has,
3757 enforce: enforce,
3758 getterFor: getterFor
3759};
3760
3761
3762/***/ }),
3763/* 92 */
3764/***/ (function(module, exports) {
3765
3766// empty
3767
3768
3769/***/ }),
3770/* 93 */
3771/***/ (function(module, exports, __webpack_require__) {
3772
3773var uncurryThis = __webpack_require__(6);
3774var fails = __webpack_require__(4);
3775var isCallable = __webpack_require__(7);
3776var classof = __webpack_require__(53);
3777var getBuiltIn = __webpack_require__(16);
3778var inspectSource = __webpack_require__(118);
3779
3780var noop = function () { /* empty */ };
3781var empty = [];
3782var construct = getBuiltIn('Reflect', 'construct');
3783var constructorRegExp = /^\s*(?:class|function)\b/;
3784var exec = uncurryThis(constructorRegExp.exec);
3785var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
3786
3787var isConstructorModern = function isConstructor(argument) {
3788 if (!isCallable(argument)) return false;
3789 try {
3790 construct(noop, empty, argument);
3791 return true;
3792 } catch (error) {
3793 return false;
3794 }
3795};
3796
3797var isConstructorLegacy = function isConstructor(argument) {
3798 if (!isCallable(argument)) return false;
3799 switch (classof(argument)) {
3800 case 'AsyncFunction':
3801 case 'GeneratorFunction':
3802 case 'AsyncGeneratorFunction': return false;
3803 }
3804 try {
3805 // we can't check .prototype since constructors produced by .bind haven't it
3806 // `Function#toString` throws on some built-it function in some legacy engines
3807 // (for example, `DOMQuad` and similar in FF41-)
3808 return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
3809 } catch (error) {
3810 return true;
3811 }
3812};
3813
3814isConstructorLegacy.sham = true;
3815
3816// `IsConstructor` abstract operation
3817// https://tc39.es/ecma262/#sec-isconstructor
3818module.exports = !construct || fails(function () {
3819 var called;
3820 return isConstructorModern(isConstructorModern.call)
3821 || !isConstructorModern(Object)
3822 || !isConstructorModern(function () { called = true; })
3823 || called;
3824}) ? isConstructorLegacy : isConstructorModern;
3825
3826
3827/***/ }),
3828/* 94 */
3829/***/ (function(module, exports, __webpack_require__) {
3830
3831var uncurryThis = __webpack_require__(6);
3832
3833module.exports = uncurryThis([].slice);
3834
3835
3836/***/ }),
3837/* 95 */
3838/***/ (function(module, exports, __webpack_require__) {
3839
3840"use strict";
3841
3842var charAt = __webpack_require__(277).charAt;
3843var toString = __webpack_require__(69);
3844var InternalStateModule = __webpack_require__(91);
3845var defineIterator = __webpack_require__(153);
3846
3847var STRING_ITERATOR = 'String Iterator';
3848var setInternalState = InternalStateModule.set;
3849var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
3850
3851// `String.prototype[@@iterator]` method
3852// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
3853defineIterator(String, 'String', function (iterated) {
3854 setInternalState(this, {
3855 type: STRING_ITERATOR,
3856 string: toString(iterated),
3857 index: 0
3858 });
3859// `%StringIteratorPrototype%.next` method
3860// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
3861}, function next() {
3862 var state = getInternalState(this);
3863 var string = state.string;
3864 var index = state.index;
3865 var point;
3866 if (index >= string.length) return { value: undefined, done: true };
3867 point = charAt(string, index);
3868 state.index += point.length;
3869 return { value: point, done: false };
3870});
3871
3872
3873/***/ }),
3874/* 96 */
3875/***/ (function(module, __webpack_exports__, __webpack_require__) {
3876
3877"use strict";
3878/* harmony export (immutable) */ __webpack_exports__["a"] = matcher;
3879/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__extendOwn_js__ = __webpack_require__(127);
3880/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isMatch_js__ = __webpack_require__(173);
3881
3882
3883
3884// Returns a predicate for checking whether an object has a given set of
3885// `key:value` pairs.
3886function matcher(attrs) {
3887 attrs = Object(__WEBPACK_IMPORTED_MODULE_0__extendOwn_js__["a" /* default */])({}, attrs);
3888 return function(obj) {
3889 return Object(__WEBPACK_IMPORTED_MODULE_1__isMatch_js__["a" /* default */])(obj, attrs);
3890 };
3891}
3892
3893
3894/***/ }),
3895/* 97 */
3896/***/ (function(module, __webpack_exports__, __webpack_require__) {
3897
3898"use strict";
3899/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
3900/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__executeBound_js__ = __webpack_require__(189);
3901/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(23);
3902
3903
3904
3905
3906// Partially apply a function by creating a version that has had some of its
3907// arguments pre-filled, without changing its dynamic `this` context. `_` acts
3908// as a placeholder by default, allowing any combination of arguments to be
3909// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
3910var partial = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, boundArgs) {
3911 var placeholder = partial.placeholder;
3912 var bound = function() {
3913 var position = 0, length = boundArgs.length;
3914 var args = Array(length);
3915 for (var i = 0; i < length; i++) {
3916 args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
3917 }
3918 while (position < arguments.length) args.push(arguments[position++]);
3919 return Object(__WEBPACK_IMPORTED_MODULE_1__executeBound_js__["a" /* default */])(func, bound, this, this, args);
3920 };
3921 return bound;
3922});
3923
3924partial.placeholder = __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */];
3925/* harmony default export */ __webpack_exports__["a"] = (partial);
3926
3927
3928/***/ }),
3929/* 98 */
3930/***/ (function(module, __webpack_exports__, __webpack_require__) {
3931
3932"use strict";
3933/* harmony export (immutable) */ __webpack_exports__["a"] = group;
3934/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
3935/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(47);
3936
3937
3938
3939// An internal function used for aggregate "group by" operations.
3940function group(behavior, partition) {
3941 return function(obj, iteratee, context) {
3942 var result = partition ? [[], []] : {};
3943 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
3944 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index) {
3945 var key = iteratee(value, index, obj);
3946 behavior(result, value, key);
3947 });
3948 return result;
3949 };
3950}
3951
3952
3953/***/ }),
3954/* 99 */
3955/***/ (function(module, exports, __webpack_require__) {
3956
3957"use strict";
3958
3959var toPropertyKey = __webpack_require__(82);
3960var definePropertyModule = __webpack_require__(32);
3961var createPropertyDescriptor = __webpack_require__(41);
3962
3963module.exports = function (object, key, value) {
3964 var propertyKey = toPropertyKey(key);
3965 if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
3966 else object[propertyKey] = value;
3967};
3968
3969
3970/***/ }),
3971/* 100 */
3972/***/ (function(module, exports, __webpack_require__) {
3973
3974var fails = __webpack_require__(4);
3975var wellKnownSymbol = __webpack_require__(8);
3976var V8_VERSION = __webpack_require__(84);
3977
3978var SPECIES = wellKnownSymbol('species');
3979
3980module.exports = function (METHOD_NAME) {
3981 // We can't use this feature detection in V8 since it causes
3982 // deoptimization and serious performance degradation
3983 // https://github.com/zloirock/core-js/issues/677
3984 return V8_VERSION >= 51 || !fails(function () {
3985 var array = [];
3986 var constructor = array.constructor = {};
3987 constructor[SPECIES] = function () {
3988 return { foo: 1 };
3989 };
3990 return array[METHOD_NAME](Boolean).foo !== 1;
3991 });
3992};
3993
3994
3995/***/ }),
3996/* 101 */
3997/***/ (function(module, exports, __webpack_require__) {
3998
3999var bind = __webpack_require__(50);
4000var uncurryThis = __webpack_require__(6);
4001var IndexedObject = __webpack_require__(139);
4002var toObject = __webpack_require__(35);
4003var lengthOfArrayLike = __webpack_require__(42);
4004var arraySpeciesCreate = __webpack_require__(211);
4005
4006var push = uncurryThis([].push);
4007
4008// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
4009var createMethod = function (TYPE) {
4010 var IS_MAP = TYPE == 1;
4011 var IS_FILTER = TYPE == 2;
4012 var IS_SOME = TYPE == 3;
4013 var IS_EVERY = TYPE == 4;
4014 var IS_FIND_INDEX = TYPE == 6;
4015 var IS_FILTER_REJECT = TYPE == 7;
4016 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
4017 return function ($this, callbackfn, that, specificCreate) {
4018 var O = toObject($this);
4019 var self = IndexedObject(O);
4020 var boundFunction = bind(callbackfn, that);
4021 var length = lengthOfArrayLike(self);
4022 var index = 0;
4023 var create = specificCreate || arraySpeciesCreate;
4024 var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
4025 var value, result;
4026 for (;length > index; index++) if (NO_HOLES || index in self) {
4027 value = self[index];
4028 result = boundFunction(value, index, O);
4029 if (TYPE) {
4030 if (IS_MAP) target[index] = result; // map
4031 else if (result) switch (TYPE) {
4032 case 3: return true; // some
4033 case 5: return value; // find
4034 case 6: return index; // findIndex
4035 case 2: push(target, value); // filter
4036 } else switch (TYPE) {
4037 case 4: return false; // every
4038 case 7: push(target, value); // filterReject
4039 }
4040 }
4041 }
4042 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
4043 };
4044};
4045
4046module.exports = {
4047 // `Array.prototype.forEach` method
4048 // https://tc39.es/ecma262/#sec-array.prototype.foreach
4049 forEach: createMethod(0),
4050 // `Array.prototype.map` method
4051 // https://tc39.es/ecma262/#sec-array.prototype.map
4052 map: createMethod(1),
4053 // `Array.prototype.filter` method
4054 // https://tc39.es/ecma262/#sec-array.prototype.filter
4055 filter: createMethod(2),
4056 // `Array.prototype.some` method
4057 // https://tc39.es/ecma262/#sec-array.prototype.some
4058 some: createMethod(3),
4059 // `Array.prototype.every` method
4060 // https://tc39.es/ecma262/#sec-array.prototype.every
4061 every: createMethod(4),
4062 // `Array.prototype.find` method
4063 // https://tc39.es/ecma262/#sec-array.prototype.find
4064 find: createMethod(5),
4065 // `Array.prototype.findIndex` method
4066 // https://tc39.es/ecma262/#sec-array.prototype.findIndex
4067 findIndex: createMethod(6),
4068 // `Array.prototype.filterReject` method
4069 // https://github.com/tc39/proposal-array-filtering
4070 filterReject: createMethod(7)
4071};
4072
4073
4074/***/ }),
4075/* 102 */
4076/***/ (function(module, exports, __webpack_require__) {
4077
4078module.exports = __webpack_require__(365);
4079
4080/***/ }),
4081/* 103 */
4082/***/ (function(module, exports, __webpack_require__) {
4083
4084"use strict";
4085
4086
4087var _interopRequireDefault = __webpack_require__(2);
4088
4089var _typeof2 = _interopRequireDefault(__webpack_require__(135));
4090
4091var _filter = _interopRequireDefault(__webpack_require__(430));
4092
4093var _map = _interopRequireDefault(__webpack_require__(39));
4094
4095var _keys = _interopRequireDefault(__webpack_require__(212));
4096
4097var _stringify = _interopRequireDefault(__webpack_require__(34));
4098
4099var _concat = _interopRequireDefault(__webpack_require__(29));
4100
4101var _ = __webpack_require__(1);
4102
4103var _require = __webpack_require__(435),
4104 timeout = _require.timeout;
4105
4106var debug = __webpack_require__(60);
4107
4108var debugRequest = debug('leancloud:request');
4109var debugRequestError = debug('leancloud:request:error');
4110
4111var _require2 = __webpack_require__(61),
4112 getAdapter = _require2.getAdapter;
4113
4114var requestsCount = 0;
4115
4116var ajax = function ajax(_ref) {
4117 var method = _ref.method,
4118 url = _ref.url,
4119 query = _ref.query,
4120 data = _ref.data,
4121 _ref$headers = _ref.headers,
4122 headers = _ref$headers === void 0 ? {} : _ref$headers,
4123 time = _ref.timeout,
4124 onprogress = _ref.onprogress;
4125
4126 if (query) {
4127 var _context, _context2, _context4;
4128
4129 var queryString = (0, _filter.default)(_context = (0, _map.default)(_context2 = (0, _keys.default)(query)).call(_context2, function (key) {
4130 var _context3;
4131
4132 var value = query[key];
4133 if (value === undefined) return undefined;
4134 var v = (0, _typeof2.default)(value) === 'object' ? (0, _stringify.default)(value) : value;
4135 return (0, _concat.default)(_context3 = "".concat(encodeURIComponent(key), "=")).call(_context3, encodeURIComponent(v));
4136 })).call(_context, function (qs) {
4137 return qs;
4138 }).join('&');
4139 url = (0, _concat.default)(_context4 = "".concat(url, "?")).call(_context4, queryString);
4140 }
4141
4142 var count = requestsCount++;
4143 debugRequest('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
4144 var request = getAdapter('request');
4145 var promise = request(url, {
4146 method: method,
4147 headers: headers,
4148 data: data,
4149 onprogress: onprogress
4150 }).then(function (response) {
4151 debugRequest('response(%d) %d %O %o', count, response.status, response.data || response.text, response.header);
4152
4153 if (response.ok === false) {
4154 var error = new Error();
4155 error.response = response;
4156 throw error;
4157 }
4158
4159 return response.data;
4160 }).catch(function (error) {
4161 if (error.response) {
4162 if (!debug.enabled('leancloud:request')) {
4163 debugRequestError('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
4164 }
4165
4166 debugRequestError('response(%d) %d %O %o', count, error.response.status, error.response.data || error.response.text, error.response.header);
4167 error.statusCode = error.response.status;
4168 error.responseText = error.response.text;
4169 error.response = error.response.data;
4170 }
4171
4172 throw error;
4173 });
4174 return time ? timeout(promise, time) : promise;
4175};
4176
4177module.exports = ajax;
4178
4179/***/ }),
4180/* 104 */
4181/***/ (function(module, exports, __webpack_require__) {
4182
4183module.exports = __webpack_require__(440);
4184
4185/***/ }),
4186/* 105 */
4187/***/ (function(module, exports) {
4188
4189var g;
4190
4191// This works in non-strict mode
4192g = (function() {
4193 return this;
4194})();
4195
4196try {
4197 // This works if eval is allowed (see CSP)
4198 g = g || Function("return this")() || (1,eval)("this");
4199} catch(e) {
4200 // This works if the window reference is available
4201 if(typeof window === "object")
4202 g = window;
4203}
4204
4205// g can still be undefined, but nothing to do about it...
4206// We return undefined, instead of nothing here, so it's
4207// easier to handle this case. if(!global) { ...}
4208
4209module.exports = g;
4210
4211
4212/***/ }),
4213/* 106 */
4214/***/ (function(module, exports) {
4215
4216var $TypeError = TypeError;
4217
4218// `RequireObjectCoercible` abstract operation
4219// https://tc39.es/ecma262/#sec-requireobjectcoercible
4220module.exports = function (it) {
4221 if (it == undefined) throw $TypeError("Can't call method on " + it);
4222 return it;
4223};
4224
4225
4226/***/ }),
4227/* 107 */
4228/***/ (function(module, exports, __webpack_require__) {
4229
4230var aCallable = __webpack_require__(30);
4231
4232// `GetMethod` abstract operation
4233// https://tc39.es/ecma262/#sec-getmethod
4234module.exports = function (V, P) {
4235 var func = V[P];
4236 return func == null ? undefined : aCallable(func);
4237};
4238
4239
4240/***/ }),
4241/* 108 */
4242/***/ (function(module, exports, __webpack_require__) {
4243
4244var global = __webpack_require__(9);
4245var defineGlobalProperty = __webpack_require__(244);
4246
4247var SHARED = '__core-js_shared__';
4248var store = global[SHARED] || defineGlobalProperty(SHARED, {});
4249
4250module.exports = store;
4251
4252
4253/***/ }),
4254/* 109 */
4255/***/ (function(module, exports, __webpack_require__) {
4256
4257var uncurryThis = __webpack_require__(6);
4258
4259var id = 0;
4260var postfix = Math.random();
4261var toString = uncurryThis(1.0.toString);
4262
4263module.exports = function (key) {
4264 return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
4265};
4266
4267
4268/***/ }),
4269/* 110 */
4270/***/ (function(module, exports, __webpack_require__) {
4271
4272var global = __webpack_require__(9);
4273var isObject = __webpack_require__(17);
4274
4275var document = global.document;
4276// typeof document.createElement is 'object' in old IE
4277var EXISTS = isObject(document) && isObject(document.createElement);
4278
4279module.exports = function (it) {
4280 return EXISTS ? document.createElement(it) : {};
4281};
4282
4283
4284/***/ }),
4285/* 111 */
4286/***/ (function(module, exports, __webpack_require__) {
4287
4288var internalObjectKeys = __webpack_require__(145);
4289var enumBugKeys = __webpack_require__(114);
4290
4291var hiddenKeys = enumBugKeys.concat('length', 'prototype');
4292
4293// `Object.getOwnPropertyNames` method
4294// https://tc39.es/ecma262/#sec-object.getownpropertynames
4295// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
4296exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
4297 return internalObjectKeys(O, hiddenKeys);
4298};
4299
4300
4301/***/ }),
4302/* 112 */
4303/***/ (function(module, exports, __webpack_require__) {
4304
4305var toIntegerOrInfinity = __webpack_require__(113);
4306
4307var max = Math.max;
4308var min = Math.min;
4309
4310// Helper for a popular repeating case of the spec:
4311// Let integer be ? ToInteger(index).
4312// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
4313module.exports = function (index, length) {
4314 var integer = toIntegerOrInfinity(index);
4315 return integer < 0 ? max(integer + length, 0) : min(integer, length);
4316};
4317
4318
4319/***/ }),
4320/* 113 */
4321/***/ (function(module, exports, __webpack_require__) {
4322
4323var trunc = __webpack_require__(248);
4324
4325// `ToIntegerOrInfinity` abstract operation
4326// https://tc39.es/ecma262/#sec-tointegerorinfinity
4327module.exports = function (argument) {
4328 var number = +argument;
4329 // eslint-disable-next-line no-self-compare -- NaN check
4330 return number !== number || number === 0 ? 0 : trunc(number);
4331};
4332
4333
4334/***/ }),
4335/* 114 */
4336/***/ (function(module, exports) {
4337
4338// IE8- don't enum bug keys
4339module.exports = [
4340 'constructor',
4341 'hasOwnProperty',
4342 'isPrototypeOf',
4343 'propertyIsEnumerable',
4344 'toLocaleString',
4345 'toString',
4346 'valueOf'
4347];
4348
4349
4350/***/ }),
4351/* 115 */
4352/***/ (function(module, exports) {
4353
4354// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
4355exports.f = Object.getOwnPropertySymbols;
4356
4357
4358/***/ }),
4359/* 116 */
4360/***/ (function(module, exports, __webpack_require__) {
4361
4362var internalObjectKeys = __webpack_require__(145);
4363var enumBugKeys = __webpack_require__(114);
4364
4365// `Object.keys` method
4366// https://tc39.es/ecma262/#sec-object.keys
4367// eslint-disable-next-line es-x/no-object-keys -- safe
4368module.exports = Object.keys || function keys(O) {
4369 return internalObjectKeys(O, enumBugKeys);
4370};
4371
4372
4373/***/ }),
4374/* 117 */
4375/***/ (function(module, exports, __webpack_require__) {
4376
4377var wellKnownSymbol = __webpack_require__(8);
4378
4379var TO_STRING_TAG = wellKnownSymbol('toStringTag');
4380var test = {};
4381
4382test[TO_STRING_TAG] = 'z';
4383
4384module.exports = String(test) === '[object z]';
4385
4386
4387/***/ }),
4388/* 118 */
4389/***/ (function(module, exports, __webpack_require__) {
4390
4391var uncurryThis = __webpack_require__(6);
4392var isCallable = __webpack_require__(7);
4393var store = __webpack_require__(108);
4394
4395var functionToString = uncurryThis(Function.toString);
4396
4397// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
4398if (!isCallable(store.inspectSource)) {
4399 store.inspectSource = function (it) {
4400 return functionToString(it);
4401 };
4402}
4403
4404module.exports = store.inspectSource;
4405
4406
4407/***/ }),
4408/* 119 */
4409/***/ (function(module, exports, __webpack_require__) {
4410
4411var classof = __webpack_require__(65);
4412var global = __webpack_require__(9);
4413
4414module.exports = classof(global.process) == 'process';
4415
4416
4417/***/ }),
4418/* 120 */
4419/***/ (function(module, __webpack_exports__, __webpack_require__) {
4420
4421"use strict";
4422Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
4423/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
4424/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__setup_js__["e"]; });
4425/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__restArguments_js__ = __webpack_require__(22);
4426/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__restArguments_js__["a"]; });
4427/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(45);
4428/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_2__isObject_js__["a"]; });
4429/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isNull_js__ = __webpack_require__(280);
4430/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_3__isNull_js__["a"]; });
4431/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__ = __webpack_require__(162);
4432/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__["a"]; });
4433/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__ = __webpack_require__(163);
4434/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__["a"]; });
4435/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isElement_js__ = __webpack_require__(281);
4436/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_6__isElement_js__["a"]; });
4437/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isString_js__ = __webpack_require__(121);
4438/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_7__isString_js__["a"]; });
4439/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__isNumber_js__ = __webpack_require__(164);
4440/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_8__isNumber_js__["a"]; });
4441/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__isDate_js__ = __webpack_require__(282);
4442/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_9__isDate_js__["a"]; });
4443/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__ = __webpack_require__(283);
4444/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__["a"]; });
4445/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__isError_js__ = __webpack_require__(284);
4446/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_11__isError_js__["a"]; });
4447/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__ = __webpack_require__(165);
4448/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__["a"]; });
4449/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__ = __webpack_require__(166);
4450/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__["a"]; });
4451/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__isDataView_js__ = __webpack_require__(122);
4452/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_14__isDataView_js__["a"]; });
4453/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__isArray_js__ = __webpack_require__(46);
4454/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_15__isArray_js__["a"]; });
4455/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__isFunction_js__ = __webpack_require__(26);
4456/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_16__isFunction_js__["a"]; });
4457/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__isArguments_js__ = __webpack_require__(123);
4458/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_17__isArguments_js__["a"]; });
4459/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__isFinite_js__ = __webpack_require__(286);
4460/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_18__isFinite_js__["a"]; });
4461/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isNaN_js__ = __webpack_require__(167);
4462/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_19__isNaN_js__["a"]; });
4463/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__ = __webpack_require__(168);
4464/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__["a"]; });
4465/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__ = __webpack_require__(288);
4466/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__["a"]; });
4467/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__isMatch_js__ = __webpack_require__(173);
4468/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_22__isMatch_js__["a"]; });
4469/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__isEqual_js__ = __webpack_require__(289);
4470/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_23__isEqual_js__["a"]; });
4471/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__isMap_js__ = __webpack_require__(291);
4472/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_24__isMap_js__["a"]; });
4473/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__ = __webpack_require__(292);
4474/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__["a"]; });
4475/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__isSet_js__ = __webpack_require__(293);
4476/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_26__isSet_js__["a"]; });
4477/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__ = __webpack_require__(294);
4478/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__["a"]; });
4479/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__keys_js__ = __webpack_require__(12);
4480/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_28__keys_js__["a"]; });
4481/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__allKeys_js__ = __webpack_require__(75);
4482/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_29__allKeys_js__["a"]; });
4483/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__values_js__ = __webpack_require__(56);
4484/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_30__values_js__["a"]; });
4485/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__pairs_js__ = __webpack_require__(295);
4486/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_31__pairs_js__["a"]; });
4487/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__invert_js__ = __webpack_require__(174);
4488/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_32__invert_js__["a"]; });
4489/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__functions_js__ = __webpack_require__(175);
4490/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
4491/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
4492/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__extend_js__ = __webpack_require__(176);
4493/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_34__extend_js__["a"]; });
4494/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__ = __webpack_require__(127);
4495/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
4496/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
4497/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__defaults_js__ = __webpack_require__(177);
4498/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_36__defaults_js__["a"]; });
4499/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__create_js__ = __webpack_require__(296);
4500/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_37__create_js__["a"]; });
4501/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__clone_js__ = __webpack_require__(179);
4502/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_38__clone_js__["a"]; });
4503/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__tap_js__ = __webpack_require__(297);
4504/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_39__tap_js__["a"]; });
4505/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__get_js__ = __webpack_require__(180);
4506/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_40__get_js__["a"]; });
4507/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__has_js__ = __webpack_require__(298);
4508/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_41__has_js__["a"]; });
4509/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__mapObject_js__ = __webpack_require__(299);
4510/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_42__mapObject_js__["a"]; });
4511/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__identity_js__ = __webpack_require__(129);
4512/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_43__identity_js__["a"]; });
4513/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__constant_js__ = __webpack_require__(169);
4514/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_44__constant_js__["a"]; });
4515/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__noop_js__ = __webpack_require__(184);
4516/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_45__noop_js__["a"]; });
4517/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__toPath_js__ = __webpack_require__(181);
4518/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_46__toPath_js__["a"]; });
4519/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__property_js__ = __webpack_require__(130);
4520/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_47__property_js__["a"]; });
4521/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__ = __webpack_require__(300);
4522/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__["a"]; });
4523/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__matcher_js__ = __webpack_require__(96);
4524/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
4525/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
4526/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__times_js__ = __webpack_require__(301);
4527/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_50__times_js__["a"]; });
4528/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__random_js__ = __webpack_require__(185);
4529/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_51__random_js__["a"]; });
4530/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__now_js__ = __webpack_require__(131);
4531/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_52__now_js__["a"]; });
4532/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__escape_js__ = __webpack_require__(302);
4533/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_53__escape_js__["a"]; });
4534/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__unescape_js__ = __webpack_require__(303);
4535/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_54__unescape_js__["a"]; });
4536/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__ = __webpack_require__(188);
4537/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__["a"]; });
4538/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__template_js__ = __webpack_require__(305);
4539/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_56__template_js__["a"]; });
4540/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__result_js__ = __webpack_require__(306);
4541/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_57__result_js__["a"]; });
4542/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__ = __webpack_require__(307);
4543/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__["a"]; });
4544/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__chain_js__ = __webpack_require__(308);
4545/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_59__chain_js__["a"]; });
4546/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__iteratee_js__ = __webpack_require__(183);
4547/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_60__iteratee_js__["a"]; });
4548/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__partial_js__ = __webpack_require__(97);
4549/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_61__partial_js__["a"]; });
4550/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__bind_js__ = __webpack_require__(190);
4551/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_62__bind_js__["a"]; });
4552/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__bindAll_js__ = __webpack_require__(309);
4553/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_63__bindAll_js__["a"]; });
4554/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__memoize_js__ = __webpack_require__(310);
4555/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_64__memoize_js__["a"]; });
4556/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__delay_js__ = __webpack_require__(191);
4557/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_65__delay_js__["a"]; });
4558/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__defer_js__ = __webpack_require__(311);
4559/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_66__defer_js__["a"]; });
4560/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__throttle_js__ = __webpack_require__(312);
4561/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_67__throttle_js__["a"]; });
4562/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__debounce_js__ = __webpack_require__(313);
4563/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_68__debounce_js__["a"]; });
4564/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__wrap_js__ = __webpack_require__(314);
4565/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_69__wrap_js__["a"]; });
4566/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__negate_js__ = __webpack_require__(132);
4567/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_70__negate_js__["a"]; });
4568/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__compose_js__ = __webpack_require__(315);
4569/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_71__compose_js__["a"]; });
4570/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__after_js__ = __webpack_require__(316);
4571/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_72__after_js__["a"]; });
4572/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__before_js__ = __webpack_require__(192);
4573/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_73__before_js__["a"]; });
4574/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__once_js__ = __webpack_require__(317);
4575/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_74__once_js__["a"]; });
4576/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__findKey_js__ = __webpack_require__(193);
4577/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_75__findKey_js__["a"]; });
4578/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__findIndex_js__ = __webpack_require__(133);
4579/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_76__findIndex_js__["a"]; });
4580/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__ = __webpack_require__(195);
4581/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__["a"]; });
4582/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__ = __webpack_require__(196);
4583/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__["a"]; });
4584/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__indexOf_js__ = __webpack_require__(197);
4585/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_79__indexOf_js__["a"]; });
4586/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__ = __webpack_require__(318);
4587/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__["a"]; });
4588/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__find_js__ = __webpack_require__(199);
4589/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
4590/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
4591/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__findWhere_js__ = __webpack_require__(319);
4592/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_82__findWhere_js__["a"]; });
4593/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__each_js__ = __webpack_require__(47);
4594/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
4595/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
4596/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__map_js__ = __webpack_require__(58);
4597/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
4598/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
4599/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__reduce_js__ = __webpack_require__(320);
4600/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4601/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4602/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4603/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__ = __webpack_require__(321);
4604/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
4605/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
4606/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__filter_js__ = __webpack_require__(78);
4607/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
4608/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
4609/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__reject_js__ = __webpack_require__(322);
4610/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_88__reject_js__["a"]; });
4611/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__every_js__ = __webpack_require__(323);
4612/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
4613/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
4614/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__some_js__ = __webpack_require__(324);
4615/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
4616/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
4617/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__contains_js__ = __webpack_require__(79);
4618/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4619/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4620/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4621/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__invoke_js__ = __webpack_require__(325);
4622/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_92__invoke_js__["a"]; });
4623/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__pluck_js__ = __webpack_require__(134);
4624/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_93__pluck_js__["a"]; });
4625/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__where_js__ = __webpack_require__(326);
4626/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_94__where_js__["a"]; });
4627/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__max_js__ = __webpack_require__(201);
4628/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_95__max_js__["a"]; });
4629/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__min_js__ = __webpack_require__(327);
4630/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_96__min_js__["a"]; });
4631/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__shuffle_js__ = __webpack_require__(328);
4632/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_97__shuffle_js__["a"]; });
4633/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__sample_js__ = __webpack_require__(202);
4634/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_98__sample_js__["a"]; });
4635/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__sortBy_js__ = __webpack_require__(329);
4636/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_99__sortBy_js__["a"]; });
4637/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__groupBy_js__ = __webpack_require__(330);
4638/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_100__groupBy_js__["a"]; });
4639/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__indexBy_js__ = __webpack_require__(331);
4640/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_101__indexBy_js__["a"]; });
4641/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__countBy_js__ = __webpack_require__(332);
4642/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_102__countBy_js__["a"]; });
4643/* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__partition_js__ = __webpack_require__(333);
4644/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_103__partition_js__["a"]; });
4645/* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__toArray_js__ = __webpack_require__(334);
4646/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_104__toArray_js__["a"]; });
4647/* harmony import */ var __WEBPACK_IMPORTED_MODULE_105__size_js__ = __webpack_require__(335);
4648/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_105__size_js__["a"]; });
4649/* harmony import */ var __WEBPACK_IMPORTED_MODULE_106__pick_js__ = __webpack_require__(203);
4650/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_106__pick_js__["a"]; });
4651/* harmony import */ var __WEBPACK_IMPORTED_MODULE_107__omit_js__ = __webpack_require__(337);
4652/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_107__omit_js__["a"]; });
4653/* harmony import */ var __WEBPACK_IMPORTED_MODULE_108__first_js__ = __webpack_require__(338);
4654/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4655/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4656/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4657/* harmony import */ var __WEBPACK_IMPORTED_MODULE_109__initial_js__ = __webpack_require__(204);
4658/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_109__initial_js__["a"]; });
4659/* harmony import */ var __WEBPACK_IMPORTED_MODULE_110__last_js__ = __webpack_require__(339);
4660/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_110__last_js__["a"]; });
4661/* harmony import */ var __WEBPACK_IMPORTED_MODULE_111__rest_js__ = __webpack_require__(205);
4662/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4663/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4664/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4665/* harmony import */ var __WEBPACK_IMPORTED_MODULE_112__compact_js__ = __webpack_require__(340);
4666/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_112__compact_js__["a"]; });
4667/* harmony import */ var __WEBPACK_IMPORTED_MODULE_113__flatten_js__ = __webpack_require__(341);
4668/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_113__flatten_js__["a"]; });
4669/* harmony import */ var __WEBPACK_IMPORTED_MODULE_114__without_js__ = __webpack_require__(342);
4670/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_114__without_js__["a"]; });
4671/* harmony import */ var __WEBPACK_IMPORTED_MODULE_115__uniq_js__ = __webpack_require__(207);
4672/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
4673/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
4674/* harmony import */ var __WEBPACK_IMPORTED_MODULE_116__union_js__ = __webpack_require__(343);
4675/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_116__union_js__["a"]; });
4676/* harmony import */ var __WEBPACK_IMPORTED_MODULE_117__intersection_js__ = __webpack_require__(344);
4677/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_117__intersection_js__["a"]; });
4678/* harmony import */ var __WEBPACK_IMPORTED_MODULE_118__difference_js__ = __webpack_require__(206);
4679/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_118__difference_js__["a"]; });
4680/* harmony import */ var __WEBPACK_IMPORTED_MODULE_119__unzip_js__ = __webpack_require__(208);
4681/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
4682/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
4683/* harmony import */ var __WEBPACK_IMPORTED_MODULE_120__zip_js__ = __webpack_require__(345);
4684/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_120__zip_js__["a"]; });
4685/* harmony import */ var __WEBPACK_IMPORTED_MODULE_121__object_js__ = __webpack_require__(346);
4686/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_121__object_js__["a"]; });
4687/* harmony import */ var __WEBPACK_IMPORTED_MODULE_122__range_js__ = __webpack_require__(347);
4688/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_122__range_js__["a"]; });
4689/* harmony import */ var __WEBPACK_IMPORTED_MODULE_123__chunk_js__ = __webpack_require__(348);
4690/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_123__chunk_js__["a"]; });
4691/* harmony import */ var __WEBPACK_IMPORTED_MODULE_124__mixin_js__ = __webpack_require__(349);
4692/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_124__mixin_js__["a"]; });
4693/* harmony import */ var __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__ = __webpack_require__(350);
4694/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__["a"]; });
4695// Named Exports
4696// =============
4697
4698// Underscore.js 1.12.1
4699// https://underscorejs.org
4700// (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
4701// Underscore may be freely distributed under the MIT license.
4702
4703// Baseline setup.
4704
4705
4706
4707// Object Functions
4708// ----------------
4709// Our most fundamental functions operate on any JavaScript object.
4710// Most functions in Underscore depend on at least one function in this section.
4711
4712// A group of functions that check the types of core JavaScript values.
4713// These are often informally referred to as the "isType" functions.
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741// Functions that treat an object as a dictionary of key-value pairs.
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758// Utility Functions
4759// -----------------
4760// A bit of a grab bag: Predicate-generating functions for use with filters and
4761// loops, string escaping and templating, create random numbers and unique ids,
4762// and functions that facilitate Underscore's chaining and iteration conventions.
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782// Function (ahem) Functions
4783// -------------------------
4784// These functions take a function as an argument and return a new function
4785// as the result. Also known as higher-order functions.
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801// Finders
4802// -------
4803// Functions that extract (the position of) a single element from an object
4804// or array based on some criterion.
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814// Collection Functions
4815// --------------------
4816// Functions that work on any collection of elements: either an array, or
4817// an object of key-value pairs.
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842// `_.pick` and `_.omit` are actually object functions, but we put
4843// them here in order to create a more natural reading order in the
4844// monolithic build as they depend on `_.contains`.
4845
4846
4847
4848// Array Functions
4849// ---------------
4850// Functions that operate on arrays (and array-likes) only, because they’re
4851// expressed in terms of operations on an ordered list of values.
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869// OOP
4870// ---
4871// These modules support the "object-oriented" calling style. See also
4872// `underscore.js` and `index-default.js`.
4873
4874
4875
4876
4877/***/ }),
4878/* 121 */
4879/***/ (function(module, __webpack_exports__, __webpack_require__) {
4880
4881"use strict";
4882/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
4883
4884
4885/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('String'));
4886
4887
4888/***/ }),
4889/* 122 */
4890/***/ (function(module, __webpack_exports__, __webpack_require__) {
4891
4892"use strict";
4893/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
4894/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
4895/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__ = __webpack_require__(166);
4896/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__ = __webpack_require__(74);
4897
4898
4899
4900
4901
4902var isDataView = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('DataView');
4903
4904// In IE 10 - Edge 13, we need a different heuristic
4905// to determine whether an object is a `DataView`.
4906function ie10IsDataView(obj) {
4907 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);
4908}
4909
4910/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__["a" /* hasStringTagBug */] ? ie10IsDataView : isDataView);
4911
4912
4913/***/ }),
4914/* 123 */
4915/***/ (function(module, __webpack_exports__, __webpack_require__) {
4916
4917"use strict";
4918/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
4919/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(37);
4920
4921
4922
4923var isArguments = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Arguments');
4924
4925// Define a fallback version of the method in browsers (ahem, IE < 9), where
4926// there isn't any inspectable "Arguments" type.
4927(function() {
4928 if (!isArguments(arguments)) {
4929 isArguments = function(obj) {
4930 return Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(obj, 'callee');
4931 };
4932 }
4933}());
4934
4935/* harmony default export */ __webpack_exports__["a"] = (isArguments);
4936
4937
4938/***/ }),
4939/* 124 */
4940/***/ (function(module, __webpack_exports__, __webpack_require__) {
4941
4942"use strict";
4943/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(171);
4944
4945
4946// Internal helper to obtain the `byteLength` property of an object.
4947/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('byteLength'));
4948
4949
4950/***/ }),
4951/* 125 */
4952/***/ (function(module, __webpack_exports__, __webpack_require__) {
4953
4954"use strict";
4955/* harmony export (immutable) */ __webpack_exports__["a"] = ie11fingerprint;
4956/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mapMethods; });
4957/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return weakMapMethods; });
4958/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setMethods; });
4959/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
4960/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
4961/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__allKeys_js__ = __webpack_require__(75);
4962
4963
4964
4965
4966// Since the regular `Object.prototype.toString` type tests don't work for
4967// some types in IE 11, we use a fingerprinting heuristic instead, based
4968// on the methods. It's not great, but it's the best we got.
4969// The fingerprint method lists are defined below.
4970function ie11fingerprint(methods) {
4971 var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(methods);
4972 return function(obj) {
4973 if (obj == null) return false;
4974 // `Map`, `WeakMap` and `Set` have no enumerable keys.
4975 var keys = Object(__WEBPACK_IMPORTED_MODULE_2__allKeys_js__["a" /* default */])(obj);
4976 if (Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(keys)) return false;
4977 for (var i = 0; i < length; i++) {
4978 if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[methods[i]])) return false;
4979 }
4980 // If we are testing against `WeakMap`, we need to ensure that
4981 // `obj` doesn't have a `forEach` method in order to distinguish
4982 // it from a regular `Map`.
4983 return methods !== weakMapMethods || !Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[forEachName]);
4984 };
4985}
4986
4987// In the interest of compact minification, we write
4988// each string in the fingerprints only once.
4989var forEachName = 'forEach',
4990 hasName = 'has',
4991 commonInit = ['clear', 'delete'],
4992 mapTail = ['get', hasName, 'set'];
4993
4994// `Map`, `WeakMap` and `Set` each have slightly different
4995// combinations of the above sublists.
4996var mapMethods = commonInit.concat(forEachName, mapTail),
4997 weakMapMethods = commonInit.concat(mapTail),
4998 setMethods = ['add'].concat(commonInit, forEachName, hasName);
4999
5000
5001/***/ }),
5002/* 126 */
5003/***/ (function(module, __webpack_exports__, __webpack_require__) {
5004
5005"use strict";
5006/* harmony export (immutable) */ __webpack_exports__["a"] = createAssigner;
5007// An internal function for creating assigner functions.
5008function createAssigner(keysFunc, defaults) {
5009 return function(obj) {
5010 var length = arguments.length;
5011 if (defaults) obj = Object(obj);
5012 if (length < 2 || obj == null) return obj;
5013 for (var index = 1; index < length; index++) {
5014 var source = arguments[index],
5015 keys = keysFunc(source),
5016 l = keys.length;
5017 for (var i = 0; i < l; i++) {
5018 var key = keys[i];
5019 if (!defaults || obj[key] === void 0) obj[key] = source[key];
5020 }
5021 }
5022 return obj;
5023 };
5024}
5025
5026
5027/***/ }),
5028/* 127 */
5029/***/ (function(module, __webpack_exports__, __webpack_require__) {
5030
5031"use strict";
5032/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(126);
5033/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(12);
5034
5035
5036
5037// Assigns a given object with all the own properties in the passed-in
5038// object(s).
5039// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
5040/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */]));
5041
5042
5043/***/ }),
5044/* 128 */
5045/***/ (function(module, __webpack_exports__, __webpack_require__) {
5046
5047"use strict";
5048/* harmony export (immutable) */ __webpack_exports__["a"] = deepGet;
5049// Internal function to obtain a nested property in `obj` along `path`.
5050function deepGet(obj, path) {
5051 var length = path.length;
5052 for (var i = 0; i < length; i++) {
5053 if (obj == null) return void 0;
5054 obj = obj[path[i]];
5055 }
5056 return length ? obj : void 0;
5057}
5058
5059
5060/***/ }),
5061/* 129 */
5062/***/ (function(module, __webpack_exports__, __webpack_require__) {
5063
5064"use strict";
5065/* harmony export (immutable) */ __webpack_exports__["a"] = identity;
5066// Keep the identity function around for default iteratees.
5067function identity(value) {
5068 return value;
5069}
5070
5071
5072/***/ }),
5073/* 130 */
5074/***/ (function(module, __webpack_exports__, __webpack_require__) {
5075
5076"use strict";
5077/* harmony export (immutable) */ __webpack_exports__["a"] = property;
5078/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__deepGet_js__ = __webpack_require__(128);
5079/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(76);
5080
5081
5082
5083// Creates a function that, when passed an object, will traverse that object’s
5084// properties down the given `path`, specified as an array of keys or indices.
5085function property(path) {
5086 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
5087 return function(obj) {
5088 return Object(__WEBPACK_IMPORTED_MODULE_0__deepGet_js__["a" /* default */])(obj, path);
5089 };
5090}
5091
5092
5093/***/ }),
5094/* 131 */
5095/***/ (function(module, __webpack_exports__, __webpack_require__) {
5096
5097"use strict";
5098// A (possibly faster) way to get the current timestamp as an integer.
5099/* harmony default export */ __webpack_exports__["a"] = (Date.now || function() {
5100 return new Date().getTime();
5101});
5102
5103
5104/***/ }),
5105/* 132 */
5106/***/ (function(module, __webpack_exports__, __webpack_require__) {
5107
5108"use strict";
5109/* harmony export (immutable) */ __webpack_exports__["a"] = negate;
5110// Returns a negated version of the passed-in predicate.
5111function negate(predicate) {
5112 return function() {
5113 return !predicate.apply(this, arguments);
5114 };
5115}
5116
5117
5118/***/ }),
5119/* 133 */
5120/***/ (function(module, __webpack_exports__, __webpack_require__) {
5121
5122"use strict";
5123/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(194);
5124
5125
5126// Returns the first index on an array-like that passes a truth test.
5127/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(1));
5128
5129
5130/***/ }),
5131/* 134 */
5132/***/ (function(module, __webpack_exports__, __webpack_require__) {
5133
5134"use strict";
5135/* harmony export (immutable) */ __webpack_exports__["a"] = pluck;
5136/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__map_js__ = __webpack_require__(58);
5137/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__property_js__ = __webpack_require__(130);
5138
5139
5140
5141// Convenience version of a common use case of `_.map`: fetching a property.
5142function pluck(obj, key) {
5143 return Object(__WEBPACK_IMPORTED_MODULE_0__map_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__property_js__["a" /* default */])(key));
5144}
5145
5146
5147/***/ }),
5148/* 135 */
5149/***/ (function(module, exports, __webpack_require__) {
5150
5151var _Symbol = __webpack_require__(225);
5152
5153var _Symbol$iterator = __webpack_require__(424);
5154
5155function _typeof(obj) {
5156 "@babel/helpers - typeof";
5157
5158 return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (obj) {
5159 return typeof obj;
5160 } : function (obj) {
5161 return obj && "function" == typeof _Symbol && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
5162 }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
5163}
5164
5165module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
5166
5167/***/ }),
5168/* 136 */
5169/***/ (function(module, exports, __webpack_require__) {
5170
5171var wellKnownSymbol = __webpack_require__(8);
5172
5173exports.f = wellKnownSymbol;
5174
5175
5176/***/ }),
5177/* 137 */
5178/***/ (function(module, exports, __webpack_require__) {
5179
5180module.exports = __webpack_require__(471);
5181
5182/***/ }),
5183/* 138 */
5184/***/ (function(module, exports, __webpack_require__) {
5185
5186"use strict";
5187
5188var $propertyIsEnumerable = {}.propertyIsEnumerable;
5189// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
5190var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
5191
5192// Nashorn ~ JDK8 bug
5193var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
5194
5195// `Object.prototype.propertyIsEnumerable` method implementation
5196// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
5197exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
5198 var descriptor = getOwnPropertyDescriptor(this, V);
5199 return !!descriptor && descriptor.enumerable;
5200} : $propertyIsEnumerable;
5201
5202
5203/***/ }),
5204/* 139 */
5205/***/ (function(module, exports, __webpack_require__) {
5206
5207var uncurryThis = __webpack_require__(6);
5208var fails = __webpack_require__(4);
5209var classof = __webpack_require__(65);
5210
5211var $Object = Object;
5212var split = uncurryThis(''.split);
5213
5214// fallback for non-array-like ES3 and non-enumerable old V8 strings
5215module.exports = fails(function () {
5216 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
5217 // eslint-disable-next-line no-prototype-builtins -- safe
5218 return !$Object('z').propertyIsEnumerable(0);
5219}) ? function (it) {
5220 return classof(it) == 'String' ? split(it, '') : $Object(it);
5221} : $Object;
5222
5223
5224/***/ }),
5225/* 140 */
5226/***/ (function(module, exports, __webpack_require__) {
5227
5228/* eslint-disable es-x/no-symbol -- required for testing */
5229var NATIVE_SYMBOL = __webpack_require__(49);
5230
5231module.exports = NATIVE_SYMBOL
5232 && !Symbol.sham
5233 && typeof Symbol.iterator == 'symbol';
5234
5235
5236/***/ }),
5237/* 141 */
5238/***/ (function(module, exports, __webpack_require__) {
5239
5240var DESCRIPTORS = __webpack_require__(19);
5241var fails = __webpack_require__(4);
5242var createElement = __webpack_require__(110);
5243
5244// Thanks to IE8 for its funny defineProperty
5245module.exports = !DESCRIPTORS && !fails(function () {
5246 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
5247 return Object.defineProperty(createElement('div'), 'a', {
5248 get: function () { return 7; }
5249 }).a != 7;
5250});
5251
5252
5253/***/ }),
5254/* 142 */
5255/***/ (function(module, exports, __webpack_require__) {
5256
5257var fails = __webpack_require__(4);
5258var isCallable = __webpack_require__(7);
5259
5260var replacement = /#|\.prototype\./;
5261
5262var isForced = function (feature, detection) {
5263 var value = data[normalize(feature)];
5264 return value == POLYFILL ? true
5265 : value == NATIVE ? false
5266 : isCallable(detection) ? fails(detection)
5267 : !!detection;
5268};
5269
5270var normalize = isForced.normalize = function (string) {
5271 return String(string).replace(replacement, '.').toLowerCase();
5272};
5273
5274var data = isForced.data = {};
5275var NATIVE = isForced.NATIVE = 'N';
5276var POLYFILL = isForced.POLYFILL = 'P';
5277
5278module.exports = isForced;
5279
5280
5281/***/ }),
5282/* 143 */
5283/***/ (function(module, exports, __webpack_require__) {
5284
5285var DESCRIPTORS = __webpack_require__(19);
5286var fails = __webpack_require__(4);
5287
5288// V8 ~ Chrome 36-
5289// https://bugs.chromium.org/p/v8/issues/detail?id=3334
5290module.exports = DESCRIPTORS && fails(function () {
5291 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
5292 return Object.defineProperty(function () { /* empty */ }, 'prototype', {
5293 value: 42,
5294 writable: false
5295 }).prototype != 42;
5296});
5297
5298
5299/***/ }),
5300/* 144 */
5301/***/ (function(module, exports, __webpack_require__) {
5302
5303var fails = __webpack_require__(4);
5304
5305module.exports = !fails(function () {
5306 function F() { /* empty */ }
5307 F.prototype.constructor = null;
5308 // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
5309 return Object.getPrototypeOf(new F()) !== F.prototype;
5310});
5311
5312
5313/***/ }),
5314/* 145 */
5315/***/ (function(module, exports, __webpack_require__) {
5316
5317var uncurryThis = __webpack_require__(6);
5318var hasOwn = __webpack_require__(14);
5319var toIndexedObject = __webpack_require__(33);
5320var indexOf = __webpack_require__(146).indexOf;
5321var hiddenKeys = __webpack_require__(89);
5322
5323var push = uncurryThis([].push);
5324
5325module.exports = function (object, names) {
5326 var O = toIndexedObject(object);
5327 var i = 0;
5328 var result = [];
5329 var key;
5330 for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
5331 // Don't enum bug & hidden keys
5332 while (names.length > i) if (hasOwn(O, key = names[i++])) {
5333 ~indexOf(result, key) || push(result, key);
5334 }
5335 return result;
5336};
5337
5338
5339/***/ }),
5340/* 146 */
5341/***/ (function(module, exports, __webpack_require__) {
5342
5343var toIndexedObject = __webpack_require__(33);
5344var toAbsoluteIndex = __webpack_require__(112);
5345var lengthOfArrayLike = __webpack_require__(42);
5346
5347// `Array.prototype.{ indexOf, includes }` methods implementation
5348var createMethod = function (IS_INCLUDES) {
5349 return function ($this, el, fromIndex) {
5350 var O = toIndexedObject($this);
5351 var length = lengthOfArrayLike(O);
5352 var index = toAbsoluteIndex(fromIndex, length);
5353 var value;
5354 // Array#includes uses SameValueZero equality algorithm
5355 // eslint-disable-next-line no-self-compare -- NaN check
5356 if (IS_INCLUDES && el != el) while (length > index) {
5357 value = O[index++];
5358 // eslint-disable-next-line no-self-compare -- NaN check
5359 if (value != value) return true;
5360 // Array#indexOf ignores holes, Array#includes - not
5361 } else for (;length > index; index++) {
5362 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
5363 } return !IS_INCLUDES && -1;
5364 };
5365};
5366
5367module.exports = {
5368 // `Array.prototype.includes` method
5369 // https://tc39.es/ecma262/#sec-array.prototype.includes
5370 includes: createMethod(true),
5371 // `Array.prototype.indexOf` method
5372 // https://tc39.es/ecma262/#sec-array.prototype.indexof
5373 indexOf: createMethod(false)
5374};
5375
5376
5377/***/ }),
5378/* 147 */
5379/***/ (function(module, exports, __webpack_require__) {
5380
5381var DESCRIPTORS = __webpack_require__(19);
5382var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(143);
5383var definePropertyModule = __webpack_require__(32);
5384var anObject = __webpack_require__(21);
5385var toIndexedObject = __webpack_require__(33);
5386var objectKeys = __webpack_require__(116);
5387
5388// `Object.defineProperties` method
5389// https://tc39.es/ecma262/#sec-object.defineproperties
5390// eslint-disable-next-line es-x/no-object-defineproperties -- safe
5391exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
5392 anObject(O);
5393 var props = toIndexedObject(Properties);
5394 var keys = objectKeys(Properties);
5395 var length = keys.length;
5396 var index = 0;
5397 var key;
5398 while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
5399 return O;
5400};
5401
5402
5403/***/ }),
5404/* 148 */
5405/***/ (function(module, exports, __webpack_require__) {
5406
5407var getBuiltIn = __webpack_require__(16);
5408
5409module.exports = getBuiltIn('document', 'documentElement');
5410
5411
5412/***/ }),
5413/* 149 */
5414/***/ (function(module, exports, __webpack_require__) {
5415
5416var wellKnownSymbol = __webpack_require__(8);
5417var Iterators = __webpack_require__(52);
5418
5419var ITERATOR = wellKnownSymbol('iterator');
5420var ArrayPrototype = Array.prototype;
5421
5422// check on default Array iterator
5423module.exports = function (it) {
5424 return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
5425};
5426
5427
5428/***/ }),
5429/* 150 */
5430/***/ (function(module, exports, __webpack_require__) {
5431
5432var call = __webpack_require__(11);
5433var aCallable = __webpack_require__(30);
5434var anObject = __webpack_require__(21);
5435var tryToString = __webpack_require__(66);
5436var getIteratorMethod = __webpack_require__(90);
5437
5438var $TypeError = TypeError;
5439
5440module.exports = function (argument, usingIterator) {
5441 var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
5442 if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
5443 throw $TypeError(tryToString(argument) + ' is not iterable');
5444};
5445
5446
5447/***/ }),
5448/* 151 */
5449/***/ (function(module, exports, __webpack_require__) {
5450
5451var call = __webpack_require__(11);
5452var anObject = __webpack_require__(21);
5453var getMethod = __webpack_require__(107);
5454
5455module.exports = function (iterator, kind, value) {
5456 var innerResult, innerError;
5457 anObject(iterator);
5458 try {
5459 innerResult = getMethod(iterator, 'return');
5460 if (!innerResult) {
5461 if (kind === 'throw') throw value;
5462 return value;
5463 }
5464 innerResult = call(innerResult, iterator);
5465 } catch (error) {
5466 innerError = true;
5467 innerResult = error;
5468 }
5469 if (kind === 'throw') throw value;
5470 if (innerError) throw innerResult;
5471 anObject(innerResult);
5472 return value;
5473};
5474
5475
5476/***/ }),
5477/* 152 */
5478/***/ (function(module, exports) {
5479
5480module.exports = function () { /* empty */ };
5481
5482
5483/***/ }),
5484/* 153 */
5485/***/ (function(module, exports, __webpack_require__) {
5486
5487"use strict";
5488
5489var $ = __webpack_require__(0);
5490var call = __webpack_require__(11);
5491var IS_PURE = __webpack_require__(31);
5492var FunctionName = __webpack_require__(255);
5493var isCallable = __webpack_require__(7);
5494var createIteratorConstructor = __webpack_require__(256);
5495var getPrototypeOf = __webpack_require__(86);
5496var setPrototypeOf = __webpack_require__(88);
5497var setToStringTag = __webpack_require__(54);
5498var createNonEnumerableProperty = __webpack_require__(36);
5499var defineBuiltIn = __webpack_require__(43);
5500var wellKnownSymbol = __webpack_require__(8);
5501var Iterators = __webpack_require__(52);
5502var IteratorsCore = __webpack_require__(154);
5503
5504var PROPER_FUNCTION_NAME = FunctionName.PROPER;
5505var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
5506var IteratorPrototype = IteratorsCore.IteratorPrototype;
5507var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
5508var ITERATOR = wellKnownSymbol('iterator');
5509var KEYS = 'keys';
5510var VALUES = 'values';
5511var ENTRIES = 'entries';
5512
5513var returnThis = function () { return this; };
5514
5515module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
5516 createIteratorConstructor(IteratorConstructor, NAME, next);
5517
5518 var getIterationMethod = function (KIND) {
5519 if (KIND === DEFAULT && defaultIterator) return defaultIterator;
5520 if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
5521 switch (KIND) {
5522 case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
5523 case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
5524 case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
5525 } return function () { return new IteratorConstructor(this); };
5526 };
5527
5528 var TO_STRING_TAG = NAME + ' Iterator';
5529 var INCORRECT_VALUES_NAME = false;
5530 var IterablePrototype = Iterable.prototype;
5531 var nativeIterator = IterablePrototype[ITERATOR]
5532 || IterablePrototype['@@iterator']
5533 || DEFAULT && IterablePrototype[DEFAULT];
5534 var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
5535 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
5536 var CurrentIteratorPrototype, methods, KEY;
5537
5538 // fix native
5539 if (anyNativeIterator) {
5540 CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
5541 if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
5542 if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
5543 if (setPrototypeOf) {
5544 setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
5545 } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
5546 defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
5547 }
5548 }
5549 // Set @@toStringTag to native iterators
5550 setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
5551 if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
5552 }
5553 }
5554
5555 // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
5556 if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
5557 if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
5558 createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
5559 } else {
5560 INCORRECT_VALUES_NAME = true;
5561 defaultIterator = function values() { return call(nativeIterator, this); };
5562 }
5563 }
5564
5565 // export additional methods
5566 if (DEFAULT) {
5567 methods = {
5568 values: getIterationMethod(VALUES),
5569 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
5570 entries: getIterationMethod(ENTRIES)
5571 };
5572 if (FORCED) for (KEY in methods) {
5573 if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
5574 defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
5575 }
5576 } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
5577 }
5578
5579 // define iterator
5580 if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
5581 defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
5582 }
5583 Iterators[NAME] = defaultIterator;
5584
5585 return methods;
5586};
5587
5588
5589/***/ }),
5590/* 154 */
5591/***/ (function(module, exports, __webpack_require__) {
5592
5593"use strict";
5594
5595var fails = __webpack_require__(4);
5596var isCallable = __webpack_require__(7);
5597var create = __webpack_require__(51);
5598var getPrototypeOf = __webpack_require__(86);
5599var defineBuiltIn = __webpack_require__(43);
5600var wellKnownSymbol = __webpack_require__(8);
5601var IS_PURE = __webpack_require__(31);
5602
5603var ITERATOR = wellKnownSymbol('iterator');
5604var BUGGY_SAFARI_ITERATORS = false;
5605
5606// `%IteratorPrototype%` object
5607// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
5608var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
5609
5610/* eslint-disable es-x/no-array-prototype-keys -- safe */
5611if ([].keys) {
5612 arrayIterator = [].keys();
5613 // Safari 8 has buggy iterators w/o `next`
5614 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
5615 else {
5616 PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
5617 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
5618 }
5619}
5620
5621var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
5622 var test = {};
5623 // FF44- legacy iterators case
5624 return IteratorPrototype[ITERATOR].call(test) !== test;
5625});
5626
5627if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
5628else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
5629
5630// `%IteratorPrototype%[@@iterator]()` method
5631// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
5632if (!isCallable(IteratorPrototype[ITERATOR])) {
5633 defineBuiltIn(IteratorPrototype, ITERATOR, function () {
5634 return this;
5635 });
5636}
5637
5638module.exports = {
5639 IteratorPrototype: IteratorPrototype,
5640 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
5641};
5642
5643
5644/***/ }),
5645/* 155 */
5646/***/ (function(module, exports, __webpack_require__) {
5647
5648var anObject = __webpack_require__(21);
5649var aConstructor = __webpack_require__(156);
5650var wellKnownSymbol = __webpack_require__(8);
5651
5652var SPECIES = wellKnownSymbol('species');
5653
5654// `SpeciesConstructor` abstract operation
5655// https://tc39.es/ecma262/#sec-speciesconstructor
5656module.exports = function (O, defaultConstructor) {
5657 var C = anObject(O).constructor;
5658 var S;
5659 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
5660};
5661
5662
5663/***/ }),
5664/* 156 */
5665/***/ (function(module, exports, __webpack_require__) {
5666
5667var isConstructor = __webpack_require__(93);
5668var tryToString = __webpack_require__(66);
5669
5670var $TypeError = TypeError;
5671
5672// `Assert: IsConstructor(argument) is true`
5673module.exports = function (argument) {
5674 if (isConstructor(argument)) return argument;
5675 throw $TypeError(tryToString(argument) + ' is not a constructor');
5676};
5677
5678
5679/***/ }),
5680/* 157 */
5681/***/ (function(module, exports, __webpack_require__) {
5682
5683var global = __webpack_require__(9);
5684var apply = __webpack_require__(62);
5685var bind = __webpack_require__(50);
5686var isCallable = __webpack_require__(7);
5687var hasOwn = __webpack_require__(14);
5688var fails = __webpack_require__(4);
5689var html = __webpack_require__(148);
5690var arraySlice = __webpack_require__(94);
5691var createElement = __webpack_require__(110);
5692var validateArgumentsLength = __webpack_require__(262);
5693var IS_IOS = __webpack_require__(158);
5694var IS_NODE = __webpack_require__(119);
5695
5696var set = global.setImmediate;
5697var clear = global.clearImmediate;
5698var process = global.process;
5699var Dispatch = global.Dispatch;
5700var Function = global.Function;
5701var MessageChannel = global.MessageChannel;
5702var String = global.String;
5703var counter = 0;
5704var queue = {};
5705var ONREADYSTATECHANGE = 'onreadystatechange';
5706var location, defer, channel, port;
5707
5708try {
5709 // Deno throws a ReferenceError on `location` access without `--location` flag
5710 location = global.location;
5711} catch (error) { /* empty */ }
5712
5713var run = function (id) {
5714 if (hasOwn(queue, id)) {
5715 var fn = queue[id];
5716 delete queue[id];
5717 fn();
5718 }
5719};
5720
5721var runner = function (id) {
5722 return function () {
5723 run(id);
5724 };
5725};
5726
5727var listener = function (event) {
5728 run(event.data);
5729};
5730
5731var post = function (id) {
5732 // old engines have not location.origin
5733 global.postMessage(String(id), location.protocol + '//' + location.host);
5734};
5735
5736// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
5737if (!set || !clear) {
5738 set = function setImmediate(handler) {
5739 validateArgumentsLength(arguments.length, 1);
5740 var fn = isCallable(handler) ? handler : Function(handler);
5741 var args = arraySlice(arguments, 1);
5742 queue[++counter] = function () {
5743 apply(fn, undefined, args);
5744 };
5745 defer(counter);
5746 return counter;
5747 };
5748 clear = function clearImmediate(id) {
5749 delete queue[id];
5750 };
5751 // Node.js 0.8-
5752 if (IS_NODE) {
5753 defer = function (id) {
5754 process.nextTick(runner(id));
5755 };
5756 // Sphere (JS game engine) Dispatch API
5757 } else if (Dispatch && Dispatch.now) {
5758 defer = function (id) {
5759 Dispatch.now(runner(id));
5760 };
5761 // Browsers with MessageChannel, includes WebWorkers
5762 // except iOS - https://github.com/zloirock/core-js/issues/624
5763 } else if (MessageChannel && !IS_IOS) {
5764 channel = new MessageChannel();
5765 port = channel.port2;
5766 channel.port1.onmessage = listener;
5767 defer = bind(port.postMessage, port);
5768 // Browsers with postMessage, skip WebWorkers
5769 // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
5770 } else if (
5771 global.addEventListener &&
5772 isCallable(global.postMessage) &&
5773 !global.importScripts &&
5774 location && location.protocol !== 'file:' &&
5775 !fails(post)
5776 ) {
5777 defer = post;
5778 global.addEventListener('message', listener, false);
5779 // IE8-
5780 } else if (ONREADYSTATECHANGE in createElement('script')) {
5781 defer = function (id) {
5782 html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
5783 html.removeChild(this);
5784 run(id);
5785 };
5786 };
5787 // Rest old browsers
5788 } else {
5789 defer = function (id) {
5790 setTimeout(runner(id), 0);
5791 };
5792 }
5793}
5794
5795module.exports = {
5796 set: set,
5797 clear: clear
5798};
5799
5800
5801/***/ }),
5802/* 158 */
5803/***/ (function(module, exports, __webpack_require__) {
5804
5805var userAgent = __webpack_require__(85);
5806
5807module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
5808
5809
5810/***/ }),
5811/* 159 */
5812/***/ (function(module, exports, __webpack_require__) {
5813
5814var NativePromiseConstructor = __webpack_require__(55);
5815var checkCorrectnessOfIteration = __webpack_require__(160);
5816var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(72).CONSTRUCTOR;
5817
5818module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
5819 NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });
5820});
5821
5822
5823/***/ }),
5824/* 160 */
5825/***/ (function(module, exports, __webpack_require__) {
5826
5827var wellKnownSymbol = __webpack_require__(8);
5828
5829var ITERATOR = wellKnownSymbol('iterator');
5830var SAFE_CLOSING = false;
5831
5832try {
5833 var called = 0;
5834 var iteratorWithReturn = {
5835 next: function () {
5836 return { done: !!called++ };
5837 },
5838 'return': function () {
5839 SAFE_CLOSING = true;
5840 }
5841 };
5842 iteratorWithReturn[ITERATOR] = function () {
5843 return this;
5844 };
5845 // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
5846 Array.from(iteratorWithReturn, function () { throw 2; });
5847} catch (error) { /* empty */ }
5848
5849module.exports = function (exec, SKIP_CLOSING) {
5850 if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
5851 var ITERATION_SUPPORT = false;
5852 try {
5853 var object = {};
5854 object[ITERATOR] = function () {
5855 return {
5856 next: function () {
5857 return { done: ITERATION_SUPPORT = true };
5858 }
5859 };
5860 };
5861 exec(object);
5862 } catch (error) { /* empty */ }
5863 return ITERATION_SUPPORT;
5864};
5865
5866
5867/***/ }),
5868/* 161 */
5869/***/ (function(module, exports, __webpack_require__) {
5870
5871var anObject = __webpack_require__(21);
5872var isObject = __webpack_require__(17);
5873var newPromiseCapability = __webpack_require__(44);
5874
5875module.exports = function (C, x) {
5876 anObject(C);
5877 if (isObject(x) && x.constructor === C) return x;
5878 var promiseCapability = newPromiseCapability.f(C);
5879 var resolve = promiseCapability.resolve;
5880 resolve(x);
5881 return promiseCapability.promise;
5882};
5883
5884
5885/***/ }),
5886/* 162 */
5887/***/ (function(module, __webpack_exports__, __webpack_require__) {
5888
5889"use strict";
5890/* harmony export (immutable) */ __webpack_exports__["a"] = isUndefined;
5891// Is a given variable undefined?
5892function isUndefined(obj) {
5893 return obj === void 0;
5894}
5895
5896
5897/***/ }),
5898/* 163 */
5899/***/ (function(module, __webpack_exports__, __webpack_require__) {
5900
5901"use strict";
5902/* harmony export (immutable) */ __webpack_exports__["a"] = isBoolean;
5903/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
5904
5905
5906// Is a given value a boolean?
5907function isBoolean(obj) {
5908 return obj === true || obj === false || __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === '[object Boolean]';
5909}
5910
5911
5912/***/ }),
5913/* 164 */
5914/***/ (function(module, __webpack_exports__, __webpack_require__) {
5915
5916"use strict";
5917/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
5918
5919
5920/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Number'));
5921
5922
5923/***/ }),
5924/* 165 */
5925/***/ (function(module, __webpack_exports__, __webpack_require__) {
5926
5927"use strict";
5928/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
5929
5930
5931/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Symbol'));
5932
5933
5934/***/ }),
5935/* 166 */
5936/***/ (function(module, __webpack_exports__, __webpack_require__) {
5937
5938"use strict";
5939/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
5940
5941
5942/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('ArrayBuffer'));
5943
5944
5945/***/ }),
5946/* 167 */
5947/***/ (function(module, __webpack_exports__, __webpack_require__) {
5948
5949"use strict";
5950/* harmony export (immutable) */ __webpack_exports__["a"] = isNaN;
5951/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
5952/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isNumber_js__ = __webpack_require__(164);
5953
5954
5955
5956// Is the given value `NaN`?
5957function isNaN(obj) {
5958 return Object(__WEBPACK_IMPORTED_MODULE_1__isNumber_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["g" /* _isNaN */])(obj);
5959}
5960
5961
5962/***/ }),
5963/* 168 */
5964/***/ (function(module, __webpack_exports__, __webpack_require__) {
5965
5966"use strict";
5967/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
5968/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isDataView_js__ = __webpack_require__(122);
5969/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constant_js__ = __webpack_require__(169);
5970/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__ = __webpack_require__(287);
5971
5972
5973
5974
5975
5976// Is a given value a typed array?
5977var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
5978function isTypedArray(obj) {
5979 // `ArrayBuffer.isView` is the most future-proof, so use it when available.
5980 // Otherwise, fall back on the above regular expression.
5981 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)) :
5982 Object(__WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__["a" /* default */])(obj) && typedArrayPattern.test(__WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj));
5983}
5984
5985/* 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));
5986
5987
5988/***/ }),
5989/* 169 */
5990/***/ (function(module, __webpack_exports__, __webpack_require__) {
5991
5992"use strict";
5993/* harmony export (immutable) */ __webpack_exports__["a"] = constant;
5994// Predicate-generating function. Often useful outside of Underscore.
5995function constant(value) {
5996 return function() {
5997 return value;
5998 };
5999}
6000
6001
6002/***/ }),
6003/* 170 */
6004/***/ (function(module, __webpack_exports__, __webpack_require__) {
6005
6006"use strict";
6007/* harmony export (immutable) */ __webpack_exports__["a"] = createSizePropertyCheck;
6008/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
6009
6010
6011// Common internal logic for `isArrayLike` and `isBufferLike`.
6012function createSizePropertyCheck(getSizeProperty) {
6013 return function(collection) {
6014 var sizeProperty = getSizeProperty(collection);
6015 return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= __WEBPACK_IMPORTED_MODULE_0__setup_js__["b" /* MAX_ARRAY_INDEX */];
6016 }
6017}
6018
6019
6020/***/ }),
6021/* 171 */
6022/***/ (function(module, __webpack_exports__, __webpack_require__) {
6023
6024"use strict";
6025/* harmony export (immutable) */ __webpack_exports__["a"] = shallowProperty;
6026// Internal helper to generate a function to obtain property `key` from `obj`.
6027function shallowProperty(key) {
6028 return function(obj) {
6029 return obj == null ? void 0 : obj[key];
6030 };
6031}
6032
6033
6034/***/ }),
6035/* 172 */
6036/***/ (function(module, __webpack_exports__, __webpack_require__) {
6037
6038"use strict";
6039/* harmony export (immutable) */ __webpack_exports__["a"] = collectNonEnumProps;
6040/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
6041/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
6042/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(37);
6043
6044
6045
6046
6047// Internal helper to create a simple lookup structure.
6048// `collectNonEnumProps` used to depend on `_.contains`, but this led to
6049// circular imports. `emulatedSet` is a one-off solution that only works for
6050// arrays of strings.
6051function emulatedSet(keys) {
6052 var hash = {};
6053 for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
6054 return {
6055 contains: function(key) { return hash[key]; },
6056 push: function(key) {
6057 hash[key] = true;
6058 return keys.push(key);
6059 }
6060 };
6061}
6062
6063// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
6064// be iterated by `for key in ...` and thus missed. Extends `keys` in place if
6065// needed.
6066function collectNonEnumProps(obj, keys) {
6067 keys = emulatedSet(keys);
6068 var nonEnumIdx = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */].length;
6069 var constructor = obj.constructor;
6070 var proto = Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(constructor) && constructor.prototype || __WEBPACK_IMPORTED_MODULE_0__setup_js__["c" /* ObjProto */];
6071
6072 // Constructor is a special case.
6073 var prop = 'constructor';
6074 if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, prop) && !keys.contains(prop)) keys.push(prop);
6075
6076 while (nonEnumIdx--) {
6077 prop = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */][nonEnumIdx];
6078 if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
6079 keys.push(prop);
6080 }
6081 }
6082}
6083
6084
6085/***/ }),
6086/* 173 */
6087/***/ (function(module, __webpack_exports__, __webpack_require__) {
6088
6089"use strict";
6090/* harmony export (immutable) */ __webpack_exports__["a"] = isMatch;
6091/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(12);
6092
6093
6094// Returns whether an object has a given set of `key:value` pairs.
6095function isMatch(object, attrs) {
6096 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(attrs), length = _keys.length;
6097 if (object == null) return !length;
6098 var obj = Object(object);
6099 for (var i = 0; i < length; i++) {
6100 var key = _keys[i];
6101 if (attrs[key] !== obj[key] || !(key in obj)) return false;
6102 }
6103 return true;
6104}
6105
6106
6107/***/ }),
6108/* 174 */
6109/***/ (function(module, __webpack_exports__, __webpack_require__) {
6110
6111"use strict";
6112/* harmony export (immutable) */ __webpack_exports__["a"] = invert;
6113/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(12);
6114
6115
6116// Invert the keys and values of an object. The values must be serializable.
6117function invert(obj) {
6118 var result = {};
6119 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
6120 for (var i = 0, length = _keys.length; i < length; i++) {
6121 result[obj[_keys[i]]] = _keys[i];
6122 }
6123 return result;
6124}
6125
6126
6127/***/ }),
6128/* 175 */
6129/***/ (function(module, __webpack_exports__, __webpack_require__) {
6130
6131"use strict";
6132/* harmony export (immutable) */ __webpack_exports__["a"] = functions;
6133/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(26);
6134
6135
6136// Return a sorted list of the function names available on the object.
6137function functions(obj) {
6138 var names = [];
6139 for (var key in obj) {
6140 if (Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(obj[key])) names.push(key);
6141 }
6142 return names.sort();
6143}
6144
6145
6146/***/ }),
6147/* 176 */
6148/***/ (function(module, __webpack_exports__, __webpack_require__) {
6149
6150"use strict";
6151/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(126);
6152/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(75);
6153
6154
6155
6156// Extend a given object with all the properties in passed-in object(s).
6157/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */]));
6158
6159
6160/***/ }),
6161/* 177 */
6162/***/ (function(module, __webpack_exports__, __webpack_require__) {
6163
6164"use strict";
6165/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(126);
6166/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(75);
6167
6168
6169
6170// Fill in a given object with default properties.
6171/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */], true));
6172
6173
6174/***/ }),
6175/* 178 */
6176/***/ (function(module, __webpack_exports__, __webpack_require__) {
6177
6178"use strict";
6179/* harmony export (immutable) */ __webpack_exports__["a"] = baseCreate;
6180/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(45);
6181/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
6182
6183
6184
6185// Create a naked function reference for surrogate-prototype-swapping.
6186function ctor() {
6187 return function(){};
6188}
6189
6190// An internal function for creating a new object that inherits from another.
6191function baseCreate(prototype) {
6192 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(prototype)) return {};
6193 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */])(prototype);
6194 var Ctor = ctor();
6195 Ctor.prototype = prototype;
6196 var result = new Ctor;
6197 Ctor.prototype = null;
6198 return result;
6199}
6200
6201
6202/***/ }),
6203/* 179 */
6204/***/ (function(module, __webpack_exports__, __webpack_require__) {
6205
6206"use strict";
6207/* harmony export (immutable) */ __webpack_exports__["a"] = clone;
6208/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(45);
6209/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(46);
6210/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__extend_js__ = __webpack_require__(176);
6211
6212
6213
6214
6215// Create a (shallow-cloned) duplicate of an object.
6216function clone(obj) {
6217 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return obj;
6218 return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) ? obj.slice() : Object(__WEBPACK_IMPORTED_MODULE_2__extend_js__["a" /* default */])({}, obj);
6219}
6220
6221
6222/***/ }),
6223/* 180 */
6224/***/ (function(module, __webpack_exports__, __webpack_require__) {
6225
6226"use strict";
6227/* harmony export (immutable) */ __webpack_exports__["a"] = get;
6228/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__toPath_js__ = __webpack_require__(76);
6229/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deepGet_js__ = __webpack_require__(128);
6230/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isUndefined_js__ = __webpack_require__(162);
6231
6232
6233
6234
6235// Get the value of the (deep) property on `path` from `object`.
6236// If any property in `path` does not exist or if the value is
6237// `undefined`, return `defaultValue` instead.
6238// The `path` is normalized through `_.toPath`.
6239function get(object, path, defaultValue) {
6240 var value = Object(__WEBPACK_IMPORTED_MODULE_1__deepGet_js__["a" /* default */])(object, Object(__WEBPACK_IMPORTED_MODULE_0__toPath_js__["a" /* default */])(path));
6241 return Object(__WEBPACK_IMPORTED_MODULE_2__isUndefined_js__["a" /* default */])(value) ? defaultValue : value;
6242}
6243
6244
6245/***/ }),
6246/* 181 */
6247/***/ (function(module, __webpack_exports__, __webpack_require__) {
6248
6249"use strict";
6250/* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
6251/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6252/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(46);
6253
6254
6255
6256// Normalize a (deep) property `path` to array.
6257// Like `_.iteratee`, this function can be customized.
6258function toPath(path) {
6259 return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(path) ? path : [path];
6260}
6261__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath = toPath;
6262
6263
6264/***/ }),
6265/* 182 */
6266/***/ (function(module, __webpack_exports__, __webpack_require__) {
6267
6268"use strict";
6269/* harmony export (immutable) */ __webpack_exports__["a"] = baseIteratee;
6270/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(129);
6271/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
6272/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(45);
6273/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(46);
6274/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matcher_js__ = __webpack_require__(96);
6275/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__property_js__ = __webpack_require__(130);
6276/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__ = __webpack_require__(77);
6277
6278
6279
6280
6281
6282
6283
6284
6285// An internal function to generate callbacks that can be applied to each
6286// element in a collection, returning the desired result — either `_.identity`,
6287// an arbitrary callback, a property matcher, or a property accessor.
6288function baseIteratee(value, context, argCount) {
6289 if (value == null) return __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" /* default */];
6290 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__["a" /* default */])(value, context, argCount);
6291 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);
6292 return Object(__WEBPACK_IMPORTED_MODULE_5__property_js__["a" /* default */])(value);
6293}
6294
6295
6296/***/ }),
6297/* 183 */
6298/***/ (function(module, __webpack_exports__, __webpack_require__) {
6299
6300"use strict";
6301/* harmony export (immutable) */ __webpack_exports__["a"] = iteratee;
6302/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6303/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(182);
6304
6305
6306
6307// External wrapper for our callback generator. Users may customize
6308// `_.iteratee` if they want additional predicate/iteratee shorthand styles.
6309// This abstraction hides the internal-only `argCount` argument.
6310function iteratee(value, context) {
6311 return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, Infinity);
6312}
6313__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee = iteratee;
6314
6315
6316/***/ }),
6317/* 184 */
6318/***/ (function(module, __webpack_exports__, __webpack_require__) {
6319
6320"use strict";
6321/* harmony export (immutable) */ __webpack_exports__["a"] = noop;
6322// Predicate-generating function. Often useful outside of Underscore.
6323function noop(){}
6324
6325
6326/***/ }),
6327/* 185 */
6328/***/ (function(module, __webpack_exports__, __webpack_require__) {
6329
6330"use strict";
6331/* harmony export (immutable) */ __webpack_exports__["a"] = random;
6332// Return a random integer between `min` and `max` (inclusive).
6333function random(min, max) {
6334 if (max == null) {
6335 max = min;
6336 min = 0;
6337 }
6338 return min + Math.floor(Math.random() * (max - min + 1));
6339}
6340
6341
6342/***/ }),
6343/* 186 */
6344/***/ (function(module, __webpack_exports__, __webpack_require__) {
6345
6346"use strict";
6347/* harmony export (immutable) */ __webpack_exports__["a"] = createEscaper;
6348/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(12);
6349
6350
6351// Internal helper to generate functions for escaping and unescaping strings
6352// to/from HTML interpolation.
6353function createEscaper(map) {
6354 var escaper = function(match) {
6355 return map[match];
6356 };
6357 // Regexes for identifying a key that needs to be escaped.
6358 var source = '(?:' + Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(map).join('|') + ')';
6359 var testRegexp = RegExp(source);
6360 var replaceRegexp = RegExp(source, 'g');
6361 return function(string) {
6362 string = string == null ? '' : '' + string;
6363 return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
6364 };
6365}
6366
6367
6368/***/ }),
6369/* 187 */
6370/***/ (function(module, __webpack_exports__, __webpack_require__) {
6371
6372"use strict";
6373// Internal list of HTML entities for escaping.
6374/* harmony default export */ __webpack_exports__["a"] = ({
6375 '&': '&amp;',
6376 '<': '&lt;',
6377 '>': '&gt;',
6378 '"': '&quot;',
6379 "'": '&#x27;',
6380 '`': '&#x60;'
6381});
6382
6383
6384/***/ }),
6385/* 188 */
6386/***/ (function(module, __webpack_exports__, __webpack_require__) {
6387
6388"use strict";
6389/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6390
6391
6392// By default, Underscore uses ERB-style template delimiters. Change the
6393// following template settings to use alternative delimiters.
6394/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].templateSettings = {
6395 evaluate: /<%([\s\S]+?)%>/g,
6396 interpolate: /<%=([\s\S]+?)%>/g,
6397 escape: /<%-([\s\S]+?)%>/g
6398});
6399
6400
6401/***/ }),
6402/* 189 */
6403/***/ (function(module, __webpack_exports__, __webpack_require__) {
6404
6405"use strict";
6406/* harmony export (immutable) */ __webpack_exports__["a"] = executeBound;
6407/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(178);
6408/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(45);
6409
6410
6411
6412// Internal function to execute `sourceFunc` bound to `context` with optional
6413// `args`. Determines whether to execute a function as a constructor or as a
6414// normal function.
6415function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
6416 if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
6417 var self = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(sourceFunc.prototype);
6418 var result = sourceFunc.apply(self, args);
6419 if (Object(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" /* default */])(result)) return result;
6420 return self;
6421}
6422
6423
6424/***/ }),
6425/* 190 */
6426/***/ (function(module, __webpack_exports__, __webpack_require__) {
6427
6428"use strict";
6429/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6430/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
6431/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__executeBound_js__ = __webpack_require__(189);
6432
6433
6434
6435
6436// Create a function bound to a given object (assigning `this`, and arguments,
6437// optionally).
6438/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, context, args) {
6439 if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(func)) throw new TypeError('Bind must be called on a function');
6440 var bound = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(callArgs) {
6441 return Object(__WEBPACK_IMPORTED_MODULE_2__executeBound_js__["a" /* default */])(func, bound, context, this, args.concat(callArgs));
6442 });
6443 return bound;
6444}));
6445
6446
6447/***/ }),
6448/* 191 */
6449/***/ (function(module, __webpack_exports__, __webpack_require__) {
6450
6451"use strict";
6452/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6453
6454
6455// Delays a function for the given number of milliseconds, and then calls
6456// it with the arguments supplied.
6457/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, wait, args) {
6458 return setTimeout(function() {
6459 return func.apply(null, args);
6460 }, wait);
6461}));
6462
6463
6464/***/ }),
6465/* 192 */
6466/***/ (function(module, __webpack_exports__, __webpack_require__) {
6467
6468"use strict";
6469/* harmony export (immutable) */ __webpack_exports__["a"] = before;
6470// Returns a function that will only be executed up to (but not including) the
6471// Nth call.
6472function before(times, func) {
6473 var memo;
6474 return function() {
6475 if (--times > 0) {
6476 memo = func.apply(this, arguments);
6477 }
6478 if (times <= 1) func = null;
6479 return memo;
6480 };
6481}
6482
6483
6484/***/ }),
6485/* 193 */
6486/***/ (function(module, __webpack_exports__, __webpack_require__) {
6487
6488"use strict";
6489/* harmony export (immutable) */ __webpack_exports__["a"] = findKey;
6490/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
6491/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(12);
6492
6493
6494
6495// Returns the first key on an object that passes a truth test.
6496function findKey(obj, predicate, context) {
6497 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
6498 var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj), key;
6499 for (var i = 0, length = _keys.length; i < length; i++) {
6500 key = _keys[i];
6501 if (predicate(obj[key], key, obj)) return key;
6502 }
6503}
6504
6505
6506/***/ }),
6507/* 194 */
6508/***/ (function(module, __webpack_exports__, __webpack_require__) {
6509
6510"use strict";
6511/* harmony export (immutable) */ __webpack_exports__["a"] = createPredicateIndexFinder;
6512/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
6513/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(27);
6514
6515
6516
6517// Internal function to generate `_.findIndex` and `_.findLastIndex`.
6518function createPredicateIndexFinder(dir) {
6519 return function(array, predicate, context) {
6520 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
6521 var length = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
6522 var index = dir > 0 ? 0 : length - 1;
6523 for (; index >= 0 && index < length; index += dir) {
6524 if (predicate(array[index], index, array)) return index;
6525 }
6526 return -1;
6527 };
6528}
6529
6530
6531/***/ }),
6532/* 195 */
6533/***/ (function(module, __webpack_exports__, __webpack_require__) {
6534
6535"use strict";
6536/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(194);
6537
6538
6539// Returns the last index on an array-like that passes a truth test.
6540/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(-1));
6541
6542
6543/***/ }),
6544/* 196 */
6545/***/ (function(module, __webpack_exports__, __webpack_require__) {
6546
6547"use strict";
6548/* harmony export (immutable) */ __webpack_exports__["a"] = sortedIndex;
6549/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
6550/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(27);
6551
6552
6553
6554// Use a comparator function to figure out the smallest index at which
6555// an object should be inserted so as to maintain order. Uses binary search.
6556function sortedIndex(array, obj, iteratee, context) {
6557 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context, 1);
6558 var value = iteratee(obj);
6559 var low = 0, high = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
6560 while (low < high) {
6561 var mid = Math.floor((low + high) / 2);
6562 if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
6563 }
6564 return low;
6565}
6566
6567
6568/***/ }),
6569/* 197 */
6570/***/ (function(module, __webpack_exports__, __webpack_require__) {
6571
6572"use strict";
6573/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__ = __webpack_require__(196);
6574/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(133);
6575/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__ = __webpack_require__(198);
6576
6577
6578
6579
6580// Return the position of the first occurrence of an item in an array,
6581// or -1 if the item is not included in the array.
6582// If the array is large and already in sort order, pass `true`
6583// for **isSorted** to use binary search.
6584/* 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 */]));
6585
6586
6587/***/ }),
6588/* 198 */
6589/***/ (function(module, __webpack_exports__, __webpack_require__) {
6590
6591"use strict";
6592/* harmony export (immutable) */ __webpack_exports__["a"] = createIndexFinder;
6593/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
6594/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
6595/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isNaN_js__ = __webpack_require__(167);
6596
6597
6598
6599
6600// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
6601function createIndexFinder(dir, predicateFind, sortedIndex) {
6602 return function(array, item, idx) {
6603 var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array);
6604 if (typeof idx == 'number') {
6605 if (dir > 0) {
6606 i = idx >= 0 ? idx : Math.max(idx + length, i);
6607 } else {
6608 length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
6609 }
6610 } else if (sortedIndex && idx && length) {
6611 idx = sortedIndex(array, item);
6612 return array[idx] === item ? idx : -1;
6613 }
6614 if (item !== item) {
6615 idx = predicateFind(__WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(array, i, length), __WEBPACK_IMPORTED_MODULE_2__isNaN_js__["a" /* default */]);
6616 return idx >= 0 ? idx + i : -1;
6617 }
6618 for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
6619 if (array[idx] === item) return idx;
6620 }
6621 return -1;
6622 };
6623}
6624
6625
6626/***/ }),
6627/* 199 */
6628/***/ (function(module, __webpack_exports__, __webpack_require__) {
6629
6630"use strict";
6631/* harmony export (immutable) */ __webpack_exports__["a"] = find;
6632/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6633/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(133);
6634/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__findKey_js__ = __webpack_require__(193);
6635
6636
6637
6638
6639// Return the first value which passes a truth test.
6640function find(obj, predicate, context) {
6641 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 */];
6642 var key = keyFinder(obj, predicate, context);
6643 if (key !== void 0 && key !== -1) return obj[key];
6644}
6645
6646
6647/***/ }),
6648/* 200 */
6649/***/ (function(module, __webpack_exports__, __webpack_require__) {
6650
6651"use strict";
6652/* harmony export (immutable) */ __webpack_exports__["a"] = createReduce;
6653/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6654/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(12);
6655/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(77);
6656
6657
6658
6659
6660// Internal helper to create a reducing function, iterating left or right.
6661function createReduce(dir) {
6662 // Wrap code that reassigns argument variables in a separate function than
6663 // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
6664 var reducer = function(obj, iteratee, memo, initial) {
6665 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
6666 length = (_keys || obj).length,
6667 index = dir > 0 ? 0 : length - 1;
6668 if (!initial) {
6669 memo = obj[_keys ? _keys[index] : index];
6670 index += dir;
6671 }
6672 for (; index >= 0 && index < length; index += dir) {
6673 var currentKey = _keys ? _keys[index] : index;
6674 memo = iteratee(memo, obj[currentKey], currentKey, obj);
6675 }
6676 return memo;
6677 };
6678
6679 return function(obj, iteratee, memo, context) {
6680 var initial = arguments.length >= 3;
6681 return reducer(obj, Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, context, 4), memo, initial);
6682 };
6683}
6684
6685
6686/***/ }),
6687/* 201 */
6688/***/ (function(module, __webpack_exports__, __webpack_require__) {
6689
6690"use strict";
6691/* harmony export (immutable) */ __webpack_exports__["a"] = max;
6692/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6693/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(56);
6694/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(18);
6695/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(47);
6696
6697
6698
6699
6700
6701// Return the maximum element (or element-based computation).
6702function max(obj, iteratee, context) {
6703 var result = -Infinity, lastComputed = -Infinity,
6704 value, computed;
6705 if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
6706 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
6707 for (var i = 0, length = obj.length; i < length; i++) {
6708 value = obj[i];
6709 if (value != null && value > result) {
6710 result = value;
6711 }
6712 }
6713 } else {
6714 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
6715 Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
6716 computed = iteratee(v, index, list);
6717 if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
6718 result = v;
6719 lastComputed = computed;
6720 }
6721 });
6722 }
6723 return result;
6724}
6725
6726
6727/***/ }),
6728/* 202 */
6729/***/ (function(module, __webpack_exports__, __webpack_require__) {
6730
6731"use strict";
6732/* harmony export (immutable) */ __webpack_exports__["a"] = sample;
6733/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6734/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_js__ = __webpack_require__(179);
6735/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__values_js__ = __webpack_require__(56);
6736/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__getLength_js__ = __webpack_require__(27);
6737/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__random_js__ = __webpack_require__(185);
6738
6739
6740
6741
6742
6743
6744// Sample **n** random values from a collection using the modern version of the
6745// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
6746// If **n** is not specified, returns a single random element.
6747// The internal `guard` argument allows it to work with `_.map`.
6748function sample(obj, n, guard) {
6749 if (n == null || guard) {
6750 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
6751 return obj[Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(obj.length - 1)];
6752 }
6753 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);
6754 var length = Object(__WEBPACK_IMPORTED_MODULE_3__getLength_js__["a" /* default */])(sample);
6755 n = Math.max(Math.min(n, length), 0);
6756 var last = length - 1;
6757 for (var index = 0; index < n; index++) {
6758 var rand = Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(index, last);
6759 var temp = sample[index];
6760 sample[index] = sample[rand];
6761 sample[rand] = temp;
6762 }
6763 return sample.slice(0, n);
6764}
6765
6766
6767/***/ }),
6768/* 203 */
6769/***/ (function(module, __webpack_exports__, __webpack_require__) {
6770
6771"use strict";
6772/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6773/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
6774/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(77);
6775/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__allKeys_js__ = __webpack_require__(75);
6776/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__ = __webpack_require__(336);
6777/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__flatten_js__ = __webpack_require__(57);
6778
6779
6780
6781
6782
6783
6784
6785// Return a copy of the object only containing the allowed properties.
6786/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
6787 var result = {}, iteratee = keys[0];
6788 if (obj == null) return result;
6789 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
6790 if (keys.length > 1) iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, keys[1]);
6791 keys = Object(__WEBPACK_IMPORTED_MODULE_3__allKeys_js__["a" /* default */])(obj);
6792 } else {
6793 iteratee = __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__["a" /* default */];
6794 keys = Object(__WEBPACK_IMPORTED_MODULE_5__flatten_js__["a" /* default */])(keys, false, false);
6795 obj = Object(obj);
6796 }
6797 for (var i = 0, length = keys.length; i < length; i++) {
6798 var key = keys[i];
6799 var value = obj[key];
6800 if (iteratee(value, key, obj)) result[key] = value;
6801 }
6802 return result;
6803}));
6804
6805
6806/***/ }),
6807/* 204 */
6808/***/ (function(module, __webpack_exports__, __webpack_require__) {
6809
6810"use strict";
6811/* harmony export (immutable) */ __webpack_exports__["a"] = initial;
6812/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
6813
6814
6815// Returns everything but the last entry of the array. Especially useful on
6816// the arguments object. Passing **n** will return all the values in
6817// the array, excluding the last N.
6818function initial(array, n, guard) {
6819 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
6820}
6821
6822
6823/***/ }),
6824/* 205 */
6825/***/ (function(module, __webpack_exports__, __webpack_require__) {
6826
6827"use strict";
6828/* harmony export (immutable) */ __webpack_exports__["a"] = rest;
6829/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
6830
6831
6832// Returns everything but the first entry of the `array`. Especially useful on
6833// the `arguments` object. Passing an **n** will return the rest N values in the
6834// `array`.
6835function rest(array, n, guard) {
6836 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, n == null || guard ? 1 : n);
6837}
6838
6839
6840/***/ }),
6841/* 206 */
6842/***/ (function(module, __webpack_exports__, __webpack_require__) {
6843
6844"use strict";
6845/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6846/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(57);
6847/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_js__ = __webpack_require__(78);
6848/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(79);
6849
6850
6851
6852
6853
6854// Take the difference between one array and a number of other arrays.
6855// Only the elements present in just the first array will remain.
6856/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, rest) {
6857 rest = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(rest, true, true);
6858 return Object(__WEBPACK_IMPORTED_MODULE_2__filter_js__["a" /* default */])(array, function(value){
6859 return !Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(rest, value);
6860 });
6861}));
6862
6863
6864/***/ }),
6865/* 207 */
6866/***/ (function(module, __webpack_exports__, __webpack_require__) {
6867
6868"use strict";
6869/* harmony export (immutable) */ __webpack_exports__["a"] = uniq;
6870/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isBoolean_js__ = __webpack_require__(163);
6871/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cb_js__ = __webpack_require__(18);
6872/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getLength_js__ = __webpack_require__(27);
6873/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(79);
6874
6875
6876
6877
6878
6879// Produce a duplicate-free version of the array. If the array has already
6880// been sorted, you have the option of using a faster algorithm.
6881// The faster algorithm will not work with an iteratee if the iteratee
6882// is not a one-to-one function, so providing an iteratee will disable
6883// the faster algorithm.
6884function uniq(array, isSorted, iteratee, context) {
6885 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isBoolean_js__["a" /* default */])(isSorted)) {
6886 context = iteratee;
6887 iteratee = isSorted;
6888 isSorted = false;
6889 }
6890 if (iteratee != null) iteratee = Object(__WEBPACK_IMPORTED_MODULE_1__cb_js__["a" /* default */])(iteratee, context);
6891 var result = [];
6892 var seen = [];
6893 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_2__getLength_js__["a" /* default */])(array); i < length; i++) {
6894 var value = array[i],
6895 computed = iteratee ? iteratee(value, i, array) : value;
6896 if (isSorted && !iteratee) {
6897 if (!i || seen !== computed) result.push(value);
6898 seen = computed;
6899 } else if (iteratee) {
6900 if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(seen, computed)) {
6901 seen.push(computed);
6902 result.push(value);
6903 }
6904 } else if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(result, value)) {
6905 result.push(value);
6906 }
6907 }
6908 return result;
6909}
6910
6911
6912/***/ }),
6913/* 208 */
6914/***/ (function(module, __webpack_exports__, __webpack_require__) {
6915
6916"use strict";
6917/* harmony export (immutable) */ __webpack_exports__["a"] = unzip;
6918/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__max_js__ = __webpack_require__(201);
6919/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(27);
6920/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pluck_js__ = __webpack_require__(134);
6921
6922
6923
6924
6925// Complement of zip. Unzip accepts an array of arrays and groups
6926// each array's elements on shared indices.
6927function unzip(array) {
6928 var length = array && Object(__WEBPACK_IMPORTED_MODULE_0__max_js__["a" /* default */])(array, __WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]).length || 0;
6929 var result = Array(length);
6930
6931 for (var index = 0; index < length; index++) {
6932 result[index] = Object(__WEBPACK_IMPORTED_MODULE_2__pluck_js__["a" /* default */])(array, index);
6933 }
6934 return result;
6935}
6936
6937
6938/***/ }),
6939/* 209 */
6940/***/ (function(module, __webpack_exports__, __webpack_require__) {
6941
6942"use strict";
6943/* harmony export (immutable) */ __webpack_exports__["a"] = chainResult;
6944/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6945
6946
6947// Helper function to continue chaining intermediate results.
6948function chainResult(instance, obj) {
6949 return instance._chain ? Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj).chain() : obj;
6950}
6951
6952
6953/***/ }),
6954/* 210 */
6955/***/ (function(module, exports, __webpack_require__) {
6956
6957"use strict";
6958
6959var $ = __webpack_require__(0);
6960var fails = __webpack_require__(4);
6961var isArray = __webpack_require__(80);
6962var isObject = __webpack_require__(17);
6963var toObject = __webpack_require__(35);
6964var lengthOfArrayLike = __webpack_require__(42);
6965var doesNotExceedSafeInteger = __webpack_require__(354);
6966var createProperty = __webpack_require__(99);
6967var arraySpeciesCreate = __webpack_require__(211);
6968var arrayMethodHasSpeciesSupport = __webpack_require__(100);
6969var wellKnownSymbol = __webpack_require__(8);
6970var V8_VERSION = __webpack_require__(84);
6971
6972var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
6973
6974// We can't use this feature detection in V8 since it causes
6975// deoptimization and serious performance degradation
6976// https://github.com/zloirock/core-js/issues/679
6977var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
6978 var array = [];
6979 array[IS_CONCAT_SPREADABLE] = false;
6980 return array.concat()[0] !== array;
6981});
6982
6983var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
6984
6985var isConcatSpreadable = function (O) {
6986 if (!isObject(O)) return false;
6987 var spreadable = O[IS_CONCAT_SPREADABLE];
6988 return spreadable !== undefined ? !!spreadable : isArray(O);
6989};
6990
6991var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
6992
6993// `Array.prototype.concat` method
6994// https://tc39.es/ecma262/#sec-array.prototype.concat
6995// with adding support of @@isConcatSpreadable and @@species
6996$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
6997 // eslint-disable-next-line no-unused-vars -- required for `.length`
6998 concat: function concat(arg) {
6999 var O = toObject(this);
7000 var A = arraySpeciesCreate(O, 0);
7001 var n = 0;
7002 var i, k, length, len, E;
7003 for (i = -1, length = arguments.length; i < length; i++) {
7004 E = i === -1 ? O : arguments[i];
7005 if (isConcatSpreadable(E)) {
7006 len = lengthOfArrayLike(E);
7007 doesNotExceedSafeInteger(n + len);
7008 for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
7009 } else {
7010 doesNotExceedSafeInteger(n + 1);
7011 createProperty(A, n++, E);
7012 }
7013 }
7014 A.length = n;
7015 return A;
7016 }
7017});
7018
7019
7020/***/ }),
7021/* 211 */
7022/***/ (function(module, exports, __webpack_require__) {
7023
7024var arraySpeciesConstructor = __webpack_require__(355);
7025
7026// `ArraySpeciesCreate` abstract operation
7027// https://tc39.es/ecma262/#sec-arrayspeciescreate
7028module.exports = function (originalArray, length) {
7029 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
7030};
7031
7032
7033/***/ }),
7034/* 212 */
7035/***/ (function(module, exports, __webpack_require__) {
7036
7037module.exports = __webpack_require__(360);
7038
7039/***/ }),
7040/* 213 */
7041/***/ (function(module, exports, __webpack_require__) {
7042
7043var $ = __webpack_require__(0);
7044var getBuiltIn = __webpack_require__(16);
7045var apply = __webpack_require__(62);
7046var call = __webpack_require__(11);
7047var uncurryThis = __webpack_require__(6);
7048var fails = __webpack_require__(4);
7049var isArray = __webpack_require__(80);
7050var isCallable = __webpack_require__(7);
7051var isObject = __webpack_require__(17);
7052var isSymbol = __webpack_require__(83);
7053var arraySlice = __webpack_require__(94);
7054var NATIVE_SYMBOL = __webpack_require__(49);
7055
7056var $stringify = getBuiltIn('JSON', 'stringify');
7057var exec = uncurryThis(/./.exec);
7058var charAt = uncurryThis(''.charAt);
7059var charCodeAt = uncurryThis(''.charCodeAt);
7060var replace = uncurryThis(''.replace);
7061var numberToString = uncurryThis(1.0.toString);
7062
7063var tester = /[\uD800-\uDFFF]/g;
7064var low = /^[\uD800-\uDBFF]$/;
7065var hi = /^[\uDC00-\uDFFF]$/;
7066
7067var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
7068 var symbol = getBuiltIn('Symbol')();
7069 // MS Edge converts symbol values to JSON as {}
7070 return $stringify([symbol]) != '[null]'
7071 // WebKit converts symbol values to JSON as null
7072 || $stringify({ a: symbol }) != '{}'
7073 // V8 throws on boxed symbols
7074 || $stringify(Object(symbol)) != '{}';
7075});
7076
7077// https://github.com/tc39/proposal-well-formed-stringify
7078var ILL_FORMED_UNICODE = fails(function () {
7079 return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
7080 || $stringify('\uDEAD') !== '"\\udead"';
7081});
7082
7083var stringifyWithSymbolsFix = function (it, replacer) {
7084 var args = arraySlice(arguments);
7085 var $replacer = replacer;
7086 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
7087 if (!isArray(replacer)) replacer = function (key, value) {
7088 if (isCallable($replacer)) value = call($replacer, this, key, value);
7089 if (!isSymbol(value)) return value;
7090 };
7091 args[1] = replacer;
7092 return apply($stringify, null, args);
7093};
7094
7095var fixIllFormed = function (match, offset, string) {
7096 var prev = charAt(string, offset - 1);
7097 var next = charAt(string, offset + 1);
7098 if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
7099 return '\\u' + numberToString(charCodeAt(match, 0), 16);
7100 } return match;
7101};
7102
7103if ($stringify) {
7104 // `JSON.stringify` method
7105 // https://tc39.es/ecma262/#sec-json.stringify
7106 $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
7107 // eslint-disable-next-line no-unused-vars -- required for `.length`
7108 stringify: function stringify(it, replacer, space) {
7109 var args = arraySlice(arguments);
7110 var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
7111 return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
7112 }
7113 });
7114}
7115
7116
7117/***/ }),
7118/* 214 */
7119/***/ (function(module, exports, __webpack_require__) {
7120
7121var rng = __webpack_require__(373);
7122var bytesToUuid = __webpack_require__(374);
7123
7124function v4(options, buf, offset) {
7125 var i = buf && offset || 0;
7126
7127 if (typeof(options) == 'string') {
7128 buf = options === 'binary' ? new Array(16) : null;
7129 options = null;
7130 }
7131 options = options || {};
7132
7133 var rnds = options.random || (options.rng || rng)();
7134
7135 // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
7136 rnds[6] = (rnds[6] & 0x0f) | 0x40;
7137 rnds[8] = (rnds[8] & 0x3f) | 0x80;
7138
7139 // Copy bytes to buffer, if provided
7140 if (buf) {
7141 for (var ii = 0; ii < 16; ++ii) {
7142 buf[i + ii] = rnds[ii];
7143 }
7144 }
7145
7146 return buf || bytesToUuid(rnds);
7147}
7148
7149module.exports = v4;
7150
7151
7152/***/ }),
7153/* 215 */
7154/***/ (function(module, exports, __webpack_require__) {
7155
7156module.exports = __webpack_require__(216);
7157
7158/***/ }),
7159/* 216 */
7160/***/ (function(module, exports, __webpack_require__) {
7161
7162var parent = __webpack_require__(377);
7163
7164module.exports = parent;
7165
7166
7167/***/ }),
7168/* 217 */
7169/***/ (function(module, exports, __webpack_require__) {
7170
7171"use strict";
7172
7173
7174module.exports = '4.15.1';
7175
7176/***/ }),
7177/* 218 */
7178/***/ (function(module, exports, __webpack_require__) {
7179
7180"use strict";
7181
7182
7183var has = Object.prototype.hasOwnProperty
7184 , prefix = '~';
7185
7186/**
7187 * Constructor to create a storage for our `EE` objects.
7188 * An `Events` instance is a plain object whose properties are event names.
7189 *
7190 * @constructor
7191 * @api private
7192 */
7193function Events() {}
7194
7195//
7196// We try to not inherit from `Object.prototype`. In some engines creating an
7197// instance in this way is faster than calling `Object.create(null)` directly.
7198// If `Object.create(null)` is not supported we prefix the event names with a
7199// character to make sure that the built-in object properties are not
7200// overridden or used as an attack vector.
7201//
7202if (Object.create) {
7203 Events.prototype = Object.create(null);
7204
7205 //
7206 // This hack is needed because the `__proto__` property is still inherited in
7207 // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
7208 //
7209 if (!new Events().__proto__) prefix = false;
7210}
7211
7212/**
7213 * Representation of a single event listener.
7214 *
7215 * @param {Function} fn The listener function.
7216 * @param {Mixed} context The context to invoke the listener with.
7217 * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
7218 * @constructor
7219 * @api private
7220 */
7221function EE(fn, context, once) {
7222 this.fn = fn;
7223 this.context = context;
7224 this.once = once || false;
7225}
7226
7227/**
7228 * Minimal `EventEmitter` interface that is molded against the Node.js
7229 * `EventEmitter` interface.
7230 *
7231 * @constructor
7232 * @api public
7233 */
7234function EventEmitter() {
7235 this._events = new Events();
7236 this._eventsCount = 0;
7237}
7238
7239/**
7240 * Return an array listing the events for which the emitter has registered
7241 * listeners.
7242 *
7243 * @returns {Array}
7244 * @api public
7245 */
7246EventEmitter.prototype.eventNames = function eventNames() {
7247 var names = []
7248 , events
7249 , name;
7250
7251 if (this._eventsCount === 0) return names;
7252
7253 for (name in (events = this._events)) {
7254 if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
7255 }
7256
7257 if (Object.getOwnPropertySymbols) {
7258 return names.concat(Object.getOwnPropertySymbols(events));
7259 }
7260
7261 return names;
7262};
7263
7264/**
7265 * Return the listeners registered for a given event.
7266 *
7267 * @param {String|Symbol} event The event name.
7268 * @param {Boolean} exists Only check if there are listeners.
7269 * @returns {Array|Boolean}
7270 * @api public
7271 */
7272EventEmitter.prototype.listeners = function listeners(event, exists) {
7273 var evt = prefix ? prefix + event : event
7274 , available = this._events[evt];
7275
7276 if (exists) return !!available;
7277 if (!available) return [];
7278 if (available.fn) return [available.fn];
7279
7280 for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
7281 ee[i] = available[i].fn;
7282 }
7283
7284 return ee;
7285};
7286
7287/**
7288 * Calls each of the listeners registered for a given event.
7289 *
7290 * @param {String|Symbol} event The event name.
7291 * @returns {Boolean} `true` if the event had listeners, else `false`.
7292 * @api public
7293 */
7294EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
7295 var evt = prefix ? prefix + event : event;
7296
7297 if (!this._events[evt]) return false;
7298
7299 var listeners = this._events[evt]
7300 , len = arguments.length
7301 , args
7302 , i;
7303
7304 if (listeners.fn) {
7305 if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
7306
7307 switch (len) {
7308 case 1: return listeners.fn.call(listeners.context), true;
7309 case 2: return listeners.fn.call(listeners.context, a1), true;
7310 case 3: return listeners.fn.call(listeners.context, a1, a2), true;
7311 case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
7312 case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
7313 case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
7314 }
7315
7316 for (i = 1, args = new Array(len -1); i < len; i++) {
7317 args[i - 1] = arguments[i];
7318 }
7319
7320 listeners.fn.apply(listeners.context, args);
7321 } else {
7322 var length = listeners.length
7323 , j;
7324
7325 for (i = 0; i < length; i++) {
7326 if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
7327
7328 switch (len) {
7329 case 1: listeners[i].fn.call(listeners[i].context); break;
7330 case 2: listeners[i].fn.call(listeners[i].context, a1); break;
7331 case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
7332 case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
7333 default:
7334 if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
7335 args[j - 1] = arguments[j];
7336 }
7337
7338 listeners[i].fn.apply(listeners[i].context, args);
7339 }
7340 }
7341 }
7342
7343 return true;
7344};
7345
7346/**
7347 * Add a listener for a given event.
7348 *
7349 * @param {String|Symbol} event The event name.
7350 * @param {Function} fn The listener function.
7351 * @param {Mixed} [context=this] The context to invoke the listener with.
7352 * @returns {EventEmitter} `this`.
7353 * @api public
7354 */
7355EventEmitter.prototype.on = function on(event, fn, context) {
7356 var listener = new EE(fn, context || this)
7357 , evt = prefix ? prefix + event : event;
7358
7359 if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
7360 else if (!this._events[evt].fn) this._events[evt].push(listener);
7361 else this._events[evt] = [this._events[evt], listener];
7362
7363 return this;
7364};
7365
7366/**
7367 * Add a one-time listener for a given event.
7368 *
7369 * @param {String|Symbol} event The event name.
7370 * @param {Function} fn The listener function.
7371 * @param {Mixed} [context=this] The context to invoke the listener with.
7372 * @returns {EventEmitter} `this`.
7373 * @api public
7374 */
7375EventEmitter.prototype.once = function once(event, fn, context) {
7376 var listener = new EE(fn, context || this, true)
7377 , evt = prefix ? prefix + event : event;
7378
7379 if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
7380 else if (!this._events[evt].fn) this._events[evt].push(listener);
7381 else this._events[evt] = [this._events[evt], listener];
7382
7383 return this;
7384};
7385
7386/**
7387 * Remove the listeners of a given event.
7388 *
7389 * @param {String|Symbol} event The event name.
7390 * @param {Function} fn Only remove the listeners that match this function.
7391 * @param {Mixed} context Only remove the listeners that have this context.
7392 * @param {Boolean} once Only remove one-time listeners.
7393 * @returns {EventEmitter} `this`.
7394 * @api public
7395 */
7396EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
7397 var evt = prefix ? prefix + event : event;
7398
7399 if (!this._events[evt]) return this;
7400 if (!fn) {
7401 if (--this._eventsCount === 0) this._events = new Events();
7402 else delete this._events[evt];
7403 return this;
7404 }
7405
7406 var listeners = this._events[evt];
7407
7408 if (listeners.fn) {
7409 if (
7410 listeners.fn === fn
7411 && (!once || listeners.once)
7412 && (!context || listeners.context === context)
7413 ) {
7414 if (--this._eventsCount === 0) this._events = new Events();
7415 else delete this._events[evt];
7416 }
7417 } else {
7418 for (var i = 0, events = [], length = listeners.length; i < length; i++) {
7419 if (
7420 listeners[i].fn !== fn
7421 || (once && !listeners[i].once)
7422 || (context && listeners[i].context !== context)
7423 ) {
7424 events.push(listeners[i]);
7425 }
7426 }
7427
7428 //
7429 // Reset the array, or remove it completely if we have no more listeners.
7430 //
7431 if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
7432 else if (--this._eventsCount === 0) this._events = new Events();
7433 else delete this._events[evt];
7434 }
7435
7436 return this;
7437};
7438
7439/**
7440 * Remove all listeners, or those of the specified event.
7441 *
7442 * @param {String|Symbol} [event] The event name.
7443 * @returns {EventEmitter} `this`.
7444 * @api public
7445 */
7446EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
7447 var evt;
7448
7449 if (event) {
7450 evt = prefix ? prefix + event : event;
7451 if (this._events[evt]) {
7452 if (--this._eventsCount === 0) this._events = new Events();
7453 else delete this._events[evt];
7454 }
7455 } else {
7456 this._events = new Events();
7457 this._eventsCount = 0;
7458 }
7459
7460 return this;
7461};
7462
7463//
7464// Alias methods names because people roll like that.
7465//
7466EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
7467EventEmitter.prototype.addListener = EventEmitter.prototype.on;
7468
7469//
7470// This function doesn't apply anymore.
7471//
7472EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
7473 return this;
7474};
7475
7476//
7477// Expose the prefix.
7478//
7479EventEmitter.prefixed = prefix;
7480
7481//
7482// Allow `EventEmitter` to be imported as module namespace.
7483//
7484EventEmitter.EventEmitter = EventEmitter;
7485
7486//
7487// Expose the module.
7488//
7489if (true) {
7490 module.exports = EventEmitter;
7491}
7492
7493
7494/***/ }),
7495/* 219 */
7496/***/ (function(module, exports, __webpack_require__) {
7497
7498"use strict";
7499
7500
7501var _interopRequireDefault = __webpack_require__(2);
7502
7503var _promise = _interopRequireDefault(__webpack_require__(10));
7504
7505var _require = __webpack_require__(61),
7506 getAdapter = _require.getAdapter;
7507
7508var syncApiNames = ['getItem', 'setItem', 'removeItem', 'clear'];
7509var localStorage = {
7510 get async() {
7511 return getAdapter('storage').async;
7512 }
7513
7514}; // wrap sync apis with async ones.
7515
7516syncApiNames.forEach(function (apiName) {
7517 localStorage[apiName + 'Async'] = function () {
7518 var storage = getAdapter('storage');
7519 return _promise.default.resolve(storage[apiName].apply(storage, arguments));
7520 };
7521
7522 localStorage[apiName] = function () {
7523 var storage = getAdapter('storage');
7524
7525 if (!storage.async) {
7526 return storage[apiName].apply(storage, arguments);
7527 }
7528
7529 var error = new Error('Synchronous API [' + apiName + '] is not available in this runtime.');
7530 error.code = 'SYNC_API_NOT_AVAILABLE';
7531 throw error;
7532 };
7533});
7534module.exports = localStorage;
7535
7536/***/ }),
7537/* 220 */
7538/***/ (function(module, exports, __webpack_require__) {
7539
7540"use strict";
7541
7542
7543var _interopRequireDefault = __webpack_require__(2);
7544
7545var _concat = _interopRequireDefault(__webpack_require__(29));
7546
7547var _stringify = _interopRequireDefault(__webpack_require__(34));
7548
7549var storage = __webpack_require__(219);
7550
7551var AV = __webpack_require__(59);
7552
7553var removeAsync = exports.removeAsync = storage.removeItemAsync.bind(storage);
7554
7555var getCacheData = function getCacheData(cacheData, key) {
7556 try {
7557 cacheData = JSON.parse(cacheData);
7558 } catch (e) {
7559 return null;
7560 }
7561
7562 if (cacheData) {
7563 var expired = cacheData.expiredAt && cacheData.expiredAt < Date.now();
7564
7565 if (!expired) {
7566 return cacheData.value;
7567 }
7568
7569 return removeAsync(key).then(function () {
7570 return null;
7571 });
7572 }
7573
7574 return null;
7575};
7576
7577exports.getAsync = function (key) {
7578 var _context;
7579
7580 key = (0, _concat.default)(_context = "AV/".concat(AV.applicationId, "/")).call(_context, key);
7581 return storage.getItemAsync(key).then(function (cache) {
7582 return getCacheData(cache, key);
7583 });
7584};
7585
7586exports.setAsync = function (key, value, ttl) {
7587 var _context2;
7588
7589 var cache = {
7590 value: value
7591 };
7592
7593 if (typeof ttl === 'number') {
7594 cache.expiredAt = Date.now() + ttl;
7595 }
7596
7597 return storage.setItemAsync((0, _concat.default)(_context2 = "AV/".concat(AV.applicationId, "/")).call(_context2, key), (0, _stringify.default)(cache));
7598};
7599
7600/***/ }),
7601/* 221 */
7602/***/ (function(module, exports, __webpack_require__) {
7603
7604var parent = __webpack_require__(380);
7605
7606module.exports = parent;
7607
7608
7609/***/ }),
7610/* 222 */
7611/***/ (function(module, exports, __webpack_require__) {
7612
7613var parent = __webpack_require__(383);
7614
7615module.exports = parent;
7616
7617
7618/***/ }),
7619/* 223 */
7620/***/ (function(module, exports, __webpack_require__) {
7621
7622module.exports = __webpack_require__(224);
7623
7624/***/ }),
7625/* 224 */
7626/***/ (function(module, exports, __webpack_require__) {
7627
7628var parent = __webpack_require__(386);
7629
7630module.exports = parent;
7631
7632
7633/***/ }),
7634/* 225 */
7635/***/ (function(module, exports, __webpack_require__) {
7636
7637module.exports = __webpack_require__(389);
7638
7639/***/ }),
7640/* 226 */
7641/***/ (function(module, exports, __webpack_require__) {
7642
7643var parent = __webpack_require__(392);
7644__webpack_require__(73);
7645
7646module.exports = parent;
7647
7648
7649/***/ }),
7650/* 227 */
7651/***/ (function(module, exports, __webpack_require__) {
7652
7653var call = __webpack_require__(11);
7654var getBuiltIn = __webpack_require__(16);
7655var wellKnownSymbol = __webpack_require__(8);
7656var defineBuiltIn = __webpack_require__(43);
7657
7658module.exports = function () {
7659 var Symbol = getBuiltIn('Symbol');
7660 var SymbolPrototype = Symbol && Symbol.prototype;
7661 var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
7662 var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
7663
7664 if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
7665 // `Symbol.prototype[@@toPrimitive]` method
7666 // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
7667 // eslint-disable-next-line no-unused-vars -- required for .length
7668 defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
7669 return call(valueOf, this);
7670 }, { arity: 1 });
7671 }
7672};
7673
7674
7675/***/ }),
7676/* 228 */
7677/***/ (function(module, exports, __webpack_require__) {
7678
7679var NATIVE_SYMBOL = __webpack_require__(49);
7680
7681/* eslint-disable es-x/no-symbol -- safe */
7682module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
7683
7684
7685/***/ }),
7686/* 229 */
7687/***/ (function(module, exports, __webpack_require__) {
7688
7689var defineWellKnownSymbol = __webpack_require__(5);
7690
7691// `Symbol.iterator` well-known symbol
7692// https://tc39.es/ecma262/#sec-symbol.iterator
7693defineWellKnownSymbol('iterator');
7694
7695
7696/***/ }),
7697/* 230 */
7698/***/ (function(module, exports, __webpack_require__) {
7699
7700var parent = __webpack_require__(449);
7701
7702module.exports = parent;
7703
7704
7705/***/ }),
7706/* 231 */
7707/***/ (function(module, exports, __webpack_require__) {
7708
7709module.exports = __webpack_require__(454);
7710
7711/***/ }),
7712/* 232 */
7713/***/ (function(module, exports, __webpack_require__) {
7714
7715"use strict";
7716
7717var uncurryThis = __webpack_require__(6);
7718var aCallable = __webpack_require__(30);
7719var isObject = __webpack_require__(17);
7720var hasOwn = __webpack_require__(14);
7721var arraySlice = __webpack_require__(94);
7722var NATIVE_BIND = __webpack_require__(63);
7723
7724var $Function = Function;
7725var concat = uncurryThis([].concat);
7726var join = uncurryThis([].join);
7727var factories = {};
7728
7729var construct = function (C, argsLength, args) {
7730 if (!hasOwn(factories, argsLength)) {
7731 for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
7732 factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
7733 } return factories[argsLength](C, args);
7734};
7735
7736// `Function.prototype.bind` method implementation
7737// https://tc39.es/ecma262/#sec-function.prototype.bind
7738module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
7739 var F = aCallable(this);
7740 var Prototype = F.prototype;
7741 var partArgs = arraySlice(arguments, 1);
7742 var boundFunction = function bound(/* args... */) {
7743 var args = concat(partArgs, arraySlice(arguments));
7744 return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
7745 };
7746 if (isObject(Prototype)) boundFunction.prototype = Prototype;
7747 return boundFunction;
7748};
7749
7750
7751/***/ }),
7752/* 233 */
7753/***/ (function(module, exports, __webpack_require__) {
7754
7755module.exports = __webpack_require__(475);
7756
7757/***/ }),
7758/* 234 */
7759/***/ (function(module, exports, __webpack_require__) {
7760
7761module.exports = __webpack_require__(478);
7762
7763/***/ }),
7764/* 235 */
7765/***/ (function(module, exports) {
7766
7767var charenc = {
7768 // UTF-8 encoding
7769 utf8: {
7770 // Convert a string to a byte array
7771 stringToBytes: function(str) {
7772 return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
7773 },
7774
7775 // Convert a byte array to a string
7776 bytesToString: function(bytes) {
7777 return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
7778 }
7779 },
7780
7781 // Binary encoding
7782 bin: {
7783 // Convert a string to a byte array
7784 stringToBytes: function(str) {
7785 for (var bytes = [], i = 0; i < str.length; i++)
7786 bytes.push(str.charCodeAt(i) & 0xFF);
7787 return bytes;
7788 },
7789
7790 // Convert a byte array to a string
7791 bytesToString: function(bytes) {
7792 for (var str = [], i = 0; i < bytes.length; i++)
7793 str.push(String.fromCharCode(bytes[i]));
7794 return str.join('');
7795 }
7796 }
7797};
7798
7799module.exports = charenc;
7800
7801
7802/***/ }),
7803/* 236 */
7804/***/ (function(module, exports, __webpack_require__) {
7805
7806"use strict";
7807
7808
7809module.exports = __webpack_require__(237);
7810
7811/***/ }),
7812/* 237 */
7813/***/ (function(module, exports, __webpack_require__) {
7814
7815"use strict";
7816
7817
7818var _interopRequireDefault = __webpack_require__(2);
7819
7820var _promise = _interopRequireDefault(__webpack_require__(10));
7821
7822/*!
7823 * LeanCloud JavaScript SDK
7824 * https://leancloud.cn
7825 *
7826 * Copyright 2016 LeanCloud.cn, Inc.
7827 * The LeanCloud JavaScript SDK is freely distributable under the MIT license.
7828 */
7829var _ = __webpack_require__(1);
7830
7831var AV = __webpack_require__(59);
7832
7833AV._ = _;
7834AV.version = __webpack_require__(217);
7835AV.Promise = _promise.default;
7836AV.localStorage = __webpack_require__(219);
7837AV.Cache = __webpack_require__(220);
7838AV.Error = __webpack_require__(40);
7839
7840__webpack_require__(382);
7841
7842__webpack_require__(436)(AV);
7843
7844__webpack_require__(437)(AV);
7845
7846__webpack_require__(438)(AV);
7847
7848__webpack_require__(439)(AV);
7849
7850__webpack_require__(444)(AV);
7851
7852__webpack_require__(445)(AV);
7853
7854__webpack_require__(500)(AV);
7855
7856__webpack_require__(526)(AV);
7857
7858__webpack_require__(527)(AV);
7859
7860__webpack_require__(529)(AV);
7861
7862__webpack_require__(530)(AV);
7863
7864__webpack_require__(531)(AV);
7865
7866__webpack_require__(532)(AV);
7867
7868__webpack_require__(533)(AV);
7869
7870__webpack_require__(534)(AV);
7871
7872__webpack_require__(535)(AV);
7873
7874__webpack_require__(536)(AV);
7875
7876__webpack_require__(537)(AV);
7877
7878AV.Conversation = __webpack_require__(538);
7879
7880__webpack_require__(539);
7881
7882module.exports = AV;
7883/**
7884 * Options to controll the authentication for an operation
7885 * @typedef {Object} AuthOptions
7886 * @property {String} [sessionToken] Specify a user to excute the operation as.
7887 * @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.
7888 * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
7889 */
7890
7891/**
7892 * Options to controll the authentication for an SMS operation
7893 * @typedef {Object} SMSAuthOptions
7894 * @property {String} [sessionToken] Specify a user to excute the operation as.
7895 * @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.
7896 * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
7897 * @property {String} [validateToken] a validate token returned by {@link AV.Cloud.verifyCaptcha}
7898 */
7899
7900/***/ }),
7901/* 238 */
7902/***/ (function(module, exports, __webpack_require__) {
7903
7904var parent = __webpack_require__(239);
7905__webpack_require__(73);
7906
7907module.exports = parent;
7908
7909
7910/***/ }),
7911/* 239 */
7912/***/ (function(module, exports, __webpack_require__) {
7913
7914__webpack_require__(240);
7915__webpack_require__(70);
7916__webpack_require__(92);
7917__webpack_require__(258);
7918__webpack_require__(274);
7919__webpack_require__(275);
7920__webpack_require__(276);
7921__webpack_require__(95);
7922var path = __webpack_require__(13);
7923
7924module.exports = path.Promise;
7925
7926
7927/***/ }),
7928/* 240 */
7929/***/ (function(module, exports, __webpack_require__) {
7930
7931// TODO: Remove this module from `core-js@4` since it's replaced to module below
7932__webpack_require__(241);
7933
7934
7935/***/ }),
7936/* 241 */
7937/***/ (function(module, exports, __webpack_require__) {
7938
7939"use strict";
7940
7941var $ = __webpack_require__(0);
7942var isPrototypeOf = __webpack_require__(20);
7943var getPrototypeOf = __webpack_require__(86);
7944var setPrototypeOf = __webpack_require__(88);
7945var copyConstructorProperties = __webpack_require__(246);
7946var create = __webpack_require__(51);
7947var createNonEnumerableProperty = __webpack_require__(36);
7948var createPropertyDescriptor = __webpack_require__(41);
7949var clearErrorStack = __webpack_require__(250);
7950var installErrorCause = __webpack_require__(251);
7951var iterate = __webpack_require__(68);
7952var normalizeStringArgument = __webpack_require__(252);
7953var wellKnownSymbol = __webpack_require__(8);
7954var ERROR_STACK_INSTALLABLE = __webpack_require__(253);
7955
7956var TO_STRING_TAG = wellKnownSymbol('toStringTag');
7957var $Error = Error;
7958var push = [].push;
7959
7960var $AggregateError = function AggregateError(errors, message /* , options */) {
7961 var options = arguments.length > 2 ? arguments[2] : undefined;
7962 var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
7963 var that;
7964 if (setPrototypeOf) {
7965 that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
7966 } else {
7967 that = isInstance ? this : create(AggregateErrorPrototype);
7968 createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
7969 }
7970 if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
7971 if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
7972 installErrorCause(that, options);
7973 var errorsArray = [];
7974 iterate(errors, push, { that: errorsArray });
7975 createNonEnumerableProperty(that, 'errors', errorsArray);
7976 return that;
7977};
7978
7979if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
7980else copyConstructorProperties($AggregateError, $Error, { name: true });
7981
7982var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
7983 constructor: createPropertyDescriptor(1, $AggregateError),
7984 message: createPropertyDescriptor(1, ''),
7985 name: createPropertyDescriptor(1, 'AggregateError')
7986});
7987
7988// `AggregateError` constructor
7989// https://tc39.es/ecma262/#sec-aggregate-error-constructor
7990$({ global: true, constructor: true, arity: 2 }, {
7991 AggregateError: $AggregateError
7992});
7993
7994
7995/***/ }),
7996/* 242 */
7997/***/ (function(module, exports, __webpack_require__) {
7998
7999var call = __webpack_require__(11);
8000var isObject = __webpack_require__(17);
8001var isSymbol = __webpack_require__(83);
8002var getMethod = __webpack_require__(107);
8003var ordinaryToPrimitive = __webpack_require__(243);
8004var wellKnownSymbol = __webpack_require__(8);
8005
8006var $TypeError = TypeError;
8007var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
8008
8009// `ToPrimitive` abstract operation
8010// https://tc39.es/ecma262/#sec-toprimitive
8011module.exports = function (input, pref) {
8012 if (!isObject(input) || isSymbol(input)) return input;
8013 var exoticToPrim = getMethod(input, TO_PRIMITIVE);
8014 var result;
8015 if (exoticToPrim) {
8016 if (pref === undefined) pref = 'default';
8017 result = call(exoticToPrim, input, pref);
8018 if (!isObject(result) || isSymbol(result)) return result;
8019 throw $TypeError("Can't convert object to primitive value");
8020 }
8021 if (pref === undefined) pref = 'number';
8022 return ordinaryToPrimitive(input, pref);
8023};
8024
8025
8026/***/ }),
8027/* 243 */
8028/***/ (function(module, exports, __webpack_require__) {
8029
8030var call = __webpack_require__(11);
8031var isCallable = __webpack_require__(7);
8032var isObject = __webpack_require__(17);
8033
8034var $TypeError = TypeError;
8035
8036// `OrdinaryToPrimitive` abstract operation
8037// https://tc39.es/ecma262/#sec-ordinarytoprimitive
8038module.exports = function (input, pref) {
8039 var fn, val;
8040 if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
8041 if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
8042 if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
8043 throw $TypeError("Can't convert object to primitive value");
8044};
8045
8046
8047/***/ }),
8048/* 244 */
8049/***/ (function(module, exports, __webpack_require__) {
8050
8051var global = __webpack_require__(9);
8052
8053// eslint-disable-next-line es-x/no-object-defineproperty -- safe
8054var defineProperty = Object.defineProperty;
8055
8056module.exports = function (key, value) {
8057 try {
8058 defineProperty(global, key, { value: value, configurable: true, writable: true });
8059 } catch (error) {
8060 global[key] = value;
8061 } return value;
8062};
8063
8064
8065/***/ }),
8066/* 245 */
8067/***/ (function(module, exports, __webpack_require__) {
8068
8069var isCallable = __webpack_require__(7);
8070
8071var $String = String;
8072var $TypeError = TypeError;
8073
8074module.exports = function (argument) {
8075 if (typeof argument == 'object' || isCallable(argument)) return argument;
8076 throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
8077};
8078
8079
8080/***/ }),
8081/* 246 */
8082/***/ (function(module, exports, __webpack_require__) {
8083
8084var hasOwn = __webpack_require__(14);
8085var ownKeys = __webpack_require__(247);
8086var getOwnPropertyDescriptorModule = __webpack_require__(64);
8087var definePropertyModule = __webpack_require__(32);
8088
8089module.exports = function (target, source, exceptions) {
8090 var keys = ownKeys(source);
8091 var defineProperty = definePropertyModule.f;
8092 var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
8093 for (var i = 0; i < keys.length; i++) {
8094 var key = keys[i];
8095 if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
8096 defineProperty(target, key, getOwnPropertyDescriptor(source, key));
8097 }
8098 }
8099};
8100
8101
8102/***/ }),
8103/* 247 */
8104/***/ (function(module, exports, __webpack_require__) {
8105
8106var getBuiltIn = __webpack_require__(16);
8107var uncurryThis = __webpack_require__(6);
8108var getOwnPropertyNamesModule = __webpack_require__(111);
8109var getOwnPropertySymbolsModule = __webpack_require__(115);
8110var anObject = __webpack_require__(21);
8111
8112var concat = uncurryThis([].concat);
8113
8114// all object keys, includes non-enumerable and symbols
8115module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
8116 var keys = getOwnPropertyNamesModule.f(anObject(it));
8117 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
8118 return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
8119};
8120
8121
8122/***/ }),
8123/* 248 */
8124/***/ (function(module, exports) {
8125
8126var ceil = Math.ceil;
8127var floor = Math.floor;
8128
8129// `Math.trunc` method
8130// https://tc39.es/ecma262/#sec-math.trunc
8131// eslint-disable-next-line es-x/no-math-trunc -- safe
8132module.exports = Math.trunc || function trunc(x) {
8133 var n = +x;
8134 return (n > 0 ? floor : ceil)(n);
8135};
8136
8137
8138/***/ }),
8139/* 249 */
8140/***/ (function(module, exports, __webpack_require__) {
8141
8142var toIntegerOrInfinity = __webpack_require__(113);
8143
8144var min = Math.min;
8145
8146// `ToLength` abstract operation
8147// https://tc39.es/ecma262/#sec-tolength
8148module.exports = function (argument) {
8149 return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
8150};
8151
8152
8153/***/ }),
8154/* 250 */
8155/***/ (function(module, exports, __webpack_require__) {
8156
8157var uncurryThis = __webpack_require__(6);
8158
8159var $Error = Error;
8160var replace = uncurryThis(''.replace);
8161
8162var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
8163var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
8164var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
8165
8166module.exports = function (stack, dropEntries) {
8167 if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
8168 while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
8169 } return stack;
8170};
8171
8172
8173/***/ }),
8174/* 251 */
8175/***/ (function(module, exports, __webpack_require__) {
8176
8177var isObject = __webpack_require__(17);
8178var createNonEnumerableProperty = __webpack_require__(36);
8179
8180// `InstallErrorCause` abstract operation
8181// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
8182module.exports = function (O, options) {
8183 if (isObject(options) && 'cause' in options) {
8184 createNonEnumerableProperty(O, 'cause', options.cause);
8185 }
8186};
8187
8188
8189/***/ }),
8190/* 252 */
8191/***/ (function(module, exports, __webpack_require__) {
8192
8193var toString = __webpack_require__(69);
8194
8195module.exports = function (argument, $default) {
8196 return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
8197};
8198
8199
8200/***/ }),
8201/* 253 */
8202/***/ (function(module, exports, __webpack_require__) {
8203
8204var fails = __webpack_require__(4);
8205var createPropertyDescriptor = __webpack_require__(41);
8206
8207module.exports = !fails(function () {
8208 var error = Error('a');
8209 if (!('stack' in error)) return true;
8210 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
8211 Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
8212 return error.stack !== 7;
8213});
8214
8215
8216/***/ }),
8217/* 254 */
8218/***/ (function(module, exports, __webpack_require__) {
8219
8220var global = __webpack_require__(9);
8221var isCallable = __webpack_require__(7);
8222var inspectSource = __webpack_require__(118);
8223
8224var WeakMap = global.WeakMap;
8225
8226module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
8227
8228
8229/***/ }),
8230/* 255 */
8231/***/ (function(module, exports, __webpack_require__) {
8232
8233var DESCRIPTORS = __webpack_require__(19);
8234var hasOwn = __webpack_require__(14);
8235
8236var FunctionPrototype = Function.prototype;
8237// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
8238var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
8239
8240var EXISTS = hasOwn(FunctionPrototype, 'name');
8241// additional protection from minified / mangled / dropped function names
8242var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
8243var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
8244
8245module.exports = {
8246 EXISTS: EXISTS,
8247 PROPER: PROPER,
8248 CONFIGURABLE: CONFIGURABLE
8249};
8250
8251
8252/***/ }),
8253/* 256 */
8254/***/ (function(module, exports, __webpack_require__) {
8255
8256"use strict";
8257
8258var IteratorPrototype = __webpack_require__(154).IteratorPrototype;
8259var create = __webpack_require__(51);
8260var createPropertyDescriptor = __webpack_require__(41);
8261var setToStringTag = __webpack_require__(54);
8262var Iterators = __webpack_require__(52);
8263
8264var returnThis = function () { return this; };
8265
8266module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
8267 var TO_STRING_TAG = NAME + ' Iterator';
8268 IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
8269 setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
8270 Iterators[TO_STRING_TAG] = returnThis;
8271 return IteratorConstructor;
8272};
8273
8274
8275/***/ }),
8276/* 257 */
8277/***/ (function(module, exports, __webpack_require__) {
8278
8279"use strict";
8280
8281var TO_STRING_TAG_SUPPORT = __webpack_require__(117);
8282var classof = __webpack_require__(53);
8283
8284// `Object.prototype.toString` method implementation
8285// https://tc39.es/ecma262/#sec-object.prototype.tostring
8286module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
8287 return '[object ' + classof(this) + ']';
8288};
8289
8290
8291/***/ }),
8292/* 258 */
8293/***/ (function(module, exports, __webpack_require__) {
8294
8295// TODO: Remove this module from `core-js@4` since it's split to modules listed below
8296__webpack_require__(259);
8297__webpack_require__(269);
8298__webpack_require__(270);
8299__webpack_require__(271);
8300__webpack_require__(272);
8301__webpack_require__(273);
8302
8303
8304/***/ }),
8305/* 259 */
8306/***/ (function(module, exports, __webpack_require__) {
8307
8308"use strict";
8309
8310var $ = __webpack_require__(0);
8311var IS_PURE = __webpack_require__(31);
8312var IS_NODE = __webpack_require__(119);
8313var global = __webpack_require__(9);
8314var call = __webpack_require__(11);
8315var defineBuiltIn = __webpack_require__(43);
8316var setPrototypeOf = __webpack_require__(88);
8317var setToStringTag = __webpack_require__(54);
8318var setSpecies = __webpack_require__(260);
8319var aCallable = __webpack_require__(30);
8320var isCallable = __webpack_require__(7);
8321var isObject = __webpack_require__(17);
8322var anInstance = __webpack_require__(261);
8323var speciesConstructor = __webpack_require__(155);
8324var task = __webpack_require__(157).set;
8325var microtask = __webpack_require__(263);
8326var hostReportErrors = __webpack_require__(266);
8327var perform = __webpack_require__(71);
8328var Queue = __webpack_require__(267);
8329var InternalStateModule = __webpack_require__(91);
8330var NativePromiseConstructor = __webpack_require__(55);
8331var PromiseConstructorDetection = __webpack_require__(72);
8332var newPromiseCapabilityModule = __webpack_require__(44);
8333
8334var PROMISE = 'Promise';
8335var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
8336var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
8337var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
8338var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
8339var setInternalState = InternalStateModule.set;
8340var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
8341var PromiseConstructor = NativePromiseConstructor;
8342var PromisePrototype = NativePromisePrototype;
8343var TypeError = global.TypeError;
8344var document = global.document;
8345var process = global.process;
8346var newPromiseCapability = newPromiseCapabilityModule.f;
8347var newGenericPromiseCapability = newPromiseCapability;
8348
8349var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
8350var UNHANDLED_REJECTION = 'unhandledrejection';
8351var REJECTION_HANDLED = 'rejectionhandled';
8352var PENDING = 0;
8353var FULFILLED = 1;
8354var REJECTED = 2;
8355var HANDLED = 1;
8356var UNHANDLED = 2;
8357
8358var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
8359
8360// helpers
8361var isThenable = function (it) {
8362 var then;
8363 return isObject(it) && isCallable(then = it.then) ? then : false;
8364};
8365
8366var callReaction = function (reaction, state) {
8367 var value = state.value;
8368 var ok = state.state == FULFILLED;
8369 var handler = ok ? reaction.ok : reaction.fail;
8370 var resolve = reaction.resolve;
8371 var reject = reaction.reject;
8372 var domain = reaction.domain;
8373 var result, then, exited;
8374 try {
8375 if (handler) {
8376 if (!ok) {
8377 if (state.rejection === UNHANDLED) onHandleUnhandled(state);
8378 state.rejection = HANDLED;
8379 }
8380 if (handler === true) result = value;
8381 else {
8382 if (domain) domain.enter();
8383 result = handler(value); // can throw
8384 if (domain) {
8385 domain.exit();
8386 exited = true;
8387 }
8388 }
8389 if (result === reaction.promise) {
8390 reject(TypeError('Promise-chain cycle'));
8391 } else if (then = isThenable(result)) {
8392 call(then, result, resolve, reject);
8393 } else resolve(result);
8394 } else reject(value);
8395 } catch (error) {
8396 if (domain && !exited) domain.exit();
8397 reject(error);
8398 }
8399};
8400
8401var notify = function (state, isReject) {
8402 if (state.notified) return;
8403 state.notified = true;
8404 microtask(function () {
8405 var reactions = state.reactions;
8406 var reaction;
8407 while (reaction = reactions.get()) {
8408 callReaction(reaction, state);
8409 }
8410 state.notified = false;
8411 if (isReject && !state.rejection) onUnhandled(state);
8412 });
8413};
8414
8415var dispatchEvent = function (name, promise, reason) {
8416 var event, handler;
8417 if (DISPATCH_EVENT) {
8418 event = document.createEvent('Event');
8419 event.promise = promise;
8420 event.reason = reason;
8421 event.initEvent(name, false, true);
8422 global.dispatchEvent(event);
8423 } else event = { promise: promise, reason: reason };
8424 if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
8425 else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
8426};
8427
8428var onUnhandled = function (state) {
8429 call(task, global, function () {
8430 var promise = state.facade;
8431 var value = state.value;
8432 var IS_UNHANDLED = isUnhandled(state);
8433 var result;
8434 if (IS_UNHANDLED) {
8435 result = perform(function () {
8436 if (IS_NODE) {
8437 process.emit('unhandledRejection', value, promise);
8438 } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
8439 });
8440 // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
8441 state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
8442 if (result.error) throw result.value;
8443 }
8444 });
8445};
8446
8447var isUnhandled = function (state) {
8448 return state.rejection !== HANDLED && !state.parent;
8449};
8450
8451var onHandleUnhandled = function (state) {
8452 call(task, global, function () {
8453 var promise = state.facade;
8454 if (IS_NODE) {
8455 process.emit('rejectionHandled', promise);
8456 } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
8457 });
8458};
8459
8460var bind = function (fn, state, unwrap) {
8461 return function (value) {
8462 fn(state, value, unwrap);
8463 };
8464};
8465
8466var internalReject = function (state, value, unwrap) {
8467 if (state.done) return;
8468 state.done = true;
8469 if (unwrap) state = unwrap;
8470 state.value = value;
8471 state.state = REJECTED;
8472 notify(state, true);
8473};
8474
8475var internalResolve = function (state, value, unwrap) {
8476 if (state.done) return;
8477 state.done = true;
8478 if (unwrap) state = unwrap;
8479 try {
8480 if (state.facade === value) throw TypeError("Promise can't be resolved itself");
8481 var then = isThenable(value);
8482 if (then) {
8483 microtask(function () {
8484 var wrapper = { done: false };
8485 try {
8486 call(then, value,
8487 bind(internalResolve, wrapper, state),
8488 bind(internalReject, wrapper, state)
8489 );
8490 } catch (error) {
8491 internalReject(wrapper, error, state);
8492 }
8493 });
8494 } else {
8495 state.value = value;
8496 state.state = FULFILLED;
8497 notify(state, false);
8498 }
8499 } catch (error) {
8500 internalReject({ done: false }, error, state);
8501 }
8502};
8503
8504// constructor polyfill
8505if (FORCED_PROMISE_CONSTRUCTOR) {
8506 // 25.4.3.1 Promise(executor)
8507 PromiseConstructor = function Promise(executor) {
8508 anInstance(this, PromisePrototype);
8509 aCallable(executor);
8510 call(Internal, this);
8511 var state = getInternalPromiseState(this);
8512 try {
8513 executor(bind(internalResolve, state), bind(internalReject, state));
8514 } catch (error) {
8515 internalReject(state, error);
8516 }
8517 };
8518
8519 PromisePrototype = PromiseConstructor.prototype;
8520
8521 // eslint-disable-next-line no-unused-vars -- required for `.length`
8522 Internal = function Promise(executor) {
8523 setInternalState(this, {
8524 type: PROMISE,
8525 done: false,
8526 notified: false,
8527 parent: false,
8528 reactions: new Queue(),
8529 rejection: false,
8530 state: PENDING,
8531 value: undefined
8532 });
8533 };
8534
8535 // `Promise.prototype.then` method
8536 // https://tc39.es/ecma262/#sec-promise.prototype.then
8537 Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
8538 var state = getInternalPromiseState(this);
8539 var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
8540 state.parent = true;
8541 reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
8542 reaction.fail = isCallable(onRejected) && onRejected;
8543 reaction.domain = IS_NODE ? process.domain : undefined;
8544 if (state.state == PENDING) state.reactions.add(reaction);
8545 else microtask(function () {
8546 callReaction(reaction, state);
8547 });
8548 return reaction.promise;
8549 });
8550
8551 OwnPromiseCapability = function () {
8552 var promise = new Internal();
8553 var state = getInternalPromiseState(promise);
8554 this.promise = promise;
8555 this.resolve = bind(internalResolve, state);
8556 this.reject = bind(internalReject, state);
8557 };
8558
8559 newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
8560 return C === PromiseConstructor || C === PromiseWrapper
8561 ? new OwnPromiseCapability(C)
8562 : newGenericPromiseCapability(C);
8563 };
8564
8565 if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
8566 nativeThen = NativePromisePrototype.then;
8567
8568 if (!NATIVE_PROMISE_SUBCLASSING) {
8569 // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
8570 defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
8571 var that = this;
8572 return new PromiseConstructor(function (resolve, reject) {
8573 call(nativeThen, that, resolve, reject);
8574 }).then(onFulfilled, onRejected);
8575 // https://github.com/zloirock/core-js/issues/640
8576 }, { unsafe: true });
8577 }
8578
8579 // make `.constructor === Promise` work for native promise-based APIs
8580 try {
8581 delete NativePromisePrototype.constructor;
8582 } catch (error) { /* empty */ }
8583
8584 // make `instanceof Promise` work for native promise-based APIs
8585 if (setPrototypeOf) {
8586 setPrototypeOf(NativePromisePrototype, PromisePrototype);
8587 }
8588 }
8589}
8590
8591$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
8592 Promise: PromiseConstructor
8593});
8594
8595setToStringTag(PromiseConstructor, PROMISE, false, true);
8596setSpecies(PROMISE);
8597
8598
8599/***/ }),
8600/* 260 */
8601/***/ (function(module, exports, __webpack_require__) {
8602
8603"use strict";
8604
8605var getBuiltIn = __webpack_require__(16);
8606var definePropertyModule = __webpack_require__(32);
8607var wellKnownSymbol = __webpack_require__(8);
8608var DESCRIPTORS = __webpack_require__(19);
8609
8610var SPECIES = wellKnownSymbol('species');
8611
8612module.exports = function (CONSTRUCTOR_NAME) {
8613 var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
8614 var defineProperty = definePropertyModule.f;
8615
8616 if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
8617 defineProperty(Constructor, SPECIES, {
8618 configurable: true,
8619 get: function () { return this; }
8620 });
8621 }
8622};
8623
8624
8625/***/ }),
8626/* 261 */
8627/***/ (function(module, exports, __webpack_require__) {
8628
8629var isPrototypeOf = __webpack_require__(20);
8630
8631var $TypeError = TypeError;
8632
8633module.exports = function (it, Prototype) {
8634 if (isPrototypeOf(Prototype, it)) return it;
8635 throw $TypeError('Incorrect invocation');
8636};
8637
8638
8639/***/ }),
8640/* 262 */
8641/***/ (function(module, exports) {
8642
8643var $TypeError = TypeError;
8644
8645module.exports = function (passed, required) {
8646 if (passed < required) throw $TypeError('Not enough arguments');
8647 return passed;
8648};
8649
8650
8651/***/ }),
8652/* 263 */
8653/***/ (function(module, exports, __webpack_require__) {
8654
8655var global = __webpack_require__(9);
8656var bind = __webpack_require__(50);
8657var getOwnPropertyDescriptor = __webpack_require__(64).f;
8658var macrotask = __webpack_require__(157).set;
8659var IS_IOS = __webpack_require__(158);
8660var IS_IOS_PEBBLE = __webpack_require__(264);
8661var IS_WEBOS_WEBKIT = __webpack_require__(265);
8662var IS_NODE = __webpack_require__(119);
8663
8664var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
8665var document = global.document;
8666var process = global.process;
8667var Promise = global.Promise;
8668// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
8669var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
8670var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
8671
8672var flush, head, last, notify, toggle, node, promise, then;
8673
8674// modern engines have queueMicrotask method
8675if (!queueMicrotask) {
8676 flush = function () {
8677 var parent, fn;
8678 if (IS_NODE && (parent = process.domain)) parent.exit();
8679 while (head) {
8680 fn = head.fn;
8681 head = head.next;
8682 try {
8683 fn();
8684 } catch (error) {
8685 if (head) notify();
8686 else last = undefined;
8687 throw error;
8688 }
8689 } last = undefined;
8690 if (parent) parent.enter();
8691 };
8692
8693 // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
8694 // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
8695 if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
8696 toggle = true;
8697 node = document.createTextNode('');
8698 new MutationObserver(flush).observe(node, { characterData: true });
8699 notify = function () {
8700 node.data = toggle = !toggle;
8701 };
8702 // environments with maybe non-completely correct, but existent Promise
8703 } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
8704 // Promise.resolve without an argument throws an error in LG WebOS 2
8705 promise = Promise.resolve(undefined);
8706 // workaround of WebKit ~ iOS Safari 10.1 bug
8707 promise.constructor = Promise;
8708 then = bind(promise.then, promise);
8709 notify = function () {
8710 then(flush);
8711 };
8712 // Node.js without promises
8713 } else if (IS_NODE) {
8714 notify = function () {
8715 process.nextTick(flush);
8716 };
8717 // for other environments - macrotask based on:
8718 // - setImmediate
8719 // - MessageChannel
8720 // - window.postMessage
8721 // - onreadystatechange
8722 // - setTimeout
8723 } else {
8724 // strange IE + webpack dev server bug - use .bind(global)
8725 macrotask = bind(macrotask, global);
8726 notify = function () {
8727 macrotask(flush);
8728 };
8729 }
8730}
8731
8732module.exports = queueMicrotask || function (fn) {
8733 var task = { fn: fn, next: undefined };
8734 if (last) last.next = task;
8735 if (!head) {
8736 head = task;
8737 notify();
8738 } last = task;
8739};
8740
8741
8742/***/ }),
8743/* 264 */
8744/***/ (function(module, exports, __webpack_require__) {
8745
8746var userAgent = __webpack_require__(85);
8747var global = __webpack_require__(9);
8748
8749module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
8750
8751
8752/***/ }),
8753/* 265 */
8754/***/ (function(module, exports, __webpack_require__) {
8755
8756var userAgent = __webpack_require__(85);
8757
8758module.exports = /web0s(?!.*chrome)/i.test(userAgent);
8759
8760
8761/***/ }),
8762/* 266 */
8763/***/ (function(module, exports, __webpack_require__) {
8764
8765var global = __webpack_require__(9);
8766
8767module.exports = function (a, b) {
8768 var console = global.console;
8769 if (console && console.error) {
8770 arguments.length == 1 ? console.error(a) : console.error(a, b);
8771 }
8772};
8773
8774
8775/***/ }),
8776/* 267 */
8777/***/ (function(module, exports) {
8778
8779var Queue = function () {
8780 this.head = null;
8781 this.tail = null;
8782};
8783
8784Queue.prototype = {
8785 add: function (item) {
8786 var entry = { item: item, next: null };
8787 if (this.head) this.tail.next = entry;
8788 else this.head = entry;
8789 this.tail = entry;
8790 },
8791 get: function () {
8792 var entry = this.head;
8793 if (entry) {
8794 this.head = entry.next;
8795 if (this.tail === entry) this.tail = null;
8796 return entry.item;
8797 }
8798 }
8799};
8800
8801module.exports = Queue;
8802
8803
8804/***/ }),
8805/* 268 */
8806/***/ (function(module, exports) {
8807
8808module.exports = typeof window == 'object' && typeof Deno != 'object';
8809
8810
8811/***/ }),
8812/* 269 */
8813/***/ (function(module, exports, __webpack_require__) {
8814
8815"use strict";
8816
8817var $ = __webpack_require__(0);
8818var call = __webpack_require__(11);
8819var aCallable = __webpack_require__(30);
8820var newPromiseCapabilityModule = __webpack_require__(44);
8821var perform = __webpack_require__(71);
8822var iterate = __webpack_require__(68);
8823var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(159);
8824
8825// `Promise.all` method
8826// https://tc39.es/ecma262/#sec-promise.all
8827$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
8828 all: function all(iterable) {
8829 var C = this;
8830 var capability = newPromiseCapabilityModule.f(C);
8831 var resolve = capability.resolve;
8832 var reject = capability.reject;
8833 var result = perform(function () {
8834 var $promiseResolve = aCallable(C.resolve);
8835 var values = [];
8836 var counter = 0;
8837 var remaining = 1;
8838 iterate(iterable, function (promise) {
8839 var index = counter++;
8840 var alreadyCalled = false;
8841 remaining++;
8842 call($promiseResolve, C, promise).then(function (value) {
8843 if (alreadyCalled) return;
8844 alreadyCalled = true;
8845 values[index] = value;
8846 --remaining || resolve(values);
8847 }, reject);
8848 });
8849 --remaining || resolve(values);
8850 });
8851 if (result.error) reject(result.value);
8852 return capability.promise;
8853 }
8854});
8855
8856
8857/***/ }),
8858/* 270 */
8859/***/ (function(module, exports, __webpack_require__) {
8860
8861"use strict";
8862
8863var $ = __webpack_require__(0);
8864var IS_PURE = __webpack_require__(31);
8865var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(72).CONSTRUCTOR;
8866var NativePromiseConstructor = __webpack_require__(55);
8867var getBuiltIn = __webpack_require__(16);
8868var isCallable = __webpack_require__(7);
8869var defineBuiltIn = __webpack_require__(43);
8870
8871var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
8872
8873// `Promise.prototype.catch` method
8874// https://tc39.es/ecma262/#sec-promise.prototype.catch
8875$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
8876 'catch': function (onRejected) {
8877 return this.then(undefined, onRejected);
8878 }
8879});
8880
8881// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
8882if (!IS_PURE && isCallable(NativePromiseConstructor)) {
8883 var method = getBuiltIn('Promise').prototype['catch'];
8884 if (NativePromisePrototype['catch'] !== method) {
8885 defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
8886 }
8887}
8888
8889
8890/***/ }),
8891/* 271 */
8892/***/ (function(module, exports, __webpack_require__) {
8893
8894"use strict";
8895
8896var $ = __webpack_require__(0);
8897var call = __webpack_require__(11);
8898var aCallable = __webpack_require__(30);
8899var newPromiseCapabilityModule = __webpack_require__(44);
8900var perform = __webpack_require__(71);
8901var iterate = __webpack_require__(68);
8902var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(159);
8903
8904// `Promise.race` method
8905// https://tc39.es/ecma262/#sec-promise.race
8906$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
8907 race: function race(iterable) {
8908 var C = this;
8909 var capability = newPromiseCapabilityModule.f(C);
8910 var reject = capability.reject;
8911 var result = perform(function () {
8912 var $promiseResolve = aCallable(C.resolve);
8913 iterate(iterable, function (promise) {
8914 call($promiseResolve, C, promise).then(capability.resolve, reject);
8915 });
8916 });
8917 if (result.error) reject(result.value);
8918 return capability.promise;
8919 }
8920});
8921
8922
8923/***/ }),
8924/* 272 */
8925/***/ (function(module, exports, __webpack_require__) {
8926
8927"use strict";
8928
8929var $ = __webpack_require__(0);
8930var call = __webpack_require__(11);
8931var newPromiseCapabilityModule = __webpack_require__(44);
8932var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(72).CONSTRUCTOR;
8933
8934// `Promise.reject` method
8935// https://tc39.es/ecma262/#sec-promise.reject
8936$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
8937 reject: function reject(r) {
8938 var capability = newPromiseCapabilityModule.f(this);
8939 call(capability.reject, undefined, r);
8940 return capability.promise;
8941 }
8942});
8943
8944
8945/***/ }),
8946/* 273 */
8947/***/ (function(module, exports, __webpack_require__) {
8948
8949"use strict";
8950
8951var $ = __webpack_require__(0);
8952var getBuiltIn = __webpack_require__(16);
8953var IS_PURE = __webpack_require__(31);
8954var NativePromiseConstructor = __webpack_require__(55);
8955var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(72).CONSTRUCTOR;
8956var promiseResolve = __webpack_require__(161);
8957
8958var PromiseConstructorWrapper = getBuiltIn('Promise');
8959var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
8960
8961// `Promise.resolve` method
8962// https://tc39.es/ecma262/#sec-promise.resolve
8963$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
8964 resolve: function resolve(x) {
8965 return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
8966 }
8967});
8968
8969
8970/***/ }),
8971/* 274 */
8972/***/ (function(module, exports, __webpack_require__) {
8973
8974"use strict";
8975
8976var $ = __webpack_require__(0);
8977var call = __webpack_require__(11);
8978var aCallable = __webpack_require__(30);
8979var newPromiseCapabilityModule = __webpack_require__(44);
8980var perform = __webpack_require__(71);
8981var iterate = __webpack_require__(68);
8982
8983// `Promise.allSettled` method
8984// https://tc39.es/ecma262/#sec-promise.allsettled
8985$({ target: 'Promise', stat: true }, {
8986 allSettled: function allSettled(iterable) {
8987 var C = this;
8988 var capability = newPromiseCapabilityModule.f(C);
8989 var resolve = capability.resolve;
8990 var reject = capability.reject;
8991 var result = perform(function () {
8992 var promiseResolve = aCallable(C.resolve);
8993 var values = [];
8994 var counter = 0;
8995 var remaining = 1;
8996 iterate(iterable, function (promise) {
8997 var index = counter++;
8998 var alreadyCalled = false;
8999 remaining++;
9000 call(promiseResolve, C, promise).then(function (value) {
9001 if (alreadyCalled) return;
9002 alreadyCalled = true;
9003 values[index] = { status: 'fulfilled', value: value };
9004 --remaining || resolve(values);
9005 }, function (error) {
9006 if (alreadyCalled) return;
9007 alreadyCalled = true;
9008 values[index] = { status: 'rejected', reason: error };
9009 --remaining || resolve(values);
9010 });
9011 });
9012 --remaining || resolve(values);
9013 });
9014 if (result.error) reject(result.value);
9015 return capability.promise;
9016 }
9017});
9018
9019
9020/***/ }),
9021/* 275 */
9022/***/ (function(module, exports, __webpack_require__) {
9023
9024"use strict";
9025
9026var $ = __webpack_require__(0);
9027var call = __webpack_require__(11);
9028var aCallable = __webpack_require__(30);
9029var getBuiltIn = __webpack_require__(16);
9030var newPromiseCapabilityModule = __webpack_require__(44);
9031var perform = __webpack_require__(71);
9032var iterate = __webpack_require__(68);
9033
9034var PROMISE_ANY_ERROR = 'No one promise resolved';
9035
9036// `Promise.any` method
9037// https://tc39.es/ecma262/#sec-promise.any
9038$({ target: 'Promise', stat: true }, {
9039 any: function any(iterable) {
9040 var C = this;
9041 var AggregateError = getBuiltIn('AggregateError');
9042 var capability = newPromiseCapabilityModule.f(C);
9043 var resolve = capability.resolve;
9044 var reject = capability.reject;
9045 var result = perform(function () {
9046 var promiseResolve = aCallable(C.resolve);
9047 var errors = [];
9048 var counter = 0;
9049 var remaining = 1;
9050 var alreadyResolved = false;
9051 iterate(iterable, function (promise) {
9052 var index = counter++;
9053 var alreadyRejected = false;
9054 remaining++;
9055 call(promiseResolve, C, promise).then(function (value) {
9056 if (alreadyRejected || alreadyResolved) return;
9057 alreadyResolved = true;
9058 resolve(value);
9059 }, function (error) {
9060 if (alreadyRejected || alreadyResolved) return;
9061 alreadyRejected = true;
9062 errors[index] = error;
9063 --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
9064 });
9065 });
9066 --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
9067 });
9068 if (result.error) reject(result.value);
9069 return capability.promise;
9070 }
9071});
9072
9073
9074/***/ }),
9075/* 276 */
9076/***/ (function(module, exports, __webpack_require__) {
9077
9078"use strict";
9079
9080var $ = __webpack_require__(0);
9081var IS_PURE = __webpack_require__(31);
9082var NativePromiseConstructor = __webpack_require__(55);
9083var fails = __webpack_require__(4);
9084var getBuiltIn = __webpack_require__(16);
9085var isCallable = __webpack_require__(7);
9086var speciesConstructor = __webpack_require__(155);
9087var promiseResolve = __webpack_require__(161);
9088var defineBuiltIn = __webpack_require__(43);
9089
9090var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
9091
9092// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
9093var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
9094 // eslint-disable-next-line unicorn/no-thenable -- required for testing
9095 NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
9096});
9097
9098// `Promise.prototype.finally` method
9099// https://tc39.es/ecma262/#sec-promise.prototype.finally
9100$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
9101 'finally': function (onFinally) {
9102 var C = speciesConstructor(this, getBuiltIn('Promise'));
9103 var isFunction = isCallable(onFinally);
9104 return this.then(
9105 isFunction ? function (x) {
9106 return promiseResolve(C, onFinally()).then(function () { return x; });
9107 } : onFinally,
9108 isFunction ? function (e) {
9109 return promiseResolve(C, onFinally()).then(function () { throw e; });
9110 } : onFinally
9111 );
9112 }
9113});
9114
9115// makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
9116if (!IS_PURE && isCallable(NativePromiseConstructor)) {
9117 var method = getBuiltIn('Promise').prototype['finally'];
9118 if (NativePromisePrototype['finally'] !== method) {
9119 defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
9120 }
9121}
9122
9123
9124/***/ }),
9125/* 277 */
9126/***/ (function(module, exports, __webpack_require__) {
9127
9128var uncurryThis = __webpack_require__(6);
9129var toIntegerOrInfinity = __webpack_require__(113);
9130var toString = __webpack_require__(69);
9131var requireObjectCoercible = __webpack_require__(106);
9132
9133var charAt = uncurryThis(''.charAt);
9134var charCodeAt = uncurryThis(''.charCodeAt);
9135var stringSlice = uncurryThis(''.slice);
9136
9137var createMethod = function (CONVERT_TO_STRING) {
9138 return function ($this, pos) {
9139 var S = toString(requireObjectCoercible($this));
9140 var position = toIntegerOrInfinity(pos);
9141 var size = S.length;
9142 var first, second;
9143 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
9144 first = charCodeAt(S, position);
9145 return first < 0xD800 || first > 0xDBFF || position + 1 === size
9146 || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
9147 ? CONVERT_TO_STRING
9148 ? charAt(S, position)
9149 : first
9150 : CONVERT_TO_STRING
9151 ? stringSlice(S, position, position + 2)
9152 : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
9153 };
9154};
9155
9156module.exports = {
9157 // `String.prototype.codePointAt` method
9158 // https://tc39.es/ecma262/#sec-string.prototype.codepointat
9159 codeAt: createMethod(false),
9160 // `String.prototype.at` method
9161 // https://github.com/mathiasbynens/String.prototype.at
9162 charAt: createMethod(true)
9163};
9164
9165
9166/***/ }),
9167/* 278 */
9168/***/ (function(module, exports) {
9169
9170// iterable DOM collections
9171// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
9172module.exports = {
9173 CSSRuleList: 0,
9174 CSSStyleDeclaration: 0,
9175 CSSValueList: 0,
9176 ClientRectList: 0,
9177 DOMRectList: 0,
9178 DOMStringList: 0,
9179 DOMTokenList: 1,
9180 DataTransferItemList: 0,
9181 FileList: 0,
9182 HTMLAllCollection: 0,
9183 HTMLCollection: 0,
9184 HTMLFormElement: 0,
9185 HTMLSelectElement: 0,
9186 MediaList: 0,
9187 MimeTypeArray: 0,
9188 NamedNodeMap: 0,
9189 NodeList: 1,
9190 PaintRequestList: 0,
9191 Plugin: 0,
9192 PluginArray: 0,
9193 SVGLengthList: 0,
9194 SVGNumberList: 0,
9195 SVGPathSegList: 0,
9196 SVGPointList: 0,
9197 SVGStringList: 0,
9198 SVGTransformList: 0,
9199 SourceBufferList: 0,
9200 StyleSheetList: 0,
9201 TextTrackCueList: 0,
9202 TextTrackList: 0,
9203 TouchList: 0
9204};
9205
9206
9207/***/ }),
9208/* 279 */
9209/***/ (function(module, __webpack_exports__, __webpack_require__) {
9210
9211"use strict";
9212/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_js__ = __webpack_require__(120);
9213// Default Export
9214// ==============
9215// In this module, we mix our bundled exports into the `_` object and export
9216// the result. This is analogous to setting `module.exports = _` in CommonJS.
9217// Hence, this module is also the entry point of our UMD bundle and the package
9218// entry point for CommonJS and AMD users. In other words, this is (the source
9219// of) the module you are interfacing with when you do any of the following:
9220//
9221// ```js
9222// // CommonJS
9223// var _ = require('underscore');
9224//
9225// // AMD
9226// define(['underscore'], function(_) {...});
9227//
9228// // UMD in the browser
9229// // _ is available as a global variable
9230// ```
9231
9232
9233
9234// Add all of the Underscore functions to the wrapper object.
9235var _ = Object(__WEBPACK_IMPORTED_MODULE_0__index_js__["mixin"])(__WEBPACK_IMPORTED_MODULE_0__index_js__);
9236// Legacy Node.js API.
9237_._ = _;
9238// Export the Underscore API.
9239/* harmony default export */ __webpack_exports__["a"] = (_);
9240
9241
9242/***/ }),
9243/* 280 */
9244/***/ (function(module, __webpack_exports__, __webpack_require__) {
9245
9246"use strict";
9247/* harmony export (immutable) */ __webpack_exports__["a"] = isNull;
9248// Is a given value equal to null?
9249function isNull(obj) {
9250 return obj === null;
9251}
9252
9253
9254/***/ }),
9255/* 281 */
9256/***/ (function(module, __webpack_exports__, __webpack_require__) {
9257
9258"use strict";
9259/* harmony export (immutable) */ __webpack_exports__["a"] = isElement;
9260// Is a given value a DOM element?
9261function isElement(obj) {
9262 return !!(obj && obj.nodeType === 1);
9263}
9264
9265
9266/***/ }),
9267/* 282 */
9268/***/ (function(module, __webpack_exports__, __webpack_require__) {
9269
9270"use strict";
9271/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9272
9273
9274/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Date'));
9275
9276
9277/***/ }),
9278/* 283 */
9279/***/ (function(module, __webpack_exports__, __webpack_require__) {
9280
9281"use strict";
9282/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9283
9284
9285/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('RegExp'));
9286
9287
9288/***/ }),
9289/* 284 */
9290/***/ (function(module, __webpack_exports__, __webpack_require__) {
9291
9292"use strict";
9293/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9294
9295
9296/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Error'));
9297
9298
9299/***/ }),
9300/* 285 */
9301/***/ (function(module, __webpack_exports__, __webpack_require__) {
9302
9303"use strict";
9304/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9305
9306
9307/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Object'));
9308
9309
9310/***/ }),
9311/* 286 */
9312/***/ (function(module, __webpack_exports__, __webpack_require__) {
9313
9314"use strict";
9315/* harmony export (immutable) */ __webpack_exports__["a"] = isFinite;
9316/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
9317/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(165);
9318
9319
9320
9321// Is a given object a finite number?
9322function isFinite(obj) {
9323 return !Object(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["f" /* _isFinite */])(obj) && !isNaN(parseFloat(obj));
9324}
9325
9326
9327/***/ }),
9328/* 287 */
9329/***/ (function(module, __webpack_exports__, __webpack_require__) {
9330
9331"use strict";
9332/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(170);
9333/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getByteLength_js__ = __webpack_require__(124);
9334
9335
9336
9337// Internal helper to determine whether we should spend extensive checks against
9338// `ArrayBuffer` et al.
9339/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getByteLength_js__["a" /* default */]));
9340
9341
9342/***/ }),
9343/* 288 */
9344/***/ (function(module, __webpack_exports__, __webpack_require__) {
9345
9346"use strict";
9347/* harmony export (immutable) */ __webpack_exports__["a"] = isEmpty;
9348/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
9349/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(46);
9350/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(121);
9351/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(123);
9352/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keys_js__ = __webpack_require__(12);
9353
9354
9355
9356
9357
9358
9359// Is a given array, string, or object empty?
9360// An "empty" object has no enumerable own-properties.
9361function isEmpty(obj) {
9362 if (obj == null) return true;
9363 // Skip the more expensive `toString`-based type checks if `obj` has no
9364 // `.length`.
9365 var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(obj);
9366 if (typeof length == 'number' && (
9367 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)
9368 )) return length === 0;
9369 return Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__keys_js__["a" /* default */])(obj)) === 0;
9370}
9371
9372
9373/***/ }),
9374/* 289 */
9375/***/ (function(module, __webpack_exports__, __webpack_require__) {
9376
9377"use strict";
9378/* harmony export (immutable) */ __webpack_exports__["a"] = isEqual;
9379/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
9380/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
9381/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getByteLength_js__ = __webpack_require__(124);
9382/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__ = __webpack_require__(168);
9383/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isFunction_js__ = __webpack_require__(26);
9384/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__ = __webpack_require__(74);
9385/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isDataView_js__ = __webpack_require__(122);
9386/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__keys_js__ = __webpack_require__(12);
9387/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__has_js__ = __webpack_require__(37);
9388/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__toBufferView_js__ = __webpack_require__(290);
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400// We use this string twice, so give it a name for minification.
9401var tagDataView = '[object DataView]';
9402
9403// Internal recursive comparison function for `_.isEqual`.
9404function eq(a, b, aStack, bStack) {
9405 // Identical objects are equal. `0 === -0`, but they aren't identical.
9406 // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
9407 if (a === b) return a !== 0 || 1 / a === 1 / b;
9408 // `null` or `undefined` only equal to itself (strict comparison).
9409 if (a == null || b == null) return false;
9410 // `NaN`s are equivalent, but non-reflexive.
9411 if (a !== a) return b !== b;
9412 // Exhaust primitive checks
9413 var type = typeof a;
9414 if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
9415 return deepEq(a, b, aStack, bStack);
9416}
9417
9418// Internal recursive comparison function for `_.isEqual`.
9419function deepEq(a, b, aStack, bStack) {
9420 // Unwrap any wrapped objects.
9421 if (a instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) a = a._wrapped;
9422 if (b instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) b = b._wrapped;
9423 // Compare `[[Class]]` names.
9424 var className = __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(a);
9425 if (className !== __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(b)) return false;
9426 // Work around a bug in IE 10 - Edge 13.
9427 if (__WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__["a" /* hasStringTagBug */] && className == '[object Object]' && Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(a)) {
9428 if (!Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(b)) return false;
9429 className = tagDataView;
9430 }
9431 switch (className) {
9432 // These types are compared by value.
9433 case '[object RegExp]':
9434 // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
9435 case '[object String]':
9436 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
9437 // equivalent to `new String("5")`.
9438 return '' + a === '' + b;
9439 case '[object Number]':
9440 // `NaN`s are equivalent, but non-reflexive.
9441 // Object(NaN) is equivalent to NaN.
9442 if (+a !== +a) return +b !== +b;
9443 // An `egal` comparison is performed for other numeric values.
9444 return +a === 0 ? 1 / +a === 1 / b : +a === +b;
9445 case '[object Date]':
9446 case '[object Boolean]':
9447 // Coerce dates and booleans to numeric primitive values. Dates are compared by their
9448 // millisecond representations. Note that invalid dates with millisecond representations
9449 // of `NaN` are not equivalent.
9450 return +a === +b;
9451 case '[object Symbol]':
9452 return __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(a) === __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(b);
9453 case '[object ArrayBuffer]':
9454 case tagDataView:
9455 // Coerce to typed array so we can fall through.
9456 return deepEq(Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(a), Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(b), aStack, bStack);
9457 }
9458
9459 var areArrays = className === '[object Array]';
9460 if (!areArrays && Object(__WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__["a" /* default */])(a)) {
9461 var byteLength = Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(a);
9462 if (byteLength !== Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(b)) return false;
9463 if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
9464 areArrays = true;
9465 }
9466 if (!areArrays) {
9467 if (typeof a != 'object' || typeof b != 'object') return false;
9468
9469 // Objects with different constructors are not equivalent, but `Object`s or `Array`s
9470 // from different frames are.
9471 var aCtor = a.constructor, bCtor = b.constructor;
9472 if (aCtor !== bCtor && !(Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(aCtor) && aCtor instanceof aCtor &&
9473 Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(bCtor) && bCtor instanceof bCtor)
9474 && ('constructor' in a && 'constructor' in b)) {
9475 return false;
9476 }
9477 }
9478 // Assume equality for cyclic structures. The algorithm for detecting cyclic
9479 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
9480
9481 // Initializing stack of traversed objects.
9482 // It's done here since we only need them for objects and arrays comparison.
9483 aStack = aStack || [];
9484 bStack = bStack || [];
9485 var length = aStack.length;
9486 while (length--) {
9487 // Linear search. Performance is inversely proportional to the number of
9488 // unique nested structures.
9489 if (aStack[length] === a) return bStack[length] === b;
9490 }
9491
9492 // Add the first object to the stack of traversed objects.
9493 aStack.push(a);
9494 bStack.push(b);
9495
9496 // Recursively compare objects and arrays.
9497 if (areArrays) {
9498 // Compare array lengths to determine if a deep comparison is necessary.
9499 length = a.length;
9500 if (length !== b.length) return false;
9501 // Deep compare the contents, ignoring non-numeric properties.
9502 while (length--) {
9503 if (!eq(a[length], b[length], aStack, bStack)) return false;
9504 }
9505 } else {
9506 // Deep compare objects.
9507 var _keys = Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(a), key;
9508 length = _keys.length;
9509 // Ensure that both objects contain the same number of properties before comparing deep equality.
9510 if (Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(b).length !== length) return false;
9511 while (length--) {
9512 // Deep compare each member
9513 key = _keys[length];
9514 if (!(Object(__WEBPACK_IMPORTED_MODULE_8__has_js__["a" /* default */])(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
9515 }
9516 }
9517 // Remove the first object from the stack of traversed objects.
9518 aStack.pop();
9519 bStack.pop();
9520 return true;
9521}
9522
9523// Perform a deep comparison to check if two objects are equal.
9524function isEqual(a, b) {
9525 return eq(a, b);
9526}
9527
9528
9529/***/ }),
9530/* 290 */
9531/***/ (function(module, __webpack_exports__, __webpack_require__) {
9532
9533"use strict";
9534/* harmony export (immutable) */ __webpack_exports__["a"] = toBufferView;
9535/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getByteLength_js__ = __webpack_require__(124);
9536
9537
9538// Internal function to wrap or shallow-copy an ArrayBuffer,
9539// typed array or DataView to a new view, reusing the buffer.
9540function toBufferView(bufferSource) {
9541 return new Uint8Array(
9542 bufferSource.buffer || bufferSource,
9543 bufferSource.byteOffset || 0,
9544 Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__["a" /* default */])(bufferSource)
9545 );
9546}
9547
9548
9549/***/ }),
9550/* 291 */
9551/***/ (function(module, __webpack_exports__, __webpack_require__) {
9552
9553"use strict";
9554/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9555/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(74);
9556/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(125);
9557
9558
9559
9560
9561/* 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'));
9562
9563
9564/***/ }),
9565/* 292 */
9566/***/ (function(module, __webpack_exports__, __webpack_require__) {
9567
9568"use strict";
9569/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9570/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(74);
9571/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(125);
9572
9573
9574
9575
9576/* 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'));
9577
9578
9579/***/ }),
9580/* 293 */
9581/***/ (function(module, __webpack_exports__, __webpack_require__) {
9582
9583"use strict";
9584/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9585/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(74);
9586/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(125);
9587
9588
9589
9590
9591/* 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'));
9592
9593
9594/***/ }),
9595/* 294 */
9596/***/ (function(module, __webpack_exports__, __webpack_require__) {
9597
9598"use strict";
9599/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9600
9601
9602/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakSet'));
9603
9604
9605/***/ }),
9606/* 295 */
9607/***/ (function(module, __webpack_exports__, __webpack_require__) {
9608
9609"use strict";
9610/* harmony export (immutable) */ __webpack_exports__["a"] = pairs;
9611/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(12);
9612
9613
9614// Convert an object into a list of `[key, value]` pairs.
9615// The opposite of `_.object` with one argument.
9616function pairs(obj) {
9617 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
9618 var length = _keys.length;
9619 var pairs = Array(length);
9620 for (var i = 0; i < length; i++) {
9621 pairs[i] = [_keys[i], obj[_keys[i]]];
9622 }
9623 return pairs;
9624}
9625
9626
9627/***/ }),
9628/* 296 */
9629/***/ (function(module, __webpack_exports__, __webpack_require__) {
9630
9631"use strict";
9632/* harmony export (immutable) */ __webpack_exports__["a"] = create;
9633/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(178);
9634/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__extendOwn_js__ = __webpack_require__(127);
9635
9636
9637
9638// Creates an object that inherits from the given prototype object.
9639// If additional properties are provided then they will be added to the
9640// created object.
9641function create(prototype, props) {
9642 var result = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(prototype);
9643 if (props) Object(__WEBPACK_IMPORTED_MODULE_1__extendOwn_js__["a" /* default */])(result, props);
9644 return result;
9645}
9646
9647
9648/***/ }),
9649/* 297 */
9650/***/ (function(module, __webpack_exports__, __webpack_require__) {
9651
9652"use strict";
9653/* harmony export (immutable) */ __webpack_exports__["a"] = tap;
9654// Invokes `interceptor` with the `obj` and then returns `obj`.
9655// The primary purpose of this method is to "tap into" a method chain, in
9656// order to perform operations on intermediate results within the chain.
9657function tap(obj, interceptor) {
9658 interceptor(obj);
9659 return obj;
9660}
9661
9662
9663/***/ }),
9664/* 298 */
9665/***/ (function(module, __webpack_exports__, __webpack_require__) {
9666
9667"use strict";
9668/* harmony export (immutable) */ __webpack_exports__["a"] = has;
9669/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(37);
9670/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(76);
9671
9672
9673
9674// Shortcut function for checking if an object has a given property directly on
9675// itself (in other words, not on a prototype). Unlike the internal `has`
9676// function, this public version can also traverse nested properties.
9677function has(obj, path) {
9678 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
9679 var length = path.length;
9680 for (var i = 0; i < length; i++) {
9681 var key = path[i];
9682 if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(obj, key)) return false;
9683 obj = obj[key];
9684 }
9685 return !!length;
9686}
9687
9688
9689/***/ }),
9690/* 299 */
9691/***/ (function(module, __webpack_exports__, __webpack_require__) {
9692
9693"use strict";
9694/* harmony export (immutable) */ __webpack_exports__["a"] = mapObject;
9695/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
9696/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(12);
9697
9698
9699
9700// Returns the results of applying the `iteratee` to each element of `obj`.
9701// In contrast to `_.map` it returns an object.
9702function mapObject(obj, iteratee, context) {
9703 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
9704 var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
9705 length = _keys.length,
9706 results = {};
9707 for (var index = 0; index < length; index++) {
9708 var currentKey = _keys[index];
9709 results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
9710 }
9711 return results;
9712}
9713
9714
9715/***/ }),
9716/* 300 */
9717/***/ (function(module, __webpack_exports__, __webpack_require__) {
9718
9719"use strict";
9720/* harmony export (immutable) */ __webpack_exports__["a"] = propertyOf;
9721/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__noop_js__ = __webpack_require__(184);
9722/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(180);
9723
9724
9725
9726// Generates a function for a given object that returns a given property.
9727function propertyOf(obj) {
9728 if (obj == null) return __WEBPACK_IMPORTED_MODULE_0__noop_js__["a" /* default */];
9729 return function(path) {
9730 return Object(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" /* default */])(obj, path);
9731 };
9732}
9733
9734
9735/***/ }),
9736/* 301 */
9737/***/ (function(module, __webpack_exports__, __webpack_require__) {
9738
9739"use strict";
9740/* harmony export (immutable) */ __webpack_exports__["a"] = times;
9741/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(77);
9742
9743
9744// Run a function **n** times.
9745function times(n, iteratee, context) {
9746 var accum = Array(Math.max(0, n));
9747 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context, 1);
9748 for (var i = 0; i < n; i++) accum[i] = iteratee(i);
9749 return accum;
9750}
9751
9752
9753/***/ }),
9754/* 302 */
9755/***/ (function(module, __webpack_exports__, __webpack_require__) {
9756
9757"use strict";
9758/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(186);
9759/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(187);
9760
9761
9762
9763// Function for escaping strings to HTML interpolation.
9764/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
9765
9766
9767/***/ }),
9768/* 303 */
9769/***/ (function(module, __webpack_exports__, __webpack_require__) {
9770
9771"use strict";
9772/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(186);
9773/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__ = __webpack_require__(304);
9774
9775
9776
9777// Function for unescaping strings from HTML interpolation.
9778/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__["a" /* default */]));
9779
9780
9781/***/ }),
9782/* 304 */
9783/***/ (function(module, __webpack_exports__, __webpack_require__) {
9784
9785"use strict";
9786/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__invert_js__ = __webpack_require__(174);
9787/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(187);
9788
9789
9790
9791// Internal list of HTML entities for unescaping.
9792/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__invert_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
9793
9794
9795/***/ }),
9796/* 305 */
9797/***/ (function(module, __webpack_exports__, __webpack_require__) {
9798
9799"use strict";
9800/* harmony export (immutable) */ __webpack_exports__["a"] = template;
9801/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defaults_js__ = __webpack_require__(177);
9802/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__underscore_js__ = __webpack_require__(23);
9803/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__templateSettings_js__ = __webpack_require__(188);
9804
9805
9806
9807
9808// When customizing `_.templateSettings`, if you don't want to define an
9809// interpolation, evaluation or escaping regex, we need one that is
9810// guaranteed not to match.
9811var noMatch = /(.)^/;
9812
9813// Certain characters need to be escaped so that they can be put into a
9814// string literal.
9815var escapes = {
9816 "'": "'",
9817 '\\': '\\',
9818 '\r': 'r',
9819 '\n': 'n',
9820 '\u2028': 'u2028',
9821 '\u2029': 'u2029'
9822};
9823
9824var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
9825
9826function escapeChar(match) {
9827 return '\\' + escapes[match];
9828}
9829
9830var bareIdentifier = /^\s*(\w|\$)+\s*$/;
9831
9832// JavaScript micro-templating, similar to John Resig's implementation.
9833// Underscore templating handles arbitrary delimiters, preserves whitespace,
9834// and correctly escapes quotes within interpolated code.
9835// NB: `oldSettings` only exists for backwards compatibility.
9836function template(text, settings, oldSettings) {
9837 if (!settings && oldSettings) settings = oldSettings;
9838 settings = Object(__WEBPACK_IMPORTED_MODULE_0__defaults_js__["a" /* default */])({}, settings, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */].templateSettings);
9839
9840 // Combine delimiters into one regular expression via alternation.
9841 var matcher = RegExp([
9842 (settings.escape || noMatch).source,
9843 (settings.interpolate || noMatch).source,
9844 (settings.evaluate || noMatch).source
9845 ].join('|') + '|$', 'g');
9846
9847 // Compile the template source, escaping string literals appropriately.
9848 var index = 0;
9849 var source = "__p+='";
9850 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
9851 source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
9852 index = offset + match.length;
9853
9854 if (escape) {
9855 source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
9856 } else if (interpolate) {
9857 source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
9858 } else if (evaluate) {
9859 source += "';\n" + evaluate + "\n__p+='";
9860 }
9861
9862 // Adobe VMs need the match returned to produce the correct offset.
9863 return match;
9864 });
9865 source += "';\n";
9866
9867 var argument = settings.variable;
9868 if (argument) {
9869 if (!bareIdentifier.test(argument)) throw new Error(argument);
9870 } else {
9871 // If a variable is not specified, place data values in local scope.
9872 source = 'with(obj||{}){\n' + source + '}\n';
9873 argument = 'obj';
9874 }
9875
9876 source = "var __t,__p='',__j=Array.prototype.join," +
9877 "print=function(){__p+=__j.call(arguments,'');};\n" +
9878 source + 'return __p;\n';
9879
9880 var render;
9881 try {
9882 render = new Function(argument, '_', source);
9883 } catch (e) {
9884 e.source = source;
9885 throw e;
9886 }
9887
9888 var template = function(data) {
9889 return render.call(this, data, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */]);
9890 };
9891
9892 // Provide the compiled source as a convenience for precompilation.
9893 template.source = 'function(' + argument + '){\n' + source + '}';
9894
9895 return template;
9896}
9897
9898
9899/***/ }),
9900/* 306 */
9901/***/ (function(module, __webpack_exports__, __webpack_require__) {
9902
9903"use strict";
9904/* harmony export (immutable) */ __webpack_exports__["a"] = result;
9905/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(26);
9906/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(76);
9907
9908
9909
9910// Traverses the children of `obj` along `path`. If a child is a function, it
9911// is invoked with its parent as context. Returns the value of the final
9912// child, or `fallback` if any child is undefined.
9913function result(obj, path, fallback) {
9914 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
9915 var length = path.length;
9916 if (!length) {
9917 return Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(fallback) ? fallback.call(obj) : fallback;
9918 }
9919 for (var i = 0; i < length; i++) {
9920 var prop = obj == null ? void 0 : obj[path[i]];
9921 if (prop === void 0) {
9922 prop = fallback;
9923 i = length; // Ensure we don't continue iterating.
9924 }
9925 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(prop) ? prop.call(obj) : prop;
9926 }
9927 return obj;
9928}
9929
9930
9931/***/ }),
9932/* 307 */
9933/***/ (function(module, __webpack_exports__, __webpack_require__) {
9934
9935"use strict";
9936/* harmony export (immutable) */ __webpack_exports__["a"] = uniqueId;
9937// Generate a unique integer id (unique within the entire client session).
9938// Useful for temporary DOM ids.
9939var idCounter = 0;
9940function uniqueId(prefix) {
9941 var id = ++idCounter + '';
9942 return prefix ? prefix + id : id;
9943}
9944
9945
9946/***/ }),
9947/* 308 */
9948/***/ (function(module, __webpack_exports__, __webpack_require__) {
9949
9950"use strict";
9951/* harmony export (immutable) */ __webpack_exports__["a"] = chain;
9952/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
9953
9954
9955// Start chaining a wrapped Underscore object.
9956function chain(obj) {
9957 var instance = Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj);
9958 instance._chain = true;
9959 return instance;
9960}
9961
9962
9963/***/ }),
9964/* 309 */
9965/***/ (function(module, __webpack_exports__, __webpack_require__) {
9966
9967"use strict";
9968/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
9969/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(57);
9970/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bind_js__ = __webpack_require__(190);
9971
9972
9973
9974
9975// Bind a number of an object's methods to that object. Remaining arguments
9976// are the method names to be bound. Useful for ensuring that all callbacks
9977// defined on an object belong to it.
9978/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
9979 keys = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(keys, false, false);
9980 var index = keys.length;
9981 if (index < 1) throw new Error('bindAll must be passed function names');
9982 while (index--) {
9983 var key = keys[index];
9984 obj[key] = Object(__WEBPACK_IMPORTED_MODULE_2__bind_js__["a" /* default */])(obj[key], obj);
9985 }
9986 return obj;
9987}));
9988
9989
9990/***/ }),
9991/* 310 */
9992/***/ (function(module, __webpack_exports__, __webpack_require__) {
9993
9994"use strict";
9995/* harmony export (immutable) */ __webpack_exports__["a"] = memoize;
9996/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(37);
9997
9998
9999// Memoize an expensive function by storing its results.
10000function memoize(func, hasher) {
10001 var memoize = function(key) {
10002 var cache = memoize.cache;
10003 var address = '' + (hasher ? hasher.apply(this, arguments) : key);
10004 if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(cache, address)) cache[address] = func.apply(this, arguments);
10005 return cache[address];
10006 };
10007 memoize.cache = {};
10008 return memoize;
10009}
10010
10011
10012/***/ }),
10013/* 311 */
10014/***/ (function(module, __webpack_exports__, __webpack_require__) {
10015
10016"use strict";
10017/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(97);
10018/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__delay_js__ = __webpack_require__(191);
10019/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(23);
10020
10021
10022
10023
10024// Defers a function, scheduling it to run after the current call stack has
10025// cleared.
10026/* 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));
10027
10028
10029/***/ }),
10030/* 312 */
10031/***/ (function(module, __webpack_exports__, __webpack_require__) {
10032
10033"use strict";
10034/* harmony export (immutable) */ __webpack_exports__["a"] = throttle;
10035/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__now_js__ = __webpack_require__(131);
10036
10037
10038// Returns a function, that, when invoked, will only be triggered at most once
10039// during a given window of time. Normally, the throttled function will run
10040// as much as it can, without ever going more than once per `wait` duration;
10041// but if you'd like to disable the execution on the leading edge, pass
10042// `{leading: false}`. To disable execution on the trailing edge, ditto.
10043function throttle(func, wait, options) {
10044 var timeout, context, args, result;
10045 var previous = 0;
10046 if (!options) options = {};
10047
10048 var later = function() {
10049 previous = options.leading === false ? 0 : Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
10050 timeout = null;
10051 result = func.apply(context, args);
10052 if (!timeout) context = args = null;
10053 };
10054
10055 var throttled = function() {
10056 var _now = Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
10057 if (!previous && options.leading === false) previous = _now;
10058 var remaining = wait - (_now - previous);
10059 context = this;
10060 args = arguments;
10061 if (remaining <= 0 || remaining > wait) {
10062 if (timeout) {
10063 clearTimeout(timeout);
10064 timeout = null;
10065 }
10066 previous = _now;
10067 result = func.apply(context, args);
10068 if (!timeout) context = args = null;
10069 } else if (!timeout && options.trailing !== false) {
10070 timeout = setTimeout(later, remaining);
10071 }
10072 return result;
10073 };
10074
10075 throttled.cancel = function() {
10076 clearTimeout(timeout);
10077 previous = 0;
10078 timeout = context = args = null;
10079 };
10080
10081 return throttled;
10082}
10083
10084
10085/***/ }),
10086/* 313 */
10087/***/ (function(module, __webpack_exports__, __webpack_require__) {
10088
10089"use strict";
10090/* harmony export (immutable) */ __webpack_exports__["a"] = debounce;
10091/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10092/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__now_js__ = __webpack_require__(131);
10093
10094
10095
10096// When a sequence of calls of the returned function ends, the argument
10097// function is triggered. The end of a sequence is defined by the `wait`
10098// parameter. If `immediate` is passed, the argument function will be
10099// triggered at the beginning of the sequence instead of at the end.
10100function debounce(func, wait, immediate) {
10101 var timeout, previous, args, result, context;
10102
10103 var later = function() {
10104 var passed = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])() - previous;
10105 if (wait > passed) {
10106 timeout = setTimeout(later, wait - passed);
10107 } else {
10108 timeout = null;
10109 if (!immediate) result = func.apply(context, args);
10110 // This check is needed because `func` can recursively invoke `debounced`.
10111 if (!timeout) args = context = null;
10112 }
10113 };
10114
10115 var debounced = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(_args) {
10116 context = this;
10117 args = _args;
10118 previous = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])();
10119 if (!timeout) {
10120 timeout = setTimeout(later, wait);
10121 if (immediate) result = func.apply(context, args);
10122 }
10123 return result;
10124 });
10125
10126 debounced.cancel = function() {
10127 clearTimeout(timeout);
10128 timeout = args = context = null;
10129 };
10130
10131 return debounced;
10132}
10133
10134
10135/***/ }),
10136/* 314 */
10137/***/ (function(module, __webpack_exports__, __webpack_require__) {
10138
10139"use strict";
10140/* harmony export (immutable) */ __webpack_exports__["a"] = wrap;
10141/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(97);
10142
10143
10144// Returns the first function passed as an argument to the second,
10145// allowing you to adjust arguments, run code before and after, and
10146// conditionally execute the original function.
10147function wrap(func, wrapper) {
10148 return Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(wrapper, func);
10149}
10150
10151
10152/***/ }),
10153/* 315 */
10154/***/ (function(module, __webpack_exports__, __webpack_require__) {
10155
10156"use strict";
10157/* harmony export (immutable) */ __webpack_exports__["a"] = compose;
10158// Returns a function that is the composition of a list of functions, each
10159// consuming the return value of the function that follows.
10160function compose() {
10161 var args = arguments;
10162 var start = args.length - 1;
10163 return function() {
10164 var i = start;
10165 var result = args[start].apply(this, arguments);
10166 while (i--) result = args[i].call(this, result);
10167 return result;
10168 };
10169}
10170
10171
10172/***/ }),
10173/* 316 */
10174/***/ (function(module, __webpack_exports__, __webpack_require__) {
10175
10176"use strict";
10177/* harmony export (immutable) */ __webpack_exports__["a"] = after;
10178// Returns a function that will only be executed on and after the Nth call.
10179function after(times, func) {
10180 return function() {
10181 if (--times < 1) {
10182 return func.apply(this, arguments);
10183 }
10184 };
10185}
10186
10187
10188/***/ }),
10189/* 317 */
10190/***/ (function(module, __webpack_exports__, __webpack_require__) {
10191
10192"use strict";
10193/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(97);
10194/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__before_js__ = __webpack_require__(192);
10195
10196
10197
10198// Returns a function that will be executed at most one time, no matter how
10199// often you call it. Useful for lazy initialization.
10200/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__before_js__["a" /* default */], 2));
10201
10202
10203/***/ }),
10204/* 318 */
10205/***/ (function(module, __webpack_exports__, __webpack_require__) {
10206
10207"use strict";
10208/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__ = __webpack_require__(195);
10209/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__ = __webpack_require__(198);
10210
10211
10212
10213// Return the position of the last occurrence of an item in an array,
10214// or -1 if the item is not included in the array.
10215/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__["a" /* default */])(-1, __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__["a" /* default */]));
10216
10217
10218/***/ }),
10219/* 319 */
10220/***/ (function(module, __webpack_exports__, __webpack_require__) {
10221
10222"use strict";
10223/* harmony export (immutable) */ __webpack_exports__["a"] = findWhere;
10224/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__find_js__ = __webpack_require__(199);
10225/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(96);
10226
10227
10228
10229// Convenience version of a common use case of `_.find`: getting the first
10230// object containing specific `key:value` pairs.
10231function findWhere(obj, attrs) {
10232 return Object(__WEBPACK_IMPORTED_MODULE_0__find_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
10233}
10234
10235
10236/***/ }),
10237/* 320 */
10238/***/ (function(module, __webpack_exports__, __webpack_require__) {
10239
10240"use strict";
10241/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(200);
10242
10243
10244// **Reduce** builds up a single result from a list of values, aka `inject`,
10245// or `foldl`.
10246/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(1));
10247
10248
10249/***/ }),
10250/* 321 */
10251/***/ (function(module, __webpack_exports__, __webpack_require__) {
10252
10253"use strict";
10254/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(200);
10255
10256
10257// The right-associative version of reduce, also known as `foldr`.
10258/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(-1));
10259
10260
10261/***/ }),
10262/* 322 */
10263/***/ (function(module, __webpack_exports__, __webpack_require__) {
10264
10265"use strict";
10266/* harmony export (immutable) */ __webpack_exports__["a"] = reject;
10267/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(78);
10268/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__negate_js__ = __webpack_require__(132);
10269/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(18);
10270
10271
10272
10273
10274// Return all the elements for which a truth test fails.
10275function reject(obj, predicate, context) {
10276 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);
10277}
10278
10279
10280/***/ }),
10281/* 323 */
10282/***/ (function(module, __webpack_exports__, __webpack_require__) {
10283
10284"use strict";
10285/* harmony export (immutable) */ __webpack_exports__["a"] = every;
10286/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
10287/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
10288/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(12);
10289
10290
10291
10292
10293// Determine whether all of the elements pass a truth test.
10294function every(obj, predicate, context) {
10295 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
10296 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
10297 length = (_keys || obj).length;
10298 for (var index = 0; index < length; index++) {
10299 var currentKey = _keys ? _keys[index] : index;
10300 if (!predicate(obj[currentKey], currentKey, obj)) return false;
10301 }
10302 return true;
10303}
10304
10305
10306/***/ }),
10307/* 324 */
10308/***/ (function(module, __webpack_exports__, __webpack_require__) {
10309
10310"use strict";
10311/* harmony export (immutable) */ __webpack_exports__["a"] = some;
10312/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
10313/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
10314/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(12);
10315
10316
10317
10318
10319// Determine if at least one element in the object passes a truth test.
10320function some(obj, predicate, context) {
10321 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
10322 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
10323 length = (_keys || obj).length;
10324 for (var index = 0; index < length; index++) {
10325 var currentKey = _keys ? _keys[index] : index;
10326 if (predicate(obj[currentKey], currentKey, obj)) return true;
10327 }
10328 return false;
10329}
10330
10331
10332/***/ }),
10333/* 325 */
10334/***/ (function(module, __webpack_exports__, __webpack_require__) {
10335
10336"use strict";
10337/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10338/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
10339/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(58);
10340/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__deepGet_js__ = __webpack_require__(128);
10341/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__toPath_js__ = __webpack_require__(76);
10342
10343
10344
10345
10346
10347
10348// Invoke a method (with arguments) on every item in a collection.
10349/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, path, args) {
10350 var contextPath, func;
10351 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(path)) {
10352 func = path;
10353 } else {
10354 path = Object(__WEBPACK_IMPORTED_MODULE_4__toPath_js__["a" /* default */])(path);
10355 contextPath = path.slice(0, -1);
10356 path = path[path.length - 1];
10357 }
10358 return Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(context) {
10359 var method = func;
10360 if (!method) {
10361 if (contextPath && contextPath.length) {
10362 context = Object(__WEBPACK_IMPORTED_MODULE_3__deepGet_js__["a" /* default */])(context, contextPath);
10363 }
10364 if (context == null) return void 0;
10365 method = context[path];
10366 }
10367 return method == null ? method : method.apply(context, args);
10368 });
10369}));
10370
10371
10372/***/ }),
10373/* 326 */
10374/***/ (function(module, __webpack_exports__, __webpack_require__) {
10375
10376"use strict";
10377/* harmony export (immutable) */ __webpack_exports__["a"] = where;
10378/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(78);
10379/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(96);
10380
10381
10382
10383// Convenience version of a common use case of `_.filter`: selecting only
10384// objects containing specific `key:value` pairs.
10385function where(obj, attrs) {
10386 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
10387}
10388
10389
10390/***/ }),
10391/* 327 */
10392/***/ (function(module, __webpack_exports__, __webpack_require__) {
10393
10394"use strict";
10395/* harmony export (immutable) */ __webpack_exports__["a"] = min;
10396/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
10397/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(56);
10398/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(18);
10399/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(47);
10400
10401
10402
10403
10404
10405// Return the minimum element (or element-based computation).
10406function min(obj, iteratee, context) {
10407 var result = Infinity, lastComputed = Infinity,
10408 value, computed;
10409 if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
10410 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
10411 for (var i = 0, length = obj.length; i < length; i++) {
10412 value = obj[i];
10413 if (value != null && value < result) {
10414 result = value;
10415 }
10416 }
10417 } else {
10418 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
10419 Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
10420 computed = iteratee(v, index, list);
10421 if (computed < lastComputed || computed === Infinity && result === Infinity) {
10422 result = v;
10423 lastComputed = computed;
10424 }
10425 });
10426 }
10427 return result;
10428}
10429
10430
10431/***/ }),
10432/* 328 */
10433/***/ (function(module, __webpack_exports__, __webpack_require__) {
10434
10435"use strict";
10436/* harmony export (immutable) */ __webpack_exports__["a"] = shuffle;
10437/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sample_js__ = __webpack_require__(202);
10438
10439
10440// Shuffle a collection.
10441function shuffle(obj) {
10442 return Object(__WEBPACK_IMPORTED_MODULE_0__sample_js__["a" /* default */])(obj, Infinity);
10443}
10444
10445
10446/***/ }),
10447/* 329 */
10448/***/ (function(module, __webpack_exports__, __webpack_require__) {
10449
10450"use strict";
10451/* harmony export (immutable) */ __webpack_exports__["a"] = sortBy;
10452/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
10453/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pluck_js__ = __webpack_require__(134);
10454/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(58);
10455
10456
10457
10458
10459// Sort the object's values by a criterion produced by an iteratee.
10460function sortBy(obj, iteratee, context) {
10461 var index = 0;
10462 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
10463 return Object(__WEBPACK_IMPORTED_MODULE_1__pluck_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(value, key, list) {
10464 return {
10465 value: value,
10466 index: index++,
10467 criteria: iteratee(value, key, list)
10468 };
10469 }).sort(function(left, right) {
10470 var a = left.criteria;
10471 var b = right.criteria;
10472 if (a !== b) {
10473 if (a > b || a === void 0) return 1;
10474 if (a < b || b === void 0) return -1;
10475 }
10476 return left.index - right.index;
10477 }), 'value');
10478}
10479
10480
10481/***/ }),
10482/* 330 */
10483/***/ (function(module, __webpack_exports__, __webpack_require__) {
10484
10485"use strict";
10486/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(98);
10487/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(37);
10488
10489
10490
10491// Groups the object's values by a criterion. Pass either a string attribute
10492// to group by, or a function that returns the criterion.
10493/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10494 if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key].push(value); else result[key] = [value];
10495}));
10496
10497
10498/***/ }),
10499/* 331 */
10500/***/ (function(module, __webpack_exports__, __webpack_require__) {
10501
10502"use strict";
10503/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(98);
10504
10505
10506// Indexes the object's values by a criterion, similar to `_.groupBy`, but for
10507// when you know that your index values will be unique.
10508/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10509 result[key] = value;
10510}));
10511
10512
10513/***/ }),
10514/* 332 */
10515/***/ (function(module, __webpack_exports__, __webpack_require__) {
10516
10517"use strict";
10518/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(98);
10519/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(37);
10520
10521
10522
10523// Counts instances of an object that group by a certain criterion. Pass
10524// either a string attribute to count by, or a function that returns the
10525// criterion.
10526/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10527 if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key]++; else result[key] = 1;
10528}));
10529
10530
10531/***/ }),
10532/* 333 */
10533/***/ (function(module, __webpack_exports__, __webpack_require__) {
10534
10535"use strict";
10536/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(98);
10537
10538
10539// Split a collection into two arrays: one whose elements all pass the given
10540// truth test, and one whose elements all do not pass the truth test.
10541/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, pass) {
10542 result[pass ? 0 : 1].push(value);
10543}, true));
10544
10545
10546/***/ }),
10547/* 334 */
10548/***/ (function(module, __webpack_exports__, __webpack_require__) {
10549
10550"use strict";
10551/* harmony export (immutable) */ __webpack_exports__["a"] = toArray;
10552/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(46);
10553/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
10554/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(121);
10555/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__ = __webpack_require__(24);
10556/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map_js__ = __webpack_require__(58);
10557/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__identity_js__ = __webpack_require__(129);
10558/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__values_js__ = __webpack_require__(56);
10559
10560
10561
10562
10563
10564
10565
10566
10567// Safely create a real, live array from anything iterable.
10568var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
10569function toArray(obj) {
10570 if (!obj) return [];
10571 if (Object(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" /* default */])(obj)) return __WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(obj);
10572 if (Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj)) {
10573 // Keep surrogate pair characters together.
10574 return obj.match(reStrSymbol);
10575 }
10576 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 */]);
10577 return Object(__WEBPACK_IMPORTED_MODULE_6__values_js__["a" /* default */])(obj);
10578}
10579
10580
10581/***/ }),
10582/* 335 */
10583/***/ (function(module, __webpack_exports__, __webpack_require__) {
10584
10585"use strict";
10586/* harmony export (immutable) */ __webpack_exports__["a"] = size;
10587/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
10588/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(12);
10589
10590
10591
10592// Return the number of elements in a collection.
10593function size(obj) {
10594 if (obj == null) return 0;
10595 return Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj.length : Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj).length;
10596}
10597
10598
10599/***/ }),
10600/* 336 */
10601/***/ (function(module, __webpack_exports__, __webpack_require__) {
10602
10603"use strict";
10604/* harmony export (immutable) */ __webpack_exports__["a"] = keyInObj;
10605// Internal `_.pick` helper function to determine whether `key` is an enumerable
10606// property name of `obj`.
10607function keyInObj(value, key, obj) {
10608 return key in obj;
10609}
10610
10611
10612/***/ }),
10613/* 337 */
10614/***/ (function(module, __webpack_exports__, __webpack_require__) {
10615
10616"use strict";
10617/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10618/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
10619/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__negate_js__ = __webpack_require__(132);
10620/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__map_js__ = __webpack_require__(58);
10621/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__flatten_js__ = __webpack_require__(57);
10622/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__contains_js__ = __webpack_require__(79);
10623/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pick_js__ = __webpack_require__(203);
10624
10625
10626
10627
10628
10629
10630
10631
10632// Return a copy of the object without the disallowed properties.
10633/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
10634 var iteratee = keys[0], context;
10635 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
10636 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__negate_js__["a" /* default */])(iteratee);
10637 if (keys.length > 1) context = keys[1];
10638 } else {
10639 keys = Object(__WEBPACK_IMPORTED_MODULE_3__map_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__flatten_js__["a" /* default */])(keys, false, false), String);
10640 iteratee = function(value, key) {
10641 return !Object(__WEBPACK_IMPORTED_MODULE_5__contains_js__["a" /* default */])(keys, key);
10642 };
10643 }
10644 return Object(__WEBPACK_IMPORTED_MODULE_6__pick_js__["a" /* default */])(obj, iteratee, context);
10645}));
10646
10647
10648/***/ }),
10649/* 338 */
10650/***/ (function(module, __webpack_exports__, __webpack_require__) {
10651
10652"use strict";
10653/* harmony export (immutable) */ __webpack_exports__["a"] = first;
10654/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__initial_js__ = __webpack_require__(204);
10655
10656
10657// Get the first element of an array. Passing **n** will return the first N
10658// values in the array. The **guard** check allows it to work with `_.map`.
10659function first(array, n, guard) {
10660 if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
10661 if (n == null || guard) return array[0];
10662 return Object(__WEBPACK_IMPORTED_MODULE_0__initial_js__["a" /* default */])(array, array.length - n);
10663}
10664
10665
10666/***/ }),
10667/* 339 */
10668/***/ (function(module, __webpack_exports__, __webpack_require__) {
10669
10670"use strict";
10671/* harmony export (immutable) */ __webpack_exports__["a"] = last;
10672/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rest_js__ = __webpack_require__(205);
10673
10674
10675// Get the last element of an array. Passing **n** will return the last N
10676// values in the array.
10677function last(array, n, guard) {
10678 if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
10679 if (n == null || guard) return array[array.length - 1];
10680 return Object(__WEBPACK_IMPORTED_MODULE_0__rest_js__["a" /* default */])(array, Math.max(0, array.length - n));
10681}
10682
10683
10684/***/ }),
10685/* 340 */
10686/***/ (function(module, __webpack_exports__, __webpack_require__) {
10687
10688"use strict";
10689/* harmony export (immutable) */ __webpack_exports__["a"] = compact;
10690/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(78);
10691
10692
10693// Trim out all falsy values from an array.
10694function compact(array) {
10695 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(array, Boolean);
10696}
10697
10698
10699/***/ }),
10700/* 341 */
10701/***/ (function(module, __webpack_exports__, __webpack_require__) {
10702
10703"use strict";
10704/* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
10705/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__flatten_js__ = __webpack_require__(57);
10706
10707
10708// Flatten out an array, either recursively (by default), or up to `depth`.
10709// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
10710function flatten(array, depth) {
10711 return Object(__WEBPACK_IMPORTED_MODULE_0__flatten_js__["a" /* default */])(array, depth, false);
10712}
10713
10714
10715/***/ }),
10716/* 342 */
10717/***/ (function(module, __webpack_exports__, __webpack_require__) {
10718
10719"use strict";
10720/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10721/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__difference_js__ = __webpack_require__(206);
10722
10723
10724
10725// Return a version of the array that does not contain the specified value(s).
10726/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, otherArrays) {
10727 return Object(__WEBPACK_IMPORTED_MODULE_1__difference_js__["a" /* default */])(array, otherArrays);
10728}));
10729
10730
10731/***/ }),
10732/* 343 */
10733/***/ (function(module, __webpack_exports__, __webpack_require__) {
10734
10735"use strict";
10736/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10737/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__uniq_js__ = __webpack_require__(207);
10738/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__flatten_js__ = __webpack_require__(57);
10739
10740
10741
10742
10743// Produce an array that contains the union: each distinct element from all of
10744// the passed-in arrays.
10745/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(arrays) {
10746 return Object(__WEBPACK_IMPORTED_MODULE_1__uniq_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__flatten_js__["a" /* default */])(arrays, true, true));
10747}));
10748
10749
10750/***/ }),
10751/* 344 */
10752/***/ (function(module, __webpack_exports__, __webpack_require__) {
10753
10754"use strict";
10755/* harmony export (immutable) */ __webpack_exports__["a"] = intersection;
10756/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
10757/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__contains_js__ = __webpack_require__(79);
10758
10759
10760
10761// Produce an array that contains every item shared between all the
10762// passed-in arrays.
10763function intersection(array) {
10764 var result = [];
10765 var argsLength = arguments.length;
10766 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array); i < length; i++) {
10767 var item = array[i];
10768 if (Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(result, item)) continue;
10769 var j;
10770 for (j = 1; j < argsLength; j++) {
10771 if (!Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(arguments[j], item)) break;
10772 }
10773 if (j === argsLength) result.push(item);
10774 }
10775 return result;
10776}
10777
10778
10779/***/ }),
10780/* 345 */
10781/***/ (function(module, __webpack_exports__, __webpack_require__) {
10782
10783"use strict";
10784/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10785/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unzip_js__ = __webpack_require__(208);
10786
10787
10788
10789// Zip together multiple lists into a single array -- elements that share
10790// an index go together.
10791/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unzip_js__["a" /* default */]));
10792
10793
10794/***/ }),
10795/* 346 */
10796/***/ (function(module, __webpack_exports__, __webpack_require__) {
10797
10798"use strict";
10799/* harmony export (immutable) */ __webpack_exports__["a"] = object;
10800/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
10801
10802
10803// Converts lists into objects. Pass either a single array of `[key, value]`
10804// pairs, or two parallel arrays of the same length -- one of keys, and one of
10805// the corresponding values. Passing by pairs is the reverse of `_.pairs`.
10806function object(list, values) {
10807 var result = {};
10808 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(list); i < length; i++) {
10809 if (values) {
10810 result[list[i]] = values[i];
10811 } else {
10812 result[list[i][0]] = list[i][1];
10813 }
10814 }
10815 return result;
10816}
10817
10818
10819/***/ }),
10820/* 347 */
10821/***/ (function(module, __webpack_exports__, __webpack_require__) {
10822
10823"use strict";
10824/* harmony export (immutable) */ __webpack_exports__["a"] = range;
10825// Generate an integer Array containing an arithmetic progression. A port of
10826// the native Python `range()` function. See
10827// [the Python documentation](https://docs.python.org/library/functions.html#range).
10828function range(start, stop, step) {
10829 if (stop == null) {
10830 stop = start || 0;
10831 start = 0;
10832 }
10833 if (!step) {
10834 step = stop < start ? -1 : 1;
10835 }
10836
10837 var length = Math.max(Math.ceil((stop - start) / step), 0);
10838 var range = Array(length);
10839
10840 for (var idx = 0; idx < length; idx++, start += step) {
10841 range[idx] = start;
10842 }
10843
10844 return range;
10845}
10846
10847
10848/***/ }),
10849/* 348 */
10850/***/ (function(module, __webpack_exports__, __webpack_require__) {
10851
10852"use strict";
10853/* harmony export (immutable) */ __webpack_exports__["a"] = chunk;
10854/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
10855
10856
10857// Chunk a single array into multiple arrays, each containing `count` or fewer
10858// items.
10859function chunk(array, count) {
10860 if (count == null || count < 1) return [];
10861 var result = [];
10862 var i = 0, length = array.length;
10863 while (i < length) {
10864 result.push(__WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, i, i += count));
10865 }
10866 return result;
10867}
10868
10869
10870/***/ }),
10871/* 349 */
10872/***/ (function(module, __webpack_exports__, __webpack_require__) {
10873
10874"use strict";
10875/* harmony export (immutable) */ __webpack_exports__["a"] = mixin;
10876/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
10877/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(47);
10878/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__functions_js__ = __webpack_require__(175);
10879/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__setup_js__ = __webpack_require__(3);
10880/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__chainResult_js__ = __webpack_require__(209);
10881
10882
10883
10884
10885
10886
10887// Add your own custom functions to the Underscore object.
10888function mixin(obj) {
10889 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__functions_js__["a" /* default */])(obj), function(name) {
10890 var func = __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */][name] = obj[name];
10891 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
10892 var args = [this._wrapped];
10893 __WEBPACK_IMPORTED_MODULE_3__setup_js__["o" /* push */].apply(args, arguments);
10894 return Object(__WEBPACK_IMPORTED_MODULE_4__chainResult_js__["a" /* default */])(this, func.apply(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */], args));
10895 };
10896 });
10897 return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */];
10898}
10899
10900
10901/***/ }),
10902/* 350 */
10903/***/ (function(module, __webpack_exports__, __webpack_require__) {
10904
10905"use strict";
10906/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
10907/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(47);
10908/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__setup_js__ = __webpack_require__(3);
10909/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chainResult_js__ = __webpack_require__(209);
10910
10911
10912
10913
10914
10915// Add all mutator `Array` functions to the wrapper.
10916Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
10917 var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
10918 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
10919 var obj = this._wrapped;
10920 if (obj != null) {
10921 method.apply(obj, arguments);
10922 if ((name === 'shift' || name === 'splice') && obj.length === 0) {
10923 delete obj[0];
10924 }
10925 }
10926 return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
10927 };
10928});
10929
10930// Add all accessor `Array` functions to the wrapper.
10931Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['concat', 'join', 'slice'], function(name) {
10932 var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
10933 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
10934 var obj = this._wrapped;
10935 if (obj != null) obj = method.apply(obj, arguments);
10936 return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
10937 };
10938});
10939
10940/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]);
10941
10942
10943/***/ }),
10944/* 351 */
10945/***/ (function(module, exports, __webpack_require__) {
10946
10947var parent = __webpack_require__(352);
10948
10949module.exports = parent;
10950
10951
10952/***/ }),
10953/* 352 */
10954/***/ (function(module, exports, __webpack_require__) {
10955
10956var isPrototypeOf = __webpack_require__(20);
10957var method = __webpack_require__(353);
10958
10959var ArrayPrototype = Array.prototype;
10960
10961module.exports = function (it) {
10962 var own = it.concat;
10963 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;
10964};
10965
10966
10967/***/ }),
10968/* 353 */
10969/***/ (function(module, exports, __webpack_require__) {
10970
10971__webpack_require__(210);
10972var entryVirtual = __webpack_require__(38);
10973
10974module.exports = entryVirtual('Array').concat;
10975
10976
10977/***/ }),
10978/* 354 */
10979/***/ (function(module, exports) {
10980
10981var $TypeError = TypeError;
10982var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
10983
10984module.exports = function (it) {
10985 if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
10986 return it;
10987};
10988
10989
10990/***/ }),
10991/* 355 */
10992/***/ (function(module, exports, __webpack_require__) {
10993
10994var isArray = __webpack_require__(80);
10995var isConstructor = __webpack_require__(93);
10996var isObject = __webpack_require__(17);
10997var wellKnownSymbol = __webpack_require__(8);
10998
10999var SPECIES = wellKnownSymbol('species');
11000var $Array = Array;
11001
11002// a part of `ArraySpeciesCreate` abstract operation
11003// https://tc39.es/ecma262/#sec-arrayspeciescreate
11004module.exports = function (originalArray) {
11005 var C;
11006 if (isArray(originalArray)) {
11007 C = originalArray.constructor;
11008 // cross-realm fallback
11009 if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
11010 else if (isObject(C)) {
11011 C = C[SPECIES];
11012 if (C === null) C = undefined;
11013 }
11014 } return C === undefined ? $Array : C;
11015};
11016
11017
11018/***/ }),
11019/* 356 */
11020/***/ (function(module, exports, __webpack_require__) {
11021
11022var parent = __webpack_require__(357);
11023
11024module.exports = parent;
11025
11026
11027/***/ }),
11028/* 357 */
11029/***/ (function(module, exports, __webpack_require__) {
11030
11031var isPrototypeOf = __webpack_require__(20);
11032var method = __webpack_require__(358);
11033
11034var ArrayPrototype = Array.prototype;
11035
11036module.exports = function (it) {
11037 var own = it.map;
11038 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;
11039};
11040
11041
11042/***/ }),
11043/* 358 */
11044/***/ (function(module, exports, __webpack_require__) {
11045
11046__webpack_require__(359);
11047var entryVirtual = __webpack_require__(38);
11048
11049module.exports = entryVirtual('Array').map;
11050
11051
11052/***/ }),
11053/* 359 */
11054/***/ (function(module, exports, __webpack_require__) {
11055
11056"use strict";
11057
11058var $ = __webpack_require__(0);
11059var $map = __webpack_require__(101).map;
11060var arrayMethodHasSpeciesSupport = __webpack_require__(100);
11061
11062var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
11063
11064// `Array.prototype.map` method
11065// https://tc39.es/ecma262/#sec-array.prototype.map
11066// with adding support of @@species
11067$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
11068 map: function map(callbackfn /* , thisArg */) {
11069 return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
11070 }
11071});
11072
11073
11074/***/ }),
11075/* 360 */
11076/***/ (function(module, exports, __webpack_require__) {
11077
11078var parent = __webpack_require__(361);
11079
11080module.exports = parent;
11081
11082
11083/***/ }),
11084/* 361 */
11085/***/ (function(module, exports, __webpack_require__) {
11086
11087__webpack_require__(362);
11088var path = __webpack_require__(13);
11089
11090module.exports = path.Object.keys;
11091
11092
11093/***/ }),
11094/* 362 */
11095/***/ (function(module, exports, __webpack_require__) {
11096
11097var $ = __webpack_require__(0);
11098var toObject = __webpack_require__(35);
11099var nativeKeys = __webpack_require__(116);
11100var fails = __webpack_require__(4);
11101
11102var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
11103
11104// `Object.keys` method
11105// https://tc39.es/ecma262/#sec-object.keys
11106$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
11107 keys: function keys(it) {
11108 return nativeKeys(toObject(it));
11109 }
11110});
11111
11112
11113/***/ }),
11114/* 363 */
11115/***/ (function(module, exports, __webpack_require__) {
11116
11117var parent = __webpack_require__(364);
11118
11119module.exports = parent;
11120
11121
11122/***/ }),
11123/* 364 */
11124/***/ (function(module, exports, __webpack_require__) {
11125
11126__webpack_require__(213);
11127var path = __webpack_require__(13);
11128var apply = __webpack_require__(62);
11129
11130// eslint-disable-next-line es-x/no-json -- safe
11131if (!path.JSON) path.JSON = { stringify: JSON.stringify };
11132
11133// eslint-disable-next-line no-unused-vars -- required for `.length`
11134module.exports = function stringify(it, replacer, space) {
11135 return apply(path.JSON.stringify, null, arguments);
11136};
11137
11138
11139/***/ }),
11140/* 365 */
11141/***/ (function(module, exports, __webpack_require__) {
11142
11143var parent = __webpack_require__(366);
11144
11145module.exports = parent;
11146
11147
11148/***/ }),
11149/* 366 */
11150/***/ (function(module, exports, __webpack_require__) {
11151
11152var isPrototypeOf = __webpack_require__(20);
11153var method = __webpack_require__(367);
11154
11155var ArrayPrototype = Array.prototype;
11156
11157module.exports = function (it) {
11158 var own = it.indexOf;
11159 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;
11160};
11161
11162
11163/***/ }),
11164/* 367 */
11165/***/ (function(module, exports, __webpack_require__) {
11166
11167__webpack_require__(368);
11168var entryVirtual = __webpack_require__(38);
11169
11170module.exports = entryVirtual('Array').indexOf;
11171
11172
11173/***/ }),
11174/* 368 */
11175/***/ (function(module, exports, __webpack_require__) {
11176
11177"use strict";
11178
11179/* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
11180var $ = __webpack_require__(0);
11181var uncurryThis = __webpack_require__(6);
11182var $IndexOf = __webpack_require__(146).indexOf;
11183var arrayMethodIsStrict = __webpack_require__(369);
11184
11185var un$IndexOf = uncurryThis([].indexOf);
11186
11187var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
11188var STRICT_METHOD = arrayMethodIsStrict('indexOf');
11189
11190// `Array.prototype.indexOf` method
11191// https://tc39.es/ecma262/#sec-array.prototype.indexof
11192$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
11193 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
11194 var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
11195 return NEGATIVE_ZERO
11196 // convert -0 to +0
11197 ? un$IndexOf(this, searchElement, fromIndex) || 0
11198 : $IndexOf(this, searchElement, fromIndex);
11199 }
11200});
11201
11202
11203/***/ }),
11204/* 369 */
11205/***/ (function(module, exports, __webpack_require__) {
11206
11207"use strict";
11208
11209var fails = __webpack_require__(4);
11210
11211module.exports = function (METHOD_NAME, argument) {
11212 var method = [][METHOD_NAME];
11213 return !!method && fails(function () {
11214 // eslint-disable-next-line no-useless-call -- required for testing
11215 method.call(null, argument || function () { return 1; }, 1);
11216 });
11217};
11218
11219
11220/***/ }),
11221/* 370 */
11222/***/ (function(module, exports, __webpack_require__) {
11223
11224__webpack_require__(73);
11225var classof = __webpack_require__(53);
11226var hasOwn = __webpack_require__(14);
11227var isPrototypeOf = __webpack_require__(20);
11228var method = __webpack_require__(371);
11229
11230var ArrayPrototype = Array.prototype;
11231
11232var DOMIterables = {
11233 DOMTokenList: true,
11234 NodeList: true
11235};
11236
11237module.exports = function (it) {
11238 var own = it.keys;
11239 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
11240 || hasOwn(DOMIterables, classof(it)) ? method : own;
11241};
11242
11243
11244/***/ }),
11245/* 371 */
11246/***/ (function(module, exports, __webpack_require__) {
11247
11248var parent = __webpack_require__(372);
11249
11250module.exports = parent;
11251
11252
11253/***/ }),
11254/* 372 */
11255/***/ (function(module, exports, __webpack_require__) {
11256
11257__webpack_require__(70);
11258__webpack_require__(92);
11259var entryVirtual = __webpack_require__(38);
11260
11261module.exports = entryVirtual('Array').keys;
11262
11263
11264/***/ }),
11265/* 373 */
11266/***/ (function(module, exports) {
11267
11268// Unique ID creation requires a high quality random # generator. In the
11269// browser this is a little complicated due to unknown quality of Math.random()
11270// and inconsistent support for the `crypto` API. We do the best we can via
11271// feature-detection
11272
11273// getRandomValues needs to be invoked in a context where "this" is a Crypto
11274// implementation. Also, find the complete implementation of crypto on IE11.
11275var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
11276 (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
11277
11278if (getRandomValues) {
11279 // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
11280 var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
11281
11282 module.exports = function whatwgRNG() {
11283 getRandomValues(rnds8);
11284 return rnds8;
11285 };
11286} else {
11287 // Math.random()-based (RNG)
11288 //
11289 // If all else fails, use Math.random(). It's fast, but is of unspecified
11290 // quality.
11291 var rnds = new Array(16);
11292
11293 module.exports = function mathRNG() {
11294 for (var i = 0, r; i < 16; i++) {
11295 if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
11296 rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
11297 }
11298
11299 return rnds;
11300 };
11301}
11302
11303
11304/***/ }),
11305/* 374 */
11306/***/ (function(module, exports) {
11307
11308/**
11309 * Convert array of 16 byte values to UUID string format of the form:
11310 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
11311 */
11312var byteToHex = [];
11313for (var i = 0; i < 256; ++i) {
11314 byteToHex[i] = (i + 0x100).toString(16).substr(1);
11315}
11316
11317function bytesToUuid(buf, offset) {
11318 var i = offset || 0;
11319 var bth = byteToHex;
11320 // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
11321 return ([bth[buf[i++]], bth[buf[i++]],
11322 bth[buf[i++]], bth[buf[i++]], '-',
11323 bth[buf[i++]], bth[buf[i++]], '-',
11324 bth[buf[i++]], bth[buf[i++]], '-',
11325 bth[buf[i++]], bth[buf[i++]], '-',
11326 bth[buf[i++]], bth[buf[i++]],
11327 bth[buf[i++]], bth[buf[i++]],
11328 bth[buf[i++]], bth[buf[i++]]]).join('');
11329}
11330
11331module.exports = bytesToUuid;
11332
11333
11334/***/ }),
11335/* 375 */
11336/***/ (function(module, exports, __webpack_require__) {
11337
11338"use strict";
11339
11340
11341/**
11342 * This is the common logic for both the Node.js and web browser
11343 * implementations of `debug()`.
11344 */
11345function setup(env) {
11346 createDebug.debug = createDebug;
11347 createDebug.default = createDebug;
11348 createDebug.coerce = coerce;
11349 createDebug.disable = disable;
11350 createDebug.enable = enable;
11351 createDebug.enabled = enabled;
11352 createDebug.humanize = __webpack_require__(376);
11353 Object.keys(env).forEach(function (key) {
11354 createDebug[key] = env[key];
11355 });
11356 /**
11357 * Active `debug` instances.
11358 */
11359
11360 createDebug.instances = [];
11361 /**
11362 * The currently active debug mode names, and names to skip.
11363 */
11364
11365 createDebug.names = [];
11366 createDebug.skips = [];
11367 /**
11368 * Map of special "%n" handling functions, for the debug "format" argument.
11369 *
11370 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
11371 */
11372
11373 createDebug.formatters = {};
11374 /**
11375 * Selects a color for a debug namespace
11376 * @param {String} namespace The namespace string for the for the debug instance to be colored
11377 * @return {Number|String} An ANSI color code for the given namespace
11378 * @api private
11379 */
11380
11381 function selectColor(namespace) {
11382 var hash = 0;
11383
11384 for (var i = 0; i < namespace.length; i++) {
11385 hash = (hash << 5) - hash + namespace.charCodeAt(i);
11386 hash |= 0; // Convert to 32bit integer
11387 }
11388
11389 return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
11390 }
11391
11392 createDebug.selectColor = selectColor;
11393 /**
11394 * Create a debugger with the given `namespace`.
11395 *
11396 * @param {String} namespace
11397 * @return {Function}
11398 * @api public
11399 */
11400
11401 function createDebug(namespace) {
11402 var prevTime;
11403
11404 function debug() {
11405 // Disabled?
11406 if (!debug.enabled) {
11407 return;
11408 }
11409
11410 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11411 args[_key] = arguments[_key];
11412 }
11413
11414 var self = debug; // Set `diff` timestamp
11415
11416 var curr = Number(new Date());
11417 var ms = curr - (prevTime || curr);
11418 self.diff = ms;
11419 self.prev = prevTime;
11420 self.curr = curr;
11421 prevTime = curr;
11422 args[0] = createDebug.coerce(args[0]);
11423
11424 if (typeof args[0] !== 'string') {
11425 // Anything else let's inspect with %O
11426 args.unshift('%O');
11427 } // Apply any `formatters` transformations
11428
11429
11430 var index = 0;
11431 args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
11432 // If we encounter an escaped % then don't increase the array index
11433 if (match === '%%') {
11434 return match;
11435 }
11436
11437 index++;
11438 var formatter = createDebug.formatters[format];
11439
11440 if (typeof formatter === 'function') {
11441 var val = args[index];
11442 match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
11443
11444 args.splice(index, 1);
11445 index--;
11446 }
11447
11448 return match;
11449 }); // Apply env-specific formatting (colors, etc.)
11450
11451 createDebug.formatArgs.call(self, args);
11452 var logFn = self.log || createDebug.log;
11453 logFn.apply(self, args);
11454 }
11455
11456 debug.namespace = namespace;
11457 debug.enabled = createDebug.enabled(namespace);
11458 debug.useColors = createDebug.useColors();
11459 debug.color = selectColor(namespace);
11460 debug.destroy = destroy;
11461 debug.extend = extend; // Debug.formatArgs = formatArgs;
11462 // debug.rawLog = rawLog;
11463 // env-specific initialization logic for debug instances
11464
11465 if (typeof createDebug.init === 'function') {
11466 createDebug.init(debug);
11467 }
11468
11469 createDebug.instances.push(debug);
11470 return debug;
11471 }
11472
11473 function destroy() {
11474 var index = createDebug.instances.indexOf(this);
11475
11476 if (index !== -1) {
11477 createDebug.instances.splice(index, 1);
11478 return true;
11479 }
11480
11481 return false;
11482 }
11483
11484 function extend(namespace, delimiter) {
11485 return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
11486 }
11487 /**
11488 * Enables a debug mode by namespaces. This can include modes
11489 * separated by a colon and wildcards.
11490 *
11491 * @param {String} namespaces
11492 * @api public
11493 */
11494
11495
11496 function enable(namespaces) {
11497 createDebug.save(namespaces);
11498 createDebug.names = [];
11499 createDebug.skips = [];
11500 var i;
11501 var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
11502 var len = split.length;
11503
11504 for (i = 0; i < len; i++) {
11505 if (!split[i]) {
11506 // ignore empty strings
11507 continue;
11508 }
11509
11510 namespaces = split[i].replace(/\*/g, '.*?');
11511
11512 if (namespaces[0] === '-') {
11513 createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
11514 } else {
11515 createDebug.names.push(new RegExp('^' + namespaces + '$'));
11516 }
11517 }
11518
11519 for (i = 0; i < createDebug.instances.length; i++) {
11520 var instance = createDebug.instances[i];
11521 instance.enabled = createDebug.enabled(instance.namespace);
11522 }
11523 }
11524 /**
11525 * Disable debug output.
11526 *
11527 * @api public
11528 */
11529
11530
11531 function disable() {
11532 createDebug.enable('');
11533 }
11534 /**
11535 * Returns true if the given mode name is enabled, false otherwise.
11536 *
11537 * @param {String} name
11538 * @return {Boolean}
11539 * @api public
11540 */
11541
11542
11543 function enabled(name) {
11544 if (name[name.length - 1] === '*') {
11545 return true;
11546 }
11547
11548 var i;
11549 var len;
11550
11551 for (i = 0, len = createDebug.skips.length; i < len; i++) {
11552 if (createDebug.skips[i].test(name)) {
11553 return false;
11554 }
11555 }
11556
11557 for (i = 0, len = createDebug.names.length; i < len; i++) {
11558 if (createDebug.names[i].test(name)) {
11559 return true;
11560 }
11561 }
11562
11563 return false;
11564 }
11565 /**
11566 * Coerce `val`.
11567 *
11568 * @param {Mixed} val
11569 * @return {Mixed}
11570 * @api private
11571 */
11572
11573
11574 function coerce(val) {
11575 if (val instanceof Error) {
11576 return val.stack || val.message;
11577 }
11578
11579 return val;
11580 }
11581
11582 createDebug.enable(createDebug.load());
11583 return createDebug;
11584}
11585
11586module.exports = setup;
11587
11588
11589
11590/***/ }),
11591/* 376 */
11592/***/ (function(module, exports) {
11593
11594/**
11595 * Helpers.
11596 */
11597
11598var s = 1000;
11599var m = s * 60;
11600var h = m * 60;
11601var d = h * 24;
11602var w = d * 7;
11603var y = d * 365.25;
11604
11605/**
11606 * Parse or format the given `val`.
11607 *
11608 * Options:
11609 *
11610 * - `long` verbose formatting [false]
11611 *
11612 * @param {String|Number} val
11613 * @param {Object} [options]
11614 * @throws {Error} throw an error if val is not a non-empty string or a number
11615 * @return {String|Number}
11616 * @api public
11617 */
11618
11619module.exports = function(val, options) {
11620 options = options || {};
11621 var type = typeof val;
11622 if (type === 'string' && val.length > 0) {
11623 return parse(val);
11624 } else if (type === 'number' && isFinite(val)) {
11625 return options.long ? fmtLong(val) : fmtShort(val);
11626 }
11627 throw new Error(
11628 'val is not a non-empty string or a valid number. val=' +
11629 JSON.stringify(val)
11630 );
11631};
11632
11633/**
11634 * Parse the given `str` and return milliseconds.
11635 *
11636 * @param {String} str
11637 * @return {Number}
11638 * @api private
11639 */
11640
11641function parse(str) {
11642 str = String(str);
11643 if (str.length > 100) {
11644 return;
11645 }
11646 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(
11647 str
11648 );
11649 if (!match) {
11650 return;
11651 }
11652 var n = parseFloat(match[1]);
11653 var type = (match[2] || 'ms').toLowerCase();
11654 switch (type) {
11655 case 'years':
11656 case 'year':
11657 case 'yrs':
11658 case 'yr':
11659 case 'y':
11660 return n * y;
11661 case 'weeks':
11662 case 'week':
11663 case 'w':
11664 return n * w;
11665 case 'days':
11666 case 'day':
11667 case 'd':
11668 return n * d;
11669 case 'hours':
11670 case 'hour':
11671 case 'hrs':
11672 case 'hr':
11673 case 'h':
11674 return n * h;
11675 case 'minutes':
11676 case 'minute':
11677 case 'mins':
11678 case 'min':
11679 case 'm':
11680 return n * m;
11681 case 'seconds':
11682 case 'second':
11683 case 'secs':
11684 case 'sec':
11685 case 's':
11686 return n * s;
11687 case 'milliseconds':
11688 case 'millisecond':
11689 case 'msecs':
11690 case 'msec':
11691 case 'ms':
11692 return n;
11693 default:
11694 return undefined;
11695 }
11696}
11697
11698/**
11699 * Short format for `ms`.
11700 *
11701 * @param {Number} ms
11702 * @return {String}
11703 * @api private
11704 */
11705
11706function fmtShort(ms) {
11707 var msAbs = Math.abs(ms);
11708 if (msAbs >= d) {
11709 return Math.round(ms / d) + 'd';
11710 }
11711 if (msAbs >= h) {
11712 return Math.round(ms / h) + 'h';
11713 }
11714 if (msAbs >= m) {
11715 return Math.round(ms / m) + 'm';
11716 }
11717 if (msAbs >= s) {
11718 return Math.round(ms / s) + 's';
11719 }
11720 return ms + 'ms';
11721}
11722
11723/**
11724 * Long format for `ms`.
11725 *
11726 * @param {Number} ms
11727 * @return {String}
11728 * @api private
11729 */
11730
11731function fmtLong(ms) {
11732 var msAbs = Math.abs(ms);
11733 if (msAbs >= d) {
11734 return plural(ms, msAbs, d, 'day');
11735 }
11736 if (msAbs >= h) {
11737 return plural(ms, msAbs, h, 'hour');
11738 }
11739 if (msAbs >= m) {
11740 return plural(ms, msAbs, m, 'minute');
11741 }
11742 if (msAbs >= s) {
11743 return plural(ms, msAbs, s, 'second');
11744 }
11745 return ms + ' ms';
11746}
11747
11748/**
11749 * Pluralization helper.
11750 */
11751
11752function plural(ms, msAbs, n, name) {
11753 var isPlural = msAbs >= n * 1.5;
11754 return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
11755}
11756
11757
11758/***/ }),
11759/* 377 */
11760/***/ (function(module, exports, __webpack_require__) {
11761
11762__webpack_require__(378);
11763var path = __webpack_require__(13);
11764
11765module.exports = path.Object.getPrototypeOf;
11766
11767
11768/***/ }),
11769/* 378 */
11770/***/ (function(module, exports, __webpack_require__) {
11771
11772var $ = __webpack_require__(0);
11773var fails = __webpack_require__(4);
11774var toObject = __webpack_require__(35);
11775var nativeGetPrototypeOf = __webpack_require__(86);
11776var CORRECT_PROTOTYPE_GETTER = __webpack_require__(144);
11777
11778var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
11779
11780// `Object.getPrototypeOf` method
11781// https://tc39.es/ecma262/#sec-object.getprototypeof
11782$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
11783 getPrototypeOf: function getPrototypeOf(it) {
11784 return nativeGetPrototypeOf(toObject(it));
11785 }
11786});
11787
11788
11789
11790/***/ }),
11791/* 379 */
11792/***/ (function(module, exports, __webpack_require__) {
11793
11794module.exports = __webpack_require__(221);
11795
11796/***/ }),
11797/* 380 */
11798/***/ (function(module, exports, __webpack_require__) {
11799
11800__webpack_require__(381);
11801var path = __webpack_require__(13);
11802
11803module.exports = path.Object.setPrototypeOf;
11804
11805
11806/***/ }),
11807/* 381 */
11808/***/ (function(module, exports, __webpack_require__) {
11809
11810var $ = __webpack_require__(0);
11811var setPrototypeOf = __webpack_require__(88);
11812
11813// `Object.setPrototypeOf` method
11814// https://tc39.es/ecma262/#sec-object.setprototypeof
11815$({ target: 'Object', stat: true }, {
11816 setPrototypeOf: setPrototypeOf
11817});
11818
11819
11820/***/ }),
11821/* 382 */
11822/***/ (function(module, exports, __webpack_require__) {
11823
11824"use strict";
11825
11826
11827var _interopRequireDefault = __webpack_require__(2);
11828
11829var _slice = _interopRequireDefault(__webpack_require__(81));
11830
11831var _concat = _interopRequireDefault(__webpack_require__(29));
11832
11833var _defineProperty = _interopRequireDefault(__webpack_require__(223));
11834
11835var AV = __webpack_require__(59);
11836
11837var AppRouter = __webpack_require__(388);
11838
11839var _require = __webpack_require__(28),
11840 isNullOrUndefined = _require.isNullOrUndefined;
11841
11842var _require2 = __webpack_require__(1),
11843 extend = _require2.extend,
11844 isObject = _require2.isObject,
11845 isEmpty = _require2.isEmpty;
11846
11847var isCNApp = function isCNApp(appId) {
11848 return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
11849};
11850
11851var fillServerURLs = function fillServerURLs(url) {
11852 return {
11853 push: url,
11854 stats: url,
11855 engine: url,
11856 api: url,
11857 rtm: url
11858 };
11859};
11860
11861function getDefaultServerURLs(appId) {
11862 var _context, _context2, _context3, _context4, _context5;
11863
11864 if (isCNApp(appId)) {
11865 return {};
11866 }
11867
11868 var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
11869 var domain = 'lncldglobal.com';
11870 return {
11871 push: (0, _concat.default)(_context = "https://".concat(id, ".push.")).call(_context, domain),
11872 stats: (0, _concat.default)(_context2 = "https://".concat(id, ".stats.")).call(_context2, domain),
11873 engine: (0, _concat.default)(_context3 = "https://".concat(id, ".engine.")).call(_context3, domain),
11874 api: (0, _concat.default)(_context4 = "https://".concat(id, ".api.")).call(_context4, domain),
11875 rtm: (0, _concat.default)(_context5 = "https://".concat(id, ".rtm.")).call(_context5, domain)
11876 };
11877}
11878
11879var _disableAppRouter = false;
11880var _initialized = false;
11881/**
11882 * URLs for services
11883 * @typedef {Object} ServerURLs
11884 * @property {String} [api] serverURL for API service
11885 * @property {String} [engine] serverURL for engine service
11886 * @property {String} [stats] serverURL for stats service
11887 * @property {String} [push] serverURL for push service
11888 * @property {String} [rtm] serverURL for LiveQuery service
11889 */
11890
11891/**
11892 * Call this method first to set up your authentication tokens for AV.
11893 * You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .
11894 * @function AV.init
11895 * @param {Object} options
11896 * @param {String} options.appId application id
11897 * @param {String} options.appKey application key
11898 * @param {String} [options.masterKey] application master key
11899 * @param {Boolean} [options.production]
11900 * @param {String|ServerURLs} [options.serverURL] URLs for services. if a string was given, it will be applied for all services.
11901 * @param {Boolean} [options.disableCurrentUser]
11902 */
11903
11904AV.init = function init(options) {
11905 if (!isObject(options)) {
11906 return AV.init({
11907 appId: options,
11908 appKey: arguments.length <= 1 ? undefined : arguments[1],
11909 masterKey: arguments.length <= 2 ? undefined : arguments[2]
11910 });
11911 }
11912
11913 var appId = options.appId,
11914 appKey = options.appKey,
11915 masterKey = options.masterKey,
11916 hookKey = options.hookKey,
11917 serverURL = options.serverURL,
11918 _options$serverURLs = options.serverURLs,
11919 serverURLs = _options$serverURLs === void 0 ? serverURL : _options$serverURLs,
11920 disableCurrentUser = options.disableCurrentUser,
11921 production = options.production,
11922 realtime = options.realtime;
11923 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.');
11924 if (!appId) throw new TypeError('appId must be a string');
11925 if (!appKey) throw new TypeError('appKey must be a string');
11926 if (undefined !== 'NODE_JS' && masterKey) console.warn('MasterKey is not supposed to be used at client side.');
11927
11928 if (isCNApp(appId)) {
11929 if (!serverURLs && isEmpty(AV._config.serverURLs)) {
11930 throw new TypeError("serverURL option is required for apps from CN region");
11931 }
11932 }
11933
11934 if (appId !== AV._config.applicationId) {
11935 // overwrite all keys when reinitializing as a new app
11936 AV._config.masterKey = masterKey;
11937 AV._config.hookKey = hookKey;
11938 } else {
11939 if (masterKey) AV._config.masterKey = masterKey;
11940 if (hookKey) AV._config.hookKey = hookKey;
11941 }
11942
11943 AV._config.applicationId = appId;
11944 AV._config.applicationKey = appKey;
11945
11946 if (!isNullOrUndefined(production)) {
11947 AV.setProduction(production);
11948 }
11949
11950 if (typeof disableCurrentUser !== 'undefined') AV._config.disableCurrentUser = disableCurrentUser;
11951 var disableAppRouter = _disableAppRouter || typeof serverURLs !== 'undefined';
11952
11953 if (!disableAppRouter) {
11954 AV._appRouter = new AppRouter(AV);
11955 }
11956
11957 AV._setServerURLs(extend({}, getDefaultServerURLs(appId), AV._config.serverURLs, typeof serverURLs === 'string' ? fillServerURLs(serverURLs) : serverURLs), disableAppRouter);
11958
11959 if (realtime) {
11960 AV._config.realtime = realtime;
11961 } else if (AV._sharedConfig.liveQueryRealtime) {
11962 var _AV$_config$serverURL = AV._config.serverURLs,
11963 api = _AV$_config$serverURL.api,
11964 rtm = _AV$_config$serverURL.rtm;
11965 AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
11966 appId: appId,
11967 appKey: appKey,
11968 server: {
11969 api: api,
11970 RTMRouter: rtm
11971 }
11972 });
11973 }
11974
11975 _initialized = true;
11976}; // If we're running in node.js, allow using the master key.
11977
11978
11979if (undefined === 'NODE_JS') {
11980 AV.Cloud = AV.Cloud || {};
11981 /**
11982 * Switches the LeanCloud SDK to using the Master key. The Master key grants
11983 * priveleged access to the data in LeanCloud and can be used to bypass ACLs and
11984 * other restrictions that are applied to the client SDKs.
11985 * <p><strong><em>Available in Cloud Code and Node.js only.</em></strong>
11986 * </p>
11987 */
11988
11989 AV.Cloud.useMasterKey = function () {
11990 AV._config.useMasterKey = true;
11991 };
11992}
11993/**
11994 * Call this method to set production environment variable.
11995 * @function AV.setProduction
11996 * @param {Boolean} production True is production environment,and
11997 * it's true by default.
11998 */
11999
12000
12001AV.setProduction = function (production) {
12002 if (!isNullOrUndefined(production)) {
12003 AV._config.production = production ? 1 : 0;
12004 } else {
12005 // change to default value
12006 AV._config.production = null;
12007 }
12008};
12009
12010AV._setServerURLs = function (urls) {
12011 var disableAppRouter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
12012
12013 if (typeof urls !== 'string') {
12014 extend(AV._config.serverURLs, urls);
12015 } else {
12016 AV._config.serverURLs = fillServerURLs(urls);
12017 }
12018
12019 if (disableAppRouter) {
12020 if (AV._appRouter) {
12021 AV._appRouter.disable();
12022 } else {
12023 _disableAppRouter = true;
12024 }
12025 }
12026};
12027/**
12028 * Set server URLs for services.
12029 * @function AV.setServerURL
12030 * @since 4.3.0
12031 * @param {String|ServerURLs} urls URLs for services. if a string was given, it will be applied for all services.
12032 * You can also set them when initializing SDK with `options.serverURL`
12033 */
12034
12035
12036AV.setServerURL = function (urls) {
12037 return AV._setServerURLs(urls);
12038};
12039
12040AV.setServerURLs = AV.setServerURL;
12041
12042AV.keepErrorRawMessage = function (value) {
12043 AV._sharedConfig.keepErrorRawMessage = value;
12044};
12045/**
12046 * Set a deadline for requests to complete.
12047 * Note that file upload requests are not affected.
12048 * @function AV.setRequestTimeout
12049 * @since 3.6.0
12050 * @param {number} ms
12051 */
12052
12053
12054AV.setRequestTimeout = function (ms) {
12055 AV._config.requestTimeout = ms;
12056}; // backword compatible
12057
12058
12059AV.initialize = AV.init;
12060
12061var defineConfig = function defineConfig(property) {
12062 return (0, _defineProperty.default)(AV, property, {
12063 get: function get() {
12064 return AV._config[property];
12065 },
12066 set: function set(value) {
12067 AV._config[property] = value;
12068 }
12069 });
12070};
12071
12072['applicationId', 'applicationKey', 'masterKey', 'hookKey'].forEach(defineConfig);
12073
12074/***/ }),
12075/* 383 */
12076/***/ (function(module, exports, __webpack_require__) {
12077
12078var isPrototypeOf = __webpack_require__(20);
12079var method = __webpack_require__(384);
12080
12081var ArrayPrototype = Array.prototype;
12082
12083module.exports = function (it) {
12084 var own = it.slice;
12085 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
12086};
12087
12088
12089/***/ }),
12090/* 384 */
12091/***/ (function(module, exports, __webpack_require__) {
12092
12093__webpack_require__(385);
12094var entryVirtual = __webpack_require__(38);
12095
12096module.exports = entryVirtual('Array').slice;
12097
12098
12099/***/ }),
12100/* 385 */
12101/***/ (function(module, exports, __webpack_require__) {
12102
12103"use strict";
12104
12105var $ = __webpack_require__(0);
12106var isArray = __webpack_require__(80);
12107var isConstructor = __webpack_require__(93);
12108var isObject = __webpack_require__(17);
12109var toAbsoluteIndex = __webpack_require__(112);
12110var lengthOfArrayLike = __webpack_require__(42);
12111var toIndexedObject = __webpack_require__(33);
12112var createProperty = __webpack_require__(99);
12113var wellKnownSymbol = __webpack_require__(8);
12114var arrayMethodHasSpeciesSupport = __webpack_require__(100);
12115var un$Slice = __webpack_require__(94);
12116
12117var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
12118
12119var SPECIES = wellKnownSymbol('species');
12120var $Array = Array;
12121var max = Math.max;
12122
12123// `Array.prototype.slice` method
12124// https://tc39.es/ecma262/#sec-array.prototype.slice
12125// fallback for not array-like ES3 strings and DOM objects
12126$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
12127 slice: function slice(start, end) {
12128 var O = toIndexedObject(this);
12129 var length = lengthOfArrayLike(O);
12130 var k = toAbsoluteIndex(start, length);
12131 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
12132 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
12133 var Constructor, result, n;
12134 if (isArray(O)) {
12135 Constructor = O.constructor;
12136 // cross-realm fallback
12137 if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
12138 Constructor = undefined;
12139 } else if (isObject(Constructor)) {
12140 Constructor = Constructor[SPECIES];
12141 if (Constructor === null) Constructor = undefined;
12142 }
12143 if (Constructor === $Array || Constructor === undefined) {
12144 return un$Slice(O, k, fin);
12145 }
12146 }
12147 result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
12148 for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
12149 result.length = n;
12150 return result;
12151 }
12152});
12153
12154
12155/***/ }),
12156/* 386 */
12157/***/ (function(module, exports, __webpack_require__) {
12158
12159__webpack_require__(387);
12160var path = __webpack_require__(13);
12161
12162var Object = path.Object;
12163
12164var defineProperty = module.exports = function defineProperty(it, key, desc) {
12165 return Object.defineProperty(it, key, desc);
12166};
12167
12168if (Object.defineProperty.sham) defineProperty.sham = true;
12169
12170
12171/***/ }),
12172/* 387 */
12173/***/ (function(module, exports, __webpack_require__) {
12174
12175var $ = __webpack_require__(0);
12176var DESCRIPTORS = __webpack_require__(19);
12177var defineProperty = __webpack_require__(32).f;
12178
12179// `Object.defineProperty` method
12180// https://tc39.es/ecma262/#sec-object.defineproperty
12181// eslint-disable-next-line es-x/no-object-defineproperty -- safe
12182$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
12183 defineProperty: defineProperty
12184});
12185
12186
12187/***/ }),
12188/* 388 */
12189/***/ (function(module, exports, __webpack_require__) {
12190
12191"use strict";
12192
12193
12194var ajax = __webpack_require__(103);
12195
12196var Cache = __webpack_require__(220);
12197
12198function AppRouter(AV) {
12199 var _this = this;
12200
12201 this.AV = AV;
12202 this.lockedUntil = 0;
12203 Cache.getAsync('serverURLs').then(function (data) {
12204 if (_this.disabled) return;
12205 if (!data) return _this.lock(0);
12206 var serverURLs = data.serverURLs,
12207 lockedUntil = data.lockedUntil;
12208
12209 _this.AV._setServerURLs(serverURLs, false);
12210
12211 _this.lockedUntil = lockedUntil;
12212 }).catch(function () {
12213 return _this.lock(0);
12214 });
12215}
12216
12217AppRouter.prototype.disable = function disable() {
12218 this.disabled = true;
12219};
12220
12221AppRouter.prototype.lock = function lock(ttl) {
12222 this.lockedUntil = Date.now() + ttl;
12223};
12224
12225AppRouter.prototype.refresh = function refresh() {
12226 var _this2 = this;
12227
12228 if (this.disabled) return;
12229 if (Date.now() < this.lockedUntil) return;
12230 this.lock(10);
12231 var url = 'https://app-router.com/2/route';
12232 return ajax({
12233 method: 'get',
12234 url: url,
12235 query: {
12236 appId: this.AV.applicationId
12237 }
12238 }).then(function (servers) {
12239 if (_this2.disabled) return;
12240 var ttl = servers.ttl;
12241 if (!ttl) throw new Error('missing ttl');
12242 ttl = ttl * 1000;
12243 var protocal = 'https://';
12244 var serverURLs = {
12245 push: protocal + servers.push_server,
12246 stats: protocal + servers.stats_server,
12247 engine: protocal + servers.engine_server,
12248 api: protocal + servers.api_server
12249 };
12250
12251 _this2.AV._setServerURLs(serverURLs, false);
12252
12253 _this2.lock(ttl);
12254
12255 return Cache.setAsync('serverURLs', {
12256 serverURLs: serverURLs,
12257 lockedUntil: _this2.lockedUntil
12258 }, ttl);
12259 }).catch(function (error) {
12260 // bypass all errors
12261 console.warn("refresh server URLs failed: ".concat(error.message));
12262
12263 _this2.lock(600);
12264 });
12265};
12266
12267module.exports = AppRouter;
12268
12269/***/ }),
12270/* 389 */
12271/***/ (function(module, exports, __webpack_require__) {
12272
12273module.exports = __webpack_require__(390);
12274
12275
12276/***/ }),
12277/* 390 */
12278/***/ (function(module, exports, __webpack_require__) {
12279
12280var parent = __webpack_require__(391);
12281__webpack_require__(416);
12282__webpack_require__(417);
12283__webpack_require__(418);
12284__webpack_require__(419);
12285__webpack_require__(420);
12286// TODO: Remove from `core-js@4`
12287__webpack_require__(421);
12288__webpack_require__(422);
12289__webpack_require__(423);
12290
12291module.exports = parent;
12292
12293
12294/***/ }),
12295/* 391 */
12296/***/ (function(module, exports, __webpack_require__) {
12297
12298var parent = __webpack_require__(226);
12299
12300module.exports = parent;
12301
12302
12303/***/ }),
12304/* 392 */
12305/***/ (function(module, exports, __webpack_require__) {
12306
12307__webpack_require__(210);
12308__webpack_require__(92);
12309__webpack_require__(393);
12310__webpack_require__(400);
12311__webpack_require__(401);
12312__webpack_require__(402);
12313__webpack_require__(403);
12314__webpack_require__(229);
12315__webpack_require__(404);
12316__webpack_require__(405);
12317__webpack_require__(406);
12318__webpack_require__(407);
12319__webpack_require__(408);
12320__webpack_require__(409);
12321__webpack_require__(410);
12322__webpack_require__(411);
12323__webpack_require__(412);
12324__webpack_require__(413);
12325__webpack_require__(414);
12326__webpack_require__(415);
12327var path = __webpack_require__(13);
12328
12329module.exports = path.Symbol;
12330
12331
12332/***/ }),
12333/* 393 */
12334/***/ (function(module, exports, __webpack_require__) {
12335
12336// TODO: Remove this module from `core-js@4` since it's split to modules listed below
12337__webpack_require__(394);
12338__webpack_require__(397);
12339__webpack_require__(398);
12340__webpack_require__(213);
12341__webpack_require__(399);
12342
12343
12344/***/ }),
12345/* 394 */
12346/***/ (function(module, exports, __webpack_require__) {
12347
12348"use strict";
12349
12350var $ = __webpack_require__(0);
12351var global = __webpack_require__(9);
12352var call = __webpack_require__(11);
12353var uncurryThis = __webpack_require__(6);
12354var IS_PURE = __webpack_require__(31);
12355var DESCRIPTORS = __webpack_require__(19);
12356var NATIVE_SYMBOL = __webpack_require__(49);
12357var fails = __webpack_require__(4);
12358var hasOwn = __webpack_require__(14);
12359var isPrototypeOf = __webpack_require__(20);
12360var anObject = __webpack_require__(21);
12361var toIndexedObject = __webpack_require__(33);
12362var toPropertyKey = __webpack_require__(82);
12363var $toString = __webpack_require__(69);
12364var createPropertyDescriptor = __webpack_require__(41);
12365var nativeObjectCreate = __webpack_require__(51);
12366var objectKeys = __webpack_require__(116);
12367var getOwnPropertyNamesModule = __webpack_require__(111);
12368var getOwnPropertyNamesExternal = __webpack_require__(395);
12369var getOwnPropertySymbolsModule = __webpack_require__(115);
12370var getOwnPropertyDescriptorModule = __webpack_require__(64);
12371var definePropertyModule = __webpack_require__(32);
12372var definePropertiesModule = __webpack_require__(147);
12373var propertyIsEnumerableModule = __webpack_require__(138);
12374var defineBuiltIn = __webpack_require__(43);
12375var shared = __webpack_require__(67);
12376var sharedKey = __webpack_require__(87);
12377var hiddenKeys = __webpack_require__(89);
12378var uid = __webpack_require__(109);
12379var wellKnownSymbol = __webpack_require__(8);
12380var wrappedWellKnownSymbolModule = __webpack_require__(136);
12381var defineWellKnownSymbol = __webpack_require__(5);
12382var defineSymbolToPrimitive = __webpack_require__(227);
12383var setToStringTag = __webpack_require__(54);
12384var InternalStateModule = __webpack_require__(91);
12385var $forEach = __webpack_require__(101).forEach;
12386
12387var HIDDEN = sharedKey('hidden');
12388var SYMBOL = 'Symbol';
12389var PROTOTYPE = 'prototype';
12390
12391var setInternalState = InternalStateModule.set;
12392var getInternalState = InternalStateModule.getterFor(SYMBOL);
12393
12394var ObjectPrototype = Object[PROTOTYPE];
12395var $Symbol = global.Symbol;
12396var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
12397var TypeError = global.TypeError;
12398var QObject = global.QObject;
12399var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
12400var nativeDefineProperty = definePropertyModule.f;
12401var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
12402var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
12403var push = uncurryThis([].push);
12404
12405var AllSymbols = shared('symbols');
12406var ObjectPrototypeSymbols = shared('op-symbols');
12407var WellKnownSymbolsStore = shared('wks');
12408
12409// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
12410var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
12411
12412// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
12413var setSymbolDescriptor = DESCRIPTORS && fails(function () {
12414 return nativeObjectCreate(nativeDefineProperty({}, 'a', {
12415 get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
12416 })).a != 7;
12417}) ? function (O, P, Attributes) {
12418 var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
12419 if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
12420 nativeDefineProperty(O, P, Attributes);
12421 if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
12422 nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
12423 }
12424} : nativeDefineProperty;
12425
12426var wrap = function (tag, description) {
12427 var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
12428 setInternalState(symbol, {
12429 type: SYMBOL,
12430 tag: tag,
12431 description: description
12432 });
12433 if (!DESCRIPTORS) symbol.description = description;
12434 return symbol;
12435};
12436
12437var $defineProperty = function defineProperty(O, P, Attributes) {
12438 if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
12439 anObject(O);
12440 var key = toPropertyKey(P);
12441 anObject(Attributes);
12442 if (hasOwn(AllSymbols, key)) {
12443 if (!Attributes.enumerable) {
12444 if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
12445 O[HIDDEN][key] = true;
12446 } else {
12447 if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
12448 Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
12449 } return setSymbolDescriptor(O, key, Attributes);
12450 } return nativeDefineProperty(O, key, Attributes);
12451};
12452
12453var $defineProperties = function defineProperties(O, Properties) {
12454 anObject(O);
12455 var properties = toIndexedObject(Properties);
12456 var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
12457 $forEach(keys, function (key) {
12458 if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
12459 });
12460 return O;
12461};
12462
12463var $create = function create(O, Properties) {
12464 return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
12465};
12466
12467var $propertyIsEnumerable = function propertyIsEnumerable(V) {
12468 var P = toPropertyKey(V);
12469 var enumerable = call(nativePropertyIsEnumerable, this, P);
12470 if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
12471 return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
12472 ? enumerable : true;
12473};
12474
12475var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
12476 var it = toIndexedObject(O);
12477 var key = toPropertyKey(P);
12478 if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
12479 var descriptor = nativeGetOwnPropertyDescriptor(it, key);
12480 if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
12481 descriptor.enumerable = true;
12482 }
12483 return descriptor;
12484};
12485
12486var $getOwnPropertyNames = function getOwnPropertyNames(O) {
12487 var names = nativeGetOwnPropertyNames(toIndexedObject(O));
12488 var result = [];
12489 $forEach(names, function (key) {
12490 if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
12491 });
12492 return result;
12493};
12494
12495var $getOwnPropertySymbols = function (O) {
12496 var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
12497 var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
12498 var result = [];
12499 $forEach(names, function (key) {
12500 if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
12501 push(result, AllSymbols[key]);
12502 }
12503 });
12504 return result;
12505};
12506
12507// `Symbol` constructor
12508// https://tc39.es/ecma262/#sec-symbol-constructor
12509if (!NATIVE_SYMBOL) {
12510 $Symbol = function Symbol() {
12511 if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
12512 var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
12513 var tag = uid(description);
12514 var setter = function (value) {
12515 if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
12516 if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
12517 setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
12518 };
12519 if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
12520 return wrap(tag, description);
12521 };
12522
12523 SymbolPrototype = $Symbol[PROTOTYPE];
12524
12525 defineBuiltIn(SymbolPrototype, 'toString', function toString() {
12526 return getInternalState(this).tag;
12527 });
12528
12529 defineBuiltIn($Symbol, 'withoutSetter', function (description) {
12530 return wrap(uid(description), description);
12531 });
12532
12533 propertyIsEnumerableModule.f = $propertyIsEnumerable;
12534 definePropertyModule.f = $defineProperty;
12535 definePropertiesModule.f = $defineProperties;
12536 getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
12537 getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
12538 getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
12539
12540 wrappedWellKnownSymbolModule.f = function (name) {
12541 return wrap(wellKnownSymbol(name), name);
12542 };
12543
12544 if (DESCRIPTORS) {
12545 // https://github.com/tc39/proposal-Symbol-description
12546 nativeDefineProperty(SymbolPrototype, 'description', {
12547 configurable: true,
12548 get: function description() {
12549 return getInternalState(this).description;
12550 }
12551 });
12552 if (!IS_PURE) {
12553 defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
12554 }
12555 }
12556}
12557
12558$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
12559 Symbol: $Symbol
12560});
12561
12562$forEach(objectKeys(WellKnownSymbolsStore), function (name) {
12563 defineWellKnownSymbol(name);
12564});
12565
12566$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
12567 useSetter: function () { USE_SETTER = true; },
12568 useSimple: function () { USE_SETTER = false; }
12569});
12570
12571$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
12572 // `Object.create` method
12573 // https://tc39.es/ecma262/#sec-object.create
12574 create: $create,
12575 // `Object.defineProperty` method
12576 // https://tc39.es/ecma262/#sec-object.defineproperty
12577 defineProperty: $defineProperty,
12578 // `Object.defineProperties` method
12579 // https://tc39.es/ecma262/#sec-object.defineproperties
12580 defineProperties: $defineProperties,
12581 // `Object.getOwnPropertyDescriptor` method
12582 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
12583 getOwnPropertyDescriptor: $getOwnPropertyDescriptor
12584});
12585
12586$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
12587 // `Object.getOwnPropertyNames` method
12588 // https://tc39.es/ecma262/#sec-object.getownpropertynames
12589 getOwnPropertyNames: $getOwnPropertyNames
12590});
12591
12592// `Symbol.prototype[@@toPrimitive]` method
12593// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
12594defineSymbolToPrimitive();
12595
12596// `Symbol.prototype[@@toStringTag]` property
12597// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
12598setToStringTag($Symbol, SYMBOL);
12599
12600hiddenKeys[HIDDEN] = true;
12601
12602
12603/***/ }),
12604/* 395 */
12605/***/ (function(module, exports, __webpack_require__) {
12606
12607/* eslint-disable es-x/no-object-getownpropertynames -- safe */
12608var classof = __webpack_require__(65);
12609var toIndexedObject = __webpack_require__(33);
12610var $getOwnPropertyNames = __webpack_require__(111).f;
12611var arraySlice = __webpack_require__(396);
12612
12613var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
12614 ? Object.getOwnPropertyNames(window) : [];
12615
12616var getWindowNames = function (it) {
12617 try {
12618 return $getOwnPropertyNames(it);
12619 } catch (error) {
12620 return arraySlice(windowNames);
12621 }
12622};
12623
12624// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
12625module.exports.f = function getOwnPropertyNames(it) {
12626 return windowNames && classof(it) == 'Window'
12627 ? getWindowNames(it)
12628 : $getOwnPropertyNames(toIndexedObject(it));
12629};
12630
12631
12632/***/ }),
12633/* 396 */
12634/***/ (function(module, exports, __webpack_require__) {
12635
12636var toAbsoluteIndex = __webpack_require__(112);
12637var lengthOfArrayLike = __webpack_require__(42);
12638var createProperty = __webpack_require__(99);
12639
12640var $Array = Array;
12641var max = Math.max;
12642
12643module.exports = function (O, start, end) {
12644 var length = lengthOfArrayLike(O);
12645 var k = toAbsoluteIndex(start, length);
12646 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
12647 var result = $Array(max(fin - k, 0));
12648 for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
12649 result.length = n;
12650 return result;
12651};
12652
12653
12654/***/ }),
12655/* 397 */
12656/***/ (function(module, exports, __webpack_require__) {
12657
12658var $ = __webpack_require__(0);
12659var getBuiltIn = __webpack_require__(16);
12660var hasOwn = __webpack_require__(14);
12661var toString = __webpack_require__(69);
12662var shared = __webpack_require__(67);
12663var NATIVE_SYMBOL_REGISTRY = __webpack_require__(228);
12664
12665var StringToSymbolRegistry = shared('string-to-symbol-registry');
12666var SymbolToStringRegistry = shared('symbol-to-string-registry');
12667
12668// `Symbol.for` method
12669// https://tc39.es/ecma262/#sec-symbol.for
12670$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
12671 'for': function (key) {
12672 var string = toString(key);
12673 if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
12674 var symbol = getBuiltIn('Symbol')(string);
12675 StringToSymbolRegistry[string] = symbol;
12676 SymbolToStringRegistry[symbol] = string;
12677 return symbol;
12678 }
12679});
12680
12681
12682/***/ }),
12683/* 398 */
12684/***/ (function(module, exports, __webpack_require__) {
12685
12686var $ = __webpack_require__(0);
12687var hasOwn = __webpack_require__(14);
12688var isSymbol = __webpack_require__(83);
12689var tryToString = __webpack_require__(66);
12690var shared = __webpack_require__(67);
12691var NATIVE_SYMBOL_REGISTRY = __webpack_require__(228);
12692
12693var SymbolToStringRegistry = shared('symbol-to-string-registry');
12694
12695// `Symbol.keyFor` method
12696// https://tc39.es/ecma262/#sec-symbol.keyfor
12697$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
12698 keyFor: function keyFor(sym) {
12699 if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');
12700 if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
12701 }
12702});
12703
12704
12705/***/ }),
12706/* 399 */
12707/***/ (function(module, exports, __webpack_require__) {
12708
12709var $ = __webpack_require__(0);
12710var NATIVE_SYMBOL = __webpack_require__(49);
12711var fails = __webpack_require__(4);
12712var getOwnPropertySymbolsModule = __webpack_require__(115);
12713var toObject = __webpack_require__(35);
12714
12715// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
12716// https://bugs.chromium.org/p/v8/issues/detail?id=3443
12717var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
12718
12719// `Object.getOwnPropertySymbols` method
12720// https://tc39.es/ecma262/#sec-object.getownpropertysymbols
12721$({ target: 'Object', stat: true, forced: FORCED }, {
12722 getOwnPropertySymbols: function getOwnPropertySymbols(it) {
12723 var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
12724 return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
12725 }
12726});
12727
12728
12729/***/ }),
12730/* 400 */
12731/***/ (function(module, exports, __webpack_require__) {
12732
12733var defineWellKnownSymbol = __webpack_require__(5);
12734
12735// `Symbol.asyncIterator` well-known symbol
12736// https://tc39.es/ecma262/#sec-symbol.asynciterator
12737defineWellKnownSymbol('asyncIterator');
12738
12739
12740/***/ }),
12741/* 401 */
12742/***/ (function(module, exports) {
12743
12744// empty
12745
12746
12747/***/ }),
12748/* 402 */
12749/***/ (function(module, exports, __webpack_require__) {
12750
12751var defineWellKnownSymbol = __webpack_require__(5);
12752
12753// `Symbol.hasInstance` well-known symbol
12754// https://tc39.es/ecma262/#sec-symbol.hasinstance
12755defineWellKnownSymbol('hasInstance');
12756
12757
12758/***/ }),
12759/* 403 */
12760/***/ (function(module, exports, __webpack_require__) {
12761
12762var defineWellKnownSymbol = __webpack_require__(5);
12763
12764// `Symbol.isConcatSpreadable` well-known symbol
12765// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
12766defineWellKnownSymbol('isConcatSpreadable');
12767
12768
12769/***/ }),
12770/* 404 */
12771/***/ (function(module, exports, __webpack_require__) {
12772
12773var defineWellKnownSymbol = __webpack_require__(5);
12774
12775// `Symbol.match` well-known symbol
12776// https://tc39.es/ecma262/#sec-symbol.match
12777defineWellKnownSymbol('match');
12778
12779
12780/***/ }),
12781/* 405 */
12782/***/ (function(module, exports, __webpack_require__) {
12783
12784var defineWellKnownSymbol = __webpack_require__(5);
12785
12786// `Symbol.matchAll` well-known symbol
12787// https://tc39.es/ecma262/#sec-symbol.matchall
12788defineWellKnownSymbol('matchAll');
12789
12790
12791/***/ }),
12792/* 406 */
12793/***/ (function(module, exports, __webpack_require__) {
12794
12795var defineWellKnownSymbol = __webpack_require__(5);
12796
12797// `Symbol.replace` well-known symbol
12798// https://tc39.es/ecma262/#sec-symbol.replace
12799defineWellKnownSymbol('replace');
12800
12801
12802/***/ }),
12803/* 407 */
12804/***/ (function(module, exports, __webpack_require__) {
12805
12806var defineWellKnownSymbol = __webpack_require__(5);
12807
12808// `Symbol.search` well-known symbol
12809// https://tc39.es/ecma262/#sec-symbol.search
12810defineWellKnownSymbol('search');
12811
12812
12813/***/ }),
12814/* 408 */
12815/***/ (function(module, exports, __webpack_require__) {
12816
12817var defineWellKnownSymbol = __webpack_require__(5);
12818
12819// `Symbol.species` well-known symbol
12820// https://tc39.es/ecma262/#sec-symbol.species
12821defineWellKnownSymbol('species');
12822
12823
12824/***/ }),
12825/* 409 */
12826/***/ (function(module, exports, __webpack_require__) {
12827
12828var defineWellKnownSymbol = __webpack_require__(5);
12829
12830// `Symbol.split` well-known symbol
12831// https://tc39.es/ecma262/#sec-symbol.split
12832defineWellKnownSymbol('split');
12833
12834
12835/***/ }),
12836/* 410 */
12837/***/ (function(module, exports, __webpack_require__) {
12838
12839var defineWellKnownSymbol = __webpack_require__(5);
12840var defineSymbolToPrimitive = __webpack_require__(227);
12841
12842// `Symbol.toPrimitive` well-known symbol
12843// https://tc39.es/ecma262/#sec-symbol.toprimitive
12844defineWellKnownSymbol('toPrimitive');
12845
12846// `Symbol.prototype[@@toPrimitive]` method
12847// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
12848defineSymbolToPrimitive();
12849
12850
12851/***/ }),
12852/* 411 */
12853/***/ (function(module, exports, __webpack_require__) {
12854
12855var getBuiltIn = __webpack_require__(16);
12856var defineWellKnownSymbol = __webpack_require__(5);
12857var setToStringTag = __webpack_require__(54);
12858
12859// `Symbol.toStringTag` well-known symbol
12860// https://tc39.es/ecma262/#sec-symbol.tostringtag
12861defineWellKnownSymbol('toStringTag');
12862
12863// `Symbol.prototype[@@toStringTag]` property
12864// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
12865setToStringTag(getBuiltIn('Symbol'), 'Symbol');
12866
12867
12868/***/ }),
12869/* 412 */
12870/***/ (function(module, exports, __webpack_require__) {
12871
12872var defineWellKnownSymbol = __webpack_require__(5);
12873
12874// `Symbol.unscopables` well-known symbol
12875// https://tc39.es/ecma262/#sec-symbol.unscopables
12876defineWellKnownSymbol('unscopables');
12877
12878
12879/***/ }),
12880/* 413 */
12881/***/ (function(module, exports, __webpack_require__) {
12882
12883var global = __webpack_require__(9);
12884var setToStringTag = __webpack_require__(54);
12885
12886// JSON[@@toStringTag] property
12887// https://tc39.es/ecma262/#sec-json-@@tostringtag
12888setToStringTag(global.JSON, 'JSON', true);
12889
12890
12891/***/ }),
12892/* 414 */
12893/***/ (function(module, exports) {
12894
12895// empty
12896
12897
12898/***/ }),
12899/* 415 */
12900/***/ (function(module, exports) {
12901
12902// empty
12903
12904
12905/***/ }),
12906/* 416 */
12907/***/ (function(module, exports, __webpack_require__) {
12908
12909var defineWellKnownSymbol = __webpack_require__(5);
12910
12911// `Symbol.asyncDispose` well-known symbol
12912// https://github.com/tc39/proposal-using-statement
12913defineWellKnownSymbol('asyncDispose');
12914
12915
12916/***/ }),
12917/* 417 */
12918/***/ (function(module, exports, __webpack_require__) {
12919
12920var defineWellKnownSymbol = __webpack_require__(5);
12921
12922// `Symbol.dispose` well-known symbol
12923// https://github.com/tc39/proposal-using-statement
12924defineWellKnownSymbol('dispose');
12925
12926
12927/***/ }),
12928/* 418 */
12929/***/ (function(module, exports, __webpack_require__) {
12930
12931var defineWellKnownSymbol = __webpack_require__(5);
12932
12933// `Symbol.matcher` well-known symbol
12934// https://github.com/tc39/proposal-pattern-matching
12935defineWellKnownSymbol('matcher');
12936
12937
12938/***/ }),
12939/* 419 */
12940/***/ (function(module, exports, __webpack_require__) {
12941
12942var defineWellKnownSymbol = __webpack_require__(5);
12943
12944// `Symbol.metadataKey` well-known symbol
12945// https://github.com/tc39/proposal-decorator-metadata
12946defineWellKnownSymbol('metadataKey');
12947
12948
12949/***/ }),
12950/* 420 */
12951/***/ (function(module, exports, __webpack_require__) {
12952
12953var defineWellKnownSymbol = __webpack_require__(5);
12954
12955// `Symbol.observable` well-known symbol
12956// https://github.com/tc39/proposal-observable
12957defineWellKnownSymbol('observable');
12958
12959
12960/***/ }),
12961/* 421 */
12962/***/ (function(module, exports, __webpack_require__) {
12963
12964// TODO: Remove from `core-js@4`
12965var defineWellKnownSymbol = __webpack_require__(5);
12966
12967// `Symbol.metadata` well-known symbol
12968// https://github.com/tc39/proposal-decorators
12969defineWellKnownSymbol('metadata');
12970
12971
12972/***/ }),
12973/* 422 */
12974/***/ (function(module, exports, __webpack_require__) {
12975
12976// TODO: remove from `core-js@4`
12977var defineWellKnownSymbol = __webpack_require__(5);
12978
12979// `Symbol.patternMatch` well-known symbol
12980// https://github.com/tc39/proposal-pattern-matching
12981defineWellKnownSymbol('patternMatch');
12982
12983
12984/***/ }),
12985/* 423 */
12986/***/ (function(module, exports, __webpack_require__) {
12987
12988// TODO: remove from `core-js@4`
12989var defineWellKnownSymbol = __webpack_require__(5);
12990
12991defineWellKnownSymbol('replaceAll');
12992
12993
12994/***/ }),
12995/* 424 */
12996/***/ (function(module, exports, __webpack_require__) {
12997
12998module.exports = __webpack_require__(425);
12999
13000/***/ }),
13001/* 425 */
13002/***/ (function(module, exports, __webpack_require__) {
13003
13004module.exports = __webpack_require__(426);
13005
13006
13007/***/ }),
13008/* 426 */
13009/***/ (function(module, exports, __webpack_require__) {
13010
13011var parent = __webpack_require__(427);
13012
13013module.exports = parent;
13014
13015
13016/***/ }),
13017/* 427 */
13018/***/ (function(module, exports, __webpack_require__) {
13019
13020var parent = __webpack_require__(428);
13021
13022module.exports = parent;
13023
13024
13025/***/ }),
13026/* 428 */
13027/***/ (function(module, exports, __webpack_require__) {
13028
13029var parent = __webpack_require__(429);
13030__webpack_require__(73);
13031
13032module.exports = parent;
13033
13034
13035/***/ }),
13036/* 429 */
13037/***/ (function(module, exports, __webpack_require__) {
13038
13039__webpack_require__(70);
13040__webpack_require__(92);
13041__webpack_require__(95);
13042__webpack_require__(229);
13043var WrappedWellKnownSymbolModule = __webpack_require__(136);
13044
13045module.exports = WrappedWellKnownSymbolModule.f('iterator');
13046
13047
13048/***/ }),
13049/* 430 */
13050/***/ (function(module, exports, __webpack_require__) {
13051
13052module.exports = __webpack_require__(431);
13053
13054/***/ }),
13055/* 431 */
13056/***/ (function(module, exports, __webpack_require__) {
13057
13058var parent = __webpack_require__(432);
13059
13060module.exports = parent;
13061
13062
13063/***/ }),
13064/* 432 */
13065/***/ (function(module, exports, __webpack_require__) {
13066
13067var isPrototypeOf = __webpack_require__(20);
13068var method = __webpack_require__(433);
13069
13070var ArrayPrototype = Array.prototype;
13071
13072module.exports = function (it) {
13073 var own = it.filter;
13074 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;
13075};
13076
13077
13078/***/ }),
13079/* 433 */
13080/***/ (function(module, exports, __webpack_require__) {
13081
13082__webpack_require__(434);
13083var entryVirtual = __webpack_require__(38);
13084
13085module.exports = entryVirtual('Array').filter;
13086
13087
13088/***/ }),
13089/* 434 */
13090/***/ (function(module, exports, __webpack_require__) {
13091
13092"use strict";
13093
13094var $ = __webpack_require__(0);
13095var $filter = __webpack_require__(101).filter;
13096var arrayMethodHasSpeciesSupport = __webpack_require__(100);
13097
13098var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
13099
13100// `Array.prototype.filter` method
13101// https://tc39.es/ecma262/#sec-array.prototype.filter
13102// with adding support of @@species
13103$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
13104 filter: function filter(callbackfn /* , thisArg */) {
13105 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
13106 }
13107});
13108
13109
13110/***/ }),
13111/* 435 */
13112/***/ (function(module, exports, __webpack_require__) {
13113
13114"use strict";
13115// Copyright (c) 2015-2017 David M. Lee, II
13116
13117
13118/**
13119 * Local reference to TimeoutError
13120 * @private
13121 */
13122var TimeoutError;
13123
13124/**
13125 * Rejects a promise with a {@link TimeoutError} if it does not settle within
13126 * the specified timeout.
13127 *
13128 * @param {Promise} promise The promise.
13129 * @param {number} timeoutMillis Number of milliseconds to wait on settling.
13130 * @returns {Promise} Either resolves/rejects with `promise`, or rejects with
13131 * `TimeoutError`, whichever settles first.
13132 */
13133var timeout = module.exports.timeout = function(promise, timeoutMillis) {
13134 var error = new TimeoutError(),
13135 timeout;
13136
13137 return Promise.race([
13138 promise,
13139 new Promise(function(resolve, reject) {
13140 timeout = setTimeout(function() {
13141 reject(error);
13142 }, timeoutMillis);
13143 }),
13144 ]).then(function(v) {
13145 clearTimeout(timeout);
13146 return v;
13147 }, function(err) {
13148 clearTimeout(timeout);
13149 throw err;
13150 });
13151};
13152
13153/**
13154 * Exception indicating that the timeout expired.
13155 */
13156TimeoutError = module.exports.TimeoutError = function() {
13157 Error.call(this)
13158 this.stack = Error().stack
13159 this.message = 'Timeout';
13160};
13161
13162TimeoutError.prototype = Object.create(Error.prototype);
13163TimeoutError.prototype.name = "TimeoutError";
13164
13165
13166/***/ }),
13167/* 436 */
13168/***/ (function(module, exports, __webpack_require__) {
13169
13170"use strict";
13171
13172
13173var _interopRequireDefault = __webpack_require__(2);
13174
13175var _slice = _interopRequireDefault(__webpack_require__(81));
13176
13177var _keys = _interopRequireDefault(__webpack_require__(48));
13178
13179var _concat = _interopRequireDefault(__webpack_require__(29));
13180
13181var _ = __webpack_require__(1);
13182
13183module.exports = function (AV) {
13184 var eventSplitter = /\s+/;
13185 var slice = (0, _slice.default)(Array.prototype);
13186 /**
13187 * @class
13188 *
13189 * <p>AV.Events is a fork of Backbone's Events module, provided for your
13190 * convenience.</p>
13191 *
13192 * <p>A module that can be mixed in to any object in order to provide
13193 * it with custom events. You may bind callback functions to an event
13194 * with `on`, or remove these functions with `off`.
13195 * Triggering an event fires all callbacks in the order that `on` was
13196 * called.
13197 *
13198 * @private
13199 * @example
13200 * var object = {};
13201 * _.extend(object, AV.Events);
13202 * object.on('expand', function(){ alert('expanded'); });
13203 * object.trigger('expand');</pre></p>
13204 *
13205 */
13206
13207 AV.Events = {
13208 /**
13209 * Bind one or more space separated events, `events`, to a `callback`
13210 * function. Passing `"all"` will bind the callback to all events fired.
13211 */
13212 on: function on(events, callback, context) {
13213 var calls, event, node, tail, list;
13214
13215 if (!callback) {
13216 return this;
13217 }
13218
13219 events = events.split(eventSplitter);
13220 calls = this._callbacks || (this._callbacks = {}); // Create an immutable callback list, allowing traversal during
13221 // modification. The tail is an empty object that will always be used
13222 // as the next node.
13223
13224 event = events.shift();
13225
13226 while (event) {
13227 list = calls[event];
13228 node = list ? list.tail : {};
13229 node.next = tail = {};
13230 node.context = context;
13231 node.callback = callback;
13232 calls[event] = {
13233 tail: tail,
13234 next: list ? list.next : node
13235 };
13236 event = events.shift();
13237 }
13238
13239 return this;
13240 },
13241
13242 /**
13243 * Remove one or many callbacks. If `context` is null, removes all callbacks
13244 * with that function. If `callback` is null, removes all callbacks for the
13245 * event. If `events` is null, removes all bound callbacks for all events.
13246 */
13247 off: function off(events, callback, context) {
13248 var event, calls, node, tail, cb, ctx; // No events, or removing *all* events.
13249
13250 if (!(calls = this._callbacks)) {
13251 return;
13252 }
13253
13254 if (!(events || callback || context)) {
13255 delete this._callbacks;
13256 return this;
13257 } // Loop through the listed events and contexts, splicing them out of the
13258 // linked list of callbacks if appropriate.
13259
13260
13261 events = events ? events.split(eventSplitter) : (0, _keys.default)(_).call(_, calls);
13262 event = events.shift();
13263
13264 while (event) {
13265 node = calls[event];
13266 delete calls[event];
13267
13268 if (!node || !(callback || context)) {
13269 continue;
13270 } // Create a new list, omitting the indicated callbacks.
13271
13272
13273 tail = node.tail;
13274 node = node.next;
13275
13276 while (node !== tail) {
13277 cb = node.callback;
13278 ctx = node.context;
13279
13280 if (callback && cb !== callback || context && ctx !== context) {
13281 this.on(event, cb, ctx);
13282 }
13283
13284 node = node.next;
13285 }
13286
13287 event = events.shift();
13288 }
13289
13290 return this;
13291 },
13292
13293 /**
13294 * Trigger one or many events, firing all bound callbacks. Callbacks are
13295 * passed the same arguments as `trigger` is, apart from the event name
13296 * (unless you're listening on `"all"`, which will cause your callback to
13297 * receive the true name of the event as the first argument).
13298 */
13299 trigger: function trigger(events) {
13300 var event, node, calls, tail, args, all, rest;
13301
13302 if (!(calls = this._callbacks)) {
13303 return this;
13304 }
13305
13306 all = calls.all;
13307 events = events.split(eventSplitter);
13308 rest = slice.call(arguments, 1); // For each event, walk through the linked list of callbacks twice,
13309 // first to trigger the event, then to trigger any `"all"` callbacks.
13310
13311 event = events.shift();
13312
13313 while (event) {
13314 node = calls[event];
13315
13316 if (node) {
13317 tail = node.tail;
13318
13319 while ((node = node.next) !== tail) {
13320 node.callback.apply(node.context || this, rest);
13321 }
13322 }
13323
13324 node = all;
13325
13326 if (node) {
13327 var _context;
13328
13329 tail = node.tail;
13330 args = (0, _concat.default)(_context = [event]).call(_context, rest);
13331
13332 while ((node = node.next) !== tail) {
13333 node.callback.apply(node.context || this, args);
13334 }
13335 }
13336
13337 event = events.shift();
13338 }
13339
13340 return this;
13341 }
13342 };
13343 /**
13344 * @function
13345 */
13346
13347 AV.Events.bind = AV.Events.on;
13348 /**
13349 * @function
13350 */
13351
13352 AV.Events.unbind = AV.Events.off;
13353};
13354
13355/***/ }),
13356/* 437 */
13357/***/ (function(module, exports, __webpack_require__) {
13358
13359"use strict";
13360
13361
13362var _interopRequireDefault = __webpack_require__(2);
13363
13364var _promise = _interopRequireDefault(__webpack_require__(10));
13365
13366var _ = __webpack_require__(1);
13367/*global navigator: false */
13368
13369
13370module.exports = function (AV) {
13371 /**
13372 * Creates a new GeoPoint with any of the following forms:<br>
13373 * @example
13374 * new GeoPoint(otherGeoPoint)
13375 * new GeoPoint(30, 30)
13376 * new GeoPoint([30, 30])
13377 * new GeoPoint({latitude: 30, longitude: 30})
13378 * new GeoPoint() // defaults to (0, 0)
13379 * @class
13380 *
13381 * <p>Represents a latitude / longitude point that may be associated
13382 * with a key in a AVObject or used as a reference point for geo queries.
13383 * This allows proximity-based queries on the key.</p>
13384 *
13385 * <p>Only one key in a class may contain a GeoPoint.</p>
13386 *
13387 * <p>Example:<pre>
13388 * var point = new AV.GeoPoint(30.0, -20.0);
13389 * var object = new AV.Object("PlaceObject");
13390 * object.set("location", point);
13391 * object.save();</pre></p>
13392 */
13393 AV.GeoPoint = function (arg1, arg2) {
13394 if (_.isArray(arg1)) {
13395 AV.GeoPoint._validate(arg1[0], arg1[1]);
13396
13397 this.latitude = arg1[0];
13398 this.longitude = arg1[1];
13399 } else if (_.isObject(arg1)) {
13400 AV.GeoPoint._validate(arg1.latitude, arg1.longitude);
13401
13402 this.latitude = arg1.latitude;
13403 this.longitude = arg1.longitude;
13404 } else if (_.isNumber(arg1) && _.isNumber(arg2)) {
13405 AV.GeoPoint._validate(arg1, arg2);
13406
13407 this.latitude = arg1;
13408 this.longitude = arg2;
13409 } else {
13410 this.latitude = 0;
13411 this.longitude = 0;
13412 } // Add properties so that anyone using Webkit or Mozilla will get an error
13413 // if they try to set values that are out of bounds.
13414
13415
13416 var self = this;
13417
13418 if (this.__defineGetter__ && this.__defineSetter__) {
13419 // Use _latitude and _longitude to actually store the values, and add
13420 // getters and setters for latitude and longitude.
13421 this._latitude = this.latitude;
13422 this._longitude = this.longitude;
13423
13424 this.__defineGetter__('latitude', function () {
13425 return self._latitude;
13426 });
13427
13428 this.__defineGetter__('longitude', function () {
13429 return self._longitude;
13430 });
13431
13432 this.__defineSetter__('latitude', function (val) {
13433 AV.GeoPoint._validate(val, self.longitude);
13434
13435 self._latitude = val;
13436 });
13437
13438 this.__defineSetter__('longitude', function (val) {
13439 AV.GeoPoint._validate(self.latitude, val);
13440
13441 self._longitude = val;
13442 });
13443 }
13444 };
13445 /**
13446 * @lends AV.GeoPoint.prototype
13447 * @property {float} latitude North-south portion of the coordinate, in range
13448 * [-90, 90]. Throws an exception if set out of range in a modern browser.
13449 * @property {float} longitude East-west portion of the coordinate, in range
13450 * [-180, 180]. Throws if set out of range in a modern browser.
13451 */
13452
13453 /**
13454 * Throws an exception if the given lat-long is out of bounds.
13455 * @private
13456 */
13457
13458
13459 AV.GeoPoint._validate = function (latitude, longitude) {
13460 if (latitude < -90.0) {
13461 throw new Error('AV.GeoPoint latitude ' + latitude + ' < -90.0.');
13462 }
13463
13464 if (latitude > 90.0) {
13465 throw new Error('AV.GeoPoint latitude ' + latitude + ' > 90.0.');
13466 }
13467
13468 if (longitude < -180.0) {
13469 throw new Error('AV.GeoPoint longitude ' + longitude + ' < -180.0.');
13470 }
13471
13472 if (longitude > 180.0) {
13473 throw new Error('AV.GeoPoint longitude ' + longitude + ' > 180.0.');
13474 }
13475 };
13476 /**
13477 * Creates a GeoPoint with the user's current location, if available.
13478 * @return {Promise.<AV.GeoPoint>}
13479 */
13480
13481
13482 AV.GeoPoint.current = function () {
13483 return new _promise.default(function (resolve, reject) {
13484 navigator.geolocation.getCurrentPosition(function (location) {
13485 resolve(new AV.GeoPoint({
13486 latitude: location.coords.latitude,
13487 longitude: location.coords.longitude
13488 }));
13489 }, reject);
13490 });
13491 };
13492
13493 _.extend(AV.GeoPoint.prototype,
13494 /** @lends AV.GeoPoint.prototype */
13495 {
13496 /**
13497 * Returns a JSON representation of the GeoPoint, suitable for AV.
13498 * @return {Object}
13499 */
13500 toJSON: function toJSON() {
13501 AV.GeoPoint._validate(this.latitude, this.longitude);
13502
13503 return {
13504 __type: 'GeoPoint',
13505 latitude: this.latitude,
13506 longitude: this.longitude
13507 };
13508 },
13509
13510 /**
13511 * Returns the distance from this GeoPoint to another in radians.
13512 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13513 * @return {Number}
13514 */
13515 radiansTo: function radiansTo(point) {
13516 var d2r = Math.PI / 180.0;
13517 var lat1rad = this.latitude * d2r;
13518 var long1rad = this.longitude * d2r;
13519 var lat2rad = point.latitude * d2r;
13520 var long2rad = point.longitude * d2r;
13521 var deltaLat = lat1rad - lat2rad;
13522 var deltaLong = long1rad - long2rad;
13523 var sinDeltaLatDiv2 = Math.sin(deltaLat / 2);
13524 var sinDeltaLongDiv2 = Math.sin(deltaLong / 2); // Square of half the straight line chord distance between both points.
13525
13526 var a = sinDeltaLatDiv2 * sinDeltaLatDiv2 + Math.cos(lat1rad) * Math.cos(lat2rad) * sinDeltaLongDiv2 * sinDeltaLongDiv2;
13527 a = Math.min(1.0, a);
13528 return 2 * Math.asin(Math.sqrt(a));
13529 },
13530
13531 /**
13532 * Returns the distance from this GeoPoint to another in kilometers.
13533 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13534 * @return {Number}
13535 */
13536 kilometersTo: function kilometersTo(point) {
13537 return this.radiansTo(point) * 6371.0;
13538 },
13539
13540 /**
13541 * Returns the distance from this GeoPoint to another in miles.
13542 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13543 * @return {Number}
13544 */
13545 milesTo: function milesTo(point) {
13546 return this.radiansTo(point) * 3958.8;
13547 }
13548 });
13549};
13550
13551/***/ }),
13552/* 438 */
13553/***/ (function(module, exports, __webpack_require__) {
13554
13555"use strict";
13556
13557
13558var _ = __webpack_require__(1);
13559
13560module.exports = function (AV) {
13561 var PUBLIC_KEY = '*';
13562 /**
13563 * Creates a new ACL.
13564 * If no argument is given, the ACL has no permissions for anyone.
13565 * If the argument is a AV.User, the ACL will have read and write
13566 * permission for only that user.
13567 * If the argument is any other JSON object, that object will be interpretted
13568 * as a serialized ACL created with toJSON().
13569 * @see AV.Object#setACL
13570 * @class
13571 *
13572 * <p>An ACL, or Access Control List can be added to any
13573 * <code>AV.Object</code> to restrict access to only a subset of users
13574 * of your application.</p>
13575 */
13576
13577 AV.ACL = function (arg1) {
13578 var self = this;
13579 self.permissionsById = {};
13580
13581 if (_.isObject(arg1)) {
13582 if (arg1 instanceof AV.User) {
13583 self.setReadAccess(arg1, true);
13584 self.setWriteAccess(arg1, true);
13585 } else {
13586 if (_.isFunction(arg1)) {
13587 throw new Error('AV.ACL() called with a function. Did you forget ()?');
13588 }
13589
13590 AV._objectEach(arg1, function (accessList, userId) {
13591 if (!_.isString(userId)) {
13592 throw new Error('Tried to create an ACL with an invalid userId.');
13593 }
13594
13595 self.permissionsById[userId] = {};
13596
13597 AV._objectEach(accessList, function (allowed, permission) {
13598 if (permission !== 'read' && permission !== 'write') {
13599 throw new Error('Tried to create an ACL with an invalid permission type.');
13600 }
13601
13602 if (!_.isBoolean(allowed)) {
13603 throw new Error('Tried to create an ACL with an invalid permission value.');
13604 }
13605
13606 self.permissionsById[userId][permission] = allowed;
13607 });
13608 });
13609 }
13610 }
13611 };
13612 /**
13613 * Returns a JSON-encoded version of the ACL.
13614 * @return {Object}
13615 */
13616
13617
13618 AV.ACL.prototype.toJSON = function () {
13619 return _.clone(this.permissionsById);
13620 };
13621
13622 AV.ACL.prototype._setAccess = function (accessType, userId, allowed) {
13623 if (userId instanceof AV.User) {
13624 userId = userId.id;
13625 } else if (userId instanceof AV.Role) {
13626 userId = 'role:' + userId.getName();
13627 }
13628
13629 if (!_.isString(userId)) {
13630 throw new Error('userId must be a string.');
13631 }
13632
13633 if (!_.isBoolean(allowed)) {
13634 throw new Error('allowed must be either true or false.');
13635 }
13636
13637 var permissions = this.permissionsById[userId];
13638
13639 if (!permissions) {
13640 if (!allowed) {
13641 // The user already doesn't have this permission, so no action needed.
13642 return;
13643 } else {
13644 permissions = {};
13645 this.permissionsById[userId] = permissions;
13646 }
13647 }
13648
13649 if (allowed) {
13650 this.permissionsById[userId][accessType] = true;
13651 } else {
13652 delete permissions[accessType];
13653
13654 if (_.isEmpty(permissions)) {
13655 delete this.permissionsById[userId];
13656 }
13657 }
13658 };
13659
13660 AV.ACL.prototype._getAccess = function (accessType, userId) {
13661 if (userId instanceof AV.User) {
13662 userId = userId.id;
13663 } else if (userId instanceof AV.Role) {
13664 userId = 'role:' + userId.getName();
13665 }
13666
13667 var permissions = this.permissionsById[userId];
13668
13669 if (!permissions) {
13670 return false;
13671 }
13672
13673 return permissions[accessType] ? true : false;
13674 };
13675 /**
13676 * Set whether the given user is allowed to read this object.
13677 * @param userId An instance of AV.User or its objectId.
13678 * @param {Boolean} allowed Whether that user should have read access.
13679 */
13680
13681
13682 AV.ACL.prototype.setReadAccess = function (userId, allowed) {
13683 this._setAccess('read', userId, allowed);
13684 };
13685 /**
13686 * Get whether the given user id is *explicitly* allowed to read this object.
13687 * Even if this returns false, the user may still be able to access it if
13688 * getPublicReadAccess returns true or a role that the user belongs to has
13689 * write access.
13690 * @param userId An instance of AV.User or its objectId, or a AV.Role.
13691 * @return {Boolean}
13692 */
13693
13694
13695 AV.ACL.prototype.getReadAccess = function (userId) {
13696 return this._getAccess('read', userId);
13697 };
13698 /**
13699 * Set whether the given user id is allowed to write this object.
13700 * @param userId An instance of AV.User or its objectId, or a AV.Role..
13701 * @param {Boolean} allowed Whether that user should have write access.
13702 */
13703
13704
13705 AV.ACL.prototype.setWriteAccess = function (userId, allowed) {
13706 this._setAccess('write', userId, allowed);
13707 };
13708 /**
13709 * Get whether the given user id is *explicitly* allowed to write this object.
13710 * Even if this returns false, the user may still be able to write it if
13711 * getPublicWriteAccess returns true or a role that the user belongs to has
13712 * write access.
13713 * @param userId An instance of AV.User or its objectId, or a AV.Role.
13714 * @return {Boolean}
13715 */
13716
13717
13718 AV.ACL.prototype.getWriteAccess = function (userId) {
13719 return this._getAccess('write', userId);
13720 };
13721 /**
13722 * Set whether the public is allowed to read this object.
13723 * @param {Boolean} allowed
13724 */
13725
13726
13727 AV.ACL.prototype.setPublicReadAccess = function (allowed) {
13728 this.setReadAccess(PUBLIC_KEY, allowed);
13729 };
13730 /**
13731 * Get whether the public is allowed to read this object.
13732 * @return {Boolean}
13733 */
13734
13735
13736 AV.ACL.prototype.getPublicReadAccess = function () {
13737 return this.getReadAccess(PUBLIC_KEY);
13738 };
13739 /**
13740 * Set whether the public is allowed to write this object.
13741 * @param {Boolean} allowed
13742 */
13743
13744
13745 AV.ACL.prototype.setPublicWriteAccess = function (allowed) {
13746 this.setWriteAccess(PUBLIC_KEY, allowed);
13747 };
13748 /**
13749 * Get whether the public is allowed to write this object.
13750 * @return {Boolean}
13751 */
13752
13753
13754 AV.ACL.prototype.getPublicWriteAccess = function () {
13755 return this.getWriteAccess(PUBLIC_KEY);
13756 };
13757 /**
13758 * Get whether users belonging to the given role are allowed
13759 * to read this object. Even if this returns false, the role may
13760 * still be able to write it if a parent role has read access.
13761 *
13762 * @param role The name of the role, or a AV.Role object.
13763 * @return {Boolean} true if the role has read access. false otherwise.
13764 * @throws {String} If role is neither a AV.Role nor a String.
13765 */
13766
13767
13768 AV.ACL.prototype.getRoleReadAccess = function (role) {
13769 if (role instanceof AV.Role) {
13770 // Normalize to the String name
13771 role = role.getName();
13772 }
13773
13774 if (_.isString(role)) {
13775 return this.getReadAccess('role:' + role);
13776 }
13777
13778 throw new Error('role must be a AV.Role or a String');
13779 };
13780 /**
13781 * Get whether users belonging to the given role are allowed
13782 * to write this object. Even if this returns false, the role may
13783 * still be able to write it if a parent role has write access.
13784 *
13785 * @param role The name of the role, or a AV.Role object.
13786 * @return {Boolean} true if the role has write access. false otherwise.
13787 * @throws {String} If role is neither a AV.Role nor a String.
13788 */
13789
13790
13791 AV.ACL.prototype.getRoleWriteAccess = function (role) {
13792 if (role instanceof AV.Role) {
13793 // Normalize to the String name
13794 role = role.getName();
13795 }
13796
13797 if (_.isString(role)) {
13798 return this.getWriteAccess('role:' + role);
13799 }
13800
13801 throw new Error('role must be a AV.Role or a String');
13802 };
13803 /**
13804 * Set whether users belonging to the given role are allowed
13805 * to read this object.
13806 *
13807 * @param role The name of the role, or a AV.Role object.
13808 * @param {Boolean} allowed Whether the given role can read this object.
13809 * @throws {String} If role is neither a AV.Role nor a String.
13810 */
13811
13812
13813 AV.ACL.prototype.setRoleReadAccess = function (role, allowed) {
13814 if (role instanceof AV.Role) {
13815 // Normalize to the String name
13816 role = role.getName();
13817 }
13818
13819 if (_.isString(role)) {
13820 this.setReadAccess('role:' + role, allowed);
13821 return;
13822 }
13823
13824 throw new Error('role must be a AV.Role or a String');
13825 };
13826 /**
13827 * Set whether users belonging to the given role are allowed
13828 * to write this object.
13829 *
13830 * @param role The name of the role, or a AV.Role object.
13831 * @param {Boolean} allowed Whether the given role can write this object.
13832 * @throws {String} If role is neither a AV.Role nor a String.
13833 */
13834
13835
13836 AV.ACL.prototype.setRoleWriteAccess = function (role, allowed) {
13837 if (role instanceof AV.Role) {
13838 // Normalize to the String name
13839 role = role.getName();
13840 }
13841
13842 if (_.isString(role)) {
13843 this.setWriteAccess('role:' + role, allowed);
13844 return;
13845 }
13846
13847 throw new Error('role must be a AV.Role or a String');
13848 };
13849};
13850
13851/***/ }),
13852/* 439 */
13853/***/ (function(module, exports, __webpack_require__) {
13854
13855"use strict";
13856
13857
13858var _interopRequireDefault = __webpack_require__(2);
13859
13860var _concat = _interopRequireDefault(__webpack_require__(29));
13861
13862var _find = _interopRequireDefault(__webpack_require__(104));
13863
13864var _indexOf = _interopRequireDefault(__webpack_require__(102));
13865
13866var _map = _interopRequireDefault(__webpack_require__(39));
13867
13868var _ = __webpack_require__(1);
13869
13870module.exports = function (AV) {
13871 /**
13872 * @private
13873 * @class
13874 * A AV.Op is an atomic operation that can be applied to a field in a
13875 * AV.Object. For example, calling <code>object.set("foo", "bar")</code>
13876 * is an example of a AV.Op.Set. Calling <code>object.unset("foo")</code>
13877 * is a AV.Op.Unset. These operations are stored in a AV.Object and
13878 * sent to the server as part of <code>object.save()</code> operations.
13879 * Instances of AV.Op should be immutable.
13880 *
13881 * You should not create subclasses of AV.Op or instantiate AV.Op
13882 * directly.
13883 */
13884 AV.Op = function () {
13885 this._initialize.apply(this, arguments);
13886 };
13887
13888 _.extend(AV.Op.prototype,
13889 /** @lends AV.Op.prototype */
13890 {
13891 _initialize: function _initialize() {}
13892 });
13893
13894 _.extend(AV.Op, {
13895 /**
13896 * To create a new Op, call AV.Op._extend();
13897 * @private
13898 */
13899 _extend: AV._extend,
13900 // A map of __op string to decoder function.
13901 _opDecoderMap: {},
13902
13903 /**
13904 * Registers a function to convert a json object with an __op field into an
13905 * instance of a subclass of AV.Op.
13906 * @private
13907 */
13908 _registerDecoder: function _registerDecoder(opName, decoder) {
13909 AV.Op._opDecoderMap[opName] = decoder;
13910 },
13911
13912 /**
13913 * Converts a json object into an instance of a subclass of AV.Op.
13914 * @private
13915 */
13916 _decode: function _decode(json) {
13917 var decoder = AV.Op._opDecoderMap[json.__op];
13918
13919 if (decoder) {
13920 return decoder(json);
13921 } else {
13922 return undefined;
13923 }
13924 }
13925 });
13926 /*
13927 * Add a handler for Batch ops.
13928 */
13929
13930
13931 AV.Op._registerDecoder('Batch', function (json) {
13932 var op = null;
13933
13934 AV._arrayEach(json.ops, function (nextOp) {
13935 nextOp = AV.Op._decode(nextOp);
13936 op = nextOp._mergeWithPrevious(op);
13937 });
13938
13939 return op;
13940 });
13941 /**
13942 * @private
13943 * @class
13944 * A Set operation indicates that either the field was changed using
13945 * AV.Object.set, or it is a mutable container that was detected as being
13946 * changed.
13947 */
13948
13949
13950 AV.Op.Set = AV.Op._extend(
13951 /** @lends AV.Op.Set.prototype */
13952 {
13953 _initialize: function _initialize(value) {
13954 this._value = value;
13955 },
13956
13957 /**
13958 * Returns the new value of this field after the set.
13959 */
13960 value: function value() {
13961 return this._value;
13962 },
13963
13964 /**
13965 * Returns a JSON version of the operation suitable for sending to AV.
13966 * @return {Object}
13967 */
13968 toJSON: function toJSON() {
13969 return AV._encode(this.value());
13970 },
13971 _mergeWithPrevious: function _mergeWithPrevious(previous) {
13972 return this;
13973 },
13974 _estimate: function _estimate(oldValue) {
13975 return this.value();
13976 }
13977 });
13978 /**
13979 * A sentinel value that is returned by AV.Op.Unset._estimate to
13980 * indicate the field should be deleted. Basically, if you find _UNSET as a
13981 * value in your object, you should remove that key.
13982 */
13983
13984 AV.Op._UNSET = {};
13985 /**
13986 * @private
13987 * @class
13988 * An Unset operation indicates that this field has been deleted from the
13989 * object.
13990 */
13991
13992 AV.Op.Unset = AV.Op._extend(
13993 /** @lends AV.Op.Unset.prototype */
13994 {
13995 /**
13996 * Returns a JSON version of the operation suitable for sending to AV.
13997 * @return {Object}
13998 */
13999 toJSON: function toJSON() {
14000 return {
14001 __op: 'Delete'
14002 };
14003 },
14004 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14005 return this;
14006 },
14007 _estimate: function _estimate(oldValue) {
14008 return AV.Op._UNSET;
14009 }
14010 });
14011
14012 AV.Op._registerDecoder('Delete', function (json) {
14013 return new AV.Op.Unset();
14014 });
14015 /**
14016 * @private
14017 * @class
14018 * An Increment is an atomic operation where the numeric value for the field
14019 * will be increased by a given amount.
14020 */
14021
14022
14023 AV.Op.Increment = AV.Op._extend(
14024 /** @lends AV.Op.Increment.prototype */
14025 {
14026 _initialize: function _initialize(amount) {
14027 this._amount = amount;
14028 },
14029
14030 /**
14031 * Returns the amount to increment by.
14032 * @return {Number} the amount to increment by.
14033 */
14034 amount: function amount() {
14035 return this._amount;
14036 },
14037
14038 /**
14039 * Returns a JSON version of the operation suitable for sending to AV.
14040 * @return {Object}
14041 */
14042 toJSON: function toJSON() {
14043 return {
14044 __op: 'Increment',
14045 amount: this._amount
14046 };
14047 },
14048 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14049 if (!previous) {
14050 return this;
14051 } else if (previous instanceof AV.Op.Unset) {
14052 return new AV.Op.Set(this.amount());
14053 } else if (previous instanceof AV.Op.Set) {
14054 return new AV.Op.Set(previous.value() + this.amount());
14055 } else if (previous instanceof AV.Op.Increment) {
14056 return new AV.Op.Increment(this.amount() + previous.amount());
14057 } else {
14058 throw new Error('Op is invalid after previous op.');
14059 }
14060 },
14061 _estimate: function _estimate(oldValue) {
14062 if (!oldValue) {
14063 return this.amount();
14064 }
14065
14066 return oldValue + this.amount();
14067 }
14068 });
14069
14070 AV.Op._registerDecoder('Increment', function (json) {
14071 return new AV.Op.Increment(json.amount);
14072 });
14073 /**
14074 * @private
14075 * @class
14076 * BitAnd is an atomic operation where the given value will be bit and to the
14077 * value than is stored in this field.
14078 */
14079
14080
14081 AV.Op.BitAnd = AV.Op._extend(
14082 /** @lends AV.Op.BitAnd.prototype */
14083 {
14084 _initialize: function _initialize(value) {
14085 this._value = value;
14086 },
14087 value: function value() {
14088 return this._value;
14089 },
14090
14091 /**
14092 * Returns a JSON version of the operation suitable for sending to AV.
14093 * @return {Object}
14094 */
14095 toJSON: function toJSON() {
14096 return {
14097 __op: 'BitAnd',
14098 value: this.value()
14099 };
14100 },
14101 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14102 if (!previous) {
14103 return this;
14104 } else if (previous instanceof AV.Op.Unset) {
14105 return new AV.Op.Set(0);
14106 } else if (previous instanceof AV.Op.Set) {
14107 return new AV.Op.Set(previous.value() & this.value());
14108 } else {
14109 throw new Error('Op is invalid after previous op.');
14110 }
14111 },
14112 _estimate: function _estimate(oldValue) {
14113 return oldValue & this.value();
14114 }
14115 });
14116
14117 AV.Op._registerDecoder('BitAnd', function (json) {
14118 return new AV.Op.BitAnd(json.value);
14119 });
14120 /**
14121 * @private
14122 * @class
14123 * BitOr is an atomic operation where the given value will be bit and to the
14124 * value than is stored in this field.
14125 */
14126
14127
14128 AV.Op.BitOr = AV.Op._extend(
14129 /** @lends AV.Op.BitOr.prototype */
14130 {
14131 _initialize: function _initialize(value) {
14132 this._value = value;
14133 },
14134 value: function value() {
14135 return this._value;
14136 },
14137
14138 /**
14139 * Returns a JSON version of the operation suitable for sending to AV.
14140 * @return {Object}
14141 */
14142 toJSON: function toJSON() {
14143 return {
14144 __op: 'BitOr',
14145 value: this.value()
14146 };
14147 },
14148 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14149 if (!previous) {
14150 return this;
14151 } else if (previous instanceof AV.Op.Unset) {
14152 return new AV.Op.Set(this.value());
14153 } else if (previous instanceof AV.Op.Set) {
14154 return new AV.Op.Set(previous.value() | this.value());
14155 } else {
14156 throw new Error('Op is invalid after previous op.');
14157 }
14158 },
14159 _estimate: function _estimate(oldValue) {
14160 return oldValue | this.value();
14161 }
14162 });
14163
14164 AV.Op._registerDecoder('BitOr', function (json) {
14165 return new AV.Op.BitOr(json.value);
14166 });
14167 /**
14168 * @private
14169 * @class
14170 * BitXor is an atomic operation where the given value will be bit and to the
14171 * value than is stored in this field.
14172 */
14173
14174
14175 AV.Op.BitXor = AV.Op._extend(
14176 /** @lends AV.Op.BitXor.prototype */
14177 {
14178 _initialize: function _initialize(value) {
14179 this._value = value;
14180 },
14181 value: function value() {
14182 return this._value;
14183 },
14184
14185 /**
14186 * Returns a JSON version of the operation suitable for sending to AV.
14187 * @return {Object}
14188 */
14189 toJSON: function toJSON() {
14190 return {
14191 __op: 'BitXor',
14192 value: this.value()
14193 };
14194 },
14195 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14196 if (!previous) {
14197 return this;
14198 } else if (previous instanceof AV.Op.Unset) {
14199 return new AV.Op.Set(this.value());
14200 } else if (previous instanceof AV.Op.Set) {
14201 return new AV.Op.Set(previous.value() ^ this.value());
14202 } else {
14203 throw new Error('Op is invalid after previous op.');
14204 }
14205 },
14206 _estimate: function _estimate(oldValue) {
14207 return oldValue ^ this.value();
14208 }
14209 });
14210
14211 AV.Op._registerDecoder('BitXor', function (json) {
14212 return new AV.Op.BitXor(json.value);
14213 });
14214 /**
14215 * @private
14216 * @class
14217 * Add is an atomic operation where the given objects will be appended to the
14218 * array that is stored in this field.
14219 */
14220
14221
14222 AV.Op.Add = AV.Op._extend(
14223 /** @lends AV.Op.Add.prototype */
14224 {
14225 _initialize: function _initialize(objects) {
14226 this._objects = objects;
14227 },
14228
14229 /**
14230 * Returns the objects to be added to the array.
14231 * @return {Array} The objects to be added to the array.
14232 */
14233 objects: function objects() {
14234 return this._objects;
14235 },
14236
14237 /**
14238 * Returns a JSON version of the operation suitable for sending to AV.
14239 * @return {Object}
14240 */
14241 toJSON: function toJSON() {
14242 return {
14243 __op: 'Add',
14244 objects: AV._encode(this.objects())
14245 };
14246 },
14247 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14248 if (!previous) {
14249 return this;
14250 } else if (previous instanceof AV.Op.Unset) {
14251 return new AV.Op.Set(this.objects());
14252 } else if (previous instanceof AV.Op.Set) {
14253 return new AV.Op.Set(this._estimate(previous.value()));
14254 } else if (previous instanceof AV.Op.Add) {
14255 var _context;
14256
14257 return new AV.Op.Add((0, _concat.default)(_context = previous.objects()).call(_context, this.objects()));
14258 } else {
14259 throw new Error('Op is invalid after previous op.');
14260 }
14261 },
14262 _estimate: function _estimate(oldValue) {
14263 if (!oldValue) {
14264 return _.clone(this.objects());
14265 } else {
14266 return (0, _concat.default)(oldValue).call(oldValue, this.objects());
14267 }
14268 }
14269 });
14270
14271 AV.Op._registerDecoder('Add', function (json) {
14272 return new AV.Op.Add(AV._decode(json.objects));
14273 });
14274 /**
14275 * @private
14276 * @class
14277 * AddUnique is an atomic operation where the given items will be appended to
14278 * the array that is stored in this field only if they were not already
14279 * present in the array.
14280 */
14281
14282
14283 AV.Op.AddUnique = AV.Op._extend(
14284 /** @lends AV.Op.AddUnique.prototype */
14285 {
14286 _initialize: function _initialize(objects) {
14287 this._objects = _.uniq(objects);
14288 },
14289
14290 /**
14291 * Returns the objects to be added to the array.
14292 * @return {Array} The objects to be added to the array.
14293 */
14294 objects: function objects() {
14295 return this._objects;
14296 },
14297
14298 /**
14299 * Returns a JSON version of the operation suitable for sending to AV.
14300 * @return {Object}
14301 */
14302 toJSON: function toJSON() {
14303 return {
14304 __op: 'AddUnique',
14305 objects: AV._encode(this.objects())
14306 };
14307 },
14308 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14309 if (!previous) {
14310 return this;
14311 } else if (previous instanceof AV.Op.Unset) {
14312 return new AV.Op.Set(this.objects());
14313 } else if (previous instanceof AV.Op.Set) {
14314 return new AV.Op.Set(this._estimate(previous.value()));
14315 } else if (previous instanceof AV.Op.AddUnique) {
14316 return new AV.Op.AddUnique(this._estimate(previous.objects()));
14317 } else {
14318 throw new Error('Op is invalid after previous op.');
14319 }
14320 },
14321 _estimate: function _estimate(oldValue) {
14322 if (!oldValue) {
14323 return _.clone(this.objects());
14324 } else {
14325 // We can't just take the _.uniq(_.union(...)) of oldValue and
14326 // this.objects, because the uniqueness may not apply to oldValue
14327 // (especially if the oldValue was set via .set())
14328 var newValue = _.clone(oldValue);
14329
14330 AV._arrayEach(this.objects(), function (obj) {
14331 if (obj instanceof AV.Object && obj.id) {
14332 var matchingObj = (0, _find.default)(_).call(_, newValue, function (anObj) {
14333 return anObj instanceof AV.Object && anObj.id === obj.id;
14334 });
14335
14336 if (!matchingObj) {
14337 newValue.push(obj);
14338 } else {
14339 var index = (0, _indexOf.default)(_).call(_, newValue, matchingObj);
14340 newValue[index] = obj;
14341 }
14342 } else if (!_.contains(newValue, obj)) {
14343 newValue.push(obj);
14344 }
14345 });
14346
14347 return newValue;
14348 }
14349 }
14350 });
14351
14352 AV.Op._registerDecoder('AddUnique', function (json) {
14353 return new AV.Op.AddUnique(AV._decode(json.objects));
14354 });
14355 /**
14356 * @private
14357 * @class
14358 * Remove is an atomic operation where the given objects will be removed from
14359 * the array that is stored in this field.
14360 */
14361
14362
14363 AV.Op.Remove = AV.Op._extend(
14364 /** @lends AV.Op.Remove.prototype */
14365 {
14366 _initialize: function _initialize(objects) {
14367 this._objects = _.uniq(objects);
14368 },
14369
14370 /**
14371 * Returns the objects to be removed from the array.
14372 * @return {Array} The objects to be removed from the array.
14373 */
14374 objects: function objects() {
14375 return this._objects;
14376 },
14377
14378 /**
14379 * Returns a JSON version of the operation suitable for sending to AV.
14380 * @return {Object}
14381 */
14382 toJSON: function toJSON() {
14383 return {
14384 __op: 'Remove',
14385 objects: AV._encode(this.objects())
14386 };
14387 },
14388 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14389 if (!previous) {
14390 return this;
14391 } else if (previous instanceof AV.Op.Unset) {
14392 return previous;
14393 } else if (previous instanceof AV.Op.Set) {
14394 return new AV.Op.Set(this._estimate(previous.value()));
14395 } else if (previous instanceof AV.Op.Remove) {
14396 return new AV.Op.Remove(_.union(previous.objects(), this.objects()));
14397 } else {
14398 throw new Error('Op is invalid after previous op.');
14399 }
14400 },
14401 _estimate: function _estimate(oldValue) {
14402 if (!oldValue) {
14403 return [];
14404 } else {
14405 var newValue = _.difference(oldValue, this.objects()); // If there are saved AV Objects being removed, also remove them.
14406
14407
14408 AV._arrayEach(this.objects(), function (obj) {
14409 if (obj instanceof AV.Object && obj.id) {
14410 newValue = _.reject(newValue, function (other) {
14411 return other instanceof AV.Object && other.id === obj.id;
14412 });
14413 }
14414 });
14415
14416 return newValue;
14417 }
14418 }
14419 });
14420
14421 AV.Op._registerDecoder('Remove', function (json) {
14422 return new AV.Op.Remove(AV._decode(json.objects));
14423 });
14424 /**
14425 * @private
14426 * @class
14427 * A Relation operation indicates that the field is an instance of
14428 * AV.Relation, and objects are being added to, or removed from, that
14429 * relation.
14430 */
14431
14432
14433 AV.Op.Relation = AV.Op._extend(
14434 /** @lends AV.Op.Relation.prototype */
14435 {
14436 _initialize: function _initialize(adds, removes) {
14437 this._targetClassName = null;
14438 var self = this;
14439
14440 var pointerToId = function pointerToId(object) {
14441 if (object instanceof AV.Object) {
14442 if (!object.id) {
14443 throw new Error("You can't add an unsaved AV.Object to a relation.");
14444 }
14445
14446 if (!self._targetClassName) {
14447 self._targetClassName = object.className;
14448 }
14449
14450 if (self._targetClassName !== object.className) {
14451 throw new Error('Tried to create a AV.Relation with 2 different types: ' + self._targetClassName + ' and ' + object.className + '.');
14452 }
14453
14454 return object.id;
14455 }
14456
14457 return object;
14458 };
14459
14460 this.relationsToAdd = _.uniq((0, _map.default)(_).call(_, adds, pointerToId));
14461 this.relationsToRemove = _.uniq((0, _map.default)(_).call(_, removes, pointerToId));
14462 },
14463
14464 /**
14465 * Returns an array of unfetched AV.Object that are being added to the
14466 * relation.
14467 * @return {Array}
14468 */
14469 added: function added() {
14470 var self = this;
14471 return (0, _map.default)(_).call(_, this.relationsToAdd, function (objectId) {
14472 var object = AV.Object._create(self._targetClassName);
14473
14474 object.id = objectId;
14475 return object;
14476 });
14477 },
14478
14479 /**
14480 * Returns an array of unfetched AV.Object that are being removed from
14481 * the relation.
14482 * @return {Array}
14483 */
14484 removed: function removed() {
14485 var self = this;
14486 return (0, _map.default)(_).call(_, this.relationsToRemove, function (objectId) {
14487 var object = AV.Object._create(self._targetClassName);
14488
14489 object.id = objectId;
14490 return object;
14491 });
14492 },
14493
14494 /**
14495 * Returns a JSON version of the operation suitable for sending to AV.
14496 * @return {Object}
14497 */
14498 toJSON: function toJSON() {
14499 var adds = null;
14500 var removes = null;
14501 var self = this;
14502
14503 var idToPointer = function idToPointer(id) {
14504 return {
14505 __type: 'Pointer',
14506 className: self._targetClassName,
14507 objectId: id
14508 };
14509 };
14510
14511 var pointers = null;
14512
14513 if (this.relationsToAdd.length > 0) {
14514 pointers = (0, _map.default)(_).call(_, this.relationsToAdd, idToPointer);
14515 adds = {
14516 __op: 'AddRelation',
14517 objects: pointers
14518 };
14519 }
14520
14521 if (this.relationsToRemove.length > 0) {
14522 pointers = (0, _map.default)(_).call(_, this.relationsToRemove, idToPointer);
14523 removes = {
14524 __op: 'RemoveRelation',
14525 objects: pointers
14526 };
14527 }
14528
14529 if (adds && removes) {
14530 return {
14531 __op: 'Batch',
14532 ops: [adds, removes]
14533 };
14534 }
14535
14536 return adds || removes || {};
14537 },
14538 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14539 if (!previous) {
14540 return this;
14541 } else if (previous instanceof AV.Op.Unset) {
14542 throw new Error("You can't modify a relation after deleting it.");
14543 } else if (previous instanceof AV.Op.Relation) {
14544 if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
14545 throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + this._targetClassName + ' was passed in.');
14546 }
14547
14548 var newAdd = _.union(_.difference(previous.relationsToAdd, this.relationsToRemove), this.relationsToAdd);
14549
14550 var newRemove = _.union(_.difference(previous.relationsToRemove, this.relationsToAdd), this.relationsToRemove);
14551
14552 var newRelation = new AV.Op.Relation(newAdd, newRemove);
14553 newRelation._targetClassName = this._targetClassName;
14554 return newRelation;
14555 } else {
14556 throw new Error('Op is invalid after previous op.');
14557 }
14558 },
14559 _estimate: function _estimate(oldValue, object, key) {
14560 if (!oldValue) {
14561 var relation = new AV.Relation(object, key);
14562 relation.targetClassName = this._targetClassName;
14563 } else if (oldValue instanceof AV.Relation) {
14564 if (this._targetClassName) {
14565 if (oldValue.targetClassName) {
14566 if (oldValue.targetClassName !== this._targetClassName) {
14567 throw new Error('Related object must be a ' + oldValue.targetClassName + ', but a ' + this._targetClassName + ' was passed in.');
14568 }
14569 } else {
14570 oldValue.targetClassName = this._targetClassName;
14571 }
14572 }
14573
14574 return oldValue;
14575 } else {
14576 throw new Error('Op is invalid after previous op.');
14577 }
14578 }
14579 });
14580
14581 AV.Op._registerDecoder('AddRelation', function (json) {
14582 return new AV.Op.Relation(AV._decode(json.objects), []);
14583 });
14584
14585 AV.Op._registerDecoder('RemoveRelation', function (json) {
14586 return new AV.Op.Relation([], AV._decode(json.objects));
14587 });
14588};
14589
14590/***/ }),
14591/* 440 */
14592/***/ (function(module, exports, __webpack_require__) {
14593
14594var parent = __webpack_require__(441);
14595
14596module.exports = parent;
14597
14598
14599/***/ }),
14600/* 441 */
14601/***/ (function(module, exports, __webpack_require__) {
14602
14603var isPrototypeOf = __webpack_require__(20);
14604var method = __webpack_require__(442);
14605
14606var ArrayPrototype = Array.prototype;
14607
14608module.exports = function (it) {
14609 var own = it.find;
14610 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;
14611};
14612
14613
14614/***/ }),
14615/* 442 */
14616/***/ (function(module, exports, __webpack_require__) {
14617
14618__webpack_require__(443);
14619var entryVirtual = __webpack_require__(38);
14620
14621module.exports = entryVirtual('Array').find;
14622
14623
14624/***/ }),
14625/* 443 */
14626/***/ (function(module, exports, __webpack_require__) {
14627
14628"use strict";
14629
14630var $ = __webpack_require__(0);
14631var $find = __webpack_require__(101).find;
14632var addToUnscopables = __webpack_require__(152);
14633
14634var FIND = 'find';
14635var SKIPS_HOLES = true;
14636
14637// Shouldn't skip holes
14638if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
14639
14640// `Array.prototype.find` method
14641// https://tc39.es/ecma262/#sec-array.prototype.find
14642$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
14643 find: function find(callbackfn /* , that = undefined */) {
14644 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
14645 }
14646});
14647
14648// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
14649addToUnscopables(FIND);
14650
14651
14652/***/ }),
14653/* 444 */
14654/***/ (function(module, exports, __webpack_require__) {
14655
14656"use strict";
14657
14658
14659var _ = __webpack_require__(1);
14660
14661module.exports = function (AV) {
14662 /**
14663 * Creates a new Relation for the given parent object and key. This
14664 * constructor should rarely be used directly, but rather created by
14665 * {@link AV.Object#relation}.
14666 * @param {AV.Object} parent The parent of this relation.
14667 * @param {String} key The key for this relation on the parent.
14668 * @see AV.Object#relation
14669 * @class
14670 *
14671 * <p>
14672 * A class that is used to access all of the children of a many-to-many
14673 * relationship. Each instance of AV.Relation is associated with a
14674 * particular parent object and key.
14675 * </p>
14676 */
14677 AV.Relation = function (parent, key) {
14678 if (!_.isString(key)) {
14679 throw new TypeError('key must be a string');
14680 }
14681
14682 this.parent = parent;
14683 this.key = key;
14684 this.targetClassName = null;
14685 };
14686 /**
14687 * Creates a query that can be used to query the parent objects in this relation.
14688 * @param {String} parentClass The parent class or name.
14689 * @param {String} relationKey The relation field key in parent.
14690 * @param {AV.Object} child The child object.
14691 * @return {AV.Query}
14692 */
14693
14694
14695 AV.Relation.reverseQuery = function (parentClass, relationKey, child) {
14696 var query = new AV.Query(parentClass);
14697 query.equalTo(relationKey, child._toPointer());
14698 return query;
14699 };
14700
14701 _.extend(AV.Relation.prototype,
14702 /** @lends AV.Relation.prototype */
14703 {
14704 /**
14705 * Makes sure that this relation has the right parent and key.
14706 * @private
14707 */
14708 _ensureParentAndKey: function _ensureParentAndKey(parent, key) {
14709 this.parent = this.parent || parent;
14710 this.key = this.key || key;
14711
14712 if (this.parent !== parent) {
14713 throw new Error('Internal Error. Relation retrieved from two different Objects.');
14714 }
14715
14716 if (this.key !== key) {
14717 throw new Error('Internal Error. Relation retrieved from two different keys.');
14718 }
14719 },
14720
14721 /**
14722 * Adds a AV.Object or an array of AV.Objects to the relation.
14723 * @param {AV.Object|AV.Object[]} objects The item or items to add.
14724 */
14725 add: function add(objects) {
14726 if (!_.isArray(objects)) {
14727 objects = [objects];
14728 }
14729
14730 var change = new AV.Op.Relation(objects, []);
14731 this.parent.set(this.key, change);
14732 this.targetClassName = change._targetClassName;
14733 },
14734
14735 /**
14736 * Removes a AV.Object or an array of AV.Objects from this relation.
14737 * @param {AV.Object|AV.Object[]} objects The item or items to remove.
14738 */
14739 remove: function remove(objects) {
14740 if (!_.isArray(objects)) {
14741 objects = [objects];
14742 }
14743
14744 var change = new AV.Op.Relation([], objects);
14745 this.parent.set(this.key, change);
14746 this.targetClassName = change._targetClassName;
14747 },
14748
14749 /**
14750 * Returns a JSON version of the object suitable for saving to disk.
14751 * @return {Object}
14752 */
14753 toJSON: function toJSON() {
14754 return {
14755 __type: 'Relation',
14756 className: this.targetClassName
14757 };
14758 },
14759
14760 /**
14761 * Returns a AV.Query that is limited to objects in this
14762 * relation.
14763 * @return {AV.Query}
14764 */
14765 query: function query() {
14766 var targetClass;
14767 var query;
14768
14769 if (!this.targetClassName) {
14770 targetClass = AV.Object._getSubclass(this.parent.className);
14771 query = new AV.Query(targetClass);
14772 query._defaultParams.redirectClassNameForKey = this.key;
14773 } else {
14774 targetClass = AV.Object._getSubclass(this.targetClassName);
14775 query = new AV.Query(targetClass);
14776 }
14777
14778 query._addCondition('$relatedTo', 'object', this.parent._toPointer());
14779
14780 query._addCondition('$relatedTo', 'key', this.key);
14781
14782 return query;
14783 }
14784 });
14785};
14786
14787/***/ }),
14788/* 445 */
14789/***/ (function(module, exports, __webpack_require__) {
14790
14791"use strict";
14792
14793
14794var _interopRequireDefault = __webpack_require__(2);
14795
14796var _promise = _interopRequireDefault(__webpack_require__(10));
14797
14798var _ = __webpack_require__(1);
14799
14800var cos = __webpack_require__(446);
14801
14802var qiniu = __webpack_require__(447);
14803
14804var s3 = __webpack_require__(495);
14805
14806var AVError = __webpack_require__(40);
14807
14808var _require = __webpack_require__(25),
14809 request = _require.request,
14810 AVRequest = _require._request;
14811
14812var _require2 = __webpack_require__(28),
14813 tap = _require2.tap,
14814 transformFetchOptions = _require2.transformFetchOptions;
14815
14816var debug = __webpack_require__(60)('leancloud:file');
14817
14818var parseBase64 = __webpack_require__(499);
14819
14820module.exports = function (AV) {
14821 // port from browserify path module
14822 // since react-native packager won't shim node modules.
14823 var extname = function extname(path) {
14824 if (!_.isString(path)) return '';
14825 return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
14826 };
14827
14828 var b64Digit = function b64Digit(number) {
14829 if (number < 26) {
14830 return String.fromCharCode(65 + number);
14831 }
14832
14833 if (number < 52) {
14834 return String.fromCharCode(97 + (number - 26));
14835 }
14836
14837 if (number < 62) {
14838 return String.fromCharCode(48 + (number - 52));
14839 }
14840
14841 if (number === 62) {
14842 return '+';
14843 }
14844
14845 if (number === 63) {
14846 return '/';
14847 }
14848
14849 throw new Error('Tried to encode large digit ' + number + ' in base64.');
14850 };
14851
14852 var encodeBase64 = function encodeBase64(array) {
14853 var chunks = [];
14854 chunks.length = Math.ceil(array.length / 3);
14855
14856 _.times(chunks.length, function (i) {
14857 var b1 = array[i * 3];
14858 var b2 = array[i * 3 + 1] || 0;
14859 var b3 = array[i * 3 + 2] || 0;
14860 var has2 = i * 3 + 1 < array.length;
14861 var has3 = i * 3 + 2 < array.length;
14862 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('');
14863 });
14864
14865 return chunks.join('');
14866 };
14867 /**
14868 * An AV.File is a local representation of a file that is saved to the AV
14869 * cloud.
14870 * @param name {String} The file's name. This will change to a unique value
14871 * once the file has finished saving.
14872 * @param data {Array} The data for the file, as either:
14873 * 1. an Array of byte value Numbers, or
14874 * 2. an Object like { base64: "..." } with a base64-encoded String.
14875 * 3. a Blob(File) selected with a file upload control in a browser.
14876 * 4. an Object like { blob: {uri: "..."} } that mimics Blob
14877 * in some non-browser environments such as React Native.
14878 * 5. a Buffer in Node.js runtime.
14879 * 6. a Stream in Node.js runtime.
14880 *
14881 * For example:<pre>
14882 * var fileUploadControl = $("#profilePhotoFileUpload")[0];
14883 * if (fileUploadControl.files.length > 0) {
14884 * var file = fileUploadControl.files[0];
14885 * var name = "photo.jpg";
14886 * var file = new AV.File(name, file);
14887 * file.save().then(function() {
14888 * // The file has been saved to AV.
14889 * }, function(error) {
14890 * // The file either could not be read, or could not be saved to AV.
14891 * });
14892 * }</pre>
14893 *
14894 * @class
14895 * @param [mimeType] {String} Content-Type header to use for the file. If
14896 * this is omitted, the content type will be inferred from the name's
14897 * extension.
14898 */
14899
14900
14901 AV.File = function (name, data, mimeType) {
14902 this.attributes = {
14903 name: name,
14904 url: '',
14905 metaData: {},
14906 // 用来存储转换后要上传的 base64 String
14907 base64: ''
14908 };
14909
14910 if (_.isString(data)) {
14911 throw new TypeError('Creating an AV.File from a String is not yet supported.');
14912 }
14913
14914 if (_.isArray(data)) {
14915 this.attributes.metaData.size = data.length;
14916 data = {
14917 base64: encodeBase64(data)
14918 };
14919 }
14920
14921 this._extName = '';
14922 this._data = data;
14923 this._uploadHeaders = {};
14924
14925 if (data && data.blob && typeof data.blob.uri === 'string') {
14926 this._extName = extname(data.blob.uri);
14927 }
14928
14929 if (typeof Blob !== 'undefined' && data instanceof Blob) {
14930 if (data.size) {
14931 this.attributes.metaData.size = data.size;
14932 }
14933
14934 if (data.name) {
14935 this._extName = extname(data.name);
14936 }
14937 }
14938
14939 var owner;
14940
14941 if (data && data.owner) {
14942 owner = data.owner;
14943 } else if (!AV._config.disableCurrentUser) {
14944 try {
14945 owner = AV.User.current();
14946 } catch (error) {
14947 if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
14948 throw error;
14949 }
14950 }
14951 }
14952
14953 this.attributes.metaData.owner = owner ? owner.id : 'unknown';
14954 this.set('mime_type', mimeType);
14955 };
14956 /**
14957 * Creates a fresh AV.File object with exists url for saving to AVOS Cloud.
14958 * @param {String} name the file name
14959 * @param {String} url the file url.
14960 * @param {Object} [metaData] the file metadata object.
14961 * @param {String} [type] Content-Type header to use for the file. If
14962 * this is omitted, the content type will be inferred from the name's
14963 * extension.
14964 * @return {AV.File} the file object
14965 */
14966
14967
14968 AV.File.withURL = function (name, url, metaData, type) {
14969 if (!name || !url) {
14970 throw new Error('Please provide file name and url');
14971 }
14972
14973 var file = new AV.File(name, null, type); //copy metaData properties to file.
14974
14975 if (metaData) {
14976 for (var prop in metaData) {
14977 if (!file.attributes.metaData[prop]) file.attributes.metaData[prop] = metaData[prop];
14978 }
14979 }
14980
14981 file.attributes.url = url; //Mark the file is from external source.
14982
14983 file.attributes.metaData.__source = 'external';
14984 file.attributes.metaData.size = 0;
14985 return file;
14986 };
14987 /**
14988 * Creates a file object with exists objectId.
14989 * @param {String} objectId The objectId string
14990 * @return {AV.File} the file object
14991 */
14992
14993
14994 AV.File.createWithoutData = function (objectId) {
14995 if (!objectId) {
14996 throw new TypeError('The objectId must be provided');
14997 }
14998
14999 var file = new AV.File();
15000 file.id = objectId;
15001 return file;
15002 };
15003 /**
15004 * Request file censor.
15005 * @since 4.13.0
15006 * @param {String} objectId
15007 * @return {Promise.<string>}
15008 */
15009
15010
15011 AV.File.censor = function (objectId) {
15012 if (!AV._config.masterKey) {
15013 throw new Error('Cannot censor a file without masterKey');
15014 }
15015
15016 return request({
15017 method: 'POST',
15018 path: "/files/".concat(objectId, "/censor"),
15019 authOptions: {
15020 useMasterKey: true
15021 }
15022 }).then(function (res) {
15023 return res.censorResult;
15024 });
15025 };
15026
15027 _.extend(AV.File.prototype,
15028 /** @lends AV.File.prototype */
15029 {
15030 className: '_File',
15031 _toFullJSON: function _toFullJSON(seenObjects) {
15032 var _this = this;
15033
15034 var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
15035
15036 var json = _.clone(this.attributes);
15037
15038 AV._objectEach(json, function (val, key) {
15039 json[key] = AV._encode(val, seenObjects, undefined, full);
15040 });
15041
15042 AV._objectEach(this._operations, function (val, key) {
15043 json[key] = val;
15044 });
15045
15046 if (_.has(this, 'id')) {
15047 json.objectId = this.id;
15048 }
15049
15050 ['createdAt', 'updatedAt'].forEach(function (key) {
15051 if (_.has(_this, key)) {
15052 var val = _this[key];
15053 json[key] = _.isDate(val) ? val.toJSON() : val;
15054 }
15055 });
15056
15057 if (full) {
15058 json.__type = 'File';
15059 }
15060
15061 return json;
15062 },
15063
15064 /**
15065 * Returns a JSON version of the file with meta data.
15066 * Inverse to {@link AV.parseJSON}
15067 * @since 3.0.0
15068 * @return {Object}
15069 */
15070 toFullJSON: function toFullJSON() {
15071 var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
15072 return this._toFullJSON(seenObjects);
15073 },
15074
15075 /**
15076 * Returns a JSON version of the object.
15077 * @return {Object}
15078 */
15079 toJSON: function toJSON(key, holder) {
15080 var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [this];
15081 return this._toFullJSON(seenObjects, false);
15082 },
15083
15084 /**
15085 * Gets a Pointer referencing this file.
15086 * @private
15087 */
15088 _toPointer: function _toPointer() {
15089 return {
15090 __type: 'Pointer',
15091 className: this.className,
15092 objectId: this.id
15093 };
15094 },
15095
15096 /**
15097 * Returns the ACL for this file.
15098 * @returns {AV.ACL} An instance of AV.ACL.
15099 */
15100 getACL: function getACL() {
15101 return this._acl;
15102 },
15103
15104 /**
15105 * Sets the ACL to be used for this file.
15106 * @param {AV.ACL} acl An instance of AV.ACL.
15107 */
15108 setACL: function setACL(acl) {
15109 if (!(acl instanceof AV.ACL)) {
15110 return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
15111 }
15112
15113 this._acl = acl;
15114 return this;
15115 },
15116
15117 /**
15118 * Gets the name of the file. Before save is called, this is the filename
15119 * given by the user. After save is called, that name gets prefixed with a
15120 * unique identifier.
15121 */
15122 name: function name() {
15123 return this.get('name');
15124 },
15125
15126 /**
15127 * Gets the url of the file. It is only available after you save the file or
15128 * after you get the file from a AV.Object.
15129 * @return {String}
15130 */
15131 url: function url() {
15132 return this.get('url');
15133 },
15134
15135 /**
15136 * Gets the attributs of the file object.
15137 * @param {String} The attribute name which want to get.
15138 * @returns {Any}
15139 */
15140 get: function get(attrName) {
15141 switch (attrName) {
15142 case 'objectId':
15143 return this.id;
15144
15145 case 'url':
15146 case 'name':
15147 case 'mime_type':
15148 case 'metaData':
15149 case 'createdAt':
15150 case 'updatedAt':
15151 return this.attributes[attrName];
15152
15153 default:
15154 return this.attributes.metaData[attrName];
15155 }
15156 },
15157
15158 /**
15159 * Set the metaData of the file object.
15160 * @param {Object} Object is an key value Object for setting metaData.
15161 * @param {String} attr is an optional metadata key.
15162 * @param {Object} value is an optional metadata value.
15163 * @returns {String|Number|Array|Object}
15164 */
15165 set: function set() {
15166 var _this2 = this;
15167
15168 var set = function set(attrName, value) {
15169 switch (attrName) {
15170 case 'name':
15171 case 'url':
15172 case 'mime_type':
15173 case 'base64':
15174 case 'metaData':
15175 _this2.attributes[attrName] = value;
15176 break;
15177
15178 default:
15179 // File 并非一个 AVObject,不能完全自定义其他属性,所以只能都放在 metaData 上面
15180 _this2.attributes.metaData[attrName] = value;
15181 break;
15182 }
15183 };
15184
15185 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15186 args[_key] = arguments[_key];
15187 }
15188
15189 switch (args.length) {
15190 case 1:
15191 // 传入一个 Object
15192 for (var k in args[0]) {
15193 set(k, args[0][k]);
15194 }
15195
15196 break;
15197
15198 case 2:
15199 set(args[0], args[1]);
15200 break;
15201 }
15202
15203 return this;
15204 },
15205
15206 /**
15207 * Set a header for the upload request.
15208 * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
15209 *
15210 * @param {String} key header key
15211 * @param {String} value header value
15212 * @return {AV.File} this
15213 */
15214 setUploadHeader: function setUploadHeader(key, value) {
15215 this._uploadHeaders[key] = value;
15216 return this;
15217 },
15218
15219 /**
15220 * <p>Returns the file's metadata JSON object if no arguments is given.Returns the
15221 * metadata value if a key is given.Set metadata value if key and value are both given.</p>
15222 * <p><pre>
15223 * var metadata = file.metaData(); //Get metadata JSON object.
15224 * var size = file.metaData('size'); // Get the size metadata value.
15225 * file.metaData('format', 'jpeg'); //set metadata attribute and value.
15226 *</pre></p>
15227 * @return {Object} The file's metadata JSON object.
15228 * @param {String} attr an optional metadata key.
15229 * @param {Object} value an optional metadata value.
15230 **/
15231 metaData: function metaData(attr, value) {
15232 if (attr && value) {
15233 this.attributes.metaData[attr] = value;
15234 return this;
15235 } else if (attr && !value) {
15236 return this.attributes.metaData[attr];
15237 } else {
15238 return this.attributes.metaData;
15239 }
15240 },
15241
15242 /**
15243 * 如果文件是图片,获取图片的缩略图URL。可以传入宽度、高度、质量、格式等参数。
15244 * @return {String} 缩略图URL
15245 * @param {Number} width 宽度,单位:像素
15246 * @param {Number} heigth 高度,单位:像素
15247 * @param {Number} quality 质量,1-100的数字,默认100
15248 * @param {Number} scaleToFit 是否将图片自适应大小。默认为true。
15249 * @param {String} fmt 格式,默认为png,也可以为jpeg,gif等格式。
15250 */
15251 thumbnailURL: function thumbnailURL(width, height) {
15252 var quality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
15253 var scaleToFit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
15254 var fmt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'png';
15255 var url = this.attributes.url;
15256
15257 if (!url) {
15258 throw new Error('Invalid url.');
15259 }
15260
15261 if (!width || !height || width <= 0 || height <= 0) {
15262 throw new Error('Invalid width or height value.');
15263 }
15264
15265 if (quality <= 0 || quality > 100) {
15266 throw new Error('Invalid quality value.');
15267 }
15268
15269 var mode = scaleToFit ? 2 : 1;
15270 return url + '?imageView/' + mode + '/w/' + width + '/h/' + height + '/q/' + quality + '/format/' + fmt;
15271 },
15272
15273 /**
15274 * Returns the file's size.
15275 * @return {Number} The file's size in bytes.
15276 **/
15277 size: function size() {
15278 return this.metaData().size;
15279 },
15280
15281 /**
15282 * Returns the file's owner.
15283 * @return {String} The file's owner id.
15284 */
15285 ownerId: function ownerId() {
15286 return this.metaData().owner;
15287 },
15288
15289 /**
15290 * Destroy the file.
15291 * @param {AuthOptions} options
15292 * @return {Promise} A promise that is fulfilled when the destroy
15293 * completes.
15294 */
15295 destroy: function destroy(options) {
15296 if (!this.id) {
15297 return _promise.default.reject(new Error('The file id does not eixst.'));
15298 }
15299
15300 var request = AVRequest('files', null, this.id, 'DELETE', null, options);
15301 return request;
15302 },
15303
15304 /**
15305 * Request Qiniu upload token
15306 * @param {string} type
15307 * @return {Promise} Resolved with the response
15308 * @private
15309 */
15310 _fileToken: function _fileToken(type, authOptions) {
15311 var name = this.attributes.name;
15312 var extName = extname(name);
15313
15314 if (!extName && this._extName) {
15315 name += this._extName;
15316 extName = this._extName;
15317 }
15318
15319 var data = {
15320 name: name,
15321 keep_file_name: authOptions.keepFileName,
15322 key: authOptions.key,
15323 ACL: this._acl,
15324 mime_type: type,
15325 metaData: this.attributes.metaData
15326 };
15327 return AVRequest('fileTokens', null, null, 'POST', data, authOptions);
15328 },
15329
15330 /**
15331 * @callback UploadProgressCallback
15332 * @param {XMLHttpRequestProgressEvent} event - The progress event with 'loaded' and 'total' attributes
15333 */
15334
15335 /**
15336 * Saves the file to the AV cloud.
15337 * @param {AuthOptions} [options] AuthOptions plus:
15338 * @param {UploadProgressCallback} [options.onprogress] 文件上传进度,在 Node.js 中无效,回调参数说明详见 {@link UploadProgressCallback}。
15339 * @param {boolean} [options.keepFileName = false] 保留下载文件的文件名。
15340 * @param {string} [options.key] 指定文件的 key。设置该选项需要使用 masterKey
15341 * @return {Promise} Promise that is resolved when the save finishes.
15342 */
15343 save: function save() {
15344 var _this3 = this;
15345
15346 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15347
15348 if (this.id) {
15349 throw new Error('File is already saved.');
15350 }
15351
15352 if (!this._previousSave) {
15353 if (this._data) {
15354 var mimeType = this.get('mime_type');
15355 this._previousSave = this._fileToken(mimeType, options).then(function (uploadInfo) {
15356 if (uploadInfo.mime_type) {
15357 mimeType = uploadInfo.mime_type;
15358
15359 _this3.set('mime_type', mimeType);
15360 }
15361
15362 _this3._token = uploadInfo.token;
15363 return _promise.default.resolve().then(function () {
15364 var data = _this3._data;
15365
15366 if (data && data.base64) {
15367 return parseBase64(data.base64, mimeType);
15368 }
15369
15370 if (data && data.blob) {
15371 if (!data.blob.type && mimeType) {
15372 data.blob.type = mimeType;
15373 }
15374
15375 if (!data.blob.name) {
15376 data.blob.name = _this3.get('name');
15377 }
15378
15379 return data.blob;
15380 }
15381
15382 if (typeof Blob !== 'undefined' && data instanceof Blob) {
15383 return data;
15384 }
15385
15386 throw new TypeError('malformed file data');
15387 }).then(function (data) {
15388 var _options = _.extend({}, options); // filter out download progress events
15389
15390
15391 if (options.onprogress) {
15392 _options.onprogress = function (event) {
15393 if (event.direction === 'download') return;
15394 return options.onprogress(event);
15395 };
15396 }
15397
15398 switch (uploadInfo.provider) {
15399 case 's3':
15400 return s3(uploadInfo, data, _this3, _options);
15401
15402 case 'qcloud':
15403 return cos(uploadInfo, data, _this3, _options);
15404
15405 case 'qiniu':
15406 default:
15407 return qiniu(uploadInfo, data, _this3, _options);
15408 }
15409 }).then(tap(function () {
15410 return _this3._callback(true);
15411 }), function (error) {
15412 _this3._callback(false);
15413
15414 throw error;
15415 });
15416 });
15417 } else if (this.attributes.url && this.attributes.metaData.__source === 'external') {
15418 // external link file.
15419 var data = {
15420 name: this.attributes.name,
15421 ACL: this._acl,
15422 metaData: this.attributes.metaData,
15423 mime_type: this.mimeType,
15424 url: this.attributes.url
15425 };
15426 this._previousSave = AVRequest('files', null, null, 'post', data, options).then(function (response) {
15427 _this3.id = response.objectId;
15428 return _this3;
15429 });
15430 }
15431 }
15432
15433 return this._previousSave;
15434 },
15435 _callback: function _callback(success) {
15436 AVRequest('fileCallback', null, null, 'post', {
15437 token: this._token,
15438 result: success
15439 }).catch(debug);
15440 delete this._token;
15441 delete this._data;
15442 },
15443
15444 /**
15445 * fetch the file from server. If the server's representation of the
15446 * model differs from its current attributes, they will be overriden,
15447 * @param {Object} fetchOptions Optional options to set 'keys',
15448 * 'include' and 'includeACL' option.
15449 * @param {AuthOptions} options
15450 * @return {Promise} A promise that is fulfilled when the fetch
15451 * completes.
15452 */
15453 fetch: function fetch(fetchOptions, options) {
15454 if (!this.id) {
15455 throw new Error('Cannot fetch unsaved file');
15456 }
15457
15458 var request = AVRequest('files', null, this.id, 'GET', transformFetchOptions(fetchOptions), options);
15459 return request.then(this._finishFetch.bind(this));
15460 },
15461 _finishFetch: function _finishFetch(response) {
15462 var value = AV.Object.prototype.parse(response);
15463 value.attributes = {
15464 name: value.name,
15465 url: value.url,
15466 mime_type: value.mime_type,
15467 bucket: value.bucket
15468 };
15469 value.attributes.metaData = value.metaData || {};
15470 value.id = value.objectId; // clean
15471
15472 delete value.objectId;
15473 delete value.metaData;
15474 delete value.url;
15475 delete value.name;
15476 delete value.mime_type;
15477 delete value.bucket;
15478
15479 _.extend(this, value);
15480
15481 return this;
15482 },
15483
15484 /**
15485 * Request file censor
15486 * @since 4.13.0
15487 * @return {Promise.<string>}
15488 */
15489 censor: function censor() {
15490 if (!this.id) {
15491 throw new Error('Cannot censor an unsaved file');
15492 }
15493
15494 return AV.File.censor(this.id);
15495 }
15496 });
15497};
15498
15499/***/ }),
15500/* 446 */
15501/***/ (function(module, exports, __webpack_require__) {
15502
15503"use strict";
15504
15505
15506var _require = __webpack_require__(61),
15507 getAdapter = _require.getAdapter;
15508
15509var debug = __webpack_require__(60)('cos');
15510
15511module.exports = function (uploadInfo, data, file) {
15512 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15513 var url = uploadInfo.upload_url + '?sign=' + encodeURIComponent(uploadInfo.token);
15514 var fileFormData = {
15515 field: 'fileContent',
15516 data: data,
15517 name: file.attributes.name
15518 };
15519 var options = {
15520 headers: file._uploadHeaders,
15521 data: {
15522 op: 'upload'
15523 },
15524 onprogress: saveOptions.onprogress
15525 };
15526 debug('url: %s, file: %o, options: %o', url, fileFormData, options);
15527 var upload = getAdapter('upload');
15528 return upload(url, fileFormData, options).then(function (response) {
15529 debug(response.status, response.data);
15530
15531 if (response.ok === false) {
15532 var error = new Error(response.status);
15533 error.response = response;
15534 throw error;
15535 }
15536
15537 file.attributes.url = uploadInfo.url;
15538 file._bucket = uploadInfo.bucket;
15539 file.id = uploadInfo.objectId;
15540 return file;
15541 }, function (error) {
15542 var response = error.response;
15543
15544 if (response) {
15545 debug(response.status, response.data);
15546 error.statusCode = response.status;
15547 error.response = response.data;
15548 }
15549
15550 throw error;
15551 });
15552};
15553
15554/***/ }),
15555/* 447 */
15556/***/ (function(module, exports, __webpack_require__) {
15557
15558"use strict";
15559
15560
15561var _sliceInstanceProperty2 = __webpack_require__(81);
15562
15563var _Array$from = __webpack_require__(448);
15564
15565var _Symbol = __webpack_require__(453);
15566
15567var _getIteratorMethod = __webpack_require__(231);
15568
15569var _Reflect$construct = __webpack_require__(459);
15570
15571var _interopRequireDefault = __webpack_require__(2);
15572
15573var _inherits2 = _interopRequireDefault(__webpack_require__(463));
15574
15575var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(485));
15576
15577var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(487));
15578
15579var _classCallCheck2 = _interopRequireDefault(__webpack_require__(492));
15580
15581var _createClass2 = _interopRequireDefault(__webpack_require__(493));
15582
15583var _stringify = _interopRequireDefault(__webpack_require__(34));
15584
15585var _concat = _interopRequireDefault(__webpack_require__(29));
15586
15587var _promise = _interopRequireDefault(__webpack_require__(10));
15588
15589var _slice = _interopRequireDefault(__webpack_require__(81));
15590
15591function _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); }; }
15592
15593function _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; } }
15594
15595function _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; } } }; }
15596
15597function _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); }
15598
15599function _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; }
15600
15601var _require = __webpack_require__(61),
15602 getAdapter = _require.getAdapter;
15603
15604var debug = __webpack_require__(60)('leancloud:qiniu');
15605
15606var ajax = __webpack_require__(103);
15607
15608var btoa = __webpack_require__(494);
15609
15610var SHARD_THRESHOLD = 1024 * 1024 * 64;
15611var CHUNK_SIZE = 1024 * 1024 * 16;
15612
15613function upload(uploadInfo, data, file) {
15614 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15615 // Get the uptoken to upload files to qiniu.
15616 var uptoken = uploadInfo.token;
15617 var url = uploadInfo.upload_url || 'https://upload.qiniup.com';
15618 var fileFormData = {
15619 field: 'file',
15620 data: data,
15621 name: file.attributes.name
15622 };
15623 var options = {
15624 headers: file._uploadHeaders,
15625 data: {
15626 name: file.attributes.name,
15627 key: uploadInfo.key,
15628 token: uptoken
15629 },
15630 onprogress: saveOptions.onprogress
15631 };
15632 debug('url: %s, file: %o, options: %o', url, fileFormData, options);
15633 var upload = getAdapter('upload');
15634 return upload(url, fileFormData, options).then(function (response) {
15635 debug(response.status, response.data);
15636
15637 if (response.ok === false) {
15638 var message = response.status;
15639
15640 if (response.data) {
15641 if (response.data.error) {
15642 message = response.data.error;
15643 } else {
15644 message = (0, _stringify.default)(response.data);
15645 }
15646 }
15647
15648 var error = new Error(message);
15649 error.response = response;
15650 throw error;
15651 }
15652
15653 file.attributes.url = uploadInfo.url;
15654 file._bucket = uploadInfo.bucket;
15655 file.id = uploadInfo.objectId;
15656 return file;
15657 }, function (error) {
15658 var response = error.response;
15659
15660 if (response) {
15661 debug(response.status, response.data);
15662 error.statusCode = response.status;
15663 error.response = response.data;
15664 }
15665
15666 throw error;
15667 });
15668}
15669
15670function urlSafeBase64(string) {
15671 var base64 = btoa(unescape(encodeURIComponent(string)));
15672 var result = '';
15673
15674 var _iterator = _createForOfIteratorHelper(base64),
15675 _step;
15676
15677 try {
15678 for (_iterator.s(); !(_step = _iterator.n()).done;) {
15679 var ch = _step.value;
15680
15681 switch (ch) {
15682 case '+':
15683 result += '-';
15684 break;
15685
15686 case '/':
15687 result += '_';
15688 break;
15689
15690 default:
15691 result += ch;
15692 }
15693 }
15694 } catch (err) {
15695 _iterator.e(err);
15696 } finally {
15697 _iterator.f();
15698 }
15699
15700 return result;
15701}
15702
15703var ShardUploader = /*#__PURE__*/function () {
15704 function ShardUploader(uploadInfo, data, file, saveOptions) {
15705 var _context,
15706 _context2,
15707 _this = this;
15708
15709 (0, _classCallCheck2.default)(this, ShardUploader);
15710 this.uploadInfo = uploadInfo;
15711 this.data = data;
15712 this.file = file;
15713 this.size = undefined;
15714 this.offset = 0;
15715 this.uploadedChunks = 0;
15716 var key = urlSafeBase64(uploadInfo.key);
15717 var uploadURL = uploadInfo.upload_url || 'https://upload.qiniup.com';
15718 this.baseURL = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(uploadURL, "/buckets/")).call(_context2, uploadInfo.bucket, "/objects/")).call(_context, key, "/uploads");
15719 this.upToken = 'UpToken ' + uploadInfo.token;
15720 this.uploaded = 0;
15721
15722 if (saveOptions && saveOptions.onprogress) {
15723 this.onProgress = function (_ref) {
15724 var loaded = _ref.loaded;
15725 loaded += _this.uploadedChunks * CHUNK_SIZE;
15726
15727 if (loaded <= _this.uploaded) {
15728 return;
15729 }
15730
15731 if (_this.size) {
15732 saveOptions.onprogress({
15733 loaded: loaded,
15734 total: _this.size,
15735 percent: loaded / _this.size * 100
15736 });
15737 } else {
15738 saveOptions.onprogress({
15739 loaded: loaded
15740 });
15741 }
15742
15743 _this.uploaded = loaded;
15744 };
15745 }
15746 }
15747 /**
15748 * @returns {Promise<string>}
15749 */
15750
15751
15752 (0, _createClass2.default)(ShardUploader, [{
15753 key: "getUploadId",
15754 value: function getUploadId() {
15755 return ajax({
15756 method: 'POST',
15757 url: this.baseURL,
15758 headers: {
15759 Authorization: this.upToken
15760 }
15761 }).then(function (res) {
15762 return res.uploadId;
15763 });
15764 }
15765 }, {
15766 key: "getChunk",
15767 value: function getChunk() {
15768 throw new Error('Not implemented');
15769 }
15770 /**
15771 * @param {string} uploadId
15772 * @param {number} partNumber
15773 * @param {any} data
15774 * @returns {Promise<{ partNumber: number, etag: string }>}
15775 */
15776
15777 }, {
15778 key: "uploadPart",
15779 value: function uploadPart(uploadId, partNumber, data) {
15780 var _context3, _context4;
15781
15782 return ajax({
15783 method: 'PUT',
15784 url: (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.baseURL, "/")).call(_context4, uploadId, "/")).call(_context3, partNumber),
15785 headers: {
15786 Authorization: this.upToken
15787 },
15788 data: data,
15789 onprogress: this.onProgress
15790 }).then(function (_ref2) {
15791 var etag = _ref2.etag;
15792 return {
15793 partNumber: partNumber,
15794 etag: etag
15795 };
15796 });
15797 }
15798 }, {
15799 key: "stopUpload",
15800 value: function stopUpload(uploadId) {
15801 var _context5;
15802
15803 return ajax({
15804 method: 'DELETE',
15805 url: (0, _concat.default)(_context5 = "".concat(this.baseURL, "/")).call(_context5, uploadId),
15806 headers: {
15807 Authorization: this.upToken
15808 }
15809 });
15810 }
15811 }, {
15812 key: "upload",
15813 value: function upload() {
15814 var _this2 = this;
15815
15816 var parts = [];
15817 return this.getUploadId().then(function (uploadId) {
15818 var uploadPart = function uploadPart() {
15819 return _promise.default.resolve(_this2.getChunk()).then(function (chunk) {
15820 if (!chunk) {
15821 return;
15822 }
15823
15824 var partNumber = parts.length + 1;
15825 return _this2.uploadPart(uploadId, partNumber, chunk).then(function (part) {
15826 parts.push(part);
15827 _this2.uploadedChunks++;
15828 return uploadPart();
15829 });
15830 }).catch(function (error) {
15831 return _this2.stopUpload(uploadId).then(function () {
15832 return _promise.default.reject(error);
15833 });
15834 });
15835 };
15836
15837 return uploadPart().then(function () {
15838 var _context6;
15839
15840 return ajax({
15841 method: 'POST',
15842 url: (0, _concat.default)(_context6 = "".concat(_this2.baseURL, "/")).call(_context6, uploadId),
15843 headers: {
15844 Authorization: _this2.upToken
15845 },
15846 data: {
15847 parts: parts,
15848 fname: _this2.file.attributes.name,
15849 mimeType: _this2.file.attributes.mime_type
15850 }
15851 });
15852 });
15853 }).then(function () {
15854 _this2.file.attributes.url = _this2.uploadInfo.url;
15855 _this2.file._bucket = _this2.uploadInfo.bucket;
15856 _this2.file.id = _this2.uploadInfo.objectId;
15857 return _this2.file;
15858 });
15859 }
15860 }]);
15861 return ShardUploader;
15862}();
15863
15864var BlobUploader = /*#__PURE__*/function (_ShardUploader) {
15865 (0, _inherits2.default)(BlobUploader, _ShardUploader);
15866
15867 var _super = _createSuper(BlobUploader);
15868
15869 function BlobUploader(uploadInfo, data, file, saveOptions) {
15870 var _this3;
15871
15872 (0, _classCallCheck2.default)(this, BlobUploader);
15873 _this3 = _super.call(this, uploadInfo, data, file, saveOptions);
15874 _this3.size = data.size;
15875 return _this3;
15876 }
15877 /**
15878 * @returns {Blob | null}
15879 */
15880
15881
15882 (0, _createClass2.default)(BlobUploader, [{
15883 key: "getChunk",
15884 value: function getChunk() {
15885 var _context7;
15886
15887 if (this.offset >= this.size) {
15888 return null;
15889 }
15890
15891 var chunk = (0, _slice.default)(_context7 = this.data).call(_context7, this.offset, this.offset + CHUNK_SIZE);
15892 this.offset += chunk.size;
15893 return chunk;
15894 }
15895 }]);
15896 return BlobUploader;
15897}(ShardUploader);
15898
15899function isBlob(data) {
15900 return typeof Blob !== 'undefined' && data instanceof Blob;
15901}
15902
15903module.exports = function (uploadInfo, data, file) {
15904 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15905
15906 if (isBlob(data) && data.size >= SHARD_THRESHOLD) {
15907 return new BlobUploader(uploadInfo, data, file, saveOptions).upload();
15908 }
15909
15910 return upload(uploadInfo, data, file, saveOptions);
15911};
15912
15913/***/ }),
15914/* 448 */
15915/***/ (function(module, exports, __webpack_require__) {
15916
15917module.exports = __webpack_require__(230);
15918
15919/***/ }),
15920/* 449 */
15921/***/ (function(module, exports, __webpack_require__) {
15922
15923__webpack_require__(95);
15924__webpack_require__(450);
15925var path = __webpack_require__(13);
15926
15927module.exports = path.Array.from;
15928
15929
15930/***/ }),
15931/* 450 */
15932/***/ (function(module, exports, __webpack_require__) {
15933
15934var $ = __webpack_require__(0);
15935var from = __webpack_require__(451);
15936var checkCorrectnessOfIteration = __webpack_require__(160);
15937
15938var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
15939 // eslint-disable-next-line es-x/no-array-from -- required for testing
15940 Array.from(iterable);
15941});
15942
15943// `Array.from` method
15944// https://tc39.es/ecma262/#sec-array.from
15945$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
15946 from: from
15947});
15948
15949
15950/***/ }),
15951/* 451 */
15952/***/ (function(module, exports, __webpack_require__) {
15953
15954"use strict";
15955
15956var bind = __webpack_require__(50);
15957var call = __webpack_require__(11);
15958var toObject = __webpack_require__(35);
15959var callWithSafeIterationClosing = __webpack_require__(452);
15960var isArrayIteratorMethod = __webpack_require__(149);
15961var isConstructor = __webpack_require__(93);
15962var lengthOfArrayLike = __webpack_require__(42);
15963var createProperty = __webpack_require__(99);
15964var getIterator = __webpack_require__(150);
15965var getIteratorMethod = __webpack_require__(90);
15966
15967var $Array = Array;
15968
15969// `Array.from` method implementation
15970// https://tc39.es/ecma262/#sec-array.from
15971module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
15972 var O = toObject(arrayLike);
15973 var IS_CONSTRUCTOR = isConstructor(this);
15974 var argumentsLength = arguments.length;
15975 var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
15976 var mapping = mapfn !== undefined;
15977 if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
15978 var iteratorMethod = getIteratorMethod(O);
15979 var index = 0;
15980 var length, result, step, iterator, next, value;
15981 // if the target is not iterable or it's an array with the default iterator - use a simple case
15982 if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
15983 iterator = getIterator(O, iteratorMethod);
15984 next = iterator.next;
15985 result = IS_CONSTRUCTOR ? new this() : [];
15986 for (;!(step = call(next, iterator)).done; index++) {
15987 value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
15988 createProperty(result, index, value);
15989 }
15990 } else {
15991 length = lengthOfArrayLike(O);
15992 result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
15993 for (;length > index; index++) {
15994 value = mapping ? mapfn(O[index], index) : O[index];
15995 createProperty(result, index, value);
15996 }
15997 }
15998 result.length = index;
15999 return result;
16000};
16001
16002
16003/***/ }),
16004/* 452 */
16005/***/ (function(module, exports, __webpack_require__) {
16006
16007var anObject = __webpack_require__(21);
16008var iteratorClose = __webpack_require__(151);
16009
16010// call something on iterator step with safe closing on error
16011module.exports = function (iterator, fn, value, ENTRIES) {
16012 try {
16013 return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
16014 } catch (error) {
16015 iteratorClose(iterator, 'throw', error);
16016 }
16017};
16018
16019
16020/***/ }),
16021/* 453 */
16022/***/ (function(module, exports, __webpack_require__) {
16023
16024module.exports = __webpack_require__(226);
16025
16026/***/ }),
16027/* 454 */
16028/***/ (function(module, exports, __webpack_require__) {
16029
16030module.exports = __webpack_require__(455);
16031
16032
16033/***/ }),
16034/* 455 */
16035/***/ (function(module, exports, __webpack_require__) {
16036
16037var parent = __webpack_require__(456);
16038
16039module.exports = parent;
16040
16041
16042/***/ }),
16043/* 456 */
16044/***/ (function(module, exports, __webpack_require__) {
16045
16046var parent = __webpack_require__(457);
16047
16048module.exports = parent;
16049
16050
16051/***/ }),
16052/* 457 */
16053/***/ (function(module, exports, __webpack_require__) {
16054
16055var parent = __webpack_require__(458);
16056__webpack_require__(73);
16057
16058module.exports = parent;
16059
16060
16061/***/ }),
16062/* 458 */
16063/***/ (function(module, exports, __webpack_require__) {
16064
16065__webpack_require__(70);
16066__webpack_require__(95);
16067var getIteratorMethod = __webpack_require__(90);
16068
16069module.exports = getIteratorMethod;
16070
16071
16072/***/ }),
16073/* 459 */
16074/***/ (function(module, exports, __webpack_require__) {
16075
16076module.exports = __webpack_require__(460);
16077
16078/***/ }),
16079/* 460 */
16080/***/ (function(module, exports, __webpack_require__) {
16081
16082var parent = __webpack_require__(461);
16083
16084module.exports = parent;
16085
16086
16087/***/ }),
16088/* 461 */
16089/***/ (function(module, exports, __webpack_require__) {
16090
16091__webpack_require__(462);
16092var path = __webpack_require__(13);
16093
16094module.exports = path.Reflect.construct;
16095
16096
16097/***/ }),
16098/* 462 */
16099/***/ (function(module, exports, __webpack_require__) {
16100
16101var $ = __webpack_require__(0);
16102var getBuiltIn = __webpack_require__(16);
16103var apply = __webpack_require__(62);
16104var bind = __webpack_require__(232);
16105var aConstructor = __webpack_require__(156);
16106var anObject = __webpack_require__(21);
16107var isObject = __webpack_require__(17);
16108var create = __webpack_require__(51);
16109var fails = __webpack_require__(4);
16110
16111var nativeConstruct = getBuiltIn('Reflect', 'construct');
16112var ObjectPrototype = Object.prototype;
16113var push = [].push;
16114
16115// `Reflect.construct` method
16116// https://tc39.es/ecma262/#sec-reflect.construct
16117// MS Edge supports only 2 arguments and argumentsList argument is optional
16118// FF Nightly sets third argument as `new.target`, but does not create `this` from it
16119var NEW_TARGET_BUG = fails(function () {
16120 function F() { /* empty */ }
16121 return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
16122});
16123
16124var ARGS_BUG = !fails(function () {
16125 nativeConstruct(function () { /* empty */ });
16126});
16127
16128var FORCED = NEW_TARGET_BUG || ARGS_BUG;
16129
16130$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
16131 construct: function construct(Target, args /* , newTarget */) {
16132 aConstructor(Target);
16133 anObject(args);
16134 var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
16135 if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
16136 if (Target == newTarget) {
16137 // w/o altered newTarget, optimization for 0-4 arguments
16138 switch (args.length) {
16139 case 0: return new Target();
16140 case 1: return new Target(args[0]);
16141 case 2: return new Target(args[0], args[1]);
16142 case 3: return new Target(args[0], args[1], args[2]);
16143 case 4: return new Target(args[0], args[1], args[2], args[3]);
16144 }
16145 // w/o altered newTarget, lot of arguments case
16146 var $args = [null];
16147 apply(push, $args, args);
16148 return new (apply(bind, Target, $args))();
16149 }
16150 // with altered newTarget, not support built-in constructors
16151 var proto = newTarget.prototype;
16152 var instance = create(isObject(proto) ? proto : ObjectPrototype);
16153 var result = apply(Target, instance, args);
16154 return isObject(result) ? result : instance;
16155 }
16156});
16157
16158
16159/***/ }),
16160/* 463 */
16161/***/ (function(module, exports, __webpack_require__) {
16162
16163var _Object$create = __webpack_require__(464);
16164
16165var _Object$defineProperty = __webpack_require__(137);
16166
16167var setPrototypeOf = __webpack_require__(474);
16168
16169function _inherits(subClass, superClass) {
16170 if (typeof superClass !== "function" && superClass !== null) {
16171 throw new TypeError("Super expression must either be null or a function");
16172 }
16173
16174 subClass.prototype = _Object$create(superClass && superClass.prototype, {
16175 constructor: {
16176 value: subClass,
16177 writable: true,
16178 configurable: true
16179 }
16180 });
16181
16182 _Object$defineProperty(subClass, "prototype", {
16183 writable: false
16184 });
16185
16186 if (superClass) setPrototypeOf(subClass, superClass);
16187}
16188
16189module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
16190
16191/***/ }),
16192/* 464 */
16193/***/ (function(module, exports, __webpack_require__) {
16194
16195module.exports = __webpack_require__(465);
16196
16197/***/ }),
16198/* 465 */
16199/***/ (function(module, exports, __webpack_require__) {
16200
16201module.exports = __webpack_require__(466);
16202
16203
16204/***/ }),
16205/* 466 */
16206/***/ (function(module, exports, __webpack_require__) {
16207
16208var parent = __webpack_require__(467);
16209
16210module.exports = parent;
16211
16212
16213/***/ }),
16214/* 467 */
16215/***/ (function(module, exports, __webpack_require__) {
16216
16217var parent = __webpack_require__(468);
16218
16219module.exports = parent;
16220
16221
16222/***/ }),
16223/* 468 */
16224/***/ (function(module, exports, __webpack_require__) {
16225
16226var parent = __webpack_require__(469);
16227
16228module.exports = parent;
16229
16230
16231/***/ }),
16232/* 469 */
16233/***/ (function(module, exports, __webpack_require__) {
16234
16235__webpack_require__(470);
16236var path = __webpack_require__(13);
16237
16238var Object = path.Object;
16239
16240module.exports = function create(P, D) {
16241 return Object.create(P, D);
16242};
16243
16244
16245/***/ }),
16246/* 470 */
16247/***/ (function(module, exports, __webpack_require__) {
16248
16249// TODO: Remove from `core-js@4`
16250var $ = __webpack_require__(0);
16251var DESCRIPTORS = __webpack_require__(19);
16252var create = __webpack_require__(51);
16253
16254// `Object.create` method
16255// https://tc39.es/ecma262/#sec-object.create
16256$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
16257 create: create
16258});
16259
16260
16261/***/ }),
16262/* 471 */
16263/***/ (function(module, exports, __webpack_require__) {
16264
16265module.exports = __webpack_require__(472);
16266
16267
16268/***/ }),
16269/* 472 */
16270/***/ (function(module, exports, __webpack_require__) {
16271
16272var parent = __webpack_require__(473);
16273
16274module.exports = parent;
16275
16276
16277/***/ }),
16278/* 473 */
16279/***/ (function(module, exports, __webpack_require__) {
16280
16281var parent = __webpack_require__(224);
16282
16283module.exports = parent;
16284
16285
16286/***/ }),
16287/* 474 */
16288/***/ (function(module, exports, __webpack_require__) {
16289
16290var _Object$setPrototypeOf = __webpack_require__(233);
16291
16292var _bindInstanceProperty = __webpack_require__(234);
16293
16294function _setPrototypeOf(o, p) {
16295 var _context;
16296
16297 module.exports = _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
16298 o.__proto__ = p;
16299 return o;
16300 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
16301 return _setPrototypeOf(o, p);
16302}
16303
16304module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
16305
16306/***/ }),
16307/* 475 */
16308/***/ (function(module, exports, __webpack_require__) {
16309
16310module.exports = __webpack_require__(476);
16311
16312
16313/***/ }),
16314/* 476 */
16315/***/ (function(module, exports, __webpack_require__) {
16316
16317var parent = __webpack_require__(477);
16318
16319module.exports = parent;
16320
16321
16322/***/ }),
16323/* 477 */
16324/***/ (function(module, exports, __webpack_require__) {
16325
16326var parent = __webpack_require__(221);
16327
16328module.exports = parent;
16329
16330
16331/***/ }),
16332/* 478 */
16333/***/ (function(module, exports, __webpack_require__) {
16334
16335module.exports = __webpack_require__(479);
16336
16337
16338/***/ }),
16339/* 479 */
16340/***/ (function(module, exports, __webpack_require__) {
16341
16342var parent = __webpack_require__(480);
16343
16344module.exports = parent;
16345
16346
16347/***/ }),
16348/* 480 */
16349/***/ (function(module, exports, __webpack_require__) {
16350
16351var parent = __webpack_require__(481);
16352
16353module.exports = parent;
16354
16355
16356/***/ }),
16357/* 481 */
16358/***/ (function(module, exports, __webpack_require__) {
16359
16360var parent = __webpack_require__(482);
16361
16362module.exports = parent;
16363
16364
16365/***/ }),
16366/* 482 */
16367/***/ (function(module, exports, __webpack_require__) {
16368
16369var isPrototypeOf = __webpack_require__(20);
16370var method = __webpack_require__(483);
16371
16372var FunctionPrototype = Function.prototype;
16373
16374module.exports = function (it) {
16375 var own = it.bind;
16376 return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;
16377};
16378
16379
16380/***/ }),
16381/* 483 */
16382/***/ (function(module, exports, __webpack_require__) {
16383
16384__webpack_require__(484);
16385var entryVirtual = __webpack_require__(38);
16386
16387module.exports = entryVirtual('Function').bind;
16388
16389
16390/***/ }),
16391/* 484 */
16392/***/ (function(module, exports, __webpack_require__) {
16393
16394// TODO: Remove from `core-js@4`
16395var $ = __webpack_require__(0);
16396var bind = __webpack_require__(232);
16397
16398// `Function.prototype.bind` method
16399// https://tc39.es/ecma262/#sec-function.prototype.bind
16400$({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
16401 bind: bind
16402});
16403
16404
16405/***/ }),
16406/* 485 */
16407/***/ (function(module, exports, __webpack_require__) {
16408
16409var _typeof = __webpack_require__(135)["default"];
16410
16411var assertThisInitialized = __webpack_require__(486);
16412
16413function _possibleConstructorReturn(self, call) {
16414 if (call && (_typeof(call) === "object" || typeof call === "function")) {
16415 return call;
16416 } else if (call !== void 0) {
16417 throw new TypeError("Derived constructors may only return object or undefined");
16418 }
16419
16420 return assertThisInitialized(self);
16421}
16422
16423module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
16424
16425/***/ }),
16426/* 486 */
16427/***/ (function(module, exports) {
16428
16429function _assertThisInitialized(self) {
16430 if (self === void 0) {
16431 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
16432 }
16433
16434 return self;
16435}
16436
16437module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
16438
16439/***/ }),
16440/* 487 */
16441/***/ (function(module, exports, __webpack_require__) {
16442
16443var _Object$setPrototypeOf = __webpack_require__(233);
16444
16445var _bindInstanceProperty = __webpack_require__(234);
16446
16447var _Object$getPrototypeOf = __webpack_require__(488);
16448
16449function _getPrototypeOf(o) {
16450 var _context;
16451
16452 module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
16453 return o.__proto__ || _Object$getPrototypeOf(o);
16454 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
16455 return _getPrototypeOf(o);
16456}
16457
16458module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
16459
16460/***/ }),
16461/* 488 */
16462/***/ (function(module, exports, __webpack_require__) {
16463
16464module.exports = __webpack_require__(489);
16465
16466/***/ }),
16467/* 489 */
16468/***/ (function(module, exports, __webpack_require__) {
16469
16470module.exports = __webpack_require__(490);
16471
16472
16473/***/ }),
16474/* 490 */
16475/***/ (function(module, exports, __webpack_require__) {
16476
16477var parent = __webpack_require__(491);
16478
16479module.exports = parent;
16480
16481
16482/***/ }),
16483/* 491 */
16484/***/ (function(module, exports, __webpack_require__) {
16485
16486var parent = __webpack_require__(216);
16487
16488module.exports = parent;
16489
16490
16491/***/ }),
16492/* 492 */
16493/***/ (function(module, exports) {
16494
16495function _classCallCheck(instance, Constructor) {
16496 if (!(instance instanceof Constructor)) {
16497 throw new TypeError("Cannot call a class as a function");
16498 }
16499}
16500
16501module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
16502
16503/***/ }),
16504/* 493 */
16505/***/ (function(module, exports, __webpack_require__) {
16506
16507var _Object$defineProperty = __webpack_require__(137);
16508
16509function _defineProperties(target, props) {
16510 for (var i = 0; i < props.length; i++) {
16511 var descriptor = props[i];
16512 descriptor.enumerable = descriptor.enumerable || false;
16513 descriptor.configurable = true;
16514 if ("value" in descriptor) descriptor.writable = true;
16515
16516 _Object$defineProperty(target, descriptor.key, descriptor);
16517 }
16518}
16519
16520function _createClass(Constructor, protoProps, staticProps) {
16521 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
16522 if (staticProps) _defineProperties(Constructor, staticProps);
16523
16524 _Object$defineProperty(Constructor, "prototype", {
16525 writable: false
16526 });
16527
16528 return Constructor;
16529}
16530
16531module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
16532
16533/***/ }),
16534/* 494 */
16535/***/ (function(module, exports, __webpack_require__) {
16536
16537"use strict";
16538
16539
16540var _interopRequireDefault = __webpack_require__(2);
16541
16542var _slice = _interopRequireDefault(__webpack_require__(81));
16543
16544// base64 character set, plus padding character (=)
16545var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
16546
16547module.exports = function (string) {
16548 var result = '';
16549
16550 for (var i = 0; i < string.length;) {
16551 var a = string.charCodeAt(i++);
16552 var b = string.charCodeAt(i++);
16553 var c = string.charCodeAt(i++);
16554
16555 if (a > 255 || b > 255 || c > 255) {
16556 throw new TypeError('Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.');
16557 }
16558
16559 var bitmap = a << 16 | b << 8 | c;
16560 result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
16561 } // To determine the final padding
16562
16563
16564 var rest = string.length % 3; // If there's need of padding, replace the last 'A's with equal signs
16565
16566 return rest ? (0, _slice.default)(result).call(result, 0, rest - 3) + '==='.substring(rest) : result;
16567};
16568
16569/***/ }),
16570/* 495 */
16571/***/ (function(module, exports, __webpack_require__) {
16572
16573"use strict";
16574
16575
16576var _ = __webpack_require__(1);
16577
16578var ajax = __webpack_require__(103);
16579
16580module.exports = function upload(uploadInfo, data, file) {
16581 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
16582 return ajax({
16583 url: uploadInfo.upload_url,
16584 method: 'PUT',
16585 data: data,
16586 headers: _.extend({
16587 'Content-Type': file.get('mime_type'),
16588 'Cache-Control': 'public, max-age=31536000'
16589 }, file._uploadHeaders),
16590 onprogress: saveOptions.onprogress
16591 }).then(function () {
16592 file.attributes.url = uploadInfo.url;
16593 file._bucket = uploadInfo.bucket;
16594 file.id = uploadInfo.objectId;
16595 return file;
16596 });
16597};
16598
16599/***/ }),
16600/* 496 */
16601/***/ (function(module, exports, __webpack_require__) {
16602
16603(function(){
16604 var crypt = __webpack_require__(497),
16605 utf8 = __webpack_require__(235).utf8,
16606 isBuffer = __webpack_require__(498),
16607 bin = __webpack_require__(235).bin,
16608
16609 // The core
16610 md5 = function (message, options) {
16611 // Convert to byte array
16612 if (message.constructor == String)
16613 if (options && options.encoding === 'binary')
16614 message = bin.stringToBytes(message);
16615 else
16616 message = utf8.stringToBytes(message);
16617 else if (isBuffer(message))
16618 message = Array.prototype.slice.call(message, 0);
16619 else if (!Array.isArray(message))
16620 message = message.toString();
16621 // else, assume byte array already
16622
16623 var m = crypt.bytesToWords(message),
16624 l = message.length * 8,
16625 a = 1732584193,
16626 b = -271733879,
16627 c = -1732584194,
16628 d = 271733878;
16629
16630 // Swap endian
16631 for (var i = 0; i < m.length; i++) {
16632 m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
16633 ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
16634 }
16635
16636 // Padding
16637 m[l >>> 5] |= 0x80 << (l % 32);
16638 m[(((l + 64) >>> 9) << 4) + 14] = l;
16639
16640 // Method shortcuts
16641 var FF = md5._ff,
16642 GG = md5._gg,
16643 HH = md5._hh,
16644 II = md5._ii;
16645
16646 for (var i = 0; i < m.length; i += 16) {
16647
16648 var aa = a,
16649 bb = b,
16650 cc = c,
16651 dd = d;
16652
16653 a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
16654 d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
16655 c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
16656 b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
16657 a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
16658 d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
16659 c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
16660 b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
16661 a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
16662 d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
16663 c = FF(c, d, a, b, m[i+10], 17, -42063);
16664 b = FF(b, c, d, a, m[i+11], 22, -1990404162);
16665 a = FF(a, b, c, d, m[i+12], 7, 1804603682);
16666 d = FF(d, a, b, c, m[i+13], 12, -40341101);
16667 c = FF(c, d, a, b, m[i+14], 17, -1502002290);
16668 b = FF(b, c, d, a, m[i+15], 22, 1236535329);
16669
16670 a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
16671 d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
16672 c = GG(c, d, a, b, m[i+11], 14, 643717713);
16673 b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
16674 a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
16675 d = GG(d, a, b, c, m[i+10], 9, 38016083);
16676 c = GG(c, d, a, b, m[i+15], 14, -660478335);
16677 b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
16678 a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
16679 d = GG(d, a, b, c, m[i+14], 9, -1019803690);
16680 c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
16681 b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
16682 a = GG(a, b, c, d, m[i+13], 5, -1444681467);
16683 d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
16684 c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
16685 b = GG(b, c, d, a, m[i+12], 20, -1926607734);
16686
16687 a = HH(a, b, c, d, m[i+ 5], 4, -378558);
16688 d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
16689 c = HH(c, d, a, b, m[i+11], 16, 1839030562);
16690 b = HH(b, c, d, a, m[i+14], 23, -35309556);
16691 a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
16692 d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
16693 c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
16694 b = HH(b, c, d, a, m[i+10], 23, -1094730640);
16695 a = HH(a, b, c, d, m[i+13], 4, 681279174);
16696 d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
16697 c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
16698 b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
16699 a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
16700 d = HH(d, a, b, c, m[i+12], 11, -421815835);
16701 c = HH(c, d, a, b, m[i+15], 16, 530742520);
16702 b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
16703
16704 a = II(a, b, c, d, m[i+ 0], 6, -198630844);
16705 d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
16706 c = II(c, d, a, b, m[i+14], 15, -1416354905);
16707 b = II(b, c, d, a, m[i+ 5], 21, -57434055);
16708 a = II(a, b, c, d, m[i+12], 6, 1700485571);
16709 d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
16710 c = II(c, d, a, b, m[i+10], 15, -1051523);
16711 b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
16712 a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
16713 d = II(d, a, b, c, m[i+15], 10, -30611744);
16714 c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
16715 b = II(b, c, d, a, m[i+13], 21, 1309151649);
16716 a = II(a, b, c, d, m[i+ 4], 6, -145523070);
16717 d = II(d, a, b, c, m[i+11], 10, -1120210379);
16718 c = II(c, d, a, b, m[i+ 2], 15, 718787259);
16719 b = II(b, c, d, a, m[i+ 9], 21, -343485551);
16720
16721 a = (a + aa) >>> 0;
16722 b = (b + bb) >>> 0;
16723 c = (c + cc) >>> 0;
16724 d = (d + dd) >>> 0;
16725 }
16726
16727 return crypt.endian([a, b, c, d]);
16728 };
16729
16730 // Auxiliary functions
16731 md5._ff = function (a, b, c, d, x, s, t) {
16732 var n = a + (b & c | ~b & d) + (x >>> 0) + t;
16733 return ((n << s) | (n >>> (32 - s))) + b;
16734 };
16735 md5._gg = function (a, b, c, d, x, s, t) {
16736 var n = a + (b & d | c & ~d) + (x >>> 0) + t;
16737 return ((n << s) | (n >>> (32 - s))) + b;
16738 };
16739 md5._hh = function (a, b, c, d, x, s, t) {
16740 var n = a + (b ^ c ^ d) + (x >>> 0) + t;
16741 return ((n << s) | (n >>> (32 - s))) + b;
16742 };
16743 md5._ii = function (a, b, c, d, x, s, t) {
16744 var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
16745 return ((n << s) | (n >>> (32 - s))) + b;
16746 };
16747
16748 // Package private blocksize
16749 md5._blocksize = 16;
16750 md5._digestsize = 16;
16751
16752 module.exports = function (message, options) {
16753 if (message === undefined || message === null)
16754 throw new Error('Illegal argument ' + message);
16755
16756 var digestbytes = crypt.wordsToBytes(md5(message, options));
16757 return options && options.asBytes ? digestbytes :
16758 options && options.asString ? bin.bytesToString(digestbytes) :
16759 crypt.bytesToHex(digestbytes);
16760 };
16761
16762})();
16763
16764
16765/***/ }),
16766/* 497 */
16767/***/ (function(module, exports) {
16768
16769(function() {
16770 var base64map
16771 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
16772
16773 crypt = {
16774 // Bit-wise rotation left
16775 rotl: function(n, b) {
16776 return (n << b) | (n >>> (32 - b));
16777 },
16778
16779 // Bit-wise rotation right
16780 rotr: function(n, b) {
16781 return (n << (32 - b)) | (n >>> b);
16782 },
16783
16784 // Swap big-endian to little-endian and vice versa
16785 endian: function(n) {
16786 // If number given, swap endian
16787 if (n.constructor == Number) {
16788 return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
16789 }
16790
16791 // Else, assume array and swap all items
16792 for (var i = 0; i < n.length; i++)
16793 n[i] = crypt.endian(n[i]);
16794 return n;
16795 },
16796
16797 // Generate an array of any length of random bytes
16798 randomBytes: function(n) {
16799 for (var bytes = []; n > 0; n--)
16800 bytes.push(Math.floor(Math.random() * 256));
16801 return bytes;
16802 },
16803
16804 // Convert a byte array to big-endian 32-bit words
16805 bytesToWords: function(bytes) {
16806 for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
16807 words[b >>> 5] |= bytes[i] << (24 - b % 32);
16808 return words;
16809 },
16810
16811 // Convert big-endian 32-bit words to a byte array
16812 wordsToBytes: function(words) {
16813 for (var bytes = [], b = 0; b < words.length * 32; b += 8)
16814 bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
16815 return bytes;
16816 },
16817
16818 // Convert a byte array to a hex string
16819 bytesToHex: function(bytes) {
16820 for (var hex = [], i = 0; i < bytes.length; i++) {
16821 hex.push((bytes[i] >>> 4).toString(16));
16822 hex.push((bytes[i] & 0xF).toString(16));
16823 }
16824 return hex.join('');
16825 },
16826
16827 // Convert a hex string to a byte array
16828 hexToBytes: function(hex) {
16829 for (var bytes = [], c = 0; c < hex.length; c += 2)
16830 bytes.push(parseInt(hex.substr(c, 2), 16));
16831 return bytes;
16832 },
16833
16834 // Convert a byte array to a base-64 string
16835 bytesToBase64: function(bytes) {
16836 for (var base64 = [], i = 0; i < bytes.length; i += 3) {
16837 var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
16838 for (var j = 0; j < 4; j++)
16839 if (i * 8 + j * 6 <= bytes.length * 8)
16840 base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
16841 else
16842 base64.push('=');
16843 }
16844 return base64.join('');
16845 },
16846
16847 // Convert a base-64 string to a byte array
16848 base64ToBytes: function(base64) {
16849 // Remove non-base-64 characters
16850 base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
16851
16852 for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
16853 imod4 = ++i % 4) {
16854 if (imod4 == 0) continue;
16855 bytes.push(((base64map.indexOf(base64.charAt(i - 1))
16856 & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
16857 | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
16858 }
16859 return bytes;
16860 }
16861 };
16862
16863 module.exports = crypt;
16864})();
16865
16866
16867/***/ }),
16868/* 498 */
16869/***/ (function(module, exports) {
16870
16871/*!
16872 * Determine if an object is a Buffer
16873 *
16874 * @author Feross Aboukhadijeh <https://feross.org>
16875 * @license MIT
16876 */
16877
16878// The _isBuffer check is for Safari 5-7 support, because it's missing
16879// Object.prototype.constructor. Remove this eventually
16880module.exports = function (obj) {
16881 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
16882}
16883
16884function isBuffer (obj) {
16885 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
16886}
16887
16888// For Node v0.10 support. Remove this eventually.
16889function isSlowBuffer (obj) {
16890 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
16891}
16892
16893
16894/***/ }),
16895/* 499 */
16896/***/ (function(module, exports, __webpack_require__) {
16897
16898"use strict";
16899
16900
16901var _interopRequireDefault = __webpack_require__(2);
16902
16903var _indexOf = _interopRequireDefault(__webpack_require__(102));
16904
16905var dataURItoBlob = function dataURItoBlob(dataURI, type) {
16906 var _context;
16907
16908 var byteString; // 传入的 base64,不是 dataURL
16909
16910 if ((0, _indexOf.default)(dataURI).call(dataURI, 'base64') < 0) {
16911 byteString = atob(dataURI);
16912 } else if ((0, _indexOf.default)(_context = dataURI.split(',')[0]).call(_context, 'base64') >= 0) {
16913 type = type || dataURI.split(',')[0].split(':')[1].split(';')[0];
16914 byteString = atob(dataURI.split(',')[1]);
16915 } else {
16916 byteString = unescape(dataURI.split(',')[1]);
16917 }
16918
16919 var ia = new Uint8Array(byteString.length);
16920
16921 for (var i = 0; i < byteString.length; i++) {
16922 ia[i] = byteString.charCodeAt(i);
16923 }
16924
16925 return new Blob([ia], {
16926 type: type
16927 });
16928};
16929
16930module.exports = dataURItoBlob;
16931
16932/***/ }),
16933/* 500 */
16934/***/ (function(module, exports, __webpack_require__) {
16935
16936"use strict";
16937
16938
16939var _interopRequireDefault = __webpack_require__(2);
16940
16941var _slicedToArray2 = _interopRequireDefault(__webpack_require__(501));
16942
16943var _map = _interopRequireDefault(__webpack_require__(39));
16944
16945var _indexOf = _interopRequireDefault(__webpack_require__(102));
16946
16947var _find = _interopRequireDefault(__webpack_require__(104));
16948
16949var _promise = _interopRequireDefault(__webpack_require__(10));
16950
16951var _concat = _interopRequireDefault(__webpack_require__(29));
16952
16953var _keys2 = _interopRequireDefault(__webpack_require__(48));
16954
16955var _stringify = _interopRequireDefault(__webpack_require__(34));
16956
16957var _defineProperty = _interopRequireDefault(__webpack_require__(223));
16958
16959var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(522));
16960
16961var _ = __webpack_require__(1);
16962
16963var AVError = __webpack_require__(40);
16964
16965var _require = __webpack_require__(25),
16966 _request = _require._request;
16967
16968var _require2 = __webpack_require__(28),
16969 isNullOrUndefined = _require2.isNullOrUndefined,
16970 ensureArray = _require2.ensureArray,
16971 transformFetchOptions = _require2.transformFetchOptions,
16972 setValue = _require2.setValue,
16973 findValue = _require2.findValue,
16974 isPlainObject = _require2.isPlainObject,
16975 continueWhile = _require2.continueWhile;
16976
16977var recursiveToPointer = function recursiveToPointer(value) {
16978 if (_.isArray(value)) return (0, _map.default)(value).call(value, recursiveToPointer);
16979 if (isPlainObject(value)) return _.mapObject(value, recursiveToPointer);
16980 if (_.isObject(value) && value._toPointer) return value._toPointer();
16981 return value;
16982};
16983
16984var RESERVED_KEYS = ['objectId', 'createdAt', 'updatedAt'];
16985
16986var checkReservedKey = function checkReservedKey(key) {
16987 if ((0, _indexOf.default)(RESERVED_KEYS).call(RESERVED_KEYS, key) !== -1) {
16988 throw new Error("key[".concat(key, "] is reserved"));
16989 }
16990};
16991
16992var handleBatchResults = function handleBatchResults(results) {
16993 var firstError = (0, _find.default)(_).call(_, results, function (result) {
16994 return result instanceof Error;
16995 });
16996
16997 if (!firstError) {
16998 return results;
16999 }
17000
17001 var error = new AVError(firstError.code, firstError.message);
17002 error.results = results;
17003 throw error;
17004}; // Helper function to get a value from a Backbone object as a property
17005// or as a function.
17006
17007
17008function getValue(object, prop) {
17009 if (!(object && object[prop])) {
17010 return null;
17011 }
17012
17013 return _.isFunction(object[prop]) ? object[prop]() : object[prop];
17014} // AV.Object is analogous to the Java AVObject.
17015// It also implements the same interface as a Backbone model.
17016
17017
17018module.exports = function (AV) {
17019 /**
17020 * Creates a new model with defined attributes. A client id (cid) is
17021 * automatically generated and assigned for you.
17022 *
17023 * <p>You won't normally call this method directly. It is recommended that
17024 * you use a subclass of <code>AV.Object</code> instead, created by calling
17025 * <code>extend</code>.</p>
17026 *
17027 * <p>However, if you don't want to use a subclass, or aren't sure which
17028 * subclass is appropriate, you can use this form:<pre>
17029 * var object = new AV.Object("ClassName");
17030 * </pre>
17031 * That is basically equivalent to:<pre>
17032 * var MyClass = AV.Object.extend("ClassName");
17033 * var object = new MyClass();
17034 * </pre></p>
17035 *
17036 * @param {Object} attributes The initial set of data to store in the object.
17037 * @param {Object} options A set of Backbone-like options for creating the
17038 * object. The only option currently supported is "collection".
17039 * @see AV.Object.extend
17040 *
17041 * @class
17042 *
17043 * <p>The fundamental unit of AV data, which implements the Backbone Model
17044 * interface.</p>
17045 */
17046 AV.Object = function (attributes, options) {
17047 // Allow new AV.Object("ClassName") as a shortcut to _create.
17048 if (_.isString(attributes)) {
17049 return AV.Object._create.apply(this, arguments);
17050 }
17051
17052 attributes = attributes || {};
17053
17054 if (options && options.parse) {
17055 attributes = this.parse(attributes);
17056 attributes = this._mergeMagicFields(attributes);
17057 }
17058
17059 var defaults = getValue(this, 'defaults');
17060
17061 if (defaults) {
17062 attributes = _.extend({}, defaults, attributes);
17063 }
17064
17065 if (options && options.collection) {
17066 this.collection = options.collection;
17067 }
17068
17069 this._serverData = {}; // The last known data for this object from cloud.
17070
17071 this._opSetQueue = [{}]; // List of sets of changes to the data.
17072
17073 this._flags = {};
17074 this.attributes = {}; // The best estimate of this's current data.
17075
17076 this._hashedJSON = {}; // Hash of values of containers at last save.
17077
17078 this._escapedAttributes = {};
17079 this.cid = _.uniqueId('c');
17080 this.changed = {};
17081 this._silent = {};
17082 this._pending = {};
17083 this.set(attributes, {
17084 silent: true
17085 });
17086 this.changed = {};
17087 this._silent = {};
17088 this._pending = {};
17089 this._hasData = true;
17090 this._previousAttributes = _.clone(this.attributes);
17091 this.initialize.apply(this, arguments);
17092 };
17093 /**
17094 * @lends AV.Object.prototype
17095 * @property {String} id The objectId of the AV Object.
17096 */
17097
17098 /**
17099 * Saves the given list of AV.Object.
17100 * If any error is encountered, stops and calls the error handler.
17101 *
17102 * @example
17103 * AV.Object.saveAll([object1, object2, ...]).then(function(list) {
17104 * // All the objects were saved.
17105 * }, function(error) {
17106 * // An error occurred while saving one of the objects.
17107 * });
17108 *
17109 * @param {Array} list A list of <code>AV.Object</code>.
17110 */
17111
17112
17113 AV.Object.saveAll = function (list, options) {
17114 return AV.Object._deepSaveAsync(list, null, options);
17115 };
17116 /**
17117 * Fetch the given list of AV.Object.
17118 *
17119 * @param {AV.Object[]} objects A list of <code>AV.Object</code>
17120 * @param {AuthOptions} options
17121 * @return {Promise.<AV.Object[]>} The given list of <code>AV.Object</code>, updated
17122 */
17123
17124
17125 AV.Object.fetchAll = function (objects, options) {
17126 return _promise.default.resolve().then(function () {
17127 return _request('batch', null, null, 'POST', {
17128 requests: (0, _map.default)(_).call(_, objects, function (object) {
17129 var _context;
17130
17131 if (!object.className) throw new Error('object must have className to fetch');
17132 if (!object.id) throw new Error('object must have id to fetch');
17133 if (object.dirty()) throw new Error('object is modified but not saved');
17134 return {
17135 method: 'GET',
17136 path: (0, _concat.default)(_context = "/1.1/classes/".concat(object.className, "/")).call(_context, object.id)
17137 };
17138 })
17139 }, options);
17140 }).then(function (response) {
17141 var results = (0, _map.default)(_).call(_, objects, function (object, i) {
17142 if (response[i].success) {
17143 var fetchedAttrs = object.parse(response[i].success);
17144
17145 object._cleanupUnsetKeys(fetchedAttrs);
17146
17147 object._finishFetch(fetchedAttrs);
17148
17149 return object;
17150 }
17151
17152 if (response[i].success === null) {
17153 return new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
17154 }
17155
17156 return new AVError(response[i].error.code, response[i].error.error);
17157 });
17158 return handleBatchResults(results);
17159 });
17160 }; // Attach all inheritable methods to the AV.Object prototype.
17161
17162
17163 _.extend(AV.Object.prototype, AV.Events,
17164 /** @lends AV.Object.prototype */
17165 {
17166 _fetchWhenSave: false,
17167
17168 /**
17169 * Initialize is an empty function by default. Override it with your own
17170 * initialization logic.
17171 */
17172 initialize: function initialize() {},
17173
17174 /**
17175 * Set whether to enable fetchWhenSave option when updating object.
17176 * When set true, SDK would fetch the latest object after saving.
17177 * Default is false.
17178 *
17179 * @deprecated use AV.Object#save with options.fetchWhenSave instead
17180 * @param {boolean} enable true to enable fetchWhenSave option.
17181 */
17182 fetchWhenSave: function fetchWhenSave(enable) {
17183 console.warn('AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead.');
17184
17185 if (!_.isBoolean(enable)) {
17186 throw new Error('Expect boolean value for fetchWhenSave');
17187 }
17188
17189 this._fetchWhenSave = enable;
17190 },
17191
17192 /**
17193 * Returns the object's objectId.
17194 * @return {String} the objectId.
17195 */
17196 getObjectId: function getObjectId() {
17197 return this.id;
17198 },
17199
17200 /**
17201 * Returns the object's createdAt attribute.
17202 * @return {Date}
17203 */
17204 getCreatedAt: function getCreatedAt() {
17205 return this.createdAt;
17206 },
17207
17208 /**
17209 * Returns the object's updatedAt attribute.
17210 * @return {Date}
17211 */
17212 getUpdatedAt: function getUpdatedAt() {
17213 return this.updatedAt;
17214 },
17215
17216 /**
17217 * Returns a JSON version of the object.
17218 * @return {Object}
17219 */
17220 toJSON: function toJSON(key, holder) {
17221 var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
17222 return this._toFullJSON(seenObjects, false);
17223 },
17224
17225 /**
17226 * Returns a JSON version of the object with meta data.
17227 * Inverse to {@link AV.parseJSON}
17228 * @since 3.0.0
17229 * @return {Object}
17230 */
17231 toFullJSON: function toFullJSON() {
17232 var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
17233 return this._toFullJSON(seenObjects);
17234 },
17235 _toFullJSON: function _toFullJSON(seenObjects) {
17236 var _this = this;
17237
17238 var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
17239
17240 var json = _.clone(this.attributes);
17241
17242 if (_.isArray(seenObjects)) {
17243 var newSeenObjects = (0, _concat.default)(seenObjects).call(seenObjects, this);
17244 }
17245
17246 AV._objectEach(json, function (val, key) {
17247 json[key] = AV._encode(val, newSeenObjects, undefined, full);
17248 });
17249
17250 AV._objectEach(this._operations, function (val, key) {
17251 json[key] = val;
17252 });
17253
17254 if (_.has(this, 'id')) {
17255 json.objectId = this.id;
17256 }
17257
17258 ['createdAt', 'updatedAt'].forEach(function (key) {
17259 if (_.has(_this, key)) {
17260 var val = _this[key];
17261 json[key] = _.isDate(val) ? val.toJSON() : val;
17262 }
17263 });
17264
17265 if (full) {
17266 json.__type = 'Object';
17267 if (_.isArray(seenObjects) && seenObjects.length) json.__type = 'Pointer';
17268 json.className = this.className;
17269 }
17270
17271 return json;
17272 },
17273
17274 /**
17275 * Updates _hashedJSON to reflect the current state of this object.
17276 * Adds any changed hash values to the set of pending changes.
17277 * @private
17278 */
17279 _refreshCache: function _refreshCache() {
17280 var self = this;
17281
17282 if (self._refreshingCache) {
17283 return;
17284 }
17285
17286 self._refreshingCache = true;
17287
17288 AV._objectEach(this.attributes, function (value, key) {
17289 if (value instanceof AV.Object) {
17290 value._refreshCache();
17291 } else if (_.isObject(value)) {
17292 if (self._resetCacheForKey(key)) {
17293 self.set(key, new AV.Op.Set(value), {
17294 silent: true
17295 });
17296 }
17297 }
17298 });
17299
17300 delete self._refreshingCache;
17301 },
17302
17303 /**
17304 * Returns true if this object has been modified since its last
17305 * save/refresh. If an attribute is specified, it returns true only if that
17306 * particular attribute has been modified since the last save/refresh.
17307 * @param {String} attr An attribute name (optional).
17308 * @return {Boolean}
17309 */
17310 dirty: function dirty(attr) {
17311 this._refreshCache();
17312
17313 var currentChanges = _.last(this._opSetQueue);
17314
17315 if (attr) {
17316 return currentChanges[attr] ? true : false;
17317 }
17318
17319 if (!this.id) {
17320 return true;
17321 }
17322
17323 if ((0, _keys2.default)(_).call(_, currentChanges).length > 0) {
17324 return true;
17325 }
17326
17327 return false;
17328 },
17329
17330 /**
17331 * Returns the keys of the modified attribute since its last save/refresh.
17332 * @return {String[]}
17333 */
17334 dirtyKeys: function dirtyKeys() {
17335 this._refreshCache();
17336
17337 var currentChanges = _.last(this._opSetQueue);
17338
17339 return (0, _keys2.default)(_).call(_, currentChanges);
17340 },
17341
17342 /**
17343 * Gets a Pointer referencing this Object.
17344 * @private
17345 */
17346 _toPointer: function _toPointer() {
17347 // if (!this.id) {
17348 // throw new Error("Can't serialize an unsaved AV.Object");
17349 // }
17350 return {
17351 __type: 'Pointer',
17352 className: this.className,
17353 objectId: this.id
17354 };
17355 },
17356
17357 /**
17358 * Gets the value of an attribute.
17359 * @param {String} attr The string name of an attribute.
17360 */
17361 get: function get(attr) {
17362 switch (attr) {
17363 case 'objectId':
17364 return this.id;
17365
17366 case 'createdAt':
17367 case 'updatedAt':
17368 return this[attr];
17369
17370 default:
17371 return this.attributes[attr];
17372 }
17373 },
17374
17375 /**
17376 * Gets a relation on the given class for the attribute.
17377 * @param {String} attr The attribute to get the relation for.
17378 * @return {AV.Relation}
17379 */
17380 relation: function relation(attr) {
17381 var value = this.get(attr);
17382
17383 if (value) {
17384 if (!(value instanceof AV.Relation)) {
17385 throw new Error('Called relation() on non-relation field ' + attr);
17386 }
17387
17388 value._ensureParentAndKey(this, attr);
17389
17390 return value;
17391 } else {
17392 return new AV.Relation(this, attr);
17393 }
17394 },
17395
17396 /**
17397 * Gets the HTML-escaped value of an attribute.
17398 */
17399 escape: function escape(attr) {
17400 var html = this._escapedAttributes[attr];
17401
17402 if (html) {
17403 return html;
17404 }
17405
17406 var val = this.attributes[attr];
17407 var escaped;
17408
17409 if (isNullOrUndefined(val)) {
17410 escaped = '';
17411 } else {
17412 escaped = _.escape(val.toString());
17413 }
17414
17415 this._escapedAttributes[attr] = escaped;
17416 return escaped;
17417 },
17418
17419 /**
17420 * Returns <code>true</code> if the attribute contains a value that is not
17421 * null or undefined.
17422 * @param {String} attr The string name of the attribute.
17423 * @return {Boolean}
17424 */
17425 has: function has(attr) {
17426 return !isNullOrUndefined(this.attributes[attr]);
17427 },
17428
17429 /**
17430 * Pulls "special" fields like objectId, createdAt, etc. out of attrs
17431 * and puts them on "this" directly. Removes them from attrs.
17432 * @param attrs - A dictionary with the data for this AV.Object.
17433 * @private
17434 */
17435 _mergeMagicFields: function _mergeMagicFields(attrs) {
17436 // Check for changes of magic fields.
17437 var model = this;
17438 var specialFields = ['objectId', 'createdAt', 'updatedAt'];
17439
17440 AV._arrayEach(specialFields, function (attr) {
17441 if (attrs[attr]) {
17442 if (attr === 'objectId') {
17443 model.id = attrs[attr];
17444 } else if ((attr === 'createdAt' || attr === 'updatedAt') && !_.isDate(attrs[attr])) {
17445 model[attr] = AV._parseDate(attrs[attr]);
17446 } else {
17447 model[attr] = attrs[attr];
17448 }
17449
17450 delete attrs[attr];
17451 }
17452 });
17453
17454 return attrs;
17455 },
17456
17457 /**
17458 * Returns the json to be sent to the server.
17459 * @private
17460 */
17461 _startSave: function _startSave() {
17462 this._opSetQueue.push({});
17463 },
17464
17465 /**
17466 * Called when a save fails because of an error. Any changes that were part
17467 * of the save need to be merged with changes made after the save. This
17468 * might throw an exception is you do conflicting operations. For example,
17469 * if you do:
17470 * object.set("foo", "bar");
17471 * object.set("invalid field name", "baz");
17472 * object.save();
17473 * object.increment("foo");
17474 * then this will throw when the save fails and the client tries to merge
17475 * "bar" with the +1.
17476 * @private
17477 */
17478 _cancelSave: function _cancelSave() {
17479 var failedChanges = _.first(this._opSetQueue);
17480
17481 this._opSetQueue = _.rest(this._opSetQueue);
17482
17483 var nextChanges = _.first(this._opSetQueue);
17484
17485 AV._objectEach(failedChanges, function (op, key) {
17486 var op1 = failedChanges[key];
17487 var op2 = nextChanges[key];
17488
17489 if (op1 && op2) {
17490 nextChanges[key] = op2._mergeWithPrevious(op1);
17491 } else if (op1) {
17492 nextChanges[key] = op1;
17493 }
17494 });
17495
17496 this._saving = this._saving - 1;
17497 },
17498
17499 /**
17500 * Called when a save completes successfully. This merges the changes that
17501 * were saved into the known server data, and overrides it with any data
17502 * sent directly from the server.
17503 * @private
17504 */
17505 _finishSave: function _finishSave(serverData) {
17506 var _context2;
17507
17508 // Grab a copy of any object referenced by this object. These instances
17509 // may have already been fetched, and we don't want to lose their data.
17510 // Note that doing it like this means we will unify separate copies of the
17511 // same object, but that's a risk we have to take.
17512 var fetchedObjects = {};
17513
17514 AV._traverse(this.attributes, function (object) {
17515 if (object instanceof AV.Object && object.id && object._hasData) {
17516 fetchedObjects[object.id] = object;
17517 }
17518 });
17519
17520 var savedChanges = _.first(this._opSetQueue);
17521
17522 this._opSetQueue = _.rest(this._opSetQueue);
17523
17524 this._applyOpSet(savedChanges, this._serverData);
17525
17526 this._mergeMagicFields(serverData);
17527
17528 var self = this;
17529
17530 AV._objectEach(serverData, function (value, key) {
17531 self._serverData[key] = AV._decode(value, key); // Look for any objects that might have become unfetched and fix them
17532 // by replacing their values with the previously observed values.
17533
17534 var fetched = AV._traverse(self._serverData[key], function (object) {
17535 if (object instanceof AV.Object && fetchedObjects[object.id]) {
17536 return fetchedObjects[object.id];
17537 }
17538 });
17539
17540 if (fetched) {
17541 self._serverData[key] = fetched;
17542 }
17543 });
17544
17545 this._rebuildAllEstimatedData();
17546
17547 var opSetQueue = (0, _map.default)(_context2 = this._opSetQueue).call(_context2, _.clone);
17548
17549 this._refreshCache();
17550
17551 this._opSetQueue = opSetQueue;
17552 this._saving = this._saving - 1;
17553 },
17554
17555 /**
17556 * Called when a fetch or login is complete to set the known server data to
17557 * the given object.
17558 * @private
17559 */
17560 _finishFetch: function _finishFetch(serverData, hasData) {
17561 // Clear out any changes the user might have made previously.
17562 this._opSetQueue = [{}]; // Bring in all the new server data.
17563
17564 this._mergeMagicFields(serverData);
17565
17566 var self = this;
17567
17568 AV._objectEach(serverData, function (value, key) {
17569 self._serverData[key] = AV._decode(value, key);
17570 }); // Refresh the attributes.
17571
17572
17573 this._rebuildAllEstimatedData(); // Clear out the cache of mutable containers.
17574
17575
17576 this._refreshCache();
17577
17578 this._opSetQueue = [{}];
17579 this._hasData = hasData;
17580 },
17581
17582 /**
17583 * Applies the set of AV.Op in opSet to the object target.
17584 * @private
17585 */
17586 _applyOpSet: function _applyOpSet(opSet, target) {
17587 var self = this;
17588
17589 AV._objectEach(opSet, function (change, key) {
17590 var _findValue = findValue(target, key),
17591 _findValue2 = (0, _slicedToArray2.default)(_findValue, 3),
17592 value = _findValue2[0],
17593 actualTarget = _findValue2[1],
17594 actualKey = _findValue2[2];
17595
17596 setValue(target, key, change._estimate(value, self, key));
17597
17598 if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
17599 delete actualTarget[actualKey];
17600 }
17601 });
17602 },
17603
17604 /**
17605 * Replaces the cached value for key with the current value.
17606 * Returns true if the new value is different than the old value.
17607 * @private
17608 */
17609 _resetCacheForKey: function _resetCacheForKey(key) {
17610 var value = this.attributes[key];
17611
17612 if (_.isObject(value) && !(value instanceof AV.Object) && !(value instanceof AV.File)) {
17613 var json = (0, _stringify.default)(recursiveToPointer(value));
17614
17615 if (this._hashedJSON[key] !== json) {
17616 var wasSet = !!this._hashedJSON[key];
17617 this._hashedJSON[key] = json;
17618 return wasSet;
17619 }
17620 }
17621
17622 return false;
17623 },
17624
17625 /**
17626 * Populates attributes[key] by starting with the last known data from the
17627 * server, and applying all of the local changes that have been made to that
17628 * key since then.
17629 * @private
17630 */
17631 _rebuildEstimatedDataForKey: function _rebuildEstimatedDataForKey(key) {
17632 var self = this;
17633 delete this.attributes[key];
17634
17635 if (this._serverData[key]) {
17636 this.attributes[key] = this._serverData[key];
17637 }
17638
17639 AV._arrayEach(this._opSetQueue, function (opSet) {
17640 var op = opSet[key];
17641
17642 if (op) {
17643 var _findValue3 = findValue(self.attributes, key),
17644 _findValue4 = (0, _slicedToArray2.default)(_findValue3, 4),
17645 value = _findValue4[0],
17646 actualTarget = _findValue4[1],
17647 actualKey = _findValue4[2],
17648 firstKey = _findValue4[3];
17649
17650 setValue(self.attributes, key, op._estimate(value, self, key));
17651
17652 if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
17653 delete actualTarget[actualKey];
17654 }
17655
17656 self._resetCacheForKey(firstKey);
17657 }
17658 });
17659 },
17660
17661 /**
17662 * Populates attributes by starting with the last known data from the
17663 * server, and applying all of the local changes that have been made since
17664 * then.
17665 * @private
17666 */
17667 _rebuildAllEstimatedData: function _rebuildAllEstimatedData() {
17668 var self = this;
17669
17670 var previousAttributes = _.clone(this.attributes);
17671
17672 this.attributes = _.clone(this._serverData);
17673
17674 AV._arrayEach(this._opSetQueue, function (opSet) {
17675 self._applyOpSet(opSet, self.attributes);
17676
17677 AV._objectEach(opSet, function (op, key) {
17678 self._resetCacheForKey(key);
17679 });
17680 }); // Trigger change events for anything that changed because of the fetch.
17681
17682
17683 AV._objectEach(previousAttributes, function (oldValue, key) {
17684 if (self.attributes[key] !== oldValue) {
17685 self.trigger('change:' + key, self, self.attributes[key], {});
17686 }
17687 });
17688
17689 AV._objectEach(this.attributes, function (newValue, key) {
17690 if (!_.has(previousAttributes, key)) {
17691 self.trigger('change:' + key, self, newValue, {});
17692 }
17693 });
17694 },
17695
17696 /**
17697 * Sets a hash of model attributes on the object, firing
17698 * <code>"change"</code> unless you choose to silence it.
17699 *
17700 * <p>You can call it with an object containing keys and values, or with one
17701 * key and value. For example:</p>
17702 *
17703 * @example
17704 * gameTurn.set({
17705 * player: player1,
17706 * diceRoll: 2
17707 * });
17708 *
17709 * game.set("currentPlayer", player2);
17710 *
17711 * game.set("finished", true);
17712 *
17713 * @param {String} key The key to set.
17714 * @param {Any} value The value to give it.
17715 * @param {Object} [options]
17716 * @param {Boolean} [options.silent]
17717 * @return {AV.Object} self if succeeded, throws if the value is not valid.
17718 * @see AV.Object#validate
17719 */
17720 set: function set(key, value, options) {
17721 var attrs;
17722
17723 if (_.isObject(key) || isNullOrUndefined(key)) {
17724 attrs = _.mapObject(key, function (v, k) {
17725 checkReservedKey(k);
17726 return AV._decode(v, k);
17727 });
17728 options = value;
17729 } else {
17730 attrs = {};
17731 checkReservedKey(key);
17732 attrs[key] = AV._decode(value, key);
17733 } // Extract attributes and options.
17734
17735
17736 options = options || {};
17737
17738 if (!attrs) {
17739 return this;
17740 }
17741
17742 if (attrs instanceof AV.Object) {
17743 attrs = attrs.attributes;
17744 } // If the unset option is used, every attribute should be a Unset.
17745
17746
17747 if (options.unset) {
17748 AV._objectEach(attrs, function (unused_value, key) {
17749 attrs[key] = new AV.Op.Unset();
17750 });
17751 } // Apply all the attributes to get the estimated values.
17752
17753
17754 var dataToValidate = _.clone(attrs);
17755
17756 var self = this;
17757
17758 AV._objectEach(dataToValidate, function (value, key) {
17759 if (value instanceof AV.Op) {
17760 dataToValidate[key] = value._estimate(self.attributes[key], self, key);
17761
17762 if (dataToValidate[key] === AV.Op._UNSET) {
17763 delete dataToValidate[key];
17764 }
17765 }
17766 }); // Run validation.
17767
17768
17769 this._validate(attrs, options);
17770
17771 options.changes = {};
17772 var escaped = this._escapedAttributes; // Update attributes.
17773
17774 AV._arrayEach((0, _keys2.default)(_).call(_, attrs), function (attr) {
17775 var val = attrs[attr]; // If this is a relation object we need to set the parent correctly,
17776 // since the location where it was parsed does not have access to
17777 // this object.
17778
17779 if (val instanceof AV.Relation) {
17780 val.parent = self;
17781 }
17782
17783 if (!(val instanceof AV.Op)) {
17784 val = new AV.Op.Set(val);
17785 } // See if this change will actually have any effect.
17786
17787
17788 var isRealChange = true;
17789
17790 if (val instanceof AV.Op.Set && _.isEqual(self.attributes[attr], val.value)) {
17791 isRealChange = false;
17792 }
17793
17794 if (isRealChange) {
17795 delete escaped[attr];
17796
17797 if (options.silent) {
17798 self._silent[attr] = true;
17799 } else {
17800 options.changes[attr] = true;
17801 }
17802 }
17803
17804 var currentChanges = _.last(self._opSetQueue);
17805
17806 currentChanges[attr] = val._mergeWithPrevious(currentChanges[attr]);
17807
17808 self._rebuildEstimatedDataForKey(attr);
17809
17810 if (isRealChange) {
17811 self.changed[attr] = self.attributes[attr];
17812
17813 if (!options.silent) {
17814 self._pending[attr] = true;
17815 }
17816 } else {
17817 delete self.changed[attr];
17818 delete self._pending[attr];
17819 }
17820 });
17821
17822 if (!options.silent) {
17823 this.change(options);
17824 }
17825
17826 return this;
17827 },
17828
17829 /**
17830 * Remove an attribute from the model, firing <code>"change"</code> unless
17831 * you choose to silence it. This is a noop if the attribute doesn't
17832 * exist.
17833 * @param key {String} The key.
17834 */
17835 unset: function unset(attr, options) {
17836 options = options || {};
17837 options.unset = true;
17838 return this.set(attr, null, options);
17839 },
17840
17841 /**
17842 * Atomically increments the value of the given attribute the next time the
17843 * object is saved. If no amount is specified, 1 is used by default.
17844 *
17845 * @param key {String} The key.
17846 * @param amount {Number} The amount to increment by.
17847 */
17848 increment: function increment(attr, amount) {
17849 if (_.isUndefined(amount) || _.isNull(amount)) {
17850 amount = 1;
17851 }
17852
17853 return this.set(attr, new AV.Op.Increment(amount));
17854 },
17855
17856 /**
17857 * Atomically add an object to the end of the array associated with a given
17858 * key.
17859 * @param key {String} The key.
17860 * @param item {} The item to add.
17861 */
17862 add: function add(attr, item) {
17863 return this.set(attr, new AV.Op.Add(ensureArray(item)));
17864 },
17865
17866 /**
17867 * Atomically add an object to the array associated with a given key, only
17868 * if it is not already present in the array. The position of the insert is
17869 * not guaranteed.
17870 *
17871 * @param key {String} The key.
17872 * @param item {} The object to add.
17873 */
17874 addUnique: function addUnique(attr, item) {
17875 return this.set(attr, new AV.Op.AddUnique(ensureArray(item)));
17876 },
17877
17878 /**
17879 * Atomically remove all instances of an object from the array associated
17880 * with a given key.
17881 *
17882 * @param key {String} The key.
17883 * @param item {} The object to remove.
17884 */
17885 remove: function remove(attr, item) {
17886 return this.set(attr, new AV.Op.Remove(ensureArray(item)));
17887 },
17888
17889 /**
17890 * Atomically apply a "bit and" operation on the value associated with a
17891 * given key.
17892 *
17893 * @param key {String} The key.
17894 * @param value {Number} The value to apply.
17895 */
17896 bitAnd: function bitAnd(attr, value) {
17897 return this.set(attr, new AV.Op.BitAnd(value));
17898 },
17899
17900 /**
17901 * Atomically apply a "bit or" operation on the value associated with a
17902 * given key.
17903 *
17904 * @param key {String} The key.
17905 * @param value {Number} The value to apply.
17906 */
17907 bitOr: function bitOr(attr, value) {
17908 return this.set(attr, new AV.Op.BitOr(value));
17909 },
17910
17911 /**
17912 * Atomically apply a "bit xor" operation on the value associated with a
17913 * given key.
17914 *
17915 * @param key {String} The key.
17916 * @param value {Number} The value to apply.
17917 */
17918 bitXor: function bitXor(attr, value) {
17919 return this.set(attr, new AV.Op.BitXor(value));
17920 },
17921
17922 /**
17923 * Returns an instance of a subclass of AV.Op describing what kind of
17924 * modification has been performed on this field since the last time it was
17925 * saved. For example, after calling object.increment("x"), calling
17926 * object.op("x") would return an instance of AV.Op.Increment.
17927 *
17928 * @param key {String} The key.
17929 * @returns {AV.Op} The operation, or undefined if none.
17930 */
17931 op: function op(attr) {
17932 return _.last(this._opSetQueue)[attr];
17933 },
17934
17935 /**
17936 * Clear all attributes on the model, firing <code>"change"</code> unless
17937 * you choose to silence it.
17938 */
17939 clear: function clear(options) {
17940 options = options || {};
17941 options.unset = true;
17942
17943 var keysToClear = _.extend(this.attributes, this._operations);
17944
17945 return this.set(keysToClear, options);
17946 },
17947
17948 /**
17949 * Clears any (or specific) changes to the model made since the last save.
17950 * @param {string|string[]} [keys] specify keys to revert.
17951 */
17952 revert: function revert(keys) {
17953 var lastOp = _.last(this._opSetQueue);
17954
17955 var _keys = ensureArray(keys || (0, _keys2.default)(_).call(_, lastOp));
17956
17957 _keys.forEach(function (key) {
17958 delete lastOp[key];
17959 });
17960
17961 this._rebuildAllEstimatedData();
17962
17963 return this;
17964 },
17965
17966 /**
17967 * Returns a JSON-encoded set of operations to be sent with the next save
17968 * request.
17969 * @private
17970 */
17971 _getSaveJSON: function _getSaveJSON() {
17972 var json = _.clone(_.first(this._opSetQueue));
17973
17974 AV._objectEach(json, function (op, key) {
17975 json[key] = op.toJSON();
17976 });
17977
17978 return json;
17979 },
17980
17981 /**
17982 * Returns true if this object can be serialized for saving.
17983 * @private
17984 */
17985 _canBeSerialized: function _canBeSerialized() {
17986 return AV.Object._canBeSerializedAsValue(this.attributes);
17987 },
17988
17989 /**
17990 * Fetch the model from the server. If the server's representation of the
17991 * model differs from its current attributes, they will be overriden,
17992 * triggering a <code>"change"</code> event.
17993 * @param {Object} fetchOptions Optional options to set 'keys',
17994 * 'include' and 'includeACL' option.
17995 * @param {AuthOptions} options
17996 * @return {Promise} A promise that is fulfilled when the fetch
17997 * completes.
17998 */
17999 fetch: function fetch() {
18000 var fetchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18001 var options = arguments.length > 1 ? arguments[1] : undefined;
18002
18003 if (!this.id) {
18004 throw new Error('Cannot fetch unsaved object');
18005 }
18006
18007 var self = this;
18008
18009 var request = _request('classes', this.className, this.id, 'GET', transformFetchOptions(fetchOptions), options);
18010
18011 return request.then(function (response) {
18012 var fetchedAttrs = self.parse(response);
18013
18014 self._cleanupUnsetKeys(fetchedAttrs, (0, _keys2.default)(fetchOptions) ? ensureArray((0, _keys2.default)(fetchOptions)).join(',').split(',') : undefined);
18015
18016 self._finishFetch(fetchedAttrs, true);
18017
18018 return self;
18019 });
18020 },
18021 _cleanupUnsetKeys: function _cleanupUnsetKeys(fetchedAttrs) {
18022 var _this2 = this;
18023
18024 var fetchedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _keys2.default)(_).call(_, this._serverData);
18025
18026 _.forEach(fetchedKeys, function (key) {
18027 if (fetchedAttrs[key] === undefined) delete _this2._serverData[key];
18028 });
18029 },
18030
18031 /**
18032 * Set a hash of model attributes, and save the model to the server.
18033 * updatedAt will be updated when the request returns.
18034 * You can either call it as:<pre>
18035 * object.save();</pre>
18036 * or<pre>
18037 * object.save(null, options);</pre>
18038 * or<pre>
18039 * object.save(attrs, options);</pre>
18040 * or<pre>
18041 * object.save(key, value, options);</pre>
18042 *
18043 * @example
18044 * gameTurn.save({
18045 * player: "Jake Cutter",
18046 * diceRoll: 2
18047 * }).then(function(gameTurnAgain) {
18048 * // The save was successful.
18049 * }, function(error) {
18050 * // The save failed. Error is an instance of AVError.
18051 * });
18052 *
18053 * @param {AuthOptions} options AuthOptions plus:
18054 * @param {Boolean} options.fetchWhenSave fetch and update object after save succeeded
18055 * @param {AV.Query} options.query Save object only when it matches the query
18056 * @return {Promise} A promise that is fulfilled when the save
18057 * completes.
18058 * @see AVError
18059 */
18060 save: function save(arg1, arg2, arg3) {
18061 var attrs, current, options;
18062
18063 if (_.isObject(arg1) || isNullOrUndefined(arg1)) {
18064 attrs = arg1;
18065 options = arg2;
18066 } else {
18067 attrs = {};
18068 attrs[arg1] = arg2;
18069 options = arg3;
18070 }
18071
18072 options = _.clone(options) || {};
18073
18074 if (options.wait) {
18075 current = _.clone(this.attributes);
18076 }
18077
18078 var setOptions = _.clone(options) || {};
18079
18080 if (setOptions.wait) {
18081 setOptions.silent = true;
18082 }
18083
18084 if (attrs) {
18085 this.set(attrs, setOptions);
18086 }
18087
18088 var model = this;
18089 var unsavedChildren = [];
18090 var unsavedFiles = [];
18091
18092 AV.Object._findUnsavedChildren(model, unsavedChildren, unsavedFiles);
18093
18094 if (unsavedChildren.length + unsavedFiles.length > 1) {
18095 return AV.Object._deepSaveAsync(this, model, options);
18096 }
18097
18098 this._startSave();
18099
18100 this._saving = (this._saving || 0) + 1;
18101 this._allPreviousSaves = this._allPreviousSaves || _promise.default.resolve();
18102 this._allPreviousSaves = this._allPreviousSaves.catch(function (e) {}).then(function () {
18103 var method = model.id ? 'PUT' : 'POST';
18104
18105 var json = model._getSaveJSON();
18106
18107 var query = {};
18108
18109 if (model._fetchWhenSave || options.fetchWhenSave) {
18110 query['new'] = 'true';
18111 } // user login option
18112
18113
18114 if (options._failOnNotExist) {
18115 query.failOnNotExist = 'true';
18116 }
18117
18118 if (options.query) {
18119 var queryParams;
18120
18121 if (typeof options.query._getParams === 'function') {
18122 queryParams = options.query._getParams();
18123
18124 if (queryParams) {
18125 query.where = queryParams.where;
18126 }
18127 }
18128
18129 if (!query.where) {
18130 var error = new Error('options.query is not an AV.Query');
18131 throw error;
18132 }
18133 }
18134
18135 _.extend(json, model._flags);
18136
18137 var route = 'classes';
18138 var className = model.className;
18139
18140 if (model.className === '_User' && !model.id) {
18141 // Special-case user sign-up.
18142 route = 'users';
18143 className = null;
18144 } //hook makeRequest in options.
18145
18146
18147 var makeRequest = options._makeRequest || _request;
18148 var requestPromise = makeRequest(route, className, model.id, method, json, options, query);
18149 requestPromise = requestPromise.then(function (resp) {
18150 var serverAttrs = model.parse(resp);
18151
18152 if (options.wait) {
18153 serverAttrs = _.extend(attrs || {}, serverAttrs);
18154 }
18155
18156 model._finishSave(serverAttrs);
18157
18158 if (options.wait) {
18159 model.set(current, setOptions);
18160 }
18161
18162 return model;
18163 }, function (error) {
18164 model._cancelSave();
18165
18166 throw error;
18167 });
18168 return requestPromise;
18169 });
18170 return this._allPreviousSaves;
18171 },
18172
18173 /**
18174 * Destroy this model on the server if it was already persisted.
18175 * Optimistically removes the model from its collection, if it has one.
18176 * @param {AuthOptions} options AuthOptions plus:
18177 * @param {Boolean} [options.wait] wait for the server to respond
18178 * before removal.
18179 *
18180 * @return {Promise} A promise that is fulfilled when the destroy
18181 * completes.
18182 */
18183 destroy: function destroy(options) {
18184 options = options || {};
18185 var model = this;
18186
18187 var triggerDestroy = function triggerDestroy() {
18188 model.trigger('destroy', model, model.collection, options);
18189 };
18190
18191 if (!this.id) {
18192 return triggerDestroy();
18193 }
18194
18195 if (!options.wait) {
18196 triggerDestroy();
18197 }
18198
18199 var request = _request('classes', this.className, this.id, 'DELETE', this._flags, options);
18200
18201 return request.then(function () {
18202 if (options.wait) {
18203 triggerDestroy();
18204 }
18205
18206 return model;
18207 });
18208 },
18209
18210 /**
18211 * Converts a response into the hash of attributes to be set on the model.
18212 * @ignore
18213 */
18214 parse: function parse(resp) {
18215 var output = _.clone(resp);
18216
18217 ['createdAt', 'updatedAt'].forEach(function (key) {
18218 if (output[key]) {
18219 output[key] = AV._parseDate(output[key]);
18220 }
18221 });
18222
18223 if (output.createdAt && !output.updatedAt) {
18224 output.updatedAt = output.createdAt;
18225 }
18226
18227 return output;
18228 },
18229
18230 /**
18231 * Creates a new model with identical attributes to this one.
18232 * @return {AV.Object}
18233 */
18234 clone: function clone() {
18235 return new this.constructor(this.attributes);
18236 },
18237
18238 /**
18239 * Returns true if this object has never been saved to AV.
18240 * @return {Boolean}
18241 */
18242 isNew: function isNew() {
18243 return !this.id;
18244 },
18245
18246 /**
18247 * Call this method to manually fire a `"change"` event for this model and
18248 * a `"change:attribute"` event for each changed attribute.
18249 * Calling this will cause all objects observing the model to update.
18250 */
18251 change: function change(options) {
18252 options = options || {};
18253 var changing = this._changing;
18254 this._changing = true; // Silent changes become pending changes.
18255
18256 var self = this;
18257
18258 AV._objectEach(this._silent, function (attr) {
18259 self._pending[attr] = true;
18260 }); // Silent changes are triggered.
18261
18262
18263 var changes = _.extend({}, options.changes, this._silent);
18264
18265 this._silent = {};
18266
18267 AV._objectEach(changes, function (unused_value, attr) {
18268 self.trigger('change:' + attr, self, self.get(attr), options);
18269 });
18270
18271 if (changing) {
18272 return this;
18273 } // This is to get around lint not letting us make a function in a loop.
18274
18275
18276 var deleteChanged = function deleteChanged(value, attr) {
18277 if (!self._pending[attr] && !self._silent[attr]) {
18278 delete self.changed[attr];
18279 }
18280 }; // Continue firing `"change"` events while there are pending changes.
18281
18282
18283 while (!_.isEmpty(this._pending)) {
18284 this._pending = {};
18285 this.trigger('change', this, options); // Pending and silent changes still remain.
18286
18287 AV._objectEach(this.changed, deleteChanged);
18288
18289 self._previousAttributes = _.clone(this.attributes);
18290 }
18291
18292 this._changing = false;
18293 return this;
18294 },
18295
18296 /**
18297 * Gets the previous value of an attribute, recorded at the time the last
18298 * <code>"change"</code> event was fired.
18299 * @param {String} attr Name of the attribute to get.
18300 */
18301 previous: function previous(attr) {
18302 if (!arguments.length || !this._previousAttributes) {
18303 return null;
18304 }
18305
18306 return this._previousAttributes[attr];
18307 },
18308
18309 /**
18310 * Gets all of the attributes of the model at the time of the previous
18311 * <code>"change"</code> event.
18312 * @return {Object}
18313 */
18314 previousAttributes: function previousAttributes() {
18315 return _.clone(this._previousAttributes);
18316 },
18317
18318 /**
18319 * Checks if the model is currently in a valid state. It's only possible to
18320 * get into an *invalid* state if you're using silent changes.
18321 * @return {Boolean}
18322 */
18323 isValid: function isValid() {
18324 try {
18325 this.validate(this.attributes);
18326 } catch (error) {
18327 return false;
18328 }
18329
18330 return true;
18331 },
18332
18333 /**
18334 * You should not call this function directly unless you subclass
18335 * <code>AV.Object</code>, in which case you can override this method
18336 * to provide additional validation on <code>set</code> and
18337 * <code>save</code>. Your implementation should throw an Error if
18338 * the attrs is invalid
18339 *
18340 * @param {Object} attrs The current data to validate.
18341 * @see AV.Object#set
18342 */
18343 validate: function validate(attrs) {
18344 if (_.has(attrs, 'ACL') && !(attrs.ACL instanceof AV.ACL)) {
18345 throw new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
18346 }
18347 },
18348
18349 /**
18350 * Run validation against a set of incoming attributes, returning `true`
18351 * if all is well. If a specific `error` callback has been passed,
18352 * call that instead of firing the general `"error"` event.
18353 * @private
18354 */
18355 _validate: function _validate(attrs, options) {
18356 if (options.silent || !this.validate) {
18357 return;
18358 }
18359
18360 attrs = _.extend({}, this.attributes, attrs);
18361 this.validate(attrs);
18362 },
18363
18364 /**
18365 * Returns the ACL for this object.
18366 * @returns {AV.ACL} An instance of AV.ACL.
18367 * @see AV.Object#get
18368 */
18369 getACL: function getACL() {
18370 return this.get('ACL');
18371 },
18372
18373 /**
18374 * Sets the ACL to be used for this object.
18375 * @param {AV.ACL} acl An instance of AV.ACL.
18376 * @param {Object} options Optional Backbone-like options object to be
18377 * passed in to set.
18378 * @return {AV.Object} self
18379 * @see AV.Object#set
18380 */
18381 setACL: function setACL(acl, options) {
18382 return this.set('ACL', acl, options);
18383 },
18384 disableBeforeHook: function disableBeforeHook() {
18385 this.ignoreHook('beforeSave');
18386 this.ignoreHook('beforeUpdate');
18387 this.ignoreHook('beforeDelete');
18388 },
18389 disableAfterHook: function disableAfterHook() {
18390 this.ignoreHook('afterSave');
18391 this.ignoreHook('afterUpdate');
18392 this.ignoreHook('afterDelete');
18393 },
18394 ignoreHook: function ignoreHook(hookName) {
18395 if (!_.contains(['beforeSave', 'afterSave', 'beforeUpdate', 'afterUpdate', 'beforeDelete', 'afterDelete'], hookName)) {
18396 throw new Error('Unsupported hookName: ' + hookName);
18397 }
18398
18399 if (!AV.hookKey) {
18400 throw new Error('ignoreHook required hookKey');
18401 }
18402
18403 if (!this._flags.__ignore_hooks) {
18404 this._flags.__ignore_hooks = [];
18405 }
18406
18407 this._flags.__ignore_hooks.push(hookName);
18408 }
18409 });
18410 /**
18411 * Creates an instance of a subclass of AV.Object for the give classname
18412 * and id.
18413 * @param {String|Function} class the className or a subclass of AV.Object.
18414 * @param {String} id The object id of this model.
18415 * @return {AV.Object} A new subclass instance of AV.Object.
18416 */
18417
18418
18419 AV.Object.createWithoutData = function (klass, id, hasData) {
18420 var _klass;
18421
18422 if (_.isString(klass)) {
18423 _klass = AV.Object._getSubclass(klass);
18424 } else if (klass.prototype && klass.prototype instanceof AV.Object) {
18425 _klass = klass;
18426 } else {
18427 throw new Error('class must be a string or a subclass of AV.Object.');
18428 }
18429
18430 if (!id) {
18431 throw new TypeError('The objectId must be provided');
18432 }
18433
18434 var object = new _klass();
18435 object.id = id;
18436 object._hasData = hasData;
18437 return object;
18438 };
18439 /**
18440 * Delete objects in batch.
18441 * @param {AV.Object[]} objects The <code>AV.Object</code> array to be deleted.
18442 * @param {AuthOptions} options
18443 * @return {Promise} A promise that is fulfilled when the save
18444 * completes.
18445 */
18446
18447
18448 AV.Object.destroyAll = function (objects) {
18449 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
18450
18451 if (!objects || objects.length === 0) {
18452 return _promise.default.resolve();
18453 }
18454
18455 var objectsByClassNameAndFlags = _.groupBy(objects, function (object) {
18456 return (0, _stringify.default)({
18457 className: object.className,
18458 flags: object._flags
18459 });
18460 });
18461
18462 var body = {
18463 requests: (0, _map.default)(_).call(_, objectsByClassNameAndFlags, function (objects) {
18464 var _context3;
18465
18466 var ids = (0, _map.default)(_).call(_, objects, 'id').join(',');
18467 return {
18468 method: 'DELETE',
18469 path: (0, _concat.default)(_context3 = "/1.1/classes/".concat(objects[0].className, "/")).call(_context3, ids),
18470 body: objects[0]._flags
18471 };
18472 })
18473 };
18474 return _request('batch', null, null, 'POST', body, options).then(function (response) {
18475 var firstError = (0, _find.default)(_).call(_, response, function (result) {
18476 return !result.success;
18477 });
18478 if (firstError) throw new AVError(firstError.error.code, firstError.error.error);
18479 return undefined;
18480 });
18481 };
18482 /**
18483 * Returns the appropriate subclass for making new instances of the given
18484 * className string.
18485 * @private
18486 */
18487
18488
18489 AV.Object._getSubclass = function (className) {
18490 if (!_.isString(className)) {
18491 throw new Error('AV.Object._getSubclass requires a string argument.');
18492 }
18493
18494 var ObjectClass = AV.Object._classMap[className];
18495
18496 if (!ObjectClass) {
18497 ObjectClass = AV.Object.extend(className);
18498 AV.Object._classMap[className] = ObjectClass;
18499 }
18500
18501 return ObjectClass;
18502 };
18503 /**
18504 * Creates an instance of a subclass of AV.Object for the given classname.
18505 * @private
18506 */
18507
18508
18509 AV.Object._create = function (className, attributes, options) {
18510 var ObjectClass = AV.Object._getSubclass(className);
18511
18512 return new ObjectClass(attributes, options);
18513 }; // Set up a map of className to class so that we can create new instances of
18514 // AV Objects from JSON automatically.
18515
18516
18517 AV.Object._classMap = {};
18518 AV.Object._extend = AV._extend;
18519 /**
18520 * Creates a new model with defined attributes,
18521 * It's the same with
18522 * <pre>
18523 * new AV.Object(attributes, options);
18524 * </pre>
18525 * @param {Object} attributes The initial set of data to store in the object.
18526 * @param {Object} options A set of Backbone-like options for creating the
18527 * object. The only option currently supported is "collection".
18528 * @return {AV.Object}
18529 * @since v0.4.4
18530 * @see AV.Object
18531 * @see AV.Object.extend
18532 */
18533
18534 AV.Object['new'] = function (attributes, options) {
18535 return new AV.Object(attributes, options);
18536 };
18537 /**
18538 * Creates a new subclass of AV.Object for the given AV class name.
18539 *
18540 * <p>Every extension of a AV class will inherit from the most recent
18541 * previous extension of that class. When a AV.Object is automatically
18542 * created by parsing JSON, it will use the most recent extension of that
18543 * class.</p>
18544 *
18545 * @example
18546 * var MyClass = AV.Object.extend("MyClass", {
18547 * // Instance properties
18548 * }, {
18549 * // Class properties
18550 * });
18551 *
18552 * @param {String} className The name of the AV class backing this model.
18553 * @param {Object} protoProps Instance properties to add to instances of the
18554 * class returned from this method.
18555 * @param {Object} classProps Class properties to add the class returned from
18556 * this method.
18557 * @return {Class} A new subclass of AV.Object.
18558 */
18559
18560
18561 AV.Object.extend = function (className, protoProps, classProps) {
18562 // Handle the case with only two args.
18563 if (!_.isString(className)) {
18564 if (className && _.has(className, 'className')) {
18565 return AV.Object.extend(className.className, className, protoProps);
18566 } else {
18567 throw new Error("AV.Object.extend's first argument should be the className.");
18568 }
18569 } // If someone tries to subclass "User", coerce it to the right type.
18570
18571
18572 if (className === 'User') {
18573 className = '_User';
18574 }
18575
18576 var NewClassObject = null;
18577
18578 if (_.has(AV.Object._classMap, className)) {
18579 var OldClassObject = AV.Object._classMap[className]; // This new subclass has been told to extend both from "this" and from
18580 // OldClassObject. This is multiple inheritance, which isn't supported.
18581 // For now, let's just pick one.
18582
18583 if (protoProps || classProps) {
18584 NewClassObject = OldClassObject._extend(protoProps, classProps);
18585 } else {
18586 return OldClassObject;
18587 }
18588 } else {
18589 protoProps = protoProps || {};
18590 protoProps._className = className;
18591 NewClassObject = this._extend(protoProps, classProps);
18592 } // Extending a subclass should reuse the classname automatically.
18593
18594
18595 NewClassObject.extend = function (arg0) {
18596 var _context4;
18597
18598 if (_.isString(arg0) || arg0 && _.has(arg0, 'className')) {
18599 return AV.Object.extend.apply(NewClassObject, arguments);
18600 }
18601
18602 var newArguments = (0, _concat.default)(_context4 = [className]).call(_context4, _.toArray(arguments));
18603 return AV.Object.extend.apply(NewClassObject, newArguments);
18604 }; // Add the query property descriptor.
18605
18606
18607 (0, _defineProperty.default)(NewClassObject, 'query', (0, _getOwnPropertyDescriptor.default)(AV.Object, 'query'));
18608
18609 NewClassObject['new'] = function (attributes, options) {
18610 return new NewClassObject(attributes, options);
18611 };
18612
18613 AV.Object._classMap[className] = NewClassObject;
18614 return NewClassObject;
18615 }; // ES6 class syntax support
18616
18617
18618 (0, _defineProperty.default)(AV.Object.prototype, 'className', {
18619 get: function get() {
18620 var className = this._className || this.constructor._LCClassName || this.constructor.name; // If someone tries to subclass "User", coerce it to the right type.
18621
18622 if (className === 'User') {
18623 return '_User';
18624 }
18625
18626 return className;
18627 }
18628 });
18629 /**
18630 * Register a class.
18631 * If a subclass of <code>AV.Object</code> is defined with your own implement
18632 * rather then <code>AV.Object.extend</code>, the subclass must be registered.
18633 * @param {Function} klass A subclass of <code>AV.Object</code>
18634 * @param {String} [name] Specify the name of the class. Useful when the class might be uglified.
18635 * @example
18636 * class Person extend AV.Object {}
18637 * AV.Object.register(Person);
18638 */
18639
18640 AV.Object.register = function (klass, name) {
18641 if (!(klass.prototype instanceof AV.Object)) {
18642 throw new Error('registered class is not a subclass of AV.Object');
18643 }
18644
18645 var className = name || klass.name;
18646
18647 if (!className.length) {
18648 throw new Error('registered class must be named');
18649 }
18650
18651 if (name) {
18652 klass._LCClassName = name;
18653 }
18654
18655 AV.Object._classMap[className] = klass;
18656 };
18657 /**
18658 * Get a new Query of the current class
18659 * @name query
18660 * @memberof AV.Object
18661 * @type AV.Query
18662 * @readonly
18663 * @since v3.1.0
18664 * @example
18665 * const Post = AV.Object.extend('Post');
18666 * Post.query.equalTo('author', 'leancloud').find().then();
18667 */
18668
18669
18670 (0, _defineProperty.default)(AV.Object, 'query', {
18671 get: function get() {
18672 return new AV.Query(this.prototype.className);
18673 }
18674 });
18675
18676 AV.Object._findUnsavedChildren = function (objects, children, files) {
18677 AV._traverse(objects, function (object) {
18678 if (object instanceof AV.Object) {
18679 if (object.dirty()) {
18680 children.push(object);
18681 }
18682
18683 return;
18684 }
18685
18686 if (object instanceof AV.File) {
18687 if (!object.id) {
18688 files.push(object);
18689 }
18690
18691 return;
18692 }
18693 });
18694 };
18695
18696 AV.Object._canBeSerializedAsValue = function (object) {
18697 var canBeSerializedAsValue = true;
18698
18699 if (object instanceof AV.Object || object instanceof AV.File) {
18700 canBeSerializedAsValue = !!object.id;
18701 } else if (_.isArray(object)) {
18702 AV._arrayEach(object, function (child) {
18703 if (!AV.Object._canBeSerializedAsValue(child)) {
18704 canBeSerializedAsValue = false;
18705 }
18706 });
18707 } else if (_.isObject(object)) {
18708 AV._objectEach(object, function (child) {
18709 if (!AV.Object._canBeSerializedAsValue(child)) {
18710 canBeSerializedAsValue = false;
18711 }
18712 });
18713 }
18714
18715 return canBeSerializedAsValue;
18716 };
18717
18718 AV.Object._deepSaveAsync = function (object, model, options) {
18719 var unsavedChildren = [];
18720 var unsavedFiles = [];
18721
18722 AV.Object._findUnsavedChildren(object, unsavedChildren, unsavedFiles);
18723
18724 unsavedFiles = _.uniq(unsavedFiles);
18725
18726 var promise = _promise.default.resolve();
18727
18728 _.each(unsavedFiles, function (file) {
18729 promise = promise.then(function () {
18730 return file.save();
18731 });
18732 });
18733
18734 var objects = _.uniq(unsavedChildren);
18735
18736 var remaining = _.uniq(objects);
18737
18738 return promise.then(function () {
18739 return continueWhile(function () {
18740 return remaining.length > 0;
18741 }, function () {
18742 // Gather up all the objects that can be saved in this batch.
18743 var batch = [];
18744 var newRemaining = [];
18745
18746 AV._arrayEach(remaining, function (object) {
18747 if (object._canBeSerialized()) {
18748 batch.push(object);
18749 } else {
18750 newRemaining.push(object);
18751 }
18752 });
18753
18754 remaining = newRemaining; // If we can't save any objects, there must be a circular reference.
18755
18756 if (batch.length === 0) {
18757 return _promise.default.reject(new AVError(AVError.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
18758 } // Reserve a spot in every object's save queue.
18759
18760
18761 var readyToStart = _promise.default.resolve((0, _map.default)(_).call(_, batch, function (object) {
18762 return object._allPreviousSaves || _promise.default.resolve();
18763 })); // Save a single batch, whether previous saves succeeded or failed.
18764
18765
18766 var bathSavePromise = readyToStart.then(function () {
18767 return _request('batch', null, null, 'POST', {
18768 requests: (0, _map.default)(_).call(_, batch, function (object) {
18769 var method = object.id ? 'PUT' : 'POST';
18770
18771 var json = object._getSaveJSON();
18772
18773 _.extend(json, object._flags);
18774
18775 var route = 'classes';
18776 var className = object.className;
18777 var path = "/".concat(route, "/").concat(className);
18778
18779 if (object.className === '_User' && !object.id) {
18780 // Special-case user sign-up.
18781 path = '/users';
18782 }
18783
18784 var path = "/1.1".concat(path);
18785
18786 if (object.id) {
18787 path = path + '/' + object.id;
18788 }
18789
18790 object._startSave();
18791
18792 return {
18793 method: method,
18794 path: path,
18795 body: json,
18796 params: options && options.fetchWhenSave ? {
18797 fetchWhenSave: true
18798 } : undefined
18799 };
18800 })
18801 }, options).then(function (response) {
18802 var results = (0, _map.default)(_).call(_, batch, function (object, i) {
18803 if (response[i].success) {
18804 object._finishSave(object.parse(response[i].success));
18805
18806 return object;
18807 }
18808
18809 object._cancelSave();
18810
18811 return new AVError(response[i].error.code, response[i].error.error);
18812 });
18813 return handleBatchResults(results);
18814 });
18815 });
18816
18817 AV._arrayEach(batch, function (object) {
18818 object._allPreviousSaves = bathSavePromise;
18819 });
18820
18821 return bathSavePromise;
18822 });
18823 }).then(function () {
18824 return object;
18825 });
18826 };
18827};
18828
18829/***/ }),
18830/* 501 */
18831/***/ (function(module, exports, __webpack_require__) {
18832
18833var arrayWithHoles = __webpack_require__(502);
18834
18835var iterableToArrayLimit = __webpack_require__(510);
18836
18837var unsupportedIterableToArray = __webpack_require__(511);
18838
18839var nonIterableRest = __webpack_require__(521);
18840
18841function _slicedToArray(arr, i) {
18842 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
18843}
18844
18845module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
18846
18847/***/ }),
18848/* 502 */
18849/***/ (function(module, exports, __webpack_require__) {
18850
18851var _Array$isArray = __webpack_require__(503);
18852
18853function _arrayWithHoles(arr) {
18854 if (_Array$isArray(arr)) return arr;
18855}
18856
18857module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
18858
18859/***/ }),
18860/* 503 */
18861/***/ (function(module, exports, __webpack_require__) {
18862
18863module.exports = __webpack_require__(504);
18864
18865/***/ }),
18866/* 504 */
18867/***/ (function(module, exports, __webpack_require__) {
18868
18869module.exports = __webpack_require__(505);
18870
18871
18872/***/ }),
18873/* 505 */
18874/***/ (function(module, exports, __webpack_require__) {
18875
18876var parent = __webpack_require__(506);
18877
18878module.exports = parent;
18879
18880
18881/***/ }),
18882/* 506 */
18883/***/ (function(module, exports, __webpack_require__) {
18884
18885var parent = __webpack_require__(507);
18886
18887module.exports = parent;
18888
18889
18890/***/ }),
18891/* 507 */
18892/***/ (function(module, exports, __webpack_require__) {
18893
18894var parent = __webpack_require__(508);
18895
18896module.exports = parent;
18897
18898
18899/***/ }),
18900/* 508 */
18901/***/ (function(module, exports, __webpack_require__) {
18902
18903__webpack_require__(509);
18904var path = __webpack_require__(13);
18905
18906module.exports = path.Array.isArray;
18907
18908
18909/***/ }),
18910/* 509 */
18911/***/ (function(module, exports, __webpack_require__) {
18912
18913var $ = __webpack_require__(0);
18914var isArray = __webpack_require__(80);
18915
18916// `Array.isArray` method
18917// https://tc39.es/ecma262/#sec-array.isarray
18918$({ target: 'Array', stat: true }, {
18919 isArray: isArray
18920});
18921
18922
18923/***/ }),
18924/* 510 */
18925/***/ (function(module, exports, __webpack_require__) {
18926
18927var _Symbol = __webpack_require__(225);
18928
18929var _getIteratorMethod = __webpack_require__(231);
18930
18931function _iterableToArrayLimit(arr, i) {
18932 var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"];
18933
18934 if (_i == null) return;
18935 var _arr = [];
18936 var _n = true;
18937 var _d = false;
18938
18939 var _s, _e;
18940
18941 try {
18942 for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
18943 _arr.push(_s.value);
18944
18945 if (i && _arr.length === i) break;
18946 }
18947 } catch (err) {
18948 _d = true;
18949 _e = err;
18950 } finally {
18951 try {
18952 if (!_n && _i["return"] != null) _i["return"]();
18953 } finally {
18954 if (_d) throw _e;
18955 }
18956 }
18957
18958 return _arr;
18959}
18960
18961module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
18962
18963/***/ }),
18964/* 511 */
18965/***/ (function(module, exports, __webpack_require__) {
18966
18967var _sliceInstanceProperty = __webpack_require__(512);
18968
18969var _Array$from = __webpack_require__(516);
18970
18971var arrayLikeToArray = __webpack_require__(520);
18972
18973function _unsupportedIterableToArray(o, minLen) {
18974 var _context;
18975
18976 if (!o) return;
18977 if (typeof o === "string") return arrayLikeToArray(o, minLen);
18978
18979 var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
18980
18981 if (n === "Object" && o.constructor) n = o.constructor.name;
18982 if (n === "Map" || n === "Set") return _Array$from(o);
18983 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
18984}
18985
18986module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
18987
18988/***/ }),
18989/* 512 */
18990/***/ (function(module, exports, __webpack_require__) {
18991
18992module.exports = __webpack_require__(513);
18993
18994/***/ }),
18995/* 513 */
18996/***/ (function(module, exports, __webpack_require__) {
18997
18998module.exports = __webpack_require__(514);
18999
19000
19001/***/ }),
19002/* 514 */
19003/***/ (function(module, exports, __webpack_require__) {
19004
19005var parent = __webpack_require__(515);
19006
19007module.exports = parent;
19008
19009
19010/***/ }),
19011/* 515 */
19012/***/ (function(module, exports, __webpack_require__) {
19013
19014var parent = __webpack_require__(222);
19015
19016module.exports = parent;
19017
19018
19019/***/ }),
19020/* 516 */
19021/***/ (function(module, exports, __webpack_require__) {
19022
19023module.exports = __webpack_require__(517);
19024
19025/***/ }),
19026/* 517 */
19027/***/ (function(module, exports, __webpack_require__) {
19028
19029module.exports = __webpack_require__(518);
19030
19031
19032/***/ }),
19033/* 518 */
19034/***/ (function(module, exports, __webpack_require__) {
19035
19036var parent = __webpack_require__(519);
19037
19038module.exports = parent;
19039
19040
19041/***/ }),
19042/* 519 */
19043/***/ (function(module, exports, __webpack_require__) {
19044
19045var parent = __webpack_require__(230);
19046
19047module.exports = parent;
19048
19049
19050/***/ }),
19051/* 520 */
19052/***/ (function(module, exports) {
19053
19054function _arrayLikeToArray(arr, len) {
19055 if (len == null || len > arr.length) len = arr.length;
19056
19057 for (var i = 0, arr2 = new Array(len); i < len; i++) {
19058 arr2[i] = arr[i];
19059 }
19060
19061 return arr2;
19062}
19063
19064module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
19065
19066/***/ }),
19067/* 521 */
19068/***/ (function(module, exports) {
19069
19070function _nonIterableRest() {
19071 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
19072}
19073
19074module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
19075
19076/***/ }),
19077/* 522 */
19078/***/ (function(module, exports, __webpack_require__) {
19079
19080module.exports = __webpack_require__(523);
19081
19082/***/ }),
19083/* 523 */
19084/***/ (function(module, exports, __webpack_require__) {
19085
19086var parent = __webpack_require__(524);
19087
19088module.exports = parent;
19089
19090
19091/***/ }),
19092/* 524 */
19093/***/ (function(module, exports, __webpack_require__) {
19094
19095__webpack_require__(525);
19096var path = __webpack_require__(13);
19097
19098var Object = path.Object;
19099
19100var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
19101 return Object.getOwnPropertyDescriptor(it, key);
19102};
19103
19104if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
19105
19106
19107/***/ }),
19108/* 525 */
19109/***/ (function(module, exports, __webpack_require__) {
19110
19111var $ = __webpack_require__(0);
19112var fails = __webpack_require__(4);
19113var toIndexedObject = __webpack_require__(33);
19114var nativeGetOwnPropertyDescriptor = __webpack_require__(64).f;
19115var DESCRIPTORS = __webpack_require__(19);
19116
19117var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
19118var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
19119
19120// `Object.getOwnPropertyDescriptor` method
19121// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
19122$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
19123 getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
19124 return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
19125 }
19126});
19127
19128
19129/***/ }),
19130/* 526 */
19131/***/ (function(module, exports, __webpack_require__) {
19132
19133"use strict";
19134
19135
19136var _ = __webpack_require__(1);
19137
19138var AVError = __webpack_require__(40);
19139
19140module.exports = function (AV) {
19141 AV.Role = AV.Object.extend('_Role',
19142 /** @lends AV.Role.prototype */
19143 {
19144 // Instance Methods
19145
19146 /**
19147 * Represents a Role on the AV server. Roles represent groupings of
19148 * Users for the purposes of granting permissions (e.g. specifying an ACL
19149 * for an Object). Roles are specified by their sets of child users and
19150 * child roles, all of which are granted any permissions that the parent
19151 * role has.
19152 *
19153 * <p>Roles must have a name (which cannot be changed after creation of the
19154 * role), and must specify an ACL.</p>
19155 * An AV.Role is a local representation of a role persisted to the AV
19156 * cloud.
19157 * @class AV.Role
19158 * @param {String} name The name of the Role to create.
19159 * @param {AV.ACL} acl The ACL for this role.
19160 */
19161 constructor: function constructor(name, acl) {
19162 if (_.isString(name)) {
19163 AV.Object.prototype.constructor.call(this, null, null);
19164 this.setName(name);
19165 } else {
19166 AV.Object.prototype.constructor.call(this, name, acl);
19167 }
19168
19169 if (acl) {
19170 if (!(acl instanceof AV.ACL)) {
19171 throw new TypeError('acl must be an instance of AV.ACL');
19172 } else {
19173 this.setACL(acl);
19174 }
19175 }
19176 },
19177
19178 /**
19179 * Gets the name of the role. You can alternatively call role.get("name")
19180 *
19181 * @return {String} the name of the role.
19182 */
19183 getName: function getName() {
19184 return this.get('name');
19185 },
19186
19187 /**
19188 * Sets the name for a role. This value must be set before the role has
19189 * been saved to the server, and cannot be set once the role has been
19190 * saved.
19191 *
19192 * <p>
19193 * A role's name can only contain alphanumeric characters, _, -, and
19194 * spaces.
19195 * </p>
19196 *
19197 * <p>This is equivalent to calling role.set("name", name)</p>
19198 *
19199 * @param {String} name The name of the role.
19200 */
19201 setName: function setName(name, options) {
19202 return this.set('name', name, options);
19203 },
19204
19205 /**
19206 * Gets the AV.Relation for the AV.Users that are direct
19207 * children of this role. These users are granted any privileges that this
19208 * role has been granted (e.g. read or write access through ACLs). You can
19209 * add or remove users from the role through this relation.
19210 *
19211 * <p>This is equivalent to calling role.relation("users")</p>
19212 *
19213 * @return {AV.Relation} the relation for the users belonging to this
19214 * role.
19215 */
19216 getUsers: function getUsers() {
19217 return this.relation('users');
19218 },
19219
19220 /**
19221 * Gets the AV.Relation for the AV.Roles that are direct
19222 * children of this role. These roles' users are granted any privileges that
19223 * this role has been granted (e.g. read or write access through ACLs). You
19224 * can add or remove child roles from this role through this relation.
19225 *
19226 * <p>This is equivalent to calling role.relation("roles")</p>
19227 *
19228 * @return {AV.Relation} the relation for the roles belonging to this
19229 * role.
19230 */
19231 getRoles: function getRoles() {
19232 return this.relation('roles');
19233 },
19234
19235 /**
19236 * @ignore
19237 */
19238 validate: function validate(attrs, options) {
19239 if ('name' in attrs && attrs.name !== this.getName()) {
19240 var newName = attrs.name;
19241
19242 if (this.id && this.id !== attrs.objectId) {
19243 // Check to see if the objectId being set matches this.id.
19244 // This happens during a fetch -- the id is set before calling fetch.
19245 // Let the name be set in this case.
19246 return new AVError(AVError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
19247 }
19248
19249 if (!_.isString(newName)) {
19250 return new AVError(AVError.OTHER_CAUSE, "A role's name must be a String.");
19251 }
19252
19253 if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
19254 return new AVError(AVError.OTHER_CAUSE, "A role's name can only contain alphanumeric characters, _," + ' -, and spaces.');
19255 }
19256 }
19257
19258 if (AV.Object.prototype.validate) {
19259 return AV.Object.prototype.validate.call(this, attrs, options);
19260 }
19261
19262 return false;
19263 }
19264 });
19265};
19266
19267/***/ }),
19268/* 527 */
19269/***/ (function(module, exports, __webpack_require__) {
19270
19271"use strict";
19272
19273
19274var _interopRequireDefault = __webpack_require__(2);
19275
19276var _defineProperty2 = _interopRequireDefault(__webpack_require__(528));
19277
19278var _promise = _interopRequireDefault(__webpack_require__(10));
19279
19280var _map = _interopRequireDefault(__webpack_require__(39));
19281
19282var _find = _interopRequireDefault(__webpack_require__(104));
19283
19284var _stringify = _interopRequireDefault(__webpack_require__(34));
19285
19286var _ = __webpack_require__(1);
19287
19288var uuid = __webpack_require__(214);
19289
19290var AVError = __webpack_require__(40);
19291
19292var _require = __webpack_require__(25),
19293 AVRequest = _require._request,
19294 request = _require.request;
19295
19296var _require2 = __webpack_require__(61),
19297 getAdapter = _require2.getAdapter;
19298
19299var PLATFORM_ANONYMOUS = 'anonymous';
19300var PLATFORM_QQAPP = 'lc_qqapp';
19301
19302var mergeUnionDataIntoAuthData = function mergeUnionDataIntoAuthData() {
19303 var defaultUnionIdPlatform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'weixin';
19304 return function (authData, unionId) {
19305 var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
19306 _ref$unionIdPlatform = _ref.unionIdPlatform,
19307 unionIdPlatform = _ref$unionIdPlatform === void 0 ? defaultUnionIdPlatform : _ref$unionIdPlatform,
19308 _ref$asMainAccount = _ref.asMainAccount,
19309 asMainAccount = _ref$asMainAccount === void 0 ? false : _ref$asMainAccount;
19310
19311 if (typeof unionId !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionId is not a string');
19312 if (typeof unionIdPlatform !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionIdPlatform is not a string');
19313 return _.extend({}, authData, {
19314 platform: unionIdPlatform,
19315 unionid: unionId,
19316 main_account: Boolean(asMainAccount)
19317 });
19318 };
19319};
19320
19321module.exports = function (AV) {
19322 /**
19323 * @class
19324 *
19325 * <p>An AV.User object is a local representation of a user persisted to the
19326 * LeanCloud server. This class is a subclass of an AV.Object, and retains the
19327 * same functionality of an AV.Object, but also extends it with various
19328 * user specific methods, like authentication, signing up, and validation of
19329 * uniqueness.</p>
19330 */
19331 AV.User = AV.Object.extend('_User',
19332 /** @lends AV.User.prototype */
19333 {
19334 // Instance Variables
19335 _isCurrentUser: false,
19336 // Instance Methods
19337
19338 /**
19339 * Internal method to handle special fields in a _User response.
19340 * @private
19341 */
19342 _mergeMagicFields: function _mergeMagicFields(attrs) {
19343 if (attrs.sessionToken) {
19344 this._sessionToken = attrs.sessionToken;
19345 delete attrs.sessionToken;
19346 }
19347
19348 return AV.User.__super__._mergeMagicFields.call(this, attrs);
19349 },
19350
19351 /**
19352 * Removes null values from authData (which exist temporarily for
19353 * unlinking)
19354 * @private
19355 */
19356 _cleanupAuthData: function _cleanupAuthData() {
19357 if (!this.isCurrent()) {
19358 return;
19359 }
19360
19361 var authData = this.get('authData');
19362
19363 if (!authData) {
19364 return;
19365 }
19366
19367 AV._objectEach(this.get('authData'), function (value, key) {
19368 if (!authData[key]) {
19369 delete authData[key];
19370 }
19371 });
19372 },
19373
19374 /**
19375 * Synchronizes authData for all providers.
19376 * @private
19377 */
19378 _synchronizeAllAuthData: function _synchronizeAllAuthData() {
19379 var authData = this.get('authData');
19380
19381 if (!authData) {
19382 return;
19383 }
19384
19385 var self = this;
19386
19387 AV._objectEach(this.get('authData'), function (value, key) {
19388 self._synchronizeAuthData(key);
19389 });
19390 },
19391
19392 /**
19393 * Synchronizes auth data for a provider (e.g. puts the access token in the
19394 * right place to be used by the Facebook SDK).
19395 * @private
19396 */
19397 _synchronizeAuthData: function _synchronizeAuthData(provider) {
19398 if (!this.isCurrent()) {
19399 return;
19400 }
19401
19402 var authType;
19403
19404 if (_.isString(provider)) {
19405 authType = provider;
19406 provider = AV.User._authProviders[authType];
19407 } else {
19408 authType = provider.getAuthType();
19409 }
19410
19411 var authData = this.get('authData');
19412
19413 if (!authData || !provider) {
19414 return;
19415 }
19416
19417 var success = provider.restoreAuthentication(authData[authType]);
19418
19419 if (!success) {
19420 this.dissociateAuthData(provider);
19421 }
19422 },
19423 _handleSaveResult: function _handleSaveResult(makeCurrent) {
19424 // Clean up and synchronize the authData object, removing any unset values
19425 if (makeCurrent && !AV._config.disableCurrentUser) {
19426 this._isCurrentUser = true;
19427 }
19428
19429 this._cleanupAuthData();
19430
19431 this._synchronizeAllAuthData(); // Don't keep the password around.
19432
19433
19434 delete this._serverData.password;
19435
19436 this._rebuildEstimatedDataForKey('password');
19437
19438 this._refreshCache();
19439
19440 if ((makeCurrent || this.isCurrent()) && !AV._config.disableCurrentUser) {
19441 // Some old version of leanengine-node-sdk will overwrite
19442 // AV.User._saveCurrentUser which returns no Promise.
19443 // So we need a Promise wrapper.
19444 return _promise.default.resolve(AV.User._saveCurrentUser(this));
19445 } else {
19446 return _promise.default.resolve();
19447 }
19448 },
19449
19450 /**
19451 * Unlike in the Android/iOS SDKs, logInWith is unnecessary, since you can
19452 * call linkWith on the user (even if it doesn't exist yet on the server).
19453 * @private
19454 */
19455 _linkWith: function _linkWith(provider, data) {
19456 var _this = this;
19457
19458 var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
19459 _ref2$failOnNotExist = _ref2.failOnNotExist,
19460 failOnNotExist = _ref2$failOnNotExist === void 0 ? false : _ref2$failOnNotExist,
19461 useMasterKey = _ref2.useMasterKey,
19462 sessionToken = _ref2.sessionToken,
19463 user = _ref2.user;
19464
19465 var authType;
19466
19467 if (_.isString(provider)) {
19468 authType = provider;
19469 provider = AV.User._authProviders[provider];
19470 } else {
19471 authType = provider.getAuthType();
19472 }
19473
19474 if (data) {
19475 return this.save({
19476 authData: (0, _defineProperty2.default)({}, authType, data)
19477 }, {
19478 useMasterKey: useMasterKey,
19479 sessionToken: sessionToken,
19480 user: user,
19481 fetchWhenSave: !!this.get('authData'),
19482 _failOnNotExist: failOnNotExist
19483 }).then(function (model) {
19484 return model._handleSaveResult(true).then(function () {
19485 return model;
19486 });
19487 });
19488 } else {
19489 return provider.authenticate().then(function (result) {
19490 return _this._linkWith(provider, result);
19491 });
19492 }
19493 },
19494
19495 /**
19496 * Associate the user with a third party authData.
19497 * @since 3.3.0
19498 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
19499 * @param {string} platform Available platform for sign up.
19500 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
19501 * @example user.associateWithAuthData({
19502 * openid: 'abc123',
19503 * access_token: '123abc',
19504 * expires_in: 1382686496
19505 * }, 'weixin').then(function(user) {
19506 * //Access user here
19507 * }).catch(function(error) {
19508 * //console.error("error: ", error);
19509 * });
19510 */
19511 associateWithAuthData: function associateWithAuthData(authData, platform) {
19512 return this._linkWith(platform, authData);
19513 },
19514
19515 /**
19516 * Associate the user with a third party authData and unionId.
19517 * @since 3.5.0
19518 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
19519 * @param {string} platform Available platform for sign up.
19520 * @param {string} unionId
19521 * @param {Object} [unionLoginOptions]
19522 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
19523 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19524 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
19525 * @example user.associateWithAuthDataAndUnionId({
19526 * openid: 'abc123',
19527 * access_token: '123abc',
19528 * expires_in: 1382686496
19529 * }, 'weixin', 'union123', {
19530 * unionIdPlatform: 'weixin',
19531 * asMainAccount: true,
19532 * }).then(function(user) {
19533 * //Access user here
19534 * }).catch(function(error) {
19535 * //console.error("error: ", error);
19536 * });
19537 */
19538 associateWithAuthDataAndUnionId: function associateWithAuthDataAndUnionId(authData, platform, unionId, unionOptions) {
19539 return this._linkWith(platform, mergeUnionDataIntoAuthData()(authData, unionId, unionOptions));
19540 },
19541
19542 /**
19543 * Associate the user with the identity of the current mini-app.
19544 * @since 4.6.0
19545 * @param {Object} [authInfo]
19546 * @param {Object} [option]
19547 * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
19548 * @return {Promise<AV.User>}
19549 */
19550 associateWithMiniApp: function associateWithMiniApp(authInfo, option) {
19551 var _this2 = this;
19552
19553 if (authInfo === undefined) {
19554 var getAuthInfo = getAdapter('getAuthInfo');
19555 return getAuthInfo().then(function (authInfo) {
19556 return _this2._linkWith(authInfo.provider, authInfo.authData, option);
19557 });
19558 }
19559
19560 return this._linkWith(authInfo.provider, authInfo.authData, option);
19561 },
19562
19563 /**
19564 * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的微信帐号。
19565 * 仅在 QQ 小程序中可用。
19566 *
19567 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19568 * @since 4.2.0
19569 * @param {Object} [options]
19570 * @param {boolean} [options.preferUnionId = false] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
19571 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
19572 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19573 * @return {Promise<AV.User>}
19574 */
19575 associateWithQQApp: function associateWithQQApp() {
19576 var _this3 = this;
19577
19578 var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19579 _ref3$preferUnionId = _ref3.preferUnionId,
19580 preferUnionId = _ref3$preferUnionId === void 0 ? false : _ref3$preferUnionId,
19581 _ref3$unionIdPlatform = _ref3.unionIdPlatform,
19582 unionIdPlatform = _ref3$unionIdPlatform === void 0 ? 'qq' : _ref3$unionIdPlatform,
19583 _ref3$asMainAccount = _ref3.asMainAccount,
19584 asMainAccount = _ref3$asMainAccount === void 0 ? true : _ref3$asMainAccount;
19585
19586 var getAuthInfo = getAdapter('getAuthInfo');
19587 return getAuthInfo({
19588 preferUnionId: preferUnionId,
19589 asMainAccount: asMainAccount,
19590 platform: unionIdPlatform
19591 }).then(function (authInfo) {
19592 authInfo.provider = PLATFORM_QQAPP;
19593 return _this3.associateWithMiniApp(authInfo);
19594 });
19595 },
19596
19597 /**
19598 * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
19599 * 仅在微信小程序中可用。
19600 *
19601 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19602 * @since 3.13.0
19603 * @param {Object} [options]
19604 * @param {boolean} [options.preferUnionId = false] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否将 UnionId 保存在用户账号中。
19605 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
19606 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19607 * @return {Promise<AV.User>}
19608 */
19609 associateWithWeapp: function associateWithWeapp() {
19610 var _this4 = this;
19611
19612 var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19613 _ref4$preferUnionId = _ref4.preferUnionId,
19614 preferUnionId = _ref4$preferUnionId === void 0 ? false : _ref4$preferUnionId,
19615 _ref4$unionIdPlatform = _ref4.unionIdPlatform,
19616 unionIdPlatform = _ref4$unionIdPlatform === void 0 ? 'weixin' : _ref4$unionIdPlatform,
19617 _ref4$asMainAccount = _ref4.asMainAccount,
19618 asMainAccount = _ref4$asMainAccount === void 0 ? true : _ref4$asMainAccount;
19619
19620 var getAuthInfo = getAdapter('getAuthInfo');
19621 return getAuthInfo({
19622 preferUnionId: preferUnionId,
19623 asMainAccount: asMainAccount,
19624 platform: unionIdPlatform
19625 }).then(function (authInfo) {
19626 return _this4.associateWithMiniApp(authInfo);
19627 });
19628 },
19629
19630 /**
19631 * @deprecated renamed to {@link AV.User#associateWithWeapp}
19632 * @return {Promise<AV.User>}
19633 */
19634 linkWithWeapp: function linkWithWeapp(options) {
19635 console.warn('DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替');
19636 return this.associateWithWeapp(options);
19637 },
19638
19639 /**
19640 * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的 QQ 帐号。
19641 * 仅在 QQ 小程序中可用。
19642 *
19643 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19644 * @since 4.2.0
19645 * @param {string} unionId
19646 * @param {Object} [unionOptions]
19647 * @param {string} [unionOptions.unionIdPlatform = 'qq'] unionId platform
19648 * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19649 * @return {Promise<AV.User>}
19650 */
19651 associateWithQQAppWithUnionId: function associateWithQQAppWithUnionId(unionId) {
19652 var _this5 = this;
19653
19654 var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19655 _ref5$unionIdPlatform = _ref5.unionIdPlatform,
19656 unionIdPlatform = _ref5$unionIdPlatform === void 0 ? 'qq' : _ref5$unionIdPlatform,
19657 _ref5$asMainAccount = _ref5.asMainAccount,
19658 asMainAccount = _ref5$asMainAccount === void 0 ? false : _ref5$asMainAccount;
19659
19660 var getAuthInfo = getAdapter('getAuthInfo');
19661 return getAuthInfo({
19662 platform: unionIdPlatform
19663 }).then(function (authInfo) {
19664 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19665 asMainAccount: asMainAccount
19666 });
19667 authInfo.provider = PLATFORM_QQAPP;
19668 return _this5.associateWithMiniApp(authInfo);
19669 });
19670 },
19671
19672 /**
19673 * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
19674 * 仅在微信小程序中可用。
19675 *
19676 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19677 * @since 3.13.0
19678 * @param {string} unionId
19679 * @param {Object} [unionOptions]
19680 * @param {string} [unionOptions.unionIdPlatform = 'weixin'] unionId platform
19681 * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19682 * @return {Promise<AV.User>}
19683 */
19684 associateWithWeappWithUnionId: function associateWithWeappWithUnionId(unionId) {
19685 var _this6 = this;
19686
19687 var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19688 _ref6$unionIdPlatform = _ref6.unionIdPlatform,
19689 unionIdPlatform = _ref6$unionIdPlatform === void 0 ? 'weixin' : _ref6$unionIdPlatform,
19690 _ref6$asMainAccount = _ref6.asMainAccount,
19691 asMainAccount = _ref6$asMainAccount === void 0 ? false : _ref6$asMainAccount;
19692
19693 var getAuthInfo = getAdapter('getAuthInfo');
19694 return getAuthInfo({
19695 platform: unionIdPlatform
19696 }).then(function (authInfo) {
19697 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19698 asMainAccount: asMainAccount
19699 });
19700 return _this6.associateWithMiniApp(authInfo);
19701 });
19702 },
19703
19704 /**
19705 * Unlinks a user from a service.
19706 * @param {string} platform
19707 * @return {Promise<AV.User>}
19708 * @since 3.3.0
19709 */
19710 dissociateAuthData: function dissociateAuthData(provider) {
19711 this.unset("authData.".concat(provider));
19712 return this.save().then(function (model) {
19713 return model._handleSaveResult(true).then(function () {
19714 return model;
19715 });
19716 });
19717 },
19718
19719 /**
19720 * @private
19721 * @deprecated
19722 */
19723 _unlinkFrom: function _unlinkFrom(provider) {
19724 console.warn('DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替');
19725 return this.dissociateAuthData(provider);
19726 },
19727
19728 /**
19729 * Checks whether a user is linked to a service.
19730 * @private
19731 */
19732 _isLinked: function _isLinked(provider) {
19733 var authType;
19734
19735 if (_.isString(provider)) {
19736 authType = provider;
19737 } else {
19738 authType = provider.getAuthType();
19739 }
19740
19741 var authData = this.get('authData') || {};
19742 return !!authData[authType];
19743 },
19744
19745 /**
19746 * Checks whether a user is anonymous.
19747 * @since 3.9.0
19748 * @return {boolean}
19749 */
19750 isAnonymous: function isAnonymous() {
19751 return this._isLinked(PLATFORM_ANONYMOUS);
19752 },
19753 logOut: function logOut() {
19754 this._logOutWithAll();
19755
19756 this._isCurrentUser = false;
19757 },
19758
19759 /**
19760 * Deauthenticates all providers.
19761 * @private
19762 */
19763 _logOutWithAll: function _logOutWithAll() {
19764 var authData = this.get('authData');
19765
19766 if (!authData) {
19767 return;
19768 }
19769
19770 var self = this;
19771
19772 AV._objectEach(this.get('authData'), function (value, key) {
19773 self._logOutWith(key);
19774 });
19775 },
19776
19777 /**
19778 * Deauthenticates a single provider (e.g. removing access tokens from the
19779 * Facebook SDK).
19780 * @private
19781 */
19782 _logOutWith: function _logOutWith(provider) {
19783 if (!this.isCurrent()) {
19784 return;
19785 }
19786
19787 if (_.isString(provider)) {
19788 provider = AV.User._authProviders[provider];
19789 }
19790
19791 if (provider && provider.deauthenticate) {
19792 provider.deauthenticate();
19793 }
19794 },
19795
19796 /**
19797 * Signs up a new user. You should call this instead of save for
19798 * new AV.Users. This will create a new AV.User on the server, and
19799 * also persist the session on disk so that you can access the user using
19800 * <code>current</code>.
19801 *
19802 * <p>A username and password must be set before calling signUp.</p>
19803 *
19804 * @param {Object} attrs Extra fields to set on the new user, or null.
19805 * @param {AuthOptions} options
19806 * @return {Promise} A promise that is fulfilled when the signup
19807 * finishes.
19808 * @see AV.User.signUp
19809 */
19810 signUp: function signUp(attrs, options) {
19811 var error;
19812 var username = attrs && attrs.username || this.get('username');
19813
19814 if (!username || username === '') {
19815 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty name.');
19816 throw error;
19817 }
19818
19819 var password = attrs && attrs.password || this.get('password');
19820
19821 if (!password || password === '') {
19822 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty password.');
19823 throw error;
19824 }
19825
19826 return this.save(attrs, options).then(function (model) {
19827 if (model.isAnonymous()) {
19828 model.unset("authData.".concat(PLATFORM_ANONYMOUS));
19829 model._opSetQueue = [{}];
19830 }
19831
19832 return model._handleSaveResult(true).then(function () {
19833 return model;
19834 });
19835 });
19836 },
19837
19838 /**
19839 * Signs up a new user with mobile phone and sms code.
19840 * You should call this instead of save for
19841 * new AV.Users. This will create a new AV.User on the server, and
19842 * also persist the session on disk so that you can access the user using
19843 * <code>current</code>.
19844 *
19845 * <p>A username and password must be set before calling signUp.</p>
19846 *
19847 * @param {Object} attrs Extra fields to set on the new user, or null.
19848 * @param {AuthOptions} options
19849 * @return {Promise} A promise that is fulfilled when the signup
19850 * finishes.
19851 * @see AV.User.signUpOrlogInWithMobilePhone
19852 * @see AV.Cloud.requestSmsCode
19853 */
19854 signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(attrs) {
19855 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
19856 var error;
19857 var mobilePhoneNumber = attrs && attrs.mobilePhoneNumber || this.get('mobilePhoneNumber');
19858
19859 if (!mobilePhoneNumber || mobilePhoneNumber === '') {
19860 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty mobilePhoneNumber.');
19861 throw error;
19862 }
19863
19864 var smsCode = attrs && attrs.smsCode || this.get('smsCode');
19865
19866 if (!smsCode || smsCode === '') {
19867 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty smsCode.');
19868 throw error;
19869 }
19870
19871 options._makeRequest = function (route, className, id, method, json) {
19872 return AVRequest('usersByMobilePhone', null, null, 'POST', json);
19873 };
19874
19875 return this.save(attrs, options).then(function (model) {
19876 delete model.attributes.smsCode;
19877 delete model._serverData.smsCode;
19878 return model._handleSaveResult(true).then(function () {
19879 return model;
19880 });
19881 });
19882 },
19883
19884 /**
19885 * The same with {@link AV.User.loginWithAuthData}, except that you can set attributes before login.
19886 * @since 3.7.0
19887 */
19888 loginWithAuthData: function loginWithAuthData(authData, platform, options) {
19889 return this._linkWith(platform, authData, options);
19890 },
19891
19892 /**
19893 * The same with {@link AV.User.loginWithAuthDataAndUnionId}, except that you can set attributes before login.
19894 * @since 3.7.0
19895 */
19896 loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
19897 return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
19898 },
19899
19900 /**
19901 * The same with {@link AV.User.loginWithWeapp}, except that you can set attributes before login.
19902 * @deprecated please use {@link AV.User#loginWithMiniApp}
19903 * @since 3.7.0
19904 * @param {Object} [options]
19905 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
19906 * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
19907 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
19908 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19909 * @return {Promise<AV.User>}
19910 */
19911 loginWithWeapp: function loginWithWeapp() {
19912 var _this7 = this;
19913
19914 var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19915 _ref7$preferUnionId = _ref7.preferUnionId,
19916 preferUnionId = _ref7$preferUnionId === void 0 ? false : _ref7$preferUnionId,
19917 _ref7$unionIdPlatform = _ref7.unionIdPlatform,
19918 unionIdPlatform = _ref7$unionIdPlatform === void 0 ? 'weixin' : _ref7$unionIdPlatform,
19919 _ref7$asMainAccount = _ref7.asMainAccount,
19920 asMainAccount = _ref7$asMainAccount === void 0 ? true : _ref7$asMainAccount,
19921 _ref7$failOnNotExist = _ref7.failOnNotExist,
19922 failOnNotExist = _ref7$failOnNotExist === void 0 ? false : _ref7$failOnNotExist,
19923 useMasterKey = _ref7.useMasterKey,
19924 sessionToken = _ref7.sessionToken,
19925 user = _ref7.user;
19926
19927 var getAuthInfo = getAdapter('getAuthInfo');
19928 return getAuthInfo({
19929 preferUnionId: preferUnionId,
19930 asMainAccount: asMainAccount,
19931 platform: unionIdPlatform
19932 }).then(function (authInfo) {
19933 return _this7.loginWithMiniApp(authInfo, {
19934 failOnNotExist: failOnNotExist,
19935 useMasterKey: useMasterKey,
19936 sessionToken: sessionToken,
19937 user: user
19938 });
19939 });
19940 },
19941
19942 /**
19943 * The same with {@link AV.User.loginWithWeappWithUnionId}, except that you can set attributes before login.
19944 * @deprecated please use {@link AV.User#loginWithMiniApp}
19945 * @since 3.13.0
19946 */
19947 loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
19948 var _this8 = this;
19949
19950 var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19951 _ref8$unionIdPlatform = _ref8.unionIdPlatform,
19952 unionIdPlatform = _ref8$unionIdPlatform === void 0 ? 'weixin' : _ref8$unionIdPlatform,
19953 _ref8$asMainAccount = _ref8.asMainAccount,
19954 asMainAccount = _ref8$asMainAccount === void 0 ? false : _ref8$asMainAccount,
19955 _ref8$failOnNotExist = _ref8.failOnNotExist,
19956 failOnNotExist = _ref8$failOnNotExist === void 0 ? false : _ref8$failOnNotExist,
19957 useMasterKey = _ref8.useMasterKey,
19958 sessionToken = _ref8.sessionToken,
19959 user = _ref8.user;
19960
19961 var getAuthInfo = getAdapter('getAuthInfo');
19962 return getAuthInfo({
19963 platform: unionIdPlatform
19964 }).then(function (authInfo) {
19965 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19966 asMainAccount: asMainAccount
19967 });
19968 return _this8.loginWithMiniApp(authInfo, {
19969 failOnNotExist: failOnNotExist,
19970 useMasterKey: useMasterKey,
19971 sessionToken: sessionToken,
19972 user: user
19973 });
19974 });
19975 },
19976
19977 /**
19978 * The same with {@link AV.User.loginWithQQApp}, except that you can set attributes before login.
19979 * @deprecated please use {@link AV.User#loginWithMiniApp}
19980 * @since 4.2.0
19981 * @param {Object} [options]
19982 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
19983 * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
19984 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
19985 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19986 */
19987 loginWithQQApp: function loginWithQQApp() {
19988 var _this9 = this;
19989
19990 var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19991 _ref9$preferUnionId = _ref9.preferUnionId,
19992 preferUnionId = _ref9$preferUnionId === void 0 ? false : _ref9$preferUnionId,
19993 _ref9$unionIdPlatform = _ref9.unionIdPlatform,
19994 unionIdPlatform = _ref9$unionIdPlatform === void 0 ? 'qq' : _ref9$unionIdPlatform,
19995 _ref9$asMainAccount = _ref9.asMainAccount,
19996 asMainAccount = _ref9$asMainAccount === void 0 ? true : _ref9$asMainAccount,
19997 _ref9$failOnNotExist = _ref9.failOnNotExist,
19998 failOnNotExist = _ref9$failOnNotExist === void 0 ? false : _ref9$failOnNotExist,
19999 useMasterKey = _ref9.useMasterKey,
20000 sessionToken = _ref9.sessionToken,
20001 user = _ref9.user;
20002
20003 var getAuthInfo = getAdapter('getAuthInfo');
20004 return getAuthInfo({
20005 preferUnionId: preferUnionId,
20006 asMainAccount: asMainAccount,
20007 platform: unionIdPlatform
20008 }).then(function (authInfo) {
20009 authInfo.provider = PLATFORM_QQAPP;
20010 return _this9.loginWithMiniApp(authInfo, {
20011 failOnNotExist: failOnNotExist,
20012 useMasterKey: useMasterKey,
20013 sessionToken: sessionToken,
20014 user: user
20015 });
20016 });
20017 },
20018
20019 /**
20020 * The same with {@link AV.User.loginWithQQAppWithUnionId}, except that you can set attributes before login.
20021 * @deprecated please use {@link AV.User#loginWithMiniApp}
20022 * @since 4.2.0
20023 */
20024 loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
20025 var _this10 = this;
20026
20027 var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20028 _ref10$unionIdPlatfor = _ref10.unionIdPlatform,
20029 unionIdPlatform = _ref10$unionIdPlatfor === void 0 ? 'qq' : _ref10$unionIdPlatfor,
20030 _ref10$asMainAccount = _ref10.asMainAccount,
20031 asMainAccount = _ref10$asMainAccount === void 0 ? false : _ref10$asMainAccount,
20032 _ref10$failOnNotExist = _ref10.failOnNotExist,
20033 failOnNotExist = _ref10$failOnNotExist === void 0 ? false : _ref10$failOnNotExist,
20034 useMasterKey = _ref10.useMasterKey,
20035 sessionToken = _ref10.sessionToken,
20036 user = _ref10.user;
20037
20038 var getAuthInfo = getAdapter('getAuthInfo');
20039 return getAuthInfo({
20040 platform: unionIdPlatform
20041 }).then(function (authInfo) {
20042 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20043 asMainAccount: asMainAccount
20044 });
20045 authInfo.provider = PLATFORM_QQAPP;
20046 return _this10.loginWithMiniApp(authInfo, {
20047 failOnNotExist: failOnNotExist,
20048 useMasterKey: useMasterKey,
20049 sessionToken: sessionToken,
20050 user: user
20051 });
20052 });
20053 },
20054
20055 /**
20056 * The same with {@link AV.User.loginWithMiniApp}, except that you can set attributes before login.
20057 * @since 4.6.0
20058 */
20059 loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
20060 var _this11 = this;
20061
20062 if (authInfo === undefined) {
20063 var getAuthInfo = getAdapter('getAuthInfo');
20064 return getAuthInfo().then(function (authInfo) {
20065 return _this11.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20066 });
20067 }
20068
20069 return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20070 },
20071
20072 /**
20073 * Logs in a AV.User. On success, this saves the session to localStorage,
20074 * so you can retrieve the currently logged in user using
20075 * <code>current</code>.
20076 *
20077 * <p>A username and password must be set before calling logIn.</p>
20078 *
20079 * @see AV.User.logIn
20080 * @return {Promise} A promise that is fulfilled with the user when
20081 * the login is complete.
20082 */
20083 logIn: function logIn() {
20084 var model = this;
20085 var request = AVRequest('login', null, null, 'POST', this.toJSON());
20086 return request.then(function (resp) {
20087 var serverAttrs = model.parse(resp);
20088
20089 model._finishFetch(serverAttrs);
20090
20091 return model._handleSaveResult(true).then(function () {
20092 if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
20093 return model;
20094 });
20095 });
20096 },
20097
20098 /**
20099 * @see AV.Object#save
20100 */
20101 save: function save(arg1, arg2, arg3) {
20102 var attrs, options;
20103
20104 if (_.isObject(arg1) || _.isNull(arg1) || _.isUndefined(arg1)) {
20105 attrs = arg1;
20106 options = arg2;
20107 } else {
20108 attrs = {};
20109 attrs[arg1] = arg2;
20110 options = arg3;
20111 }
20112
20113 options = options || {};
20114 return AV.Object.prototype.save.call(this, attrs, options).then(function (model) {
20115 return model._handleSaveResult(false).then(function () {
20116 return model;
20117 });
20118 });
20119 },
20120
20121 /**
20122 * Follow a user
20123 * @since 0.3.0
20124 * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
20125 * @param {AV.User | String} options.user The target user or user's objectId to follow.
20126 * @param {Object} [options.attributes] key-value attributes dictionary to be used as
20127 * conditions of followerQuery/followeeQuery.
20128 * @param {AuthOptions} [authOptions]
20129 */
20130 follow: function follow(options, authOptions) {
20131 if (!this.id) {
20132 throw new Error('Please signin.');
20133 }
20134
20135 var user;
20136 var attributes;
20137
20138 if (options.user) {
20139 user = options.user;
20140 attributes = options.attributes;
20141 } else {
20142 user = options;
20143 }
20144
20145 var userObjectId = _.isString(user) ? user : user.id;
20146
20147 if (!userObjectId) {
20148 throw new Error('Invalid target user.');
20149 }
20150
20151 var route = 'users/' + this.id + '/friendship/' + userObjectId;
20152 var request = AVRequest(route, null, null, 'POST', AV._encode(attributes), authOptions);
20153 return request;
20154 },
20155
20156 /**
20157 * Unfollow a user.
20158 * @since 0.3.0
20159 * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
20160 * @param {AV.User | String} options.user The target user or user's objectId to unfollow.
20161 * @param {AuthOptions} [authOptions]
20162 */
20163 unfollow: function unfollow(options, authOptions) {
20164 if (!this.id) {
20165 throw new Error('Please signin.');
20166 }
20167
20168 var user;
20169
20170 if (options.user) {
20171 user = options.user;
20172 } else {
20173 user = options;
20174 }
20175
20176 var userObjectId = _.isString(user) ? user : user.id;
20177
20178 if (!userObjectId) {
20179 throw new Error('Invalid target user.');
20180 }
20181
20182 var route = 'users/' + this.id + '/friendship/' + userObjectId;
20183 var request = AVRequest(route, null, null, 'DELETE', null, authOptions);
20184 return request;
20185 },
20186
20187 /**
20188 * Get the user's followers and followees.
20189 * @since 4.8.0
20190 * @param {Object} [options]
20191 * @param {Number} [options.skip]
20192 * @param {Number} [options.limit]
20193 * @param {AuthOptions} [authOptions]
20194 */
20195 getFollowersAndFollowees: function getFollowersAndFollowees(options, authOptions) {
20196 if (!this.id) {
20197 throw new Error('Please signin.');
20198 }
20199
20200 return request({
20201 method: 'GET',
20202 path: "/users/".concat(this.id, "/followersAndFollowees"),
20203 query: {
20204 skip: options && options.skip,
20205 limit: options && options.limit,
20206 include: 'follower,followee',
20207 keys: 'follower,followee'
20208 },
20209 authOptions: authOptions
20210 }).then(function (_ref11) {
20211 var followers = _ref11.followers,
20212 followees = _ref11.followees;
20213 return {
20214 followers: (0, _map.default)(followers).call(followers, function (_ref12) {
20215 var follower = _ref12.follower;
20216 return AV._decode(follower);
20217 }),
20218 followees: (0, _map.default)(followees).call(followees, function (_ref13) {
20219 var followee = _ref13.followee;
20220 return AV._decode(followee);
20221 })
20222 };
20223 });
20224 },
20225
20226 /**
20227 *Create a follower query to query the user's followers.
20228 * @since 0.3.0
20229 * @see AV.User#followerQuery
20230 */
20231 followerQuery: function followerQuery() {
20232 return AV.User.followerQuery(this.id);
20233 },
20234
20235 /**
20236 *Create a followee query to query the user's followees.
20237 * @since 0.3.0
20238 * @see AV.User#followeeQuery
20239 */
20240 followeeQuery: function followeeQuery() {
20241 return AV.User.followeeQuery(this.id);
20242 },
20243
20244 /**
20245 * @see AV.Object#fetch
20246 */
20247 fetch: function fetch(fetchOptions, options) {
20248 return AV.Object.prototype.fetch.call(this, fetchOptions, options).then(function (model) {
20249 return model._handleSaveResult(false).then(function () {
20250 return model;
20251 });
20252 });
20253 },
20254
20255 /**
20256 * Update user's new password safely based on old password.
20257 * @param {String} oldPassword the old password.
20258 * @param {String} newPassword the new password.
20259 * @param {AuthOptions} options
20260 */
20261 updatePassword: function updatePassword(oldPassword, newPassword, options) {
20262 var _this12 = this;
20263
20264 var route = 'users/' + this.id + '/updatePassword';
20265 var params = {
20266 old_password: oldPassword,
20267 new_password: newPassword
20268 };
20269 var request = AVRequest(route, null, null, 'PUT', params, options);
20270 return request.then(function (resp) {
20271 _this12._finishFetch(_this12.parse(resp));
20272
20273 return _this12._handleSaveResult(true).then(function () {
20274 return resp;
20275 });
20276 });
20277 },
20278
20279 /**
20280 * Returns true if <code>current</code> would return this user.
20281 * @see AV.User#current
20282 */
20283 isCurrent: function isCurrent() {
20284 return this._isCurrentUser;
20285 },
20286
20287 /**
20288 * Returns get("username").
20289 * @return {String}
20290 * @see AV.Object#get
20291 */
20292 getUsername: function getUsername() {
20293 return this.get('username');
20294 },
20295
20296 /**
20297 * Returns get("mobilePhoneNumber").
20298 * @return {String}
20299 * @see AV.Object#get
20300 */
20301 getMobilePhoneNumber: function getMobilePhoneNumber() {
20302 return this.get('mobilePhoneNumber');
20303 },
20304
20305 /**
20306 * Calls set("mobilePhoneNumber", phoneNumber, options) and returns the result.
20307 * @param {String} mobilePhoneNumber
20308 * @return {Boolean}
20309 * @see AV.Object#set
20310 */
20311 setMobilePhoneNumber: function setMobilePhoneNumber(phone, options) {
20312 return this.set('mobilePhoneNumber', phone, options);
20313 },
20314
20315 /**
20316 * Calls set("username", username, options) and returns the result.
20317 * @param {String} username
20318 * @return {Boolean}
20319 * @see AV.Object#set
20320 */
20321 setUsername: function setUsername(username, options) {
20322 return this.set('username', username, options);
20323 },
20324
20325 /**
20326 * Calls set("password", password, options) and returns the result.
20327 * @param {String} password
20328 * @return {Boolean}
20329 * @see AV.Object#set
20330 */
20331 setPassword: function setPassword(password, options) {
20332 return this.set('password', password, options);
20333 },
20334
20335 /**
20336 * Returns get("email").
20337 * @return {String}
20338 * @see AV.Object#get
20339 */
20340 getEmail: function getEmail() {
20341 return this.get('email');
20342 },
20343
20344 /**
20345 * Calls set("email", email, options) and returns the result.
20346 * @param {String} email
20347 * @param {AuthOptions} options
20348 * @return {Boolean}
20349 * @see AV.Object#set
20350 */
20351 setEmail: function setEmail(email, options) {
20352 return this.set('email', email, options);
20353 },
20354
20355 /**
20356 * Checks whether this user is the current user and has been authenticated.
20357 * @deprecated 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),
20358 * 如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id
20359 * @return (Boolean) whether this user is the current user and is logged in.
20360 */
20361 authenticated: function authenticated() {
20362 console.warn('DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。');
20363 return !!this._sessionToken && !AV._config.disableCurrentUser && AV.User.current() && AV.User.current().id === this.id;
20364 },
20365
20366 /**
20367 * Detects if current sessionToken is valid.
20368 *
20369 * @since 2.0.0
20370 * @return Promise.<Boolean>
20371 */
20372 isAuthenticated: function isAuthenticated() {
20373 var _this13 = this;
20374
20375 return _promise.default.resolve().then(function () {
20376 return !!_this13._sessionToken && AV.User._fetchUserBySessionToken(_this13._sessionToken).then(function () {
20377 return true;
20378 }, function (error) {
20379 if (error.code === 211) {
20380 return false;
20381 }
20382
20383 throw error;
20384 });
20385 });
20386 },
20387
20388 /**
20389 * Get sessionToken of current user.
20390 * @return {String} sessionToken
20391 */
20392 getSessionToken: function getSessionToken() {
20393 return this._sessionToken;
20394 },
20395
20396 /**
20397 * Refresh sessionToken of current user.
20398 * @since 2.1.0
20399 * @param {AuthOptions} [options]
20400 * @return {Promise.<AV.User>} user with refreshed sessionToken
20401 */
20402 refreshSessionToken: function refreshSessionToken(options) {
20403 var _this14 = this;
20404
20405 return AVRequest("users/".concat(this.id, "/refreshSessionToken"), null, null, 'PUT', null, options).then(function (response) {
20406 _this14._finishFetch(response);
20407
20408 return _this14._handleSaveResult(true).then(function () {
20409 return _this14;
20410 });
20411 });
20412 },
20413
20414 /**
20415 * Get this user's Roles.
20416 * @param {AuthOptions} [options]
20417 * @return {Promise.<AV.Role[]>} A promise that is fulfilled with the roles when
20418 * the query is complete.
20419 */
20420 getRoles: function getRoles(options) {
20421 var _context;
20422
20423 return (0, _find.default)(_context = AV.Relation.reverseQuery('_Role', 'users', this)).call(_context, options);
20424 }
20425 },
20426 /** @lends AV.User */
20427 {
20428 // Class Variables
20429 // The currently logged-in user.
20430 _currentUser: null,
20431 // Whether currentUser is known to match the serialized version on disk.
20432 // This is useful for saving a localstorage check if you try to load
20433 // _currentUser frequently while there is none stored.
20434 _currentUserMatchesDisk: false,
20435 // The localStorage key suffix that the current user is stored under.
20436 _CURRENT_USER_KEY: 'currentUser',
20437 // The mapping of auth provider names to actual providers
20438 _authProviders: {},
20439 // Class Methods
20440
20441 /**
20442 * Signs up a new user with a username (or email) and password.
20443 * This will create a new AV.User on the server, and also persist the
20444 * session in localStorage so that you can access the user using
20445 * {@link #current}.
20446 *
20447 * @param {String} username The username (or email) to sign up with.
20448 * @param {String} password The password to sign up with.
20449 * @param {Object} [attrs] Extra fields to set on the new user.
20450 * @param {AuthOptions} [options]
20451 * @return {Promise} A promise that is fulfilled with the user when
20452 * the signup completes.
20453 * @see AV.User#signUp
20454 */
20455 signUp: function signUp(username, password, attrs, options) {
20456 attrs = attrs || {};
20457 attrs.username = username;
20458 attrs.password = password;
20459
20460 var user = AV.Object._create('_User');
20461
20462 return user.signUp(attrs, options);
20463 },
20464
20465 /**
20466 * Logs in a user with a username (or email) and password. On success, this
20467 * saves the session to disk, so you can retrieve the currently logged in
20468 * user using <code>current</code>.
20469 *
20470 * @param {String} username The username (or email) to log in with.
20471 * @param {String} password The password to log in with.
20472 * @return {Promise} A promise that is fulfilled with the user when
20473 * the login completes.
20474 * @see AV.User#logIn
20475 */
20476 logIn: function logIn(username, password) {
20477 var user = AV.Object._create('_User');
20478
20479 user._finishFetch({
20480 username: username,
20481 password: password
20482 });
20483
20484 return user.logIn();
20485 },
20486
20487 /**
20488 * Logs in a user with a session token. On success, this saves the session
20489 * to disk, so you can retrieve the currently logged in user using
20490 * <code>current</code>.
20491 *
20492 * @param {String} sessionToken The sessionToken to log in with.
20493 * @return {Promise} A promise that is fulfilled with the user when
20494 * the login completes.
20495 */
20496 become: function become(sessionToken) {
20497 return this._fetchUserBySessionToken(sessionToken).then(function (user) {
20498 return user._handleSaveResult(true).then(function () {
20499 return user;
20500 });
20501 });
20502 },
20503 _fetchUserBySessionToken: function _fetchUserBySessionToken(sessionToken) {
20504 if (sessionToken === undefined) {
20505 return _promise.default.reject(new Error('The sessionToken cannot be undefined'));
20506 }
20507
20508 var user = AV.Object._create('_User');
20509
20510 return request({
20511 method: 'GET',
20512 path: '/users/me',
20513 authOptions: {
20514 sessionToken: sessionToken
20515 }
20516 }).then(function (resp) {
20517 var serverAttrs = user.parse(resp);
20518
20519 user._finishFetch(serverAttrs);
20520
20521 return user;
20522 });
20523 },
20524
20525 /**
20526 * Logs in a user with a mobile phone number and sms code sent by
20527 * AV.User.requestLoginSmsCode.On success, this
20528 * saves the session to disk, so you can retrieve the currently logged in
20529 * user using <code>current</code>.
20530 *
20531 * @param {String} mobilePhone The user's mobilePhoneNumber
20532 * @param {String} smsCode The sms code sent by AV.User.requestLoginSmsCode
20533 * @return {Promise} A promise that is fulfilled with the user when
20534 * the login completes.
20535 * @see AV.User#logIn
20536 */
20537 logInWithMobilePhoneSmsCode: function logInWithMobilePhoneSmsCode(mobilePhone, smsCode) {
20538 var user = AV.Object._create('_User');
20539
20540 user._finishFetch({
20541 mobilePhoneNumber: mobilePhone,
20542 smsCode: smsCode
20543 });
20544
20545 return user.logIn();
20546 },
20547
20548 /**
20549 * Signs up or logs in a user with a mobilePhoneNumber and smsCode.
20550 * On success, this saves the session to disk, so you can retrieve the currently
20551 * logged in user using <code>current</code>.
20552 *
20553 * @param {String} mobilePhoneNumber The user's mobilePhoneNumber.
20554 * @param {String} smsCode The sms code sent by AV.Cloud.requestSmsCode
20555 * @param {Object} attributes The user's other attributes such as username etc.
20556 * @param {AuthOptions} options
20557 * @return {Promise} A promise that is fulfilled with the user when
20558 * the login completes.
20559 * @see AV.User#signUpOrlogInWithMobilePhone
20560 * @see AV.Cloud.requestSmsCode
20561 */
20562 signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attrs, options) {
20563 attrs = attrs || {};
20564 attrs.mobilePhoneNumber = mobilePhoneNumber;
20565 attrs.smsCode = smsCode;
20566
20567 var user = AV.Object._create('_User');
20568
20569 return user.signUpOrlogInWithMobilePhone(attrs, options);
20570 },
20571
20572 /**
20573 * Logs in a user with a mobile phone number and password. On success, this
20574 * saves the session to disk, so you can retrieve the currently logged in
20575 * user using <code>current</code>.
20576 *
20577 * @param {String} mobilePhone The user's mobilePhoneNumber
20578 * @param {String} password The password to log in with.
20579 * @return {Promise} A promise that is fulfilled with the user when
20580 * the login completes.
20581 * @see AV.User#logIn
20582 */
20583 logInWithMobilePhone: function logInWithMobilePhone(mobilePhone, password) {
20584 var user = AV.Object._create('_User');
20585
20586 user._finishFetch({
20587 mobilePhoneNumber: mobilePhone,
20588 password: password
20589 });
20590
20591 return user.logIn();
20592 },
20593
20594 /**
20595 * Logs in a user with email and password.
20596 *
20597 * @since 3.13.0
20598 * @param {String} email The user's email.
20599 * @param {String} password The password to log in with.
20600 * @return {Promise} A promise that is fulfilled with the user when
20601 * the login completes.
20602 */
20603 loginWithEmail: function loginWithEmail(email, password) {
20604 var user = AV.Object._create('_User');
20605
20606 user._finishFetch({
20607 email: email,
20608 password: password
20609 });
20610
20611 return user.logIn();
20612 },
20613
20614 /**
20615 * Signs up or logs in a user with a third party auth data(AccessToken).
20616 * On success, this saves the session to disk, so you can retrieve the currently
20617 * logged in user using <code>current</code>.
20618 *
20619 * @since 3.7.0
20620 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
20621 * @param {string} platform Available platform for sign up.
20622 * @param {Object} [options]
20623 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20624 * @return {Promise} A promise that is fulfilled with the user when
20625 * the login completes.
20626 * @example AV.User.loginWithAuthData({
20627 * openid: 'abc123',
20628 * access_token: '123abc',
20629 * expires_in: 1382686496
20630 * }, 'weixin').then(function(user) {
20631 * //Access user here
20632 * }).catch(function(error) {
20633 * //console.error("error: ", error);
20634 * });
20635 * @see {@link https://leancloud.cn/docs/js_guide.html#绑定第三方平台账户}
20636 */
20637 loginWithAuthData: function loginWithAuthData(authData, platform, options) {
20638 return AV.User._logInWith(platform, authData, options);
20639 },
20640
20641 /**
20642 * @deprecated renamed to {@link AV.User.loginWithAuthData}
20643 */
20644 signUpOrlogInWithAuthData: function signUpOrlogInWithAuthData() {
20645 console.warn('DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替');
20646 return this.loginWithAuthData.apply(this, arguments);
20647 },
20648
20649 /**
20650 * Signs up or logs in a user with a third party authData and unionId.
20651 * @since 3.7.0
20652 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
20653 * @param {string} platform Available platform for sign up.
20654 * @param {string} unionId
20655 * @param {Object} [unionLoginOptions]
20656 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
20657 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20658 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20659 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
20660 * @example AV.User.loginWithAuthDataAndUnionId({
20661 * openid: 'abc123',
20662 * access_token: '123abc',
20663 * expires_in: 1382686496
20664 * }, 'weixin', 'union123', {
20665 * unionIdPlatform: 'weixin',
20666 * asMainAccount: true,
20667 * }).then(function(user) {
20668 * //Access user here
20669 * }).catch(function(error) {
20670 * //console.error("error: ", error);
20671 * });
20672 */
20673 loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
20674 return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
20675 },
20676
20677 /**
20678 * @deprecated renamed to {@link AV.User.loginWithAuthDataAndUnionId}
20679 * @since 3.5.0
20680 */
20681 signUpOrlogInWithAuthDataAndUnionId: function signUpOrlogInWithAuthDataAndUnionId() {
20682 console.warn('DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替');
20683 return this.loginWithAuthDataAndUnionId.apply(this, arguments);
20684 },
20685
20686 /**
20687 * Merge unionId into authInfo.
20688 * @since 4.6.0
20689 * @param {Object} authInfo
20690 * @param {String} unionId
20691 * @param {Object} [unionIdOption]
20692 * @param {Boolean} [unionIdOption.asMainAccount] If true, the unionId will be associated with the user.
20693 */
20694 mergeUnionId: function mergeUnionId(authInfo, unionId) {
20695 var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
20696 _ref14$asMainAccount = _ref14.asMainAccount,
20697 asMainAccount = _ref14$asMainAccount === void 0 ? false : _ref14$asMainAccount;
20698
20699 authInfo = JSON.parse((0, _stringify.default)(authInfo));
20700 var _authInfo = authInfo,
20701 authData = _authInfo.authData,
20702 platform = _authInfo.platform;
20703 authData.platform = platform;
20704 authData.main_account = asMainAccount;
20705 authData.unionid = unionId;
20706 return authInfo;
20707 },
20708
20709 /**
20710 * 使用当前使用微信小程序的微信用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
20711 * 仅在微信小程序中可用。
20712 *
20713 * @deprecated please use {@link AV.User.loginWithMiniApp}
20714 * @since 2.0.0
20715 * @param {Object} [options]
20716 * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
20717 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
20718 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20719 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
20720 * @return {Promise.<AV.User>}
20721 */
20722 loginWithWeapp: function loginWithWeapp() {
20723 var _this15 = this;
20724
20725 var _ref15 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20726 _ref15$preferUnionId = _ref15.preferUnionId,
20727 preferUnionId = _ref15$preferUnionId === void 0 ? false : _ref15$preferUnionId,
20728 _ref15$unionIdPlatfor = _ref15.unionIdPlatform,
20729 unionIdPlatform = _ref15$unionIdPlatfor === void 0 ? 'weixin' : _ref15$unionIdPlatfor,
20730 _ref15$asMainAccount = _ref15.asMainAccount,
20731 asMainAccount = _ref15$asMainAccount === void 0 ? true : _ref15$asMainAccount,
20732 _ref15$failOnNotExist = _ref15.failOnNotExist,
20733 failOnNotExist = _ref15$failOnNotExist === void 0 ? false : _ref15$failOnNotExist,
20734 useMasterKey = _ref15.useMasterKey,
20735 sessionToken = _ref15.sessionToken,
20736 user = _ref15.user;
20737
20738 var getAuthInfo = getAdapter('getAuthInfo');
20739 return getAuthInfo({
20740 preferUnionId: preferUnionId,
20741 asMainAccount: asMainAccount,
20742 platform: unionIdPlatform
20743 }).then(function (authInfo) {
20744 return _this15.loginWithMiniApp(authInfo, {
20745 failOnNotExist: failOnNotExist,
20746 useMasterKey: useMasterKey,
20747 sessionToken: sessionToken,
20748 user: user
20749 });
20750 });
20751 },
20752
20753 /**
20754 * 使用当前使用微信小程序的微信用户身份注册或登录,
20755 * 仅在微信小程序中可用。
20756 *
20757 * @deprecated please use {@link AV.User.loginWithMiniApp}
20758 * @since 3.13.0
20759 * @param {Object} [unionLoginOptions]
20760 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
20761 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20762 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists. * @return {Promise.<AV.User>}
20763 */
20764 loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
20765 var _this16 = this;
20766
20767 var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20768 _ref16$unionIdPlatfor = _ref16.unionIdPlatform,
20769 unionIdPlatform = _ref16$unionIdPlatfor === void 0 ? 'weixin' : _ref16$unionIdPlatfor,
20770 _ref16$asMainAccount = _ref16.asMainAccount,
20771 asMainAccount = _ref16$asMainAccount === void 0 ? false : _ref16$asMainAccount,
20772 _ref16$failOnNotExist = _ref16.failOnNotExist,
20773 failOnNotExist = _ref16$failOnNotExist === void 0 ? false : _ref16$failOnNotExist,
20774 useMasterKey = _ref16.useMasterKey,
20775 sessionToken = _ref16.sessionToken,
20776 user = _ref16.user;
20777
20778 var getAuthInfo = getAdapter('getAuthInfo');
20779 return getAuthInfo({
20780 platform: unionIdPlatform
20781 }).then(function (authInfo) {
20782 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20783 asMainAccount: asMainAccount
20784 });
20785 return _this16.loginWithMiniApp(authInfo, {
20786 failOnNotExist: failOnNotExist,
20787 useMasterKey: useMasterKey,
20788 sessionToken: sessionToken,
20789 user: user
20790 });
20791 });
20792 },
20793
20794 /**
20795 * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
20796 * 仅在 QQ 小程序中可用。
20797 *
20798 * @deprecated please use {@link AV.User.loginWithMiniApp}
20799 * @since 4.2.0
20800 * @param {Object} [options]
20801 * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
20802 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
20803 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20804 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
20805 * @return {Promise.<AV.User>}
20806 */
20807 loginWithQQApp: function loginWithQQApp() {
20808 var _this17 = this;
20809
20810 var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20811 _ref17$preferUnionId = _ref17.preferUnionId,
20812 preferUnionId = _ref17$preferUnionId === void 0 ? false : _ref17$preferUnionId,
20813 _ref17$unionIdPlatfor = _ref17.unionIdPlatform,
20814 unionIdPlatform = _ref17$unionIdPlatfor === void 0 ? 'qq' : _ref17$unionIdPlatfor,
20815 _ref17$asMainAccount = _ref17.asMainAccount,
20816 asMainAccount = _ref17$asMainAccount === void 0 ? true : _ref17$asMainAccount,
20817 _ref17$failOnNotExist = _ref17.failOnNotExist,
20818 failOnNotExist = _ref17$failOnNotExist === void 0 ? false : _ref17$failOnNotExist,
20819 useMasterKey = _ref17.useMasterKey,
20820 sessionToken = _ref17.sessionToken,
20821 user = _ref17.user;
20822
20823 var getAuthInfo = getAdapter('getAuthInfo');
20824 return getAuthInfo({
20825 preferUnionId: preferUnionId,
20826 asMainAccount: asMainAccount,
20827 platform: unionIdPlatform
20828 }).then(function (authInfo) {
20829 authInfo.provider = PLATFORM_QQAPP;
20830 return _this17.loginWithMiniApp(authInfo, {
20831 failOnNotExist: failOnNotExist,
20832 useMasterKey: useMasterKey,
20833 sessionToken: sessionToken,
20834 user: user
20835 });
20836 });
20837 },
20838
20839 /**
20840 * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,
20841 * 仅在 QQ 小程序中可用。
20842 *
20843 * @deprecated please use {@link AV.User.loginWithMiniApp}
20844 * @since 4.2.0
20845 * @param {Object} [unionLoginOptions]
20846 * @param {string} [unionLoginOptions.unionIdPlatform = 'qq'] unionId platform
20847 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20848 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20849 * @return {Promise.<AV.User>}
20850 */
20851 loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
20852 var _this18 = this;
20853
20854 var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20855 _ref18$unionIdPlatfor = _ref18.unionIdPlatform,
20856 unionIdPlatform = _ref18$unionIdPlatfor === void 0 ? 'qq' : _ref18$unionIdPlatfor,
20857 _ref18$asMainAccount = _ref18.asMainAccount,
20858 asMainAccount = _ref18$asMainAccount === void 0 ? false : _ref18$asMainAccount,
20859 _ref18$failOnNotExist = _ref18.failOnNotExist,
20860 failOnNotExist = _ref18$failOnNotExist === void 0 ? false : _ref18$failOnNotExist,
20861 useMasterKey = _ref18.useMasterKey,
20862 sessionToken = _ref18.sessionToken,
20863 user = _ref18.user;
20864
20865 var getAuthInfo = getAdapter('getAuthInfo');
20866 return getAuthInfo({
20867 platform: unionIdPlatform
20868 }).then(function (authInfo) {
20869 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20870 asMainAccount: asMainAccount
20871 });
20872 authInfo.provider = PLATFORM_QQAPP;
20873 return _this18.loginWithMiniApp(authInfo, {
20874 failOnNotExist: failOnNotExist,
20875 useMasterKey: useMasterKey,
20876 sessionToken: sessionToken,
20877 user: user
20878 });
20879 });
20880 },
20881
20882 /**
20883 * Register or login using the identity of the current mini-app.
20884 * @param {Object} authInfo
20885 * @param {Object} [option]
20886 * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
20887 */
20888 loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
20889 var _this19 = this;
20890
20891 if (authInfo === undefined) {
20892 var getAuthInfo = getAdapter('getAuthInfo');
20893 return getAuthInfo().then(function (authInfo) {
20894 return _this19.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20895 });
20896 }
20897
20898 return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20899 },
20900
20901 /**
20902 * Only use for DI in tests to produce deterministic IDs.
20903 */
20904 _genId: function _genId() {
20905 return uuid();
20906 },
20907
20908 /**
20909 * Creates an anonymous user.
20910 *
20911 * @since 3.9.0
20912 * @return {Promise.<AV.User>}
20913 */
20914 loginAnonymously: function loginAnonymously() {
20915 return this.loginWithAuthData({
20916 id: AV.User._genId()
20917 }, 'anonymous');
20918 },
20919 associateWithAuthData: function associateWithAuthData(userObj, platform, authData) {
20920 console.warn('DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替');
20921 return userObj._linkWith(platform, authData);
20922 },
20923
20924 /**
20925 * Logs out the currently logged in user session. This will remove the
20926 * session from disk, log out of linked services, and future calls to
20927 * <code>current</code> will return <code>null</code>.
20928 * @return {Promise}
20929 */
20930 logOut: function logOut() {
20931 if (AV._config.disableCurrentUser) {
20932 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');
20933 return _promise.default.resolve(null);
20934 }
20935
20936 if (AV.User._currentUser !== null) {
20937 AV.User._currentUser._logOutWithAll();
20938
20939 AV.User._currentUser._isCurrentUser = false;
20940 }
20941
20942 AV.User._currentUserMatchesDisk = true;
20943 AV.User._currentUser = null;
20944 return AV.localStorage.removeItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function () {
20945 return AV._refreshSubscriptionId();
20946 });
20947 },
20948
20949 /**
20950 *Create a follower query for special user to query the user's followers.
20951 * @param {String} userObjectId The user object id.
20952 * @return {AV.FriendShipQuery}
20953 * @since 0.3.0
20954 */
20955 followerQuery: function followerQuery(userObjectId) {
20956 if (!userObjectId || !_.isString(userObjectId)) {
20957 throw new Error('Invalid user object id.');
20958 }
20959
20960 var query = new AV.FriendShipQuery('_Follower');
20961 query._friendshipTag = 'follower';
20962 query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
20963 return query;
20964 },
20965
20966 /**
20967 *Create a followee query for special user to query the user's followees.
20968 * @param {String} userObjectId The user object id.
20969 * @return {AV.FriendShipQuery}
20970 * @since 0.3.0
20971 */
20972 followeeQuery: function followeeQuery(userObjectId) {
20973 if (!userObjectId || !_.isString(userObjectId)) {
20974 throw new Error('Invalid user object id.');
20975 }
20976
20977 var query = new AV.FriendShipQuery('_Followee');
20978 query._friendshipTag = 'followee';
20979 query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
20980 return query;
20981 },
20982
20983 /**
20984 * Requests a password reset email to be sent to the specified email address
20985 * associated with the user account. This email allows the user to securely
20986 * reset their password on the AV site.
20987 *
20988 * @param {String} email The email address associated with the user that
20989 * forgot their password.
20990 * @return {Promise}
20991 */
20992 requestPasswordReset: function requestPasswordReset(email) {
20993 var json = {
20994 email: email
20995 };
20996 var request = AVRequest('requestPasswordReset', null, null, 'POST', json);
20997 return request;
20998 },
20999
21000 /**
21001 * Requests a verify email to be sent to the specified email address
21002 * associated with the user account. This email allows the user to securely
21003 * verify their email address on the AV site.
21004 *
21005 * @param {String} email The email address associated with the user that
21006 * doesn't verify their email address.
21007 * @return {Promise}
21008 */
21009 requestEmailVerify: function requestEmailVerify(email) {
21010 var json = {
21011 email: email
21012 };
21013 var request = AVRequest('requestEmailVerify', null, null, 'POST', json);
21014 return request;
21015 },
21016
21017 /**
21018 * Requests a verify sms code to be sent to the specified mobile phone
21019 * number associated with the user account. This sms code allows the user to
21020 * verify their mobile phone number by calling AV.User.verifyMobilePhone
21021 *
21022 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21023 * user that doesn't verify their mobile phone number.
21024 * @param {SMSAuthOptions} [options]
21025 * @return {Promise}
21026 */
21027 requestMobilePhoneVerify: function requestMobilePhoneVerify(mobilePhoneNumber) {
21028 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21029 var data = {
21030 mobilePhoneNumber: mobilePhoneNumber
21031 };
21032
21033 if (options.validateToken) {
21034 data.validate_token = options.validateToken;
21035 }
21036
21037 var request = AVRequest('requestMobilePhoneVerify', null, null, 'POST', data, options);
21038 return request;
21039 },
21040
21041 /**
21042 * Requests a reset password sms code to be sent to the specified mobile phone
21043 * number associated with the user account. This sms code allows the user to
21044 * reset their account's password by calling AV.User.resetPasswordBySmsCode
21045 *
21046 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21047 * user that doesn't verify their mobile phone number.
21048 * @param {SMSAuthOptions} [options]
21049 * @return {Promise}
21050 */
21051 requestPasswordResetBySmsCode: function requestPasswordResetBySmsCode(mobilePhoneNumber) {
21052 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21053 var data = {
21054 mobilePhoneNumber: mobilePhoneNumber
21055 };
21056
21057 if (options.validateToken) {
21058 data.validate_token = options.validateToken;
21059 }
21060
21061 var request = AVRequest('requestPasswordResetBySmsCode', null, null, 'POST', data, options);
21062 return request;
21063 },
21064
21065 /**
21066 * Requests a change mobile phone number sms code to be sent to the mobilePhoneNumber.
21067 * This sms code allows current user to reset it's mobilePhoneNumber by
21068 * calling {@link AV.User.changePhoneNumber}
21069 * @since 4.7.0
21070 * @param {String} mobilePhoneNumber
21071 * @param {Number} [ttl] ttl of sms code (default is 6 minutes)
21072 * @param {SMSAuthOptions} [options]
21073 * @return {Promise}
21074 */
21075 requestChangePhoneNumber: function requestChangePhoneNumber(mobilePhoneNumber, ttl, options) {
21076 var data = {
21077 mobilePhoneNumber: mobilePhoneNumber
21078 };
21079
21080 if (ttl) {
21081 data.ttl = options.ttl;
21082 }
21083
21084 if (options && options.validateToken) {
21085 data.validate_token = options.validateToken;
21086 }
21087
21088 return AVRequest('requestChangePhoneNumber', null, null, 'POST', data, options);
21089 },
21090
21091 /**
21092 * Makes a call to reset user's account mobilePhoneNumber by sms code.
21093 * The sms code is sent by {@link AV.User.requestChangePhoneNumber}
21094 * @since 4.7.0
21095 * @param {String} mobilePhoneNumber
21096 * @param {String} code The sms code.
21097 * @return {Promise}
21098 */
21099 changePhoneNumber: function changePhoneNumber(mobilePhoneNumber, code) {
21100 var data = {
21101 mobilePhoneNumber: mobilePhoneNumber,
21102 code: code
21103 };
21104 return AVRequest('changePhoneNumber', null, null, 'POST', data);
21105 },
21106
21107 /**
21108 * Makes a call to reset user's account password by sms code and new password.
21109 * The sms code is sent by AV.User.requestPasswordResetBySmsCode.
21110 * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
21111 * @param {String} password The new password.
21112 * @return {Promise} A promise that will be resolved with the result
21113 * of the function.
21114 */
21115 resetPasswordBySmsCode: function resetPasswordBySmsCode(code, password) {
21116 var json = {
21117 password: password
21118 };
21119 var request = AVRequest('resetPasswordBySmsCode', null, code, 'PUT', json);
21120 return request;
21121 },
21122
21123 /**
21124 * Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode
21125 * If verify successfully,the user mobilePhoneVerified attribute will be true.
21126 * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
21127 * @return {Promise} A promise that will be resolved with the result
21128 * of the function.
21129 */
21130 verifyMobilePhone: function verifyMobilePhone(code) {
21131 var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
21132 return request;
21133 },
21134
21135 /**
21136 * Requests a logIn sms code to be sent to the specified mobile phone
21137 * number associated with the user account. This sms code allows the user to
21138 * login by AV.User.logInWithMobilePhoneSmsCode function.
21139 *
21140 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21141 * user that want to login by AV.User.logInWithMobilePhoneSmsCode
21142 * @param {SMSAuthOptions} [options]
21143 * @return {Promise}
21144 */
21145 requestLoginSmsCode: function requestLoginSmsCode(mobilePhoneNumber) {
21146 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21147 var data = {
21148 mobilePhoneNumber: mobilePhoneNumber
21149 };
21150
21151 if (options.validateToken) {
21152 data.validate_token = options.validateToken;
21153 }
21154
21155 var request = AVRequest('requestLoginSmsCode', null, null, 'POST', data, options);
21156 return request;
21157 },
21158
21159 /**
21160 * Retrieves the currently logged in AVUser with a valid session,
21161 * either from memory or localStorage, if necessary.
21162 * @return {Promise.<AV.User>} resolved with the currently logged in AV.User.
21163 */
21164 currentAsync: function currentAsync() {
21165 if (AV._config.disableCurrentUser) {
21166 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');
21167 return _promise.default.resolve(null);
21168 }
21169
21170 if (AV.User._currentUser) {
21171 return _promise.default.resolve(AV.User._currentUser);
21172 }
21173
21174 if (AV.User._currentUserMatchesDisk) {
21175 return _promise.default.resolve(AV.User._currentUser);
21176 }
21177
21178 return AV.localStorage.getItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function (userData) {
21179 if (!userData) {
21180 return null;
21181 } // Load the user from local storage.
21182
21183
21184 AV.User._currentUserMatchesDisk = true;
21185 AV.User._currentUser = AV.Object._create('_User');
21186 AV.User._currentUser._isCurrentUser = true;
21187 var json = JSON.parse(userData);
21188 AV.User._currentUser.id = json._id;
21189 delete json._id;
21190 AV.User._currentUser._sessionToken = json._sessionToken;
21191 delete json._sessionToken;
21192
21193 AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
21194
21195
21196 AV.User._currentUser._synchronizeAllAuthData();
21197
21198 AV.User._currentUser._refreshCache();
21199
21200 AV.User._currentUser._opSetQueue = [{}];
21201 return AV.User._currentUser;
21202 });
21203 },
21204
21205 /**
21206 * Retrieves the currently logged in AVUser with a valid session,
21207 * either from memory or localStorage, if necessary.
21208 * @return {AV.User} The currently logged in AV.User.
21209 */
21210 current: function current() {
21211 if (AV._config.disableCurrentUser) {
21212 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');
21213 return null;
21214 }
21215
21216 if (AV.localStorage.async) {
21217 var error = new Error('Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.');
21218 error.code = 'SYNC_API_NOT_AVAILABLE';
21219 throw error;
21220 }
21221
21222 if (AV.User._currentUser) {
21223 return AV.User._currentUser;
21224 }
21225
21226 if (AV.User._currentUserMatchesDisk) {
21227 return AV.User._currentUser;
21228 } // Load the user from local storage.
21229
21230
21231 AV.User._currentUserMatchesDisk = true;
21232 var userData = AV.localStorage.getItem(AV._getAVPath(AV.User._CURRENT_USER_KEY));
21233
21234 if (!userData) {
21235 return null;
21236 }
21237
21238 AV.User._currentUser = AV.Object._create('_User');
21239 AV.User._currentUser._isCurrentUser = true;
21240 var json = JSON.parse(userData);
21241 AV.User._currentUser.id = json._id;
21242 delete json._id;
21243 AV.User._currentUser._sessionToken = json._sessionToken;
21244 delete json._sessionToken;
21245
21246 AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
21247
21248
21249 AV.User._currentUser._synchronizeAllAuthData();
21250
21251 AV.User._currentUser._refreshCache();
21252
21253 AV.User._currentUser._opSetQueue = [{}];
21254 return AV.User._currentUser;
21255 },
21256
21257 /**
21258 * Persists a user as currentUser to localStorage, and into the singleton.
21259 * @private
21260 */
21261 _saveCurrentUser: function _saveCurrentUser(user) {
21262 var promise;
21263
21264 if (AV.User._currentUser !== user) {
21265 promise = AV.User.logOut();
21266 } else {
21267 promise = _promise.default.resolve();
21268 }
21269
21270 return promise.then(function () {
21271 user._isCurrentUser = true;
21272 AV.User._currentUser = user;
21273
21274 var json = user._toFullJSON();
21275
21276 json._id = user.id;
21277 json._sessionToken = user._sessionToken;
21278 return AV.localStorage.setItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY), (0, _stringify.default)(json)).then(function () {
21279 AV.User._currentUserMatchesDisk = true;
21280 return AV._refreshSubscriptionId();
21281 });
21282 });
21283 },
21284 _registerAuthenticationProvider: function _registerAuthenticationProvider(provider) {
21285 AV.User._authProviders[provider.getAuthType()] = provider; // Synchronize the current user with the auth provider.
21286
21287 if (!AV._config.disableCurrentUser && AV.User.current()) {
21288 AV.User.current()._synchronizeAuthData(provider.getAuthType());
21289 }
21290 },
21291 _logInWith: function _logInWith(provider, authData, options) {
21292 var user = AV.Object._create('_User');
21293
21294 return user._linkWith(provider, authData, options);
21295 }
21296 });
21297};
21298
21299/***/ }),
21300/* 528 */
21301/***/ (function(module, exports, __webpack_require__) {
21302
21303var _Object$defineProperty = __webpack_require__(137);
21304
21305function _defineProperty(obj, key, value) {
21306 if (key in obj) {
21307 _Object$defineProperty(obj, key, {
21308 value: value,
21309 enumerable: true,
21310 configurable: true,
21311 writable: true
21312 });
21313 } else {
21314 obj[key] = value;
21315 }
21316
21317 return obj;
21318}
21319
21320module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
21321
21322/***/ }),
21323/* 529 */
21324/***/ (function(module, exports, __webpack_require__) {
21325
21326"use strict";
21327
21328
21329var _interopRequireDefault = __webpack_require__(2);
21330
21331var _map = _interopRequireDefault(__webpack_require__(39));
21332
21333var _promise = _interopRequireDefault(__webpack_require__(10));
21334
21335var _keys = _interopRequireDefault(__webpack_require__(48));
21336
21337var _stringify = _interopRequireDefault(__webpack_require__(34));
21338
21339var _find = _interopRequireDefault(__webpack_require__(104));
21340
21341var _concat = _interopRequireDefault(__webpack_require__(29));
21342
21343var _ = __webpack_require__(1);
21344
21345var debug = __webpack_require__(60)('leancloud:query');
21346
21347var AVError = __webpack_require__(40);
21348
21349var _require = __webpack_require__(25),
21350 _request = _require._request,
21351 request = _require.request;
21352
21353var _require2 = __webpack_require__(28),
21354 ensureArray = _require2.ensureArray,
21355 transformFetchOptions = _require2.transformFetchOptions,
21356 continueWhile = _require2.continueWhile;
21357
21358var requires = function requires(value, message) {
21359 if (value === undefined) {
21360 throw new Error(message);
21361 }
21362}; // AV.Query is a way to create a list of AV.Objects.
21363
21364
21365module.exports = function (AV) {
21366 /**
21367 * Creates a new AV.Query for the given AV.Object subclass.
21368 * @param {Class|String} objectClass An instance of a subclass of AV.Object, or a AV className string.
21369 * @class
21370 *
21371 * <p>AV.Query defines a query that is used to fetch AV.Objects. The
21372 * most common use case is finding all objects that match a query through the
21373 * <code>find</code> method. For example, this sample code fetches all objects
21374 * of class <code>MyClass</code>. It calls a different function depending on
21375 * whether the fetch succeeded or not.
21376 *
21377 * <pre>
21378 * var query = new AV.Query(MyClass);
21379 * query.find().then(function(results) {
21380 * // results is an array of AV.Object.
21381 * }, function(error) {
21382 * // error is an instance of AVError.
21383 * });</pre></p>
21384 *
21385 * <p>An AV.Query can also be used to retrieve a single object whose id is
21386 * known, through the get method. For example, this sample code fetches an
21387 * object of class <code>MyClass</code> and id <code>myId</code>. It calls a
21388 * different function depending on whether the fetch succeeded or not.
21389 *
21390 * <pre>
21391 * var query = new AV.Query(MyClass);
21392 * query.get(myId).then(function(object) {
21393 * // object is an instance 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 count the number of objects that match
21399 * the query without retrieving all of those objects. For example, this
21400 * sample code counts the number of objects of the class <code>MyClass</code>
21401 * <pre>
21402 * var query = new AV.Query(MyClass);
21403 * query.count().then(function(number) {
21404 * // There are number instances of MyClass.
21405 * }, function(error) {
21406 * // error is an instance of AVError.
21407 * });</pre></p>
21408 */
21409 AV.Query = function (objectClass) {
21410 if (_.isString(objectClass)) {
21411 objectClass = AV.Object._getSubclass(objectClass);
21412 }
21413
21414 this.objectClass = objectClass;
21415 this.className = objectClass.prototype.className;
21416 this._where = {};
21417 this._include = [];
21418 this._select = [];
21419 this._limit = -1; // negative limit means, do not send a limit
21420
21421 this._skip = 0;
21422 this._defaultParams = {};
21423 };
21424 /**
21425 * Constructs a AV.Query that is the OR of the passed in queries. For
21426 * example:
21427 * <pre>var compoundQuery = AV.Query.or(query1, query2, query3);</pre>
21428 *
21429 * will create a compoundQuery that is an or of the query1, query2, and
21430 * query3.
21431 * @param {...AV.Query} var_args The list of queries to OR.
21432 * @return {AV.Query} The query that is the OR of the passed in queries.
21433 */
21434
21435
21436 AV.Query.or = function () {
21437 var queries = _.toArray(arguments);
21438
21439 var className = null;
21440
21441 AV._arrayEach(queries, function (q) {
21442 if (_.isNull(className)) {
21443 className = q.className;
21444 }
21445
21446 if (className !== q.className) {
21447 throw new Error('All queries must be for the same class');
21448 }
21449 });
21450
21451 var query = new AV.Query(className);
21452
21453 query._orQuery(queries);
21454
21455 return query;
21456 };
21457 /**
21458 * Constructs a AV.Query that is the AND of the passed in queries. For
21459 * example:
21460 * <pre>var compoundQuery = AV.Query.and(query1, query2, query3);</pre>
21461 *
21462 * will create a compoundQuery that is an 'and' of the query1, query2, and
21463 * query3.
21464 * @param {...AV.Query} var_args The list of queries to AND.
21465 * @return {AV.Query} The query that is the AND of the passed in queries.
21466 */
21467
21468
21469 AV.Query.and = function () {
21470 var queries = _.toArray(arguments);
21471
21472 var className = null;
21473
21474 AV._arrayEach(queries, function (q) {
21475 if (_.isNull(className)) {
21476 className = q.className;
21477 }
21478
21479 if (className !== q.className) {
21480 throw new Error('All queries must be for the same class');
21481 }
21482 });
21483
21484 var query = new AV.Query(className);
21485
21486 query._andQuery(queries);
21487
21488 return query;
21489 };
21490 /**
21491 * Retrieves a list of AVObjects that satisfy the CQL.
21492 * CQL syntax please see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
21493 *
21494 * @param {String} cql A CQL string, see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
21495 * @param {Array} pvalues An array contains placeholder values.
21496 * @param {AuthOptions} options
21497 * @return {Promise} A promise that is resolved with the results when
21498 * the query completes.
21499 */
21500
21501
21502 AV.Query.doCloudQuery = function (cql, pvalues, options) {
21503 var params = {
21504 cql: cql
21505 };
21506
21507 if (_.isArray(pvalues)) {
21508 params.pvalues = pvalues;
21509 } else {
21510 options = pvalues;
21511 }
21512
21513 var request = _request('cloudQuery', null, null, 'GET', params, options);
21514
21515 return request.then(function (response) {
21516 //query to process results.
21517 var query = new AV.Query(response.className);
21518 var results = (0, _map.default)(_).call(_, response.results, function (json) {
21519 var obj = query._newObject(response);
21520
21521 if (obj._finishFetch) {
21522 obj._finishFetch(query._processResult(json), true);
21523 }
21524
21525 return obj;
21526 });
21527 return {
21528 results: results,
21529 count: response.count,
21530 className: response.className
21531 };
21532 });
21533 };
21534 /**
21535 * Return a query with conditions from json.
21536 * This can be useful to send a query from server side to client side.
21537 * @since 4.0.0
21538 * @param {Object} json from {@link AV.Query#toJSON}
21539 * @return {AV.Query}
21540 */
21541
21542
21543 AV.Query.fromJSON = function (_ref) {
21544 var className = _ref.className,
21545 where = _ref.where,
21546 include = _ref.include,
21547 select = _ref.select,
21548 includeACL = _ref.includeACL,
21549 limit = _ref.limit,
21550 skip = _ref.skip,
21551 order = _ref.order;
21552
21553 if (typeof className !== 'string') {
21554 throw new TypeError('Invalid Query JSON, className must be a String.');
21555 }
21556
21557 var query = new AV.Query(className);
21558
21559 _.extend(query, {
21560 _where: where,
21561 _include: include,
21562 _select: select,
21563 _includeACL: includeACL,
21564 _limit: limit,
21565 _skip: skip,
21566 _order: order
21567 });
21568
21569 return query;
21570 };
21571
21572 AV.Query._extend = AV._extend;
21573
21574 _.extend(AV.Query.prototype,
21575 /** @lends AV.Query.prototype */
21576 {
21577 //hook to iterate result. Added by dennis<xzhuang@avoscloud.com>.
21578 _processResult: function _processResult(obj) {
21579 return obj;
21580 },
21581
21582 /**
21583 * Constructs an AV.Object whose id is already known by fetching data from
21584 * the server.
21585 *
21586 * @param {String} objectId The id of the object to be fetched.
21587 * @param {AuthOptions} options
21588 * @return {Promise.<AV.Object>}
21589 */
21590 get: function get(objectId, options) {
21591 if (!_.isString(objectId)) {
21592 throw new Error('objectId must be a string');
21593 }
21594
21595 if (objectId === '') {
21596 return _promise.default.reject(new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.'));
21597 }
21598
21599 var obj = this._newObject();
21600
21601 obj.id = objectId;
21602
21603 var queryJSON = this._getParams();
21604
21605 var fetchOptions = {};
21606 if ((0, _keys.default)(queryJSON)) fetchOptions.keys = (0, _keys.default)(queryJSON);
21607 if (queryJSON.include) fetchOptions.include = queryJSON.include;
21608 if (queryJSON.includeACL) fetchOptions.includeACL = queryJSON.includeACL;
21609 return _request('classes', this.className, objectId, 'GET', transformFetchOptions(fetchOptions), options).then(function (response) {
21610 if (_.isEmpty(response)) throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
21611
21612 obj._finishFetch(obj.parse(response), true);
21613
21614 return obj;
21615 });
21616 },
21617
21618 /**
21619 * Returns a JSON representation of this query.
21620 * @return {Object}
21621 */
21622 toJSON: function toJSON() {
21623 var className = this.className,
21624 where = this._where,
21625 include = this._include,
21626 select = this._select,
21627 includeACL = this._includeACL,
21628 limit = this._limit,
21629 skip = this._skip,
21630 order = this._order;
21631 return {
21632 className: className,
21633 where: where,
21634 include: include,
21635 select: select,
21636 includeACL: includeACL,
21637 limit: limit,
21638 skip: skip,
21639 order: order
21640 };
21641 },
21642 _getParams: function _getParams() {
21643 var params = _.extend({}, this._defaultParams, {
21644 where: this._where
21645 });
21646
21647 if (this._include.length > 0) {
21648 params.include = this._include.join(',');
21649 }
21650
21651 if (this._select.length > 0) {
21652 params.keys = this._select.join(',');
21653 }
21654
21655 if (this._includeACL !== undefined) {
21656 params.returnACL = this._includeACL;
21657 }
21658
21659 if (this._limit >= 0) {
21660 params.limit = this._limit;
21661 }
21662
21663 if (this._skip > 0) {
21664 params.skip = this._skip;
21665 }
21666
21667 if (this._order !== undefined) {
21668 params.order = this._order;
21669 }
21670
21671 return params;
21672 },
21673 _newObject: function _newObject(response) {
21674 var obj;
21675
21676 if (response && response.className) {
21677 obj = new AV.Object(response.className);
21678 } else {
21679 obj = new this.objectClass();
21680 }
21681
21682 return obj;
21683 },
21684 _createRequest: function _createRequest() {
21685 var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getParams();
21686 var options = arguments.length > 1 ? arguments[1] : undefined;
21687 var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "/classes/".concat(this.className);
21688
21689 if (encodeURIComponent((0, _stringify.default)(params)).length > 2000) {
21690 var body = {
21691 requests: [{
21692 method: 'GET',
21693 path: "/1.1".concat(path),
21694 params: params
21695 }]
21696 };
21697 return request({
21698 path: '/batch',
21699 method: 'POST',
21700 data: body,
21701 authOptions: options
21702 }).then(function (response) {
21703 var result = response[0];
21704
21705 if (result.success) {
21706 return result.success;
21707 }
21708
21709 var error = new AVError(result.error.code, result.error.error || 'Unknown batch error');
21710 throw error;
21711 });
21712 }
21713
21714 return request({
21715 method: 'GET',
21716 path: path,
21717 query: params,
21718 authOptions: options
21719 });
21720 },
21721 _parseResponse: function _parseResponse(response) {
21722 var _this = this;
21723
21724 return (0, _map.default)(_).call(_, response.results, function (json) {
21725 var obj = _this._newObject(response);
21726
21727 if (obj._finishFetch) {
21728 obj._finishFetch(_this._processResult(json), true);
21729 }
21730
21731 return obj;
21732 });
21733 },
21734
21735 /**
21736 * Retrieves a list of AVObjects that satisfy this query.
21737 *
21738 * @param {AuthOptions} options
21739 * @return {Promise} A promise that is resolved with the results when
21740 * the query completes.
21741 */
21742 find: function find(options) {
21743 var request = this._createRequest(undefined, options);
21744
21745 return request.then(this._parseResponse.bind(this));
21746 },
21747
21748 /**
21749 * Retrieves both AVObjects and total count.
21750 *
21751 * @since 4.12.0
21752 * @param {AuthOptions} options
21753 * @return {Promise} A tuple contains results and count.
21754 */
21755 findAndCount: function findAndCount(options) {
21756 var _this2 = this;
21757
21758 var params = this._getParams();
21759
21760 params.count = 1;
21761
21762 var request = this._createRequest(params, options);
21763
21764 return request.then(function (response) {
21765 return [_this2._parseResponse(response), response.count];
21766 });
21767 },
21768
21769 /**
21770 * scan a Query. masterKey required.
21771 *
21772 * @since 2.1.0
21773 * @param {object} [options]
21774 * @param {string} [options.orderedBy] specify the key to sort
21775 * @param {number} [options.batchSize] specify the batch size for each request
21776 * @param {AuthOptions} [authOptions]
21777 * @return {AsyncIterator.<AV.Object>}
21778 * @example const testIterator = {
21779 * [Symbol.asyncIterator]() {
21780 * return new Query('Test').scan(undefined, { useMasterKey: true });
21781 * },
21782 * };
21783 * for await (const test of testIterator) {
21784 * console.log(test.id);
21785 * }
21786 */
21787 scan: function scan() {
21788 var _this3 = this;
21789
21790 var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
21791 orderedBy = _ref2.orderedBy,
21792 batchSize = _ref2.batchSize;
21793
21794 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
21795
21796 var condition = this._getParams();
21797
21798 debug('scan %O', condition);
21799
21800 if (condition.order) {
21801 console.warn('The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan.');
21802 delete condition.order;
21803 }
21804
21805 if (condition.skip) {
21806 console.warn('The skip option of the query is ignored for Query#scan.');
21807 delete condition.skip;
21808 }
21809
21810 if (condition.limit) {
21811 console.warn('The limit option of the query is ignored for Query#scan.');
21812 delete condition.limit;
21813 }
21814
21815 if (orderedBy) condition.scan_key = orderedBy;
21816 if (batchSize) condition.limit = batchSize;
21817 var cursor;
21818 var remainResults = [];
21819 return {
21820 next: function next() {
21821 if (remainResults.length) {
21822 return _promise.default.resolve({
21823 done: false,
21824 value: remainResults.shift()
21825 });
21826 }
21827
21828 if (cursor === null) {
21829 return _promise.default.resolve({
21830 done: true
21831 });
21832 }
21833
21834 return _request('scan/classes', _this3.className, null, 'GET', cursor ? _.extend({}, condition, {
21835 cursor: cursor
21836 }) : condition, authOptions).then(function (response) {
21837 cursor = response.cursor;
21838
21839 if (response.results.length) {
21840 var results = _this3._parseResponse(response);
21841
21842 results.forEach(function (result) {
21843 return remainResults.push(result);
21844 });
21845 }
21846
21847 if (cursor === null && remainResults.length === 0) {
21848 return {
21849 done: true
21850 };
21851 }
21852
21853 return {
21854 done: false,
21855 value: remainResults.shift()
21856 };
21857 });
21858 }
21859 };
21860 },
21861
21862 /**
21863 * Delete objects retrieved by this query.
21864 * @param {AuthOptions} options
21865 * @return {Promise} A promise that is fulfilled when the save
21866 * completes.
21867 */
21868 destroyAll: function destroyAll(options) {
21869 var self = this;
21870 return (0, _find.default)(self).call(self, options).then(function (objects) {
21871 return AV.Object.destroyAll(objects, options);
21872 });
21873 },
21874
21875 /**
21876 * Counts the number of objects that match this query.
21877 *
21878 * @param {AuthOptions} options
21879 * @return {Promise} A promise that is resolved with the count when
21880 * the query completes.
21881 */
21882 count: function count(options) {
21883 var params = this._getParams();
21884
21885 params.limit = 0;
21886 params.count = 1;
21887
21888 var request = this._createRequest(params, options);
21889
21890 return request.then(function (response) {
21891 return response.count;
21892 });
21893 },
21894
21895 /**
21896 * Retrieves at most one AV.Object that satisfies this query.
21897 *
21898 * @param {AuthOptions} options
21899 * @return {Promise} A promise that is resolved with the object when
21900 * the query completes.
21901 */
21902 first: function first(options) {
21903 var self = this;
21904
21905 var params = this._getParams();
21906
21907 params.limit = 1;
21908
21909 var request = this._createRequest(params, options);
21910
21911 return request.then(function (response) {
21912 return (0, _map.default)(_).call(_, response.results, function (json) {
21913 var obj = self._newObject();
21914
21915 if (obj._finishFetch) {
21916 obj._finishFetch(self._processResult(json), true);
21917 }
21918
21919 return obj;
21920 })[0];
21921 });
21922 },
21923
21924 /**
21925 * Sets the number of results to skip before returning any results.
21926 * This is useful for pagination.
21927 * Default is to skip zero results.
21928 * @param {Number} n the number of results to skip.
21929 * @return {AV.Query} Returns the query, so you can chain this call.
21930 */
21931 skip: function skip(n) {
21932 requires(n, 'undefined is not a valid skip value');
21933 this._skip = n;
21934 return this;
21935 },
21936
21937 /**
21938 * Sets the limit of the number of results to return. The default limit is
21939 * 100, with a maximum of 1000 results being returned at a time.
21940 * @param {Number} n the number of results to limit to.
21941 * @return {AV.Query} Returns the query, so you can chain this call.
21942 */
21943 limit: function limit(n) {
21944 requires(n, 'undefined is not a valid limit value');
21945 this._limit = n;
21946 return this;
21947 },
21948
21949 /**
21950 * Add a constraint to the query that requires a particular key's value to
21951 * be equal to the provided value.
21952 * @param {String} key The key to check.
21953 * @param value The value that the AV.Object must contain.
21954 * @return {AV.Query} Returns the query, so you can chain this call.
21955 */
21956 equalTo: function equalTo(key, value) {
21957 requires(key, 'undefined is not a valid key');
21958 requires(value, 'undefined is not a valid value');
21959 this._where[key] = AV._encode(value);
21960 return this;
21961 },
21962
21963 /**
21964 * Helper for condition queries
21965 * @private
21966 */
21967 _addCondition: function _addCondition(key, condition, value) {
21968 requires(key, 'undefined is not a valid condition key');
21969 requires(condition, 'undefined is not a valid condition');
21970 requires(value, 'undefined is not a valid condition value'); // Check if we already have a condition
21971
21972 if (!this._where[key]) {
21973 this._where[key] = {};
21974 }
21975
21976 this._where[key][condition] = AV._encode(value);
21977 return this;
21978 },
21979
21980 /**
21981 * Add a constraint to the query that requires a particular
21982 * <strong>array</strong> key's length to be equal to the provided value.
21983 * @param {String} key The array key to check.
21984 * @param {number} value The length value.
21985 * @return {AV.Query} Returns the query, so you can chain this call.
21986 */
21987 sizeEqualTo: function sizeEqualTo(key, value) {
21988 this._addCondition(key, '$size', value);
21989
21990 return this;
21991 },
21992
21993 /**
21994 * Add a constraint to the query that requires a particular key's value to
21995 * be not equal to the provided value.
21996 * @param {String} key The key to check.
21997 * @param value The value that must not be equalled.
21998 * @return {AV.Query} Returns the query, so you can chain this call.
21999 */
22000 notEqualTo: function notEqualTo(key, value) {
22001 this._addCondition(key, '$ne', 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 less than the provided value.
22009 * @param {String} key The key to check.
22010 * @param value The value that provides an upper bound.
22011 * @return {AV.Query} Returns the query, so you can chain this call.
22012 */
22013 lessThan: function lessThan(key, value) {
22014 this._addCondition(key, '$lt', 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 greater than the provided value.
22022 * @param {String} key The key to check.
22023 * @param value The value that provides an lower bound.
22024 * @return {AV.Query} Returns the query, so you can chain this call.
22025 */
22026 greaterThan: function greaterThan(key, value) {
22027 this._addCondition(key, '$gt', 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 less than or equal to the provided value.
22035 * @param {String} key The key to check.
22036 * @param value The value that provides an upper bound.
22037 * @return {AV.Query} Returns the query, so you can chain this call.
22038 */
22039 lessThanOrEqualTo: function lessThanOrEqualTo(key, value) {
22040 this._addCondition(key, '$lte', 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 greater than or equal to the provided value.
22048 * @param {String} key The key to check.
22049 * @param value The value that provides an lower bound.
22050 * @return {AV.Query} Returns the query, so you can chain this call.
22051 */
22052 greaterThanOrEqualTo: function greaterThanOrEqualTo(key, value) {
22053 this._addCondition(key, '$gte', 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 contained in the provided list of values.
22061 * @param {String} key The key to check.
22062 * @param {Array} values The values that will match.
22063 * @return {AV.Query} Returns the query, so you can chain this call.
22064 */
22065 containedIn: function containedIn(key, values) {
22066 this._addCondition(key, '$in', values);
22067
22068 return this;
22069 },
22070
22071 /**
22072 * Add a constraint to the query that requires a particular key's value to
22073 * not be contained in the provided list of values.
22074 * @param {String} key The key to check.
22075 * @param {Array} values The values that will not match.
22076 * @return {AV.Query} Returns the query, so you can chain this call.
22077 */
22078 notContainedIn: function notContainedIn(key, values) {
22079 this._addCondition(key, '$nin', values);
22080
22081 return this;
22082 },
22083
22084 /**
22085 * Add a constraint to the query that requires a particular key's value to
22086 * contain each one of the provided list of values.
22087 * @param {String} key The key to check. This key's value must be an array.
22088 * @param {Array} values The values that will match.
22089 * @return {AV.Query} Returns the query, so you can chain this call.
22090 */
22091 containsAll: function containsAll(key, values) {
22092 this._addCondition(key, '$all', values);
22093
22094 return this;
22095 },
22096
22097 /**
22098 * Add a constraint for finding objects that contain the given key.
22099 * @param {String} key The key that should exist.
22100 * @return {AV.Query} Returns the query, so you can chain this call.
22101 */
22102 exists: function exists(key) {
22103 this._addCondition(key, '$exists', true);
22104
22105 return this;
22106 },
22107
22108 /**
22109 * Add a constraint for finding objects that do not contain a given key.
22110 * @param {String} key The key that should not exist
22111 * @return {AV.Query} Returns the query, so you can chain this call.
22112 */
22113 doesNotExist: function doesNotExist(key) {
22114 this._addCondition(key, '$exists', false);
22115
22116 return this;
22117 },
22118
22119 /**
22120 * Add a regular expression constraint for finding string values that match
22121 * the provided regular expression.
22122 * This may be slow for large datasets.
22123 * @param {String} key The key that the string to match is stored in.
22124 * @param {RegExp} regex The regular expression pattern to match.
22125 * @return {AV.Query} Returns the query, so you can chain this call.
22126 */
22127 matches: function matches(key, regex, modifiers) {
22128 this._addCondition(key, '$regex', regex);
22129
22130 if (!modifiers) {
22131 modifiers = '';
22132 } // Javascript regex options support mig as inline options but store them
22133 // as properties of the object. We support mi & should migrate them to
22134 // modifiers
22135
22136
22137 if (regex.ignoreCase) {
22138 modifiers += 'i';
22139 }
22140
22141 if (regex.multiline) {
22142 modifiers += 'm';
22143 }
22144
22145 if (modifiers && modifiers.length) {
22146 this._addCondition(key, '$options', modifiers);
22147 }
22148
22149 return this;
22150 },
22151
22152 /**
22153 * Add a constraint that requires that a key's value matches a AV.Query
22154 * constraint.
22155 * @param {String} key The key that the contains the object to match the
22156 * query.
22157 * @param {AV.Query} query The query that should match.
22158 * @return {AV.Query} Returns the query, so you can chain this call.
22159 */
22160 matchesQuery: function matchesQuery(key, query) {
22161 var queryJSON = query._getParams();
22162
22163 queryJSON.className = query.className;
22164
22165 this._addCondition(key, '$inQuery', queryJSON);
22166
22167 return this;
22168 },
22169
22170 /**
22171 * Add a constraint that requires that a key's value not matches a
22172 * AV.Query constraint.
22173 * @param {String} key The key that the contains the object to match the
22174 * query.
22175 * @param {AV.Query} query The query that should not match.
22176 * @return {AV.Query} Returns the query, so you can chain this call.
22177 */
22178 doesNotMatchQuery: function doesNotMatchQuery(key, query) {
22179 var queryJSON = query._getParams();
22180
22181 queryJSON.className = query.className;
22182
22183 this._addCondition(key, '$notInQuery', queryJSON);
22184
22185 return this;
22186 },
22187
22188 /**
22189 * Add a constraint that requires that a key's value matches a value in
22190 * an object returned by a different AV.Query.
22191 * @param {String} key The key that contains the value that is being
22192 * matched.
22193 * @param {String} queryKey The key in the objects returned by the query to
22194 * match against.
22195 * @param {AV.Query} query The query to run.
22196 * @return {AV.Query} Returns the query, so you can chain this call.
22197 */
22198 matchesKeyInQuery: function matchesKeyInQuery(key, queryKey, query) {
22199 var queryJSON = query._getParams();
22200
22201 queryJSON.className = query.className;
22202
22203 this._addCondition(key, '$select', {
22204 key: queryKey,
22205 query: queryJSON
22206 });
22207
22208 return this;
22209 },
22210
22211 /**
22212 * Add a constraint that requires that a key's value not match a value in
22213 * an object returned by a different AV.Query.
22214 * @param {String} key The key that contains the value that is being
22215 * excluded.
22216 * @param {String} queryKey The key in the objects returned by the query to
22217 * match against.
22218 * @param {AV.Query} query The query to run.
22219 * @return {AV.Query} Returns the query, so you can chain this call.
22220 */
22221 doesNotMatchKeyInQuery: function doesNotMatchKeyInQuery(key, queryKey, query) {
22222 var queryJSON = query._getParams();
22223
22224 queryJSON.className = query.className;
22225
22226 this._addCondition(key, '$dontSelect', {
22227 key: queryKey,
22228 query: queryJSON
22229 });
22230
22231 return this;
22232 },
22233
22234 /**
22235 * Add constraint that at least one of the passed in queries matches.
22236 * @param {Array} queries
22237 * @return {AV.Query} Returns the query, so you can chain this call.
22238 * @private
22239 */
22240 _orQuery: function _orQuery(queries) {
22241 var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
22242 return q._getParams().where;
22243 });
22244 this._where.$or = queryJSON;
22245 return this;
22246 },
22247
22248 /**
22249 * Add constraint that both of the passed in queries matches.
22250 * @param {Array} queries
22251 * @return {AV.Query} Returns the query, so you can chain this call.
22252 * @private
22253 */
22254 _andQuery: function _andQuery(queries) {
22255 var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
22256 return q._getParams().where;
22257 });
22258 this._where.$and = queryJSON;
22259 return this;
22260 },
22261
22262 /**
22263 * Converts a string into a regex that matches it.
22264 * Surrounding with \Q .. \E does this, we just need to escape \E's in
22265 * the text separately.
22266 * @private
22267 */
22268 _quote: function _quote(s) {
22269 return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
22270 },
22271
22272 /**
22273 * Add a constraint for finding string values that contain a provided
22274 * string. This may be slow for large datasets.
22275 * @param {String} key The key that the string to match is stored in.
22276 * @param {String} substring The substring that the value must contain.
22277 * @return {AV.Query} Returns the query, so you can chain this call.
22278 */
22279 contains: function contains(key, value) {
22280 this._addCondition(key, '$regex', this._quote(value));
22281
22282 return this;
22283 },
22284
22285 /**
22286 * Add a constraint for finding string values that start with a provided
22287 * string. This query will use the backend index, so it will be fast even
22288 * for large datasets.
22289 * @param {String} key The key that the string to match is stored in.
22290 * @param {String} prefix The substring that the value must start with.
22291 * @return {AV.Query} Returns the query, so you can chain this call.
22292 */
22293 startsWith: function startsWith(key, value) {
22294 this._addCondition(key, '$regex', '^' + this._quote(value));
22295
22296 return this;
22297 },
22298
22299 /**
22300 * Add a constraint for finding string values that end with a provided
22301 * string. This will be slow for large datasets.
22302 * @param {String} key The key that the string to match is stored in.
22303 * @param {String} suffix The substring that the value must end with.
22304 * @return {AV.Query} Returns the query, so you can chain this call.
22305 */
22306 endsWith: function endsWith(key, value) {
22307 this._addCondition(key, '$regex', this._quote(value) + '$');
22308
22309 return this;
22310 },
22311
22312 /**
22313 * Sorts the results in ascending order by the given key.
22314 *
22315 * @param {String} key The key to order by.
22316 * @return {AV.Query} Returns the query, so you can chain this call.
22317 */
22318 ascending: function ascending(key) {
22319 requires(key, 'undefined is not a valid key');
22320 this._order = key;
22321 return this;
22322 },
22323
22324 /**
22325 * Also sorts the results in ascending order by the given key. The previous sort keys have
22326 * precedence over this 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 addAscending: function addAscending(key) {
22332 requires(key, 'undefined is not a valid key');
22333 if (this._order) this._order += ',' + key;else this._order = key;
22334 return this;
22335 },
22336
22337 /**
22338 * Sorts the results in descending order by the given key.
22339 *
22340 * @param {String} key The key to order by.
22341 * @return {AV.Query} Returns the query, so you can chain this call.
22342 */
22343 descending: function descending(key) {
22344 requires(key, 'undefined is not a valid key');
22345 this._order = '-' + key;
22346 return this;
22347 },
22348
22349 /**
22350 * Also sorts the results in descending order by the given key. The previous sort keys have
22351 * precedence over this 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 addDescending: function addDescending(key) {
22357 requires(key, 'undefined is not a valid key');
22358 if (this._order) this._order += ',-' + key;else this._order = '-' + key;
22359 return this;
22360 },
22361
22362 /**
22363 * Add a proximity based constraint for finding objects with key point
22364 * values near the point given.
22365 * @param {String} key The key that the AV.GeoPoint is stored in.
22366 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22367 * @return {AV.Query} Returns the query, so you can chain this call.
22368 */
22369 near: function near(key, point) {
22370 if (!(point instanceof AV.GeoPoint)) {
22371 // Try to cast it to a GeoPoint, so that near("loc", [20,30]) works.
22372 point = new AV.GeoPoint(point);
22373 }
22374
22375 this._addCondition(key, '$nearSphere', point);
22376
22377 return this;
22378 },
22379
22380 /**
22381 * Add a proximity based constraint for finding objects with key point
22382 * values near the point given and within the maximum distance given.
22383 * @param {String} key The key that the AV.GeoPoint is stored in.
22384 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22385 * @param maxDistance Maximum distance (in radians) of results to return.
22386 * @return {AV.Query} Returns the query, so you can chain this call.
22387 */
22388 withinRadians: function withinRadians(key, point, distance) {
22389 this.near(key, point);
22390
22391 this._addCondition(key, '$maxDistance', distance);
22392
22393 return this;
22394 },
22395
22396 /**
22397 * Add a proximity based constraint for finding objects with key point
22398 * values near the point given and within the maximum distance given.
22399 * Radius of earth used is 3958.8 miles.
22400 * @param {String} key The key that the AV.GeoPoint is stored in.
22401 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22402 * @param {Number} maxDistance Maximum distance (in miles) of results to
22403 * return.
22404 * @return {AV.Query} Returns the query, so you can chain this call.
22405 */
22406 withinMiles: function withinMiles(key, point, distance) {
22407 return this.withinRadians(key, point, distance / 3958.8);
22408 },
22409
22410 /**
22411 * Add a proximity based constraint for finding objects with key point
22412 * values near the point given and within the maximum distance given.
22413 * Radius of earth used is 6371.0 kilometers.
22414 * @param {String} key The key that the AV.GeoPoint is stored in.
22415 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22416 * @param {Number} maxDistance Maximum distance (in kilometers) of results
22417 * to return.
22418 * @return {AV.Query} Returns the query, so you can chain this call.
22419 */
22420 withinKilometers: function withinKilometers(key, point, distance) {
22421 return this.withinRadians(key, point, distance / 6371.0);
22422 },
22423
22424 /**
22425 * Add a constraint to the query that requires a particular key's
22426 * coordinates be contained within a given rectangular geographic bounding
22427 * box.
22428 * @param {String} key The key to be constrained.
22429 * @param {AV.GeoPoint} southwest
22430 * The lower-left inclusive corner of the box.
22431 * @param {AV.GeoPoint} northeast
22432 * The upper-right inclusive corner of the box.
22433 * @return {AV.Query} Returns the query, so you can chain this call.
22434 */
22435 withinGeoBox: function withinGeoBox(key, southwest, northeast) {
22436 if (!(southwest instanceof AV.GeoPoint)) {
22437 southwest = new AV.GeoPoint(southwest);
22438 }
22439
22440 if (!(northeast instanceof AV.GeoPoint)) {
22441 northeast = new AV.GeoPoint(northeast);
22442 }
22443
22444 this._addCondition(key, '$within', {
22445 $box: [southwest, northeast]
22446 });
22447
22448 return this;
22449 },
22450
22451 /**
22452 * Include nested AV.Objects for the provided key. You can use dot
22453 * notation to specify which fields in the included object are also fetch.
22454 * @param {String[]} keys The name of the key to include.
22455 * @return {AV.Query} Returns the query, so you can chain this call.
22456 */
22457 include: function include(keys) {
22458 var _this4 = this;
22459
22460 requires(keys, 'undefined is not a valid key');
22461
22462 _.forEach(arguments, function (keys) {
22463 var _context;
22464
22465 _this4._include = (0, _concat.default)(_context = _this4._include).call(_context, ensureArray(keys));
22466 });
22467
22468 return this;
22469 },
22470
22471 /**
22472 * Include the ACL.
22473 * @param {Boolean} [value=true] Whether to include the ACL
22474 * @return {AV.Query} Returns the query, so you can chain this call.
22475 */
22476 includeACL: function includeACL() {
22477 var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
22478 this._includeACL = value;
22479 return this;
22480 },
22481
22482 /**
22483 * Restrict the fields of the returned AV.Objects to include only the
22484 * provided keys. If this is called multiple times, then all of the keys
22485 * specified in each of the calls will be included.
22486 * @param {String[]} keys The names of the keys to include.
22487 * @return {AV.Query} Returns the query, so you can chain this call.
22488 */
22489 select: function select(keys) {
22490 var _this5 = this;
22491
22492 requires(keys, 'undefined is not a valid key');
22493
22494 _.forEach(arguments, function (keys) {
22495 var _context2;
22496
22497 _this5._select = (0, _concat.default)(_context2 = _this5._select).call(_context2, ensureArray(keys));
22498 });
22499
22500 return this;
22501 },
22502
22503 /**
22504 * Iterates over each result of a query, calling a callback for each one. If
22505 * the callback returns a promise, the iteration will not continue until
22506 * that promise has been fulfilled. If the callback returns a rejected
22507 * promise, then iteration will stop with that error. The items are
22508 * processed in an unspecified order. The query may not have any sort order,
22509 * and may not use limit or skip.
22510 * @param callback {Function} Callback that will be called with each result
22511 * of the query.
22512 * @return {Promise} A promise that will be fulfilled once the
22513 * iteration has completed.
22514 */
22515 each: function each(callback) {
22516 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22517
22518 if (this._order || this._skip || this._limit >= 0) {
22519 var error = new Error('Cannot iterate on a query with sort, skip, or limit.');
22520 return _promise.default.reject(error);
22521 }
22522
22523 var query = new AV.Query(this.objectClass); // We can override the batch size from the options.
22524 // This is undocumented, but useful for testing.
22525
22526 query._limit = options.batchSize || 100;
22527 query._where = _.clone(this._where);
22528 query._include = _.clone(this._include);
22529 query.ascending('objectId');
22530 var finished = false;
22531 return continueWhile(function () {
22532 return !finished;
22533 }, function () {
22534 return (0, _find.default)(query).call(query, options).then(function (results) {
22535 var callbacksDone = _promise.default.resolve();
22536
22537 _.each(results, function (result) {
22538 callbacksDone = callbacksDone.then(function () {
22539 return callback(result);
22540 });
22541 });
22542
22543 return callbacksDone.then(function () {
22544 if (results.length >= query._limit) {
22545 query.greaterThan('objectId', results[results.length - 1].id);
22546 } else {
22547 finished = true;
22548 }
22549 });
22550 });
22551 });
22552 },
22553
22554 /**
22555 * Subscribe the changes of this query.
22556 *
22557 * LiveQuery is not included in the default bundle: {@link https://url.leanapp.cn/enable-live-query}.
22558 *
22559 * @since 3.0.0
22560 * @return {AV.LiveQuery} An eventemitter which can be used to get LiveQuery updates;
22561 */
22562 subscribe: function subscribe(options) {
22563 return AV.LiveQuery.init(this, options);
22564 }
22565 });
22566
22567 AV.FriendShipQuery = AV.Query._extend({
22568 _newObject: function _newObject() {
22569 var UserClass = AV.Object._getSubclass('_User');
22570
22571 return new UserClass();
22572 },
22573 _processResult: function _processResult(json) {
22574 if (json && json[this._friendshipTag]) {
22575 var user = json[this._friendshipTag];
22576
22577 if (user.__type === 'Pointer' && user.className === '_User') {
22578 delete user.__type;
22579 delete user.className;
22580 }
22581
22582 return user;
22583 } else {
22584 return null;
22585 }
22586 }
22587 });
22588};
22589
22590/***/ }),
22591/* 530 */
22592/***/ (function(module, exports, __webpack_require__) {
22593
22594"use strict";
22595
22596
22597var _interopRequireDefault = __webpack_require__(2);
22598
22599var _promise = _interopRequireDefault(__webpack_require__(10));
22600
22601var _keys = _interopRequireDefault(__webpack_require__(48));
22602
22603var _ = __webpack_require__(1);
22604
22605var EventEmitter = __webpack_require__(218);
22606
22607var _require = __webpack_require__(28),
22608 inherits = _require.inherits;
22609
22610var _require2 = __webpack_require__(25),
22611 request = _require2.request;
22612
22613var subscribe = function subscribe(queryJSON, subscriptionId) {
22614 return request({
22615 method: 'POST',
22616 path: '/LiveQuery/subscribe',
22617 data: {
22618 query: queryJSON,
22619 id: subscriptionId
22620 }
22621 });
22622};
22623
22624module.exports = function (AV) {
22625 var requireRealtime = function requireRealtime() {
22626 if (!AV._config.realtime) {
22627 throw new Error('LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query');
22628 }
22629 };
22630 /**
22631 * @class
22632 * A LiveQuery, created by {@link AV.Query#subscribe} is an EventEmitter notifies changes of the Query.
22633 * @since 3.0.0
22634 */
22635
22636
22637 AV.LiveQuery = inherits(EventEmitter,
22638 /** @lends AV.LiveQuery.prototype */
22639 {
22640 constructor: function constructor(id, client, queryJSON, subscriptionId) {
22641 var _this = this;
22642
22643 EventEmitter.apply(this);
22644 this.id = id;
22645 this._client = client;
22646
22647 this._client.register(this);
22648
22649 this._queryJSON = queryJSON;
22650 this._subscriptionId = subscriptionId;
22651 this._onMessage = this._dispatch.bind(this);
22652
22653 this._onReconnect = function () {
22654 subscribe(_this._queryJSON, _this._subscriptionId).catch(function (error) {
22655 return console.error("LiveQuery resubscribe error: ".concat(error.message));
22656 });
22657 };
22658
22659 client.on('message', this._onMessage);
22660 client.on('reconnect', this._onReconnect);
22661 },
22662 _dispatch: function _dispatch(message) {
22663 var _this2 = this;
22664
22665 message.forEach(function (_ref) {
22666 var op = _ref.op,
22667 object = _ref.object,
22668 queryId = _ref.query_id,
22669 updatedKeys = _ref.updatedKeys;
22670 if (queryId !== _this2.id) return;
22671 var target = AV.parseJSON(_.extend({
22672 __type: object.className === '_File' ? 'File' : 'Object'
22673 }, object));
22674
22675 if (updatedKeys) {
22676 /**
22677 * An existing AV.Object which fulfills the Query you subscribe is updated.
22678 * @event AV.LiveQuery#update
22679 * @param {AV.Object|AV.File} target updated object
22680 * @param {String[]} updatedKeys updated keys
22681 */
22682
22683 /**
22684 * An existing AV.Object which doesn't fulfill the Query is updated and now it fulfills the Query.
22685 * @event AV.LiveQuery#enter
22686 * @param {AV.Object|AV.File} target updated object
22687 * @param {String[]} updatedKeys updated keys
22688 */
22689
22690 /**
22691 * An existing AV.Object which fulfills the Query is updated and now it doesn't fulfill the Query.
22692 * @event AV.LiveQuery#leave
22693 * @param {AV.Object|AV.File} target updated object
22694 * @param {String[]} updatedKeys updated keys
22695 */
22696 _this2.emit(op, target, updatedKeys);
22697 } else {
22698 /**
22699 * A new AV.Object which fulfills the Query you subscribe is created.
22700 * @event AV.LiveQuery#create
22701 * @param {AV.Object|AV.File} target updated object
22702 */
22703
22704 /**
22705 * An existing AV.Object which fulfills the Query you subscribe is deleted.
22706 * @event AV.LiveQuery#delete
22707 * @param {AV.Object|AV.File} target updated object
22708 */
22709 _this2.emit(op, target);
22710 }
22711 });
22712 },
22713
22714 /**
22715 * unsubscribe the query
22716 *
22717 * @return {Promise}
22718 */
22719 unsubscribe: function unsubscribe() {
22720 var client = this._client;
22721 client.off('message', this._onMessage);
22722 client.off('reconnect', this._onReconnect);
22723 client.deregister(this);
22724 return request({
22725 method: 'POST',
22726 path: '/LiveQuery/unsubscribe',
22727 data: {
22728 id: client.id,
22729 query_id: this.id
22730 }
22731 });
22732 }
22733 },
22734 /** @lends AV.LiveQuery */
22735 {
22736 init: function init(query) {
22737 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
22738 _ref2$subscriptionId = _ref2.subscriptionId,
22739 userDefinedSubscriptionId = _ref2$subscriptionId === void 0 ? AV._getSubscriptionId() : _ref2$subscriptionId;
22740
22741 requireRealtime();
22742 if (!(query instanceof AV.Query)) throw new TypeError('LiveQuery must be inited with a Query');
22743 return _promise.default.resolve(userDefinedSubscriptionId).then(function (subscriptionId) {
22744 return AV._config.realtime.createLiveQueryClient(subscriptionId).then(function (liveQueryClient) {
22745 var _query$_getParams = query._getParams(),
22746 where = _query$_getParams.where,
22747 keys = (0, _keys.default)(_query$_getParams),
22748 returnACL = _query$_getParams.returnACL;
22749
22750 var queryJSON = {
22751 where: where,
22752 keys: keys,
22753 returnACL: returnACL,
22754 className: query.className
22755 };
22756 var promise = subscribe(queryJSON, subscriptionId).then(function (_ref3) {
22757 var queryId = _ref3.query_id;
22758 return new AV.LiveQuery(queryId, liveQueryClient, queryJSON, subscriptionId);
22759 }).finally(function () {
22760 liveQueryClient.deregister(promise);
22761 });
22762 liveQueryClient.register(promise);
22763 return promise;
22764 });
22765 });
22766 },
22767
22768 /**
22769 * Pause the LiveQuery connection. This is useful to deactivate the SDK when the app is swtiched to background.
22770 * @static
22771 * @return void
22772 */
22773 pause: function pause() {
22774 requireRealtime();
22775 return AV._config.realtime.pause();
22776 },
22777
22778 /**
22779 * Resume the LiveQuery connection. All subscriptions will be restored after reconnection.
22780 * @static
22781 * @return void
22782 */
22783 resume: function resume() {
22784 requireRealtime();
22785 return AV._config.realtime.resume();
22786 }
22787 });
22788};
22789
22790/***/ }),
22791/* 531 */
22792/***/ (function(module, exports, __webpack_require__) {
22793
22794"use strict";
22795
22796
22797var _ = __webpack_require__(1);
22798
22799var _require = __webpack_require__(28),
22800 tap = _require.tap;
22801
22802module.exports = function (AV) {
22803 /**
22804 * @class
22805 * @example
22806 * AV.Captcha.request().then(captcha => {
22807 * captcha.bind({
22808 * textInput: 'code', // the id for textInput
22809 * image: 'captcha',
22810 * verifyButton: 'verify',
22811 * }, {
22812 * success: (validateCode) => {}, // next step
22813 * error: (error) => {}, // present error.message to user
22814 * });
22815 * });
22816 */
22817 AV.Captcha = function Captcha(options, authOptions) {
22818 this._options = options;
22819 this._authOptions = authOptions;
22820 /**
22821 * The image url of the captcha
22822 * @type string
22823 */
22824
22825 this.url = undefined;
22826 /**
22827 * The captchaToken of the captcha.
22828 * @type string
22829 */
22830
22831 this.captchaToken = undefined;
22832 /**
22833 * The validateToken of the captcha.
22834 * @type string
22835 */
22836
22837 this.validateToken = undefined;
22838 };
22839 /**
22840 * Refresh the captcha
22841 * @return {Promise.<string>} a new capcha url
22842 */
22843
22844
22845 AV.Captcha.prototype.refresh = function refresh() {
22846 var _this = this;
22847
22848 return AV.Cloud._requestCaptcha(this._options, this._authOptions).then(function (_ref) {
22849 var captchaToken = _ref.captchaToken,
22850 url = _ref.url;
22851
22852 _.extend(_this, {
22853 captchaToken: captchaToken,
22854 url: url
22855 });
22856
22857 return url;
22858 });
22859 };
22860 /**
22861 * Verify the captcha
22862 * @param {String} code The code from user input
22863 * @return {Promise.<string>} validateToken if the code is valid
22864 */
22865
22866
22867 AV.Captcha.prototype.verify = function verify(code) {
22868 var _this2 = this;
22869
22870 return AV.Cloud.verifyCaptcha(code, this.captchaToken).then(tap(function (validateToken) {
22871 return _this2.validateToken = validateToken;
22872 }));
22873 };
22874
22875 if (undefined === 'Browser') {
22876 /**
22877 * Bind the captcha to HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
22878 * @param [elements]
22879 * @param {String|HTMLInputElement} [elements.textInput] An input element typed text, or the id for the element.
22880 * @param {String|HTMLImageElement} [elements.image] An image element, or the id for the element.
22881 * @param {String|HTMLElement} [elements.verifyButton] A button element, or the id for the element.
22882 * @param [callbacks]
22883 * @param {Function} [callbacks.success] Success callback will be called if the code is verified. The param `validateCode` can be used for further SMS request.
22884 * @param {Function} [callbacks.error] Error callback will be called if something goes wrong, detailed in param `error.message`.
22885 */
22886 AV.Captcha.prototype.bind = function bind(_ref2, _ref3) {
22887 var _this3 = this;
22888
22889 var textInput = _ref2.textInput,
22890 image = _ref2.image,
22891 verifyButton = _ref2.verifyButton;
22892 var success = _ref3.success,
22893 error = _ref3.error;
22894
22895 if (typeof textInput === 'string') {
22896 textInput = document.getElementById(textInput);
22897 if (!textInput) throw new Error("textInput with id ".concat(textInput, " not found"));
22898 }
22899
22900 if (typeof image === 'string') {
22901 image = document.getElementById(image);
22902 if (!image) throw new Error("image with id ".concat(image, " not found"));
22903 }
22904
22905 if (typeof verifyButton === 'string') {
22906 verifyButton = document.getElementById(verifyButton);
22907 if (!verifyButton) throw new Error("verifyButton with id ".concat(verifyButton, " not found"));
22908 }
22909
22910 this.__refresh = function () {
22911 return _this3.refresh().then(function (url) {
22912 image.src = url;
22913
22914 if (textInput) {
22915 textInput.value = '';
22916 textInput.focus();
22917 }
22918 }).catch(function (err) {
22919 return console.warn("refresh captcha fail: ".concat(err.message));
22920 });
22921 };
22922
22923 if (image) {
22924 this.__image = image;
22925 image.src = this.url;
22926 image.addEventListener('click', this.__refresh);
22927 }
22928
22929 this.__verify = function () {
22930 var code = textInput.value;
22931
22932 _this3.verify(code).catch(function (err) {
22933 _this3.__refresh();
22934
22935 throw err;
22936 }).then(success, error).catch(function (err) {
22937 return console.warn("verify captcha fail: ".concat(err.message));
22938 });
22939 };
22940
22941 if (textInput && verifyButton) {
22942 this.__verifyButton = verifyButton;
22943 verifyButton.addEventListener('click', this.__verify);
22944 }
22945 };
22946 /**
22947 * unbind the captcha from HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
22948 */
22949
22950
22951 AV.Captcha.prototype.unbind = function unbind() {
22952 if (this.__image) this.__image.removeEventListener('click', this.__refresh);
22953 if (this.__verifyButton) this.__verifyButton.removeEventListener('click', this.__verify);
22954 };
22955 }
22956 /**
22957 * Request a captcha
22958 * @param [options]
22959 * @param {Number} [options.width] width(px) of the captcha, ranged 60-200
22960 * @param {Number} [options.height] height(px) of the captcha, ranged 30-100
22961 * @param {Number} [options.size=4] length of the captcha, ranged 3-6. MasterKey required.
22962 * @param {Number} [options.ttl=60] time to live(s), ranged 10-180. MasterKey required.
22963 * @return {Promise.<AV.Captcha>}
22964 */
22965
22966
22967 AV.Captcha.request = function (options, authOptions) {
22968 var captcha = new AV.Captcha(options, authOptions);
22969 return captcha.refresh().then(function () {
22970 return captcha;
22971 });
22972 };
22973};
22974
22975/***/ }),
22976/* 532 */
22977/***/ (function(module, exports, __webpack_require__) {
22978
22979"use strict";
22980
22981
22982var _interopRequireDefault = __webpack_require__(2);
22983
22984var _promise = _interopRequireDefault(__webpack_require__(10));
22985
22986var _ = __webpack_require__(1);
22987
22988var _require = __webpack_require__(25),
22989 _request = _require._request,
22990 request = _require.request;
22991
22992module.exports = function (AV) {
22993 /**
22994 * Contains functions for calling and declaring
22995 * <p><strong><em>
22996 * Some functions are only available from Cloud Code.
22997 * </em></strong></p>
22998 *
22999 * @namespace
23000 * @borrows AV.Captcha.request as requestCaptcha
23001 */
23002 AV.Cloud = AV.Cloud || {};
23003
23004 _.extend(AV.Cloud,
23005 /** @lends AV.Cloud */
23006 {
23007 /**
23008 * Makes a call to a cloud function.
23009 * @param {String} name The function name.
23010 * @param {Object} [data] The parameters to send to the cloud function.
23011 * @param {AuthOptions} [options]
23012 * @return {Promise} A promise that will be resolved with the result
23013 * of the function.
23014 */
23015 run: function run(name, data, options) {
23016 return request({
23017 service: 'engine',
23018 method: 'POST',
23019 path: "/functions/".concat(name),
23020 data: AV._encode(data, null, true),
23021 authOptions: options
23022 }).then(function (resp) {
23023 return AV._decode(resp).result;
23024 });
23025 },
23026
23027 /**
23028 * Makes a call to a cloud function, you can send {AV.Object} as param or a field of param; the response
23029 * from server will also be parsed as an {AV.Object}, array of {AV.Object}, or object includes {AV.Object}
23030 * @param {String} name The function name.
23031 * @param {Object} [data] The parameters to send to the cloud function.
23032 * @param {AuthOptions} [options]
23033 * @return {Promise} A promise that will be resolved with the result of the function.
23034 */
23035 rpc: function rpc(name, data, options) {
23036 if (_.isArray(data)) {
23037 return _promise.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK."));
23038 }
23039
23040 return request({
23041 service: 'engine',
23042 method: 'POST',
23043 path: "/call/".concat(name),
23044 data: AV._encodeObjectOrArray(data),
23045 authOptions: options
23046 }).then(function (resp) {
23047 return AV._decode(resp).result;
23048 });
23049 },
23050
23051 /**
23052 * Make a call to request server date time.
23053 * @return {Promise.<Date>} A promise that will be resolved with the result
23054 * of the function.
23055 * @since 0.5.9
23056 */
23057 getServerDate: function getServerDate() {
23058 return _request('date', null, null, 'GET').then(function (resp) {
23059 return AV._decode(resp);
23060 });
23061 },
23062
23063 /**
23064 * Makes a call to request an sms code for operation verification.
23065 * @param {String|Object} data The mobile phone number string or a JSON
23066 * object that contains mobilePhoneNumber,template,sign,op,ttl,name etc.
23067 * @param {String} data.mobilePhoneNumber
23068 * @param {String} [data.template] sms template name
23069 * @param {String} [data.sign] sms signature name
23070 * @param {String} [data.smsType] sending code by `sms` (default) or `voice` call
23071 * @param {SMSAuthOptions} [options]
23072 * @return {Promise} A promise that will be resolved if the request succeed
23073 */
23074 requestSmsCode: function requestSmsCode(data) {
23075 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23076
23077 if (_.isString(data)) {
23078 data = {
23079 mobilePhoneNumber: data
23080 };
23081 }
23082
23083 if (!data.mobilePhoneNumber) {
23084 throw new Error('Missing mobilePhoneNumber.');
23085 }
23086
23087 if (options.validateToken) {
23088 data = _.extend({}, data, {
23089 validate_token: options.validateToken
23090 });
23091 }
23092
23093 return _request('requestSmsCode', null, null, 'POST', data, options);
23094 },
23095
23096 /**
23097 * Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
23098 * @param {String} code The sms code sent by AV.Cloud.requestSmsCode
23099 * @param {phone} phone The mobile phoner number.
23100 * @return {Promise} A promise that will be resolved with the result
23101 * of the function.
23102 */
23103 verifySmsCode: function verifySmsCode(code, phone) {
23104 if (!code) throw new Error('Missing sms code.');
23105 var params = {};
23106
23107 if (_.isString(phone)) {
23108 params['mobilePhoneNumber'] = phone;
23109 }
23110
23111 return _request('verifySmsCode', code, null, 'POST', params);
23112 },
23113 _requestCaptcha: function _requestCaptcha(options, authOptions) {
23114 return _request('requestCaptcha', null, null, 'GET', options, authOptions).then(function (_ref) {
23115 var url = _ref.captcha_url,
23116 captchaToken = _ref.captcha_token;
23117 return {
23118 captchaToken: captchaToken,
23119 url: url
23120 };
23121 });
23122 },
23123
23124 /**
23125 * Request a captcha.
23126 */
23127 requestCaptcha: AV.Captcha.request,
23128
23129 /**
23130 * Verify captcha code. This is the low-level API for captcha.
23131 * Checkout {@link AV.Captcha} for high abstract APIs.
23132 * @param {String} code the code from user input
23133 * @param {String} captchaToken captchaToken returned by {@link AV.Cloud.requestCaptcha}
23134 * @return {Promise.<String>} validateToken if the code is valid
23135 */
23136 verifyCaptcha: function verifyCaptcha(code, captchaToken) {
23137 return _request('verifyCaptcha', null, null, 'POST', {
23138 captcha_code: code,
23139 captcha_token: captchaToken
23140 }).then(function (_ref2) {
23141 var validateToken = _ref2.validate_token;
23142 return validateToken;
23143 });
23144 }
23145 });
23146};
23147
23148/***/ }),
23149/* 533 */
23150/***/ (function(module, exports, __webpack_require__) {
23151
23152"use strict";
23153
23154
23155var request = __webpack_require__(25).request;
23156
23157module.exports = function (AV) {
23158 AV.Installation = AV.Object.extend('_Installation');
23159 /**
23160 * @namespace
23161 */
23162
23163 AV.Push = AV.Push || {};
23164 /**
23165 * Sends a push notification.
23166 * @param {Object} data The data of the push notification.
23167 * @param {String[]} [data.channels] An Array of channels to push to.
23168 * @param {Date} [data.push_time] A Date object for when to send the push.
23169 * @param {Date} [data.expiration_time] A Date object for when to expire
23170 * the push.
23171 * @param {Number} [data.expiration_interval] The seconds from now to expire the push.
23172 * @param {Number} [data.flow_control] The clients to notify per second
23173 * @param {AV.Query} [data.where] An AV.Query over AV.Installation that is used to match
23174 * a set of installations to push to.
23175 * @param {String} [data.cql] A CQL statement over AV.Installation that is used to match
23176 * a set of installations to push to.
23177 * @param {Object} data.data The data to send as part of the push.
23178 More details: https://url.leanapp.cn/pushData
23179 * @param {AuthOptions} [options]
23180 * @return {Promise}
23181 */
23182
23183 AV.Push.send = function (data, options) {
23184 if (data.where) {
23185 data.where = data.where._getParams().where;
23186 }
23187
23188 if (data.where && data.cql) {
23189 throw new Error("Both where and cql can't be set");
23190 }
23191
23192 if (data.push_time) {
23193 data.push_time = data.push_time.toJSON();
23194 }
23195
23196 if (data.expiration_time) {
23197 data.expiration_time = data.expiration_time.toJSON();
23198 }
23199
23200 if (data.expiration_time && data.expiration_interval) {
23201 throw new Error("Both expiration_time and expiration_interval can't be set");
23202 }
23203
23204 return request({
23205 service: 'push',
23206 method: 'POST',
23207 path: '/push',
23208 data: data,
23209 authOptions: options
23210 });
23211 };
23212};
23213
23214/***/ }),
23215/* 534 */
23216/***/ (function(module, exports, __webpack_require__) {
23217
23218"use strict";
23219
23220
23221var _interopRequireDefault = __webpack_require__(2);
23222
23223var _promise = _interopRequireDefault(__webpack_require__(10));
23224
23225var _typeof2 = _interopRequireDefault(__webpack_require__(135));
23226
23227var _ = __webpack_require__(1);
23228
23229var AVRequest = __webpack_require__(25)._request;
23230
23231var _require = __webpack_require__(28),
23232 getSessionToken = _require.getSessionToken;
23233
23234module.exports = function (AV) {
23235 var getUser = function getUser() {
23236 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23237 var sessionToken = getSessionToken(options);
23238
23239 if (sessionToken) {
23240 return AV.User._fetchUserBySessionToken(getSessionToken(options));
23241 }
23242
23243 return AV.User.currentAsync();
23244 };
23245
23246 var getUserPointer = function getUserPointer(options) {
23247 return getUser(options).then(function (currUser) {
23248 return AV.Object.createWithoutData('_User', currUser.id)._toPointer();
23249 });
23250 };
23251 /**
23252 * Contains functions to deal with Status in LeanCloud.
23253 * @class
23254 */
23255
23256
23257 AV.Status = function (imageUrl, message) {
23258 this.data = {};
23259 this.inboxType = 'default';
23260 this.query = null;
23261
23262 if (imageUrl && (0, _typeof2.default)(imageUrl) === 'object') {
23263 this.data = imageUrl;
23264 } else {
23265 if (imageUrl) {
23266 this.data.image = imageUrl;
23267 }
23268
23269 if (message) {
23270 this.data.message = message;
23271 }
23272 }
23273
23274 return this;
23275 };
23276
23277 _.extend(AV.Status.prototype,
23278 /** @lends AV.Status.prototype */
23279 {
23280 /**
23281 * Gets the value of an attribute in status data.
23282 * @param {String} attr The string name of an attribute.
23283 */
23284 get: function get(attr) {
23285 return this.data[attr];
23286 },
23287
23288 /**
23289 * Sets a hash of model attributes on the status data.
23290 * @param {String} key The key to set.
23291 * @param {any} value The value to give it.
23292 */
23293 set: function set(key, value) {
23294 this.data[key] = value;
23295 return this;
23296 },
23297
23298 /**
23299 * Destroy this status,then it will not be avaiable in other user's inboxes.
23300 * @param {AuthOptions} options
23301 * @return {Promise} A promise that is fulfilled when the destroy
23302 * completes.
23303 */
23304 destroy: function destroy(options) {
23305 if (!this.id) return _promise.default.reject(new Error('The status id is not exists.'));
23306 var request = AVRequest('statuses', null, this.id, 'DELETE', options);
23307 return request;
23308 },
23309
23310 /**
23311 * Cast the AV.Status object to an AV.Object pointer.
23312 * @return {AV.Object} A AV.Object pointer.
23313 */
23314 toObject: function toObject() {
23315 if (!this.id) return null;
23316 return AV.Object.createWithoutData('_Status', this.id);
23317 },
23318 _getDataJSON: function _getDataJSON() {
23319 var json = _.clone(this.data);
23320
23321 return AV._encode(json);
23322 },
23323
23324 /**
23325 * Send a status by a AV.Query object.
23326 * @since 0.3.0
23327 * @param {AuthOptions} options
23328 * @return {Promise} A promise that is fulfilled when the send
23329 * completes.
23330 * @example
23331 * // send a status to male users
23332 * var status = new AVStatus('image url', 'a message');
23333 * status.query = new AV.Query('_User');
23334 * status.query.equalTo('gender', 'male');
23335 * status.send().then(function(){
23336 * //send status successfully.
23337 * }, function(err){
23338 * //an error threw.
23339 * console.dir(err);
23340 * });
23341 */
23342 send: function send() {
23343 var _this = this;
23344
23345 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23346
23347 if (!getSessionToken(options) && !AV.User.current()) {
23348 throw new Error('Please signin an user.');
23349 }
23350
23351 if (!this.query) {
23352 return AV.Status.sendStatusToFollowers(this, options);
23353 }
23354
23355 return getUserPointer(options).then(function (currUser) {
23356 var query = _this.query._getParams();
23357
23358 query.className = _this.query.className;
23359 var data = {};
23360 data.query = query;
23361 _this.data = _this.data || {};
23362 _this.data.source = _this.data.source || currUser;
23363 data.data = _this._getDataJSON();
23364 data.inboxType = _this.inboxType || 'default';
23365 return AVRequest('statuses', null, null, 'POST', data, options);
23366 }).then(function (response) {
23367 _this.id = response.objectId;
23368 _this.createdAt = AV._parseDate(response.createdAt);
23369 return _this;
23370 });
23371 },
23372 _finishFetch: function _finishFetch(serverData) {
23373 this.id = serverData.objectId;
23374 this.createdAt = AV._parseDate(serverData.createdAt);
23375 this.updatedAt = AV._parseDate(serverData.updatedAt);
23376 this.messageId = serverData.messageId;
23377 delete serverData.messageId;
23378 delete serverData.objectId;
23379 delete serverData.createdAt;
23380 delete serverData.updatedAt;
23381 this.data = AV._decode(serverData);
23382 }
23383 });
23384 /**
23385 * Send a status to current signined user's followers.
23386 * @since 0.3.0
23387 * @param {AV.Status} status A status object to be send to followers.
23388 * @param {AuthOptions} options
23389 * @return {Promise} A promise that is fulfilled when the send
23390 * completes.
23391 * @example
23392 * var status = new AVStatus('image url', 'a message');
23393 * AV.Status.sendStatusToFollowers(status).then(function(){
23394 * //send status successfully.
23395 * }, function(err){
23396 * //an error threw.
23397 * console.dir(err);
23398 * });
23399 */
23400
23401
23402 AV.Status.sendStatusToFollowers = function (status) {
23403 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23404
23405 if (!getSessionToken(options) && !AV.User.current()) {
23406 throw new Error('Please signin an user.');
23407 }
23408
23409 return getUserPointer(options).then(function (currUser) {
23410 var query = {};
23411 query.className = '_Follower';
23412 query.keys = 'follower';
23413 query.where = {
23414 user: currUser
23415 };
23416 var data = {};
23417 data.query = query;
23418 status.data = status.data || {};
23419 status.data.source = status.data.source || currUser;
23420 data.data = status._getDataJSON();
23421 data.inboxType = status.inboxType || 'default';
23422 var request = AVRequest('statuses', null, null, 'POST', data, options);
23423 return request.then(function (response) {
23424 status.id = response.objectId;
23425 status.createdAt = AV._parseDate(response.createdAt);
23426 return status;
23427 });
23428 });
23429 };
23430 /**
23431 * <p>Send a status from current signined user to other user's private status inbox.</p>
23432 * @since 0.3.0
23433 * @param {AV.Status} status A status object to be send to followers.
23434 * @param {String} target The target user or user's objectId.
23435 * @param {AuthOptions} options
23436 * @return {Promise} A promise that is fulfilled when the send
23437 * completes.
23438 * @example
23439 * // send a private status to user '52e84e47e4b0f8de283b079b'
23440 * var status = new AVStatus('image url', 'a message');
23441 * AV.Status.sendPrivateStatus(status, '52e84e47e4b0f8de283b079b').then(function(){
23442 * //send status successfully.
23443 * }, function(err){
23444 * //an error threw.
23445 * console.dir(err);
23446 * });
23447 */
23448
23449
23450 AV.Status.sendPrivateStatus = function (status, target) {
23451 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23452
23453 if (!getSessionToken(options) && !AV.User.current()) {
23454 throw new Error('Please signin an user.');
23455 }
23456
23457 if (!target) {
23458 throw new Error('Invalid target user.');
23459 }
23460
23461 var userObjectId = _.isString(target) ? target : target.id;
23462
23463 if (!userObjectId) {
23464 throw new Error('Invalid target user.');
23465 }
23466
23467 return getUserPointer(options).then(function (currUser) {
23468 var query = {};
23469 query.className = '_User';
23470 query.where = {
23471 objectId: userObjectId
23472 };
23473 var data = {};
23474 data.query = query;
23475 status.data = status.data || {};
23476 status.data.source = status.data.source || currUser;
23477 data.data = status._getDataJSON();
23478 data.inboxType = 'private';
23479 status.inboxType = 'private';
23480 var request = AVRequest('statuses', null, null, 'POST', data, options);
23481 return request.then(function (response) {
23482 status.id = response.objectId;
23483 status.createdAt = AV._parseDate(response.createdAt);
23484 return status;
23485 });
23486 });
23487 };
23488 /**
23489 * Count unread statuses in someone's inbox.
23490 * @since 0.3.0
23491 * @param {AV.User} owner The status owner.
23492 * @param {String} inboxType The inbox type, 'default' by default.
23493 * @param {AuthOptions} options
23494 * @return {Promise} A promise that is fulfilled when the count
23495 * completes.
23496 * @example
23497 * AV.Status.countUnreadStatuses(AV.User.current()).then(function(response){
23498 * console.log(response.unread); //unread statuses number.
23499 * console.log(response.total); //total statuses number.
23500 * });
23501 */
23502
23503
23504 AV.Status.countUnreadStatuses = function (owner) {
23505 var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
23506 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23507 if (!_.isString(inboxType)) options = inboxType;
23508
23509 if (!getSessionToken(options) && owner == null && !AV.User.current()) {
23510 throw new Error('Please signin an user or pass the owner objectId.');
23511 }
23512
23513 return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
23514 var params = {};
23515 params.inboxType = AV._encode(inboxType);
23516 params.owner = AV._encode(owner);
23517 return AVRequest('subscribe/statuses/count', null, null, 'GET', params, options);
23518 });
23519 };
23520 /**
23521 * reset unread statuses count in someone's inbox.
23522 * @since 2.1.0
23523 * @param {AV.User} owner The status owner.
23524 * @param {String} inboxType The inbox type, 'default' by default.
23525 * @param {AuthOptions} options
23526 * @return {Promise} A promise that is fulfilled when the reset
23527 * completes.
23528 * @example
23529 * AV.Status.resetUnreadCount(AV.User.current()).then(function(response){
23530 * console.log(response.unread); //unread statuses number.
23531 * console.log(response.total); //total statuses number.
23532 * });
23533 */
23534
23535
23536 AV.Status.resetUnreadCount = function (owner) {
23537 var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
23538 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23539 if (!_.isString(inboxType)) options = inboxType;
23540
23541 if (!getSessionToken(options) && owner == null && !AV.User.current()) {
23542 throw new Error('Please signin an user or pass the owner objectId.');
23543 }
23544
23545 return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
23546 var params = {};
23547 params.inboxType = AV._encode(inboxType);
23548 params.owner = AV._encode(owner);
23549 return AVRequest('subscribe/statuses/resetUnreadCount', null, null, 'POST', params, options);
23550 });
23551 };
23552 /**
23553 * Create a status query to find someone's published statuses.
23554 * @since 0.3.0
23555 * @param {AV.User} source The status source, typically the publisher.
23556 * @return {AV.Query} The query object for status.
23557 * @example
23558 * //Find current user's published statuses.
23559 * var query = AV.Status.statusQuery(AV.User.current());
23560 * query.find().then(function(statuses){
23561 * //process statuses
23562 * });
23563 */
23564
23565
23566 AV.Status.statusQuery = function (source) {
23567 var query = new AV.Query('_Status');
23568
23569 if (source) {
23570 query.equalTo('source', source);
23571 }
23572
23573 return query;
23574 };
23575 /**
23576 * <p>AV.InboxQuery defines a query that is used to fetch somebody's inbox statuses.</p>
23577 * @class
23578 */
23579
23580
23581 AV.InboxQuery = AV.Query._extend(
23582 /** @lends AV.InboxQuery.prototype */
23583 {
23584 _objectClass: AV.Status,
23585 _sinceId: 0,
23586 _maxId: 0,
23587 _inboxType: 'default',
23588 _owner: null,
23589 _newObject: function _newObject() {
23590 return new AV.Status();
23591 },
23592 _createRequest: function _createRequest(params, options) {
23593 return AV.InboxQuery.__super__._createRequest.call(this, params, options, '/subscribe/statuses');
23594 },
23595
23596 /**
23597 * Sets the messageId of results to skip before returning any results.
23598 * This is useful for pagination.
23599 * Default is zero.
23600 * @param {Number} n the mesage id.
23601 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23602 */
23603 sinceId: function sinceId(id) {
23604 this._sinceId = id;
23605 return this;
23606 },
23607
23608 /**
23609 * Sets the maximal messageId of results。
23610 * This is useful for pagination.
23611 * Default is zero that is no limition.
23612 * @param {Number} n the mesage id.
23613 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23614 */
23615 maxId: function maxId(id) {
23616 this._maxId = id;
23617 return this;
23618 },
23619
23620 /**
23621 * Sets the owner of the querying inbox.
23622 * @param {AV.User} owner The inbox owner.
23623 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23624 */
23625 owner: function owner(_owner) {
23626 this._owner = _owner;
23627 return this;
23628 },
23629
23630 /**
23631 * Sets the querying inbox type.default is 'default'.
23632 * @param {String} type The inbox type.
23633 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23634 */
23635 inboxType: function inboxType(type) {
23636 this._inboxType = type;
23637 return this;
23638 },
23639 _getParams: function _getParams() {
23640 var params = AV.InboxQuery.__super__._getParams.call(this);
23641
23642 params.owner = AV._encode(this._owner);
23643 params.inboxType = AV._encode(this._inboxType);
23644 params.sinceId = AV._encode(this._sinceId);
23645 params.maxId = AV._encode(this._maxId);
23646 return params;
23647 }
23648 });
23649 /**
23650 * Create a inbox status query to find someone's inbox statuses.
23651 * @since 0.3.0
23652 * @param {AV.User} owner The inbox's owner
23653 * @param {String} inboxType The inbox type,'default' by default.
23654 * @return {AV.InboxQuery} The inbox query object.
23655 * @see AV.InboxQuery
23656 * @example
23657 * //Find current user's default inbox statuses.
23658 * var query = AV.Status.inboxQuery(AV.User.current());
23659 * //find the statuses after the last message id
23660 * query.sinceId(lastMessageId);
23661 * query.find().then(function(statuses){
23662 * //process statuses
23663 * });
23664 */
23665
23666 AV.Status.inboxQuery = function (owner, inboxType) {
23667 var query = new AV.InboxQuery(AV.Status);
23668
23669 if (owner) {
23670 query._owner = owner;
23671 }
23672
23673 if (inboxType) {
23674 query._inboxType = inboxType;
23675 }
23676
23677 return query;
23678 };
23679};
23680
23681/***/ }),
23682/* 535 */
23683/***/ (function(module, exports, __webpack_require__) {
23684
23685"use strict";
23686
23687
23688var _interopRequireDefault = __webpack_require__(2);
23689
23690var _stringify = _interopRequireDefault(__webpack_require__(34));
23691
23692var _map = _interopRequireDefault(__webpack_require__(39));
23693
23694var _ = __webpack_require__(1);
23695
23696var AVRequest = __webpack_require__(25)._request;
23697
23698module.exports = function (AV) {
23699 /**
23700 * A builder to generate sort string for app searching.For example:
23701 * @class
23702 * @since 0.5.1
23703 * @example
23704 * var builder = new AV.SearchSortBuilder();
23705 * builder.ascending('key1').descending('key2','max');
23706 * var query = new AV.SearchQuery('Player');
23707 * query.sortBy(builder);
23708 * query.find().then();
23709 */
23710 AV.SearchSortBuilder = function () {
23711 this._sortFields = [];
23712 };
23713
23714 _.extend(AV.SearchSortBuilder.prototype,
23715 /** @lends AV.SearchSortBuilder.prototype */
23716 {
23717 _addField: function _addField(key, order, mode, missing) {
23718 var field = {};
23719 field[key] = {
23720 order: order || 'asc',
23721 mode: mode || 'avg',
23722 missing: '_' + (missing || 'last')
23723 };
23724
23725 this._sortFields.push(field);
23726
23727 return this;
23728 },
23729
23730 /**
23731 * Sorts the results in ascending order by the given key and options.
23732 *
23733 * @param {String} key The key to order by.
23734 * @param {String} mode The sort mode, default is 'avg', you can choose
23735 * 'max' or 'min' too.
23736 * @param {String} missing The missing key behaviour, default is 'last',
23737 * you can choose 'first' too.
23738 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23739 */
23740 ascending: function ascending(key, mode, missing) {
23741 return this._addField(key, 'asc', mode, missing);
23742 },
23743
23744 /**
23745 * Sorts the results in descending order by the given key and options.
23746 *
23747 * @param {String} key The key to order by.
23748 * @param {String} mode The sort mode, default is 'avg', you can choose
23749 * 'max' or 'min' too.
23750 * @param {String} missing The missing key behaviour, default is 'last',
23751 * you can choose 'first' too.
23752 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23753 */
23754 descending: function descending(key, mode, missing) {
23755 return this._addField(key, 'desc', mode, missing);
23756 },
23757
23758 /**
23759 * Add a proximity based constraint for finding objects with key point
23760 * values near the point given.
23761 * @param {String} key The key that the AV.GeoPoint is stored in.
23762 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
23763 * @param {Object} options The other options such as mode,order, unit etc.
23764 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23765 */
23766 whereNear: function whereNear(key, point, options) {
23767 options = options || {};
23768 var field = {};
23769 var geo = {
23770 lat: point.latitude,
23771 lon: point.longitude
23772 };
23773 var m = {
23774 order: options.order || 'asc',
23775 mode: options.mode || 'avg',
23776 unit: options.unit || 'km'
23777 };
23778 m[key] = geo;
23779 field['_geo_distance'] = m;
23780
23781 this._sortFields.push(field);
23782
23783 return this;
23784 },
23785
23786 /**
23787 * Build a sort string by configuration.
23788 * @return {String} the sort string.
23789 */
23790 build: function build() {
23791 return (0, _stringify.default)(AV._encode(this._sortFields));
23792 }
23793 });
23794 /**
23795 * App searching query.Use just like AV.Query:
23796 *
23797 * Visit <a href='https://leancloud.cn/docs/app_search_guide.html'>App Searching Guide</a>
23798 * for more details.
23799 * @class
23800 * @since 0.5.1
23801 * @example
23802 * var query = new AV.SearchQuery('Player');
23803 * query.queryString('*');
23804 * query.find().then(function(results) {
23805 * console.log('Found %d objects', query.hits());
23806 * //Process results
23807 * });
23808 */
23809
23810
23811 AV.SearchQuery = AV.Query._extend(
23812 /** @lends AV.SearchQuery.prototype */
23813 {
23814 _sid: null,
23815 _hits: 0,
23816 _queryString: null,
23817 _highlights: null,
23818 _sortBuilder: null,
23819 _clazz: null,
23820 constructor: function constructor(className) {
23821 if (className) {
23822 this._clazz = className;
23823 } else {
23824 className = '__INVALID_CLASS';
23825 }
23826
23827 AV.Query.call(this, className);
23828 },
23829 _createRequest: function _createRequest(params, options) {
23830 return AVRequest('search/select', null, null, 'GET', params || this._getParams(), options);
23831 },
23832
23833 /**
23834 * Sets the sid of app searching query.Default is null.
23835 * @param {String} sid Scroll id for searching.
23836 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23837 */
23838 sid: function sid(_sid) {
23839 this._sid = _sid;
23840 return this;
23841 },
23842
23843 /**
23844 * Sets the query string of app searching.
23845 * @param {String} q The query string.
23846 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23847 */
23848 queryString: function queryString(q) {
23849 this._queryString = q;
23850 return this;
23851 },
23852
23853 /**
23854 * Sets the highlight fields. Such as
23855 * <pre><code>
23856 * query.highlights('title');
23857 * //or pass an array.
23858 * query.highlights(['title', 'content'])
23859 * </code></pre>
23860 * @param {String|String[]} highlights a list of fields.
23861 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23862 */
23863 highlights: function highlights(_highlights) {
23864 var objects;
23865
23866 if (_highlights && _.isString(_highlights)) {
23867 objects = _.toArray(arguments);
23868 } else {
23869 objects = _highlights;
23870 }
23871
23872 this._highlights = objects;
23873 return this;
23874 },
23875
23876 /**
23877 * Sets the sort builder for this query.
23878 * @see AV.SearchSortBuilder
23879 * @param { AV.SearchSortBuilder} builder The sort builder.
23880 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23881 *
23882 */
23883 sortBy: function sortBy(builder) {
23884 this._sortBuilder = builder;
23885 return this;
23886 },
23887
23888 /**
23889 * Returns the number of objects that match this query.
23890 * @return {Number}
23891 */
23892 hits: function hits() {
23893 if (!this._hits) {
23894 this._hits = 0;
23895 }
23896
23897 return this._hits;
23898 },
23899 _processResult: function _processResult(json) {
23900 delete json['className'];
23901 delete json['_app_url'];
23902 delete json['_deeplink'];
23903 return json;
23904 },
23905
23906 /**
23907 * Returns true when there are more documents can be retrieved by this
23908 * query instance, you can call find function to get more results.
23909 * @see AV.SearchQuery#find
23910 * @return {Boolean}
23911 */
23912 hasMore: function hasMore() {
23913 return !this._hitEnd;
23914 },
23915
23916 /**
23917 * Reset current query instance state(such as sid, hits etc) except params
23918 * for a new searching. After resetting, hasMore() will return true.
23919 */
23920 reset: function reset() {
23921 this._hitEnd = false;
23922 this._sid = null;
23923 this._hits = 0;
23924 },
23925
23926 /**
23927 * Retrieves a list of AVObjects that satisfy this query.
23928 * Either options.success or options.error is called when the find
23929 * completes.
23930 *
23931 * @see AV.Query#find
23932 * @param {AuthOptions} options
23933 * @return {Promise} A promise that is resolved with the results when
23934 * the query completes.
23935 */
23936 find: function find(options) {
23937 var self = this;
23938
23939 var request = this._createRequest(undefined, options);
23940
23941 return request.then(function (response) {
23942 //update sid for next querying.
23943 if (response.sid) {
23944 self._oldSid = self._sid;
23945 self._sid = response.sid;
23946 } else {
23947 self._sid = null;
23948 self._hitEnd = true;
23949 }
23950
23951 self._hits = response.hits || 0;
23952 return (0, _map.default)(_).call(_, response.results, function (json) {
23953 if (json.className) {
23954 response.className = json.className;
23955 }
23956
23957 var obj = self._newObject(response);
23958
23959 obj.appURL = json['_app_url'];
23960
23961 obj._finishFetch(self._processResult(json), true);
23962
23963 return obj;
23964 });
23965 });
23966 },
23967 _getParams: function _getParams() {
23968 var params = AV.SearchQuery.__super__._getParams.call(this);
23969
23970 delete params.where;
23971
23972 if (this._clazz) {
23973 params.clazz = this.className;
23974 }
23975
23976 if (this._sid) {
23977 params.sid = this._sid;
23978 }
23979
23980 if (!this._queryString) {
23981 throw new Error('Please set query string.');
23982 } else {
23983 params.q = this._queryString;
23984 }
23985
23986 if (this._highlights) {
23987 params.highlights = this._highlights.join(',');
23988 }
23989
23990 if (this._sortBuilder && params.order) {
23991 throw new Error('sort and order can not be set at same time.');
23992 }
23993
23994 if (this._sortBuilder) {
23995 params.sort = this._sortBuilder.build();
23996 }
23997
23998 return params;
23999 }
24000 });
24001};
24002/**
24003 * Sorts the results in ascending order by the given key.
24004 *
24005 * @method AV.SearchQuery#ascending
24006 * @param {String} key The key to order by.
24007 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24008 */
24009
24010/**
24011 * Also sorts the results in ascending order by the given key. The previous sort keys have
24012 * precedence over this key.
24013 *
24014 * @method AV.SearchQuery#addAscending
24015 * @param {String} key The key to order by
24016 * @return {AV.SearchQuery} Returns the query so you can chain this call.
24017 */
24018
24019/**
24020 * Sorts the results in descending order by the given key.
24021 *
24022 * @method AV.SearchQuery#descending
24023 * @param {String} key The key to order by.
24024 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24025 */
24026
24027/**
24028 * Also sorts the results in descending order by the given key. The previous sort keys have
24029 * precedence over this key.
24030 *
24031 * @method AV.SearchQuery#addDescending
24032 * @param {String} key The key to order by
24033 * @return {AV.SearchQuery} Returns the query so you can chain this call.
24034 */
24035
24036/**
24037 * Include nested AV.Objects for the provided key. You can use dot
24038 * notation to specify which fields in the included object are also fetch.
24039 * @method AV.SearchQuery#include
24040 * @param {String[]} keys The name of the key to include.
24041 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24042 */
24043
24044/**
24045 * Sets the number of results to skip before returning any results.
24046 * This is useful for pagination.
24047 * Default is to skip zero results.
24048 * @method AV.SearchQuery#skip
24049 * @param {Number} n the number of results to skip.
24050 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24051 */
24052
24053/**
24054 * Sets the limit of the number of results to return. The default limit is
24055 * 100, with a maximum of 1000 results being returned at a time.
24056 * @method AV.SearchQuery#limit
24057 * @param {Number} n the number of results to limit to.
24058 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24059 */
24060
24061/***/ }),
24062/* 536 */
24063/***/ (function(module, exports, __webpack_require__) {
24064
24065"use strict";
24066
24067
24068var _interopRequireDefault = __webpack_require__(2);
24069
24070var _promise = _interopRequireDefault(__webpack_require__(10));
24071
24072var _ = __webpack_require__(1);
24073
24074var AVError = __webpack_require__(40);
24075
24076var _require = __webpack_require__(25),
24077 request = _require.request;
24078
24079module.exports = function (AV) {
24080 /**
24081 * 包含了使用了 LeanCloud
24082 * <a href='/docs/leaninsight_guide.html'>离线数据分析功能</a>的函数。
24083 * <p><strong><em>
24084 * 仅在云引擎运行环境下有效。
24085 * </em></strong></p>
24086 * @namespace
24087 */
24088 AV.Insight = AV.Insight || {};
24089
24090 _.extend(AV.Insight,
24091 /** @lends AV.Insight */
24092 {
24093 /**
24094 * 开始一个 Insight 任务。结果里将返回 Job id,你可以拿得到的 id 使用
24095 * AV.Insight.JobQuery 查询任务状态和结果。
24096 * @param {Object} jobConfig 任务配置的 JSON 对象,例如:<code><pre>
24097 * { "sql" : "select count(*) as c,gender from _User group by gender",
24098 * "saveAs": {
24099 * "className" : "UserGender",
24100 * "limit": 1
24101 * }
24102 * }
24103 * </pre></code>
24104 * sql 指定任务执行的 SQL 语句, saveAs(可选) 指定将结果保存在哪张表里,limit 最大 1000。
24105 * @param {AuthOptions} [options]
24106 * @return {Promise} A promise that will be resolved with the result
24107 * of the function.
24108 */
24109 startJob: function startJob(jobConfig, options) {
24110 if (!jobConfig || !jobConfig.sql) {
24111 throw new Error('Please provide the sql to run the job.');
24112 }
24113
24114 var data = {
24115 jobConfig: jobConfig,
24116 appId: AV.applicationId
24117 };
24118 return request({
24119 path: '/bigquery/jobs',
24120 method: 'POST',
24121 data: AV._encode(data, null, true),
24122 authOptions: options,
24123 signKey: false
24124 }).then(function (resp) {
24125 return AV._decode(resp).id;
24126 });
24127 },
24128
24129 /**
24130 * 监听 Insight 任务事件(未来推出独立部署的离线分析服务后开放)
24131 * <p><strong><em>
24132 * 仅在云引擎运行环境下有效。
24133 * </em></strong></p>
24134 * @param {String} event 监听的事件,目前尚不支持。
24135 * @param {Function} 监听回调函数,接收 (err, id) 两个参数,err 表示错误信息,
24136 * id 表示任务 id。接下来你可以拿这个 id 使用AV.Insight.JobQuery 查询任务状态和结果。
24137 *
24138 */
24139 on: function on(event, cb) {}
24140 });
24141 /**
24142 * 创建一个对象,用于查询 Insight 任务状态和结果。
24143 * @class
24144 * @param {String} id 任务 id
24145 * @since 0.5.5
24146 */
24147
24148
24149 AV.Insight.JobQuery = function (id, className) {
24150 if (!id) {
24151 throw new Error('Please provide the job id.');
24152 }
24153
24154 this.id = id;
24155 this.className = className;
24156 this._skip = 0;
24157 this._limit = 100;
24158 };
24159
24160 _.extend(AV.Insight.JobQuery.prototype,
24161 /** @lends AV.Insight.JobQuery.prototype */
24162 {
24163 /**
24164 * Sets the number of results to skip before returning any results.
24165 * This is useful for pagination.
24166 * Default is to skip zero results.
24167 * @param {Number} n the number of results to skip.
24168 * @return {AV.Query} Returns the query, so you can chain this call.
24169 */
24170 skip: function skip(n) {
24171 this._skip = n;
24172 return this;
24173 },
24174
24175 /**
24176 * Sets the limit of the number of results to return. The default limit is
24177 * 100, with a maximum of 1000 results being returned at a time.
24178 * @param {Number} n the number of results to limit to.
24179 * @return {AV.Query} Returns the query, so you can chain this call.
24180 */
24181 limit: function limit(n) {
24182 this._limit = n;
24183 return this;
24184 },
24185
24186 /**
24187 * 查询任务状态和结果,任务结果为一个 JSON 对象,包括 status 表示任务状态, totalCount 表示总数,
24188 * results 数组表示任务结果数组,previewCount 表示可以返回的结果总数,任务的开始和截止时间
24189 * startTime、endTime 等信息。
24190 *
24191 * @param {AuthOptions} [options]
24192 * @return {Promise} A promise that will be resolved with the result
24193 * of the function.
24194 *
24195 */
24196 find: function find(options) {
24197 var params = {
24198 skip: this._skip,
24199 limit: this._limit
24200 };
24201 return request({
24202 path: "/bigquery/jobs/".concat(this.id),
24203 method: 'GET',
24204 query: params,
24205 authOptions: options,
24206 signKey: false
24207 }).then(function (response) {
24208 if (response.error) {
24209 return _promise.default.reject(new AVError(response.code, response.error));
24210 }
24211
24212 return _promise.default.resolve(response);
24213 });
24214 }
24215 });
24216};
24217
24218/***/ }),
24219/* 537 */
24220/***/ (function(module, exports, __webpack_require__) {
24221
24222"use strict";
24223
24224
24225var _interopRequireDefault = __webpack_require__(2);
24226
24227var _promise = _interopRequireDefault(__webpack_require__(10));
24228
24229var _ = __webpack_require__(1);
24230
24231var _require = __webpack_require__(25),
24232 LCRequest = _require.request;
24233
24234var _require2 = __webpack_require__(28),
24235 getSessionToken = _require2.getSessionToken;
24236
24237module.exports = function (AV) {
24238 var getUserWithSessionToken = function getUserWithSessionToken(authOptions) {
24239 if (authOptions.user) {
24240 if (!authOptions.user._sessionToken) {
24241 throw new Error('authOptions.user is not signed in.');
24242 }
24243
24244 return _promise.default.resolve(authOptions.user);
24245 }
24246
24247 if (authOptions.sessionToken) {
24248 return AV.User._fetchUserBySessionToken(authOptions.sessionToken);
24249 }
24250
24251 return AV.User.currentAsync();
24252 };
24253
24254 var getSessionTokenAsync = function getSessionTokenAsync(authOptions) {
24255 var sessionToken = getSessionToken(authOptions);
24256
24257 if (sessionToken) {
24258 return _promise.default.resolve(sessionToken);
24259 }
24260
24261 return AV.User.currentAsync().then(function (user) {
24262 if (user) {
24263 return user.getSessionToken();
24264 }
24265 });
24266 };
24267 /**
24268 * Contains functions to deal with Friendship in LeanCloud.
24269 * @class
24270 */
24271
24272
24273 AV.Friendship = {
24274 /**
24275 * Request friendship.
24276 * @since 4.8.0
24277 * @param {String | AV.User | Object} options if an AV.User or string is given, it will be used as the friend.
24278 * @param {AV.User | string} options.friend The friend (or friend's objectId) to follow.
24279 * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of followeeQuery.
24280 * @param {AuthOptions} [authOptions]
24281 * @return {Promise<void>}
24282 */
24283 request: function request(options) {
24284 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24285 var friend;
24286 var attributes;
24287
24288 if (options.friend) {
24289 friend = options.friend;
24290 attributes = options.attributes;
24291 } else {
24292 friend = options;
24293 }
24294
24295 var friendObj = _.isString(friend) ? AV.Object.createWithoutData('_User', friend) : friend;
24296 return getUserWithSessionToken(authOptions).then(function (userObj) {
24297 if (!userObj) {
24298 throw new Error('Please signin an user.');
24299 }
24300
24301 return LCRequest({
24302 method: 'POST',
24303 path: '/users/friendshipRequests',
24304 data: {
24305 user: userObj._toPointer(),
24306 friend: friendObj._toPointer(),
24307 friendship: attributes
24308 },
24309 authOptions: authOptions
24310 });
24311 });
24312 },
24313
24314 /**
24315 * Accept a friendship request.
24316 * @since 4.8.0
24317 * @param {AV.Object | string | Object} options if an AV.Object or string is given, it will be used as the request in _FriendshipRequest.
24318 * @param {AV.Object} options.request The request (or it's objectId) to be accepted.
24319 * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of {@link AV#followeeQuery}.
24320 * @param {AuthOptions} [authOptions]
24321 * @return {Promise<void>}
24322 */
24323 acceptRequest: function acceptRequest(options) {
24324 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24325 var request;
24326 var attributes;
24327
24328 if (options.request) {
24329 request = options.request;
24330 attributes = options.attributes;
24331 } else {
24332 request = options;
24333 }
24334
24335 var requestId = _.isString(request) ? request : request.id;
24336 return getSessionTokenAsync(authOptions).then(function (sessionToken) {
24337 if (!sessionToken) {
24338 throw new Error('Please signin an user.');
24339 }
24340
24341 return LCRequest({
24342 method: 'PUT',
24343 path: '/users/friendshipRequests/' + requestId + '/accept',
24344 data: {
24345 friendship: AV._encode(attributes)
24346 },
24347 authOptions: authOptions
24348 });
24349 });
24350 },
24351
24352 /**
24353 * Decline a friendship request.
24354 * @param {AV.Object | string} request The request (or it's objectId) to be declined.
24355 * @param {AuthOptions} [authOptions]
24356 * @return {Promise<void>}
24357 */
24358 declineRequest: function declineRequest(request) {
24359 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24360 var requestId = _.isString(request) ? request : request.id;
24361 return getSessionTokenAsync(authOptions).then(function (sessionToken) {
24362 if (!sessionToken) {
24363 throw new Error('Please signin an user.');
24364 }
24365
24366 return LCRequest({
24367 method: 'PUT',
24368 path: '/users/friendshipRequests/' + requestId + '/decline',
24369 authOptions: authOptions
24370 });
24371 });
24372 }
24373 };
24374};
24375
24376/***/ }),
24377/* 538 */
24378/***/ (function(module, exports, __webpack_require__) {
24379
24380"use strict";
24381
24382
24383var _interopRequireDefault = __webpack_require__(2);
24384
24385var _stringify = _interopRequireDefault(__webpack_require__(34));
24386
24387var _ = __webpack_require__(1);
24388
24389var _require = __webpack_require__(25),
24390 _request = _require._request;
24391
24392var AV = __webpack_require__(59);
24393
24394var serializeMessage = function serializeMessage(message) {
24395 if (typeof message === 'string') {
24396 return message;
24397 }
24398
24399 if (typeof message.getPayload === 'function') {
24400 return (0, _stringify.default)(message.getPayload());
24401 }
24402
24403 return (0, _stringify.default)(message);
24404};
24405/**
24406 * <p>An AV.Conversation is a local representation of a LeanCloud realtime's
24407 * conversation. This class is a subclass of AV.Object, and retains the
24408 * same functionality of an AV.Object, but also extends it with various
24409 * conversation specific methods, like get members, creators of this conversation.
24410 * </p>
24411 *
24412 * @class AV.Conversation
24413 * @param {String} name The name of the Role to create.
24414 * @param {Object} [options]
24415 * @param {Boolean} [options.isSystem] Set this conversation as system conversation.
24416 * @param {Boolean} [options.isTransient] Set this conversation as transient conversation.
24417 */
24418
24419
24420module.exports = AV.Object.extend('_Conversation',
24421/** @lends AV.Conversation.prototype */
24422{
24423 constructor: function constructor(name) {
24424 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24425 AV.Object.prototype.constructor.call(this, null, null);
24426 this.set('name', name);
24427
24428 if (options.isSystem !== undefined) {
24429 this.set('sys', options.isSystem ? true : false);
24430 }
24431
24432 if (options.isTransient !== undefined) {
24433 this.set('tr', options.isTransient ? true : false);
24434 }
24435 },
24436
24437 /**
24438 * Get current conversation's creator.
24439 *
24440 * @return {String}
24441 */
24442 getCreator: function getCreator() {
24443 return this.get('c');
24444 },
24445
24446 /**
24447 * Get the last message's time.
24448 *
24449 * @return {Date}
24450 */
24451 getLastMessageAt: function getLastMessageAt() {
24452 return this.get('lm');
24453 },
24454
24455 /**
24456 * Get this conversation's members
24457 *
24458 * @return {String[]}
24459 */
24460 getMembers: function getMembers() {
24461 return this.get('m');
24462 },
24463
24464 /**
24465 * Add a member to this conversation
24466 *
24467 * @param {String} member
24468 */
24469 addMember: function addMember(member) {
24470 return this.add('m', member);
24471 },
24472
24473 /**
24474 * Get this conversation's members who set this conversation as muted.
24475 *
24476 * @return {String[]}
24477 */
24478 getMutedMembers: function getMutedMembers() {
24479 return this.get('mu');
24480 },
24481
24482 /**
24483 * Get this conversation's name field.
24484 *
24485 * @return String
24486 */
24487 getName: function getName() {
24488 return this.get('name');
24489 },
24490
24491 /**
24492 * Returns true if this conversation is transient conversation.
24493 *
24494 * @return {Boolean}
24495 */
24496 isTransient: function isTransient() {
24497 return this.get('tr');
24498 },
24499
24500 /**
24501 * Returns true if this conversation is system conversation.
24502 *
24503 * @return {Boolean}
24504 */
24505 isSystem: function isSystem() {
24506 return this.get('sys');
24507 },
24508
24509 /**
24510 * Send realtime message to this conversation, using HTTP request.
24511 *
24512 * @param {String} fromClient Sender's client id.
24513 * @param {String|Object} message The message which will send to conversation.
24514 * It could be a raw string, or an object with a `toJSON` method, like a
24515 * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}
24516 * @param {Object} [options]
24517 * @param {Boolean} [options.transient] Whether send this message as transient message or not.
24518 * @param {String[]} [options.toClients] Ids of clients to send to. This option can be used only in system conversation.
24519 * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}
24520 * @param {AuthOptions} [authOptions]
24521 * @return {Promise}
24522 */
24523 send: function send(fromClient, message) {
24524 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24525 var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24526 var data = {
24527 from_peer: fromClient,
24528 conv_id: this.id,
24529 transient: false,
24530 message: serializeMessage(message)
24531 };
24532
24533 if (options.toClients !== undefined) {
24534 data.to_peers = options.toClients;
24535 }
24536
24537 if (options.transient !== undefined) {
24538 data.transient = options.transient ? true : false;
24539 }
24540
24541 if (options.pushData !== undefined) {
24542 data.push_data = options.pushData;
24543 }
24544
24545 return _request('rtm', 'messages', null, 'POST', data, authOptions);
24546 },
24547
24548 /**
24549 * Send realtime broadcast message to all clients, via this conversation, using HTTP request.
24550 *
24551 * @param {String} fromClient Sender's client id.
24552 * @param {String|Object} message The message which will send to conversation.
24553 * It could be a raw string, or an object with a `toJSON` method, like a
24554 * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}.
24555 * @param {Object} [options]
24556 * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}.
24557 * @param {Object} [options.validTill] The message will valid till this time.
24558 * @param {AuthOptions} [authOptions]
24559 * @return {Promise}
24560 */
24561 broadcast: function broadcast(fromClient, message) {
24562 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24563 var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24564 var data = {
24565 from_peer: fromClient,
24566 conv_id: this.id,
24567 message: serializeMessage(message)
24568 };
24569
24570 if (options.pushData !== undefined) {
24571 data.push = options.pushData;
24572 }
24573
24574 if (options.validTill !== undefined) {
24575 var ts = options.validTill;
24576
24577 if (_.isDate(ts)) {
24578 ts = ts.getTime();
24579 }
24580
24581 options.valid_till = ts;
24582 }
24583
24584 return _request('rtm', 'broadcast', null, 'POST', data, authOptions);
24585 }
24586});
24587
24588/***/ }),
24589/* 539 */
24590/***/ (function(module, exports, __webpack_require__) {
24591
24592"use strict";
24593
24594
24595var _interopRequireDefault = __webpack_require__(2);
24596
24597var _promise = _interopRequireDefault(__webpack_require__(10));
24598
24599var _map = _interopRequireDefault(__webpack_require__(39));
24600
24601var _concat = _interopRequireDefault(__webpack_require__(29));
24602
24603var _ = __webpack_require__(1);
24604
24605var _require = __webpack_require__(25),
24606 request = _require.request;
24607
24608var _require2 = __webpack_require__(28),
24609 ensureArray = _require2.ensureArray,
24610 parseDate = _require2.parseDate;
24611
24612var AV = __webpack_require__(59);
24613/**
24614 * The version change interval for Leaderboard
24615 * @enum
24616 */
24617
24618
24619AV.LeaderboardVersionChangeInterval = {
24620 NEVER: 'never',
24621 DAY: 'day',
24622 WEEK: 'week',
24623 MONTH: 'month'
24624};
24625/**
24626 * The order of the leaderboard results
24627 * @enum
24628 */
24629
24630AV.LeaderboardOrder = {
24631 ASCENDING: 'ascending',
24632 DESCENDING: 'descending'
24633};
24634/**
24635 * The update strategy for Leaderboard
24636 * @enum
24637 */
24638
24639AV.LeaderboardUpdateStrategy = {
24640 /** Only keep the best statistic. If the leaderboard is in descending order, the best statistic is the highest one. */
24641 BETTER: 'better',
24642
24643 /** Keep the last updated statistic */
24644 LAST: 'last',
24645
24646 /** Keep the sum of all updated statistics */
24647 SUM: 'sum'
24648};
24649/**
24650 * @typedef {Object} Ranking
24651 * @property {number} rank Starts at 0
24652 * @property {number} value the statistic value of this ranking
24653 * @property {AV.User} user The user of this ranking
24654 * @property {Statistic[]} [includedStatistics] Other statistics of the user, specified by the `includeStatistic` option of `AV.Leaderboard.getResults()`
24655 */
24656
24657/**
24658 * @typedef {Object} LeaderboardArchive
24659 * @property {string} statisticName
24660 * @property {number} version version of the leaderboard
24661 * @property {string} status
24662 * @property {string} url URL for the downloadable archive
24663 * @property {Date} activatedAt time when this version became active
24664 * @property {Date} deactivatedAt time when this version was deactivated by a version incrementing
24665 */
24666
24667/**
24668 * @class
24669 */
24670
24671function Statistic(_ref) {
24672 var name = _ref.name,
24673 value = _ref.value,
24674 version = _ref.version;
24675
24676 /**
24677 * @type {string}
24678 */
24679 this.name = name;
24680 /**
24681 * @type {number}
24682 */
24683
24684 this.value = value;
24685 /**
24686 * @type {number?}
24687 */
24688
24689 this.version = version;
24690}
24691
24692var parseStatisticData = function parseStatisticData(statisticData) {
24693 var _AV$_decode = AV._decode(statisticData),
24694 name = _AV$_decode.statisticName,
24695 value = _AV$_decode.statisticValue,
24696 version = _AV$_decode.version;
24697
24698 return new Statistic({
24699 name: name,
24700 value: value,
24701 version: version
24702 });
24703};
24704/**
24705 * @class
24706 */
24707
24708
24709AV.Leaderboard = function Leaderboard(statisticName) {
24710 /**
24711 * @type {string}
24712 */
24713 this.statisticName = statisticName;
24714 /**
24715 * @type {AV.LeaderboardOrder}
24716 */
24717
24718 this.order = undefined;
24719 /**
24720 * @type {AV.LeaderboardUpdateStrategy}
24721 */
24722
24723 this.updateStrategy = undefined;
24724 /**
24725 * @type {AV.LeaderboardVersionChangeInterval}
24726 */
24727
24728 this.versionChangeInterval = undefined;
24729 /**
24730 * @type {number}
24731 */
24732
24733 this.version = undefined;
24734 /**
24735 * @type {Date?}
24736 */
24737
24738 this.nextResetAt = undefined;
24739 /**
24740 * @type {Date?}
24741 */
24742
24743 this.createdAt = undefined;
24744};
24745
24746var Leaderboard = AV.Leaderboard;
24747/**
24748 * Create an instance of Leaderboard for the give statistic name.
24749 * @param {string} statisticName
24750 * @return {AV.Leaderboard}
24751 */
24752
24753AV.Leaderboard.createWithoutData = function (statisticName) {
24754 return new Leaderboard(statisticName);
24755};
24756/**
24757 * (masterKey required) Create a new Leaderboard.
24758 * @param {Object} options
24759 * @param {string} options.statisticName
24760 * @param {AV.LeaderboardOrder} options.order
24761 * @param {AV.LeaderboardVersionChangeInterval} [options.versionChangeInterval] default to WEEK
24762 * @param {AV.LeaderboardUpdateStrategy} [options.updateStrategy] default to BETTER
24763 * @param {AuthOptions} [authOptions]
24764 * @return {Promise<AV.Leaderboard>}
24765 */
24766
24767
24768AV.Leaderboard.createLeaderboard = function (_ref2, authOptions) {
24769 var statisticName = _ref2.statisticName,
24770 order = _ref2.order,
24771 versionChangeInterval = _ref2.versionChangeInterval,
24772 updateStrategy = _ref2.updateStrategy;
24773 return request({
24774 method: 'POST',
24775 path: '/leaderboard/leaderboards',
24776 data: {
24777 statisticName: statisticName,
24778 order: order,
24779 versionChangeInterval: versionChangeInterval,
24780 updateStrategy: updateStrategy
24781 },
24782 authOptions: authOptions
24783 }).then(function (data) {
24784 var leaderboard = new Leaderboard(statisticName);
24785 return leaderboard._finishFetch(data);
24786 });
24787};
24788/**
24789 * Get the Leaderboard with the specified statistic name.
24790 * @param {string} statisticName
24791 * @param {AuthOptions} [authOptions]
24792 * @return {Promise<AV.Leaderboard>}
24793 */
24794
24795
24796AV.Leaderboard.getLeaderboard = function (statisticName, authOptions) {
24797 return Leaderboard.createWithoutData(statisticName).fetch(authOptions);
24798};
24799/**
24800 * Get Statistics for the specified user.
24801 * @param {AV.User} user The specified AV.User pointer.
24802 * @param {Object} [options]
24803 * @param {string[]} [options.statisticNames] Specify the statisticNames. If not set, all statistics of the user will be fetched.
24804 * @param {AuthOptions} [authOptions]
24805 * @return {Promise<Statistic[]>}
24806 */
24807
24808
24809AV.Leaderboard.getStatistics = function (user) {
24810 var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
24811 statisticNames = _ref3.statisticNames;
24812
24813 var authOptions = arguments.length > 2 ? arguments[2] : undefined;
24814 return _promise.default.resolve().then(function () {
24815 if (!(user && user.id)) throw new Error('user must be an AV.User');
24816 return request({
24817 method: 'GET',
24818 path: "/leaderboard/users/".concat(user.id, "/statistics"),
24819 query: {
24820 statistics: statisticNames ? ensureArray(statisticNames).join(',') : undefined
24821 },
24822 authOptions: authOptions
24823 }).then(function (_ref4) {
24824 var results = _ref4.results;
24825 return (0, _map.default)(results).call(results, parseStatisticData);
24826 });
24827 });
24828};
24829/**
24830 * Update Statistics for the specified user.
24831 * @param {AV.User} user The specified AV.User pointer.
24832 * @param {Object} statistics A name-value pair representing the statistics to update.
24833 * @param {AuthOptions} [options] AuthOptions plus:
24834 * @param {boolean} [options.overwrite] Wethere to overwrite these statistics disregarding the updateStrategy of there leaderboards
24835 * @return {Promise<Statistic[]>}
24836 */
24837
24838
24839AV.Leaderboard.updateStatistics = function (user, statistics) {
24840 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24841 return _promise.default.resolve().then(function () {
24842 if (!(user && user.id)) throw new Error('user must be an AV.User');
24843 var data = (0, _map.default)(_).call(_, statistics, function (value, key) {
24844 return {
24845 statisticName: key,
24846 statisticValue: value
24847 };
24848 });
24849 var overwrite = options.overwrite;
24850 return request({
24851 method: 'POST',
24852 path: "/leaderboard/users/".concat(user.id, "/statistics"),
24853 query: {
24854 overwrite: overwrite ? 1 : undefined
24855 },
24856 data: data,
24857 authOptions: options
24858 }).then(function (_ref5) {
24859 var results = _ref5.results;
24860 return (0, _map.default)(results).call(results, parseStatisticData);
24861 });
24862 });
24863};
24864/**
24865 * Delete Statistics for the specified user.
24866 * @param {AV.User} user The specified AV.User pointer.
24867 * @param {Object} statistics A name-value pair representing the statistics to delete.
24868 * @param {AuthOptions} [options]
24869 * @return {Promise<void>}
24870 */
24871
24872
24873AV.Leaderboard.deleteStatistics = function (user, statisticNames, authOptions) {
24874 return _promise.default.resolve().then(function () {
24875 if (!(user && user.id)) throw new Error('user must be an AV.User');
24876 return request({
24877 method: 'DELETE',
24878 path: "/leaderboard/users/".concat(user.id, "/statistics"),
24879 query: {
24880 statistics: ensureArray(statisticNames).join(',')
24881 },
24882 authOptions: authOptions
24883 }).then(function () {
24884 return undefined;
24885 });
24886 });
24887};
24888
24889_.extend(Leaderboard.prototype,
24890/** @lends AV.Leaderboard.prototype */
24891{
24892 _finishFetch: function _finishFetch(data) {
24893 var _this = this;
24894
24895 _.forEach(data, function (value, key) {
24896 if (key === 'updatedAt' || key === 'objectId') return;
24897
24898 if (key === 'expiredAt') {
24899 key = 'nextResetAt';
24900 }
24901
24902 if (key === 'createdAt') {
24903 value = parseDate(value);
24904 }
24905
24906 if (value && value.__type === 'Date') {
24907 value = parseDate(value.iso);
24908 }
24909
24910 _this[key] = value;
24911 });
24912
24913 return this;
24914 },
24915
24916 /**
24917 * Fetch data from the srever.
24918 * @param {AuthOptions} [authOptions]
24919 * @return {Promise<AV.Leaderboard>}
24920 */
24921 fetch: function fetch(authOptions) {
24922 var _this2 = this;
24923
24924 return request({
24925 method: 'GET',
24926 path: "/leaderboard/leaderboards/".concat(this.statisticName),
24927 authOptions: authOptions
24928 }).then(function (data) {
24929 return _this2._finishFetch(data);
24930 });
24931 },
24932
24933 /**
24934 * Counts the number of users participated in this leaderboard
24935 * @param {Object} [options]
24936 * @param {number} [options.version] Specify the version of the leaderboard
24937 * @param {AuthOptions} [authOptions]
24938 * @return {Promise<number>}
24939 */
24940 count: function count() {
24941 var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
24942 version = _ref6.version;
24943
24944 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
24945 return request({
24946 method: 'GET',
24947 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks"),
24948 query: {
24949 count: 1,
24950 limit: 0,
24951 version: version
24952 },
24953 authOptions: authOptions
24954 }).then(function (_ref7) {
24955 var count = _ref7.count;
24956 return count;
24957 });
24958 },
24959 _getResults: function _getResults(_ref8, authOptions, userId) {
24960 var _context;
24961
24962 var skip = _ref8.skip,
24963 limit = _ref8.limit,
24964 selectUserKeys = _ref8.selectUserKeys,
24965 includeUserKeys = _ref8.includeUserKeys,
24966 includeStatistics = _ref8.includeStatistics,
24967 version = _ref8.version;
24968 return request({
24969 method: 'GET',
24970 path: (0, _concat.default)(_context = "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks")).call(_context, userId ? "/".concat(userId) : ''),
24971 query: {
24972 skip: skip,
24973 limit: limit,
24974 selectUserKeys: _.union(ensureArray(selectUserKeys), ensureArray(includeUserKeys)).join(',') || undefined,
24975 includeUser: includeUserKeys ? ensureArray(includeUserKeys).join(',') : undefined,
24976 includeStatistics: includeStatistics ? ensureArray(includeStatistics).join(',') : undefined,
24977 version: version
24978 },
24979 authOptions: authOptions
24980 }).then(function (_ref9) {
24981 var rankings = _ref9.results;
24982 return (0, _map.default)(rankings).call(rankings, function (rankingData) {
24983 var _AV$_decode2 = AV._decode(rankingData),
24984 user = _AV$_decode2.user,
24985 value = _AV$_decode2.statisticValue,
24986 rank = _AV$_decode2.rank,
24987 _AV$_decode2$statisti = _AV$_decode2.statistics,
24988 statistics = _AV$_decode2$statisti === void 0 ? [] : _AV$_decode2$statisti;
24989
24990 return {
24991 user: user,
24992 value: value,
24993 rank: rank,
24994 includedStatistics: (0, _map.default)(statistics).call(statistics, parseStatisticData)
24995 };
24996 });
24997 });
24998 },
24999
25000 /**
25001 * Retrieve a list of ranked users for this Leaderboard.
25002 * @param {Object} [options]
25003 * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
25004 * @param {number} [options.limit] The limit of the number of results.
25005 * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
25006 * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
25007 * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
25008 * @param {number} [options.version] Specify the version of the leaderboard
25009 * @param {AuthOptions} [authOptions]
25010 * @return {Promise<Ranking[]>}
25011 */
25012 getResults: function getResults() {
25013 var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25014 skip = _ref10.skip,
25015 limit = _ref10.limit,
25016 selectUserKeys = _ref10.selectUserKeys,
25017 includeUserKeys = _ref10.includeUserKeys,
25018 includeStatistics = _ref10.includeStatistics,
25019 version = _ref10.version;
25020
25021 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25022 return this._getResults({
25023 skip: skip,
25024 limit: limit,
25025 selectUserKeys: selectUserKeys,
25026 includeUserKeys: includeUserKeys,
25027 includeStatistics: includeStatistics,
25028 version: version
25029 }, authOptions);
25030 },
25031
25032 /**
25033 * Retrieve a list of ranked users for this Leaderboard, centered on the specified user.
25034 * @param {AV.User} user The specified AV.User pointer.
25035 * @param {Object} [options]
25036 * @param {number} [options.limit] The limit of the number of results.
25037 * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
25038 * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
25039 * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
25040 * @param {number} [options.version] Specify the version of the leaderboard
25041 * @param {AuthOptions} [authOptions]
25042 * @return {Promise<Ranking[]>}
25043 */
25044 getResultsAroundUser: function getResultsAroundUser(user) {
25045 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25046 var authOptions = arguments.length > 2 ? arguments[2] : undefined;
25047
25048 // getResultsAroundUser(options, authOptions)
25049 if (user && typeof user.id !== 'string') {
25050 return this.getResultsAroundUser(undefined, user, options);
25051 }
25052
25053 var limit = options.limit,
25054 selectUserKeys = options.selectUserKeys,
25055 includeUserKeys = options.includeUserKeys,
25056 includeStatistics = options.includeStatistics,
25057 version = options.version;
25058 return this._getResults({
25059 limit: limit,
25060 selectUserKeys: selectUserKeys,
25061 includeUserKeys: includeUserKeys,
25062 includeStatistics: includeStatistics,
25063 version: version
25064 }, authOptions, user ? user.id : 'self');
25065 },
25066 _update: function _update(data, authOptions) {
25067 var _this3 = this;
25068
25069 return request({
25070 method: 'PUT',
25071 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25072 data: data,
25073 authOptions: authOptions
25074 }).then(function (result) {
25075 return _this3._finishFetch(result);
25076 });
25077 },
25078
25079 /**
25080 * (masterKey required) Update the version change interval of the Leaderboard.
25081 * @param {AV.LeaderboardVersionChangeInterval} versionChangeInterval
25082 * @param {AuthOptions} [authOptions]
25083 * @return {Promise<AV.Leaderboard>}
25084 */
25085 updateVersionChangeInterval: function updateVersionChangeInterval(versionChangeInterval, authOptions) {
25086 return this._update({
25087 versionChangeInterval: versionChangeInterval
25088 }, authOptions);
25089 },
25090
25091 /**
25092 * (masterKey required) Update the version change interval of the Leaderboard.
25093 * @param {AV.LeaderboardUpdateStrategy} updateStrategy
25094 * @param {AuthOptions} [authOptions]
25095 * @return {Promise<AV.Leaderboard>}
25096 */
25097 updateUpdateStrategy: function updateUpdateStrategy(updateStrategy, authOptions) {
25098 return this._update({
25099 updateStrategy: updateStrategy
25100 }, authOptions);
25101 },
25102
25103 /**
25104 * (masterKey required) Reset the Leaderboard. The version of the Leaderboard will be incremented by 1.
25105 * @param {AuthOptions} [authOptions]
25106 * @return {Promise<AV.Leaderboard>}
25107 */
25108 reset: function reset(authOptions) {
25109 var _this4 = this;
25110
25111 return request({
25112 method: 'PUT',
25113 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/incrementVersion"),
25114 authOptions: authOptions
25115 }).then(function (data) {
25116 return _this4._finishFetch(data);
25117 });
25118 },
25119
25120 /**
25121 * (masterKey required) Delete the Leaderboard and its all archived versions.
25122 * @param {AuthOptions} [authOptions]
25123 * @return {void}
25124 */
25125 destroy: function destroy(authOptions) {
25126 return AV.request({
25127 method: 'DELETE',
25128 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25129 authOptions: authOptions
25130 }).then(function () {
25131 return undefined;
25132 });
25133 },
25134
25135 /**
25136 * (masterKey required) Get archived versions.
25137 * @param {Object} [options]
25138 * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
25139 * @param {number} [options.limit] The limit of the number of results.
25140 * @param {AuthOptions} [authOptions]
25141 * @return {Promise<LeaderboardArchive[]>}
25142 */
25143 getArchives: function getArchives() {
25144 var _this5 = this;
25145
25146 var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25147 skip = _ref11.skip,
25148 limit = _ref11.limit;
25149
25150 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25151 return request({
25152 method: 'GET',
25153 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/archives"),
25154 query: {
25155 skip: skip,
25156 limit: limit
25157 },
25158 authOptions: authOptions
25159 }).then(function (_ref12) {
25160 var results = _ref12.results;
25161 return (0, _map.default)(results).call(results, function (_ref13) {
25162 var version = _ref13.version,
25163 status = _ref13.status,
25164 url = _ref13.url,
25165 activatedAt = _ref13.activatedAt,
25166 deactivatedAt = _ref13.deactivatedAt;
25167 return {
25168 statisticName: _this5.statisticName,
25169 version: version,
25170 status: status,
25171 url: url,
25172 activatedAt: parseDate(activatedAt.iso),
25173 deactivatedAt: parseDate(deactivatedAt.iso)
25174 };
25175 });
25176 });
25177 }
25178});
25179
25180/***/ })
25181/******/ ]);
25182});
25183//# sourceMappingURL=av-core.js.map
\No newline at end of file