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() {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
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 |
|
67 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
68 |
|
69 |
|
70 | __webpack_require__.p = "";
|
71 |
|
72 |
|
73 | return __webpack_require__(__webpack_require__.s = 281);
|
74 | })
|
75 |
|
76 | ([
|
77 |
|
78 | (function(module, exports, __webpack_require__) {
|
79 |
|
80 | "use strict";
|
81 |
|
82 | var global = __webpack_require__(8);
|
83 | var apply = __webpack_require__(79);
|
84 | var uncurryThis = __webpack_require__(4);
|
85 | var isCallable = __webpack_require__(9);
|
86 | var getOwnPropertyDescriptor = __webpack_require__(64).f;
|
87 | var isForced = __webpack_require__(159);
|
88 | var path = __webpack_require__(7);
|
89 | var bind = __webpack_require__(52);
|
90 | var createNonEnumerableProperty = __webpack_require__(39);
|
91 | var hasOwn = __webpack_require__(13);
|
92 |
|
93 | var 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 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 | module.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 |
|
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 |
|
149 | sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
|
150 |
|
151 | if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
|
152 |
|
153 |
|
154 | if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
|
155 |
|
156 | else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
|
157 |
|
158 | else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);
|
159 |
|
160 | else resultProperty = sourceProperty;
|
161 |
|
162 |
|
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 |
|
175 | createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);
|
176 |
|
177 | if (options.real && targetPrototype && !targetPrototype[key]) {
|
178 | createNonEnumerableProperty(targetPrototype, key, sourceProperty);
|
179 | }
|
180 | }
|
181 | }
|
182 | };
|
183 |
|
184 |
|
185 | }),
|
186 |
|
187 | (function(module, exports) {
|
188 |
|
189 | function _interopRequireDefault(obj) {
|
190 | return obj && obj.__esModule ? obj : {
|
191 | "default": obj
|
192 | };
|
193 | }
|
194 |
|
195 | module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
196 |
|
197 | }),
|
198 |
|
199 | (function(module, exports) {
|
200 |
|
201 | module.exports = function (exec) {
|
202 | try {
|
203 | return !!exec();
|
204 | } catch (error) {
|
205 | return true;
|
206 | }
|
207 | };
|
208 |
|
209 |
|
210 | }),
|
211 |
|
212 | (function(module, __webpack_exports__, __webpack_require__) {
|
213 |
|
214 | "use strict";
|
215 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
216 | var __WEBPACK_IMPORTED_MODULE_0__index_default_js__ = __webpack_require__(321);
|
217 | __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__index_default_js__["a"]; });
|
218 | var __WEBPACK_IMPORTED_MODULE_1__index_js__ = __webpack_require__(134);
|
219 | __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["VERSION"]; });
|
220 | __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["restArguments"]; });
|
221 | __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isObject"]; });
|
222 | __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNull"]; });
|
223 | __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isUndefined"]; });
|
224 | __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isBoolean"]; });
|
225 | __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isElement"]; });
|
226 | __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isString"]; });
|
227 | __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNumber"]; });
|
228 | __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDate"]; });
|
229 | __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isRegExp"]; });
|
230 | __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isError"]; });
|
231 | __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSymbol"]; });
|
232 | __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArrayBuffer"]; });
|
233 | __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDataView"]; });
|
234 | __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArray"]; });
|
235 | __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFunction"]; });
|
236 | __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArguments"]; });
|
237 | __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFinite"]; });
|
238 | __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNaN"]; });
|
239 | __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isTypedArray"]; });
|
240 | __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEmpty"]; });
|
241 | __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMatch"]; });
|
242 | __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEqual"]; });
|
243 | __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMap"]; });
|
244 | __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakMap"]; });
|
245 | __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSet"]; });
|
246 | __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakSet"]; });
|
247 | __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["keys"]; });
|
248 | __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["allKeys"]; });
|
249 | __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["values"]; });
|
250 | __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pairs"]; });
|
251 | __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invert"]; });
|
252 | __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["functions"]; });
|
253 | __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["methods"]; });
|
254 | __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extend"]; });
|
255 | __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extendOwn"]; });
|
256 | __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["assign"]; });
|
257 | __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defaults"]; });
|
258 | __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["create"]; });
|
259 | __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["clone"]; });
|
260 | __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tap"]; });
|
261 | __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["get"]; });
|
262 | __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["has"]; });
|
263 | __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mapObject"]; });
|
264 | __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["identity"]; });
|
265 | __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["constant"]; });
|
266 | __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["noop"]; });
|
267 | __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toPath"]; });
|
268 | __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["property"]; });
|
269 | __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["propertyOf"]; });
|
270 | __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matcher"]; });
|
271 | __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matches"]; });
|
272 | __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["times"]; });
|
273 | __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["random"]; });
|
274 | __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["now"]; });
|
275 | __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["escape"]; });
|
276 | __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unescape"]; });
|
277 | __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["templateSettings"]; });
|
278 | __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["template"]; });
|
279 | __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["result"]; });
|
280 | __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniqueId"]; });
|
281 | __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chain"]; });
|
282 | __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["iteratee"]; });
|
283 | __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partial"]; });
|
284 | __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bind"]; });
|
285 | __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bindAll"]; });
|
286 | __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["memoize"]; });
|
287 | __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["delay"]; });
|
288 | __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defer"]; });
|
289 | __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["throttle"]; });
|
290 | __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["debounce"]; });
|
291 | __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["wrap"]; });
|
292 | __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["negate"]; });
|
293 | __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compose"]; });
|
294 | __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["after"]; });
|
295 | __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["before"]; });
|
296 | __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["once"]; });
|
297 | __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findKey"]; });
|
298 | __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findIndex"]; });
|
299 | __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findLastIndex"]; });
|
300 | __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortedIndex"]; });
|
301 | __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexOf"]; });
|
302 | __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["lastIndexOf"]; });
|
303 | __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["find"]; });
|
304 | __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["detect"]; });
|
305 | __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findWhere"]; });
|
306 | __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["each"]; });
|
307 | __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["forEach"]; });
|
308 | __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["map"]; });
|
309 | __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["collect"]; });
|
310 | __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduce"]; });
|
311 | __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldl"]; });
|
312 | __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["inject"]; });
|
313 | __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduceRight"]; });
|
314 | __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldr"]; });
|
315 | __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["filter"]; });
|
316 | __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["select"]; });
|
317 | __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reject"]; });
|
318 | __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["every"]; });
|
319 | __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["all"]; });
|
320 | __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["some"]; });
|
321 | __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["any"]; });
|
322 | __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["contains"]; });
|
323 | __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["includes"]; });
|
324 | __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["include"]; });
|
325 | __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invoke"]; });
|
326 | __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pluck"]; });
|
327 | __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["where"]; });
|
328 | __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["max"]; });
|
329 | __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["min"]; });
|
330 | __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["shuffle"]; });
|
331 | __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sample"]; });
|
332 | __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortBy"]; });
|
333 | __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["groupBy"]; });
|
334 | __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexBy"]; });
|
335 | __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["countBy"]; });
|
336 | __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partition"]; });
|
337 | __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toArray"]; });
|
338 | __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["size"]; });
|
339 | __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pick"]; });
|
340 | __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["omit"]; });
|
341 | __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["first"]; });
|
342 | __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["head"]; });
|
343 | __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["take"]; });
|
344 | __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["initial"]; });
|
345 | __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["last"]; });
|
346 | __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["rest"]; });
|
347 | __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tail"]; });
|
348 | __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["drop"]; });
|
349 | __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compact"]; });
|
350 | __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["flatten"]; });
|
351 | __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["without"]; });
|
352 | __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniq"]; });
|
353 | __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unique"]; });
|
354 | __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["union"]; });
|
355 | __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["intersection"]; });
|
356 | __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["difference"]; });
|
357 | __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unzip"]; });
|
358 | __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["transpose"]; });
|
359 | __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["zip"]; });
|
360 | __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["object"]; });
|
361 | __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["range"]; });
|
362 | __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chunk"]; });
|
363 | __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mixin"]; });
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 | }),
|
385 |
|
386 | (function(module, exports, __webpack_require__) {
|
387 |
|
388 | var NATIVE_BIND = __webpack_require__(80);
|
389 |
|
390 | var FunctionPrototype = Function.prototype;
|
391 | var bind = FunctionPrototype.bind;
|
392 | var call = FunctionPrototype.call;
|
393 | var uncurryThis = NATIVE_BIND && bind.bind(call, call);
|
394 |
|
395 | module.exports = NATIVE_BIND ? function (fn) {
|
396 | return fn && uncurryThis(fn);
|
397 | } : function (fn) {
|
398 | return fn && function () {
|
399 | return call.apply(fn, arguments);
|
400 | };
|
401 | };
|
402 |
|
403 |
|
404 | }),
|
405 |
|
406 | (function(module, exports, __webpack_require__) {
|
407 |
|
408 | var global = __webpack_require__(8);
|
409 | var shared = __webpack_require__(82);
|
410 | var hasOwn = __webpack_require__(13);
|
411 | var uid = __webpack_require__(101);
|
412 | var NATIVE_SYMBOL = __webpack_require__(65);
|
413 | var USE_SYMBOL_AS_UID = __webpack_require__(157);
|
414 |
|
415 | var WellKnownSymbolsStore = shared('wks');
|
416 | var Symbol = global.Symbol;
|
417 | var symbolFor = Symbol && Symbol['for'];
|
418 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
|
419 |
|
420 | module.exports = function (name) {
|
421 | if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
|
422 | var description = 'Symbol.' + name;
|
423 | if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
|
424 | WellKnownSymbolsStore[name] = Symbol[name];
|
425 | } else if (USE_SYMBOL_AS_UID && symbolFor) {
|
426 | WellKnownSymbolsStore[name] = symbolFor(description);
|
427 | } else {
|
428 | WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
429 | }
|
430 | } return WellKnownSymbolsStore[name];
|
431 | };
|
432 |
|
433 |
|
434 | }),
|
435 |
|
436 | (function(module, __webpack_exports__, __webpack_require__) {
|
437 |
|
438 | "use strict";
|
439 | (function(global) { __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; });
|
440 | __webpack_require__.d(__webpack_exports__, "p", function() { return root; });
|
441 | __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; });
|
442 | __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; });
|
443 | __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; });
|
444 | __webpack_require__.d(__webpack_exports__, "o", function() { return push; });
|
445 | __webpack_require__.d(__webpack_exports__, "q", function() { return slice; });
|
446 | __webpack_require__.d(__webpack_exports__, "t", function() { return toString; });
|
447 | __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; });
|
448 | __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; });
|
449 | __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; });
|
450 | __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; });
|
451 | __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; });
|
452 | __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; });
|
453 | __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; });
|
454 | __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; });
|
455 | __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; });
|
456 | __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; });
|
457 | __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; });
|
458 | __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; });
|
459 |
|
460 | var VERSION = '1.12.1';
|
461 |
|
462 |
|
463 |
|
464 |
|
465 | var root = typeof self == 'object' && self.self === self && self ||
|
466 | typeof global == 'object' && global.global === global && global ||
|
467 | Function('return this')() ||
|
468 | {};
|
469 |
|
470 |
|
471 | var ArrayProto = Array.prototype, ObjProto = Object.prototype;
|
472 | var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
|
473 |
|
474 |
|
475 | var push = ArrayProto.push,
|
476 | slice = ArrayProto.slice,
|
477 | toString = ObjProto.toString,
|
478 | hasOwnProperty = ObjProto.hasOwnProperty;
|
479 |
|
480 |
|
481 | var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
|
482 | supportsDataView = typeof DataView !== 'undefined';
|
483 |
|
484 |
|
485 |
|
486 | var nativeIsArray = Array.isArray,
|
487 | nativeKeys = Object.keys,
|
488 | nativeCreate = Object.create,
|
489 | nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
|
490 |
|
491 |
|
492 | var _isNaN = isNaN,
|
493 | _isFinite = isFinite;
|
494 |
|
495 |
|
496 | var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
|
497 | var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
|
498 | 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
|
499 |
|
500 |
|
501 | var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
|
502 |
|
503 | }.call(__webpack_exports__, __webpack_require__(78)))
|
504 |
|
505 | }),
|
506 |
|
507 | (function(module, exports) {
|
508 |
|
509 | module.exports = {};
|
510 |
|
511 |
|
512 | }),
|
513 |
|
514 | (function(module, exports, __webpack_require__) {
|
515 |
|
516 | (function(global) {var check = function (it) {
|
517 | return it && it.Math == Math && it;
|
518 | };
|
519 |
|
520 |
|
521 | module.exports =
|
522 |
|
523 | check(typeof globalThis == 'object' && globalThis) ||
|
524 | check(typeof window == 'object' && window) ||
|
525 |
|
526 | check(typeof self == 'object' && self) ||
|
527 | check(typeof global == 'object' && global) ||
|
528 |
|
529 | (function () { return this; })() || Function('return this')();
|
530 |
|
531 | }.call(exports, __webpack_require__(78)))
|
532 |
|
533 | }),
|
534 |
|
535 | (function(module, exports) {
|
536 |
|
537 |
|
538 |
|
539 | module.exports = function (argument) {
|
540 | return typeof argument == 'function';
|
541 | };
|
542 |
|
543 |
|
544 | }),
|
545 |
|
546 | (function(module, exports, __webpack_require__) {
|
547 |
|
548 | var path = __webpack_require__(7);
|
549 | var hasOwn = __webpack_require__(13);
|
550 | var wrappedWellKnownSymbolModule = __webpack_require__(151);
|
551 | var defineProperty = __webpack_require__(23).f;
|
552 |
|
553 | module.exports = function (NAME) {
|
554 | var Symbol = path.Symbol || (path.Symbol = {});
|
555 | if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
|
556 | value: wrappedWellKnownSymbolModule.f(NAME)
|
557 | });
|
558 | };
|
559 |
|
560 |
|
561 | }),
|
562 |
|
563 | (function(module, exports, __webpack_require__) {
|
564 |
|
565 | var isCallable = __webpack_require__(9);
|
566 |
|
567 | module.exports = function (it) {
|
568 | return typeof it == 'object' ? it !== null : isCallable(it);
|
569 | };
|
570 |
|
571 |
|
572 | }),
|
573 |
|
574 | (function(module, exports, __webpack_require__) {
|
575 |
|
576 | module.exports = __webpack_require__(285);
|
577 |
|
578 | }),
|
579 |
|
580 | (function(module, exports, __webpack_require__) {
|
581 |
|
582 | var uncurryThis = __webpack_require__(4);
|
583 | var toObject = __webpack_require__(33);
|
584 |
|
585 | var hasOwnProperty = uncurryThis({}.hasOwnProperty);
|
586 |
|
587 |
|
588 |
|
589 |
|
590 | module.exports = Object.hasOwn || function hasOwn(it, key) {
|
591 | return hasOwnProperty(toObject(it), key);
|
592 | };
|
593 |
|
594 |
|
595 | }),
|
596 |
|
597 | (function(module, exports, __webpack_require__) {
|
598 |
|
599 | var fails = __webpack_require__(2);
|
600 |
|
601 |
|
602 | module.exports = !fails(function () {
|
603 |
|
604 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
605 | });
|
606 |
|
607 |
|
608 | }),
|
609 |
|
610 | (function(module, exports, __webpack_require__) {
|
611 |
|
612 | var NATIVE_BIND = __webpack_require__(80);
|
613 |
|
614 | var call = Function.prototype.call;
|
615 |
|
616 | module.exports = NATIVE_BIND ? call.bind(call) : function () {
|
617 | return call.apply(call, arguments);
|
618 | };
|
619 |
|
620 |
|
621 | }),
|
622 |
|
623 | (function(module, exports, __webpack_require__) {
|
624 |
|
625 | var uncurryThis = __webpack_require__(4);
|
626 |
|
627 | module.exports = uncurryThis({}.isPrototypeOf);
|
628 |
|
629 |
|
630 | }),
|
631 |
|
632 | (function(module, __webpack_exports__, __webpack_require__) {
|
633 |
|
634 | "use strict";
|
635 | __webpack_exports__["a"] = keys;
|
636 | var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(58);
|
637 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
638 | var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(47);
|
639 | var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(189);
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 | function keys(obj) {
|
648 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" ])(obj)) return [];
|
649 | if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" ]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" ])(obj);
|
650 | var keys = [];
|
651 | for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" ])(obj, key)) keys.push(key);
|
652 |
|
653 | if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" ]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" ])(obj, keys);
|
654 | return keys;
|
655 | }
|
656 |
|
657 |
|
658 | }),
|
659 |
|
660 | (function(module, __webpack_exports__, __webpack_require__) {
|
661 |
|
662 | "use strict";
|
663 | __webpack_exports__["a"] = tagTester;
|
664 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
665 |
|
666 |
|
667 |
|
668 | function tagTester(name) {
|
669 | var tag = '[object ' + name + ']';
|
670 | return function(obj) {
|
671 | return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" ].call(obj) === tag;
|
672 | };
|
673 | }
|
674 |
|
675 |
|
676 | }),
|
677 |
|
678 | (function(module, exports, __webpack_require__) {
|
679 |
|
680 | module.exports = __webpack_require__(393);
|
681 |
|
682 | }),
|
683 |
|
684 | (function(module, exports, __webpack_require__) {
|
685 |
|
686 | var path = __webpack_require__(7);
|
687 | var global = __webpack_require__(8);
|
688 | var isCallable = __webpack_require__(9);
|
689 |
|
690 | var aFunction = function (variable) {
|
691 | return isCallable(variable) ? variable : undefined;
|
692 | };
|
693 |
|
694 | module.exports = function (namespace, method) {
|
695 | return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
|
696 | : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
|
697 | };
|
698 |
|
699 |
|
700 | }),
|
701 |
|
702 | (function(module, exports, __webpack_require__) {
|
703 |
|
704 | var isObject = __webpack_require__(11);
|
705 |
|
706 | var $String = String;
|
707 | var $TypeError = TypeError;
|
708 |
|
709 |
|
710 | module.exports = function (argument) {
|
711 | if (isObject(argument)) return argument;
|
712 | throw $TypeError($String(argument) + ' is not an object');
|
713 | };
|
714 |
|
715 |
|
716 | }),
|
717 |
|
718 | (function(module, __webpack_exports__, __webpack_require__) {
|
719 |
|
720 | "use strict";
|
721 | __webpack_exports__["a"] = cb;
|
722 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
723 | var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(199);
|
724 | var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(200);
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 | function cb(value, context, argCount) {
|
732 | if (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].iteratee !== __WEBPACK_IMPORTED_MODULE_2__iteratee_js__["a" ]) return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].iteratee(value, context);
|
733 | return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" ])(value, context, argCount);
|
734 | }
|
735 |
|
736 |
|
737 | }),
|
738 |
|
739 | (function(module, exports, __webpack_require__) {
|
740 |
|
741 | var DESCRIPTORS = __webpack_require__(14);
|
742 | var IE8_DOM_DEFINE = __webpack_require__(158);
|
743 | var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(160);
|
744 | var anObject = __webpack_require__(21);
|
745 | var toPropertyKey = __webpack_require__(99);
|
746 |
|
747 | var $TypeError = TypeError;
|
748 |
|
749 | var $defineProperty = Object.defineProperty;
|
750 |
|
751 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
752 | var ENUMERABLE = 'enumerable';
|
753 | var CONFIGURABLE = 'configurable';
|
754 | var WRITABLE = 'writable';
|
755 |
|
756 |
|
757 |
|
758 | exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
|
759 | anObject(O);
|
760 | P = toPropertyKey(P);
|
761 | anObject(Attributes);
|
762 | if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
763 | var current = $getOwnPropertyDescriptor(O, P);
|
764 | if (current && current[WRITABLE]) {
|
765 | O[P] = Attributes.value;
|
766 | Attributes = {
|
767 | configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
|
768 | enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
769 | writable: false
|
770 | };
|
771 | }
|
772 | } return $defineProperty(O, P, Attributes);
|
773 | } : $defineProperty : function defineProperty(O, P, Attributes) {
|
774 | anObject(O);
|
775 | P = toPropertyKey(P);
|
776 | anObject(Attributes);
|
777 | if (IE8_DOM_DEFINE) try {
|
778 | return $defineProperty(O, P, Attributes);
|
779 | } catch (error) { }
|
780 | if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
|
781 | if ('value' in Attributes) O[P] = Attributes.value;
|
782 | return O;
|
783 | };
|
784 |
|
785 |
|
786 | }),
|
787 |
|
788 | (function(module, __webpack_exports__, __webpack_require__) {
|
789 |
|
790 | "use strict";
|
791 | __webpack_exports__["a"] = restArguments;
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 | function restArguments(func, startIndex) {
|
798 | startIndex = startIndex == null ? func.length - 1 : +startIndex;
|
799 | return function() {
|
800 | var length = Math.max(arguments.length - startIndex, 0),
|
801 | rest = Array(length),
|
802 | index = 0;
|
803 | for (; index < length; index++) {
|
804 | rest[index] = arguments[index + startIndex];
|
805 | }
|
806 | switch (startIndex) {
|
807 | case 0: return func.call(this, rest);
|
808 | case 1: return func.call(this, arguments[0], rest);
|
809 | case 2: return func.call(this, arguments[0], arguments[1], rest);
|
810 | }
|
811 | var args = Array(startIndex + 1);
|
812 | for (index = 0; index < startIndex; index++) {
|
813 | args[index] = arguments[index];
|
814 | }
|
815 | args[startIndex] = rest;
|
816 | return func.apply(this, args);
|
817 | };
|
818 | }
|
819 |
|
820 |
|
821 | }),
|
822 |
|
823 | (function(module, __webpack_exports__, __webpack_require__) {
|
824 |
|
825 | "use strict";
|
826 | __webpack_exports__["a"] = _;
|
827 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
828 |
|
829 |
|
830 |
|
831 |
|
832 |
|
833 | function _(obj) {
|
834 | if (obj instanceof _) return obj;
|
835 | if (!(this instanceof _)) return new _(obj);
|
836 | this._wrapped = obj;
|
837 | }
|
838 |
|
839 | _.VERSION = __WEBPACK_IMPORTED_MODULE_0__setup_js__["e" ];
|
840 |
|
841 |
|
842 | _.prototype.value = function() {
|
843 | return this._wrapped;
|
844 | };
|
845 |
|
846 |
|
847 |
|
848 | _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
|
849 |
|
850 | _.prototype.toString = function() {
|
851 | return String(this._wrapped);
|
852 | };
|
853 |
|
854 |
|
855 | }),
|
856 |
|
857 | (function(module, __webpack_exports__, __webpack_require__) {
|
858 |
|
859 | "use strict";
|
860 | var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(187);
|
861 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(31);
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ]));
|
870 |
|
871 |
|
872 | }),
|
873 |
|
874 | (function(module, exports, __webpack_require__) {
|
875 |
|
876 | var path = __webpack_require__(7);
|
877 |
|
878 | module.exports = function (CONSTRUCTOR) {
|
879 | return path[CONSTRUCTOR + 'Prototype'];
|
880 | };
|
881 |
|
882 |
|
883 | }),
|
884 |
|
885 | (function(module, exports, __webpack_require__) {
|
886 |
|
887 | "use strict";
|
888 |
|
889 |
|
890 | var _interopRequireDefault = __webpack_require__(1);
|
891 |
|
892 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
893 |
|
894 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
895 |
|
896 | var _ = __webpack_require__(3);
|
897 |
|
898 | var md5 = __webpack_require__(529);
|
899 |
|
900 | var _require = __webpack_require__(3),
|
901 | extend = _require.extend;
|
902 |
|
903 | var AV = __webpack_require__(74);
|
904 |
|
905 | var AVError = __webpack_require__(48);
|
906 |
|
907 | var _require2 = __webpack_require__(32),
|
908 | getSessionToken = _require2.getSessionToken;
|
909 |
|
910 | var ajax = __webpack_require__(117);
|
911 |
|
912 |
|
913 | var sign = function sign(key, isMasterKey) {
|
914 | var _context2;
|
915 |
|
916 | var now = new Date().getTime();
|
917 | var signature = md5(now + key);
|
918 |
|
919 | if (isMasterKey) {
|
920 | var _context;
|
921 |
|
922 | return (0, _concat.default)(_context = "".concat(signature, ",")).call(_context, now, ",master");
|
923 | }
|
924 |
|
925 | return (0, _concat.default)(_context2 = "".concat(signature, ",")).call(_context2, now);
|
926 | };
|
927 |
|
928 | var setAppKey = function setAppKey(headers, signKey) {
|
929 | if (signKey) {
|
930 | headers['X-LC-Sign'] = sign(AV.applicationKey);
|
931 | } else {
|
932 | headers['X-LC-Key'] = AV.applicationKey;
|
933 | }
|
934 | };
|
935 |
|
936 | var setHeaders = function setHeaders() {
|
937 | var authOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
938 | var signKey = arguments.length > 1 ? arguments[1] : undefined;
|
939 | var headers = {
|
940 | 'X-LC-Id': AV.applicationId,
|
941 | 'Content-Type': 'application/json;charset=UTF-8'
|
942 | };
|
943 | var useMasterKey = false;
|
944 |
|
945 | if (typeof authOptions.useMasterKey === 'boolean') {
|
946 | useMasterKey = authOptions.useMasterKey;
|
947 | } else if (typeof AV._config.useMasterKey === 'boolean') {
|
948 | useMasterKey = AV._config.useMasterKey;
|
949 | }
|
950 |
|
951 | if (useMasterKey) {
|
952 | if (AV.masterKey) {
|
953 | if (signKey) {
|
954 | headers['X-LC-Sign'] = sign(AV.masterKey, true);
|
955 | } else {
|
956 | headers['X-LC-Key'] = "".concat(AV.masterKey, ",master");
|
957 | }
|
958 | } else {
|
959 | console.warn('masterKey is not set, fall back to use appKey');
|
960 | setAppKey(headers, signKey);
|
961 | }
|
962 | } else {
|
963 | setAppKey(headers, signKey);
|
964 | }
|
965 |
|
966 | if (AV.hookKey) {
|
967 | headers['X-LC-Hook-Key'] = AV.hookKey;
|
968 | }
|
969 |
|
970 | if (AV._config.production !== null) {
|
971 | headers['X-LC-Prod'] = String(AV._config.production);
|
972 | }
|
973 |
|
974 | headers[ false ? 'User-Agent' : 'X-LC-UA'] = AV._sharedConfig.userAgent;
|
975 | return _promise.default.resolve().then(function () {
|
976 |
|
977 | var sessionToken = getSessionToken(authOptions);
|
978 |
|
979 | if (sessionToken) {
|
980 | headers['X-LC-Session'] = sessionToken;
|
981 | } else if (!AV._config.disableCurrentUser) {
|
982 | return AV.User.currentAsync().then(function (currentUser) {
|
983 | if (currentUser && currentUser._sessionToken) {
|
984 | headers['X-LC-Session'] = currentUser._sessionToken;
|
985 | }
|
986 |
|
987 | return headers;
|
988 | });
|
989 | }
|
990 |
|
991 | return headers;
|
992 | });
|
993 | };
|
994 |
|
995 | var createApiUrl = function createApiUrl(_ref) {
|
996 | var _ref$service = _ref.service,
|
997 | service = _ref$service === void 0 ? 'api' : _ref$service,
|
998 | _ref$version = _ref.version,
|
999 | version = _ref$version === void 0 ? '1.1' : _ref$version,
|
1000 | path = _ref.path;
|
1001 | var apiURL = AV._config.serverURLs[service];
|
1002 | if (!apiURL) throw new Error("undefined server URL for ".concat(service));
|
1003 |
|
1004 | if (apiURL.charAt(apiURL.length - 1) !== '/') {
|
1005 | apiURL += '/';
|
1006 | }
|
1007 |
|
1008 | apiURL += version;
|
1009 |
|
1010 | if (path) {
|
1011 | apiURL += path;
|
1012 | }
|
1013 |
|
1014 | return apiURL;
|
1015 | };
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 |
|
1030 |
|
1031 | var request = function request(_ref2) {
|
1032 | var service = _ref2.service,
|
1033 | version = _ref2.version,
|
1034 | method = _ref2.method,
|
1035 | path = _ref2.path,
|
1036 | query = _ref2.query,
|
1037 | data = _ref2.data,
|
1038 | authOptions = _ref2.authOptions,
|
1039 | _ref2$signKey = _ref2.signKey,
|
1040 | signKey = _ref2$signKey === void 0 ? true : _ref2$signKey;
|
1041 |
|
1042 | if (!(AV.applicationId && (AV.applicationKey || AV.masterKey))) {
|
1043 | throw new Error('Not initialized');
|
1044 | }
|
1045 |
|
1046 | if (AV._appRouter) {
|
1047 | AV._appRouter.refresh();
|
1048 | }
|
1049 |
|
1050 | var timeout = AV._config.requestTimeout;
|
1051 | var url = createApiUrl({
|
1052 | service: service,
|
1053 | path: path,
|
1054 | version: version
|
1055 | });
|
1056 | return setHeaders(authOptions, signKey).then(function (headers) {
|
1057 | return ajax({
|
1058 | method: method,
|
1059 | url: url,
|
1060 | query: query,
|
1061 | data: data,
|
1062 | headers: headers,
|
1063 | timeout: timeout
|
1064 | }).catch(function (error) {
|
1065 | var errorJSON = {
|
1066 | code: error.code || -1,
|
1067 | error: error.message || error.responseText
|
1068 | };
|
1069 |
|
1070 | if (error.response && error.response.code) {
|
1071 | errorJSON = error.response;
|
1072 | } else if (error.responseText) {
|
1073 | try {
|
1074 | errorJSON = JSON.parse(error.responseText);
|
1075 | } catch (e) {
|
1076 | }
|
1077 | }
|
1078 |
|
1079 | errorJSON.rawMessage = errorJSON.rawMessage || errorJSON.error;
|
1080 |
|
1081 | if (!AV._sharedConfig.keepErrorRawMessage) {
|
1082 | var _context3, _context4;
|
1083 |
|
1084 | errorJSON.error += (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = " [".concat(error.statusCode || 'N/A', " ")).call(_context4, method, " ")).call(_context3, url, "]");
|
1085 | }
|
1086 |
|
1087 |
|
1088 |
|
1089 | var err = new AVError(errorJSON.code, errorJSON.error);
|
1090 | delete errorJSON.error;
|
1091 | throw _.extend(err, errorJSON);
|
1092 | });
|
1093 | });
|
1094 | };
|
1095 |
|
1096 |
|
1097 | var _request = function _request(route, className, objectId, method, data, authOptions, query) {
|
1098 | var path = '';
|
1099 | if (route) path += "/".concat(route);
|
1100 | if (className) path += "/".concat(className);
|
1101 | if (objectId) path += "/".concat(objectId);
|
1102 |
|
1103 | if (data && data._fetchWhenSave) throw new Error('_fetchWhenSave should be in the query');
|
1104 | if (data && data._where) throw new Error('_where should be in the query');
|
1105 |
|
1106 | if (method && method.toLowerCase() === 'get') {
|
1107 | query = extend({}, query, data);
|
1108 | data = null;
|
1109 | }
|
1110 |
|
1111 | return request({
|
1112 | method: method,
|
1113 | path: path,
|
1114 | query: query,
|
1115 | data: data,
|
1116 | authOptions: authOptions
|
1117 | });
|
1118 | };
|
1119 |
|
1120 | AV.request = request;
|
1121 | module.exports = {
|
1122 | _request: _request,
|
1123 | request: request
|
1124 | };
|
1125 |
|
1126 | }),
|
1127 |
|
1128 | (function(module, exports, __webpack_require__) {
|
1129 |
|
1130 | var isCallable = __webpack_require__(9);
|
1131 | var tryToString = __webpack_require__(67);
|
1132 |
|
1133 | var $TypeError = TypeError;
|
1134 |
|
1135 |
|
1136 | module.exports = function (argument) {
|
1137 | if (isCallable(argument)) return argument;
|
1138 | throw $TypeError(tryToString(argument) + ' is not a function');
|
1139 | };
|
1140 |
|
1141 |
|
1142 | }),
|
1143 |
|
1144 | (function(module, __webpack_exports__, __webpack_require__) {
|
1145 |
|
1146 | "use strict";
|
1147 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
1148 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
1149 |
|
1150 |
|
1151 |
|
1152 | var isFunction = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Function');
|
1153 |
|
1154 |
|
1155 |
|
1156 | var nodelist = __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" ].document && __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" ].document.childNodes;
|
1157 | if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
|
1158 | isFunction = function(obj) {
|
1159 | return typeof obj == 'function' || false;
|
1160 | };
|
1161 | }
|
1162 |
|
1163 | __webpack_exports__["a"] = (isFunction);
|
1164 |
|
1165 |
|
1166 | }),
|
1167 |
|
1168 | (function(module, __webpack_exports__, __webpack_require__) {
|
1169 |
|
1170 | "use strict";
|
1171 | var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(188);
|
1172 |
|
1173 |
|
1174 |
|
1175 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" ])('length'));
|
1176 |
|
1177 |
|
1178 | }),
|
1179 |
|
1180 | (function(module, exports, __webpack_require__) {
|
1181 |
|
1182 | "use strict";
|
1183 |
|
1184 |
|
1185 | var _interopRequireDefault = __webpack_require__(1);
|
1186 |
|
1187 | var _keys = _interopRequireDefault(__webpack_require__(62));
|
1188 |
|
1189 | var _getPrototypeOf = _interopRequireDefault(__webpack_require__(231));
|
1190 |
|
1191 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
1192 |
|
1193 | var _ = __webpack_require__(3);
|
1194 |
|
1195 |
|
1196 | var isNullOrUndefined = function isNullOrUndefined(x) {
|
1197 | return _.isNull(x) || _.isUndefined(x);
|
1198 | };
|
1199 |
|
1200 | var ensureArray = function ensureArray(target) {
|
1201 | if (_.isArray(target)) {
|
1202 | return target;
|
1203 | }
|
1204 |
|
1205 | if (target === undefined || target === null) {
|
1206 | return [];
|
1207 | }
|
1208 |
|
1209 | return [target];
|
1210 | };
|
1211 |
|
1212 | var transformFetchOptions = function transformFetchOptions() {
|
1213 | var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
1214 | keys = (0, _keys.default)(_ref),
|
1215 | include = _ref.include,
|
1216 | includeACL = _ref.includeACL;
|
1217 |
|
1218 | var fetchOptions = {};
|
1219 |
|
1220 | if (keys) {
|
1221 | fetchOptions.keys = ensureArray(keys).join(',');
|
1222 | }
|
1223 |
|
1224 | if (include) {
|
1225 | fetchOptions.include = ensureArray(include).join(',');
|
1226 | }
|
1227 |
|
1228 | if (includeACL) {
|
1229 | fetchOptions.returnACL = includeACL;
|
1230 | }
|
1231 |
|
1232 | return fetchOptions;
|
1233 | };
|
1234 |
|
1235 | var getSessionToken = function getSessionToken(authOptions) {
|
1236 | if (authOptions.sessionToken) {
|
1237 | return authOptions.sessionToken;
|
1238 | }
|
1239 |
|
1240 | if (authOptions.user && typeof authOptions.user.getSessionToken === 'function') {
|
1241 | return authOptions.user.getSessionToken();
|
1242 | }
|
1243 | };
|
1244 |
|
1245 | var tap = function tap(interceptor) {
|
1246 | return function (value) {
|
1247 | return interceptor(value), value;
|
1248 | };
|
1249 | };
|
1250 |
|
1251 |
|
1252 | var EmptyConstructor = function EmptyConstructor() {};
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 | var inherits = function inherits(parent, protoProps, staticProps) {
|
1258 | var child;
|
1259 |
|
1260 |
|
1261 |
|
1262 | if (protoProps && protoProps.hasOwnProperty('constructor')) {
|
1263 | child = protoProps.constructor;
|
1264 | } else {
|
1265 |
|
1266 | child = function child() {
|
1267 | parent.apply(this, arguments);
|
1268 | };
|
1269 | }
|
1270 |
|
1271 |
|
1272 | _.extend(child, parent);
|
1273 |
|
1274 |
|
1275 |
|
1276 | EmptyConstructor.prototype = parent.prototype;
|
1277 | child.prototype = new EmptyConstructor();
|
1278 |
|
1279 |
|
1280 | if (protoProps) {
|
1281 | _.extend(child.prototype, protoProps);
|
1282 | }
|
1283 |
|
1284 |
|
1285 | if (staticProps) {
|
1286 | _.extend(child, staticProps);
|
1287 | }
|
1288 |
|
1289 |
|
1290 | child.prototype.constructor = child;
|
1291 |
|
1292 |
|
1293 | child.__super__ = parent.prototype;
|
1294 | return child;
|
1295 | };
|
1296 |
|
1297 |
|
1298 |
|
1299 | var parseDate = typeof wx === 'undefined' ? function (iso8601) {
|
1300 | return new Date(iso8601);
|
1301 | } : function (iso8601) {
|
1302 | return new Date(Date.parse(iso8601));
|
1303 | };
|
1304 |
|
1305 | var setValue = function setValue(target, key, value) {
|
1306 |
|
1307 | var segs = key.split('.');
|
1308 | var lastSeg = segs.pop();
|
1309 | var currentTarget = target;
|
1310 | segs.forEach(function (seg) {
|
1311 | if (currentTarget[seg] === undefined) currentTarget[seg] = {};
|
1312 | currentTarget = currentTarget[seg];
|
1313 | });
|
1314 | currentTarget[lastSeg] = value;
|
1315 | return target;
|
1316 | };
|
1317 |
|
1318 | var findValue = function findValue(target, key) {
|
1319 | var segs = key.split('.');
|
1320 | var firstSeg = segs[0];
|
1321 | var lastSeg = segs.pop();
|
1322 | var currentTarget = target;
|
1323 |
|
1324 | for (var i = 0; i < segs.length; i++) {
|
1325 | currentTarget = currentTarget[segs[i]];
|
1326 |
|
1327 | if (currentTarget === undefined) {
|
1328 | return [undefined, undefined, lastSeg];
|
1329 | }
|
1330 | }
|
1331 |
|
1332 | var value = currentTarget[lastSeg];
|
1333 | return [value, currentTarget, lastSeg, firstSeg];
|
1334 | };
|
1335 |
|
1336 | var isPlainObject = function isPlainObject(obj) {
|
1337 | return _.isObject(obj) && (0, _getPrototypeOf.default)(obj) === Object.prototype;
|
1338 | };
|
1339 |
|
1340 | var continueWhile = function continueWhile(predicate, asyncFunction) {
|
1341 | if (predicate()) {
|
1342 | return asyncFunction().then(function () {
|
1343 | return continueWhile(predicate, asyncFunction);
|
1344 | });
|
1345 | }
|
1346 |
|
1347 | return _promise.default.resolve();
|
1348 | };
|
1349 |
|
1350 | module.exports = {
|
1351 | isNullOrUndefined: isNullOrUndefined,
|
1352 | ensureArray: ensureArray,
|
1353 | transformFetchOptions: transformFetchOptions,
|
1354 | getSessionToken: getSessionToken,
|
1355 | tap: tap,
|
1356 | inherits: inherits,
|
1357 | parseDate: parseDate,
|
1358 | setValue: setValue,
|
1359 | findValue: findValue,
|
1360 | isPlainObject: isPlainObject,
|
1361 | continueWhile: continueWhile
|
1362 | };
|
1363 |
|
1364 | }),
|
1365 |
|
1366 | (function(module, exports, __webpack_require__) {
|
1367 |
|
1368 | var requireObjectCoercible = __webpack_require__(81);
|
1369 |
|
1370 | var $Object = Object;
|
1371 |
|
1372 |
|
1373 |
|
1374 | module.exports = function (argument) {
|
1375 | return $Object(requireObjectCoercible(argument));
|
1376 | };
|
1377 |
|
1378 |
|
1379 | }),
|
1380 |
|
1381 | (function(module, exports, __webpack_require__) {
|
1382 |
|
1383 | module.exports = __webpack_require__(238);
|
1384 |
|
1385 | }),
|
1386 |
|
1387 | (function(module, exports, __webpack_require__) {
|
1388 |
|
1389 |
|
1390 | var IndexedObject = __webpack_require__(98);
|
1391 | var requireObjectCoercible = __webpack_require__(81);
|
1392 |
|
1393 | module.exports = function (it) {
|
1394 | return IndexedObject(requireObjectCoercible(it));
|
1395 | };
|
1396 |
|
1397 |
|
1398 | }),
|
1399 |
|
1400 | (function(module, exports) {
|
1401 |
|
1402 | module.exports = true;
|
1403 |
|
1404 |
|
1405 | }),
|
1406 |
|
1407 | (function(module, exports, __webpack_require__) {
|
1408 |
|
1409 | module.exports = __webpack_require__(398);
|
1410 |
|
1411 | }),
|
1412 |
|
1413 | (function(module, exports, __webpack_require__) {
|
1414 |
|
1415 | module.exports = __webpack_require__(405);
|
1416 |
|
1417 | }),
|
1418 |
|
1419 | (function(module, exports, __webpack_require__) {
|
1420 |
|
1421 | var DESCRIPTORS = __webpack_require__(14);
|
1422 | var definePropertyModule = __webpack_require__(23);
|
1423 | var createPropertyDescriptor = __webpack_require__(49);
|
1424 |
|
1425 | module.exports = DESCRIPTORS ? function (object, key, value) {
|
1426 | return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
1427 | } : function (object, key, value) {
|
1428 | object[key] = value;
|
1429 | return object;
|
1430 | };
|
1431 |
|
1432 |
|
1433 | }),
|
1434 |
|
1435 | (function(module, exports, __webpack_require__) {
|
1436 |
|
1437 | var toLength = __webpack_require__(295);
|
1438 |
|
1439 |
|
1440 |
|
1441 | module.exports = function (obj) {
|
1442 | return toLength(obj.length);
|
1443 | };
|
1444 |
|
1445 |
|
1446 | }),
|
1447 |
|
1448 | (function(module, exports, __webpack_require__) {
|
1449 |
|
1450 | var bind = __webpack_require__(52);
|
1451 | var call = __webpack_require__(15);
|
1452 | var anObject = __webpack_require__(21);
|
1453 | var tryToString = __webpack_require__(67);
|
1454 | var isArrayIteratorMethod = __webpack_require__(165);
|
1455 | var lengthOfArrayLike = __webpack_require__(40);
|
1456 | var isPrototypeOf = __webpack_require__(16);
|
1457 | var getIterator = __webpack_require__(166);
|
1458 | var getIteratorMethod = __webpack_require__(108);
|
1459 | var iteratorClose = __webpack_require__(167);
|
1460 |
|
1461 | var $TypeError = TypeError;
|
1462 |
|
1463 | var Result = function (stopped, result) {
|
1464 | this.stopped = stopped;
|
1465 | this.result = result;
|
1466 | };
|
1467 |
|
1468 | var ResultPrototype = Result.prototype;
|
1469 |
|
1470 | module.exports = function (iterable, unboundFunction, options) {
|
1471 | var that = options && options.that;
|
1472 | var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
1473 | var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
1474 | var INTERRUPTED = !!(options && options.INTERRUPTED);
|
1475 | var fn = bind(unboundFunction, that);
|
1476 | var iterator, iterFn, index, length, result, next, step;
|
1477 |
|
1478 | var stop = function (condition) {
|
1479 | if (iterator) iteratorClose(iterator, 'normal', condition);
|
1480 | return new Result(true, condition);
|
1481 | };
|
1482 |
|
1483 | var callFn = function (value) {
|
1484 | if (AS_ENTRIES) {
|
1485 | anObject(value);
|
1486 | return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
1487 | } return INTERRUPTED ? fn(value, stop) : fn(value);
|
1488 | };
|
1489 |
|
1490 | if (IS_ITERATOR) {
|
1491 | iterator = iterable;
|
1492 | } else {
|
1493 | iterFn = getIteratorMethod(iterable);
|
1494 | if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
|
1495 |
|
1496 | if (isArrayIteratorMethod(iterFn)) {
|
1497 | for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
1498 | result = callFn(iterable[index]);
|
1499 | if (result && isPrototypeOf(ResultPrototype, result)) return result;
|
1500 | } return new Result(false);
|
1501 | }
|
1502 | iterator = getIterator(iterable, iterFn);
|
1503 | }
|
1504 |
|
1505 | next = iterator.next;
|
1506 | while (!(step = call(next, iterator)).done) {
|
1507 | try {
|
1508 | result = callFn(step.value);
|
1509 | } catch (error) {
|
1510 | iteratorClose(iterator, 'throw', error);
|
1511 | }
|
1512 | if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
|
1513 | } return new Result(false);
|
1514 | };
|
1515 |
|
1516 |
|
1517 | }),
|
1518 |
|
1519 | (function(module, exports, __webpack_require__) {
|
1520 |
|
1521 | var classof = __webpack_require__(55);
|
1522 |
|
1523 | var $String = String;
|
1524 |
|
1525 | module.exports = function (argument) {
|
1526 | if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
1527 | return $String(argument);
|
1528 | };
|
1529 |
|
1530 |
|
1531 | }),
|
1532 |
|
1533 | (function(module, exports, __webpack_require__) {
|
1534 |
|
1535 | "use strict";
|
1536 |
|
1537 | var toIndexedObject = __webpack_require__(35);
|
1538 | var addToUnscopables = __webpack_require__(131);
|
1539 | var Iterators = __webpack_require__(54);
|
1540 | var InternalStateModule = __webpack_require__(44);
|
1541 | var defineProperty = __webpack_require__(23).f;
|
1542 | var defineIterator = __webpack_require__(133);
|
1543 | var IS_PURE = __webpack_require__(36);
|
1544 | var DESCRIPTORS = __webpack_require__(14);
|
1545 |
|
1546 | var ARRAY_ITERATOR = 'Array Iterator';
|
1547 | var setInternalState = InternalStateModule.set;
|
1548 | var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
1549 |
|
1550 |
|
1551 |
|
1552 |
|
1553 |
|
1554 |
|
1555 |
|
1556 |
|
1557 |
|
1558 |
|
1559 |
|
1560 | module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
|
1561 | setInternalState(this, {
|
1562 | type: ARRAY_ITERATOR,
|
1563 | target: toIndexedObject(iterated),
|
1564 | index: 0,
|
1565 | kind: kind
|
1566 | });
|
1567 |
|
1568 |
|
1569 | }, function () {
|
1570 | var state = getInternalState(this);
|
1571 | var target = state.target;
|
1572 | var kind = state.kind;
|
1573 | var index = state.index++;
|
1574 | if (!target || index >= target.length) {
|
1575 | state.target = undefined;
|
1576 | return { value: undefined, done: true };
|
1577 | }
|
1578 | if (kind == 'keys') return { value: index, done: false };
|
1579 | if (kind == 'values') return { value: target[index], done: false };
|
1580 | return { value: [index, target[index]], done: false };
|
1581 | }, 'values');
|
1582 |
|
1583 |
|
1584 |
|
1585 |
|
1586 | var values = Iterators.Arguments = Iterators.Array;
|
1587 |
|
1588 |
|
1589 | addToUnscopables('keys');
|
1590 | addToUnscopables('values');
|
1591 | addToUnscopables('entries');
|
1592 |
|
1593 |
|
1594 | if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
|
1595 | defineProperty(values, 'name', { value: 'values' });
|
1596 | } catch (error) { }
|
1597 |
|
1598 |
|
1599 | }),
|
1600 |
|
1601 | (function(module, exports, __webpack_require__) {
|
1602 |
|
1603 | var NATIVE_WEAK_MAP = __webpack_require__(168);
|
1604 | var global = __webpack_require__(8);
|
1605 | var uncurryThis = __webpack_require__(4);
|
1606 | var isObject = __webpack_require__(11);
|
1607 | var createNonEnumerableProperty = __webpack_require__(39);
|
1608 | var hasOwn = __webpack_require__(13);
|
1609 | var shared = __webpack_require__(123);
|
1610 | var sharedKey = __webpack_require__(103);
|
1611 | var hiddenKeys = __webpack_require__(83);
|
1612 |
|
1613 | var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
1614 | var TypeError = global.TypeError;
|
1615 | var WeakMap = global.WeakMap;
|
1616 | var set, get, has;
|
1617 |
|
1618 | var enforce = function (it) {
|
1619 | return has(it) ? get(it) : set(it, {});
|
1620 | };
|
1621 |
|
1622 | var getterFor = function (TYPE) {
|
1623 | return function (it) {
|
1624 | var state;
|
1625 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
1626 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
1627 | } return state;
|
1628 | };
|
1629 | };
|
1630 |
|
1631 | if (NATIVE_WEAK_MAP || shared.state) {
|
1632 | var store = shared.state || (shared.state = new WeakMap());
|
1633 | var wmget = uncurryThis(store.get);
|
1634 | var wmhas = uncurryThis(store.has);
|
1635 | var wmset = uncurryThis(store.set);
|
1636 | set = function (it, metadata) {
|
1637 | if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
1638 | metadata.facade = it;
|
1639 | wmset(store, it, metadata);
|
1640 | return metadata;
|
1641 | };
|
1642 | get = function (it) {
|
1643 | return wmget(store, it) || {};
|
1644 | };
|
1645 | has = function (it) {
|
1646 | return wmhas(store, it);
|
1647 | };
|
1648 | } else {
|
1649 | var STATE = sharedKey('state');
|
1650 | hiddenKeys[STATE] = true;
|
1651 | set = function (it, metadata) {
|
1652 | if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
1653 | metadata.facade = it;
|
1654 | createNonEnumerableProperty(it, STATE, metadata);
|
1655 | return metadata;
|
1656 | };
|
1657 | get = function (it) {
|
1658 | return hasOwn(it, STATE) ? it[STATE] : {};
|
1659 | };
|
1660 | has = function (it) {
|
1661 | return hasOwn(it, STATE);
|
1662 | };
|
1663 | }
|
1664 |
|
1665 | module.exports = {
|
1666 | set: set,
|
1667 | get: get,
|
1668 | has: has,
|
1669 | enforce: enforce,
|
1670 | getterFor: getterFor
|
1671 | };
|
1672 |
|
1673 |
|
1674 | /***/ }),
|
1675 | /* 45 */
|
1676 | /***/ (function(module, exports, __webpack_require__) {
|
1677 |
|
1678 | var createNonEnumerableProperty = __webpack_require__(39);
|
1679 |
|
1680 | module.exports = function (target, key, value, options) {
|
1681 | if (options && options.enumerable) target[key] = value;
|
1682 | else createNonEnumerableProperty(target, key, value);
|
1683 | return target;
|
1684 | };
|
1685 |
|
1686 |
|
1687 | }),
|
1688 |
|
1689 | (function(module, exports, __webpack_require__) {
|
1690 |
|
1691 | __webpack_require__(43);
|
1692 | var DOMIterables = __webpack_require__(320);
|
1693 | var global = __webpack_require__(8);
|
1694 | var classof = __webpack_require__(55);
|
1695 | var createNonEnumerableProperty = __webpack_require__(39);
|
1696 | var Iterators = __webpack_require__(54);
|
1697 | var wellKnownSymbol = __webpack_require__(5);
|
1698 |
|
1699 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
1700 |
|
1701 | for (var COLLECTION_NAME in DOMIterables) {
|
1702 | var Collection = global[COLLECTION_NAME];
|
1703 | var CollectionPrototype = Collection && Collection.prototype;
|
1704 | if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
|
1705 | createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
|
1706 | }
|
1707 | Iterators[COLLECTION_NAME] = Iterators.Array;
|
1708 | }
|
1709 |
|
1710 |
|
1711 | }),
|
1712 |
|
1713 | (function(module, __webpack_exports__, __webpack_require__) {
|
1714 |
|
1715 | "use strict";
|
1716 | __webpack_exports__["a"] = has;
|
1717 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
1718 |
|
1719 |
|
1720 |
|
1721 | function has(obj, key) {
|
1722 | return obj != null && __WEBPACK_IMPORTED_MODULE_0__setup_js__["i" ].call(obj, key);
|
1723 | }
|
1724 |
|
1725 |
|
1726 | }),
|
1727 |
|
1728 | (function(module, exports, __webpack_require__) {
|
1729 |
|
1730 | "use strict";
|
1731 |
|
1732 |
|
1733 | var _interopRequireDefault = __webpack_require__(1);
|
1734 |
|
1735 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(420));
|
1736 |
|
1737 | var _getPrototypeOf = _interopRequireDefault(__webpack_require__(231));
|
1738 |
|
1739 | var _ = __webpack_require__(3);
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 |
|
1745 | function AVError(code, message) {
|
1746 | if (this instanceof AVError ? this.constructor : void 0) {
|
1747 | var error = new Error(message);
|
1748 | (0, _setPrototypeOf.default)(error, (0, _getPrototypeOf.default)(this));
|
1749 | error.code = code;
|
1750 | return error;
|
1751 | }
|
1752 |
|
1753 | return new AVError(code, message);
|
1754 | }
|
1755 |
|
1756 | AVError.prototype = Object.create(Error.prototype, {
|
1757 | constructor: {
|
1758 | value: Error,
|
1759 | enumerable: false,
|
1760 | writable: true,
|
1761 | configurable: true
|
1762 | }
|
1763 | });
|
1764 | (0, _setPrototypeOf.default)(AVError, Error);
|
1765 |
|
1766 | _.extend(AVError,
|
1767 |
|
1768 | {
|
1769 | |
1770 |
|
1771 |
|
1772 |
|
1773 | OTHER_CAUSE: -1,
|
1774 |
|
1775 | |
1776 |
|
1777 |
|
1778 |
|
1779 |
|
1780 | INTERNAL_SERVER_ERROR: 1,
|
1781 |
|
1782 | |
1783 |
|
1784 |
|
1785 |
|
1786 | CONNECTION_FAILED: 100,
|
1787 |
|
1788 | |
1789 |
|
1790 |
|
1791 |
|
1792 | OBJECT_NOT_FOUND: 101,
|
1793 |
|
1794 | |
1795 |
|
1796 |
|
1797 |
|
1798 |
|
1799 | INVALID_QUERY: 102,
|
1800 |
|
1801 | |
1802 |
|
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 | INVALID_CLASS_NAME: 103,
|
1808 |
|
1809 | |
1810 |
|
1811 |
|
1812 |
|
1813 | MISSING_OBJECT_ID: 104,
|
1814 |
|
1815 | |
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 | INVALID_KEY_NAME: 105,
|
1821 |
|
1822 | |
1823 |
|
1824 |
|
1825 |
|
1826 |
|
1827 | INVALID_POINTER: 106,
|
1828 |
|
1829 | |
1830 |
|
1831 |
|
1832 |
|
1833 |
|
1834 |
|
1835 | INVALID_JSON: 107,
|
1836 |
|
1837 | |
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 | COMMAND_UNAVAILABLE: 108,
|
1843 |
|
1844 | |
1845 |
|
1846 |
|
1847 |
|
1848 | NOT_INITIALIZED: 109,
|
1849 |
|
1850 | |
1851 |
|
1852 |
|
1853 |
|
1854 | INCORRECT_TYPE: 111,
|
1855 |
|
1856 | |
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 | INVALID_CHANNEL_NAME: 112,
|
1863 |
|
1864 | |
1865 |
|
1866 |
|
1867 |
|
1868 | PUSH_MISCONFIGURED: 115,
|
1869 |
|
1870 | |
1871 |
|
1872 |
|
1873 |
|
1874 | OBJECT_TOO_LARGE: 116,
|
1875 |
|
1876 | |
1877 |
|
1878 |
|
1879 |
|
1880 | OPERATION_FORBIDDEN: 119,
|
1881 |
|
1882 | |
1883 |
|
1884 |
|
1885 |
|
1886 | CACHE_MISS: 120,
|
1887 |
|
1888 | |
1889 |
|
1890 |
|
1891 |
|
1892 |
|
1893 | INVALID_NESTED_KEY: 121,
|
1894 |
|
1895 | |
1896 |
|
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 | INVALID_FILE_NAME: 122,
|
1902 |
|
1903 | |
1904 |
|
1905 |
|
1906 |
|
1907 | INVALID_ACL: 123,
|
1908 |
|
1909 | |
1910 |
|
1911 |
|
1912 |
|
1913 |
|
1914 | TIMEOUT: 124,
|
1915 |
|
1916 | |
1917 |
|
1918 |
|
1919 |
|
1920 | INVALID_EMAIL_ADDRESS: 125,
|
1921 |
|
1922 | |
1923 |
|
1924 |
|
1925 |
|
1926 | MISSING_CONTENT_TYPE: 126,
|
1927 |
|
1928 | |
1929 |
|
1930 |
|
1931 |
|
1932 | MISSING_CONTENT_LENGTH: 127,
|
1933 |
|
1934 | |
1935 |
|
1936 |
|
1937 |
|
1938 | INVALID_CONTENT_LENGTH: 128,
|
1939 |
|
1940 | |
1941 |
|
1942 |
|
1943 |
|
1944 | FILE_TOO_LARGE: 129,
|
1945 |
|
1946 | |
1947 |
|
1948 |
|
1949 |
|
1950 | FILE_SAVE_ERROR: 130,
|
1951 |
|
1952 | |
1953 |
|
1954 |
|
1955 |
|
1956 | FILE_DELETE_ERROR: 153,
|
1957 |
|
1958 | |
1959 |
|
1960 |
|
1961 |
|
1962 |
|
1963 | DUPLICATE_VALUE: 137,
|
1964 |
|
1965 | |
1966 |
|
1967 |
|
1968 |
|
1969 | INVALID_ROLE_NAME: 139,
|
1970 |
|
1971 | |
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 | EXCEEDED_QUOTA: 140,
|
1977 |
|
1978 | |
1979 |
|
1980 |
|
1981 |
|
1982 | SCRIPT_FAILED: 141,
|
1983 |
|
1984 | |
1985 |
|
1986 |
|
1987 |
|
1988 | VALIDATION_ERROR: 142,
|
1989 |
|
1990 | |
1991 |
|
1992 |
|
1993 |
|
1994 | INVALID_IMAGE_DATA: 150,
|
1995 |
|
1996 | |
1997 |
|
1998 |
|
1999 |
|
2000 | UNSAVED_FILE_ERROR: 151,
|
2001 |
|
2002 | |
2003 |
|
2004 |
|
2005 |
|
2006 | INVALID_PUSH_TIME_ERROR: 152,
|
2007 |
|
2008 | |
2009 |
|
2010 |
|
2011 |
|
2012 | USERNAME_MISSING: 200,
|
2013 |
|
2014 | |
2015 |
|
2016 |
|
2017 |
|
2018 | PASSWORD_MISSING: 201,
|
2019 |
|
2020 | |
2021 |
|
2022 |
|
2023 |
|
2024 | USERNAME_TAKEN: 202,
|
2025 |
|
2026 | |
2027 |
|
2028 |
|
2029 |
|
2030 | EMAIL_TAKEN: 203,
|
2031 |
|
2032 | |
2033 |
|
2034 |
|
2035 |
|
2036 | EMAIL_MISSING: 204,
|
2037 |
|
2038 | |
2039 |
|
2040 |
|
2041 |
|
2042 | EMAIL_NOT_FOUND: 205,
|
2043 |
|
2044 | |
2045 |
|
2046 |
|
2047 |
|
2048 |
|
2049 | SESSION_MISSING: 206,
|
2050 |
|
2051 | |
2052 |
|
2053 |
|
2054 |
|
2055 | MUST_CREATE_USER_THROUGH_SIGNUP: 207,
|
2056 |
|
2057 | |
2058 |
|
2059 |
|
2060 |
|
2061 |
|
2062 | ACCOUNT_ALREADY_LINKED: 208,
|
2063 |
|
2064 | |
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 | LINKED_ID_MISSING: 250,
|
2070 |
|
2071 | |
2072 |
|
2073 |
|
2074 |
|
2075 |
|
2076 | INVALID_LINKED_SESSION: 251,
|
2077 |
|
2078 | |
2079 |
|
2080 |
|
2081 |
|
2082 |
|
2083 | UNSUPPORTED_SERVICE: 252,
|
2084 |
|
2085 | |
2086 |
|
2087 |
|
2088 |
|
2089 |
|
2090 |
|
2091 |
|
2092 | X_DOMAIN_REQUEST: 602
|
2093 | });
|
2094 |
|
2095 | module.exports = AVError;
|
2096 |
|
2097 | }),
|
2098 |
|
2099 | (function(module, exports) {
|
2100 |
|
2101 | module.exports = function (bitmap, value) {
|
2102 | return {
|
2103 | enumerable: !(bitmap & 1),
|
2104 | configurable: !(bitmap & 2),
|
2105 | writable: !(bitmap & 4),
|
2106 | value: value
|
2107 | };
|
2108 | };
|
2109 |
|
2110 |
|
2111 | }),
|
2112 |
|
2113 | (function(module, exports, __webpack_require__) {
|
2114 |
|
2115 | var uncurryThis = __webpack_require__(4);
|
2116 |
|
2117 | var toString = uncurryThis({}.toString);
|
2118 | var stringSlice = uncurryThis(''.slice);
|
2119 |
|
2120 | module.exports = function (it) {
|
2121 | return stringSlice(toString(it), 8, -1);
|
2122 | };
|
2123 |
|
2124 |
|
2125 | }),
|
2126 |
|
2127 | (function(module, exports, __webpack_require__) {
|
2128 |
|
2129 | var getBuiltIn = __webpack_require__(20);
|
2130 |
|
2131 | module.exports = getBuiltIn('navigator', 'userAgent') || '';
|
2132 |
|
2133 |
|
2134 | }),
|
2135 |
|
2136 | (function(module, exports, __webpack_require__) {
|
2137 |
|
2138 | var uncurryThis = __webpack_require__(4);
|
2139 | var aCallable = __webpack_require__(29);
|
2140 | var NATIVE_BIND = __webpack_require__(80);
|
2141 |
|
2142 | var bind = uncurryThis(uncurryThis.bind);
|
2143 |
|
2144 |
|
2145 | module.exports = function (fn, that) {
|
2146 | aCallable(fn);
|
2147 | return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
|
2148 | return fn.apply(that, arguments);
|
2149 | };
|
2150 | };
|
2151 |
|
2152 |
|
2153 | }),
|
2154 |
|
2155 | (function(module, exports, __webpack_require__) {
|
2156 |
|
2157 |
|
2158 | var anObject = __webpack_require__(21);
|
2159 | var definePropertiesModule = __webpack_require__(129);
|
2160 | var enumBugKeys = __webpack_require__(128);
|
2161 | var hiddenKeys = __webpack_require__(83);
|
2162 | var html = __webpack_require__(164);
|
2163 | var documentCreateElement = __webpack_require__(124);
|
2164 | var sharedKey = __webpack_require__(103);
|
2165 |
|
2166 | var GT = '>';
|
2167 | var LT = '<';
|
2168 | var PROTOTYPE = 'prototype';
|
2169 | var SCRIPT = 'script';
|
2170 | var IE_PROTO = sharedKey('IE_PROTO');
|
2171 |
|
2172 | var EmptyConstructor = function () { };
|
2173 |
|
2174 | var scriptTag = function (content) {
|
2175 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
2176 | };
|
2177 |
|
2178 |
|
2179 | var NullProtoObjectViaActiveX = function (activeXDocument) {
|
2180 | activeXDocument.write(scriptTag(''));
|
2181 | activeXDocument.close();
|
2182 | var temp = activeXDocument.parentWindow.Object;
|
2183 | activeXDocument = null;
|
2184 | return temp;
|
2185 | };
|
2186 |
|
2187 |
|
2188 | var NullProtoObjectViaIFrame = function () {
|
2189 |
|
2190 | var iframe = documentCreateElement('iframe');
|
2191 | var JS = 'java' + SCRIPT + ':';
|
2192 | var iframeDocument;
|
2193 | iframe.style.display = 'none';
|
2194 | html.appendChild(iframe);
|
2195 |
|
2196 | iframe.src = String(JS);
|
2197 | iframeDocument = iframe.contentWindow.document;
|
2198 | iframeDocument.open();
|
2199 | iframeDocument.write(scriptTag('document.F=Object'));
|
2200 | iframeDocument.close();
|
2201 | return iframeDocument.F;
|
2202 | };
|
2203 |
|
2204 |
|
2205 |
|
2206 |
|
2207 |
|
2208 |
|
2209 | var activeXDocument;
|
2210 | var NullProtoObject = function () {
|
2211 | try {
|
2212 | activeXDocument = new ActiveXObject('htmlfile');
|
2213 | } catch (error) { }
|
2214 | NullProtoObject = typeof document != 'undefined'
|
2215 | ? document.domain && activeXDocument
|
2216 | ? NullProtoObjectViaActiveX(activeXDocument)
|
2217 | : NullProtoObjectViaIFrame()
|
2218 | : NullProtoObjectViaActiveX(activeXDocument);
|
2219 | var length = enumBugKeys.length;
|
2220 | while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
2221 | return NullProtoObject();
|
2222 | };
|
2223 |
|
2224 | hiddenKeys[IE_PROTO] = true;
|
2225 |
|
2226 |
|
2227 |
|
2228 |
|
2229 | module.exports = Object.create || function create(O, Properties) {
|
2230 | var result;
|
2231 | if (O !== null) {
|
2232 | EmptyConstructor[PROTOTYPE] = anObject(O);
|
2233 | result = new EmptyConstructor();
|
2234 | EmptyConstructor[PROTOTYPE] = null;
|
2235 |
|
2236 | result[IE_PROTO] = O;
|
2237 | } else result = NullProtoObject();
|
2238 | return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
2239 | };
|
2240 |
|
2241 |
|
2242 | }),
|
2243 |
|
2244 | (function(module, exports) {
|
2245 |
|
2246 | module.exports = {};
|
2247 |
|
2248 |
|
2249 | }),
|
2250 |
|
2251 | (function(module, exports, __webpack_require__) {
|
2252 |
|
2253 | var TO_STRING_TAG_SUPPORT = __webpack_require__(130);
|
2254 | var isCallable = __webpack_require__(9);
|
2255 | var classofRaw = __webpack_require__(50);
|
2256 | var wellKnownSymbol = __webpack_require__(5);
|
2257 |
|
2258 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2259 | var $Object = Object;
|
2260 |
|
2261 |
|
2262 | var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
2263 |
|
2264 |
|
2265 | var tryGet = function (it, key) {
|
2266 | try {
|
2267 | return it[key];
|
2268 | } catch (error) { }
|
2269 | };
|
2270 |
|
2271 |
|
2272 | module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
2273 | var O, tag, result;
|
2274 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
2275 |
|
2276 | : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
2277 |
|
2278 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
2279 |
|
2280 | : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
2281 | };
|
2282 |
|
2283 |
|
2284 | }),
|
2285 |
|
2286 | (function(module, exports, __webpack_require__) {
|
2287 |
|
2288 | var TO_STRING_TAG_SUPPORT = __webpack_require__(130);
|
2289 | var defineProperty = __webpack_require__(23).f;
|
2290 | var createNonEnumerableProperty = __webpack_require__(39);
|
2291 | var hasOwn = __webpack_require__(13);
|
2292 | var toString = __webpack_require__(301);
|
2293 | var wellKnownSymbol = __webpack_require__(5);
|
2294 |
|
2295 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2296 |
|
2297 | module.exports = function (it, TAG, STATIC, SET_METHOD) {
|
2298 | if (it) {
|
2299 | var target = STATIC ? it : it.prototype;
|
2300 | if (!hasOwn(target, TO_STRING_TAG)) {
|
2301 | defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
|
2302 | }
|
2303 | if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
|
2304 | createNonEnumerableProperty(target, 'toString', toString);
|
2305 | }
|
2306 | }
|
2307 | };
|
2308 |
|
2309 |
|
2310 | }),
|
2311 |
|
2312 | (function(module, exports, __webpack_require__) {
|
2313 |
|
2314 | "use strict";
|
2315 |
|
2316 | var aCallable = __webpack_require__(29);
|
2317 |
|
2318 | var PromiseCapability = function (C) {
|
2319 | var resolve, reject;
|
2320 | this.promise = new C(function ($$resolve, $$reject) {
|
2321 | if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
2322 | resolve = $$resolve;
|
2323 | reject = $$reject;
|
2324 | });
|
2325 | this.resolve = aCallable(resolve);
|
2326 | this.reject = aCallable(reject);
|
2327 | };
|
2328 |
|
2329 |
|
2330 |
|
2331 | module.exports.f = function (C) {
|
2332 | return new PromiseCapability(C);
|
2333 | };
|
2334 |
|
2335 |
|
2336 | }),
|
2337 |
|
2338 | (function(module, __webpack_exports__, __webpack_require__) {
|
2339 |
|
2340 | "use strict";
|
2341 | __webpack_exports__["a"] = isObject;
|
2342 |
|
2343 | function isObject(obj) {
|
2344 | var type = typeof obj;
|
2345 | return type === 'function' || type === 'object' && !!obj;
|
2346 | }
|
2347 |
|
2348 |
|
2349 | }),
|
2350 |
|
2351 | (function(module, __webpack_exports__, __webpack_require__) {
|
2352 |
|
2353 | "use strict";
|
2354 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
2355 | var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(18);
|
2356 |
|
2357 |
|
2358 |
|
2359 |
|
2360 |
|
2361 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["k" ] || Object(__WEBPACK_IMPORTED_MODULE_1__tagTester_js__["a" ])('Array'));
|
2362 |
|
2363 |
|
2364 | }),
|
2365 |
|
2366 | (function(module, __webpack_exports__, __webpack_require__) {
|
2367 |
|
2368 | "use strict";
|
2369 | __webpack_exports__["a"] = each;
|
2370 | var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(89);
|
2371 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
2372 | var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(17);
|
2373 |
|
2374 |
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 | function each(obj, iteratee, context) {
|
2382 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" ])(iteratee, context);
|
2383 | var i, length;
|
2384 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(obj)) {
|
2385 | for (i = 0, length = obj.length; i < length; i++) {
|
2386 | iteratee(obj[i], i, obj);
|
2387 | }
|
2388 | } else {
|
2389 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" ])(obj);
|
2390 | for (i = 0, length = _keys.length; i < length; i++) {
|
2391 | iteratee(obj[_keys[i]], _keys[i], obj);
|
2392 | }
|
2393 | }
|
2394 | return obj;
|
2395 | }
|
2396 |
|
2397 |
|
2398 | }),
|
2399 |
|
2400 | (function(module, exports, __webpack_require__) {
|
2401 |
|
2402 | module.exports = __webpack_require__(407);
|
2403 |
|
2404 | }),
|
2405 |
|
2406 | (function(module, exports, __webpack_require__) {
|
2407 |
|
2408 | module.exports = __webpack_require__(411);
|
2409 |
|
2410 | }),
|
2411 |
|
2412 | (function(module, exports, __webpack_require__) {
|
2413 |
|
2414 | "use strict";
|
2415 |
|
2416 |
|
2417 | function _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); }
|
2418 |
|
2419 |
|
2420 |
|
2421 |
|
2422 |
|
2423 |
|
2424 | exports.log = log;
|
2425 | exports.formatArgs = formatArgs;
|
2426 | exports.save = save;
|
2427 | exports.load = load;
|
2428 | exports.useColors = useColors;
|
2429 | exports.storage = localstorage();
|
2430 |
|
2431 |
|
2432 |
|
2433 |
|
2434 | exports.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'];
|
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 |
|
2442 |
|
2443 |
|
2444 | function useColors() {
|
2445 |
|
2446 |
|
2447 |
|
2448 | if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
2449 | return true;
|
2450 | }
|
2451 |
|
2452 |
|
2453 | if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
2454 | return false;
|
2455 | }
|
2456 |
|
2457 |
|
2458 |
|
2459 | return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
|
2460 | typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
|
2461 |
|
2462 | typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
|
2463 | typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
2464 | }
|
2465 |
|
2466 |
|
2467 |
|
2468 |
|
2469 |
|
2470 |
|
2471 |
|
2472 | function formatArgs(args) {
|
2473 | args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
2474 |
|
2475 | if (!this.useColors) {
|
2476 | return;
|
2477 | }
|
2478 |
|
2479 | var c = 'color: ' + this.color;
|
2480 | args.splice(1, 0, c, 'color: inherit');
|
2481 |
|
2482 |
|
2483 |
|
2484 | var index = 0;
|
2485 | var lastC = 0;
|
2486 | args[0].replace(/%[a-zA-Z%]/g, function (match) {
|
2487 | if (match === '%%') {
|
2488 | return;
|
2489 | }
|
2490 |
|
2491 | index++;
|
2492 |
|
2493 | if (match === '%c') {
|
2494 |
|
2495 |
|
2496 | lastC = index;
|
2497 | }
|
2498 | });
|
2499 | args.splice(lastC, 0, c);
|
2500 | }
|
2501 |
|
2502 |
|
2503 |
|
2504 |
|
2505 |
|
2506 |
|
2507 |
|
2508 |
|
2509 | function log() {
|
2510 | var _console;
|
2511 |
|
2512 |
|
2513 |
|
2514 | return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
|
2515 | }
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 |
|
2522 |
|
2523 |
|
2524 | function save(namespaces) {
|
2525 | try {
|
2526 | if (namespaces) {
|
2527 | exports.storage.setItem('debug', namespaces);
|
2528 | } else {
|
2529 | exports.storage.removeItem('debug');
|
2530 | }
|
2531 | } catch (error) {
|
2532 |
|
2533 | }
|
2534 | }
|
2535 |
|
2536 |
|
2537 |
|
2538 |
|
2539 |
|
2540 |
|
2541 |
|
2542 |
|
2543 | function load() {
|
2544 | var r;
|
2545 |
|
2546 | try {
|
2547 | r = exports.storage.getItem('debug');
|
2548 | } catch (error) {}
|
2549 |
|
2550 |
|
2551 |
|
2552 |
|
2553 | if (!r && typeof process !== 'undefined' && 'env' in process) {
|
2554 | r = process.env.DEBUG;
|
2555 | }
|
2556 |
|
2557 | return r;
|
2558 | }
|
2559 |
|
2560 |
|
2561 |
|
2562 |
|
2563 |
|
2564 |
|
2565 |
|
2566 |
|
2567 |
|
2568 |
|
2569 |
|
2570 |
|
2571 | function localstorage() {
|
2572 | try {
|
2573 |
|
2574 |
|
2575 | return localStorage;
|
2576 | } catch (error) {
|
2577 |
|
2578 | }
|
2579 | }
|
2580 |
|
2581 | module.exports = __webpack_require__(416)(exports);
|
2582 | var formatters = module.exports.formatters;
|
2583 |
|
2584 |
|
2585 |
|
2586 |
|
2587 | formatters.j = function (v) {
|
2588 | try {
|
2589 | return JSON.stringify(v);
|
2590 | } catch (error) {
|
2591 | return '[UnexpectedJSONParseError]: ' + error.message;
|
2592 | }
|
2593 | };
|
2594 |
|
2595 |
|
2596 |
|
2597 | }),
|
2598 |
|
2599 | (function(module, exports, __webpack_require__) {
|
2600 |
|
2601 | var DESCRIPTORS = __webpack_require__(14);
|
2602 | var call = __webpack_require__(15);
|
2603 | var propertyIsEnumerableModule = __webpack_require__(121);
|
2604 | var createPropertyDescriptor = __webpack_require__(49);
|
2605 | var toIndexedObject = __webpack_require__(35);
|
2606 | var toPropertyKey = __webpack_require__(99);
|
2607 | var hasOwn = __webpack_require__(13);
|
2608 | var IE8_DOM_DEFINE = __webpack_require__(158);
|
2609 |
|
2610 |
|
2611 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
2612 |
|
2613 |
|
2614 |
|
2615 | exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
2616 | O = toIndexedObject(O);
|
2617 | P = toPropertyKey(P);
|
2618 | if (IE8_DOM_DEFINE) try {
|
2619 | return $getOwnPropertyDescriptor(O, P);
|
2620 | } catch (error) { }
|
2621 | if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
2622 | };
|
2623 |
|
2624 |
|
2625 | }),
|
2626 |
|
2627 | (function(module, exports, __webpack_require__) {
|
2628 |
|
2629 |
|
2630 | var V8_VERSION = __webpack_require__(66);
|
2631 | var fails = __webpack_require__(2);
|
2632 |
|
2633 |
|
2634 | module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
2635 | var symbol = Symbol();
|
2636 |
|
2637 |
|
2638 | return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
2639 |
|
2640 | !Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
2641 | });
|
2642 |
|
2643 |
|
2644 | }),
|
2645 |
|
2646 | (function(module, exports, __webpack_require__) {
|
2647 |
|
2648 | var global = __webpack_require__(8);
|
2649 | var userAgent = __webpack_require__(51);
|
2650 |
|
2651 | var process = global.process;
|
2652 | var Deno = global.Deno;
|
2653 | var versions = process && process.versions || Deno && Deno.version;
|
2654 | var v8 = versions && versions.v8;
|
2655 | var match, version;
|
2656 |
|
2657 | if (v8) {
|
2658 | match = v8.split('.');
|
2659 |
|
2660 |
|
2661 | version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
2662 | }
|
2663 |
|
2664 |
|
2665 |
|
2666 | if (!version && userAgent) {
|
2667 | match = userAgent.match(/Edge\/(\d+)/);
|
2668 | if (!match || match[1] >= 74) {
|
2669 | match = userAgent.match(/Chrome\/(\d+)/);
|
2670 | if (match) version = +match[1];
|
2671 | }
|
2672 | }
|
2673 |
|
2674 | module.exports = version;
|
2675 |
|
2676 |
|
2677 | }),
|
2678 |
|
2679 | (function(module, exports) {
|
2680 |
|
2681 | var $String = String;
|
2682 |
|
2683 | module.exports = function (argument) {
|
2684 | try {
|
2685 | return $String(argument);
|
2686 | } catch (error) {
|
2687 | return 'Object';
|
2688 | }
|
2689 | };
|
2690 |
|
2691 |
|
2692 | }),
|
2693 |
|
2694 | (function(module, exports) {
|
2695 |
|
2696 |
|
2697 |
|
2698 |
|
2699 | }),
|
2700 |
|
2701 | (function(module, exports, __webpack_require__) {
|
2702 |
|
2703 | var global = __webpack_require__(8);
|
2704 |
|
2705 | module.exports = global.Promise;
|
2706 |
|
2707 |
|
2708 | }),
|
2709 |
|
2710 | (function(module, exports, __webpack_require__) {
|
2711 |
|
2712 | "use strict";
|
2713 |
|
2714 | var charAt = __webpack_require__(319).charAt;
|
2715 | var toString = __webpack_require__(42);
|
2716 | var InternalStateModule = __webpack_require__(44);
|
2717 | var defineIterator = __webpack_require__(133);
|
2718 |
|
2719 | var STRING_ITERATOR = 'String Iterator';
|
2720 | var setInternalState = InternalStateModule.set;
|
2721 | var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
|
2722 |
|
2723 |
|
2724 |
|
2725 | defineIterator(String, 'String', function (iterated) {
|
2726 | setInternalState(this, {
|
2727 | type: STRING_ITERATOR,
|
2728 | string: toString(iterated),
|
2729 | index: 0
|
2730 | });
|
2731 |
|
2732 |
|
2733 | }, function next() {
|
2734 | var state = getInternalState(this);
|
2735 | var string = state.string;
|
2736 | var index = state.index;
|
2737 | var point;
|
2738 | if (index >= string.length) return { value: undefined, done: true };
|
2739 | point = charAt(string, index);
|
2740 | state.index += point.length;
|
2741 | return { value: point, done: false };
|
2742 | });
|
2743 |
|
2744 |
|
2745 | }),
|
2746 |
|
2747 | (function(module, __webpack_exports__, __webpack_require__) {
|
2748 |
|
2749 | "use strict";
|
2750 | __webpack_exports__["a"] = values;
|
2751 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(17);
|
2752 |
|
2753 |
|
2754 |
|
2755 | function values(obj) {
|
2756 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(obj);
|
2757 | var length = _keys.length;
|
2758 | var values = Array(length);
|
2759 | for (var i = 0; i < length; i++) {
|
2760 | values[i] = obj[_keys[i]];
|
2761 | }
|
2762 | return values;
|
2763 | }
|
2764 |
|
2765 |
|
2766 | }),
|
2767 |
|
2768 | (function(module, __webpack_exports__, __webpack_require__) {
|
2769 |
|
2770 | "use strict";
|
2771 | __webpack_exports__["a"] = flatten;
|
2772 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
2773 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
2774 | var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(59);
|
2775 | var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(137);
|
2776 |
|
2777 |
|
2778 |
|
2779 |
|
2780 |
|
2781 |
|
2782 | function flatten(input, depth, strict, output) {
|
2783 | output = output || [];
|
2784 | if (!depth && depth !== 0) {
|
2785 | depth = Infinity;
|
2786 | } else if (depth <= 0) {
|
2787 | return output.concat(input);
|
2788 | }
|
2789 | var idx = output.length;
|
2790 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(input); i < length; i++) {
|
2791 | var value = input[i];
|
2792 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(value) && (Object(__WEBPACK_IMPORTED_MODULE_2__isArray_js__["a" ])(value) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" ])(value))) {
|
2793 |
|
2794 | if (depth > 1) {
|
2795 | flatten(value, depth - 1, strict, output);
|
2796 | idx = output.length;
|
2797 | } else {
|
2798 | var j = 0, len = value.length;
|
2799 | while (j < len) output[idx++] = value[j++];
|
2800 | }
|
2801 | } else if (!strict) {
|
2802 | output[idx++] = value;
|
2803 | }
|
2804 | }
|
2805 | return output;
|
2806 | }
|
2807 |
|
2808 |
|
2809 | }),
|
2810 |
|
2811 | (function(module, __webpack_exports__, __webpack_require__) {
|
2812 |
|
2813 | "use strict";
|
2814 | __webpack_exports__["a"] = map;
|
2815 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
2816 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
2817 | var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(17);
|
2818 |
|
2819 |
|
2820 |
|
2821 |
|
2822 |
|
2823 | function map(obj, iteratee, context) {
|
2824 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context);
|
2825 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" ])(obj),
|
2826 | length = (_keys || obj).length,
|
2827 | results = Array(length);
|
2828 | for (var index = 0; index < length; index++) {
|
2829 | var currentKey = _keys ? _keys[index] : index;
|
2830 | results[index] = iteratee(obj[currentKey], currentKey, obj);
|
2831 | }
|
2832 | return results;
|
2833 | }
|
2834 |
|
2835 |
|
2836 | }),
|
2837 |
|
2838 | (function(module, exports, __webpack_require__) {
|
2839 |
|
2840 | "use strict";
|
2841 | (function(global) {
|
2842 |
|
2843 | var _interopRequireDefault = __webpack_require__(1);
|
2844 |
|
2845 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
2846 |
|
2847 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
2848 |
|
2849 | var _map = _interopRequireDefault(__webpack_require__(37));
|
2850 |
|
2851 | var _keys = _interopRequireDefault(__webpack_require__(149));
|
2852 |
|
2853 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
2854 |
|
2855 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
2856 |
|
2857 | var _keys2 = _interopRequireDefault(__webpack_require__(62));
|
2858 |
|
2859 | var _ = __webpack_require__(3);
|
2860 |
|
2861 | var uuid = __webpack_require__(230);
|
2862 |
|
2863 | var debug = __webpack_require__(63);
|
2864 |
|
2865 | var _require = __webpack_require__(32),
|
2866 | inherits = _require.inherits,
|
2867 | parseDate = _require.parseDate;
|
2868 |
|
2869 | var version = __webpack_require__(233);
|
2870 |
|
2871 | var _require2 = __webpack_require__(76),
|
2872 | setAdapters = _require2.setAdapters,
|
2873 | adapterManager = _require2.adapterManager;
|
2874 |
|
2875 | var AV = global.AV || {};
|
2876 |
|
2877 | AV._config = {
|
2878 | serverURLs: {},
|
2879 | useMasterKey: false,
|
2880 | production: null,
|
2881 | realtime: null,
|
2882 | requestTimeout: null
|
2883 | };
|
2884 | var initialUserAgent = "LeanCloud-JS-SDK/".concat(version);
|
2885 |
|
2886 | AV._sharedConfig = {
|
2887 | userAgent: initialUserAgent,
|
2888 | liveQueryRealtime: null
|
2889 | };
|
2890 | adapterManager.on('platformInfo', function (platformInfo) {
|
2891 | var ua = initialUserAgent;
|
2892 |
|
2893 | if (platformInfo) {
|
2894 | if (platformInfo.userAgent) {
|
2895 | ua = platformInfo.userAgent;
|
2896 | } else {
|
2897 | var comments = platformInfo.name;
|
2898 |
|
2899 | if (platformInfo.version) {
|
2900 | comments += "/".concat(platformInfo.version);
|
2901 | }
|
2902 |
|
2903 | if (platformInfo.extra) {
|
2904 | comments += "; ".concat(platformInfo.extra);
|
2905 | }
|
2906 |
|
2907 | ua += " (".concat(comments, ")");
|
2908 | }
|
2909 | }
|
2910 |
|
2911 | AV._sharedConfig.userAgent = ua;
|
2912 | });
|
2913 |
|
2914 |
|
2915 |
|
2916 |
|
2917 |
|
2918 |
|
2919 |
|
2920 |
|
2921 |
|
2922 |
|
2923 |
|
2924 |
|
2925 |
|
2926 | AV._getAVPath = function (path) {
|
2927 | if (!AV.applicationId) {
|
2928 | throw new Error('You need to call AV.initialize before using AV.');
|
2929 | }
|
2930 |
|
2931 | if (!path) {
|
2932 | path = '';
|
2933 | }
|
2934 |
|
2935 | if (!_.isString(path)) {
|
2936 | throw new Error("Tried to get a localStorage path that wasn't a String.");
|
2937 | }
|
2938 |
|
2939 | if (path[0] === '/') {
|
2940 | path = path.substring(1);
|
2941 | }
|
2942 |
|
2943 | return 'AV/' + AV.applicationId + '/' + path;
|
2944 | };
|
2945 |
|
2946 |
|
2947 |
|
2948 |
|
2949 |
|
2950 |
|
2951 |
|
2952 | AV._installationId = null;
|
2953 |
|
2954 | AV._getInstallationId = function () {
|
2955 |
|
2956 | if (AV._installationId) {
|
2957 | return _promise.default.resolve(AV._installationId);
|
2958 | }
|
2959 |
|
2960 |
|
2961 | var path = AV._getAVPath('installationId');
|
2962 |
|
2963 | return AV.localStorage.getItemAsync(path).then(function (_installationId) {
|
2964 | AV._installationId = _installationId;
|
2965 |
|
2966 | if (!AV._installationId) {
|
2967 |
|
2968 | AV._installationId = _installationId = uuid();
|
2969 | return AV.localStorage.setItemAsync(path, _installationId).then(function () {
|
2970 | return _installationId;
|
2971 | });
|
2972 | }
|
2973 |
|
2974 | return _installationId;
|
2975 | });
|
2976 | };
|
2977 |
|
2978 | AV._subscriptionId = null;
|
2979 |
|
2980 | AV._refreshSubscriptionId = function () {
|
2981 | var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AV._getAVPath('subscriptionId');
|
2982 | var subscriptionId = AV._subscriptionId = uuid();
|
2983 | return AV.localStorage.setItemAsync(path, subscriptionId).then(function () {
|
2984 | return subscriptionId;
|
2985 | });
|
2986 | };
|
2987 |
|
2988 | AV._getSubscriptionId = function () {
|
2989 |
|
2990 | if (AV._subscriptionId) {
|
2991 | return _promise.default.resolve(AV._subscriptionId);
|
2992 | }
|
2993 |
|
2994 |
|
2995 | var path = AV._getAVPath('subscriptionId');
|
2996 |
|
2997 | return AV.localStorage.getItemAsync(path).then(function (_subscriptionId) {
|
2998 | AV._subscriptionId = _subscriptionId;
|
2999 |
|
3000 | if (!AV._subscriptionId) {
|
3001 |
|
3002 | _subscriptionId = AV._refreshSubscriptionId(path);
|
3003 | }
|
3004 |
|
3005 | return _subscriptionId;
|
3006 | });
|
3007 | };
|
3008 |
|
3009 | AV._parseDate = parseDate;
|
3010 |
|
3011 | AV._extend = function (protoProps, classProps) {
|
3012 | var child = inherits(this, protoProps, classProps);
|
3013 | child.extend = this.extend;
|
3014 | return child;
|
3015 | };
|
3016 |
|
3017 |
|
3018 |
|
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 |
|
3026 |
|
3027 |
|
3028 | AV._encode = function (value, seenObjects, disallowObjects) {
|
3029 | var full = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
3030 |
|
3031 | if (value instanceof AV.Object) {
|
3032 | if (disallowObjects) {
|
3033 | throw new Error('AV.Objects not allowed here');
|
3034 | }
|
3035 |
|
3036 | if (!seenObjects || _.include(seenObjects, value) || !value._hasData) {
|
3037 | return value._toPointer();
|
3038 | }
|
3039 |
|
3040 | return value._toFullJSON((0, _concat.default)(seenObjects).call(seenObjects, value), full);
|
3041 | }
|
3042 |
|
3043 | if (value instanceof AV.ACL) {
|
3044 | return value.toJSON();
|
3045 | }
|
3046 |
|
3047 | if (_.isDate(value)) {
|
3048 | return full ? {
|
3049 | __type: 'Date',
|
3050 | iso: value.toJSON()
|
3051 | } : value.toJSON();
|
3052 | }
|
3053 |
|
3054 | if (value instanceof AV.GeoPoint) {
|
3055 | return value.toJSON();
|
3056 | }
|
3057 |
|
3058 | if (_.isArray(value)) {
|
3059 | return (0, _map.default)(_).call(_, value, function (x) {
|
3060 | return AV._encode(x, seenObjects, disallowObjects, full);
|
3061 | });
|
3062 | }
|
3063 |
|
3064 | if (_.isRegExp(value)) {
|
3065 | return value.source;
|
3066 | }
|
3067 |
|
3068 | if (value instanceof AV.Relation) {
|
3069 | return value.toJSON();
|
3070 | }
|
3071 |
|
3072 | if (value instanceof AV.Op) {
|
3073 | return value.toJSON();
|
3074 | }
|
3075 |
|
3076 | if (value instanceof AV.File) {
|
3077 | if (!value.url() && !value.id) {
|
3078 | throw new Error('Tried to save an object containing an unsaved file.');
|
3079 | }
|
3080 |
|
3081 | return value._toFullJSON(seenObjects, full);
|
3082 | }
|
3083 |
|
3084 | if (_.isObject(value)) {
|
3085 | return _.mapObject(value, function (v, k) {
|
3086 | return AV._encode(v, seenObjects, disallowObjects, full);
|
3087 | });
|
3088 | }
|
3089 |
|
3090 | return value;
|
3091 | };
|
3092 |
|
3093 |
|
3094 |
|
3095 |
|
3096 |
|
3097 |
|
3098 | AV._decode = function (value, key) {
|
3099 | if (!_.isObject(value) || _.isDate(value)) {
|
3100 | return value;
|
3101 | }
|
3102 |
|
3103 | if (_.isArray(value)) {
|
3104 | return (0, _map.default)(_).call(_, value, function (v) {
|
3105 | return AV._decode(v);
|
3106 | });
|
3107 | }
|
3108 |
|
3109 | if (value instanceof AV.Object) {
|
3110 | return value;
|
3111 | }
|
3112 |
|
3113 | if (value instanceof AV.File) {
|
3114 | return value;
|
3115 | }
|
3116 |
|
3117 | if (value instanceof AV.Op) {
|
3118 | return value;
|
3119 | }
|
3120 |
|
3121 | if (value instanceof AV.GeoPoint) {
|
3122 | return value;
|
3123 | }
|
3124 |
|
3125 | if (value instanceof AV.ACL) {
|
3126 | return value;
|
3127 | }
|
3128 |
|
3129 | if (key === 'ACL') {
|
3130 | return new AV.ACL(value);
|
3131 | }
|
3132 |
|
3133 | if (value.__op) {
|
3134 | return AV.Op._decode(value);
|
3135 | }
|
3136 |
|
3137 | var className;
|
3138 |
|
3139 | if (value.__type === 'Pointer') {
|
3140 | className = value.className;
|
3141 |
|
3142 | var pointer = AV.Object._create(className);
|
3143 |
|
3144 | if ((0, _keys.default)(value).length > 3) {
|
3145 | var v = _.clone(value);
|
3146 |
|
3147 | delete v.__type;
|
3148 | delete v.className;
|
3149 |
|
3150 | pointer._finishFetch(v, true);
|
3151 | } else {
|
3152 | pointer._finishFetch({
|
3153 | objectId: value.objectId
|
3154 | }, false);
|
3155 | }
|
3156 |
|
3157 | return pointer;
|
3158 | }
|
3159 |
|
3160 | if (value.__type === 'Object') {
|
3161 |
|
3162 | className = value.className;
|
3163 |
|
3164 | var _v = _.clone(value);
|
3165 |
|
3166 | delete _v.__type;
|
3167 | delete _v.className;
|
3168 |
|
3169 | var object = AV.Object._create(className);
|
3170 |
|
3171 | object._finishFetch(_v, true);
|
3172 |
|
3173 | return object;
|
3174 | }
|
3175 |
|
3176 | if (value.__type === 'Date') {
|
3177 | return AV._parseDate(value.iso);
|
3178 | }
|
3179 |
|
3180 | if (value.__type === 'GeoPoint') {
|
3181 | return new AV.GeoPoint({
|
3182 | latitude: value.latitude,
|
3183 | longitude: value.longitude
|
3184 | });
|
3185 | }
|
3186 |
|
3187 | if (value.__type === 'Relation') {
|
3188 | if (!key) throw new Error('key missing decoding a Relation');
|
3189 | var relation = new AV.Relation(null, key);
|
3190 | relation.targetClassName = value.className;
|
3191 | return relation;
|
3192 | }
|
3193 |
|
3194 | if (value.__type === 'File') {
|
3195 | var file = new AV.File(value.name);
|
3196 |
|
3197 | var _v2 = _.clone(value);
|
3198 |
|
3199 | delete _v2.__type;
|
3200 |
|
3201 | file._finishFetch(_v2);
|
3202 |
|
3203 | return file;
|
3204 | }
|
3205 |
|
3206 | return _.mapObject(value, AV._decode);
|
3207 | };
|
3208 |
|
3209 |
|
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 | AV.parseJSON = AV._decode;
|
3218 |
|
3219 |
|
3220 |
|
3221 |
|
3222 |
|
3223 |
|
3224 |
|
3225 |
|
3226 | AV.parse = function (text) {
|
3227 | return AV.parseJSON(JSON.parse(text));
|
3228 | };
|
3229 |
|
3230 |
|
3231 |
|
3232 |
|
3233 |
|
3234 |
|
3235 |
|
3236 |
|
3237 | AV.stringify = function (target) {
|
3238 | return (0, _stringify.default)(AV._encode(target, [], false, true));
|
3239 | };
|
3240 |
|
3241 | AV._encodeObjectOrArray = function (value) {
|
3242 | var encodeAVObject = function encodeAVObject(object) {
|
3243 | if (object && object._toFullJSON) {
|
3244 | object = object._toFullJSON([]);
|
3245 | }
|
3246 |
|
3247 | return _.mapObject(object, function (value) {
|
3248 | return AV._encode(value, []);
|
3249 | });
|
3250 | };
|
3251 |
|
3252 | if (_.isArray(value)) {
|
3253 | return (0, _map.default)(value).call(value, function (object) {
|
3254 | return encodeAVObject(object);
|
3255 | });
|
3256 | } else {
|
3257 | return encodeAVObject(value);
|
3258 | }
|
3259 | };
|
3260 |
|
3261 | AV._arrayEach = _.each;
|
3262 |
|
3263 |
|
3264 |
|
3265 |
|
3266 |
|
3267 |
|
3268 |
|
3269 |
|
3270 |
|
3271 |
|
3272 | AV._traverse = function (object, func, seen) {
|
3273 | if (object instanceof AV.Object) {
|
3274 | seen = seen || [];
|
3275 |
|
3276 | if ((0, _indexOf.default)(_).call(_, seen, object) >= 0) {
|
3277 |
|
3278 | return;
|
3279 | }
|
3280 |
|
3281 | seen.push(object);
|
3282 |
|
3283 | AV._traverse(object.attributes, func, seen);
|
3284 |
|
3285 | return func(object);
|
3286 | }
|
3287 |
|
3288 | if (object instanceof AV.Relation || object instanceof AV.File) {
|
3289 |
|
3290 |
|
3291 | return func(object);
|
3292 | }
|
3293 |
|
3294 | if (_.isArray(object)) {
|
3295 | _.each(object, function (child, index) {
|
3296 | var newChild = AV._traverse(child, func, seen);
|
3297 |
|
3298 | if (newChild) {
|
3299 | object[index] = newChild;
|
3300 | }
|
3301 | });
|
3302 |
|
3303 | return func(object);
|
3304 | }
|
3305 |
|
3306 | if (_.isObject(object)) {
|
3307 | AV._each(object, function (child, key) {
|
3308 | var newChild = AV._traverse(child, func, seen);
|
3309 |
|
3310 | if (newChild) {
|
3311 | object[key] = newChild;
|
3312 | }
|
3313 | });
|
3314 |
|
3315 | return func(object);
|
3316 | }
|
3317 |
|
3318 | return func(object);
|
3319 | };
|
3320 |
|
3321 |
|
3322 |
|
3323 |
|
3324 |
|
3325 |
|
3326 |
|
3327 |
|
3328 | AV._objectEach = AV._each = function (obj, callback) {
|
3329 | if (_.isObject(obj)) {
|
3330 | _.each((0, _keys2.default)(_).call(_, obj), function (key) {
|
3331 | callback(obj[key], key);
|
3332 | });
|
3333 | } else {
|
3334 | _.each(obj, callback);
|
3335 | }
|
3336 | };
|
3337 |
|
3338 |
|
3339 |
|
3340 |
|
3341 |
|
3342 |
|
3343 | AV.debug = {
|
3344 | |
3345 |
|
3346 |
|
3347 | enable: function enable() {
|
3348 | var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'leancloud*';
|
3349 | return debug.enable(namespaces);
|
3350 | },
|
3351 |
|
3352 | |
3353 |
|
3354 |
|
3355 | disable: debug.disable
|
3356 | };
|
3357 |
|
3358 |
|
3359 |
|
3360 |
|
3361 |
|
3362 |
|
3363 |
|
3364 | AV.setAdapters = setAdapters;
|
3365 | module.exports = AV;
|
3366 | }.call(exports, __webpack_require__(78)))
|
3367 |
|
3368 | }),
|
3369 |
|
3370 | (function(module, exports, __webpack_require__) {
|
3371 |
|
3372 | var bind = __webpack_require__(52);
|
3373 | var uncurryThis = __webpack_require__(4);
|
3374 | var IndexedObject = __webpack_require__(98);
|
3375 | var toObject = __webpack_require__(33);
|
3376 | var lengthOfArrayLike = __webpack_require__(40);
|
3377 | var arraySpeciesCreate = __webpack_require__(228);
|
3378 |
|
3379 | var push = uncurryThis([].push);
|
3380 |
|
3381 |
|
3382 | var createMethod = function (TYPE) {
|
3383 | var IS_MAP = TYPE == 1;
|
3384 | var IS_FILTER = TYPE == 2;
|
3385 | var IS_SOME = TYPE == 3;
|
3386 | var IS_EVERY = TYPE == 4;
|
3387 | var IS_FIND_INDEX = TYPE == 6;
|
3388 | var IS_FILTER_REJECT = TYPE == 7;
|
3389 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
3390 | return function ($this, callbackfn, that, specificCreate) {
|
3391 | var O = toObject($this);
|
3392 | var self = IndexedObject(O);
|
3393 | var boundFunction = bind(callbackfn, that);
|
3394 | var length = lengthOfArrayLike(self);
|
3395 | var index = 0;
|
3396 | var create = specificCreate || arraySpeciesCreate;
|
3397 | var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
3398 | var value, result;
|
3399 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
3400 | value = self[index];
|
3401 | result = boundFunction(value, index, O);
|
3402 | if (TYPE) {
|
3403 | if (IS_MAP) target[index] = result;
|
3404 | else if (result) switch (TYPE) {
|
3405 | case 3: return true;
|
3406 | case 5: return value;
|
3407 | case 6: return index;
|
3408 | case 2: push(target, value);
|
3409 | } else switch (TYPE) {
|
3410 | case 4: return false;
|
3411 | case 7: push(target, value);
|
3412 | }
|
3413 | }
|
3414 | }
|
3415 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
3416 | };
|
3417 | };
|
3418 |
|
3419 | module.exports = {
|
3420 |
|
3421 |
|
3422 | forEach: createMethod(0),
|
3423 |
|
3424 |
|
3425 | map: createMethod(1),
|
3426 |
|
3427 |
|
3428 | filter: createMethod(2),
|
3429 |
|
3430 |
|
3431 | some: createMethod(3),
|
3432 |
|
3433 |
|
3434 | every: createMethod(4),
|
3435 |
|
3436 |
|
3437 | find: createMethod(5),
|
3438 |
|
3439 |
|
3440 | findIndex: createMethod(6),
|
3441 |
|
3442 |
|
3443 | filterReject: createMethod(7)
|
3444 | };
|
3445 |
|
3446 |
|
3447 | }),
|
3448 |
|
3449 | (function(module, exports, __webpack_require__) {
|
3450 |
|
3451 | "use strict";
|
3452 |
|
3453 |
|
3454 | var _interopRequireDefault = __webpack_require__(1);
|
3455 |
|
3456 | var _keys = _interopRequireDefault(__webpack_require__(62));
|
3457 |
|
3458 | var _ = __webpack_require__(3);
|
3459 |
|
3460 | var EventEmitter = __webpack_require__(234);
|
3461 |
|
3462 | var _require = __webpack_require__(32),
|
3463 | inherits = _require.inherits;
|
3464 |
|
3465 | var AdapterManager = inherits(EventEmitter, {
|
3466 | constructor: function constructor() {
|
3467 | EventEmitter.apply(this);
|
3468 | this._adapters = {};
|
3469 | },
|
3470 | getAdapter: function getAdapter(name) {
|
3471 | var adapter = this._adapters[name];
|
3472 |
|
3473 | if (adapter === undefined) {
|
3474 | throw new Error("".concat(name, " adapter is not configured"));
|
3475 | }
|
3476 |
|
3477 | return adapter;
|
3478 | },
|
3479 | setAdapters: function setAdapters(newAdapters) {
|
3480 | var _this = this;
|
3481 |
|
3482 | _.extend(this._adapters, newAdapters);
|
3483 |
|
3484 | (0, _keys.default)(_).call(_, newAdapters).forEach(function (name) {
|
3485 | return _this.emit(name, newAdapters[name]);
|
3486 | });
|
3487 | }
|
3488 | });
|
3489 | var adapterManager = new AdapterManager();
|
3490 | module.exports = {
|
3491 | getAdapter: adapterManager.getAdapter.bind(adapterManager),
|
3492 | setAdapters: adapterManager.setAdapters.bind(adapterManager),
|
3493 | adapterManager: adapterManager
|
3494 | };
|
3495 |
|
3496 | }),
|
3497 |
|
3498 | (function(module, exports, __webpack_require__) {
|
3499 |
|
3500 | module.exports = __webpack_require__(241);
|
3501 |
|
3502 | }),
|
3503 |
|
3504 | (function(module, exports) {
|
3505 |
|
3506 | var g;
|
3507 |
|
3508 |
|
3509 | g = (function() {
|
3510 | return this;
|
3511 | })();
|
3512 |
|
3513 | try {
|
3514 |
|
3515 | g = g || Function("return this")() || (1,eval)("this");
|
3516 | } catch(e) {
|
3517 |
|
3518 | if(typeof window === "object")
|
3519 | g = window;
|
3520 | }
|
3521 |
|
3522 |
|
3523 |
|
3524 |
|
3525 |
|
3526 | module.exports = g;
|
3527 |
|
3528 |
|
3529 | }),
|
3530 |
|
3531 | (function(module, exports, __webpack_require__) {
|
3532 |
|
3533 | var NATIVE_BIND = __webpack_require__(80);
|
3534 |
|
3535 | var FunctionPrototype = Function.prototype;
|
3536 | var apply = FunctionPrototype.apply;
|
3537 | var call = FunctionPrototype.call;
|
3538 |
|
3539 |
|
3540 | module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
|
3541 | return call.apply(apply, arguments);
|
3542 | });
|
3543 |
|
3544 |
|
3545 | }),
|
3546 |
|
3547 | (function(module, exports, __webpack_require__) {
|
3548 |
|
3549 | var fails = __webpack_require__(2);
|
3550 |
|
3551 | module.exports = !fails(function () {
|
3552 |
|
3553 | var test = (function () { }).bind();
|
3554 |
|
3555 | return typeof test != 'function' || test.hasOwnProperty('prototype');
|
3556 | });
|
3557 |
|
3558 |
|
3559 | }),
|
3560 |
|
3561 | (function(module, exports) {
|
3562 |
|
3563 | var $TypeError = TypeError;
|
3564 |
|
3565 |
|
3566 |
|
3567 | module.exports = function (it) {
|
3568 | if (it == undefined) throw $TypeError("Can't call method on " + it);
|
3569 | return it;
|
3570 | };
|
3571 |
|
3572 |
|
3573 | }),
|
3574 |
|
3575 | (function(module, exports, __webpack_require__) {
|
3576 |
|
3577 | var IS_PURE = __webpack_require__(36);
|
3578 | var store = __webpack_require__(123);
|
3579 |
|
3580 | (module.exports = function (key, value) {
|
3581 | return store[key] || (store[key] = value !== undefined ? value : {});
|
3582 | })('versions', []).push({
|
3583 | version: '3.23.3',
|
3584 | mode: IS_PURE ? 'pure' : 'global',
|
3585 | copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
3586 | license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
|
3587 | source: 'https://github.com/zloirock/core-js'
|
3588 | });
|
3589 |
|
3590 |
|
3591 | }),
|
3592 |
|
3593 | (function(module, exports) {
|
3594 |
|
3595 | module.exports = {};
|
3596 |
|
3597 |
|
3598 | }),
|
3599 |
|
3600 | (function(module, exports) {
|
3601 |
|
3602 | module.exports = function (exec) {
|
3603 | try {
|
3604 | return { error: false, value: exec() };
|
3605 | } catch (error) {
|
3606 | return { error: true, value: error };
|
3607 | }
|
3608 | };
|
3609 |
|
3610 |
|
3611 | }),
|
3612 |
|
3613 | (function(module, exports, __webpack_require__) {
|
3614 |
|
3615 | var global = __webpack_require__(8);
|
3616 | var NativePromiseConstructor = __webpack_require__(69);
|
3617 | var isCallable = __webpack_require__(9);
|
3618 | var isForced = __webpack_require__(159);
|
3619 | var inspectSource = __webpack_require__(132);
|
3620 | var wellKnownSymbol = __webpack_require__(5);
|
3621 | var IS_BROWSER = __webpack_require__(310);
|
3622 | var IS_PURE = __webpack_require__(36);
|
3623 | var V8_VERSION = __webpack_require__(66);
|
3624 |
|
3625 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
3626 | var SPECIES = wellKnownSymbol('species');
|
3627 | var SUBCLASSING = false;
|
3628 | var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
|
3629 |
|
3630 | var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
|
3631 | var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
|
3632 | var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
|
3633 |
|
3634 |
|
3635 |
|
3636 | if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
|
3637 |
|
3638 | if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
|
3639 |
|
3640 |
|
3641 |
|
3642 | if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
|
3643 |
|
3644 | var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
|
3645 | var FakePromise = function (exec) {
|
3646 | exec(function () { }, function () { });
|
3647 | };
|
3648 | var constructor = promise.constructor = {};
|
3649 | constructor[SPECIES] = FakePromise;
|
3650 | SUBCLASSING = promise.then(function () { }) instanceof FakePromise;
|
3651 | if (!SUBCLASSING) return true;
|
3652 |
|
3653 | return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
|
3654 | });
|
3655 |
|
3656 | module.exports = {
|
3657 | CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
|
3658 | REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
|
3659 | SUBCLASSING: SUBCLASSING
|
3660 | };
|
3661 |
|
3662 |
|
3663 | }),
|
3664 |
|
3665 | (function(module, __webpack_exports__, __webpack_require__) {
|
3666 |
|
3667 | "use strict";
|
3668 | __webpack_require__.d(__webpack_exports__, "a", function() { return hasStringTagBug; });
|
3669 | __webpack_require__.d(__webpack_exports__, "b", function() { return isIE11; });
|
3670 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
3671 | var __WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__ = __webpack_require__(327);
|
3672 |
|
3673 |
|
3674 |
|
3675 |
|
3676 |
|
3677 |
|
3678 | var hasStringTagBug = (
|
3679 | __WEBPACK_IMPORTED_MODULE_0__setup_js__["s" ] && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" ])(new DataView(new ArrayBuffer(8)))
|
3680 | ),
|
3681 | isIE11 = (typeof Map !== 'undefined' && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" ])(new Map));
|
3682 |
|
3683 |
|
3684 | }),
|
3685 |
|
3686 | (function(module, __webpack_exports__, __webpack_require__) {
|
3687 |
|
3688 | "use strict";
|
3689 | __webpack_exports__["a"] = allKeys;
|
3690 | var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(58);
|
3691 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
3692 | var __WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__ = __webpack_require__(189);
|
3693 |
|
3694 |
|
3695 |
|
3696 |
|
3697 |
|
3698 | function allKeys(obj) {
|
3699 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" ])(obj)) return [];
|
3700 | var keys = [];
|
3701 | for (var key in obj) keys.push(key);
|
3702 |
|
3703 | if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" ]) Object(__WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__["a" ])(obj, keys);
|
3704 | return keys;
|
3705 | }
|
3706 |
|
3707 |
|
3708 | }),
|
3709 |
|
3710 | (function(module, __webpack_exports__, __webpack_require__) {
|
3711 |
|
3712 | "use strict";
|
3713 | __webpack_exports__["a"] = toPath;
|
3714 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
3715 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(198);
|
3716 |
|
3717 |
|
3718 |
|
3719 |
|
3720 |
|
3721 | function toPath(path) {
|
3722 | return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].toPath(path);
|
3723 | }
|
3724 |
|
3725 |
|
3726 | }),
|
3727 |
|
3728 | (function(module, __webpack_exports__, __webpack_require__) {
|
3729 |
|
3730 | "use strict";
|
3731 | __webpack_exports__["a"] = optimizeCb;
|
3732 |
|
3733 |
|
3734 |
|
3735 | function optimizeCb(func, context, argCount) {
|
3736 | if (context === void 0) return func;
|
3737 | switch (argCount == null ? 3 : argCount) {
|
3738 | case 1: return function(value) {
|
3739 | return func.call(context, value);
|
3740 | };
|
3741 |
|
3742 | case 3: return function(value, index, collection) {
|
3743 | return func.call(context, value, index, collection);
|
3744 | };
|
3745 | case 4: return function(accumulator, value, index, collection) {
|
3746 | return func.call(context, accumulator, value, index, collection);
|
3747 | };
|
3748 | }
|
3749 | return function() {
|
3750 | return func.apply(context, arguments);
|
3751 | };
|
3752 | }
|
3753 |
|
3754 |
|
3755 | }),
|
3756 |
|
3757 | (function(module, __webpack_exports__, __webpack_require__) {
|
3758 |
|
3759 | "use strict";
|
3760 | __webpack_exports__["a"] = filter;
|
3761 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
3762 | var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(60);
|
3763 |
|
3764 |
|
3765 |
|
3766 |
|
3767 | function filter(obj, predicate, context) {
|
3768 | var results = [];
|
3769 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
3770 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(obj, function(value, index, list) {
|
3771 | if (predicate(value, index, list)) results.push(value);
|
3772 | });
|
3773 | return results;
|
3774 | }
|
3775 |
|
3776 |
|
3777 | }),
|
3778 |
|
3779 | (function(module, __webpack_exports__, __webpack_require__) {
|
3780 |
|
3781 | "use strict";
|
3782 | __webpack_exports__["a"] = contains;
|
3783 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
3784 | var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(71);
|
3785 | var __WEBPACK_IMPORTED_MODULE_2__indexOf_js__ = __webpack_require__(214);
|
3786 |
|
3787 |
|
3788 |
|
3789 |
|
3790 |
|
3791 | function contains(obj, item, fromIndex, guard) {
|
3792 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" ])(obj);
|
3793 | if (typeof fromIndex != 'number' || guard) fromIndex = 0;
|
3794 | return Object(__WEBPACK_IMPORTED_MODULE_2__indexOf_js__["a" ])(obj, item, fromIndex) >= 0;
|
3795 | }
|
3796 |
|
3797 |
|
3798 | }),
|
3799 |
|
3800 | (function(module, exports, __webpack_require__) {
|
3801 |
|
3802 | var classof = __webpack_require__(50);
|
3803 |
|
3804 |
|
3805 |
|
3806 |
|
3807 | module.exports = Array.isArray || function isArray(argument) {
|
3808 | return classof(argument) == 'Array';
|
3809 | };
|
3810 |
|
3811 |
|
3812 | }),
|
3813 |
|
3814 | (function(module, exports, __webpack_require__) {
|
3815 |
|
3816 | "use strict";
|
3817 |
|
3818 | var toPropertyKey = __webpack_require__(99);
|
3819 | var definePropertyModule = __webpack_require__(23);
|
3820 | var createPropertyDescriptor = __webpack_require__(49);
|
3821 |
|
3822 | module.exports = function (object, key, value) {
|
3823 | var propertyKey = toPropertyKey(key);
|
3824 | if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
|
3825 | else object[propertyKey] = value;
|
3826 | };
|
3827 |
|
3828 |
|
3829 | }),
|
3830 |
|
3831 | (function(module, exports, __webpack_require__) {
|
3832 |
|
3833 | module.exports = __webpack_require__(239);
|
3834 |
|
3835 | }),
|
3836 |
|
3837 | (function(module, exports, __webpack_require__) {
|
3838 |
|
3839 | var _Symbol = __webpack_require__(240);
|
3840 |
|
3841 | var _Symbol$iterator = __webpack_require__(462);
|
3842 |
|
3843 | function _typeof(obj) {
|
3844 | "@babel/helpers - typeof";
|
3845 |
|
3846 | return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (obj) {
|
3847 | return typeof obj;
|
3848 | } : function (obj) {
|
3849 | return obj && "function" == typeof _Symbol && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
|
3850 | }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
3851 | }
|
3852 |
|
3853 | module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
3854 |
|
3855 | }),
|
3856 |
|
3857 | (function(module, exports, __webpack_require__) {
|
3858 |
|
3859 | module.exports = __webpack_require__(475);
|
3860 |
|
3861 | }),
|
3862 |
|
3863 | (function(module, exports, __webpack_require__) {
|
3864 |
|
3865 | var $ = __webpack_require__(0);
|
3866 | var uncurryThis = __webpack_require__(4);
|
3867 | var hiddenKeys = __webpack_require__(83);
|
3868 | var isObject = __webpack_require__(11);
|
3869 | var hasOwn = __webpack_require__(13);
|
3870 | var defineProperty = __webpack_require__(23).f;
|
3871 | var getOwnPropertyNamesModule = __webpack_require__(105);
|
3872 | var getOwnPropertyNamesExternalModule = __webpack_require__(243);
|
3873 | var isExtensible = __webpack_require__(264);
|
3874 | var uid = __webpack_require__(101);
|
3875 | var FREEZING = __webpack_require__(263);
|
3876 |
|
3877 | var REQUIRED = false;
|
3878 | var METADATA = uid('meta');
|
3879 | var id = 0;
|
3880 |
|
3881 | var setMetadata = function (it) {
|
3882 | defineProperty(it, METADATA, { value: {
|
3883 | objectID: 'O' + id++,
|
3884 | weakData: {}
|
3885 | } });
|
3886 | };
|
3887 |
|
3888 | var fastKey = function (it, create) {
|
3889 |
|
3890 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
3891 | if (!hasOwn(it, METADATA)) {
|
3892 |
|
3893 | if (!isExtensible(it)) return 'F';
|
3894 |
|
3895 | if (!create) return 'E';
|
3896 |
|
3897 | setMetadata(it);
|
3898 |
|
3899 | } return it[METADATA].objectID;
|
3900 | };
|
3901 |
|
3902 | var getWeakData = function (it, create) {
|
3903 | if (!hasOwn(it, METADATA)) {
|
3904 |
|
3905 | if (!isExtensible(it)) return true;
|
3906 |
|
3907 | if (!create) return false;
|
3908 |
|
3909 | setMetadata(it);
|
3910 |
|
3911 | } return it[METADATA].weakData;
|
3912 | };
|
3913 |
|
3914 |
|
3915 | var onFreeze = function (it) {
|
3916 | if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);
|
3917 | return it;
|
3918 | };
|
3919 |
|
3920 | var enable = function () {
|
3921 | meta.enable = function () { };
|
3922 | REQUIRED = true;
|
3923 | var getOwnPropertyNames = getOwnPropertyNamesModule.f;
|
3924 | var splice = uncurryThis([].splice);
|
3925 | var test = {};
|
3926 | test[METADATA] = 1;
|
3927 |
|
3928 |
|
3929 | if (getOwnPropertyNames(test).length) {
|
3930 | getOwnPropertyNamesModule.f = function (it) {
|
3931 | var result = getOwnPropertyNames(it);
|
3932 | for (var i = 0, length = result.length; i < length; i++) {
|
3933 | if (result[i] === METADATA) {
|
3934 | splice(result, i, 1);
|
3935 | break;
|
3936 | }
|
3937 | } return result;
|
3938 | };
|
3939 |
|
3940 | $({ target: 'Object', stat: true, forced: true }, {
|
3941 | getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
|
3942 | });
|
3943 | }
|
3944 | };
|
3945 |
|
3946 | var meta = module.exports = {
|
3947 | enable: enable,
|
3948 | fastKey: fastKey,
|
3949 | getWeakData: getWeakData,
|
3950 | onFreeze: onFreeze
|
3951 | };
|
3952 |
|
3953 | hiddenKeys[METADATA] = true;
|
3954 |
|
3955 |
|
3956 | }),
|
3957 |
|
3958 | (function(module, exports, __webpack_require__) {
|
3959 |
|
3960 | var uncurryThis = __webpack_require__(4);
|
3961 | var fails = __webpack_require__(2);
|
3962 | var classof = __webpack_require__(50);
|
3963 |
|
3964 | var $Object = Object;
|
3965 | var split = uncurryThis(''.split);
|
3966 |
|
3967 |
|
3968 | module.exports = fails(function () {
|
3969 |
|
3970 |
|
3971 | return !$Object('z').propertyIsEnumerable(0);
|
3972 | }) ? function (it) {
|
3973 | return classof(it) == 'String' ? split(it, '') : $Object(it);
|
3974 | } : $Object;
|
3975 |
|
3976 |
|
3977 | }),
|
3978 |
|
3979 | (function(module, exports, __webpack_require__) {
|
3980 |
|
3981 | var toPrimitive = __webpack_require__(289);
|
3982 | var isSymbol = __webpack_require__(100);
|
3983 |
|
3984 |
|
3985 |
|
3986 | module.exports = function (argument) {
|
3987 | var key = toPrimitive(argument, 'string');
|
3988 | return isSymbol(key) ? key : key + '';
|
3989 | };
|
3990 |
|
3991 |
|
3992 | }),
|
3993 |
|
3994 | (function(module, exports, __webpack_require__) {
|
3995 |
|
3996 | var getBuiltIn = __webpack_require__(20);
|
3997 | var isCallable = __webpack_require__(9);
|
3998 | var isPrototypeOf = __webpack_require__(16);
|
3999 | var USE_SYMBOL_AS_UID = __webpack_require__(157);
|
4000 |
|
4001 | var $Object = Object;
|
4002 |
|
4003 | module.exports = USE_SYMBOL_AS_UID ? function (it) {
|
4004 | return typeof it == 'symbol';
|
4005 | } : function (it) {
|
4006 | var $Symbol = getBuiltIn('Symbol');
|
4007 | return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
|
4008 | };
|
4009 |
|
4010 |
|
4011 | }),
|
4012 |
|
4013 | (function(module, exports, __webpack_require__) {
|
4014 |
|
4015 | var uncurryThis = __webpack_require__(4);
|
4016 |
|
4017 | var id = 0;
|
4018 | var postfix = Math.random();
|
4019 | var toString = uncurryThis(1.0.toString);
|
4020 |
|
4021 | module.exports = function (key) {
|
4022 | return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
4023 | };
|
4024 |
|
4025 |
|
4026 | }),
|
4027 |
|
4028 | (function(module, exports, __webpack_require__) {
|
4029 |
|
4030 | var hasOwn = __webpack_require__(13);
|
4031 | var isCallable = __webpack_require__(9);
|
4032 | var toObject = __webpack_require__(33);
|
4033 | var sharedKey = __webpack_require__(103);
|
4034 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(161);
|
4035 |
|
4036 | var IE_PROTO = sharedKey('IE_PROTO');
|
4037 | var $Object = Object;
|
4038 | var ObjectPrototype = $Object.prototype;
|
4039 |
|
4040 |
|
4041 |
|
4042 |
|
4043 | module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
|
4044 | var object = toObject(O);
|
4045 | if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
|
4046 | var constructor = object.constructor;
|
4047 | if (isCallable(constructor) && object instanceof constructor) {
|
4048 | return constructor.prototype;
|
4049 | } return object instanceof $Object ? ObjectPrototype : null;
|
4050 | };
|
4051 |
|
4052 |
|
4053 | /***/ }),
|
4054 | /* 103 */
|
4055 | /***/ (function(module, exports, __webpack_require__) {
|
4056 |
|
4057 | var shared = __webpack_require__(82);
|
4058 | var uid = __webpack_require__(101);
|
4059 |
|
4060 | var keys = shared('keys');
|
4061 |
|
4062 | module.exports = function (key) {
|
4063 | return keys[key] || (keys[key] = uid(key));
|
4064 | };
|
4065 |
|
4066 |
|
4067 | }),
|
4068 |
|
4069 | (function(module, exports, __webpack_require__) {
|
4070 |
|
4071 |
|
4072 | var uncurryThis = __webpack_require__(4);
|
4073 | var anObject = __webpack_require__(21);
|
4074 | var aPossiblePrototype = __webpack_require__(292);
|
4075 |
|
4076 |
|
4077 |
|
4078 |
|
4079 |
|
4080 | module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
4081 | var CORRECT_SETTER = false;
|
4082 | var test = {};
|
4083 | var setter;
|
4084 | try {
|
4085 |
|
4086 | setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
4087 | setter(test, []);
|
4088 | CORRECT_SETTER = test instanceof Array;
|
4089 | } catch (error) { }
|
4090 | return function setPrototypeOf(O, proto) {
|
4091 | anObject(O);
|
4092 | aPossiblePrototype(proto);
|
4093 | if (CORRECT_SETTER) setter(O, proto);
|
4094 | else O.__proto__ = proto;
|
4095 | return O;
|
4096 | };
|
4097 | }() : undefined);
|
4098 |
|
4099 |
|
4100 | }),
|
4101 |
|
4102 | (function(module, exports, __webpack_require__) {
|
4103 |
|
4104 | var internalObjectKeys = __webpack_require__(163);
|
4105 | var enumBugKeys = __webpack_require__(128);
|
4106 |
|
4107 | var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
4108 |
|
4109 |
|
4110 |
|
4111 |
|
4112 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
4113 | return internalObjectKeys(O, hiddenKeys);
|
4114 | };
|
4115 |
|
4116 |
|
4117 | }),
|
4118 |
|
4119 | (function(module, exports) {
|
4120 |
|
4121 |
|
4122 | exports.f = Object.getOwnPropertySymbols;
|
4123 |
|
4124 |
|
4125 | }),
|
4126 |
|
4127 | (function(module, exports, __webpack_require__) {
|
4128 |
|
4129 | var internalObjectKeys = __webpack_require__(163);
|
4130 | var enumBugKeys = __webpack_require__(128);
|
4131 |
|
4132 |
|
4133 |
|
4134 |
|
4135 | module.exports = Object.keys || function keys(O) {
|
4136 | return internalObjectKeys(O, enumBugKeys);
|
4137 | };
|
4138 |
|
4139 |
|
4140 | }),
|
4141 |
|
4142 | (function(module, exports, __webpack_require__) {
|
4143 |
|
4144 | var classof = __webpack_require__(55);
|
4145 | var getMethod = __webpack_require__(122);
|
4146 | var Iterators = __webpack_require__(54);
|
4147 | var wellKnownSymbol = __webpack_require__(5);
|
4148 |
|
4149 | var ITERATOR = wellKnownSymbol('iterator');
|
4150 |
|
4151 | module.exports = function (it) {
|
4152 | if (it != undefined) return getMethod(it, ITERATOR)
|
4153 | || getMethod(it, '@@iterator')
|
4154 | || Iterators[classof(it)];
|
4155 | };
|
4156 |
|
4157 |
|
4158 | }),
|
4159 |
|
4160 | (function(module, exports, __webpack_require__) {
|
4161 |
|
4162 | var classof = __webpack_require__(50);
|
4163 | var global = __webpack_require__(8);
|
4164 |
|
4165 | module.exports = classof(global.process) == 'process';
|
4166 |
|
4167 |
|
4168 | }),
|
4169 |
|
4170 | (function(module, exports, __webpack_require__) {
|
4171 |
|
4172 | var isPrototypeOf = __webpack_require__(16);
|
4173 |
|
4174 | var $TypeError = TypeError;
|
4175 |
|
4176 | module.exports = function (it, Prototype) {
|
4177 | if (isPrototypeOf(Prototype, it)) return it;
|
4178 | throw $TypeError('Incorrect invocation');
|
4179 | };
|
4180 |
|
4181 |
|
4182 | }),
|
4183 |
|
4184 | (function(module, exports, __webpack_require__) {
|
4185 |
|
4186 | var uncurryThis = __webpack_require__(4);
|
4187 | var fails = __webpack_require__(2);
|
4188 | var isCallable = __webpack_require__(9);
|
4189 | var classof = __webpack_require__(55);
|
4190 | var getBuiltIn = __webpack_require__(20);
|
4191 | var inspectSource = __webpack_require__(132);
|
4192 |
|
4193 | var noop = function () { };
|
4194 | var empty = [];
|
4195 | var construct = getBuiltIn('Reflect', 'construct');
|
4196 | var constructorRegExp = /^\s*(?:class|function)\b/;
|
4197 | var exec = uncurryThis(constructorRegExp.exec);
|
4198 | var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
4199 |
|
4200 | var isConstructorModern = function isConstructor(argument) {
|
4201 | if (!isCallable(argument)) return false;
|
4202 | try {
|
4203 | construct(noop, empty, argument);
|
4204 | return true;
|
4205 | } catch (error) {
|
4206 | return false;
|
4207 | }
|
4208 | };
|
4209 |
|
4210 | var isConstructorLegacy = function isConstructor(argument) {
|
4211 | if (!isCallable(argument)) return false;
|
4212 | switch (classof(argument)) {
|
4213 | case 'AsyncFunction':
|
4214 | case 'GeneratorFunction':
|
4215 | case 'AsyncGeneratorFunction': return false;
|
4216 | }
|
4217 | try {
|
4218 |
|
4219 |
|
4220 |
|
4221 | return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
4222 | } catch (error) {
|
4223 | return true;
|
4224 | }
|
4225 | };
|
4226 |
|
4227 | isConstructorLegacy.sham = true;
|
4228 |
|
4229 |
|
4230 |
|
4231 | module.exports = !construct || fails(function () {
|
4232 | var called;
|
4233 | return isConstructorModern(isConstructorModern.call)
|
4234 | || !isConstructorModern(Object)
|
4235 | || !isConstructorModern(function () { called = true; })
|
4236 | || called;
|
4237 | }) ? isConstructorLegacy : isConstructorModern;
|
4238 |
|
4239 |
|
4240 | }),
|
4241 |
|
4242 | (function(module, exports, __webpack_require__) {
|
4243 |
|
4244 | var uncurryThis = __webpack_require__(4);
|
4245 |
|
4246 | module.exports = uncurryThis([].slice);
|
4247 |
|
4248 |
|
4249 | }),
|
4250 |
|
4251 | (function(module, __webpack_exports__, __webpack_require__) {
|
4252 |
|
4253 | "use strict";
|
4254 | __webpack_exports__["a"] = matcher;
|
4255 | var __WEBPACK_IMPORTED_MODULE_0__extendOwn_js__ = __webpack_require__(141);
|
4256 | var __WEBPACK_IMPORTED_MODULE_1__isMatch_js__ = __webpack_require__(190);
|
4257 |
|
4258 |
|
4259 |
|
4260 |
|
4261 |
|
4262 | function matcher(attrs) {
|
4263 | attrs = Object(__WEBPACK_IMPORTED_MODULE_0__extendOwn_js__["a" ])({}, attrs);
|
4264 | return function(obj) {
|
4265 | return Object(__WEBPACK_IMPORTED_MODULE_1__isMatch_js__["a" ])(obj, attrs);
|
4266 | };
|
4267 | }
|
4268 |
|
4269 |
|
4270 | }),
|
4271 |
|
4272 | (function(module, __webpack_exports__, __webpack_require__) {
|
4273 |
|
4274 | "use strict";
|
4275 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
4276 | var __WEBPACK_IMPORTED_MODULE_1__executeBound_js__ = __webpack_require__(206);
|
4277 | var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(25);
|
4278 |
|
4279 |
|
4280 |
|
4281 |
|
4282 |
|
4283 |
|
4284 |
|
4285 |
|
4286 | var partial = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(func, boundArgs) {
|
4287 | var placeholder = partial.placeholder;
|
4288 | var bound = function() {
|
4289 | var position = 0, length = boundArgs.length;
|
4290 | var args = Array(length);
|
4291 | for (var i = 0; i < length; i++) {
|
4292 | args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
|
4293 | }
|
4294 | while (position < arguments.length) args.push(arguments[position++]);
|
4295 | return Object(__WEBPACK_IMPORTED_MODULE_1__executeBound_js__["a" ])(func, bound, this, this, args);
|
4296 | };
|
4297 | return bound;
|
4298 | });
|
4299 |
|
4300 | partial.placeholder = __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" ];
|
4301 | __webpack_exports__["a"] = (partial);
|
4302 |
|
4303 |
|
4304 | }),
|
4305 |
|
4306 | (function(module, __webpack_exports__, __webpack_require__) {
|
4307 |
|
4308 | "use strict";
|
4309 | __webpack_exports__["a"] = group;
|
4310 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
4311 | var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(60);
|
4312 |
|
4313 |
|
4314 |
|
4315 |
|
4316 | function group(behavior, partition) {
|
4317 | return function(obj, iteratee, context) {
|
4318 | var result = partition ? [[], []] : {};
|
4319 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context);
|
4320 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(obj, function(value, index) {
|
4321 | var key = iteratee(value, index, obj);
|
4322 | behavior(result, value, key);
|
4323 | });
|
4324 | return result;
|
4325 | };
|
4326 | }
|
4327 |
|
4328 |
|
4329 | }),
|
4330 |
|
4331 | (function(module, exports, __webpack_require__) {
|
4332 |
|
4333 | var fails = __webpack_require__(2);
|
4334 | var wellKnownSymbol = __webpack_require__(5);
|
4335 | var V8_VERSION = __webpack_require__(66);
|
4336 |
|
4337 | var SPECIES = wellKnownSymbol('species');
|
4338 |
|
4339 | module.exports = function (METHOD_NAME) {
|
4340 |
|
4341 |
|
4342 |
|
4343 | return V8_VERSION >= 51 || !fails(function () {
|
4344 | var array = [];
|
4345 | var constructor = array.constructor = {};
|
4346 | constructor[SPECIES] = function () {
|
4347 | return { foo: 1 };
|
4348 | };
|
4349 | return array[METHOD_NAME](Boolean).foo !== 1;
|
4350 | });
|
4351 | };
|
4352 |
|
4353 |
|
4354 | }),
|
4355 |
|
4356 | (function(module, exports, __webpack_require__) {
|
4357 |
|
4358 | "use strict";
|
4359 |
|
4360 |
|
4361 | var _interopRequireDefault = __webpack_require__(1);
|
4362 |
|
4363 | var _typeof2 = _interopRequireDefault(__webpack_require__(95));
|
4364 |
|
4365 | var _filter = _interopRequireDefault(__webpack_require__(249));
|
4366 |
|
4367 | var _map = _interopRequireDefault(__webpack_require__(37));
|
4368 |
|
4369 | var _keys = _interopRequireDefault(__webpack_require__(149));
|
4370 |
|
4371 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
4372 |
|
4373 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
4374 |
|
4375 | var _ = __webpack_require__(3);
|
4376 |
|
4377 | var _require = __webpack_require__(250),
|
4378 | timeout = _require.timeout;
|
4379 |
|
4380 | var debug = __webpack_require__(63);
|
4381 |
|
4382 | var debugRequest = debug('leancloud:request');
|
4383 | var debugRequestError = debug('leancloud:request:error');
|
4384 |
|
4385 | var _require2 = __webpack_require__(76),
|
4386 | getAdapter = _require2.getAdapter;
|
4387 |
|
4388 | var requestsCount = 0;
|
4389 |
|
4390 | var ajax = function ajax(_ref) {
|
4391 | var method = _ref.method,
|
4392 | url = _ref.url,
|
4393 | query = _ref.query,
|
4394 | data = _ref.data,
|
4395 | _ref$headers = _ref.headers,
|
4396 | headers = _ref$headers === void 0 ? {} : _ref$headers,
|
4397 | time = _ref.timeout,
|
4398 | onprogress = _ref.onprogress;
|
4399 |
|
4400 | if (query) {
|
4401 | var _context, _context2, _context4;
|
4402 |
|
4403 | var queryString = (0, _filter.default)(_context = (0, _map.default)(_context2 = (0, _keys.default)(query)).call(_context2, function (key) {
|
4404 | var _context3;
|
4405 |
|
4406 | var value = query[key];
|
4407 | if (value === undefined) return undefined;
|
4408 | var v = (0, _typeof2.default)(value) === 'object' ? (0, _stringify.default)(value) : value;
|
4409 | return (0, _concat.default)(_context3 = "".concat(encodeURIComponent(key), "=")).call(_context3, encodeURIComponent(v));
|
4410 | })).call(_context, function (qs) {
|
4411 | return qs;
|
4412 | }).join('&');
|
4413 | url = (0, _concat.default)(_context4 = "".concat(url, "?")).call(_context4, queryString);
|
4414 | }
|
4415 |
|
4416 | var count = requestsCount++;
|
4417 | debugRequest('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
|
4418 | var request = getAdapter('request');
|
4419 | var promise = request(url, {
|
4420 | method: method,
|
4421 | headers: headers,
|
4422 | data: data,
|
4423 | onprogress: onprogress
|
4424 | }).then(function (response) {
|
4425 | debugRequest('response(%d) %d %O %o', count, response.status, response.data || response.text, response.header);
|
4426 |
|
4427 | if (response.ok === false) {
|
4428 | var error = new Error();
|
4429 | error.response = response;
|
4430 | throw error;
|
4431 | }
|
4432 |
|
4433 | return response.data;
|
4434 | }).catch(function (error) {
|
4435 | if (error.response) {
|
4436 | if (!debug.enabled('leancloud:request')) {
|
4437 | debugRequestError('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
|
4438 | }
|
4439 |
|
4440 | debugRequestError('response(%d) %d %O %o', count, error.response.status, error.response.data || error.response.text, error.response.header);
|
4441 | error.statusCode = error.response.status;
|
4442 | error.responseText = error.response.text;
|
4443 | error.response = error.response.data;
|
4444 | }
|
4445 |
|
4446 | throw error;
|
4447 | });
|
4448 | return time ? timeout(promise, time) : promise;
|
4449 | };
|
4450 |
|
4451 | module.exports = ajax;
|
4452 |
|
4453 | }),
|
4454 |
|
4455 | (function(module, exports) {
|
4456 |
|
4457 |
|
4458 |
|
4459 | }),
|
4460 |
|
4461 | (function(module, exports, __webpack_require__) {
|
4462 |
|
4463 | var Symbol = __webpack_require__(274),
|
4464 | getRawTag = __webpack_require__(680),
|
4465 | objectToString = __webpack_require__(681);
|
4466 |
|
4467 |
|
4468 | var nullTag = '[object Null]',
|
4469 | undefinedTag = '[object Undefined]';
|
4470 |
|
4471 |
|
4472 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
4473 |
|
4474 |
|
4475 |
|
4476 |
|
4477 |
|
4478 |
|
4479 |
|
4480 |
|
4481 | function baseGetTag(value) {
|
4482 | if (value == null) {
|
4483 | return value === undefined ? undefinedTag : nullTag;
|
4484 | }
|
4485 | return (symToStringTag && symToStringTag in Object(value))
|
4486 | ? getRawTag(value)
|
4487 | : objectToString(value);
|
4488 | }
|
4489 |
|
4490 | module.exports = baseGetTag;
|
4491 |
|
4492 |
|
4493 | }),
|
4494 |
|
4495 | (function(module, exports) {
|
4496 |
|
4497 |
|
4498 |
|
4499 |
|
4500 |
|
4501 |
|
4502 |
|
4503 |
|
4504 |
|
4505 |
|
4506 |
|
4507 |
|
4508 |
|
4509 |
|
4510 |
|
4511 |
|
4512 |
|
4513 |
|
4514 |
|
4515 |
|
4516 |
|
4517 |
|
4518 |
|
4519 |
|
4520 |
|
4521 | function isObjectLike(value) {
|
4522 | return value != null && typeof value == 'object';
|
4523 | }
|
4524 |
|
4525 | module.exports = isObjectLike;
|
4526 |
|
4527 |
|
4528 | }),
|
4529 |
|
4530 | (function(module, exports, __webpack_require__) {
|
4531 |
|
4532 | "use strict";
|
4533 |
|
4534 | var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
4535 |
|
4536 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
4537 |
|
4538 |
|
4539 | var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
4540 |
|
4541 |
|
4542 |
|
4543 | exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
4544 | var descriptor = getOwnPropertyDescriptor(this, V);
|
4545 | return !!descriptor && descriptor.enumerable;
|
4546 | } : $propertyIsEnumerable;
|
4547 |
|
4548 |
|
4549 | }),
|
4550 |
|
4551 | (function(module, exports, __webpack_require__) {
|
4552 |
|
4553 | var aCallable = __webpack_require__(29);
|
4554 |
|
4555 |
|
4556 |
|
4557 | module.exports = function (V, P) {
|
4558 | var func = V[P];
|
4559 | return func == null ? undefined : aCallable(func);
|
4560 | };
|
4561 |
|
4562 |
|
4563 | }),
|
4564 |
|
4565 | (function(module, exports, __webpack_require__) {
|
4566 |
|
4567 | var global = __webpack_require__(8);
|
4568 | var defineGlobalProperty = __webpack_require__(291);
|
4569 |
|
4570 | var SHARED = '__core-js_shared__';
|
4571 | var store = global[SHARED] || defineGlobalProperty(SHARED, {});
|
4572 |
|
4573 | module.exports = store;
|
4574 |
|
4575 |
|
4576 | }),
|
4577 |
|
4578 | (function(module, exports, __webpack_require__) {
|
4579 |
|
4580 | var global = __webpack_require__(8);
|
4581 | var isObject = __webpack_require__(11);
|
4582 |
|
4583 | var document = global.document;
|
4584 |
|
4585 | var EXISTS = isObject(document) && isObject(document.createElement);
|
4586 |
|
4587 | module.exports = function (it) {
|
4588 | return EXISTS ? document.createElement(it) : {};
|
4589 | };
|
4590 |
|
4591 |
|
4592 | }),
|
4593 |
|
4594 | (function(module, exports, __webpack_require__) {
|
4595 |
|
4596 | var toIndexedObject = __webpack_require__(35);
|
4597 | var toAbsoluteIndex = __webpack_require__(126);
|
4598 | var lengthOfArrayLike = __webpack_require__(40);
|
4599 |
|
4600 |
|
4601 | var createMethod = function (IS_INCLUDES) {
|
4602 | return function ($this, el, fromIndex) {
|
4603 | var O = toIndexedObject($this);
|
4604 | var length = lengthOfArrayLike(O);
|
4605 | var index = toAbsoluteIndex(fromIndex, length);
|
4606 | var value;
|
4607 |
|
4608 |
|
4609 | if (IS_INCLUDES && el != el) while (length > index) {
|
4610 | value = O[index++];
|
4611 |
|
4612 | if (value != value) return true;
|
4613 |
|
4614 | } else for (;length > index; index++) {
|
4615 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
4616 | } return !IS_INCLUDES && -1;
|
4617 | };
|
4618 | };
|
4619 |
|
4620 | module.exports = {
|
4621 |
|
4622 |
|
4623 | includes: createMethod(true),
|
4624 |
|
4625 |
|
4626 | indexOf: createMethod(false)
|
4627 | };
|
4628 |
|
4629 |
|
4630 | }),
|
4631 |
|
4632 | (function(module, exports, __webpack_require__) {
|
4633 |
|
4634 | var toIntegerOrInfinity = __webpack_require__(127);
|
4635 |
|
4636 | var max = Math.max;
|
4637 | var min = Math.min;
|
4638 |
|
4639 |
|
4640 |
|
4641 |
|
4642 | module.exports = function (index, length) {
|
4643 | var integer = toIntegerOrInfinity(index);
|
4644 | return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
4645 | };
|
4646 |
|
4647 |
|
4648 | }),
|
4649 |
|
4650 | (function(module, exports, __webpack_require__) {
|
4651 |
|
4652 | var trunc = __webpack_require__(294);
|
4653 |
|
4654 |
|
4655 |
|
4656 | module.exports = function (argument) {
|
4657 | var number = +argument;
|
4658 |
|
4659 | return number !== number || number === 0 ? 0 : trunc(number);
|
4660 | };
|
4661 |
|
4662 |
|
4663 | }),
|
4664 |
|
4665 | (function(module, exports) {
|
4666 |
|
4667 |
|
4668 | module.exports = [
|
4669 | 'constructor',
|
4670 | 'hasOwnProperty',
|
4671 | 'isPrototypeOf',
|
4672 | 'propertyIsEnumerable',
|
4673 | 'toLocaleString',
|
4674 | 'toString',
|
4675 | 'valueOf'
|
4676 | ];
|
4677 |
|
4678 |
|
4679 | }),
|
4680 |
|
4681 | (function(module, exports, __webpack_require__) {
|
4682 |
|
4683 | var DESCRIPTORS = __webpack_require__(14);
|
4684 | var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(160);
|
4685 | var definePropertyModule = __webpack_require__(23);
|
4686 | var anObject = __webpack_require__(21);
|
4687 | var toIndexedObject = __webpack_require__(35);
|
4688 | var objectKeys = __webpack_require__(107);
|
4689 |
|
4690 |
|
4691 |
|
4692 |
|
4693 | exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
4694 | anObject(O);
|
4695 | var props = toIndexedObject(Properties);
|
4696 | var keys = objectKeys(Properties);
|
4697 | var length = keys.length;
|
4698 | var index = 0;
|
4699 | var key;
|
4700 | while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
4701 | return O;
|
4702 | };
|
4703 |
|
4704 |
|
4705 | }),
|
4706 |
|
4707 | (function(module, exports, __webpack_require__) {
|
4708 |
|
4709 | var wellKnownSymbol = __webpack_require__(5);
|
4710 |
|
4711 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
4712 | var test = {};
|
4713 |
|
4714 | test[TO_STRING_TAG] = 'z';
|
4715 |
|
4716 | module.exports = String(test) === '[object z]';
|
4717 |
|
4718 |
|
4719 | }),
|
4720 |
|
4721 | (function(module, exports) {
|
4722 |
|
4723 | module.exports = function () { };
|
4724 |
|
4725 |
|
4726 | }),
|
4727 |
|
4728 | (function(module, exports, __webpack_require__) {
|
4729 |
|
4730 | var uncurryThis = __webpack_require__(4);
|
4731 | var isCallable = __webpack_require__(9);
|
4732 | var store = __webpack_require__(123);
|
4733 |
|
4734 | var functionToString = uncurryThis(Function.toString);
|
4735 |
|
4736 |
|
4737 | if (!isCallable(store.inspectSource)) {
|
4738 | store.inspectSource = function (it) {
|
4739 | return functionToString(it);
|
4740 | };
|
4741 | }
|
4742 |
|
4743 | module.exports = store.inspectSource;
|
4744 |
|
4745 |
|
4746 | }),
|
4747 |
|
4748 | (function(module, exports, __webpack_require__) {
|
4749 |
|
4750 | "use strict";
|
4751 |
|
4752 | var $ = __webpack_require__(0);
|
4753 | var call = __webpack_require__(15);
|
4754 | var IS_PURE = __webpack_require__(36);
|
4755 | var FunctionName = __webpack_require__(169);
|
4756 | var isCallable = __webpack_require__(9);
|
4757 | var createIteratorConstructor = __webpack_require__(300);
|
4758 | var getPrototypeOf = __webpack_require__(102);
|
4759 | var setPrototypeOf = __webpack_require__(104);
|
4760 | var setToStringTag = __webpack_require__(56);
|
4761 | var createNonEnumerableProperty = __webpack_require__(39);
|
4762 | var defineBuiltIn = __webpack_require__(45);
|
4763 | var wellKnownSymbol = __webpack_require__(5);
|
4764 | var Iterators = __webpack_require__(54);
|
4765 | var IteratorsCore = __webpack_require__(170);
|
4766 |
|
4767 | var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
4768 | var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
4769 | var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
4770 | var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
4771 | var ITERATOR = wellKnownSymbol('iterator');
|
4772 | var KEYS = 'keys';
|
4773 | var VALUES = 'values';
|
4774 | var ENTRIES = 'entries';
|
4775 |
|
4776 | var returnThis = function () { return this; };
|
4777 |
|
4778 | module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
4779 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
4780 |
|
4781 | var getIterationMethod = function (KIND) {
|
4782 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
4783 | if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
4784 | switch (KIND) {
|
4785 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
4786 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
4787 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
4788 | } return function () { return new IteratorConstructor(this); };
|
4789 | };
|
4790 |
|
4791 | var TO_STRING_TAG = NAME + ' Iterator';
|
4792 | var INCORRECT_VALUES_NAME = false;
|
4793 | var IterablePrototype = Iterable.prototype;
|
4794 | var nativeIterator = IterablePrototype[ITERATOR]
|
4795 | || IterablePrototype['@@iterator']
|
4796 | || DEFAULT && IterablePrototype[DEFAULT];
|
4797 | var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
4798 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
4799 | var CurrentIteratorPrototype, methods, KEY;
|
4800 |
|
4801 |
|
4802 | if (anyNativeIterator) {
|
4803 | CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
4804 | if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
4805 | if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
4806 | if (setPrototypeOf) {
|
4807 | setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
4808 | } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
|
4809 | defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
|
4810 | }
|
4811 | }
|
4812 |
|
4813 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
4814 | if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
|
4815 | }
|
4816 | }
|
4817 |
|
4818 |
|
4819 | if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
4820 | if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
|
4821 | createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
|
4822 | } else {
|
4823 | INCORRECT_VALUES_NAME = true;
|
4824 | defaultIterator = function values() { return call(nativeIterator, this); };
|
4825 | }
|
4826 | }
|
4827 |
|
4828 |
|
4829 | if (DEFAULT) {
|
4830 | methods = {
|
4831 | values: getIterationMethod(VALUES),
|
4832 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
4833 | entries: getIterationMethod(ENTRIES)
|
4834 | };
|
4835 | if (FORCED) for (KEY in methods) {
|
4836 | if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
4837 | defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
|
4838 | }
|
4839 | } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
4840 | }
|
4841 |
|
4842 |
|
4843 | if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
|
4844 | defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
|
4845 | }
|
4846 | Iterators[NAME] = defaultIterator;
|
4847 |
|
4848 | return methods;
|
4849 | };
|
4850 |
|
4851 |
|
4852 | }),
|
4853 |
|
4854 | (function(module, __webpack_exports__, __webpack_require__) {
|
4855 |
|
4856 | "use strict";
|
4857 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
4858 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
4859 | __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__setup_js__["e"]; });
|
4860 | var __WEBPACK_IMPORTED_MODULE_1__restArguments_js__ = __webpack_require__(24);
|
4861 | __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__restArguments_js__["a"]; });
|
4862 | var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(58);
|
4863 | __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_2__isObject_js__["a"]; });
|
4864 | var __WEBPACK_IMPORTED_MODULE_3__isNull_js__ = __webpack_require__(322);
|
4865 | __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_3__isNull_js__["a"]; });
|
4866 | var __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__ = __webpack_require__(179);
|
4867 | __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__["a"]; });
|
4868 | var __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__ = __webpack_require__(180);
|
4869 | __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__["a"]; });
|
4870 | var __WEBPACK_IMPORTED_MODULE_6__isElement_js__ = __webpack_require__(323);
|
4871 | __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_6__isElement_js__["a"]; });
|
4872 | var __WEBPACK_IMPORTED_MODULE_7__isString_js__ = __webpack_require__(135);
|
4873 | __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_7__isString_js__["a"]; });
|
4874 | var __WEBPACK_IMPORTED_MODULE_8__isNumber_js__ = __webpack_require__(181);
|
4875 | __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_8__isNumber_js__["a"]; });
|
4876 | var __WEBPACK_IMPORTED_MODULE_9__isDate_js__ = __webpack_require__(324);
|
4877 | __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_9__isDate_js__["a"]; });
|
4878 | var __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__ = __webpack_require__(325);
|
4879 | __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__["a"]; });
|
4880 | var __WEBPACK_IMPORTED_MODULE_11__isError_js__ = __webpack_require__(326);
|
4881 | __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_11__isError_js__["a"]; });
|
4882 | var __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__ = __webpack_require__(182);
|
4883 | __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__["a"]; });
|
4884 | var __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__ = __webpack_require__(183);
|
4885 | __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__["a"]; });
|
4886 | var __WEBPACK_IMPORTED_MODULE_14__isDataView_js__ = __webpack_require__(136);
|
4887 | __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_14__isDataView_js__["a"]; });
|
4888 | var __WEBPACK_IMPORTED_MODULE_15__isArray_js__ = __webpack_require__(59);
|
4889 | __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_15__isArray_js__["a"]; });
|
4890 | var __WEBPACK_IMPORTED_MODULE_16__isFunction_js__ = __webpack_require__(30);
|
4891 | __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_16__isFunction_js__["a"]; });
|
4892 | var __WEBPACK_IMPORTED_MODULE_17__isArguments_js__ = __webpack_require__(137);
|
4893 | __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_17__isArguments_js__["a"]; });
|
4894 | var __WEBPACK_IMPORTED_MODULE_18__isFinite_js__ = __webpack_require__(328);
|
4895 | __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_18__isFinite_js__["a"]; });
|
4896 | var __WEBPACK_IMPORTED_MODULE_19__isNaN_js__ = __webpack_require__(184);
|
4897 | __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_19__isNaN_js__["a"]; });
|
4898 | var __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__ = __webpack_require__(185);
|
4899 | __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__["a"]; });
|
4900 | var __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__ = __webpack_require__(330);
|
4901 | __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__["a"]; });
|
4902 | var __WEBPACK_IMPORTED_MODULE_22__isMatch_js__ = __webpack_require__(190);
|
4903 | __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_22__isMatch_js__["a"]; });
|
4904 | var __WEBPACK_IMPORTED_MODULE_23__isEqual_js__ = __webpack_require__(331);
|
4905 | __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_23__isEqual_js__["a"]; });
|
4906 | var __WEBPACK_IMPORTED_MODULE_24__isMap_js__ = __webpack_require__(333);
|
4907 | __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_24__isMap_js__["a"]; });
|
4908 | var __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__ = __webpack_require__(334);
|
4909 | __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__["a"]; });
|
4910 | var __WEBPACK_IMPORTED_MODULE_26__isSet_js__ = __webpack_require__(335);
|
4911 | __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_26__isSet_js__["a"]; });
|
4912 | var __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__ = __webpack_require__(336);
|
4913 | __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__["a"]; });
|
4914 | var __WEBPACK_IMPORTED_MODULE_28__keys_js__ = __webpack_require__(17);
|
4915 | __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_28__keys_js__["a"]; });
|
4916 | var __WEBPACK_IMPORTED_MODULE_29__allKeys_js__ = __webpack_require__(87);
|
4917 | __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_29__allKeys_js__["a"]; });
|
4918 | var __WEBPACK_IMPORTED_MODULE_30__values_js__ = __webpack_require__(71);
|
4919 | __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_30__values_js__["a"]; });
|
4920 | var __WEBPACK_IMPORTED_MODULE_31__pairs_js__ = __webpack_require__(337);
|
4921 | __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_31__pairs_js__["a"]; });
|
4922 | var __WEBPACK_IMPORTED_MODULE_32__invert_js__ = __webpack_require__(191);
|
4923 | __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_32__invert_js__["a"]; });
|
4924 | var __WEBPACK_IMPORTED_MODULE_33__functions_js__ = __webpack_require__(192);
|
4925 | __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
|
4926 | __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
|
4927 | var __WEBPACK_IMPORTED_MODULE_34__extend_js__ = __webpack_require__(193);
|
4928 | __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_34__extend_js__["a"]; });
|
4929 | var __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__ = __webpack_require__(141);
|
4930 | __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
|
4931 | __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
|
4932 | var __WEBPACK_IMPORTED_MODULE_36__defaults_js__ = __webpack_require__(194);
|
4933 | __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_36__defaults_js__["a"]; });
|
4934 | var __WEBPACK_IMPORTED_MODULE_37__create_js__ = __webpack_require__(338);
|
4935 | __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_37__create_js__["a"]; });
|
4936 | var __WEBPACK_IMPORTED_MODULE_38__clone_js__ = __webpack_require__(196);
|
4937 | __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_38__clone_js__["a"]; });
|
4938 | var __WEBPACK_IMPORTED_MODULE_39__tap_js__ = __webpack_require__(339);
|
4939 | __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_39__tap_js__["a"]; });
|
4940 | var __WEBPACK_IMPORTED_MODULE_40__get_js__ = __webpack_require__(197);
|
4941 | __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_40__get_js__["a"]; });
|
4942 | var __WEBPACK_IMPORTED_MODULE_41__has_js__ = __webpack_require__(340);
|
4943 | __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_41__has_js__["a"]; });
|
4944 | var __WEBPACK_IMPORTED_MODULE_42__mapObject_js__ = __webpack_require__(341);
|
4945 | __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_42__mapObject_js__["a"]; });
|
4946 | var __WEBPACK_IMPORTED_MODULE_43__identity_js__ = __webpack_require__(143);
|
4947 | __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_43__identity_js__["a"]; });
|
4948 | var __WEBPACK_IMPORTED_MODULE_44__constant_js__ = __webpack_require__(186);
|
4949 | __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_44__constant_js__["a"]; });
|
4950 | var __WEBPACK_IMPORTED_MODULE_45__noop_js__ = __webpack_require__(201);
|
4951 | __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_45__noop_js__["a"]; });
|
4952 | var __WEBPACK_IMPORTED_MODULE_46__toPath_js__ = __webpack_require__(198);
|
4953 | __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_46__toPath_js__["a"]; });
|
4954 | var __WEBPACK_IMPORTED_MODULE_47__property_js__ = __webpack_require__(144);
|
4955 | __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_47__property_js__["a"]; });
|
4956 | var __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__ = __webpack_require__(342);
|
4957 | __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__["a"]; });
|
4958 | var __WEBPACK_IMPORTED_MODULE_49__matcher_js__ = __webpack_require__(113);
|
4959 | __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
|
4960 | __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
|
4961 | var __WEBPACK_IMPORTED_MODULE_50__times_js__ = __webpack_require__(343);
|
4962 | __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_50__times_js__["a"]; });
|
4963 | var __WEBPACK_IMPORTED_MODULE_51__random_js__ = __webpack_require__(202);
|
4964 | __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_51__random_js__["a"]; });
|
4965 | var __WEBPACK_IMPORTED_MODULE_52__now_js__ = __webpack_require__(145);
|
4966 | __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_52__now_js__["a"]; });
|
4967 | var __WEBPACK_IMPORTED_MODULE_53__escape_js__ = __webpack_require__(344);
|
4968 | __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_53__escape_js__["a"]; });
|
4969 | var __WEBPACK_IMPORTED_MODULE_54__unescape_js__ = __webpack_require__(345);
|
4970 | __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_54__unescape_js__["a"]; });
|
4971 | var __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__ = __webpack_require__(205);
|
4972 | __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__["a"]; });
|
4973 | var __WEBPACK_IMPORTED_MODULE_56__template_js__ = __webpack_require__(347);
|
4974 | __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_56__template_js__["a"]; });
|
4975 | var __WEBPACK_IMPORTED_MODULE_57__result_js__ = __webpack_require__(348);
|
4976 | __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_57__result_js__["a"]; });
|
4977 | var __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__ = __webpack_require__(349);
|
4978 | __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__["a"]; });
|
4979 | var __WEBPACK_IMPORTED_MODULE_59__chain_js__ = __webpack_require__(350);
|
4980 | __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_59__chain_js__["a"]; });
|
4981 | var __WEBPACK_IMPORTED_MODULE_60__iteratee_js__ = __webpack_require__(200);
|
4982 | __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_60__iteratee_js__["a"]; });
|
4983 | var __WEBPACK_IMPORTED_MODULE_61__partial_js__ = __webpack_require__(114);
|
4984 | __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_61__partial_js__["a"]; });
|
4985 | var __WEBPACK_IMPORTED_MODULE_62__bind_js__ = __webpack_require__(207);
|
4986 | __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_62__bind_js__["a"]; });
|
4987 | var __WEBPACK_IMPORTED_MODULE_63__bindAll_js__ = __webpack_require__(351);
|
4988 | __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_63__bindAll_js__["a"]; });
|
4989 | var __WEBPACK_IMPORTED_MODULE_64__memoize_js__ = __webpack_require__(352);
|
4990 | __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_64__memoize_js__["a"]; });
|
4991 | var __WEBPACK_IMPORTED_MODULE_65__delay_js__ = __webpack_require__(208);
|
4992 | __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_65__delay_js__["a"]; });
|
4993 | var __WEBPACK_IMPORTED_MODULE_66__defer_js__ = __webpack_require__(353);
|
4994 | __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_66__defer_js__["a"]; });
|
4995 | var __WEBPACK_IMPORTED_MODULE_67__throttle_js__ = __webpack_require__(354);
|
4996 | __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_67__throttle_js__["a"]; });
|
4997 | var __WEBPACK_IMPORTED_MODULE_68__debounce_js__ = __webpack_require__(355);
|
4998 | __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_68__debounce_js__["a"]; });
|
4999 | var __WEBPACK_IMPORTED_MODULE_69__wrap_js__ = __webpack_require__(356);
|
5000 | __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_69__wrap_js__["a"]; });
|
5001 | var __WEBPACK_IMPORTED_MODULE_70__negate_js__ = __webpack_require__(146);
|
5002 | __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_70__negate_js__["a"]; });
|
5003 | var __WEBPACK_IMPORTED_MODULE_71__compose_js__ = __webpack_require__(357);
|
5004 | __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_71__compose_js__["a"]; });
|
5005 | var __WEBPACK_IMPORTED_MODULE_72__after_js__ = __webpack_require__(358);
|
5006 | __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_72__after_js__["a"]; });
|
5007 | var __WEBPACK_IMPORTED_MODULE_73__before_js__ = __webpack_require__(209);
|
5008 | __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_73__before_js__["a"]; });
|
5009 | var __WEBPACK_IMPORTED_MODULE_74__once_js__ = __webpack_require__(359);
|
5010 | __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_74__once_js__["a"]; });
|
5011 | var __WEBPACK_IMPORTED_MODULE_75__findKey_js__ = __webpack_require__(210);
|
5012 | __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_75__findKey_js__["a"]; });
|
5013 | var __WEBPACK_IMPORTED_MODULE_76__findIndex_js__ = __webpack_require__(147);
|
5014 | __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_76__findIndex_js__["a"]; });
|
5015 | var __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__ = __webpack_require__(212);
|
5016 | __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__["a"]; });
|
5017 | var __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__ = __webpack_require__(213);
|
5018 | __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__["a"]; });
|
5019 | var __WEBPACK_IMPORTED_MODULE_79__indexOf_js__ = __webpack_require__(214);
|
5020 | __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_79__indexOf_js__["a"]; });
|
5021 | var __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__ = __webpack_require__(360);
|
5022 | __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__["a"]; });
|
5023 | var __WEBPACK_IMPORTED_MODULE_81__find_js__ = __webpack_require__(216);
|
5024 | __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
|
5025 | __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
|
5026 | var __WEBPACK_IMPORTED_MODULE_82__findWhere_js__ = __webpack_require__(361);
|
5027 | __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_82__findWhere_js__["a"]; });
|
5028 | var __WEBPACK_IMPORTED_MODULE_83__each_js__ = __webpack_require__(60);
|
5029 | __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
|
5030 | __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
|
5031 | var __WEBPACK_IMPORTED_MODULE_84__map_js__ = __webpack_require__(73);
|
5032 | __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
|
5033 | __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
|
5034 | var __WEBPACK_IMPORTED_MODULE_85__reduce_js__ = __webpack_require__(362);
|
5035 | __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
|
5036 | __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
|
5037 | __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
|
5038 | var __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__ = __webpack_require__(363);
|
5039 | __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
|
5040 | __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
|
5041 | var __WEBPACK_IMPORTED_MODULE_87__filter_js__ = __webpack_require__(90);
|
5042 | __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
|
5043 | __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
|
5044 | var __WEBPACK_IMPORTED_MODULE_88__reject_js__ = __webpack_require__(364);
|
5045 | __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_88__reject_js__["a"]; });
|
5046 | var __WEBPACK_IMPORTED_MODULE_89__every_js__ = __webpack_require__(365);
|
5047 | __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
|
5048 | __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
|
5049 | var __WEBPACK_IMPORTED_MODULE_90__some_js__ = __webpack_require__(366);
|
5050 | __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
|
5051 | __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
|
5052 | var __WEBPACK_IMPORTED_MODULE_91__contains_js__ = __webpack_require__(91);
|
5053 | __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
|
5054 | __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
|
5055 | __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
|
5056 | var __WEBPACK_IMPORTED_MODULE_92__invoke_js__ = __webpack_require__(367);
|
5057 | __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_92__invoke_js__["a"]; });
|
5058 | var __WEBPACK_IMPORTED_MODULE_93__pluck_js__ = __webpack_require__(148);
|
5059 | __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_93__pluck_js__["a"]; });
|
5060 | var __WEBPACK_IMPORTED_MODULE_94__where_js__ = __webpack_require__(368);
|
5061 | __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_94__where_js__["a"]; });
|
5062 | var __WEBPACK_IMPORTED_MODULE_95__max_js__ = __webpack_require__(218);
|
5063 | __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_95__max_js__["a"]; });
|
5064 | var __WEBPACK_IMPORTED_MODULE_96__min_js__ = __webpack_require__(369);
|
5065 | __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_96__min_js__["a"]; });
|
5066 | var __WEBPACK_IMPORTED_MODULE_97__shuffle_js__ = __webpack_require__(370);
|
5067 | __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_97__shuffle_js__["a"]; });
|
5068 | var __WEBPACK_IMPORTED_MODULE_98__sample_js__ = __webpack_require__(219);
|
5069 | __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_98__sample_js__["a"]; });
|
5070 | var __WEBPACK_IMPORTED_MODULE_99__sortBy_js__ = __webpack_require__(371);
|
5071 | __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_99__sortBy_js__["a"]; });
|
5072 | var __WEBPACK_IMPORTED_MODULE_100__groupBy_js__ = __webpack_require__(372);
|
5073 | __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_100__groupBy_js__["a"]; });
|
5074 | var __WEBPACK_IMPORTED_MODULE_101__indexBy_js__ = __webpack_require__(373);
|
5075 | __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_101__indexBy_js__["a"]; });
|
5076 | var __WEBPACK_IMPORTED_MODULE_102__countBy_js__ = __webpack_require__(374);
|
5077 | __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_102__countBy_js__["a"]; });
|
5078 | var __WEBPACK_IMPORTED_MODULE_103__partition_js__ = __webpack_require__(375);
|
5079 | __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_103__partition_js__["a"]; });
|
5080 | var __WEBPACK_IMPORTED_MODULE_104__toArray_js__ = __webpack_require__(376);
|
5081 | __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_104__toArray_js__["a"]; });
|
5082 | var __WEBPACK_IMPORTED_MODULE_105__size_js__ = __webpack_require__(377);
|
5083 | __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_105__size_js__["a"]; });
|
5084 | var __WEBPACK_IMPORTED_MODULE_106__pick_js__ = __webpack_require__(220);
|
5085 | __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_106__pick_js__["a"]; });
|
5086 | var __WEBPACK_IMPORTED_MODULE_107__omit_js__ = __webpack_require__(379);
|
5087 | __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_107__omit_js__["a"]; });
|
5088 | var __WEBPACK_IMPORTED_MODULE_108__first_js__ = __webpack_require__(380);
|
5089 | __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
|
5090 | __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
|
5091 | __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
|
5092 | var __WEBPACK_IMPORTED_MODULE_109__initial_js__ = __webpack_require__(221);
|
5093 | __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_109__initial_js__["a"]; });
|
5094 | var __WEBPACK_IMPORTED_MODULE_110__last_js__ = __webpack_require__(381);
|
5095 | __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_110__last_js__["a"]; });
|
5096 | var __WEBPACK_IMPORTED_MODULE_111__rest_js__ = __webpack_require__(222);
|
5097 | __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
|
5098 | __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
|
5099 | __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
|
5100 | var __WEBPACK_IMPORTED_MODULE_112__compact_js__ = __webpack_require__(382);
|
5101 | __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_112__compact_js__["a"]; });
|
5102 | var __WEBPACK_IMPORTED_MODULE_113__flatten_js__ = __webpack_require__(383);
|
5103 | __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_113__flatten_js__["a"]; });
|
5104 | var __WEBPACK_IMPORTED_MODULE_114__without_js__ = __webpack_require__(384);
|
5105 | __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_114__without_js__["a"]; });
|
5106 | var __WEBPACK_IMPORTED_MODULE_115__uniq_js__ = __webpack_require__(224);
|
5107 | __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
|
5108 | __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
|
5109 | var __WEBPACK_IMPORTED_MODULE_116__union_js__ = __webpack_require__(385);
|
5110 | __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_116__union_js__["a"]; });
|
5111 | var __WEBPACK_IMPORTED_MODULE_117__intersection_js__ = __webpack_require__(386);
|
5112 | __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_117__intersection_js__["a"]; });
|
5113 | var __WEBPACK_IMPORTED_MODULE_118__difference_js__ = __webpack_require__(223);
|
5114 | __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_118__difference_js__["a"]; });
|
5115 | var __WEBPACK_IMPORTED_MODULE_119__unzip_js__ = __webpack_require__(225);
|
5116 | __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
|
5117 | __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
|
5118 | var __WEBPACK_IMPORTED_MODULE_120__zip_js__ = __webpack_require__(387);
|
5119 | __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_120__zip_js__["a"]; });
|
5120 | var __WEBPACK_IMPORTED_MODULE_121__object_js__ = __webpack_require__(388);
|
5121 | __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_121__object_js__["a"]; });
|
5122 | var __WEBPACK_IMPORTED_MODULE_122__range_js__ = __webpack_require__(389);
|
5123 | __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_122__range_js__["a"]; });
|
5124 | var __WEBPACK_IMPORTED_MODULE_123__chunk_js__ = __webpack_require__(390);
|
5125 | __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_123__chunk_js__["a"]; });
|
5126 | var __WEBPACK_IMPORTED_MODULE_124__mixin_js__ = __webpack_require__(391);
|
5127 | __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_124__mixin_js__["a"]; });
|
5128 | var __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__ = __webpack_require__(392);
|
5129 | __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__["a"]; });
|
5130 |
|
5131 |
|
5132 |
|
5133 |
|
5134 |
|
5135 |
|
5136 |
|
5137 |
|
5138 |
|
5139 |
|
5140 |
|
5141 |
|
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 |
|
5147 |
|
5148 |
|
5149 |
|
5150 |
|
5151 |
|
5152 |
|
5153 |
|
5154 |
|
5155 |
|
5156 |
|
5157 |
|
5158 |
|
5159 |
|
5160 |
|
5161 |
|
5162 |
|
5163 |
|
5164 |
|
5165 |
|
5166 |
|
5167 |
|
5168 |
|
5169 |
|
5170 |
|
5171 |
|
5172 |
|
5173 |
|
5174 |
|
5175 |
|
5176 |
|
5177 |
|
5178 |
|
5179 |
|
5180 |
|
5181 |
|
5182 |
|
5183 |
|
5184 |
|
5185 |
|
5186 |
|
5187 |
|
5188 |
|
5189 |
|
5190 |
|
5191 |
|
5192 |
|
5193 |
|
5194 |
|
5195 |
|
5196 |
|
5197 |
|
5198 |
|
5199 |
|
5200 |
|
5201 |
|
5202 |
|
5203 |
|
5204 |
|
5205 |
|
5206 |
|
5207 |
|
5208 |
|
5209 |
|
5210 |
|
5211 |
|
5212 |
|
5213 |
|
5214 |
|
5215 |
|
5216 |
|
5217 |
|
5218 |
|
5219 |
|
5220 |
|
5221 |
|
5222 |
|
5223 |
|
5224 |
|
5225 |
|
5226 |
|
5227 |
|
5228 |
|
5229 |
|
5230 |
|
5231 |
|
5232 |
|
5233 |
|
5234 |
|
5235 |
|
5236 |
|
5237 |
|
5238 |
|
5239 |
|
5240 |
|
5241 |
|
5242 |
|
5243 |
|
5244 |
|
5245 |
|
5246 |
|
5247 |
|
5248 |
|
5249 |
|
5250 |
|
5251 |
|
5252 |
|
5253 |
|
5254 |
|
5255 |
|
5256 |
|
5257 |
|
5258 |
|
5259 |
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 |
|
5266 |
|
5267 |
|
5268 |
|
5269 |
|
5270 |
|
5271 |
|
5272 |
|
5273 |
|
5274 |
|
5275 |
|
5276 |
|
5277 |
|
5278 |
|
5279 |
|
5280 |
|
5281 |
|
5282 |
|
5283 |
|
5284 |
|
5285 |
|
5286 |
|
5287 |
|
5288 |
|
5289 |
|
5290 |
|
5291 |
|
5292 |
|
5293 |
|
5294 |
|
5295 |
|
5296 |
|
5297 |
|
5298 |
|
5299 |
|
5300 |
|
5301 |
|
5302 |
|
5303 |
|
5304 |
|
5305 |
|
5306 |
|
5307 |
|
5308 |
|
5309 |
|
5310 |
|
5311 |
|
5312 | }),
|
5313 |
|
5314 | (function(module, __webpack_exports__, __webpack_require__) {
|
5315 |
|
5316 | "use strict";
|
5317 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
5318 |
|
5319 |
|
5320 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('String'));
|
5321 |
|
5322 |
|
5323 | }),
|
5324 |
|
5325 | (function(module, __webpack_exports__, __webpack_require__) {
|
5326 |
|
5327 | "use strict";
|
5328 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
5329 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
5330 | var __WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__ = __webpack_require__(183);
|
5331 | var __WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__ = __webpack_require__(86);
|
5332 |
|
5333 |
|
5334 |
|
5335 |
|
5336 |
|
5337 | var isDataView = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('DataView');
|
5338 |
|
5339 |
|
5340 |
|
5341 | function ie10IsDataView(obj) {
|
5342 | return obj != null && Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(obj.getInt8) && Object(__WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__["a" ])(obj.buffer);
|
5343 | }
|
5344 |
|
5345 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__["a" ] ? ie10IsDataView : isDataView);
|
5346 |
|
5347 |
|
5348 | }),
|
5349 |
|
5350 | (function(module, __webpack_exports__, __webpack_require__) {
|
5351 |
|
5352 | "use strict";
|
5353 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
5354 | var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(47);
|
5355 |
|
5356 |
|
5357 |
|
5358 | var isArguments = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Arguments');
|
5359 |
|
5360 |
|
5361 |
|
5362 | (function() {
|
5363 | if (!isArguments(arguments)) {
|
5364 | isArguments = function(obj) {
|
5365 | return Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" ])(obj, 'callee');
|
5366 | };
|
5367 | }
|
5368 | }());
|
5369 |
|
5370 | __webpack_exports__["a"] = (isArguments);
|
5371 |
|
5372 |
|
5373 | }),
|
5374 |
|
5375 | (function(module, __webpack_exports__, __webpack_require__) {
|
5376 |
|
5377 | "use strict";
|
5378 | var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(188);
|
5379 |
|
5380 |
|
5381 |
|
5382 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" ])('byteLength'));
|
5383 |
|
5384 |
|
5385 | }),
|
5386 |
|
5387 | (function(module, __webpack_exports__, __webpack_require__) {
|
5388 |
|
5389 | "use strict";
|
5390 | __webpack_exports__["a"] = ie11fingerprint;
|
5391 | __webpack_require__.d(__webpack_exports__, "b", function() { return mapMethods; });
|
5392 | __webpack_require__.d(__webpack_exports__, "d", function() { return weakMapMethods; });
|
5393 | __webpack_require__.d(__webpack_exports__, "c", function() { return setMethods; });
|
5394 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
5395 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
5396 | var __WEBPACK_IMPORTED_MODULE_2__allKeys_js__ = __webpack_require__(87);
|
5397 |
|
5398 |
|
5399 |
|
5400 |
|
5401 |
|
5402 |
|
5403 |
|
5404 |
|
5405 | function ie11fingerprint(methods) {
|
5406 | var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(methods);
|
5407 | return function(obj) {
|
5408 | if (obj == null) return false;
|
5409 |
|
5410 | var keys = Object(__WEBPACK_IMPORTED_MODULE_2__allKeys_js__["a" ])(obj);
|
5411 | if (Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(keys)) return false;
|
5412 | for (var i = 0; i < length; i++) {
|
5413 | if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(obj[methods[i]])) return false;
|
5414 | }
|
5415 |
|
5416 |
|
5417 |
|
5418 | return methods !== weakMapMethods || !Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(obj[forEachName]);
|
5419 | };
|
5420 | }
|
5421 |
|
5422 |
|
5423 |
|
5424 | var forEachName = 'forEach',
|
5425 | hasName = 'has',
|
5426 | commonInit = ['clear', 'delete'],
|
5427 | mapTail = ['get', hasName, 'set'];
|
5428 |
|
5429 |
|
5430 |
|
5431 | var mapMethods = commonInit.concat(forEachName, mapTail),
|
5432 | weakMapMethods = commonInit.concat(mapTail),
|
5433 | setMethods = ['add'].concat(commonInit, forEachName, hasName);
|
5434 |
|
5435 |
|
5436 | }),
|
5437 |
|
5438 | (function(module, __webpack_exports__, __webpack_require__) {
|
5439 |
|
5440 | "use strict";
|
5441 | __webpack_exports__["a"] = createAssigner;
|
5442 |
|
5443 | function createAssigner(keysFunc, defaults) {
|
5444 | return function(obj) {
|
5445 | var length = arguments.length;
|
5446 | if (defaults) obj = Object(obj);
|
5447 | if (length < 2 || obj == null) return obj;
|
5448 | for (var index = 1; index < length; index++) {
|
5449 | var source = arguments[index],
|
5450 | keys = keysFunc(source),
|
5451 | l = keys.length;
|
5452 | for (var i = 0; i < l; i++) {
|
5453 | var key = keys[i];
|
5454 | if (!defaults || obj[key] === void 0) obj[key] = source[key];
|
5455 | }
|
5456 | }
|
5457 | return obj;
|
5458 | };
|
5459 | }
|
5460 |
|
5461 |
|
5462 | }),
|
5463 |
|
5464 | (function(module, __webpack_exports__, __webpack_require__) {
|
5465 |
|
5466 | "use strict";
|
5467 | var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(140);
|
5468 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(17);
|
5469 |
|
5470 |
|
5471 |
|
5472 |
|
5473 |
|
5474 |
|
5475 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ]));
|
5476 |
|
5477 |
|
5478 | }),
|
5479 |
|
5480 | (function(module, __webpack_exports__, __webpack_require__) {
|
5481 |
|
5482 | "use strict";
|
5483 | __webpack_exports__["a"] = deepGet;
|
5484 |
|
5485 | function deepGet(obj, path) {
|
5486 | var length = path.length;
|
5487 | for (var i = 0; i < length; i++) {
|
5488 | if (obj == null) return void 0;
|
5489 | obj = obj[path[i]];
|
5490 | }
|
5491 | return length ? obj : void 0;
|
5492 | }
|
5493 |
|
5494 |
|
5495 | }),
|
5496 |
|
5497 | (function(module, __webpack_exports__, __webpack_require__) {
|
5498 |
|
5499 | "use strict";
|
5500 | __webpack_exports__["a"] = identity;
|
5501 |
|
5502 | function identity(value) {
|
5503 | return value;
|
5504 | }
|
5505 |
|
5506 |
|
5507 | }),
|
5508 |
|
5509 | (function(module, __webpack_exports__, __webpack_require__) {
|
5510 |
|
5511 | "use strict";
|
5512 | __webpack_exports__["a"] = property;
|
5513 | var __WEBPACK_IMPORTED_MODULE_0__deepGet_js__ = __webpack_require__(142);
|
5514 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(88);
|
5515 |
|
5516 |
|
5517 |
|
5518 |
|
5519 |
|
5520 | function property(path) {
|
5521 | path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" ])(path);
|
5522 | return function(obj) {
|
5523 | return Object(__WEBPACK_IMPORTED_MODULE_0__deepGet_js__["a" ])(obj, path);
|
5524 | };
|
5525 | }
|
5526 |
|
5527 |
|
5528 | }),
|
5529 |
|
5530 | (function(module, __webpack_exports__, __webpack_require__) {
|
5531 |
|
5532 | "use strict";
|
5533 |
|
5534 | __webpack_exports__["a"] = (Date.now || function() {
|
5535 | return new Date().getTime();
|
5536 | });
|
5537 |
|
5538 |
|
5539 | }),
|
5540 |
|
5541 | (function(module, __webpack_exports__, __webpack_require__) {
|
5542 |
|
5543 | "use strict";
|
5544 | __webpack_exports__["a"] = negate;
|
5545 |
|
5546 | function negate(predicate) {
|
5547 | return function() {
|
5548 | return !predicate.apply(this, arguments);
|
5549 | };
|
5550 | }
|
5551 |
|
5552 |
|
5553 | }),
|
5554 |
|
5555 | (function(module, __webpack_exports__, __webpack_require__) {
|
5556 |
|
5557 | "use strict";
|
5558 | var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(211);
|
5559 |
|
5560 |
|
5561 |
|
5562 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" ])(1));
|
5563 |
|
5564 |
|
5565 | }),
|
5566 |
|
5567 | (function(module, __webpack_exports__, __webpack_require__) {
|
5568 |
|
5569 | "use strict";
|
5570 | __webpack_exports__["a"] = pluck;
|
5571 | var __WEBPACK_IMPORTED_MODULE_0__map_js__ = __webpack_require__(73);
|
5572 | var __WEBPACK_IMPORTED_MODULE_1__property_js__ = __webpack_require__(144);
|
5573 |
|
5574 |
|
5575 |
|
5576 |
|
5577 | function pluck(obj, key) {
|
5578 | return Object(__WEBPACK_IMPORTED_MODULE_0__map_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__property_js__["a" ])(key));
|
5579 | }
|
5580 |
|
5581 |
|
5582 | }),
|
5583 |
|
5584 | (function(module, exports, __webpack_require__) {
|
5585 |
|
5586 | module.exports = __webpack_require__(402);
|
5587 |
|
5588 | }),
|
5589 |
|
5590 | (function(module, exports, __webpack_require__) {
|
5591 |
|
5592 | "use strict";
|
5593 |
|
5594 | var fails = __webpack_require__(2);
|
5595 |
|
5596 | module.exports = function (METHOD_NAME, argument) {
|
5597 | var method = [][METHOD_NAME];
|
5598 | return !!method && fails(function () {
|
5599 |
|
5600 | method.call(null, argument || function () { return 1; }, 1);
|
5601 | });
|
5602 | };
|
5603 |
|
5604 |
|
5605 | }),
|
5606 |
|
5607 | (function(module, exports, __webpack_require__) {
|
5608 |
|
5609 | var wellKnownSymbol = __webpack_require__(5);
|
5610 |
|
5611 | exports.f = wellKnownSymbol;
|
5612 |
|
5613 |
|
5614 | }),
|
5615 |
|
5616 | (function(module, exports, __webpack_require__) {
|
5617 |
|
5618 | module.exports = __webpack_require__(251);
|
5619 |
|
5620 | }),
|
5621 |
|
5622 | (function(module, exports, __webpack_require__) {
|
5623 |
|
5624 | module.exports = __webpack_require__(504);
|
5625 |
|
5626 | }),
|
5627 |
|
5628 | (function(module, exports, __webpack_require__) {
|
5629 |
|
5630 | module.exports = __webpack_require__(248);
|
5631 |
|
5632 | }),
|
5633 |
|
5634 | (function(module, exports, __webpack_require__) {
|
5635 |
|
5636 | "use strict";
|
5637 |
|
5638 |
|
5639 | module.exports = __webpack_require__(621);
|
5640 |
|
5641 | }),
|
5642 |
|
5643 | (function(module, exports, __webpack_require__) {
|
5644 |
|
5645 | var defineBuiltIn = __webpack_require__(45);
|
5646 |
|
5647 | module.exports = function (target, src, options) {
|
5648 | for (var key in src) {
|
5649 | if (options && options.unsafe && target[key]) target[key] = src[key];
|
5650 | else defineBuiltIn(target, key, src[key], options);
|
5651 | } return target;
|
5652 | };
|
5653 |
|
5654 |
|
5655 | }),
|
5656 |
|
5657 | (function(module, exports, __webpack_require__) {
|
5658 |
|
5659 |
|
5660 | var NATIVE_SYMBOL = __webpack_require__(65);
|
5661 |
|
5662 | module.exports = NATIVE_SYMBOL
|
5663 | && !Symbol.sham
|
5664 | && typeof Symbol.iterator == 'symbol';
|
5665 |
|
5666 |
|
5667 | }),
|
5668 |
|
5669 | (function(module, exports, __webpack_require__) {
|
5670 |
|
5671 | var DESCRIPTORS = __webpack_require__(14);
|
5672 | var fails = __webpack_require__(2);
|
5673 | var createElement = __webpack_require__(124);
|
5674 |
|
5675 |
|
5676 | module.exports = !DESCRIPTORS && !fails(function () {
|
5677 |
|
5678 | return Object.defineProperty(createElement('div'), 'a', {
|
5679 | get: function () { return 7; }
|
5680 | }).a != 7;
|
5681 | });
|
5682 |
|
5683 |
|
5684 | }),
|
5685 |
|
5686 | (function(module, exports, __webpack_require__) {
|
5687 |
|
5688 | var fails = __webpack_require__(2);
|
5689 | var isCallable = __webpack_require__(9);
|
5690 |
|
5691 | var replacement = /#|\.prototype\./;
|
5692 |
|
5693 | var isForced = function (feature, detection) {
|
5694 | var value = data[normalize(feature)];
|
5695 | return value == POLYFILL ? true
|
5696 | : value == NATIVE ? false
|
5697 | : isCallable(detection) ? fails(detection)
|
5698 | : !!detection;
|
5699 | };
|
5700 |
|
5701 | var normalize = isForced.normalize = function (string) {
|
5702 | return String(string).replace(replacement, '.').toLowerCase();
|
5703 | };
|
5704 |
|
5705 | var data = isForced.data = {};
|
5706 | var NATIVE = isForced.NATIVE = 'N';
|
5707 | var POLYFILL = isForced.POLYFILL = 'P';
|
5708 |
|
5709 | module.exports = isForced;
|
5710 |
|
5711 |
|
5712 | }),
|
5713 |
|
5714 | (function(module, exports, __webpack_require__) {
|
5715 |
|
5716 | var DESCRIPTORS = __webpack_require__(14);
|
5717 | var fails = __webpack_require__(2);
|
5718 |
|
5719 |
|
5720 |
|
5721 | module.exports = DESCRIPTORS && fails(function () {
|
5722 |
|
5723 | return Object.defineProperty(function () { }, 'prototype', {
|
5724 | value: 42,
|
5725 | writable: false
|
5726 | }).prototype != 42;
|
5727 | });
|
5728 |
|
5729 |
|
5730 | }),
|
5731 |
|
5732 | (function(module, exports, __webpack_require__) {
|
5733 |
|
5734 | var fails = __webpack_require__(2);
|
5735 |
|
5736 | module.exports = !fails(function () {
|
5737 | function F() { }
|
5738 | F.prototype.constructor = null;
|
5739 |
|
5740 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
5741 | });
|
5742 |
|
5743 |
|
5744 | }),
|
5745 |
|
5746 | (function(module, exports, __webpack_require__) {
|
5747 |
|
5748 | var getBuiltIn = __webpack_require__(20);
|
5749 | var uncurryThis = __webpack_require__(4);
|
5750 | var getOwnPropertyNamesModule = __webpack_require__(105);
|
5751 | var getOwnPropertySymbolsModule = __webpack_require__(106);
|
5752 | var anObject = __webpack_require__(21);
|
5753 |
|
5754 | var concat = uncurryThis([].concat);
|
5755 |
|
5756 |
|
5757 | module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
5758 | var keys = getOwnPropertyNamesModule.f(anObject(it));
|
5759 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
5760 | return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
5761 | };
|
5762 |
|
5763 |
|
5764 | }),
|
5765 |
|
5766 | (function(module, exports, __webpack_require__) {
|
5767 |
|
5768 | var uncurryThis = __webpack_require__(4);
|
5769 | var hasOwn = __webpack_require__(13);
|
5770 | var toIndexedObject = __webpack_require__(35);
|
5771 | var indexOf = __webpack_require__(125).indexOf;
|
5772 | var hiddenKeys = __webpack_require__(83);
|
5773 |
|
5774 | var push = uncurryThis([].push);
|
5775 |
|
5776 | module.exports = function (object, names) {
|
5777 | var O = toIndexedObject(object);
|
5778 | var i = 0;
|
5779 | var result = [];
|
5780 | var key;
|
5781 | for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
|
5782 |
|
5783 | while (names.length > i) if (hasOwn(O, key = names[i++])) {
|
5784 | ~indexOf(result, key) || push(result, key);
|
5785 | }
|
5786 | return result;
|
5787 | };
|
5788 |
|
5789 |
|
5790 | }),
|
5791 |
|
5792 | (function(module, exports, __webpack_require__) {
|
5793 |
|
5794 | var getBuiltIn = __webpack_require__(20);
|
5795 |
|
5796 | module.exports = getBuiltIn('document', 'documentElement');
|
5797 |
|
5798 |
|
5799 | }),
|
5800 |
|
5801 | (function(module, exports, __webpack_require__) {
|
5802 |
|
5803 | var wellKnownSymbol = __webpack_require__(5);
|
5804 | var Iterators = __webpack_require__(54);
|
5805 |
|
5806 | var ITERATOR = wellKnownSymbol('iterator');
|
5807 | var ArrayPrototype = Array.prototype;
|
5808 |
|
5809 |
|
5810 | module.exports = function (it) {
|
5811 | return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
5812 | };
|
5813 |
|
5814 |
|
5815 | }),
|
5816 |
|
5817 | (function(module, exports, __webpack_require__) {
|
5818 |
|
5819 | var call = __webpack_require__(15);
|
5820 | var aCallable = __webpack_require__(29);
|
5821 | var anObject = __webpack_require__(21);
|
5822 | var tryToString = __webpack_require__(67);
|
5823 | var getIteratorMethod = __webpack_require__(108);
|
5824 |
|
5825 | var $TypeError = TypeError;
|
5826 |
|
5827 | module.exports = function (argument, usingIterator) {
|
5828 | var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
5829 | if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
|
5830 | throw $TypeError(tryToString(argument) + ' is not iterable');
|
5831 | };
|
5832 |
|
5833 |
|
5834 | }),
|
5835 |
|
5836 | (function(module, exports, __webpack_require__) {
|
5837 |
|
5838 | var call = __webpack_require__(15);
|
5839 | var anObject = __webpack_require__(21);
|
5840 | var getMethod = __webpack_require__(122);
|
5841 |
|
5842 | module.exports = function (iterator, kind, value) {
|
5843 | var innerResult, innerError;
|
5844 | anObject(iterator);
|
5845 | try {
|
5846 | innerResult = getMethod(iterator, 'return');
|
5847 | if (!innerResult) {
|
5848 | if (kind === 'throw') throw value;
|
5849 | return value;
|
5850 | }
|
5851 | innerResult = call(innerResult, iterator);
|
5852 | } catch (error) {
|
5853 | innerError = true;
|
5854 | innerResult = error;
|
5855 | }
|
5856 | if (kind === 'throw') throw value;
|
5857 | if (innerError) throw innerResult;
|
5858 | anObject(innerResult);
|
5859 | return value;
|
5860 | };
|
5861 |
|
5862 |
|
5863 | }),
|
5864 |
|
5865 | (function(module, exports, __webpack_require__) {
|
5866 |
|
5867 | var global = __webpack_require__(8);
|
5868 | var isCallable = __webpack_require__(9);
|
5869 | var inspectSource = __webpack_require__(132);
|
5870 |
|
5871 | var WeakMap = global.WeakMap;
|
5872 |
|
5873 | module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
|
5874 |
|
5875 |
|
5876 | }),
|
5877 |
|
5878 | (function(module, exports, __webpack_require__) {
|
5879 |
|
5880 | var DESCRIPTORS = __webpack_require__(14);
|
5881 | var hasOwn = __webpack_require__(13);
|
5882 |
|
5883 | var FunctionPrototype = Function.prototype;
|
5884 |
|
5885 | var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
|
5886 |
|
5887 | var EXISTS = hasOwn(FunctionPrototype, 'name');
|
5888 |
|
5889 | var PROPER = EXISTS && (function something() { }).name === 'something';
|
5890 | var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
|
5891 |
|
5892 | module.exports = {
|
5893 | EXISTS: EXISTS,
|
5894 | PROPER: PROPER,
|
5895 | CONFIGURABLE: CONFIGURABLE
|
5896 | };
|
5897 |
|
5898 |
|
5899 | }),
|
5900 |
|
5901 | (function(module, exports, __webpack_require__) {
|
5902 |
|
5903 | "use strict";
|
5904 |
|
5905 | var fails = __webpack_require__(2);
|
5906 | var isCallable = __webpack_require__(9);
|
5907 | var create = __webpack_require__(53);
|
5908 | var getPrototypeOf = __webpack_require__(102);
|
5909 | var defineBuiltIn = __webpack_require__(45);
|
5910 | var wellKnownSymbol = __webpack_require__(5);
|
5911 | var IS_PURE = __webpack_require__(36);
|
5912 |
|
5913 | var ITERATOR = wellKnownSymbol('iterator');
|
5914 | var BUGGY_SAFARI_ITERATORS = false;
|
5915 |
|
5916 |
|
5917 |
|
5918 | var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
5919 |
|
5920 |
|
5921 | if ([].keys) {
|
5922 | arrayIterator = [].keys();
|
5923 |
|
5924 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
5925 | else {
|
5926 | PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
|
5927 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
5928 | }
|
5929 | }
|
5930 |
|
5931 | var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
|
5932 | var test = {};
|
5933 |
|
5934 | return IteratorPrototype[ITERATOR].call(test) !== test;
|
5935 | });
|
5936 |
|
5937 | if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
|
5938 | else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
|
5939 |
|
5940 |
|
5941 |
|
5942 | if (!isCallable(IteratorPrototype[ITERATOR])) {
|
5943 | defineBuiltIn(IteratorPrototype, ITERATOR, function () {
|
5944 | return this;
|
5945 | });
|
5946 | }
|
5947 |
|
5948 | module.exports = {
|
5949 | IteratorPrototype: IteratorPrototype,
|
5950 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
5951 | };
|
5952 |
|
5953 |
|
5954 | }),
|
5955 |
|
5956 | (function(module, exports, __webpack_require__) {
|
5957 |
|
5958 | "use strict";
|
5959 |
|
5960 | var getBuiltIn = __webpack_require__(20);
|
5961 | var definePropertyModule = __webpack_require__(23);
|
5962 | var wellKnownSymbol = __webpack_require__(5);
|
5963 | var DESCRIPTORS = __webpack_require__(14);
|
5964 |
|
5965 | var SPECIES = wellKnownSymbol('species');
|
5966 |
|
5967 | module.exports = function (CONSTRUCTOR_NAME) {
|
5968 | var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
5969 | var defineProperty = definePropertyModule.f;
|
5970 |
|
5971 | if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
|
5972 | defineProperty(Constructor, SPECIES, {
|
5973 | configurable: true,
|
5974 | get: function () { return this; }
|
5975 | });
|
5976 | }
|
5977 | };
|
5978 |
|
5979 |
|
5980 | }),
|
5981 |
|
5982 | (function(module, exports, __webpack_require__) {
|
5983 |
|
5984 | var anObject = __webpack_require__(21);
|
5985 | var aConstructor = __webpack_require__(173);
|
5986 | var wellKnownSymbol = __webpack_require__(5);
|
5987 |
|
5988 | var SPECIES = wellKnownSymbol('species');
|
5989 |
|
5990 |
|
5991 |
|
5992 | module.exports = function (O, defaultConstructor) {
|
5993 | var C = anObject(O).constructor;
|
5994 | var S;
|
5995 | return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
|
5996 | };
|
5997 |
|
5998 |
|
5999 | }),
|
6000 |
|
6001 | (function(module, exports, __webpack_require__) {
|
6002 |
|
6003 | var isConstructor = __webpack_require__(111);
|
6004 | var tryToString = __webpack_require__(67);
|
6005 |
|
6006 | var $TypeError = TypeError;
|
6007 |
|
6008 |
|
6009 | module.exports = function (argument) {
|
6010 | if (isConstructor(argument)) return argument;
|
6011 | throw $TypeError(tryToString(argument) + ' is not a constructor');
|
6012 | };
|
6013 |
|
6014 |
|
6015 | }),
|
6016 |
|
6017 | (function(module, exports, __webpack_require__) {
|
6018 |
|
6019 | var global = __webpack_require__(8);
|
6020 | var apply = __webpack_require__(79);
|
6021 | var bind = __webpack_require__(52);
|
6022 | var isCallable = __webpack_require__(9);
|
6023 | var hasOwn = __webpack_require__(13);
|
6024 | var fails = __webpack_require__(2);
|
6025 | var html = __webpack_require__(164);
|
6026 | var arraySlice = __webpack_require__(112);
|
6027 | var createElement = __webpack_require__(124);
|
6028 | var validateArgumentsLength = __webpack_require__(304);
|
6029 | var IS_IOS = __webpack_require__(175);
|
6030 | var IS_NODE = __webpack_require__(109);
|
6031 |
|
6032 | var set = global.setImmediate;
|
6033 | var clear = global.clearImmediate;
|
6034 | var process = global.process;
|
6035 | var Dispatch = global.Dispatch;
|
6036 | var Function = global.Function;
|
6037 | var MessageChannel = global.MessageChannel;
|
6038 | var String = global.String;
|
6039 | var counter = 0;
|
6040 | var queue = {};
|
6041 | var ONREADYSTATECHANGE = 'onreadystatechange';
|
6042 | var location, defer, channel, port;
|
6043 |
|
6044 | try {
|
6045 |
|
6046 | location = global.location;
|
6047 | } catch (error) { }
|
6048 |
|
6049 | var run = function (id) {
|
6050 | if (hasOwn(queue, id)) {
|
6051 | var fn = queue[id];
|
6052 | delete queue[id];
|
6053 | fn();
|
6054 | }
|
6055 | };
|
6056 |
|
6057 | var runner = function (id) {
|
6058 | return function () {
|
6059 | run(id);
|
6060 | };
|
6061 | };
|
6062 |
|
6063 | var listener = function (event) {
|
6064 | run(event.data);
|
6065 | };
|
6066 |
|
6067 | var post = function (id) {
|
6068 |
|
6069 | global.postMessage(String(id), location.protocol + '//' + location.host);
|
6070 | };
|
6071 |
|
6072 |
|
6073 | if (!set || !clear) {
|
6074 | set = function setImmediate(handler) {
|
6075 | validateArgumentsLength(arguments.length, 1);
|
6076 | var fn = isCallable(handler) ? handler : Function(handler);
|
6077 | var args = arraySlice(arguments, 1);
|
6078 | queue[++counter] = function () {
|
6079 | apply(fn, undefined, args);
|
6080 | };
|
6081 | defer(counter);
|
6082 | return counter;
|
6083 | };
|
6084 | clear = function clearImmediate(id) {
|
6085 | delete queue[id];
|
6086 | };
|
6087 |
|
6088 | if (IS_NODE) {
|
6089 | defer = function (id) {
|
6090 | process.nextTick(runner(id));
|
6091 | };
|
6092 |
|
6093 | } else if (Dispatch && Dispatch.now) {
|
6094 | defer = function (id) {
|
6095 | Dispatch.now(runner(id));
|
6096 | };
|
6097 |
|
6098 |
|
6099 | } else if (MessageChannel && !IS_IOS) {
|
6100 | channel = new MessageChannel();
|
6101 | port = channel.port2;
|
6102 | channel.port1.onmessage = listener;
|
6103 | defer = bind(port.postMessage, port);
|
6104 |
|
6105 |
|
6106 | } else if (
|
6107 | global.addEventListener &&
|
6108 | isCallable(global.postMessage) &&
|
6109 | !global.importScripts &&
|
6110 | location && location.protocol !== 'file:' &&
|
6111 | !fails(post)
|
6112 | ) {
|
6113 | defer = post;
|
6114 | global.addEventListener('message', listener, false);
|
6115 |
|
6116 | } else if (ONREADYSTATECHANGE in createElement('script')) {
|
6117 | defer = function (id) {
|
6118 | html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
6119 | html.removeChild(this);
|
6120 | run(id);
|
6121 | };
|
6122 | };
|
6123 |
|
6124 | } else {
|
6125 | defer = function (id) {
|
6126 | setTimeout(runner(id), 0);
|
6127 | };
|
6128 | }
|
6129 | }
|
6130 |
|
6131 | module.exports = {
|
6132 | set: set,
|
6133 | clear: clear
|
6134 | };
|
6135 |
|
6136 |
|
6137 | /***/ }),
|
6138 | /* 175 */
|
6139 | /***/ (function(module, exports, __webpack_require__) {
|
6140 |
|
6141 | var userAgent = __webpack_require__(51);
|
6142 |
|
6143 | module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
|
6144 |
|
6145 |
|
6146 | }),
|
6147 |
|
6148 | (function(module, exports, __webpack_require__) {
|
6149 |
|
6150 | var NativePromiseConstructor = __webpack_require__(69);
|
6151 | var checkCorrectnessOfIteration = __webpack_require__(177);
|
6152 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(85).CONSTRUCTOR;
|
6153 |
|
6154 | module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
|
6155 | NativePromiseConstructor.all(iterable).then(undefined, function () { });
|
6156 | });
|
6157 |
|
6158 |
|
6159 | }),
|
6160 |
|
6161 | (function(module, exports, __webpack_require__) {
|
6162 |
|
6163 | var wellKnownSymbol = __webpack_require__(5);
|
6164 |
|
6165 | var ITERATOR = wellKnownSymbol('iterator');
|
6166 | var SAFE_CLOSING = false;
|
6167 |
|
6168 | try {
|
6169 | var called = 0;
|
6170 | var iteratorWithReturn = {
|
6171 | next: function () {
|
6172 | return { done: !!called++ };
|
6173 | },
|
6174 | 'return': function () {
|
6175 | SAFE_CLOSING = true;
|
6176 | }
|
6177 | };
|
6178 | iteratorWithReturn[ITERATOR] = function () {
|
6179 | return this;
|
6180 | };
|
6181 |
|
6182 | Array.from(iteratorWithReturn, function () { throw 2; });
|
6183 | } catch (error) { }
|
6184 |
|
6185 | module.exports = function (exec, SKIP_CLOSING) {
|
6186 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
6187 | var ITERATION_SUPPORT = false;
|
6188 | try {
|
6189 | var object = {};
|
6190 | object[ITERATOR] = function () {
|
6191 | return {
|
6192 | next: function () {
|
6193 | return { done: ITERATION_SUPPORT = true };
|
6194 | }
|
6195 | };
|
6196 | };
|
6197 | exec(object);
|
6198 | } catch (error) { }
|
6199 | return ITERATION_SUPPORT;
|
6200 | };
|
6201 |
|
6202 |
|
6203 | }),
|
6204 |
|
6205 | (function(module, exports, __webpack_require__) {
|
6206 |
|
6207 | var anObject = __webpack_require__(21);
|
6208 | var isObject = __webpack_require__(11);
|
6209 | var newPromiseCapability = __webpack_require__(57);
|
6210 |
|
6211 | module.exports = function (C, x) {
|
6212 | anObject(C);
|
6213 | if (isObject(x) && x.constructor === C) return x;
|
6214 | var promiseCapability = newPromiseCapability.f(C);
|
6215 | var resolve = promiseCapability.resolve;
|
6216 | resolve(x);
|
6217 | return promiseCapability.promise;
|
6218 | };
|
6219 |
|
6220 |
|
6221 | }),
|
6222 |
|
6223 | (function(module, __webpack_exports__, __webpack_require__) {
|
6224 |
|
6225 | "use strict";
|
6226 | __webpack_exports__["a"] = isUndefined;
|
6227 |
|
6228 | function isUndefined(obj) {
|
6229 | return obj === void 0;
|
6230 | }
|
6231 |
|
6232 |
|
6233 | }),
|
6234 |
|
6235 | (function(module, __webpack_exports__, __webpack_require__) {
|
6236 |
|
6237 | "use strict";
|
6238 | __webpack_exports__["a"] = isBoolean;
|
6239 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6240 |
|
6241 |
|
6242 |
|
6243 | function isBoolean(obj) {
|
6244 | return obj === true || obj === false || __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" ].call(obj) === '[object Boolean]';
|
6245 | }
|
6246 |
|
6247 |
|
6248 | }),
|
6249 |
|
6250 | (function(module, __webpack_exports__, __webpack_require__) {
|
6251 |
|
6252 | "use strict";
|
6253 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
6254 |
|
6255 |
|
6256 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Number'));
|
6257 |
|
6258 |
|
6259 | }),
|
6260 |
|
6261 | (function(module, __webpack_exports__, __webpack_require__) {
|
6262 |
|
6263 | "use strict";
|
6264 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
6265 |
|
6266 |
|
6267 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Symbol'));
|
6268 |
|
6269 |
|
6270 | }),
|
6271 |
|
6272 | (function(module, __webpack_exports__, __webpack_require__) {
|
6273 |
|
6274 | "use strict";
|
6275 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
6276 |
|
6277 |
|
6278 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('ArrayBuffer'));
|
6279 |
|
6280 |
|
6281 | }),
|
6282 |
|
6283 | (function(module, __webpack_exports__, __webpack_require__) {
|
6284 |
|
6285 | "use strict";
|
6286 | __webpack_exports__["a"] = isNaN;
|
6287 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6288 | var __WEBPACK_IMPORTED_MODULE_1__isNumber_js__ = __webpack_require__(181);
|
6289 |
|
6290 |
|
6291 |
|
6292 |
|
6293 | function isNaN(obj) {
|
6294 | return Object(__WEBPACK_IMPORTED_MODULE_1__isNumber_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["g" ])(obj);
|
6295 | }
|
6296 |
|
6297 |
|
6298 | }),
|
6299 |
|
6300 | (function(module, __webpack_exports__, __webpack_require__) {
|
6301 |
|
6302 | "use strict";
|
6303 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6304 | var __WEBPACK_IMPORTED_MODULE_1__isDataView_js__ = __webpack_require__(136);
|
6305 | var __WEBPACK_IMPORTED_MODULE_2__constant_js__ = __webpack_require__(186);
|
6306 | var __WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__ = __webpack_require__(329);
|
6307 |
|
6308 |
|
6309 |
|
6310 |
|
6311 |
|
6312 |
|
6313 | var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
|
6314 | function isTypedArray(obj) {
|
6315 |
|
6316 |
|
6317 | return __WEBPACK_IMPORTED_MODULE_0__setup_js__["l" ] ? (Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["l" ])(obj) && !Object(__WEBPACK_IMPORTED_MODULE_1__isDataView_js__["a" ])(obj)) :
|
6318 | Object(__WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__["a" ])(obj) && typedArrayPattern.test(__WEBPACK_IMPORTED_MODULE_0__setup_js__["t" ].call(obj));
|
6319 | }
|
6320 |
|
6321 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["r" ] ? isTypedArray : Object(__WEBPACK_IMPORTED_MODULE_2__constant_js__["a" ])(false));
|
6322 |
|
6323 |
|
6324 | }),
|
6325 |
|
6326 | (function(module, __webpack_exports__, __webpack_require__) {
|
6327 |
|
6328 | "use strict";
|
6329 | __webpack_exports__["a"] = constant;
|
6330 |
|
6331 | function constant(value) {
|
6332 | return function() {
|
6333 | return value;
|
6334 | };
|
6335 | }
|
6336 |
|
6337 |
|
6338 | }),
|
6339 |
|
6340 | (function(module, __webpack_exports__, __webpack_require__) {
|
6341 |
|
6342 | "use strict";
|
6343 | __webpack_exports__["a"] = createSizePropertyCheck;
|
6344 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6345 |
|
6346 |
|
6347 |
|
6348 | function createSizePropertyCheck(getSizeProperty) {
|
6349 | return function(collection) {
|
6350 | var sizeProperty = getSizeProperty(collection);
|
6351 | return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= __WEBPACK_IMPORTED_MODULE_0__setup_js__["b" ];
|
6352 | }
|
6353 | }
|
6354 |
|
6355 |
|
6356 | }),
|
6357 |
|
6358 | (function(module, __webpack_exports__, __webpack_require__) {
|
6359 |
|
6360 | "use strict";
|
6361 | __webpack_exports__["a"] = shallowProperty;
|
6362 |
|
6363 | function shallowProperty(key) {
|
6364 | return function(obj) {
|
6365 | return obj == null ? void 0 : obj[key];
|
6366 | };
|
6367 | }
|
6368 |
|
6369 |
|
6370 | }),
|
6371 |
|
6372 | (function(module, __webpack_exports__, __webpack_require__) {
|
6373 |
|
6374 | "use strict";
|
6375 | __webpack_exports__["a"] = collectNonEnumProps;
|
6376 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6377 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
6378 | var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(47);
|
6379 |
|
6380 |
|
6381 |
|
6382 |
|
6383 |
|
6384 |
|
6385 |
|
6386 |
|
6387 | function emulatedSet(keys) {
|
6388 | var hash = {};
|
6389 | for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
|
6390 | return {
|
6391 | contains: function(key) { return hash[key]; },
|
6392 | push: function(key) {
|
6393 | hash[key] = true;
|
6394 | return keys.push(key);
|
6395 | }
|
6396 | };
|
6397 | }
|
6398 |
|
6399 |
|
6400 |
|
6401 |
|
6402 | function collectNonEnumProps(obj, keys) {
|
6403 | keys = emulatedSet(keys);
|
6404 | var nonEnumIdx = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" ].length;
|
6405 | var constructor = obj.constructor;
|
6406 | var proto = Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(constructor) && constructor.prototype || __WEBPACK_IMPORTED_MODULE_0__setup_js__["c" /* ObjProto */];
|
6407 |
|
6408 | // Constructor is a special case.
|
6409 | var prop = 'constructor';
|
6410 | if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, prop) && !keys.contains(prop)) keys.push(prop);
|
6411 |
|
6412 | while (nonEnumIdx--) {
|
6413 | prop = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" ][nonEnumIdx];
|
6414 | if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
|
6415 | keys.push(prop);
|
6416 | }
|
6417 | }
|
6418 | }
|
6419 |
|
6420 |
|
6421 | }),
|
6422 |
|
6423 | (function(module, __webpack_exports__, __webpack_require__) {
|
6424 |
|
6425 | "use strict";
|
6426 | __webpack_exports__["a"] = isMatch;
|
6427 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(17);
|
6428 |
|
6429 |
|
6430 |
|
6431 | function isMatch(object, attrs) {
|
6432 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(attrs), length = _keys.length;
|
6433 | if (object == null) return !length;
|
6434 | var obj = Object(object);
|
6435 | for (var i = 0; i < length; i++) {
|
6436 | var key = _keys[i];
|
6437 | if (attrs[key] !== obj[key] || !(key in obj)) return false;
|
6438 | }
|
6439 | return true;
|
6440 | }
|
6441 |
|
6442 |
|
6443 | }),
|
6444 |
|
6445 | (function(module, __webpack_exports__, __webpack_require__) {
|
6446 |
|
6447 | "use strict";
|
6448 | __webpack_exports__["a"] = invert;
|
6449 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(17);
|
6450 |
|
6451 |
|
6452 |
|
6453 | function invert(obj) {
|
6454 | var result = {};
|
6455 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(obj);
|
6456 | for (var i = 0, length = _keys.length; i < length; i++) {
|
6457 | result[obj[_keys[i]]] = _keys[i];
|
6458 | }
|
6459 | return result;
|
6460 | }
|
6461 |
|
6462 |
|
6463 | }),
|
6464 |
|
6465 | (function(module, __webpack_exports__, __webpack_require__) {
|
6466 |
|
6467 | "use strict";
|
6468 | __webpack_exports__["a"] = functions;
|
6469 | var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(30);
|
6470 |
|
6471 |
|
6472 |
|
6473 | function functions(obj) {
|
6474 | var names = [];
|
6475 | for (var key in obj) {
|
6476 | if (Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" ])(obj[key])) names.push(key);
|
6477 | }
|
6478 | return names.sort();
|
6479 | }
|
6480 |
|
6481 |
|
6482 | }),
|
6483 |
|
6484 | (function(module, __webpack_exports__, __webpack_require__) {
|
6485 |
|
6486 | "use strict";
|
6487 | var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(140);
|
6488 | var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(87);
|
6489 |
|
6490 |
|
6491 |
|
6492 |
|
6493 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" ]));
|
6494 |
|
6495 |
|
6496 | }),
|
6497 |
|
6498 | (function(module, __webpack_exports__, __webpack_require__) {
|
6499 |
|
6500 | "use strict";
|
6501 | var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(140);
|
6502 | var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(87);
|
6503 |
|
6504 |
|
6505 |
|
6506 |
|
6507 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" ], true));
|
6508 |
|
6509 |
|
6510 | }),
|
6511 |
|
6512 | (function(module, __webpack_exports__, __webpack_require__) {
|
6513 |
|
6514 | "use strict";
|
6515 | __webpack_exports__["a"] = baseCreate;
|
6516 | var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(58);
|
6517 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
6518 |
|
6519 |
|
6520 |
|
6521 |
|
6522 | function ctor() {
|
6523 | return function(){};
|
6524 | }
|
6525 |
|
6526 |
|
6527 | function baseCreate(prototype) {
|
6528 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" ])(prototype)) return {};
|
6529 | if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" ]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" ])(prototype);
|
6530 | var Ctor = ctor();
|
6531 | Ctor.prototype = prototype;
|
6532 | var result = new Ctor;
|
6533 | Ctor.prototype = null;
|
6534 | return result;
|
6535 | }
|
6536 |
|
6537 |
|
6538 | }),
|
6539 |
|
6540 | (function(module, __webpack_exports__, __webpack_require__) {
|
6541 |
|
6542 | "use strict";
|
6543 | __webpack_exports__["a"] = clone;
|
6544 | var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(58);
|
6545 | var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(59);
|
6546 | var __WEBPACK_IMPORTED_MODULE_2__extend_js__ = __webpack_require__(193);
|
6547 |
|
6548 |
|
6549 |
|
6550 |
|
6551 |
|
6552 | function clone(obj) {
|
6553 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" ])(obj)) return obj;
|
6554 | return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" ])(obj) ? obj.slice() : Object(__WEBPACK_IMPORTED_MODULE_2__extend_js__["a" ])({}, obj);
|
6555 | }
|
6556 |
|
6557 |
|
6558 | }),
|
6559 |
|
6560 | (function(module, __webpack_exports__, __webpack_require__) {
|
6561 |
|
6562 | "use strict";
|
6563 | __webpack_exports__["a"] = get;
|
6564 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__toPath_js__ = __webpack_require__(88);
|
6565 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deepGet_js__ = __webpack_require__(142);
|
6566 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isUndefined_js__ = __webpack_require__(179);
|
6567 |
|
6568 |
|
6569 |
|
6570 |
|
6571 | // Get the value of the (deep) property on `path` from `object`.
|
6572 | // If any property in `path` does not exist or if the value is
|
6573 | // `undefined`, return `defaultValue` instead.
|
6574 | // The `path` is normalized through `_.toPath`.
|
6575 | function get(object, path, defaultValue) {
|
6576 | var value = Object(__WEBPACK_IMPORTED_MODULE_1__deepGet_js__["a" ])(object, Object(__WEBPACK_IMPORTED_MODULE_0__toPath_js__["a" ])(path));
|
6577 | return Object(__WEBPACK_IMPORTED_MODULE_2__isUndefined_js__["a" ])(value) ? defaultValue : value;
|
6578 | }
|
6579 |
|
6580 |
|
6581 | }),
|
6582 |
|
6583 | (function(module, __webpack_exports__, __webpack_require__) {
|
6584 |
|
6585 | "use strict";
|
6586 | __webpack_exports__["a"] = toPath;
|
6587 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
6588 | var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(59);
|
6589 |
|
6590 |
|
6591 |
|
6592 |
|
6593 |
|
6594 | function toPath(path) {
|
6595 | return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" ])(path) ? path : [path];
|
6596 | }
|
6597 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].toPath = toPath;
|
6598 |
|
6599 |
|
6600 | }),
|
6601 |
|
6602 | (function(module, __webpack_exports__, __webpack_require__) {
|
6603 |
|
6604 | "use strict";
|
6605 | __webpack_exports__["a"] = baseIteratee;
|
6606 | var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(143);
|
6607 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
6608 | var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(58);
|
6609 | var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(59);
|
6610 | var __WEBPACK_IMPORTED_MODULE_4__matcher_js__ = __webpack_require__(113);
|
6611 | var __WEBPACK_IMPORTED_MODULE_5__property_js__ = __webpack_require__(144);
|
6612 | var __WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__ = __webpack_require__(89);
|
6613 |
|
6614 |
|
6615 |
|
6616 |
|
6617 |
|
6618 |
|
6619 |
|
6620 |
|
6621 |
|
6622 |
|
6623 |
|
6624 | function baseIteratee(value, context, argCount) {
|
6625 | if (value == null) return __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" ];
|
6626 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(value)) return Object(__WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__["a" ])(value, context, argCount);
|
6627 | if (Object(__WEBPACK_IMPORTED_MODULE_2__isObject_js__["a" ])(value) && !Object(__WEBPACK_IMPORTED_MODULE_3__isArray_js__["a" ])(value)) return Object(__WEBPACK_IMPORTED_MODULE_4__matcher_js__["a" ])(value);
|
6628 | return Object(__WEBPACK_IMPORTED_MODULE_5__property_js__["a" ])(value);
|
6629 | }
|
6630 |
|
6631 |
|
6632 | }),
|
6633 |
|
6634 | (function(module, __webpack_exports__, __webpack_require__) {
|
6635 |
|
6636 | "use strict";
|
6637 | __webpack_exports__["a"] = iteratee;
|
6638 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
6639 | var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(199);
|
6640 |
|
6641 |
|
6642 |
|
6643 |
|
6644 |
|
6645 |
|
6646 | function iteratee(value, context) {
|
6647 | return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" ])(value, context, Infinity);
|
6648 | }
|
6649 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].iteratee = iteratee;
|
6650 |
|
6651 |
|
6652 | }),
|
6653 |
|
6654 | (function(module, __webpack_exports__, __webpack_require__) {
|
6655 |
|
6656 | "use strict";
|
6657 | __webpack_exports__["a"] = noop;
|
6658 |
|
6659 | function noop(){}
|
6660 |
|
6661 |
|
6662 | }),
|
6663 |
|
6664 | (function(module, __webpack_exports__, __webpack_require__) {
|
6665 |
|
6666 | "use strict";
|
6667 | __webpack_exports__["a"] = random;
|
6668 |
|
6669 | function random(min, max) {
|
6670 | if (max == null) {
|
6671 | max = min;
|
6672 | min = 0;
|
6673 | }
|
6674 | return min + Math.floor(Math.random() * (max - min + 1));
|
6675 | }
|
6676 |
|
6677 |
|
6678 | }),
|
6679 |
|
6680 | (function(module, __webpack_exports__, __webpack_require__) {
|
6681 |
|
6682 | "use strict";
|
6683 | __webpack_exports__["a"] = createEscaper;
|
6684 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(17);
|
6685 |
|
6686 |
|
6687 |
|
6688 |
|
6689 | function createEscaper(map) {
|
6690 | var escaper = function(match) {
|
6691 | return map[match];
|
6692 | };
|
6693 |
|
6694 | var source = '(?:' + Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(map).join('|') + ')';
|
6695 | var testRegexp = RegExp(source);
|
6696 | var replaceRegexp = RegExp(source, 'g');
|
6697 | return function(string) {
|
6698 | string = string == null ? '' : '' + string;
|
6699 | return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
|
6700 | };
|
6701 | }
|
6702 |
|
6703 |
|
6704 | }),
|
6705 |
|
6706 | (function(module, __webpack_exports__, __webpack_require__) {
|
6707 |
|
6708 | "use strict";
|
6709 |
|
6710 | __webpack_exports__["a"] = ({
|
6711 | '&': '&',
|
6712 | '<': '<',
|
6713 | '>': '>',
|
6714 | '"': '"',
|
6715 | "'": ''',
|
6716 | '`': '`'
|
6717 | });
|
6718 |
|
6719 |
|
6720 | }),
|
6721 |
|
6722 | (function(module, __webpack_exports__, __webpack_require__) {
|
6723 |
|
6724 | "use strict";
|
6725 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
6726 |
|
6727 |
|
6728 |
|
6729 |
|
6730 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].templateSettings = {
|
6731 | evaluate: /<%([\s\S]+?)%>/g,
|
6732 | interpolate: /<%=([\s\S]+?)%>/g,
|
6733 | escape: /<%-([\s\S]+?)%>/g
|
6734 | });
|
6735 |
|
6736 |
|
6737 | }),
|
6738 |
|
6739 | (function(module, __webpack_exports__, __webpack_require__) {
|
6740 |
|
6741 | "use strict";
|
6742 | __webpack_exports__["a"] = executeBound;
|
6743 | var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(195);
|
6744 | var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(58);
|
6745 |
|
6746 |
|
6747 |
|
6748 |
|
6749 |
|
6750 |
|
6751 | function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
|
6752 | if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
|
6753 | var self = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" ])(sourceFunc.prototype);
|
6754 | var result = sourceFunc.apply(self, args);
|
6755 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" ])(result)) return result;
|
6756 | return self;
|
6757 | }
|
6758 |
|
6759 |
|
6760 | }),
|
6761 |
|
6762 | (function(module, __webpack_exports__, __webpack_require__) {
|
6763 |
|
6764 | "use strict";
|
6765 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
6766 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
6767 | var __WEBPACK_IMPORTED_MODULE_2__executeBound_js__ = __webpack_require__(206);
|
6768 |
|
6769 |
|
6770 |
|
6771 |
|
6772 |
|
6773 |
|
6774 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(func, context, args) {
|
6775 | if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(func)) throw new TypeError('Bind must be called on a function');
|
6776 | var bound = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(callArgs) {
|
6777 | return Object(__WEBPACK_IMPORTED_MODULE_2__executeBound_js__["a" ])(func, bound, context, this, args.concat(callArgs));
|
6778 | });
|
6779 | return bound;
|
6780 | }));
|
6781 |
|
6782 |
|
6783 | }),
|
6784 |
|
6785 | (function(module, __webpack_exports__, __webpack_require__) {
|
6786 |
|
6787 | "use strict";
|
6788 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
6789 |
|
6790 |
|
6791 |
|
6792 |
|
6793 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(func, wait, args) {
|
6794 | return setTimeout(function() {
|
6795 | return func.apply(null, args);
|
6796 | }, wait);
|
6797 | }));
|
6798 |
|
6799 |
|
6800 | }),
|
6801 |
|
6802 | (function(module, __webpack_exports__, __webpack_require__) {
|
6803 |
|
6804 | "use strict";
|
6805 | __webpack_exports__["a"] = before;
|
6806 |
|
6807 |
|
6808 | function before(times, func) {
|
6809 | var memo;
|
6810 | return function() {
|
6811 | if (--times > 0) {
|
6812 | memo = func.apply(this, arguments);
|
6813 | }
|
6814 | if (times <= 1) func = null;
|
6815 | return memo;
|
6816 | };
|
6817 | }
|
6818 |
|
6819 |
|
6820 | }),
|
6821 |
|
6822 | (function(module, __webpack_exports__, __webpack_require__) {
|
6823 |
|
6824 | "use strict";
|
6825 | __webpack_exports__["a"] = findKey;
|
6826 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
6827 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(17);
|
6828 |
|
6829 |
|
6830 |
|
6831 |
|
6832 | function findKey(obj, predicate, context) {
|
6833 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
6834 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj), key;
|
6835 | for (var i = 0, length = _keys.length; i < length; i++) {
|
6836 | key = _keys[i];
|
6837 | if (predicate(obj[key], key, obj)) return key;
|
6838 | }
|
6839 | }
|
6840 |
|
6841 |
|
6842 | }),
|
6843 |
|
6844 | (function(module, __webpack_exports__, __webpack_require__) {
|
6845 |
|
6846 | "use strict";
|
6847 | __webpack_exports__["a"] = createPredicateIndexFinder;
|
6848 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
6849 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(31);
|
6850 |
|
6851 |
|
6852 |
|
6853 |
|
6854 | function createPredicateIndexFinder(dir) {
|
6855 | return function(array, predicate, context) {
|
6856 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
6857 | var length = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ])(array);
|
6858 | var index = dir > 0 ? 0 : length - 1;
|
6859 | for (; index >= 0 && index < length; index += dir) {
|
6860 | if (predicate(array[index], index, array)) return index;
|
6861 | }
|
6862 | return -1;
|
6863 | };
|
6864 | }
|
6865 |
|
6866 |
|
6867 | }),
|
6868 |
|
6869 | (function(module, __webpack_exports__, __webpack_require__) {
|
6870 |
|
6871 | "use strict";
|
6872 | var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(211);
|
6873 |
|
6874 |
|
6875 |
|
6876 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" ])(-1));
|
6877 |
|
6878 |
|
6879 | }),
|
6880 |
|
6881 | (function(module, __webpack_exports__, __webpack_require__) {
|
6882 |
|
6883 | "use strict";
|
6884 | __webpack_exports__["a"] = sortedIndex;
|
6885 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
6886 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(31);
|
6887 |
|
6888 |
|
6889 |
|
6890 |
|
6891 |
|
6892 | function sortedIndex(array, obj, iteratee, context) {
|
6893 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context, 1);
|
6894 | var value = iteratee(obj);
|
6895 | var low = 0, high = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ])(array);
|
6896 | while (low < high) {
|
6897 | var mid = Math.floor((low + high) / 2);
|
6898 | if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
|
6899 | }
|
6900 | return low;
|
6901 | }
|
6902 |
|
6903 |
|
6904 | }),
|
6905 |
|
6906 | (function(module, __webpack_exports__, __webpack_require__) {
|
6907 |
|
6908 | "use strict";
|
6909 | var __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__ = __webpack_require__(213);
|
6910 | var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(147);
|
6911 | var __WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__ = __webpack_require__(215);
|
6912 |
|
6913 |
|
6914 |
|
6915 |
|
6916 |
|
6917 |
|
6918 |
|
6919 |
|
6920 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__["a" ])(1, __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" ], __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__["a" ]));
|
6921 |
|
6922 |
|
6923 | }),
|
6924 |
|
6925 | (function(module, __webpack_exports__, __webpack_require__) {
|
6926 |
|
6927 | "use strict";
|
6928 | __webpack_exports__["a"] = createIndexFinder;
|
6929 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
6930 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
6931 | var __WEBPACK_IMPORTED_MODULE_2__isNaN_js__ = __webpack_require__(184);
|
6932 |
|
6933 |
|
6934 |
|
6935 |
|
6936 |
|
6937 | function createIndexFinder(dir, predicateFind, sortedIndex) {
|
6938 | return function(array, item, idx) {
|
6939 | var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(array);
|
6940 | if (typeof idx == 'number') {
|
6941 | if (dir > 0) {
|
6942 | i = idx >= 0 ? idx : Math.max(idx + length, i);
|
6943 | } else {
|
6944 | length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
|
6945 | }
|
6946 | } else if (sortedIndex && idx && length) {
|
6947 | idx = sortedIndex(array, item);
|
6948 | return array[idx] === item ? idx : -1;
|
6949 | }
|
6950 | if (item !== item) {
|
6951 | idx = predicateFind(__WEBPACK_IMPORTED_MODULE_1__setup_js__["q" ].call(array, i, length), __WEBPACK_IMPORTED_MODULE_2__isNaN_js__["a" ]);
|
6952 | return idx >= 0 ? idx + i : -1;
|
6953 | }
|
6954 | for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
|
6955 | if (array[idx] === item) return idx;
|
6956 | }
|
6957 | return -1;
|
6958 | };
|
6959 | }
|
6960 |
|
6961 |
|
6962 | }),
|
6963 |
|
6964 | (function(module, __webpack_exports__, __webpack_require__) {
|
6965 |
|
6966 | "use strict";
|
6967 | __webpack_exports__["a"] = find;
|
6968 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
6969 | var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(147);
|
6970 | var __WEBPACK_IMPORTED_MODULE_2__findKey_js__ = __webpack_require__(210);
|
6971 |
|
6972 |
|
6973 |
|
6974 |
|
6975 |
|
6976 | function find(obj, predicate, context) {
|
6977 | var keyFinder = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" ] : __WEBPACK_IMPORTED_MODULE_2__findKey_js__["a" ];
|
6978 | var key = keyFinder(obj, predicate, context);
|
6979 | if (key !== void 0 && key !== -1) return obj[key];
|
6980 | }
|
6981 |
|
6982 |
|
6983 | }),
|
6984 |
|
6985 | (function(module, __webpack_exports__, __webpack_require__) {
|
6986 |
|
6987 | "use strict";
|
6988 | __webpack_exports__["a"] = createReduce;
|
6989 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
6990 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(17);
|
6991 | var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(89);
|
6992 |
|
6993 |
|
6994 |
|
6995 |
|
6996 |
|
6997 | function createReduce(dir) {
|
6998 |
|
6999 |
|
7000 | var reducer = function(obj, iteratee, memo, initial) {
|
7001 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj),
|
7002 | length = (_keys || obj).length,
|
7003 | index = dir > 0 ? 0 : length - 1;
|
7004 | if (!initial) {
|
7005 | memo = obj[_keys ? _keys[index] : index];
|
7006 | index += dir;
|
7007 | }
|
7008 | for (; index >= 0 && index < length; index += dir) {
|
7009 | var currentKey = _keys ? _keys[index] : index;
|
7010 | memo = iteratee(memo, obj[currentKey], currentKey, obj);
|
7011 | }
|
7012 | return memo;
|
7013 | };
|
7014 |
|
7015 | return function(obj, iteratee, memo, context) {
|
7016 | var initial = arguments.length >= 3;
|
7017 | return reducer(obj, Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" ])(iteratee, context, 4), memo, initial);
|
7018 | };
|
7019 | }
|
7020 |
|
7021 |
|
7022 | }),
|
7023 |
|
7024 | (function(module, __webpack_exports__, __webpack_require__) {
|
7025 |
|
7026 | "use strict";
|
7027 | __webpack_exports__["a"] = max;
|
7028 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
7029 | var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(71);
|
7030 | var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(22);
|
7031 | var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(60);
|
7032 |
|
7033 |
|
7034 |
|
7035 |
|
7036 |
|
7037 |
|
7038 | function max(obj, iteratee, context) {
|
7039 | var result = -Infinity, lastComputed = -Infinity,
|
7040 | value, computed;
|
7041 | if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
|
7042 | obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" ])(obj);
|
7043 | for (var i = 0, length = obj.length; i < length; i++) {
|
7044 | value = obj[i];
|
7045 | if (value != null && value > result) {
|
7046 | result = value;
|
7047 | }
|
7048 | }
|
7049 | } else {
|
7050 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" ])(iteratee, context);
|
7051 | Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" ])(obj, function(v, index, list) {
|
7052 | computed = iteratee(v, index, list);
|
7053 | if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
|
7054 | result = v;
|
7055 | lastComputed = computed;
|
7056 | }
|
7057 | });
|
7058 | }
|
7059 | return result;
|
7060 | }
|
7061 |
|
7062 |
|
7063 | }),
|
7064 |
|
7065 | (function(module, __webpack_exports__, __webpack_require__) {
|
7066 |
|
7067 | "use strict";
|
7068 | __webpack_exports__["a"] = sample;
|
7069 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
7070 | var __WEBPACK_IMPORTED_MODULE_1__clone_js__ = __webpack_require__(196);
|
7071 | var __WEBPACK_IMPORTED_MODULE_2__values_js__ = __webpack_require__(71);
|
7072 | var __WEBPACK_IMPORTED_MODULE_3__getLength_js__ = __webpack_require__(31);
|
7073 | var __WEBPACK_IMPORTED_MODULE_4__random_js__ = __webpack_require__(202);
|
7074 |
|
7075 |
|
7076 |
|
7077 |
|
7078 |
|
7079 |
|
7080 |
|
7081 |
|
7082 |
|
7083 |
|
7084 | function sample(obj, n, guard) {
|
7085 | if (n == null || guard) {
|
7086 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" ])(obj);
|
7087 | return obj[Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" ])(obj.length - 1)];
|
7088 | }
|
7089 | var sample = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? Object(__WEBPACK_IMPORTED_MODULE_1__clone_js__["a" ])(obj) : Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" ])(obj);
|
7090 | var length = Object(__WEBPACK_IMPORTED_MODULE_3__getLength_js__["a" ])(sample);
|
7091 | n = Math.max(Math.min(n, length), 0);
|
7092 | var last = length - 1;
|
7093 | for (var index = 0; index < n; index++) {
|
7094 | var rand = Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" ])(index, last);
|
7095 | var temp = sample[index];
|
7096 | sample[index] = sample[rand];
|
7097 | sample[rand] = temp;
|
7098 | }
|
7099 | return sample.slice(0, n);
|
7100 | }
|
7101 |
|
7102 |
|
7103 | }),
|
7104 |
|
7105 | (function(module, __webpack_exports__, __webpack_require__) {
|
7106 |
|
7107 | "use strict";
|
7108 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
7109 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
7110 | var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(89);
|
7111 | var __WEBPACK_IMPORTED_MODULE_3__allKeys_js__ = __webpack_require__(87);
|
7112 | var __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__ = __webpack_require__(378);
|
7113 | var __WEBPACK_IMPORTED_MODULE_5__flatten_js__ = __webpack_require__(72);
|
7114 |
|
7115 |
|
7116 |
|
7117 |
|
7118 |
|
7119 |
|
7120 |
|
7121 |
|
7122 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, keys) {
|
7123 | var result = {}, iteratee = keys[0];
|
7124 | if (obj == null) return result;
|
7125 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(iteratee)) {
|
7126 | if (keys.length > 1) iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" ])(iteratee, keys[1]);
|
7127 | keys = Object(__WEBPACK_IMPORTED_MODULE_3__allKeys_js__["a" ])(obj);
|
7128 | } else {
|
7129 | iteratee = __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__["a" ];
|
7130 | keys = Object(__WEBPACK_IMPORTED_MODULE_5__flatten_js__["a" ])(keys, false, false);
|
7131 | obj = Object(obj);
|
7132 | }
|
7133 | for (var i = 0, length = keys.length; i < length; i++) {
|
7134 | var key = keys[i];
|
7135 | var value = obj[key];
|
7136 | if (iteratee(value, key, obj)) result[key] = value;
|
7137 | }
|
7138 | return result;
|
7139 | }));
|
7140 |
|
7141 |
|
7142 | }),
|
7143 |
|
7144 | (function(module, __webpack_exports__, __webpack_require__) {
|
7145 |
|
7146 | "use strict";
|
7147 | __webpack_exports__["a"] = initial;
|
7148 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
7149 |
|
7150 |
|
7151 |
|
7152 |
|
7153 |
|
7154 | function initial(array, n, guard) {
|
7155 | return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" ].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
|
7156 | }
|
7157 |
|
7158 |
|
7159 | }),
|
7160 |
|
7161 | (function(module, __webpack_exports__, __webpack_require__) {
|
7162 |
|
7163 | "use strict";
|
7164 | __webpack_exports__["a"] = rest;
|
7165 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
7166 |
|
7167 |
|
7168 |
|
7169 |
|
7170 |
|
7171 | function rest(array, n, guard) {
|
7172 | return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" ].call(array, n == null || guard ? 1 : n);
|
7173 | }
|
7174 |
|
7175 |
|
7176 | }),
|
7177 |
|
7178 | (function(module, __webpack_exports__, __webpack_require__) {
|
7179 |
|
7180 | "use strict";
|
7181 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
7182 | var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(72);
|
7183 | var __WEBPACK_IMPORTED_MODULE_2__filter_js__ = __webpack_require__(90);
|
7184 | var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(91);
|
7185 |
|
7186 |
|
7187 |
|
7188 |
|
7189 |
|
7190 |
|
7191 |
|
7192 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(array, rest) {
|
7193 | rest = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" ])(rest, true, true);
|
7194 | return Object(__WEBPACK_IMPORTED_MODULE_2__filter_js__["a" ])(array, function(value){
|
7195 | return !Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" ])(rest, value);
|
7196 | });
|
7197 | }));
|
7198 |
|
7199 |
|
7200 | }),
|
7201 |
|
7202 | (function(module, __webpack_exports__, __webpack_require__) {
|
7203 |
|
7204 | "use strict";
|
7205 | __webpack_exports__["a"] = uniq;
|
7206 | var __WEBPACK_IMPORTED_MODULE_0__isBoolean_js__ = __webpack_require__(180);
|
7207 | var __WEBPACK_IMPORTED_MODULE_1__cb_js__ = __webpack_require__(22);
|
7208 | var __WEBPACK_IMPORTED_MODULE_2__getLength_js__ = __webpack_require__(31);
|
7209 | var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(91);
|
7210 |
|
7211 |
|
7212 |
|
7213 |
|
7214 |
|
7215 |
|
7216 |
|
7217 |
|
7218 |
|
7219 |
|
7220 | function uniq(array, isSorted, iteratee, context) {
|
7221 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isBoolean_js__["a" ])(isSorted)) {
|
7222 | context = iteratee;
|
7223 | iteratee = isSorted;
|
7224 | isSorted = false;
|
7225 | }
|
7226 | if (iteratee != null) iteratee = Object(__WEBPACK_IMPORTED_MODULE_1__cb_js__["a" ])(iteratee, context);
|
7227 | var result = [];
|
7228 | var seen = [];
|
7229 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_2__getLength_js__["a" ])(array); i < length; i++) {
|
7230 | var value = array[i],
|
7231 | computed = iteratee ? iteratee(value, i, array) : value;
|
7232 | if (isSorted && !iteratee) {
|
7233 | if (!i || seen !== computed) result.push(value);
|
7234 | seen = computed;
|
7235 | } else if (iteratee) {
|
7236 | if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" ])(seen, computed)) {
|
7237 | seen.push(computed);
|
7238 | result.push(value);
|
7239 | }
|
7240 | } else if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" ])(result, value)) {
|
7241 | result.push(value);
|
7242 | }
|
7243 | }
|
7244 | return result;
|
7245 | }
|
7246 |
|
7247 |
|
7248 | }),
|
7249 |
|
7250 | (function(module, __webpack_exports__, __webpack_require__) {
|
7251 |
|
7252 | "use strict";
|
7253 | __webpack_exports__["a"] = unzip;
|
7254 | var __WEBPACK_IMPORTED_MODULE_0__max_js__ = __webpack_require__(218);
|
7255 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(31);
|
7256 | var __WEBPACK_IMPORTED_MODULE_2__pluck_js__ = __webpack_require__(148);
|
7257 |
|
7258 |
|
7259 |
|
7260 |
|
7261 |
|
7262 |
|
7263 | function unzip(array) {
|
7264 | var length = array && Object(__WEBPACK_IMPORTED_MODULE_0__max_js__["a" ])(array, __WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ]).length || 0;
|
7265 | var result = Array(length);
|
7266 |
|
7267 | for (var index = 0; index < length; index++) {
|
7268 | result[index] = Object(__WEBPACK_IMPORTED_MODULE_2__pluck_js__["a" ])(array, index);
|
7269 | }
|
7270 | return result;
|
7271 | }
|
7272 |
|
7273 |
|
7274 | }),
|
7275 |
|
7276 | (function(module, __webpack_exports__, __webpack_require__) {
|
7277 |
|
7278 | "use strict";
|
7279 | __webpack_exports__["a"] = chainResult;
|
7280 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
7281 |
|
7282 |
|
7283 |
|
7284 | function chainResult(instance, obj) {
|
7285 | return instance._chain ? Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ])(obj).chain() : obj;
|
7286 | }
|
7287 |
|
7288 |
|
7289 | }),
|
7290 |
|
7291 | (function(module, exports, __webpack_require__) {
|
7292 |
|
7293 | "use strict";
|
7294 |
|
7295 | var $ = __webpack_require__(0);
|
7296 | var fails = __webpack_require__(2);
|
7297 | var isArray = __webpack_require__(92);
|
7298 | var isObject = __webpack_require__(11);
|
7299 | var toObject = __webpack_require__(33);
|
7300 | var lengthOfArrayLike = __webpack_require__(40);
|
7301 | var doesNotExceedSafeInteger = __webpack_require__(396);
|
7302 | var createProperty = __webpack_require__(93);
|
7303 | var arraySpeciesCreate = __webpack_require__(228);
|
7304 | var arrayMethodHasSpeciesSupport = __webpack_require__(116);
|
7305 | var wellKnownSymbol = __webpack_require__(5);
|
7306 | var V8_VERSION = __webpack_require__(66);
|
7307 |
|
7308 | var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
7309 |
|
7310 |
|
7311 |
|
7312 |
|
7313 | var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
|
7314 | var array = [];
|
7315 | array[IS_CONCAT_SPREADABLE] = false;
|
7316 | return array.concat()[0] !== array;
|
7317 | });
|
7318 |
|
7319 | var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
7320 |
|
7321 | var isConcatSpreadable = function (O) {
|
7322 | if (!isObject(O)) return false;
|
7323 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
7324 | return spreadable !== undefined ? !!spreadable : isArray(O);
|
7325 | };
|
7326 |
|
7327 | var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
7328 |
|
7329 |
|
7330 |
|
7331 |
|
7332 | $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
|
7333 |
|
7334 | concat: function concat(arg) {
|
7335 | var O = toObject(this);
|
7336 | var A = arraySpeciesCreate(O, 0);
|
7337 | var n = 0;
|
7338 | var i, k, length, len, E;
|
7339 | for (i = -1, length = arguments.length; i < length; i++) {
|
7340 | E = i === -1 ? O : arguments[i];
|
7341 | if (isConcatSpreadable(E)) {
|
7342 | len = lengthOfArrayLike(E);
|
7343 | doesNotExceedSafeInteger(n + len);
|
7344 | for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
7345 | } else {
|
7346 | doesNotExceedSafeInteger(n + 1);
|
7347 | createProperty(A, n++, E);
|
7348 | }
|
7349 | }
|
7350 | A.length = n;
|
7351 | return A;
|
7352 | }
|
7353 | });
|
7354 |
|
7355 |
|
7356 | }),
|
7357 |
|
7358 | (function(module, exports, __webpack_require__) {
|
7359 |
|
7360 | var arraySpeciesConstructor = __webpack_require__(397);
|
7361 |
|
7362 |
|
7363 |
|
7364 | module.exports = function (originalArray, length) {
|
7365 | return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
7366 | };
|
7367 |
|
7368 |
|
7369 | }),
|
7370 |
|
7371 | (function(module, exports, __webpack_require__) {
|
7372 |
|
7373 | var $ = __webpack_require__(0);
|
7374 | var getBuiltIn = __webpack_require__(20);
|
7375 | var apply = __webpack_require__(79);
|
7376 | var call = __webpack_require__(15);
|
7377 | var uncurryThis = __webpack_require__(4);
|
7378 | var fails = __webpack_require__(2);
|
7379 | var isArray = __webpack_require__(92);
|
7380 | var isCallable = __webpack_require__(9);
|
7381 | var isObject = __webpack_require__(11);
|
7382 | var isSymbol = __webpack_require__(100);
|
7383 | var arraySlice = __webpack_require__(112);
|
7384 | var NATIVE_SYMBOL = __webpack_require__(65);
|
7385 |
|
7386 | var $stringify = getBuiltIn('JSON', 'stringify');
|
7387 | var exec = uncurryThis(/./.exec);
|
7388 | var charAt = uncurryThis(''.charAt);
|
7389 | var charCodeAt = uncurryThis(''.charCodeAt);
|
7390 | var replace = uncurryThis(''.replace);
|
7391 | var numberToString = uncurryThis(1.0.toString);
|
7392 |
|
7393 | var tester = /[\uD800-\uDFFF]/g;
|
7394 | var low = /^[\uD800-\uDBFF]$/;
|
7395 | var hi = /^[\uDC00-\uDFFF]$/;
|
7396 |
|
7397 | var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
|
7398 | var symbol = getBuiltIn('Symbol')();
|
7399 |
|
7400 | return $stringify([symbol]) != '[null]'
|
7401 |
|
7402 | || $stringify({ a: symbol }) != '{}'
|
7403 |
|
7404 | || $stringify(Object(symbol)) != '{}';
|
7405 | });
|
7406 |
|
7407 |
|
7408 | var ILL_FORMED_UNICODE = fails(function () {
|
7409 | return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|
7410 | || $stringify('\uDEAD') !== '"\\udead"';
|
7411 | });
|
7412 |
|
7413 | var stringifyWithSymbolsFix = function (it, replacer) {
|
7414 | var args = arraySlice(arguments);
|
7415 | var $replacer = replacer;
|
7416 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
7417 | if (!isArray(replacer)) replacer = function (key, value) {
|
7418 | if (isCallable($replacer)) value = call($replacer, this, key, value);
|
7419 | if (!isSymbol(value)) return value;
|
7420 | };
|
7421 | args[1] = replacer;
|
7422 | return apply($stringify, null, args);
|
7423 | };
|
7424 |
|
7425 | var fixIllFormed = function (match, offset, string) {
|
7426 | var prev = charAt(string, offset - 1);
|
7427 | var next = charAt(string, offset + 1);
|
7428 | if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
|
7429 | return '\\u' + numberToString(charCodeAt(match, 0), 16);
|
7430 | } return match;
|
7431 | };
|
7432 |
|
7433 | if ($stringify) {
|
7434 |
|
7435 |
|
7436 | $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
|
7437 |
|
7438 | stringify: function stringify(it, replacer, space) {
|
7439 | var args = arraySlice(arguments);
|
7440 | var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
|
7441 | return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
|
7442 | }
|
7443 | });
|
7444 | }
|
7445 |
|
7446 |
|
7447 | }),
|
7448 |
|
7449 | (function(module, exports, __webpack_require__) {
|
7450 |
|
7451 | var rng = __webpack_require__(414);
|
7452 | var bytesToUuid = __webpack_require__(415);
|
7453 |
|
7454 | function v4(options, buf, offset) {
|
7455 | var i = buf && offset || 0;
|
7456 |
|
7457 | if (typeof(options) == 'string') {
|
7458 | buf = options === 'binary' ? new Array(16) : null;
|
7459 | options = null;
|
7460 | }
|
7461 | options = options || {};
|
7462 |
|
7463 | var rnds = options.random || (options.rng || rng)();
|
7464 |
|
7465 |
|
7466 | rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
7467 | rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
7468 |
|
7469 |
|
7470 | if (buf) {
|
7471 | for (var ii = 0; ii < 16; ++ii) {
|
7472 | buf[i + ii] = rnds[ii];
|
7473 | }
|
7474 | }
|
7475 |
|
7476 | return buf || bytesToUuid(rnds);
|
7477 | }
|
7478 |
|
7479 | module.exports = v4;
|
7480 |
|
7481 |
|
7482 | }),
|
7483 |
|
7484 | (function(module, exports, __webpack_require__) {
|
7485 |
|
7486 | module.exports = __webpack_require__(232);
|
7487 |
|
7488 | }),
|
7489 |
|
7490 | (function(module, exports, __webpack_require__) {
|
7491 |
|
7492 | var parent = __webpack_require__(418);
|
7493 |
|
7494 | module.exports = parent;
|
7495 |
|
7496 |
|
7497 | }),
|
7498 |
|
7499 | (function(module, exports, __webpack_require__) {
|
7500 |
|
7501 | "use strict";
|
7502 |
|
7503 |
|
7504 | module.exports = '4.15.1';
|
7505 |
|
7506 | }),
|
7507 |
|
7508 | (function(module, exports, __webpack_require__) {
|
7509 |
|
7510 | "use strict";
|
7511 |
|
7512 |
|
7513 | var has = Object.prototype.hasOwnProperty
|
7514 | , prefix = '~';
|
7515 |
|
7516 |
|
7517 |
|
7518 |
|
7519 |
|
7520 |
|
7521 |
|
7522 |
|
7523 | function Events() {}
|
7524 |
|
7525 |
|
7526 |
|
7527 |
|
7528 |
|
7529 |
|
7530 |
|
7531 |
|
7532 | if (Object.create) {
|
7533 | Events.prototype = Object.create(null);
|
7534 |
|
7535 |
|
7536 |
|
7537 |
|
7538 |
|
7539 | if (!new Events().__proto__) prefix = false;
|
7540 | }
|
7541 |
|
7542 |
|
7543 |
|
7544 |
|
7545 |
|
7546 |
|
7547 |
|
7548 |
|
7549 |
|
7550 |
|
7551 | function EE(fn, context, once) {
|
7552 | this.fn = fn;
|
7553 | this.context = context;
|
7554 | this.once = once || false;
|
7555 | }
|
7556 |
|
7557 |
|
7558 |
|
7559 |
|
7560 |
|
7561 |
|
7562 |
|
7563 |
|
7564 | function EventEmitter() {
|
7565 | this._events = new Events();
|
7566 | this._eventsCount = 0;
|
7567 | }
|
7568 |
|
7569 |
|
7570 |
|
7571 |
|
7572 |
|
7573 |
|
7574 |
|
7575 |
|
7576 | EventEmitter.prototype.eventNames = function eventNames() {
|
7577 | var names = []
|
7578 | , events
|
7579 | , name;
|
7580 |
|
7581 | if (this._eventsCount === 0) return names;
|
7582 |
|
7583 | for (name in (events = this._events)) {
|
7584 | if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
7585 | }
|
7586 |
|
7587 | if (Object.getOwnPropertySymbols) {
|
7588 | return names.concat(Object.getOwnPropertySymbols(events));
|
7589 | }
|
7590 |
|
7591 | return names;
|
7592 | };
|
7593 |
|
7594 |
|
7595 |
|
7596 |
|
7597 |
|
7598 |
|
7599 |
|
7600 |
|
7601 |
|
7602 | EventEmitter.prototype.listeners = function listeners(event, exists) {
|
7603 | var evt = prefix ? prefix + event : event
|
7604 | , available = this._events[evt];
|
7605 |
|
7606 | if (exists) return !!available;
|
7607 | if (!available) return [];
|
7608 | if (available.fn) return [available.fn];
|
7609 |
|
7610 | for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
|
7611 | ee[i] = available[i].fn;
|
7612 | }
|
7613 |
|
7614 | return ee;
|
7615 | };
|
7616 |
|
7617 |
|
7618 |
|
7619 |
|
7620 |
|
7621 |
|
7622 |
|
7623 |
|
7624 | EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
7625 | var evt = prefix ? prefix + event : event;
|
7626 |
|
7627 | if (!this._events[evt]) return false;
|
7628 |
|
7629 | var listeners = this._events[evt]
|
7630 | , len = arguments.length
|
7631 | , args
|
7632 | , i;
|
7633 |
|
7634 | if (listeners.fn) {
|
7635 | if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
7636 |
|
7637 | switch (len) {
|
7638 | case 1: return listeners.fn.call(listeners.context), true;
|
7639 | case 2: return listeners.fn.call(listeners.context, a1), true;
|
7640 | case 3: return listeners.fn.call(listeners.context, a1, a2), true;
|
7641 | case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
7642 | case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
7643 | case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
7644 | }
|
7645 |
|
7646 | for (i = 1, args = new Array(len -1); i < len; i++) {
|
7647 | args[i - 1] = arguments[i];
|
7648 | }
|
7649 |
|
7650 | listeners.fn.apply(listeners.context, args);
|
7651 | } else {
|
7652 | var length = listeners.length
|
7653 | , j;
|
7654 |
|
7655 | for (i = 0; i < length; i++) {
|
7656 | if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
7657 |
|
7658 | switch (len) {
|
7659 | case 1: listeners[i].fn.call(listeners[i].context); break;
|
7660 | case 2: listeners[i].fn.call(listeners[i].context, a1); break;
|
7661 | case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
|
7662 | case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
|
7663 | default:
|
7664 | if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
|
7665 | args[j - 1] = arguments[j];
|
7666 | }
|
7667 |
|
7668 | listeners[i].fn.apply(listeners[i].context, args);
|
7669 | }
|
7670 | }
|
7671 | }
|
7672 |
|
7673 | return true;
|
7674 | };
|
7675 |
|
7676 |
|
7677 |
|
7678 |
|
7679 |
|
7680 |
|
7681 |
|
7682 |
|
7683 |
|
7684 |
|
7685 | EventEmitter.prototype.on = function on(event, fn, context) {
|
7686 | var listener = new EE(fn, context || this)
|
7687 | , evt = prefix ? prefix + event : event;
|
7688 |
|
7689 | if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
|
7690 | else if (!this._events[evt].fn) this._events[evt].push(listener);
|
7691 | else this._events[evt] = [this._events[evt], listener];
|
7692 |
|
7693 | return this;
|
7694 | };
|
7695 |
|
7696 |
|
7697 |
|
7698 |
|
7699 |
|
7700 |
|
7701 |
|
7702 |
|
7703 |
|
7704 |
|
7705 | EventEmitter.prototype.once = function once(event, fn, context) {
|
7706 | var listener = new EE(fn, context || this, true)
|
7707 | , evt = prefix ? prefix + event : event;
|
7708 |
|
7709 | if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
|
7710 | else if (!this._events[evt].fn) this._events[evt].push(listener);
|
7711 | else this._events[evt] = [this._events[evt], listener];
|
7712 |
|
7713 | return this;
|
7714 | };
|
7715 |
|
7716 |
|
7717 |
|
7718 |
|
7719 |
|
7720 |
|
7721 |
|
7722 |
|
7723 |
|
7724 |
|
7725 |
|
7726 | EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
7727 | var evt = prefix ? prefix + event : event;
|
7728 |
|
7729 | if (!this._events[evt]) return this;
|
7730 | if (!fn) {
|
7731 | if (--this._eventsCount === 0) this._events = new Events();
|
7732 | else delete this._events[evt];
|
7733 | return this;
|
7734 | }
|
7735 |
|
7736 | var listeners = this._events[evt];
|
7737 |
|
7738 | if (listeners.fn) {
|
7739 | if (
|
7740 | listeners.fn === fn
|
7741 | && (!once || listeners.once)
|
7742 | && (!context || listeners.context === context)
|
7743 | ) {
|
7744 | if (--this._eventsCount === 0) this._events = new Events();
|
7745 | else delete this._events[evt];
|
7746 | }
|
7747 | } else {
|
7748 | for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
7749 | if (
|
7750 | listeners[i].fn !== fn
|
7751 | || (once && !listeners[i].once)
|
7752 | || (context && listeners[i].context !== context)
|
7753 | ) {
|
7754 | events.push(listeners[i]);
|
7755 | }
|
7756 | }
|
7757 |
|
7758 |
|
7759 |
|
7760 |
|
7761 | if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
|
7762 | else if (--this._eventsCount === 0) this._events = new Events();
|
7763 | else delete this._events[evt];
|
7764 | }
|
7765 |
|
7766 | return this;
|
7767 | };
|
7768 |
|
7769 |
|
7770 |
|
7771 |
|
7772 |
|
7773 |
|
7774 |
|
7775 |
|
7776 | EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
7777 | var evt;
|
7778 |
|
7779 | if (event) {
|
7780 | evt = prefix ? prefix + event : event;
|
7781 | if (this._events[evt]) {
|
7782 | if (--this._eventsCount === 0) this._events = new Events();
|
7783 | else delete this._events[evt];
|
7784 | }
|
7785 | } else {
|
7786 | this._events = new Events();
|
7787 | this._eventsCount = 0;
|
7788 | }
|
7789 |
|
7790 | return this;
|
7791 | };
|
7792 |
|
7793 |
|
7794 |
|
7795 |
|
7796 | EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
7797 | EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
7798 |
|
7799 |
|
7800 |
|
7801 |
|
7802 | EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
|
7803 | return this;
|
7804 | };
|
7805 |
|
7806 |
|
7807 |
|
7808 |
|
7809 | EventEmitter.prefixed = prefix;
|
7810 |
|
7811 |
|
7812 |
|
7813 |
|
7814 | EventEmitter.EventEmitter = EventEmitter;
|
7815 |
|
7816 |
|
7817 |
|
7818 |
|
7819 | if (true) {
|
7820 | module.exports = EventEmitter;
|
7821 | }
|
7822 |
|
7823 |
|
7824 | }),
|
7825 |
|
7826 | (function(module, exports, __webpack_require__) {
|
7827 |
|
7828 | "use strict";
|
7829 |
|
7830 |
|
7831 | var _interopRequireDefault = __webpack_require__(1);
|
7832 |
|
7833 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
7834 |
|
7835 | var _require = __webpack_require__(76),
|
7836 | getAdapter = _require.getAdapter;
|
7837 |
|
7838 | var syncApiNames = ['getItem', 'setItem', 'removeItem', 'clear'];
|
7839 | var localStorage = {
|
7840 | get async() {
|
7841 | return getAdapter('storage').async;
|
7842 | }
|
7843 |
|
7844 | };
|
7845 |
|
7846 | syncApiNames.forEach(function (apiName) {
|
7847 | localStorage[apiName + 'Async'] = function () {
|
7848 | var storage = getAdapter('storage');
|
7849 | return _promise.default.resolve(storage[apiName].apply(storage, arguments));
|
7850 | };
|
7851 |
|
7852 | localStorage[apiName] = function () {
|
7853 | var storage = getAdapter('storage');
|
7854 |
|
7855 | if (!storage.async) {
|
7856 | return storage[apiName].apply(storage, arguments);
|
7857 | }
|
7858 |
|
7859 | var error = new Error('Synchronous API [' + apiName + '] is not available in this runtime.');
|
7860 | error.code = 'SYNC_API_NOT_AVAILABLE';
|
7861 | throw error;
|
7862 | };
|
7863 | });
|
7864 | module.exports = localStorage;
|
7865 |
|
7866 | }),
|
7867 |
|
7868 | (function(module, exports, __webpack_require__) {
|
7869 |
|
7870 | "use strict";
|
7871 |
|
7872 |
|
7873 | var _interopRequireDefault = __webpack_require__(1);
|
7874 |
|
7875 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
7876 |
|
7877 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
7878 |
|
7879 | var storage = __webpack_require__(235);
|
7880 |
|
7881 | var AV = __webpack_require__(74);
|
7882 |
|
7883 | var removeAsync = exports.removeAsync = storage.removeItemAsync.bind(storage);
|
7884 |
|
7885 | var getCacheData = function getCacheData(cacheData, key) {
|
7886 | try {
|
7887 | cacheData = JSON.parse(cacheData);
|
7888 | } catch (e) {
|
7889 | return null;
|
7890 | }
|
7891 |
|
7892 | if (cacheData) {
|
7893 | var expired = cacheData.expiredAt && cacheData.expiredAt < Date.now();
|
7894 |
|
7895 | if (!expired) {
|
7896 | return cacheData.value;
|
7897 | }
|
7898 |
|
7899 | return removeAsync(key).then(function () {
|
7900 | return null;
|
7901 | });
|
7902 | }
|
7903 |
|
7904 | return null;
|
7905 | };
|
7906 |
|
7907 | exports.getAsync = function (key) {
|
7908 | var _context;
|
7909 |
|
7910 | key = (0, _concat.default)(_context = "AV/".concat(AV.applicationId, "/")).call(_context, key);
|
7911 | return storage.getItemAsync(key).then(function (cache) {
|
7912 | return getCacheData(cache, key);
|
7913 | });
|
7914 | };
|
7915 |
|
7916 | exports.setAsync = function (key, value, ttl) {
|
7917 | var _context2;
|
7918 |
|
7919 | var cache = {
|
7920 | value: value
|
7921 | };
|
7922 |
|
7923 | if (typeof ttl === 'number') {
|
7924 | cache.expiredAt = Date.now() + ttl;
|
7925 | }
|
7926 |
|
7927 | return storage.setItemAsync((0, _concat.default)(_context2 = "AV/".concat(AV.applicationId, "/")).call(_context2, key), (0, _stringify.default)(cache));
|
7928 | };
|
7929 |
|
7930 | }),
|
7931 |
|
7932 | (function(module, exports, __webpack_require__) {
|
7933 |
|
7934 | var parent = __webpack_require__(421);
|
7935 |
|
7936 | module.exports = parent;
|
7937 |
|
7938 |
|
7939 | }),
|
7940 |
|
7941 | (function(module, exports, __webpack_require__) {
|
7942 |
|
7943 | var parent = __webpack_require__(424);
|
7944 |
|
7945 | module.exports = parent;
|
7946 |
|
7947 |
|
7948 | }),
|
7949 |
|
7950 | (function(module, exports, __webpack_require__) {
|
7951 |
|
7952 | var parent = __webpack_require__(427);
|
7953 |
|
7954 | module.exports = parent;
|
7955 |
|
7956 |
|
7957 | }),
|
7958 |
|
7959 | (function(module, exports, __webpack_require__) {
|
7960 |
|
7961 | module.exports = __webpack_require__(430);
|
7962 |
|
7963 | }),
|
7964 |
|
7965 | (function(module, exports, __webpack_require__) {
|
7966 |
|
7967 | var parent = __webpack_require__(433);
|
7968 | __webpack_require__(46);
|
7969 |
|
7970 | module.exports = parent;
|
7971 |
|
7972 |
|
7973 | }),
|
7974 |
|
7975 | (function(module, exports, __webpack_require__) {
|
7976 |
|
7977 |
|
7978 | __webpack_require__(434);
|
7979 | __webpack_require__(435);
|
7980 | __webpack_require__(436);
|
7981 | __webpack_require__(229);
|
7982 | __webpack_require__(437);
|
7983 |
|
7984 |
|
7985 | }),
|
7986 |
|
7987 | (function(module, exports, __webpack_require__) {
|
7988 |
|
7989 |
|
7990 | var classof = __webpack_require__(50);
|
7991 | var toIndexedObject = __webpack_require__(35);
|
7992 | var $getOwnPropertyNames = __webpack_require__(105).f;
|
7993 | var arraySlice = __webpack_require__(244);
|
7994 |
|
7995 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
7996 | ? Object.getOwnPropertyNames(window) : [];
|
7997 |
|
7998 | var getWindowNames = function (it) {
|
7999 | try {
|
8000 | return $getOwnPropertyNames(it);
|
8001 | } catch (error) {
|
8002 | return arraySlice(windowNames);
|
8003 | }
|
8004 | };
|
8005 |
|
8006 |
|
8007 | module.exports.f = function getOwnPropertyNames(it) {
|
8008 | return windowNames && classof(it) == 'Window'
|
8009 | ? getWindowNames(it)
|
8010 | : $getOwnPropertyNames(toIndexedObject(it));
|
8011 | };
|
8012 |
|
8013 |
|
8014 | }),
|
8015 |
|
8016 | (function(module, exports, __webpack_require__) {
|
8017 |
|
8018 | var toAbsoluteIndex = __webpack_require__(126);
|
8019 | var lengthOfArrayLike = __webpack_require__(40);
|
8020 | var createProperty = __webpack_require__(93);
|
8021 |
|
8022 | var $Array = Array;
|
8023 | var max = Math.max;
|
8024 |
|
8025 | module.exports = function (O, start, end) {
|
8026 | var length = lengthOfArrayLike(O);
|
8027 | var k = toAbsoluteIndex(start, length);
|
8028 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
8029 | var result = $Array(max(fin - k, 0));
|
8030 | for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
|
8031 | result.length = n;
|
8032 | return result;
|
8033 | };
|
8034 |
|
8035 |
|
8036 | }),
|
8037 |
|
8038 | (function(module, exports, __webpack_require__) {
|
8039 |
|
8040 | var call = __webpack_require__(15);
|
8041 | var getBuiltIn = __webpack_require__(20);
|
8042 | var wellKnownSymbol = __webpack_require__(5);
|
8043 | var defineBuiltIn = __webpack_require__(45);
|
8044 |
|
8045 | module.exports = function () {
|
8046 | var Symbol = getBuiltIn('Symbol');
|
8047 | var SymbolPrototype = Symbol && Symbol.prototype;
|
8048 | var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
|
8049 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
8050 |
|
8051 | if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
|
8052 |
|
8053 |
|
8054 |
|
8055 | defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
|
8056 | return call(valueOf, this);
|
8057 | }, { arity: 1 });
|
8058 | }
|
8059 | };
|
8060 |
|
8061 |
|
8062 | }),
|
8063 |
|
8064 | (function(module, exports, __webpack_require__) {
|
8065 |
|
8066 | var NATIVE_SYMBOL = __webpack_require__(65);
|
8067 |
|
8068 |
|
8069 | module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
|
8070 |
|
8071 |
|
8072 | }),
|
8073 |
|
8074 | (function(module, exports, __webpack_require__) {
|
8075 |
|
8076 | var defineWellKnownSymbol = __webpack_require__(10);
|
8077 |
|
8078 |
|
8079 |
|
8080 | defineWellKnownSymbol('iterator');
|
8081 |
|
8082 |
|
8083 | }),
|
8084 |
|
8085 | (function(module, exports, __webpack_require__) {
|
8086 |
|
8087 | var parent = __webpack_require__(466);
|
8088 | __webpack_require__(46);
|
8089 |
|
8090 | module.exports = parent;
|
8091 |
|
8092 |
|
8093 | }),
|
8094 |
|
8095 | (function(module, exports, __webpack_require__) {
|
8096 |
|
8097 | module.exports = __webpack_require__(467);
|
8098 |
|
8099 | }),
|
8100 |
|
8101 | (function(module, exports, __webpack_require__) {
|
8102 |
|
8103 | "use strict";
|
8104 |
|
8105 |
|
8106 |
|
8107 |
|
8108 |
|
8109 |
|
8110 |
|
8111 | var TimeoutError;
|
8112 |
|
8113 |
|
8114 |
|
8115 |
|
8116 |
|
8117 |
|
8118 |
|
8119 |
|
8120 |
|
8121 |
|
8122 | var timeout = module.exports.timeout = function(promise, timeoutMillis) {
|
8123 | var error = new TimeoutError(),
|
8124 | timeout;
|
8125 |
|
8126 | return Promise.race([
|
8127 | promise,
|
8128 | new Promise(function(resolve, reject) {
|
8129 | timeout = setTimeout(function() {
|
8130 | reject(error);
|
8131 | }, timeoutMillis);
|
8132 | }),
|
8133 | ]).then(function(v) {
|
8134 | clearTimeout(timeout);
|
8135 | return v;
|
8136 | }, function(err) {
|
8137 | clearTimeout(timeout);
|
8138 | throw err;
|
8139 | });
|
8140 | };
|
8141 |
|
8142 |
|
8143 |
|
8144 |
|
8145 | TimeoutError = module.exports.TimeoutError = function() {
|
8146 | Error.call(this)
|
8147 | this.stack = Error().stack
|
8148 | this.message = 'Timeout';
|
8149 | };
|
8150 |
|
8151 | TimeoutError.prototype = Object.create(Error.prototype);
|
8152 | TimeoutError.prototype.name = "TimeoutError";
|
8153 |
|
8154 |
|
8155 | }),
|
8156 |
|
8157 | (function(module, exports, __webpack_require__) {
|
8158 |
|
8159 | var parent = __webpack_require__(483);
|
8160 |
|
8161 | module.exports = parent;
|
8162 |
|
8163 |
|
8164 | }),
|
8165 |
|
8166 | (function(module, exports, __webpack_require__) {
|
8167 |
|
8168 | module.exports = __webpack_require__(487);
|
8169 |
|
8170 | }),
|
8171 |
|
8172 | (function(module, exports, __webpack_require__) {
|
8173 |
|
8174 | "use strict";
|
8175 |
|
8176 | var uncurryThis = __webpack_require__(4);
|
8177 | var aCallable = __webpack_require__(29);
|
8178 | var isObject = __webpack_require__(11);
|
8179 | var hasOwn = __webpack_require__(13);
|
8180 | var arraySlice = __webpack_require__(112);
|
8181 | var NATIVE_BIND = __webpack_require__(80);
|
8182 |
|
8183 | var $Function = Function;
|
8184 | var concat = uncurryThis([].concat);
|
8185 | var join = uncurryThis([].join);
|
8186 | var factories = {};
|
8187 |
|
8188 | var construct = function (C, argsLength, args) {
|
8189 | if (!hasOwn(factories, argsLength)) {
|
8190 | for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
8191 | factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
|
8192 | } return factories[argsLength](C, args);
|
8193 | };
|
8194 |
|
8195 |
|
8196 |
|
8197 | module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
|
8198 | var F = aCallable(this);
|
8199 | var Prototype = F.prototype;
|
8200 | var partArgs = arraySlice(arguments, 1);
|
8201 | var boundFunction = function bound(/* args... */) {
|
8202 | var args = concat(partArgs, arraySlice(arguments));
|
8203 | return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
|
8204 | };
|
8205 | if (isObject(Prototype)) boundFunction.prototype = Prototype;
|
8206 | return boundFunction;
|
8207 | };
|
8208 |
|
8209 |
|
8210 | }),
|
8211 |
|
8212 | (function(module, exports, __webpack_require__) {
|
8213 |
|
8214 | module.exports = __webpack_require__(508);
|
8215 |
|
8216 | }),
|
8217 |
|
8218 | (function(module, exports, __webpack_require__) {
|
8219 |
|
8220 | module.exports = __webpack_require__(511);
|
8221 |
|
8222 | }),
|
8223 |
|
8224 | (function(module, exports) {
|
8225 |
|
8226 | var charenc = {
|
8227 |
|
8228 | utf8: {
|
8229 |
|
8230 | stringToBytes: function(str) {
|
8231 | return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
|
8232 | },
|
8233 |
|
8234 |
|
8235 | bytesToString: function(bytes) {
|
8236 | return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
|
8237 | }
|
8238 | },
|
8239 |
|
8240 |
|
8241 | bin: {
|
8242 |
|
8243 | stringToBytes: function(str) {
|
8244 | for (var bytes = [], i = 0; i < str.length; i++)
|
8245 | bytes.push(str.charCodeAt(i) & 0xFF);
|
8246 | return bytes;
|
8247 | },
|
8248 |
|
8249 |
|
8250 | bytesToString: function(bytes) {
|
8251 | for (var str = [], i = 0; i < bytes.length; i++)
|
8252 | str.push(String.fromCharCode(bytes[i]));
|
8253 | return str.join('');
|
8254 | }
|
8255 | }
|
8256 | };
|
8257 |
|
8258 | module.exports = charenc;
|
8259 |
|
8260 |
|
8261 | }),
|
8262 |
|
8263 | (function(module, exports, __webpack_require__) {
|
8264 |
|
8265 | module.exports = __webpack_require__(555);
|
8266 |
|
8267 | }),
|
8268 |
|
8269 | (function(module, exports, __webpack_require__) {
|
8270 |
|
8271 | "use strict";
|
8272 |
|
8273 |
|
8274 | var adapters = __webpack_require__(572);
|
8275 |
|
8276 | module.exports = function (AV) {
|
8277 | AV.setAdapters(adapters);
|
8278 | return AV;
|
8279 | };
|
8280 |
|
8281 | }),
|
8282 |
|
8283 | (function(module, exports) {
|
8284 |
|
8285 |
|
8286 | module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
8287 | '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
8288 |
|
8289 |
|
8290 | }),
|
8291 |
|
8292 | (function(module, exports, __webpack_require__) {
|
8293 |
|
8294 | "use strict";
|
8295 |
|
8296 |
|
8297 | var _interopRequireDefault = __webpack_require__(1);
|
8298 |
|
8299 | var _symbol = _interopRequireDefault(__webpack_require__(77));
|
8300 |
|
8301 | var _iterator = _interopRequireDefault(__webpack_require__(154));
|
8302 |
|
8303 | function _typeof(obj) {
|
8304 | "@babel/helpers - typeof";
|
8305 |
|
8306 | if (typeof _symbol.default === "function" && typeof _iterator.default === "symbol") {
|
8307 | _typeof = function _typeof(obj) {
|
8308 | return typeof obj;
|
8309 | };
|
8310 | } else {
|
8311 | _typeof = function _typeof(obj) {
|
8312 | return obj && typeof _symbol.default === "function" && obj.constructor === _symbol.default && obj !== _symbol.default.prototype ? "symbol" : typeof obj;
|
8313 | };
|
8314 | }
|
8315 |
|
8316 | return _typeof(obj);
|
8317 | }
|
8318 |
|
8319 |
|
8320 |
|
8321 |
|
8322 |
|
8323 |
|
8324 |
|
8325 |
|
8326 |
|
8327 | function isObject(obj) {
|
8328 | return obj !== null && _typeof(obj) === 'object';
|
8329 | }
|
8330 |
|
8331 | module.exports = isObject;
|
8332 |
|
8333 | }),
|
8334 |
|
8335 | (function(module, exports, __webpack_require__) {
|
8336 |
|
8337 | module.exports = __webpack_require__(608);
|
8338 |
|
8339 | }),
|
8340 |
|
8341 | (function(module, exports, __webpack_require__) {
|
8342 |
|
8343 | module.exports = __webpack_require__(614);
|
8344 |
|
8345 | }),
|
8346 |
|
8347 | (function(module, exports, __webpack_require__) {
|
8348 |
|
8349 | var fails = __webpack_require__(2);
|
8350 |
|
8351 | module.exports = !fails(function () {
|
8352 |
|
8353 | return Object.isExtensible(Object.preventExtensions({}));
|
8354 | });
|
8355 |
|
8356 |
|
8357 | }),
|
8358 |
|
8359 | (function(module, exports, __webpack_require__) {
|
8360 |
|
8361 | var fails = __webpack_require__(2);
|
8362 | var isObject = __webpack_require__(11);
|
8363 | var classof = __webpack_require__(50);
|
8364 | var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(626);
|
8365 |
|
8366 |
|
8367 | var $isExtensible = Object.isExtensible;
|
8368 | var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
|
8369 |
|
8370 |
|
8371 |
|
8372 | module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
|
8373 | if (!isObject(it)) return false;
|
8374 | if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;
|
8375 | return $isExtensible ? $isExtensible(it) : true;
|
8376 | } : $isExtensible;
|
8377 |
|
8378 |
|
8379 | }),
|
8380 |
|
8381 | (function(module, exports, __webpack_require__) {
|
8382 |
|
8383 | module.exports = __webpack_require__(627);
|
8384 |
|
8385 | }),
|
8386 |
|
8387 | (function(module, exports, __webpack_require__) {
|
8388 |
|
8389 | module.exports = __webpack_require__(631);
|
8390 |
|
8391 | }),
|
8392 |
|
8393 | (function(module, exports, __webpack_require__) {
|
8394 |
|
8395 | "use strict";
|
8396 |
|
8397 | var $ = __webpack_require__(0);
|
8398 | var global = __webpack_require__(8);
|
8399 | var InternalMetadataModule = __webpack_require__(97);
|
8400 | var fails = __webpack_require__(2);
|
8401 | var createNonEnumerableProperty = __webpack_require__(39);
|
8402 | var iterate = __webpack_require__(41);
|
8403 | var anInstance = __webpack_require__(110);
|
8404 | var isCallable = __webpack_require__(9);
|
8405 | var isObject = __webpack_require__(11);
|
8406 | var setToStringTag = __webpack_require__(56);
|
8407 | var defineProperty = __webpack_require__(23).f;
|
8408 | var forEach = __webpack_require__(75).forEach;
|
8409 | var DESCRIPTORS = __webpack_require__(14);
|
8410 | var InternalStateModule = __webpack_require__(44);
|
8411 |
|
8412 | var setInternalState = InternalStateModule.set;
|
8413 | var internalStateGetterFor = InternalStateModule.getterFor;
|
8414 |
|
8415 | module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
|
8416 | var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
8417 | var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
8418 | var ADDER = IS_MAP ? 'set' : 'add';
|
8419 | var NativeConstructor = global[CONSTRUCTOR_NAME];
|
8420 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
8421 | var exported = {};
|
8422 | var Constructor;
|
8423 |
|
8424 | if (!DESCRIPTORS || !isCallable(NativeConstructor)
|
8425 | || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))
|
8426 | ) {
|
8427 |
|
8428 | Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
8429 | InternalMetadataModule.enable();
|
8430 | } else {
|
8431 | Constructor = wrapper(function (target, iterable) {
|
8432 | setInternalState(anInstance(target, Prototype), {
|
8433 | type: CONSTRUCTOR_NAME,
|
8434 | collection: new NativeConstructor()
|
8435 | });
|
8436 | if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
|
8437 | });
|
8438 |
|
8439 | var Prototype = Constructor.prototype;
|
8440 |
|
8441 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
8442 |
|
8443 | forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
|
8444 | var IS_ADDER = KEY == 'add' || KEY == 'set';
|
8445 | if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
|
8446 | createNonEnumerableProperty(Prototype, KEY, function (a, b) {
|
8447 | var collection = getInternalState(this).collection;
|
8448 | if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
|
8449 | var result = collection[KEY](a === 0 ? 0 : a, b);
|
8450 | return IS_ADDER ? this : result;
|
8451 | });
|
8452 | }
|
8453 | });
|
8454 |
|
8455 | IS_WEAK || defineProperty(Prototype, 'size', {
|
8456 | configurable: true,
|
8457 | get: function () {
|
8458 | return getInternalState(this).collection.size;
|
8459 | }
|
8460 | });
|
8461 | }
|
8462 |
|
8463 | setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
|
8464 |
|
8465 | exported[CONSTRUCTOR_NAME] = Constructor;
|
8466 | $({ global: true, forced: true }, exported);
|
8467 |
|
8468 | if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
8469 |
|
8470 | return Constructor;
|
8471 | };
|
8472 |
|
8473 |
|
8474 | }),
|
8475 |
|
8476 | (function(module, exports, __webpack_require__) {
|
8477 |
|
8478 | module.exports = __webpack_require__(647);
|
8479 |
|
8480 | }),
|
8481 |
|
8482 | (function(module, exports) {
|
8483 |
|
8484 | function _arrayLikeToArray(arr, len) {
|
8485 | if (len == null || len > arr.length) len = arr.length;
|
8486 |
|
8487 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
8488 | arr2[i] = arr[i];
|
8489 | }
|
8490 |
|
8491 | return arr2;
|
8492 | }
|
8493 |
|
8494 | module.exports = _arrayLikeToArray;
|
8495 |
|
8496 | }),
|
8497 |
|
8498 | (function(module, exports) {
|
8499 |
|
8500 | function _iterableToArray(iter) {
|
8501 | if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
8502 | }
|
8503 |
|
8504 | module.exports = _iterableToArray;
|
8505 |
|
8506 | }),
|
8507 |
|
8508 | (function(module, exports, __webpack_require__) {
|
8509 |
|
8510 | var arrayLikeToArray = __webpack_require__(269);
|
8511 |
|
8512 | function _unsupportedIterableToArray(o, minLen) {
|
8513 | if (!o) return;
|
8514 | if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
8515 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
8516 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
8517 | if (n === "Map" || n === "Set") return Array.from(o);
|
8518 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
8519 | }
|
8520 |
|
8521 | module.exports = _unsupportedIterableToArray;
|
8522 |
|
8523 | }),
|
8524 |
|
8525 | (function(module, exports, __webpack_require__) {
|
8526 |
|
8527 | var baseRandom = __webpack_require__(671);
|
8528 |
|
8529 |
|
8530 |
|
8531 |
|
8532 |
|
8533 |
|
8534 |
|
8535 |
|
8536 |
|
8537 | function shuffleSelf(array, size) {
|
8538 | var index = -1,
|
8539 | length = array.length,
|
8540 | lastIndex = length - 1;
|
8541 |
|
8542 | size = size === undefined ? length : size;
|
8543 | while (++index < size) {
|
8544 | var rand = baseRandom(index, lastIndex),
|
8545 | value = array[rand];
|
8546 |
|
8547 | array[rand] = array[index];
|
8548 | array[index] = value;
|
8549 | }
|
8550 | array.length = size;
|
8551 | return array;
|
8552 | }
|
8553 |
|
8554 | module.exports = shuffleSelf;
|
8555 |
|
8556 |
|
8557 | }),
|
8558 |
|
8559 | (function(module, exports, __webpack_require__) {
|
8560 |
|
8561 | var baseValues = __webpack_require__(673),
|
8562 | keys = __webpack_require__(675);
|
8563 |
|
8564 |
|
8565 |
|
8566 |
|
8567 |
|
8568 |
|
8569 |
|
8570 |
|
8571 |
|
8572 |
|
8573 |
|
8574 |
|
8575 |
|
8576 |
|
8577 |
|
8578 |
|
8579 |
|
8580 |
|
8581 |
|
8582 |
|
8583 |
|
8584 |
|
8585 |
|
8586 |
|
8587 |
|
8588 |
|
8589 |
|
8590 | function values(object) {
|
8591 | return object == null ? [] : baseValues(object, keys(object));
|
8592 | }
|
8593 |
|
8594 | module.exports = values;
|
8595 |
|
8596 |
|
8597 | }),
|
8598 |
|
8599 | (function(module, exports, __webpack_require__) {
|
8600 |
|
8601 | var root = __webpack_require__(275);
|
8602 |
|
8603 |
|
8604 | var Symbol = root.Symbol;
|
8605 |
|
8606 | module.exports = Symbol;
|
8607 |
|
8608 |
|
8609 | }),
|
8610 |
|
8611 | (function(module, exports, __webpack_require__) {
|
8612 |
|
8613 | var freeGlobal = __webpack_require__(276);
|
8614 |
|
8615 |
|
8616 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
8617 |
|
8618 |
|
8619 | var root = freeGlobal || freeSelf || Function('return this')();
|
8620 |
|
8621 | module.exports = root;
|
8622 |
|
8623 |
|
8624 | }),
|
8625 |
|
8626 | (function(module, exports, __webpack_require__) {
|
8627 |
|
8628 | (function(global) {
|
8629 | var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
8630 |
|
8631 | module.exports = freeGlobal;
|
8632 |
|
8633 | }.call(exports, __webpack_require__(78)))
|
8634 |
|
8635 | }),
|
8636 |
|
8637 | (function(module, exports) {
|
8638 |
|
8639 |
|
8640 |
|
8641 |
|
8642 |
|
8643 |
|
8644 |
|
8645 |
|
8646 |
|
8647 |
|
8648 |
|
8649 |
|
8650 |
|
8651 |
|
8652 |
|
8653 |
|
8654 |
|
8655 |
|
8656 |
|
8657 |
|
8658 |
|
8659 |
|
8660 |
|
8661 |
|
8662 | var isArray = Array.isArray;
|
8663 |
|
8664 | module.exports = isArray;
|
8665 |
|
8666 |
|
8667 | }),
|
8668 |
|
8669 | (function(module, exports) {
|
8670 |
|
8671 | module.exports = function(module) {
|
8672 | if(!module.webpackPolyfill) {
|
8673 | module.deprecate = function() {};
|
8674 | module.paths = [];
|
8675 |
|
8676 | if(!module.children) module.children = [];
|
8677 | Object.defineProperty(module, "loaded", {
|
8678 | enumerable: true,
|
8679 | get: function() {
|
8680 | return module.l;
|
8681 | }
|
8682 | });
|
8683 | Object.defineProperty(module, "id", {
|
8684 | enumerable: true,
|
8685 | get: function() {
|
8686 | return module.i;
|
8687 | }
|
8688 | });
|
8689 | module.webpackPolyfill = 1;
|
8690 | }
|
8691 | return module;
|
8692 | };
|
8693 |
|
8694 |
|
8695 | }),
|
8696 |
|
8697 | (function(module, exports) {
|
8698 |
|
8699 |
|
8700 | var MAX_SAFE_INTEGER = 9007199254740991;
|
8701 |
|
8702 |
|
8703 |
|
8704 |
|
8705 |
|
8706 |
|
8707 |
|
8708 |
|
8709 |
|
8710 |
|
8711 |
|
8712 |
|
8713 |
|
8714 |
|
8715 |
|
8716 |
|
8717 |
|
8718 |
|
8719 |
|
8720 |
|
8721 |
|
8722 |
|
8723 |
|
8724 |
|
8725 |
|
8726 |
|
8727 |
|
8728 | function isLength(value) {
|
8729 | return typeof value == 'number' &&
|
8730 | value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
8731 | }
|
8732 |
|
8733 | module.exports = isLength;
|
8734 |
|
8735 |
|
8736 | }),
|
8737 |
|
8738 | (function(module, exports) {
|
8739 |
|
8740 |
|
8741 |
|
8742 |
|
8743 |
|
8744 |
|
8745 |
|
8746 |
|
8747 |
|
8748 | function overArg(func, transform) {
|
8749 | return function(arg) {
|
8750 | return func(transform(arg));
|
8751 | };
|
8752 | }
|
8753 |
|
8754 | module.exports = overArg;
|
8755 |
|
8756 |
|
8757 | }),
|
8758 |
|
8759 | (function(module, exports, __webpack_require__) {
|
8760 |
|
8761 | "use strict";
|
8762 |
|
8763 |
|
8764 | var AV = __webpack_require__(282);
|
8765 |
|
8766 | var useLiveQuery = __webpack_require__(620);
|
8767 |
|
8768 | var useAdatpers = __webpack_require__(258);
|
8769 |
|
8770 | module.exports = useAdatpers(useLiveQuery(AV));
|
8771 |
|
8772 | }),
|
8773 |
|
8774 | (function(module, exports, __webpack_require__) {
|
8775 |
|
8776 | "use strict";
|
8777 |
|
8778 |
|
8779 | var AV = __webpack_require__(283);
|
8780 |
|
8781 | var useAdatpers = __webpack_require__(258);
|
8782 |
|
8783 | module.exports = useAdatpers(AV);
|
8784 |
|
8785 | }),
|
8786 |
|
8787 | (function(module, exports, __webpack_require__) {
|
8788 |
|
8789 | "use strict";
|
8790 |
|
8791 |
|
8792 | module.exports = __webpack_require__(284);
|
8793 |
|
8794 | }),
|
8795 |
|
8796 | (function(module, exports, __webpack_require__) {
|
8797 |
|
8798 | "use strict";
|
8799 |
|
8800 |
|
8801 | var _interopRequireDefault = __webpack_require__(1);
|
8802 |
|
8803 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
8804 |
|
8805 |
|
8806 |
|
8807 |
|
8808 |
|
8809 |
|
8810 |
|
8811 |
|
8812 | var _ = __webpack_require__(3);
|
8813 |
|
8814 | var AV = __webpack_require__(74);
|
8815 |
|
8816 | AV._ = _;
|
8817 | AV.version = __webpack_require__(233);
|
8818 | AV.Promise = _promise.default;
|
8819 | AV.localStorage = __webpack_require__(235);
|
8820 | AV.Cache = __webpack_require__(236);
|
8821 | AV.Error = __webpack_require__(48);
|
8822 |
|
8823 | __webpack_require__(423);
|
8824 |
|
8825 | __webpack_require__(471)(AV);
|
8826 |
|
8827 | __webpack_require__(472)(AV);
|
8828 |
|
8829 | __webpack_require__(473)(AV);
|
8830 |
|
8831 | __webpack_require__(474)(AV);
|
8832 |
|
8833 | __webpack_require__(479)(AV);
|
8834 |
|
8835 | __webpack_require__(480)(AV);
|
8836 |
|
8837 | __webpack_require__(533)(AV);
|
8838 |
|
8839 | __webpack_require__(558)(AV);
|
8840 |
|
8841 | __webpack_require__(559)(AV);
|
8842 |
|
8843 | __webpack_require__(561)(AV);
|
8844 |
|
8845 | __webpack_require__(562)(AV);
|
8846 |
|
8847 | __webpack_require__(563)(AV);
|
8848 |
|
8849 | __webpack_require__(564)(AV);
|
8850 |
|
8851 | __webpack_require__(565)(AV);
|
8852 |
|
8853 | __webpack_require__(566)(AV);
|
8854 |
|
8855 | __webpack_require__(567)(AV);
|
8856 |
|
8857 | __webpack_require__(568)(AV);
|
8858 |
|
8859 | __webpack_require__(569)(AV);
|
8860 |
|
8861 | AV.Conversation = __webpack_require__(570);
|
8862 |
|
8863 | __webpack_require__(571);
|
8864 |
|
8865 | module.exports = AV;
|
8866 |
|
8867 |
|
8868 |
|
8869 |
|
8870 |
|
8871 |
|
8872 |
|
8873 |
|
8874 |
|
8875 |
|
8876 |
|
8877 |
|
8878 |
|
8879 |
|
8880 |
|
8881 |
|
8882 |
|
8883 | }),
|
8884 |
|
8885 | (function(module, exports, __webpack_require__) {
|
8886 |
|
8887 | var parent = __webpack_require__(286);
|
8888 | __webpack_require__(46);
|
8889 |
|
8890 | module.exports = parent;
|
8891 |
|
8892 |
|
8893 | }),
|
8894 |
|
8895 | (function(module, exports, __webpack_require__) {
|
8896 |
|
8897 | __webpack_require__(287);
|
8898 | __webpack_require__(43);
|
8899 | __webpack_require__(68);
|
8900 | __webpack_require__(302);
|
8901 | __webpack_require__(316);
|
8902 | __webpack_require__(317);
|
8903 | __webpack_require__(318);
|
8904 | __webpack_require__(70);
|
8905 | var path = __webpack_require__(7);
|
8906 |
|
8907 | module.exports = path.Promise;
|
8908 |
|
8909 |
|
8910 | }),
|
8911 |
|
8912 | (function(module, exports, __webpack_require__) {
|
8913 |
|
8914 |
|
8915 | __webpack_require__(288);
|
8916 |
|
8917 |
|
8918 | }),
|
8919 |
|
8920 | (function(module, exports, __webpack_require__) {
|
8921 |
|
8922 | "use strict";
|
8923 |
|
8924 | var $ = __webpack_require__(0);
|
8925 | var isPrototypeOf = __webpack_require__(16);
|
8926 | var getPrototypeOf = __webpack_require__(102);
|
8927 | var setPrototypeOf = __webpack_require__(104);
|
8928 | var copyConstructorProperties = __webpack_require__(293);
|
8929 | var create = __webpack_require__(53);
|
8930 | var createNonEnumerableProperty = __webpack_require__(39);
|
8931 | var createPropertyDescriptor = __webpack_require__(49);
|
8932 | var clearErrorStack = __webpack_require__(296);
|
8933 | var installErrorCause = __webpack_require__(297);
|
8934 | var iterate = __webpack_require__(41);
|
8935 | var normalizeStringArgument = __webpack_require__(298);
|
8936 | var wellKnownSymbol = __webpack_require__(5);
|
8937 | var ERROR_STACK_INSTALLABLE = __webpack_require__(299);
|
8938 |
|
8939 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
8940 | var $Error = Error;
|
8941 | var push = [].push;
|
8942 |
|
8943 | var $AggregateError = function AggregateError(errors, message /* , options */) {
|
8944 | var options = arguments.length > 2 ? arguments[2] : undefined;
|
8945 | var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
|
8946 | var that;
|
8947 | if (setPrototypeOf) {
|
8948 | that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
|
8949 | } else {
|
8950 | that = isInstance ? this : create(AggregateErrorPrototype);
|
8951 | createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
|
8952 | }
|
8953 | if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
|
8954 | if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
|
8955 | installErrorCause(that, options);
|
8956 | var errorsArray = [];
|
8957 | iterate(errors, push, { that: errorsArray });
|
8958 | createNonEnumerableProperty(that, 'errors', errorsArray);
|
8959 | return that;
|
8960 | };
|
8961 |
|
8962 | if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
|
8963 | else copyConstructorProperties($AggregateError, $Error, { name: true });
|
8964 |
|
8965 | var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
|
8966 | constructor: createPropertyDescriptor(1, $AggregateError),
|
8967 | message: createPropertyDescriptor(1, ''),
|
8968 | name: createPropertyDescriptor(1, 'AggregateError')
|
8969 | });
|
8970 |
|
8971 | // `AggregateError` constructor
|
8972 | // https://tc39.es/ecma262/#sec-aggregate-error-constructor
|
8973 | $({ global: true, constructor: true, arity: 2 }, {
|
8974 | AggregateError: $AggregateError
|
8975 | });
|
8976 |
|
8977 |
|
8978 | }),
|
8979 |
|
8980 | (function(module, exports, __webpack_require__) {
|
8981 |
|
8982 | var call = __webpack_require__(15);
|
8983 | var isObject = __webpack_require__(11);
|
8984 | var isSymbol = __webpack_require__(100);
|
8985 | var getMethod = __webpack_require__(122);
|
8986 | var ordinaryToPrimitive = __webpack_require__(290);
|
8987 | var wellKnownSymbol = __webpack_require__(5);
|
8988 |
|
8989 | var $TypeError = TypeError;
|
8990 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
8991 |
|
8992 |
|
8993 |
|
8994 | module.exports = function (input, pref) {
|
8995 | if (!isObject(input) || isSymbol(input)) return input;
|
8996 | var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
8997 | var result;
|
8998 | if (exoticToPrim) {
|
8999 | if (pref === undefined) pref = 'default';
|
9000 | result = call(exoticToPrim, input, pref);
|
9001 | if (!isObject(result) || isSymbol(result)) return result;
|
9002 | throw $TypeError("Can't convert object to primitive value");
|
9003 | }
|
9004 | if (pref === undefined) pref = 'number';
|
9005 | return ordinaryToPrimitive(input, pref);
|
9006 | };
|
9007 |
|
9008 |
|
9009 | }),
|
9010 |
|
9011 | (function(module, exports, __webpack_require__) {
|
9012 |
|
9013 | var call = __webpack_require__(15);
|
9014 | var isCallable = __webpack_require__(9);
|
9015 | var isObject = __webpack_require__(11);
|
9016 |
|
9017 | var $TypeError = TypeError;
|
9018 |
|
9019 |
|
9020 |
|
9021 | module.exports = function (input, pref) {
|
9022 | var fn, val;
|
9023 | if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
9024 | if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
|
9025 | if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
9026 | throw $TypeError("Can't convert object to primitive value");
|
9027 | };
|
9028 |
|
9029 |
|
9030 | }),
|
9031 |
|
9032 | (function(module, exports, __webpack_require__) {
|
9033 |
|
9034 | var global = __webpack_require__(8);
|
9035 |
|
9036 |
|
9037 | var defineProperty = Object.defineProperty;
|
9038 |
|
9039 | module.exports = function (key, value) {
|
9040 | try {
|
9041 | defineProperty(global, key, { value: value, configurable: true, writable: true });
|
9042 | } catch (error) {
|
9043 | global[key] = value;
|
9044 | } return value;
|
9045 | };
|
9046 |
|
9047 |
|
9048 | }),
|
9049 |
|
9050 | (function(module, exports, __webpack_require__) {
|
9051 |
|
9052 | var isCallable = __webpack_require__(9);
|
9053 |
|
9054 | var $String = String;
|
9055 | var $TypeError = TypeError;
|
9056 |
|
9057 | module.exports = function (argument) {
|
9058 | if (typeof argument == 'object' || isCallable(argument)) return argument;
|
9059 | throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
|
9060 | };
|
9061 |
|
9062 |
|
9063 | }),
|
9064 |
|
9065 | (function(module, exports, __webpack_require__) {
|
9066 |
|
9067 | var hasOwn = __webpack_require__(13);
|
9068 | var ownKeys = __webpack_require__(162);
|
9069 | var getOwnPropertyDescriptorModule = __webpack_require__(64);
|
9070 | var definePropertyModule = __webpack_require__(23);
|
9071 |
|
9072 | module.exports = function (target, source, exceptions) {
|
9073 | var keys = ownKeys(source);
|
9074 | var defineProperty = definePropertyModule.f;
|
9075 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
9076 | for (var i = 0; i < keys.length; i++) {
|
9077 | var key = keys[i];
|
9078 | if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
|
9079 | defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
9080 | }
|
9081 | }
|
9082 | };
|
9083 |
|
9084 |
|
9085 | }),
|
9086 |
|
9087 | (function(module, exports) {
|
9088 |
|
9089 | var ceil = Math.ceil;
|
9090 | var floor = Math.floor;
|
9091 |
|
9092 |
|
9093 |
|
9094 |
|
9095 | module.exports = Math.trunc || function trunc(x) {
|
9096 | var n = +x;
|
9097 | return (n > 0 ? floor : ceil)(n);
|
9098 | };
|
9099 |
|
9100 |
|
9101 | }),
|
9102 |
|
9103 | (function(module, exports, __webpack_require__) {
|
9104 |
|
9105 | var toIntegerOrInfinity = __webpack_require__(127);
|
9106 |
|
9107 | var min = Math.min;
|
9108 |
|
9109 |
|
9110 |
|
9111 | module.exports = function (argument) {
|
9112 | return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0;
|
9113 | };
|
9114 |
|
9115 |
|
9116 | }),
|
9117 |
|
9118 | (function(module, exports, __webpack_require__) {
|
9119 |
|
9120 | var uncurryThis = __webpack_require__(4);
|
9121 |
|
9122 | var $Error = Error;
|
9123 | var replace = uncurryThis(''.replace);
|
9124 |
|
9125 | var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
|
9126 | var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
|
9127 | var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
|
9128 |
|
9129 | module.exports = function (stack, dropEntries) {
|
9130 | if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
|
9131 | while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
|
9132 | } return stack;
|
9133 | };
|
9134 |
|
9135 |
|
9136 | }),
|
9137 |
|
9138 | (function(module, exports, __webpack_require__) {
|
9139 |
|
9140 | var isObject = __webpack_require__(11);
|
9141 | var createNonEnumerableProperty = __webpack_require__(39);
|
9142 |
|
9143 |
|
9144 |
|
9145 | module.exports = function (O, options) {
|
9146 | if (isObject(options) && 'cause' in options) {
|
9147 | createNonEnumerableProperty(O, 'cause', options.cause);
|
9148 | }
|
9149 | };
|
9150 |
|
9151 |
|
9152 | }),
|
9153 |
|
9154 | (function(module, exports, __webpack_require__) {
|
9155 |
|
9156 | var toString = __webpack_require__(42);
|
9157 |
|
9158 | module.exports = function (argument, $default) {
|
9159 | return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
|
9160 | };
|
9161 |
|
9162 |
|
9163 | }),
|
9164 |
|
9165 | (function(module, exports, __webpack_require__) {
|
9166 |
|
9167 | var fails = __webpack_require__(2);
|
9168 | var createPropertyDescriptor = __webpack_require__(49);
|
9169 |
|
9170 | module.exports = !fails(function () {
|
9171 | var error = Error('a');
|
9172 | if (!('stack' in error)) return true;
|
9173 |
|
9174 | Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
|
9175 | return error.stack !== 7;
|
9176 | });
|
9177 |
|
9178 |
|
9179 | }),
|
9180 |
|
9181 | (function(module, exports, __webpack_require__) {
|
9182 |
|
9183 | "use strict";
|
9184 |
|
9185 | var IteratorPrototype = __webpack_require__(170).IteratorPrototype;
|
9186 | var create = __webpack_require__(53);
|
9187 | var createPropertyDescriptor = __webpack_require__(49);
|
9188 | var setToStringTag = __webpack_require__(56);
|
9189 | var Iterators = __webpack_require__(54);
|
9190 |
|
9191 | var returnThis = function () { return this; };
|
9192 |
|
9193 | module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
9194 | var TO_STRING_TAG = NAME + ' Iterator';
|
9195 | IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
9196 | setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
|
9197 | Iterators[TO_STRING_TAG] = returnThis;
|
9198 | return IteratorConstructor;
|
9199 | };
|
9200 |
|
9201 |
|
9202 | }),
|
9203 |
|
9204 | (function(module, exports, __webpack_require__) {
|
9205 |
|
9206 | "use strict";
|
9207 |
|
9208 | var TO_STRING_TAG_SUPPORT = __webpack_require__(130);
|
9209 | var classof = __webpack_require__(55);
|
9210 |
|
9211 |
|
9212 |
|
9213 | module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
|
9214 | return '[object ' + classof(this) + ']';
|
9215 | };
|
9216 |
|
9217 |
|
9218 | }),
|
9219 |
|
9220 | (function(module, exports, __webpack_require__) {
|
9221 |
|
9222 |
|
9223 | __webpack_require__(303);
|
9224 | __webpack_require__(311);
|
9225 | __webpack_require__(312);
|
9226 | __webpack_require__(313);
|
9227 | __webpack_require__(314);
|
9228 | __webpack_require__(315);
|
9229 |
|
9230 |
|
9231 | }),
|
9232 |
|
9233 | (function(module, exports, __webpack_require__) {
|
9234 |
|
9235 | "use strict";
|
9236 |
|
9237 | var $ = __webpack_require__(0);
|
9238 | var IS_PURE = __webpack_require__(36);
|
9239 | var IS_NODE = __webpack_require__(109);
|
9240 | var global = __webpack_require__(8);
|
9241 | var call = __webpack_require__(15);
|
9242 | var defineBuiltIn = __webpack_require__(45);
|
9243 | var setPrototypeOf = __webpack_require__(104);
|
9244 | var setToStringTag = __webpack_require__(56);
|
9245 | var setSpecies = __webpack_require__(171);
|
9246 | var aCallable = __webpack_require__(29);
|
9247 | var isCallable = __webpack_require__(9);
|
9248 | var isObject = __webpack_require__(11);
|
9249 | var anInstance = __webpack_require__(110);
|
9250 | var speciesConstructor = __webpack_require__(172);
|
9251 | var task = __webpack_require__(174).set;
|
9252 | var microtask = __webpack_require__(305);
|
9253 | var hostReportErrors = __webpack_require__(308);
|
9254 | var perform = __webpack_require__(84);
|
9255 | var Queue = __webpack_require__(309);
|
9256 | var InternalStateModule = __webpack_require__(44);
|
9257 | var NativePromiseConstructor = __webpack_require__(69);
|
9258 | var PromiseConstructorDetection = __webpack_require__(85);
|
9259 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9260 |
|
9261 | var PROMISE = 'Promise';
|
9262 | var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
|
9263 | var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
|
9264 | var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
|
9265 | var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
|
9266 | var setInternalState = InternalStateModule.set;
|
9267 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
9268 | var PromiseConstructor = NativePromiseConstructor;
|
9269 | var PromisePrototype = NativePromisePrototype;
|
9270 | var TypeError = global.TypeError;
|
9271 | var document = global.document;
|
9272 | var process = global.process;
|
9273 | var newPromiseCapability = newPromiseCapabilityModule.f;
|
9274 | var newGenericPromiseCapability = newPromiseCapability;
|
9275 |
|
9276 | var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
|
9277 | var UNHANDLED_REJECTION = 'unhandledrejection';
|
9278 | var REJECTION_HANDLED = 'rejectionhandled';
|
9279 | var PENDING = 0;
|
9280 | var FULFILLED = 1;
|
9281 | var REJECTED = 2;
|
9282 | var HANDLED = 1;
|
9283 | var UNHANDLED = 2;
|
9284 |
|
9285 | var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
9286 |
|
9287 |
|
9288 | var isThenable = function (it) {
|
9289 | var then;
|
9290 | return isObject(it) && isCallable(then = it.then) ? then : false;
|
9291 | };
|
9292 |
|
9293 | var callReaction = function (reaction, state) {
|
9294 | var value = state.value;
|
9295 | var ok = state.state == FULFILLED;
|
9296 | var handler = ok ? reaction.ok : reaction.fail;
|
9297 | var resolve = reaction.resolve;
|
9298 | var reject = reaction.reject;
|
9299 | var domain = reaction.domain;
|
9300 | var result, then, exited;
|
9301 | try {
|
9302 | if (handler) {
|
9303 | if (!ok) {
|
9304 | if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
9305 | state.rejection = HANDLED;
|
9306 | }
|
9307 | if (handler === true) result = value;
|
9308 | else {
|
9309 | if (domain) domain.enter();
|
9310 | result = handler(value);
|
9311 | if (domain) {
|
9312 | domain.exit();
|
9313 | exited = true;
|
9314 | }
|
9315 | }
|
9316 | if (result === reaction.promise) {
|
9317 | reject(TypeError('Promise-chain cycle'));
|
9318 | } else if (then = isThenable(result)) {
|
9319 | call(then, result, resolve, reject);
|
9320 | } else resolve(result);
|
9321 | } else reject(value);
|
9322 | } catch (error) {
|
9323 | if (domain && !exited) domain.exit();
|
9324 | reject(error);
|
9325 | }
|
9326 | };
|
9327 |
|
9328 | var notify = function (state, isReject) {
|
9329 | if (state.notified) return;
|
9330 | state.notified = true;
|
9331 | microtask(function () {
|
9332 | var reactions = state.reactions;
|
9333 | var reaction;
|
9334 | while (reaction = reactions.get()) {
|
9335 | callReaction(reaction, state);
|
9336 | }
|
9337 | state.notified = false;
|
9338 | if (isReject && !state.rejection) onUnhandled(state);
|
9339 | });
|
9340 | };
|
9341 |
|
9342 | var dispatchEvent = function (name, promise, reason) {
|
9343 | var event, handler;
|
9344 | if (DISPATCH_EVENT) {
|
9345 | event = document.createEvent('Event');
|
9346 | event.promise = promise;
|
9347 | event.reason = reason;
|
9348 | event.initEvent(name, false, true);
|
9349 | global.dispatchEvent(event);
|
9350 | } else event = { promise: promise, reason: reason };
|
9351 | if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
|
9352 | else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
9353 | };
|
9354 |
|
9355 | var onUnhandled = function (state) {
|
9356 | call(task, global, function () {
|
9357 | var promise = state.facade;
|
9358 | var value = state.value;
|
9359 | var IS_UNHANDLED = isUnhandled(state);
|
9360 | var result;
|
9361 | if (IS_UNHANDLED) {
|
9362 | result = perform(function () {
|
9363 | if (IS_NODE) {
|
9364 | process.emit('unhandledRejection', value, promise);
|
9365 | } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
9366 | });
|
9367 |
|
9368 | state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
|
9369 | if (result.error) throw result.value;
|
9370 | }
|
9371 | });
|
9372 | };
|
9373 |
|
9374 | var isUnhandled = function (state) {
|
9375 | return state.rejection !== HANDLED && !state.parent;
|
9376 | };
|
9377 |
|
9378 | var onHandleUnhandled = function (state) {
|
9379 | call(task, global, function () {
|
9380 | var promise = state.facade;
|
9381 | if (IS_NODE) {
|
9382 | process.emit('rejectionHandled', promise);
|
9383 | } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
9384 | });
|
9385 | };
|
9386 |
|
9387 | var bind = function (fn, state, unwrap) {
|
9388 | return function (value) {
|
9389 | fn(state, value, unwrap);
|
9390 | };
|
9391 | };
|
9392 |
|
9393 | var internalReject = function (state, value, unwrap) {
|
9394 | if (state.done) return;
|
9395 | state.done = true;
|
9396 | if (unwrap) state = unwrap;
|
9397 | state.value = value;
|
9398 | state.state = REJECTED;
|
9399 | notify(state, true);
|
9400 | };
|
9401 |
|
9402 | var internalResolve = function (state, value, unwrap) {
|
9403 | if (state.done) return;
|
9404 | state.done = true;
|
9405 | if (unwrap) state = unwrap;
|
9406 | try {
|
9407 | if (state.facade === value) throw TypeError("Promise can't be resolved itself");
|
9408 | var then = isThenable(value);
|
9409 | if (then) {
|
9410 | microtask(function () {
|
9411 | var wrapper = { done: false };
|
9412 | try {
|
9413 | call(then, value,
|
9414 | bind(internalResolve, wrapper, state),
|
9415 | bind(internalReject, wrapper, state)
|
9416 | );
|
9417 | } catch (error) {
|
9418 | internalReject(wrapper, error, state);
|
9419 | }
|
9420 | });
|
9421 | } else {
|
9422 | state.value = value;
|
9423 | state.state = FULFILLED;
|
9424 | notify(state, false);
|
9425 | }
|
9426 | } catch (error) {
|
9427 | internalReject({ done: false }, error, state);
|
9428 | }
|
9429 | };
|
9430 |
|
9431 |
|
9432 | if (FORCED_PROMISE_CONSTRUCTOR) {
|
9433 |
|
9434 | PromiseConstructor = function Promise(executor) {
|
9435 | anInstance(this, PromisePrototype);
|
9436 | aCallable(executor);
|
9437 | call(Internal, this);
|
9438 | var state = getInternalPromiseState(this);
|
9439 | try {
|
9440 | executor(bind(internalResolve, state), bind(internalReject, state));
|
9441 | } catch (error) {
|
9442 | internalReject(state, error);
|
9443 | }
|
9444 | };
|
9445 |
|
9446 | PromisePrototype = PromiseConstructor.prototype;
|
9447 |
|
9448 |
|
9449 | Internal = function Promise(executor) {
|
9450 | setInternalState(this, {
|
9451 | type: PROMISE,
|
9452 | done: false,
|
9453 | notified: false,
|
9454 | parent: false,
|
9455 | reactions: new Queue(),
|
9456 | rejection: false,
|
9457 | state: PENDING,
|
9458 | value: undefined
|
9459 | });
|
9460 | };
|
9461 |
|
9462 |
|
9463 |
|
9464 | Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
9465 | var state = getInternalPromiseState(this);
|
9466 | var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
9467 | state.parent = true;
|
9468 | reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
|
9469 | reaction.fail = isCallable(onRejected) && onRejected;
|
9470 | reaction.domain = IS_NODE ? process.domain : undefined;
|
9471 | if (state.state == PENDING) state.reactions.add(reaction);
|
9472 | else microtask(function () {
|
9473 | callReaction(reaction, state);
|
9474 | });
|
9475 | return reaction.promise;
|
9476 | });
|
9477 |
|
9478 | OwnPromiseCapability = function () {
|
9479 | var promise = new Internal();
|
9480 | var state = getInternalPromiseState(promise);
|
9481 | this.promise = promise;
|
9482 | this.resolve = bind(internalResolve, state);
|
9483 | this.reject = bind(internalReject, state);
|
9484 | };
|
9485 |
|
9486 | newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
9487 | return C === PromiseConstructor || C === PromiseWrapper
|
9488 | ? new OwnPromiseCapability(C)
|
9489 | : newGenericPromiseCapability(C);
|
9490 | };
|
9491 |
|
9492 | if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
|
9493 | nativeThen = NativePromisePrototype.then;
|
9494 |
|
9495 | if (!NATIVE_PROMISE_SUBCLASSING) {
|
9496 |
|
9497 | defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
9498 | var that = this;
|
9499 | return new PromiseConstructor(function (resolve, reject) {
|
9500 | call(nativeThen, that, resolve, reject);
|
9501 | }).then(onFulfilled, onRejected);
|
9502 |
|
9503 | }, { unsafe: true });
|
9504 | }
|
9505 |
|
9506 |
|
9507 | try {
|
9508 | delete NativePromisePrototype.constructor;
|
9509 | } catch (error) { }
|
9510 |
|
9511 |
|
9512 | if (setPrototypeOf) {
|
9513 | setPrototypeOf(NativePromisePrototype, PromisePrototype);
|
9514 | }
|
9515 | }
|
9516 | }
|
9517 |
|
9518 | $({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
9519 | Promise: PromiseConstructor
|
9520 | });
|
9521 |
|
9522 | setToStringTag(PromiseConstructor, PROMISE, false, true);
|
9523 | setSpecies(PROMISE);
|
9524 |
|
9525 |
|
9526 | }),
|
9527 |
|
9528 | (function(module, exports) {
|
9529 |
|
9530 | var $TypeError = TypeError;
|
9531 |
|
9532 | module.exports = function (passed, required) {
|
9533 | if (passed < required) throw $TypeError('Not enough arguments');
|
9534 | return passed;
|
9535 | };
|
9536 |
|
9537 |
|
9538 | }),
|
9539 |
|
9540 | (function(module, exports, __webpack_require__) {
|
9541 |
|
9542 | var global = __webpack_require__(8);
|
9543 | var bind = __webpack_require__(52);
|
9544 | var getOwnPropertyDescriptor = __webpack_require__(64).f;
|
9545 | var macrotask = __webpack_require__(174).set;
|
9546 | var IS_IOS = __webpack_require__(175);
|
9547 | var IS_IOS_PEBBLE = __webpack_require__(306);
|
9548 | var IS_WEBOS_WEBKIT = __webpack_require__(307);
|
9549 | var IS_NODE = __webpack_require__(109);
|
9550 |
|
9551 | var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
|
9552 | var document = global.document;
|
9553 | var process = global.process;
|
9554 | var Promise = global.Promise;
|
9555 |
|
9556 | var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
|
9557 | var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
9558 |
|
9559 | var flush, head, last, notify, toggle, node, promise, then;
|
9560 |
|
9561 |
|
9562 | if (!queueMicrotask) {
|
9563 | flush = function () {
|
9564 | var parent, fn;
|
9565 | if (IS_NODE && (parent = process.domain)) parent.exit();
|
9566 | while (head) {
|
9567 | fn = head.fn;
|
9568 | head = head.next;
|
9569 | try {
|
9570 | fn();
|
9571 | } catch (error) {
|
9572 | if (head) notify();
|
9573 | else last = undefined;
|
9574 | throw error;
|
9575 | }
|
9576 | } last = undefined;
|
9577 | if (parent) parent.enter();
|
9578 | };
|
9579 |
|
9580 |
|
9581 |
|
9582 | if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
|
9583 | toggle = true;
|
9584 | node = document.createTextNode('');
|
9585 | new MutationObserver(flush).observe(node, { characterData: true });
|
9586 | notify = function () {
|
9587 | node.data = toggle = !toggle;
|
9588 | };
|
9589 |
|
9590 | } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
|
9591 |
|
9592 | promise = Promise.resolve(undefined);
|
9593 |
|
9594 | promise.constructor = Promise;
|
9595 | then = bind(promise.then, promise);
|
9596 | notify = function () {
|
9597 | then(flush);
|
9598 | };
|
9599 |
|
9600 | } else if (IS_NODE) {
|
9601 | notify = function () {
|
9602 | process.nextTick(flush);
|
9603 | };
|
9604 |
|
9605 |
|
9606 |
|
9607 |
|
9608 |
|
9609 |
|
9610 | } else {
|
9611 |
|
9612 | macrotask = bind(macrotask, global);
|
9613 | notify = function () {
|
9614 | macrotask(flush);
|
9615 | };
|
9616 | }
|
9617 | }
|
9618 |
|
9619 | module.exports = queueMicrotask || function (fn) {
|
9620 | var task = { fn: fn, next: undefined };
|
9621 | if (last) last.next = task;
|
9622 | if (!head) {
|
9623 | head = task;
|
9624 | notify();
|
9625 | } last = task;
|
9626 | };
|
9627 |
|
9628 |
|
9629 | }),
|
9630 |
|
9631 | (function(module, exports, __webpack_require__) {
|
9632 |
|
9633 | var userAgent = __webpack_require__(51);
|
9634 | var global = __webpack_require__(8);
|
9635 |
|
9636 | module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
|
9637 |
|
9638 |
|
9639 | }),
|
9640 |
|
9641 | (function(module, exports, __webpack_require__) {
|
9642 |
|
9643 | var userAgent = __webpack_require__(51);
|
9644 |
|
9645 | module.exports = /web0s(?!.*chrome)/i.test(userAgent);
|
9646 |
|
9647 |
|
9648 | }),
|
9649 |
|
9650 | (function(module, exports, __webpack_require__) {
|
9651 |
|
9652 | var global = __webpack_require__(8);
|
9653 |
|
9654 | module.exports = function (a, b) {
|
9655 | var console = global.console;
|
9656 | if (console && console.error) {
|
9657 | arguments.length == 1 ? console.error(a) : console.error(a, b);
|
9658 | }
|
9659 | };
|
9660 |
|
9661 |
|
9662 | }),
|
9663 |
|
9664 | (function(module, exports) {
|
9665 |
|
9666 | var Queue = function () {
|
9667 | this.head = null;
|
9668 | this.tail = null;
|
9669 | };
|
9670 |
|
9671 | Queue.prototype = {
|
9672 | add: function (item) {
|
9673 | var entry = { item: item, next: null };
|
9674 | if (this.head) this.tail.next = entry;
|
9675 | else this.head = entry;
|
9676 | this.tail = entry;
|
9677 | },
|
9678 | get: function () {
|
9679 | var entry = this.head;
|
9680 | if (entry) {
|
9681 | this.head = entry.next;
|
9682 | if (this.tail === entry) this.tail = null;
|
9683 | return entry.item;
|
9684 | }
|
9685 | }
|
9686 | };
|
9687 |
|
9688 | module.exports = Queue;
|
9689 |
|
9690 |
|
9691 | }),
|
9692 |
|
9693 | (function(module, exports) {
|
9694 |
|
9695 | module.exports = typeof window == 'object' && typeof Deno != 'object';
|
9696 |
|
9697 |
|
9698 | }),
|
9699 |
|
9700 | (function(module, exports, __webpack_require__) {
|
9701 |
|
9702 | "use strict";
|
9703 |
|
9704 | var $ = __webpack_require__(0);
|
9705 | var call = __webpack_require__(15);
|
9706 | var aCallable = __webpack_require__(29);
|
9707 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9708 | var perform = __webpack_require__(84);
|
9709 | var iterate = __webpack_require__(41);
|
9710 | var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(176);
|
9711 |
|
9712 |
|
9713 |
|
9714 | $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
|
9715 | all: function all(iterable) {
|
9716 | var C = this;
|
9717 | var capability = newPromiseCapabilityModule.f(C);
|
9718 | var resolve = capability.resolve;
|
9719 | var reject = capability.reject;
|
9720 | var result = perform(function () {
|
9721 | var $promiseResolve = aCallable(C.resolve);
|
9722 | var values = [];
|
9723 | var counter = 0;
|
9724 | var remaining = 1;
|
9725 | iterate(iterable, function (promise) {
|
9726 | var index = counter++;
|
9727 | var alreadyCalled = false;
|
9728 | remaining++;
|
9729 | call($promiseResolve, C, promise).then(function (value) {
|
9730 | if (alreadyCalled) return;
|
9731 | alreadyCalled = true;
|
9732 | values[index] = value;
|
9733 | --remaining || resolve(values);
|
9734 | }, reject);
|
9735 | });
|
9736 | --remaining || resolve(values);
|
9737 | });
|
9738 | if (result.error) reject(result.value);
|
9739 | return capability.promise;
|
9740 | }
|
9741 | });
|
9742 |
|
9743 |
|
9744 | }),
|
9745 |
|
9746 | (function(module, exports, __webpack_require__) {
|
9747 |
|
9748 | "use strict";
|
9749 |
|
9750 | var $ = __webpack_require__(0);
|
9751 | var IS_PURE = __webpack_require__(36);
|
9752 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(85).CONSTRUCTOR;
|
9753 | var NativePromiseConstructor = __webpack_require__(69);
|
9754 | var getBuiltIn = __webpack_require__(20);
|
9755 | var isCallable = __webpack_require__(9);
|
9756 | var defineBuiltIn = __webpack_require__(45);
|
9757 |
|
9758 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
9759 |
|
9760 |
|
9761 |
|
9762 | $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
|
9763 | 'catch': function (onRejected) {
|
9764 | return this.then(undefined, onRejected);
|
9765 | }
|
9766 | });
|
9767 |
|
9768 |
|
9769 | if (!IS_PURE && isCallable(NativePromiseConstructor)) {
|
9770 | var method = getBuiltIn('Promise').prototype['catch'];
|
9771 | if (NativePromisePrototype['catch'] !== method) {
|
9772 | defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
|
9773 | }
|
9774 | }
|
9775 |
|
9776 |
|
9777 | }),
|
9778 |
|
9779 | (function(module, exports, __webpack_require__) {
|
9780 |
|
9781 | "use strict";
|
9782 |
|
9783 | var $ = __webpack_require__(0);
|
9784 | var call = __webpack_require__(15);
|
9785 | var aCallable = __webpack_require__(29);
|
9786 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9787 | var perform = __webpack_require__(84);
|
9788 | var iterate = __webpack_require__(41);
|
9789 | var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(176);
|
9790 |
|
9791 |
|
9792 |
|
9793 | $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
|
9794 | race: function race(iterable) {
|
9795 | var C = this;
|
9796 | var capability = newPromiseCapabilityModule.f(C);
|
9797 | var reject = capability.reject;
|
9798 | var result = perform(function () {
|
9799 | var $promiseResolve = aCallable(C.resolve);
|
9800 | iterate(iterable, function (promise) {
|
9801 | call($promiseResolve, C, promise).then(capability.resolve, reject);
|
9802 | });
|
9803 | });
|
9804 | if (result.error) reject(result.value);
|
9805 | return capability.promise;
|
9806 | }
|
9807 | });
|
9808 |
|
9809 |
|
9810 | }),
|
9811 |
|
9812 | (function(module, exports, __webpack_require__) {
|
9813 |
|
9814 | "use strict";
|
9815 |
|
9816 | var $ = __webpack_require__(0);
|
9817 | var call = __webpack_require__(15);
|
9818 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9819 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(85).CONSTRUCTOR;
|
9820 |
|
9821 |
|
9822 |
|
9823 | $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
9824 | reject: function reject(r) {
|
9825 | var capability = newPromiseCapabilityModule.f(this);
|
9826 | call(capability.reject, undefined, r);
|
9827 | return capability.promise;
|
9828 | }
|
9829 | });
|
9830 |
|
9831 |
|
9832 | }),
|
9833 |
|
9834 | (function(module, exports, __webpack_require__) {
|
9835 |
|
9836 | "use strict";
|
9837 |
|
9838 | var $ = __webpack_require__(0);
|
9839 | var getBuiltIn = __webpack_require__(20);
|
9840 | var IS_PURE = __webpack_require__(36);
|
9841 | var NativePromiseConstructor = __webpack_require__(69);
|
9842 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(85).CONSTRUCTOR;
|
9843 | var promiseResolve = __webpack_require__(178);
|
9844 |
|
9845 | var PromiseConstructorWrapper = getBuiltIn('Promise');
|
9846 | var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
|
9847 |
|
9848 |
|
9849 |
|
9850 | $({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
|
9851 | resolve: function resolve(x) {
|
9852 | return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
|
9853 | }
|
9854 | });
|
9855 |
|
9856 |
|
9857 | }),
|
9858 |
|
9859 | (function(module, exports, __webpack_require__) {
|
9860 |
|
9861 | "use strict";
|
9862 |
|
9863 | var $ = __webpack_require__(0);
|
9864 | var call = __webpack_require__(15);
|
9865 | var aCallable = __webpack_require__(29);
|
9866 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9867 | var perform = __webpack_require__(84);
|
9868 | var iterate = __webpack_require__(41);
|
9869 |
|
9870 |
|
9871 |
|
9872 | $({ target: 'Promise', stat: true }, {
|
9873 | allSettled: function allSettled(iterable) {
|
9874 | var C = this;
|
9875 | var capability = newPromiseCapabilityModule.f(C);
|
9876 | var resolve = capability.resolve;
|
9877 | var reject = capability.reject;
|
9878 | var result = perform(function () {
|
9879 | var promiseResolve = aCallable(C.resolve);
|
9880 | var values = [];
|
9881 | var counter = 0;
|
9882 | var remaining = 1;
|
9883 | iterate(iterable, function (promise) {
|
9884 | var index = counter++;
|
9885 | var alreadyCalled = false;
|
9886 | remaining++;
|
9887 | call(promiseResolve, C, promise).then(function (value) {
|
9888 | if (alreadyCalled) return;
|
9889 | alreadyCalled = true;
|
9890 | values[index] = { status: 'fulfilled', value: value };
|
9891 | --remaining || resolve(values);
|
9892 | }, function (error) {
|
9893 | if (alreadyCalled) return;
|
9894 | alreadyCalled = true;
|
9895 | values[index] = { status: 'rejected', reason: error };
|
9896 | --remaining || resolve(values);
|
9897 | });
|
9898 | });
|
9899 | --remaining || resolve(values);
|
9900 | });
|
9901 | if (result.error) reject(result.value);
|
9902 | return capability.promise;
|
9903 | }
|
9904 | });
|
9905 |
|
9906 |
|
9907 | }),
|
9908 |
|
9909 | (function(module, exports, __webpack_require__) {
|
9910 |
|
9911 | "use strict";
|
9912 |
|
9913 | var $ = __webpack_require__(0);
|
9914 | var call = __webpack_require__(15);
|
9915 | var aCallable = __webpack_require__(29);
|
9916 | var getBuiltIn = __webpack_require__(20);
|
9917 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9918 | var perform = __webpack_require__(84);
|
9919 | var iterate = __webpack_require__(41);
|
9920 |
|
9921 | var PROMISE_ANY_ERROR = 'No one promise resolved';
|
9922 |
|
9923 |
|
9924 |
|
9925 | $({ target: 'Promise', stat: true }, {
|
9926 | any: function any(iterable) {
|
9927 | var C = this;
|
9928 | var AggregateError = getBuiltIn('AggregateError');
|
9929 | var capability = newPromiseCapabilityModule.f(C);
|
9930 | var resolve = capability.resolve;
|
9931 | var reject = capability.reject;
|
9932 | var result = perform(function () {
|
9933 | var promiseResolve = aCallable(C.resolve);
|
9934 | var errors = [];
|
9935 | var counter = 0;
|
9936 | var remaining = 1;
|
9937 | var alreadyResolved = false;
|
9938 | iterate(iterable, function (promise) {
|
9939 | var index = counter++;
|
9940 | var alreadyRejected = false;
|
9941 | remaining++;
|
9942 | call(promiseResolve, C, promise).then(function (value) {
|
9943 | if (alreadyRejected || alreadyResolved) return;
|
9944 | alreadyResolved = true;
|
9945 | resolve(value);
|
9946 | }, function (error) {
|
9947 | if (alreadyRejected || alreadyResolved) return;
|
9948 | alreadyRejected = true;
|
9949 | errors[index] = error;
|
9950 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
9951 | });
|
9952 | });
|
9953 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
9954 | });
|
9955 | if (result.error) reject(result.value);
|
9956 | return capability.promise;
|
9957 | }
|
9958 | });
|
9959 |
|
9960 |
|
9961 | }),
|
9962 |
|
9963 | (function(module, exports, __webpack_require__) {
|
9964 |
|
9965 | "use strict";
|
9966 |
|
9967 | var $ = __webpack_require__(0);
|
9968 | var IS_PURE = __webpack_require__(36);
|
9969 | var NativePromiseConstructor = __webpack_require__(69);
|
9970 | var fails = __webpack_require__(2);
|
9971 | var getBuiltIn = __webpack_require__(20);
|
9972 | var isCallable = __webpack_require__(9);
|
9973 | var speciesConstructor = __webpack_require__(172);
|
9974 | var promiseResolve = __webpack_require__(178);
|
9975 | var defineBuiltIn = __webpack_require__(45);
|
9976 |
|
9977 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
9978 |
|
9979 |
|
9980 | var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
|
9981 |
|
9982 | NativePromisePrototype['finally'].call({ then: function () { } }, function () { });
|
9983 | });
|
9984 |
|
9985 |
|
9986 |
|
9987 | $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
|
9988 | 'finally': function (onFinally) {
|
9989 | var C = speciesConstructor(this, getBuiltIn('Promise'));
|
9990 | var isFunction = isCallable(onFinally);
|
9991 | return this.then(
|
9992 | isFunction ? function (x) {
|
9993 | return promiseResolve(C, onFinally()).then(function () { return x; });
|
9994 | } : onFinally,
|
9995 | isFunction ? function (e) {
|
9996 | return promiseResolve(C, onFinally()).then(function () { throw e; });
|
9997 | } : onFinally
|
9998 | );
|
9999 | }
|
10000 | });
|
10001 |
|
10002 |
|
10003 | if (!IS_PURE && isCallable(NativePromiseConstructor)) {
|
10004 | var method = getBuiltIn('Promise').prototype['finally'];
|
10005 | if (NativePromisePrototype['finally'] !== method) {
|
10006 | defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
|
10007 | }
|
10008 | }
|
10009 |
|
10010 |
|
10011 | }),
|
10012 |
|
10013 | (function(module, exports, __webpack_require__) {
|
10014 |
|
10015 | var uncurryThis = __webpack_require__(4);
|
10016 | var toIntegerOrInfinity = __webpack_require__(127);
|
10017 | var toString = __webpack_require__(42);
|
10018 | var requireObjectCoercible = __webpack_require__(81);
|
10019 |
|
10020 | var charAt = uncurryThis(''.charAt);
|
10021 | var charCodeAt = uncurryThis(''.charCodeAt);
|
10022 | var stringSlice = uncurryThis(''.slice);
|
10023 |
|
10024 | var createMethod = function (CONVERT_TO_STRING) {
|
10025 | return function ($this, pos) {
|
10026 | var S = toString(requireObjectCoercible($this));
|
10027 | var position = toIntegerOrInfinity(pos);
|
10028 | var size = S.length;
|
10029 | var first, second;
|
10030 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
10031 | first = charCodeAt(S, position);
|
10032 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
10033 | || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
10034 | ? CONVERT_TO_STRING
|
10035 | ? charAt(S, position)
|
10036 | : first
|
10037 | : CONVERT_TO_STRING
|
10038 | ? stringSlice(S, position, position + 2)
|
10039 | : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
10040 | };
|
10041 | };
|
10042 |
|
10043 | module.exports = {
|
10044 |
|
10045 |
|
10046 | codeAt: createMethod(false),
|
10047 |
|
10048 |
|
10049 | charAt: createMethod(true)
|
10050 | };
|
10051 |
|
10052 |
|
10053 | }),
|
10054 |
|
10055 | (function(module, exports) {
|
10056 |
|
10057 |
|
10058 |
|
10059 | module.exports = {
|
10060 | CSSRuleList: 0,
|
10061 | CSSStyleDeclaration: 0,
|
10062 | CSSValueList: 0,
|
10063 | ClientRectList: 0,
|
10064 | DOMRectList: 0,
|
10065 | DOMStringList: 0,
|
10066 | DOMTokenList: 1,
|
10067 | DataTransferItemList: 0,
|
10068 | FileList: 0,
|
10069 | HTMLAllCollection: 0,
|
10070 | HTMLCollection: 0,
|
10071 | HTMLFormElement: 0,
|
10072 | HTMLSelectElement: 0,
|
10073 | MediaList: 0,
|
10074 | MimeTypeArray: 0,
|
10075 | NamedNodeMap: 0,
|
10076 | NodeList: 1,
|
10077 | PaintRequestList: 0,
|
10078 | Plugin: 0,
|
10079 | PluginArray: 0,
|
10080 | SVGLengthList: 0,
|
10081 | SVGNumberList: 0,
|
10082 | SVGPathSegList: 0,
|
10083 | SVGPointList: 0,
|
10084 | SVGStringList: 0,
|
10085 | SVGTransformList: 0,
|
10086 | SourceBufferList: 0,
|
10087 | StyleSheetList: 0,
|
10088 | TextTrackCueList: 0,
|
10089 | TextTrackList: 0,
|
10090 | TouchList: 0
|
10091 | };
|
10092 |
|
10093 |
|
10094 | }),
|
10095 |
|
10096 | (function(module, __webpack_exports__, __webpack_require__) {
|
10097 |
|
10098 | "use strict";
|
10099 | var __WEBPACK_IMPORTED_MODULE_0__index_js__ = __webpack_require__(134);
|
10100 |
|
10101 |
|
10102 |
|
10103 |
|
10104 |
|
10105 |
|
10106 |
|
10107 |
|
10108 |
|
10109 |
|
10110 |
|
10111 |
|
10112 |
|
10113 |
|
10114 |
|
10115 |
|
10116 |
|
10117 |
|
10118 |
|
10119 |
|
10120 |
|
10121 |
|
10122 | var _ = Object(__WEBPACK_IMPORTED_MODULE_0__index_js__["mixin"])(__WEBPACK_IMPORTED_MODULE_0__index_js__);
|
10123 |
|
10124 | _._ = _;
|
10125 |
|
10126 | __webpack_exports__["a"] = (_);
|
10127 |
|
10128 |
|
10129 | }),
|
10130 |
|
10131 | (function(module, __webpack_exports__, __webpack_require__) {
|
10132 |
|
10133 | "use strict";
|
10134 | __webpack_exports__["a"] = isNull;
|
10135 |
|
10136 | function isNull(obj) {
|
10137 | return obj === null;
|
10138 | }
|
10139 |
|
10140 |
|
10141 | }),
|
10142 |
|
10143 | (function(module, __webpack_exports__, __webpack_require__) {
|
10144 |
|
10145 | "use strict";
|
10146 | __webpack_exports__["a"] = isElement;
|
10147 |
|
10148 | function isElement(obj) {
|
10149 | return !!(obj && obj.nodeType === 1);
|
10150 | }
|
10151 |
|
10152 |
|
10153 | }),
|
10154 |
|
10155 | (function(module, __webpack_exports__, __webpack_require__) {
|
10156 |
|
10157 | "use strict";
|
10158 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10159 |
|
10160 |
|
10161 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Date'));
|
10162 |
|
10163 |
|
10164 | }),
|
10165 |
|
10166 | (function(module, __webpack_exports__, __webpack_require__) {
|
10167 |
|
10168 | "use strict";
|
10169 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10170 |
|
10171 |
|
10172 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('RegExp'));
|
10173 |
|
10174 |
|
10175 | }),
|
10176 |
|
10177 | (function(module, __webpack_exports__, __webpack_require__) {
|
10178 |
|
10179 | "use strict";
|
10180 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10181 |
|
10182 |
|
10183 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Error'));
|
10184 |
|
10185 |
|
10186 | }),
|
10187 |
|
10188 | (function(module, __webpack_exports__, __webpack_require__) {
|
10189 |
|
10190 | "use strict";
|
10191 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10192 |
|
10193 |
|
10194 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Object'));
|
10195 |
|
10196 |
|
10197 | }),
|
10198 |
|
10199 | (function(module, __webpack_exports__, __webpack_require__) {
|
10200 |
|
10201 | "use strict";
|
10202 | __webpack_exports__["a"] = isFinite;
|
10203 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
10204 | var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(182);
|
10205 |
|
10206 |
|
10207 |
|
10208 |
|
10209 | function isFinite(obj) {
|
10210 | return !Object(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["f" ])(obj) && !isNaN(parseFloat(obj));
|
10211 | }
|
10212 |
|
10213 |
|
10214 | }),
|
10215 |
|
10216 | (function(module, __webpack_exports__, __webpack_require__) {
|
10217 |
|
10218 | "use strict";
|
10219 | var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(187);
|
10220 | var __WEBPACK_IMPORTED_MODULE_1__getByteLength_js__ = __webpack_require__(138);
|
10221 |
|
10222 |
|
10223 |
|
10224 |
|
10225 |
|
10226 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__getByteLength_js__["a" ]));
|
10227 |
|
10228 |
|
10229 | }),
|
10230 |
|
10231 | (function(module, __webpack_exports__, __webpack_require__) {
|
10232 |
|
10233 | "use strict";
|
10234 | __webpack_exports__["a"] = isEmpty;
|
10235 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
10236 | var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(59);
|
10237 | var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(135);
|
10238 | var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(137);
|
10239 | var __WEBPACK_IMPORTED_MODULE_4__keys_js__ = __webpack_require__(17);
|
10240 |
|
10241 |
|
10242 |
|
10243 |
|
10244 |
|
10245 |
|
10246 |
|
10247 |
|
10248 | function isEmpty(obj) {
|
10249 | if (obj == null) return true;
|
10250 |
|
10251 |
|
10252 | var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(obj);
|
10253 | if (typeof length == 'number' && (
|
10254 | Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" ])(obj) || Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" ])(obj) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" ])(obj)
|
10255 | )) return length === 0;
|
10256 | return Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_4__keys_js__["a" ])(obj)) === 0;
|
10257 | }
|
10258 |
|
10259 |
|
10260 | }),
|
10261 |
|
10262 | (function(module, __webpack_exports__, __webpack_require__) {
|
10263 |
|
10264 | "use strict";
|
10265 | __webpack_exports__["a"] = isEqual;
|
10266 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
10267 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
10268 | var __WEBPACK_IMPORTED_MODULE_2__getByteLength_js__ = __webpack_require__(138);
|
10269 | var __WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__ = __webpack_require__(185);
|
10270 | var __WEBPACK_IMPORTED_MODULE_4__isFunction_js__ = __webpack_require__(30);
|
10271 | var __WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__ = __webpack_require__(86);
|
10272 | var __WEBPACK_IMPORTED_MODULE_6__isDataView_js__ = __webpack_require__(136);
|
10273 | var __WEBPACK_IMPORTED_MODULE_7__keys_js__ = __webpack_require__(17);
|
10274 | var __WEBPACK_IMPORTED_MODULE_8__has_js__ = __webpack_require__(47);
|
10275 | var __WEBPACK_IMPORTED_MODULE_9__toBufferView_js__ = __webpack_require__(332);
|
10276 |
|
10277 |
|
10278 |
|
10279 |
|
10280 |
|
10281 |
|
10282 |
|
10283 |
|
10284 |
|
10285 |
|
10286 |
|
10287 |
|
10288 | var tagDataView = '[object DataView]';
|
10289 |
|
10290 |
|
10291 | function eq(a, b, aStack, bStack) {
|
10292 |
|
10293 |
|
10294 | if (a === b) return a !== 0 || 1 / a === 1 / b;
|
10295 |
|
10296 | if (a == null || b == null) return false;
|
10297 |
|
10298 | if (a !== a) return b !== b;
|
10299 |
|
10300 | var type = typeof a;
|
10301 | if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
|
10302 | return deepEq(a, b, aStack, bStack);
|
10303 | }
|
10304 |
|
10305 |
|
10306 | function deepEq(a, b, aStack, bStack) {
|
10307 |
|
10308 | if (a instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ]) a = a._wrapped;
|
10309 | if (b instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ]) b = b._wrapped;
|
10310 |
|
10311 | var className = __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" ].call(a);
|
10312 | if (className !== __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" ].call(b)) return false;
|
10313 |
|
10314 | if (__WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__["a" ] && className == '[object Object]' && Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" ])(a)) {
|
10315 | if (!Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" ])(b)) return false;
|
10316 | className = tagDataView;
|
10317 | }
|
10318 | switch (className) {
|
10319 |
|
10320 | case '[object RegExp]':
|
10321 |
|
10322 | case '[object String]':
|
10323 |
|
10324 |
|
10325 | return '' + a === '' + b;
|
10326 | case '[object Number]':
|
10327 |
|
10328 |
|
10329 | if (+a !== +a) return +b !== +b;
|
10330 |
|
10331 | return +a === 0 ? 1 / +a === 1 / b : +a === +b;
|
10332 | case '[object Date]':
|
10333 | case '[object Boolean]':
|
10334 |
|
10335 |
|
10336 |
|
10337 | return +a === +b;
|
10338 | case '[object Symbol]':
|
10339 | return __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" ].valueOf.call(a) === __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" ].valueOf.call(b);
|
10340 | case '[object ArrayBuffer]':
|
10341 | case tagDataView:
|
10342 |
|
10343 | return deepEq(Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" ])(a), Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" ])(b), aStack, bStack);
|
10344 | }
|
10345 |
|
10346 | var areArrays = className === '[object Array]';
|
10347 | if (!areArrays && Object(__WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__["a" ])(a)) {
|
10348 | var byteLength = Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" ])(a);
|
10349 | if (byteLength !== Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" ])(b)) return false;
|
10350 | if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
|
10351 | areArrays = true;
|
10352 | }
|
10353 | if (!areArrays) {
|
10354 | if (typeof a != 'object' || typeof b != 'object') return false;
|
10355 |
|
10356 |
|
10357 |
|
10358 | var aCtor = a.constructor, bCtor = b.constructor;
|
10359 | if (aCtor !== bCtor && !(Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" ])(aCtor) && aCtor instanceof aCtor &&
|
10360 | Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" ])(bCtor) && bCtor instanceof bCtor)
|
10361 | && ('constructor' in a && 'constructor' in b)) {
|
10362 | return false;
|
10363 | }
|
10364 | }
|
10365 |
|
10366 |
|
10367 |
|
10368 |
|
10369 |
|
10370 | aStack = aStack || [];
|
10371 | bStack = bStack || [];
|
10372 | var length = aStack.length;
|
10373 | while (length--) {
|
10374 |
|
10375 |
|
10376 | if (aStack[length] === a) return bStack[length] === b;
|
10377 | }
|
10378 |
|
10379 |
|
10380 | aStack.push(a);
|
10381 | bStack.push(b);
|
10382 |
|
10383 |
|
10384 | if (areArrays) {
|
10385 |
|
10386 | length = a.length;
|
10387 | if (length !== b.length) return false;
|
10388 |
|
10389 | while (length--) {
|
10390 | if (!eq(a[length], b[length], aStack, bStack)) return false;
|
10391 | }
|
10392 | } else {
|
10393 |
|
10394 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" ])(a), key;
|
10395 | length = _keys.length;
|
10396 |
|
10397 | if (Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" ])(b).length !== length) return false;
|
10398 | while (length--) {
|
10399 |
|
10400 | key = _keys[length];
|
10401 | if (!(Object(__WEBPACK_IMPORTED_MODULE_8__has_js__["a" ])(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
|
10402 | }
|
10403 | }
|
10404 |
|
10405 | aStack.pop();
|
10406 | bStack.pop();
|
10407 | return true;
|
10408 | }
|
10409 |
|
10410 |
|
10411 | function isEqual(a, b) {
|
10412 | return eq(a, b);
|
10413 | }
|
10414 |
|
10415 |
|
10416 | }),
|
10417 |
|
10418 | (function(module, __webpack_exports__, __webpack_require__) {
|
10419 |
|
10420 | "use strict";
|
10421 | __webpack_exports__["a"] = toBufferView;
|
10422 | var __WEBPACK_IMPORTED_MODULE_0__getByteLength_js__ = __webpack_require__(138);
|
10423 |
|
10424 |
|
10425 |
|
10426 |
|
10427 | function toBufferView(bufferSource) {
|
10428 | return new Uint8Array(
|
10429 | bufferSource.buffer || bufferSource,
|
10430 | bufferSource.byteOffset || 0,
|
10431 | Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__["a" ])(bufferSource)
|
10432 | );
|
10433 | }
|
10434 |
|
10435 |
|
10436 | }),
|
10437 |
|
10438 | (function(module, __webpack_exports__, __webpack_require__) {
|
10439 |
|
10440 | "use strict";
|
10441 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10442 | var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(86);
|
10443 | var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(139);
|
10444 |
|
10445 |
|
10446 |
|
10447 |
|
10448 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" ] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" ])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["b" ]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Map'));
|
10449 |
|
10450 |
|
10451 | }),
|
10452 |
|
10453 | (function(module, __webpack_exports__, __webpack_require__) {
|
10454 |
|
10455 | "use strict";
|
10456 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10457 | var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(86);
|
10458 | var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(139);
|
10459 |
|
10460 |
|
10461 |
|
10462 |
|
10463 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" ] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" ])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["d" ]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('WeakMap'));
|
10464 |
|
10465 |
|
10466 | }),
|
10467 |
|
10468 | (function(module, __webpack_exports__, __webpack_require__) {
|
10469 |
|
10470 | "use strict";
|
10471 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10472 | var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(86);
|
10473 | var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(139);
|
10474 |
|
10475 |
|
10476 |
|
10477 |
|
10478 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" ] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" ])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["c" ]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Set'));
|
10479 |
|
10480 |
|
10481 | }),
|
10482 |
|
10483 | (function(module, __webpack_exports__, __webpack_require__) {
|
10484 |
|
10485 | "use strict";
|
10486 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10487 |
|
10488 |
|
10489 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('WeakSet'));
|
10490 |
|
10491 |
|
10492 | }),
|
10493 |
|
10494 | (function(module, __webpack_exports__, __webpack_require__) {
|
10495 |
|
10496 | "use strict";
|
10497 | __webpack_exports__["a"] = pairs;
|
10498 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(17);
|
10499 |
|
10500 |
|
10501 |
|
10502 |
|
10503 | function pairs(obj) {
|
10504 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(obj);
|
10505 | var length = _keys.length;
|
10506 | var pairs = Array(length);
|
10507 | for (var i = 0; i < length; i++) {
|
10508 | pairs[i] = [_keys[i], obj[_keys[i]]];
|
10509 | }
|
10510 | return pairs;
|
10511 | }
|
10512 |
|
10513 |
|
10514 | }),
|
10515 |
|
10516 | (function(module, __webpack_exports__, __webpack_require__) {
|
10517 |
|
10518 | "use strict";
|
10519 | __webpack_exports__["a"] = create;
|
10520 | var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(195);
|
10521 | var __WEBPACK_IMPORTED_MODULE_1__extendOwn_js__ = __webpack_require__(141);
|
10522 |
|
10523 |
|
10524 |
|
10525 |
|
10526 |
|
10527 |
|
10528 | function create(prototype, props) {
|
10529 | var result = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" ])(prototype);
|
10530 | if (props) Object(__WEBPACK_IMPORTED_MODULE_1__extendOwn_js__["a" ])(result, props);
|
10531 | return result;
|
10532 | }
|
10533 |
|
10534 |
|
10535 | }),
|
10536 |
|
10537 | (function(module, __webpack_exports__, __webpack_require__) {
|
10538 |
|
10539 | "use strict";
|
10540 | __webpack_exports__["a"] = tap;
|
10541 |
|
10542 |
|
10543 |
|
10544 | function tap(obj, interceptor) {
|
10545 | interceptor(obj);
|
10546 | return obj;
|
10547 | }
|
10548 |
|
10549 |
|
10550 | }),
|
10551 |
|
10552 | (function(module, __webpack_exports__, __webpack_require__) {
|
10553 |
|
10554 | "use strict";
|
10555 | __webpack_exports__["a"] = has;
|
10556 | var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(47);
|
10557 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(88);
|
10558 |
|
10559 |
|
10560 |
|
10561 |
|
10562 |
|
10563 |
|
10564 | function has(obj, path) {
|
10565 | path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" ])(path);
|
10566 | var length = path.length;
|
10567 | for (var i = 0; i < length; i++) {
|
10568 | var key = path[i];
|
10569 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" ])(obj, key)) return false;
|
10570 | obj = obj[key];
|
10571 | }
|
10572 | return !!length;
|
10573 | }
|
10574 |
|
10575 |
|
10576 | }),
|
10577 |
|
10578 | (function(module, __webpack_exports__, __webpack_require__) {
|
10579 |
|
10580 | "use strict";
|
10581 | __webpack_exports__["a"] = mapObject;
|
10582 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
10583 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(17);
|
10584 |
|
10585 |
|
10586 |
|
10587 |
|
10588 |
|
10589 | function mapObject(obj, iteratee, context) {
|
10590 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context);
|
10591 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj),
|
10592 | length = _keys.length,
|
10593 | results = {};
|
10594 | for (var index = 0; index < length; index++) {
|
10595 | var currentKey = _keys[index];
|
10596 | results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
|
10597 | }
|
10598 | return results;
|
10599 | }
|
10600 |
|
10601 |
|
10602 | }),
|
10603 |
|
10604 | (function(module, __webpack_exports__, __webpack_require__) {
|
10605 |
|
10606 | "use strict";
|
10607 | __webpack_exports__["a"] = propertyOf;
|
10608 | var __WEBPACK_IMPORTED_MODULE_0__noop_js__ = __webpack_require__(201);
|
10609 | var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(197);
|
10610 |
|
10611 |
|
10612 |
|
10613 |
|
10614 | function propertyOf(obj) {
|
10615 | if (obj == null) return __WEBPACK_IMPORTED_MODULE_0__noop_js__["a" ];
|
10616 | return function(path) {
|
10617 | return Object(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" ])(obj, path);
|
10618 | };
|
10619 | }
|
10620 |
|
10621 |
|
10622 | }),
|
10623 |
|
10624 | (function(module, __webpack_exports__, __webpack_require__) {
|
10625 |
|
10626 | "use strict";
|
10627 | __webpack_exports__["a"] = times;
|
10628 | var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(89);
|
10629 |
|
10630 |
|
10631 |
|
10632 | function times(n, iteratee, context) {
|
10633 | var accum = Array(Math.max(0, n));
|
10634 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" ])(iteratee, context, 1);
|
10635 | for (var i = 0; i < n; i++) accum[i] = iteratee(i);
|
10636 | return accum;
|
10637 | }
|
10638 |
|
10639 |
|
10640 | }),
|
10641 |
|
10642 | (function(module, __webpack_exports__, __webpack_require__) {
|
10643 |
|
10644 | "use strict";
|
10645 | var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(203);
|
10646 | var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(204);
|
10647 |
|
10648 |
|
10649 |
|
10650 |
|
10651 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" ]));
|
10652 |
|
10653 |
|
10654 | }),
|
10655 |
|
10656 | (function(module, __webpack_exports__, __webpack_require__) {
|
10657 |
|
10658 | "use strict";
|
10659 | var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(203);
|
10660 | var __WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__ = __webpack_require__(346);
|
10661 |
|
10662 |
|
10663 |
|
10664 |
|
10665 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__["a" ]));
|
10666 |
|
10667 |
|
10668 | }),
|
10669 |
|
10670 | (function(module, __webpack_exports__, __webpack_require__) {
|
10671 |
|
10672 | "use strict";
|
10673 | var __WEBPACK_IMPORTED_MODULE_0__invert_js__ = __webpack_require__(191);
|
10674 | var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(204);
|
10675 |
|
10676 |
|
10677 |
|
10678 |
|
10679 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__invert_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" ]));
|
10680 |
|
10681 |
|
10682 | }),
|
10683 |
|
10684 | (function(module, __webpack_exports__, __webpack_require__) {
|
10685 |
|
10686 | "use strict";
|
10687 | __webpack_exports__["a"] = template;
|
10688 | var __WEBPACK_IMPORTED_MODULE_0__defaults_js__ = __webpack_require__(194);
|
10689 | var __WEBPACK_IMPORTED_MODULE_1__underscore_js__ = __webpack_require__(25);
|
10690 | var __WEBPACK_IMPORTED_MODULE_2__templateSettings_js__ = __webpack_require__(205);
|
10691 |
|
10692 |
|
10693 |
|
10694 |
|
10695 |
|
10696 |
|
10697 |
|
10698 | var noMatch = /(.)^/;
|
10699 |
|
10700 |
|
10701 |
|
10702 | var escapes = {
|
10703 | "'": "'",
|
10704 | '\\': '\\',
|
10705 | '\r': 'r',
|
10706 | '\n': 'n',
|
10707 | '\u2028': 'u2028',
|
10708 | '\u2029': 'u2029'
|
10709 | };
|
10710 |
|
10711 | var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
|
10712 |
|
10713 | function escapeChar(match) {
|
10714 | return '\\' + escapes[match];
|
10715 | }
|
10716 |
|
10717 | var bareIdentifier = /^\s*(\w|\$)+\s*$/;
|
10718 |
|
10719 |
|
10720 |
|
10721 |
|
10722 |
|
10723 | function template(text, settings, oldSettings) {
|
10724 | if (!settings && oldSettings) settings = oldSettings;
|
10725 | settings = Object(__WEBPACK_IMPORTED_MODULE_0__defaults_js__["a" ])({}, settings, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" ].templateSettings);
|
10726 |
|
10727 |
|
10728 | var matcher = RegExp([
|
10729 | (settings.escape || noMatch).source,
|
10730 | (settings.interpolate || noMatch).source,
|
10731 | (settings.evaluate || noMatch).source
|
10732 | ].join('|') + '|$', 'g');
|
10733 |
|
10734 |
|
10735 | var index = 0;
|
10736 | var source = "__p+='";
|
10737 | text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
|
10738 | source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
|
10739 | index = offset + match.length;
|
10740 |
|
10741 | if (escape) {
|
10742 | source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
|
10743 | } else if (interpolate) {
|
10744 | source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
|
10745 | } else if (evaluate) {
|
10746 | source += "';\n" + evaluate + "\n__p+='";
|
10747 | }
|
10748 |
|
10749 |
|
10750 | return match;
|
10751 | });
|
10752 | source += "';\n";
|
10753 |
|
10754 | var argument = settings.variable;
|
10755 | if (argument) {
|
10756 | if (!bareIdentifier.test(argument)) throw new Error(argument);
|
10757 | } else {
|
10758 |
|
10759 | source = 'with(obj||{}){\n' + source + '}\n';
|
10760 | argument = 'obj';
|
10761 | }
|
10762 |
|
10763 | source = "var __t,__p='',__j=Array.prototype.join," +
|
10764 | "print=function(){__p+=__j.call(arguments,'');};\n" +
|
10765 | source + 'return __p;\n';
|
10766 |
|
10767 | var render;
|
10768 | try {
|
10769 | render = new Function(argument, '_', source);
|
10770 | } catch (e) {
|
10771 | e.source = source;
|
10772 | throw e;
|
10773 | }
|
10774 |
|
10775 | var template = function(data) {
|
10776 | return render.call(this, data, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" ]);
|
10777 | };
|
10778 |
|
10779 |
|
10780 | template.source = 'function(' + argument + '){\n' + source + '}';
|
10781 |
|
10782 | return template;
|
10783 | }
|
10784 |
|
10785 |
|
10786 | }),
|
10787 |
|
10788 | (function(module, __webpack_exports__, __webpack_require__) {
|
10789 |
|
10790 | "use strict";
|
10791 | __webpack_exports__["a"] = result;
|
10792 | var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(30);
|
10793 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(88);
|
10794 |
|
10795 |
|
10796 |
|
10797 |
|
10798 |
|
10799 |
|
10800 | function result(obj, path, fallback) {
|
10801 | path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" ])(path);
|
10802 | var length = path.length;
|
10803 | if (!length) {
|
10804 | return Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" ])(fallback) ? fallback.call(obj) : fallback;
|
10805 | }
|
10806 | for (var i = 0; i < length; i++) {
|
10807 | var prop = obj == null ? void 0 : obj[path[i]];
|
10808 | if (prop === void 0) {
|
10809 | prop = fallback;
|
10810 | i = length;
|
10811 | }
|
10812 | obj = Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" ])(prop) ? prop.call(obj) : prop;
|
10813 | }
|
10814 | return obj;
|
10815 | }
|
10816 |
|
10817 |
|
10818 | }),
|
10819 |
|
10820 | (function(module, __webpack_exports__, __webpack_require__) {
|
10821 |
|
10822 | "use strict";
|
10823 | __webpack_exports__["a"] = uniqueId;
|
10824 |
|
10825 |
|
10826 | var idCounter = 0;
|
10827 | function uniqueId(prefix) {
|
10828 | var id = ++idCounter + '';
|
10829 | return prefix ? prefix + id : id;
|
10830 | }
|
10831 |
|
10832 |
|
10833 | }),
|
10834 |
|
10835 | (function(module, __webpack_exports__, __webpack_require__) {
|
10836 |
|
10837 | "use strict";
|
10838 | __webpack_exports__["a"] = chain;
|
10839 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
10840 |
|
10841 |
|
10842 |
|
10843 | function chain(obj) {
|
10844 | var instance = Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ])(obj);
|
10845 | instance._chain = true;
|
10846 | return instance;
|
10847 | }
|
10848 |
|
10849 |
|
10850 | }),
|
10851 |
|
10852 | (function(module, __webpack_exports__, __webpack_require__) {
|
10853 |
|
10854 | "use strict";
|
10855 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
10856 | var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(72);
|
10857 | var __WEBPACK_IMPORTED_MODULE_2__bind_js__ = __webpack_require__(207);
|
10858 |
|
10859 |
|
10860 |
|
10861 |
|
10862 |
|
10863 |
|
10864 |
|
10865 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, keys) {
|
10866 | keys = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" ])(keys, false, false);
|
10867 | var index = keys.length;
|
10868 | if (index < 1) throw new Error('bindAll must be passed function names');
|
10869 | while (index--) {
|
10870 | var key = keys[index];
|
10871 | obj[key] = Object(__WEBPACK_IMPORTED_MODULE_2__bind_js__["a" ])(obj[key], obj);
|
10872 | }
|
10873 | return obj;
|
10874 | }));
|
10875 |
|
10876 |
|
10877 | }),
|
10878 |
|
10879 | (function(module, __webpack_exports__, __webpack_require__) {
|
10880 |
|
10881 | "use strict";
|
10882 | __webpack_exports__["a"] = memoize;
|
10883 | var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(47);
|
10884 |
|
10885 |
|
10886 |
|
10887 | function memoize(func, hasher) {
|
10888 | var memoize = function(key) {
|
10889 | var cache = memoize.cache;
|
10890 | var address = '' + (hasher ? hasher.apply(this, arguments) : key);
|
10891 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" ])(cache, address)) cache[address] = func.apply(this, arguments);
|
10892 | return cache[address];
|
10893 | };
|
10894 | memoize.cache = {};
|
10895 | return memoize;
|
10896 | }
|
10897 |
|
10898 |
|
10899 | }),
|
10900 |
|
10901 | (function(module, __webpack_exports__, __webpack_require__) {
|
10902 |
|
10903 | "use strict";
|
10904 | var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(114);
|
10905 | var __WEBPACK_IMPORTED_MODULE_1__delay_js__ = __webpack_require__(208);
|
10906 | var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(25);
|
10907 |
|
10908 |
|
10909 |
|
10910 |
|
10911 |
|
10912 |
|
10913 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__delay_js__["a" ], __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" ], 1));
|
10914 |
|
10915 |
|
10916 | }),
|
10917 |
|
10918 | (function(module, __webpack_exports__, __webpack_require__) {
|
10919 |
|
10920 | "use strict";
|
10921 | __webpack_exports__["a"] = throttle;
|
10922 | var __WEBPACK_IMPORTED_MODULE_0__now_js__ = __webpack_require__(145);
|
10923 |
|
10924 |
|
10925 |
|
10926 |
|
10927 |
|
10928 |
|
10929 |
|
10930 | function throttle(func, wait, options) {
|
10931 | var timeout, context, args, result;
|
10932 | var previous = 0;
|
10933 | if (!options) options = {};
|
10934 |
|
10935 | var later = function() {
|
10936 | previous = options.leading === false ? 0 : Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" ])();
|
10937 | timeout = null;
|
10938 | result = func.apply(context, args);
|
10939 | if (!timeout) context = args = null;
|
10940 | };
|
10941 |
|
10942 | var throttled = function() {
|
10943 | var _now = Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" ])();
|
10944 | if (!previous && options.leading === false) previous = _now;
|
10945 | var remaining = wait - (_now - previous);
|
10946 | context = this;
|
10947 | args = arguments;
|
10948 | if (remaining <= 0 || remaining > wait) {
|
10949 | if (timeout) {
|
10950 | clearTimeout(timeout);
|
10951 | timeout = null;
|
10952 | }
|
10953 | previous = _now;
|
10954 | result = func.apply(context, args);
|
10955 | if (!timeout) context = args = null;
|
10956 | } else if (!timeout && options.trailing !== false) {
|
10957 | timeout = setTimeout(later, remaining);
|
10958 | }
|
10959 | return result;
|
10960 | };
|
10961 |
|
10962 | throttled.cancel = function() {
|
10963 | clearTimeout(timeout);
|
10964 | previous = 0;
|
10965 | timeout = context = args = null;
|
10966 | };
|
10967 |
|
10968 | return throttled;
|
10969 | }
|
10970 |
|
10971 |
|
10972 | }),
|
10973 |
|
10974 | (function(module, __webpack_exports__, __webpack_require__) {
|
10975 |
|
10976 | "use strict";
|
10977 | __webpack_exports__["a"] = debounce;
|
10978 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
10979 | var __WEBPACK_IMPORTED_MODULE_1__now_js__ = __webpack_require__(145);
|
10980 |
|
10981 |
|
10982 |
|
10983 |
|
10984 |
|
10985 |
|
10986 |
|
10987 | function debounce(func, wait, immediate) {
|
10988 | var timeout, previous, args, result, context;
|
10989 |
|
10990 | var later = function() {
|
10991 | var passed = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" ])() - previous;
|
10992 | if (wait > passed) {
|
10993 | timeout = setTimeout(later, wait - passed);
|
10994 | } else {
|
10995 | timeout = null;
|
10996 | if (!immediate) result = func.apply(context, args);
|
10997 |
|
10998 | if (!timeout) args = context = null;
|
10999 | }
|
11000 | };
|
11001 |
|
11002 | var debounced = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(_args) {
|
11003 | context = this;
|
11004 | args = _args;
|
11005 | previous = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" ])();
|
11006 | if (!timeout) {
|
11007 | timeout = setTimeout(later, wait);
|
11008 | if (immediate) result = func.apply(context, args);
|
11009 | }
|
11010 | return result;
|
11011 | });
|
11012 |
|
11013 | debounced.cancel = function() {
|
11014 | clearTimeout(timeout);
|
11015 | timeout = args = context = null;
|
11016 | };
|
11017 |
|
11018 | return debounced;
|
11019 | }
|
11020 |
|
11021 |
|
11022 | }),
|
11023 |
|
11024 | (function(module, __webpack_exports__, __webpack_require__) {
|
11025 |
|
11026 | "use strict";
|
11027 | __webpack_exports__["a"] = wrap;
|
11028 | var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(114);
|
11029 |
|
11030 |
|
11031 |
|
11032 |
|
11033 |
|
11034 | function wrap(func, wrapper) {
|
11035 | return Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" ])(wrapper, func);
|
11036 | }
|
11037 |
|
11038 |
|
11039 | }),
|
11040 |
|
11041 | (function(module, __webpack_exports__, __webpack_require__) {
|
11042 |
|
11043 | "use strict";
|
11044 | __webpack_exports__["a"] = compose;
|
11045 |
|
11046 |
|
11047 | function compose() {
|
11048 | var args = arguments;
|
11049 | var start = args.length - 1;
|
11050 | return function() {
|
11051 | var i = start;
|
11052 | var result = args[start].apply(this, arguments);
|
11053 | while (i--) result = args[i].call(this, result);
|
11054 | return result;
|
11055 | };
|
11056 | }
|
11057 |
|
11058 |
|
11059 | }),
|
11060 |
|
11061 | (function(module, __webpack_exports__, __webpack_require__) {
|
11062 |
|
11063 | "use strict";
|
11064 | __webpack_exports__["a"] = after;
|
11065 |
|
11066 | function after(times, func) {
|
11067 | return function() {
|
11068 | if (--times < 1) {
|
11069 | return func.apply(this, arguments);
|
11070 | }
|
11071 | };
|
11072 | }
|
11073 |
|
11074 |
|
11075 | }),
|
11076 |
|
11077 | (function(module, __webpack_exports__, __webpack_require__) {
|
11078 |
|
11079 | "use strict";
|
11080 | var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(114);
|
11081 | var __WEBPACK_IMPORTED_MODULE_1__before_js__ = __webpack_require__(209);
|
11082 |
|
11083 |
|
11084 |
|
11085 |
|
11086 |
|
11087 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__before_js__["a" ], 2));
|
11088 |
|
11089 |
|
11090 | }),
|
11091 |
|
11092 | (function(module, __webpack_exports__, __webpack_require__) {
|
11093 |
|
11094 | "use strict";
|
11095 | var __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__ = __webpack_require__(212);
|
11096 | var __WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__ = __webpack_require__(215);
|
11097 |
|
11098 |
|
11099 |
|
11100 |
|
11101 |
|
11102 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__["a" ])(-1, __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__["a" ]));
|
11103 |
|
11104 |
|
11105 | }),
|
11106 |
|
11107 | (function(module, __webpack_exports__, __webpack_require__) {
|
11108 |
|
11109 | "use strict";
|
11110 | __webpack_exports__["a"] = findWhere;
|
11111 | var __WEBPACK_IMPORTED_MODULE_0__find_js__ = __webpack_require__(216);
|
11112 | var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(113);
|
11113 |
|
11114 |
|
11115 |
|
11116 |
|
11117 |
|
11118 | function findWhere(obj, attrs) {
|
11119 | return Object(__WEBPACK_IMPORTED_MODULE_0__find_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" ])(attrs));
|
11120 | }
|
11121 |
|
11122 |
|
11123 | }),
|
11124 |
|
11125 | (function(module, __webpack_exports__, __webpack_require__) {
|
11126 |
|
11127 | "use strict";
|
11128 | var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(217);
|
11129 |
|
11130 |
|
11131 |
|
11132 |
|
11133 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" ])(1));
|
11134 |
|
11135 |
|
11136 | }),
|
11137 |
|
11138 | (function(module, __webpack_exports__, __webpack_require__) {
|
11139 |
|
11140 | "use strict";
|
11141 | var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(217);
|
11142 |
|
11143 |
|
11144 |
|
11145 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" ])(-1));
|
11146 |
|
11147 |
|
11148 | }),
|
11149 |
|
11150 | (function(module, __webpack_exports__, __webpack_require__) {
|
11151 |
|
11152 | "use strict";
|
11153 | __webpack_exports__["a"] = reject;
|
11154 | var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(90);
|
11155 | var __WEBPACK_IMPORTED_MODULE_1__negate_js__ = __webpack_require__(146);
|
11156 | var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(22);
|
11157 |
|
11158 |
|
11159 |
|
11160 |
|
11161 |
|
11162 | function reject(obj, predicate, context) {
|
11163 | return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__negate_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" ])(predicate)), context);
|
11164 | }
|
11165 |
|
11166 |
|
11167 | }),
|
11168 |
|
11169 | (function(module, __webpack_exports__, __webpack_require__) {
|
11170 |
|
11171 | "use strict";
|
11172 | __webpack_exports__["a"] = every;
|
11173 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
11174 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
11175 | var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(17);
|
11176 |
|
11177 |
|
11178 |
|
11179 |
|
11180 |
|
11181 | function every(obj, predicate, context) {
|
11182 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
11183 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" ])(obj),
|
11184 | length = (_keys || obj).length;
|
11185 | for (var index = 0; index < length; index++) {
|
11186 | var currentKey = _keys ? _keys[index] : index;
|
11187 | if (!predicate(obj[currentKey], currentKey, obj)) return false;
|
11188 | }
|
11189 | return true;
|
11190 | }
|
11191 |
|
11192 |
|
11193 | }),
|
11194 |
|
11195 | (function(module, __webpack_exports__, __webpack_require__) {
|
11196 |
|
11197 | "use strict";
|
11198 | __webpack_exports__["a"] = some;
|
11199 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
11200 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
11201 | var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(17);
|
11202 |
|
11203 |
|
11204 |
|
11205 |
|
11206 |
|
11207 | function some(obj, predicate, context) {
|
11208 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
11209 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" ])(obj),
|
11210 | length = (_keys || obj).length;
|
11211 | for (var index = 0; index < length; index++) {
|
11212 | var currentKey = _keys ? _keys[index] : index;
|
11213 | if (predicate(obj[currentKey], currentKey, obj)) return true;
|
11214 | }
|
11215 | return false;
|
11216 | }
|
11217 |
|
11218 |
|
11219 | }),
|
11220 |
|
11221 | (function(module, __webpack_exports__, __webpack_require__) {
|
11222 |
|
11223 | "use strict";
|
11224 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11225 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
11226 | var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(73);
|
11227 | var __WEBPACK_IMPORTED_MODULE_3__deepGet_js__ = __webpack_require__(142);
|
11228 | var __WEBPACK_IMPORTED_MODULE_4__toPath_js__ = __webpack_require__(88);
|
11229 |
|
11230 |
|
11231 |
|
11232 |
|
11233 |
|
11234 |
|
11235 |
|
11236 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, path, args) {
|
11237 | var contextPath, func;
|
11238 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(path)) {
|
11239 | func = path;
|
11240 | } else {
|
11241 | path = Object(__WEBPACK_IMPORTED_MODULE_4__toPath_js__["a" ])(path);
|
11242 | contextPath = path.slice(0, -1);
|
11243 | path = path[path.length - 1];
|
11244 | }
|
11245 | return Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" ])(obj, function(context) {
|
11246 | var method = func;
|
11247 | if (!method) {
|
11248 | if (contextPath && contextPath.length) {
|
11249 | context = Object(__WEBPACK_IMPORTED_MODULE_3__deepGet_js__["a" ])(context, contextPath);
|
11250 | }
|
11251 | if (context == null) return void 0;
|
11252 | method = context[path];
|
11253 | }
|
11254 | return method == null ? method : method.apply(context, args);
|
11255 | });
|
11256 | }));
|
11257 |
|
11258 |
|
11259 | }),
|
11260 |
|
11261 | (function(module, __webpack_exports__, __webpack_require__) {
|
11262 |
|
11263 | "use strict";
|
11264 | __webpack_exports__["a"] = where;
|
11265 | var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(90);
|
11266 | var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(113);
|
11267 |
|
11268 |
|
11269 |
|
11270 |
|
11271 |
|
11272 | function where(obj, attrs) {
|
11273 | return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" ])(attrs));
|
11274 | }
|
11275 |
|
11276 |
|
11277 | }),
|
11278 |
|
11279 | (function(module, __webpack_exports__, __webpack_require__) {
|
11280 |
|
11281 | "use strict";
|
11282 | __webpack_exports__["a"] = min;
|
11283 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
11284 | var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(71);
|
11285 | var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(22);
|
11286 | var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(60);
|
11287 |
|
11288 |
|
11289 |
|
11290 |
|
11291 |
|
11292 |
|
11293 | function min(obj, iteratee, context) {
|
11294 | var result = Infinity, lastComputed = Infinity,
|
11295 | value, computed;
|
11296 | if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
|
11297 | obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" ])(obj);
|
11298 | for (var i = 0, length = obj.length; i < length; i++) {
|
11299 | value = obj[i];
|
11300 | if (value != null && value < result) {
|
11301 | result = value;
|
11302 | }
|
11303 | }
|
11304 | } else {
|
11305 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" ])(iteratee, context);
|
11306 | Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" ])(obj, function(v, index, list) {
|
11307 | computed = iteratee(v, index, list);
|
11308 | if (computed < lastComputed || computed === Infinity && result === Infinity) {
|
11309 | result = v;
|
11310 | lastComputed = computed;
|
11311 | }
|
11312 | });
|
11313 | }
|
11314 | return result;
|
11315 | }
|
11316 |
|
11317 |
|
11318 | }),
|
11319 |
|
11320 | (function(module, __webpack_exports__, __webpack_require__) {
|
11321 |
|
11322 | "use strict";
|
11323 | __webpack_exports__["a"] = shuffle;
|
11324 | var __WEBPACK_IMPORTED_MODULE_0__sample_js__ = __webpack_require__(219);
|
11325 |
|
11326 |
|
11327 |
|
11328 | function shuffle(obj) {
|
11329 | return Object(__WEBPACK_IMPORTED_MODULE_0__sample_js__["a" ])(obj, Infinity);
|
11330 | }
|
11331 |
|
11332 |
|
11333 | }),
|
11334 |
|
11335 | (function(module, __webpack_exports__, __webpack_require__) {
|
11336 |
|
11337 | "use strict";
|
11338 | __webpack_exports__["a"] = sortBy;
|
11339 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
11340 | var __WEBPACK_IMPORTED_MODULE_1__pluck_js__ = __webpack_require__(148);
|
11341 | var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(73);
|
11342 |
|
11343 |
|
11344 |
|
11345 |
|
11346 |
|
11347 | function sortBy(obj, iteratee, context) {
|
11348 | var index = 0;
|
11349 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context);
|
11350 | return Object(__WEBPACK_IMPORTED_MODULE_1__pluck_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" ])(obj, function(value, key, list) {
|
11351 | return {
|
11352 | value: value,
|
11353 | index: index++,
|
11354 | criteria: iteratee(value, key, list)
|
11355 | };
|
11356 | }).sort(function(left, right) {
|
11357 | var a = left.criteria;
|
11358 | var b = right.criteria;
|
11359 | if (a !== b) {
|
11360 | if (a > b || a === void 0) return 1;
|
11361 | if (a < b || b === void 0) return -1;
|
11362 | }
|
11363 | return left.index - right.index;
|
11364 | }), 'value');
|
11365 | }
|
11366 |
|
11367 |
|
11368 | }),
|
11369 |
|
11370 | (function(module, __webpack_exports__, __webpack_require__) {
|
11371 |
|
11372 | "use strict";
|
11373 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(115);
|
11374 | var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(47);
|
11375 |
|
11376 |
|
11377 |
|
11378 |
|
11379 |
|
11380 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, key) {
|
11381 | if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" ])(result, key)) result[key].push(value); else result[key] = [value];
|
11382 | }));
|
11383 |
|
11384 |
|
11385 | }),
|
11386 |
|
11387 | (function(module, __webpack_exports__, __webpack_require__) {
|
11388 |
|
11389 | "use strict";
|
11390 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(115);
|
11391 |
|
11392 |
|
11393 |
|
11394 |
|
11395 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, key) {
|
11396 | result[key] = value;
|
11397 | }));
|
11398 |
|
11399 |
|
11400 | }),
|
11401 |
|
11402 | (function(module, __webpack_exports__, __webpack_require__) {
|
11403 |
|
11404 | "use strict";
|
11405 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(115);
|
11406 | var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(47);
|
11407 |
|
11408 |
|
11409 |
|
11410 |
|
11411 |
|
11412 |
|
11413 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, key) {
|
11414 | if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" ])(result, key)) result[key]++; else result[key] = 1;
|
11415 | }));
|
11416 |
|
11417 |
|
11418 | }),
|
11419 |
|
11420 | (function(module, __webpack_exports__, __webpack_require__) {
|
11421 |
|
11422 | "use strict";
|
11423 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(115);
|
11424 |
|
11425 |
|
11426 |
|
11427 |
|
11428 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, pass) {
|
11429 | result[pass ? 0 : 1].push(value);
|
11430 | }, true));
|
11431 |
|
11432 |
|
11433 | }),
|
11434 |
|
11435 | (function(module, __webpack_exports__, __webpack_require__) {
|
11436 |
|
11437 | "use strict";
|
11438 | __webpack_exports__["a"] = toArray;
|
11439 | var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(59);
|
11440 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
11441 | var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(135);
|
11442 | var __WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__ = __webpack_require__(26);
|
11443 | var __WEBPACK_IMPORTED_MODULE_4__map_js__ = __webpack_require__(73);
|
11444 | var __WEBPACK_IMPORTED_MODULE_5__identity_js__ = __webpack_require__(143);
|
11445 | var __WEBPACK_IMPORTED_MODULE_6__values_js__ = __webpack_require__(71);
|
11446 |
|
11447 |
|
11448 |
|
11449 |
|
11450 |
|
11451 |
|
11452 |
|
11453 |
|
11454 |
|
11455 | var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
|
11456 | function toArray(obj) {
|
11457 | if (!obj) return [];
|
11458 | if (Object(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" ])(obj)) return __WEBPACK_IMPORTED_MODULE_1__setup_js__["q" ].call(obj);
|
11459 | if (Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" ])(obj)) {
|
11460 |
|
11461 | return obj.match(reStrSymbol);
|
11462 | }
|
11463 | if (Object(__WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__["a" ])(obj)) return Object(__WEBPACK_IMPORTED_MODULE_4__map_js__["a" ])(obj, __WEBPACK_IMPORTED_MODULE_5__identity_js__["a" ]);
|
11464 | return Object(__WEBPACK_IMPORTED_MODULE_6__values_js__["a" ])(obj);
|
11465 | }
|
11466 |
|
11467 |
|
11468 | }),
|
11469 |
|
11470 | (function(module, __webpack_exports__, __webpack_require__) {
|
11471 |
|
11472 | "use strict";
|
11473 | __webpack_exports__["a"] = size;
|
11474 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
11475 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(17);
|
11476 |
|
11477 |
|
11478 |
|
11479 |
|
11480 | function size(obj) {
|
11481 | if (obj == null) return 0;
|
11482 | return Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? obj.length : Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj).length;
|
11483 | }
|
11484 |
|
11485 |
|
11486 | }),
|
11487 |
|
11488 | (function(module, __webpack_exports__, __webpack_require__) {
|
11489 |
|
11490 | "use strict";
|
11491 | __webpack_exports__["a"] = keyInObj;
|
11492 |
|
11493 |
|
11494 | function keyInObj(value, key, obj) {
|
11495 | return key in obj;
|
11496 | }
|
11497 |
|
11498 |
|
11499 | }),
|
11500 |
|
11501 | (function(module, __webpack_exports__, __webpack_require__) {
|
11502 |
|
11503 | "use strict";
|
11504 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11505 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
11506 | var __WEBPACK_IMPORTED_MODULE_2__negate_js__ = __webpack_require__(146);
|
11507 | var __WEBPACK_IMPORTED_MODULE_3__map_js__ = __webpack_require__(73);
|
11508 | var __WEBPACK_IMPORTED_MODULE_4__flatten_js__ = __webpack_require__(72);
|
11509 | var __WEBPACK_IMPORTED_MODULE_5__contains_js__ = __webpack_require__(91);
|
11510 | var __WEBPACK_IMPORTED_MODULE_6__pick_js__ = __webpack_require__(220);
|
11511 |
|
11512 |
|
11513 |
|
11514 |
|
11515 |
|
11516 |
|
11517 |
|
11518 |
|
11519 |
|
11520 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, keys) {
|
11521 | var iteratee = keys[0], context;
|
11522 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(iteratee)) {
|
11523 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__negate_js__["a" ])(iteratee);
|
11524 | if (keys.length > 1) context = keys[1];
|
11525 | } else {
|
11526 | keys = Object(__WEBPACK_IMPORTED_MODULE_3__map_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_4__flatten_js__["a" ])(keys, false, false), String);
|
11527 | iteratee = function(value, key) {
|
11528 | return !Object(__WEBPACK_IMPORTED_MODULE_5__contains_js__["a" ])(keys, key);
|
11529 | };
|
11530 | }
|
11531 | return Object(__WEBPACK_IMPORTED_MODULE_6__pick_js__["a" ])(obj, iteratee, context);
|
11532 | }));
|
11533 |
|
11534 |
|
11535 | }),
|
11536 |
|
11537 | (function(module, __webpack_exports__, __webpack_require__) {
|
11538 |
|
11539 | "use strict";
|
11540 | __webpack_exports__["a"] = first;
|
11541 | var __WEBPACK_IMPORTED_MODULE_0__initial_js__ = __webpack_require__(221);
|
11542 |
|
11543 |
|
11544 |
|
11545 |
|
11546 | function first(array, n, guard) {
|
11547 | if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
|
11548 | if (n == null || guard) return array[0];
|
11549 | return Object(__WEBPACK_IMPORTED_MODULE_0__initial_js__["a" ])(array, array.length - n);
|
11550 | }
|
11551 |
|
11552 |
|
11553 | }),
|
11554 |
|
11555 | (function(module, __webpack_exports__, __webpack_require__) {
|
11556 |
|
11557 | "use strict";
|
11558 | __webpack_exports__["a"] = last;
|
11559 | var __WEBPACK_IMPORTED_MODULE_0__rest_js__ = __webpack_require__(222);
|
11560 |
|
11561 |
|
11562 |
|
11563 |
|
11564 | function last(array, n, guard) {
|
11565 | if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
|
11566 | if (n == null || guard) return array[array.length - 1];
|
11567 | return Object(__WEBPACK_IMPORTED_MODULE_0__rest_js__["a" ])(array, Math.max(0, array.length - n));
|
11568 | }
|
11569 |
|
11570 |
|
11571 | }),
|
11572 |
|
11573 | (function(module, __webpack_exports__, __webpack_require__) {
|
11574 |
|
11575 | "use strict";
|
11576 | __webpack_exports__["a"] = compact;
|
11577 | var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(90);
|
11578 |
|
11579 |
|
11580 |
|
11581 | function compact(array) {
|
11582 | return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" ])(array, Boolean);
|
11583 | }
|
11584 |
|
11585 |
|
11586 | }),
|
11587 |
|
11588 | (function(module, __webpack_exports__, __webpack_require__) {
|
11589 |
|
11590 | "use strict";
|
11591 | __webpack_exports__["a"] = flatten;
|
11592 | var __WEBPACK_IMPORTED_MODULE_0__flatten_js__ = __webpack_require__(72);
|
11593 |
|
11594 |
|
11595 |
|
11596 |
|
11597 | function flatten(array, depth) {
|
11598 | return Object(__WEBPACK_IMPORTED_MODULE_0__flatten_js__["a" ])(array, depth, false);
|
11599 | }
|
11600 |
|
11601 |
|
11602 | }),
|
11603 |
|
11604 | (function(module, __webpack_exports__, __webpack_require__) {
|
11605 |
|
11606 | "use strict";
|
11607 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11608 | var __WEBPACK_IMPORTED_MODULE_1__difference_js__ = __webpack_require__(223);
|
11609 |
|
11610 |
|
11611 |
|
11612 |
|
11613 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(array, otherArrays) {
|
11614 | return Object(__WEBPACK_IMPORTED_MODULE_1__difference_js__["a" ])(array, otherArrays);
|
11615 | }));
|
11616 |
|
11617 |
|
11618 | }),
|
11619 |
|
11620 | (function(module, __webpack_exports__, __webpack_require__) {
|
11621 |
|
11622 | "use strict";
|
11623 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11624 | var __WEBPACK_IMPORTED_MODULE_1__uniq_js__ = __webpack_require__(224);
|
11625 | var __WEBPACK_IMPORTED_MODULE_2__flatten_js__ = __webpack_require__(72);
|
11626 |
|
11627 |
|
11628 |
|
11629 |
|
11630 |
|
11631 |
|
11632 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(arrays) {
|
11633 | return Object(__WEBPACK_IMPORTED_MODULE_1__uniq_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__flatten_js__["a" ])(arrays, true, true));
|
11634 | }));
|
11635 |
|
11636 |
|
11637 | }),
|
11638 |
|
11639 | (function(module, __webpack_exports__, __webpack_require__) {
|
11640 |
|
11641 | "use strict";
|
11642 | __webpack_exports__["a"] = intersection;
|
11643 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
11644 | var __WEBPACK_IMPORTED_MODULE_1__contains_js__ = __webpack_require__(91);
|
11645 |
|
11646 |
|
11647 |
|
11648 |
|
11649 |
|
11650 | function intersection(array) {
|
11651 | var result = [];
|
11652 | var argsLength = arguments.length;
|
11653 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(array); i < length; i++) {
|
11654 | var item = array[i];
|
11655 | if (Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" ])(result, item)) continue;
|
11656 | var j;
|
11657 | for (j = 1; j < argsLength; j++) {
|
11658 | if (!Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" ])(arguments[j], item)) break;
|
11659 | }
|
11660 | if (j === argsLength) result.push(item);
|
11661 | }
|
11662 | return result;
|
11663 | }
|
11664 |
|
11665 |
|
11666 | }),
|
11667 |
|
11668 | (function(module, __webpack_exports__, __webpack_require__) {
|
11669 |
|
11670 | "use strict";
|
11671 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11672 | var __WEBPACK_IMPORTED_MODULE_1__unzip_js__ = __webpack_require__(225);
|
11673 |
|
11674 |
|
11675 |
|
11676 |
|
11677 |
|
11678 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__unzip_js__["a" ]));
|
11679 |
|
11680 |
|
11681 | }),
|
11682 |
|
11683 | (function(module, __webpack_exports__, __webpack_require__) {
|
11684 |
|
11685 | "use strict";
|
11686 | __webpack_exports__["a"] = object;
|
11687 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
11688 |
|
11689 |
|
11690 |
|
11691 |
|
11692 |
|
11693 | function object(list, values) {
|
11694 | var result = {};
|
11695 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(list); i < length; i++) {
|
11696 | if (values) {
|
11697 | result[list[i]] = values[i];
|
11698 | } else {
|
11699 | result[list[i][0]] = list[i][1];
|
11700 | }
|
11701 | }
|
11702 | return result;
|
11703 | }
|
11704 |
|
11705 |
|
11706 | }),
|
11707 |
|
11708 | (function(module, __webpack_exports__, __webpack_require__) {
|
11709 |
|
11710 | "use strict";
|
11711 | __webpack_exports__["a"] = range;
|
11712 |
|
11713 |
|
11714 |
|
11715 | function range(start, stop, step) {
|
11716 | if (stop == null) {
|
11717 | stop = start || 0;
|
11718 | start = 0;
|
11719 | }
|
11720 | if (!step) {
|
11721 | step = stop < start ? -1 : 1;
|
11722 | }
|
11723 |
|
11724 | var length = Math.max(Math.ceil((stop - start) / step), 0);
|
11725 | var range = Array(length);
|
11726 |
|
11727 | for (var idx = 0; idx < length; idx++, start += step) {
|
11728 | range[idx] = start;
|
11729 | }
|
11730 |
|
11731 | return range;
|
11732 | }
|
11733 |
|
11734 |
|
11735 | }),
|
11736 |
|
11737 | (function(module, __webpack_exports__, __webpack_require__) {
|
11738 |
|
11739 | "use strict";
|
11740 | __webpack_exports__["a"] = chunk;
|
11741 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
11742 |
|
11743 |
|
11744 |
|
11745 |
|
11746 | function chunk(array, count) {
|
11747 | if (count == null || count < 1) return [];
|
11748 | var result = [];
|
11749 | var i = 0, length = array.length;
|
11750 | while (i < length) {
|
11751 | result.push(__WEBPACK_IMPORTED_MODULE_0__setup_js__["q" ].call(array, i, i += count));
|
11752 | }
|
11753 | return result;
|
11754 | }
|
11755 |
|
11756 |
|
11757 | }),
|
11758 |
|
11759 | (function(module, __webpack_exports__, __webpack_require__) {
|
11760 |
|
11761 | "use strict";
|
11762 | __webpack_exports__["a"] = mixin;
|
11763 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
11764 | var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(60);
|
11765 | var __WEBPACK_IMPORTED_MODULE_2__functions_js__ = __webpack_require__(192);
|
11766 | var __WEBPACK_IMPORTED_MODULE_3__setup_js__ = __webpack_require__(6);
|
11767 | var __WEBPACK_IMPORTED_MODULE_4__chainResult_js__ = __webpack_require__(226);
|
11768 |
|
11769 |
|
11770 |
|
11771 |
|
11772 |
|
11773 |
|
11774 |
|
11775 | function mixin(obj) {
|
11776 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__functions_js__["a" ])(obj), function(name) {
|
11777 | var func = __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ][name] = obj[name];
|
11778 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].prototype[name] = function() {
|
11779 | var args = [this._wrapped];
|
11780 | __WEBPACK_IMPORTED_MODULE_3__setup_js__["o" ].apply(args, arguments);
|
11781 | return Object(__WEBPACK_IMPORTED_MODULE_4__chainResult_js__["a" ])(this, func.apply(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ], args));
|
11782 | };
|
11783 | });
|
11784 | return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ];
|
11785 | }
|
11786 |
|
11787 |
|
11788 | }),
|
11789 |
|
11790 | (function(module, __webpack_exports__, __webpack_require__) {
|
11791 |
|
11792 | "use strict";
|
11793 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
11794 | var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(60);
|
11795 | var __WEBPACK_IMPORTED_MODULE_2__setup_js__ = __webpack_require__(6);
|
11796 | var __WEBPACK_IMPORTED_MODULE_3__chainResult_js__ = __webpack_require__(226);
|
11797 |
|
11798 |
|
11799 |
|
11800 |
|
11801 |
|
11802 |
|
11803 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
|
11804 | var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" ][name];
|
11805 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].prototype[name] = function() {
|
11806 | var obj = this._wrapped;
|
11807 | if (obj != null) {
|
11808 | method.apply(obj, arguments);
|
11809 | if ((name === 'shift' || name === 'splice') && obj.length === 0) {
|
11810 | delete obj[0];
|
11811 | }
|
11812 | }
|
11813 | return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" ])(this, obj);
|
11814 | };
|
11815 | });
|
11816 |
|
11817 |
|
11818 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(['concat', 'join', 'slice'], function(name) {
|
11819 | var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" ][name];
|
11820 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].prototype[name] = function() {
|
11821 | var obj = this._wrapped;
|
11822 | if (obj != null) obj = method.apply(obj, arguments);
|
11823 | return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" ])(this, obj);
|
11824 | };
|
11825 | });
|
11826 |
|
11827 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ]);
|
11828 |
|
11829 |
|
11830 | }),
|
11831 |
|
11832 | (function(module, exports, __webpack_require__) {
|
11833 |
|
11834 | var parent = __webpack_require__(394);
|
11835 |
|
11836 | module.exports = parent;
|
11837 |
|
11838 |
|
11839 | }),
|
11840 |
|
11841 | (function(module, exports, __webpack_require__) {
|
11842 |
|
11843 | var isPrototypeOf = __webpack_require__(16);
|
11844 | var method = __webpack_require__(395);
|
11845 |
|
11846 | var ArrayPrototype = Array.prototype;
|
11847 |
|
11848 | module.exports = function (it) {
|
11849 | var own = it.concat;
|
11850 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;
|
11851 | };
|
11852 |
|
11853 |
|
11854 | }),
|
11855 |
|
11856 | (function(module, exports, __webpack_require__) {
|
11857 |
|
11858 | __webpack_require__(227);
|
11859 | var entryVirtual = __webpack_require__(27);
|
11860 |
|
11861 | module.exports = entryVirtual('Array').concat;
|
11862 |
|
11863 |
|
11864 | }),
|
11865 |
|
11866 | (function(module, exports) {
|
11867 |
|
11868 | var $TypeError = TypeError;
|
11869 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
11870 |
|
11871 | module.exports = function (it) {
|
11872 | if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
|
11873 | return it;
|
11874 | };
|
11875 |
|
11876 |
|
11877 | }),
|
11878 |
|
11879 | (function(module, exports, __webpack_require__) {
|
11880 |
|
11881 | var isArray = __webpack_require__(92);
|
11882 | var isConstructor = __webpack_require__(111);
|
11883 | var isObject = __webpack_require__(11);
|
11884 | var wellKnownSymbol = __webpack_require__(5);
|
11885 |
|
11886 | var SPECIES = wellKnownSymbol('species');
|
11887 | var $Array = Array;
|
11888 |
|
11889 |
|
11890 |
|
11891 | module.exports = function (originalArray) {
|
11892 | var C;
|
11893 | if (isArray(originalArray)) {
|
11894 | C = originalArray.constructor;
|
11895 |
|
11896 | if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
|
11897 | else if (isObject(C)) {
|
11898 | C = C[SPECIES];
|
11899 | if (C === null) C = undefined;
|
11900 | }
|
11901 | } return C === undefined ? $Array : C;
|
11902 | };
|
11903 |
|
11904 |
|
11905 | }),
|
11906 |
|
11907 | (function(module, exports, __webpack_require__) {
|
11908 |
|
11909 | var parent = __webpack_require__(399);
|
11910 |
|
11911 | module.exports = parent;
|
11912 |
|
11913 |
|
11914 | }),
|
11915 |
|
11916 | (function(module, exports, __webpack_require__) {
|
11917 |
|
11918 | var isPrototypeOf = __webpack_require__(16);
|
11919 | var method = __webpack_require__(400);
|
11920 |
|
11921 | var ArrayPrototype = Array.prototype;
|
11922 |
|
11923 | module.exports = function (it) {
|
11924 | var own = it.map;
|
11925 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;
|
11926 | };
|
11927 |
|
11928 |
|
11929 | }),
|
11930 |
|
11931 | (function(module, exports, __webpack_require__) {
|
11932 |
|
11933 | __webpack_require__(401);
|
11934 | var entryVirtual = __webpack_require__(27);
|
11935 |
|
11936 | module.exports = entryVirtual('Array').map;
|
11937 |
|
11938 |
|
11939 | }),
|
11940 |
|
11941 | (function(module, exports, __webpack_require__) {
|
11942 |
|
11943 | "use strict";
|
11944 |
|
11945 | var $ = __webpack_require__(0);
|
11946 | var $map = __webpack_require__(75).map;
|
11947 | var arrayMethodHasSpeciesSupport = __webpack_require__(116);
|
11948 |
|
11949 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
|
11950 |
|
11951 |
|
11952 |
|
11953 |
|
11954 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
11955 | map: function map(callbackfn /* , thisArg */) {
|
11956 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
11957 | }
|
11958 | });
|
11959 |
|
11960 |
|
11961 | }),
|
11962 |
|
11963 | (function(module, exports, __webpack_require__) {
|
11964 |
|
11965 | var parent = __webpack_require__(403);
|
11966 |
|
11967 | module.exports = parent;
|
11968 |
|
11969 |
|
11970 | }),
|
11971 |
|
11972 | (function(module, exports, __webpack_require__) {
|
11973 |
|
11974 | __webpack_require__(404);
|
11975 | var path = __webpack_require__(7);
|
11976 |
|
11977 | module.exports = path.Object.keys;
|
11978 |
|
11979 |
|
11980 | }),
|
11981 |
|
11982 | (function(module, exports, __webpack_require__) {
|
11983 |
|
11984 | var $ = __webpack_require__(0);
|
11985 | var toObject = __webpack_require__(33);
|
11986 | var nativeKeys = __webpack_require__(107);
|
11987 | var fails = __webpack_require__(2);
|
11988 |
|
11989 | var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
|
11990 |
|
11991 |
|
11992 |
|
11993 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
11994 | keys: function keys(it) {
|
11995 | return nativeKeys(toObject(it));
|
11996 | }
|
11997 | });
|
11998 |
|
11999 |
|
12000 | }),
|
12001 |
|
12002 | (function(module, exports, __webpack_require__) {
|
12003 |
|
12004 | var parent = __webpack_require__(406);
|
12005 |
|
12006 | module.exports = parent;
|
12007 |
|
12008 |
|
12009 | }),
|
12010 |
|
12011 | (function(module, exports, __webpack_require__) {
|
12012 |
|
12013 | __webpack_require__(229);
|
12014 | var path = __webpack_require__(7);
|
12015 | var apply = __webpack_require__(79);
|
12016 |
|
12017 |
|
12018 | if (!path.JSON) path.JSON = { stringify: JSON.stringify };
|
12019 |
|
12020 |
|
12021 | module.exports = function stringify(it, replacer, space) {
|
12022 | return apply(path.JSON.stringify, null, arguments);
|
12023 | };
|
12024 |
|
12025 |
|
12026 | }),
|
12027 |
|
12028 | (function(module, exports, __webpack_require__) {
|
12029 |
|
12030 | var parent = __webpack_require__(408);
|
12031 |
|
12032 | module.exports = parent;
|
12033 |
|
12034 |
|
12035 | }),
|
12036 |
|
12037 | (function(module, exports, __webpack_require__) {
|
12038 |
|
12039 | var isPrototypeOf = __webpack_require__(16);
|
12040 | var method = __webpack_require__(409);
|
12041 |
|
12042 | var ArrayPrototype = Array.prototype;
|
12043 |
|
12044 | module.exports = function (it) {
|
12045 | var own = it.indexOf;
|
12046 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;
|
12047 | };
|
12048 |
|
12049 |
|
12050 | }),
|
12051 |
|
12052 | (function(module, exports, __webpack_require__) {
|
12053 |
|
12054 | __webpack_require__(410);
|
12055 | var entryVirtual = __webpack_require__(27);
|
12056 |
|
12057 | module.exports = entryVirtual('Array').indexOf;
|
12058 |
|
12059 |
|
12060 | }),
|
12061 |
|
12062 | (function(module, exports, __webpack_require__) {
|
12063 |
|
12064 | "use strict";
|
12065 |
|
12066 |
|
12067 | var $ = __webpack_require__(0);
|
12068 | var uncurryThis = __webpack_require__(4);
|
12069 | var $IndexOf = __webpack_require__(125).indexOf;
|
12070 | var arrayMethodIsStrict = __webpack_require__(150);
|
12071 |
|
12072 | var un$IndexOf = uncurryThis([].indexOf);
|
12073 |
|
12074 | var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
|
12075 | var STRICT_METHOD = arrayMethodIsStrict('indexOf');
|
12076 |
|
12077 |
|
12078 |
|
12079 | $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
|
12080 | indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
12081 | var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
|
12082 | return NEGATIVE_ZERO
|
12083 |
|
12084 | ? un$IndexOf(this, searchElement, fromIndex) || 0
|
12085 | : $IndexOf(this, searchElement, fromIndex);
|
12086 | }
|
12087 | });
|
12088 |
|
12089 |
|
12090 | }),
|
12091 |
|
12092 | (function(module, exports, __webpack_require__) {
|
12093 |
|
12094 | __webpack_require__(46);
|
12095 | var classof = __webpack_require__(55);
|
12096 | var hasOwn = __webpack_require__(13);
|
12097 | var isPrototypeOf = __webpack_require__(16);
|
12098 | var method = __webpack_require__(412);
|
12099 |
|
12100 | var ArrayPrototype = Array.prototype;
|
12101 |
|
12102 | var DOMIterables = {
|
12103 | DOMTokenList: true,
|
12104 | NodeList: true
|
12105 | };
|
12106 |
|
12107 | module.exports = function (it) {
|
12108 | var own = it.keys;
|
12109 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
|
12110 | || hasOwn(DOMIterables, classof(it)) ? method : own;
|
12111 | };
|
12112 |
|
12113 |
|
12114 | }),
|
12115 |
|
12116 | (function(module, exports, __webpack_require__) {
|
12117 |
|
12118 | var parent = __webpack_require__(413);
|
12119 |
|
12120 | module.exports = parent;
|
12121 |
|
12122 |
|
12123 | }),
|
12124 |
|
12125 | (function(module, exports, __webpack_require__) {
|
12126 |
|
12127 | __webpack_require__(43);
|
12128 | __webpack_require__(68);
|
12129 | var entryVirtual = __webpack_require__(27);
|
12130 |
|
12131 | module.exports = entryVirtual('Array').keys;
|
12132 |
|
12133 |
|
12134 | }),
|
12135 |
|
12136 | (function(module, exports) {
|
12137 |
|
12138 |
|
12139 |
|
12140 |
|
12141 |
|
12142 |
|
12143 |
|
12144 |
|
12145 | var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
|
12146 | (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
|
12147 |
|
12148 | if (getRandomValues) {
|
12149 |
|
12150 | var rnds8 = new Uint8Array(16);
|
12151 |
|
12152 | module.exports = function whatwgRNG() {
|
12153 | getRandomValues(rnds8);
|
12154 | return rnds8;
|
12155 | };
|
12156 | } else {
|
12157 |
|
12158 |
|
12159 |
|
12160 |
|
12161 | var rnds = new Array(16);
|
12162 |
|
12163 | module.exports = function mathRNG() {
|
12164 | for (var i = 0, r; i < 16; i++) {
|
12165 | if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
12166 | rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
12167 | }
|
12168 |
|
12169 | return rnds;
|
12170 | };
|
12171 | }
|
12172 |
|
12173 |
|
12174 | }),
|
12175 |
|
12176 | (function(module, exports) {
|
12177 |
|
12178 |
|
12179 |
|
12180 |
|
12181 |
|
12182 | var byteToHex = [];
|
12183 | for (var i = 0; i < 256; ++i) {
|
12184 | byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
12185 | }
|
12186 |
|
12187 | function bytesToUuid(buf, offset) {
|
12188 | var i = offset || 0;
|
12189 | var bth = byteToHex;
|
12190 |
|
12191 | return ([bth[buf[i++]], bth[buf[i++]],
|
12192 | bth[buf[i++]], bth[buf[i++]], '-',
|
12193 | bth[buf[i++]], bth[buf[i++]], '-',
|
12194 | bth[buf[i++]], bth[buf[i++]], '-',
|
12195 | bth[buf[i++]], bth[buf[i++]], '-',
|
12196 | bth[buf[i++]], bth[buf[i++]],
|
12197 | bth[buf[i++]], bth[buf[i++]],
|
12198 | bth[buf[i++]], bth[buf[i++]]]).join('');
|
12199 | }
|
12200 |
|
12201 | module.exports = bytesToUuid;
|
12202 |
|
12203 |
|
12204 | }),
|
12205 |
|
12206 | (function(module, exports, __webpack_require__) {
|
12207 |
|
12208 | "use strict";
|
12209 |
|
12210 |
|
12211 |
|
12212 |
|
12213 |
|
12214 |
|
12215 | function setup(env) {
|
12216 | createDebug.debug = createDebug;
|
12217 | createDebug.default = createDebug;
|
12218 | createDebug.coerce = coerce;
|
12219 | createDebug.disable = disable;
|
12220 | createDebug.enable = enable;
|
12221 | createDebug.enabled = enabled;
|
12222 | createDebug.humanize = __webpack_require__(417);
|
12223 | Object.keys(env).forEach(function (key) {
|
12224 | createDebug[key] = env[key];
|
12225 | });
|
12226 | |
12227 |
|
12228 |
|
12229 |
|
12230 | createDebug.instances = [];
|
12231 | |
12232 |
|
12233 |
|
12234 |
|
12235 | createDebug.names = [];
|
12236 | createDebug.skips = [];
|
12237 | |
12238 |
|
12239 |
|
12240 |
|
12241 |
|
12242 |
|
12243 | createDebug.formatters = {};
|
12244 | |
12245 |
|
12246 |
|
12247 |
|
12248 |
|
12249 |
|
12250 |
|
12251 | function selectColor(namespace) {
|
12252 | var hash = 0;
|
12253 |
|
12254 | for (var i = 0; i < namespace.length; i++) {
|
12255 | hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
12256 | hash |= 0;
|
12257 | }
|
12258 |
|
12259 | return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
12260 | }
|
12261 |
|
12262 | createDebug.selectColor = selectColor;
|
12263 | |
12264 |
|
12265 |
|
12266 |
|
12267 |
|
12268 |
|
12269 |
|
12270 |
|
12271 | function createDebug(namespace) {
|
12272 | var prevTime;
|
12273 |
|
12274 | function debug() {
|
12275 |
|
12276 | if (!debug.enabled) {
|
12277 | return;
|
12278 | }
|
12279 |
|
12280 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
12281 | args[_key] = arguments[_key];
|
12282 | }
|
12283 |
|
12284 | var self = debug;
|
12285 |
|
12286 | var curr = Number(new Date());
|
12287 | var ms = curr - (prevTime || curr);
|
12288 | self.diff = ms;
|
12289 | self.prev = prevTime;
|
12290 | self.curr = curr;
|
12291 | prevTime = curr;
|
12292 | args[0] = createDebug.coerce(args[0]);
|
12293 |
|
12294 | if (typeof args[0] !== 'string') {
|
12295 |
|
12296 | args.unshift('%O');
|
12297 | }
|
12298 |
|
12299 |
|
12300 | var index = 0;
|
12301 | args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
|
12302 |
|
12303 | if (match === '%%') {
|
12304 | return match;
|
12305 | }
|
12306 |
|
12307 | index++;
|
12308 | var formatter = createDebug.formatters[format];
|
12309 |
|
12310 | if (typeof formatter === 'function') {
|
12311 | var val = args[index];
|
12312 | match = formatter.call(self, val);
|
12313 |
|
12314 | args.splice(index, 1);
|
12315 | index--;
|
12316 | }
|
12317 |
|
12318 | return match;
|
12319 | });
|
12320 |
|
12321 | createDebug.formatArgs.call(self, args);
|
12322 | var logFn = self.log || createDebug.log;
|
12323 | logFn.apply(self, args);
|
12324 | }
|
12325 |
|
12326 | debug.namespace = namespace;
|
12327 | debug.enabled = createDebug.enabled(namespace);
|
12328 | debug.useColors = createDebug.useColors();
|
12329 | debug.color = selectColor(namespace);
|
12330 | debug.destroy = destroy;
|
12331 | debug.extend = extend;
|
12332 |
|
12333 |
|
12334 |
|
12335 | if (typeof createDebug.init === 'function') {
|
12336 | createDebug.init(debug);
|
12337 | }
|
12338 |
|
12339 | createDebug.instances.push(debug);
|
12340 | return debug;
|
12341 | }
|
12342 |
|
12343 | function destroy() {
|
12344 | var index = createDebug.instances.indexOf(this);
|
12345 |
|
12346 | if (index !== -1) {
|
12347 | createDebug.instances.splice(index, 1);
|
12348 | return true;
|
12349 | }
|
12350 |
|
12351 | return false;
|
12352 | }
|
12353 |
|
12354 | function extend(namespace, delimiter) {
|
12355 | return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
12356 | }
|
12357 | |
12358 |
|
12359 |
|
12360 |
|
12361 |
|
12362 |
|
12363 |
|
12364 |
|
12365 |
|
12366 | function enable(namespaces) {
|
12367 | createDebug.save(namespaces);
|
12368 | createDebug.names = [];
|
12369 | createDebug.skips = [];
|
12370 | var i;
|
12371 | var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
12372 | var len = split.length;
|
12373 |
|
12374 | for (i = 0; i < len; i++) {
|
12375 | if (!split[i]) {
|
12376 |
|
12377 | continue;
|
12378 | }
|
12379 |
|
12380 | namespaces = split[i].replace(/\*/g, '.*?');
|
12381 |
|
12382 | if (namespaces[0] === '-') {
|
12383 | createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
12384 | } else {
|
12385 | createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
12386 | }
|
12387 | }
|
12388 |
|
12389 | for (i = 0; i < createDebug.instances.length; i++) {
|
12390 | var instance = createDebug.instances[i];
|
12391 | instance.enabled = createDebug.enabled(instance.namespace);
|
12392 | }
|
12393 | }
|
12394 | |
12395 |
|
12396 |
|
12397 |
|
12398 |
|
12399 |
|
12400 |
|
12401 | function disable() {
|
12402 | createDebug.enable('');
|
12403 | }
|
12404 | |
12405 |
|
12406 |
|
12407 |
|
12408 |
|
12409 |
|
12410 |
|
12411 |
|
12412 |
|
12413 | function enabled(name) {
|
12414 | if (name[name.length - 1] === '*') {
|
12415 | return true;
|
12416 | }
|
12417 |
|
12418 | var i;
|
12419 | var len;
|
12420 |
|
12421 | for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
12422 | if (createDebug.skips[i].test(name)) {
|
12423 | return false;
|
12424 | }
|
12425 | }
|
12426 |
|
12427 | for (i = 0, len = createDebug.names.length; i < len; i++) {
|
12428 | if (createDebug.names[i].test(name)) {
|
12429 | return true;
|
12430 | }
|
12431 | }
|
12432 |
|
12433 | return false;
|
12434 | }
|
12435 | |
12436 |
|
12437 |
|
12438 |
|
12439 |
|
12440 |
|
12441 |
|
12442 |
|
12443 |
|
12444 | function coerce(val) {
|
12445 | if (val instanceof Error) {
|
12446 | return val.stack || val.message;
|
12447 | }
|
12448 |
|
12449 | return val;
|
12450 | }
|
12451 |
|
12452 | createDebug.enable(createDebug.load());
|
12453 | return createDebug;
|
12454 | }
|
12455 |
|
12456 | module.exports = setup;
|
12457 |
|
12458 |
|
12459 |
|
12460 | }),
|
12461 |
|
12462 | (function(module, exports) {
|
12463 |
|
12464 |
|
12465 |
|
12466 |
|
12467 |
|
12468 | var s = 1000;
|
12469 | var m = s * 60;
|
12470 | var h = m * 60;
|
12471 | var d = h * 24;
|
12472 | var w = d * 7;
|
12473 | var y = d * 365.25;
|
12474 |
|
12475 |
|
12476 |
|
12477 |
|
12478 |
|
12479 |
|
12480 |
|
12481 |
|
12482 |
|
12483 |
|
12484 |
|
12485 |
|
12486 |
|
12487 |
|
12488 |
|
12489 | module.exports = function(val, options) {
|
12490 | options = options || {};
|
12491 | var type = typeof val;
|
12492 | if (type === 'string' && val.length > 0) {
|
12493 | return parse(val);
|
12494 | } else if (type === 'number' && isFinite(val)) {
|
12495 | return options.long ? fmtLong(val) : fmtShort(val);
|
12496 | }
|
12497 | throw new Error(
|
12498 | 'val is not a non-empty string or a valid number. val=' +
|
12499 | JSON.stringify(val)
|
12500 | );
|
12501 | };
|
12502 |
|
12503 |
|
12504 |
|
12505 |
|
12506 |
|
12507 |
|
12508 |
|
12509 |
|
12510 |
|
12511 | function parse(str) {
|
12512 | str = String(str);
|
12513 | if (str.length > 100) {
|
12514 | return;
|
12515 | }
|
12516 | 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(
|
12517 | str
|
12518 | );
|
12519 | if (!match) {
|
12520 | return;
|
12521 | }
|
12522 | var n = parseFloat(match[1]);
|
12523 | var type = (match[2] || 'ms').toLowerCase();
|
12524 | switch (type) {
|
12525 | case 'years':
|
12526 | case 'year':
|
12527 | case 'yrs':
|
12528 | case 'yr':
|
12529 | case 'y':
|
12530 | return n * y;
|
12531 | case 'weeks':
|
12532 | case 'week':
|
12533 | case 'w':
|
12534 | return n * w;
|
12535 | case 'days':
|
12536 | case 'day':
|
12537 | case 'd':
|
12538 | return n * d;
|
12539 | case 'hours':
|
12540 | case 'hour':
|
12541 | case 'hrs':
|
12542 | case 'hr':
|
12543 | case 'h':
|
12544 | return n * h;
|
12545 | case 'minutes':
|
12546 | case 'minute':
|
12547 | case 'mins':
|
12548 | case 'min':
|
12549 | case 'm':
|
12550 | return n * m;
|
12551 | case 'seconds':
|
12552 | case 'second':
|
12553 | case 'secs':
|
12554 | case 'sec':
|
12555 | case 's':
|
12556 | return n * s;
|
12557 | case 'milliseconds':
|
12558 | case 'millisecond':
|
12559 | case 'msecs':
|
12560 | case 'msec':
|
12561 | case 'ms':
|
12562 | return n;
|
12563 | default:
|
12564 | return undefined;
|
12565 | }
|
12566 | }
|
12567 |
|
12568 |
|
12569 |
|
12570 |
|
12571 |
|
12572 |
|
12573 |
|
12574 |
|
12575 |
|
12576 | function fmtShort(ms) {
|
12577 | var msAbs = Math.abs(ms);
|
12578 | if (msAbs >= d) {
|
12579 | return Math.round(ms / d) + 'd';
|
12580 | }
|
12581 | if (msAbs >= h) {
|
12582 | return Math.round(ms / h) + 'h';
|
12583 | }
|
12584 | if (msAbs >= m) {
|
12585 | return Math.round(ms / m) + 'm';
|
12586 | }
|
12587 | if (msAbs >= s) {
|
12588 | return Math.round(ms / s) + 's';
|
12589 | }
|
12590 | return ms + 'ms';
|
12591 | }
|
12592 |
|
12593 |
|
12594 |
|
12595 |
|
12596 |
|
12597 |
|
12598 |
|
12599 |
|
12600 |
|
12601 | function fmtLong(ms) {
|
12602 | var msAbs = Math.abs(ms);
|
12603 | if (msAbs >= d) {
|
12604 | return plural(ms, msAbs, d, 'day');
|
12605 | }
|
12606 | if (msAbs >= h) {
|
12607 | return plural(ms, msAbs, h, 'hour');
|
12608 | }
|
12609 | if (msAbs >= m) {
|
12610 | return plural(ms, msAbs, m, 'minute');
|
12611 | }
|
12612 | if (msAbs >= s) {
|
12613 | return plural(ms, msAbs, s, 'second');
|
12614 | }
|
12615 | return ms + ' ms';
|
12616 | }
|
12617 |
|
12618 |
|
12619 |
|
12620 |
|
12621 |
|
12622 | function plural(ms, msAbs, n, name) {
|
12623 | var isPlural = msAbs >= n * 1.5;
|
12624 | return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
12625 | }
|
12626 |
|
12627 |
|
12628 | }),
|
12629 |
|
12630 | (function(module, exports, __webpack_require__) {
|
12631 |
|
12632 | __webpack_require__(419);
|
12633 | var path = __webpack_require__(7);
|
12634 |
|
12635 | module.exports = path.Object.getPrototypeOf;
|
12636 |
|
12637 |
|
12638 | }),
|
12639 |
|
12640 | (function(module, exports, __webpack_require__) {
|
12641 |
|
12642 | var $ = __webpack_require__(0);
|
12643 | var fails = __webpack_require__(2);
|
12644 | var toObject = __webpack_require__(33);
|
12645 | var nativeGetPrototypeOf = __webpack_require__(102);
|
12646 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(161);
|
12647 |
|
12648 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
|
12649 |
|
12650 |
|
12651 |
|
12652 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
|
12653 | getPrototypeOf: function getPrototypeOf(it) {
|
12654 | return nativeGetPrototypeOf(toObject(it));
|
12655 | }
|
12656 | });
|
12657 |
|
12658 |
|
12659 |
|
12660 | }),
|
12661 |
|
12662 | (function(module, exports, __webpack_require__) {
|
12663 |
|
12664 | module.exports = __webpack_require__(237);
|
12665 |
|
12666 | }),
|
12667 |
|
12668 | (function(module, exports, __webpack_require__) {
|
12669 |
|
12670 | __webpack_require__(422);
|
12671 | var path = __webpack_require__(7);
|
12672 |
|
12673 | module.exports = path.Object.setPrototypeOf;
|
12674 |
|
12675 |
|
12676 | }),
|
12677 |
|
12678 | (function(module, exports, __webpack_require__) {
|
12679 |
|
12680 | var $ = __webpack_require__(0);
|
12681 | var setPrototypeOf = __webpack_require__(104);
|
12682 |
|
12683 |
|
12684 |
|
12685 | $({ target: 'Object', stat: true }, {
|
12686 | setPrototypeOf: setPrototypeOf
|
12687 | });
|
12688 |
|
12689 |
|
12690 | }),
|
12691 |
|
12692 | (function(module, exports, __webpack_require__) {
|
12693 |
|
12694 | "use strict";
|
12695 |
|
12696 |
|
12697 | var _interopRequireDefault = __webpack_require__(1);
|
12698 |
|
12699 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
12700 |
|
12701 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
12702 |
|
12703 | var _defineProperty = _interopRequireDefault(__webpack_require__(94));
|
12704 |
|
12705 | var AV = __webpack_require__(74);
|
12706 |
|
12707 | var AppRouter = __webpack_require__(429);
|
12708 |
|
12709 | var _require = __webpack_require__(32),
|
12710 | isNullOrUndefined = _require.isNullOrUndefined;
|
12711 |
|
12712 | var _require2 = __webpack_require__(3),
|
12713 | extend = _require2.extend,
|
12714 | isObject = _require2.isObject,
|
12715 | isEmpty = _require2.isEmpty;
|
12716 |
|
12717 | var isCNApp = function isCNApp(appId) {
|
12718 | return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
|
12719 | };
|
12720 |
|
12721 | var fillServerURLs = function fillServerURLs(url) {
|
12722 | return {
|
12723 | push: url,
|
12724 | stats: url,
|
12725 | engine: url,
|
12726 | api: url,
|
12727 | rtm: url
|
12728 | };
|
12729 | };
|
12730 |
|
12731 | function getDefaultServerURLs(appId) {
|
12732 | var _context, _context2, _context3, _context4, _context5;
|
12733 |
|
12734 | if (isCNApp(appId)) {
|
12735 | return {};
|
12736 | }
|
12737 |
|
12738 | var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
|
12739 | var domain = 'lncldglobal.com';
|
12740 | return {
|
12741 | push: (0, _concat.default)(_context = "https://".concat(id, ".push.")).call(_context, domain),
|
12742 | stats: (0, _concat.default)(_context2 = "https://".concat(id, ".stats.")).call(_context2, domain),
|
12743 | engine: (0, _concat.default)(_context3 = "https://".concat(id, ".engine.")).call(_context3, domain),
|
12744 | api: (0, _concat.default)(_context4 = "https://".concat(id, ".api.")).call(_context4, domain),
|
12745 | rtm: (0, _concat.default)(_context5 = "https://".concat(id, ".rtm.")).call(_context5, domain)
|
12746 | };
|
12747 | }
|
12748 |
|
12749 | var _disableAppRouter = false;
|
12750 | var _initialized = false;
|
12751 |
|
12752 |
|
12753 |
|
12754 |
|
12755 |
|
12756 |
|
12757 |
|
12758 |
|
12759 |
|
12760 |
|
12761 |
|
12762 |
|
12763 |
|
12764 |
|
12765 |
|
12766 |
|
12767 |
|
12768 |
|
12769 |
|
12770 |
|
12771 |
|
12772 |
|
12773 |
|
12774 | AV.init = function init(options) {
|
12775 | if (!isObject(options)) {
|
12776 | return AV.init({
|
12777 | appId: options,
|
12778 | appKey: arguments.length <= 1 ? undefined : arguments[1],
|
12779 | masterKey: arguments.length <= 2 ? undefined : arguments[2]
|
12780 | });
|
12781 | }
|
12782 |
|
12783 | var appId = options.appId,
|
12784 | appKey = options.appKey,
|
12785 | masterKey = options.masterKey,
|
12786 | hookKey = options.hookKey,
|
12787 | serverURL = options.serverURL,
|
12788 | _options$serverURLs = options.serverURLs,
|
12789 | serverURLs = _options$serverURLs === void 0 ? serverURL : _options$serverURLs,
|
12790 | disableCurrentUser = options.disableCurrentUser,
|
12791 | production = options.production,
|
12792 | realtime = options.realtime;
|
12793 | 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.');
|
12794 | if (!appId) throw new TypeError('appId must be a string');
|
12795 | if (!appKey) throw new TypeError('appKey must be a string');
|
12796 | if ("Browser" !== 'NODE_JS' && masterKey) console.warn('MasterKey is not supposed to be used at client side.');
|
12797 |
|
12798 | if (isCNApp(appId)) {
|
12799 | if (!serverURLs && isEmpty(AV._config.serverURLs)) {
|
12800 | throw new TypeError("serverURL option is required for apps from CN region");
|
12801 | }
|
12802 | }
|
12803 |
|
12804 | if (appId !== AV._config.applicationId) {
|
12805 |
|
12806 | AV._config.masterKey = masterKey;
|
12807 | AV._config.hookKey = hookKey;
|
12808 | } else {
|
12809 | if (masterKey) AV._config.masterKey = masterKey;
|
12810 | if (hookKey) AV._config.hookKey = hookKey;
|
12811 | }
|
12812 |
|
12813 | AV._config.applicationId = appId;
|
12814 | AV._config.applicationKey = appKey;
|
12815 |
|
12816 | if (!isNullOrUndefined(production)) {
|
12817 | AV.setProduction(production);
|
12818 | }
|
12819 |
|
12820 | if (typeof disableCurrentUser !== 'undefined') AV._config.disableCurrentUser = disableCurrentUser;
|
12821 | var disableAppRouter = _disableAppRouter || typeof serverURLs !== 'undefined';
|
12822 |
|
12823 | if (!disableAppRouter) {
|
12824 | AV._appRouter = new AppRouter(AV);
|
12825 | }
|
12826 |
|
12827 | AV._setServerURLs(extend({}, getDefaultServerURLs(appId), AV._config.serverURLs, typeof serverURLs === 'string' ? fillServerURLs(serverURLs) : serverURLs), disableAppRouter);
|
12828 |
|
12829 | if (realtime) {
|
12830 | AV._config.realtime = realtime;
|
12831 | } else if (AV._sharedConfig.liveQueryRealtime) {
|
12832 | var _AV$_config$serverURL = AV._config.serverURLs,
|
12833 | api = _AV$_config$serverURL.api,
|
12834 | rtm = _AV$_config$serverURL.rtm;
|
12835 | AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
|
12836 | appId: appId,
|
12837 | appKey: appKey,
|
12838 | server: {
|
12839 | api: api,
|
12840 | RTMRouter: rtm
|
12841 | }
|
12842 | });
|
12843 | }
|
12844 |
|
12845 | _initialized = true;
|
12846 | };
|
12847 |
|
12848 |
|
12849 | if (false) {
|
12850 | AV.Cloud = AV.Cloud || {};
|
12851 | |
12852 |
|
12853 |
|
12854 |
|
12855 |
|
12856 |
|
12857 |
|
12858 |
|
12859 | AV.Cloud.useMasterKey = function () {
|
12860 | AV._config.useMasterKey = true;
|
12861 | };
|
12862 | }
|
12863 |
|
12864 |
|
12865 |
|
12866 |
|
12867 |
|
12868 |
|
12869 |
|
12870 |
|
12871 | AV.setProduction = function (production) {
|
12872 | if (!isNullOrUndefined(production)) {
|
12873 | AV._config.production = production ? 1 : 0;
|
12874 | } else {
|
12875 |
|
12876 | AV._config.production = null;
|
12877 | }
|
12878 | };
|
12879 |
|
12880 | AV._setServerURLs = function (urls) {
|
12881 | var disableAppRouter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
12882 |
|
12883 | if (typeof urls !== 'string') {
|
12884 | extend(AV._config.serverURLs, urls);
|
12885 | } else {
|
12886 | AV._config.serverURLs = fillServerURLs(urls);
|
12887 | }
|
12888 |
|
12889 | if (disableAppRouter) {
|
12890 | if (AV._appRouter) {
|
12891 | AV._appRouter.disable();
|
12892 | } else {
|
12893 | _disableAppRouter = true;
|
12894 | }
|
12895 | }
|
12896 | };
|
12897 |
|
12898 |
|
12899 |
|
12900 |
|
12901 |
|
12902 |
|
12903 |
|
12904 |
|
12905 |
|
12906 | AV.setServerURL = function (urls) {
|
12907 | return AV._setServerURLs(urls);
|
12908 | };
|
12909 |
|
12910 | AV.setServerURLs = AV.setServerURL;
|
12911 |
|
12912 | AV.keepErrorRawMessage = function (value) {
|
12913 | AV._sharedConfig.keepErrorRawMessage = value;
|
12914 | };
|
12915 |
|
12916 |
|
12917 |
|
12918 |
|
12919 |
|
12920 |
|
12921 |
|
12922 |
|
12923 |
|
12924 | AV.setRequestTimeout = function (ms) {
|
12925 | AV._config.requestTimeout = ms;
|
12926 | };
|
12927 |
|
12928 |
|
12929 | AV.initialize = AV.init;
|
12930 |
|
12931 | var defineConfig = function defineConfig(property) {
|
12932 | return (0, _defineProperty.default)(AV, property, {
|
12933 | get: function get() {
|
12934 | return AV._config[property];
|
12935 | },
|
12936 | set: function set(value) {
|
12937 | AV._config[property] = value;
|
12938 | }
|
12939 | });
|
12940 | };
|
12941 |
|
12942 | ['applicationId', 'applicationKey', 'masterKey', 'hookKey'].forEach(defineConfig);
|
12943 |
|
12944 | }),
|
12945 |
|
12946 | (function(module, exports, __webpack_require__) {
|
12947 |
|
12948 | var isPrototypeOf = __webpack_require__(16);
|
12949 | var method = __webpack_require__(425);
|
12950 |
|
12951 | var ArrayPrototype = Array.prototype;
|
12952 |
|
12953 | module.exports = function (it) {
|
12954 | var own = it.slice;
|
12955 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
|
12956 | };
|
12957 |
|
12958 |
|
12959 | }),
|
12960 |
|
12961 | (function(module, exports, __webpack_require__) {
|
12962 |
|
12963 | __webpack_require__(426);
|
12964 | var entryVirtual = __webpack_require__(27);
|
12965 |
|
12966 | module.exports = entryVirtual('Array').slice;
|
12967 |
|
12968 |
|
12969 | }),
|
12970 |
|
12971 | (function(module, exports, __webpack_require__) {
|
12972 |
|
12973 | "use strict";
|
12974 |
|
12975 | var $ = __webpack_require__(0);
|
12976 | var isArray = __webpack_require__(92);
|
12977 | var isConstructor = __webpack_require__(111);
|
12978 | var isObject = __webpack_require__(11);
|
12979 | var toAbsoluteIndex = __webpack_require__(126);
|
12980 | var lengthOfArrayLike = __webpack_require__(40);
|
12981 | var toIndexedObject = __webpack_require__(35);
|
12982 | var createProperty = __webpack_require__(93);
|
12983 | var wellKnownSymbol = __webpack_require__(5);
|
12984 | var arrayMethodHasSpeciesSupport = __webpack_require__(116);
|
12985 | var un$Slice = __webpack_require__(112);
|
12986 |
|
12987 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
|
12988 |
|
12989 | var SPECIES = wellKnownSymbol('species');
|
12990 | var $Array = Array;
|
12991 | var max = Math.max;
|
12992 |
|
12993 |
|
12994 |
|
12995 |
|
12996 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
12997 | slice: function slice(start, end) {
|
12998 | var O = toIndexedObject(this);
|
12999 | var length = lengthOfArrayLike(O);
|
13000 | var k = toAbsoluteIndex(start, length);
|
13001 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
13002 |
|
13003 | var Constructor, result, n;
|
13004 | if (isArray(O)) {
|
13005 | Constructor = O.constructor;
|
13006 |
|
13007 | if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
|
13008 | Constructor = undefined;
|
13009 | } else if (isObject(Constructor)) {
|
13010 | Constructor = Constructor[SPECIES];
|
13011 | if (Constructor === null) Constructor = undefined;
|
13012 | }
|
13013 | if (Constructor === $Array || Constructor === undefined) {
|
13014 | return un$Slice(O, k, fin);
|
13015 | }
|
13016 | }
|
13017 | result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
|
13018 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
|
13019 | result.length = n;
|
13020 | return result;
|
13021 | }
|
13022 | });
|
13023 |
|
13024 |
|
13025 | }),
|
13026 |
|
13027 | (function(module, exports, __webpack_require__) {
|
13028 |
|
13029 | __webpack_require__(428);
|
13030 | var path = __webpack_require__(7);
|
13031 |
|
13032 | var Object = path.Object;
|
13033 |
|
13034 | var defineProperty = module.exports = function defineProperty(it, key, desc) {
|
13035 | return Object.defineProperty(it, key, desc);
|
13036 | };
|
13037 |
|
13038 | if (Object.defineProperty.sham) defineProperty.sham = true;
|
13039 |
|
13040 |
|
13041 | }),
|
13042 |
|
13043 | (function(module, exports, __webpack_require__) {
|
13044 |
|
13045 | var $ = __webpack_require__(0);
|
13046 | var DESCRIPTORS = __webpack_require__(14);
|
13047 | var defineProperty = __webpack_require__(23).f;
|
13048 |
|
13049 |
|
13050 |
|
13051 |
|
13052 | $({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
|
13053 | defineProperty: defineProperty
|
13054 | });
|
13055 |
|
13056 |
|
13057 | }),
|
13058 |
|
13059 | (function(module, exports, __webpack_require__) {
|
13060 |
|
13061 | "use strict";
|
13062 |
|
13063 |
|
13064 | var ajax = __webpack_require__(117);
|
13065 |
|
13066 | var Cache = __webpack_require__(236);
|
13067 |
|
13068 | function AppRouter(AV) {
|
13069 | var _this = this;
|
13070 |
|
13071 | this.AV = AV;
|
13072 | this.lockedUntil = 0;
|
13073 | Cache.getAsync('serverURLs').then(function (data) {
|
13074 | if (_this.disabled) return;
|
13075 | if (!data) return _this.lock(0);
|
13076 | var serverURLs = data.serverURLs,
|
13077 | lockedUntil = data.lockedUntil;
|
13078 |
|
13079 | _this.AV._setServerURLs(serverURLs, false);
|
13080 |
|
13081 | _this.lockedUntil = lockedUntil;
|
13082 | }).catch(function () {
|
13083 | return _this.lock(0);
|
13084 | });
|
13085 | }
|
13086 |
|
13087 | AppRouter.prototype.disable = function disable() {
|
13088 | this.disabled = true;
|
13089 | };
|
13090 |
|
13091 | AppRouter.prototype.lock = function lock(ttl) {
|
13092 | this.lockedUntil = Date.now() + ttl;
|
13093 | };
|
13094 |
|
13095 | AppRouter.prototype.refresh = function refresh() {
|
13096 | var _this2 = this;
|
13097 |
|
13098 | if (this.disabled) return;
|
13099 | if (Date.now() < this.lockedUntil) return;
|
13100 | this.lock(10);
|
13101 | var url = 'https://app-router.com/2/route';
|
13102 | return ajax({
|
13103 | method: 'get',
|
13104 | url: url,
|
13105 | query: {
|
13106 | appId: this.AV.applicationId
|
13107 | }
|
13108 | }).then(function (servers) {
|
13109 | if (_this2.disabled) return;
|
13110 | var ttl = servers.ttl;
|
13111 | if (!ttl) throw new Error('missing ttl');
|
13112 | ttl = ttl * 1000;
|
13113 | var protocal = 'https://';
|
13114 | var serverURLs = {
|
13115 | push: protocal + servers.push_server,
|
13116 | stats: protocal + servers.stats_server,
|
13117 | engine: protocal + servers.engine_server,
|
13118 | api: protocal + servers.api_server
|
13119 | };
|
13120 |
|
13121 | _this2.AV._setServerURLs(serverURLs, false);
|
13122 |
|
13123 | _this2.lock(ttl);
|
13124 |
|
13125 | return Cache.setAsync('serverURLs', {
|
13126 | serverURLs: serverURLs,
|
13127 | lockedUntil: _this2.lockedUntil
|
13128 | }, ttl);
|
13129 | }).catch(function (error) {
|
13130 |
|
13131 | console.warn("refresh server URLs failed: ".concat(error.message));
|
13132 |
|
13133 | _this2.lock(600);
|
13134 | });
|
13135 | };
|
13136 |
|
13137 | module.exports = AppRouter;
|
13138 |
|
13139 | }),
|
13140 |
|
13141 | (function(module, exports, __webpack_require__) {
|
13142 |
|
13143 | module.exports = __webpack_require__(431);
|
13144 |
|
13145 |
|
13146 | }),
|
13147 |
|
13148 | (function(module, exports, __webpack_require__) {
|
13149 |
|
13150 | var parent = __webpack_require__(432);
|
13151 | __webpack_require__(454);
|
13152 | __webpack_require__(455);
|
13153 | __webpack_require__(456);
|
13154 | __webpack_require__(457);
|
13155 | __webpack_require__(458);
|
13156 |
|
13157 | __webpack_require__(459);
|
13158 | __webpack_require__(460);
|
13159 | __webpack_require__(461);
|
13160 |
|
13161 | module.exports = parent;
|
13162 |
|
13163 |
|
13164 | }),
|
13165 |
|
13166 | (function(module, exports, __webpack_require__) {
|
13167 |
|
13168 | var parent = __webpack_require__(241);
|
13169 |
|
13170 | module.exports = parent;
|
13171 |
|
13172 |
|
13173 | }),
|
13174 |
|
13175 | (function(module, exports, __webpack_require__) {
|
13176 |
|
13177 | __webpack_require__(227);
|
13178 | __webpack_require__(68);
|
13179 | __webpack_require__(242);
|
13180 | __webpack_require__(438);
|
13181 | __webpack_require__(439);
|
13182 | __webpack_require__(440);
|
13183 | __webpack_require__(441);
|
13184 | __webpack_require__(247);
|
13185 | __webpack_require__(442);
|
13186 | __webpack_require__(443);
|
13187 | __webpack_require__(444);
|
13188 | __webpack_require__(445);
|
13189 | __webpack_require__(446);
|
13190 | __webpack_require__(447);
|
13191 | __webpack_require__(448);
|
13192 | __webpack_require__(449);
|
13193 | __webpack_require__(450);
|
13194 | __webpack_require__(451);
|
13195 | __webpack_require__(452);
|
13196 | __webpack_require__(453);
|
13197 | var path = __webpack_require__(7);
|
13198 |
|
13199 | module.exports = path.Symbol;
|
13200 |
|
13201 |
|
13202 | }),
|
13203 |
|
13204 | (function(module, exports, __webpack_require__) {
|
13205 |
|
13206 | "use strict";
|
13207 |
|
13208 | var $ = __webpack_require__(0);
|
13209 | var global = __webpack_require__(8);
|
13210 | var call = __webpack_require__(15);
|
13211 | var uncurryThis = __webpack_require__(4);
|
13212 | var IS_PURE = __webpack_require__(36);
|
13213 | var DESCRIPTORS = __webpack_require__(14);
|
13214 | var NATIVE_SYMBOL = __webpack_require__(65);
|
13215 | var fails = __webpack_require__(2);
|
13216 | var hasOwn = __webpack_require__(13);
|
13217 | var isPrototypeOf = __webpack_require__(16);
|
13218 | var anObject = __webpack_require__(21);
|
13219 | var toIndexedObject = __webpack_require__(35);
|
13220 | var toPropertyKey = __webpack_require__(99);
|
13221 | var $toString = __webpack_require__(42);
|
13222 | var createPropertyDescriptor = __webpack_require__(49);
|
13223 | var nativeObjectCreate = __webpack_require__(53);
|
13224 | var objectKeys = __webpack_require__(107);
|
13225 | var getOwnPropertyNamesModule = __webpack_require__(105);
|
13226 | var getOwnPropertyNamesExternal = __webpack_require__(243);
|
13227 | var getOwnPropertySymbolsModule = __webpack_require__(106);
|
13228 | var getOwnPropertyDescriptorModule = __webpack_require__(64);
|
13229 | var definePropertyModule = __webpack_require__(23);
|
13230 | var definePropertiesModule = __webpack_require__(129);
|
13231 | var propertyIsEnumerableModule = __webpack_require__(121);
|
13232 | var defineBuiltIn = __webpack_require__(45);
|
13233 | var shared = __webpack_require__(82);
|
13234 | var sharedKey = __webpack_require__(103);
|
13235 | var hiddenKeys = __webpack_require__(83);
|
13236 | var uid = __webpack_require__(101);
|
13237 | var wellKnownSymbol = __webpack_require__(5);
|
13238 | var wrappedWellKnownSymbolModule = __webpack_require__(151);
|
13239 | var defineWellKnownSymbol = __webpack_require__(10);
|
13240 | var defineSymbolToPrimitive = __webpack_require__(245);
|
13241 | var setToStringTag = __webpack_require__(56);
|
13242 | var InternalStateModule = __webpack_require__(44);
|
13243 | var $forEach = __webpack_require__(75).forEach;
|
13244 |
|
13245 | var HIDDEN = sharedKey('hidden');
|
13246 | var SYMBOL = 'Symbol';
|
13247 | var PROTOTYPE = 'prototype';
|
13248 |
|
13249 | var setInternalState = InternalStateModule.set;
|
13250 | var getInternalState = InternalStateModule.getterFor(SYMBOL);
|
13251 |
|
13252 | var ObjectPrototype = Object[PROTOTYPE];
|
13253 | var $Symbol = global.Symbol;
|
13254 | var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
|
13255 | var TypeError = global.TypeError;
|
13256 | var QObject = global.QObject;
|
13257 | var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
13258 | var nativeDefineProperty = definePropertyModule.f;
|
13259 | var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
|
13260 | var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
|
13261 | var push = uncurryThis([].push);
|
13262 |
|
13263 | var AllSymbols = shared('symbols');
|
13264 | var ObjectPrototypeSymbols = shared('op-symbols');
|
13265 | var WellKnownSymbolsStore = shared('wks');
|
13266 |
|
13267 |
|
13268 | var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
13269 |
|
13270 |
|
13271 | var setSymbolDescriptor = DESCRIPTORS && fails(function () {
|
13272 | return nativeObjectCreate(nativeDefineProperty({}, 'a', {
|
13273 | get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
|
13274 | })).a != 7;
|
13275 | }) ? function (O, P, Attributes) {
|
13276 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
|
13277 | if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
|
13278 | nativeDefineProperty(O, P, Attributes);
|
13279 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
|
13280 | nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
|
13281 | }
|
13282 | } : nativeDefineProperty;
|
13283 |
|
13284 | var wrap = function (tag, description) {
|
13285 | var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
|
13286 | setInternalState(symbol, {
|
13287 | type: SYMBOL,
|
13288 | tag: tag,
|
13289 | description: description
|
13290 | });
|
13291 | if (!DESCRIPTORS) symbol.description = description;
|
13292 | return symbol;
|
13293 | };
|
13294 |
|
13295 | var $defineProperty = function defineProperty(O, P, Attributes) {
|
13296 | if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
13297 | anObject(O);
|
13298 | var key = toPropertyKey(P);
|
13299 | anObject(Attributes);
|
13300 | if (hasOwn(AllSymbols, key)) {
|
13301 | if (!Attributes.enumerable) {
|
13302 | if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
|
13303 | O[HIDDEN][key] = true;
|
13304 | } else {
|
13305 | if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
13306 | Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
|
13307 | } return setSymbolDescriptor(O, key, Attributes);
|
13308 | } return nativeDefineProperty(O, key, Attributes);
|
13309 | };
|
13310 |
|
13311 | var $defineProperties = function defineProperties(O, Properties) {
|
13312 | anObject(O);
|
13313 | var properties = toIndexedObject(Properties);
|
13314 | var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
|
13315 | $forEach(keys, function (key) {
|
13316 | if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
|
13317 | });
|
13318 | return O;
|
13319 | };
|
13320 |
|
13321 | var $create = function create(O, Properties) {
|
13322 | return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
|
13323 | };
|
13324 |
|
13325 | var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
13326 | var P = toPropertyKey(V);
|
13327 | var enumerable = call(nativePropertyIsEnumerable, this, P);
|
13328 | if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
|
13329 | return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
|
13330 | ? enumerable : true;
|
13331 | };
|
13332 |
|
13333 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
13334 | var it = toIndexedObject(O);
|
13335 | var key = toPropertyKey(P);
|
13336 | if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
|
13337 | var descriptor = nativeGetOwnPropertyDescriptor(it, key);
|
13338 | if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
|
13339 | descriptor.enumerable = true;
|
13340 | }
|
13341 | return descriptor;
|
13342 | };
|
13343 |
|
13344 | var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
13345 | var names = nativeGetOwnPropertyNames(toIndexedObject(O));
|
13346 | var result = [];
|
13347 | $forEach(names, function (key) {
|
13348 | if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
|
13349 | });
|
13350 | return result;
|
13351 | };
|
13352 |
|
13353 | var $getOwnPropertySymbols = function (O) {
|
13354 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
|
13355 | var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
|
13356 | var result = [];
|
13357 | $forEach(names, function (key) {
|
13358 | if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
|
13359 | push(result, AllSymbols[key]);
|
13360 | }
|
13361 | });
|
13362 | return result;
|
13363 | };
|
13364 |
|
13365 |
|
13366 |
|
13367 | if (!NATIVE_SYMBOL) {
|
13368 | $Symbol = function Symbol() {
|
13369 | if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
|
13370 | var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
|
13371 | var tag = uid(description);
|
13372 | var setter = function (value) {
|
13373 | if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
|
13374 | if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
13375 | setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
|
13376 | };
|
13377 | if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
|
13378 | return wrap(tag, description);
|
13379 | };
|
13380 |
|
13381 | SymbolPrototype = $Symbol[PROTOTYPE];
|
13382 |
|
13383 | defineBuiltIn(SymbolPrototype, 'toString', function toString() {
|
13384 | return getInternalState(this).tag;
|
13385 | });
|
13386 |
|
13387 | defineBuiltIn($Symbol, 'withoutSetter', function (description) {
|
13388 | return wrap(uid(description), description);
|
13389 | });
|
13390 |
|
13391 | propertyIsEnumerableModule.f = $propertyIsEnumerable;
|
13392 | definePropertyModule.f = $defineProperty;
|
13393 | definePropertiesModule.f = $defineProperties;
|
13394 | getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
|
13395 | getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
13396 | getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
|
13397 |
|
13398 | wrappedWellKnownSymbolModule.f = function (name) {
|
13399 | return wrap(wellKnownSymbol(name), name);
|
13400 | };
|
13401 |
|
13402 | if (DESCRIPTORS) {
|
13403 |
|
13404 | nativeDefineProperty(SymbolPrototype, 'description', {
|
13405 | configurable: true,
|
13406 | get: function description() {
|
13407 | return getInternalState(this).description;
|
13408 | }
|
13409 | });
|
13410 | if (!IS_PURE) {
|
13411 | defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
|
13412 | }
|
13413 | }
|
13414 | }
|
13415 |
|
13416 | $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
|
13417 | Symbol: $Symbol
|
13418 | });
|
13419 |
|
13420 | $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
|
13421 | defineWellKnownSymbol(name);
|
13422 | });
|
13423 |
|
13424 | $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
|
13425 | useSetter: function () { USE_SETTER = true; },
|
13426 | useSimple: function () { USE_SETTER = false; }
|
13427 | });
|
13428 |
|
13429 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
|
13430 |
|
13431 |
|
13432 | create: $create,
|
13433 |
|
13434 |
|
13435 | defineProperty: $defineProperty,
|
13436 |
|
13437 |
|
13438 | defineProperties: $defineProperties,
|
13439 |
|
13440 |
|
13441 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
13442 | });
|
13443 |
|
13444 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
|
13445 |
|
13446 |
|
13447 | getOwnPropertyNames: $getOwnPropertyNames
|
13448 | });
|
13449 |
|
13450 |
|
13451 |
|
13452 | defineSymbolToPrimitive();
|
13453 |
|
13454 |
|
13455 |
|
13456 | setToStringTag($Symbol, SYMBOL);
|
13457 |
|
13458 | hiddenKeys[HIDDEN] = true;
|
13459 |
|
13460 |
|
13461 | }),
|
13462 |
|
13463 | (function(module, exports, __webpack_require__) {
|
13464 |
|
13465 | var $ = __webpack_require__(0);
|
13466 | var getBuiltIn = __webpack_require__(20);
|
13467 | var hasOwn = __webpack_require__(13);
|
13468 | var toString = __webpack_require__(42);
|
13469 | var shared = __webpack_require__(82);
|
13470 | var NATIVE_SYMBOL_REGISTRY = __webpack_require__(246);
|
13471 |
|
13472 | var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
13473 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
13474 |
|
13475 |
|
13476 |
|
13477 | $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
|
13478 | 'for': function (key) {
|
13479 | var string = toString(key);
|
13480 | if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
13481 | var symbol = getBuiltIn('Symbol')(string);
|
13482 | StringToSymbolRegistry[string] = symbol;
|
13483 | SymbolToStringRegistry[symbol] = string;
|
13484 | return symbol;
|
13485 | }
|
13486 | });
|
13487 |
|
13488 |
|
13489 | }),
|
13490 |
|
13491 | (function(module, exports, __webpack_require__) {
|
13492 |
|
13493 | var $ = __webpack_require__(0);
|
13494 | var hasOwn = __webpack_require__(13);
|
13495 | var isSymbol = __webpack_require__(100);
|
13496 | var tryToString = __webpack_require__(67);
|
13497 | var shared = __webpack_require__(82);
|
13498 | var NATIVE_SYMBOL_REGISTRY = __webpack_require__(246);
|
13499 |
|
13500 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
13501 |
|
13502 |
|
13503 |
|
13504 | $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
|
13505 | keyFor: function keyFor(sym) {
|
13506 | if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');
|
13507 | if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
13508 | }
|
13509 | });
|
13510 |
|
13511 |
|
13512 | }),
|
13513 |
|
13514 | (function(module, exports, __webpack_require__) {
|
13515 |
|
13516 | var $ = __webpack_require__(0);
|
13517 | var NATIVE_SYMBOL = __webpack_require__(65);
|
13518 | var fails = __webpack_require__(2);
|
13519 | var getOwnPropertySymbolsModule = __webpack_require__(106);
|
13520 | var toObject = __webpack_require__(33);
|
13521 |
|
13522 |
|
13523 |
|
13524 | var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
|
13525 |
|
13526 |
|
13527 |
|
13528 | $({ target: 'Object', stat: true, forced: FORCED }, {
|
13529 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
13530 | var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
13531 | return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
|
13532 | }
|
13533 | });
|
13534 |
|
13535 |
|
13536 | }),
|
13537 |
|
13538 | (function(module, exports, __webpack_require__) {
|
13539 |
|
13540 | var defineWellKnownSymbol = __webpack_require__(10);
|
13541 |
|
13542 |
|
13543 |
|
13544 | defineWellKnownSymbol('asyncIterator');
|
13545 |
|
13546 |
|
13547 | }),
|
13548 |
|
13549 | (function(module, exports) {
|
13550 |
|
13551 |
|
13552 |
|
13553 |
|
13554 | }),
|
13555 |
|
13556 | (function(module, exports, __webpack_require__) {
|
13557 |
|
13558 | var defineWellKnownSymbol = __webpack_require__(10);
|
13559 |
|
13560 |
|
13561 |
|
13562 | defineWellKnownSymbol('hasInstance');
|
13563 |
|
13564 |
|
13565 | }),
|
13566 |
|
13567 | (function(module, exports, __webpack_require__) {
|
13568 |
|
13569 | var defineWellKnownSymbol = __webpack_require__(10);
|
13570 |
|
13571 |
|
13572 |
|
13573 | defineWellKnownSymbol('isConcatSpreadable');
|
13574 |
|
13575 |
|
13576 | }),
|
13577 |
|
13578 | (function(module, exports, __webpack_require__) {
|
13579 |
|
13580 | var defineWellKnownSymbol = __webpack_require__(10);
|
13581 |
|
13582 |
|
13583 |
|
13584 | defineWellKnownSymbol('match');
|
13585 |
|
13586 |
|
13587 | }),
|
13588 |
|
13589 | (function(module, exports, __webpack_require__) {
|
13590 |
|
13591 | var defineWellKnownSymbol = __webpack_require__(10);
|
13592 |
|
13593 |
|
13594 |
|
13595 | defineWellKnownSymbol('matchAll');
|
13596 |
|
13597 |
|
13598 | }),
|
13599 |
|
13600 | (function(module, exports, __webpack_require__) {
|
13601 |
|
13602 | var defineWellKnownSymbol = __webpack_require__(10);
|
13603 |
|
13604 |
|
13605 |
|
13606 | defineWellKnownSymbol('replace');
|
13607 |
|
13608 |
|
13609 | }),
|
13610 |
|
13611 | (function(module, exports, __webpack_require__) {
|
13612 |
|
13613 | var defineWellKnownSymbol = __webpack_require__(10);
|
13614 |
|
13615 |
|
13616 |
|
13617 | defineWellKnownSymbol('search');
|
13618 |
|
13619 |
|
13620 | }),
|
13621 |
|
13622 | (function(module, exports, __webpack_require__) {
|
13623 |
|
13624 | var defineWellKnownSymbol = __webpack_require__(10);
|
13625 |
|
13626 |
|
13627 |
|
13628 | defineWellKnownSymbol('species');
|
13629 |
|
13630 |
|
13631 | }),
|
13632 |
|
13633 | (function(module, exports, __webpack_require__) {
|
13634 |
|
13635 | var defineWellKnownSymbol = __webpack_require__(10);
|
13636 |
|
13637 |
|
13638 |
|
13639 | defineWellKnownSymbol('split');
|
13640 |
|
13641 |
|
13642 | }),
|
13643 |
|
13644 | (function(module, exports, __webpack_require__) {
|
13645 |
|
13646 | var defineWellKnownSymbol = __webpack_require__(10);
|
13647 | var defineSymbolToPrimitive = __webpack_require__(245);
|
13648 |
|
13649 |
|
13650 |
|
13651 | defineWellKnownSymbol('toPrimitive');
|
13652 |
|
13653 |
|
13654 |
|
13655 | defineSymbolToPrimitive();
|
13656 |
|
13657 |
|
13658 | }),
|
13659 |
|
13660 | (function(module, exports, __webpack_require__) {
|
13661 |
|
13662 | var getBuiltIn = __webpack_require__(20);
|
13663 | var defineWellKnownSymbol = __webpack_require__(10);
|
13664 | var setToStringTag = __webpack_require__(56);
|
13665 |
|
13666 |
|
13667 |
|
13668 | defineWellKnownSymbol('toStringTag');
|
13669 |
|
13670 |
|
13671 |
|
13672 | setToStringTag(getBuiltIn('Symbol'), 'Symbol');
|
13673 |
|
13674 |
|
13675 | }),
|
13676 |
|
13677 | (function(module, exports, __webpack_require__) {
|
13678 |
|
13679 | var defineWellKnownSymbol = __webpack_require__(10);
|
13680 |
|
13681 |
|
13682 |
|
13683 | defineWellKnownSymbol('unscopables');
|
13684 |
|
13685 |
|
13686 | }),
|
13687 |
|
13688 | (function(module, exports, __webpack_require__) {
|
13689 |
|
13690 | var global = __webpack_require__(8);
|
13691 | var setToStringTag = __webpack_require__(56);
|
13692 |
|
13693 |
|
13694 |
|
13695 | setToStringTag(global.JSON, 'JSON', true);
|
13696 |
|
13697 |
|
13698 | }),
|
13699 |
|
13700 | (function(module, exports) {
|
13701 |
|
13702 |
|
13703 |
|
13704 |
|
13705 | }),
|
13706 |
|
13707 | (function(module, exports) {
|
13708 |
|
13709 |
|
13710 |
|
13711 |
|
13712 | }),
|
13713 |
|
13714 | (function(module, exports, __webpack_require__) {
|
13715 |
|
13716 | var defineWellKnownSymbol = __webpack_require__(10);
|
13717 |
|
13718 |
|
13719 |
|
13720 | defineWellKnownSymbol('asyncDispose');
|
13721 |
|
13722 |
|
13723 | }),
|
13724 |
|
13725 | (function(module, exports, __webpack_require__) {
|
13726 |
|
13727 | var defineWellKnownSymbol = __webpack_require__(10);
|
13728 |
|
13729 |
|
13730 |
|
13731 | defineWellKnownSymbol('dispose');
|
13732 |
|
13733 |
|
13734 | }),
|
13735 |
|
13736 | (function(module, exports, __webpack_require__) {
|
13737 |
|
13738 | var defineWellKnownSymbol = __webpack_require__(10);
|
13739 |
|
13740 |
|
13741 |
|
13742 | defineWellKnownSymbol('matcher');
|
13743 |
|
13744 |
|
13745 | }),
|
13746 |
|
13747 | (function(module, exports, __webpack_require__) {
|
13748 |
|
13749 | var defineWellKnownSymbol = __webpack_require__(10);
|
13750 |
|
13751 |
|
13752 |
|
13753 | defineWellKnownSymbol('metadataKey');
|
13754 |
|
13755 |
|
13756 | }),
|
13757 |
|
13758 | (function(module, exports, __webpack_require__) {
|
13759 |
|
13760 | var defineWellKnownSymbol = __webpack_require__(10);
|
13761 |
|
13762 |
|
13763 |
|
13764 | defineWellKnownSymbol('observable');
|
13765 |
|
13766 |
|
13767 | }),
|
13768 |
|
13769 | (function(module, exports, __webpack_require__) {
|
13770 |
|
13771 |
|
13772 | var defineWellKnownSymbol = __webpack_require__(10);
|
13773 |
|
13774 |
|
13775 |
|
13776 | defineWellKnownSymbol('metadata');
|
13777 |
|
13778 |
|
13779 | }),
|
13780 |
|
13781 | (function(module, exports, __webpack_require__) {
|
13782 |
|
13783 |
|
13784 | var defineWellKnownSymbol = __webpack_require__(10);
|
13785 |
|
13786 |
|
13787 |
|
13788 | defineWellKnownSymbol('patternMatch');
|
13789 |
|
13790 |
|
13791 | }),
|
13792 |
|
13793 | (function(module, exports, __webpack_require__) {
|
13794 |
|
13795 |
|
13796 | var defineWellKnownSymbol = __webpack_require__(10);
|
13797 |
|
13798 | defineWellKnownSymbol('replaceAll');
|
13799 |
|
13800 |
|
13801 | }),
|
13802 |
|
13803 | (function(module, exports, __webpack_require__) {
|
13804 |
|
13805 | module.exports = __webpack_require__(463);
|
13806 |
|
13807 | }),
|
13808 |
|
13809 | (function(module, exports, __webpack_require__) {
|
13810 |
|
13811 | module.exports = __webpack_require__(464);
|
13812 |
|
13813 |
|
13814 | }),
|
13815 |
|
13816 | (function(module, exports, __webpack_require__) {
|
13817 |
|
13818 | var parent = __webpack_require__(465);
|
13819 |
|
13820 | module.exports = parent;
|
13821 |
|
13822 |
|
13823 | }),
|
13824 |
|
13825 | (function(module, exports, __webpack_require__) {
|
13826 |
|
13827 | var parent = __webpack_require__(248);
|
13828 |
|
13829 | module.exports = parent;
|
13830 |
|
13831 |
|
13832 | }),
|
13833 |
|
13834 | (function(module, exports, __webpack_require__) {
|
13835 |
|
13836 | __webpack_require__(43);
|
13837 | __webpack_require__(68);
|
13838 | __webpack_require__(70);
|
13839 | __webpack_require__(247);
|
13840 | var WrappedWellKnownSymbolModule = __webpack_require__(151);
|
13841 |
|
13842 | module.exports = WrappedWellKnownSymbolModule.f('iterator');
|
13843 |
|
13844 |
|
13845 | }),
|
13846 |
|
13847 | (function(module, exports, __webpack_require__) {
|
13848 |
|
13849 | var parent = __webpack_require__(468);
|
13850 |
|
13851 | module.exports = parent;
|
13852 |
|
13853 |
|
13854 | }),
|
13855 |
|
13856 | (function(module, exports, __webpack_require__) {
|
13857 |
|
13858 | var isPrototypeOf = __webpack_require__(16);
|
13859 | var method = __webpack_require__(469);
|
13860 |
|
13861 | var ArrayPrototype = Array.prototype;
|
13862 |
|
13863 | module.exports = function (it) {
|
13864 | var own = it.filter;
|
13865 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;
|
13866 | };
|
13867 |
|
13868 |
|
13869 | }),
|
13870 |
|
13871 | (function(module, exports, __webpack_require__) {
|
13872 |
|
13873 | __webpack_require__(470);
|
13874 | var entryVirtual = __webpack_require__(27);
|
13875 |
|
13876 | module.exports = entryVirtual('Array').filter;
|
13877 |
|
13878 |
|
13879 | }),
|
13880 |
|
13881 | (function(module, exports, __webpack_require__) {
|
13882 |
|
13883 | "use strict";
|
13884 |
|
13885 | var $ = __webpack_require__(0);
|
13886 | var $filter = __webpack_require__(75).filter;
|
13887 | var arrayMethodHasSpeciesSupport = __webpack_require__(116);
|
13888 |
|
13889 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
13890 |
|
13891 |
|
13892 |
|
13893 |
|
13894 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
13895 | filter: function filter(callbackfn /* , thisArg */) {
|
13896 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
13897 | }
|
13898 | });
|
13899 |
|
13900 |
|
13901 | }),
|
13902 |
|
13903 | (function(module, exports, __webpack_require__) {
|
13904 |
|
13905 | "use strict";
|
13906 |
|
13907 |
|
13908 | var _interopRequireDefault = __webpack_require__(1);
|
13909 |
|
13910 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
13911 |
|
13912 | var _keys = _interopRequireDefault(__webpack_require__(62));
|
13913 |
|
13914 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
13915 |
|
13916 | var _ = __webpack_require__(3);
|
13917 |
|
13918 | module.exports = function (AV) {
|
13919 | var eventSplitter = /\s+/;
|
13920 | var slice = (0, _slice.default)(Array.prototype);
|
13921 | |
13922 |
|
13923 |
|
13924 |
|
13925 |
|
13926 |
|
13927 |
|
13928 |
|
13929 |
|
13930 |
|
13931 |
|
13932 |
|
13933 |
|
13934 |
|
13935 |
|
13936 |
|
13937 |
|
13938 |
|
13939 |
|
13940 |
|
13941 |
|
13942 | AV.Events = {
|
13943 | |
13944 |
|
13945 |
|
13946 |
|
13947 | on: function on(events, callback, context) {
|
13948 | var calls, event, node, tail, list;
|
13949 |
|
13950 | if (!callback) {
|
13951 | return this;
|
13952 | }
|
13953 |
|
13954 | events = events.split(eventSplitter);
|
13955 | calls = this._callbacks || (this._callbacks = {});
|
13956 |
|
13957 |
|
13958 |
|
13959 | event = events.shift();
|
13960 |
|
13961 | while (event) {
|
13962 | list = calls[event];
|
13963 | node = list ? list.tail : {};
|
13964 | node.next = tail = {};
|
13965 | node.context = context;
|
13966 | node.callback = callback;
|
13967 | calls[event] = {
|
13968 | tail: tail,
|
13969 | next: list ? list.next : node
|
13970 | };
|
13971 | event = events.shift();
|
13972 | }
|
13973 |
|
13974 | return this;
|
13975 | },
|
13976 |
|
13977 | |
13978 |
|
13979 |
|
13980 |
|
13981 |
|
13982 | off: function off(events, callback, context) {
|
13983 | var event, calls, node, tail, cb, ctx;
|
13984 |
|
13985 | if (!(calls = this._callbacks)) {
|
13986 | return;
|
13987 | }
|
13988 |
|
13989 | if (!(events || callback || context)) {
|
13990 | delete this._callbacks;
|
13991 | return this;
|
13992 | }
|
13993 |
|
13994 |
|
13995 |
|
13996 | events = events ? events.split(eventSplitter) : (0, _keys.default)(_).call(_, calls);
|
13997 | event = events.shift();
|
13998 |
|
13999 | while (event) {
|
14000 | node = calls[event];
|
14001 | delete calls[event];
|
14002 |
|
14003 | if (!node || !(callback || context)) {
|
14004 | continue;
|
14005 | }
|
14006 |
|
14007 |
|
14008 | tail = node.tail;
|
14009 | node = node.next;
|
14010 |
|
14011 | while (node !== tail) {
|
14012 | cb = node.callback;
|
14013 | ctx = node.context;
|
14014 |
|
14015 | if (callback && cb !== callback || context && ctx !== context) {
|
14016 | this.on(event, cb, ctx);
|
14017 | }
|
14018 |
|
14019 | node = node.next;
|
14020 | }
|
14021 |
|
14022 | event = events.shift();
|
14023 | }
|
14024 |
|
14025 | return this;
|
14026 | },
|
14027 |
|
14028 | |
14029 |
|
14030 |
|
14031 |
|
14032 |
|
14033 |
|
14034 | trigger: function trigger(events) {
|
14035 | var event, node, calls, tail, args, all, rest;
|
14036 |
|
14037 | if (!(calls = this._callbacks)) {
|
14038 | return this;
|
14039 | }
|
14040 |
|
14041 | all = calls.all;
|
14042 | events = events.split(eventSplitter);
|
14043 | rest = slice.call(arguments, 1);
|
14044 |
|
14045 |
|
14046 | event = events.shift();
|
14047 |
|
14048 | while (event) {
|
14049 | node = calls[event];
|
14050 |
|
14051 | if (node) {
|
14052 | tail = node.tail;
|
14053 |
|
14054 | while ((node = node.next) !== tail) {
|
14055 | node.callback.apply(node.context || this, rest);
|
14056 | }
|
14057 | }
|
14058 |
|
14059 | node = all;
|
14060 |
|
14061 | if (node) {
|
14062 | var _context;
|
14063 |
|
14064 | tail = node.tail;
|
14065 | args = (0, _concat.default)(_context = [event]).call(_context, rest);
|
14066 |
|
14067 | while ((node = node.next) !== tail) {
|
14068 | node.callback.apply(node.context || this, args);
|
14069 | }
|
14070 | }
|
14071 |
|
14072 | event = events.shift();
|
14073 | }
|
14074 |
|
14075 | return this;
|
14076 | }
|
14077 | };
|
14078 | |
14079 |
|
14080 |
|
14081 |
|
14082 | AV.Events.bind = AV.Events.on;
|
14083 | |
14084 |
|
14085 |
|
14086 |
|
14087 | AV.Events.unbind = AV.Events.off;
|
14088 | };
|
14089 |
|
14090 | }),
|
14091 |
|
14092 | (function(module, exports, __webpack_require__) {
|
14093 |
|
14094 | "use strict";
|
14095 |
|
14096 |
|
14097 | var _interopRequireDefault = __webpack_require__(1);
|
14098 |
|
14099 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
14100 |
|
14101 | var _ = __webpack_require__(3);
|
14102 |
|
14103 |
|
14104 |
|
14105 | module.exports = function (AV) {
|
14106 | |
14107 |
|
14108 |
|
14109 |
|
14110 |
|
14111 |
|
14112 |
|
14113 |
|
14114 |
|
14115 |
|
14116 |
|
14117 |
|
14118 |
|
14119 |
|
14120 |
|
14121 |
|
14122 |
|
14123 |
|
14124 |
|
14125 |
|
14126 |
|
14127 |
|
14128 | AV.GeoPoint = function (arg1, arg2) {
|
14129 | if (_.isArray(arg1)) {
|
14130 | AV.GeoPoint._validate(arg1[0], arg1[1]);
|
14131 |
|
14132 | this.latitude = arg1[0];
|
14133 | this.longitude = arg1[1];
|
14134 | } else if (_.isObject(arg1)) {
|
14135 | AV.GeoPoint._validate(arg1.latitude, arg1.longitude);
|
14136 |
|
14137 | this.latitude = arg1.latitude;
|
14138 | this.longitude = arg1.longitude;
|
14139 | } else if (_.isNumber(arg1) && _.isNumber(arg2)) {
|
14140 | AV.GeoPoint._validate(arg1, arg2);
|
14141 |
|
14142 | this.latitude = arg1;
|
14143 | this.longitude = arg2;
|
14144 | } else {
|
14145 | this.latitude = 0;
|
14146 | this.longitude = 0;
|
14147 | }
|
14148 |
|
14149 |
|
14150 |
|
14151 | var self = this;
|
14152 |
|
14153 | if (this.__defineGetter__ && this.__defineSetter__) {
|
14154 |
|
14155 |
|
14156 | this._latitude = this.latitude;
|
14157 | this._longitude = this.longitude;
|
14158 |
|
14159 | this.__defineGetter__('latitude', function () {
|
14160 | return self._latitude;
|
14161 | });
|
14162 |
|
14163 | this.__defineGetter__('longitude', function () {
|
14164 | return self._longitude;
|
14165 | });
|
14166 |
|
14167 | this.__defineSetter__('latitude', function (val) {
|
14168 | AV.GeoPoint._validate(val, self.longitude);
|
14169 |
|
14170 | self._latitude = val;
|
14171 | });
|
14172 |
|
14173 | this.__defineSetter__('longitude', function (val) {
|
14174 | AV.GeoPoint._validate(self.latitude, val);
|
14175 |
|
14176 | self._longitude = val;
|
14177 | });
|
14178 | }
|
14179 | };
|
14180 | |
14181 |
|
14182 |
|
14183 |
|
14184 |
|
14185 |
|
14186 |
|
14187 |
|
14188 | |
14189 |
|
14190 |
|
14191 |
|
14192 |
|
14193 |
|
14194 | AV.GeoPoint._validate = function (latitude, longitude) {
|
14195 | if (latitude < -90.0) {
|
14196 | throw new Error('AV.GeoPoint latitude ' + latitude + ' < -90.0.');
|
14197 | }
|
14198 |
|
14199 | if (latitude > 90.0) {
|
14200 | throw new Error('AV.GeoPoint latitude ' + latitude + ' > 90.0.');
|
14201 | }
|
14202 |
|
14203 | if (longitude < -180.0) {
|
14204 | throw new Error('AV.GeoPoint longitude ' + longitude + ' < -180.0.');
|
14205 | }
|
14206 |
|
14207 | if (longitude > 180.0) {
|
14208 | throw new Error('AV.GeoPoint longitude ' + longitude + ' > 180.0.');
|
14209 | }
|
14210 | };
|
14211 | |
14212 |
|
14213 |
|
14214 |
|
14215 |
|
14216 |
|
14217 | AV.GeoPoint.current = function () {
|
14218 | return new _promise.default(function (resolve, reject) {
|
14219 | navigator.geolocation.getCurrentPosition(function (location) {
|
14220 | resolve(new AV.GeoPoint({
|
14221 | latitude: location.coords.latitude,
|
14222 | longitude: location.coords.longitude
|
14223 | }));
|
14224 | }, reject);
|
14225 | });
|
14226 | };
|
14227 |
|
14228 | _.extend(AV.GeoPoint.prototype,
|
14229 |
|
14230 | {
|
14231 | |
14232 |
|
14233 |
|
14234 |
|
14235 | toJSON: function toJSON() {
|
14236 | AV.GeoPoint._validate(this.latitude, this.longitude);
|
14237 |
|
14238 | return {
|
14239 | __type: 'GeoPoint',
|
14240 | latitude: this.latitude,
|
14241 | longitude: this.longitude
|
14242 | };
|
14243 | },
|
14244 |
|
14245 | |
14246 |
|
14247 |
|
14248 |
|
14249 |
|
14250 | radiansTo: function radiansTo(point) {
|
14251 | var d2r = Math.PI / 180.0;
|
14252 | var lat1rad = this.latitude * d2r;
|
14253 | var long1rad = this.longitude * d2r;
|
14254 | var lat2rad = point.latitude * d2r;
|
14255 | var long2rad = point.longitude * d2r;
|
14256 | var deltaLat = lat1rad - lat2rad;
|
14257 | var deltaLong = long1rad - long2rad;
|
14258 | var sinDeltaLatDiv2 = Math.sin(deltaLat / 2);
|
14259 | var sinDeltaLongDiv2 = Math.sin(deltaLong / 2);
|
14260 |
|
14261 | var a = sinDeltaLatDiv2 * sinDeltaLatDiv2 + Math.cos(lat1rad) * Math.cos(lat2rad) * sinDeltaLongDiv2 * sinDeltaLongDiv2;
|
14262 | a = Math.min(1.0, a);
|
14263 | return 2 * Math.asin(Math.sqrt(a));
|
14264 | },
|
14265 |
|
14266 | |
14267 |
|
14268 |
|
14269 |
|
14270 |
|
14271 | kilometersTo: function kilometersTo(point) {
|
14272 | return this.radiansTo(point) * 6371.0;
|
14273 | },
|
14274 |
|
14275 | |
14276 |
|
14277 |
|
14278 |
|
14279 |
|
14280 | milesTo: function milesTo(point) {
|
14281 | return this.radiansTo(point) * 3958.8;
|
14282 | }
|
14283 | });
|
14284 | };
|
14285 |
|
14286 | }),
|
14287 |
|
14288 | (function(module, exports, __webpack_require__) {
|
14289 |
|
14290 | "use strict";
|
14291 |
|
14292 |
|
14293 | var _ = __webpack_require__(3);
|
14294 |
|
14295 | module.exports = function (AV) {
|
14296 | var PUBLIC_KEY = '*';
|
14297 | |
14298 |
|
14299 |
|
14300 |
|
14301 |
|
14302 |
|
14303 |
|
14304 |
|
14305 |
|
14306 |
|
14307 |
|
14308 |
|
14309 |
|
14310 |
|
14311 |
|
14312 | AV.ACL = function (arg1) {
|
14313 | var self = this;
|
14314 | self.permissionsById = {};
|
14315 |
|
14316 | if (_.isObject(arg1)) {
|
14317 | if (arg1 instanceof AV.User) {
|
14318 | self.setReadAccess(arg1, true);
|
14319 | self.setWriteAccess(arg1, true);
|
14320 | } else {
|
14321 | if (_.isFunction(arg1)) {
|
14322 | throw new Error('AV.ACL() called with a function. Did you forget ()?');
|
14323 | }
|
14324 |
|
14325 | AV._objectEach(arg1, function (accessList, userId) {
|
14326 | if (!_.isString(userId)) {
|
14327 | throw new Error('Tried to create an ACL with an invalid userId.');
|
14328 | }
|
14329 |
|
14330 | self.permissionsById[userId] = {};
|
14331 |
|
14332 | AV._objectEach(accessList, function (allowed, permission) {
|
14333 | if (permission !== 'read' && permission !== 'write') {
|
14334 | throw new Error('Tried to create an ACL with an invalid permission type.');
|
14335 | }
|
14336 |
|
14337 | if (!_.isBoolean(allowed)) {
|
14338 | throw new Error('Tried to create an ACL with an invalid permission value.');
|
14339 | }
|
14340 |
|
14341 | self.permissionsById[userId][permission] = allowed;
|
14342 | });
|
14343 | });
|
14344 | }
|
14345 | }
|
14346 | };
|
14347 | |
14348 |
|
14349 |
|
14350 |
|
14351 |
|
14352 |
|
14353 | AV.ACL.prototype.toJSON = function () {
|
14354 | return _.clone(this.permissionsById);
|
14355 | };
|
14356 |
|
14357 | AV.ACL.prototype._setAccess = function (accessType, userId, allowed) {
|
14358 | if (userId instanceof AV.User) {
|
14359 | userId = userId.id;
|
14360 | } else if (userId instanceof AV.Role) {
|
14361 | userId = 'role:' + userId.getName();
|
14362 | }
|
14363 |
|
14364 | if (!_.isString(userId)) {
|
14365 | throw new Error('userId must be a string.');
|
14366 | }
|
14367 |
|
14368 | if (!_.isBoolean(allowed)) {
|
14369 | throw new Error('allowed must be either true or false.');
|
14370 | }
|
14371 |
|
14372 | var permissions = this.permissionsById[userId];
|
14373 |
|
14374 | if (!permissions) {
|
14375 | if (!allowed) {
|
14376 |
|
14377 | return;
|
14378 | } else {
|
14379 | permissions = {};
|
14380 | this.permissionsById[userId] = permissions;
|
14381 | }
|
14382 | }
|
14383 |
|
14384 | if (allowed) {
|
14385 | this.permissionsById[userId][accessType] = true;
|
14386 | } else {
|
14387 | delete permissions[accessType];
|
14388 |
|
14389 | if (_.isEmpty(permissions)) {
|
14390 | delete this.permissionsById[userId];
|
14391 | }
|
14392 | }
|
14393 | };
|
14394 |
|
14395 | AV.ACL.prototype._getAccess = function (accessType, userId) {
|
14396 | if (userId instanceof AV.User) {
|
14397 | userId = userId.id;
|
14398 | } else if (userId instanceof AV.Role) {
|
14399 | userId = 'role:' + userId.getName();
|
14400 | }
|
14401 |
|
14402 | var permissions = this.permissionsById[userId];
|
14403 |
|
14404 | if (!permissions) {
|
14405 | return false;
|
14406 | }
|
14407 |
|
14408 | return permissions[accessType] ? true : false;
|
14409 | };
|
14410 | |
14411 |
|
14412 |
|
14413 |
|
14414 |
|
14415 |
|
14416 |
|
14417 | AV.ACL.prototype.setReadAccess = function (userId, allowed) {
|
14418 | this._setAccess('read', userId, allowed);
|
14419 | };
|
14420 | |
14421 |
|
14422 |
|
14423 |
|
14424 |
|
14425 |
|
14426 |
|
14427 |
|
14428 |
|
14429 |
|
14430 | AV.ACL.prototype.getReadAccess = function (userId) {
|
14431 | return this._getAccess('read', userId);
|
14432 | };
|
14433 | |
14434 |
|
14435 |
|
14436 |
|
14437 |
|
14438 |
|
14439 |
|
14440 | AV.ACL.prototype.setWriteAccess = function (userId, allowed) {
|
14441 | this._setAccess('write', userId, allowed);
|
14442 | };
|
14443 | |
14444 |
|
14445 |
|
14446 |
|
14447 |
|
14448 |
|
14449 |
|
14450 |
|
14451 |
|
14452 |
|
14453 | AV.ACL.prototype.getWriteAccess = function (userId) {
|
14454 | return this._getAccess('write', userId);
|
14455 | };
|
14456 | |
14457 |
|
14458 |
|
14459 |
|
14460 |
|
14461 |
|
14462 | AV.ACL.prototype.setPublicReadAccess = function (allowed) {
|
14463 | this.setReadAccess(PUBLIC_KEY, allowed);
|
14464 | };
|
14465 | |
14466 |
|
14467 |
|
14468 |
|
14469 |
|
14470 |
|
14471 | AV.ACL.prototype.getPublicReadAccess = function () {
|
14472 | return this.getReadAccess(PUBLIC_KEY);
|
14473 | };
|
14474 | |
14475 |
|
14476 |
|
14477 |
|
14478 |
|
14479 |
|
14480 | AV.ACL.prototype.setPublicWriteAccess = function (allowed) {
|
14481 | this.setWriteAccess(PUBLIC_KEY, allowed);
|
14482 | };
|
14483 | |
14484 |
|
14485 |
|
14486 |
|
14487 |
|
14488 |
|
14489 | AV.ACL.prototype.getPublicWriteAccess = function () {
|
14490 | return this.getWriteAccess(PUBLIC_KEY);
|
14491 | };
|
14492 | |
14493 |
|
14494 |
|
14495 |
|
14496 |
|
14497 |
|
14498 |
|
14499 |
|
14500 |
|
14501 |
|
14502 |
|
14503 | AV.ACL.prototype.getRoleReadAccess = function (role) {
|
14504 | if (role instanceof AV.Role) {
|
14505 |
|
14506 | role = role.getName();
|
14507 | }
|
14508 |
|
14509 | if (_.isString(role)) {
|
14510 | return this.getReadAccess('role:' + role);
|
14511 | }
|
14512 |
|
14513 | throw new Error('role must be a AV.Role or a String');
|
14514 | };
|
14515 | |
14516 |
|
14517 |
|
14518 |
|
14519 |
|
14520 |
|
14521 |
|
14522 |
|
14523 |
|
14524 |
|
14525 |
|
14526 | AV.ACL.prototype.getRoleWriteAccess = function (role) {
|
14527 | if (role instanceof AV.Role) {
|
14528 |
|
14529 | role = role.getName();
|
14530 | }
|
14531 |
|
14532 | if (_.isString(role)) {
|
14533 | return this.getWriteAccess('role:' + role);
|
14534 | }
|
14535 |
|
14536 | throw new Error('role must be a AV.Role or a String');
|
14537 | };
|
14538 | |
14539 |
|
14540 |
|
14541 |
|
14542 |
|
14543 |
|
14544 |
|
14545 |
|
14546 |
|
14547 |
|
14548 | AV.ACL.prototype.setRoleReadAccess = function (role, allowed) {
|
14549 | if (role instanceof AV.Role) {
|
14550 |
|
14551 | role = role.getName();
|
14552 | }
|
14553 |
|
14554 | if (_.isString(role)) {
|
14555 | this.setReadAccess('role:' + role, allowed);
|
14556 | return;
|
14557 | }
|
14558 |
|
14559 | throw new Error('role must be a AV.Role or a String');
|
14560 | };
|
14561 | |
14562 |
|
14563 |
|
14564 |
|
14565 |
|
14566 |
|
14567 |
|
14568 |
|
14569 |
|
14570 |
|
14571 | AV.ACL.prototype.setRoleWriteAccess = function (role, allowed) {
|
14572 | if (role instanceof AV.Role) {
|
14573 |
|
14574 | role = role.getName();
|
14575 | }
|
14576 |
|
14577 | if (_.isString(role)) {
|
14578 | this.setWriteAccess('role:' + role, allowed);
|
14579 | return;
|
14580 | }
|
14581 |
|
14582 | throw new Error('role must be a AV.Role or a String');
|
14583 | };
|
14584 | };
|
14585 |
|
14586 | }),
|
14587 |
|
14588 | (function(module, exports, __webpack_require__) {
|
14589 |
|
14590 | "use strict";
|
14591 |
|
14592 |
|
14593 | var _interopRequireDefault = __webpack_require__(1);
|
14594 |
|
14595 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
14596 |
|
14597 | var _find = _interopRequireDefault(__webpack_require__(96));
|
14598 |
|
14599 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
14600 |
|
14601 | var _map = _interopRequireDefault(__webpack_require__(37));
|
14602 |
|
14603 | var _ = __webpack_require__(3);
|
14604 |
|
14605 | module.exports = function (AV) {
|
14606 | |
14607 |
|
14608 |
|
14609 |
|
14610 |
|
14611 |
|
14612 |
|
14613 |
|
14614 |
|
14615 |
|
14616 |
|
14617 |
|
14618 |
|
14619 | AV.Op = function () {
|
14620 | this._initialize.apply(this, arguments);
|
14621 | };
|
14622 |
|
14623 | _.extend(AV.Op.prototype,
|
14624 |
|
14625 | {
|
14626 | _initialize: function _initialize() {}
|
14627 | });
|
14628 |
|
14629 | _.extend(AV.Op, {
|
14630 | |
14631 |
|
14632 |
|
14633 |
|
14634 | _extend: AV._extend,
|
14635 |
|
14636 | _opDecoderMap: {},
|
14637 |
|
14638 | |
14639 |
|
14640 |
|
14641 |
|
14642 |
|
14643 | _registerDecoder: function _registerDecoder(opName, decoder) {
|
14644 | AV.Op._opDecoderMap[opName] = decoder;
|
14645 | },
|
14646 |
|
14647 | |
14648 |
|
14649 |
|
14650 |
|
14651 | _decode: function _decode(json) {
|
14652 | var decoder = AV.Op._opDecoderMap[json.__op];
|
14653 |
|
14654 | if (decoder) {
|
14655 | return decoder(json);
|
14656 | } else {
|
14657 | return undefined;
|
14658 | }
|
14659 | }
|
14660 | });
|
14661 | |
14662 |
|
14663 |
|
14664 |
|
14665 |
|
14666 | AV.Op._registerDecoder('Batch', function (json) {
|
14667 | var op = null;
|
14668 |
|
14669 | AV._arrayEach(json.ops, function (nextOp) {
|
14670 | nextOp = AV.Op._decode(nextOp);
|
14671 | op = nextOp._mergeWithPrevious(op);
|
14672 | });
|
14673 |
|
14674 | return op;
|
14675 | });
|
14676 | |
14677 |
|
14678 |
|
14679 |
|
14680 |
|
14681 |
|
14682 |
|
14683 |
|
14684 |
|
14685 | AV.Op.Set = AV.Op._extend(
|
14686 |
|
14687 | {
|
14688 | _initialize: function _initialize(value) {
|
14689 | this._value = value;
|
14690 | },
|
14691 |
|
14692 | |
14693 |
|
14694 |
|
14695 | value: function value() {
|
14696 | return this._value;
|
14697 | },
|
14698 |
|
14699 | |
14700 |
|
14701 |
|
14702 |
|
14703 | toJSON: function toJSON() {
|
14704 | return AV._encode(this.value());
|
14705 | },
|
14706 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14707 | return this;
|
14708 | },
|
14709 | _estimate: function _estimate(oldValue) {
|
14710 | return this.value();
|
14711 | }
|
14712 | });
|
14713 | |
14714 |
|
14715 |
|
14716 |
|
14717 |
|
14718 |
|
14719 | AV.Op._UNSET = {};
|
14720 | |
14721 |
|
14722 |
|
14723 |
|
14724 |
|
14725 |
|
14726 |
|
14727 | AV.Op.Unset = AV.Op._extend(
|
14728 |
|
14729 | {
|
14730 | |
14731 |
|
14732 |
|
14733 |
|
14734 | toJSON: function toJSON() {
|
14735 | return {
|
14736 | __op: 'Delete'
|
14737 | };
|
14738 | },
|
14739 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14740 | return this;
|
14741 | },
|
14742 | _estimate: function _estimate(oldValue) {
|
14743 | return AV.Op._UNSET;
|
14744 | }
|
14745 | });
|
14746 |
|
14747 | AV.Op._registerDecoder('Delete', function (json) {
|
14748 | return new AV.Op.Unset();
|
14749 | });
|
14750 | |
14751 |
|
14752 |
|
14753 |
|
14754 |
|
14755 |
|
14756 |
|
14757 |
|
14758 | AV.Op.Increment = AV.Op._extend(
|
14759 |
|
14760 | {
|
14761 | _initialize: function _initialize(amount) {
|
14762 | this._amount = amount;
|
14763 | },
|
14764 |
|
14765 | |
14766 |
|
14767 |
|
14768 |
|
14769 | amount: function amount() {
|
14770 | return this._amount;
|
14771 | },
|
14772 |
|
14773 | |
14774 |
|
14775 |
|
14776 |
|
14777 | toJSON: function toJSON() {
|
14778 | return {
|
14779 | __op: 'Increment',
|
14780 | amount: this._amount
|
14781 | };
|
14782 | },
|
14783 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14784 | if (!previous) {
|
14785 | return this;
|
14786 | } else if (previous instanceof AV.Op.Unset) {
|
14787 | return new AV.Op.Set(this.amount());
|
14788 | } else if (previous instanceof AV.Op.Set) {
|
14789 | return new AV.Op.Set(previous.value() + this.amount());
|
14790 | } else if (previous instanceof AV.Op.Increment) {
|
14791 | return new AV.Op.Increment(this.amount() + previous.amount());
|
14792 | } else {
|
14793 | throw new Error('Op is invalid after previous op.');
|
14794 | }
|
14795 | },
|
14796 | _estimate: function _estimate(oldValue) {
|
14797 | if (!oldValue) {
|
14798 | return this.amount();
|
14799 | }
|
14800 |
|
14801 | return oldValue + this.amount();
|
14802 | }
|
14803 | });
|
14804 |
|
14805 | AV.Op._registerDecoder('Increment', function (json) {
|
14806 | return new AV.Op.Increment(json.amount);
|
14807 | });
|
14808 | |
14809 |
|
14810 |
|
14811 |
|
14812 |
|
14813 |
|
14814 |
|
14815 |
|
14816 | AV.Op.BitAnd = AV.Op._extend(
|
14817 |
|
14818 | {
|
14819 | _initialize: function _initialize(value) {
|
14820 | this._value = value;
|
14821 | },
|
14822 | value: function value() {
|
14823 | return this._value;
|
14824 | },
|
14825 |
|
14826 | |
14827 |
|
14828 |
|
14829 |
|
14830 | toJSON: function toJSON() {
|
14831 | return {
|
14832 | __op: 'BitAnd',
|
14833 | value: this.value()
|
14834 | };
|
14835 | },
|
14836 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14837 | if (!previous) {
|
14838 | return this;
|
14839 | } else if (previous instanceof AV.Op.Unset) {
|
14840 | return new AV.Op.Set(0);
|
14841 | } else if (previous instanceof AV.Op.Set) {
|
14842 | return new AV.Op.Set(previous.value() & this.value());
|
14843 | } else {
|
14844 | throw new Error('Op is invalid after previous op.');
|
14845 | }
|
14846 | },
|
14847 | _estimate: function _estimate(oldValue) {
|
14848 | return oldValue & this.value();
|
14849 | }
|
14850 | });
|
14851 |
|
14852 | AV.Op._registerDecoder('BitAnd', function (json) {
|
14853 | return new AV.Op.BitAnd(json.value);
|
14854 | });
|
14855 | |
14856 |
|
14857 |
|
14858 |
|
14859 |
|
14860 |
|
14861 |
|
14862 |
|
14863 | AV.Op.BitOr = AV.Op._extend(
|
14864 |
|
14865 | {
|
14866 | _initialize: function _initialize(value) {
|
14867 | this._value = value;
|
14868 | },
|
14869 | value: function value() {
|
14870 | return this._value;
|
14871 | },
|
14872 |
|
14873 | |
14874 |
|
14875 |
|
14876 |
|
14877 | toJSON: function toJSON() {
|
14878 | return {
|
14879 | __op: 'BitOr',
|
14880 | value: this.value()
|
14881 | };
|
14882 | },
|
14883 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14884 | if (!previous) {
|
14885 | return this;
|
14886 | } else if (previous instanceof AV.Op.Unset) {
|
14887 | return new AV.Op.Set(this.value());
|
14888 | } else if (previous instanceof AV.Op.Set) {
|
14889 | return new AV.Op.Set(previous.value() | this.value());
|
14890 | } else {
|
14891 | throw new Error('Op is invalid after previous op.');
|
14892 | }
|
14893 | },
|
14894 | _estimate: function _estimate(oldValue) {
|
14895 | return oldValue | this.value();
|
14896 | }
|
14897 | });
|
14898 |
|
14899 | AV.Op._registerDecoder('BitOr', function (json) {
|
14900 | return new AV.Op.BitOr(json.value);
|
14901 | });
|
14902 | |
14903 |
|
14904 |
|
14905 |
|
14906 |
|
14907 |
|
14908 |
|
14909 |
|
14910 | AV.Op.BitXor = AV.Op._extend(
|
14911 |
|
14912 | {
|
14913 | _initialize: function _initialize(value) {
|
14914 | this._value = value;
|
14915 | },
|
14916 | value: function value() {
|
14917 | return this._value;
|
14918 | },
|
14919 |
|
14920 | |
14921 |
|
14922 |
|
14923 |
|
14924 | toJSON: function toJSON() {
|
14925 | return {
|
14926 | __op: 'BitXor',
|
14927 | value: this.value()
|
14928 | };
|
14929 | },
|
14930 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14931 | if (!previous) {
|
14932 | return this;
|
14933 | } else if (previous instanceof AV.Op.Unset) {
|
14934 | return new AV.Op.Set(this.value());
|
14935 | } else if (previous instanceof AV.Op.Set) {
|
14936 | return new AV.Op.Set(previous.value() ^ this.value());
|
14937 | } else {
|
14938 | throw new Error('Op is invalid after previous op.');
|
14939 | }
|
14940 | },
|
14941 | _estimate: function _estimate(oldValue) {
|
14942 | return oldValue ^ this.value();
|
14943 | }
|
14944 | });
|
14945 |
|
14946 | AV.Op._registerDecoder('BitXor', function (json) {
|
14947 | return new AV.Op.BitXor(json.value);
|
14948 | });
|
14949 | |
14950 |
|
14951 |
|
14952 |
|
14953 |
|
14954 |
|
14955 |
|
14956 |
|
14957 | AV.Op.Add = AV.Op._extend(
|
14958 |
|
14959 | {
|
14960 | _initialize: function _initialize(objects) {
|
14961 | this._objects = objects;
|
14962 | },
|
14963 |
|
14964 | |
14965 |
|
14966 |
|
14967 |
|
14968 | objects: function objects() {
|
14969 | return this._objects;
|
14970 | },
|
14971 |
|
14972 | |
14973 |
|
14974 |
|
14975 |
|
14976 | toJSON: function toJSON() {
|
14977 | return {
|
14978 | __op: 'Add',
|
14979 | objects: AV._encode(this.objects())
|
14980 | };
|
14981 | },
|
14982 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14983 | if (!previous) {
|
14984 | return this;
|
14985 | } else if (previous instanceof AV.Op.Unset) {
|
14986 | return new AV.Op.Set(this.objects());
|
14987 | } else if (previous instanceof AV.Op.Set) {
|
14988 | return new AV.Op.Set(this._estimate(previous.value()));
|
14989 | } else if (previous instanceof AV.Op.Add) {
|
14990 | var _context;
|
14991 |
|
14992 | return new AV.Op.Add((0, _concat.default)(_context = previous.objects()).call(_context, this.objects()));
|
14993 | } else {
|
14994 | throw new Error('Op is invalid after previous op.');
|
14995 | }
|
14996 | },
|
14997 | _estimate: function _estimate(oldValue) {
|
14998 | if (!oldValue) {
|
14999 | return _.clone(this.objects());
|
15000 | } else {
|
15001 | return (0, _concat.default)(oldValue).call(oldValue, this.objects());
|
15002 | }
|
15003 | }
|
15004 | });
|
15005 |
|
15006 | AV.Op._registerDecoder('Add', function (json) {
|
15007 | return new AV.Op.Add(AV._decode(json.objects));
|
15008 | });
|
15009 | |
15010 |
|
15011 |
|
15012 |
|
15013 |
|
15014 |
|
15015 |
|
15016 |
|
15017 |
|
15018 | AV.Op.AddUnique = AV.Op._extend(
|
15019 |
|
15020 | {
|
15021 | _initialize: function _initialize(objects) {
|
15022 | this._objects = _.uniq(objects);
|
15023 | },
|
15024 |
|
15025 | |
15026 |
|
15027 |
|
15028 |
|
15029 | objects: function objects() {
|
15030 | return this._objects;
|
15031 | },
|
15032 |
|
15033 | |
15034 |
|
15035 |
|
15036 |
|
15037 | toJSON: function toJSON() {
|
15038 | return {
|
15039 | __op: 'AddUnique',
|
15040 | objects: AV._encode(this.objects())
|
15041 | };
|
15042 | },
|
15043 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15044 | if (!previous) {
|
15045 | return this;
|
15046 | } else if (previous instanceof AV.Op.Unset) {
|
15047 | return new AV.Op.Set(this.objects());
|
15048 | } else if (previous instanceof AV.Op.Set) {
|
15049 | return new AV.Op.Set(this._estimate(previous.value()));
|
15050 | } else if (previous instanceof AV.Op.AddUnique) {
|
15051 | return new AV.Op.AddUnique(this._estimate(previous.objects()));
|
15052 | } else {
|
15053 | throw new Error('Op is invalid after previous op.');
|
15054 | }
|
15055 | },
|
15056 | _estimate: function _estimate(oldValue) {
|
15057 | if (!oldValue) {
|
15058 | return _.clone(this.objects());
|
15059 | } else {
|
15060 |
|
15061 |
|
15062 |
|
15063 | var newValue = _.clone(oldValue);
|
15064 |
|
15065 | AV._arrayEach(this.objects(), function (obj) {
|
15066 | if (obj instanceof AV.Object && obj.id) {
|
15067 | var matchingObj = (0, _find.default)(_).call(_, newValue, function (anObj) {
|
15068 | return anObj instanceof AV.Object && anObj.id === obj.id;
|
15069 | });
|
15070 |
|
15071 | if (!matchingObj) {
|
15072 | newValue.push(obj);
|
15073 | } else {
|
15074 | var index = (0, _indexOf.default)(_).call(_, newValue, matchingObj);
|
15075 | newValue[index] = obj;
|
15076 | }
|
15077 | } else if (!_.contains(newValue, obj)) {
|
15078 | newValue.push(obj);
|
15079 | }
|
15080 | });
|
15081 |
|
15082 | return newValue;
|
15083 | }
|
15084 | }
|
15085 | });
|
15086 |
|
15087 | AV.Op._registerDecoder('AddUnique', function (json) {
|
15088 | return new AV.Op.AddUnique(AV._decode(json.objects));
|
15089 | });
|
15090 | |
15091 |
|
15092 |
|
15093 |
|
15094 |
|
15095 |
|
15096 |
|
15097 |
|
15098 | AV.Op.Remove = AV.Op._extend(
|
15099 |
|
15100 | {
|
15101 | _initialize: function _initialize(objects) {
|
15102 | this._objects = _.uniq(objects);
|
15103 | },
|
15104 |
|
15105 | |
15106 |
|
15107 |
|
15108 |
|
15109 | objects: function objects() {
|
15110 | return this._objects;
|
15111 | },
|
15112 |
|
15113 | |
15114 |
|
15115 |
|
15116 |
|
15117 | toJSON: function toJSON() {
|
15118 | return {
|
15119 | __op: 'Remove',
|
15120 | objects: AV._encode(this.objects())
|
15121 | };
|
15122 | },
|
15123 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15124 | if (!previous) {
|
15125 | return this;
|
15126 | } else if (previous instanceof AV.Op.Unset) {
|
15127 | return previous;
|
15128 | } else if (previous instanceof AV.Op.Set) {
|
15129 | return new AV.Op.Set(this._estimate(previous.value()));
|
15130 | } else if (previous instanceof AV.Op.Remove) {
|
15131 | return new AV.Op.Remove(_.union(previous.objects(), this.objects()));
|
15132 | } else {
|
15133 | throw new Error('Op is invalid after previous op.');
|
15134 | }
|
15135 | },
|
15136 | _estimate: function _estimate(oldValue) {
|
15137 | if (!oldValue) {
|
15138 | return [];
|
15139 | } else {
|
15140 | var newValue = _.difference(oldValue, this.objects());
|
15141 |
|
15142 |
|
15143 | AV._arrayEach(this.objects(), function (obj) {
|
15144 | if (obj instanceof AV.Object && obj.id) {
|
15145 | newValue = _.reject(newValue, function (other) {
|
15146 | return other instanceof AV.Object && other.id === obj.id;
|
15147 | });
|
15148 | }
|
15149 | });
|
15150 |
|
15151 | return newValue;
|
15152 | }
|
15153 | }
|
15154 | });
|
15155 |
|
15156 | AV.Op._registerDecoder('Remove', function (json) {
|
15157 | return new AV.Op.Remove(AV._decode(json.objects));
|
15158 | });
|
15159 | |
15160 |
|
15161 |
|
15162 |
|
15163 |
|
15164 |
|
15165 |
|
15166 |
|
15167 |
|
15168 | AV.Op.Relation = AV.Op._extend(
|
15169 |
|
15170 | {
|
15171 | _initialize: function _initialize(adds, removes) {
|
15172 | this._targetClassName = null;
|
15173 | var self = this;
|
15174 |
|
15175 | var pointerToId = function pointerToId(object) {
|
15176 | if (object instanceof AV.Object) {
|
15177 | if (!object.id) {
|
15178 | throw new Error("You can't add an unsaved AV.Object to a relation.");
|
15179 | }
|
15180 |
|
15181 | if (!self._targetClassName) {
|
15182 | self._targetClassName = object.className;
|
15183 | }
|
15184 |
|
15185 | if (self._targetClassName !== object.className) {
|
15186 | throw new Error('Tried to create a AV.Relation with 2 different types: ' + self._targetClassName + ' and ' + object.className + '.');
|
15187 | }
|
15188 |
|
15189 | return object.id;
|
15190 | }
|
15191 |
|
15192 | return object;
|
15193 | };
|
15194 |
|
15195 | this.relationsToAdd = _.uniq((0, _map.default)(_).call(_, adds, pointerToId));
|
15196 | this.relationsToRemove = _.uniq((0, _map.default)(_).call(_, removes, pointerToId));
|
15197 | },
|
15198 |
|
15199 | |
15200 |
|
15201 |
|
15202 |
|
15203 |
|
15204 | added: function added() {
|
15205 | var self = this;
|
15206 | return (0, _map.default)(_).call(_, this.relationsToAdd, function (objectId) {
|
15207 | var object = AV.Object._create(self._targetClassName);
|
15208 |
|
15209 | object.id = objectId;
|
15210 | return object;
|
15211 | });
|
15212 | },
|
15213 |
|
15214 | |
15215 |
|
15216 |
|
15217 |
|
15218 |
|
15219 | removed: function removed() {
|
15220 | var self = this;
|
15221 | return (0, _map.default)(_).call(_, this.relationsToRemove, function (objectId) {
|
15222 | var object = AV.Object._create(self._targetClassName);
|
15223 |
|
15224 | object.id = objectId;
|
15225 | return object;
|
15226 | });
|
15227 | },
|
15228 |
|
15229 | |
15230 |
|
15231 |
|
15232 |
|
15233 | toJSON: function toJSON() {
|
15234 | var adds = null;
|
15235 | var removes = null;
|
15236 | var self = this;
|
15237 |
|
15238 | var idToPointer = function idToPointer(id) {
|
15239 | return {
|
15240 | __type: 'Pointer',
|
15241 | className: self._targetClassName,
|
15242 | objectId: id
|
15243 | };
|
15244 | };
|
15245 |
|
15246 | var pointers = null;
|
15247 |
|
15248 | if (this.relationsToAdd.length > 0) {
|
15249 | pointers = (0, _map.default)(_).call(_, this.relationsToAdd, idToPointer);
|
15250 | adds = {
|
15251 | __op: 'AddRelation',
|
15252 | objects: pointers
|
15253 | };
|
15254 | }
|
15255 |
|
15256 | if (this.relationsToRemove.length > 0) {
|
15257 | pointers = (0, _map.default)(_).call(_, this.relationsToRemove, idToPointer);
|
15258 | removes = {
|
15259 | __op: 'RemoveRelation',
|
15260 | objects: pointers
|
15261 | };
|
15262 | }
|
15263 |
|
15264 | if (adds && removes) {
|
15265 | return {
|
15266 | __op: 'Batch',
|
15267 | ops: [adds, removes]
|
15268 | };
|
15269 | }
|
15270 |
|
15271 | return adds || removes || {};
|
15272 | },
|
15273 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15274 | if (!previous) {
|
15275 | return this;
|
15276 | } else if (previous instanceof AV.Op.Unset) {
|
15277 | throw new Error("You can't modify a relation after deleting it.");
|
15278 | } else if (previous instanceof AV.Op.Relation) {
|
15279 | if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
|
15280 | throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + this._targetClassName + ' was passed in.');
|
15281 | }
|
15282 |
|
15283 | var newAdd = _.union(_.difference(previous.relationsToAdd, this.relationsToRemove), this.relationsToAdd);
|
15284 |
|
15285 | var newRemove = _.union(_.difference(previous.relationsToRemove, this.relationsToAdd), this.relationsToRemove);
|
15286 |
|
15287 | var newRelation = new AV.Op.Relation(newAdd, newRemove);
|
15288 | newRelation._targetClassName = this._targetClassName;
|
15289 | return newRelation;
|
15290 | } else {
|
15291 | throw new Error('Op is invalid after previous op.');
|
15292 | }
|
15293 | },
|
15294 | _estimate: function _estimate(oldValue, object, key) {
|
15295 | if (!oldValue) {
|
15296 | var relation = new AV.Relation(object, key);
|
15297 | relation.targetClassName = this._targetClassName;
|
15298 | } else if (oldValue instanceof AV.Relation) {
|
15299 | if (this._targetClassName) {
|
15300 | if (oldValue.targetClassName) {
|
15301 | if (oldValue.targetClassName !== this._targetClassName) {
|
15302 | throw new Error('Related object must be a ' + oldValue.targetClassName + ', but a ' + this._targetClassName + ' was passed in.');
|
15303 | }
|
15304 | } else {
|
15305 | oldValue.targetClassName = this._targetClassName;
|
15306 | }
|
15307 | }
|
15308 |
|
15309 | return oldValue;
|
15310 | } else {
|
15311 | throw new Error('Op is invalid after previous op.');
|
15312 | }
|
15313 | }
|
15314 | });
|
15315 |
|
15316 | AV.Op._registerDecoder('AddRelation', function (json) {
|
15317 | return new AV.Op.Relation(AV._decode(json.objects), []);
|
15318 | });
|
15319 |
|
15320 | AV.Op._registerDecoder('RemoveRelation', function (json) {
|
15321 | return new AV.Op.Relation([], AV._decode(json.objects));
|
15322 | });
|
15323 | };
|
15324 |
|
15325 | }),
|
15326 |
|
15327 | (function(module, exports, __webpack_require__) {
|
15328 |
|
15329 | var parent = __webpack_require__(476);
|
15330 |
|
15331 | module.exports = parent;
|
15332 |
|
15333 |
|
15334 | }),
|
15335 |
|
15336 | (function(module, exports, __webpack_require__) {
|
15337 |
|
15338 | var isPrototypeOf = __webpack_require__(16);
|
15339 | var method = __webpack_require__(477);
|
15340 |
|
15341 | var ArrayPrototype = Array.prototype;
|
15342 |
|
15343 | module.exports = function (it) {
|
15344 | var own = it.find;
|
15345 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;
|
15346 | };
|
15347 |
|
15348 |
|
15349 | }),
|
15350 |
|
15351 | (function(module, exports, __webpack_require__) {
|
15352 |
|
15353 | __webpack_require__(478);
|
15354 | var entryVirtual = __webpack_require__(27);
|
15355 |
|
15356 | module.exports = entryVirtual('Array').find;
|
15357 |
|
15358 |
|
15359 | }),
|
15360 |
|
15361 | (function(module, exports, __webpack_require__) {
|
15362 |
|
15363 | "use strict";
|
15364 |
|
15365 | var $ = __webpack_require__(0);
|
15366 | var $find = __webpack_require__(75).find;
|
15367 | var addToUnscopables = __webpack_require__(131);
|
15368 |
|
15369 | var FIND = 'find';
|
15370 | var SKIPS_HOLES = true;
|
15371 |
|
15372 |
|
15373 | if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
15374 |
|
15375 |
|
15376 |
|
15377 | $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
15378 | find: function find(callbackfn /* , that = undefined */) {
|
15379 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
15380 | }
|
15381 | });
|
15382 |
|
15383 |
|
15384 | addToUnscopables(FIND);
|
15385 |
|
15386 |
|
15387 | }),
|
15388 |
|
15389 | (function(module, exports, __webpack_require__) {
|
15390 |
|
15391 | "use strict";
|
15392 |
|
15393 |
|
15394 | var _ = __webpack_require__(3);
|
15395 |
|
15396 | module.exports = function (AV) {
|
15397 | |
15398 |
|
15399 |
|
15400 |
|
15401 |
|
15402 |
|
15403 |
|
15404 |
|
15405 |
|
15406 |
|
15407 |
|
15408 |
|
15409 |
|
15410 |
|
15411 |
|
15412 | AV.Relation = function (parent, key) {
|
15413 | if (!_.isString(key)) {
|
15414 | throw new TypeError('key must be a string');
|
15415 | }
|
15416 |
|
15417 | this.parent = parent;
|
15418 | this.key = key;
|
15419 | this.targetClassName = null;
|
15420 | };
|
15421 | |
15422 |
|
15423 |
|
15424 |
|
15425 |
|
15426 |
|
15427 |
|
15428 |
|
15429 |
|
15430 | AV.Relation.reverseQuery = function (parentClass, relationKey, child) {
|
15431 | var query = new AV.Query(parentClass);
|
15432 | query.equalTo(relationKey, child._toPointer());
|
15433 | return query;
|
15434 | };
|
15435 |
|
15436 | _.extend(AV.Relation.prototype,
|
15437 |
|
15438 | {
|
15439 | |
15440 |
|
15441 |
|
15442 |
|
15443 | _ensureParentAndKey: function _ensureParentAndKey(parent, key) {
|
15444 | this.parent = this.parent || parent;
|
15445 | this.key = this.key || key;
|
15446 |
|
15447 | if (this.parent !== parent) {
|
15448 | throw new Error('Internal Error. Relation retrieved from two different Objects.');
|
15449 | }
|
15450 |
|
15451 | if (this.key !== key) {
|
15452 | throw new Error('Internal Error. Relation retrieved from two different keys.');
|
15453 | }
|
15454 | },
|
15455 |
|
15456 | |
15457 |
|
15458 |
|
15459 |
|
15460 | add: function add(objects) {
|
15461 | if (!_.isArray(objects)) {
|
15462 | objects = [objects];
|
15463 | }
|
15464 |
|
15465 | var change = new AV.Op.Relation(objects, []);
|
15466 | this.parent.set(this.key, change);
|
15467 | this.targetClassName = change._targetClassName;
|
15468 | },
|
15469 |
|
15470 | |
15471 |
|
15472 |
|
15473 |
|
15474 | remove: function remove(objects) {
|
15475 | if (!_.isArray(objects)) {
|
15476 | objects = [objects];
|
15477 | }
|
15478 |
|
15479 | var change = new AV.Op.Relation([], objects);
|
15480 | this.parent.set(this.key, change);
|
15481 | this.targetClassName = change._targetClassName;
|
15482 | },
|
15483 |
|
15484 | |
15485 |
|
15486 |
|
15487 |
|
15488 | toJSON: function toJSON() {
|
15489 | return {
|
15490 | __type: 'Relation',
|
15491 | className: this.targetClassName
|
15492 | };
|
15493 | },
|
15494 |
|
15495 | |
15496 |
|
15497 |
|
15498 |
|
15499 |
|
15500 | query: function query() {
|
15501 | var targetClass;
|
15502 | var query;
|
15503 |
|
15504 | if (!this.targetClassName) {
|
15505 | targetClass = AV.Object._getSubclass(this.parent.className);
|
15506 | query = new AV.Query(targetClass);
|
15507 | query._defaultParams.redirectClassNameForKey = this.key;
|
15508 | } else {
|
15509 | targetClass = AV.Object._getSubclass(this.targetClassName);
|
15510 | query = new AV.Query(targetClass);
|
15511 | }
|
15512 |
|
15513 | query._addCondition('$relatedTo', 'object', this.parent._toPointer());
|
15514 |
|
15515 | query._addCondition('$relatedTo', 'key', this.key);
|
15516 |
|
15517 | return query;
|
15518 | }
|
15519 | });
|
15520 | };
|
15521 |
|
15522 | }),
|
15523 |
|
15524 | (function(module, exports, __webpack_require__) {
|
15525 |
|
15526 | "use strict";
|
15527 |
|
15528 |
|
15529 | var _interopRequireDefault = __webpack_require__(1);
|
15530 |
|
15531 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
15532 |
|
15533 | var _ = __webpack_require__(3);
|
15534 |
|
15535 | var cos = __webpack_require__(481);
|
15536 |
|
15537 | var qiniu = __webpack_require__(482);
|
15538 |
|
15539 | var s3 = __webpack_require__(528);
|
15540 |
|
15541 | var AVError = __webpack_require__(48);
|
15542 |
|
15543 | var _require = __webpack_require__(28),
|
15544 | request = _require.request,
|
15545 | AVRequest = _require._request;
|
15546 |
|
15547 | var _require2 = __webpack_require__(32),
|
15548 | tap = _require2.tap,
|
15549 | transformFetchOptions = _require2.transformFetchOptions;
|
15550 |
|
15551 | var debug = __webpack_require__(63)('leancloud:file');
|
15552 |
|
15553 | var parseBase64 = __webpack_require__(532);
|
15554 |
|
15555 | module.exports = function (AV) {
|
15556 |
|
15557 |
|
15558 | var extname = function extname(path) {
|
15559 | if (!_.isString(path)) return '';
|
15560 | return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
|
15561 | };
|
15562 |
|
15563 | var b64Digit = function b64Digit(number) {
|
15564 | if (number < 26) {
|
15565 | return String.fromCharCode(65 + number);
|
15566 | }
|
15567 |
|
15568 | if (number < 52) {
|
15569 | return String.fromCharCode(97 + (number - 26));
|
15570 | }
|
15571 |
|
15572 | if (number < 62) {
|
15573 | return String.fromCharCode(48 + (number - 52));
|
15574 | }
|
15575 |
|
15576 | if (number === 62) {
|
15577 | return '+';
|
15578 | }
|
15579 |
|
15580 | if (number === 63) {
|
15581 | return '/';
|
15582 | }
|
15583 |
|
15584 | throw new Error('Tried to encode large digit ' + number + ' in base64.');
|
15585 | };
|
15586 |
|
15587 | var encodeBase64 = function encodeBase64(array) {
|
15588 | var chunks = [];
|
15589 | chunks.length = Math.ceil(array.length / 3);
|
15590 |
|
15591 | _.times(chunks.length, function (i) {
|
15592 | var b1 = array[i * 3];
|
15593 | var b2 = array[i * 3 + 1] || 0;
|
15594 | var b3 = array[i * 3 + 2] || 0;
|
15595 | var has2 = i * 3 + 1 < array.length;
|
15596 | var has3 = i * 3 + 2 < array.length;
|
15597 | 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('');
|
15598 | });
|
15599 |
|
15600 | return chunks.join('');
|
15601 | };
|
15602 | |
15603 |
|
15604 |
|
15605 |
|
15606 |
|
15607 |
|
15608 |
|
15609 |
|
15610 |
|
15611 |
|
15612 |
|
15613 |
|
15614 |
|
15615 |
|
15616 |
|
15617 |
|
15618 |
|
15619 |
|
15620 |
|
15621 |
|
15622 |
|
15623 |
|
15624 |
|
15625 |
|
15626 |
|
15627 |
|
15628 |
|
15629 |
|
15630 |
|
15631 |
|
15632 |
|
15633 |
|
15634 |
|
15635 |
|
15636 | AV.File = function (name, data, mimeType) {
|
15637 | this.attributes = {
|
15638 | name: name,
|
15639 | url: '',
|
15640 | metaData: {},
|
15641 |
|
15642 | base64: ''
|
15643 | };
|
15644 |
|
15645 | if (_.isString(data)) {
|
15646 | throw new TypeError('Creating an AV.File from a String is not yet supported.');
|
15647 | }
|
15648 |
|
15649 | if (_.isArray(data)) {
|
15650 | this.attributes.metaData.size = data.length;
|
15651 | data = {
|
15652 | base64: encodeBase64(data)
|
15653 | };
|
15654 | }
|
15655 |
|
15656 | this._extName = '';
|
15657 | this._data = data;
|
15658 | this._uploadHeaders = {};
|
15659 |
|
15660 | if (data && data.blob && typeof data.blob.uri === 'string') {
|
15661 | this._extName = extname(data.blob.uri);
|
15662 | }
|
15663 |
|
15664 | if (typeof Blob !== 'undefined' && data instanceof Blob) {
|
15665 | if (data.size) {
|
15666 | this.attributes.metaData.size = data.size;
|
15667 | }
|
15668 |
|
15669 | if (data.name) {
|
15670 | this._extName = extname(data.name);
|
15671 | }
|
15672 | }
|
15673 |
|
15674 | var owner;
|
15675 |
|
15676 | if (data && data.owner) {
|
15677 | owner = data.owner;
|
15678 | } else if (!AV._config.disableCurrentUser) {
|
15679 | try {
|
15680 | owner = AV.User.current();
|
15681 | } catch (error) {
|
15682 | if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
|
15683 | throw error;
|
15684 | }
|
15685 | }
|
15686 | }
|
15687 |
|
15688 | this.attributes.metaData.owner = owner ? owner.id : 'unknown';
|
15689 | this.set('mime_type', mimeType);
|
15690 | };
|
15691 | |
15692 |
|
15693 |
|
15694 |
|
15695 |
|
15696 |
|
15697 |
|
15698 |
|
15699 |
|
15700 |
|
15701 |
|
15702 |
|
15703 | AV.File.withURL = function (name, url, metaData, type) {
|
15704 | if (!name || !url) {
|
15705 | throw new Error('Please provide file name and url');
|
15706 | }
|
15707 |
|
15708 | var file = new AV.File(name, null, type);
|
15709 |
|
15710 | if (metaData) {
|
15711 | for (var prop in metaData) {
|
15712 | if (!file.attributes.metaData[prop]) file.attributes.metaData[prop] = metaData[prop];
|
15713 | }
|
15714 | }
|
15715 |
|
15716 | file.attributes.url = url;
|
15717 |
|
15718 | file.attributes.metaData.__source = 'external';
|
15719 | file.attributes.metaData.size = 0;
|
15720 | return file;
|
15721 | };
|
15722 | |
15723 |
|
15724 |
|
15725 |
|
15726 |
|
15727 |
|
15728 |
|
15729 | AV.File.createWithoutData = function (objectId) {
|
15730 | if (!objectId) {
|
15731 | throw new TypeError('The objectId must be provided');
|
15732 | }
|
15733 |
|
15734 | var file = new AV.File();
|
15735 | file.id = objectId;
|
15736 | return file;
|
15737 | };
|
15738 | |
15739 |
|
15740 |
|
15741 |
|
15742 |
|
15743 |
|
15744 |
|
15745 |
|
15746 | AV.File.censor = function (objectId) {
|
15747 | if (!AV._config.masterKey) {
|
15748 | throw new Error('Cannot censor a file without masterKey');
|
15749 | }
|
15750 |
|
15751 | return request({
|
15752 | method: 'POST',
|
15753 | path: "/files/".concat(objectId, "/censor"),
|
15754 | authOptions: {
|
15755 | useMasterKey: true
|
15756 | }
|
15757 | }).then(function (res) {
|
15758 | return res.censorResult;
|
15759 | });
|
15760 | };
|
15761 |
|
15762 | _.extend(AV.File.prototype,
|
15763 |
|
15764 | {
|
15765 | className: '_File',
|
15766 | _toFullJSON: function _toFullJSON(seenObjects) {
|
15767 | var _this = this;
|
15768 |
|
15769 | var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
15770 |
|
15771 | var json = _.clone(this.attributes);
|
15772 |
|
15773 | AV._objectEach(json, function (val, key) {
|
15774 | json[key] = AV._encode(val, seenObjects, undefined, full);
|
15775 | });
|
15776 |
|
15777 | AV._objectEach(this._operations, function (val, key) {
|
15778 | json[key] = val;
|
15779 | });
|
15780 |
|
15781 | if (_.has(this, 'id')) {
|
15782 | json.objectId = this.id;
|
15783 | }
|
15784 |
|
15785 | ['createdAt', 'updatedAt'].forEach(function (key) {
|
15786 | if (_.has(_this, key)) {
|
15787 | var val = _this[key];
|
15788 | json[key] = _.isDate(val) ? val.toJSON() : val;
|
15789 | }
|
15790 | });
|
15791 |
|
15792 | if (full) {
|
15793 | json.__type = 'File';
|
15794 | }
|
15795 |
|
15796 | return json;
|
15797 | },
|
15798 |
|
15799 | |
15800 |
|
15801 |
|
15802 |
|
15803 |
|
15804 |
|
15805 | toFullJSON: function toFullJSON() {
|
15806 | var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
15807 | return this._toFullJSON(seenObjects);
|
15808 | },
|
15809 |
|
15810 | |
15811 |
|
15812 |
|
15813 |
|
15814 | toJSON: function toJSON(key, holder) {
|
15815 | var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [this];
|
15816 | return this._toFullJSON(seenObjects, false);
|
15817 | },
|
15818 |
|
15819 | |
15820 |
|
15821 |
|
15822 |
|
15823 | _toPointer: function _toPointer() {
|
15824 | return {
|
15825 | __type: 'Pointer',
|
15826 | className: this.className,
|
15827 | objectId: this.id
|
15828 | };
|
15829 | },
|
15830 |
|
15831 | |
15832 |
|
15833 |
|
15834 |
|
15835 | getACL: function getACL() {
|
15836 | return this._acl;
|
15837 | },
|
15838 |
|
15839 | |
15840 |
|
15841 |
|
15842 |
|
15843 | setACL: function setACL(acl) {
|
15844 | if (!(acl instanceof AV.ACL)) {
|
15845 | return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
|
15846 | }
|
15847 |
|
15848 | this._acl = acl;
|
15849 | return this;
|
15850 | },
|
15851 |
|
15852 | |
15853 |
|
15854 |
|
15855 |
|
15856 |
|
15857 | name: function name() {
|
15858 | return this.get('name');
|
15859 | },
|
15860 |
|
15861 | |
15862 |
|
15863 |
|
15864 |
|
15865 |
|
15866 | url: function url() {
|
15867 | return this.get('url');
|
15868 | },
|
15869 |
|
15870 | |
15871 |
|
15872 |
|
15873 |
|
15874 |
|
15875 | get: function get(attrName) {
|
15876 | switch (attrName) {
|
15877 | case 'objectId':
|
15878 | return this.id;
|
15879 |
|
15880 | case 'url':
|
15881 | case 'name':
|
15882 | case 'mime_type':
|
15883 | case 'metaData':
|
15884 | case 'createdAt':
|
15885 | case 'updatedAt':
|
15886 | return this.attributes[attrName];
|
15887 |
|
15888 | default:
|
15889 | return this.attributes.metaData[attrName];
|
15890 | }
|
15891 | },
|
15892 |
|
15893 | |
15894 |
|
15895 |
|
15896 |
|
15897 |
|
15898 |
|
15899 |
|
15900 | set: function set() {
|
15901 | var _this2 = this;
|
15902 |
|
15903 | var set = function set(attrName, value) {
|
15904 | switch (attrName) {
|
15905 | case 'name':
|
15906 | case 'url':
|
15907 | case 'mime_type':
|
15908 | case 'base64':
|
15909 | case 'metaData':
|
15910 | _this2.attributes[attrName] = value;
|
15911 | break;
|
15912 |
|
15913 | default:
|
15914 |
|
15915 | _this2.attributes.metaData[attrName] = value;
|
15916 | break;
|
15917 | }
|
15918 | };
|
15919 |
|
15920 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
15921 | args[_key] = arguments[_key];
|
15922 | }
|
15923 |
|
15924 | switch (args.length) {
|
15925 | case 1:
|
15926 |
|
15927 | for (var k in args[0]) {
|
15928 | set(k, args[0][k]);
|
15929 | }
|
15930 |
|
15931 | break;
|
15932 |
|
15933 | case 2:
|
15934 | set(args[0], args[1]);
|
15935 | break;
|
15936 | }
|
15937 |
|
15938 | return this;
|
15939 | },
|
15940 |
|
15941 | /**
|
15942 | * Set a header for the upload request.
|
15943 | * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
|
15944 | *
|
15945 | * @param {String} key header key
|
15946 | * @param {String} value header value
|
15947 | * @return {AV.File} this
|
15948 | */
|
15949 | setUploadHeader: function setUploadHeader(key, value) {
|
15950 | this._uploadHeaders[key] = value;
|
15951 | return this;
|
15952 | },
|
15953 |
|
15954 | |
15955 |
|
15956 |
|
15957 |
|
15958 |
|
15959 |
|
15960 |
|
15961 |
|
15962 |
|
15963 |
|
15964 |
|
15965 |
|
15966 | metaData: function metaData(attr, value) {
|
15967 | if (attr && value) {
|
15968 | this.attributes.metaData[attr] = value;
|
15969 | return this;
|
15970 | } else if (attr && !value) {
|
15971 | return this.attributes.metaData[attr];
|
15972 | } else {
|
15973 | return this.attributes.metaData;
|
15974 | }
|
15975 | },
|
15976 |
|
15977 | |
15978 |
|
15979 |
|
15980 |
|
15981 |
|
15982 |
|
15983 |
|
15984 |
|
15985 |
|
15986 | thumbnailURL: function thumbnailURL(width, height) {
|
15987 | var quality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
|
15988 | var scaleToFit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
15989 | var fmt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'png';
|
15990 | var url = this.attributes.url;
|
15991 |
|
15992 | if (!url) {
|
15993 | throw new Error('Invalid url.');
|
15994 | }
|
15995 |
|
15996 | if (!width || !height || width <= 0 || height <= 0) {
|
15997 | throw new Error('Invalid width or height value.');
|
15998 | }
|
15999 |
|
16000 | if (quality <= 0 || quality > 100) {
|
16001 | throw new Error('Invalid quality value.');
|
16002 | }
|
16003 |
|
16004 | var mode = scaleToFit ? 2 : 1;
|
16005 | return url + '?imageView/' + mode + '/w/' + width + '/h/' + height + '/q/' + quality + '/format/' + fmt;
|
16006 | },
|
16007 |
|
16008 | |
16009 |
|
16010 |
|
16011 |
|
16012 | size: function size() {
|
16013 | return this.metaData().size;
|
16014 | },
|
16015 |
|
16016 | |
16017 |
|
16018 |
|
16019 |
|
16020 | ownerId: function ownerId() {
|
16021 | return this.metaData().owner;
|
16022 | },
|
16023 |
|
16024 | |
16025 |
|
16026 |
|
16027 |
|
16028 |
|
16029 |
|
16030 | destroy: function destroy(options) {
|
16031 | if (!this.id) {
|
16032 | return _promise.default.reject(new Error('The file id does not eixst.'));
|
16033 | }
|
16034 |
|
16035 | var request = AVRequest('files', null, this.id, 'DELETE', null, options);
|
16036 | return request;
|
16037 | },
|
16038 |
|
16039 | |
16040 |
|
16041 |
|
16042 |
|
16043 |
|
16044 |
|
16045 | _fileToken: function _fileToken(type, authOptions) {
|
16046 | var name = this.attributes.name;
|
16047 | var extName = extname(name);
|
16048 |
|
16049 | if (!extName && this._extName) {
|
16050 | name += this._extName;
|
16051 | extName = this._extName;
|
16052 | }
|
16053 |
|
16054 | var data = {
|
16055 | name: name,
|
16056 | keep_file_name: authOptions.keepFileName,
|
16057 | key: authOptions.key,
|
16058 | ACL: this._acl,
|
16059 | mime_type: type,
|
16060 | metaData: this.attributes.metaData
|
16061 | };
|
16062 | return AVRequest('fileTokens', null, null, 'POST', data, authOptions);
|
16063 | },
|
16064 |
|
16065 | |
16066 |
|
16067 |
|
16068 |
|
16069 |
|
16070 | |
16071 |
|
16072 |
|
16073 |
|
16074 |
|
16075 |
|
16076 |
|
16077 |
|
16078 | save: function save() {
|
16079 | var _this3 = this;
|
16080 |
|
16081 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
16082 |
|
16083 | if (this.id) {
|
16084 | throw new Error('File is already saved.');
|
16085 | }
|
16086 |
|
16087 | if (!this._previousSave) {
|
16088 | if (this._data) {
|
16089 | var mimeType = this.get('mime_type');
|
16090 | this._previousSave = this._fileToken(mimeType, options).then(function (uploadInfo) {
|
16091 | if (uploadInfo.mime_type) {
|
16092 | mimeType = uploadInfo.mime_type;
|
16093 |
|
16094 | _this3.set('mime_type', mimeType);
|
16095 | }
|
16096 |
|
16097 | _this3._token = uploadInfo.token;
|
16098 | return _promise.default.resolve().then(function () {
|
16099 | var data = _this3._data;
|
16100 |
|
16101 | if (data && data.base64) {
|
16102 | return parseBase64(data.base64, mimeType);
|
16103 | }
|
16104 |
|
16105 | if (data && data.blob) {
|
16106 | if (!data.blob.type && mimeType) {
|
16107 | data.blob.type = mimeType;
|
16108 | }
|
16109 |
|
16110 | if (!data.blob.name) {
|
16111 | data.blob.name = _this3.get('name');
|
16112 | }
|
16113 |
|
16114 | return data.blob;
|
16115 | }
|
16116 |
|
16117 | if (typeof Blob !== 'undefined' && data instanceof Blob) {
|
16118 | return data;
|
16119 | }
|
16120 |
|
16121 | throw new TypeError('malformed file data');
|
16122 | }).then(function (data) {
|
16123 | var _options = _.extend({}, options);
|
16124 |
|
16125 |
|
16126 | if (options.onprogress) {
|
16127 | _options.onprogress = function (event) {
|
16128 | if (event.direction === 'download') return;
|
16129 | return options.onprogress(event);
|
16130 | };
|
16131 | }
|
16132 |
|
16133 | switch (uploadInfo.provider) {
|
16134 | case 's3':
|
16135 | return s3(uploadInfo, data, _this3, _options);
|
16136 |
|
16137 | case 'qcloud':
|
16138 | return cos(uploadInfo, data, _this3, _options);
|
16139 |
|
16140 | case 'qiniu':
|
16141 | default:
|
16142 | return qiniu(uploadInfo, data, _this3, _options);
|
16143 | }
|
16144 | }).then(tap(function () {
|
16145 | return _this3._callback(true);
|
16146 | }), function (error) {
|
16147 | _this3._callback(false);
|
16148 |
|
16149 | throw error;
|
16150 | });
|
16151 | });
|
16152 | } else if (this.attributes.url && this.attributes.metaData.__source === 'external') {
|
16153 |
|
16154 | var data = {
|
16155 | name: this.attributes.name,
|
16156 | ACL: this._acl,
|
16157 | metaData: this.attributes.metaData,
|
16158 | mime_type: this.mimeType,
|
16159 | url: this.attributes.url
|
16160 | };
|
16161 | this._previousSave = AVRequest('files', null, null, 'post', data, options).then(function (response) {
|
16162 | _this3.id = response.objectId;
|
16163 | return _this3;
|
16164 | });
|
16165 | }
|
16166 | }
|
16167 |
|
16168 | return this._previousSave;
|
16169 | },
|
16170 | _callback: function _callback(success) {
|
16171 | AVRequest('fileCallback', null, null, 'post', {
|
16172 | token: this._token,
|
16173 | result: success
|
16174 | }).catch(debug);
|
16175 | delete this._token;
|
16176 | delete this._data;
|
16177 | },
|
16178 |
|
16179 | |
16180 |
|
16181 |
|
16182 |
|
16183 |
|
16184 |
|
16185 |
|
16186 |
|
16187 |
|
16188 | fetch: function fetch(fetchOptions, options) {
|
16189 | if (!this.id) {
|
16190 | throw new Error('Cannot fetch unsaved file');
|
16191 | }
|
16192 |
|
16193 | var request = AVRequest('files', null, this.id, 'GET', transformFetchOptions(fetchOptions), options);
|
16194 | return request.then(this._finishFetch.bind(this));
|
16195 | },
|
16196 | _finishFetch: function _finishFetch(response) {
|
16197 | var value = AV.Object.prototype.parse(response);
|
16198 | value.attributes = {
|
16199 | name: value.name,
|
16200 | url: value.url,
|
16201 | mime_type: value.mime_type,
|
16202 | bucket: value.bucket
|
16203 | };
|
16204 | value.attributes.metaData = value.metaData || {};
|
16205 | value.id = value.objectId;
|
16206 |
|
16207 | delete value.objectId;
|
16208 | delete value.metaData;
|
16209 | delete value.url;
|
16210 | delete value.name;
|
16211 | delete value.mime_type;
|
16212 | delete value.bucket;
|
16213 |
|
16214 | _.extend(this, value);
|
16215 |
|
16216 | return this;
|
16217 | },
|
16218 |
|
16219 | |
16220 |
|
16221 |
|
16222 |
|
16223 |
|
16224 | censor: function censor() {
|
16225 | if (!this.id) {
|
16226 | throw new Error('Cannot censor an unsaved file');
|
16227 | }
|
16228 |
|
16229 | return AV.File.censor(this.id);
|
16230 | }
|
16231 | });
|
16232 | };
|
16233 |
|
16234 | }),
|
16235 |
|
16236 | (function(module, exports, __webpack_require__) {
|
16237 |
|
16238 | "use strict";
|
16239 |
|
16240 |
|
16241 | var _require = __webpack_require__(76),
|
16242 | getAdapter = _require.getAdapter;
|
16243 |
|
16244 | var debug = __webpack_require__(63)('cos');
|
16245 |
|
16246 | module.exports = function (uploadInfo, data, file) {
|
16247 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
16248 | var url = uploadInfo.upload_url + '?sign=' + encodeURIComponent(uploadInfo.token);
|
16249 | var fileFormData = {
|
16250 | field: 'fileContent',
|
16251 | data: data,
|
16252 | name: file.attributes.name
|
16253 | };
|
16254 | var options = {
|
16255 | headers: file._uploadHeaders,
|
16256 | data: {
|
16257 | op: 'upload'
|
16258 | },
|
16259 | onprogress: saveOptions.onprogress
|
16260 | };
|
16261 | debug('url: %s, file: %o, options: %o', url, fileFormData, options);
|
16262 | var upload = getAdapter('upload');
|
16263 | return upload(url, fileFormData, options).then(function (response) {
|
16264 | debug(response.status, response.data);
|
16265 |
|
16266 | if (response.ok === false) {
|
16267 | var error = new Error(response.status);
|
16268 | error.response = response;
|
16269 | throw error;
|
16270 | }
|
16271 |
|
16272 | file.attributes.url = uploadInfo.url;
|
16273 | file._bucket = uploadInfo.bucket;
|
16274 | file.id = uploadInfo.objectId;
|
16275 | return file;
|
16276 | }, function (error) {
|
16277 | var response = error.response;
|
16278 |
|
16279 | if (response) {
|
16280 | debug(response.status, response.data);
|
16281 | error.statusCode = response.status;
|
16282 | error.response = response.data;
|
16283 | }
|
16284 |
|
16285 | throw error;
|
16286 | });
|
16287 | };
|
16288 |
|
16289 | }),
|
16290 |
|
16291 | (function(module, exports, __webpack_require__) {
|
16292 |
|
16293 | "use strict";
|
16294 |
|
16295 |
|
16296 | var _sliceInstanceProperty2 = __webpack_require__(34);
|
16297 |
|
16298 | var _Array$from = __webpack_require__(152);
|
16299 |
|
16300 | var _Symbol = __webpack_require__(77);
|
16301 |
|
16302 | var _getIteratorMethod = __webpack_require__(252);
|
16303 |
|
16304 | var _Reflect$construct = __webpack_require__(492);
|
16305 |
|
16306 | var _interopRequireDefault = __webpack_require__(1);
|
16307 |
|
16308 | var _inherits2 = _interopRequireDefault(__webpack_require__(496));
|
16309 |
|
16310 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(518));
|
16311 |
|
16312 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(520));
|
16313 |
|
16314 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(525));
|
16315 |
|
16316 | var _createClass2 = _interopRequireDefault(__webpack_require__(526));
|
16317 |
|
16318 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
16319 |
|
16320 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
16321 |
|
16322 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
16323 |
|
16324 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
16325 |
|
16326 | function _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); }; }
|
16327 |
|
16328 | function _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; } }
|
16329 |
|
16330 | function _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; } } }; }
|
16331 |
|
16332 | function _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); }
|
16333 |
|
16334 | function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
16335 |
|
16336 | var _require = __webpack_require__(76),
|
16337 | getAdapter = _require.getAdapter;
|
16338 |
|
16339 | var debug = __webpack_require__(63)('leancloud:qiniu');
|
16340 |
|
16341 | var ajax = __webpack_require__(117);
|
16342 |
|
16343 | var btoa = __webpack_require__(527);
|
16344 |
|
16345 | var SHARD_THRESHOLD = 1024 * 1024 * 64;
|
16346 | var CHUNK_SIZE = 1024 * 1024 * 16;
|
16347 |
|
16348 | function upload(uploadInfo, data, file) {
|
16349 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
16350 |
|
16351 | var uptoken = uploadInfo.token;
|
16352 | var url = uploadInfo.upload_url || 'https://upload.qiniup.com';
|
16353 | var fileFormData = {
|
16354 | field: 'file',
|
16355 | data: data,
|
16356 | name: file.attributes.name
|
16357 | };
|
16358 | var options = {
|
16359 | headers: file._uploadHeaders,
|
16360 | data: {
|
16361 | name: file.attributes.name,
|
16362 | key: uploadInfo.key,
|
16363 | token: uptoken
|
16364 | },
|
16365 | onprogress: saveOptions.onprogress
|
16366 | };
|
16367 | debug('url: %s, file: %o, options: %o', url, fileFormData, options);
|
16368 | var upload = getAdapter('upload');
|
16369 | return upload(url, fileFormData, options).then(function (response) {
|
16370 | debug(response.status, response.data);
|
16371 |
|
16372 | if (response.ok === false) {
|
16373 | var message = response.status;
|
16374 |
|
16375 | if (response.data) {
|
16376 | if (response.data.error) {
|
16377 | message = response.data.error;
|
16378 | } else {
|
16379 | message = (0, _stringify.default)(response.data);
|
16380 | }
|
16381 | }
|
16382 |
|
16383 | var error = new Error(message);
|
16384 | error.response = response;
|
16385 | throw error;
|
16386 | }
|
16387 |
|
16388 | file.attributes.url = uploadInfo.url;
|
16389 | file._bucket = uploadInfo.bucket;
|
16390 | file.id = uploadInfo.objectId;
|
16391 | return file;
|
16392 | }, function (error) {
|
16393 | var response = error.response;
|
16394 |
|
16395 | if (response) {
|
16396 | debug(response.status, response.data);
|
16397 | error.statusCode = response.status;
|
16398 | error.response = response.data;
|
16399 | }
|
16400 |
|
16401 | throw error;
|
16402 | });
|
16403 | }
|
16404 |
|
16405 | function urlSafeBase64(string) {
|
16406 | var base64 = btoa(unescape(encodeURIComponent(string)));
|
16407 | var result = '';
|
16408 |
|
16409 | var _iterator = _createForOfIteratorHelper(base64),
|
16410 | _step;
|
16411 |
|
16412 | try {
|
16413 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
16414 | var ch = _step.value;
|
16415 |
|
16416 | switch (ch) {
|
16417 | case '+':
|
16418 | result += '-';
|
16419 | break;
|
16420 |
|
16421 | case '/':
|
16422 | result += '_';
|
16423 | break;
|
16424 |
|
16425 | default:
|
16426 | result += ch;
|
16427 | }
|
16428 | }
|
16429 | } catch (err) {
|
16430 | _iterator.e(err);
|
16431 | } finally {
|
16432 | _iterator.f();
|
16433 | }
|
16434 |
|
16435 | return result;
|
16436 | }
|
16437 |
|
16438 | var ShardUploader = function () {
|
16439 | function ShardUploader(uploadInfo, data, file, saveOptions) {
|
16440 | var _context,
|
16441 | _context2,
|
16442 | _this = this;
|
16443 |
|
16444 | (0, _classCallCheck2.default)(this, ShardUploader);
|
16445 | this.uploadInfo = uploadInfo;
|
16446 | this.data = data;
|
16447 | this.file = file;
|
16448 | this.size = undefined;
|
16449 | this.offset = 0;
|
16450 | this.uploadedChunks = 0;
|
16451 | var key = urlSafeBase64(uploadInfo.key);
|
16452 | var uploadURL = uploadInfo.upload_url || 'https://upload.qiniup.com';
|
16453 | this.baseURL = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(uploadURL, "/buckets/")).call(_context2, uploadInfo.bucket, "/objects/")).call(_context, key, "/uploads");
|
16454 | this.upToken = 'UpToken ' + uploadInfo.token;
|
16455 | this.uploaded = 0;
|
16456 |
|
16457 | if (saveOptions && saveOptions.onprogress) {
|
16458 | this.onProgress = function (_ref) {
|
16459 | var loaded = _ref.loaded;
|
16460 | loaded += _this.uploadedChunks * CHUNK_SIZE;
|
16461 |
|
16462 | if (loaded <= _this.uploaded) {
|
16463 | return;
|
16464 | }
|
16465 |
|
16466 | if (_this.size) {
|
16467 | saveOptions.onprogress({
|
16468 | loaded: loaded,
|
16469 | total: _this.size,
|
16470 | percent: loaded / _this.size * 100
|
16471 | });
|
16472 | } else {
|
16473 | saveOptions.onprogress({
|
16474 | loaded: loaded
|
16475 | });
|
16476 | }
|
16477 |
|
16478 | _this.uploaded = loaded;
|
16479 | };
|
16480 | }
|
16481 | }
|
16482 | |
16483 |
|
16484 |
|
16485 |
|
16486 |
|
16487 | (0, _createClass2.default)(ShardUploader, [{
|
16488 | key: "getUploadId",
|
16489 | value: function getUploadId() {
|
16490 | return ajax({
|
16491 | method: 'POST',
|
16492 | url: this.baseURL,
|
16493 | headers: {
|
16494 | Authorization: this.upToken
|
16495 | }
|
16496 | }).then(function (res) {
|
16497 | return res.uploadId;
|
16498 | });
|
16499 | }
|
16500 | }, {
|
16501 | key: "getChunk",
|
16502 | value: function getChunk() {
|
16503 | throw new Error('Not implemented');
|
16504 | }
|
16505 | |
16506 |
|
16507 |
|
16508 |
|
16509 |
|
16510 |
|
16511 |
|
16512 | }, {
|
16513 | key: "uploadPart",
|
16514 | value: function uploadPart(uploadId, partNumber, data) {
|
16515 | var _context3, _context4;
|
16516 |
|
16517 | return ajax({
|
16518 | method: 'PUT',
|
16519 | url: (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.baseURL, "/")).call(_context4, uploadId, "/")).call(_context3, partNumber),
|
16520 | headers: {
|
16521 | Authorization: this.upToken
|
16522 | },
|
16523 | data: data,
|
16524 | onprogress: this.onProgress
|
16525 | }).then(function (_ref2) {
|
16526 | var etag = _ref2.etag;
|
16527 | return {
|
16528 | partNumber: partNumber,
|
16529 | etag: etag
|
16530 | };
|
16531 | });
|
16532 | }
|
16533 | }, {
|
16534 | key: "stopUpload",
|
16535 | value: function stopUpload(uploadId) {
|
16536 | var _context5;
|
16537 |
|
16538 | return ajax({
|
16539 | method: 'DELETE',
|
16540 | url: (0, _concat.default)(_context5 = "".concat(this.baseURL, "/")).call(_context5, uploadId),
|
16541 | headers: {
|
16542 | Authorization: this.upToken
|
16543 | }
|
16544 | });
|
16545 | }
|
16546 | }, {
|
16547 | key: "upload",
|
16548 | value: function upload() {
|
16549 | var _this2 = this;
|
16550 |
|
16551 | var parts = [];
|
16552 | return this.getUploadId().then(function (uploadId) {
|
16553 | var uploadPart = function uploadPart() {
|
16554 | return _promise.default.resolve(_this2.getChunk()).then(function (chunk) {
|
16555 | if (!chunk) {
|
16556 | return;
|
16557 | }
|
16558 |
|
16559 | var partNumber = parts.length + 1;
|
16560 | return _this2.uploadPart(uploadId, partNumber, chunk).then(function (part) {
|
16561 | parts.push(part);
|
16562 | _this2.uploadedChunks++;
|
16563 | return uploadPart();
|
16564 | });
|
16565 | }).catch(function (error) {
|
16566 | return _this2.stopUpload(uploadId).then(function () {
|
16567 | return _promise.default.reject(error);
|
16568 | });
|
16569 | });
|
16570 | };
|
16571 |
|
16572 | return uploadPart().then(function () {
|
16573 | var _context6;
|
16574 |
|
16575 | return ajax({
|
16576 | method: 'POST',
|
16577 | url: (0, _concat.default)(_context6 = "".concat(_this2.baseURL, "/")).call(_context6, uploadId),
|
16578 | headers: {
|
16579 | Authorization: _this2.upToken
|
16580 | },
|
16581 | data: {
|
16582 | parts: parts,
|
16583 | fname: _this2.file.attributes.name,
|
16584 | mimeType: _this2.file.attributes.mime_type
|
16585 | }
|
16586 | });
|
16587 | });
|
16588 | }).then(function () {
|
16589 | _this2.file.attributes.url = _this2.uploadInfo.url;
|
16590 | _this2.file._bucket = _this2.uploadInfo.bucket;
|
16591 | _this2.file.id = _this2.uploadInfo.objectId;
|
16592 | return _this2.file;
|
16593 | });
|
16594 | }
|
16595 | }]);
|
16596 | return ShardUploader;
|
16597 | }();
|
16598 |
|
16599 | var BlobUploader = function (_ShardUploader) {
|
16600 | (0, _inherits2.default)(BlobUploader, _ShardUploader);
|
16601 |
|
16602 | var _super = _createSuper(BlobUploader);
|
16603 |
|
16604 | function BlobUploader(uploadInfo, data, file, saveOptions) {
|
16605 | var _this3;
|
16606 |
|
16607 | (0, _classCallCheck2.default)(this, BlobUploader);
|
16608 | _this3 = _super.call(this, uploadInfo, data, file, saveOptions);
|
16609 | _this3.size = data.size;
|
16610 | return _this3;
|
16611 | }
|
16612 | |
16613 |
|
16614 |
|
16615 |
|
16616 |
|
16617 | (0, _createClass2.default)(BlobUploader, [{
|
16618 | key: "getChunk",
|
16619 | value: function getChunk() {
|
16620 | var _context7;
|
16621 |
|
16622 | if (this.offset >= this.size) {
|
16623 | return null;
|
16624 | }
|
16625 |
|
16626 | var chunk = (0, _slice.default)(_context7 = this.data).call(_context7, this.offset, this.offset + CHUNK_SIZE);
|
16627 | this.offset += chunk.size;
|
16628 | return chunk;
|
16629 | }
|
16630 | }]);
|
16631 | return BlobUploader;
|
16632 | }(ShardUploader);
|
16633 |
|
16634 | function isBlob(data) {
|
16635 | return typeof Blob !== 'undefined' && data instanceof Blob;
|
16636 | }
|
16637 |
|
16638 | module.exports = function (uploadInfo, data, file) {
|
16639 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
16640 |
|
16641 | if (isBlob(data) && data.size >= SHARD_THRESHOLD) {
|
16642 | return new BlobUploader(uploadInfo, data, file, saveOptions).upload();
|
16643 | }
|
16644 |
|
16645 | return upload(uploadInfo, data, file, saveOptions);
|
16646 | };
|
16647 |
|
16648 | }),
|
16649 |
|
16650 | (function(module, exports, __webpack_require__) {
|
16651 |
|
16652 | __webpack_require__(70);
|
16653 | __webpack_require__(484);
|
16654 | var path = __webpack_require__(7);
|
16655 |
|
16656 | module.exports = path.Array.from;
|
16657 |
|
16658 |
|
16659 | }),
|
16660 |
|
16661 | (function(module, exports, __webpack_require__) {
|
16662 |
|
16663 | var $ = __webpack_require__(0);
|
16664 | var from = __webpack_require__(485);
|
16665 | var checkCorrectnessOfIteration = __webpack_require__(177);
|
16666 |
|
16667 | var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
|
16668 |
|
16669 | Array.from(iterable);
|
16670 | });
|
16671 |
|
16672 |
|
16673 |
|
16674 | $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
|
16675 | from: from
|
16676 | });
|
16677 |
|
16678 |
|
16679 | }),
|
16680 |
|
16681 | (function(module, exports, __webpack_require__) {
|
16682 |
|
16683 | "use strict";
|
16684 |
|
16685 | var bind = __webpack_require__(52);
|
16686 | var call = __webpack_require__(15);
|
16687 | var toObject = __webpack_require__(33);
|
16688 | var callWithSafeIterationClosing = __webpack_require__(486);
|
16689 | var isArrayIteratorMethod = __webpack_require__(165);
|
16690 | var isConstructor = __webpack_require__(111);
|
16691 | var lengthOfArrayLike = __webpack_require__(40);
|
16692 | var createProperty = __webpack_require__(93);
|
16693 | var getIterator = __webpack_require__(166);
|
16694 | var getIteratorMethod = __webpack_require__(108);
|
16695 |
|
16696 | var $Array = Array;
|
16697 |
|
16698 |
|
16699 |
|
16700 | module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
|
16701 | var O = toObject(arrayLike);
|
16702 | var IS_CONSTRUCTOR = isConstructor(this);
|
16703 | var argumentsLength = arguments.length;
|
16704 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
16705 | var mapping = mapfn !== undefined;
|
16706 | if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
|
16707 | var iteratorMethod = getIteratorMethod(O);
|
16708 | var index = 0;
|
16709 | var length, result, step, iterator, next, value;
|
16710 |
|
16711 | if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
|
16712 | iterator = getIterator(O, iteratorMethod);
|
16713 | next = iterator.next;
|
16714 | result = IS_CONSTRUCTOR ? new this() : [];
|
16715 | for (;!(step = call(next, iterator)).done; index++) {
|
16716 | value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
|
16717 | createProperty(result, index, value);
|
16718 | }
|
16719 | } else {
|
16720 | length = lengthOfArrayLike(O);
|
16721 | result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
|
16722 | for (;length > index; index++) {
|
16723 | value = mapping ? mapfn(O[index], index) : O[index];
|
16724 | createProperty(result, index, value);
|
16725 | }
|
16726 | }
|
16727 | result.length = index;
|
16728 | return result;
|
16729 | };
|
16730 |
|
16731 |
|
16732 | }),
|
16733 |
|
16734 | (function(module, exports, __webpack_require__) {
|
16735 |
|
16736 | var anObject = __webpack_require__(21);
|
16737 | var iteratorClose = __webpack_require__(167);
|
16738 |
|
16739 |
|
16740 | module.exports = function (iterator, fn, value, ENTRIES) {
|
16741 | try {
|
16742 | return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
16743 | } catch (error) {
|
16744 | iteratorClose(iterator, 'throw', error);
|
16745 | }
|
16746 | };
|
16747 |
|
16748 |
|
16749 | }),
|
16750 |
|
16751 | (function(module, exports, __webpack_require__) {
|
16752 |
|
16753 | module.exports = __webpack_require__(488);
|
16754 |
|
16755 |
|
16756 | }),
|
16757 |
|
16758 | (function(module, exports, __webpack_require__) {
|
16759 |
|
16760 | var parent = __webpack_require__(489);
|
16761 |
|
16762 | module.exports = parent;
|
16763 |
|
16764 |
|
16765 | }),
|
16766 |
|
16767 | (function(module, exports, __webpack_require__) {
|
16768 |
|
16769 | var parent = __webpack_require__(490);
|
16770 |
|
16771 | module.exports = parent;
|
16772 |
|
16773 |
|
16774 | }),
|
16775 |
|
16776 | (function(module, exports, __webpack_require__) {
|
16777 |
|
16778 | var parent = __webpack_require__(491);
|
16779 | __webpack_require__(46);
|
16780 |
|
16781 | module.exports = parent;
|
16782 |
|
16783 |
|
16784 | }),
|
16785 |
|
16786 | (function(module, exports, __webpack_require__) {
|
16787 |
|
16788 | __webpack_require__(43);
|
16789 | __webpack_require__(70);
|
16790 | var getIteratorMethod = __webpack_require__(108);
|
16791 |
|
16792 | module.exports = getIteratorMethod;
|
16793 |
|
16794 |
|
16795 | }),
|
16796 |
|
16797 | (function(module, exports, __webpack_require__) {
|
16798 |
|
16799 | module.exports = __webpack_require__(493);
|
16800 |
|
16801 | }),
|
16802 |
|
16803 | (function(module, exports, __webpack_require__) {
|
16804 |
|
16805 | var parent = __webpack_require__(494);
|
16806 |
|
16807 | module.exports = parent;
|
16808 |
|
16809 |
|
16810 | }),
|
16811 |
|
16812 | (function(module, exports, __webpack_require__) {
|
16813 |
|
16814 | __webpack_require__(495);
|
16815 | var path = __webpack_require__(7);
|
16816 |
|
16817 | module.exports = path.Reflect.construct;
|
16818 |
|
16819 |
|
16820 | }),
|
16821 |
|
16822 | (function(module, exports, __webpack_require__) {
|
16823 |
|
16824 | var $ = __webpack_require__(0);
|
16825 | var getBuiltIn = __webpack_require__(20);
|
16826 | var apply = __webpack_require__(79);
|
16827 | var bind = __webpack_require__(253);
|
16828 | var aConstructor = __webpack_require__(173);
|
16829 | var anObject = __webpack_require__(21);
|
16830 | var isObject = __webpack_require__(11);
|
16831 | var create = __webpack_require__(53);
|
16832 | var fails = __webpack_require__(2);
|
16833 |
|
16834 | var nativeConstruct = getBuiltIn('Reflect', 'construct');
|
16835 | var ObjectPrototype = Object.prototype;
|
16836 | var push = [].push;
|
16837 |
|
16838 |
|
16839 |
|
16840 |
|
16841 |
|
16842 | var NEW_TARGET_BUG = fails(function () {
|
16843 | function F() { }
|
16844 | return !(nativeConstruct(function () { }, [], F) instanceof F);
|
16845 | });
|
16846 |
|
16847 | var ARGS_BUG = !fails(function () {
|
16848 | nativeConstruct(function () { });
|
16849 | });
|
16850 |
|
16851 | var FORCED = NEW_TARGET_BUG || ARGS_BUG;
|
16852 |
|
16853 | $({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
|
16854 | construct: function construct(Target, args /* , newTarget */) {
|
16855 | aConstructor(Target);
|
16856 | anObject(args);
|
16857 | var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
|
16858 | if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
|
16859 | if (Target == newTarget) {
|
16860 |
|
16861 | switch (args.length) {
|
16862 | case 0: return new Target();
|
16863 | case 1: return new Target(args[0]);
|
16864 | case 2: return new Target(args[0], args[1]);
|
16865 | case 3: return new Target(args[0], args[1], args[2]);
|
16866 | case 4: return new Target(args[0], args[1], args[2], args[3]);
|
16867 | }
|
16868 |
|
16869 | var $args = [null];
|
16870 | apply(push, $args, args);
|
16871 | return new (apply(bind, Target, $args))();
|
16872 | }
|
16873 |
|
16874 | var proto = newTarget.prototype;
|
16875 | var instance = create(isObject(proto) ? proto : ObjectPrototype);
|
16876 | var result = apply(Target, instance, args);
|
16877 | return isObject(result) ? result : instance;
|
16878 | }
|
16879 | });
|
16880 |
|
16881 |
|
16882 | }),
|
16883 |
|
16884 | (function(module, exports, __webpack_require__) {
|
16885 |
|
16886 | var _Object$create = __webpack_require__(497);
|
16887 |
|
16888 | var _Object$defineProperty = __webpack_require__(153);
|
16889 |
|
16890 | var setPrototypeOf = __webpack_require__(507);
|
16891 |
|
16892 | function _inherits(subClass, superClass) {
|
16893 | if (typeof superClass !== "function" && superClass !== null) {
|
16894 | throw new TypeError("Super expression must either be null or a function");
|
16895 | }
|
16896 |
|
16897 | subClass.prototype = _Object$create(superClass && superClass.prototype, {
|
16898 | constructor: {
|
16899 | value: subClass,
|
16900 | writable: true,
|
16901 | configurable: true
|
16902 | }
|
16903 | });
|
16904 |
|
16905 | _Object$defineProperty(subClass, "prototype", {
|
16906 | writable: false
|
16907 | });
|
16908 |
|
16909 | if (superClass) setPrototypeOf(subClass, superClass);
|
16910 | }
|
16911 |
|
16912 | module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
16913 |
|
16914 | }),
|
16915 |
|
16916 | (function(module, exports, __webpack_require__) {
|
16917 |
|
16918 | module.exports = __webpack_require__(498);
|
16919 |
|
16920 | }),
|
16921 |
|
16922 | (function(module, exports, __webpack_require__) {
|
16923 |
|
16924 | module.exports = __webpack_require__(499);
|
16925 |
|
16926 |
|
16927 | }),
|
16928 |
|
16929 | (function(module, exports, __webpack_require__) {
|
16930 |
|
16931 | var parent = __webpack_require__(500);
|
16932 |
|
16933 | module.exports = parent;
|
16934 |
|
16935 |
|
16936 | }),
|
16937 |
|
16938 | (function(module, exports, __webpack_require__) {
|
16939 |
|
16940 | var parent = __webpack_require__(501);
|
16941 |
|
16942 | module.exports = parent;
|
16943 |
|
16944 |
|
16945 | }),
|
16946 |
|
16947 | (function(module, exports, __webpack_require__) {
|
16948 |
|
16949 | var parent = __webpack_require__(502);
|
16950 |
|
16951 | module.exports = parent;
|
16952 |
|
16953 |
|
16954 | }),
|
16955 |
|
16956 | (function(module, exports, __webpack_require__) {
|
16957 |
|
16958 | __webpack_require__(503);
|
16959 | var path = __webpack_require__(7);
|
16960 |
|
16961 | var Object = path.Object;
|
16962 |
|
16963 | module.exports = function create(P, D) {
|
16964 | return Object.create(P, D);
|
16965 | };
|
16966 |
|
16967 |
|
16968 | }),
|
16969 |
|
16970 | (function(module, exports, __webpack_require__) {
|
16971 |
|
16972 |
|
16973 | var $ = __webpack_require__(0);
|
16974 | var DESCRIPTORS = __webpack_require__(14);
|
16975 | var create = __webpack_require__(53);
|
16976 |
|
16977 |
|
16978 |
|
16979 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
16980 | create: create
|
16981 | });
|
16982 |
|
16983 |
|
16984 | }),
|
16985 |
|
16986 | (function(module, exports, __webpack_require__) {
|
16987 |
|
16988 | module.exports = __webpack_require__(505);
|
16989 |
|
16990 |
|
16991 | }),
|
16992 |
|
16993 | (function(module, exports, __webpack_require__) {
|
16994 |
|
16995 | var parent = __webpack_require__(506);
|
16996 |
|
16997 | module.exports = parent;
|
16998 |
|
16999 |
|
17000 | }),
|
17001 |
|
17002 | (function(module, exports, __webpack_require__) {
|
17003 |
|
17004 | var parent = __webpack_require__(239);
|
17005 |
|
17006 | module.exports = parent;
|
17007 |
|
17008 |
|
17009 | }),
|
17010 |
|
17011 | (function(module, exports, __webpack_require__) {
|
17012 |
|
17013 | var _Object$setPrototypeOf = __webpack_require__(254);
|
17014 |
|
17015 | var _bindInstanceProperty = __webpack_require__(255);
|
17016 |
|
17017 | function _setPrototypeOf(o, p) {
|
17018 | var _context;
|
17019 |
|
17020 | module.exports = _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
|
17021 | o.__proto__ = p;
|
17022 | return o;
|
17023 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17024 | return _setPrototypeOf(o, p);
|
17025 | }
|
17026 |
|
17027 | module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17028 |
|
17029 | }),
|
17030 |
|
17031 | (function(module, exports, __webpack_require__) {
|
17032 |
|
17033 | module.exports = __webpack_require__(509);
|
17034 |
|
17035 |
|
17036 | }),
|
17037 |
|
17038 | (function(module, exports, __webpack_require__) {
|
17039 |
|
17040 | var parent = __webpack_require__(510);
|
17041 |
|
17042 | module.exports = parent;
|
17043 |
|
17044 |
|
17045 | }),
|
17046 |
|
17047 | (function(module, exports, __webpack_require__) {
|
17048 |
|
17049 | var parent = __webpack_require__(237);
|
17050 |
|
17051 | module.exports = parent;
|
17052 |
|
17053 |
|
17054 | }),
|
17055 |
|
17056 | (function(module, exports, __webpack_require__) {
|
17057 |
|
17058 | module.exports = __webpack_require__(512);
|
17059 |
|
17060 |
|
17061 | }),
|
17062 |
|
17063 | (function(module, exports, __webpack_require__) {
|
17064 |
|
17065 | var parent = __webpack_require__(513);
|
17066 |
|
17067 | module.exports = parent;
|
17068 |
|
17069 |
|
17070 | }),
|
17071 |
|
17072 | (function(module, exports, __webpack_require__) {
|
17073 |
|
17074 | var parent = __webpack_require__(514);
|
17075 |
|
17076 | module.exports = parent;
|
17077 |
|
17078 |
|
17079 | }),
|
17080 |
|
17081 | (function(module, exports, __webpack_require__) {
|
17082 |
|
17083 | var parent = __webpack_require__(515);
|
17084 |
|
17085 | module.exports = parent;
|
17086 |
|
17087 |
|
17088 | }),
|
17089 |
|
17090 | (function(module, exports, __webpack_require__) {
|
17091 |
|
17092 | var isPrototypeOf = __webpack_require__(16);
|
17093 | var method = __webpack_require__(516);
|
17094 |
|
17095 | var FunctionPrototype = Function.prototype;
|
17096 |
|
17097 | module.exports = function (it) {
|
17098 | var own = it.bind;
|
17099 | return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;
|
17100 | };
|
17101 |
|
17102 |
|
17103 | }),
|
17104 |
|
17105 | (function(module, exports, __webpack_require__) {
|
17106 |
|
17107 | __webpack_require__(517);
|
17108 | var entryVirtual = __webpack_require__(27);
|
17109 |
|
17110 | module.exports = entryVirtual('Function').bind;
|
17111 |
|
17112 |
|
17113 | }),
|
17114 |
|
17115 | (function(module, exports, __webpack_require__) {
|
17116 |
|
17117 |
|
17118 | var $ = __webpack_require__(0);
|
17119 | var bind = __webpack_require__(253);
|
17120 |
|
17121 |
|
17122 |
|
17123 | $({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
|
17124 | bind: bind
|
17125 | });
|
17126 |
|
17127 |
|
17128 | }),
|
17129 |
|
17130 | (function(module, exports, __webpack_require__) {
|
17131 |
|
17132 | var _typeof = __webpack_require__(95)["default"];
|
17133 |
|
17134 | var assertThisInitialized = __webpack_require__(519);
|
17135 |
|
17136 | function _possibleConstructorReturn(self, call) {
|
17137 | if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
17138 | return call;
|
17139 | } else if (call !== void 0) {
|
17140 | throw new TypeError("Derived constructors may only return object or undefined");
|
17141 | }
|
17142 |
|
17143 | return assertThisInitialized(self);
|
17144 | }
|
17145 |
|
17146 | module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17147 |
|
17148 | }),
|
17149 |
|
17150 | (function(module, exports) {
|
17151 |
|
17152 | function _assertThisInitialized(self) {
|
17153 | if (self === void 0) {
|
17154 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
17155 | }
|
17156 |
|
17157 | return self;
|
17158 | }
|
17159 |
|
17160 | module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17161 |
|
17162 | }),
|
17163 |
|
17164 | (function(module, exports, __webpack_require__) {
|
17165 |
|
17166 | var _Object$setPrototypeOf = __webpack_require__(254);
|
17167 |
|
17168 | var _bindInstanceProperty = __webpack_require__(255);
|
17169 |
|
17170 | var _Object$getPrototypeOf = __webpack_require__(521);
|
17171 |
|
17172 | function _getPrototypeOf(o) {
|
17173 | var _context;
|
17174 |
|
17175 | module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
|
17176 | return o.__proto__ || _Object$getPrototypeOf(o);
|
17177 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17178 | return _getPrototypeOf(o);
|
17179 | }
|
17180 |
|
17181 | module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17182 |
|
17183 | }),
|
17184 |
|
17185 | (function(module, exports, __webpack_require__) {
|
17186 |
|
17187 | module.exports = __webpack_require__(522);
|
17188 |
|
17189 | }),
|
17190 |
|
17191 | (function(module, exports, __webpack_require__) {
|
17192 |
|
17193 | module.exports = __webpack_require__(523);
|
17194 |
|
17195 |
|
17196 | }),
|
17197 |
|
17198 | (function(module, exports, __webpack_require__) {
|
17199 |
|
17200 | var parent = __webpack_require__(524);
|
17201 |
|
17202 | module.exports = parent;
|
17203 |
|
17204 |
|
17205 | }),
|
17206 |
|
17207 | (function(module, exports, __webpack_require__) {
|
17208 |
|
17209 | var parent = __webpack_require__(232);
|
17210 |
|
17211 | module.exports = parent;
|
17212 |
|
17213 |
|
17214 | }),
|
17215 |
|
17216 | (function(module, exports) {
|
17217 |
|
17218 | function _classCallCheck(instance, Constructor) {
|
17219 | if (!(instance instanceof Constructor)) {
|
17220 | throw new TypeError("Cannot call a class as a function");
|
17221 | }
|
17222 | }
|
17223 |
|
17224 | module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17225 |
|
17226 | }),
|
17227 |
|
17228 | (function(module, exports, __webpack_require__) {
|
17229 |
|
17230 | var _Object$defineProperty = __webpack_require__(153);
|
17231 |
|
17232 | function _defineProperties(target, props) {
|
17233 | for (var i = 0; i < props.length; i++) {
|
17234 | var descriptor = props[i];
|
17235 | descriptor.enumerable = descriptor.enumerable || false;
|
17236 | descriptor.configurable = true;
|
17237 | if ("value" in descriptor) descriptor.writable = true;
|
17238 |
|
17239 | _Object$defineProperty(target, descriptor.key, descriptor);
|
17240 | }
|
17241 | }
|
17242 |
|
17243 | function _createClass(Constructor, protoProps, staticProps) {
|
17244 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
17245 | if (staticProps) _defineProperties(Constructor, staticProps);
|
17246 |
|
17247 | _Object$defineProperty(Constructor, "prototype", {
|
17248 | writable: false
|
17249 | });
|
17250 |
|
17251 | return Constructor;
|
17252 | }
|
17253 |
|
17254 | module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17255 |
|
17256 | }),
|
17257 |
|
17258 | (function(module, exports, __webpack_require__) {
|
17259 |
|
17260 | "use strict";
|
17261 |
|
17262 |
|
17263 | var _interopRequireDefault = __webpack_require__(1);
|
17264 |
|
17265 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
17266 |
|
17267 |
|
17268 | var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
17269 |
|
17270 | module.exports = function (string) {
|
17271 | var result = '';
|
17272 |
|
17273 | for (var i = 0; i < string.length;) {
|
17274 | var a = string.charCodeAt(i++);
|
17275 | var b = string.charCodeAt(i++);
|
17276 | var c = string.charCodeAt(i++);
|
17277 |
|
17278 | if (a > 255 || b > 255 || c > 255) {
|
17279 | throw new TypeError('Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.');
|
17280 | }
|
17281 |
|
17282 | var bitmap = a << 16 | b << 8 | c;
|
17283 | result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
|
17284 | }
|
17285 |
|
17286 |
|
17287 | var rest = string.length % 3;
|
17288 |
|
17289 | return rest ? (0, _slice.default)(result).call(result, 0, rest - 3) + '==='.substring(rest) : result;
|
17290 | };
|
17291 |
|
17292 | }),
|
17293 |
|
17294 | (function(module, exports, __webpack_require__) {
|
17295 |
|
17296 | "use strict";
|
17297 |
|
17298 |
|
17299 | var _ = __webpack_require__(3);
|
17300 |
|
17301 | var ajax = __webpack_require__(117);
|
17302 |
|
17303 | module.exports = function upload(uploadInfo, data, file) {
|
17304 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
17305 | return ajax({
|
17306 | url: uploadInfo.upload_url,
|
17307 | method: 'PUT',
|
17308 | data: data,
|
17309 | headers: _.extend({
|
17310 | 'Content-Type': file.get('mime_type'),
|
17311 | 'Cache-Control': 'public, max-age=31536000'
|
17312 | }, file._uploadHeaders),
|
17313 | onprogress: saveOptions.onprogress
|
17314 | }).then(function () {
|
17315 | file.attributes.url = uploadInfo.url;
|
17316 | file._bucket = uploadInfo.bucket;
|
17317 | file.id = uploadInfo.objectId;
|
17318 | return file;
|
17319 | });
|
17320 | };
|
17321 |
|
17322 | }),
|
17323 |
|
17324 | (function(module, exports, __webpack_require__) {
|
17325 |
|
17326 | (function(){
|
17327 | var crypt = __webpack_require__(530),
|
17328 | utf8 = __webpack_require__(256).utf8,
|
17329 | isBuffer = __webpack_require__(531),
|
17330 | bin = __webpack_require__(256).bin,
|
17331 |
|
17332 |
|
17333 | md5 = function (message, options) {
|
17334 |
|
17335 | if (message.constructor == String)
|
17336 | if (options && options.encoding === 'binary')
|
17337 | message = bin.stringToBytes(message);
|
17338 | else
|
17339 | message = utf8.stringToBytes(message);
|
17340 | else if (isBuffer(message))
|
17341 | message = Array.prototype.slice.call(message, 0);
|
17342 | else if (!Array.isArray(message))
|
17343 | message = message.toString();
|
17344 |
|
17345 |
|
17346 | var m = crypt.bytesToWords(message),
|
17347 | l = message.length * 8,
|
17348 | a = 1732584193,
|
17349 | b = -271733879,
|
17350 | c = -1732584194,
|
17351 | d = 271733878;
|
17352 |
|
17353 |
|
17354 | for (var i = 0; i < m.length; i++) {
|
17355 | m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
|
17356 | ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
|
17357 | }
|
17358 |
|
17359 |
|
17360 | m[l >>> 5] |= 0x80 << (l % 32);
|
17361 | m[(((l + 64) >>> 9) << 4) + 14] = l;
|
17362 |
|
17363 |
|
17364 | var FF = md5._ff,
|
17365 | GG = md5._gg,
|
17366 | HH = md5._hh,
|
17367 | II = md5._ii;
|
17368 |
|
17369 | for (var i = 0; i < m.length; i += 16) {
|
17370 |
|
17371 | var aa = a,
|
17372 | bb = b,
|
17373 | cc = c,
|
17374 | dd = d;
|
17375 |
|
17376 | a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
|
17377 | d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
|
17378 | c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
|
17379 | b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
|
17380 | a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
|
17381 | d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
|
17382 | c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
|
17383 | b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
|
17384 | a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
|
17385 | d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
|
17386 | c = FF(c, d, a, b, m[i+10], 17, -42063);
|
17387 | b = FF(b, c, d, a, m[i+11], 22, -1990404162);
|
17388 | a = FF(a, b, c, d, m[i+12], 7, 1804603682);
|
17389 | d = FF(d, a, b, c, m[i+13], 12, -40341101);
|
17390 | c = FF(c, d, a, b, m[i+14], 17, -1502002290);
|
17391 | b = FF(b, c, d, a, m[i+15], 22, 1236535329);
|
17392 |
|
17393 | a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
|
17394 | d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
|
17395 | c = GG(c, d, a, b, m[i+11], 14, 643717713);
|
17396 | b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
|
17397 | a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
|
17398 | d = GG(d, a, b, c, m[i+10], 9, 38016083);
|
17399 | c = GG(c, d, a, b, m[i+15], 14, -660478335);
|
17400 | b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
|
17401 | a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
|
17402 | d = GG(d, a, b, c, m[i+14], 9, -1019803690);
|
17403 | c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
|
17404 | b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
|
17405 | a = GG(a, b, c, d, m[i+13], 5, -1444681467);
|
17406 | d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
|
17407 | c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
|
17408 | b = GG(b, c, d, a, m[i+12], 20, -1926607734);
|
17409 |
|
17410 | a = HH(a, b, c, d, m[i+ 5], 4, -378558);
|
17411 | d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
|
17412 | c = HH(c, d, a, b, m[i+11], 16, 1839030562);
|
17413 | b = HH(b, c, d, a, m[i+14], 23, -35309556);
|
17414 | a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
|
17415 | d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
|
17416 | c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
|
17417 | b = HH(b, c, d, a, m[i+10], 23, -1094730640);
|
17418 | a = HH(a, b, c, d, m[i+13], 4, 681279174);
|
17419 | d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
|
17420 | c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
|
17421 | b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
|
17422 | a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
|
17423 | d = HH(d, a, b, c, m[i+12], 11, -421815835);
|
17424 | c = HH(c, d, a, b, m[i+15], 16, 530742520);
|
17425 | b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
|
17426 |
|
17427 | a = II(a, b, c, d, m[i+ 0], 6, -198630844);
|
17428 | d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
|
17429 | c = II(c, d, a, b, m[i+14], 15, -1416354905);
|
17430 | b = II(b, c, d, a, m[i+ 5], 21, -57434055);
|
17431 | a = II(a, b, c, d, m[i+12], 6, 1700485571);
|
17432 | d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
|
17433 | c = II(c, d, a, b, m[i+10], 15, -1051523);
|
17434 | b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
|
17435 | a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
|
17436 | d = II(d, a, b, c, m[i+15], 10, -30611744);
|
17437 | c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
|
17438 | b = II(b, c, d, a, m[i+13], 21, 1309151649);
|
17439 | a = II(a, b, c, d, m[i+ 4], 6, -145523070);
|
17440 | d = II(d, a, b, c, m[i+11], 10, -1120210379);
|
17441 | c = II(c, d, a, b, m[i+ 2], 15, 718787259);
|
17442 | b = II(b, c, d, a, m[i+ 9], 21, -343485551);
|
17443 |
|
17444 | a = (a + aa) >>> 0;
|
17445 | b = (b + bb) >>> 0;
|
17446 | c = (c + cc) >>> 0;
|
17447 | d = (d + dd) >>> 0;
|
17448 | }
|
17449 |
|
17450 | return crypt.endian([a, b, c, d]);
|
17451 | };
|
17452 |
|
17453 |
|
17454 | md5._ff = function (a, b, c, d, x, s, t) {
|
17455 | var n = a + (b & c | ~b & d) + (x >>> 0) + t;
|
17456 | return ((n << s) | (n >>> (32 - s))) + b;
|
17457 | };
|
17458 | md5._gg = function (a, b, c, d, x, s, t) {
|
17459 | var n = a + (b & d | c & ~d) + (x >>> 0) + t;
|
17460 | return ((n << s) | (n >>> (32 - s))) + b;
|
17461 | };
|
17462 | md5._hh = function (a, b, c, d, x, s, t) {
|
17463 | var n = a + (b ^ c ^ d) + (x >>> 0) + t;
|
17464 | return ((n << s) | (n >>> (32 - s))) + b;
|
17465 | };
|
17466 | md5._ii = function (a, b, c, d, x, s, t) {
|
17467 | var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
|
17468 | return ((n << s) | (n >>> (32 - s))) + b;
|
17469 | };
|
17470 |
|
17471 |
|
17472 | md5._blocksize = 16;
|
17473 | md5._digestsize = 16;
|
17474 |
|
17475 | module.exports = function (message, options) {
|
17476 | if (message === undefined || message === null)
|
17477 | throw new Error('Illegal argument ' + message);
|
17478 |
|
17479 | var digestbytes = crypt.wordsToBytes(md5(message, options));
|
17480 | return options && options.asBytes ? digestbytes :
|
17481 | options && options.asString ? bin.bytesToString(digestbytes) :
|
17482 | crypt.bytesToHex(digestbytes);
|
17483 | };
|
17484 |
|
17485 | })();
|
17486 |
|
17487 |
|
17488 | }),
|
17489 |
|
17490 | (function(module, exports) {
|
17491 |
|
17492 | (function() {
|
17493 | var base64map
|
17494 | = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
|
17495 |
|
17496 | crypt = {
|
17497 |
|
17498 | rotl: function(n, b) {
|
17499 | return (n << b) | (n >>> (32 - b));
|
17500 | },
|
17501 |
|
17502 |
|
17503 | rotr: function(n, b) {
|
17504 | return (n << (32 - b)) | (n >>> b);
|
17505 | },
|
17506 |
|
17507 |
|
17508 | endian: function(n) {
|
17509 |
|
17510 | if (n.constructor == Number) {
|
17511 | return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
|
17512 | }
|
17513 |
|
17514 |
|
17515 | for (var i = 0; i < n.length; i++)
|
17516 | n[i] = crypt.endian(n[i]);
|
17517 | return n;
|
17518 | },
|
17519 |
|
17520 |
|
17521 | randomBytes: function(n) {
|
17522 | for (var bytes = []; n > 0; n--)
|
17523 | bytes.push(Math.floor(Math.random() * 256));
|
17524 | return bytes;
|
17525 | },
|
17526 |
|
17527 |
|
17528 | bytesToWords: function(bytes) {
|
17529 | for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
|
17530 | words[b >>> 5] |= bytes[i] << (24 - b % 32);
|
17531 | return words;
|
17532 | },
|
17533 |
|
17534 |
|
17535 | wordsToBytes: function(words) {
|
17536 | for (var bytes = [], b = 0; b < words.length * 32; b += 8)
|
17537 | bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
|
17538 | return bytes;
|
17539 | },
|
17540 |
|
17541 |
|
17542 | bytesToHex: function(bytes) {
|
17543 | for (var hex = [], i = 0; i < bytes.length; i++) {
|
17544 | hex.push((bytes[i] >>> 4).toString(16));
|
17545 | hex.push((bytes[i] & 0xF).toString(16));
|
17546 | }
|
17547 | return hex.join('');
|
17548 | },
|
17549 |
|
17550 |
|
17551 | hexToBytes: function(hex) {
|
17552 | for (var bytes = [], c = 0; c < hex.length; c += 2)
|
17553 | bytes.push(parseInt(hex.substr(c, 2), 16));
|
17554 | return bytes;
|
17555 | },
|
17556 |
|
17557 |
|
17558 | bytesToBase64: function(bytes) {
|
17559 | for (var base64 = [], i = 0; i < bytes.length; i += 3) {
|
17560 | var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
|
17561 | for (var j = 0; j < 4; j++)
|
17562 | if (i * 8 + j * 6 <= bytes.length * 8)
|
17563 | base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
|
17564 | else
|
17565 | base64.push('=');
|
17566 | }
|
17567 | return base64.join('');
|
17568 | },
|
17569 |
|
17570 |
|
17571 | base64ToBytes: function(base64) {
|
17572 |
|
17573 | base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
|
17574 |
|
17575 | for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
|
17576 | imod4 = ++i % 4) {
|
17577 | if (imod4 == 0) continue;
|
17578 | bytes.push(((base64map.indexOf(base64.charAt(i - 1))
|
17579 | & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
|
17580 | | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
|
17581 | }
|
17582 | return bytes;
|
17583 | }
|
17584 | };
|
17585 |
|
17586 | module.exports = crypt;
|
17587 | })();
|
17588 |
|
17589 |
|
17590 | }),
|
17591 |
|
17592 | (function(module, exports) {
|
17593 |
|
17594 |
|
17595 |
|
17596 |
|
17597 |
|
17598 |
|
17599 |
|
17600 |
|
17601 |
|
17602 |
|
17603 | module.exports = function (obj) {
|
17604 | return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
|
17605 | }
|
17606 |
|
17607 | function isBuffer (obj) {
|
17608 | return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
|
17609 | }
|
17610 |
|
17611 |
|
17612 | function isSlowBuffer (obj) {
|
17613 | return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
|
17614 | }
|
17615 |
|
17616 |
|
17617 | }),
|
17618 |
|
17619 | (function(module, exports, __webpack_require__) {
|
17620 |
|
17621 | "use strict";
|
17622 |
|
17623 |
|
17624 | var _interopRequireDefault = __webpack_require__(1);
|
17625 |
|
17626 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
17627 |
|
17628 | var dataURItoBlob = function dataURItoBlob(dataURI, type) {
|
17629 | var _context;
|
17630 |
|
17631 | var byteString;
|
17632 |
|
17633 | if ((0, _indexOf.default)(dataURI).call(dataURI, 'base64') < 0) {
|
17634 | byteString = atob(dataURI);
|
17635 | } else if ((0, _indexOf.default)(_context = dataURI.split(',')[0]).call(_context, 'base64') >= 0) {
|
17636 | type = type || dataURI.split(',')[0].split(':')[1].split(';')[0];
|
17637 | byteString = atob(dataURI.split(',')[1]);
|
17638 | } else {
|
17639 | byteString = unescape(dataURI.split(',')[1]);
|
17640 | }
|
17641 |
|
17642 | var ia = new Uint8Array(byteString.length);
|
17643 |
|
17644 | for (var i = 0; i < byteString.length; i++) {
|
17645 | ia[i] = byteString.charCodeAt(i);
|
17646 | }
|
17647 |
|
17648 | return new Blob([ia], {
|
17649 | type: type
|
17650 | });
|
17651 | };
|
17652 |
|
17653 | module.exports = dataURItoBlob;
|
17654 |
|
17655 | }),
|
17656 |
|
17657 | (function(module, exports, __webpack_require__) {
|
17658 |
|
17659 | "use strict";
|
17660 |
|
17661 |
|
17662 | var _interopRequireDefault = __webpack_require__(1);
|
17663 |
|
17664 | var _slicedToArray2 = _interopRequireDefault(__webpack_require__(534));
|
17665 |
|
17666 | var _map = _interopRequireDefault(__webpack_require__(37));
|
17667 |
|
17668 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
17669 |
|
17670 | var _find = _interopRequireDefault(__webpack_require__(96));
|
17671 |
|
17672 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
17673 |
|
17674 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
17675 |
|
17676 | var _keys2 = _interopRequireDefault(__webpack_require__(62));
|
17677 |
|
17678 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
17679 |
|
17680 | var _defineProperty = _interopRequireDefault(__webpack_require__(94));
|
17681 |
|
17682 | var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(257));
|
17683 |
|
17684 | var _ = __webpack_require__(3);
|
17685 |
|
17686 | var AVError = __webpack_require__(48);
|
17687 |
|
17688 | var _require = __webpack_require__(28),
|
17689 | _request = _require._request;
|
17690 |
|
17691 | var _require2 = __webpack_require__(32),
|
17692 | isNullOrUndefined = _require2.isNullOrUndefined,
|
17693 | ensureArray = _require2.ensureArray,
|
17694 | transformFetchOptions = _require2.transformFetchOptions,
|
17695 | setValue = _require2.setValue,
|
17696 | findValue = _require2.findValue,
|
17697 | isPlainObject = _require2.isPlainObject,
|
17698 | continueWhile = _require2.continueWhile;
|
17699 |
|
17700 | var recursiveToPointer = function recursiveToPointer(value) {
|
17701 | if (_.isArray(value)) return (0, _map.default)(value).call(value, recursiveToPointer);
|
17702 | if (isPlainObject(value)) return _.mapObject(value, recursiveToPointer);
|
17703 | if (_.isObject(value) && value._toPointer) return value._toPointer();
|
17704 | return value;
|
17705 | };
|
17706 |
|
17707 | var RESERVED_KEYS = ['objectId', 'createdAt', 'updatedAt'];
|
17708 |
|
17709 | var checkReservedKey = function checkReservedKey(key) {
|
17710 | if ((0, _indexOf.default)(RESERVED_KEYS).call(RESERVED_KEYS, key) !== -1) {
|
17711 | throw new Error("key[".concat(key, "] is reserved"));
|
17712 | }
|
17713 | };
|
17714 |
|
17715 | var handleBatchResults = function handleBatchResults(results) {
|
17716 | var firstError = (0, _find.default)(_).call(_, results, function (result) {
|
17717 | return result instanceof Error;
|
17718 | });
|
17719 |
|
17720 | if (!firstError) {
|
17721 | return results;
|
17722 | }
|
17723 |
|
17724 | var error = new AVError(firstError.code, firstError.message);
|
17725 | error.results = results;
|
17726 | throw error;
|
17727 | };
|
17728 |
|
17729 |
|
17730 |
|
17731 | function getValue(object, prop) {
|
17732 | if (!(object && object[prop])) {
|
17733 | return null;
|
17734 | }
|
17735 |
|
17736 | return _.isFunction(object[prop]) ? object[prop]() : object[prop];
|
17737 | }
|
17738 |
|
17739 |
|
17740 |
|
17741 | module.exports = function (AV) {
|
17742 | |
17743 |
|
17744 |
|
17745 |
|
17746 |
|
17747 |
|
17748 |
|
17749 |
|
17750 |
|
17751 |
|
17752 |
|
17753 |
|
17754 |
|
17755 |
|
17756 |
|
17757 |
|
17758 |
|
17759 |
|
17760 |
|
17761 |
|
17762 |
|
17763 |
|
17764 |
|
17765 |
|
17766 |
|
17767 |
|
17768 |
|
17769 | AV.Object = function (attributes, options) {
|
17770 |
|
17771 | if (_.isString(attributes)) {
|
17772 | return AV.Object._create.apply(this, arguments);
|
17773 | }
|
17774 |
|
17775 | attributes = attributes || {};
|
17776 |
|
17777 | if (options && options.parse) {
|
17778 | attributes = this.parse(attributes);
|
17779 | attributes = this._mergeMagicFields(attributes);
|
17780 | }
|
17781 |
|
17782 | var defaults = getValue(this, 'defaults');
|
17783 |
|
17784 | if (defaults) {
|
17785 | attributes = _.extend({}, defaults, attributes);
|
17786 | }
|
17787 |
|
17788 | if (options && options.collection) {
|
17789 | this.collection = options.collection;
|
17790 | }
|
17791 |
|
17792 | this._serverData = {};
|
17793 |
|
17794 | this._opSetQueue = [{}];
|
17795 |
|
17796 | this._flags = {};
|
17797 | this.attributes = {};
|
17798 |
|
17799 | this._hashedJSON = {};
|
17800 |
|
17801 | this._escapedAttributes = {};
|
17802 | this.cid = _.uniqueId('c');
|
17803 | this.changed = {};
|
17804 | this._silent = {};
|
17805 | this._pending = {};
|
17806 | this.set(attributes, {
|
17807 | silent: true
|
17808 | });
|
17809 | this.changed = {};
|
17810 | this._silent = {};
|
17811 | this._pending = {};
|
17812 | this._hasData = true;
|
17813 | this._previousAttributes = _.clone(this.attributes);
|
17814 | this.initialize.apply(this, arguments);
|
17815 | };
|
17816 | |
17817 |
|
17818 |
|
17819 |
|
17820 |
|
17821 | |
17822 |
|
17823 |
|
17824 |
|
17825 |
|
17826 |
|
17827 |
|
17828 |
|
17829 |
|
17830 |
|
17831 |
|
17832 |
|
17833 |
|
17834 |
|
17835 |
|
17836 | AV.Object.saveAll = function (list, options) {
|
17837 | return AV.Object._deepSaveAsync(list, null, options);
|
17838 | };
|
17839 | |
17840 |
|
17841 |
|
17842 |
|
17843 |
|
17844 |
|
17845 |
|
17846 |
|
17847 |
|
17848 | AV.Object.fetchAll = function (objects, options) {
|
17849 | return _promise.default.resolve().then(function () {
|
17850 | return _request('batch', null, null, 'POST', {
|
17851 | requests: (0, _map.default)(_).call(_, objects, function (object) {
|
17852 | var _context;
|
17853 |
|
17854 | if (!object.className) throw new Error('object must have className to fetch');
|
17855 | if (!object.id) throw new Error('object must have id to fetch');
|
17856 | if (object.dirty()) throw new Error('object is modified but not saved');
|
17857 | return {
|
17858 | method: 'GET',
|
17859 | path: (0, _concat.default)(_context = "/1.1/classes/".concat(object.className, "/")).call(_context, object.id)
|
17860 | };
|
17861 | })
|
17862 | }, options);
|
17863 | }).then(function (response) {
|
17864 | var results = (0, _map.default)(_).call(_, objects, function (object, i) {
|
17865 | if (response[i].success) {
|
17866 | var fetchedAttrs = object.parse(response[i].success);
|
17867 |
|
17868 | object._cleanupUnsetKeys(fetchedAttrs);
|
17869 |
|
17870 | object._finishFetch(fetchedAttrs);
|
17871 |
|
17872 | return object;
|
17873 | }
|
17874 |
|
17875 | if (response[i].success === null) {
|
17876 | return new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
|
17877 | }
|
17878 |
|
17879 | return new AVError(response[i].error.code, response[i].error.error);
|
17880 | });
|
17881 | return handleBatchResults(results);
|
17882 | });
|
17883 | };
|
17884 |
|
17885 |
|
17886 | _.extend(AV.Object.prototype, AV.Events,
|
17887 |
|
17888 | {
|
17889 | _fetchWhenSave: false,
|
17890 |
|
17891 | |
17892 |
|
17893 |
|
17894 |
|
17895 | initialize: function initialize() {},
|
17896 |
|
17897 | |
17898 |
|
17899 |
|
17900 |
|
17901 |
|
17902 |
|
17903 |
|
17904 |
|
17905 | fetchWhenSave: function fetchWhenSave(enable) {
|
17906 | console.warn('AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead.');
|
17907 |
|
17908 | if (!_.isBoolean(enable)) {
|
17909 | throw new Error('Expect boolean value for fetchWhenSave');
|
17910 | }
|
17911 |
|
17912 | this._fetchWhenSave = enable;
|
17913 | },
|
17914 |
|
17915 | |
17916 |
|
17917 |
|
17918 |
|
17919 | getObjectId: function getObjectId() {
|
17920 | return this.id;
|
17921 | },
|
17922 |
|
17923 | |
17924 |
|
17925 |
|
17926 |
|
17927 | getCreatedAt: function getCreatedAt() {
|
17928 | return this.createdAt;
|
17929 | },
|
17930 |
|
17931 | |
17932 |
|
17933 |
|
17934 |
|
17935 | getUpdatedAt: function getUpdatedAt() {
|
17936 | return this.updatedAt;
|
17937 | },
|
17938 |
|
17939 | |
17940 |
|
17941 |
|
17942 |
|
17943 | toJSON: function toJSON(key, holder) {
|
17944 | var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
17945 | return this._toFullJSON(seenObjects, false);
|
17946 | },
|
17947 |
|
17948 | |
17949 |
|
17950 |
|
17951 |
|
17952 |
|
17953 |
|
17954 | toFullJSON: function toFullJSON() {
|
17955 | var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
17956 | return this._toFullJSON(seenObjects);
|
17957 | },
|
17958 | _toFullJSON: function _toFullJSON(seenObjects) {
|
17959 | var _this = this;
|
17960 |
|
17961 | var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
17962 |
|
17963 | var json = _.clone(this.attributes);
|
17964 |
|
17965 | if (_.isArray(seenObjects)) {
|
17966 | var newSeenObjects = (0, _concat.default)(seenObjects).call(seenObjects, this);
|
17967 | }
|
17968 |
|
17969 | AV._objectEach(json, function (val, key) {
|
17970 | json[key] = AV._encode(val, newSeenObjects, undefined, full);
|
17971 | });
|
17972 |
|
17973 | AV._objectEach(this._operations, function (val, key) {
|
17974 | json[key] = val;
|
17975 | });
|
17976 |
|
17977 | if (_.has(this, 'id')) {
|
17978 | json.objectId = this.id;
|
17979 | }
|
17980 |
|
17981 | ['createdAt', 'updatedAt'].forEach(function (key) {
|
17982 | if (_.has(_this, key)) {
|
17983 | var val = _this[key];
|
17984 | json[key] = _.isDate(val) ? val.toJSON() : val;
|
17985 | }
|
17986 | });
|
17987 |
|
17988 | if (full) {
|
17989 | json.__type = 'Object';
|
17990 | if (_.isArray(seenObjects) && seenObjects.length) json.__type = 'Pointer';
|
17991 | json.className = this.className;
|
17992 | }
|
17993 |
|
17994 | return json;
|
17995 | },
|
17996 |
|
17997 | |
17998 |
|
17999 |
|
18000 |
|
18001 |
|
18002 | _refreshCache: function _refreshCache() {
|
18003 | var self = this;
|
18004 |
|
18005 | if (self._refreshingCache) {
|
18006 | return;
|
18007 | }
|
18008 |
|
18009 | self._refreshingCache = true;
|
18010 |
|
18011 | AV._objectEach(this.attributes, function (value, key) {
|
18012 | if (value instanceof AV.Object) {
|
18013 | value._refreshCache();
|
18014 | } else if (_.isObject(value)) {
|
18015 | if (self._resetCacheForKey(key)) {
|
18016 | self.set(key, new AV.Op.Set(value), {
|
18017 | silent: true
|
18018 | });
|
18019 | }
|
18020 | }
|
18021 | });
|
18022 |
|
18023 | delete self._refreshingCache;
|
18024 | },
|
18025 |
|
18026 | |
18027 |
|
18028 |
|
18029 |
|
18030 |
|
18031 |
|
18032 |
|
18033 | dirty: function dirty(attr) {
|
18034 | this._refreshCache();
|
18035 |
|
18036 | var currentChanges = _.last(this._opSetQueue);
|
18037 |
|
18038 | if (attr) {
|
18039 | return currentChanges[attr] ? true : false;
|
18040 | }
|
18041 |
|
18042 | if (!this.id) {
|
18043 | return true;
|
18044 | }
|
18045 |
|
18046 | if ((0, _keys2.default)(_).call(_, currentChanges).length > 0) {
|
18047 | return true;
|
18048 | }
|
18049 |
|
18050 | return false;
|
18051 | },
|
18052 |
|
18053 | |
18054 |
|
18055 |
|
18056 |
|
18057 | dirtyKeys: function dirtyKeys() {
|
18058 | this._refreshCache();
|
18059 |
|
18060 | var currentChanges = _.last(this._opSetQueue);
|
18061 |
|
18062 | return (0, _keys2.default)(_).call(_, currentChanges);
|
18063 | },
|
18064 |
|
18065 | |
18066 |
|
18067 |
|
18068 |
|
18069 | _toPointer: function _toPointer() {
|
18070 |
|
18071 |
|
18072 |
|
18073 | return {
|
18074 | __type: 'Pointer',
|
18075 | className: this.className,
|
18076 | objectId: this.id
|
18077 | };
|
18078 | },
|
18079 |
|
18080 | |
18081 |
|
18082 |
|
18083 |
|
18084 | get: function get(attr) {
|
18085 | switch (attr) {
|
18086 | case 'objectId':
|
18087 | return this.id;
|
18088 |
|
18089 | case 'createdAt':
|
18090 | case 'updatedAt':
|
18091 | return this[attr];
|
18092 |
|
18093 | default:
|
18094 | return this.attributes[attr];
|
18095 | }
|
18096 | },
|
18097 |
|
18098 | |
18099 |
|
18100 |
|
18101 |
|
18102 |
|
18103 | relation: function relation(attr) {
|
18104 | var value = this.get(attr);
|
18105 |
|
18106 | if (value) {
|
18107 | if (!(value instanceof AV.Relation)) {
|
18108 | throw new Error('Called relation() on non-relation field ' + attr);
|
18109 | }
|
18110 |
|
18111 | value._ensureParentAndKey(this, attr);
|
18112 |
|
18113 | return value;
|
18114 | } else {
|
18115 | return new AV.Relation(this, attr);
|
18116 | }
|
18117 | },
|
18118 |
|
18119 | |
18120 |
|
18121 |
|
18122 | escape: function escape(attr) {
|
18123 | var html = this._escapedAttributes[attr];
|
18124 |
|
18125 | if (html) {
|
18126 | return html;
|
18127 | }
|
18128 |
|
18129 | var val = this.attributes[attr];
|
18130 | var escaped;
|
18131 |
|
18132 | if (isNullOrUndefined(val)) {
|
18133 | escaped = '';
|
18134 | } else {
|
18135 | escaped = _.escape(val.toString());
|
18136 | }
|
18137 |
|
18138 | this._escapedAttributes[attr] = escaped;
|
18139 | return escaped;
|
18140 | },
|
18141 |
|
18142 | |
18143 |
|
18144 |
|
18145 |
|
18146 |
|
18147 |
|
18148 | has: function has(attr) {
|
18149 | return !isNullOrUndefined(this.attributes[attr]);
|
18150 | },
|
18151 |
|
18152 | |
18153 |
|
18154 |
|
18155 |
|
18156 |
|
18157 |
|
18158 | _mergeMagicFields: function _mergeMagicFields(attrs) {
|
18159 |
|
18160 | var model = this;
|
18161 | var specialFields = ['objectId', 'createdAt', 'updatedAt'];
|
18162 |
|
18163 | AV._arrayEach(specialFields, function (attr) {
|
18164 | if (attrs[attr]) {
|
18165 | if (attr === 'objectId') {
|
18166 | model.id = attrs[attr];
|
18167 | } else if ((attr === 'createdAt' || attr === 'updatedAt') && !_.isDate(attrs[attr])) {
|
18168 | model[attr] = AV._parseDate(attrs[attr]);
|
18169 | } else {
|
18170 | model[attr] = attrs[attr];
|
18171 | }
|
18172 |
|
18173 | delete attrs[attr];
|
18174 | }
|
18175 | });
|
18176 |
|
18177 | return attrs;
|
18178 | },
|
18179 |
|
18180 | |
18181 |
|
18182 |
|
18183 |
|
18184 | _startSave: function _startSave() {
|
18185 | this._opSetQueue.push({});
|
18186 | },
|
18187 |
|
18188 | |
18189 |
|
18190 |
|
18191 |
|
18192 |
|
18193 |
|
18194 |
|
18195 |
|
18196 |
|
18197 |
|
18198 |
|
18199 |
|
18200 |
|
18201 | _cancelSave: function _cancelSave() {
|
18202 | var failedChanges = _.first(this._opSetQueue);
|
18203 |
|
18204 | this._opSetQueue = _.rest(this._opSetQueue);
|
18205 |
|
18206 | var nextChanges = _.first(this._opSetQueue);
|
18207 |
|
18208 | AV._objectEach(failedChanges, function (op, key) {
|
18209 | var op1 = failedChanges[key];
|
18210 | var op2 = nextChanges[key];
|
18211 |
|
18212 | if (op1 && op2) {
|
18213 | nextChanges[key] = op2._mergeWithPrevious(op1);
|
18214 | } else if (op1) {
|
18215 | nextChanges[key] = op1;
|
18216 | }
|
18217 | });
|
18218 |
|
18219 | this._saving = this._saving - 1;
|
18220 | },
|
18221 |
|
18222 | |
18223 |
|
18224 |
|
18225 |
|
18226 |
|
18227 |
|
18228 | _finishSave: function _finishSave(serverData) {
|
18229 | var _context2;
|
18230 |
|
18231 |
|
18232 |
|
18233 |
|
18234 |
|
18235 | var fetchedObjects = {};
|
18236 |
|
18237 | AV._traverse(this.attributes, function (object) {
|
18238 | if (object instanceof AV.Object && object.id && object._hasData) {
|
18239 | fetchedObjects[object.id] = object;
|
18240 | }
|
18241 | });
|
18242 |
|
18243 | var savedChanges = _.first(this._opSetQueue);
|
18244 |
|
18245 | this._opSetQueue = _.rest(this._opSetQueue);
|
18246 |
|
18247 | this._applyOpSet(savedChanges, this._serverData);
|
18248 |
|
18249 | this._mergeMagicFields(serverData);
|
18250 |
|
18251 | var self = this;
|
18252 |
|
18253 | AV._objectEach(serverData, function (value, key) {
|
18254 | self._serverData[key] = AV._decode(value, key);
|
18255 |
|
18256 |
|
18257 | var fetched = AV._traverse(self._serverData[key], function (object) {
|
18258 | if (object instanceof AV.Object && fetchedObjects[object.id]) {
|
18259 | return fetchedObjects[object.id];
|
18260 | }
|
18261 | });
|
18262 |
|
18263 | if (fetched) {
|
18264 | self._serverData[key] = fetched;
|
18265 | }
|
18266 | });
|
18267 |
|
18268 | this._rebuildAllEstimatedData();
|
18269 |
|
18270 | var opSetQueue = (0, _map.default)(_context2 = this._opSetQueue).call(_context2, _.clone);
|
18271 |
|
18272 | this._refreshCache();
|
18273 |
|
18274 | this._opSetQueue = opSetQueue;
|
18275 | this._saving = this._saving - 1;
|
18276 | },
|
18277 |
|
18278 | |
18279 |
|
18280 |
|
18281 |
|
18282 |
|
18283 | _finishFetch: function _finishFetch(serverData, hasData) {
|
18284 |
|
18285 | this._opSetQueue = [{}];
|
18286 |
|
18287 | this._mergeMagicFields(serverData);
|
18288 |
|
18289 | var self = this;
|
18290 |
|
18291 | AV._objectEach(serverData, function (value, key) {
|
18292 | self._serverData[key] = AV._decode(value, key);
|
18293 | });
|
18294 |
|
18295 |
|
18296 | this._rebuildAllEstimatedData();
|
18297 |
|
18298 |
|
18299 | this._refreshCache();
|
18300 |
|
18301 | this._opSetQueue = [{}];
|
18302 | this._hasData = hasData;
|
18303 | },
|
18304 |
|
18305 | |
18306 |
|
18307 |
|
18308 |
|
18309 | _applyOpSet: function _applyOpSet(opSet, target) {
|
18310 | var self = this;
|
18311 |
|
18312 | AV._objectEach(opSet, function (change, key) {
|
18313 | var _findValue = findValue(target, key),
|
18314 | _findValue2 = (0, _slicedToArray2.default)(_findValue, 3),
|
18315 | value = _findValue2[0],
|
18316 | actualTarget = _findValue2[1],
|
18317 | actualKey = _findValue2[2];
|
18318 |
|
18319 | setValue(target, key, change._estimate(value, self, key));
|
18320 |
|
18321 | if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
|
18322 | delete actualTarget[actualKey];
|
18323 | }
|
18324 | });
|
18325 | },
|
18326 |
|
18327 | |
18328 |
|
18329 |
|
18330 |
|
18331 |
|
18332 | _resetCacheForKey: function _resetCacheForKey(key) {
|
18333 | var value = this.attributes[key];
|
18334 |
|
18335 | if (_.isObject(value) && !(value instanceof AV.Object) && !(value instanceof AV.File)) {
|
18336 | var json = (0, _stringify.default)(recursiveToPointer(value));
|
18337 |
|
18338 | if (this._hashedJSON[key] !== json) {
|
18339 | var wasSet = !!this._hashedJSON[key];
|
18340 | this._hashedJSON[key] = json;
|
18341 | return wasSet;
|
18342 | }
|
18343 | }
|
18344 |
|
18345 | return false;
|
18346 | },
|
18347 |
|
18348 | |
18349 |
|
18350 |
|
18351 |
|
18352 |
|
18353 |
|
18354 | _rebuildEstimatedDataForKey: function _rebuildEstimatedDataForKey(key) {
|
18355 | var self = this;
|
18356 | delete this.attributes[key];
|
18357 |
|
18358 | if (this._serverData[key]) {
|
18359 | this.attributes[key] = this._serverData[key];
|
18360 | }
|
18361 |
|
18362 | AV._arrayEach(this._opSetQueue, function (opSet) {
|
18363 | var op = opSet[key];
|
18364 |
|
18365 | if (op) {
|
18366 | var _findValue3 = findValue(self.attributes, key),
|
18367 | _findValue4 = (0, _slicedToArray2.default)(_findValue3, 4),
|
18368 | value = _findValue4[0],
|
18369 | actualTarget = _findValue4[1],
|
18370 | actualKey = _findValue4[2],
|
18371 | firstKey = _findValue4[3];
|
18372 |
|
18373 | setValue(self.attributes, key, op._estimate(value, self, key));
|
18374 |
|
18375 | if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
|
18376 | delete actualTarget[actualKey];
|
18377 | }
|
18378 |
|
18379 | self._resetCacheForKey(firstKey);
|
18380 | }
|
18381 | });
|
18382 | },
|
18383 |
|
18384 | |
18385 |
|
18386 |
|
18387 |
|
18388 |
|
18389 |
|
18390 | _rebuildAllEstimatedData: function _rebuildAllEstimatedData() {
|
18391 | var self = this;
|
18392 |
|
18393 | var previousAttributes = _.clone(this.attributes);
|
18394 |
|
18395 | this.attributes = _.clone(this._serverData);
|
18396 |
|
18397 | AV._arrayEach(this._opSetQueue, function (opSet) {
|
18398 | self._applyOpSet(opSet, self.attributes);
|
18399 |
|
18400 | AV._objectEach(opSet, function (op, key) {
|
18401 | self._resetCacheForKey(key);
|
18402 | });
|
18403 | });
|
18404 |
|
18405 |
|
18406 | AV._objectEach(previousAttributes, function (oldValue, key) {
|
18407 | if (self.attributes[key] !== oldValue) {
|
18408 | self.trigger('change:' + key, self, self.attributes[key], {});
|
18409 | }
|
18410 | });
|
18411 |
|
18412 | AV._objectEach(this.attributes, function (newValue, key) {
|
18413 | if (!_.has(previousAttributes, key)) {
|
18414 | self.trigger('change:' + key, self, newValue, {});
|
18415 | }
|
18416 | });
|
18417 | },
|
18418 |
|
18419 | |
18420 |
|
18421 |
|
18422 |
|
18423 |
|
18424 |
|
18425 |
|
18426 |
|
18427 |
|
18428 |
|
18429 |
|
18430 |
|
18431 |
|
18432 |
|
18433 |
|
18434 |
|
18435 |
|
18436 |
|
18437 |
|
18438 |
|
18439 |
|
18440 |
|
18441 |
|
18442 |
|
18443 | set: function set(key, value, options) {
|
18444 | var attrs;
|
18445 |
|
18446 | if (_.isObject(key) || isNullOrUndefined(key)) {
|
18447 | attrs = _.mapObject(key, function (v, k) {
|
18448 | checkReservedKey(k);
|
18449 | return AV._decode(v, k);
|
18450 | });
|
18451 | options = value;
|
18452 | } else {
|
18453 | attrs = {};
|
18454 | checkReservedKey(key);
|
18455 | attrs[key] = AV._decode(value, key);
|
18456 | }
|
18457 |
|
18458 |
|
18459 | options = options || {};
|
18460 |
|
18461 | if (!attrs) {
|
18462 | return this;
|
18463 | }
|
18464 |
|
18465 | if (attrs instanceof AV.Object) {
|
18466 | attrs = attrs.attributes;
|
18467 | }
|
18468 |
|
18469 |
|
18470 | if (options.unset) {
|
18471 | AV._objectEach(attrs, function (unused_value, key) {
|
18472 | attrs[key] = new AV.Op.Unset();
|
18473 | });
|
18474 | }
|
18475 |
|
18476 |
|
18477 | var dataToValidate = _.clone(attrs);
|
18478 |
|
18479 | var self = this;
|
18480 |
|
18481 | AV._objectEach(dataToValidate, function (value, key) {
|
18482 | if (value instanceof AV.Op) {
|
18483 | dataToValidate[key] = value._estimate(self.attributes[key], self, key);
|
18484 |
|
18485 | if (dataToValidate[key] === AV.Op._UNSET) {
|
18486 | delete dataToValidate[key];
|
18487 | }
|
18488 | }
|
18489 | });
|
18490 |
|
18491 |
|
18492 | this._validate(attrs, options);
|
18493 |
|
18494 | options.changes = {};
|
18495 | var escaped = this._escapedAttributes;
|
18496 |
|
18497 | AV._arrayEach((0, _keys2.default)(_).call(_, attrs), function (attr) {
|
18498 | var val = attrs[attr];
|
18499 |
|
18500 |
|
18501 |
|
18502 | if (val instanceof AV.Relation) {
|
18503 | val.parent = self;
|
18504 | }
|
18505 |
|
18506 | if (!(val instanceof AV.Op)) {
|
18507 | val = new AV.Op.Set(val);
|
18508 | }
|
18509 |
|
18510 |
|
18511 | var isRealChange = true;
|
18512 |
|
18513 | if (val instanceof AV.Op.Set && _.isEqual(self.attributes[attr], val.value)) {
|
18514 | isRealChange = false;
|
18515 | }
|
18516 |
|
18517 | if (isRealChange) {
|
18518 | delete escaped[attr];
|
18519 |
|
18520 | if (options.silent) {
|
18521 | self._silent[attr] = true;
|
18522 | } else {
|
18523 | options.changes[attr] = true;
|
18524 | }
|
18525 | }
|
18526 |
|
18527 | var currentChanges = _.last(self._opSetQueue);
|
18528 |
|
18529 | currentChanges[attr] = val._mergeWithPrevious(currentChanges[attr]);
|
18530 |
|
18531 | self._rebuildEstimatedDataForKey(attr);
|
18532 |
|
18533 | if (isRealChange) {
|
18534 | self.changed[attr] = self.attributes[attr];
|
18535 |
|
18536 | if (!options.silent) {
|
18537 | self._pending[attr] = true;
|
18538 | }
|
18539 | } else {
|
18540 | delete self.changed[attr];
|
18541 | delete self._pending[attr];
|
18542 | }
|
18543 | });
|
18544 |
|
18545 | if (!options.silent) {
|
18546 | this.change(options);
|
18547 | }
|
18548 |
|
18549 | return this;
|
18550 | },
|
18551 |
|
18552 | |
18553 |
|
18554 |
|
18555 |
|
18556 |
|
18557 |
|
18558 | unset: function unset(attr, options) {
|
18559 | options = options || {};
|
18560 | options.unset = true;
|
18561 | return this.set(attr, null, options);
|
18562 | },
|
18563 |
|
18564 | |
18565 |
|
18566 |
|
18567 |
|
18568 |
|
18569 |
|
18570 |
|
18571 | increment: function increment(attr, amount) {
|
18572 | if (_.isUndefined(amount) || _.isNull(amount)) {
|
18573 | amount = 1;
|
18574 | }
|
18575 |
|
18576 | return this.set(attr, new AV.Op.Increment(amount));
|
18577 | },
|
18578 |
|
18579 | |
18580 |
|
18581 |
|
18582 |
|
18583 |
|
18584 |
|
18585 | add: function add(attr, item) {
|
18586 | return this.set(attr, new AV.Op.Add(ensureArray(item)));
|
18587 | },
|
18588 |
|
18589 | |
18590 |
|
18591 |
|
18592 |
|
18593 |
|
18594 |
|
18595 |
|
18596 |
|
18597 | addUnique: function addUnique(attr, item) {
|
18598 | return this.set(attr, new AV.Op.AddUnique(ensureArray(item)));
|
18599 | },
|
18600 |
|
18601 | |
18602 |
|
18603 |
|
18604 |
|
18605 |
|
18606 |
|
18607 |
|
18608 | remove: function remove(attr, item) {
|
18609 | return this.set(attr, new AV.Op.Remove(ensureArray(item)));
|
18610 | },
|
18611 |
|
18612 | |
18613 |
|
18614 |
|
18615 |
|
18616 |
|
18617 |
|
18618 |
|
18619 | bitAnd: function bitAnd(attr, value) {
|
18620 | return this.set(attr, new AV.Op.BitAnd(value));
|
18621 | },
|
18622 |
|
18623 | |
18624 |
|
18625 |
|
18626 |
|
18627 |
|
18628 |
|
18629 |
|
18630 | bitOr: function bitOr(attr, value) {
|
18631 | return this.set(attr, new AV.Op.BitOr(value));
|
18632 | },
|
18633 |
|
18634 | |
18635 |
|
18636 |
|
18637 |
|
18638 |
|
18639 |
|
18640 |
|
18641 | bitXor: function bitXor(attr, value) {
|
18642 | return this.set(attr, new AV.Op.BitXor(value));
|
18643 | },
|
18644 |
|
18645 | |
18646 |
|
18647 |
|
18648 |
|
18649 |
|
18650 |
|
18651 |
|
18652 |
|
18653 |
|
18654 | op: function op(attr) {
|
18655 | return _.last(this._opSetQueue)[attr];
|
18656 | },
|
18657 |
|
18658 | |
18659 |
|
18660 |
|
18661 |
|
18662 | clear: function clear(options) {
|
18663 | options = options || {};
|
18664 | options.unset = true;
|
18665 |
|
18666 | var keysToClear = _.extend(this.attributes, this._operations);
|
18667 |
|
18668 | return this.set(keysToClear, options);
|
18669 | },
|
18670 |
|
18671 | |
18672 |
|
18673 |
|
18674 |
|
18675 | revert: function revert(keys) {
|
18676 | var lastOp = _.last(this._opSetQueue);
|
18677 |
|
18678 | var _keys = ensureArray(keys || (0, _keys2.default)(_).call(_, lastOp));
|
18679 |
|
18680 | _keys.forEach(function (key) {
|
18681 | delete lastOp[key];
|
18682 | });
|
18683 |
|
18684 | this._rebuildAllEstimatedData();
|
18685 |
|
18686 | return this;
|
18687 | },
|
18688 |
|
18689 | |
18690 |
|
18691 |
|
18692 |
|
18693 |
|
18694 | _getSaveJSON: function _getSaveJSON() {
|
18695 | var json = _.clone(_.first(this._opSetQueue));
|
18696 |
|
18697 | AV._objectEach(json, function (op, key) {
|
18698 | json[key] = op.toJSON();
|
18699 | });
|
18700 |
|
18701 | return json;
|
18702 | },
|
18703 |
|
18704 | |
18705 |
|
18706 |
|
18707 |
|
18708 | _canBeSerialized: function _canBeSerialized() {
|
18709 | return AV.Object._canBeSerializedAsValue(this.attributes);
|
18710 | },
|
18711 |
|
18712 | |
18713 |
|
18714 |
|
18715 |
|
18716 |
|
18717 |
|
18718 |
|
18719 |
|
18720 |
|
18721 |
|
18722 | fetch: function fetch() {
|
18723 | var fetchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
18724 | var options = arguments.length > 1 ? arguments[1] : undefined;
|
18725 |
|
18726 | if (!this.id) {
|
18727 | throw new Error('Cannot fetch unsaved object');
|
18728 | }
|
18729 |
|
18730 | var self = this;
|
18731 |
|
18732 | var request = _request('classes', this.className, this.id, 'GET', transformFetchOptions(fetchOptions), options);
|
18733 |
|
18734 | return request.then(function (response) {
|
18735 | var fetchedAttrs = self.parse(response);
|
18736 |
|
18737 | self._cleanupUnsetKeys(fetchedAttrs, (0, _keys2.default)(fetchOptions) ? ensureArray((0, _keys2.default)(fetchOptions)).join(',').split(',') : undefined);
|
18738 |
|
18739 | self._finishFetch(fetchedAttrs, true);
|
18740 |
|
18741 | return self;
|
18742 | });
|
18743 | },
|
18744 | _cleanupUnsetKeys: function _cleanupUnsetKeys(fetchedAttrs) {
|
18745 | var _this2 = this;
|
18746 |
|
18747 | var fetchedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _keys2.default)(_).call(_, this._serverData);
|
18748 |
|
18749 | _.forEach(fetchedKeys, function (key) {
|
18750 | if (fetchedAttrs[key] === undefined) delete _this2._serverData[key];
|
18751 | });
|
18752 | },
|
18753 |
|
18754 | |
18755 |
|
18756 |
|
18757 |
|
18758 |
|
18759 |
|
18760 |
|
18761 |
|
18762 |
|
18763 |
|
18764 |
|
18765 |
|
18766 |
|
18767 |
|
18768 |
|
18769 |
|
18770 |
|
18771 |
|
18772 |
|
18773 |
|
18774 |
|
18775 |
|
18776 |
|
18777 |
|
18778 |
|
18779 |
|
18780 |
|
18781 |
|
18782 |
|
18783 | save: function save(arg1, arg2, arg3) {
|
18784 | var attrs, current, options;
|
18785 |
|
18786 | if (_.isObject(arg1) || isNullOrUndefined(arg1)) {
|
18787 | attrs = arg1;
|
18788 | options = arg2;
|
18789 | } else {
|
18790 | attrs = {};
|
18791 | attrs[arg1] = arg2;
|
18792 | options = arg3;
|
18793 | }
|
18794 |
|
18795 | options = _.clone(options) || {};
|
18796 |
|
18797 | if (options.wait) {
|
18798 | current = _.clone(this.attributes);
|
18799 | }
|
18800 |
|
18801 | var setOptions = _.clone(options) || {};
|
18802 |
|
18803 | if (setOptions.wait) {
|
18804 | setOptions.silent = true;
|
18805 | }
|
18806 |
|
18807 | if (attrs) {
|
18808 | this.set(attrs, setOptions);
|
18809 | }
|
18810 |
|
18811 | var model = this;
|
18812 | var unsavedChildren = [];
|
18813 | var unsavedFiles = [];
|
18814 |
|
18815 | AV.Object._findUnsavedChildren(model, unsavedChildren, unsavedFiles);
|
18816 |
|
18817 | if (unsavedChildren.length + unsavedFiles.length > 1) {
|
18818 | return AV.Object._deepSaveAsync(this, model, options);
|
18819 | }
|
18820 |
|
18821 | this._startSave();
|
18822 |
|
18823 | this._saving = (this._saving || 0) + 1;
|
18824 | this._allPreviousSaves = this._allPreviousSaves || _promise.default.resolve();
|
18825 | this._allPreviousSaves = this._allPreviousSaves.catch(function (e) {}).then(function () {
|
18826 | var method = model.id ? 'PUT' : 'POST';
|
18827 |
|
18828 | var json = model._getSaveJSON();
|
18829 |
|
18830 | var query = {};
|
18831 |
|
18832 | if (model._fetchWhenSave || options.fetchWhenSave) {
|
18833 | query['new'] = 'true';
|
18834 | }
|
18835 |
|
18836 |
|
18837 | if (options._failOnNotExist) {
|
18838 | query.failOnNotExist = 'true';
|
18839 | }
|
18840 |
|
18841 | if (options.query) {
|
18842 | var queryParams;
|
18843 |
|
18844 | if (typeof options.query._getParams === 'function') {
|
18845 | queryParams = options.query._getParams();
|
18846 |
|
18847 | if (queryParams) {
|
18848 | query.where = queryParams.where;
|
18849 | }
|
18850 | }
|
18851 |
|
18852 | if (!query.where) {
|
18853 | var error = new Error('options.query is not an AV.Query');
|
18854 | throw error;
|
18855 | }
|
18856 | }
|
18857 |
|
18858 | _.extend(json, model._flags);
|
18859 |
|
18860 | var route = 'classes';
|
18861 | var className = model.className;
|
18862 |
|
18863 | if (model.className === '_User' && !model.id) {
|
18864 |
|
18865 | route = 'users';
|
18866 | className = null;
|
18867 | }
|
18868 |
|
18869 |
|
18870 | var makeRequest = options._makeRequest || _request;
|
18871 | var requestPromise = makeRequest(route, className, model.id, method, json, options, query);
|
18872 | requestPromise = requestPromise.then(function (resp) {
|
18873 | var serverAttrs = model.parse(resp);
|
18874 |
|
18875 | if (options.wait) {
|
18876 | serverAttrs = _.extend(attrs || {}, serverAttrs);
|
18877 | }
|
18878 |
|
18879 | model._finishSave(serverAttrs);
|
18880 |
|
18881 | if (options.wait) {
|
18882 | model.set(current, setOptions);
|
18883 | }
|
18884 |
|
18885 | return model;
|
18886 | }, function (error) {
|
18887 | model._cancelSave();
|
18888 |
|
18889 | throw error;
|
18890 | });
|
18891 | return requestPromise;
|
18892 | });
|
18893 | return this._allPreviousSaves;
|
18894 | },
|
18895 |
|
18896 | |
18897 |
|
18898 |
|
18899 |
|
18900 |
|
18901 |
|
18902 |
|
18903 |
|
18904 |
|
18905 |
|
18906 | destroy: function destroy(options) {
|
18907 | options = options || {};
|
18908 | var model = this;
|
18909 |
|
18910 | var triggerDestroy = function triggerDestroy() {
|
18911 | model.trigger('destroy', model, model.collection, options);
|
18912 | };
|
18913 |
|
18914 | if (!this.id) {
|
18915 | return triggerDestroy();
|
18916 | }
|
18917 |
|
18918 | if (!options.wait) {
|
18919 | triggerDestroy();
|
18920 | }
|
18921 |
|
18922 | var request = _request('classes', this.className, this.id, 'DELETE', this._flags, options);
|
18923 |
|
18924 | return request.then(function () {
|
18925 | if (options.wait) {
|
18926 | triggerDestroy();
|
18927 | }
|
18928 |
|
18929 | return model;
|
18930 | });
|
18931 | },
|
18932 |
|
18933 | |
18934 |
|
18935 |
|
18936 |
|
18937 | parse: function parse(resp) {
|
18938 | var output = _.clone(resp);
|
18939 |
|
18940 | ['createdAt', 'updatedAt'].forEach(function (key) {
|
18941 | if (output[key]) {
|
18942 | output[key] = AV._parseDate(output[key]);
|
18943 | }
|
18944 | });
|
18945 |
|
18946 | if (output.createdAt && !output.updatedAt) {
|
18947 | output.updatedAt = output.createdAt;
|
18948 | }
|
18949 |
|
18950 | return output;
|
18951 | },
|
18952 |
|
18953 | |
18954 |
|
18955 |
|
18956 |
|
18957 | clone: function clone() {
|
18958 | return new this.constructor(this.attributes);
|
18959 | },
|
18960 |
|
18961 | |
18962 |
|
18963 |
|
18964 |
|
18965 | isNew: function isNew() {
|
18966 | return !this.id;
|
18967 | },
|
18968 |
|
18969 | |
18970 |
|
18971 |
|
18972 |
|
18973 |
|
18974 | change: function change(options) {
|
18975 | options = options || {};
|
18976 | var changing = this._changing;
|
18977 | this._changing = true;
|
18978 |
|
18979 | var self = this;
|
18980 |
|
18981 | AV._objectEach(this._silent, function (attr) {
|
18982 | self._pending[attr] = true;
|
18983 | });
|
18984 |
|
18985 |
|
18986 | var changes = _.extend({}, options.changes, this._silent);
|
18987 |
|
18988 | this._silent = {};
|
18989 |
|
18990 | AV._objectEach(changes, function (unused_value, attr) {
|
18991 | self.trigger('change:' + attr, self, self.get(attr), options);
|
18992 | });
|
18993 |
|
18994 | if (changing) {
|
18995 | return this;
|
18996 | }
|
18997 |
|
18998 |
|
18999 | var deleteChanged = function deleteChanged(value, attr) {
|
19000 | if (!self._pending[attr] && !self._silent[attr]) {
|
19001 | delete self.changed[attr];
|
19002 | }
|
19003 | };
|
19004 |
|
19005 |
|
19006 | while (!_.isEmpty(this._pending)) {
|
19007 | this._pending = {};
|
19008 | this.trigger('change', this, options);
|
19009 |
|
19010 | AV._objectEach(this.changed, deleteChanged);
|
19011 |
|
19012 | self._previousAttributes = _.clone(this.attributes);
|
19013 | }
|
19014 |
|
19015 | this._changing = false;
|
19016 | return this;
|
19017 | },
|
19018 |
|
19019 | |
19020 |
|
19021 |
|
19022 |
|
19023 |
|
19024 | previous: function previous(attr) {
|
19025 | if (!arguments.length || !this._previousAttributes) {
|
19026 | return null;
|
19027 | }
|
19028 |
|
19029 | return this._previousAttributes[attr];
|
19030 | },
|
19031 |
|
19032 | |
19033 |
|
19034 |
|
19035 |
|
19036 |
|
19037 | previousAttributes: function previousAttributes() {
|
19038 | return _.clone(this._previousAttributes);
|
19039 | },
|
19040 |
|
19041 | |
19042 |
|
19043 |
|
19044 |
|
19045 |
|
19046 | isValid: function isValid() {
|
19047 | try {
|
19048 | this.validate(this.attributes);
|
19049 | } catch (error) {
|
19050 | return false;
|
19051 | }
|
19052 |
|
19053 | return true;
|
19054 | },
|
19055 |
|
19056 | |
19057 |
|
19058 |
|
19059 |
|
19060 |
|
19061 |
|
19062 |
|
19063 |
|
19064 |
|
19065 |
|
19066 | validate: function validate(attrs) {
|
19067 | if (_.has(attrs, 'ACL') && !(attrs.ACL instanceof AV.ACL)) {
|
19068 | throw new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
|
19069 | }
|
19070 | },
|
19071 |
|
19072 | |
19073 |
|
19074 |
|
19075 |
|
19076 |
|
19077 |
|
19078 | _validate: function _validate(attrs, options) {
|
19079 | if (options.silent || !this.validate) {
|
19080 | return;
|
19081 | }
|
19082 |
|
19083 | attrs = _.extend({}, this.attributes, attrs);
|
19084 | this.validate(attrs);
|
19085 | },
|
19086 |
|
19087 | |
19088 |
|
19089 |
|
19090 |
|
19091 |
|
19092 | getACL: function getACL() {
|
19093 | return this.get('ACL');
|
19094 | },
|
19095 |
|
19096 | |
19097 |
|
19098 |
|
19099 |
|
19100 |
|
19101 |
|
19102 |
|
19103 |
|
19104 | setACL: function setACL(acl, options) {
|
19105 | return this.set('ACL', acl, options);
|
19106 | },
|
19107 | disableBeforeHook: function disableBeforeHook() {
|
19108 | this.ignoreHook('beforeSave');
|
19109 | this.ignoreHook('beforeUpdate');
|
19110 | this.ignoreHook('beforeDelete');
|
19111 | },
|
19112 | disableAfterHook: function disableAfterHook() {
|
19113 | this.ignoreHook('afterSave');
|
19114 | this.ignoreHook('afterUpdate');
|
19115 | this.ignoreHook('afterDelete');
|
19116 | },
|
19117 | ignoreHook: function ignoreHook(hookName) {
|
19118 | if (!_.contains(['beforeSave', 'afterSave', 'beforeUpdate', 'afterUpdate', 'beforeDelete', 'afterDelete'], hookName)) {
|
19119 | throw new Error('Unsupported hookName: ' + hookName);
|
19120 | }
|
19121 |
|
19122 | if (!AV.hookKey) {
|
19123 | throw new Error('ignoreHook required hookKey');
|
19124 | }
|
19125 |
|
19126 | if (!this._flags.__ignore_hooks) {
|
19127 | this._flags.__ignore_hooks = [];
|
19128 | }
|
19129 |
|
19130 | this._flags.__ignore_hooks.push(hookName);
|
19131 | }
|
19132 | });
|
19133 | |
19134 |
|
19135 |
|
19136 |
|
19137 |
|
19138 |
|
19139 |
|
19140 |
|
19141 |
|
19142 | AV.Object.createWithoutData = function (klass, id, hasData) {
|
19143 | var _klass;
|
19144 |
|
19145 | if (_.isString(klass)) {
|
19146 | _klass = AV.Object._getSubclass(klass);
|
19147 | } else if (klass.prototype && klass.prototype instanceof AV.Object) {
|
19148 | _klass = klass;
|
19149 | } else {
|
19150 | throw new Error('class must be a string or a subclass of AV.Object.');
|
19151 | }
|
19152 |
|
19153 | if (!id) {
|
19154 | throw new TypeError('The objectId must be provided');
|
19155 | }
|
19156 |
|
19157 | var object = new _klass();
|
19158 | object.id = id;
|
19159 | object._hasData = hasData;
|
19160 | return object;
|
19161 | };
|
19162 | |
19163 |
|
19164 |
|
19165 |
|
19166 |
|
19167 |
|
19168 |
|
19169 |
|
19170 |
|
19171 | AV.Object.destroyAll = function (objects) {
|
19172 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
19173 |
|
19174 | if (!objects || objects.length === 0) {
|
19175 | return _promise.default.resolve();
|
19176 | }
|
19177 |
|
19178 | var objectsByClassNameAndFlags = _.groupBy(objects, function (object) {
|
19179 | return (0, _stringify.default)({
|
19180 | className: object.className,
|
19181 | flags: object._flags
|
19182 | });
|
19183 | });
|
19184 |
|
19185 | var body = {
|
19186 | requests: (0, _map.default)(_).call(_, objectsByClassNameAndFlags, function (objects) {
|
19187 | var _context3;
|
19188 |
|
19189 | var ids = (0, _map.default)(_).call(_, objects, 'id').join(',');
|
19190 | return {
|
19191 | method: 'DELETE',
|
19192 | path: (0, _concat.default)(_context3 = "/1.1/classes/".concat(objects[0].className, "/")).call(_context3, ids),
|
19193 | body: objects[0]._flags
|
19194 | };
|
19195 | })
|
19196 | };
|
19197 | return _request('batch', null, null, 'POST', body, options).then(function (response) {
|
19198 | var firstError = (0, _find.default)(_).call(_, response, function (result) {
|
19199 | return !result.success;
|
19200 | });
|
19201 | if (firstError) throw new AVError(firstError.error.code, firstError.error.error);
|
19202 | return undefined;
|
19203 | });
|
19204 | };
|
19205 | |
19206 |
|
19207 |
|
19208 |
|
19209 |
|
19210 |
|
19211 |
|
19212 | AV.Object._getSubclass = function (className) {
|
19213 | if (!_.isString(className)) {
|
19214 | throw new Error('AV.Object._getSubclass requires a string argument.');
|
19215 | }
|
19216 |
|
19217 | var ObjectClass = AV.Object._classMap[className];
|
19218 |
|
19219 | if (!ObjectClass) {
|
19220 | ObjectClass = AV.Object.extend(className);
|
19221 | AV.Object._classMap[className] = ObjectClass;
|
19222 | }
|
19223 |
|
19224 | return ObjectClass;
|
19225 | };
|
19226 | |
19227 |
|
19228 |
|
19229 |
|
19230 |
|
19231 |
|
19232 | AV.Object._create = function (className, attributes, options) {
|
19233 | var ObjectClass = AV.Object._getSubclass(className);
|
19234 |
|
19235 | return new ObjectClass(attributes, options);
|
19236 | };
|
19237 |
|
19238 |
|
19239 |
|
19240 | AV.Object._classMap = {};
|
19241 | AV.Object._extend = AV._extend;
|
19242 | |
19243 |
|
19244 |
|
19245 |
|
19246 |
|
19247 |
|
19248 |
|
19249 |
|
19250 |
|
19251 |
|
19252 |
|
19253 |
|
19254 |
|
19255 |
|
19256 |
|
19257 | AV.Object['new'] = function (attributes, options) {
|
19258 | return new AV.Object(attributes, options);
|
19259 | };
|
19260 | |
19261 |
|
19262 |
|
19263 |
|
19264 |
|
19265 |
|
19266 |
|
19267 |
|
19268 |
|
19269 |
|
19270 |
|
19271 |
|
19272 |
|
19273 |
|
19274 |
|
19275 |
|
19276 |
|
19277 |
|
19278 |
|
19279 |
|
19280 |
|
19281 |
|
19282 |
|
19283 |
|
19284 | AV.Object.extend = function (className, protoProps, classProps) {
|
19285 |
|
19286 | if (!_.isString(className)) {
|
19287 | if (className && _.has(className, 'className')) {
|
19288 | return AV.Object.extend(className.className, className, protoProps);
|
19289 | } else {
|
19290 | throw new Error("AV.Object.extend's first argument should be the className.");
|
19291 | }
|
19292 | }
|
19293 |
|
19294 |
|
19295 | if (className === 'User') {
|
19296 | className = '_User';
|
19297 | }
|
19298 |
|
19299 | var NewClassObject = null;
|
19300 |
|
19301 | if (_.has(AV.Object._classMap, className)) {
|
19302 | var OldClassObject = AV.Object._classMap[className];
|
19303 |
|
19304 |
|
19305 |
|
19306 | if (protoProps || classProps) {
|
19307 | NewClassObject = OldClassObject._extend(protoProps, classProps);
|
19308 | } else {
|
19309 | return OldClassObject;
|
19310 | }
|
19311 | } else {
|
19312 | protoProps = protoProps || {};
|
19313 | protoProps._className = className;
|
19314 | NewClassObject = this._extend(protoProps, classProps);
|
19315 | }
|
19316 |
|
19317 |
|
19318 | NewClassObject.extend = function (arg0) {
|
19319 | var _context4;
|
19320 |
|
19321 | if (_.isString(arg0) || arg0 && _.has(arg0, 'className')) {
|
19322 | return AV.Object.extend.apply(NewClassObject, arguments);
|
19323 | }
|
19324 |
|
19325 | var newArguments = (0, _concat.default)(_context4 = [className]).call(_context4, _.toArray(arguments));
|
19326 | return AV.Object.extend.apply(NewClassObject, newArguments);
|
19327 | };
|
19328 |
|
19329 |
|
19330 | (0, _defineProperty.default)(NewClassObject, 'query', (0, _getOwnPropertyDescriptor.default)(AV.Object, 'query'));
|
19331 |
|
19332 | NewClassObject['new'] = function (attributes, options) {
|
19333 | return new NewClassObject(attributes, options);
|
19334 | };
|
19335 |
|
19336 | AV.Object._classMap[className] = NewClassObject;
|
19337 | return NewClassObject;
|
19338 | };
|
19339 |
|
19340 |
|
19341 | (0, _defineProperty.default)(AV.Object.prototype, 'className', {
|
19342 | get: function get() {
|
19343 | var className = this._className || this.constructor._LCClassName || this.constructor.name;
|
19344 |
|
19345 | if (className === 'User') {
|
19346 | return '_User';
|
19347 | }
|
19348 |
|
19349 | return className;
|
19350 | }
|
19351 | });
|
19352 | |
19353 |
|
19354 |
|
19355 |
|
19356 |
|
19357 |
|
19358 |
|
19359 |
|
19360 |
|
19361 |
|
19362 |
|
19363 | AV.Object.register = function (klass, name) {
|
19364 | if (!(klass.prototype instanceof AV.Object)) {
|
19365 | throw new Error('registered class is not a subclass of AV.Object');
|
19366 | }
|
19367 |
|
19368 | var className = name || klass.name;
|
19369 |
|
19370 | if (!className.length) {
|
19371 | throw new Error('registered class must be named');
|
19372 | }
|
19373 |
|
19374 | if (name) {
|
19375 | klass._LCClassName = name;
|
19376 | }
|
19377 |
|
19378 | AV.Object._classMap[className] = klass;
|
19379 | };
|
19380 | |
19381 |
|
19382 |
|
19383 |
|
19384 |
|
19385 |
|
19386 |
|
19387 |
|
19388 |
|
19389 |
|
19390 |
|
19391 |
|
19392 |
|
19393 | (0, _defineProperty.default)(AV.Object, 'query', {
|
19394 | get: function get() {
|
19395 | return new AV.Query(this.prototype.className);
|
19396 | }
|
19397 | });
|
19398 |
|
19399 | AV.Object._findUnsavedChildren = function (objects, children, files) {
|
19400 | AV._traverse(objects, function (object) {
|
19401 | if (object instanceof AV.Object) {
|
19402 | if (object.dirty()) {
|
19403 | children.push(object);
|
19404 | }
|
19405 |
|
19406 | return;
|
19407 | }
|
19408 |
|
19409 | if (object instanceof AV.File) {
|
19410 | if (!object.id) {
|
19411 | files.push(object);
|
19412 | }
|
19413 |
|
19414 | return;
|
19415 | }
|
19416 | });
|
19417 | };
|
19418 |
|
19419 | AV.Object._canBeSerializedAsValue = function (object) {
|
19420 | var canBeSerializedAsValue = true;
|
19421 |
|
19422 | if (object instanceof AV.Object || object instanceof AV.File) {
|
19423 | canBeSerializedAsValue = !!object.id;
|
19424 | } else if (_.isArray(object)) {
|
19425 | AV._arrayEach(object, function (child) {
|
19426 | if (!AV.Object._canBeSerializedAsValue(child)) {
|
19427 | canBeSerializedAsValue = false;
|
19428 | }
|
19429 | });
|
19430 | } else if (_.isObject(object)) {
|
19431 | AV._objectEach(object, function (child) {
|
19432 | if (!AV.Object._canBeSerializedAsValue(child)) {
|
19433 | canBeSerializedAsValue = false;
|
19434 | }
|
19435 | });
|
19436 | }
|
19437 |
|
19438 | return canBeSerializedAsValue;
|
19439 | };
|
19440 |
|
19441 | AV.Object._deepSaveAsync = function (object, model, options) {
|
19442 | var unsavedChildren = [];
|
19443 | var unsavedFiles = [];
|
19444 |
|
19445 | AV.Object._findUnsavedChildren(object, unsavedChildren, unsavedFiles);
|
19446 |
|
19447 | unsavedFiles = _.uniq(unsavedFiles);
|
19448 |
|
19449 | var promise = _promise.default.resolve();
|
19450 |
|
19451 | _.each(unsavedFiles, function (file) {
|
19452 | promise = promise.then(function () {
|
19453 | return file.save();
|
19454 | });
|
19455 | });
|
19456 |
|
19457 | var objects = _.uniq(unsavedChildren);
|
19458 |
|
19459 | var remaining = _.uniq(objects);
|
19460 |
|
19461 | return promise.then(function () {
|
19462 | return continueWhile(function () {
|
19463 | return remaining.length > 0;
|
19464 | }, function () {
|
19465 |
|
19466 | var batch = [];
|
19467 | var newRemaining = [];
|
19468 |
|
19469 | AV._arrayEach(remaining, function (object) {
|
19470 | if (object._canBeSerialized()) {
|
19471 | batch.push(object);
|
19472 | } else {
|
19473 | newRemaining.push(object);
|
19474 | }
|
19475 | });
|
19476 |
|
19477 | remaining = newRemaining;
|
19478 |
|
19479 | if (batch.length === 0) {
|
19480 | return _promise.default.reject(new AVError(AVError.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
|
19481 | }
|
19482 |
|
19483 |
|
19484 | var readyToStart = _promise.default.resolve((0, _map.default)(_).call(_, batch, function (object) {
|
19485 | return object._allPreviousSaves || _promise.default.resolve();
|
19486 | }));
|
19487 |
|
19488 |
|
19489 | var bathSavePromise = readyToStart.then(function () {
|
19490 | return _request('batch', null, null, 'POST', {
|
19491 | requests: (0, _map.default)(_).call(_, batch, function (object) {
|
19492 | var method = object.id ? 'PUT' : 'POST';
|
19493 |
|
19494 | var json = object._getSaveJSON();
|
19495 |
|
19496 | _.extend(json, object._flags);
|
19497 |
|
19498 | var route = 'classes';
|
19499 | var className = object.className;
|
19500 | var path = "/".concat(route, "/").concat(className);
|
19501 |
|
19502 | if (object.className === '_User' && !object.id) {
|
19503 |
|
19504 | path = '/users';
|
19505 | }
|
19506 |
|
19507 | var path = "/1.1".concat(path);
|
19508 |
|
19509 | if (object.id) {
|
19510 | path = path + '/' + object.id;
|
19511 | }
|
19512 |
|
19513 | object._startSave();
|
19514 |
|
19515 | return {
|
19516 | method: method,
|
19517 | path: path,
|
19518 | body: json,
|
19519 | params: options && options.fetchWhenSave ? {
|
19520 | fetchWhenSave: true
|
19521 | } : undefined
|
19522 | };
|
19523 | })
|
19524 | }, options).then(function (response) {
|
19525 | var results = (0, _map.default)(_).call(_, batch, function (object, i) {
|
19526 | if (response[i].success) {
|
19527 | object._finishSave(object.parse(response[i].success));
|
19528 |
|
19529 | return object;
|
19530 | }
|
19531 |
|
19532 | object._cancelSave();
|
19533 |
|
19534 | return new AVError(response[i].error.code, response[i].error.error);
|
19535 | });
|
19536 | return handleBatchResults(results);
|
19537 | });
|
19538 | });
|
19539 |
|
19540 | AV._arrayEach(batch, function (object) {
|
19541 | object._allPreviousSaves = bathSavePromise;
|
19542 | });
|
19543 |
|
19544 | return bathSavePromise;
|
19545 | });
|
19546 | }).then(function () {
|
19547 | return object;
|
19548 | });
|
19549 | };
|
19550 | };
|
19551 |
|
19552 | }),
|
19553 |
|
19554 | (function(module, exports, __webpack_require__) {
|
19555 |
|
19556 | var arrayWithHoles = __webpack_require__(535);
|
19557 |
|
19558 | var iterableToArrayLimit = __webpack_require__(543);
|
19559 |
|
19560 | var unsupportedIterableToArray = __webpack_require__(544);
|
19561 |
|
19562 | var nonIterableRest = __webpack_require__(554);
|
19563 |
|
19564 | function _slicedToArray(arr, i) {
|
19565 | return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
|
19566 | }
|
19567 |
|
19568 | module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19569 |
|
19570 | }),
|
19571 |
|
19572 | (function(module, exports, __webpack_require__) {
|
19573 |
|
19574 | var _Array$isArray = __webpack_require__(536);
|
19575 |
|
19576 | function _arrayWithHoles(arr) {
|
19577 | if (_Array$isArray(arr)) return arr;
|
19578 | }
|
19579 |
|
19580 | module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19581 |
|
19582 | }),
|
19583 |
|
19584 | (function(module, exports, __webpack_require__) {
|
19585 |
|
19586 | module.exports = __webpack_require__(537);
|
19587 |
|
19588 | }),
|
19589 |
|
19590 | (function(module, exports, __webpack_require__) {
|
19591 |
|
19592 | module.exports = __webpack_require__(538);
|
19593 |
|
19594 |
|
19595 | }),
|
19596 |
|
19597 | (function(module, exports, __webpack_require__) {
|
19598 |
|
19599 | var parent = __webpack_require__(539);
|
19600 |
|
19601 | module.exports = parent;
|
19602 |
|
19603 |
|
19604 | }),
|
19605 |
|
19606 | (function(module, exports, __webpack_require__) {
|
19607 |
|
19608 | var parent = __webpack_require__(540);
|
19609 |
|
19610 | module.exports = parent;
|
19611 |
|
19612 |
|
19613 | }),
|
19614 |
|
19615 | (function(module, exports, __webpack_require__) {
|
19616 |
|
19617 | var parent = __webpack_require__(541);
|
19618 |
|
19619 | module.exports = parent;
|
19620 |
|
19621 |
|
19622 | }),
|
19623 |
|
19624 | (function(module, exports, __webpack_require__) {
|
19625 |
|
19626 | __webpack_require__(542);
|
19627 | var path = __webpack_require__(7);
|
19628 |
|
19629 | module.exports = path.Array.isArray;
|
19630 |
|
19631 |
|
19632 | }),
|
19633 |
|
19634 | (function(module, exports, __webpack_require__) {
|
19635 |
|
19636 | var $ = __webpack_require__(0);
|
19637 | var isArray = __webpack_require__(92);
|
19638 |
|
19639 |
|
19640 |
|
19641 | $({ target: 'Array', stat: true }, {
|
19642 | isArray: isArray
|
19643 | });
|
19644 |
|
19645 |
|
19646 | }),
|
19647 |
|
19648 | (function(module, exports, __webpack_require__) {
|
19649 |
|
19650 | var _Symbol = __webpack_require__(240);
|
19651 |
|
19652 | var _getIteratorMethod = __webpack_require__(252);
|
19653 |
|
19654 | function _iterableToArrayLimit(arr, i) {
|
19655 | var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"];
|
19656 |
|
19657 | if (_i == null) return;
|
19658 | var _arr = [];
|
19659 | var _n = true;
|
19660 | var _d = false;
|
19661 |
|
19662 | var _s, _e;
|
19663 |
|
19664 | try {
|
19665 | for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
19666 | _arr.push(_s.value);
|
19667 |
|
19668 | if (i && _arr.length === i) break;
|
19669 | }
|
19670 | } catch (err) {
|
19671 | _d = true;
|
19672 | _e = err;
|
19673 | } finally {
|
19674 | try {
|
19675 | if (!_n && _i["return"] != null) _i["return"]();
|
19676 | } finally {
|
19677 | if (_d) throw _e;
|
19678 | }
|
19679 | }
|
19680 |
|
19681 | return _arr;
|
19682 | }
|
19683 |
|
19684 | module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19685 |
|
19686 | }),
|
19687 |
|
19688 | (function(module, exports, __webpack_require__) {
|
19689 |
|
19690 | var _sliceInstanceProperty = __webpack_require__(545);
|
19691 |
|
19692 | var _Array$from = __webpack_require__(549);
|
19693 |
|
19694 | var arrayLikeToArray = __webpack_require__(553);
|
19695 |
|
19696 | function _unsupportedIterableToArray(o, minLen) {
|
19697 | var _context;
|
19698 |
|
19699 | if (!o) return;
|
19700 | if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
19701 |
|
19702 | var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
|
19703 |
|
19704 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
19705 | if (n === "Map" || n === "Set") return _Array$from(o);
|
19706 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
19707 | }
|
19708 |
|
19709 | module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19710 |
|
19711 | }),
|
19712 |
|
19713 | (function(module, exports, __webpack_require__) {
|
19714 |
|
19715 | module.exports = __webpack_require__(546);
|
19716 |
|
19717 | }),
|
19718 |
|
19719 | (function(module, exports, __webpack_require__) {
|
19720 |
|
19721 | module.exports = __webpack_require__(547);
|
19722 |
|
19723 |
|
19724 | }),
|
19725 |
|
19726 | (function(module, exports, __webpack_require__) {
|
19727 |
|
19728 | var parent = __webpack_require__(548);
|
19729 |
|
19730 | module.exports = parent;
|
19731 |
|
19732 |
|
19733 | }),
|
19734 |
|
19735 | (function(module, exports, __webpack_require__) {
|
19736 |
|
19737 | var parent = __webpack_require__(238);
|
19738 |
|
19739 | module.exports = parent;
|
19740 |
|
19741 |
|
19742 | }),
|
19743 |
|
19744 | (function(module, exports, __webpack_require__) {
|
19745 |
|
19746 | module.exports = __webpack_require__(550);
|
19747 |
|
19748 | }),
|
19749 |
|
19750 | (function(module, exports, __webpack_require__) {
|
19751 |
|
19752 | module.exports = __webpack_require__(551);
|
19753 |
|
19754 |
|
19755 | }),
|
19756 |
|
19757 | (function(module, exports, __webpack_require__) {
|
19758 |
|
19759 | var parent = __webpack_require__(552);
|
19760 |
|
19761 | module.exports = parent;
|
19762 |
|
19763 |
|
19764 | }),
|
19765 |
|
19766 | (function(module, exports, __webpack_require__) {
|
19767 |
|
19768 | var parent = __webpack_require__(251);
|
19769 |
|
19770 | module.exports = parent;
|
19771 |
|
19772 |
|
19773 | }),
|
19774 |
|
19775 | (function(module, exports) {
|
19776 |
|
19777 | function _arrayLikeToArray(arr, len) {
|
19778 | if (len == null || len > arr.length) len = arr.length;
|
19779 |
|
19780 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
19781 | arr2[i] = arr[i];
|
19782 | }
|
19783 |
|
19784 | return arr2;
|
19785 | }
|
19786 |
|
19787 | module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19788 |
|
19789 | }),
|
19790 |
|
19791 | (function(module, exports) {
|
19792 |
|
19793 | function _nonIterableRest() {
|
19794 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
19795 | }
|
19796 |
|
19797 | module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19798 |
|
19799 | }),
|
19800 |
|
19801 | (function(module, exports, __webpack_require__) {
|
19802 |
|
19803 | var parent = __webpack_require__(556);
|
19804 |
|
19805 | module.exports = parent;
|
19806 |
|
19807 |
|
19808 | }),
|
19809 |
|
19810 | (function(module, exports, __webpack_require__) {
|
19811 |
|
19812 | __webpack_require__(557);
|
19813 | var path = __webpack_require__(7);
|
19814 |
|
19815 | var Object = path.Object;
|
19816 |
|
19817 | var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
|
19818 | return Object.getOwnPropertyDescriptor(it, key);
|
19819 | };
|
19820 |
|
19821 | if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
|
19822 |
|
19823 |
|
19824 | }),
|
19825 |
|
19826 | (function(module, exports, __webpack_require__) {
|
19827 |
|
19828 | var $ = __webpack_require__(0);
|
19829 | var fails = __webpack_require__(2);
|
19830 | var toIndexedObject = __webpack_require__(35);
|
19831 | var nativeGetOwnPropertyDescriptor = __webpack_require__(64).f;
|
19832 | var DESCRIPTORS = __webpack_require__(14);
|
19833 |
|
19834 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
|
19835 | var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
|
19836 |
|
19837 |
|
19838 |
|
19839 | $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
|
19840 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
19841 | return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
|
19842 | }
|
19843 | });
|
19844 |
|
19845 |
|
19846 | }),
|
19847 |
|
19848 | (function(module, exports, __webpack_require__) {
|
19849 |
|
19850 | "use strict";
|
19851 |
|
19852 |
|
19853 | var _ = __webpack_require__(3);
|
19854 |
|
19855 | var AVError = __webpack_require__(48);
|
19856 |
|
19857 | module.exports = function (AV) {
|
19858 | AV.Role = AV.Object.extend('_Role',
|
19859 |
|
19860 | {
|
19861 |
|
19862 |
|
19863 | |
19864 |
|
19865 |
|
19866 |
|
19867 |
|
19868 |
|
19869 |
|
19870 |
|
19871 |
|
19872 |
|
19873 |
|
19874 |
|
19875 |
|
19876 |
|
19877 |
|
19878 | constructor: function constructor(name, acl) {
|
19879 | if (_.isString(name)) {
|
19880 | AV.Object.prototype.constructor.call(this, null, null);
|
19881 | this.setName(name);
|
19882 | } else {
|
19883 | AV.Object.prototype.constructor.call(this, name, acl);
|
19884 | }
|
19885 |
|
19886 | if (acl) {
|
19887 | if (!(acl instanceof AV.ACL)) {
|
19888 | throw new TypeError('acl must be an instance of AV.ACL');
|
19889 | } else {
|
19890 | this.setACL(acl);
|
19891 | }
|
19892 | }
|
19893 | },
|
19894 |
|
19895 | |
19896 |
|
19897 |
|
19898 |
|
19899 |
|
19900 | getName: function getName() {
|
19901 | return this.get('name');
|
19902 | },
|
19903 |
|
19904 | |
19905 |
|
19906 |
|
19907 |
|
19908 |
|
19909 |
|
19910 |
|
19911 |
|
19912 |
|
19913 |
|
19914 |
|
19915 |
|
19916 |
|
19917 |
|
19918 | setName: function setName(name, options) {
|
19919 | return this.set('name', name, options);
|
19920 | },
|
19921 |
|
19922 | |
19923 |
|
19924 |
|
19925 |
|
19926 |
|
19927 |
|
19928 |
|
19929 |
|
19930 |
|
19931 |
|
19932 |
|
19933 | getUsers: function getUsers() {
|
19934 | return this.relation('users');
|
19935 | },
|
19936 |
|
19937 | |
19938 |
|
19939 |
|
19940 |
|
19941 |
|
19942 |
|
19943 |
|
19944 |
|
19945 |
|
19946 |
|
19947 |
|
19948 | getRoles: function getRoles() {
|
19949 | return this.relation('roles');
|
19950 | },
|
19951 |
|
19952 | |
19953 |
|
19954 |
|
19955 | validate: function validate(attrs, options) {
|
19956 | if ('name' in attrs && attrs.name !== this.getName()) {
|
19957 | var newName = attrs.name;
|
19958 |
|
19959 | if (this.id && this.id !== attrs.objectId) {
|
19960 |
|
19961 |
|
19962 |
|
19963 | return new AVError(AVError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
|
19964 | }
|
19965 |
|
19966 | if (!_.isString(newName)) {
|
19967 | return new AVError(AVError.OTHER_CAUSE, "A role's name must be a String.");
|
19968 | }
|
19969 |
|
19970 | if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
|
19971 | return new AVError(AVError.OTHER_CAUSE, "A role's name can only contain alphanumeric characters, _," + ' -, and spaces.');
|
19972 | }
|
19973 | }
|
19974 |
|
19975 | if (AV.Object.prototype.validate) {
|
19976 | return AV.Object.prototype.validate.call(this, attrs, options);
|
19977 | }
|
19978 |
|
19979 | return false;
|
19980 | }
|
19981 | });
|
19982 | };
|
19983 |
|
19984 | }),
|
19985 |
|
19986 | (function(module, exports, __webpack_require__) {
|
19987 |
|
19988 | "use strict";
|
19989 |
|
19990 |
|
19991 | var _interopRequireDefault = __webpack_require__(1);
|
19992 |
|
19993 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(560));
|
19994 |
|
19995 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
19996 |
|
19997 | var _map = _interopRequireDefault(__webpack_require__(37));
|
19998 |
|
19999 | var _find = _interopRequireDefault(__webpack_require__(96));
|
20000 |
|
20001 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
20002 |
|
20003 | var _ = __webpack_require__(3);
|
20004 |
|
20005 | var uuid = __webpack_require__(230);
|
20006 |
|
20007 | var AVError = __webpack_require__(48);
|
20008 |
|
20009 | var _require = __webpack_require__(28),
|
20010 | AVRequest = _require._request,
|
20011 | request = _require.request;
|
20012 |
|
20013 | var _require2 = __webpack_require__(76),
|
20014 | getAdapter = _require2.getAdapter;
|
20015 |
|
20016 | var PLATFORM_ANONYMOUS = 'anonymous';
|
20017 | var PLATFORM_QQAPP = 'lc_qqapp';
|
20018 |
|
20019 | var mergeUnionDataIntoAuthData = function mergeUnionDataIntoAuthData() {
|
20020 | var defaultUnionIdPlatform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'weixin';
|
20021 | return function (authData, unionId) {
|
20022 | var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
20023 | _ref$unionIdPlatform = _ref.unionIdPlatform,
|
20024 | unionIdPlatform = _ref$unionIdPlatform === void 0 ? defaultUnionIdPlatform : _ref$unionIdPlatform,
|
20025 | _ref$asMainAccount = _ref.asMainAccount,
|
20026 | asMainAccount = _ref$asMainAccount === void 0 ? false : _ref$asMainAccount;
|
20027 |
|
20028 | if (typeof unionId !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionId is not a string');
|
20029 | if (typeof unionIdPlatform !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionIdPlatform is not a string');
|
20030 | return _.extend({}, authData, {
|
20031 | platform: unionIdPlatform,
|
20032 | unionid: unionId,
|
20033 | main_account: Boolean(asMainAccount)
|
20034 | });
|
20035 | };
|
20036 | };
|
20037 |
|
20038 | module.exports = function (AV) {
|
20039 | |
20040 |
|
20041 |
|
20042 |
|
20043 |
|
20044 |
|
20045 |
|
20046 |
|
20047 |
|
20048 | AV.User = AV.Object.extend('_User',
|
20049 |
|
20050 | {
|
20051 |
|
20052 | _isCurrentUser: false,
|
20053 |
|
20054 |
|
20055 | |
20056 |
|
20057 |
|
20058 |
|
20059 | _mergeMagicFields: function _mergeMagicFields(attrs) {
|
20060 | if (attrs.sessionToken) {
|
20061 | this._sessionToken = attrs.sessionToken;
|
20062 | delete attrs.sessionToken;
|
20063 | }
|
20064 |
|
20065 | return AV.User.__super__._mergeMagicFields.call(this, attrs);
|
20066 | },
|
20067 |
|
20068 | |
20069 |
|
20070 |
|
20071 |
|
20072 |
|
20073 | _cleanupAuthData: function _cleanupAuthData() {
|
20074 | if (!this.isCurrent()) {
|
20075 | return;
|
20076 | }
|
20077 |
|
20078 | var authData = this.get('authData');
|
20079 |
|
20080 | if (!authData) {
|
20081 | return;
|
20082 | }
|
20083 |
|
20084 | AV._objectEach(this.get('authData'), function (value, key) {
|
20085 | if (!authData[key]) {
|
20086 | delete authData[key];
|
20087 | }
|
20088 | });
|
20089 | },
|
20090 |
|
20091 | |
20092 |
|
20093 |
|
20094 |
|
20095 | _synchronizeAllAuthData: function _synchronizeAllAuthData() {
|
20096 | var authData = this.get('authData');
|
20097 |
|
20098 | if (!authData) {
|
20099 | return;
|
20100 | }
|
20101 |
|
20102 | var self = this;
|
20103 |
|
20104 | AV._objectEach(this.get('authData'), function (value, key) {
|
20105 | self._synchronizeAuthData(key);
|
20106 | });
|
20107 | },
|
20108 |
|
20109 | |
20110 |
|
20111 |
|
20112 |
|
20113 |
|
20114 | _synchronizeAuthData: function _synchronizeAuthData(provider) {
|
20115 | if (!this.isCurrent()) {
|
20116 | return;
|
20117 | }
|
20118 |
|
20119 | var authType;
|
20120 |
|
20121 | if (_.isString(provider)) {
|
20122 | authType = provider;
|
20123 | provider = AV.User._authProviders[authType];
|
20124 | } else {
|
20125 | authType = provider.getAuthType();
|
20126 | }
|
20127 |
|
20128 | var authData = this.get('authData');
|
20129 |
|
20130 | if (!authData || !provider) {
|
20131 | return;
|
20132 | }
|
20133 |
|
20134 | var success = provider.restoreAuthentication(authData[authType]);
|
20135 |
|
20136 | if (!success) {
|
20137 | this.dissociateAuthData(provider);
|
20138 | }
|
20139 | },
|
20140 | _handleSaveResult: function _handleSaveResult(makeCurrent) {
|
20141 |
|
20142 | if (makeCurrent && !AV._config.disableCurrentUser) {
|
20143 | this._isCurrentUser = true;
|
20144 | }
|
20145 |
|
20146 | this._cleanupAuthData();
|
20147 |
|
20148 | this._synchronizeAllAuthData();
|
20149 |
|
20150 |
|
20151 | delete this._serverData.password;
|
20152 |
|
20153 | this._rebuildEstimatedDataForKey('password');
|
20154 |
|
20155 | this._refreshCache();
|
20156 |
|
20157 | if ((makeCurrent || this.isCurrent()) && !AV._config.disableCurrentUser) {
|
20158 |
|
20159 |
|
20160 |
|
20161 | return _promise.default.resolve(AV.User._saveCurrentUser(this));
|
20162 | } else {
|
20163 | return _promise.default.resolve();
|
20164 | }
|
20165 | },
|
20166 |
|
20167 | |
20168 |
|
20169 |
|
20170 |
|
20171 |
|
20172 | _linkWith: function _linkWith(provider, data) {
|
20173 | var _this = this;
|
20174 |
|
20175 | var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
20176 | _ref2$failOnNotExist = _ref2.failOnNotExist,
|
20177 | failOnNotExist = _ref2$failOnNotExist === void 0 ? false : _ref2$failOnNotExist,
|
20178 | useMasterKey = _ref2.useMasterKey,
|
20179 | sessionToken = _ref2.sessionToken,
|
20180 | user = _ref2.user;
|
20181 |
|
20182 | var authType;
|
20183 |
|
20184 | if (_.isString(provider)) {
|
20185 | authType = provider;
|
20186 | provider = AV.User._authProviders[provider];
|
20187 | } else {
|
20188 | authType = provider.getAuthType();
|
20189 | }
|
20190 |
|
20191 | if (data) {
|
20192 | return this.save({
|
20193 | authData: (0, _defineProperty2.default)({}, authType, data)
|
20194 | }, {
|
20195 | useMasterKey: useMasterKey,
|
20196 | sessionToken: sessionToken,
|
20197 | user: user,
|
20198 | fetchWhenSave: !!this.get('authData'),
|
20199 | _failOnNotExist: failOnNotExist
|
20200 | }).then(function (model) {
|
20201 | return model._handleSaveResult(true).then(function () {
|
20202 | return model;
|
20203 | });
|
20204 | });
|
20205 | } else {
|
20206 | return provider.authenticate().then(function (result) {
|
20207 | return _this._linkWith(provider, result);
|
20208 | });
|
20209 | }
|
20210 | },
|
20211 |
|
20212 | |
20213 |
|
20214 |
|
20215 |
|
20216 |
|
20217 |
|
20218 |
|
20219 |
|
20220 |
|
20221 |
|
20222 |
|
20223 |
|
20224 |
|
20225 |
|
20226 |
|
20227 |
|
20228 | associateWithAuthData: function associateWithAuthData(authData, platform) {
|
20229 | return this._linkWith(platform, authData);
|
20230 | },
|
20231 |
|
20232 | |
20233 |
|
20234 |
|
20235 |
|
20236 |
|
20237 |
|
20238 |
|
20239 |
|
20240 |
|
20241 |
|
20242 |
|
20243 |
|
20244 |
|
20245 |
|
20246 |
|
20247 |
|
20248 |
|
20249 |
|
20250 |
|
20251 |
|
20252 |
|
20253 |
|
20254 |
|
20255 | associateWithAuthDataAndUnionId: function associateWithAuthDataAndUnionId(authData, platform, unionId, unionOptions) {
|
20256 | return this._linkWith(platform, mergeUnionDataIntoAuthData()(authData, unionId, unionOptions));
|
20257 | },
|
20258 |
|
20259 | |
20260 |
|
20261 |
|
20262 |
|
20263 |
|
20264 |
|
20265 |
|
20266 |
|
20267 | associateWithMiniApp: function associateWithMiniApp(authInfo, option) {
|
20268 | var _this2 = this;
|
20269 |
|
20270 | if (authInfo === undefined) {
|
20271 | var getAuthInfo = getAdapter('getAuthInfo');
|
20272 | return getAuthInfo().then(function (authInfo) {
|
20273 | return _this2._linkWith(authInfo.provider, authInfo.authData, option);
|
20274 | });
|
20275 | }
|
20276 |
|
20277 | return this._linkWith(authInfo.provider, authInfo.authData, option);
|
20278 | },
|
20279 |
|
20280 | |
20281 |
|
20282 |
|
20283 |
|
20284 |
|
20285 |
|
20286 |
|
20287 |
|
20288 |
|
20289 |
|
20290 |
|
20291 |
|
20292 | associateWithQQApp: function associateWithQQApp() {
|
20293 | var _this3 = this;
|
20294 |
|
20295 | var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20296 | _ref3$preferUnionId = _ref3.preferUnionId,
|
20297 | preferUnionId = _ref3$preferUnionId === void 0 ? false : _ref3$preferUnionId,
|
20298 | _ref3$unionIdPlatform = _ref3.unionIdPlatform,
|
20299 | unionIdPlatform = _ref3$unionIdPlatform === void 0 ? 'qq' : _ref3$unionIdPlatform,
|
20300 | _ref3$asMainAccount = _ref3.asMainAccount,
|
20301 | asMainAccount = _ref3$asMainAccount === void 0 ? true : _ref3$asMainAccount;
|
20302 |
|
20303 | var getAuthInfo = getAdapter('getAuthInfo');
|
20304 | return getAuthInfo({
|
20305 | preferUnionId: preferUnionId,
|
20306 | asMainAccount: asMainAccount,
|
20307 | platform: unionIdPlatform
|
20308 | }).then(function (authInfo) {
|
20309 | authInfo.provider = PLATFORM_QQAPP;
|
20310 | return _this3.associateWithMiniApp(authInfo);
|
20311 | });
|
20312 | },
|
20313 |
|
20314 | |
20315 |
|
20316 |
|
20317 |
|
20318 |
|
20319 |
|
20320 |
|
20321 |
|
20322 |
|
20323 |
|
20324 |
|
20325 |
|
20326 | associateWithWeapp: function associateWithWeapp() {
|
20327 | var _this4 = this;
|
20328 |
|
20329 | var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20330 | _ref4$preferUnionId = _ref4.preferUnionId,
|
20331 | preferUnionId = _ref4$preferUnionId === void 0 ? false : _ref4$preferUnionId,
|
20332 | _ref4$unionIdPlatform = _ref4.unionIdPlatform,
|
20333 | unionIdPlatform = _ref4$unionIdPlatform === void 0 ? 'weixin' : _ref4$unionIdPlatform,
|
20334 | _ref4$asMainAccount = _ref4.asMainAccount,
|
20335 | asMainAccount = _ref4$asMainAccount === void 0 ? true : _ref4$asMainAccount;
|
20336 |
|
20337 | var getAuthInfo = getAdapter('getAuthInfo');
|
20338 | return getAuthInfo({
|
20339 | preferUnionId: preferUnionId,
|
20340 | asMainAccount: asMainAccount,
|
20341 | platform: unionIdPlatform
|
20342 | }).then(function (authInfo) {
|
20343 | return _this4.associateWithMiniApp(authInfo);
|
20344 | });
|
20345 | },
|
20346 |
|
20347 | |
20348 |
|
20349 |
|
20350 |
|
20351 | linkWithWeapp: function linkWithWeapp(options) {
|
20352 | console.warn('DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替');
|
20353 | return this.associateWithWeapp(options);
|
20354 | },
|
20355 |
|
20356 | |
20357 |
|
20358 |
|
20359 |
|
20360 |
|
20361 |
|
20362 |
|
20363 |
|
20364 |
|
20365 |
|
20366 |
|
20367 |
|
20368 | associateWithQQAppWithUnionId: function associateWithQQAppWithUnionId(unionId) {
|
20369 | var _this5 = this;
|
20370 |
|
20371 | var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20372 | _ref5$unionIdPlatform = _ref5.unionIdPlatform,
|
20373 | unionIdPlatform = _ref5$unionIdPlatform === void 0 ? 'qq' : _ref5$unionIdPlatform,
|
20374 | _ref5$asMainAccount = _ref5.asMainAccount,
|
20375 | asMainAccount = _ref5$asMainAccount === void 0 ? false : _ref5$asMainAccount;
|
20376 |
|
20377 | var getAuthInfo = getAdapter('getAuthInfo');
|
20378 | return getAuthInfo({
|
20379 | platform: unionIdPlatform
|
20380 | }).then(function (authInfo) {
|
20381 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20382 | asMainAccount: asMainAccount
|
20383 | });
|
20384 | authInfo.provider = PLATFORM_QQAPP;
|
20385 | return _this5.associateWithMiniApp(authInfo);
|
20386 | });
|
20387 | },
|
20388 |
|
20389 | |
20390 |
|
20391 |
|
20392 |
|
20393 |
|
20394 |
|
20395 |
|
20396 |
|
20397 |
|
20398 |
|
20399 |
|
20400 |
|
20401 | associateWithWeappWithUnionId: function associateWithWeappWithUnionId(unionId) {
|
20402 | var _this6 = this;
|
20403 |
|
20404 | var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20405 | _ref6$unionIdPlatform = _ref6.unionIdPlatform,
|
20406 | unionIdPlatform = _ref6$unionIdPlatform === void 0 ? 'weixin' : _ref6$unionIdPlatform,
|
20407 | _ref6$asMainAccount = _ref6.asMainAccount,
|
20408 | asMainAccount = _ref6$asMainAccount === void 0 ? false : _ref6$asMainAccount;
|
20409 |
|
20410 | var getAuthInfo = getAdapter('getAuthInfo');
|
20411 | return getAuthInfo({
|
20412 | platform: unionIdPlatform
|
20413 | }).then(function (authInfo) {
|
20414 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20415 | asMainAccount: asMainAccount
|
20416 | });
|
20417 | return _this6.associateWithMiniApp(authInfo);
|
20418 | });
|
20419 | },
|
20420 |
|
20421 | |
20422 |
|
20423 |
|
20424 |
|
20425 |
|
20426 |
|
20427 | dissociateAuthData: function dissociateAuthData(provider) {
|
20428 | this.unset("authData.".concat(provider));
|
20429 | return this.save().then(function (model) {
|
20430 | return model._handleSaveResult(true).then(function () {
|
20431 | return model;
|
20432 | });
|
20433 | });
|
20434 | },
|
20435 |
|
20436 | |
20437 |
|
20438 |
|
20439 |
|
20440 | _unlinkFrom: function _unlinkFrom(provider) {
|
20441 | console.warn('DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替');
|
20442 | return this.dissociateAuthData(provider);
|
20443 | },
|
20444 |
|
20445 | |
20446 |
|
20447 |
|
20448 |
|
20449 | _isLinked: function _isLinked(provider) {
|
20450 | var authType;
|
20451 |
|
20452 | if (_.isString(provider)) {
|
20453 | authType = provider;
|
20454 | } else {
|
20455 | authType = provider.getAuthType();
|
20456 | }
|
20457 |
|
20458 | var authData = this.get('authData') || {};
|
20459 | return !!authData[authType];
|
20460 | },
|
20461 |
|
20462 | |
20463 |
|
20464 |
|
20465 |
|
20466 |
|
20467 | isAnonymous: function isAnonymous() {
|
20468 | return this._isLinked(PLATFORM_ANONYMOUS);
|
20469 | },
|
20470 | logOut: function logOut() {
|
20471 | this._logOutWithAll();
|
20472 |
|
20473 | this._isCurrentUser = false;
|
20474 | },
|
20475 |
|
20476 | |
20477 |
|
20478 |
|
20479 |
|
20480 | _logOutWithAll: function _logOutWithAll() {
|
20481 | var authData = this.get('authData');
|
20482 |
|
20483 | if (!authData) {
|
20484 | return;
|
20485 | }
|
20486 |
|
20487 | var self = this;
|
20488 |
|
20489 | AV._objectEach(this.get('authData'), function (value, key) {
|
20490 | self._logOutWith(key);
|
20491 | });
|
20492 | },
|
20493 |
|
20494 | |
20495 |
|
20496 |
|
20497 |
|
20498 |
|
20499 | _logOutWith: function _logOutWith(provider) {
|
20500 | if (!this.isCurrent()) {
|
20501 | return;
|
20502 | }
|
20503 |
|
20504 | if (_.isString(provider)) {
|
20505 | provider = AV.User._authProviders[provider];
|
20506 | }
|
20507 |
|
20508 | if (provider && provider.deauthenticate) {
|
20509 | provider.deauthenticate();
|
20510 | }
|
20511 | },
|
20512 |
|
20513 | |
20514 |
|
20515 |
|
20516 |
|
20517 |
|
20518 |
|
20519 |
|
20520 |
|
20521 |
|
20522 |
|
20523 |
|
20524 |
|
20525 |
|
20526 |
|
20527 | signUp: function signUp(attrs, options) {
|
20528 | var error;
|
20529 | var username = attrs && attrs.username || this.get('username');
|
20530 |
|
20531 | if (!username || username === '') {
|
20532 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty name.');
|
20533 | throw error;
|
20534 | }
|
20535 |
|
20536 | var password = attrs && attrs.password || this.get('password');
|
20537 |
|
20538 | if (!password || password === '') {
|
20539 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty password.');
|
20540 | throw error;
|
20541 | }
|
20542 |
|
20543 | return this.save(attrs, options).then(function (model) {
|
20544 | if (model.isAnonymous()) {
|
20545 | model.unset("authData.".concat(PLATFORM_ANONYMOUS));
|
20546 | model._opSetQueue = [{}];
|
20547 | }
|
20548 |
|
20549 | return model._handleSaveResult(true).then(function () {
|
20550 | return model;
|
20551 | });
|
20552 | });
|
20553 | },
|
20554 |
|
20555 | |
20556 |
|
20557 |
|
20558 |
|
20559 |
|
20560 |
|
20561 |
|
20562 |
|
20563 |
|
20564 |
|
20565 |
|
20566 |
|
20567 |
|
20568 |
|
20569 |
|
20570 |
|
20571 | signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(attrs) {
|
20572 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
20573 | var error;
|
20574 | var mobilePhoneNumber = attrs && attrs.mobilePhoneNumber || this.get('mobilePhoneNumber');
|
20575 |
|
20576 | if (!mobilePhoneNumber || mobilePhoneNumber === '') {
|
20577 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty mobilePhoneNumber.');
|
20578 | throw error;
|
20579 | }
|
20580 |
|
20581 | var smsCode = attrs && attrs.smsCode || this.get('smsCode');
|
20582 |
|
20583 | if (!smsCode || smsCode === '') {
|
20584 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty smsCode.');
|
20585 | throw error;
|
20586 | }
|
20587 |
|
20588 | options._makeRequest = function (route, className, id, method, json) {
|
20589 | return AVRequest('usersByMobilePhone', null, null, 'POST', json);
|
20590 | };
|
20591 |
|
20592 | return this.save(attrs, options).then(function (model) {
|
20593 | delete model.attributes.smsCode;
|
20594 | delete model._serverData.smsCode;
|
20595 | return model._handleSaveResult(true).then(function () {
|
20596 | return model;
|
20597 | });
|
20598 | });
|
20599 | },
|
20600 |
|
20601 | |
20602 |
|
20603 |
|
20604 |
|
20605 | loginWithAuthData: function loginWithAuthData(authData, platform, options) {
|
20606 | return this._linkWith(platform, authData, options);
|
20607 | },
|
20608 |
|
20609 | |
20610 |
|
20611 |
|
20612 |
|
20613 | loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
|
20614 | return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
|
20615 | },
|
20616 |
|
20617 | |
20618 |
|
20619 |
|
20620 |
|
20621 |
|
20622 |
|
20623 |
|
20624 |
|
20625 |
|
20626 |
|
20627 |
|
20628 | loginWithWeapp: function loginWithWeapp() {
|
20629 | var _this7 = this;
|
20630 |
|
20631 | var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20632 | _ref7$preferUnionId = _ref7.preferUnionId,
|
20633 | preferUnionId = _ref7$preferUnionId === void 0 ? false : _ref7$preferUnionId,
|
20634 | _ref7$unionIdPlatform = _ref7.unionIdPlatform,
|
20635 | unionIdPlatform = _ref7$unionIdPlatform === void 0 ? 'weixin' : _ref7$unionIdPlatform,
|
20636 | _ref7$asMainAccount = _ref7.asMainAccount,
|
20637 | asMainAccount = _ref7$asMainAccount === void 0 ? true : _ref7$asMainAccount,
|
20638 | _ref7$failOnNotExist = _ref7.failOnNotExist,
|
20639 | failOnNotExist = _ref7$failOnNotExist === void 0 ? false : _ref7$failOnNotExist,
|
20640 | useMasterKey = _ref7.useMasterKey,
|
20641 | sessionToken = _ref7.sessionToken,
|
20642 | user = _ref7.user;
|
20643 |
|
20644 | var getAuthInfo = getAdapter('getAuthInfo');
|
20645 | return getAuthInfo({
|
20646 | preferUnionId: preferUnionId,
|
20647 | asMainAccount: asMainAccount,
|
20648 | platform: unionIdPlatform
|
20649 | }).then(function (authInfo) {
|
20650 | return _this7.loginWithMiniApp(authInfo, {
|
20651 | failOnNotExist: failOnNotExist,
|
20652 | useMasterKey: useMasterKey,
|
20653 | sessionToken: sessionToken,
|
20654 | user: user
|
20655 | });
|
20656 | });
|
20657 | },
|
20658 |
|
20659 | |
20660 |
|
20661 |
|
20662 |
|
20663 |
|
20664 | loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
|
20665 | var _this8 = this;
|
20666 |
|
20667 | var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20668 | _ref8$unionIdPlatform = _ref8.unionIdPlatform,
|
20669 | unionIdPlatform = _ref8$unionIdPlatform === void 0 ? 'weixin' : _ref8$unionIdPlatform,
|
20670 | _ref8$asMainAccount = _ref8.asMainAccount,
|
20671 | asMainAccount = _ref8$asMainAccount === void 0 ? false : _ref8$asMainAccount,
|
20672 | _ref8$failOnNotExist = _ref8.failOnNotExist,
|
20673 | failOnNotExist = _ref8$failOnNotExist === void 0 ? false : _ref8$failOnNotExist,
|
20674 | useMasterKey = _ref8.useMasterKey,
|
20675 | sessionToken = _ref8.sessionToken,
|
20676 | user = _ref8.user;
|
20677 |
|
20678 | var getAuthInfo = getAdapter('getAuthInfo');
|
20679 | return getAuthInfo({
|
20680 | platform: unionIdPlatform
|
20681 | }).then(function (authInfo) {
|
20682 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20683 | asMainAccount: asMainAccount
|
20684 | });
|
20685 | return _this8.loginWithMiniApp(authInfo, {
|
20686 | failOnNotExist: failOnNotExist,
|
20687 | useMasterKey: useMasterKey,
|
20688 | sessionToken: sessionToken,
|
20689 | user: user
|
20690 | });
|
20691 | });
|
20692 | },
|
20693 |
|
20694 | |
20695 |
|
20696 |
|
20697 |
|
20698 |
|
20699 |
|
20700 |
|
20701 |
|
20702 |
|
20703 |
|
20704 | loginWithQQApp: function loginWithQQApp() {
|
20705 | var _this9 = this;
|
20706 |
|
20707 | var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20708 | _ref9$preferUnionId = _ref9.preferUnionId,
|
20709 | preferUnionId = _ref9$preferUnionId === void 0 ? false : _ref9$preferUnionId,
|
20710 | _ref9$unionIdPlatform = _ref9.unionIdPlatform,
|
20711 | unionIdPlatform = _ref9$unionIdPlatform === void 0 ? 'qq' : _ref9$unionIdPlatform,
|
20712 | _ref9$asMainAccount = _ref9.asMainAccount,
|
20713 | asMainAccount = _ref9$asMainAccount === void 0 ? true : _ref9$asMainAccount,
|
20714 | _ref9$failOnNotExist = _ref9.failOnNotExist,
|
20715 | failOnNotExist = _ref9$failOnNotExist === void 0 ? false : _ref9$failOnNotExist,
|
20716 | useMasterKey = _ref9.useMasterKey,
|
20717 | sessionToken = _ref9.sessionToken,
|
20718 | user = _ref9.user;
|
20719 |
|
20720 | var getAuthInfo = getAdapter('getAuthInfo');
|
20721 | return getAuthInfo({
|
20722 | preferUnionId: preferUnionId,
|
20723 | asMainAccount: asMainAccount,
|
20724 | platform: unionIdPlatform
|
20725 | }).then(function (authInfo) {
|
20726 | authInfo.provider = PLATFORM_QQAPP;
|
20727 | return _this9.loginWithMiniApp(authInfo, {
|
20728 | failOnNotExist: failOnNotExist,
|
20729 | useMasterKey: useMasterKey,
|
20730 | sessionToken: sessionToken,
|
20731 | user: user
|
20732 | });
|
20733 | });
|
20734 | },
|
20735 |
|
20736 | |
20737 |
|
20738 |
|
20739 |
|
20740 |
|
20741 | loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
|
20742 | var _this10 = this;
|
20743 |
|
20744 | var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20745 | _ref10$unionIdPlatfor = _ref10.unionIdPlatform,
|
20746 | unionIdPlatform = _ref10$unionIdPlatfor === void 0 ? 'qq' : _ref10$unionIdPlatfor,
|
20747 | _ref10$asMainAccount = _ref10.asMainAccount,
|
20748 | asMainAccount = _ref10$asMainAccount === void 0 ? false : _ref10$asMainAccount,
|
20749 | _ref10$failOnNotExist = _ref10.failOnNotExist,
|
20750 | failOnNotExist = _ref10$failOnNotExist === void 0 ? false : _ref10$failOnNotExist,
|
20751 | useMasterKey = _ref10.useMasterKey,
|
20752 | sessionToken = _ref10.sessionToken,
|
20753 | user = _ref10.user;
|
20754 |
|
20755 | var getAuthInfo = getAdapter('getAuthInfo');
|
20756 | return getAuthInfo({
|
20757 | platform: unionIdPlatform
|
20758 | }).then(function (authInfo) {
|
20759 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20760 | asMainAccount: asMainAccount
|
20761 | });
|
20762 | authInfo.provider = PLATFORM_QQAPP;
|
20763 | return _this10.loginWithMiniApp(authInfo, {
|
20764 | failOnNotExist: failOnNotExist,
|
20765 | useMasterKey: useMasterKey,
|
20766 | sessionToken: sessionToken,
|
20767 | user: user
|
20768 | });
|
20769 | });
|
20770 | },
|
20771 |
|
20772 | |
20773 |
|
20774 |
|
20775 |
|
20776 | loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
|
20777 | var _this11 = this;
|
20778 |
|
20779 | if (authInfo === undefined) {
|
20780 | var getAuthInfo = getAdapter('getAuthInfo');
|
20781 | return getAuthInfo().then(function (authInfo) {
|
20782 | return _this11.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
20783 | });
|
20784 | }
|
20785 |
|
20786 | return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
20787 | },
|
20788 |
|
20789 | |
20790 |
|
20791 |
|
20792 |
|
20793 |
|
20794 |
|
20795 |
|
20796 |
|
20797 |
|
20798 |
|
20799 |
|
20800 | logIn: function logIn() {
|
20801 | var model = this;
|
20802 | var request = AVRequest('login', null, null, 'POST', this.toJSON());
|
20803 | return request.then(function (resp) {
|
20804 | var serverAttrs = model.parse(resp);
|
20805 |
|
20806 | model._finishFetch(serverAttrs);
|
20807 |
|
20808 | return model._handleSaveResult(true).then(function () {
|
20809 | if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
|
20810 | return model;
|
20811 | });
|
20812 | });
|
20813 | },
|
20814 |
|
20815 | |
20816 |
|
20817 |
|
20818 | save: function save(arg1, arg2, arg3) {
|
20819 | var attrs, options;
|
20820 |
|
20821 | if (_.isObject(arg1) || _.isNull(arg1) || _.isUndefined(arg1)) {
|
20822 | attrs = arg1;
|
20823 | options = arg2;
|
20824 | } else {
|
20825 | attrs = {};
|
20826 | attrs[arg1] = arg2;
|
20827 | options = arg3;
|
20828 | }
|
20829 |
|
20830 | options = options || {};
|
20831 | return AV.Object.prototype.save.call(this, attrs, options).then(function (model) {
|
20832 | return model._handleSaveResult(false).then(function () {
|
20833 | return model;
|
20834 | });
|
20835 | });
|
20836 | },
|
20837 |
|
20838 | |
20839 |
|
20840 |
|
20841 |
|
20842 |
|
20843 |
|
20844 |
|
20845 |
|
20846 |
|
20847 | follow: function follow(options, authOptions) {
|
20848 | if (!this.id) {
|
20849 | throw new Error('Please signin.');
|
20850 | }
|
20851 |
|
20852 | var user;
|
20853 | var attributes;
|
20854 |
|
20855 | if (options.user) {
|
20856 | user = options.user;
|
20857 | attributes = options.attributes;
|
20858 | } else {
|
20859 | user = options;
|
20860 | }
|
20861 |
|
20862 | var userObjectId = _.isString(user) ? user : user.id;
|
20863 |
|
20864 | if (!userObjectId) {
|
20865 | throw new Error('Invalid target user.');
|
20866 | }
|
20867 |
|
20868 | var route = 'users/' + this.id + '/friendship/' + userObjectId;
|
20869 | var request = AVRequest(route, null, null, 'POST', AV._encode(attributes), authOptions);
|
20870 | return request;
|
20871 | },
|
20872 |
|
20873 | |
20874 |
|
20875 |
|
20876 |
|
20877 |
|
20878 |
|
20879 |
|
20880 | unfollow: function unfollow(options, authOptions) {
|
20881 | if (!this.id) {
|
20882 | throw new Error('Please signin.');
|
20883 | }
|
20884 |
|
20885 | var user;
|
20886 |
|
20887 | if (options.user) {
|
20888 | user = options.user;
|
20889 | } else {
|
20890 | user = options;
|
20891 | }
|
20892 |
|
20893 | var userObjectId = _.isString(user) ? user : user.id;
|
20894 |
|
20895 | if (!userObjectId) {
|
20896 | throw new Error('Invalid target user.');
|
20897 | }
|
20898 |
|
20899 | var route = 'users/' + this.id + '/friendship/' + userObjectId;
|
20900 | var request = AVRequest(route, null, null, 'DELETE', null, authOptions);
|
20901 | return request;
|
20902 | },
|
20903 |
|
20904 | |
20905 |
|
20906 |
|
20907 |
|
20908 |
|
20909 |
|
20910 |
|
20911 |
|
20912 | getFollowersAndFollowees: function getFollowersAndFollowees(options, authOptions) {
|
20913 | if (!this.id) {
|
20914 | throw new Error('Please signin.');
|
20915 | }
|
20916 |
|
20917 | return request({
|
20918 | method: 'GET',
|
20919 | path: "/users/".concat(this.id, "/followersAndFollowees"),
|
20920 | query: {
|
20921 | skip: options && options.skip,
|
20922 | limit: options && options.limit,
|
20923 | include: 'follower,followee',
|
20924 | keys: 'follower,followee'
|
20925 | },
|
20926 | authOptions: authOptions
|
20927 | }).then(function (_ref11) {
|
20928 | var followers = _ref11.followers,
|
20929 | followees = _ref11.followees;
|
20930 | return {
|
20931 | followers: (0, _map.default)(followers).call(followers, function (_ref12) {
|
20932 | var follower = _ref12.follower;
|
20933 | return AV._decode(follower);
|
20934 | }),
|
20935 | followees: (0, _map.default)(followees).call(followees, function (_ref13) {
|
20936 | var followee = _ref13.followee;
|
20937 | return AV._decode(followee);
|
20938 | })
|
20939 | };
|
20940 | });
|
20941 | },
|
20942 |
|
20943 | |
20944 |
|
20945 |
|
20946 |
|
20947 |
|
20948 | followerQuery: function followerQuery() {
|
20949 | return AV.User.followerQuery(this.id);
|
20950 | },
|
20951 |
|
20952 | |
20953 |
|
20954 |
|
20955 |
|
20956 |
|
20957 | followeeQuery: function followeeQuery() {
|
20958 | return AV.User.followeeQuery(this.id);
|
20959 | },
|
20960 |
|
20961 | |
20962 |
|
20963 |
|
20964 | fetch: function fetch(fetchOptions, options) {
|
20965 | return AV.Object.prototype.fetch.call(this, fetchOptions, options).then(function (model) {
|
20966 | return model._handleSaveResult(false).then(function () {
|
20967 | return model;
|
20968 | });
|
20969 | });
|
20970 | },
|
20971 |
|
20972 | |
20973 |
|
20974 |
|
20975 |
|
20976 |
|
20977 |
|
20978 | updatePassword: function updatePassword(oldPassword, newPassword, options) {
|
20979 | var _this12 = this;
|
20980 |
|
20981 | var route = 'users/' + this.id + '/updatePassword';
|
20982 | var params = {
|
20983 | old_password: oldPassword,
|
20984 | new_password: newPassword
|
20985 | };
|
20986 | var request = AVRequest(route, null, null, 'PUT', params, options);
|
20987 | return request.then(function (resp) {
|
20988 | _this12._finishFetch(_this12.parse(resp));
|
20989 |
|
20990 | return _this12._handleSaveResult(true).then(function () {
|
20991 | return resp;
|
20992 | });
|
20993 | });
|
20994 | },
|
20995 |
|
20996 | |
20997 |
|
20998 |
|
20999 |
|
21000 | isCurrent: function isCurrent() {
|
21001 | return this._isCurrentUser;
|
21002 | },
|
21003 |
|
21004 | |
21005 |
|
21006 |
|
21007 |
|
21008 |
|
21009 | getUsername: function getUsername() {
|
21010 | return this.get('username');
|
21011 | },
|
21012 |
|
21013 | |
21014 |
|
21015 |
|
21016 |
|
21017 |
|
21018 | getMobilePhoneNumber: function getMobilePhoneNumber() {
|
21019 | return this.get('mobilePhoneNumber');
|
21020 | },
|
21021 |
|
21022 | |
21023 |
|
21024 |
|
21025 |
|
21026 |
|
21027 |
|
21028 | setMobilePhoneNumber: function setMobilePhoneNumber(phone, options) {
|
21029 | return this.set('mobilePhoneNumber', phone, options);
|
21030 | },
|
21031 |
|
21032 | |
21033 |
|
21034 |
|
21035 |
|
21036 |
|
21037 |
|
21038 | setUsername: function setUsername(username, options) {
|
21039 | return this.set('username', username, options);
|
21040 | },
|
21041 |
|
21042 | |
21043 |
|
21044 |
|
21045 |
|
21046 |
|
21047 |
|
21048 | setPassword: function setPassword(password, options) {
|
21049 | return this.set('password', password, options);
|
21050 | },
|
21051 |
|
21052 | |
21053 |
|
21054 |
|
21055 |
|
21056 |
|
21057 | getEmail: function getEmail() {
|
21058 | return this.get('email');
|
21059 | },
|
21060 |
|
21061 | |
21062 |
|
21063 |
|
21064 |
|
21065 |
|
21066 |
|
21067 |
|
21068 | setEmail: function setEmail(email, options) {
|
21069 | return this.set('email', email, options);
|
21070 | },
|
21071 |
|
21072 | |
21073 |
|
21074 |
|
21075 |
|
21076 |
|
21077 |
|
21078 | authenticated: function authenticated() {
|
21079 | console.warn('DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。');
|
21080 | return !!this._sessionToken && !AV._config.disableCurrentUser && AV.User.current() && AV.User.current().id === this.id;
|
21081 | },
|
21082 |
|
21083 | |
21084 |
|
21085 |
|
21086 |
|
21087 |
|
21088 |
|
21089 | isAuthenticated: function isAuthenticated() {
|
21090 | var _this13 = this;
|
21091 |
|
21092 | return _promise.default.resolve().then(function () {
|
21093 | return !!_this13._sessionToken && AV.User._fetchUserBySessionToken(_this13._sessionToken).then(function () {
|
21094 | return true;
|
21095 | }, function (error) {
|
21096 | if (error.code === 211) {
|
21097 | return false;
|
21098 | }
|
21099 |
|
21100 | throw error;
|
21101 | });
|
21102 | });
|
21103 | },
|
21104 |
|
21105 | |
21106 |
|
21107 |
|
21108 |
|
21109 | getSessionToken: function getSessionToken() {
|
21110 | return this._sessionToken;
|
21111 | },
|
21112 |
|
21113 | |
21114 |
|
21115 |
|
21116 |
|
21117 |
|
21118 |
|
21119 | refreshSessionToken: function refreshSessionToken(options) {
|
21120 | var _this14 = this;
|
21121 |
|
21122 | return AVRequest("users/".concat(this.id, "/refreshSessionToken"), null, null, 'PUT', null, options).then(function (response) {
|
21123 | _this14._finishFetch(response);
|
21124 |
|
21125 | return _this14._handleSaveResult(true).then(function () {
|
21126 | return _this14;
|
21127 | });
|
21128 | });
|
21129 | },
|
21130 |
|
21131 | |
21132 |
|
21133 |
|
21134 |
|
21135 |
|
21136 |
|
21137 | getRoles: function getRoles(options) {
|
21138 | var _context;
|
21139 |
|
21140 | return (0, _find.default)(_context = AV.Relation.reverseQuery('_Role', 'users', this)).call(_context, options);
|
21141 | }
|
21142 | },
|
21143 |
|
21144 | {
|
21145 |
|
21146 |
|
21147 | _currentUser: null,
|
21148 |
|
21149 |
|
21150 |
|
21151 | _currentUserMatchesDisk: false,
|
21152 |
|
21153 | _CURRENT_USER_KEY: 'currentUser',
|
21154 |
|
21155 | _authProviders: {},
|
21156 |
|
21157 |
|
21158 | |
21159 |
|
21160 |
|
21161 |
|
21162 |
|
21163 |
|
21164 |
|
21165 |
|
21166 |
|
21167 |
|
21168 |
|
21169 |
|
21170 |
|
21171 |
|
21172 | signUp: function signUp(username, password, attrs, options) {
|
21173 | attrs = attrs || {};
|
21174 | attrs.username = username;
|
21175 | attrs.password = password;
|
21176 |
|
21177 | var user = AV.Object._create('_User');
|
21178 |
|
21179 | return user.signUp(attrs, options);
|
21180 | },
|
21181 |
|
21182 | |
21183 |
|
21184 |
|
21185 |
|
21186 |
|
21187 |
|
21188 |
|
21189 |
|
21190 |
|
21191 |
|
21192 |
|
21193 | logIn: function logIn(username, password) {
|
21194 | var user = AV.Object._create('_User');
|
21195 |
|
21196 | user._finishFetch({
|
21197 | username: username,
|
21198 | password: password
|
21199 | });
|
21200 |
|
21201 | return user.logIn();
|
21202 | },
|
21203 |
|
21204 | |
21205 |
|
21206 |
|
21207 |
|
21208 |
|
21209 |
|
21210 |
|
21211 |
|
21212 |
|
21213 | become: function become(sessionToken) {
|
21214 | return this._fetchUserBySessionToken(sessionToken).then(function (user) {
|
21215 | return user._handleSaveResult(true).then(function () {
|
21216 | return user;
|
21217 | });
|
21218 | });
|
21219 | },
|
21220 | _fetchUserBySessionToken: function _fetchUserBySessionToken(sessionToken) {
|
21221 | if (sessionToken === undefined) {
|
21222 | return _promise.default.reject(new Error('The sessionToken cannot be undefined'));
|
21223 | }
|
21224 |
|
21225 | var user = AV.Object._create('_User');
|
21226 |
|
21227 | return request({
|
21228 | method: 'GET',
|
21229 | path: '/users/me',
|
21230 | authOptions: {
|
21231 | sessionToken: sessionToken
|
21232 | }
|
21233 | }).then(function (resp) {
|
21234 | var serverAttrs = user.parse(resp);
|
21235 |
|
21236 | user._finishFetch(serverAttrs);
|
21237 |
|
21238 | return user;
|
21239 | });
|
21240 | },
|
21241 |
|
21242 | |
21243 |
|
21244 |
|
21245 |
|
21246 |
|
21247 |
|
21248 |
|
21249 |
|
21250 |
|
21251 |
|
21252 |
|
21253 |
|
21254 | logInWithMobilePhoneSmsCode: function logInWithMobilePhoneSmsCode(mobilePhone, smsCode) {
|
21255 | var user = AV.Object._create('_User');
|
21256 |
|
21257 | user._finishFetch({
|
21258 | mobilePhoneNumber: mobilePhone,
|
21259 | smsCode: smsCode
|
21260 | });
|
21261 |
|
21262 | return user.logIn();
|
21263 | },
|
21264 |
|
21265 | |
21266 |
|
21267 |
|
21268 |
|
21269 |
|
21270 |
|
21271 |
|
21272 |
|
21273 |
|
21274 |
|
21275 |
|
21276 |
|
21277 |
|
21278 |
|
21279 | signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attrs, options) {
|
21280 | attrs = attrs || {};
|
21281 | attrs.mobilePhoneNumber = mobilePhoneNumber;
|
21282 | attrs.smsCode = smsCode;
|
21283 |
|
21284 | var user = AV.Object._create('_User');
|
21285 |
|
21286 | return user.signUpOrlogInWithMobilePhone(attrs, options);
|
21287 | },
|
21288 |
|
21289 | |
21290 |
|
21291 |
|
21292 |
|
21293 |
|
21294 |
|
21295 |
|
21296 |
|
21297 |
|
21298 |
|
21299 |
|
21300 | logInWithMobilePhone: function logInWithMobilePhone(mobilePhone, password) {
|
21301 | var user = AV.Object._create('_User');
|
21302 |
|
21303 | user._finishFetch({
|
21304 | mobilePhoneNumber: mobilePhone,
|
21305 | password: password
|
21306 | });
|
21307 |
|
21308 | return user.logIn();
|
21309 | },
|
21310 |
|
21311 | |
21312 |
|
21313 |
|
21314 |
|
21315 |
|
21316 |
|
21317 |
|
21318 |
|
21319 |
|
21320 | loginWithEmail: function loginWithEmail(email, password) {
|
21321 | var user = AV.Object._create('_User');
|
21322 |
|
21323 | user._finishFetch({
|
21324 | email: email,
|
21325 | password: password
|
21326 | });
|
21327 |
|
21328 | return user.logIn();
|
21329 | },
|
21330 |
|
21331 | |
21332 |
|
21333 |
|
21334 |
|
21335 |
|
21336 |
|
21337 |
|
21338 |
|
21339 |
|
21340 |
|
21341 |
|
21342 |
|
21343 |
|
21344 |
|
21345 |
|
21346 |
|
21347 |
|
21348 |
|
21349 |
|
21350 |
|
21351 |
|
21352 |
|
21353 |
|
21354 | loginWithAuthData: function loginWithAuthData(authData, platform, options) {
|
21355 | return AV.User._logInWith(platform, authData, options);
|
21356 | },
|
21357 |
|
21358 | |
21359 |
|
21360 |
|
21361 | signUpOrlogInWithAuthData: function signUpOrlogInWithAuthData() {
|
21362 | console.warn('DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替');
|
21363 | return this.loginWithAuthData.apply(this, arguments);
|
21364 | },
|
21365 |
|
21366 | |
21367 |
|
21368 |
|
21369 |
|
21370 |
|
21371 |
|
21372 |
|
21373 |
|
21374 |
|
21375 |
|
21376 |
|
21377 |
|
21378 |
|
21379 |
|
21380 |
|
21381 |
|
21382 |
|
21383 |
|
21384 |
|
21385 |
|
21386 |
|
21387 |
|
21388 |
|
21389 |
|
21390 | loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
|
21391 | return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
|
21392 | },
|
21393 |
|
21394 | |
21395 |
|
21396 |
|
21397 |
|
21398 | signUpOrlogInWithAuthDataAndUnionId: function signUpOrlogInWithAuthDataAndUnionId() {
|
21399 | console.warn('DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替');
|
21400 | return this.loginWithAuthDataAndUnionId.apply(this, arguments);
|
21401 | },
|
21402 |
|
21403 | |
21404 |
|
21405 |
|
21406 |
|
21407 |
|
21408 |
|
21409 |
|
21410 |
|
21411 | mergeUnionId: function mergeUnionId(authInfo, unionId) {
|
21412 | var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
21413 | _ref14$asMainAccount = _ref14.asMainAccount,
|
21414 | asMainAccount = _ref14$asMainAccount === void 0 ? false : _ref14$asMainAccount;
|
21415 |
|
21416 | authInfo = JSON.parse((0, _stringify.default)(authInfo));
|
21417 | var _authInfo = authInfo,
|
21418 | authData = _authInfo.authData,
|
21419 | platform = _authInfo.platform;
|
21420 | authData.platform = platform;
|
21421 | authData.main_account = asMainAccount;
|
21422 | authData.unionid = unionId;
|
21423 | return authInfo;
|
21424 | },
|
21425 |
|
21426 | |
21427 |
|
21428 |
|
21429 |
|
21430 |
|
21431 |
|
21432 |
|
21433 |
|
21434 |
|
21435 |
|
21436 |
|
21437 |
|
21438 |
|
21439 | loginWithWeapp: function loginWithWeapp() {
|
21440 | var _this15 = this;
|
21441 |
|
21442 | var _ref15 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
21443 | _ref15$preferUnionId = _ref15.preferUnionId,
|
21444 | preferUnionId = _ref15$preferUnionId === void 0 ? false : _ref15$preferUnionId,
|
21445 | _ref15$unionIdPlatfor = _ref15.unionIdPlatform,
|
21446 | unionIdPlatform = _ref15$unionIdPlatfor === void 0 ? 'weixin' : _ref15$unionIdPlatfor,
|
21447 | _ref15$asMainAccount = _ref15.asMainAccount,
|
21448 | asMainAccount = _ref15$asMainAccount === void 0 ? true : _ref15$asMainAccount,
|
21449 | _ref15$failOnNotExist = _ref15.failOnNotExist,
|
21450 | failOnNotExist = _ref15$failOnNotExist === void 0 ? false : _ref15$failOnNotExist,
|
21451 | useMasterKey = _ref15.useMasterKey,
|
21452 | sessionToken = _ref15.sessionToken,
|
21453 | user = _ref15.user;
|
21454 |
|
21455 | var getAuthInfo = getAdapter('getAuthInfo');
|
21456 | return getAuthInfo({
|
21457 | preferUnionId: preferUnionId,
|
21458 | asMainAccount: asMainAccount,
|
21459 | platform: unionIdPlatform
|
21460 | }).then(function (authInfo) {
|
21461 | return _this15.loginWithMiniApp(authInfo, {
|
21462 | failOnNotExist: failOnNotExist,
|
21463 | useMasterKey: useMasterKey,
|
21464 | sessionToken: sessionToken,
|
21465 | user: user
|
21466 | });
|
21467 | });
|
21468 | },
|
21469 |
|
21470 | |
21471 |
|
21472 |
|
21473 |
|
21474 |
|
21475 |
|
21476 |
|
21477 |
|
21478 |
|
21479 |
|
21480 |
|
21481 | loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
|
21482 | var _this16 = this;
|
21483 |
|
21484 | var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
21485 | _ref16$unionIdPlatfor = _ref16.unionIdPlatform,
|
21486 | unionIdPlatform = _ref16$unionIdPlatfor === void 0 ? 'weixin' : _ref16$unionIdPlatfor,
|
21487 | _ref16$asMainAccount = _ref16.asMainAccount,
|
21488 | asMainAccount = _ref16$asMainAccount === void 0 ? false : _ref16$asMainAccount,
|
21489 | _ref16$failOnNotExist = _ref16.failOnNotExist,
|
21490 | failOnNotExist = _ref16$failOnNotExist === void 0 ? false : _ref16$failOnNotExist,
|
21491 | useMasterKey = _ref16.useMasterKey,
|
21492 | sessionToken = _ref16.sessionToken,
|
21493 | user = _ref16.user;
|
21494 |
|
21495 | var getAuthInfo = getAdapter('getAuthInfo');
|
21496 | return getAuthInfo({
|
21497 | platform: unionIdPlatform
|
21498 | }).then(function (authInfo) {
|
21499 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
21500 | asMainAccount: asMainAccount
|
21501 | });
|
21502 | return _this16.loginWithMiniApp(authInfo, {
|
21503 | failOnNotExist: failOnNotExist,
|
21504 | useMasterKey: useMasterKey,
|
21505 | sessionToken: sessionToken,
|
21506 | user: user
|
21507 | });
|
21508 | });
|
21509 | },
|
21510 |
|
21511 | |
21512 |
|
21513 |
|
21514 |
|
21515 |
|
21516 |
|
21517 |
|
21518 |
|
21519 |
|
21520 |
|
21521 |
|
21522 |
|
21523 |
|
21524 | loginWithQQApp: function loginWithQQApp() {
|
21525 | var _this17 = this;
|
21526 |
|
21527 | var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
21528 | _ref17$preferUnionId = _ref17.preferUnionId,
|
21529 | preferUnionId = _ref17$preferUnionId === void 0 ? false : _ref17$preferUnionId,
|
21530 | _ref17$unionIdPlatfor = _ref17.unionIdPlatform,
|
21531 | unionIdPlatform = _ref17$unionIdPlatfor === void 0 ? 'qq' : _ref17$unionIdPlatfor,
|
21532 | _ref17$asMainAccount = _ref17.asMainAccount,
|
21533 | asMainAccount = _ref17$asMainAccount === void 0 ? true : _ref17$asMainAccount,
|
21534 | _ref17$failOnNotExist = _ref17.failOnNotExist,
|
21535 | failOnNotExist = _ref17$failOnNotExist === void 0 ? false : _ref17$failOnNotExist,
|
21536 | useMasterKey = _ref17.useMasterKey,
|
21537 | sessionToken = _ref17.sessionToken,
|
21538 | user = _ref17.user;
|
21539 |
|
21540 | var getAuthInfo = getAdapter('getAuthInfo');
|
21541 | return getAuthInfo({
|
21542 | preferUnionId: preferUnionId,
|
21543 | asMainAccount: asMainAccount,
|
21544 | platform: unionIdPlatform
|
21545 | }).then(function (authInfo) {
|
21546 | authInfo.provider = PLATFORM_QQAPP;
|
21547 | return _this17.loginWithMiniApp(authInfo, {
|
21548 | failOnNotExist: failOnNotExist,
|
21549 | useMasterKey: useMasterKey,
|
21550 | sessionToken: sessionToken,
|
21551 | user: user
|
21552 | });
|
21553 | });
|
21554 | },
|
21555 |
|
21556 | |
21557 |
|
21558 |
|
21559 |
|
21560 |
|
21561 |
|
21562 |
|
21563 |
|
21564 |
|
21565 |
|
21566 |
|
21567 |
|
21568 | loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
|
21569 | var _this18 = this;
|
21570 |
|
21571 | var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
21572 | _ref18$unionIdPlatfor = _ref18.unionIdPlatform,
|
21573 | unionIdPlatform = _ref18$unionIdPlatfor === void 0 ? 'qq' : _ref18$unionIdPlatfor,
|
21574 | _ref18$asMainAccount = _ref18.asMainAccount,
|
21575 | asMainAccount = _ref18$asMainAccount === void 0 ? false : _ref18$asMainAccount,
|
21576 | _ref18$failOnNotExist = _ref18.failOnNotExist,
|
21577 | failOnNotExist = _ref18$failOnNotExist === void 0 ? false : _ref18$failOnNotExist,
|
21578 | useMasterKey = _ref18.useMasterKey,
|
21579 | sessionToken = _ref18.sessionToken,
|
21580 | user = _ref18.user;
|
21581 |
|
21582 | var getAuthInfo = getAdapter('getAuthInfo');
|
21583 | return getAuthInfo({
|
21584 | platform: unionIdPlatform
|
21585 | }).then(function (authInfo) {
|
21586 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
21587 | asMainAccount: asMainAccount
|
21588 | });
|
21589 | authInfo.provider = PLATFORM_QQAPP;
|
21590 | return _this18.loginWithMiniApp(authInfo, {
|
21591 | failOnNotExist: failOnNotExist,
|
21592 | useMasterKey: useMasterKey,
|
21593 | sessionToken: sessionToken,
|
21594 | user: user
|
21595 | });
|
21596 | });
|
21597 | },
|
21598 |
|
21599 | |
21600 |
|
21601 |
|
21602 |
|
21603 |
|
21604 |
|
21605 | loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
|
21606 | var _this19 = this;
|
21607 |
|
21608 | if (authInfo === undefined) {
|
21609 | var getAuthInfo = getAdapter('getAuthInfo');
|
21610 | return getAuthInfo().then(function (authInfo) {
|
21611 | return _this19.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
21612 | });
|
21613 | }
|
21614 |
|
21615 | return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
21616 | },
|
21617 |
|
21618 | |
21619 |
|
21620 |
|
21621 | _genId: function _genId() {
|
21622 | return uuid();
|
21623 | },
|
21624 |
|
21625 | |
21626 |
|
21627 |
|
21628 |
|
21629 |
|
21630 |
|
21631 | loginAnonymously: function loginAnonymously() {
|
21632 | return this.loginWithAuthData({
|
21633 | id: AV.User._genId()
|
21634 | }, 'anonymous');
|
21635 | },
|
21636 | associateWithAuthData: function associateWithAuthData(userObj, platform, authData) {
|
21637 | console.warn('DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替');
|
21638 | return userObj._linkWith(platform, authData);
|
21639 | },
|
21640 |
|
21641 | |
21642 |
|
21643 |
|
21644 |
|
21645 |
|
21646 |
|
21647 | logOut: function logOut() {
|
21648 | if (AV._config.disableCurrentUser) {
|
21649 | 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');
|
21650 | return _promise.default.resolve(null);
|
21651 | }
|
21652 |
|
21653 | if (AV.User._currentUser !== null) {
|
21654 | AV.User._currentUser._logOutWithAll();
|
21655 |
|
21656 | AV.User._currentUser._isCurrentUser = false;
|
21657 | }
|
21658 |
|
21659 | AV.User._currentUserMatchesDisk = true;
|
21660 | AV.User._currentUser = null;
|
21661 | return AV.localStorage.removeItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function () {
|
21662 | return AV._refreshSubscriptionId();
|
21663 | });
|
21664 | },
|
21665 |
|
21666 | |
21667 |
|
21668 |
|
21669 |
|
21670 |
|
21671 |
|
21672 | followerQuery: function followerQuery(userObjectId) {
|
21673 | if (!userObjectId || !_.isString(userObjectId)) {
|
21674 | throw new Error('Invalid user object id.');
|
21675 | }
|
21676 |
|
21677 | var query = new AV.FriendShipQuery('_Follower');
|
21678 | query._friendshipTag = 'follower';
|
21679 | query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
|
21680 | return query;
|
21681 | },
|
21682 |
|
21683 | |
21684 |
|
21685 |
|
21686 |
|
21687 |
|
21688 |
|
21689 | followeeQuery: function followeeQuery(userObjectId) {
|
21690 | if (!userObjectId || !_.isString(userObjectId)) {
|
21691 | throw new Error('Invalid user object id.');
|
21692 | }
|
21693 |
|
21694 | var query = new AV.FriendShipQuery('_Followee');
|
21695 | query._friendshipTag = 'followee';
|
21696 | query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
|
21697 | return query;
|
21698 | },
|
21699 |
|
21700 | |
21701 |
|
21702 |
|
21703 |
|
21704 |
|
21705 |
|
21706 |
|
21707 |
|
21708 |
|
21709 | requestPasswordReset: function requestPasswordReset(email) {
|
21710 | var json = {
|
21711 | email: email
|
21712 | };
|
21713 | var request = AVRequest('requestPasswordReset', null, null, 'POST', json);
|
21714 | return request;
|
21715 | },
|
21716 |
|
21717 | |
21718 |
|
21719 |
|
21720 |
|
21721 |
|
21722 |
|
21723 |
|
21724 |
|
21725 |
|
21726 | requestEmailVerify: function requestEmailVerify(email) {
|
21727 | var json = {
|
21728 | email: email
|
21729 | };
|
21730 | var request = AVRequest('requestEmailVerify', null, null, 'POST', json);
|
21731 | return request;
|
21732 | },
|
21733 |
|
21734 | |
21735 |
|
21736 |
|
21737 |
|
21738 |
|
21739 |
|
21740 |
|
21741 |
|
21742 |
|
21743 |
|
21744 | requestMobilePhoneVerify: function requestMobilePhoneVerify(mobilePhoneNumber) {
|
21745 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
21746 | var data = {
|
21747 | mobilePhoneNumber: mobilePhoneNumber
|
21748 | };
|
21749 |
|
21750 | if (options.validateToken) {
|
21751 | data.validate_token = options.validateToken;
|
21752 | }
|
21753 |
|
21754 | var request = AVRequest('requestMobilePhoneVerify', null, null, 'POST', data, options);
|
21755 | return request;
|
21756 | },
|
21757 |
|
21758 | |
21759 |
|
21760 |
|
21761 |
|
21762 |
|
21763 |
|
21764 |
|
21765 |
|
21766 |
|
21767 |
|
21768 | requestPasswordResetBySmsCode: function requestPasswordResetBySmsCode(mobilePhoneNumber) {
|
21769 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
21770 | var data = {
|
21771 | mobilePhoneNumber: mobilePhoneNumber
|
21772 | };
|
21773 |
|
21774 | if (options.validateToken) {
|
21775 | data.validate_token = options.validateToken;
|
21776 | }
|
21777 |
|
21778 | var request = AVRequest('requestPasswordResetBySmsCode', null, null, 'POST', data, options);
|
21779 | return request;
|
21780 | },
|
21781 |
|
21782 | |
21783 |
|
21784 |
|
21785 |
|
21786 |
|
21787 |
|
21788 |
|
21789 |
|
21790 |
|
21791 |
|
21792 | requestChangePhoneNumber: function requestChangePhoneNumber(mobilePhoneNumber, ttl, options) {
|
21793 | var data = {
|
21794 | mobilePhoneNumber: mobilePhoneNumber
|
21795 | };
|
21796 |
|
21797 | if (ttl) {
|
21798 | data.ttl = options.ttl;
|
21799 | }
|
21800 |
|
21801 | if (options && options.validateToken) {
|
21802 | data.validate_token = options.validateToken;
|
21803 | }
|
21804 |
|
21805 | return AVRequest('requestChangePhoneNumber', null, null, 'POST', data, options);
|
21806 | },
|
21807 |
|
21808 | |
21809 |
|
21810 |
|
21811 |
|
21812 |
|
21813 |
|
21814 |
|
21815 |
|
21816 | changePhoneNumber: function changePhoneNumber(mobilePhoneNumber, code) {
|
21817 | var data = {
|
21818 | mobilePhoneNumber: mobilePhoneNumber,
|
21819 | code: code
|
21820 | };
|
21821 | return AVRequest('changePhoneNumber', null, null, 'POST', data);
|
21822 | },
|
21823 |
|
21824 | |
21825 |
|
21826 |
|
21827 |
|
21828 |
|
21829 |
|
21830 |
|
21831 |
|
21832 | resetPasswordBySmsCode: function resetPasswordBySmsCode(code, password) {
|
21833 | var json = {
|
21834 | password: password
|
21835 | };
|
21836 | var request = AVRequest('resetPasswordBySmsCode', null, code, 'PUT', json);
|
21837 | return request;
|
21838 | },
|
21839 |
|
21840 | |
21841 |
|
21842 |
|
21843 |
|
21844 |
|
21845 |
|
21846 |
|
21847 | verifyMobilePhone: function verifyMobilePhone(code) {
|
21848 | var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
|
21849 | return request;
|
21850 | },
|
21851 |
|
21852 | |
21853 |
|
21854 |
|
21855 |
|
21856 |
|
21857 |
|
21858 |
|
21859 |
|
21860 |
|
21861 |
|
21862 | requestLoginSmsCode: function requestLoginSmsCode(mobilePhoneNumber) {
|
21863 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
21864 | var data = {
|
21865 | mobilePhoneNumber: mobilePhoneNumber
|
21866 | };
|
21867 |
|
21868 | if (options.validateToken) {
|
21869 | data.validate_token = options.validateToken;
|
21870 | }
|
21871 |
|
21872 | var request = AVRequest('requestLoginSmsCode', null, null, 'POST', data, options);
|
21873 | return request;
|
21874 | },
|
21875 |
|
21876 | |
21877 |
|
21878 |
|
21879 |
|
21880 |
|
21881 | currentAsync: function currentAsync() {
|
21882 | if (AV._config.disableCurrentUser) {
|
21883 | 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');
|
21884 | return _promise.default.resolve(null);
|
21885 | }
|
21886 |
|
21887 | if (AV.User._currentUser) {
|
21888 | return _promise.default.resolve(AV.User._currentUser);
|
21889 | }
|
21890 |
|
21891 | if (AV.User._currentUserMatchesDisk) {
|
21892 | return _promise.default.resolve(AV.User._currentUser);
|
21893 | }
|
21894 |
|
21895 | return AV.localStorage.getItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function (userData) {
|
21896 | if (!userData) {
|
21897 | return null;
|
21898 | }
|
21899 |
|
21900 |
|
21901 | AV.User._currentUserMatchesDisk = true;
|
21902 | AV.User._currentUser = AV.Object._create('_User');
|
21903 | AV.User._currentUser._isCurrentUser = true;
|
21904 | var json = JSON.parse(userData);
|
21905 | AV.User._currentUser.id = json._id;
|
21906 | delete json._id;
|
21907 | AV.User._currentUser._sessionToken = json._sessionToken;
|
21908 | delete json._sessionToken;
|
21909 |
|
21910 | AV.User._currentUser._finishFetch(json);
|
21911 |
|
21912 |
|
21913 | AV.User._currentUser._synchronizeAllAuthData();
|
21914 |
|
21915 | AV.User._currentUser._refreshCache();
|
21916 |
|
21917 | AV.User._currentUser._opSetQueue = [{}];
|
21918 | return AV.User._currentUser;
|
21919 | });
|
21920 | },
|
21921 |
|
21922 | |
21923 |
|
21924 |
|
21925 |
|
21926 |
|
21927 | current: function current() {
|
21928 | if (AV._config.disableCurrentUser) {
|
21929 | 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');
|
21930 | return null;
|
21931 | }
|
21932 |
|
21933 | if (AV.localStorage.async) {
|
21934 | var error = new Error('Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.');
|
21935 | error.code = 'SYNC_API_NOT_AVAILABLE';
|
21936 | throw error;
|
21937 | }
|
21938 |
|
21939 | if (AV.User._currentUser) {
|
21940 | return AV.User._currentUser;
|
21941 | }
|
21942 |
|
21943 | if (AV.User._currentUserMatchesDisk) {
|
21944 | return AV.User._currentUser;
|
21945 | }
|
21946 |
|
21947 |
|
21948 | AV.User._currentUserMatchesDisk = true;
|
21949 | var userData = AV.localStorage.getItem(AV._getAVPath(AV.User._CURRENT_USER_KEY));
|
21950 |
|
21951 | if (!userData) {
|
21952 | return null;
|
21953 | }
|
21954 |
|
21955 | AV.User._currentUser = AV.Object._create('_User');
|
21956 | AV.User._currentUser._isCurrentUser = true;
|
21957 | var json = JSON.parse(userData);
|
21958 | AV.User._currentUser.id = json._id;
|
21959 | delete json._id;
|
21960 | AV.User._currentUser._sessionToken = json._sessionToken;
|
21961 | delete json._sessionToken;
|
21962 |
|
21963 | AV.User._currentUser._finishFetch(json);
|
21964 |
|
21965 |
|
21966 | AV.User._currentUser._synchronizeAllAuthData();
|
21967 |
|
21968 | AV.User._currentUser._refreshCache();
|
21969 |
|
21970 | AV.User._currentUser._opSetQueue = [{}];
|
21971 | return AV.User._currentUser;
|
21972 | },
|
21973 |
|
21974 | |
21975 |
|
21976 |
|
21977 |
|
21978 | _saveCurrentUser: function _saveCurrentUser(user) {
|
21979 | var promise;
|
21980 |
|
21981 | if (AV.User._currentUser !== user) {
|
21982 | promise = AV.User.logOut();
|
21983 | } else {
|
21984 | promise = _promise.default.resolve();
|
21985 | }
|
21986 |
|
21987 | return promise.then(function () {
|
21988 | user._isCurrentUser = true;
|
21989 | AV.User._currentUser = user;
|
21990 |
|
21991 | var json = user._toFullJSON();
|
21992 |
|
21993 | json._id = user.id;
|
21994 | json._sessionToken = user._sessionToken;
|
21995 | return AV.localStorage.setItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY), (0, _stringify.default)(json)).then(function () {
|
21996 | AV.User._currentUserMatchesDisk = true;
|
21997 | return AV._refreshSubscriptionId();
|
21998 | });
|
21999 | });
|
22000 | },
|
22001 | _registerAuthenticationProvider: function _registerAuthenticationProvider(provider) {
|
22002 | AV.User._authProviders[provider.getAuthType()] = provider;
|
22003 |
|
22004 | if (!AV._config.disableCurrentUser && AV.User.current()) {
|
22005 | AV.User.current()._synchronizeAuthData(provider.getAuthType());
|
22006 | }
|
22007 | },
|
22008 | _logInWith: function _logInWith(provider, authData, options) {
|
22009 | var user = AV.Object._create('_User');
|
22010 |
|
22011 | return user._linkWith(provider, authData, options);
|
22012 | }
|
22013 | });
|
22014 | };
|
22015 |
|
22016 | }),
|
22017 |
|
22018 | (function(module, exports, __webpack_require__) {
|
22019 |
|
22020 | var _Object$defineProperty = __webpack_require__(153);
|
22021 |
|
22022 | function _defineProperty(obj, key, value) {
|
22023 | if (key in obj) {
|
22024 | _Object$defineProperty(obj, key, {
|
22025 | value: value,
|
22026 | enumerable: true,
|
22027 | configurable: true,
|
22028 | writable: true
|
22029 | });
|
22030 | } else {
|
22031 | obj[key] = value;
|
22032 | }
|
22033 |
|
22034 | return obj;
|
22035 | }
|
22036 |
|
22037 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
22038 |
|
22039 | }),
|
22040 |
|
22041 | (function(module, exports, __webpack_require__) {
|
22042 |
|
22043 | "use strict";
|
22044 |
|
22045 |
|
22046 | var _interopRequireDefault = __webpack_require__(1);
|
22047 |
|
22048 | var _map = _interopRequireDefault(__webpack_require__(37));
|
22049 |
|
22050 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
22051 |
|
22052 | var _keys = _interopRequireDefault(__webpack_require__(62));
|
22053 |
|
22054 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
22055 |
|
22056 | var _find = _interopRequireDefault(__webpack_require__(96));
|
22057 |
|
22058 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
22059 |
|
22060 | var _ = __webpack_require__(3);
|
22061 |
|
22062 | var debug = __webpack_require__(63)('leancloud:query');
|
22063 |
|
22064 | var AVError = __webpack_require__(48);
|
22065 |
|
22066 | var _require = __webpack_require__(28),
|
22067 | _request = _require._request,
|
22068 | request = _require.request;
|
22069 |
|
22070 | var _require2 = __webpack_require__(32),
|
22071 | ensureArray = _require2.ensureArray,
|
22072 | transformFetchOptions = _require2.transformFetchOptions,
|
22073 | continueWhile = _require2.continueWhile;
|
22074 |
|
22075 | var requires = function requires(value, message) {
|
22076 | if (value === undefined) {
|
22077 | throw new Error(message);
|
22078 | }
|
22079 | };
|
22080 |
|
22081 |
|
22082 | module.exports = function (AV) {
|
22083 | |
22084 |
|
22085 |
|
22086 |
|
22087 |
|
22088 |
|
22089 |
|
22090 |
|
22091 |
|
22092 |
|
22093 |
|
22094 |
|
22095 |
|
22096 |
|
22097 |
|
22098 |
|
22099 |
|
22100 |
|
22101 |
|
22102 |
|
22103 |
|
22104 |
|
22105 |
|
22106 |
|
22107 |
|
22108 |
|
22109 |
|
22110 |
|
22111 |
|
22112 |
|
22113 |
|
22114 |
|
22115 |
|
22116 |
|
22117 |
|
22118 |
|
22119 |
|
22120 |
|
22121 |
|
22122 |
|
22123 |
|
22124 |
|
22125 |
|
22126 | AV.Query = function (objectClass) {
|
22127 | if (_.isString(objectClass)) {
|
22128 | objectClass = AV.Object._getSubclass(objectClass);
|
22129 | }
|
22130 |
|
22131 | this.objectClass = objectClass;
|
22132 | this.className = objectClass.prototype.className;
|
22133 | this._where = {};
|
22134 | this._include = [];
|
22135 | this._select = [];
|
22136 | this._limit = -1;
|
22137 |
|
22138 | this._skip = 0;
|
22139 | this._defaultParams = {};
|
22140 | };
|
22141 | |
22142 |
|
22143 |
|
22144 |
|
22145 |
|
22146 |
|
22147 |
|
22148 |
|
22149 |
|
22150 |
|
22151 |
|
22152 |
|
22153 | AV.Query.or = function () {
|
22154 | var queries = _.toArray(arguments);
|
22155 |
|
22156 | var className = null;
|
22157 |
|
22158 | AV._arrayEach(queries, function (q) {
|
22159 | if (_.isNull(className)) {
|
22160 | className = q.className;
|
22161 | }
|
22162 |
|
22163 | if (className !== q.className) {
|
22164 | throw new Error('All queries must be for the same class');
|
22165 | }
|
22166 | });
|
22167 |
|
22168 | var query = new AV.Query(className);
|
22169 |
|
22170 | query._orQuery(queries);
|
22171 |
|
22172 | return query;
|
22173 | };
|
22174 | |
22175 |
|
22176 |
|
22177 |
|
22178 |
|
22179 |
|
22180 |
|
22181 |
|
22182 |
|
22183 |
|
22184 |
|
22185 |
|
22186 | AV.Query.and = function () {
|
22187 | var queries = _.toArray(arguments);
|
22188 |
|
22189 | var className = null;
|
22190 |
|
22191 | AV._arrayEach(queries, function (q) {
|
22192 | if (_.isNull(className)) {
|
22193 | className = q.className;
|
22194 | }
|
22195 |
|
22196 | if (className !== q.className) {
|
22197 | throw new Error('All queries must be for the same class');
|
22198 | }
|
22199 | });
|
22200 |
|
22201 | var query = new AV.Query(className);
|
22202 |
|
22203 | query._andQuery(queries);
|
22204 |
|
22205 | return query;
|
22206 | };
|
22207 | |
22208 |
|
22209 |
|
22210 |
|
22211 |
|
22212 |
|
22213 |
|
22214 |
|
22215 |
|
22216 |
|
22217 |
|
22218 |
|
22219 | AV.Query.doCloudQuery = function (cql, pvalues, options) {
|
22220 | var params = {
|
22221 | cql: cql
|
22222 | };
|
22223 |
|
22224 | if (_.isArray(pvalues)) {
|
22225 | params.pvalues = pvalues;
|
22226 | } else {
|
22227 | options = pvalues;
|
22228 | }
|
22229 |
|
22230 | var request = _request('cloudQuery', null, null, 'GET', params, options);
|
22231 |
|
22232 | return request.then(function (response) {
|
22233 |
|
22234 | var query = new AV.Query(response.className);
|
22235 | var results = (0, _map.default)(_).call(_, response.results, function (json) {
|
22236 | var obj = query._newObject(response);
|
22237 |
|
22238 | if (obj._finishFetch) {
|
22239 | obj._finishFetch(query._processResult(json), true);
|
22240 | }
|
22241 |
|
22242 | return obj;
|
22243 | });
|
22244 | return {
|
22245 | results: results,
|
22246 | count: response.count,
|
22247 | className: response.className
|
22248 | };
|
22249 | });
|
22250 | };
|
22251 | |
22252 |
|
22253 |
|
22254 |
|
22255 |
|
22256 |
|
22257 |
|
22258 |
|
22259 |
|
22260 | AV.Query.fromJSON = function (_ref) {
|
22261 | var className = _ref.className,
|
22262 | where = _ref.where,
|
22263 | include = _ref.include,
|
22264 | select = _ref.select,
|
22265 | includeACL = _ref.includeACL,
|
22266 | limit = _ref.limit,
|
22267 | skip = _ref.skip,
|
22268 | order = _ref.order;
|
22269 |
|
22270 | if (typeof className !== 'string') {
|
22271 | throw new TypeError('Invalid Query JSON, className must be a String.');
|
22272 | }
|
22273 |
|
22274 | var query = new AV.Query(className);
|
22275 |
|
22276 | _.extend(query, {
|
22277 | _where: where,
|
22278 | _include: include,
|
22279 | _select: select,
|
22280 | _includeACL: includeACL,
|
22281 | _limit: limit,
|
22282 | _skip: skip,
|
22283 | _order: order
|
22284 | });
|
22285 |
|
22286 | return query;
|
22287 | };
|
22288 |
|
22289 | AV.Query._extend = AV._extend;
|
22290 |
|
22291 | _.extend(AV.Query.prototype,
|
22292 |
|
22293 | {
|
22294 |
|
22295 | _processResult: function _processResult(obj) {
|
22296 | return obj;
|
22297 | },
|
22298 |
|
22299 | |
22300 |
|
22301 |
|
22302 |
|
22303 |
|
22304 |
|
22305 |
|
22306 |
|
22307 | get: function get(objectId, options) {
|
22308 | if (!_.isString(objectId)) {
|
22309 | throw new Error('objectId must be a string');
|
22310 | }
|
22311 |
|
22312 | if (objectId === '') {
|
22313 | return _promise.default.reject(new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.'));
|
22314 | }
|
22315 |
|
22316 | var obj = this._newObject();
|
22317 |
|
22318 | obj.id = objectId;
|
22319 |
|
22320 | var queryJSON = this._getParams();
|
22321 |
|
22322 | var fetchOptions = {};
|
22323 | if ((0, _keys.default)(queryJSON)) fetchOptions.keys = (0, _keys.default)(queryJSON);
|
22324 | if (queryJSON.include) fetchOptions.include = queryJSON.include;
|
22325 | if (queryJSON.includeACL) fetchOptions.includeACL = queryJSON.includeACL;
|
22326 | return _request('classes', this.className, objectId, 'GET', transformFetchOptions(fetchOptions), options).then(function (response) {
|
22327 | if (_.isEmpty(response)) throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
|
22328 |
|
22329 | obj._finishFetch(obj.parse(response), true);
|
22330 |
|
22331 | return obj;
|
22332 | });
|
22333 | },
|
22334 |
|
22335 | |
22336 |
|
22337 |
|
22338 |
|
22339 | toJSON: function toJSON() {
|
22340 | var className = this.className,
|
22341 | where = this._where,
|
22342 | include = this._include,
|
22343 | select = this._select,
|
22344 | includeACL = this._includeACL,
|
22345 | limit = this._limit,
|
22346 | skip = this._skip,
|
22347 | order = this._order;
|
22348 | return {
|
22349 | className: className,
|
22350 | where: where,
|
22351 | include: include,
|
22352 | select: select,
|
22353 | includeACL: includeACL,
|
22354 | limit: limit,
|
22355 | skip: skip,
|
22356 | order: order
|
22357 | };
|
22358 | },
|
22359 | _getParams: function _getParams() {
|
22360 | var params = _.extend({}, this._defaultParams, {
|
22361 | where: this._where
|
22362 | });
|
22363 |
|
22364 | if (this._include.length > 0) {
|
22365 | params.include = this._include.join(',');
|
22366 | }
|
22367 |
|
22368 | if (this._select.length > 0) {
|
22369 | params.keys = this._select.join(',');
|
22370 | }
|
22371 |
|
22372 | if (this._includeACL !== undefined) {
|
22373 | params.returnACL = this._includeACL;
|
22374 | }
|
22375 |
|
22376 | if (this._limit >= 0) {
|
22377 | params.limit = this._limit;
|
22378 | }
|
22379 |
|
22380 | if (this._skip > 0) {
|
22381 | params.skip = this._skip;
|
22382 | }
|
22383 |
|
22384 | if (this._order !== undefined) {
|
22385 | params.order = this._order;
|
22386 | }
|
22387 |
|
22388 | return params;
|
22389 | },
|
22390 | _newObject: function _newObject(response) {
|
22391 | var obj;
|
22392 |
|
22393 | if (response && response.className) {
|
22394 | obj = new AV.Object(response.className);
|
22395 | } else {
|
22396 | obj = new this.objectClass();
|
22397 | }
|
22398 |
|
22399 | return obj;
|
22400 | },
|
22401 | _createRequest: function _createRequest() {
|
22402 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getParams();
|
22403 | var options = arguments.length > 1 ? arguments[1] : undefined;
|
22404 | var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "/classes/".concat(this.className);
|
22405 |
|
22406 | if (encodeURIComponent((0, _stringify.default)(params)).length > 2000) {
|
22407 | var body = {
|
22408 | requests: [{
|
22409 | method: 'GET',
|
22410 | path: "/1.1".concat(path),
|
22411 | params: params
|
22412 | }]
|
22413 | };
|
22414 | return request({
|
22415 | path: '/batch',
|
22416 | method: 'POST',
|
22417 | data: body,
|
22418 | authOptions: options
|
22419 | }).then(function (response) {
|
22420 | var result = response[0];
|
22421 |
|
22422 | if (result.success) {
|
22423 | return result.success;
|
22424 | }
|
22425 |
|
22426 | var error = new AVError(result.error.code, result.error.error || 'Unknown batch error');
|
22427 | throw error;
|
22428 | });
|
22429 | }
|
22430 |
|
22431 | return request({
|
22432 | method: 'GET',
|
22433 | path: path,
|
22434 | query: params,
|
22435 | authOptions: options
|
22436 | });
|
22437 | },
|
22438 | _parseResponse: function _parseResponse(response) {
|
22439 | var _this = this;
|
22440 |
|
22441 | return (0, _map.default)(_).call(_, response.results, function (json) {
|
22442 | var obj = _this._newObject(response);
|
22443 |
|
22444 | if (obj._finishFetch) {
|
22445 | obj._finishFetch(_this._processResult(json), true);
|
22446 | }
|
22447 |
|
22448 | return obj;
|
22449 | });
|
22450 | },
|
22451 |
|
22452 | |
22453 |
|
22454 |
|
22455 |
|
22456 |
|
22457 |
|
22458 |
|
22459 | find: function find(options) {
|
22460 | var request = this._createRequest(undefined, options);
|
22461 |
|
22462 | return request.then(this._parseResponse.bind(this));
|
22463 | },
|
22464 |
|
22465 | |
22466 |
|
22467 |
|
22468 |
|
22469 |
|
22470 |
|
22471 |
|
22472 | findAndCount: function findAndCount(options) {
|
22473 | var _this2 = this;
|
22474 |
|
22475 | var params = this._getParams();
|
22476 |
|
22477 | params.count = 1;
|
22478 |
|
22479 | var request = this._createRequest(params, options);
|
22480 |
|
22481 | return request.then(function (response) {
|
22482 | return [_this2._parseResponse(response), response.count];
|
22483 | });
|
22484 | },
|
22485 |
|
22486 | |
22487 |
|
22488 |
|
22489 |
|
22490 |
|
22491 |
|
22492 |
|
22493 |
|
22494 |
|
22495 |
|
22496 |
|
22497 |
|
22498 |
|
22499 |
|
22500 |
|
22501 |
|
22502 |
|
22503 |
|
22504 | scan: function scan() {
|
22505 | var _this3 = this;
|
22506 |
|
22507 | var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
22508 | orderedBy = _ref2.orderedBy,
|
22509 | batchSize = _ref2.batchSize;
|
22510 |
|
22511 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
22512 |
|
22513 | var condition = this._getParams();
|
22514 |
|
22515 | debug('scan %O', condition);
|
22516 |
|
22517 | if (condition.order) {
|
22518 | console.warn('The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan.');
|
22519 | delete condition.order;
|
22520 | }
|
22521 |
|
22522 | if (condition.skip) {
|
22523 | console.warn('The skip option of the query is ignored for Query#scan.');
|
22524 | delete condition.skip;
|
22525 | }
|
22526 |
|
22527 | if (condition.limit) {
|
22528 | console.warn('The limit option of the query is ignored for Query#scan.');
|
22529 | delete condition.limit;
|
22530 | }
|
22531 |
|
22532 | if (orderedBy) condition.scan_key = orderedBy;
|
22533 | if (batchSize) condition.limit = batchSize;
|
22534 | var cursor;
|
22535 | var remainResults = [];
|
22536 | return {
|
22537 | next: function next() {
|
22538 | if (remainResults.length) {
|
22539 | return _promise.default.resolve({
|
22540 | done: false,
|
22541 | value: remainResults.shift()
|
22542 | });
|
22543 | }
|
22544 |
|
22545 | if (cursor === null) {
|
22546 | return _promise.default.resolve({
|
22547 | done: true
|
22548 | });
|
22549 | }
|
22550 |
|
22551 | return _request('scan/classes', _this3.className, null, 'GET', cursor ? _.extend({}, condition, {
|
22552 | cursor: cursor
|
22553 | }) : condition, authOptions).then(function (response) {
|
22554 | cursor = response.cursor;
|
22555 |
|
22556 | if (response.results.length) {
|
22557 | var results = _this3._parseResponse(response);
|
22558 |
|
22559 | results.forEach(function (result) {
|
22560 | return remainResults.push(result);
|
22561 | });
|
22562 | }
|
22563 |
|
22564 | if (cursor === null && remainResults.length === 0) {
|
22565 | return {
|
22566 | done: true
|
22567 | };
|
22568 | }
|
22569 |
|
22570 | return {
|
22571 | done: false,
|
22572 | value: remainResults.shift()
|
22573 | };
|
22574 | });
|
22575 | }
|
22576 | };
|
22577 | },
|
22578 |
|
22579 | |
22580 |
|
22581 |
|
22582 |
|
22583 |
|
22584 |
|
22585 | destroyAll: function destroyAll(options) {
|
22586 | var self = this;
|
22587 | return (0, _find.default)(self).call(self, options).then(function (objects) {
|
22588 | return AV.Object.destroyAll(objects, options);
|
22589 | });
|
22590 | },
|
22591 |
|
22592 | |
22593 |
|
22594 |
|
22595 |
|
22596 |
|
22597 |
|
22598 |
|
22599 | count: function count(options) {
|
22600 | var params = this._getParams();
|
22601 |
|
22602 | params.limit = 0;
|
22603 | params.count = 1;
|
22604 |
|
22605 | var request = this._createRequest(params, options);
|
22606 |
|
22607 | return request.then(function (response) {
|
22608 | return response.count;
|
22609 | });
|
22610 | },
|
22611 |
|
22612 | |
22613 |
|
22614 |
|
22615 |
|
22616 |
|
22617 |
|
22618 |
|
22619 | first: function first(options) {
|
22620 | var self = this;
|
22621 |
|
22622 | var params = this._getParams();
|
22623 |
|
22624 | params.limit = 1;
|
22625 |
|
22626 | var request = this._createRequest(params, options);
|
22627 |
|
22628 | return request.then(function (response) {
|
22629 | return (0, _map.default)(_).call(_, response.results, function (json) {
|
22630 | var obj = self._newObject();
|
22631 |
|
22632 | if (obj._finishFetch) {
|
22633 | obj._finishFetch(self._processResult(json), true);
|
22634 | }
|
22635 |
|
22636 | return obj;
|
22637 | })[0];
|
22638 | });
|
22639 | },
|
22640 |
|
22641 | |
22642 |
|
22643 |
|
22644 |
|
22645 |
|
22646 |
|
22647 |
|
22648 | skip: function skip(n) {
|
22649 | requires(n, 'undefined is not a valid skip value');
|
22650 | this._skip = n;
|
22651 | return this;
|
22652 | },
|
22653 |
|
22654 | |
22655 |
|
22656 |
|
22657 |
|
22658 |
|
22659 |
|
22660 | limit: function limit(n) {
|
22661 | requires(n, 'undefined is not a valid limit value');
|
22662 | this._limit = n;
|
22663 | return this;
|
22664 | },
|
22665 |
|
22666 | |
22667 |
|
22668 |
|
22669 |
|
22670 |
|
22671 |
|
22672 |
|
22673 | equalTo: function equalTo(key, value) {
|
22674 | requires(key, 'undefined is not a valid key');
|
22675 | requires(value, 'undefined is not a valid value');
|
22676 | this._where[key] = AV._encode(value);
|
22677 | return this;
|
22678 | },
|
22679 |
|
22680 | |
22681 |
|
22682 |
|
22683 |
|
22684 | _addCondition: function _addCondition(key, condition, value) {
|
22685 | requires(key, 'undefined is not a valid condition key');
|
22686 | requires(condition, 'undefined is not a valid condition');
|
22687 | requires(value, 'undefined is not a valid condition value');
|
22688 |
|
22689 | if (!this._where[key]) {
|
22690 | this._where[key] = {};
|
22691 | }
|
22692 |
|
22693 | this._where[key][condition] = AV._encode(value);
|
22694 | return this;
|
22695 | },
|
22696 |
|
22697 | |
22698 |
|
22699 |
|
22700 |
|
22701 |
|
22702 |
|
22703 |
|
22704 | sizeEqualTo: function sizeEqualTo(key, value) {
|
22705 | this._addCondition(key, '$size', value);
|
22706 |
|
22707 | return this;
|
22708 | },
|
22709 |
|
22710 | |
22711 |
|
22712 |
|
22713 |
|
22714 |
|
22715 |
|
22716 |
|
22717 | notEqualTo: function notEqualTo(key, value) {
|
22718 | this._addCondition(key, '$ne', value);
|
22719 |
|
22720 | return this;
|
22721 | },
|
22722 |
|
22723 | |
22724 |
|
22725 |
|
22726 |
|
22727 |
|
22728 |
|
22729 |
|
22730 | lessThan: function lessThan(key, value) {
|
22731 | this._addCondition(key, '$lt', value);
|
22732 |
|
22733 | return this;
|
22734 | },
|
22735 |
|
22736 | |
22737 |
|
22738 |
|
22739 |
|
22740 |
|
22741 |
|
22742 |
|
22743 | greaterThan: function greaterThan(key, value) {
|
22744 | this._addCondition(key, '$gt', value);
|
22745 |
|
22746 | return this;
|
22747 | },
|
22748 |
|
22749 | |
22750 |
|
22751 |
|
22752 |
|
22753 |
|
22754 |
|
22755 |
|
22756 | lessThanOrEqualTo: function lessThanOrEqualTo(key, value) {
|
22757 | this._addCondition(key, '$lte', value);
|
22758 |
|
22759 | return this;
|
22760 | },
|
22761 |
|
22762 | |
22763 |
|
22764 |
|
22765 |
|
22766 |
|
22767 |
|
22768 |
|
22769 | greaterThanOrEqualTo: function greaterThanOrEqualTo(key, value) {
|
22770 | this._addCondition(key, '$gte', value);
|
22771 |
|
22772 | return this;
|
22773 | },
|
22774 |
|
22775 | |
22776 |
|
22777 |
|
22778 |
|
22779 |
|
22780 |
|
22781 |
|
22782 | containedIn: function containedIn(key, values) {
|
22783 | this._addCondition(key, '$in', values);
|
22784 |
|
22785 | return this;
|
22786 | },
|
22787 |
|
22788 | |
22789 |
|
22790 |
|
22791 |
|
22792 |
|
22793 |
|
22794 |
|
22795 | notContainedIn: function notContainedIn(key, values) {
|
22796 | this._addCondition(key, '$nin', values);
|
22797 |
|
22798 | return this;
|
22799 | },
|
22800 |
|
22801 | |
22802 |
|
22803 |
|
22804 |
|
22805 |
|
22806 |
|
22807 |
|
22808 | containsAll: function containsAll(key, values) {
|
22809 | this._addCondition(key, '$all', values);
|
22810 |
|
22811 | return this;
|
22812 | },
|
22813 |
|
22814 | |
22815 |
|
22816 |
|
22817 |
|
22818 |
|
22819 | exists: function exists(key) {
|
22820 | this._addCondition(key, '$exists', true);
|
22821 |
|
22822 | return this;
|
22823 | },
|
22824 |
|
22825 | |
22826 |
|
22827 |
|
22828 |
|
22829 |
|
22830 | doesNotExist: function doesNotExist(key) {
|
22831 | this._addCondition(key, '$exists', false);
|
22832 |
|
22833 | return this;
|
22834 | },
|
22835 |
|
22836 | |
22837 |
|
22838 |
|
22839 |
|
22840 |
|
22841 |
|
22842 |
|
22843 |
|
22844 | matches: function matches(key, regex, modifiers) {
|
22845 | this._addCondition(key, '$regex', regex);
|
22846 |
|
22847 | if (!modifiers) {
|
22848 | modifiers = '';
|
22849 | }
|
22850 |
|
22851 |
|
22852 |
|
22853 |
|
22854 | if (regex.ignoreCase) {
|
22855 | modifiers += 'i';
|
22856 | }
|
22857 |
|
22858 | if (regex.multiline) {
|
22859 | modifiers += 'm';
|
22860 | }
|
22861 |
|
22862 | if (modifiers && modifiers.length) {
|
22863 | this._addCondition(key, '$options', modifiers);
|
22864 | }
|
22865 |
|
22866 | return this;
|
22867 | },
|
22868 |
|
22869 | |
22870 |
|
22871 |
|
22872 |
|
22873 |
|
22874 |
|
22875 |
|
22876 |
|
22877 | matchesQuery: function matchesQuery(key, query) {
|
22878 | var queryJSON = query._getParams();
|
22879 |
|
22880 | queryJSON.className = query.className;
|
22881 |
|
22882 | this._addCondition(key, '$inQuery', queryJSON);
|
22883 |
|
22884 | return this;
|
22885 | },
|
22886 |
|
22887 | |
22888 |
|
22889 |
|
22890 |
|
22891 |
|
22892 |
|
22893 |
|
22894 |
|
22895 | doesNotMatchQuery: function doesNotMatchQuery(key, query) {
|
22896 | var queryJSON = query._getParams();
|
22897 |
|
22898 | queryJSON.className = query.className;
|
22899 |
|
22900 | this._addCondition(key, '$notInQuery', queryJSON);
|
22901 |
|
22902 | return this;
|
22903 | },
|
22904 |
|
22905 | |
22906 |
|
22907 |
|
22908 |
|
22909 |
|
22910 |
|
22911 |
|
22912 |
|
22913 |
|
22914 |
|
22915 | matchesKeyInQuery: function matchesKeyInQuery(key, queryKey, query) {
|
22916 | var queryJSON = query._getParams();
|
22917 |
|
22918 | queryJSON.className = query.className;
|
22919 |
|
22920 | this._addCondition(key, '$select', {
|
22921 | key: queryKey,
|
22922 | query: queryJSON
|
22923 | });
|
22924 |
|
22925 | return this;
|
22926 | },
|
22927 |
|
22928 | |
22929 |
|
22930 |
|
22931 |
|
22932 |
|
22933 |
|
22934 |
|
22935 |
|
22936 |
|
22937 |
|
22938 | doesNotMatchKeyInQuery: function doesNotMatchKeyInQuery(key, queryKey, query) {
|
22939 | var queryJSON = query._getParams();
|
22940 |
|
22941 | queryJSON.className = query.className;
|
22942 |
|
22943 | this._addCondition(key, '$dontSelect', {
|
22944 | key: queryKey,
|
22945 | query: queryJSON
|
22946 | });
|
22947 |
|
22948 | return this;
|
22949 | },
|
22950 |
|
22951 | |
22952 |
|
22953 |
|
22954 |
|
22955 |
|
22956 |
|
22957 | _orQuery: function _orQuery(queries) {
|
22958 | var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
|
22959 | return q._getParams().where;
|
22960 | });
|
22961 | this._where.$or = queryJSON;
|
22962 | return this;
|
22963 | },
|
22964 |
|
22965 | |
22966 |
|
22967 |
|
22968 |
|
22969 |
|
22970 |
|
22971 | _andQuery: function _andQuery(queries) {
|
22972 | var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
|
22973 | return q._getParams().where;
|
22974 | });
|
22975 | this._where.$and = queryJSON;
|
22976 | return this;
|
22977 | },
|
22978 |
|
22979 | |
22980 |
|
22981 |
|
22982 |
|
22983 |
|
22984 |
|
22985 | _quote: function _quote(s) {
|
22986 | return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
|
22987 | },
|
22988 |
|
22989 | |
22990 |
|
22991 |
|
22992 |
|
22993 |
|
22994 |
|
22995 |
|
22996 | contains: function contains(key, value) {
|
22997 | this._addCondition(key, '$regex', this._quote(value));
|
22998 |
|
22999 | return this;
|
23000 | },
|
23001 |
|
23002 | |
23003 |
|
23004 |
|
23005 |
|
23006 |
|
23007 |
|
23008 |
|
23009 |
|
23010 | startsWith: function startsWith(key, value) {
|
23011 | this._addCondition(key, '$regex', '^' + this._quote(value));
|
23012 |
|
23013 | return this;
|
23014 | },
|
23015 |
|
23016 | |
23017 |
|
23018 |
|
23019 |
|
23020 |
|
23021 |
|
23022 |
|
23023 | endsWith: function endsWith(key, value) {
|
23024 | this._addCondition(key, '$regex', this._quote(value) + '$');
|
23025 |
|
23026 | return this;
|
23027 | },
|
23028 |
|
23029 | |
23030 |
|
23031 |
|
23032 |
|
23033 |
|
23034 |
|
23035 | ascending: function ascending(key) {
|
23036 | requires(key, 'undefined is not a valid key');
|
23037 | this._order = key;
|
23038 | return this;
|
23039 | },
|
23040 |
|
23041 | |
23042 |
|
23043 |
|
23044 |
|
23045 |
|
23046 |
|
23047 |
|
23048 | addAscending: function addAscending(key) {
|
23049 | requires(key, 'undefined is not a valid key');
|
23050 | if (this._order) this._order += ',' + key;else this._order = key;
|
23051 | return this;
|
23052 | },
|
23053 |
|
23054 | |
23055 |
|
23056 |
|
23057 |
|
23058 |
|
23059 |
|
23060 | descending: function descending(key) {
|
23061 | requires(key, 'undefined is not a valid key');
|
23062 | this._order = '-' + key;
|
23063 | return this;
|
23064 | },
|
23065 |
|
23066 | |
23067 |
|
23068 |
|
23069 |
|
23070 |
|
23071 |
|
23072 |
|
23073 | addDescending: function addDescending(key) {
|
23074 | requires(key, 'undefined is not a valid key');
|
23075 | if (this._order) this._order += ',-' + key;else this._order = '-' + key;
|
23076 | return this;
|
23077 | },
|
23078 |
|
23079 | |
23080 |
|
23081 |
|
23082 |
|
23083 |
|
23084 |
|
23085 |
|
23086 | near: function near(key, point) {
|
23087 | if (!(point instanceof AV.GeoPoint)) {
|
23088 |
|
23089 | point = new AV.GeoPoint(point);
|
23090 | }
|
23091 |
|
23092 | this._addCondition(key, '$nearSphere', point);
|
23093 |
|
23094 | return this;
|
23095 | },
|
23096 |
|
23097 | |
23098 |
|
23099 |
|
23100 |
|
23101 |
|
23102 |
|
23103 |
|
23104 |
|
23105 | withinRadians: function withinRadians(key, point, distance) {
|
23106 | this.near(key, point);
|
23107 |
|
23108 | this._addCondition(key, '$maxDistance', distance);
|
23109 |
|
23110 | return this;
|
23111 | },
|
23112 |
|
23113 | |
23114 |
|
23115 |
|
23116 |
|
23117 |
|
23118 |
|
23119 |
|
23120 |
|
23121 |
|
23122 |
|
23123 | withinMiles: function withinMiles(key, point, distance) {
|
23124 | return this.withinRadians(key, point, distance / 3958.8);
|
23125 | },
|
23126 |
|
23127 | |
23128 |
|
23129 |
|
23130 |
|
23131 |
|
23132 |
|
23133 |
|
23134 |
|
23135 |
|
23136 |
|
23137 | withinKilometers: function withinKilometers(key, point, distance) {
|
23138 | return this.withinRadians(key, point, distance / 6371.0);
|
23139 | },
|
23140 |
|
23141 | |
23142 |
|
23143 |
|
23144 |
|
23145 |
|
23146 |
|
23147 |
|
23148 |
|
23149 |
|
23150 |
|
23151 |
|
23152 | withinGeoBox: function withinGeoBox(key, southwest, northeast) {
|
23153 | if (!(southwest instanceof AV.GeoPoint)) {
|
23154 | southwest = new AV.GeoPoint(southwest);
|
23155 | }
|
23156 |
|
23157 | if (!(northeast instanceof AV.GeoPoint)) {
|
23158 | northeast = new AV.GeoPoint(northeast);
|
23159 | }
|
23160 |
|
23161 | this._addCondition(key, '$within', {
|
23162 | $box: [southwest, northeast]
|
23163 | });
|
23164 |
|
23165 | return this;
|
23166 | },
|
23167 |
|
23168 | |
23169 |
|
23170 |
|
23171 |
|
23172 |
|
23173 |
|
23174 | include: function include(keys) {
|
23175 | var _this4 = this;
|
23176 |
|
23177 | requires(keys, 'undefined is not a valid key');
|
23178 |
|
23179 | _.forEach(arguments, function (keys) {
|
23180 | var _context;
|
23181 |
|
23182 | _this4._include = (0, _concat.default)(_context = _this4._include).call(_context, ensureArray(keys));
|
23183 | });
|
23184 |
|
23185 | return this;
|
23186 | },
|
23187 |
|
23188 | |
23189 |
|
23190 |
|
23191 |
|
23192 |
|
23193 | includeACL: function includeACL() {
|
23194 | var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
23195 | this._includeACL = value;
|
23196 | return this;
|
23197 | },
|
23198 |
|
23199 | |
23200 |
|
23201 |
|
23202 |
|
23203 |
|
23204 |
|
23205 |
|
23206 | select: function select(keys) {
|
23207 | var _this5 = this;
|
23208 |
|
23209 | requires(keys, 'undefined is not a valid key');
|
23210 |
|
23211 | _.forEach(arguments, function (keys) {
|
23212 | var _context2;
|
23213 |
|
23214 | _this5._select = (0, _concat.default)(_context2 = _this5._select).call(_context2, ensureArray(keys));
|
23215 | });
|
23216 |
|
23217 | return this;
|
23218 | },
|
23219 |
|
23220 | |
23221 |
|
23222 |
|
23223 |
|
23224 |
|
23225 |
|
23226 |
|
23227 |
|
23228 |
|
23229 |
|
23230 |
|
23231 |
|
23232 | each: function each(callback) {
|
23233 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
23234 |
|
23235 | if (this._order || this._skip || this._limit >= 0) {
|
23236 | var error = new Error('Cannot iterate on a query with sort, skip, or limit.');
|
23237 | return _promise.default.reject(error);
|
23238 | }
|
23239 |
|
23240 | var query = new AV.Query(this.objectClass);
|
23241 |
|
23242 |
|
23243 | query._limit = options.batchSize || 100;
|
23244 | query._where = _.clone(this._where);
|
23245 | query._include = _.clone(this._include);
|
23246 | query.ascending('objectId');
|
23247 | var finished = false;
|
23248 | return continueWhile(function () {
|
23249 | return !finished;
|
23250 | }, function () {
|
23251 | return (0, _find.default)(query).call(query, options).then(function (results) {
|
23252 | var callbacksDone = _promise.default.resolve();
|
23253 |
|
23254 | _.each(results, function (result) {
|
23255 | callbacksDone = callbacksDone.then(function () {
|
23256 | return callback(result);
|
23257 | });
|
23258 | });
|
23259 |
|
23260 | return callbacksDone.then(function () {
|
23261 | if (results.length >= query._limit) {
|
23262 | query.greaterThan('objectId', results[results.length - 1].id);
|
23263 | } else {
|
23264 | finished = true;
|
23265 | }
|
23266 | });
|
23267 | });
|
23268 | });
|
23269 | },
|
23270 |
|
23271 | |
23272 |
|
23273 |
|
23274 |
|
23275 |
|
23276 |
|
23277 |
|
23278 |
|
23279 | subscribe: function subscribe(options) {
|
23280 | return AV.LiveQuery.init(this, options);
|
23281 | }
|
23282 | });
|
23283 |
|
23284 | AV.FriendShipQuery = AV.Query._extend({
|
23285 | _newObject: function _newObject() {
|
23286 | var UserClass = AV.Object._getSubclass('_User');
|
23287 |
|
23288 | return new UserClass();
|
23289 | },
|
23290 | _processResult: function _processResult(json) {
|
23291 | if (json && json[this._friendshipTag]) {
|
23292 | var user = json[this._friendshipTag];
|
23293 |
|
23294 | if (user.__type === 'Pointer' && user.className === '_User') {
|
23295 | delete user.__type;
|
23296 | delete user.className;
|
23297 | }
|
23298 |
|
23299 | return user;
|
23300 | } else {
|
23301 | return null;
|
23302 | }
|
23303 | }
|
23304 | });
|
23305 | };
|
23306 |
|
23307 | }),
|
23308 |
|
23309 | (function(module, exports, __webpack_require__) {
|
23310 |
|
23311 | "use strict";
|
23312 |
|
23313 |
|
23314 | var _interopRequireDefault = __webpack_require__(1);
|
23315 |
|
23316 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
23317 |
|
23318 | var _keys = _interopRequireDefault(__webpack_require__(62));
|
23319 |
|
23320 | var _ = __webpack_require__(3);
|
23321 |
|
23322 | var EventEmitter = __webpack_require__(234);
|
23323 |
|
23324 | var _require = __webpack_require__(32),
|
23325 | inherits = _require.inherits;
|
23326 |
|
23327 | var _require2 = __webpack_require__(28),
|
23328 | request = _require2.request;
|
23329 |
|
23330 | var subscribe = function subscribe(queryJSON, subscriptionId) {
|
23331 | return request({
|
23332 | method: 'POST',
|
23333 | path: '/LiveQuery/subscribe',
|
23334 | data: {
|
23335 | query: queryJSON,
|
23336 | id: subscriptionId
|
23337 | }
|
23338 | });
|
23339 | };
|
23340 |
|
23341 | module.exports = function (AV) {
|
23342 | var requireRealtime = function requireRealtime() {
|
23343 | if (!AV._config.realtime) {
|
23344 | throw new Error('LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query');
|
23345 | }
|
23346 | };
|
23347 | |
23348 |
|
23349 |
|
23350 |
|
23351 |
|
23352 |
|
23353 |
|
23354 | AV.LiveQuery = inherits(EventEmitter,
|
23355 |
|
23356 | {
|
23357 | constructor: function constructor(id, client, queryJSON, subscriptionId) {
|
23358 | var _this = this;
|
23359 |
|
23360 | EventEmitter.apply(this);
|
23361 | this.id = id;
|
23362 | this._client = client;
|
23363 |
|
23364 | this._client.register(this);
|
23365 |
|
23366 | this._queryJSON = queryJSON;
|
23367 | this._subscriptionId = subscriptionId;
|
23368 | this._onMessage = this._dispatch.bind(this);
|
23369 |
|
23370 | this._onReconnect = function () {
|
23371 | subscribe(_this._queryJSON, _this._subscriptionId).catch(function (error) {
|
23372 | return console.error("LiveQuery resubscribe error: ".concat(error.message));
|
23373 | });
|
23374 | };
|
23375 |
|
23376 | client.on('message', this._onMessage);
|
23377 | client.on('reconnect', this._onReconnect);
|
23378 | },
|
23379 | _dispatch: function _dispatch(message) {
|
23380 | var _this2 = this;
|
23381 |
|
23382 | message.forEach(function (_ref) {
|
23383 | var op = _ref.op,
|
23384 | object = _ref.object,
|
23385 | queryId = _ref.query_id,
|
23386 | updatedKeys = _ref.updatedKeys;
|
23387 | if (queryId !== _this2.id) return;
|
23388 | var target = AV.parseJSON(_.extend({
|
23389 | __type: object.className === '_File' ? 'File' : 'Object'
|
23390 | }, object));
|
23391 |
|
23392 | if (updatedKeys) {
|
23393 | |
23394 |
|
23395 |
|
23396 |
|
23397 |
|
23398 |
|
23399 |
|
23400 | |
23401 |
|
23402 |
|
23403 |
|
23404 |
|
23405 |
|
23406 |
|
23407 | |
23408 |
|
23409 |
|
23410 |
|
23411 |
|
23412 |
|
23413 | _this2.emit(op, target, updatedKeys);
|
23414 | } else {
|
23415 | |
23416 |
|
23417 |
|
23418 |
|
23419 |
|
23420 |
|
23421 | |
23422 |
|
23423 |
|
23424 |
|
23425 |
|
23426 | _this2.emit(op, target);
|
23427 | }
|
23428 | });
|
23429 | },
|
23430 |
|
23431 | |
23432 |
|
23433 |
|
23434 |
|
23435 |
|
23436 | unsubscribe: function unsubscribe() {
|
23437 | var client = this._client;
|
23438 | client.off('message', this._onMessage);
|
23439 | client.off('reconnect', this._onReconnect);
|
23440 | client.deregister(this);
|
23441 | return request({
|
23442 | method: 'POST',
|
23443 | path: '/LiveQuery/unsubscribe',
|
23444 | data: {
|
23445 | id: client.id,
|
23446 | query_id: this.id
|
23447 | }
|
23448 | });
|
23449 | }
|
23450 | },
|
23451 |
|
23452 | {
|
23453 | init: function init(query) {
|
23454 | var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
23455 | _ref2$subscriptionId = _ref2.subscriptionId,
|
23456 | userDefinedSubscriptionId = _ref2$subscriptionId === void 0 ? AV._getSubscriptionId() : _ref2$subscriptionId;
|
23457 |
|
23458 | requireRealtime();
|
23459 | if (!(query instanceof AV.Query)) throw new TypeError('LiveQuery must be inited with a Query');
|
23460 | return _promise.default.resolve(userDefinedSubscriptionId).then(function (subscriptionId) {
|
23461 | return AV._config.realtime.createLiveQueryClient(subscriptionId).then(function (liveQueryClient) {
|
23462 | var _query$_getParams = query._getParams(),
|
23463 | where = _query$_getParams.where,
|
23464 | keys = (0, _keys.default)(_query$_getParams),
|
23465 | returnACL = _query$_getParams.returnACL;
|
23466 |
|
23467 | var queryJSON = {
|
23468 | where: where,
|
23469 | keys: keys,
|
23470 | returnACL: returnACL,
|
23471 | className: query.className
|
23472 | };
|
23473 | var promise = subscribe(queryJSON, subscriptionId).then(function (_ref3) {
|
23474 | var queryId = _ref3.query_id;
|
23475 | return new AV.LiveQuery(queryId, liveQueryClient, queryJSON, subscriptionId);
|
23476 | }).finally(function () {
|
23477 | liveQueryClient.deregister(promise);
|
23478 | });
|
23479 | liveQueryClient.register(promise);
|
23480 | return promise;
|
23481 | });
|
23482 | });
|
23483 | },
|
23484 |
|
23485 | |
23486 |
|
23487 |
|
23488 |
|
23489 |
|
23490 | pause: function pause() {
|
23491 | requireRealtime();
|
23492 | return AV._config.realtime.pause();
|
23493 | },
|
23494 |
|
23495 | |
23496 |
|
23497 |
|
23498 |
|
23499 |
|
23500 | resume: function resume() {
|
23501 | requireRealtime();
|
23502 | return AV._config.realtime.resume();
|
23503 | }
|
23504 | });
|
23505 | };
|
23506 |
|
23507 | }),
|
23508 |
|
23509 | (function(module, exports, __webpack_require__) {
|
23510 |
|
23511 | "use strict";
|
23512 |
|
23513 |
|
23514 | var _ = __webpack_require__(3);
|
23515 |
|
23516 | var _require = __webpack_require__(32),
|
23517 | tap = _require.tap;
|
23518 |
|
23519 | module.exports = function (AV) {
|
23520 | |
23521 |
|
23522 |
|
23523 |
|
23524 |
|
23525 |
|
23526 |
|
23527 |
|
23528 |
|
23529 |
|
23530 |
|
23531 |
|
23532 |
|
23533 |
|
23534 | AV.Captcha = function Captcha(options, authOptions) {
|
23535 | this._options = options;
|
23536 | this._authOptions = authOptions;
|
23537 | |
23538 |
|
23539 |
|
23540 |
|
23541 |
|
23542 | this.url = undefined;
|
23543 | |
23544 |
|
23545 |
|
23546 |
|
23547 |
|
23548 | this.captchaToken = undefined;
|
23549 | |
23550 |
|
23551 |
|
23552 |
|
23553 |
|
23554 | this.validateToken = undefined;
|
23555 | };
|
23556 | |
23557 |
|
23558 |
|
23559 |
|
23560 |
|
23561 |
|
23562 | AV.Captcha.prototype.refresh = function refresh() {
|
23563 | var _this = this;
|
23564 |
|
23565 | return AV.Cloud._requestCaptcha(this._options, this._authOptions).then(function (_ref) {
|
23566 | var captchaToken = _ref.captchaToken,
|
23567 | url = _ref.url;
|
23568 |
|
23569 | _.extend(_this, {
|
23570 | captchaToken: captchaToken,
|
23571 | url: url
|
23572 | });
|
23573 |
|
23574 | return url;
|
23575 | });
|
23576 | };
|
23577 | |
23578 |
|
23579 |
|
23580 |
|
23581 |
|
23582 |
|
23583 |
|
23584 | AV.Captcha.prototype.verify = function verify(code) {
|
23585 | var _this2 = this;
|
23586 |
|
23587 | return AV.Cloud.verifyCaptcha(code, this.captchaToken).then(tap(function (validateToken) {
|
23588 | return _this2.validateToken = validateToken;
|
23589 | }));
|
23590 | };
|
23591 |
|
23592 | if (true) {
|
23593 | |
23594 |
|
23595 |
|
23596 |
|
23597 |
|
23598 |
|
23599 |
|
23600 |
|
23601 |
|
23602 |
|
23603 | AV.Captcha.prototype.bind = function bind(_ref2, _ref3) {
|
23604 | var _this3 = this;
|
23605 |
|
23606 | var textInput = _ref2.textInput,
|
23607 | image = _ref2.image,
|
23608 | verifyButton = _ref2.verifyButton;
|
23609 | var success = _ref3.success,
|
23610 | error = _ref3.error;
|
23611 |
|
23612 | if (typeof textInput === 'string') {
|
23613 | textInput = document.getElementById(textInput);
|
23614 | if (!textInput) throw new Error("textInput with id ".concat(textInput, " not found"));
|
23615 | }
|
23616 |
|
23617 | if (typeof image === 'string') {
|
23618 | image = document.getElementById(image);
|
23619 | if (!image) throw new Error("image with id ".concat(image, " not found"));
|
23620 | }
|
23621 |
|
23622 | if (typeof verifyButton === 'string') {
|
23623 | verifyButton = document.getElementById(verifyButton);
|
23624 | if (!verifyButton) throw new Error("verifyButton with id ".concat(verifyButton, " not found"));
|
23625 | }
|
23626 |
|
23627 | this.__refresh = function () {
|
23628 | return _this3.refresh().then(function (url) {
|
23629 | image.src = url;
|
23630 |
|
23631 | if (textInput) {
|
23632 | textInput.value = '';
|
23633 | textInput.focus();
|
23634 | }
|
23635 | }).catch(function (err) {
|
23636 | return console.warn("refresh captcha fail: ".concat(err.message));
|
23637 | });
|
23638 | };
|
23639 |
|
23640 | if (image) {
|
23641 | this.__image = image;
|
23642 | image.src = this.url;
|
23643 | image.addEventListener('click', this.__refresh);
|
23644 | }
|
23645 |
|
23646 | this.__verify = function () {
|
23647 | var code = textInput.value;
|
23648 |
|
23649 | _this3.verify(code).catch(function (err) {
|
23650 | _this3.__refresh();
|
23651 |
|
23652 | throw err;
|
23653 | }).then(success, error).catch(function (err) {
|
23654 | return console.warn("verify captcha fail: ".concat(err.message));
|
23655 | });
|
23656 | };
|
23657 |
|
23658 | if (textInput && verifyButton) {
|
23659 | this.__verifyButton = verifyButton;
|
23660 | verifyButton.addEventListener('click', this.__verify);
|
23661 | }
|
23662 | };
|
23663 | |
23664 |
|
23665 |
|
23666 |
|
23667 |
|
23668 | AV.Captcha.prototype.unbind = function unbind() {
|
23669 | if (this.__image) this.__image.removeEventListener('click', this.__refresh);
|
23670 | if (this.__verifyButton) this.__verifyButton.removeEventListener('click', this.__verify);
|
23671 | };
|
23672 | }
|
23673 | |
23674 |
|
23675 |
|
23676 |
|
23677 |
|
23678 |
|
23679 |
|
23680 |
|
23681 |
|
23682 |
|
23683 |
|
23684 | AV.Captcha.request = function (options, authOptions) {
|
23685 | var captcha = new AV.Captcha(options, authOptions);
|
23686 | return captcha.refresh().then(function () {
|
23687 | return captcha;
|
23688 | });
|
23689 | };
|
23690 | };
|
23691 |
|
23692 | }),
|
23693 |
|
23694 | (function(module, exports, __webpack_require__) {
|
23695 |
|
23696 | "use strict";
|
23697 |
|
23698 |
|
23699 | var _interopRequireDefault = __webpack_require__(1);
|
23700 |
|
23701 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
23702 |
|
23703 | var _ = __webpack_require__(3);
|
23704 |
|
23705 | var _require = __webpack_require__(28),
|
23706 | _request = _require._request,
|
23707 | request = _require.request;
|
23708 |
|
23709 | module.exports = function (AV) {
|
23710 | |
23711 |
|
23712 |
|
23713 |
|
23714 |
|
23715 |
|
23716 |
|
23717 |
|
23718 |
|
23719 | AV.Cloud = AV.Cloud || {};
|
23720 |
|
23721 | _.extend(AV.Cloud,
|
23722 |
|
23723 | {
|
23724 | |
23725 |
|
23726 |
|
23727 |
|
23728 |
|
23729 |
|
23730 |
|
23731 |
|
23732 | run: function run(name, data, options) {
|
23733 | return request({
|
23734 | service: 'engine',
|
23735 | method: 'POST',
|
23736 | path: "/functions/".concat(name),
|
23737 | data: AV._encode(data, null, true),
|
23738 | authOptions: options
|
23739 | }).then(function (resp) {
|
23740 | return AV._decode(resp).result;
|
23741 | });
|
23742 | },
|
23743 |
|
23744 | |
23745 |
|
23746 |
|
23747 |
|
23748 |
|
23749 |
|
23750 |
|
23751 |
|
23752 | rpc: function rpc(name, data, options) {
|
23753 | if (_.isArray(data)) {
|
23754 | return _promise.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK."));
|
23755 | }
|
23756 |
|
23757 | return request({
|
23758 | service: 'engine',
|
23759 | method: 'POST',
|
23760 | path: "/call/".concat(name),
|
23761 | data: AV._encodeObjectOrArray(data),
|
23762 | authOptions: options
|
23763 | }).then(function (resp) {
|
23764 | return AV._decode(resp).result;
|
23765 | });
|
23766 | },
|
23767 |
|
23768 | |
23769 |
|
23770 |
|
23771 |
|
23772 |
|
23773 |
|
23774 | getServerDate: function getServerDate() {
|
23775 | return _request('date', null, null, 'GET').then(function (resp) {
|
23776 | return AV._decode(resp);
|
23777 | });
|
23778 | },
|
23779 |
|
23780 | |
23781 |
|
23782 |
|
23783 |
|
23784 |
|
23785 |
|
23786 |
|
23787 |
|
23788 |
|
23789 |
|
23790 |
|
23791 | requestSmsCode: function requestSmsCode(data) {
|
23792 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
23793 |
|
23794 | if (_.isString(data)) {
|
23795 | data = {
|
23796 | mobilePhoneNumber: data
|
23797 | };
|
23798 | }
|
23799 |
|
23800 | if (!data.mobilePhoneNumber) {
|
23801 | throw new Error('Missing mobilePhoneNumber.');
|
23802 | }
|
23803 |
|
23804 | if (options.validateToken) {
|
23805 | data = _.extend({}, data, {
|
23806 | validate_token: options.validateToken
|
23807 | });
|
23808 | }
|
23809 |
|
23810 | return _request('requestSmsCode', null, null, 'POST', data, options);
|
23811 | },
|
23812 |
|
23813 | |
23814 |
|
23815 |
|
23816 |
|
23817 |
|
23818 |
|
23819 |
|
23820 | verifySmsCode: function verifySmsCode(code, phone) {
|
23821 | if (!code) throw new Error('Missing sms code.');
|
23822 | var params = {};
|
23823 |
|
23824 | if (_.isString(phone)) {
|
23825 | params['mobilePhoneNumber'] = phone;
|
23826 | }
|
23827 |
|
23828 | return _request('verifySmsCode', code, null, 'POST', params);
|
23829 | },
|
23830 | _requestCaptcha: function _requestCaptcha(options, authOptions) {
|
23831 | return _request('requestCaptcha', null, null, 'GET', options, authOptions).then(function (_ref) {
|
23832 | var url = _ref.captcha_url,
|
23833 | captchaToken = _ref.captcha_token;
|
23834 | return {
|
23835 | captchaToken: captchaToken,
|
23836 | url: url
|
23837 | };
|
23838 | });
|
23839 | },
|
23840 |
|
23841 | |
23842 |
|
23843 |
|
23844 | requestCaptcha: AV.Captcha.request,
|
23845 |
|
23846 | |
23847 |
|
23848 |
|
23849 |
|
23850 |
|
23851 |
|
23852 |
|
23853 | verifyCaptcha: function verifyCaptcha(code, captchaToken) {
|
23854 | return _request('verifyCaptcha', null, null, 'POST', {
|
23855 | captcha_code: code,
|
23856 | captcha_token: captchaToken
|
23857 | }).then(function (_ref2) {
|
23858 | var validateToken = _ref2.validate_token;
|
23859 | return validateToken;
|
23860 | });
|
23861 | }
|
23862 | });
|
23863 | };
|
23864 |
|
23865 | }),
|
23866 |
|
23867 | (function(module, exports, __webpack_require__) {
|
23868 |
|
23869 | "use strict";
|
23870 |
|
23871 |
|
23872 | var request = __webpack_require__(28).request;
|
23873 |
|
23874 | module.exports = function (AV) {
|
23875 | AV.Installation = AV.Object.extend('_Installation');
|
23876 | |
23877 |
|
23878 |
|
23879 |
|
23880 | AV.Push = AV.Push || {};
|
23881 | |
23882 |
|
23883 |
|
23884 |
|
23885 |
|
23886 |
|
23887 |
|
23888 |
|
23889 |
|
23890 |
|
23891 |
|
23892 |
|
23893 |
|
23894 |
|
23895 |
|
23896 |
|
23897 |
|
23898 |
|
23899 |
|
23900 | AV.Push.send = function (data, options) {
|
23901 | if (data.where) {
|
23902 | data.where = data.where._getParams().where;
|
23903 | }
|
23904 |
|
23905 | if (data.where && data.cql) {
|
23906 | throw new Error("Both where and cql can't be set");
|
23907 | }
|
23908 |
|
23909 | if (data.push_time) {
|
23910 | data.push_time = data.push_time.toJSON();
|
23911 | }
|
23912 |
|
23913 | if (data.expiration_time) {
|
23914 | data.expiration_time = data.expiration_time.toJSON();
|
23915 | }
|
23916 |
|
23917 | if (data.expiration_time && data.expiration_interval) {
|
23918 | throw new Error("Both expiration_time and expiration_interval can't be set");
|
23919 | }
|
23920 |
|
23921 | return request({
|
23922 | service: 'push',
|
23923 | method: 'POST',
|
23924 | path: '/push',
|
23925 | data: data,
|
23926 | authOptions: options
|
23927 | });
|
23928 | };
|
23929 | };
|
23930 |
|
23931 | }),
|
23932 |
|
23933 | (function(module, exports, __webpack_require__) {
|
23934 |
|
23935 | "use strict";
|
23936 |
|
23937 |
|
23938 | var _interopRequireDefault = __webpack_require__(1);
|
23939 |
|
23940 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
23941 |
|
23942 | var _typeof2 = _interopRequireDefault(__webpack_require__(95));
|
23943 |
|
23944 | var _ = __webpack_require__(3);
|
23945 |
|
23946 | var AVRequest = __webpack_require__(28)._request;
|
23947 |
|
23948 | var _require = __webpack_require__(32),
|
23949 | getSessionToken = _require.getSessionToken;
|
23950 |
|
23951 | module.exports = function (AV) {
|
23952 | var getUser = function getUser() {
|
23953 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
23954 | var sessionToken = getSessionToken(options);
|
23955 |
|
23956 | if (sessionToken) {
|
23957 | return AV.User._fetchUserBySessionToken(getSessionToken(options));
|
23958 | }
|
23959 |
|
23960 | return AV.User.currentAsync();
|
23961 | };
|
23962 |
|
23963 | var getUserPointer = function getUserPointer(options) {
|
23964 | return getUser(options).then(function (currUser) {
|
23965 | return AV.Object.createWithoutData('_User', currUser.id)._toPointer();
|
23966 | });
|
23967 | };
|
23968 | |
23969 |
|
23970 |
|
23971 |
|
23972 |
|
23973 |
|
23974 | AV.Status = function (imageUrl, message) {
|
23975 | this.data = {};
|
23976 | this.inboxType = 'default';
|
23977 | this.query = null;
|
23978 |
|
23979 | if (imageUrl && (0, _typeof2.default)(imageUrl) === 'object') {
|
23980 | this.data = imageUrl;
|
23981 | } else {
|
23982 | if (imageUrl) {
|
23983 | this.data.image = imageUrl;
|
23984 | }
|
23985 |
|
23986 | if (message) {
|
23987 | this.data.message = message;
|
23988 | }
|
23989 | }
|
23990 |
|
23991 | return this;
|
23992 | };
|
23993 |
|
23994 | _.extend(AV.Status.prototype,
|
23995 |
|
23996 | {
|
23997 | |
23998 |
|
23999 |
|
24000 |
|
24001 | get: function get(attr) {
|
24002 | return this.data[attr];
|
24003 | },
|
24004 |
|
24005 | |
24006 |
|
24007 |
|
24008 |
|
24009 |
|
24010 | set: function set(key, value) {
|
24011 | this.data[key] = value;
|
24012 | return this;
|
24013 | },
|
24014 |
|
24015 | |
24016 |
|
24017 |
|
24018 |
|
24019 |
|
24020 |
|
24021 | destroy: function destroy(options) {
|
24022 | if (!this.id) return _promise.default.reject(new Error('The status id is not exists.'));
|
24023 | var request = AVRequest('statuses', null, this.id, 'DELETE', options);
|
24024 | return request;
|
24025 | },
|
24026 |
|
24027 | |
24028 |
|
24029 |
|
24030 |
|
24031 | toObject: function toObject() {
|
24032 | if (!this.id) return null;
|
24033 | return AV.Object.createWithoutData('_Status', this.id);
|
24034 | },
|
24035 | _getDataJSON: function _getDataJSON() {
|
24036 | var json = _.clone(this.data);
|
24037 |
|
24038 | return AV._encode(json);
|
24039 | },
|
24040 |
|
24041 | |
24042 |
|
24043 |
|
24044 |
|
24045 |
|
24046 |
|
24047 |
|
24048 |
|
24049 |
|
24050 |
|
24051 |
|
24052 |
|
24053 |
|
24054 |
|
24055 |
|
24056 |
|
24057 |
|
24058 |
|
24059 | send: function send() {
|
24060 | var _this = this;
|
24061 |
|
24062 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
24063 |
|
24064 | if (!getSessionToken(options) && !AV.User.current()) {
|
24065 | throw new Error('Please signin an user.');
|
24066 | }
|
24067 |
|
24068 | if (!this.query) {
|
24069 | return AV.Status.sendStatusToFollowers(this, options);
|
24070 | }
|
24071 |
|
24072 | return getUserPointer(options).then(function (currUser) {
|
24073 | var query = _this.query._getParams();
|
24074 |
|
24075 | query.className = _this.query.className;
|
24076 | var data = {};
|
24077 | data.query = query;
|
24078 | _this.data = _this.data || {};
|
24079 | _this.data.source = _this.data.source || currUser;
|
24080 | data.data = _this._getDataJSON();
|
24081 | data.inboxType = _this.inboxType || 'default';
|
24082 | return AVRequest('statuses', null, null, 'POST', data, options);
|
24083 | }).then(function (response) {
|
24084 | _this.id = response.objectId;
|
24085 | _this.createdAt = AV._parseDate(response.createdAt);
|
24086 | return _this;
|
24087 | });
|
24088 | },
|
24089 | _finishFetch: function _finishFetch(serverData) {
|
24090 | this.id = serverData.objectId;
|
24091 | this.createdAt = AV._parseDate(serverData.createdAt);
|
24092 | this.updatedAt = AV._parseDate(serverData.updatedAt);
|
24093 | this.messageId = serverData.messageId;
|
24094 | delete serverData.messageId;
|
24095 | delete serverData.objectId;
|
24096 | delete serverData.createdAt;
|
24097 | delete serverData.updatedAt;
|
24098 | this.data = AV._decode(serverData);
|
24099 | }
|
24100 | });
|
24101 | |
24102 |
|
24103 |
|
24104 |
|
24105 |
|
24106 |
|
24107 |
|
24108 |
|
24109 |
|
24110 |
|
24111 |
|
24112 |
|
24113 |
|
24114 |
|
24115 |
|
24116 |
|
24117 |
|
24118 |
|
24119 | AV.Status.sendStatusToFollowers = function (status) {
|
24120 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
24121 |
|
24122 | if (!getSessionToken(options) && !AV.User.current()) {
|
24123 | throw new Error('Please signin an user.');
|
24124 | }
|
24125 |
|
24126 | return getUserPointer(options).then(function (currUser) {
|
24127 | var query = {};
|
24128 | query.className = '_Follower';
|
24129 | query.keys = 'follower';
|
24130 | query.where = {
|
24131 | user: currUser
|
24132 | };
|
24133 | var data = {};
|
24134 | data.query = query;
|
24135 | status.data = status.data || {};
|
24136 | status.data.source = status.data.source || currUser;
|
24137 | data.data = status._getDataJSON();
|
24138 | data.inboxType = status.inboxType || 'default';
|
24139 | var request = AVRequest('statuses', null, null, 'POST', data, options);
|
24140 | return request.then(function (response) {
|
24141 | status.id = response.objectId;
|
24142 | status.createdAt = AV._parseDate(response.createdAt);
|
24143 | return status;
|
24144 | });
|
24145 | });
|
24146 | };
|
24147 | |
24148 |
|
24149 |
|
24150 |
|
24151 |
|
24152 |
|
24153 |
|
24154 |
|
24155 |
|
24156 |
|
24157 |
|
24158 |
|
24159 |
|
24160 |
|
24161 |
|
24162 |
|
24163 |
|
24164 |
|
24165 |
|
24166 |
|
24167 | AV.Status.sendPrivateStatus = function (status, target) {
|
24168 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
24169 |
|
24170 | if (!getSessionToken(options) && !AV.User.current()) {
|
24171 | throw new Error('Please signin an user.');
|
24172 | }
|
24173 |
|
24174 | if (!target) {
|
24175 | throw new Error('Invalid target user.');
|
24176 | }
|
24177 |
|
24178 | var userObjectId = _.isString(target) ? target : target.id;
|
24179 |
|
24180 | if (!userObjectId) {
|
24181 | throw new Error('Invalid target user.');
|
24182 | }
|
24183 |
|
24184 | return getUserPointer(options).then(function (currUser) {
|
24185 | var query = {};
|
24186 | query.className = '_User';
|
24187 | query.where = {
|
24188 | objectId: userObjectId
|
24189 | };
|
24190 | var data = {};
|
24191 | data.query = query;
|
24192 | status.data = status.data || {};
|
24193 | status.data.source = status.data.source || currUser;
|
24194 | data.data = status._getDataJSON();
|
24195 | data.inboxType = 'private';
|
24196 | status.inboxType = 'private';
|
24197 | var request = AVRequest('statuses', null, null, 'POST', data, options);
|
24198 | return request.then(function (response) {
|
24199 | status.id = response.objectId;
|
24200 | status.createdAt = AV._parseDate(response.createdAt);
|
24201 | return status;
|
24202 | });
|
24203 | });
|
24204 | };
|
24205 | |
24206 |
|
24207 |
|
24208 |
|
24209 |
|
24210 |
|
24211 |
|
24212 |
|
24213 |
|
24214 |
|
24215 |
|
24216 |
|
24217 |
|
24218 |
|
24219 |
|
24220 |
|
24221 | AV.Status.countUnreadStatuses = function (owner) {
|
24222 | var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
24223 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
24224 | if (!_.isString(inboxType)) options = inboxType;
|
24225 |
|
24226 | if (!getSessionToken(options) && owner == null && !AV.User.current()) {
|
24227 | throw new Error('Please signin an user or pass the owner objectId.');
|
24228 | }
|
24229 |
|
24230 | return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
|
24231 | var params = {};
|
24232 | params.inboxType = AV._encode(inboxType);
|
24233 | params.owner = AV._encode(owner);
|
24234 | return AVRequest('subscribe/statuses/count', null, null, 'GET', params, options);
|
24235 | });
|
24236 | };
|
24237 | |
24238 |
|
24239 |
|
24240 |
|
24241 |
|
24242 |
|
24243 |
|
24244 |
|
24245 |
|
24246 |
|
24247 |
|
24248 |
|
24249 |
|
24250 |
|
24251 |
|
24252 |
|
24253 | AV.Status.resetUnreadCount = function (owner) {
|
24254 | var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
24255 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
24256 | if (!_.isString(inboxType)) options = inboxType;
|
24257 |
|
24258 | if (!getSessionToken(options) && owner == null && !AV.User.current()) {
|
24259 | throw new Error('Please signin an user or pass the owner objectId.');
|
24260 | }
|
24261 |
|
24262 | return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
|
24263 | var params = {};
|
24264 | params.inboxType = AV._encode(inboxType);
|
24265 | params.owner = AV._encode(owner);
|
24266 | return AVRequest('subscribe/statuses/resetUnreadCount', null, null, 'POST', params, options);
|
24267 | });
|
24268 | };
|
24269 | |
24270 |
|
24271 |
|
24272 |
|
24273 |
|
24274 |
|
24275 |
|
24276 |
|
24277 |
|
24278 |
|
24279 |
|
24280 |
|
24281 |
|
24282 |
|
24283 | AV.Status.statusQuery = function (source) {
|
24284 | var query = new AV.Query('_Status');
|
24285 |
|
24286 | if (source) {
|
24287 | query.equalTo('source', source);
|
24288 | }
|
24289 |
|
24290 | return query;
|
24291 | };
|
24292 | |
24293 |
|
24294 |
|
24295 |
|
24296 |
|
24297 |
|
24298 | AV.InboxQuery = AV.Query._extend(
|
24299 |
|
24300 | {
|
24301 | _objectClass: AV.Status,
|
24302 | _sinceId: 0,
|
24303 | _maxId: 0,
|
24304 | _inboxType: 'default',
|
24305 | _owner: null,
|
24306 | _newObject: function _newObject() {
|
24307 | return new AV.Status();
|
24308 | },
|
24309 | _createRequest: function _createRequest(params, options) {
|
24310 | return AV.InboxQuery.__super__._createRequest.call(this, params, options, '/subscribe/statuses');
|
24311 | },
|
24312 |
|
24313 | |
24314 |
|
24315 |
|
24316 |
|
24317 |
|
24318 |
|
24319 |
|
24320 | sinceId: function sinceId(id) {
|
24321 | this._sinceId = id;
|
24322 | return this;
|
24323 | },
|
24324 |
|
24325 | |
24326 |
|
24327 |
|
24328 |
|
24329 |
|
24330 |
|
24331 |
|
24332 | maxId: function maxId(id) {
|
24333 | this._maxId = id;
|
24334 | return this;
|
24335 | },
|
24336 |
|
24337 | |
24338 |
|
24339 |
|
24340 |
|
24341 |
|
24342 | owner: function owner(_owner) {
|
24343 | this._owner = _owner;
|
24344 | return this;
|
24345 | },
|
24346 |
|
24347 | |
24348 |
|
24349 |
|
24350 |
|
24351 |
|
24352 | inboxType: function inboxType(type) {
|
24353 | this._inboxType = type;
|
24354 | return this;
|
24355 | },
|
24356 | _getParams: function _getParams() {
|
24357 | var params = AV.InboxQuery.__super__._getParams.call(this);
|
24358 |
|
24359 | params.owner = AV._encode(this._owner);
|
24360 | params.inboxType = AV._encode(this._inboxType);
|
24361 | params.sinceId = AV._encode(this._sinceId);
|
24362 | params.maxId = AV._encode(this._maxId);
|
24363 | return params;
|
24364 | }
|
24365 | });
|
24366 | |
24367 |
|
24368 |
|
24369 |
|
24370 |
|
24371 |
|
24372 |
|
24373 |
|
24374 |
|
24375 |
|
24376 |
|
24377 |
|
24378 |
|
24379 |
|
24380 |
|
24381 |
|
24382 |
|
24383 | AV.Status.inboxQuery = function (owner, inboxType) {
|
24384 | var query = new AV.InboxQuery(AV.Status);
|
24385 |
|
24386 | if (owner) {
|
24387 | query._owner = owner;
|
24388 | }
|
24389 |
|
24390 | if (inboxType) {
|
24391 | query._inboxType = inboxType;
|
24392 | }
|
24393 |
|
24394 | return query;
|
24395 | };
|
24396 | };
|
24397 |
|
24398 | }),
|
24399 |
|
24400 | (function(module, exports, __webpack_require__) {
|
24401 |
|
24402 | "use strict";
|
24403 |
|
24404 |
|
24405 | var _interopRequireDefault = __webpack_require__(1);
|
24406 |
|
24407 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
24408 |
|
24409 | var _map = _interopRequireDefault(__webpack_require__(37));
|
24410 |
|
24411 | var _ = __webpack_require__(3);
|
24412 |
|
24413 | var AVRequest = __webpack_require__(28)._request;
|
24414 |
|
24415 | module.exports = function (AV) {
|
24416 | |
24417 |
|
24418 |
|
24419 |
|
24420 |
|
24421 |
|
24422 |
|
24423 |
|
24424 |
|
24425 |
|
24426 |
|
24427 | AV.SearchSortBuilder = function () {
|
24428 | this._sortFields = [];
|
24429 | };
|
24430 |
|
24431 | _.extend(AV.SearchSortBuilder.prototype,
|
24432 |
|
24433 | {
|
24434 | _addField: function _addField(key, order, mode, missing) {
|
24435 | var field = {};
|
24436 | field[key] = {
|
24437 | order: order || 'asc',
|
24438 | mode: mode || 'avg',
|
24439 | missing: '_' + (missing || 'last')
|
24440 | };
|
24441 |
|
24442 | this._sortFields.push(field);
|
24443 |
|
24444 | return this;
|
24445 | },
|
24446 |
|
24447 | |
24448 |
|
24449 |
|
24450 |
|
24451 |
|
24452 |
|
24453 |
|
24454 |
|
24455 |
|
24456 |
|
24457 | ascending: function ascending(key, mode, missing) {
|
24458 | return this._addField(key, 'asc', mode, missing);
|
24459 | },
|
24460 |
|
24461 | |
24462 |
|
24463 |
|
24464 |
|
24465 |
|
24466 |
|
24467 |
|
24468 |
|
24469 |
|
24470 |
|
24471 | descending: function descending(key, mode, missing) {
|
24472 | return this._addField(key, 'desc', mode, missing);
|
24473 | },
|
24474 |
|
24475 | |
24476 |
|
24477 |
|
24478 |
|
24479 |
|
24480 |
|
24481 |
|
24482 |
|
24483 | whereNear: function whereNear(key, point, options) {
|
24484 | options = options || {};
|
24485 | var field = {};
|
24486 | var geo = {
|
24487 | lat: point.latitude,
|
24488 | lon: point.longitude
|
24489 | };
|
24490 | var m = {
|
24491 | order: options.order || 'asc',
|
24492 | mode: options.mode || 'avg',
|
24493 | unit: options.unit || 'km'
|
24494 | };
|
24495 | m[key] = geo;
|
24496 | field['_geo_distance'] = m;
|
24497 |
|
24498 | this._sortFields.push(field);
|
24499 |
|
24500 | return this;
|
24501 | },
|
24502 |
|
24503 | |
24504 |
|
24505 |
|
24506 |
|
24507 | build: function build() {
|
24508 | return (0, _stringify.default)(AV._encode(this._sortFields));
|
24509 | }
|
24510 | });
|
24511 | |
24512 |
|
24513 |
|
24514 |
|
24515 |
|
24516 |
|
24517 |
|
24518 |
|
24519 |
|
24520 |
|
24521 |
|
24522 |
|
24523 |
|
24524 |
|
24525 |
|
24526 |
|
24527 |
|
24528 | AV.SearchQuery = AV.Query._extend(
|
24529 |
|
24530 | {
|
24531 | _sid: null,
|
24532 | _hits: 0,
|
24533 | _queryString: null,
|
24534 | _highlights: null,
|
24535 | _sortBuilder: null,
|
24536 | _clazz: null,
|
24537 | constructor: function constructor(className) {
|
24538 | if (className) {
|
24539 | this._clazz = className;
|
24540 | } else {
|
24541 | className = '__INVALID_CLASS';
|
24542 | }
|
24543 |
|
24544 | AV.Query.call(this, className);
|
24545 | },
|
24546 | _createRequest: function _createRequest(params, options) {
|
24547 | return AVRequest('search/select', null, null, 'GET', params || this._getParams(), options);
|
24548 | },
|
24549 |
|
24550 | |
24551 |
|
24552 |
|
24553 |
|
24554 |
|
24555 | sid: function sid(_sid) {
|
24556 | this._sid = _sid;
|
24557 | return this;
|
24558 | },
|
24559 |
|
24560 | |
24561 |
|
24562 |
|
24563 |
|
24564 |
|
24565 | queryString: function queryString(q) {
|
24566 | this._queryString = q;
|
24567 | return this;
|
24568 | },
|
24569 |
|
24570 | |
24571 |
|
24572 |
|
24573 |
|
24574 |
|
24575 |
|
24576 |
|
24577 |
|
24578 |
|
24579 |
|
24580 | highlights: function highlights(_highlights) {
|
24581 | var objects;
|
24582 |
|
24583 | if (_highlights && _.isString(_highlights)) {
|
24584 | objects = _.toArray(arguments);
|
24585 | } else {
|
24586 | objects = _highlights;
|
24587 | }
|
24588 |
|
24589 | this._highlights = objects;
|
24590 | return this;
|
24591 | },
|
24592 |
|
24593 | |
24594 |
|
24595 |
|
24596 |
|
24597 |
|
24598 |
|
24599 |
|
24600 | sortBy: function sortBy(builder) {
|
24601 | this._sortBuilder = builder;
|
24602 | return this;
|
24603 | },
|
24604 |
|
24605 | |
24606 |
|
24607 |
|
24608 |
|
24609 | hits: function hits() {
|
24610 | if (!this._hits) {
|
24611 | this._hits = 0;
|
24612 | }
|
24613 |
|
24614 | return this._hits;
|
24615 | },
|
24616 | _processResult: function _processResult(json) {
|
24617 | delete json['className'];
|
24618 | delete json['_app_url'];
|
24619 | delete json['_deeplink'];
|
24620 | return json;
|
24621 | },
|
24622 |
|
24623 | |
24624 |
|
24625 |
|
24626 |
|
24627 |
|
24628 |
|
24629 | hasMore: function hasMore() {
|
24630 | return !this._hitEnd;
|
24631 | },
|
24632 |
|
24633 | |
24634 |
|
24635 |
|
24636 |
|
24637 | reset: function reset() {
|
24638 | this._hitEnd = false;
|
24639 | this._sid = null;
|
24640 | this._hits = 0;
|
24641 | },
|
24642 |
|
24643 | |
24644 |
|
24645 |
|
24646 |
|
24647 |
|
24648 |
|
24649 |
|
24650 |
|
24651 |
|
24652 |
|
24653 | find: function find(options) {
|
24654 | var self = this;
|
24655 |
|
24656 | var request = this._createRequest(undefined, options);
|
24657 |
|
24658 | return request.then(function (response) {
|
24659 |
|
24660 | if (response.sid) {
|
24661 | self._oldSid = self._sid;
|
24662 | self._sid = response.sid;
|
24663 | } else {
|
24664 | self._sid = null;
|
24665 | self._hitEnd = true;
|
24666 | }
|
24667 |
|
24668 | self._hits = response.hits || 0;
|
24669 | return (0, _map.default)(_).call(_, response.results, function (json) {
|
24670 | if (json.className) {
|
24671 | response.className = json.className;
|
24672 | }
|
24673 |
|
24674 | var obj = self._newObject(response);
|
24675 |
|
24676 | obj.appURL = json['_app_url'];
|
24677 |
|
24678 | obj._finishFetch(self._processResult(json), true);
|
24679 |
|
24680 | return obj;
|
24681 | });
|
24682 | });
|
24683 | },
|
24684 | _getParams: function _getParams() {
|
24685 | var params = AV.SearchQuery.__super__._getParams.call(this);
|
24686 |
|
24687 | delete params.where;
|
24688 |
|
24689 | if (this._clazz) {
|
24690 | params.clazz = this.className;
|
24691 | }
|
24692 |
|
24693 | if (this._sid) {
|
24694 | params.sid = this._sid;
|
24695 | }
|
24696 |
|
24697 | if (!this._queryString) {
|
24698 | throw new Error('Please set query string.');
|
24699 | } else {
|
24700 | params.q = this._queryString;
|
24701 | }
|
24702 |
|
24703 | if (this._highlights) {
|
24704 | params.highlights = this._highlights.join(',');
|
24705 | }
|
24706 |
|
24707 | if (this._sortBuilder && params.order) {
|
24708 | throw new Error('sort and order can not be set at same time.');
|
24709 | }
|
24710 |
|
24711 | if (this._sortBuilder) {
|
24712 | params.sort = this._sortBuilder.build();
|
24713 | }
|
24714 |
|
24715 | return params;
|
24716 | }
|
24717 | });
|
24718 | };
|
24719 |
|
24720 |
|
24721 |
|
24722 |
|
24723 |
|
24724 |
|
24725 |
|
24726 |
|
24727 |
|
24728 |
|
24729 |
|
24730 |
|
24731 |
|
24732 |
|
24733 |
|
24734 |
|
24735 |
|
24736 |
|
24737 |
|
24738 |
|
24739 |
|
24740 |
|
24741 |
|
24742 |
|
24743 |
|
24744 |
|
24745 |
|
24746 |
|
24747 |
|
24748 |
|
24749 |
|
24750 |
|
24751 |
|
24752 |
|
24753 |
|
24754 |
|
24755 |
|
24756 |
|
24757 |
|
24758 |
|
24759 |
|
24760 |
|
24761 |
|
24762 |
|
24763 |
|
24764 |
|
24765 |
|
24766 |
|
24767 |
|
24768 |
|
24769 |
|
24770 |
|
24771 |
|
24772 |
|
24773 |
|
24774 |
|
24775 |
|
24776 |
|
24777 |
|
24778 | }),
|
24779 |
|
24780 | (function(module, exports, __webpack_require__) {
|
24781 |
|
24782 | "use strict";
|
24783 |
|
24784 |
|
24785 | var _interopRequireDefault = __webpack_require__(1);
|
24786 |
|
24787 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
24788 |
|
24789 | var _ = __webpack_require__(3);
|
24790 |
|
24791 | var AVError = __webpack_require__(48);
|
24792 |
|
24793 | var _require = __webpack_require__(28),
|
24794 | request = _require.request;
|
24795 |
|
24796 | module.exports = function (AV) {
|
24797 | |
24798 |
|
24799 |
|
24800 |
|
24801 |
|
24802 |
|
24803 |
|
24804 |
|
24805 | AV.Insight = AV.Insight || {};
|
24806 |
|
24807 | _.extend(AV.Insight,
|
24808 |
|
24809 | {
|
24810 | |
24811 |
|
24812 |
|
24813 |
|
24814 |
|
24815 |
|
24816 |
|
24817 |
|
24818 |
|
24819 |
|
24820 |
|
24821 |
|
24822 |
|
24823 |
|
24824 |
|
24825 |
|
24826 | startJob: function startJob(jobConfig, options) {
|
24827 | if (!jobConfig || !jobConfig.sql) {
|
24828 | throw new Error('Please provide the sql to run the job.');
|
24829 | }
|
24830 |
|
24831 | var data = {
|
24832 | jobConfig: jobConfig,
|
24833 | appId: AV.applicationId
|
24834 | };
|
24835 | return request({
|
24836 | path: '/bigquery/jobs',
|
24837 | method: 'POST',
|
24838 | data: AV._encode(data, null, true),
|
24839 | authOptions: options,
|
24840 | signKey: false
|
24841 | }).then(function (resp) {
|
24842 | return AV._decode(resp).id;
|
24843 | });
|
24844 | },
|
24845 |
|
24846 | |
24847 |
|
24848 |
|
24849 |
|
24850 |
|
24851 |
|
24852 |
|
24853 |
|
24854 |
|
24855 |
|
24856 | on: function on(event, cb) {}
|
24857 | });
|
24858 | |
24859 |
|
24860 |
|
24861 |
|
24862 |
|
24863 |
|
24864 |
|
24865 |
|
24866 | AV.Insight.JobQuery = function (id, className) {
|
24867 | if (!id) {
|
24868 | throw new Error('Please provide the job id.');
|
24869 | }
|
24870 |
|
24871 | this.id = id;
|
24872 | this.className = className;
|
24873 | this._skip = 0;
|
24874 | this._limit = 100;
|
24875 | };
|
24876 |
|
24877 | _.extend(AV.Insight.JobQuery.prototype,
|
24878 |
|
24879 | {
|
24880 | |
24881 |
|
24882 |
|
24883 |
|
24884 |
|
24885 |
|
24886 |
|
24887 | skip: function skip(n) {
|
24888 | this._skip = n;
|
24889 | return this;
|
24890 | },
|
24891 |
|
24892 | |
24893 |
|
24894 |
|
24895 |
|
24896 |
|
24897 |
|
24898 | limit: function limit(n) {
|
24899 | this._limit = n;
|
24900 | return this;
|
24901 | },
|
24902 |
|
24903 | |
24904 |
|
24905 |
|
24906 |
|
24907 |
|
24908 |
|
24909 |
|
24910 |
|
24911 |
|
24912 |
|
24913 | find: function find(options) {
|
24914 | var params = {
|
24915 | skip: this._skip,
|
24916 | limit: this._limit
|
24917 | };
|
24918 | return request({
|
24919 | path: "/bigquery/jobs/".concat(this.id),
|
24920 | method: 'GET',
|
24921 | query: params,
|
24922 | authOptions: options,
|
24923 | signKey: false
|
24924 | }).then(function (response) {
|
24925 | if (response.error) {
|
24926 | return _promise.default.reject(new AVError(response.code, response.error));
|
24927 | }
|
24928 |
|
24929 | return _promise.default.resolve(response);
|
24930 | });
|
24931 | }
|
24932 | });
|
24933 | };
|
24934 |
|
24935 | }),
|
24936 |
|
24937 | (function(module, exports, __webpack_require__) {
|
24938 |
|
24939 | "use strict";
|
24940 |
|
24941 |
|
24942 | var _interopRequireDefault = __webpack_require__(1);
|
24943 |
|
24944 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
24945 |
|
24946 | var _ = __webpack_require__(3);
|
24947 |
|
24948 | var _require = __webpack_require__(28),
|
24949 | LCRequest = _require.request;
|
24950 |
|
24951 | var _require2 = __webpack_require__(32),
|
24952 | getSessionToken = _require2.getSessionToken;
|
24953 |
|
24954 | module.exports = function (AV) {
|
24955 | var getUserWithSessionToken = function getUserWithSessionToken(authOptions) {
|
24956 | if (authOptions.user) {
|
24957 | if (!authOptions.user._sessionToken) {
|
24958 | throw new Error('authOptions.user is not signed in.');
|
24959 | }
|
24960 |
|
24961 | return _promise.default.resolve(authOptions.user);
|
24962 | }
|
24963 |
|
24964 | if (authOptions.sessionToken) {
|
24965 | return AV.User._fetchUserBySessionToken(authOptions.sessionToken);
|
24966 | }
|
24967 |
|
24968 | return AV.User.currentAsync();
|
24969 | };
|
24970 |
|
24971 | var getSessionTokenAsync = function getSessionTokenAsync(authOptions) {
|
24972 | var sessionToken = getSessionToken(authOptions);
|
24973 |
|
24974 | if (sessionToken) {
|
24975 | return _promise.default.resolve(sessionToken);
|
24976 | }
|
24977 |
|
24978 | return AV.User.currentAsync().then(function (user) {
|
24979 | if (user) {
|
24980 | return user.getSessionToken();
|
24981 | }
|
24982 | });
|
24983 | };
|
24984 | |
24985 |
|
24986 |
|
24987 |
|
24988 |
|
24989 |
|
24990 | AV.Friendship = {
|
24991 | |
24992 |
|
24993 |
|
24994 |
|
24995 |
|
24996 |
|
24997 |
|
24998 |
|
24999 |
|
25000 | request: function request(options) {
|
25001 | var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25002 | var friend;
|
25003 | var attributes;
|
25004 |
|
25005 | if (options.friend) {
|
25006 | friend = options.friend;
|
25007 | attributes = options.attributes;
|
25008 | } else {
|
25009 | friend = options;
|
25010 | }
|
25011 |
|
25012 | var friendObj = _.isString(friend) ? AV.Object.createWithoutData('_User', friend) : friend;
|
25013 | return getUserWithSessionToken(authOptions).then(function (userObj) {
|
25014 | if (!userObj) {
|
25015 | throw new Error('Please signin an user.');
|
25016 | }
|
25017 |
|
25018 | return LCRequest({
|
25019 | method: 'POST',
|
25020 | path: '/users/friendshipRequests',
|
25021 | data: {
|
25022 | user: userObj._toPointer(),
|
25023 | friend: friendObj._toPointer(),
|
25024 | friendship: attributes
|
25025 | },
|
25026 | authOptions: authOptions
|
25027 | });
|
25028 | });
|
25029 | },
|
25030 |
|
25031 | |
25032 |
|
25033 |
|
25034 |
|
25035 |
|
25036 |
|
25037 |
|
25038 |
|
25039 |
|
25040 | acceptRequest: function acceptRequest(options) {
|
25041 | var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25042 | var request;
|
25043 | var attributes;
|
25044 |
|
25045 | if (options.request) {
|
25046 | request = options.request;
|
25047 | attributes = options.attributes;
|
25048 | } else {
|
25049 | request = options;
|
25050 | }
|
25051 |
|
25052 | var requestId = _.isString(request) ? request : request.id;
|
25053 | return getSessionTokenAsync(authOptions).then(function (sessionToken) {
|
25054 | if (!sessionToken) {
|
25055 | throw new Error('Please signin an user.');
|
25056 | }
|
25057 |
|
25058 | return LCRequest({
|
25059 | method: 'PUT',
|
25060 | path: '/users/friendshipRequests/' + requestId + '/accept',
|
25061 | data: {
|
25062 | friendship: AV._encode(attributes)
|
25063 | },
|
25064 | authOptions: authOptions
|
25065 | });
|
25066 | });
|
25067 | },
|
25068 |
|
25069 | |
25070 |
|
25071 |
|
25072 |
|
25073 |
|
25074 |
|
25075 | declineRequest: function declineRequest(request) {
|
25076 | var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25077 | var requestId = _.isString(request) ? request : request.id;
|
25078 | return getSessionTokenAsync(authOptions).then(function (sessionToken) {
|
25079 | if (!sessionToken) {
|
25080 | throw new Error('Please signin an user.');
|
25081 | }
|
25082 |
|
25083 | return LCRequest({
|
25084 | method: 'PUT',
|
25085 | path: '/users/friendshipRequests/' + requestId + '/decline',
|
25086 | authOptions: authOptions
|
25087 | });
|
25088 | });
|
25089 | }
|
25090 | };
|
25091 | };
|
25092 |
|
25093 | }),
|
25094 |
|
25095 | (function(module, exports, __webpack_require__) {
|
25096 |
|
25097 | "use strict";
|
25098 |
|
25099 |
|
25100 | var _interopRequireDefault = __webpack_require__(1);
|
25101 |
|
25102 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
25103 |
|
25104 | var _ = __webpack_require__(3);
|
25105 |
|
25106 | var _require = __webpack_require__(28),
|
25107 | _request = _require._request;
|
25108 |
|
25109 | var AV = __webpack_require__(74);
|
25110 |
|
25111 | var serializeMessage = function serializeMessage(message) {
|
25112 | if (typeof message === 'string') {
|
25113 | return message;
|
25114 | }
|
25115 |
|
25116 | if (typeof message.getPayload === 'function') {
|
25117 | return (0, _stringify.default)(message.getPayload());
|
25118 | }
|
25119 |
|
25120 | return (0, _stringify.default)(message);
|
25121 | };
|
25122 |
|
25123 |
|
25124 |
|
25125 |
|
25126 |
|
25127 |
|
25128 |
|
25129 |
|
25130 |
|
25131 |
|
25132 |
|
25133 |
|
25134 |
|
25135 |
|
25136 |
|
25137 | module.exports = AV.Object.extend('_Conversation',
|
25138 |
|
25139 | {
|
25140 | constructor: function constructor(name) {
|
25141 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25142 | AV.Object.prototype.constructor.call(this, null, null);
|
25143 | this.set('name', name);
|
25144 |
|
25145 | if (options.isSystem !== undefined) {
|
25146 | this.set('sys', options.isSystem ? true : false);
|
25147 | }
|
25148 |
|
25149 | if (options.isTransient !== undefined) {
|
25150 | this.set('tr', options.isTransient ? true : false);
|
25151 | }
|
25152 | },
|
25153 |
|
25154 | |
25155 |
|
25156 |
|
25157 |
|
25158 |
|
25159 | getCreator: function getCreator() {
|
25160 | return this.get('c');
|
25161 | },
|
25162 |
|
25163 | |
25164 |
|
25165 |
|
25166 |
|
25167 |
|
25168 | getLastMessageAt: function getLastMessageAt() {
|
25169 | return this.get('lm');
|
25170 | },
|
25171 |
|
25172 | |
25173 |
|
25174 |
|
25175 |
|
25176 |
|
25177 | getMembers: function getMembers() {
|
25178 | return this.get('m');
|
25179 | },
|
25180 |
|
25181 | |
25182 |
|
25183 |
|
25184 |
|
25185 |
|
25186 | addMember: function addMember(member) {
|
25187 | return this.add('m', member);
|
25188 | },
|
25189 |
|
25190 | |
25191 |
|
25192 |
|
25193 |
|
25194 |
|
25195 | getMutedMembers: function getMutedMembers() {
|
25196 | return this.get('mu');
|
25197 | },
|
25198 |
|
25199 | |
25200 |
|
25201 |
|
25202 |
|
25203 |
|
25204 | getName: function getName() {
|
25205 | return this.get('name');
|
25206 | },
|
25207 |
|
25208 | |
25209 |
|
25210 |
|
25211 |
|
25212 |
|
25213 | isTransient: function isTransient() {
|
25214 | return this.get('tr');
|
25215 | },
|
25216 |
|
25217 | |
25218 |
|
25219 |
|
25220 |
|
25221 |
|
25222 | isSystem: function isSystem() {
|
25223 | return this.get('sys');
|
25224 | },
|
25225 |
|
25226 | |
25227 |
|
25228 |
|
25229 |
|
25230 |
|
25231 |
|
25232 |
|
25233 |
|
25234 |
|
25235 |
|
25236 |
|
25237 |
|
25238 |
|
25239 |
|
25240 | send: function send(fromClient, message) {
|
25241 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
25242 | var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
25243 | var data = {
|
25244 | from_peer: fromClient,
|
25245 | conv_id: this.id,
|
25246 | transient: false,
|
25247 | message: serializeMessage(message)
|
25248 | };
|
25249 |
|
25250 | if (options.toClients !== undefined) {
|
25251 | data.to_peers = options.toClients;
|
25252 | }
|
25253 |
|
25254 | if (options.transient !== undefined) {
|
25255 | data.transient = options.transient ? true : false;
|
25256 | }
|
25257 |
|
25258 | if (options.pushData !== undefined) {
|
25259 | data.push_data = options.pushData;
|
25260 | }
|
25261 |
|
25262 | return _request('rtm', 'messages', null, 'POST', data, authOptions);
|
25263 | },
|
25264 |
|
25265 | |
25266 |
|
25267 |
|
25268 |
|
25269 |
|
25270 |
|
25271 |
|
25272 |
|
25273 |
|
25274 |
|
25275 |
|
25276 |
|
25277 |
|
25278 | broadcast: function broadcast(fromClient, message) {
|
25279 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
25280 | var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
25281 | var data = {
|
25282 | from_peer: fromClient,
|
25283 | conv_id: this.id,
|
25284 | message: serializeMessage(message)
|
25285 | };
|
25286 |
|
25287 | if (options.pushData !== undefined) {
|
25288 | data.push = options.pushData;
|
25289 | }
|
25290 |
|
25291 | if (options.validTill !== undefined) {
|
25292 | var ts = options.validTill;
|
25293 |
|
25294 | if (_.isDate(ts)) {
|
25295 | ts = ts.getTime();
|
25296 | }
|
25297 |
|
25298 | options.valid_till = ts;
|
25299 | }
|
25300 |
|
25301 | return _request('rtm', 'broadcast', null, 'POST', data, authOptions);
|
25302 | }
|
25303 | });
|
25304 |
|
25305 | }),
|
25306 |
|
25307 | (function(module, exports, __webpack_require__) {
|
25308 |
|
25309 | "use strict";
|
25310 |
|
25311 |
|
25312 | var _interopRequireDefault = __webpack_require__(1);
|
25313 |
|
25314 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
25315 |
|
25316 | var _map = _interopRequireDefault(__webpack_require__(37));
|
25317 |
|
25318 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
25319 |
|
25320 | var _ = __webpack_require__(3);
|
25321 |
|
25322 | var _require = __webpack_require__(28),
|
25323 | request = _require.request;
|
25324 |
|
25325 | var _require2 = __webpack_require__(32),
|
25326 | ensureArray = _require2.ensureArray,
|
25327 | parseDate = _require2.parseDate;
|
25328 |
|
25329 | var AV = __webpack_require__(74);
|
25330 |
|
25331 |
|
25332 |
|
25333 |
|
25334 |
|
25335 |
|
25336 | AV.LeaderboardVersionChangeInterval = {
|
25337 | NEVER: 'never',
|
25338 | DAY: 'day',
|
25339 | WEEK: 'week',
|
25340 | MONTH: 'month'
|
25341 | };
|
25342 |
|
25343 |
|
25344 |
|
25345 |
|
25346 |
|
25347 | AV.LeaderboardOrder = {
|
25348 | ASCENDING: 'ascending',
|
25349 | DESCENDING: 'descending'
|
25350 | };
|
25351 |
|
25352 |
|
25353 |
|
25354 |
|
25355 |
|
25356 | AV.LeaderboardUpdateStrategy = {
|
25357 |
|
25358 | BETTER: 'better',
|
25359 |
|
25360 |
|
25361 | LAST: 'last',
|
25362 |
|
25363 |
|
25364 | SUM: 'sum'
|
25365 | };
|
25366 |
|
25367 |
|
25368 |
|
25369 |
|
25370 |
|
25371 |
|
25372 |
|
25373 |
|
25374 |
|
25375 |
|
25376 |
|
25377 |
|
25378 |
|
25379 |
|
25380 |
|
25381 |
|
25382 |
|
25383 |
|
25384 |
|
25385 |
|
25386 |
|
25387 |
|
25388 | function Statistic(_ref) {
|
25389 | var name = _ref.name,
|
25390 | value = _ref.value,
|
25391 | version = _ref.version;
|
25392 |
|
25393 | |
25394 |
|
25395 |
|
25396 | this.name = name;
|
25397 | |
25398 |
|
25399 |
|
25400 |
|
25401 | this.value = value;
|
25402 | |
25403 |
|
25404 |
|
25405 |
|
25406 | this.version = version;
|
25407 | }
|
25408 |
|
25409 | var parseStatisticData = function parseStatisticData(statisticData) {
|
25410 | var _AV$_decode = AV._decode(statisticData),
|
25411 | name = _AV$_decode.statisticName,
|
25412 | value = _AV$_decode.statisticValue,
|
25413 | version = _AV$_decode.version;
|
25414 |
|
25415 | return new Statistic({
|
25416 | name: name,
|
25417 | value: value,
|
25418 | version: version
|
25419 | });
|
25420 | };
|
25421 |
|
25422 |
|
25423 |
|
25424 |
|
25425 |
|
25426 | AV.Leaderboard = function Leaderboard(statisticName) {
|
25427 | |
25428 |
|
25429 |
|
25430 | this.statisticName = statisticName;
|
25431 | |
25432 |
|
25433 |
|
25434 |
|
25435 | this.order = undefined;
|
25436 | |
25437 |
|
25438 |
|
25439 |
|
25440 | this.updateStrategy = undefined;
|
25441 | |
25442 |
|
25443 |
|
25444 |
|
25445 | this.versionChangeInterval = undefined;
|
25446 | |
25447 |
|
25448 |
|
25449 |
|
25450 | this.version = undefined;
|
25451 | |
25452 |
|
25453 |
|
25454 |
|
25455 | this.nextResetAt = undefined;
|
25456 | |
25457 |
|
25458 |
|
25459 |
|
25460 | this.createdAt = undefined;
|
25461 | };
|
25462 |
|
25463 | var Leaderboard = AV.Leaderboard;
|
25464 |
|
25465 |
|
25466 |
|
25467 |
|
25468 |
|
25469 |
|
25470 | AV.Leaderboard.createWithoutData = function (statisticName) {
|
25471 | return new Leaderboard(statisticName);
|
25472 | };
|
25473 |
|
25474 |
|
25475 |
|
25476 |
|
25477 |
|
25478 |
|
25479 |
|
25480 |
|
25481 |
|
25482 |
|
25483 |
|
25484 |
|
25485 | AV.Leaderboard.createLeaderboard = function (_ref2, authOptions) {
|
25486 | var statisticName = _ref2.statisticName,
|
25487 | order = _ref2.order,
|
25488 | versionChangeInterval = _ref2.versionChangeInterval,
|
25489 | updateStrategy = _ref2.updateStrategy;
|
25490 | return request({
|
25491 | method: 'POST',
|
25492 | path: '/leaderboard/leaderboards',
|
25493 | data: {
|
25494 | statisticName: statisticName,
|
25495 | order: order,
|
25496 | versionChangeInterval: versionChangeInterval,
|
25497 | updateStrategy: updateStrategy
|
25498 | },
|
25499 | authOptions: authOptions
|
25500 | }).then(function (data) {
|
25501 | var leaderboard = new Leaderboard(statisticName);
|
25502 | return leaderboard._finishFetch(data);
|
25503 | });
|
25504 | };
|
25505 |
|
25506 |
|
25507 |
|
25508 |
|
25509 |
|
25510 |
|
25511 |
|
25512 |
|
25513 | AV.Leaderboard.getLeaderboard = function (statisticName, authOptions) {
|
25514 | return Leaderboard.createWithoutData(statisticName).fetch(authOptions);
|
25515 | };
|
25516 |
|
25517 |
|
25518 |
|
25519 |
|
25520 |
|
25521 |
|
25522 |
|
25523 |
|
25524 |
|
25525 |
|
25526 | AV.Leaderboard.getStatistics = function (user) {
|
25527 | var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
25528 | statisticNames = _ref3.statisticNames;
|
25529 |
|
25530 | var authOptions = arguments.length > 2 ? arguments[2] : undefined;
|
25531 | return _promise.default.resolve().then(function () {
|
25532 | if (!(user && user.id)) throw new Error('user must be an AV.User');
|
25533 | return request({
|
25534 | method: 'GET',
|
25535 | path: "/leaderboard/users/".concat(user.id, "/statistics"),
|
25536 | query: {
|
25537 | statistics: statisticNames ? ensureArray(statisticNames).join(',') : undefined
|
25538 | },
|
25539 | authOptions: authOptions
|
25540 | }).then(function (_ref4) {
|
25541 | var results = _ref4.results;
|
25542 | return (0, _map.default)(results).call(results, parseStatisticData);
|
25543 | });
|
25544 | });
|
25545 | };
|
25546 |
|
25547 |
|
25548 |
|
25549 |
|
25550 |
|
25551 |
|
25552 |
|
25553 |
|
25554 |
|
25555 |
|
25556 | AV.Leaderboard.updateStatistics = function (user, statistics) {
|
25557 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
25558 | return _promise.default.resolve().then(function () {
|
25559 | if (!(user && user.id)) throw new Error('user must be an AV.User');
|
25560 | var data = (0, _map.default)(_).call(_, statistics, function (value, key) {
|
25561 | return {
|
25562 | statisticName: key,
|
25563 | statisticValue: value
|
25564 | };
|
25565 | });
|
25566 | var overwrite = options.overwrite;
|
25567 | return request({
|
25568 | method: 'POST',
|
25569 | path: "/leaderboard/users/".concat(user.id, "/statistics"),
|
25570 | query: {
|
25571 | overwrite: overwrite ? 1 : undefined
|
25572 | },
|
25573 | data: data,
|
25574 | authOptions: options
|
25575 | }).then(function (_ref5) {
|
25576 | var results = _ref5.results;
|
25577 | return (0, _map.default)(results).call(results, parseStatisticData);
|
25578 | });
|
25579 | });
|
25580 | };
|
25581 |
|
25582 |
|
25583 |
|
25584 |
|
25585 |
|
25586 |
|
25587 |
|
25588 |
|
25589 |
|
25590 | AV.Leaderboard.deleteStatistics = function (user, statisticNames, authOptions) {
|
25591 | return _promise.default.resolve().then(function () {
|
25592 | if (!(user && user.id)) throw new Error('user must be an AV.User');
|
25593 | return request({
|
25594 | method: 'DELETE',
|
25595 | path: "/leaderboard/users/".concat(user.id, "/statistics"),
|
25596 | query: {
|
25597 | statistics: ensureArray(statisticNames).join(',')
|
25598 | },
|
25599 | authOptions: authOptions
|
25600 | }).then(function () {
|
25601 | return undefined;
|
25602 | });
|
25603 | });
|
25604 | };
|
25605 |
|
25606 | _.extend(Leaderboard.prototype,
|
25607 |
|
25608 | {
|
25609 | _finishFetch: function _finishFetch(data) {
|
25610 | var _this = this;
|
25611 |
|
25612 | _.forEach(data, function (value, key) {
|
25613 | if (key === 'updatedAt' || key === 'objectId') return;
|
25614 |
|
25615 | if (key === 'expiredAt') {
|
25616 | key = 'nextResetAt';
|
25617 | }
|
25618 |
|
25619 | if (key === 'createdAt') {
|
25620 | value = parseDate(value);
|
25621 | }
|
25622 |
|
25623 | if (value && value.__type === 'Date') {
|
25624 | value = parseDate(value.iso);
|
25625 | }
|
25626 |
|
25627 | _this[key] = value;
|
25628 | });
|
25629 |
|
25630 | return this;
|
25631 | },
|
25632 |
|
25633 | |
25634 |
|
25635 |
|
25636 |
|
25637 |
|
25638 | fetch: function fetch(authOptions) {
|
25639 | var _this2 = this;
|
25640 |
|
25641 | return request({
|
25642 | method: 'GET',
|
25643 | path: "/leaderboard/leaderboards/".concat(this.statisticName),
|
25644 | authOptions: authOptions
|
25645 | }).then(function (data) {
|
25646 | return _this2._finishFetch(data);
|
25647 | });
|
25648 | },
|
25649 |
|
25650 | |
25651 |
|
25652 |
|
25653 |
|
25654 |
|
25655 |
|
25656 |
|
25657 | count: function count() {
|
25658 | var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
25659 | version = _ref6.version;
|
25660 |
|
25661 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
25662 | return request({
|
25663 | method: 'GET',
|
25664 | path: "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks"),
|
25665 | query: {
|
25666 | count: 1,
|
25667 | limit: 0,
|
25668 | version: version
|
25669 | },
|
25670 | authOptions: authOptions
|
25671 | }).then(function (_ref7) {
|
25672 | var count = _ref7.count;
|
25673 | return count;
|
25674 | });
|
25675 | },
|
25676 | _getResults: function _getResults(_ref8, authOptions, userId) {
|
25677 | var _context;
|
25678 |
|
25679 | var skip = _ref8.skip,
|
25680 | limit = _ref8.limit,
|
25681 | selectUserKeys = _ref8.selectUserKeys,
|
25682 | includeUserKeys = _ref8.includeUserKeys,
|
25683 | includeStatistics = _ref8.includeStatistics,
|
25684 | version = _ref8.version;
|
25685 | return request({
|
25686 | method: 'GET',
|
25687 | path: (0, _concat.default)(_context = "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks")).call(_context, userId ? "/".concat(userId) : ''),
|
25688 | query: {
|
25689 | skip: skip,
|
25690 | limit: limit,
|
25691 | selectUserKeys: _.union(ensureArray(selectUserKeys), ensureArray(includeUserKeys)).join(',') || undefined,
|
25692 | includeUser: includeUserKeys ? ensureArray(includeUserKeys).join(',') : undefined,
|
25693 | includeStatistics: includeStatistics ? ensureArray(includeStatistics).join(',') : undefined,
|
25694 | version: version
|
25695 | },
|
25696 | authOptions: authOptions
|
25697 | }).then(function (_ref9) {
|
25698 | var rankings = _ref9.results;
|
25699 | return (0, _map.default)(rankings).call(rankings, function (rankingData) {
|
25700 | var _AV$_decode2 = AV._decode(rankingData),
|
25701 | user = _AV$_decode2.user,
|
25702 | value = _AV$_decode2.statisticValue,
|
25703 | rank = _AV$_decode2.rank,
|
25704 | _AV$_decode2$statisti = _AV$_decode2.statistics,
|
25705 | statistics = _AV$_decode2$statisti === void 0 ? [] : _AV$_decode2$statisti;
|
25706 |
|
25707 | return {
|
25708 | user: user,
|
25709 | value: value,
|
25710 | rank: rank,
|
25711 | includedStatistics: (0, _map.default)(statistics).call(statistics, parseStatisticData)
|
25712 | };
|
25713 | });
|
25714 | });
|
25715 | },
|
25716 |
|
25717 | |
25718 |
|
25719 |
|
25720 |
|
25721 |
|
25722 |
|
25723 |
|
25724 |
|
25725 |
|
25726 |
|
25727 |
|
25728 |
|
25729 | getResults: function getResults() {
|
25730 | var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
25731 | skip = _ref10.skip,
|
25732 | limit = _ref10.limit,
|
25733 | selectUserKeys = _ref10.selectUserKeys,
|
25734 | includeUserKeys = _ref10.includeUserKeys,
|
25735 | includeStatistics = _ref10.includeStatistics,
|
25736 | version = _ref10.version;
|
25737 |
|
25738 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
25739 | return this._getResults({
|
25740 | skip: skip,
|
25741 | limit: limit,
|
25742 | selectUserKeys: selectUserKeys,
|
25743 | includeUserKeys: includeUserKeys,
|
25744 | includeStatistics: includeStatistics,
|
25745 | version: version
|
25746 | }, authOptions);
|
25747 | },
|
25748 |
|
25749 | |
25750 |
|
25751 |
|
25752 |
|
25753 |
|
25754 |
|
25755 |
|
25756 |
|
25757 |
|
25758 |
|
25759 |
|
25760 |
|
25761 | getResultsAroundUser: function getResultsAroundUser(user) {
|
25762 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25763 | var authOptions = arguments.length > 2 ? arguments[2] : undefined;
|
25764 |
|
25765 |
|
25766 | if (user && typeof user.id !== 'string') {
|
25767 | return this.getResultsAroundUser(undefined, user, options);
|
25768 | }
|
25769 |
|
25770 | var limit = options.limit,
|
25771 | selectUserKeys = options.selectUserKeys,
|
25772 | includeUserKeys = options.includeUserKeys,
|
25773 | includeStatistics = options.includeStatistics,
|
25774 | version = options.version;
|
25775 | return this._getResults({
|
25776 | limit: limit,
|
25777 | selectUserKeys: selectUserKeys,
|
25778 | includeUserKeys: includeUserKeys,
|
25779 | includeStatistics: includeStatistics,
|
25780 | version: version
|
25781 | }, authOptions, user ? user.id : 'self');
|
25782 | },
|
25783 | _update: function _update(data, authOptions) {
|
25784 | var _this3 = this;
|
25785 |
|
25786 | return request({
|
25787 | method: 'PUT',
|
25788 | path: "/leaderboard/leaderboards/".concat(this.statisticName),
|
25789 | data: data,
|
25790 | authOptions: authOptions
|
25791 | }).then(function (result) {
|
25792 | return _this3._finishFetch(result);
|
25793 | });
|
25794 | },
|
25795 |
|
25796 | |
25797 |
|
25798 |
|
25799 |
|
25800 |
|
25801 |
|
25802 | updateVersionChangeInterval: function updateVersionChangeInterval(versionChangeInterval, authOptions) {
|
25803 | return this._update({
|
25804 | versionChangeInterval: versionChangeInterval
|
25805 | }, authOptions);
|
25806 | },
|
25807 |
|
25808 | |
25809 |
|
25810 |
|
25811 |
|
25812 |
|
25813 |
|
25814 | updateUpdateStrategy: function updateUpdateStrategy(updateStrategy, authOptions) {
|
25815 | return this._update({
|
25816 | updateStrategy: updateStrategy
|
25817 | }, authOptions);
|
25818 | },
|
25819 |
|
25820 | |
25821 |
|
25822 |
|
25823 |
|
25824 |
|
25825 | reset: function reset(authOptions) {
|
25826 | var _this4 = this;
|
25827 |
|
25828 | return request({
|
25829 | method: 'PUT',
|
25830 | path: "/leaderboard/leaderboards/".concat(this.statisticName, "/incrementVersion"),
|
25831 | authOptions: authOptions
|
25832 | }).then(function (data) {
|
25833 | return _this4._finishFetch(data);
|
25834 | });
|
25835 | },
|
25836 |
|
25837 | |
25838 |
|
25839 |
|
25840 |
|
25841 |
|
25842 | destroy: function destroy(authOptions) {
|
25843 | return AV.request({
|
25844 | method: 'DELETE',
|
25845 | path: "/leaderboard/leaderboards/".concat(this.statisticName),
|
25846 | authOptions: authOptions
|
25847 | }).then(function () {
|
25848 | return undefined;
|
25849 | });
|
25850 | },
|
25851 |
|
25852 | |
25853 |
|
25854 |
|
25855 |
|
25856 |
|
25857 |
|
25858 |
|
25859 |
|
25860 | getArchives: function getArchives() {
|
25861 | var _this5 = this;
|
25862 |
|
25863 | var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
25864 | skip = _ref11.skip,
|
25865 | limit = _ref11.limit;
|
25866 |
|
25867 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
25868 | return request({
|
25869 | method: 'GET',
|
25870 | path: "/leaderboard/leaderboards/".concat(this.statisticName, "/archives"),
|
25871 | query: {
|
25872 | skip: skip,
|
25873 | limit: limit
|
25874 | },
|
25875 | authOptions: authOptions
|
25876 | }).then(function (_ref12) {
|
25877 | var results = _ref12.results;
|
25878 | return (0, _map.default)(results).call(results, function (_ref13) {
|
25879 | var version = _ref13.version,
|
25880 | status = _ref13.status,
|
25881 | url = _ref13.url,
|
25882 | activatedAt = _ref13.activatedAt,
|
25883 | deactivatedAt = _ref13.deactivatedAt;
|
25884 | return {
|
25885 | statisticName: _this5.statisticName,
|
25886 | version: version,
|
25887 | status: status,
|
25888 | url: url,
|
25889 | activatedAt: parseDate(activatedAt.iso),
|
25890 | deactivatedAt: parseDate(deactivatedAt.iso)
|
25891 | };
|
25892 | });
|
25893 | });
|
25894 | }
|
25895 | });
|
25896 |
|
25897 | }),
|
25898 |
|
25899 | (function(module, exports, __webpack_require__) {
|
25900 |
|
25901 | "use strict";
|
25902 |
|
25903 |
|
25904 | var _Object$defineProperty = __webpack_require__(94);
|
25905 |
|
25906 | _Object$defineProperty(exports, "__esModule", {
|
25907 | value: true
|
25908 | });
|
25909 |
|
25910 | exports.platformInfo = exports.WebSocket = void 0;
|
25911 |
|
25912 | _Object$defineProperty(exports, "request", {
|
25913 | enumerable: true,
|
25914 | get: function get() {
|
25915 | return _adaptersSuperagent.request;
|
25916 | }
|
25917 | });
|
25918 |
|
25919 | exports.storage = void 0;
|
25920 |
|
25921 | _Object$defineProperty(exports, "upload", {
|
25922 | enumerable: true,
|
25923 | get: function get() {
|
25924 | return _adaptersSuperagent.upload;
|
25925 | }
|
25926 | });
|
25927 |
|
25928 | var _adaptersSuperagent = __webpack_require__(573);
|
25929 |
|
25930 | var storage = window.localStorage;
|
25931 | exports.storage = storage;
|
25932 | var WebSocket = window.WebSocket;
|
25933 | exports.WebSocket = WebSocket;
|
25934 | var platformInfo = {
|
25935 | name: "Browser"
|
25936 | };
|
25937 | exports.platformInfo = platformInfo;
|
25938 |
|
25939 | }),
|
25940 |
|
25941 | (function(module, exports, __webpack_require__) {
|
25942 |
|
25943 | "use strict";
|
25944 |
|
25945 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
25946 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
25947 | return new (P || (P = Promise))(function (resolve, reject) {
|
25948 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
25949 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
25950 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
25951 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
25952 | });
|
25953 | };
|
25954 | var __generator = (this && this.__generator) || function (thisArg, body) {
|
25955 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
25956 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
25957 | function verb(n) { return function (v) { return step([n, v]); }; }
|
25958 | function step(op) {
|
25959 | if (f) throw new TypeError("Generator is already executing.");
|
25960 | while (_) try {
|
25961 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
25962 | if (y = 0, t) op = [op[0] & 2, t.value];
|
25963 | switch (op[0]) {
|
25964 | case 0: case 1: t = op; break;
|
25965 | case 4: _.label++; return { value: op[1], done: false };
|
25966 | case 5: _.label++; y = op[1]; op = [0]; continue;
|
25967 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
25968 | default:
|
25969 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
25970 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
25971 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
25972 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
25973 | if (t[2]) _.ops.pop();
|
25974 | _.trys.pop(); continue;
|
25975 | }
|
25976 | op = body.call(thisArg, _);
|
25977 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
25978 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
25979 | }
|
25980 | };
|
25981 | Object.defineProperty(exports, "__esModule", { value: true });
|
25982 | exports.upload = exports.request = void 0;
|
25983 | var adapter_utils_1 = __webpack_require__(574);
|
25984 | var superagent = __webpack_require__(575);
|
25985 | function convertResponse(res) {
|
25986 | return {
|
25987 | ok: res.ok,
|
25988 | status: res.status,
|
25989 | headers: res.header,
|
25990 | data: res.body,
|
25991 | };
|
25992 | }
|
25993 | var request = function (url, options) {
|
25994 | if (options === void 0) { options = {}; }
|
25995 | return __awaiter(void 0, void 0, void 0, function () {
|
25996 | var _a, method, data, headers, onprogress, signal, req, aborted, onAbort, res, error_1;
|
25997 | return __generator(this, function (_b) {
|
25998 | switch (_b.label) {
|
25999 | case 0:
|
26000 | _a = options.method, method = _a === void 0 ? "GET" : _a, data = options.data, headers = options.headers, onprogress = options.onprogress, signal = options.signal;
|
26001 | if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
26002 | throw new adapter_utils_1.AbortError("Request aborted");
|
26003 | }
|
26004 | req = superagent(method, url).ok(function () { return true; });
|
26005 | if (headers) {
|
26006 | req.set(headers);
|
26007 | }
|
26008 | if (onprogress) {
|
26009 | req.on("progress", onprogress);
|
26010 | }
|
26011 | aborted = false;
|
26012 | onAbort = function () {
|
26013 | aborted = true;
|
26014 | req.abort();
|
26015 | };
|
26016 | signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", onAbort);
|
26017 | _b.label = 1;
|
26018 | case 1:
|
26019 | _b.trys.push([1, 3, 4, 5]);
|
26020 | return [4 , req.send(data)];
|
26021 | case 2:
|
26022 | res = _b.sent();
|
26023 | return [2 , convertResponse(res)];
|
26024 | case 3:
|
26025 | error_1 = _b.sent();
|
26026 | if (aborted) {
|
26027 | throw new adapter_utils_1.AbortError("Request aborted");
|
26028 | }
|
26029 | throw error_1;
|
26030 | case 4:
|
26031 | signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", onAbort);
|
26032 | return [7 ];
|
26033 | case 5: return [2 ];
|
26034 | }
|
26035 | });
|
26036 | });
|
26037 | };
|
26038 | exports.request = request;
|
26039 | var upload = function (url, file, options) {
|
26040 | if (options === void 0) { options = {}; }
|
26041 | return __awaiter(void 0, void 0, void 0, function () {
|
26042 | var _a, method, data, headers, onprogress, signal, req, aborted, onAbort, res, error_2;
|
26043 | return __generator(this, function (_b) {
|
26044 | switch (_b.label) {
|
26045 | case 0:
|
26046 | _a = options.method, method = _a === void 0 ? "POST" : _a, data = options.data, headers = options.headers, onprogress = options.onprogress, signal = options.signal;
|
26047 | if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
26048 | throw new adapter_utils_1.AbortError("Request aborted");
|
26049 | }
|
26050 | req = superagent(method, url)
|
26051 | .ok(function () { return true; })
|
26052 | .attach(file.field, file.data, file.name);
|
26053 | if (data) {
|
26054 | req.field(data);
|
26055 | }
|
26056 | if (headers) {
|
26057 | req.set(headers);
|
26058 | }
|
26059 | if (onprogress) {
|
26060 | req.on("progress", onprogress);
|
26061 | }
|
26062 | aborted = false;
|
26063 | onAbort = function () {
|
26064 | aborted = true;
|
26065 | req.abort();
|
26066 | };
|
26067 | signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", onAbort);
|
26068 | _b.label = 1;
|
26069 | case 1:
|
26070 | _b.trys.push([1, 3, 4, 5]);
|
26071 | return [4 , req];
|
26072 | case 2:
|
26073 | res = _b.sent();
|
26074 | return [2 , convertResponse(res)];
|
26075 | case 3:
|
26076 | error_2 = _b.sent();
|
26077 | if (aborted) {
|
26078 | throw new adapter_utils_1.AbortError("Request aborted");
|
26079 | }
|
26080 | throw error_2;
|
26081 | case 4:
|
26082 | signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", onAbort);
|
26083 | return [7 ];
|
26084 | case 5: return [2 ];
|
26085 | }
|
26086 | });
|
26087 | });
|
26088 | };
|
26089 | exports.upload = upload;
|
26090 |
|
26091 |
|
26092 | }),
|
26093 |
|
26094 | (function(module, __webpack_exports__, __webpack_require__) {
|
26095 |
|
26096 | "use strict";
|
26097 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
26098 | __webpack_require__.d(__webpack_exports__, "AbortError", function() { return AbortError; });
|
26099 |
|
26100 |
|
26101 |
|
26102 |
|
26103 |
|
26104 |
|
26105 |
|
26106 |
|
26107 |
|
26108 |
|
26109 |
|
26110 |
|
26111 |
|
26112 |
|
26113 |
|
26114 |
|
26115 | var extendStatics = function(d, b) {
|
26116 | extendStatics = Object.setPrototypeOf ||
|
26117 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
26118 | function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
26119 | return extendStatics(d, b);
|
26120 | };
|
26121 |
|
26122 | function __extends(d, b) {
|
26123 | extendStatics(d, b);
|
26124 | function __() { this.constructor = d; }
|
26125 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
26126 | }
|
26127 |
|
26128 | var AbortError = (function (_super) {
|
26129 | __extends(AbortError, _super);
|
26130 | function AbortError() {
|
26131 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
26132 | _this.name = "AbortError";
|
26133 | return _this;
|
26134 | }
|
26135 | return AbortError;
|
26136 | }(Error));
|
26137 |
|
26138 |
|
26139 |
|
26140 |
|
26141 |
|
26142 | }),
|
26143 |
|
26144 | (function(module, exports, __webpack_require__) {
|
26145 |
|
26146 | "use strict";
|
26147 |
|
26148 |
|
26149 | var _interopRequireDefault = __webpack_require__(1);
|
26150 |
|
26151 | var _symbol = _interopRequireDefault(__webpack_require__(77));
|
26152 |
|
26153 | var _iterator = _interopRequireDefault(__webpack_require__(154));
|
26154 |
|
26155 | var _trim = _interopRequireDefault(__webpack_require__(576));
|
26156 |
|
26157 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
26158 |
|
26159 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
26160 |
|
26161 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
26162 |
|
26163 | function _typeof(obj) {
|
26164 | "@babel/helpers - typeof";
|
26165 |
|
26166 | if (typeof _symbol.default === "function" && typeof _iterator.default === "symbol") {
|
26167 | _typeof = function _typeof(obj) {
|
26168 | return typeof obj;
|
26169 | };
|
26170 | } else {
|
26171 | _typeof = function _typeof(obj) {
|
26172 | return obj && typeof _symbol.default === "function" && obj.constructor === _symbol.default && obj !== _symbol.default.prototype ? "symbol" : typeof obj;
|
26173 | };
|
26174 | }
|
26175 |
|
26176 | return _typeof(obj);
|
26177 | }
|
26178 |
|
26179 |
|
26180 |
|
26181 |
|
26182 |
|
26183 | var root;
|
26184 |
|
26185 | if (typeof window !== 'undefined') {
|
26186 |
|
26187 | root = window;
|
26188 | } else if (typeof self === 'undefined') {
|
26189 |
|
26190 | console.warn('Using browser-only version of superagent in non-browser environment');
|
26191 | root = void 0;
|
26192 | } else {
|
26193 |
|
26194 | root = self;
|
26195 | }
|
26196 |
|
26197 | var Emitter = __webpack_require__(583);
|
26198 |
|
26199 | var safeStringify = __webpack_require__(584);
|
26200 |
|
26201 | var RequestBase = __webpack_require__(585);
|
26202 |
|
26203 | var isObject = __webpack_require__(260);
|
26204 |
|
26205 | var ResponseBase = __webpack_require__(606);
|
26206 |
|
26207 | var Agent = __webpack_require__(613);
|
26208 |
|
26209 |
|
26210 |
|
26211 |
|
26212 |
|
26213 | function noop() {}
|
26214 |
|
26215 |
|
26216 |
|
26217 |
|
26218 |
|
26219 | module.exports = function (method, url) {
|
26220 |
|
26221 | if (typeof url === 'function') {
|
26222 | return new exports.Request('GET', method).end(url);
|
26223 | }
|
26224 |
|
26225 |
|
26226 | if (arguments.length === 1) {
|
26227 | return new exports.Request('GET', method);
|
26228 | }
|
26229 |
|
26230 | return new exports.Request(method, url);
|
26231 | };
|
26232 |
|
26233 | exports = module.exports;
|
26234 | var request = exports;
|
26235 | exports.Request = Request;
|
26236 |
|
26237 |
|
26238 |
|
26239 |
|
26240 | request.getXHR = function () {
|
26241 | if (root.XMLHttpRequest && (!root.location || root.location.protocol !== 'file:' || !root.ActiveXObject)) {
|
26242 | return new XMLHttpRequest();
|
26243 | }
|
26244 |
|
26245 | try {
|
26246 | return new ActiveXObject('Microsoft.XMLHTTP');
|
26247 | } catch (_unused) {}
|
26248 |
|
26249 | try {
|
26250 | return new ActiveXObject('Msxml2.XMLHTTP.6.0');
|
26251 | } catch (_unused2) {}
|
26252 |
|
26253 | try {
|
26254 | return new ActiveXObject('Msxml2.XMLHTTP.3.0');
|
26255 | } catch (_unused3) {}
|
26256 |
|
26257 | try {
|
26258 | return new ActiveXObject('Msxml2.XMLHTTP');
|
26259 | } catch (_unused4) {}
|
26260 |
|
26261 | throw new Error('Browser-only version of superagent could not find XHR');
|
26262 | };
|
26263 |
|
26264 |
|
26265 |
|
26266 |
|
26267 |
|
26268 |
|
26269 |
|
26270 |
|
26271 |
|
26272 | var trim = (0, _trim.default)('') ? function (s) {
|
26273 | return (0, _trim.default)(s).call(s);
|
26274 | } : function (s) {
|
26275 | return s.replace(/(^\s*|\s*$)/g, '');
|
26276 | };
|
26277 |
|
26278 |
|
26279 |
|
26280 |
|
26281 |
|
26282 |
|
26283 |
|
26284 |
|
26285 | function serialize(obj) {
|
26286 | if (!isObject(obj)) return obj;
|
26287 | var pairs = [];
|
26288 |
|
26289 | for (var key in obj) {
|
26290 | if (Object.prototype.hasOwnProperty.call(obj, key)) pushEncodedKeyValuePair(pairs, key, obj[key]);
|
26291 | }
|
26292 |
|
26293 | return pairs.join('&');
|
26294 | }
|
26295 |
|
26296 |
|
26297 |
|
26298 |
|
26299 |
|
26300 |
|
26301 |
|
26302 |
|
26303 |
|
26304 |
|
26305 | function pushEncodedKeyValuePair(pairs, key, val) {
|
26306 | if (val === undefined) return;
|
26307 |
|
26308 | if (val === null) {
|
26309 | pairs.push(encodeURI(key));
|
26310 | return;
|
26311 | }
|
26312 |
|
26313 | if (Array.isArray(val)) {
|
26314 | val.forEach(function (v) {
|
26315 | pushEncodedKeyValuePair(pairs, key, v);
|
26316 | });
|
26317 | } else if (isObject(val)) {
|
26318 | for (var subkey in val) {
|
26319 | var _context;
|
26320 |
|
26321 | if (Object.prototype.hasOwnProperty.call(val, subkey)) pushEncodedKeyValuePair(pairs, (0, _concat.default)(_context = "".concat(key, "[")).call(_context, subkey, "]"), val[subkey]);
|
26322 | }
|
26323 | } else {
|
26324 | pairs.push(encodeURI(key) + '=' + encodeURIComponent(val));
|
26325 | }
|
26326 | }
|
26327 |
|
26328 |
|
26329 |
|
26330 |
|
26331 |
|
26332 | request.serializeObject = serialize;
|
26333 |
|
26334 |
|
26335 |
|
26336 |
|
26337 |
|
26338 |
|
26339 |
|
26340 |
|
26341 | function parseString(str) {
|
26342 | var obj = {};
|
26343 | var pairs = str.split('&');
|
26344 | var pair;
|
26345 | var pos;
|
26346 |
|
26347 | for (var i = 0, len = pairs.length; i < len; ++i) {
|
26348 | pair = pairs[i];
|
26349 | pos = (0, _indexOf.default)(pair).call(pair, '=');
|
26350 |
|
26351 | if (pos === -1) {
|
26352 | obj[decodeURIComponent(pair)] = '';
|
26353 | } else {
|
26354 | obj[decodeURIComponent((0, _slice.default)(pair).call(pair, 0, pos))] = decodeURIComponent((0, _slice.default)(pair).call(pair, pos + 1));
|
26355 | }
|
26356 | }
|
26357 |
|
26358 | return obj;
|
26359 | }
|
26360 |
|
26361 |
|
26362 |
|
26363 |
|
26364 |
|
26365 | request.parseString = parseString;
|
26366 |
|
26367 |
|
26368 |
|
26369 |
|
26370 |
|
26371 |
|
26372 |
|
26373 | request.types = {
|
26374 | html: 'text/html',
|
26375 | json: 'application/json',
|
26376 | xml: 'text/xml',
|
26377 | urlencoded: 'application/x-www-form-urlencoded',
|
26378 | form: 'application/x-www-form-urlencoded',
|
26379 | 'form-data': 'application/x-www-form-urlencoded'
|
26380 | };
|
26381 |
|
26382 |
|
26383 |
|
26384 |
|
26385 |
|
26386 |
|
26387 |
|
26388 |
|
26389 |
|
26390 | request.serialize = {
|
26391 | 'application/x-www-form-urlencoded': serialize,
|
26392 | 'application/json': safeStringify
|
26393 | };
|
26394 |
|
26395 |
|
26396 |
|
26397 |
|
26398 |
|
26399 |
|
26400 |
|
26401 |
|
26402 |
|
26403 | request.parse = {
|
26404 | 'application/x-www-form-urlencoded': parseString,
|
26405 | 'application/json': JSON.parse
|
26406 | };
|
26407 |
|
26408 |
|
26409 |
|
26410 |
|
26411 |
|
26412 |
|
26413 |
|
26414 |
|
26415 |
|
26416 | function parseHeader(str) {
|
26417 | var lines = str.split(/\r?\n/);
|
26418 | var fields = {};
|
26419 | var index;
|
26420 | var line;
|
26421 | var field;
|
26422 | var val;
|
26423 |
|
26424 | for (var i = 0, len = lines.length; i < len; ++i) {
|
26425 | line = lines[i];
|
26426 | index = (0, _indexOf.default)(line).call(line, ':');
|
26427 |
|
26428 | if (index === -1) {
|
26429 |
|
26430 | continue;
|
26431 | }
|
26432 |
|
26433 | field = (0, _slice.default)(line).call(line, 0, index).toLowerCase();
|
26434 | val = trim((0, _slice.default)(line).call(line, index + 1));
|
26435 | fields[field] = val;
|
26436 | }
|
26437 |
|
26438 | return fields;
|
26439 | }
|
26440 |
|
26441 |
|
26442 |
|
26443 |
|
26444 |
|
26445 |
|
26446 |
|
26447 |
|
26448 |
|
26449 | function isJSON(mime) {
|
26450 |
|
26451 |
|
26452 | return /[/+]json($|[^-\w])/.test(mime);
|
26453 | }
|
26454 |
|
26455 |
|
26456 |
|
26457 |
|
26458 |
|
26459 |
|
26460 |
|
26461 |
|
26462 |
|
26463 |
|
26464 |
|
26465 |
|
26466 |
|
26467 |
|
26468 |
|
26469 |
|
26470 |
|
26471 |
|
26472 |
|
26473 |
|
26474 |
|
26475 |
|
26476 |
|
26477 |
|
26478 |
|
26479 |
|
26480 |
|
26481 |
|
26482 |
|
26483 |
|
26484 |
|
26485 |
|
26486 |
|
26487 |
|
26488 |
|
26489 |
|
26490 |
|
26491 |
|
26492 |
|
26493 |
|
26494 |
|
26495 |
|
26496 |
|
26497 |
|
26498 |
|
26499 |
|
26500 |
|
26501 | function Response(req) {
|
26502 | this.req = req;
|
26503 | this.xhr = this.req.xhr;
|
26504 |
|
26505 | this.text = this.req.method !== 'HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text') || typeof this.xhr.responseType === 'undefined' ? this.xhr.responseText : null;
|
26506 | this.statusText = this.req.xhr.statusText;
|
26507 | var status = this.xhr.status;
|
26508 |
|
26509 | if (status === 1223) {
|
26510 | status = 204;
|
26511 | }
|
26512 |
|
26513 | this._setStatusProperties(status);
|
26514 |
|
26515 | this.headers = parseHeader(this.xhr.getAllResponseHeaders());
|
26516 | this.header = this.headers;
|
26517 |
|
26518 |
|
26519 |
|
26520 | this.header['content-type'] = this.xhr.getResponseHeader('content-type');
|
26521 |
|
26522 | this._setHeaderProperties(this.header);
|
26523 |
|
26524 | if (this.text === null && req._responseType) {
|
26525 | this.body = this.xhr.response;
|
26526 | } else {
|
26527 | this.body = this.req.method === 'HEAD' ? null : this._parseBody(this.text ? this.text : this.xhr.response);
|
26528 | }
|
26529 | }
|
26530 |
|
26531 |
|
26532 | ResponseBase(Response.prototype);
|
26533 |
|
26534 |
|
26535 |
|
26536 |
|
26537 |
|
26538 |
|
26539 |
|
26540 |
|
26541 |
|
26542 |
|
26543 |
|
26544 | Response.prototype._parseBody = function (str) {
|
26545 | var parse = request.parse[this.type];
|
26546 |
|
26547 | if (this.req._parser) {
|
26548 | return this.req._parser(this, str);
|
26549 | }
|
26550 |
|
26551 | if (!parse && isJSON(this.type)) {
|
26552 | parse = request.parse['application/json'];
|
26553 | }
|
26554 |
|
26555 | return parse && str && (str.length > 0 || str instanceof Object) ? parse(str) : null;
|
26556 | };
|
26557 |
|
26558 |
|
26559 |
|
26560 |
|
26561 |
|
26562 |
|
26563 |
|
26564 |
|
26565 | Response.prototype.toError = function () {
|
26566 | var _context2, _context3;
|
26567 |
|
26568 | var req = this.req;
|
26569 | var method = req.method;
|
26570 | var url = req.url;
|
26571 | var msg = (0, _concat.default)(_context2 = (0, _concat.default)(_context3 = "cannot ".concat(method, " ")).call(_context3, url, " (")).call(_context2, this.status, ")");
|
26572 | var err = new Error(msg);
|
26573 | err.status = this.status;
|
26574 | err.method = method;
|
26575 | err.url = url;
|
26576 | return err;
|
26577 | };
|
26578 |
|
26579 |
|
26580 |
|
26581 |
|
26582 |
|
26583 | request.Response = Response;
|
26584 |
|
26585 |
|
26586 |
|
26587 |
|
26588 |
|
26589 |
|
26590 |
|
26591 |
|
26592 | function Request(method, url) {
|
26593 | var self = this;
|
26594 | this._query = this._query || [];
|
26595 | this.method = method;
|
26596 | this.url = url;
|
26597 | this.header = {};
|
26598 |
|
26599 | this._header = {};
|
26600 |
|
26601 | this.on('end', function () {
|
26602 | var err = null;
|
26603 | var res = null;
|
26604 |
|
26605 | try {
|
26606 | res = new Response(self);
|
26607 | } catch (err_) {
|
26608 | err = new Error('Parser is unable to parse the response');
|
26609 | err.parse = true;
|
26610 | err.original = err_;
|
26611 |
|
26612 | if (self.xhr) {
|
26613 |
|
26614 | err.rawResponse = typeof self.xhr.responseType === 'undefined' ? self.xhr.responseText : self.xhr.response;
|
26615 |
|
26616 | err.status = self.xhr.status ? self.xhr.status : null;
|
26617 | err.statusCode = err.status;
|
26618 | } else {
|
26619 | err.rawResponse = null;
|
26620 | err.status = null;
|
26621 | }
|
26622 |
|
26623 | return self.callback(err);
|
26624 | }
|
26625 |
|
26626 | self.emit('response', res);
|
26627 | var new_err;
|
26628 |
|
26629 | try {
|
26630 | if (!self._isResponseOK(res)) {
|
26631 | new_err = new Error(res.statusText || res.text || 'Unsuccessful HTTP response');
|
26632 | }
|
26633 | } catch (err_) {
|
26634 | new_err = err_;
|
26635 | }
|
26636 |
|
26637 |
|
26638 | if (new_err) {
|
26639 | new_err.original = err;
|
26640 | new_err.response = res;
|
26641 | new_err.status = res.status;
|
26642 | self.callback(new_err, res);
|
26643 | } else {
|
26644 | self.callback(null, res);
|
26645 | }
|
26646 | });
|
26647 | }
|
26648 |
|
26649 |
|
26650 |
|
26651 |
|
26652 |
|
26653 |
|
26654 | Emitter(Request.prototype);
|
26655 |
|
26656 | RequestBase(Request.prototype);
|
26657 |
|
26658 |
|
26659 |
|
26660 |
|
26661 |
|
26662 |
|
26663 |
|
26664 |
|
26665 |
|
26666 |
|
26667 |
|
26668 |
|
26669 |
|
26670 |
|
26671 |
|
26672 |
|
26673 |
|
26674 |
|
26675 |
|
26676 |
|
26677 |
|
26678 |
|
26679 | Request.prototype.type = function (type) {
|
26680 | this.set('Content-Type', request.types[type] || type);
|
26681 | return this;
|
26682 | };
|
26683 |
|
26684 |
|
26685 |
|
26686 |
|
26687 |
|
26688 |
|
26689 |
|
26690 |
|
26691 |
|
26692 |
|
26693 |
|
26694 |
|
26695 |
|
26696 |
|
26697 |
|
26698 |
|
26699 |
|
26700 |
|
26701 |
|
26702 |
|
26703 |
|
26704 | Request.prototype.accept = function (type) {
|
26705 | this.set('Accept', request.types[type] || type);
|
26706 | return this;
|
26707 | };
|
26708 |
|
26709 |
|
26710 |
|
26711 |
|
26712 |
|
26713 |
|
26714 |
|
26715 |
|
26716 |
|
26717 |
|
26718 |
|
26719 | Request.prototype.auth = function (user, pass, options) {
|
26720 | if (arguments.length === 1) pass = '';
|
26721 |
|
26722 | if (_typeof(pass) === 'object' && pass !== null) {
|
26723 |
|
26724 | options = pass;
|
26725 | pass = '';
|
26726 | }
|
26727 |
|
26728 | if (!options) {
|
26729 | options = {
|
26730 | type: typeof btoa === 'function' ? 'basic' : 'auto'
|
26731 | };
|
26732 | }
|
26733 |
|
26734 | var encoder = function encoder(string) {
|
26735 | if (typeof btoa === 'function') {
|
26736 | return btoa(string);
|
26737 | }
|
26738 |
|
26739 | throw new Error('Cannot use basic auth, btoa is not a function');
|
26740 | };
|
26741 |
|
26742 | return this._auth(user, pass, options, encoder);
|
26743 | };
|
26744 |
|
26745 |
|
26746 |
|
26747 |
|
26748 |
|
26749 |
|
26750 |
|
26751 |
|
26752 |
|
26753 |
|
26754 |
|
26755 |
|
26756 |
|
26757 |
|
26758 |
|
26759 | Request.prototype.query = function (val) {
|
26760 | if (typeof val !== 'string') val = serialize(val);
|
26761 | if (val) this._query.push(val);
|
26762 | return this;
|
26763 | };
|
26764 |
|
26765 |
|
26766 |
|
26767 |
|
26768 |
|
26769 |
|
26770 |
|
26771 |
|
26772 |
|
26773 |
|
26774 |
|
26775 |
|
26776 |
|
26777 |
|
26778 |
|
26779 |
|
26780 |
|
26781 |
|
26782 | Request.prototype.attach = function (field, file, options) {
|
26783 | if (file) {
|
26784 | if (this._data) {
|
26785 | throw new Error("superagent can't mix .send() and .attach()");
|
26786 | }
|
26787 |
|
26788 | this._getFormData().append(field, file, options || file.name);
|
26789 | }
|
26790 |
|
26791 | return this;
|
26792 | };
|
26793 |
|
26794 | Request.prototype._getFormData = function () {
|
26795 | if (!this._formData) {
|
26796 | this._formData = new root.FormData();
|
26797 | }
|
26798 |
|
26799 | return this._formData;
|
26800 | };
|
26801 |
|
26802 |
|
26803 |
|
26804 |
|
26805 |
|
26806 |
|
26807 |
|
26808 |
|
26809 |
|
26810 |
|
26811 | Request.prototype.callback = function (err, res) {
|
26812 | if (this._shouldRetry(err, res)) {
|
26813 | return this._retry();
|
26814 | }
|
26815 |
|
26816 | var fn = this._callback;
|
26817 | this.clearTimeout();
|
26818 |
|
26819 | if (err) {
|
26820 | if (this._maxRetries) err.retries = this._retries - 1;
|
26821 | this.emit('error', err);
|
26822 | }
|
26823 |
|
26824 | fn(err, res);
|
26825 | };
|
26826 |
|
26827 |
|
26828 |
|
26829 |
|
26830 |
|
26831 |
|
26832 |
|
26833 | Request.prototype.crossDomainError = function () {
|
26834 | var err = new Error('Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.');
|
26835 | err.crossDomain = true;
|
26836 | err.status = this.status;
|
26837 | err.method = this.method;
|
26838 | err.url = this.url;
|
26839 | this.callback(err);
|
26840 | };
|
26841 |
|
26842 |
|
26843 | Request.prototype.agent = function () {
|
26844 | console.warn('This is not supported in browser version of superagent');
|
26845 | return this;
|
26846 | };
|
26847 |
|
26848 | Request.prototype.ca = Request.prototype.agent;
|
26849 | Request.prototype.buffer = Request.prototype.ca;
|
26850 |
|
26851 | Request.prototype.write = function () {
|
26852 | throw new Error('Streaming is not supported in browser version of superagent');
|
26853 | };
|
26854 |
|
26855 | Request.prototype.pipe = Request.prototype.write;
|
26856 |
|
26857 |
|
26858 |
|
26859 |
|
26860 |
|
26861 |
|
26862 |
|
26863 |
|
26864 |
|
26865 | Request.prototype._isHost = function (obj) {
|
26866 |
|
26867 | return obj && _typeof(obj) === 'object' && !Array.isArray(obj) && Object.prototype.toString.call(obj) !== '[object Object]';
|
26868 | };
|
26869 |
|
26870 |
|
26871 |
|
26872 |
|
26873 |
|
26874 |
|
26875 |
|
26876 |
|
26877 |
|
26878 |
|
26879 | Request.prototype.end = function (fn) {
|
26880 | if (this._endCalled) {
|
26881 | console.warn('Warning: .end() was called twice. This is not supported in superagent');
|
26882 | }
|
26883 |
|
26884 | this._endCalled = true;
|
26885 |
|
26886 | this._callback = fn || noop;
|
26887 |
|
26888 | this._finalizeQueryString();
|
26889 |
|
26890 | this._end();
|
26891 | };
|
26892 |
|
26893 | Request.prototype._setUploadTimeout = function () {
|
26894 | var self = this;
|
26895 |
|
26896 | if (this._uploadTimeout && !this._uploadTimeoutTimer) {
|
26897 | this._uploadTimeoutTimer = setTimeout(function () {
|
26898 | self._timeoutError('Upload timeout of ', self._uploadTimeout, 'ETIMEDOUT');
|
26899 | }, this._uploadTimeout);
|
26900 | }
|
26901 | };
|
26902 |
|
26903 |
|
26904 | Request.prototype._end = function () {
|
26905 | if (this._aborted) return this.callback(new Error('The request has been aborted even before .end() was called'));
|
26906 | var self = this;
|
26907 | this.xhr = request.getXHR();
|
26908 | var xhr = this.xhr;
|
26909 | var data = this._formData || this._data;
|
26910 |
|
26911 | this._setTimeouts();
|
26912 |
|
26913 |
|
26914 | xhr.onreadystatechange = function () {
|
26915 | var readyState = xhr.readyState;
|
26916 |
|
26917 | if (readyState >= 2 && self._responseTimeoutTimer) {
|
26918 | clearTimeout(self._responseTimeoutTimer);
|
26919 | }
|
26920 |
|
26921 | if (readyState !== 4) {
|
26922 | return;
|
26923 | }
|
26924 |
|
26925 |
|
26926 |
|
26927 | var status;
|
26928 |
|
26929 | try {
|
26930 | status = xhr.status;
|
26931 | } catch (_unused5) {
|
26932 | status = 0;
|
26933 | }
|
26934 |
|
26935 | if (!status) {
|
26936 | if (self.timedout || self._aborted) return;
|
26937 | return self.crossDomainError();
|
26938 | }
|
26939 |
|
26940 | self.emit('end');
|
26941 | };
|
26942 |
|
26943 |
|
26944 | var handleProgress = function handleProgress(direction, e) {
|
26945 | if (e.total > 0) {
|
26946 | e.percent = e.loaded / e.total * 100;
|
26947 |
|
26948 | if (e.percent === 100) {
|
26949 | clearTimeout(self._uploadTimeoutTimer);
|
26950 | }
|
26951 | }
|
26952 |
|
26953 | e.direction = direction;
|
26954 | self.emit('progress', e);
|
26955 | };
|
26956 |
|
26957 | if (this.hasListeners('progress')) {
|
26958 | try {
|
26959 | xhr.addEventListener('progress', handleProgress.bind(null, 'download'));
|
26960 |
|
26961 | if (xhr.upload) {
|
26962 | xhr.upload.addEventListener('progress', handleProgress.bind(null, 'upload'));
|
26963 | }
|
26964 | } catch (_unused6) {
|
26965 |
|
26966 |
|
26967 | }
|
26968 | }
|
26969 |
|
26970 | if (xhr.upload) {
|
26971 | this._setUploadTimeout();
|
26972 | }
|
26973 |
|
26974 |
|
26975 | try {
|
26976 | if (this.username && this.password) {
|
26977 | xhr.open(this.method, this.url, true, this.username, this.password);
|
26978 | } else {
|
26979 | xhr.open(this.method, this.url, true);
|
26980 | }
|
26981 | } catch (err) {
|
26982 |
|
26983 | return this.callback(err);
|
26984 | }
|
26985 |
|
26986 |
|
26987 | if (this._withCredentials) xhr.withCredentials = true;
|
26988 |
|
26989 | if (!this._formData && this.method !== 'GET' && this.method !== 'HEAD' && typeof data !== 'string' && !this._isHost(data)) {
|
26990 |
|
26991 | var contentType = this._header['content-type'];
|
26992 |
|
26993 | var _serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : ''];
|
26994 |
|
26995 | if (!_serialize && isJSON(contentType)) {
|
26996 | _serialize = request.serialize['application/json'];
|
26997 | }
|
26998 |
|
26999 | if (_serialize) data = _serialize(data);
|
27000 | }
|
27001 |
|
27002 |
|
27003 | for (var field in this.header) {
|
27004 | if (this.header[field] === null) continue;
|
27005 | if (Object.prototype.hasOwnProperty.call(this.header, field)) xhr.setRequestHeader(field, this.header[field]);
|
27006 | }
|
27007 |
|
27008 | if (this._responseType) {
|
27009 | xhr.responseType = this._responseType;
|
27010 | }
|
27011 |
|
27012 |
|
27013 | this.emit('request', this);
|
27014 |
|
27015 |
|
27016 | xhr.send(typeof data === 'undefined' ? null : data);
|
27017 | };
|
27018 |
|
27019 | request.agent = function () {
|
27020 | return new Agent();
|
27021 | };
|
27022 |
|
27023 | ['GET', 'POST', 'OPTIONS', 'PATCH', 'PUT', 'DELETE'].forEach(function (method) {
|
27024 | Agent.prototype[method.toLowerCase()] = function (url, fn) {
|
27025 | var req = new request.Request(method, url);
|
27026 |
|
27027 | this._setDefaults(req);
|
27028 |
|
27029 | if (fn) {
|
27030 | req.end(fn);
|
27031 | }
|
27032 |
|
27033 | return req;
|
27034 | };
|
27035 | });
|
27036 | Agent.prototype.del = Agent.prototype.delete;
|
27037 |
|
27038 |
|
27039 |
|
27040 |
|
27041 |
|
27042 |
|
27043 |
|
27044 |
|
27045 |
|
27046 |
|
27047 | request.get = function (url, data, fn) {
|
27048 | var req = request('GET', url);
|
27049 |
|
27050 | if (typeof data === 'function') {
|
27051 | fn = data;
|
27052 | data = null;
|
27053 | }
|
27054 |
|
27055 | if (data) req.query(data);
|
27056 | if (fn) req.end(fn);
|
27057 | return req;
|
27058 | };
|
27059 |
|
27060 |
|
27061 |
|
27062 |
|
27063 |
|
27064 |
|
27065 |
|
27066 |
|
27067 |
|
27068 |
|
27069 |
|
27070 | request.head = function (url, data, fn) {
|
27071 | var req = request('HEAD', url);
|
27072 |
|
27073 | if (typeof data === 'function') {
|
27074 | fn = data;
|
27075 | data = null;
|
27076 | }
|
27077 |
|
27078 | if (data) req.query(data);
|
27079 | if (fn) req.end(fn);
|
27080 | return req;
|
27081 | };
|
27082 |
|
27083 |
|
27084 |
|
27085 |
|
27086 |
|
27087 |
|
27088 |
|
27089 |
|
27090 |
|
27091 |
|
27092 |
|
27093 | request.options = function (url, data, fn) {
|
27094 | var req = request('OPTIONS', url);
|
27095 |
|
27096 | if (typeof data === 'function') {
|
27097 | fn = data;
|
27098 | data = null;
|
27099 | }
|
27100 |
|
27101 | if (data) req.send(data);
|
27102 | if (fn) req.end(fn);
|
27103 | return req;
|
27104 | };
|
27105 |
|
27106 |
|
27107 |
|
27108 |
|
27109 |
|
27110 |
|
27111 |
|
27112 |
|
27113 |
|
27114 |
|
27115 |
|
27116 | function del(url, data, fn) {
|
27117 | var req = request('DELETE', url);
|
27118 |
|
27119 | if (typeof data === 'function') {
|
27120 | fn = data;
|
27121 | data = null;
|
27122 | }
|
27123 |
|
27124 | if (data) req.send(data);
|
27125 | if (fn) req.end(fn);
|
27126 | return req;
|
27127 | }
|
27128 |
|
27129 | request.del = del;
|
27130 | request.delete = del;
|
27131 |
|
27132 |
|
27133 |
|
27134 |
|
27135 |
|
27136 |
|
27137 |
|
27138 |
|
27139 |
|
27140 |
|
27141 | request.patch = function (url, data, fn) {
|
27142 | var req = request('PATCH', url);
|
27143 |
|
27144 | if (typeof data === 'function') {
|
27145 | fn = data;
|
27146 | data = null;
|
27147 | }
|
27148 |
|
27149 | if (data) req.send(data);
|
27150 | if (fn) req.end(fn);
|
27151 | return req;
|
27152 | };
|
27153 |
|
27154 |
|
27155 |
|
27156 |
|
27157 |
|
27158 |
|
27159 |
|
27160 |
|
27161 |
|
27162 |
|
27163 |
|
27164 | request.post = function (url, data, fn) {
|
27165 | var req = request('POST', url);
|
27166 |
|
27167 | if (typeof data === 'function') {
|
27168 | fn = data;
|
27169 | data = null;
|
27170 | }
|
27171 |
|
27172 | if (data) req.send(data);
|
27173 | if (fn) req.end(fn);
|
27174 | return req;
|
27175 | };
|
27176 |
|
27177 |
|
27178 |
|
27179 |
|
27180 |
|
27181 |
|
27182 |
|
27183 |
|
27184 |
|
27185 |
|
27186 |
|
27187 | request.put = function (url, data, fn) {
|
27188 | var req = request('PUT', url);
|
27189 |
|
27190 | if (typeof data === 'function') {
|
27191 | fn = data;
|
27192 | data = null;
|
27193 | }
|
27194 |
|
27195 | if (data) req.send(data);
|
27196 | if (fn) req.end(fn);
|
27197 | return req;
|
27198 | };
|
27199 |
|
27200 | }),
|
27201 |
|
27202 | (function(module, exports, __webpack_require__) {
|
27203 |
|
27204 | module.exports = __webpack_require__(577);
|
27205 |
|
27206 | }),
|
27207 |
|
27208 | (function(module, exports, __webpack_require__) {
|
27209 |
|
27210 | var parent = __webpack_require__(578);
|
27211 |
|
27212 | module.exports = parent;
|
27213 |
|
27214 |
|
27215 | }),
|
27216 |
|
27217 | (function(module, exports, __webpack_require__) {
|
27218 |
|
27219 | var isPrototypeOf = __webpack_require__(16);
|
27220 | var method = __webpack_require__(579);
|
27221 |
|
27222 | var StringPrototype = String.prototype;
|
27223 |
|
27224 | module.exports = function (it) {
|
27225 | var own = it.trim;
|
27226 | return typeof it == 'string' || it === StringPrototype
|
27227 | || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.trim) ? method : own;
|
27228 | };
|
27229 |
|
27230 |
|
27231 | }),
|
27232 |
|
27233 | (function(module, exports, __webpack_require__) {
|
27234 |
|
27235 | __webpack_require__(580);
|
27236 | var entryVirtual = __webpack_require__(27);
|
27237 |
|
27238 | module.exports = entryVirtual('String').trim;
|
27239 |
|
27240 |
|
27241 | }),
|
27242 |
|
27243 | (function(module, exports, __webpack_require__) {
|
27244 |
|
27245 | "use strict";
|
27246 |
|
27247 | var $ = __webpack_require__(0);
|
27248 | var $trim = __webpack_require__(581).trim;
|
27249 | var forcedStringTrimMethod = __webpack_require__(582);
|
27250 |
|
27251 |
|
27252 |
|
27253 | $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
27254 | trim: function trim() {
|
27255 | return $trim(this);
|
27256 | }
|
27257 | });
|
27258 |
|
27259 |
|
27260 | }),
|
27261 |
|
27262 | (function(module, exports, __webpack_require__) {
|
27263 |
|
27264 | var uncurryThis = __webpack_require__(4);
|
27265 | var requireObjectCoercible = __webpack_require__(81);
|
27266 | var toString = __webpack_require__(42);
|
27267 | var whitespaces = __webpack_require__(259);
|
27268 |
|
27269 | var replace = uncurryThis(''.replace);
|
27270 | var whitespace = '[' + whitespaces + ']';
|
27271 | var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
27272 | var rtrim = RegExp(whitespace + whitespace + '*$');
|
27273 |
|
27274 |
|
27275 | var createMethod = function (TYPE) {
|
27276 | return function ($this) {
|
27277 | var string = toString(requireObjectCoercible($this));
|
27278 | if (TYPE & 1) string = replace(string, ltrim, '');
|
27279 | if (TYPE & 2) string = replace(string, rtrim, '');
|
27280 | return string;
|
27281 | };
|
27282 | };
|
27283 |
|
27284 | module.exports = {
|
27285 |
|
27286 |
|
27287 | start: createMethod(1),
|
27288 |
|
27289 |
|
27290 | end: createMethod(2),
|
27291 |
|
27292 |
|
27293 | trim: createMethod(3)
|
27294 | };
|
27295 |
|
27296 |
|
27297 | }),
|
27298 |
|
27299 | (function(module, exports, __webpack_require__) {
|
27300 |
|
27301 | var PROPER_FUNCTION_NAME = __webpack_require__(169).PROPER;
|
27302 | var fails = __webpack_require__(2);
|
27303 | var whitespaces = __webpack_require__(259);
|
27304 |
|
27305 | var non = '\u200B\u0085\u180E';
|
27306 |
|
27307 |
|
27308 |
|
27309 | module.exports = function (METHOD_NAME) {
|
27310 | return fails(function () {
|
27311 | return !!whitespaces[METHOD_NAME]()
|
27312 | || non[METHOD_NAME]() !== non
|
27313 | || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
|
27314 | });
|
27315 | };
|
27316 |
|
27317 |
|
27318 | }),
|
27319 |
|
27320 | (function(module, exports, __webpack_require__) {
|
27321 |
|
27322 |
|
27323 |
|
27324 |
|
27325 |
|
27326 |
|
27327 | if (true) {
|
27328 | module.exports = Emitter;
|
27329 | }
|
27330 |
|
27331 |
|
27332 |
|
27333 |
|
27334 |
|
27335 |
|
27336 |
|
27337 | function Emitter(obj) {
|
27338 | if (obj) return mixin(obj);
|
27339 | };
|
27340 |
|
27341 |
|
27342 |
|
27343 |
|
27344 |
|
27345 |
|
27346 |
|
27347 |
|
27348 |
|
27349 | function mixin(obj) {
|
27350 | for (var key in Emitter.prototype) {
|
27351 | obj[key] = Emitter.prototype[key];
|
27352 | }
|
27353 | return obj;
|
27354 | }
|
27355 |
|
27356 |
|
27357 |
|
27358 |
|
27359 |
|
27360 |
|
27361 |
|
27362 |
|
27363 |
|
27364 |
|
27365 | Emitter.prototype.on =
|
27366 | Emitter.prototype.addEventListener = function(event, fn){
|
27367 | this._callbacks = this._callbacks || {};
|
27368 | (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
|
27369 | .push(fn);
|
27370 | return this;
|
27371 | };
|
27372 |
|
27373 |
|
27374 |
|
27375 |
|
27376 |
|
27377 |
|
27378 |
|
27379 |
|
27380 |
|
27381 |
|
27382 |
|
27383 | Emitter.prototype.once = function(event, fn){
|
27384 | function on() {
|
27385 | this.off(event, on);
|
27386 | fn.apply(this, arguments);
|
27387 | }
|
27388 |
|
27389 | on.fn = fn;
|
27390 | this.on(event, on);
|
27391 | return this;
|
27392 | };
|
27393 |
|
27394 |
|
27395 |
|
27396 |
|
27397 |
|
27398 |
|
27399 |
|
27400 |
|
27401 |
|
27402 |
|
27403 |
|
27404 | Emitter.prototype.off =
|
27405 | Emitter.prototype.removeListener =
|
27406 | Emitter.prototype.removeAllListeners =
|
27407 | Emitter.prototype.removeEventListener = function(event, fn){
|
27408 | this._callbacks = this._callbacks || {};
|
27409 |
|
27410 |
|
27411 | if (0 == arguments.length) {
|
27412 | this._callbacks = {};
|
27413 | return this;
|
27414 | }
|
27415 |
|
27416 |
|
27417 | var callbacks = this._callbacks['$' + event];
|
27418 | if (!callbacks) return this;
|
27419 |
|
27420 |
|
27421 | if (1 == arguments.length) {
|
27422 | delete this._callbacks['$' + event];
|
27423 | return this;
|
27424 | }
|
27425 |
|
27426 |
|
27427 | var cb;
|
27428 | for (var i = 0; i < callbacks.length; i++) {
|
27429 | cb = callbacks[i];
|
27430 | if (cb === fn || cb.fn === fn) {
|
27431 | callbacks.splice(i, 1);
|
27432 | break;
|
27433 | }
|
27434 | }
|
27435 |
|
27436 |
|
27437 |
|
27438 | if (callbacks.length === 0) {
|
27439 | delete this._callbacks['$' + event];
|
27440 | }
|
27441 |
|
27442 | return this;
|
27443 | };
|
27444 |
|
27445 |
|
27446 |
|
27447 |
|
27448 |
|
27449 |
|
27450 |
|
27451 |
|
27452 |
|
27453 | Emitter.prototype.emit = function(event){
|
27454 | this._callbacks = this._callbacks || {};
|
27455 |
|
27456 | var args = new Array(arguments.length - 1)
|
27457 | , callbacks = this._callbacks['$' + event];
|
27458 |
|
27459 | for (var i = 1; i < arguments.length; i++) {
|
27460 | args[i - 1] = arguments[i];
|
27461 | }
|
27462 |
|
27463 | if (callbacks) {
|
27464 | callbacks = callbacks.slice(0);
|
27465 | for (var i = 0, len = callbacks.length; i < len; ++i) {
|
27466 | callbacks[i].apply(this, args);
|
27467 | }
|
27468 | }
|
27469 |
|
27470 | return this;
|
27471 | };
|
27472 |
|
27473 |
|
27474 |
|
27475 |
|
27476 |
|
27477 |
|
27478 |
|
27479 |
|
27480 |
|
27481 | Emitter.prototype.listeners = function(event){
|
27482 | this._callbacks = this._callbacks || {};
|
27483 | return this._callbacks['$' + event] || [];
|
27484 | };
|
27485 |
|
27486 |
|
27487 |
|
27488 |
|
27489 |
|
27490 |
|
27491 |
|
27492 |
|
27493 |
|
27494 | Emitter.prototype.hasListeners = function(event){
|
27495 | return !! this.listeners(event).length;
|
27496 | };
|
27497 |
|
27498 |
|
27499 | }),
|
27500 |
|
27501 | (function(module, exports) {
|
27502 |
|
27503 | module.exports = stringify
|
27504 | stringify.default = stringify
|
27505 | stringify.stable = deterministicStringify
|
27506 | stringify.stableStringify = deterministicStringify
|
27507 |
|
27508 | var LIMIT_REPLACE_NODE = '[...]'
|
27509 | var CIRCULAR_REPLACE_NODE = '[Circular]'
|
27510 |
|
27511 | var arr = []
|
27512 | var replacerStack = []
|
27513 |
|
27514 | function defaultOptions () {
|
27515 | return {
|
27516 | depthLimit: Number.MAX_SAFE_INTEGER,
|
27517 | edgesLimit: Number.MAX_SAFE_INTEGER
|
27518 | }
|
27519 | }
|
27520 |
|
27521 |
|
27522 | function stringify (obj, replacer, spacer, options) {
|
27523 | if (typeof options === 'undefined') {
|
27524 | options = defaultOptions()
|
27525 | }
|
27526 |
|
27527 | decirc(obj, '', 0, [], undefined, 0, options)
|
27528 | var res
|
27529 | try {
|
27530 | if (replacerStack.length === 0) {
|
27531 | res = JSON.stringify(obj, replacer, spacer)
|
27532 | } else {
|
27533 | res = JSON.stringify(obj, replaceGetterValues(replacer), spacer)
|
27534 | }
|
27535 | } catch (_) {
|
27536 | return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]')
|
27537 | } finally {
|
27538 | while (arr.length !== 0) {
|
27539 | var part = arr.pop()
|
27540 | if (part.length === 4) {
|
27541 | Object.defineProperty(part[0], part[1], part[3])
|
27542 | } else {
|
27543 | part[0][part[1]] = part[2]
|
27544 | }
|
27545 | }
|
27546 | }
|
27547 | return res
|
27548 | }
|
27549 |
|
27550 | function setReplace (replace, val, k, parent) {
|
27551 | var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k)
|
27552 | if (propertyDescriptor.get !== undefined) {
|
27553 | if (propertyDescriptor.configurable) {
|
27554 | Object.defineProperty(parent, k, { value: replace })
|
27555 | arr.push([parent, k, val, propertyDescriptor])
|
27556 | } else {
|
27557 | replacerStack.push([val, k, replace])
|
27558 | }
|
27559 | } else {
|
27560 | parent[k] = replace
|
27561 | arr.push([parent, k, val])
|
27562 | }
|
27563 | }
|
27564 |
|
27565 | function decirc (val, k, edgeIndex, stack, parent, depth, options) {
|
27566 | depth += 1
|
27567 | var i
|
27568 | if (typeof val === 'object' && val !== null) {
|
27569 | for (i = 0; i < stack.length; i++) {
|
27570 | if (stack[i] === val) {
|
27571 | setReplace(CIRCULAR_REPLACE_NODE, val, k, parent)
|
27572 | return
|
27573 | }
|
27574 | }
|
27575 |
|
27576 | if (
|
27577 | typeof options.depthLimit !== 'undefined' &&
|
27578 | depth > options.depthLimit
|
27579 | ) {
|
27580 | setReplace(LIMIT_REPLACE_NODE, val, k, parent)
|
27581 | return
|
27582 | }
|
27583 |
|
27584 | if (
|
27585 | typeof options.edgesLimit !== 'undefined' &&
|
27586 | edgeIndex + 1 > options.edgesLimit
|
27587 | ) {
|
27588 | setReplace(LIMIT_REPLACE_NODE, val, k, parent)
|
27589 | return
|
27590 | }
|
27591 |
|
27592 | stack.push(val)
|
27593 |
|
27594 | if (Array.isArray(val)) {
|
27595 | for (i = 0; i < val.length; i++) {
|
27596 | decirc(val[i], i, i, stack, val, depth, options)
|
27597 | }
|
27598 | } else {
|
27599 | var keys = Object.keys(val)
|
27600 | for (i = 0; i < keys.length; i++) {
|
27601 | var key = keys[i]
|
27602 | decirc(val[key], key, i, stack, val, depth, options)
|
27603 | }
|
27604 | }
|
27605 | stack.pop()
|
27606 | }
|
27607 | }
|
27608 |
|
27609 |
|
27610 | function compareFunction (a, b) {
|
27611 | if (a < b) {
|
27612 | return -1
|
27613 | }
|
27614 | if (a > b) {
|
27615 | return 1
|
27616 | }
|
27617 | return 0
|
27618 | }
|
27619 |
|
27620 | function deterministicStringify (obj, replacer, spacer, options) {
|
27621 | if (typeof options === 'undefined') {
|
27622 | options = defaultOptions()
|
27623 | }
|
27624 |
|
27625 | var tmp = deterministicDecirc(obj, '', 0, [], undefined, 0, options) || obj
|
27626 | var res
|
27627 | try {
|
27628 | if (replacerStack.length === 0) {
|
27629 | res = JSON.stringify(tmp, replacer, spacer)
|
27630 | } else {
|
27631 | res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer)
|
27632 | }
|
27633 | } catch (_) {
|
27634 | return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]')
|
27635 | } finally {
|
27636 |
|
27637 | while (arr.length !== 0) {
|
27638 | var part = arr.pop()
|
27639 | if (part.length === 4) {
|
27640 | Object.defineProperty(part[0], part[1], part[3])
|
27641 | } else {
|
27642 | part[0][part[1]] = part[2]
|
27643 | }
|
27644 | }
|
27645 | }
|
27646 | return res
|
27647 | }
|
27648 |
|
27649 | function deterministicDecirc (val, k, edgeIndex, stack, parent, depth, options) {
|
27650 | depth += 1
|
27651 | var i
|
27652 | if (typeof val === 'object' && val !== null) {
|
27653 | for (i = 0; i < stack.length; i++) {
|
27654 | if (stack[i] === val) {
|
27655 | setReplace(CIRCULAR_REPLACE_NODE, val, k, parent)
|
27656 | return
|
27657 | }
|
27658 | }
|
27659 | try {
|
27660 | if (typeof val.toJSON === 'function') {
|
27661 | return
|
27662 | }
|
27663 | } catch (_) {
|
27664 | return
|
27665 | }
|
27666 |
|
27667 | if (
|
27668 | typeof options.depthLimit !== 'undefined' &&
|
27669 | depth > options.depthLimit
|
27670 | ) {
|
27671 | setReplace(LIMIT_REPLACE_NODE, val, k, parent)
|
27672 | return
|
27673 | }
|
27674 |
|
27675 | if (
|
27676 | typeof options.edgesLimit !== 'undefined' &&
|
27677 | edgeIndex + 1 > options.edgesLimit
|
27678 | ) {
|
27679 | setReplace(LIMIT_REPLACE_NODE, val, k, parent)
|
27680 | return
|
27681 | }
|
27682 |
|
27683 | stack.push(val)
|
27684 |
|
27685 | if (Array.isArray(val)) {
|
27686 | for (i = 0; i < val.length; i++) {
|
27687 | deterministicDecirc(val[i], i, i, stack, val, depth, options)
|
27688 | }
|
27689 | } else {
|
27690 |
|
27691 | var tmp = {}
|
27692 | var keys = Object.keys(val).sort(compareFunction)
|
27693 | for (i = 0; i < keys.length; i++) {
|
27694 | var key = keys[i]
|
27695 | deterministicDecirc(val[key], key, i, stack, val, depth, options)
|
27696 | tmp[key] = val[key]
|
27697 | }
|
27698 | if (typeof parent !== 'undefined') {
|
27699 | arr.push([parent, k, val])
|
27700 | parent[k] = tmp
|
27701 | } else {
|
27702 | return tmp
|
27703 | }
|
27704 | }
|
27705 | stack.pop()
|
27706 | }
|
27707 | }
|
27708 |
|
27709 |
|
27710 |
|
27711 | function replaceGetterValues (replacer) {
|
27712 | replacer =
|
27713 | typeof replacer !== 'undefined'
|
27714 | ? replacer
|
27715 | : function (k, v) {
|
27716 | return v
|
27717 | }
|
27718 | return function (key, val) {
|
27719 | if (replacerStack.length > 0) {
|
27720 | for (var i = 0; i < replacerStack.length; i++) {
|
27721 | var part = replacerStack[i]
|
27722 | if (part[1] === key && part[0] === val) {
|
27723 | val = part[2]
|
27724 | replacerStack.splice(i, 1)
|
27725 | break
|
27726 | }
|
27727 | }
|
27728 | }
|
27729 | return replacer.call(this, key, val)
|
27730 | }
|
27731 | }
|
27732 |
|
27733 |
|
27734 | }),
|
27735 |
|
27736 | (function(module, exports, __webpack_require__) {
|
27737 |
|
27738 | "use strict";
|
27739 |
|
27740 |
|
27741 | var _interopRequireDefault = __webpack_require__(1);
|
27742 |
|
27743 | var _symbol = _interopRequireDefault(__webpack_require__(77));
|
27744 |
|
27745 | var _iterator = _interopRequireDefault(__webpack_require__(154));
|
27746 |
|
27747 | var _includes = _interopRequireDefault(__webpack_require__(586));
|
27748 |
|
27749 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
27750 |
|
27751 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
27752 |
|
27753 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
27754 |
|
27755 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
27756 |
|
27757 | var _sort = _interopRequireDefault(__webpack_require__(596));
|
27758 |
|
27759 | function _typeof(obj) {
|
27760 | "@babel/helpers - typeof";
|
27761 |
|
27762 | if (typeof _symbol.default === "function" && typeof _iterator.default === "symbol") {
|
27763 | _typeof = function _typeof(obj) {
|
27764 | return typeof obj;
|
27765 | };
|
27766 | } else {
|
27767 | _typeof = function _typeof(obj) {
|
27768 | return obj && typeof _symbol.default === "function" && obj.constructor === _symbol.default && obj !== _symbol.default.prototype ? "symbol" : typeof obj;
|
27769 | };
|
27770 | }
|
27771 |
|
27772 | return _typeof(obj);
|
27773 | }
|
27774 |
|
27775 |
|
27776 |
|
27777 |
|
27778 |
|
27779 | var isObject = __webpack_require__(260);
|
27780 |
|
27781 |
|
27782 |
|
27783 |
|
27784 |
|
27785 | module.exports = RequestBase;
|
27786 |
|
27787 |
|
27788 |
|
27789 |
|
27790 |
|
27791 |
|
27792 | function RequestBase(obj) {
|
27793 | if (obj) return mixin(obj);
|
27794 | }
|
27795 |
|
27796 |
|
27797 |
|
27798 |
|
27799 |
|
27800 |
|
27801 |
|
27802 |
|
27803 |
|
27804 | function mixin(obj) {
|
27805 | for (var key in RequestBase.prototype) {
|
27806 | if (Object.prototype.hasOwnProperty.call(RequestBase.prototype, key)) obj[key] = RequestBase.prototype[key];
|
27807 | }
|
27808 |
|
27809 | return obj;
|
27810 | }
|
27811 |
|
27812 |
|
27813 |
|
27814 |
|
27815 |
|
27816 |
|
27817 |
|
27818 |
|
27819 | RequestBase.prototype.clearTimeout = function () {
|
27820 | clearTimeout(this._timer);
|
27821 | clearTimeout(this._responseTimeoutTimer);
|
27822 | clearTimeout(this._uploadTimeoutTimer);
|
27823 | delete this._timer;
|
27824 | delete this._responseTimeoutTimer;
|
27825 | delete this._uploadTimeoutTimer;
|
27826 | return this;
|
27827 | };
|
27828 |
|
27829 |
|
27830 |
|
27831 |
|
27832 |
|
27833 |
|
27834 |
|
27835 |
|
27836 |
|
27837 |
|
27838 | RequestBase.prototype.parse = function (fn) {
|
27839 | this._parser = fn;
|
27840 | return this;
|
27841 | };
|
27842 |
|
27843 |
|
27844 |
|
27845 |
|
27846 |
|
27847 |
|
27848 |
|
27849 |
|
27850 |
|
27851 |
|
27852 |
|
27853 |
|
27854 |
|
27855 |
|
27856 |
|
27857 |
|
27858 |
|
27859 |
|
27860 |
|
27861 | RequestBase.prototype.responseType = function (val) {
|
27862 | this._responseType = val;
|
27863 | return this;
|
27864 | };
|
27865 |
|
27866 |
|
27867 |
|
27868 |
|
27869 |
|
27870 |
|
27871 |
|
27872 |
|
27873 |
|
27874 |
|
27875 | RequestBase.prototype.serialize = function (fn) {
|
27876 | this._serializer = fn;
|
27877 | return this;
|
27878 | };
|
27879 |
|
27880 |
|
27881 |
|
27882 |
|
27883 |
|
27884 |
|
27885 |
|
27886 |
|
27887 |
|
27888 |
|
27889 |
|
27890 |
|
27891 |
|
27892 |
|
27893 |
|
27894 | RequestBase.prototype.timeout = function (options) {
|
27895 | if (!options || _typeof(options) !== 'object') {
|
27896 | this._timeout = options;
|
27897 | this._responseTimeout = 0;
|
27898 | this._uploadTimeout = 0;
|
27899 | return this;
|
27900 | }
|
27901 |
|
27902 | for (var option in options) {
|
27903 | if (Object.prototype.hasOwnProperty.call(options, option)) {
|
27904 | switch (option) {
|
27905 | case 'deadline':
|
27906 | this._timeout = options.deadline;
|
27907 | break;
|
27908 |
|
27909 | case 'response':
|
27910 | this._responseTimeout = options.response;
|
27911 | break;
|
27912 |
|
27913 | case 'upload':
|
27914 | this._uploadTimeout = options.upload;
|
27915 | break;
|
27916 |
|
27917 | default:
|
27918 | console.warn('Unknown timeout option', option);
|
27919 | }
|
27920 | }
|
27921 | }
|
27922 |
|
27923 | return this;
|
27924 | };
|
27925 |
|
27926 |
|
27927 |
|
27928 |
|
27929 |
|
27930 |
|
27931 |
|
27932 |
|
27933 |
|
27934 |
|
27935 |
|
27936 |
|
27937 | RequestBase.prototype.retry = function (count, fn) {
|
27938 |
|
27939 | if (arguments.length === 0 || count === true) count = 1;
|
27940 | if (count <= 0) count = 0;
|
27941 | this._maxRetries = count;
|
27942 | this._retries = 0;
|
27943 | this._retryCallback = fn;
|
27944 | return this;
|
27945 | };
|
27946 |
|
27947 | var ERROR_CODES = ['ECONNRESET', 'ETIMEDOUT', 'EADDRINFO', 'ESOCKETTIMEDOUT'];
|
27948 |
|
27949 |
|
27950 |
|
27951 |
|
27952 |
|
27953 |
|
27954 |
|
27955 |
|
27956 |
|
27957 | RequestBase.prototype._shouldRetry = function (err, res) {
|
27958 | if (!this._maxRetries || this._retries++ >= this._maxRetries) {
|
27959 | return false;
|
27960 | }
|
27961 |
|
27962 | if (this._retryCallback) {
|
27963 | try {
|
27964 | var override = this._retryCallback(err, res);
|
27965 |
|
27966 | if (override === true) return true;
|
27967 | if (override === false) return false;
|
27968 | } catch (err_) {
|
27969 | console.error(err_);
|
27970 | }
|
27971 | }
|
27972 |
|
27973 | if (res && res.status && res.status >= 500 && res.status !== 501) return true;
|
27974 |
|
27975 | if (err) {
|
27976 | if (err.code && (0, _includes.default)(ERROR_CODES).call(ERROR_CODES, err.code)) return true;
|
27977 |
|
27978 | if (err.timeout && err.code === 'ECONNABORTED') return true;
|
27979 | if (err.crossDomain) return true;
|
27980 | }
|
27981 |
|
27982 | return false;
|
27983 | };
|
27984 |
|
27985 |
|
27986 |
|
27987 |
|
27988 |
|
27989 |
|
27990 |
|
27991 |
|
27992 | RequestBase.prototype._retry = function () {
|
27993 | this.clearTimeout();
|
27994 |
|
27995 | if (this.req) {
|
27996 | this.req = null;
|
27997 | this.req = this.request();
|
27998 | }
|
27999 |
|
28000 | this._aborted = false;
|
28001 | this.timedout = false;
|
28002 | this.timedoutError = null;
|
28003 | return this._end();
|
28004 | };
|
28005 |
|
28006 |
|
28007 |
|
28008 |
|
28009 |
|
28010 |
|
28011 |
|
28012 |
|
28013 |
|
28014 | RequestBase.prototype.then = function (resolve, reject) {
|
28015 | var _this = this;
|
28016 |
|
28017 | if (!this._fullfilledPromise) {
|
28018 | var self = this;
|
28019 |
|
28020 | if (this._endCalled) {
|
28021 | console.warn('Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises');
|
28022 | }
|
28023 |
|
28024 | this._fullfilledPromise = new _promise.default(function (resolve, reject) {
|
28025 | self.on('abort', function () {
|
28026 | if (_this._maxRetries && _this._maxRetries > _this._retries) {
|
28027 | return;
|
28028 | }
|
28029 |
|
28030 | if (_this.timedout && _this.timedoutError) {
|
28031 | reject(_this.timedoutError);
|
28032 | return;
|
28033 | }
|
28034 |
|
28035 | var err = new Error('Aborted');
|
28036 | err.code = 'ABORTED';
|
28037 | err.status = _this.status;
|
28038 | err.method = _this.method;
|
28039 | err.url = _this.url;
|
28040 | reject(err);
|
28041 | });
|
28042 | self.end(function (err, res) {
|
28043 | if (err) reject(err);else resolve(res);
|
28044 | });
|
28045 | });
|
28046 | }
|
28047 |
|
28048 | return this._fullfilledPromise.then(resolve, reject);
|
28049 | };
|
28050 |
|
28051 | RequestBase.prototype.catch = function (cb) {
|
28052 | return this.then(undefined, cb);
|
28053 | };
|
28054 |
|
28055 |
|
28056 |
|
28057 |
|
28058 |
|
28059 | RequestBase.prototype.use = function (fn) {
|
28060 | fn(this);
|
28061 | return this;
|
28062 | };
|
28063 |
|
28064 | RequestBase.prototype.ok = function (cb) {
|
28065 | if (typeof cb !== 'function') throw new Error('Callback required');
|
28066 | this._okCallback = cb;
|
28067 | return this;
|
28068 | };
|
28069 |
|
28070 | RequestBase.prototype._isResponseOK = function (res) {
|
28071 | if (!res) {
|
28072 | return false;
|
28073 | }
|
28074 |
|
28075 | if (this._okCallback) {
|
28076 | return this._okCallback(res);
|
28077 | }
|
28078 |
|
28079 | return res.status >= 200 && res.status < 300;
|
28080 | };
|
28081 |
|
28082 |
|
28083 |
|
28084 |
|
28085 |
|
28086 |
|
28087 |
|
28088 |
|
28089 |
|
28090 |
|
28091 | RequestBase.prototype.get = function (field) {
|
28092 | return this._header[field.toLowerCase()];
|
28093 | };
|
28094 |
|
28095 |
|
28096 |
|
28097 |
|
28098 |
|
28099 |
|
28100 |
|
28101 |
|
28102 |
|
28103 |
|
28104 |
|
28105 |
|
28106 |
|
28107 | RequestBase.prototype.getHeader = RequestBase.prototype.get;
|
28108 |
|
28109 |
|
28110 |
|
28111 |
|
28112 |
|
28113 |
|
28114 |
|
28115 |
|
28116 |
|
28117 |
|
28118 |
|
28119 |
|
28120 |
|
28121 |
|
28122 |
|
28123 |
|
28124 |
|
28125 |
|
28126 |
|
28127 |
|
28128 |
|
28129 | RequestBase.prototype.set = function (field, val) {
|
28130 | if (isObject(field)) {
|
28131 | for (var key in field) {
|
28132 | if (Object.prototype.hasOwnProperty.call(field, key)) this.set(key, field[key]);
|
28133 | }
|
28134 |
|
28135 | return this;
|
28136 | }
|
28137 |
|
28138 | this._header[field.toLowerCase()] = val;
|
28139 | this.header[field] = val;
|
28140 | return this;
|
28141 | };
|
28142 |
|
28143 |
|
28144 |
|
28145 |
|
28146 |
|
28147 |
|
28148 |
|
28149 |
|
28150 |
|
28151 |
|
28152 |
|
28153 |
|
28154 |
|
28155 |
|
28156 | RequestBase.prototype.unset = function (field) {
|
28157 | delete this._header[field.toLowerCase()];
|
28158 | delete this.header[field];
|
28159 | return this;
|
28160 | };
|
28161 |
|
28162 |
|
28163 |
|
28164 |
|
28165 |
|
28166 |
|
28167 |
|
28168 |
|
28169 |
|
28170 |
|
28171 |
|
28172 |
|
28173 |
|
28174 |
|
28175 |
|
28176 |
|
28177 |
|
28178 |
|
28179 |
|
28180 |
|
28181 |
|
28182 | RequestBase.prototype.field = function (name, val) {
|
28183 |
|
28184 | if (name === null || undefined === name) {
|
28185 | throw new Error('.field(name, val) name can not be empty');
|
28186 | }
|
28187 |
|
28188 | if (this._data) {
|
28189 | throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");
|
28190 | }
|
28191 |
|
28192 | if (isObject(name)) {
|
28193 | for (var key in name) {
|
28194 | if (Object.prototype.hasOwnProperty.call(name, key)) this.field(key, name[key]);
|
28195 | }
|
28196 |
|
28197 | return this;
|
28198 | }
|
28199 |
|
28200 | if (Array.isArray(val)) {
|
28201 | for (var i in val) {
|
28202 | if (Object.prototype.hasOwnProperty.call(val, i)) this.field(name, val[i]);
|
28203 | }
|
28204 |
|
28205 | return this;
|
28206 | }
|
28207 |
|
28208 |
|
28209 | if (val === null || undefined === val) {
|
28210 | throw new Error('.field(name, val) val can not be empty');
|
28211 | }
|
28212 |
|
28213 | if (typeof val === 'boolean') {
|
28214 | val = String(val);
|
28215 | }
|
28216 |
|
28217 | this._getFormData().append(name, val);
|
28218 |
|
28219 | return this;
|
28220 | };
|
28221 |
|
28222 |
|
28223 |
|
28224 |
|
28225 |
|
28226 |
|
28227 |
|
28228 |
|
28229 | RequestBase.prototype.abort = function () {
|
28230 | if (this._aborted) {
|
28231 | return this;
|
28232 | }
|
28233 |
|
28234 | this._aborted = true;
|
28235 | if (this.xhr) this.xhr.abort();
|
28236 |
|
28237 | if (this.req) this.req.abort();
|
28238 |
|
28239 | this.clearTimeout();
|
28240 | this.emit('abort');
|
28241 | return this;
|
28242 | };
|
28243 |
|
28244 | RequestBase.prototype._auth = function (user, pass, options, base64Encoder) {
|
28245 | var _context;
|
28246 |
|
28247 | switch (options.type) {
|
28248 | case 'basic':
|
28249 | this.set('Authorization', "Basic ".concat(base64Encoder((0, _concat.default)(_context = "".concat(user, ":")).call(_context, pass))));
|
28250 | break;
|
28251 |
|
28252 | case 'auto':
|
28253 | this.username = user;
|
28254 | this.password = pass;
|
28255 | break;
|
28256 |
|
28257 | case 'bearer':
|
28258 |
|
28259 | this.set('Authorization', "Bearer ".concat(user));
|
28260 | break;
|
28261 |
|
28262 | default:
|
28263 | break;
|
28264 | }
|
28265 |
|
28266 | return this;
|
28267 | };
|
28268 |
|
28269 |
|
28270 |
|
28271 |
|
28272 |
|
28273 |
|
28274 |
|
28275 |
|
28276 |
|
28277 |
|
28278 |
|
28279 |
|
28280 | RequestBase.prototype.withCredentials = function (on) {
|
28281 |
|
28282 | if (on === undefined) on = true;
|
28283 | this._withCredentials = on;
|
28284 | return this;
|
28285 | };
|
28286 |
|
28287 |
|
28288 |
|
28289 |
|
28290 |
|
28291 |
|
28292 |
|
28293 |
|
28294 |
|
28295 | RequestBase.prototype.redirects = function (n) {
|
28296 | this._maxRedirects = n;
|
28297 | return this;
|
28298 | };
|
28299 |
|
28300 |
|
28301 |
|
28302 |
|
28303 |
|
28304 |
|
28305 |
|
28306 |
|
28307 |
|
28308 | RequestBase.prototype.maxResponseSize = function (n) {
|
28309 | if (typeof n !== 'number') {
|
28310 | throw new TypeError('Invalid argument');
|
28311 | }
|
28312 |
|
28313 | this._maxResponseSize = n;
|
28314 | return this;
|
28315 | };
|
28316 |
|
28317 |
|
28318 |
|
28319 |
|
28320 |
|
28321 |
|
28322 |
|
28323 |
|
28324 |
|
28325 |
|
28326 | RequestBase.prototype.toJSON = function () {
|
28327 | return {
|
28328 | method: this.method,
|
28329 | url: this.url,
|
28330 | data: this._data,
|
28331 | headers: this._header
|
28332 | };
|
28333 | };
|
28334 |
|
28335 |
|
28336 |
|
28337 |
|
28338 |
|
28339 |
|
28340 |
|
28341 |
|
28342 |
|
28343 |
|
28344 |
|
28345 |
|
28346 |
|
28347 |
|
28348 |
|
28349 |
|
28350 |
|
28351 |
|
28352 |
|
28353 |
|
28354 |
|
28355 |
|
28356 |
|
28357 |
|
28358 |
|
28359 |
|
28360 |
|
28361 |
|
28362 |
|
28363 |
|
28364 |
|
28365 |
|
28366 |
|
28367 |
|
28368 |
|
28369 |
|
28370 |
|
28371 |
|
28372 |
|
28373 |
|
28374 |
|
28375 |
|
28376 | RequestBase.prototype.send = function (data) {
|
28377 | var isObj = isObject(data);
|
28378 | var type = this._header['content-type'];
|
28379 |
|
28380 | if (this._formData) {
|
28381 | throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");
|
28382 | }
|
28383 |
|
28384 | if (isObj && !this._data) {
|
28385 | if (Array.isArray(data)) {
|
28386 | this._data = [];
|
28387 | } else if (!this._isHost(data)) {
|
28388 | this._data = {};
|
28389 | }
|
28390 | } else if (data && this._data && this._isHost(this._data)) {
|
28391 | throw new Error("Can't merge these send calls");
|
28392 | }
|
28393 |
|
28394 |
|
28395 | if (isObj && isObject(this._data)) {
|
28396 | for (var key in data) {
|
28397 | if (Object.prototype.hasOwnProperty.call(data, key)) this._data[key] = data[key];
|
28398 | }
|
28399 | } else if (typeof data === 'string') {
|
28400 |
|
28401 | if (!type) this.type('form');
|
28402 | type = this._header['content-type'];
|
28403 |
|
28404 | if (type === 'application/x-www-form-urlencoded') {
|
28405 | var _context2;
|
28406 |
|
28407 | this._data = this._data ? (0, _concat.default)(_context2 = "".concat(this._data, "&")).call(_context2, data) : data;
|
28408 | } else {
|
28409 | this._data = (this._data || '') + data;
|
28410 | }
|
28411 | } else {
|
28412 | this._data = data;
|
28413 | }
|
28414 |
|
28415 | if (!isObj || this._isHost(data)) {
|
28416 | return this;
|
28417 | }
|
28418 |
|
28419 |
|
28420 | if (!type) this.type('json');
|
28421 | return this;
|
28422 | };
|
28423 |
|
28424 |
|
28425 |
|
28426 |
|
28427 |
|
28428 |
|
28429 |
|
28430 |
|
28431 |
|
28432 |
|
28433 |
|
28434 |
|
28435 |
|
28436 |
|
28437 |
|
28438 |
|
28439 |
|
28440 |
|
28441 |
|
28442 |
|
28443 |
|
28444 |
|
28445 |
|
28446 |
|
28447 |
|
28448 |
|
28449 |
|
28450 |
|
28451 |
|
28452 | RequestBase.prototype.sortQuery = function (sort) {
|
28453 |
|
28454 | this._sort = typeof sort === 'undefined' ? true : sort;
|
28455 | return this;
|
28456 | };
|
28457 |
|
28458 |
|
28459 |
|
28460 |
|
28461 |
|
28462 |
|
28463 |
|
28464 | RequestBase.prototype._finalizeQueryString = function () {
|
28465 | var query = this._query.join('&');
|
28466 |
|
28467 | if (query) {
|
28468 | var _context3;
|
28469 |
|
28470 | this.url += ((0, _includes.default)(_context3 = this.url).call(_context3, '?') ? '&' : '?') + query;
|
28471 | }
|
28472 |
|
28473 | this._query.length = 0;
|
28474 |
|
28475 | if (this._sort) {
|
28476 | var _context4;
|
28477 |
|
28478 | var index = (0, _indexOf.default)(_context4 = this.url).call(_context4, '?');
|
28479 |
|
28480 | if (index >= 0) {
|
28481 | var _context5, _context6;
|
28482 |
|
28483 | var queryArr = (0, _slice.default)(_context5 = this.url).call(_context5, index + 1).split('&');
|
28484 |
|
28485 | if (typeof this._sort === 'function') {
|
28486 | (0, _sort.default)(queryArr).call(queryArr, this._sort);
|
28487 | } else {
|
28488 | (0, _sort.default)(queryArr).call(queryArr);
|
28489 | }
|
28490 |
|
28491 | this.url = (0, _slice.default)(_context6 = this.url).call(_context6, 0, index) + '?' + queryArr.join('&');
|
28492 | }
|
28493 | }
|
28494 | };
|
28495 |
|
28496 |
|
28497 | RequestBase.prototype._appendQueryString = function () {
|
28498 | console.warn('Unsupported');
|
28499 | };
|
28500 |
|
28501 |
|
28502 |
|
28503 |
|
28504 |
|
28505 |
|
28506 |
|
28507 | RequestBase.prototype._timeoutError = function (reason, timeout, errno) {
|
28508 | if (this._aborted) {
|
28509 | return;
|
28510 | }
|
28511 |
|
28512 | var err = new Error("".concat(reason + timeout, "ms exceeded"));
|
28513 | err.timeout = timeout;
|
28514 | err.code = 'ECONNABORTED';
|
28515 | err.errno = errno;
|
28516 | this.timedout = true;
|
28517 | this.timedoutError = err;
|
28518 | this.abort();
|
28519 | this.callback(err);
|
28520 | };
|
28521 |
|
28522 | RequestBase.prototype._setTimeouts = function () {
|
28523 | var self = this;
|
28524 |
|
28525 | if (this._timeout && !this._timer) {
|
28526 | this._timer = setTimeout(function () {
|
28527 | self._timeoutError('Timeout of ', self._timeout, 'ETIME');
|
28528 | }, this._timeout);
|
28529 | }
|
28530 |
|
28531 |
|
28532 | if (this._responseTimeout && !this._responseTimeoutTimer) {
|
28533 | this._responseTimeoutTimer = setTimeout(function () {
|
28534 | self._timeoutError('Response timeout of ', self._responseTimeout, 'ETIMEDOUT');
|
28535 | }, this._responseTimeout);
|
28536 | }
|
28537 | };
|
28538 |
|
28539 | }),
|
28540 |
|
28541 | (function(module, exports, __webpack_require__) {
|
28542 |
|
28543 | module.exports = __webpack_require__(587);
|
28544 |
|
28545 | }),
|
28546 |
|
28547 | (function(module, exports, __webpack_require__) {
|
28548 |
|
28549 | var parent = __webpack_require__(588);
|
28550 |
|
28551 | module.exports = parent;
|
28552 |
|
28553 |
|
28554 | }),
|
28555 |
|
28556 | (function(module, exports, __webpack_require__) {
|
28557 |
|
28558 | var isPrototypeOf = __webpack_require__(16);
|
28559 | var arrayMethod = __webpack_require__(589);
|
28560 | var stringMethod = __webpack_require__(591);
|
28561 |
|
28562 | var ArrayPrototype = Array.prototype;
|
28563 | var StringPrototype = String.prototype;
|
28564 |
|
28565 | module.exports = function (it) {
|
28566 | var own = it.includes;
|
28567 | if (it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.includes)) return arrayMethod;
|
28568 | if (typeof it == 'string' || it === StringPrototype || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.includes)) {
|
28569 | return stringMethod;
|
28570 | } return own;
|
28571 | };
|
28572 |
|
28573 |
|
28574 | }),
|
28575 |
|
28576 | (function(module, exports, __webpack_require__) {
|
28577 |
|
28578 | __webpack_require__(590);
|
28579 | var entryVirtual = __webpack_require__(27);
|
28580 |
|
28581 | module.exports = entryVirtual('Array').includes;
|
28582 |
|
28583 |
|
28584 | }),
|
28585 |
|
28586 | (function(module, exports, __webpack_require__) {
|
28587 |
|
28588 | "use strict";
|
28589 |
|
28590 | var $ = __webpack_require__(0);
|
28591 | var $includes = __webpack_require__(125).includes;
|
28592 | var fails = __webpack_require__(2);
|
28593 | var addToUnscopables = __webpack_require__(131);
|
28594 |
|
28595 |
|
28596 | var BROKEN_ON_SPARSE = fails(function () {
|
28597 | return !Array(1).includes();
|
28598 | });
|
28599 |
|
28600 |
|
28601 |
|
28602 | $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
28603 | includes: function includes(el /* , fromIndex = 0 */) {
|
28604 | return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
28605 | }
|
28606 | });
|
28607 |
|
28608 |
|
28609 | addToUnscopables('includes');
|
28610 |
|
28611 |
|
28612 | }),
|
28613 |
|
28614 | (function(module, exports, __webpack_require__) {
|
28615 |
|
28616 | __webpack_require__(592);
|
28617 | var entryVirtual = __webpack_require__(27);
|
28618 |
|
28619 | module.exports = entryVirtual('String').includes;
|
28620 |
|
28621 |
|
28622 | }),
|
28623 |
|
28624 | (function(module, exports, __webpack_require__) {
|
28625 |
|
28626 | "use strict";
|
28627 |
|
28628 | var $ = __webpack_require__(0);
|
28629 | var uncurryThis = __webpack_require__(4);
|
28630 | var notARegExp = __webpack_require__(593);
|
28631 | var requireObjectCoercible = __webpack_require__(81);
|
28632 | var toString = __webpack_require__(42);
|
28633 | var correctIsRegExpLogic = __webpack_require__(595);
|
28634 |
|
28635 | var stringIndexOf = uncurryThis(''.indexOf);
|
28636 |
|
28637 |
|
28638 |
|
28639 | $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
28640 | includes: function includes(searchString /* , position = 0 */) {
|
28641 | return !!~stringIndexOf(
|
28642 | toString(requireObjectCoercible(this)),
|
28643 | toString(notARegExp(searchString)),
|
28644 | arguments.length > 1 ? arguments[1] : undefined
|
28645 | );
|
28646 | }
|
28647 | });
|
28648 |
|
28649 |
|
28650 | }),
|
28651 |
|
28652 | (function(module, exports, __webpack_require__) {
|
28653 |
|
28654 | var isRegExp = __webpack_require__(594);
|
28655 |
|
28656 | var $TypeError = TypeError;
|
28657 |
|
28658 | module.exports = function (it) {
|
28659 | if (isRegExp(it)) {
|
28660 | throw $TypeError("The method doesn't accept regular expressions");
|
28661 | } return it;
|
28662 | };
|
28663 |
|
28664 |
|
28665 | }),
|
28666 |
|
28667 | (function(module, exports, __webpack_require__) {
|
28668 |
|
28669 | var isObject = __webpack_require__(11);
|
28670 | var classof = __webpack_require__(50);
|
28671 | var wellKnownSymbol = __webpack_require__(5);
|
28672 |
|
28673 | var MATCH = wellKnownSymbol('match');
|
28674 |
|
28675 |
|
28676 |
|
28677 | module.exports = function (it) {
|
28678 | var isRegExp;
|
28679 | return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
|
28680 | };
|
28681 |
|
28682 |
|
28683 | }),
|
28684 |
|
28685 | (function(module, exports, __webpack_require__) {
|
28686 |
|
28687 | var wellKnownSymbol = __webpack_require__(5);
|
28688 |
|
28689 | var MATCH = wellKnownSymbol('match');
|
28690 |
|
28691 | module.exports = function (METHOD_NAME) {
|
28692 | var regexp = /./;
|
28693 | try {
|
28694 | '/./'[METHOD_NAME](regexp);
|
28695 | } catch (error1) {
|
28696 | try {
|
28697 | regexp[MATCH] = false;
|
28698 | return '/./'[METHOD_NAME](regexp);
|
28699 | } catch (error2) { }
|
28700 | } return false;
|
28701 | };
|
28702 |
|
28703 |
|
28704 | }),
|
28705 |
|
28706 | (function(module, exports, __webpack_require__) {
|
28707 |
|
28708 | module.exports = __webpack_require__(597);
|
28709 |
|
28710 | }),
|
28711 |
|
28712 | (function(module, exports, __webpack_require__) {
|
28713 |
|
28714 | var parent = __webpack_require__(598);
|
28715 |
|
28716 | module.exports = parent;
|
28717 |
|
28718 |
|
28719 | }),
|
28720 |
|
28721 | (function(module, exports, __webpack_require__) {
|
28722 |
|
28723 | var isPrototypeOf = __webpack_require__(16);
|
28724 | var method = __webpack_require__(599);
|
28725 |
|
28726 | var ArrayPrototype = Array.prototype;
|
28727 |
|
28728 | module.exports = function (it) {
|
28729 | var own = it.sort;
|
28730 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.sort) ? method : own;
|
28731 | };
|
28732 |
|
28733 |
|
28734 | }),
|
28735 |
|
28736 | (function(module, exports, __webpack_require__) {
|
28737 |
|
28738 | __webpack_require__(600);
|
28739 | var entryVirtual = __webpack_require__(27);
|
28740 |
|
28741 | module.exports = entryVirtual('Array').sort;
|
28742 |
|
28743 |
|
28744 | }),
|
28745 |
|
28746 | (function(module, exports, __webpack_require__) {
|
28747 |
|
28748 | "use strict";
|
28749 |
|
28750 | var $ = __webpack_require__(0);
|
28751 | var uncurryThis = __webpack_require__(4);
|
28752 | var aCallable = __webpack_require__(29);
|
28753 | var toObject = __webpack_require__(33);
|
28754 | var lengthOfArrayLike = __webpack_require__(40);
|
28755 | var deletePropertyOrThrow = __webpack_require__(601);
|
28756 | var toString = __webpack_require__(42);
|
28757 | var fails = __webpack_require__(2);
|
28758 | var internalSort = __webpack_require__(602);
|
28759 | var arrayMethodIsStrict = __webpack_require__(150);
|
28760 | var FF = __webpack_require__(603);
|
28761 | var IE_OR_EDGE = __webpack_require__(604);
|
28762 | var V8 = __webpack_require__(66);
|
28763 | var WEBKIT = __webpack_require__(605);
|
28764 |
|
28765 | var test = [];
|
28766 | var un$Sort = uncurryThis(test.sort);
|
28767 | var push = uncurryThis(test.push);
|
28768 |
|
28769 |
|
28770 | var FAILS_ON_UNDEFINED = fails(function () {
|
28771 | test.sort(undefined);
|
28772 | });
|
28773 |
|
28774 | var FAILS_ON_NULL = fails(function () {
|
28775 | test.sort(null);
|
28776 | });
|
28777 |
|
28778 | var STRICT_METHOD = arrayMethodIsStrict('sort');
|
28779 |
|
28780 | var STABLE_SORT = !fails(function () {
|
28781 |
|
28782 | if (V8) return V8 < 70;
|
28783 | if (FF && FF > 3) return;
|
28784 | if (IE_OR_EDGE) return true;
|
28785 | if (WEBKIT) return WEBKIT < 603;
|
28786 |
|
28787 | var result = '';
|
28788 | var code, chr, value, index;
|
28789 |
|
28790 |
|
28791 | for (code = 65; code < 76; code++) {
|
28792 | chr = String.fromCharCode(code);
|
28793 |
|
28794 | switch (code) {
|
28795 | case 66: case 69: case 70: case 72: value = 3; break;
|
28796 | case 68: case 71: value = 4; break;
|
28797 | default: value = 2;
|
28798 | }
|
28799 |
|
28800 | for (index = 0; index < 47; index++) {
|
28801 | test.push({ k: chr + index, v: value });
|
28802 | }
|
28803 | }
|
28804 |
|
28805 | test.sort(function (a, b) { return b.v - a.v; });
|
28806 |
|
28807 | for (index = 0; index < test.length; index++) {
|
28808 | chr = test[index].k.charAt(0);
|
28809 | if (result.charAt(result.length - 1) !== chr) result += chr;
|
28810 | }
|
28811 |
|
28812 | return result !== 'DGBEFHACIJK';
|
28813 | });
|
28814 |
|
28815 | var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
28816 |
|
28817 | var getSortCompare = function (comparefn) {
|
28818 | return function (x, y) {
|
28819 | if (y === undefined) return -1;
|
28820 | if (x === undefined) return 1;
|
28821 | if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
28822 | return toString(x) > toString(y) ? 1 : -1;
|
28823 | };
|
28824 | };
|
28825 |
|
28826 |
|
28827 |
|
28828 | $({ target: 'Array', proto: true, forced: FORCED }, {
|
28829 | sort: function sort(comparefn) {
|
28830 | if (comparefn !== undefined) aCallable(comparefn);
|
28831 |
|
28832 | var array = toObject(this);
|
28833 |
|
28834 | if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
|
28835 |
|
28836 | var items = [];
|
28837 | var arrayLength = lengthOfArrayLike(array);
|
28838 | var itemsLength, index;
|
28839 |
|
28840 | for (index = 0; index < arrayLength; index++) {
|
28841 | if (index in array) push(items, array[index]);
|
28842 | }
|
28843 |
|
28844 | internalSort(items, getSortCompare(comparefn));
|
28845 |
|
28846 | itemsLength = items.length;
|
28847 | index = 0;
|
28848 |
|
28849 | while (index < itemsLength) array[index] = items[index++];
|
28850 | while (index < arrayLength) deletePropertyOrThrow(array, index++);
|
28851 |
|
28852 | return array;
|
28853 | }
|
28854 | });
|
28855 |
|
28856 |
|
28857 | }),
|
28858 |
|
28859 | (function(module, exports, __webpack_require__) {
|
28860 |
|
28861 | "use strict";
|
28862 |
|
28863 | var tryToString = __webpack_require__(67);
|
28864 |
|
28865 | var $TypeError = TypeError;
|
28866 |
|
28867 | module.exports = function (O, P) {
|
28868 | if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
|
28869 | };
|
28870 |
|
28871 |
|
28872 | }),
|
28873 |
|
28874 | (function(module, exports, __webpack_require__) {
|
28875 |
|
28876 | var arraySlice = __webpack_require__(244);
|
28877 |
|
28878 | var floor = Math.floor;
|
28879 |
|
28880 | var mergeSort = function (array, comparefn) {
|
28881 | var length = array.length;
|
28882 | var middle = floor(length / 2);
|
28883 | return length < 8 ? insertionSort(array, comparefn) : merge(
|
28884 | array,
|
28885 | mergeSort(arraySlice(array, 0, middle), comparefn),
|
28886 | mergeSort(arraySlice(array, middle), comparefn),
|
28887 | comparefn
|
28888 | );
|
28889 | };
|
28890 |
|
28891 | var insertionSort = function (array, comparefn) {
|
28892 | var length = array.length;
|
28893 | var i = 1;
|
28894 | var element, j;
|
28895 |
|
28896 | while (i < length) {
|
28897 | j = i;
|
28898 | element = array[i];
|
28899 | while (j && comparefn(array[j - 1], element) > 0) {
|
28900 | array[j] = array[--j];
|
28901 | }
|
28902 | if (j !== i++) array[j] = element;
|
28903 | } return array;
|
28904 | };
|
28905 |
|
28906 | var merge = function (array, left, right, comparefn) {
|
28907 | var llength = left.length;
|
28908 | var rlength = right.length;
|
28909 | var lindex = 0;
|
28910 | var rindex = 0;
|
28911 |
|
28912 | while (lindex < llength || rindex < rlength) {
|
28913 | array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
28914 | ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
28915 | : lindex < llength ? left[lindex++] : right[rindex++];
|
28916 | } return array;
|
28917 | };
|
28918 |
|
28919 | module.exports = mergeSort;
|
28920 |
|
28921 |
|
28922 | }),
|
28923 |
|
28924 | (function(module, exports, __webpack_require__) {
|
28925 |
|
28926 | var userAgent = __webpack_require__(51);
|
28927 |
|
28928 | var firefox = userAgent.match(/firefox\/(\d+)/i);
|
28929 |
|
28930 | module.exports = !!firefox && +firefox[1];
|
28931 |
|
28932 |
|
28933 | }),
|
28934 |
|
28935 | (function(module, exports, __webpack_require__) {
|
28936 |
|
28937 | var UA = __webpack_require__(51);
|
28938 |
|
28939 | module.exports = /MSIE|Trident/.test(UA);
|
28940 |
|
28941 |
|
28942 | }),
|
28943 |
|
28944 | (function(module, exports, __webpack_require__) {
|
28945 |
|
28946 | var userAgent = __webpack_require__(51);
|
28947 |
|
28948 | var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
28949 |
|
28950 | module.exports = !!webkit && +webkit[1];
|
28951 |
|
28952 |
|
28953 | }),
|
28954 |
|
28955 | (function(module, exports, __webpack_require__) {
|
28956 |
|
28957 | "use strict";
|
28958 |
|
28959 |
|
28960 |
|
28961 |
|
28962 |
|
28963 | var utils = __webpack_require__(607);
|
28964 |
|
28965 |
|
28966 |
|
28967 |
|
28968 |
|
28969 | module.exports = ResponseBase;
|
28970 |
|
28971 |
|
28972 |
|
28973 |
|
28974 |
|
28975 |
|
28976 | function ResponseBase(obj) {
|
28977 | if (obj) return mixin(obj);
|
28978 | }
|
28979 |
|
28980 |
|
28981 |
|
28982 |
|
28983 |
|
28984 |
|
28985 |
|
28986 |
|
28987 |
|
28988 | function mixin(obj) {
|
28989 | for (var key in ResponseBase.prototype) {
|
28990 | if (Object.prototype.hasOwnProperty.call(ResponseBase.prototype, key)) obj[key] = ResponseBase.prototype[key];
|
28991 | }
|
28992 |
|
28993 | return obj;
|
28994 | }
|
28995 |
|
28996 |
|
28997 |
|
28998 |
|
28999 |
|
29000 |
|
29001 |
|
29002 |
|
29003 |
|
29004 | ResponseBase.prototype.get = function (field) {
|
29005 | return this.header[field.toLowerCase()];
|
29006 | };
|
29007 |
|
29008 |
|
29009 |
|
29010 |
|
29011 |
|
29012 |
|
29013 |
|
29014 |
|
29015 |
|
29016 |
|
29017 |
|
29018 |
|
29019 |
|
29020 | ResponseBase.prototype._setHeaderProperties = function (header) {
|
29021 |
|
29022 |
|
29023 |
|
29024 | var ct = header['content-type'] || '';
|
29025 | this.type = utils.type(ct);
|
29026 |
|
29027 | var params = utils.params(ct);
|
29028 |
|
29029 | for (var key in params) {
|
29030 | if (Object.prototype.hasOwnProperty.call(params, key)) this[key] = params[key];
|
29031 | }
|
29032 |
|
29033 | this.links = {};
|
29034 |
|
29035 | try {
|
29036 | if (header.link) {
|
29037 | this.links = utils.parseLinks(header.link);
|
29038 | }
|
29039 | } catch (_unused) {
|
29040 | }
|
29041 | };
|
29042 |
|
29043 |
|
29044 |
|
29045 |
|
29046 |
|
29047 |
|
29048 |
|
29049 |
|
29050 |
|
29051 |
|
29052 |
|
29053 |
|
29054 |
|
29055 |
|
29056 |
|
29057 |
|
29058 |
|
29059 |
|
29060 |
|
29061 |
|
29062 |
|
29063 |
|
29064 | ResponseBase.prototype._setStatusProperties = function (status) {
|
29065 | var type = status / 100 | 0;
|
29066 |
|
29067 | this.statusCode = status;
|
29068 | this.status = this.statusCode;
|
29069 | this.statusType = type;
|
29070 |
|
29071 | this.info = type === 1;
|
29072 | this.ok = type === 2;
|
29073 | this.redirect = type === 3;
|
29074 | this.clientError = type === 4;
|
29075 | this.serverError = type === 5;
|
29076 | this.error = type === 4 || type === 5 ? this.toError() : false;
|
29077 |
|
29078 | this.created = status === 201;
|
29079 | this.accepted = status === 202;
|
29080 | this.noContent = status === 204;
|
29081 | this.badRequest = status === 400;
|
29082 | this.unauthorized = status === 401;
|
29083 | this.notAcceptable = status === 406;
|
29084 | this.forbidden = status === 403;
|
29085 | this.notFound = status === 404;
|
29086 | this.unprocessableEntity = status === 422;
|
29087 | };
|
29088 |
|
29089 | }),
|
29090 |
|
29091 | (function(module, exports, __webpack_require__) {
|
29092 |
|
29093 | "use strict";
|
29094 |
|
29095 |
|
29096 |
|
29097 |
|
29098 |
|
29099 |
|
29100 |
|
29101 |
|
29102 |
|
29103 | var _interopRequireDefault = __webpack_require__(1);
|
29104 |
|
29105 | var _reduce = _interopRequireDefault(__webpack_require__(261));
|
29106 |
|
29107 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
29108 |
|
29109 | exports.type = function (str) {
|
29110 | return str.split(/ *; */).shift();
|
29111 | };
|
29112 |
|
29113 |
|
29114 |
|
29115 |
|
29116 |
|
29117 |
|
29118 |
|
29119 |
|
29120 |
|
29121 | exports.params = function (str) {
|
29122 | var _context;
|
29123 |
|
29124 | return (0, _reduce.default)(_context = str.split(/ *; */)).call(_context, function (obj, str) {
|
29125 | var parts = str.split(/ *= */);
|
29126 | var key = parts.shift();
|
29127 | var val = parts.shift();
|
29128 | if (key && val) obj[key] = val;
|
29129 | return obj;
|
29130 | }, {});
|
29131 | };
|
29132 |
|
29133 |
|
29134 |
|
29135 |
|
29136 |
|
29137 |
|
29138 |
|
29139 |
|
29140 |
|
29141 | exports.parseLinks = function (str) {
|
29142 | var _context2;
|
29143 |
|
29144 | return (0, _reduce.default)(_context2 = str.split(/ *, */)).call(_context2, function (obj, str) {
|
29145 | var _context3, _context4;
|
29146 |
|
29147 | var parts = str.split(/ *; */);
|
29148 | var url = (0, _slice.default)(_context3 = parts[0]).call(_context3, 1, -1);
|
29149 | var rel = (0, _slice.default)(_context4 = parts[1].split(/ *= */)[1]).call(_context4, 1, -1);
|
29150 | obj[rel] = url;
|
29151 | return obj;
|
29152 | }, {});
|
29153 | };
|
29154 |
|
29155 |
|
29156 |
|
29157 |
|
29158 |
|
29159 |
|
29160 |
|
29161 |
|
29162 |
|
29163 | exports.cleanHeader = function (header, changesOrigin) {
|
29164 | delete header['content-type'];
|
29165 | delete header['content-length'];
|
29166 | delete header['transfer-encoding'];
|
29167 | delete header.host;
|
29168 |
|
29169 | if (changesOrigin) {
|
29170 | delete header.authorization;
|
29171 | delete header.cookie;
|
29172 | }
|
29173 |
|
29174 | return header;
|
29175 | };
|
29176 |
|
29177 | }),
|
29178 |
|
29179 | (function(module, exports, __webpack_require__) {
|
29180 |
|
29181 | var parent = __webpack_require__(609);
|
29182 |
|
29183 | module.exports = parent;
|
29184 |
|
29185 |
|
29186 | }),
|
29187 |
|
29188 | (function(module, exports, __webpack_require__) {
|
29189 |
|
29190 | var isPrototypeOf = __webpack_require__(16);
|
29191 | var method = __webpack_require__(610);
|
29192 |
|
29193 | var ArrayPrototype = Array.prototype;
|
29194 |
|
29195 | module.exports = function (it) {
|
29196 | var own = it.reduce;
|
29197 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.reduce) ? method : own;
|
29198 | };
|
29199 |
|
29200 |
|
29201 | }),
|
29202 |
|
29203 | (function(module, exports, __webpack_require__) {
|
29204 |
|
29205 | __webpack_require__(611);
|
29206 | var entryVirtual = __webpack_require__(27);
|
29207 |
|
29208 | module.exports = entryVirtual('Array').reduce;
|
29209 |
|
29210 |
|
29211 | }),
|
29212 |
|
29213 | (function(module, exports, __webpack_require__) {
|
29214 |
|
29215 | "use strict";
|
29216 |
|
29217 | var $ = __webpack_require__(0);
|
29218 | var $reduce = __webpack_require__(612).left;
|
29219 | var arrayMethodIsStrict = __webpack_require__(150);
|
29220 | var CHROME_VERSION = __webpack_require__(66);
|
29221 | var IS_NODE = __webpack_require__(109);
|
29222 |
|
29223 | var STRICT_METHOD = arrayMethodIsStrict('reduce');
|
29224 |
|
29225 |
|
29226 | var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
29227 |
|
29228 |
|
29229 |
|
29230 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
|
29231 | reduce: function reduce(callbackfn /* , initialValue */) {
|
29232 | var length = arguments.length;
|
29233 | return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
29234 | }
|
29235 | });
|
29236 |
|
29237 |
|
29238 | }),
|
29239 |
|
29240 | (function(module, exports, __webpack_require__) {
|
29241 |
|
29242 | var aCallable = __webpack_require__(29);
|
29243 | var toObject = __webpack_require__(33);
|
29244 | var IndexedObject = __webpack_require__(98);
|
29245 | var lengthOfArrayLike = __webpack_require__(40);
|
29246 |
|
29247 | var $TypeError = TypeError;
|
29248 |
|
29249 |
|
29250 | var createMethod = function (IS_RIGHT) {
|
29251 | return function (that, callbackfn, argumentsLength, memo) {
|
29252 | aCallable(callbackfn);
|
29253 | var O = toObject(that);
|
29254 | var self = IndexedObject(O);
|
29255 | var length = lengthOfArrayLike(O);
|
29256 | var index = IS_RIGHT ? length - 1 : 0;
|
29257 | var i = IS_RIGHT ? -1 : 1;
|
29258 | if (argumentsLength < 2) while (true) {
|
29259 | if (index in self) {
|
29260 | memo = self[index];
|
29261 | index += i;
|
29262 | break;
|
29263 | }
|
29264 | index += i;
|
29265 | if (IS_RIGHT ? index < 0 : length <= index) {
|
29266 | throw $TypeError('Reduce of empty array with no initial value');
|
29267 | }
|
29268 | }
|
29269 | for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
29270 | memo = callbackfn(memo, self[index], index, O);
|
29271 | }
|
29272 | return memo;
|
29273 | };
|
29274 | };
|
29275 |
|
29276 | module.exports = {
|
29277 |
|
29278 |
|
29279 | left: createMethod(false),
|
29280 |
|
29281 |
|
29282 | right: createMethod(true)
|
29283 | };
|
29284 |
|
29285 |
|
29286 | }),
|
29287 |
|
29288 | (function(module, exports, __webpack_require__) {
|
29289 |
|
29290 | "use strict";
|
29291 |
|
29292 |
|
29293 | var _interopRequireDefault = __webpack_require__(1);
|
29294 |
|
29295 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
29296 |
|
29297 | var _from = _interopRequireDefault(__webpack_require__(152));
|
29298 |
|
29299 | var _symbol = _interopRequireDefault(__webpack_require__(77));
|
29300 |
|
29301 | var _isIterable2 = _interopRequireDefault(__webpack_require__(262));
|
29302 |
|
29303 | function _toConsumableArray(arr) {
|
29304 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
29305 | }
|
29306 |
|
29307 | function _nonIterableSpread() {
|
29308 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
29309 | }
|
29310 |
|
29311 | function _unsupportedIterableToArray(o, minLen) {
|
29312 | var _context;
|
29313 |
|
29314 | if (!o) return;
|
29315 | if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
29316 | var n = (0, _slice.default)(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
|
29317 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
29318 | if (n === "Map" || n === "Set") return (0, _from.default)(o);
|
29319 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
29320 | }
|
29321 |
|
29322 | function _iterableToArray(iter) {
|
29323 | if (typeof _symbol.default !== "undefined" && (0, _isIterable2.default)(Object(iter))) return (0, _from.default)(iter);
|
29324 | }
|
29325 |
|
29326 | function _arrayWithoutHoles(arr) {
|
29327 | if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
29328 | }
|
29329 |
|
29330 | function _arrayLikeToArray(arr, len) {
|
29331 | if (len == null || len > arr.length) len = arr.length;
|
29332 |
|
29333 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
29334 | arr2[i] = arr[i];
|
29335 | }
|
29336 |
|
29337 | return arr2;
|
29338 | }
|
29339 |
|
29340 | function Agent() {
|
29341 | this._defaults = [];
|
29342 | }
|
29343 |
|
29344 | ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts'].forEach(function (fn) {
|
29345 |
|
29346 | Agent.prototype[fn] = function () {
|
29347 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
29348 | args[_key] = arguments[_key];
|
29349 | }
|
29350 |
|
29351 | this._defaults.push({
|
29352 | fn: fn,
|
29353 | args: args
|
29354 | });
|
29355 |
|
29356 | return this;
|
29357 | };
|
29358 | });
|
29359 |
|
29360 | Agent.prototype._setDefaults = function (req) {
|
29361 | this._defaults.forEach(function (def) {
|
29362 | req[def.fn].apply(req, _toConsumableArray(def.args));
|
29363 | });
|
29364 | };
|
29365 |
|
29366 | module.exports = Agent;
|
29367 |
|
29368 | }),
|
29369 |
|
29370 | (function(module, exports, __webpack_require__) {
|
29371 |
|
29372 | module.exports = __webpack_require__(615);
|
29373 |
|
29374 |
|
29375 | }),
|
29376 |
|
29377 | (function(module, exports, __webpack_require__) {
|
29378 |
|
29379 | var parent = __webpack_require__(616);
|
29380 |
|
29381 | module.exports = parent;
|
29382 |
|
29383 |
|
29384 | }),
|
29385 |
|
29386 | (function(module, exports, __webpack_require__) {
|
29387 |
|
29388 | var parent = __webpack_require__(617);
|
29389 |
|
29390 | module.exports = parent;
|
29391 |
|
29392 |
|
29393 | }),
|
29394 |
|
29395 | (function(module, exports, __webpack_require__) {
|
29396 |
|
29397 | var parent = __webpack_require__(618);
|
29398 | __webpack_require__(46);
|
29399 |
|
29400 | module.exports = parent;
|
29401 |
|
29402 |
|
29403 | }),
|
29404 |
|
29405 | (function(module, exports, __webpack_require__) {
|
29406 |
|
29407 | __webpack_require__(43);
|
29408 | __webpack_require__(70);
|
29409 | var isIterable = __webpack_require__(619);
|
29410 |
|
29411 | module.exports = isIterable;
|
29412 |
|
29413 |
|
29414 | }),
|
29415 |
|
29416 | (function(module, exports, __webpack_require__) {
|
29417 |
|
29418 | var classof = __webpack_require__(55);
|
29419 | var hasOwn = __webpack_require__(13);
|
29420 | var wellKnownSymbol = __webpack_require__(5);
|
29421 | var Iterators = __webpack_require__(54);
|
29422 |
|
29423 | var ITERATOR = wellKnownSymbol('iterator');
|
29424 | var $Object = Object;
|
29425 |
|
29426 | module.exports = function (it) {
|
29427 | var O = $Object(it);
|
29428 | return O[ITERATOR] !== undefined
|
29429 | || '@@iterator' in O
|
29430 | || hasOwn(Iterators, classof(O));
|
29431 | };
|
29432 |
|
29433 |
|
29434 | }),
|
29435 |
|
29436 | (function(module, exports, __webpack_require__) {
|
29437 |
|
29438 | "use strict";
|
29439 |
|
29440 |
|
29441 | var _require = __webpack_require__(155),
|
29442 | Realtime = _require.Realtime,
|
29443 | setRTMAdapters = _require.setAdapters;
|
29444 |
|
29445 | var _require2 = __webpack_require__(704),
|
29446 | LiveQueryPlugin = _require2.LiveQueryPlugin;
|
29447 |
|
29448 | Realtime.__preRegisteredPlugins = [LiveQueryPlugin];
|
29449 |
|
29450 | module.exports = function (AV) {
|
29451 | AV._sharedConfig.liveQueryRealtime = Realtime;
|
29452 | var setAdapters = AV.setAdapters;
|
29453 |
|
29454 | AV.setAdapters = function (adapters) {
|
29455 | setAdapters(adapters);
|
29456 | setRTMAdapters(adapters);
|
29457 | };
|
29458 |
|
29459 | return AV;
|
29460 | };
|
29461 |
|
29462 | }),
|
29463 |
|
29464 | (function(module, exports, __webpack_require__) {
|
29465 |
|
29466 | "use strict";
|
29467 | (function(global) {
|
29468 |
|
29469 | var _interopRequireDefault = __webpack_require__(1);
|
29470 |
|
29471 | var _typeof3 = _interopRequireDefault(__webpack_require__(95));
|
29472 |
|
29473 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(94));
|
29474 |
|
29475 | var _freeze = _interopRequireDefault(__webpack_require__(622));
|
29476 |
|
29477 | var _assign = _interopRequireDefault(__webpack_require__(265));
|
29478 |
|
29479 | var _symbol = _interopRequireDefault(__webpack_require__(77));
|
29480 |
|
29481 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
29482 |
|
29483 | var _keys = _interopRequireDefault(__webpack_require__(149));
|
29484 |
|
29485 | var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(266));
|
29486 |
|
29487 | var _filter = _interopRequireDefault(__webpack_require__(249));
|
29488 |
|
29489 | var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(257));
|
29490 |
|
29491 | var _getOwnPropertyDescriptors = _interopRequireDefault(__webpack_require__(633));
|
29492 |
|
29493 | var _defineProperties = _interopRequireDefault(__webpack_require__(637));
|
29494 |
|
29495 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
29496 |
|
29497 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
29498 |
|
29499 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
29500 |
|
29501 | var _weakMap = _interopRequireDefault(__webpack_require__(641));
|
29502 |
|
29503 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
29504 |
|
29505 | var _map = _interopRequireDefault(__webpack_require__(37));
|
29506 |
|
29507 | var _reduce = _interopRequireDefault(__webpack_require__(261));
|
29508 |
|
29509 | var _find = _interopRequireDefault(__webpack_require__(96));
|
29510 |
|
29511 | var _set = _interopRequireDefault(__webpack_require__(268));
|
29512 |
|
29513 | var _context6, _context15;
|
29514 |
|
29515 | (0, _defineProperty2.default)(exports, '__esModule', {
|
29516 | value: true
|
29517 | });
|
29518 |
|
29519 | function _interopDefault(ex) {
|
29520 | return ex && (0, _typeof3.default)(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
|
29521 | }
|
29522 |
|
29523 | var protobufLight = _interopDefault(__webpack_require__(652));
|
29524 |
|
29525 | var EventEmitter = _interopDefault(__webpack_require__(656));
|
29526 |
|
29527 | var _regeneratorRuntime = _interopDefault(__webpack_require__(657));
|
29528 |
|
29529 | var _asyncToGenerator = _interopDefault(__webpack_require__(659));
|
29530 |
|
29531 | var _toConsumableArray = _interopDefault(__webpack_require__(660));
|
29532 |
|
29533 | var _defineProperty = _interopDefault(__webpack_require__(663));
|
29534 |
|
29535 | var _objectWithoutProperties = _interopDefault(__webpack_require__(664));
|
29536 |
|
29537 | var _assertThisInitialized = _interopDefault(__webpack_require__(666));
|
29538 |
|
29539 | var _inheritsLoose = _interopDefault(__webpack_require__(667));
|
29540 |
|
29541 | var d = _interopDefault(__webpack_require__(63));
|
29542 |
|
29543 | var shuffle = _interopDefault(__webpack_require__(668));
|
29544 |
|
29545 | var values = _interopDefault(__webpack_require__(273));
|
29546 |
|
29547 | var _toArray = _interopDefault(__webpack_require__(695));
|
29548 |
|
29549 | var _createClass = _interopDefault(__webpack_require__(698));
|
29550 |
|
29551 | var _applyDecoratedDescriptor = _interopDefault(__webpack_require__(699));
|
29552 |
|
29553 | var StateMachine = _interopDefault(__webpack_require__(700));
|
29554 |
|
29555 | var _typeof = _interopDefault(__webpack_require__(701));
|
29556 |
|
29557 | var isPlainObject = _interopDefault(__webpack_require__(702));
|
29558 |
|
29559 | var promiseTimeout = __webpack_require__(250);
|
29560 |
|
29561 | var messageCompiled = protobufLight.newBuilder({})['import']({
|
29562 | "package": 'push_server.messages2',
|
29563 | syntax: 'proto2',
|
29564 | options: {
|
29565 | objc_class_prefix: 'AVIM'
|
29566 | },
|
29567 | messages: [{
|
29568 | name: 'JsonObjectMessage',
|
29569 | syntax: 'proto2',
|
29570 | fields: [{
|
29571 | rule: 'required',
|
29572 | type: 'string',
|
29573 | name: 'data',
|
29574 | id: 1
|
29575 | }]
|
29576 | }, {
|
29577 | name: 'UnreadTuple',
|
29578 | syntax: 'proto2',
|
29579 | fields: [{
|
29580 | rule: 'required',
|
29581 | type: 'string',
|
29582 | name: 'cid',
|
29583 | id: 1
|
29584 | }, {
|
29585 | rule: 'required',
|
29586 | type: 'int32',
|
29587 | name: 'unread',
|
29588 | id: 2
|
29589 | }, {
|
29590 | rule: 'optional',
|
29591 | type: 'string',
|
29592 | name: 'mid',
|
29593 | id: 3
|
29594 | }, {
|
29595 | rule: 'optional',
|
29596 | type: 'int64',
|
29597 | name: 'timestamp',
|
29598 | id: 4
|
29599 | }, {
|
29600 | rule: 'optional',
|
29601 | type: 'string',
|
29602 | name: 'from',
|
29603 | id: 5
|
29604 | }, {
|
29605 | rule: 'optional',
|
29606 | type: 'string',
|
29607 | name: 'data',
|
29608 | id: 6
|
29609 | }, {
|
29610 | rule: 'optional',
|
29611 | type: 'int64',
|
29612 | name: 'patchTimestamp',
|
29613 | id: 7
|
29614 | }, {
|
29615 | rule: 'optional',
|
29616 | type: 'bool',
|
29617 | name: 'mentioned',
|
29618 | id: 8
|
29619 | }, {
|
29620 | rule: 'optional',
|
29621 | type: 'bytes',
|
29622 | name: 'binaryMsg',
|
29623 | id: 9
|
29624 | }, {
|
29625 | rule: 'optional',
|
29626 | type: 'int32',
|
29627 | name: 'convType',
|
29628 | id: 10
|
29629 | }]
|
29630 | }, {
|
29631 | name: 'LogItem',
|
29632 | syntax: 'proto2',
|
29633 | fields: [{
|
29634 | rule: 'optional',
|
29635 | type: 'string',
|
29636 | name: 'from',
|
29637 | id: 1
|
29638 | }, {
|
29639 | rule: 'optional',
|
29640 | type: 'string',
|
29641 | name: 'data',
|
29642 | id: 2
|
29643 | }, {
|
29644 | rule: 'optional',
|
29645 | type: 'int64',
|
29646 | name: 'timestamp',
|
29647 | id: 3
|
29648 | }, {
|
29649 | rule: 'optional',
|
29650 | type: 'string',
|
29651 | name: 'msgId',
|
29652 | id: 4
|
29653 | }, {
|
29654 | rule: 'optional',
|
29655 | type: 'int64',
|
29656 | name: 'ackAt',
|
29657 | id: 5
|
29658 | }, {
|
29659 | rule: 'optional',
|
29660 | type: 'int64',
|
29661 | name: 'readAt',
|
29662 | id: 6
|
29663 | }, {
|
29664 | rule: 'optional',
|
29665 | type: 'int64',
|
29666 | name: 'patchTimestamp',
|
29667 | id: 7
|
29668 | }, {
|
29669 | rule: 'optional',
|
29670 | type: 'bool',
|
29671 | name: 'mentionAll',
|
29672 | id: 8
|
29673 | }, {
|
29674 | rule: 'repeated',
|
29675 | type: 'string',
|
29676 | name: 'mentionPids',
|
29677 | id: 9
|
29678 | }, {
|
29679 | rule: 'optional',
|
29680 | type: 'bool',
|
29681 | name: 'bin',
|
29682 | id: 10
|
29683 | }, {
|
29684 | rule: 'optional',
|
29685 | type: 'int32',
|
29686 | name: 'convType',
|
29687 | id: 11
|
29688 | }]
|
29689 | }, {
|
29690 | name: 'ConvMemberInfo',
|
29691 | syntax: 'proto2',
|
29692 | fields: [{
|
29693 | rule: 'optional',
|
29694 | type: 'string',
|
29695 | name: 'pid',
|
29696 | id: 1
|
29697 | }, {
|
29698 | rule: 'optional',
|
29699 | type: 'string',
|
29700 | name: 'role',
|
29701 | id: 2
|
29702 | }, {
|
29703 | rule: 'optional',
|
29704 | type: 'string',
|
29705 | name: 'infoId',
|
29706 | id: 3
|
29707 | }]
|
29708 | }, {
|
29709 | name: 'DataCommand',
|
29710 | syntax: 'proto2',
|
29711 | fields: [{
|
29712 | rule: 'repeated',
|
29713 | type: 'string',
|
29714 | name: 'ids',
|
29715 | id: 1
|
29716 | }, {
|
29717 | rule: 'repeated',
|
29718 | type: 'JsonObjectMessage',
|
29719 | name: 'msg',
|
29720 | id: 2
|
29721 | }, {
|
29722 | rule: 'optional',
|
29723 | type: 'bool',
|
29724 | name: 'offline',
|
29725 | id: 3
|
29726 | }]
|
29727 | }, {
|
29728 | name: 'SessionCommand',
|
29729 | syntax: 'proto2',
|
29730 | fields: [{
|
29731 | rule: 'optional',
|
29732 | type: 'int64',
|
29733 | name: 't',
|
29734 | id: 1
|
29735 | }, {
|
29736 | rule: 'optional',
|
29737 | type: 'string',
|
29738 | name: 'n',
|
29739 | id: 2
|
29740 | }, {
|
29741 | rule: 'optional',
|
29742 | type: 'string',
|
29743 | name: 's',
|
29744 | id: 3
|
29745 | }, {
|
29746 | rule: 'optional',
|
29747 | type: 'string',
|
29748 | name: 'ua',
|
29749 | id: 4
|
29750 | }, {
|
29751 | rule: 'optional',
|
29752 | type: 'bool',
|
29753 | name: 'r',
|
29754 | id: 5
|
29755 | }, {
|
29756 | rule: 'optional',
|
29757 | type: 'string',
|
29758 | name: 'tag',
|
29759 | id: 6
|
29760 | }, {
|
29761 | rule: 'optional',
|
29762 | type: 'string',
|
29763 | name: 'deviceId',
|
29764 | id: 7
|
29765 | }, {
|
29766 | rule: 'repeated',
|
29767 | type: 'string',
|
29768 | name: 'sessionPeerIds',
|
29769 | id: 8
|
29770 | }, {
|
29771 | rule: 'repeated',
|
29772 | type: 'string',
|
29773 | name: 'onlineSessionPeerIds',
|
29774 | id: 9
|
29775 | }, {
|
29776 | rule: 'optional',
|
29777 | type: 'string',
|
29778 | name: 'st',
|
29779 | id: 10
|
29780 | }, {
|
29781 | rule: 'optional',
|
29782 | type: 'int32',
|
29783 | name: 'stTtl',
|
29784 | id: 11
|
29785 | }, {
|
29786 | rule: 'optional',
|
29787 | type: 'int32',
|
29788 | name: 'code',
|
29789 | id: 12
|
29790 | }, {
|
29791 | rule: 'optional',
|
29792 | type: 'string',
|
29793 | name: 'reason',
|
29794 | id: 13
|
29795 | }, {
|
29796 | rule: 'optional',
|
29797 | type: 'string',
|
29798 | name: 'deviceToken',
|
29799 | id: 14
|
29800 | }, {
|
29801 | rule: 'optional',
|
29802 | type: 'bool',
|
29803 | name: 'sp',
|
29804 | id: 15
|
29805 | }, {
|
29806 | rule: 'optional',
|
29807 | type: 'string',
|
29808 | name: 'detail',
|
29809 | id: 16
|
29810 | }, {
|
29811 | rule: 'optional',
|
29812 | type: 'int64',
|
29813 | name: 'lastUnreadNotifTime',
|
29814 | id: 17
|
29815 | }, {
|
29816 | rule: 'optional',
|
29817 | type: 'int64',
|
29818 | name: 'lastPatchTime',
|
29819 | id: 18
|
29820 | }, {
|
29821 | rule: 'optional',
|
29822 | type: 'int64',
|
29823 | name: 'configBitmap',
|
29824 | id: 19
|
29825 | }]
|
29826 | }, {
|
29827 | name: 'ErrorCommand',
|
29828 | syntax: 'proto2',
|
29829 | fields: [{
|
29830 | rule: 'required',
|
29831 | type: 'int32',
|
29832 | name: 'code',
|
29833 | id: 1
|
29834 | }, {
|
29835 | rule: 'required',
|
29836 | type: 'string',
|
29837 | name: 'reason',
|
29838 | id: 2
|
29839 | }, {
|
29840 | rule: 'optional',
|
29841 | type: 'int32',
|
29842 | name: 'appCode',
|
29843 | id: 3
|
29844 | }, {
|
29845 | rule: 'optional',
|
29846 | type: 'string',
|
29847 | name: 'detail',
|
29848 | id: 4
|
29849 | }, {
|
29850 | rule: 'repeated',
|
29851 | type: 'string',
|
29852 | name: 'pids',
|
29853 | id: 5
|
29854 | }, {
|
29855 | rule: 'optional',
|
29856 | type: 'string',
|
29857 | name: 'appMsg',
|
29858 | id: 6
|
29859 | }]
|
29860 | }, {
|
29861 | name: 'DirectCommand',
|
29862 | syntax: 'proto2',
|
29863 | fields: [{
|
29864 | rule: 'optional',
|
29865 | type: 'string',
|
29866 | name: 'msg',
|
29867 | id: 1
|
29868 | }, {
|
29869 | rule: 'optional',
|
29870 | type: 'string',
|
29871 | name: 'uid',
|
29872 | id: 2
|
29873 | }, {
|
29874 | rule: 'optional',
|
29875 | type: 'string',
|
29876 | name: 'fromPeerId',
|
29877 | id: 3
|
29878 | }, {
|
29879 | rule: 'optional',
|
29880 | type: 'int64',
|
29881 | name: 'timestamp',
|
29882 | id: 4
|
29883 | }, {
|
29884 | rule: 'optional',
|
29885 | type: 'bool',
|
29886 | name: 'offline',
|
29887 | id: 5
|
29888 | }, {
|
29889 | rule: 'optional',
|
29890 | type: 'bool',
|
29891 | name: 'hasMore',
|
29892 | id: 6
|
29893 | }, {
|
29894 | rule: 'repeated',
|
29895 | type: 'string',
|
29896 | name: 'toPeerIds',
|
29897 | id: 7
|
29898 | }, {
|
29899 | rule: 'optional',
|
29900 | type: 'bool',
|
29901 | name: 'r',
|
29902 | id: 10
|
29903 | }, {
|
29904 | rule: 'optional',
|
29905 | type: 'string',
|
29906 | name: 'cid',
|
29907 | id: 11
|
29908 | }, {
|
29909 | rule: 'optional',
|
29910 | type: 'string',
|
29911 | name: 'id',
|
29912 | id: 12
|
29913 | }, {
|
29914 | rule: 'optional',
|
29915 | type: 'bool',
|
29916 | name: 'transient',
|
29917 | id: 13
|
29918 | }, {
|
29919 | rule: 'optional',
|
29920 | type: 'string',
|
29921 | name: 'dt',
|
29922 | id: 14
|
29923 | }, {
|
29924 | rule: 'optional',
|
29925 | type: 'string',
|
29926 | name: 'roomId',
|
29927 | id: 15
|
29928 | }, {
|
29929 | rule: 'optional',
|
29930 | type: 'string',
|
29931 | name: 'pushData',
|
29932 | id: 16
|
29933 | }, {
|
29934 | rule: 'optional',
|
29935 | type: 'bool',
|
29936 | name: 'will',
|
29937 | id: 17
|
29938 | }, {
|
29939 | rule: 'optional',
|
29940 | type: 'int64',
|
29941 | name: 'patchTimestamp',
|
29942 | id: 18
|
29943 | }, {
|
29944 | rule: 'optional',
|
29945 | type: 'bytes',
|
29946 | name: 'binaryMsg',
|
29947 | id: 19
|
29948 | }, {
|
29949 | rule: 'repeated',
|
29950 | type: 'string',
|
29951 | name: 'mentionPids',
|
29952 | id: 20
|
29953 | }, {
|
29954 | rule: 'optional',
|
29955 | type: 'bool',
|
29956 | name: 'mentionAll',
|
29957 | id: 21
|
29958 | }, {
|
29959 | rule: 'optional',
|
29960 | type: 'int32',
|
29961 | name: 'convType',
|
29962 | id: 22
|
29963 | }]
|
29964 | }, {
|
29965 | name: 'AckCommand',
|
29966 | syntax: 'proto2',
|
29967 | fields: [{
|
29968 | rule: 'optional',
|
29969 | type: 'int32',
|
29970 | name: 'code',
|
29971 | id: 1
|
29972 | }, {
|
29973 | rule: 'optional',
|
29974 | type: 'string',
|
29975 | name: 'reason',
|
29976 | id: 2
|
29977 | }, {
|
29978 | rule: 'optional',
|
29979 | type: 'string',
|
29980 | name: 'mid',
|
29981 | id: 3
|
29982 | }, {
|
29983 | rule: 'optional',
|
29984 | type: 'string',
|
29985 | name: 'cid',
|
29986 | id: 4
|
29987 | }, {
|
29988 | rule: 'optional',
|
29989 | type: 'int64',
|
29990 | name: 't',
|
29991 | id: 5
|
29992 | }, {
|
29993 | rule: 'optional',
|
29994 | type: 'string',
|
29995 | name: 'uid',
|
29996 | id: 6
|
29997 | }, {
|
29998 | rule: 'optional',
|
29999 | type: 'int64',
|
30000 | name: 'fromts',
|
30001 | id: 7
|
30002 | }, {
|
30003 | rule: 'optional',
|
30004 | type: 'int64',
|
30005 | name: 'tots',
|
30006 | id: 8
|
30007 | }, {
|
30008 | rule: 'optional',
|
30009 | type: 'string',
|
30010 | name: 'type',
|
30011 | id: 9
|
30012 | }, {
|
30013 | rule: 'repeated',
|
30014 | type: 'string',
|
30015 | name: 'ids',
|
30016 | id: 10
|
30017 | }, {
|
30018 | rule: 'optional',
|
30019 | type: 'int32',
|
30020 | name: 'appCode',
|
30021 | id: 11
|
30022 | }, {
|
30023 | rule: 'optional',
|
30024 | type: 'string',
|
30025 | name: 'appMsg',
|
30026 | id: 12
|
30027 | }]
|
30028 | }, {
|
30029 | name: 'UnreadCommand',
|
30030 | syntax: 'proto2',
|
30031 | fields: [{
|
30032 | rule: 'repeated',
|
30033 | type: 'UnreadTuple',
|
30034 | name: 'convs',
|
30035 | id: 1
|
30036 | }, {
|
30037 | rule: 'optional',
|
30038 | type: 'int64',
|
30039 | name: 'notifTime',
|
30040 | id: 2
|
30041 | }]
|
30042 | }, {
|
30043 | name: 'ConvCommand',
|
30044 | syntax: 'proto2',
|
30045 | fields: [{
|
30046 | rule: 'repeated',
|
30047 | type: 'string',
|
30048 | name: 'm',
|
30049 | id: 1
|
30050 | }, {
|
30051 | rule: 'optional',
|
30052 | type: 'bool',
|
30053 | name: 'transient',
|
30054 | id: 2
|
30055 | }, {
|
30056 | rule: 'optional',
|
30057 | type: 'bool',
|
30058 | name: 'unique',
|
30059 | id: 3
|
30060 | }, {
|
30061 | rule: 'optional',
|
30062 | type: 'string',
|
30063 | name: 'cid',
|
30064 | id: 4
|
30065 | }, {
|
30066 | rule: 'optional',
|
30067 | type: 'string',
|
30068 | name: 'cdate',
|
30069 | id: 5
|
30070 | }, {
|
30071 | rule: 'optional',
|
30072 | type: 'string',
|
30073 | name: 'initBy',
|
30074 | id: 6
|
30075 | }, {
|
30076 | rule: 'optional',
|
30077 | type: 'string',
|
30078 | name: 'sort',
|
30079 | id: 7
|
30080 | }, {
|
30081 | rule: 'optional',
|
30082 | type: 'int32',
|
30083 | name: 'limit',
|
30084 | id: 8
|
30085 | }, {
|
30086 | rule: 'optional',
|
30087 | type: 'int32',
|
30088 | name: 'skip',
|
30089 | id: 9
|
30090 | }, {
|
30091 | rule: 'optional',
|
30092 | type: 'int32',
|
30093 | name: 'flag',
|
30094 | id: 10
|
30095 | }, {
|
30096 | rule: 'optional',
|
30097 | type: 'int32',
|
30098 | name: 'count',
|
30099 | id: 11
|
30100 | }, {
|
30101 | rule: 'optional',
|
30102 | type: 'string',
|
30103 | name: 'udate',
|
30104 | id: 12
|
30105 | }, {
|
30106 | rule: 'optional',
|
30107 | type: 'int64',
|
30108 | name: 't',
|
30109 | id: 13
|
30110 | }, {
|
30111 | rule: 'optional',
|
30112 | type: 'string',
|
30113 | name: 'n',
|
30114 | id: 14
|
30115 | }, {
|
30116 | rule: 'optional',
|
30117 | type: 'string',
|
30118 | name: 's',
|
30119 | id: 15
|
30120 | }, {
|
30121 | rule: 'optional',
|
30122 | type: 'bool',
|
30123 | name: 'statusSub',
|
30124 | id: 16
|
30125 | }, {
|
30126 | rule: 'optional',
|
30127 | type: 'bool',
|
30128 | name: 'statusPub',
|
30129 | id: 17
|
30130 | }, {
|
30131 | rule: 'optional',
|
30132 | type: 'int32',
|
30133 | name: 'statusTTL',
|
30134 | id: 18
|
30135 | }, {
|
30136 | rule: 'optional',
|
30137 | type: 'string',
|
30138 | name: 'uniqueId',
|
30139 | id: 19
|
30140 | }, {
|
30141 | rule: 'optional',
|
30142 | type: 'string',
|
30143 | name: 'targetClientId',
|
30144 | id: 20
|
30145 | }, {
|
30146 | rule: 'optional',
|
30147 | type: 'int64',
|
30148 | name: 'maxReadTimestamp',
|
30149 | id: 21
|
30150 | }, {
|
30151 | rule: 'optional',
|
30152 | type: 'int64',
|
30153 | name: 'maxAckTimestamp',
|
30154 | id: 22
|
30155 | }, {
|
30156 | rule: 'optional',
|
30157 | type: 'bool',
|
30158 | name: 'queryAllMembers',
|
30159 | id: 23
|
30160 | }, {
|
30161 | rule: 'repeated',
|
30162 | type: 'MaxReadTuple',
|
30163 | name: 'maxReadTuples',
|
30164 | id: 24
|
30165 | }, {
|
30166 | rule: 'repeated',
|
30167 | type: 'string',
|
30168 | name: 'cids',
|
30169 | id: 25
|
30170 | }, {
|
30171 | rule: 'optional',
|
30172 | type: 'ConvMemberInfo',
|
30173 | name: 'info',
|
30174 | id: 26
|
30175 | }, {
|
30176 | rule: 'optional',
|
30177 | type: 'bool',
|
30178 | name: 'tempConv',
|
30179 | id: 27
|
30180 | }, {
|
30181 | rule: 'optional',
|
30182 | type: 'int32',
|
30183 | name: 'tempConvTTL',
|
30184 | id: 28
|
30185 | }, {
|
30186 | rule: 'repeated',
|
30187 | type: 'string',
|
30188 | name: 'tempConvIds',
|
30189 | id: 29
|
30190 | }, {
|
30191 | rule: 'repeated',
|
30192 | type: 'string',
|
30193 | name: 'allowedPids',
|
30194 | id: 30
|
30195 | }, {
|
30196 | rule: 'repeated',
|
30197 | type: 'ErrorCommand',
|
30198 | name: 'failedPids',
|
30199 | id: 31
|
30200 | }, {
|
30201 | rule: 'optional',
|
30202 | type: 'string',
|
30203 | name: 'next',
|
30204 | id: 40
|
30205 | }, {
|
30206 | rule: 'optional',
|
30207 | type: 'JsonObjectMessage',
|
30208 | name: 'results',
|
30209 | id: 100
|
30210 | }, {
|
30211 | rule: 'optional',
|
30212 | type: 'JsonObjectMessage',
|
30213 | name: 'where',
|
30214 | id: 101
|
30215 | }, {
|
30216 | rule: 'optional',
|
30217 | type: 'JsonObjectMessage',
|
30218 | name: 'attr',
|
30219 | id: 103
|
30220 | }, {
|
30221 | rule: 'optional',
|
30222 | type: 'JsonObjectMessage',
|
30223 | name: 'attrModified',
|
30224 | id: 104
|
30225 | }]
|
30226 | }, {
|
30227 | name: 'RoomCommand',
|
30228 | syntax: 'proto2',
|
30229 | fields: [{
|
30230 | rule: 'optional',
|
30231 | type: 'string',
|
30232 | name: 'roomId',
|
30233 | id: 1
|
30234 | }, {
|
30235 | rule: 'optional',
|
30236 | type: 'string',
|
30237 | name: 's',
|
30238 | id: 2
|
30239 | }, {
|
30240 | rule: 'optional',
|
30241 | type: 'int64',
|
30242 | name: 't',
|
30243 | id: 3
|
30244 | }, {
|
30245 | rule: 'optional',
|
30246 | type: 'string',
|
30247 | name: 'n',
|
30248 | id: 4
|
30249 | }, {
|
30250 | rule: 'optional',
|
30251 | type: 'bool',
|
30252 | name: 'transient',
|
30253 | id: 5
|
30254 | }, {
|
30255 | rule: 'repeated',
|
30256 | type: 'string',
|
30257 | name: 'roomPeerIds',
|
30258 | id: 6
|
30259 | }, {
|
30260 | rule: 'optional',
|
30261 | type: 'string',
|
30262 | name: 'byPeerId',
|
30263 | id: 7
|
30264 | }]
|
30265 | }, {
|
30266 | name: 'LogsCommand',
|
30267 | syntax: 'proto2',
|
30268 | fields: [{
|
30269 | rule: 'optional',
|
30270 | type: 'string',
|
30271 | name: 'cid',
|
30272 | id: 1
|
30273 | }, {
|
30274 | rule: 'optional',
|
30275 | type: 'int32',
|
30276 | name: 'l',
|
30277 | id: 2
|
30278 | }, {
|
30279 | rule: 'optional',
|
30280 | type: 'int32',
|
30281 | name: 'limit',
|
30282 | id: 3
|
30283 | }, {
|
30284 | rule: 'optional',
|
30285 | type: 'int64',
|
30286 | name: 't',
|
30287 | id: 4
|
30288 | }, {
|
30289 | rule: 'optional',
|
30290 | type: 'int64',
|
30291 | name: 'tt',
|
30292 | id: 5
|
30293 | }, {
|
30294 | rule: 'optional',
|
30295 | type: 'string',
|
30296 | name: 'tmid',
|
30297 | id: 6
|
30298 | }, {
|
30299 | rule: 'optional',
|
30300 | type: 'string',
|
30301 | name: 'mid',
|
30302 | id: 7
|
30303 | }, {
|
30304 | rule: 'optional',
|
30305 | type: 'string',
|
30306 | name: 'checksum',
|
30307 | id: 8
|
30308 | }, {
|
30309 | rule: 'optional',
|
30310 | type: 'bool',
|
30311 | name: 'stored',
|
30312 | id: 9
|
30313 | }, {
|
30314 | rule: 'optional',
|
30315 | type: 'QueryDirection',
|
30316 | name: 'direction',
|
30317 | id: 10,
|
30318 | options: {
|
30319 | "default": 'OLD'
|
30320 | }
|
30321 | }, {
|
30322 | rule: 'optional',
|
30323 | type: 'bool',
|
30324 | name: 'tIncluded',
|
30325 | id: 11
|
30326 | }, {
|
30327 | rule: 'optional',
|
30328 | type: 'bool',
|
30329 | name: 'ttIncluded',
|
30330 | id: 12
|
30331 | }, {
|
30332 | rule: 'optional',
|
30333 | type: 'int32',
|
30334 | name: 'lctype',
|
30335 | id: 13
|
30336 | }, {
|
30337 | rule: 'repeated',
|
30338 | type: 'LogItem',
|
30339 | name: 'logs',
|
30340 | id: 105
|
30341 | }],
|
30342 | enums: [{
|
30343 | name: 'QueryDirection',
|
30344 | syntax: 'proto2',
|
30345 | values: [{
|
30346 | name: 'OLD',
|
30347 | id: 1
|
30348 | }, {
|
30349 | name: 'NEW',
|
30350 | id: 2
|
30351 | }]
|
30352 | }]
|
30353 | }, {
|
30354 | name: 'RcpCommand',
|
30355 | syntax: 'proto2',
|
30356 | fields: [{
|
30357 | rule: 'optional',
|
30358 | type: 'string',
|
30359 | name: 'id',
|
30360 | id: 1
|
30361 | }, {
|
30362 | rule: 'optional',
|
30363 | type: 'string',
|
30364 | name: 'cid',
|
30365 | id: 2
|
30366 | }, {
|
30367 | rule: 'optional',
|
30368 | type: 'int64',
|
30369 | name: 't',
|
30370 | id: 3
|
30371 | }, {
|
30372 | rule: 'optional',
|
30373 | type: 'bool',
|
30374 | name: 'read',
|
30375 | id: 4
|
30376 | }, {
|
30377 | rule: 'optional',
|
30378 | type: 'string',
|
30379 | name: 'from',
|
30380 | id: 5
|
30381 | }]
|
30382 | }, {
|
30383 | name: 'ReadTuple',
|
30384 | syntax: 'proto2',
|
30385 | fields: [{
|
30386 | rule: 'required',
|
30387 | type: 'string',
|
30388 | name: 'cid',
|
30389 | id: 1
|
30390 | }, {
|
30391 | rule: 'optional',
|
30392 | type: 'int64',
|
30393 | name: 'timestamp',
|
30394 | id: 2
|
30395 | }, {
|
30396 | rule: 'optional',
|
30397 | type: 'string',
|
30398 | name: 'mid',
|
30399 | id: 3
|
30400 | }]
|
30401 | }, {
|
30402 | name: 'MaxReadTuple',
|
30403 | syntax: 'proto2',
|
30404 | fields: [{
|
30405 | rule: 'optional',
|
30406 | type: 'string',
|
30407 | name: 'pid',
|
30408 | id: 1
|
30409 | }, {
|
30410 | rule: 'optional',
|
30411 | type: 'int64',
|
30412 | name: 'maxAckTimestamp',
|
30413 | id: 2
|
30414 | }, {
|
30415 | rule: 'optional',
|
30416 | type: 'int64',
|
30417 | name: 'maxReadTimestamp',
|
30418 | id: 3
|
30419 | }]
|
30420 | }, {
|
30421 | name: 'ReadCommand',
|
30422 | syntax: 'proto2',
|
30423 | fields: [{
|
30424 | rule: 'optional',
|
30425 | type: 'string',
|
30426 | name: 'cid',
|
30427 | id: 1
|
30428 | }, {
|
30429 | rule: 'repeated',
|
30430 | type: 'string',
|
30431 | name: 'cids',
|
30432 | id: 2
|
30433 | }, {
|
30434 | rule: 'repeated',
|
30435 | type: 'ReadTuple',
|
30436 | name: 'convs',
|
30437 | id: 3
|
30438 | }]
|
30439 | }, {
|
30440 | name: 'PresenceCommand',
|
30441 | syntax: 'proto2',
|
30442 | fields: [{
|
30443 | rule: 'optional',
|
30444 | type: 'StatusType',
|
30445 | name: 'status',
|
30446 | id: 1
|
30447 | }, {
|
30448 | rule: 'repeated',
|
30449 | type: 'string',
|
30450 | name: 'sessionPeerIds',
|
30451 | id: 2
|
30452 | }, {
|
30453 | rule: 'optional',
|
30454 | type: 'string',
|
30455 | name: 'cid',
|
30456 | id: 3
|
30457 | }]
|
30458 | }, {
|
30459 | name: 'ReportCommand',
|
30460 | syntax: 'proto2',
|
30461 | fields: [{
|
30462 | rule: 'optional',
|
30463 | type: 'bool',
|
30464 | name: 'initiative',
|
30465 | id: 1
|
30466 | }, {
|
30467 | rule: 'optional',
|
30468 | type: 'string',
|
30469 | name: 'type',
|
30470 | id: 2
|
30471 | }, {
|
30472 | rule: 'optional',
|
30473 | type: 'string',
|
30474 | name: 'data',
|
30475 | id: 3
|
30476 | }]
|
30477 | }, {
|
30478 | name: 'PatchItem',
|
30479 | syntax: 'proto2',
|
30480 | fields: [{
|
30481 | rule: 'optional',
|
30482 | type: 'string',
|
30483 | name: 'cid',
|
30484 | id: 1
|
30485 | }, {
|
30486 | rule: 'optional',
|
30487 | type: 'string',
|
30488 | name: 'mid',
|
30489 | id: 2
|
30490 | }, {
|
30491 | rule: 'optional',
|
30492 | type: 'int64',
|
30493 | name: 'timestamp',
|
30494 | id: 3
|
30495 | }, {
|
30496 | rule: 'optional',
|
30497 | type: 'bool',
|
30498 | name: 'recall',
|
30499 | id: 4
|
30500 | }, {
|
30501 | rule: 'optional',
|
30502 | type: 'string',
|
30503 | name: 'data',
|
30504 | id: 5
|
30505 | }, {
|
30506 | rule: 'optional',
|
30507 | type: 'int64',
|
30508 | name: 'patchTimestamp',
|
30509 | id: 6
|
30510 | }, {
|
30511 | rule: 'optional',
|
30512 | type: 'string',
|
30513 | name: 'from',
|
30514 | id: 7
|
30515 | }, {
|
30516 | rule: 'optional',
|
30517 | type: 'bytes',
|
30518 | name: 'binaryMsg',
|
30519 | id: 8
|
30520 | }, {
|
30521 | rule: 'optional',
|
30522 | type: 'bool',
|
30523 | name: 'mentionAll',
|
30524 | id: 9
|
30525 | }, {
|
30526 | rule: 'repeated',
|
30527 | type: 'string',
|
30528 | name: 'mentionPids',
|
30529 | id: 10
|
30530 | }, {
|
30531 | rule: 'optional',
|
30532 | type: 'int64',
|
30533 | name: 'patchCode',
|
30534 | id: 11
|
30535 | }, {
|
30536 | rule: 'optional',
|
30537 | type: 'string',
|
30538 | name: 'patchReason',
|
30539 | id: 12
|
30540 | }]
|
30541 | }, {
|
30542 | name: 'PatchCommand',
|
30543 | syntax: 'proto2',
|
30544 | fields: [{
|
30545 | rule: 'repeated',
|
30546 | type: 'PatchItem',
|
30547 | name: 'patches',
|
30548 | id: 1
|
30549 | }, {
|
30550 | rule: 'optional',
|
30551 | type: 'int64',
|
30552 | name: 'lastPatchTime',
|
30553 | id: 2
|
30554 | }]
|
30555 | }, {
|
30556 | name: 'PubsubCommand',
|
30557 | syntax: 'proto2',
|
30558 | fields: [{
|
30559 | rule: 'optional',
|
30560 | type: 'string',
|
30561 | name: 'cid',
|
30562 | id: 1
|
30563 | }, {
|
30564 | rule: 'repeated',
|
30565 | type: 'string',
|
30566 | name: 'cids',
|
30567 | id: 2
|
30568 | }, {
|
30569 | rule: 'optional',
|
30570 | type: 'string',
|
30571 | name: 'topic',
|
30572 | id: 3
|
30573 | }, {
|
30574 | rule: 'optional',
|
30575 | type: 'string',
|
30576 | name: 'subtopic',
|
30577 | id: 4
|
30578 | }, {
|
30579 | rule: 'repeated',
|
30580 | type: 'string',
|
30581 | name: 'topics',
|
30582 | id: 5
|
30583 | }, {
|
30584 | rule: 'repeated',
|
30585 | type: 'string',
|
30586 | name: 'subtopics',
|
30587 | id: 6
|
30588 | }, {
|
30589 | rule: 'optional',
|
30590 | type: 'JsonObjectMessage',
|
30591 | name: 'results',
|
30592 | id: 7
|
30593 | }]
|
30594 | }, {
|
30595 | name: 'BlacklistCommand',
|
30596 | syntax: 'proto2',
|
30597 | fields: [{
|
30598 | rule: 'optional',
|
30599 | type: 'string',
|
30600 | name: 'srcCid',
|
30601 | id: 1
|
30602 | }, {
|
30603 | rule: 'repeated',
|
30604 | type: 'string',
|
30605 | name: 'toPids',
|
30606 | id: 2
|
30607 | }, {
|
30608 | rule: 'optional',
|
30609 | type: 'string',
|
30610 | name: 'srcPid',
|
30611 | id: 3
|
30612 | }, {
|
30613 | rule: 'repeated',
|
30614 | type: 'string',
|
30615 | name: 'toCids',
|
30616 | id: 4
|
30617 | }, {
|
30618 | rule: 'optional',
|
30619 | type: 'int32',
|
30620 | name: 'limit',
|
30621 | id: 5
|
30622 | }, {
|
30623 | rule: 'optional',
|
30624 | type: 'string',
|
30625 | name: 'next',
|
30626 | id: 6
|
30627 | }, {
|
30628 | rule: 'repeated',
|
30629 | type: 'string',
|
30630 | name: 'blockedPids',
|
30631 | id: 8
|
30632 | }, {
|
30633 | rule: 'repeated',
|
30634 | type: 'string',
|
30635 | name: 'blockedCids',
|
30636 | id: 9
|
30637 | }, {
|
30638 | rule: 'repeated',
|
30639 | type: 'string',
|
30640 | name: 'allowedPids',
|
30641 | id: 10
|
30642 | }, {
|
30643 | rule: 'repeated',
|
30644 | type: 'ErrorCommand',
|
30645 | name: 'failedPids',
|
30646 | id: 11
|
30647 | }, {
|
30648 | rule: 'optional',
|
30649 | type: 'int64',
|
30650 | name: 't',
|
30651 | id: 12
|
30652 | }, {
|
30653 | rule: 'optional',
|
30654 | type: 'string',
|
30655 | name: 'n',
|
30656 | id: 13
|
30657 | }, {
|
30658 | rule: 'optional',
|
30659 | type: 'string',
|
30660 | name: 's',
|
30661 | id: 14
|
30662 | }]
|
30663 | }, {
|
30664 | name: 'GenericCommand',
|
30665 | syntax: 'proto2',
|
30666 | fields: [{
|
30667 | rule: 'optional',
|
30668 | type: 'CommandType',
|
30669 | name: 'cmd',
|
30670 | id: 1
|
30671 | }, {
|
30672 | rule: 'optional',
|
30673 | type: 'OpType',
|
30674 | name: 'op',
|
30675 | id: 2
|
30676 | }, {
|
30677 | rule: 'optional',
|
30678 | type: 'string',
|
30679 | name: 'appId',
|
30680 | id: 3
|
30681 | }, {
|
30682 | rule: 'optional',
|
30683 | type: 'string',
|
30684 | name: 'peerId',
|
30685 | id: 4
|
30686 | }, {
|
30687 | rule: 'optional',
|
30688 | type: 'int32',
|
30689 | name: 'i',
|
30690 | id: 5
|
30691 | }, {
|
30692 | rule: 'optional',
|
30693 | type: 'string',
|
30694 | name: 'installationId',
|
30695 | id: 6
|
30696 | }, {
|
30697 | rule: 'optional',
|
30698 | type: 'int32',
|
30699 | name: 'priority',
|
30700 | id: 7
|
30701 | }, {
|
30702 | rule: 'optional',
|
30703 | type: 'int32',
|
30704 | name: 'service',
|
30705 | id: 8
|
30706 | }, {
|
30707 | rule: 'optional',
|
30708 | type: 'int64',
|
30709 | name: 'serverTs',
|
30710 | id: 9
|
30711 | }, {
|
30712 | rule: 'optional',
|
30713 | type: 'int64',
|
30714 | name: 'clientTs',
|
30715 | id: 10
|
30716 | }, {
|
30717 | rule: 'optional',
|
30718 | type: 'int32',
|
30719 | name: 'notificationType',
|
30720 | id: 11
|
30721 | }, {
|
30722 | rule: 'optional',
|
30723 | type: 'DataCommand',
|
30724 | name: 'dataMessage',
|
30725 | id: 101
|
30726 | }, {
|
30727 | rule: 'optional',
|
30728 | type: 'SessionCommand',
|
30729 | name: 'sessionMessage',
|
30730 | id: 102
|
30731 | }, {
|
30732 | rule: 'optional',
|
30733 | type: 'ErrorCommand',
|
30734 | name: 'errorMessage',
|
30735 | id: 103
|
30736 | }, {
|
30737 | rule: 'optional',
|
30738 | type: 'DirectCommand',
|
30739 | name: 'directMessage',
|
30740 | id: 104
|
30741 | }, {
|
30742 | rule: 'optional',
|
30743 | type: 'AckCommand',
|
30744 | name: 'ackMessage',
|
30745 | id: 105
|
30746 | }, {
|
30747 | rule: 'optional',
|
30748 | type: 'UnreadCommand',
|
30749 | name: 'unreadMessage',
|
30750 | id: 106
|
30751 | }, {
|
30752 | rule: 'optional',
|
30753 | type: 'ReadCommand',
|
30754 | name: 'readMessage',
|
30755 | id: 107
|
30756 | }, {
|
30757 | rule: 'optional',
|
30758 | type: 'RcpCommand',
|
30759 | name: 'rcpMessage',
|
30760 | id: 108
|
30761 | }, {
|
30762 | rule: 'optional',
|
30763 | type: 'LogsCommand',
|
30764 | name: 'logsMessage',
|
30765 | id: 109
|
30766 | }, {
|
30767 | rule: 'optional',
|
30768 | type: 'ConvCommand',
|
30769 | name: 'convMessage',
|
30770 | id: 110
|
30771 | }, {
|
30772 | rule: 'optional',
|
30773 | type: 'RoomCommand',
|
30774 | name: 'roomMessage',
|
30775 | id: 111
|
30776 | }, {
|
30777 | rule: 'optional',
|
30778 | type: 'PresenceCommand',
|
30779 | name: 'presenceMessage',
|
30780 | id: 112
|
30781 | }, {
|
30782 | rule: 'optional',
|
30783 | type: 'ReportCommand',
|
30784 | name: 'reportMessage',
|
30785 | id: 113
|
30786 | }, {
|
30787 | rule: 'optional',
|
30788 | type: 'PatchCommand',
|
30789 | name: 'patchMessage',
|
30790 | id: 114
|
30791 | }, {
|
30792 | rule: 'optional',
|
30793 | type: 'PubsubCommand',
|
30794 | name: 'pubsubMessage',
|
30795 | id: 115
|
30796 | }, {
|
30797 | rule: 'optional',
|
30798 | type: 'BlacklistCommand',
|
30799 | name: 'blacklistMessage',
|
30800 | id: 116
|
30801 | }]
|
30802 | }],
|
30803 | enums: [{
|
30804 | name: 'CommandType',
|
30805 | syntax: 'proto2',
|
30806 | values: [{
|
30807 | name: 'session',
|
30808 | id: 0
|
30809 | }, {
|
30810 | name: 'conv',
|
30811 | id: 1
|
30812 | }, {
|
30813 | name: 'direct',
|
30814 | id: 2
|
30815 | }, {
|
30816 | name: 'ack',
|
30817 | id: 3
|
30818 | }, {
|
30819 | name: 'rcp',
|
30820 | id: 4
|
30821 | }, {
|
30822 | name: 'unread',
|
30823 | id: 5
|
30824 | }, {
|
30825 | name: 'logs',
|
30826 | id: 6
|
30827 | }, {
|
30828 | name: 'error',
|
30829 | id: 7
|
30830 | }, {
|
30831 | name: 'login',
|
30832 | id: 8
|
30833 | }, {
|
30834 | name: 'data',
|
30835 | id: 9
|
30836 | }, {
|
30837 | name: 'room',
|
30838 | id: 10
|
30839 | }, {
|
30840 | name: 'read',
|
30841 | id: 11
|
30842 | }, {
|
30843 | name: 'presence',
|
30844 | id: 12
|
30845 | }, {
|
30846 | name: 'report',
|
30847 | id: 13
|
30848 | }, {
|
30849 | name: 'echo',
|
30850 | id: 14
|
30851 | }, {
|
30852 | name: 'loggedin',
|
30853 | id: 15
|
30854 | }, {
|
30855 | name: 'logout',
|
30856 | id: 16
|
30857 | }, {
|
30858 | name: 'loggedout',
|
30859 | id: 17
|
30860 | }, {
|
30861 | name: 'patch',
|
30862 | id: 18
|
30863 | }, {
|
30864 | name: 'pubsub',
|
30865 | id: 19
|
30866 | }, {
|
30867 | name: 'blacklist',
|
30868 | id: 20
|
30869 | }, {
|
30870 | name: 'goaway',
|
30871 | id: 21
|
30872 | }]
|
30873 | }, {
|
30874 | name: 'OpType',
|
30875 | syntax: 'proto2',
|
30876 | values: [{
|
30877 | name: 'open',
|
30878 | id: 1
|
30879 | }, {
|
30880 | name: 'add',
|
30881 | id: 2
|
30882 | }, {
|
30883 | name: 'remove',
|
30884 | id: 3
|
30885 | }, {
|
30886 | name: 'close',
|
30887 | id: 4
|
30888 | }, {
|
30889 | name: 'opened',
|
30890 | id: 5
|
30891 | }, {
|
30892 | name: 'closed',
|
30893 | id: 6
|
30894 | }, {
|
30895 | name: 'query',
|
30896 | id: 7
|
30897 | }, {
|
30898 | name: 'query_result',
|
30899 | id: 8
|
30900 | }, {
|
30901 | name: 'conflict',
|
30902 | id: 9
|
30903 | }, {
|
30904 | name: 'added',
|
30905 | id: 10
|
30906 | }, {
|
30907 | name: 'removed',
|
30908 | id: 11
|
30909 | }, {
|
30910 | name: 'refresh',
|
30911 | id: 12
|
30912 | }, {
|
30913 | name: 'refreshed',
|
30914 | id: 13
|
30915 | }, {
|
30916 | name: 'start',
|
30917 | id: 30
|
30918 | }, {
|
30919 | name: 'started',
|
30920 | id: 31
|
30921 | }, {
|
30922 | name: 'joined',
|
30923 | id: 32
|
30924 | }, {
|
30925 | name: 'members_joined',
|
30926 | id: 33
|
30927 | }, {
|
30928 | name: 'left',
|
30929 | id: 39
|
30930 | }, {
|
30931 | name: 'members_left',
|
30932 | id: 40
|
30933 | }, {
|
30934 | name: 'results',
|
30935 | id: 42
|
30936 | }, {
|
30937 | name: 'count',
|
30938 | id: 43
|
30939 | }, {
|
30940 | name: 'result',
|
30941 | id: 44
|
30942 | }, {
|
30943 | name: 'update',
|
30944 | id: 45
|
30945 | }, {
|
30946 | name: 'updated',
|
30947 | id: 46
|
30948 | }, {
|
30949 | name: 'mute',
|
30950 | id: 47
|
30951 | }, {
|
30952 | name: 'unmute',
|
30953 | id: 48
|
30954 | }, {
|
30955 | name: 'status',
|
30956 | id: 49
|
30957 | }, {
|
30958 | name: 'members',
|
30959 | id: 50
|
30960 | }, {
|
30961 | name: 'max_read',
|
30962 | id: 51
|
30963 | }, {
|
30964 | name: 'is_member',
|
30965 | id: 52
|
30966 | }, {
|
30967 | name: 'member_info_update',
|
30968 | id: 53
|
30969 | }, {
|
30970 | name: 'member_info_updated',
|
30971 | id: 54
|
30972 | }, {
|
30973 | name: 'member_info_changed',
|
30974 | id: 55
|
30975 | }, {
|
30976 | name: 'join',
|
30977 | id: 80
|
30978 | }, {
|
30979 | name: 'invite',
|
30980 | id: 81
|
30981 | }, {
|
30982 | name: 'leave',
|
30983 | id: 82
|
30984 | }, {
|
30985 | name: 'kick',
|
30986 | id: 83
|
30987 | }, {
|
30988 | name: 'reject',
|
30989 | id: 84
|
30990 | }, {
|
30991 | name: 'invited',
|
30992 | id: 85
|
30993 | }, {
|
30994 | name: 'kicked',
|
30995 | id: 86
|
30996 | }, {
|
30997 | name: 'upload',
|
30998 | id: 100
|
30999 | }, {
|
31000 | name: 'uploaded',
|
31001 | id: 101
|
31002 | }, {
|
31003 | name: 'subscribe',
|
31004 | id: 120
|
31005 | }, {
|
31006 | name: 'subscribed',
|
31007 | id: 121
|
31008 | }, {
|
31009 | name: 'unsubscribe',
|
31010 | id: 122
|
31011 | }, {
|
31012 | name: 'unsubscribed',
|
31013 | id: 123
|
31014 | }, {
|
31015 | name: 'is_subscribed',
|
31016 | id: 124
|
31017 | }, {
|
31018 | name: 'modify',
|
31019 | id: 150
|
31020 | }, {
|
31021 | name: 'modified',
|
31022 | id: 151
|
31023 | }, {
|
31024 | name: 'block',
|
31025 | id: 170
|
31026 | }, {
|
31027 | name: 'unblock',
|
31028 | id: 171
|
31029 | }, {
|
31030 | name: 'blocked',
|
31031 | id: 172
|
31032 | }, {
|
31033 | name: 'unblocked',
|
31034 | id: 173
|
31035 | }, {
|
31036 | name: 'members_blocked',
|
31037 | id: 174
|
31038 | }, {
|
31039 | name: 'members_unblocked',
|
31040 | id: 175
|
31041 | }, {
|
31042 | name: 'check_block',
|
31043 | id: 176
|
31044 | }, {
|
31045 | name: 'check_result',
|
31046 | id: 177
|
31047 | }, {
|
31048 | name: 'add_shutup',
|
31049 | id: 180
|
31050 | }, {
|
31051 | name: 'remove_shutup',
|
31052 | id: 181
|
31053 | }, {
|
31054 | name: 'query_shutup',
|
31055 | id: 182
|
31056 | }, {
|
31057 | name: 'shutup_added',
|
31058 | id: 183
|
31059 | }, {
|
31060 | name: 'shutup_removed',
|
31061 | id: 184
|
31062 | }, {
|
31063 | name: 'shutup_result',
|
31064 | id: 185
|
31065 | }, {
|
31066 | name: 'shutuped',
|
31067 | id: 186
|
31068 | }, {
|
31069 | name: 'unshutuped',
|
31070 | id: 187
|
31071 | }, {
|
31072 | name: 'members_shutuped',
|
31073 | id: 188
|
31074 | }, {
|
31075 | name: 'members_unshutuped',
|
31076 | id: 189
|
31077 | }, {
|
31078 | name: 'check_shutup',
|
31079 | id: 190
|
31080 | }]
|
31081 | }, {
|
31082 | name: 'StatusType',
|
31083 | syntax: 'proto2',
|
31084 | values: [{
|
31085 | name: 'on',
|
31086 | id: 1
|
31087 | }, {
|
31088 | name: 'off',
|
31089 | id: 2
|
31090 | }]
|
31091 | }],
|
31092 | isNamespace: true
|
31093 | }).build();
|
31094 | var _messages$push_server = messageCompiled.push_server.messages2,
|
31095 | JsonObjectMessage = _messages$push_server.JsonObjectMessage,
|
31096 | UnreadTuple = _messages$push_server.UnreadTuple,
|
31097 | LogItem = _messages$push_server.LogItem,
|
31098 | DataCommand = _messages$push_server.DataCommand,
|
31099 | SessionCommand = _messages$push_server.SessionCommand,
|
31100 | ErrorCommand = _messages$push_server.ErrorCommand,
|
31101 | DirectCommand = _messages$push_server.DirectCommand,
|
31102 | AckCommand = _messages$push_server.AckCommand,
|
31103 | UnreadCommand = _messages$push_server.UnreadCommand,
|
31104 | ConvCommand = _messages$push_server.ConvCommand,
|
31105 | RoomCommand = _messages$push_server.RoomCommand,
|
31106 | LogsCommand = _messages$push_server.LogsCommand,
|
31107 | RcpCommand = _messages$push_server.RcpCommand,
|
31108 | ReadTuple = _messages$push_server.ReadTuple,
|
31109 | MaxReadTuple = _messages$push_server.MaxReadTuple,
|
31110 | ReadCommand = _messages$push_server.ReadCommand,
|
31111 | PresenceCommand = _messages$push_server.PresenceCommand,
|
31112 | ReportCommand = _messages$push_server.ReportCommand,
|
31113 | GenericCommand = _messages$push_server.GenericCommand,
|
31114 | BlacklistCommand = _messages$push_server.BlacklistCommand,
|
31115 | PatchCommand = _messages$push_server.PatchCommand,
|
31116 | PatchItem = _messages$push_server.PatchItem,
|
31117 | ConvMemberInfo = _messages$push_server.ConvMemberInfo,
|
31118 | CommandType = _messages$push_server.CommandType,
|
31119 | OpType = _messages$push_server.OpType,
|
31120 | StatusType = _messages$push_server.StatusType;
|
31121 | var message = (0, _freeze.default)({
|
31122 | __proto__: null,
|
31123 | JsonObjectMessage: JsonObjectMessage,
|
31124 | UnreadTuple: UnreadTuple,
|
31125 | LogItem: LogItem,
|
31126 | DataCommand: DataCommand,
|
31127 | SessionCommand: SessionCommand,
|
31128 | ErrorCommand: ErrorCommand,
|
31129 | DirectCommand: DirectCommand,
|
31130 | AckCommand: AckCommand,
|
31131 | UnreadCommand: UnreadCommand,
|
31132 | ConvCommand: ConvCommand,
|
31133 | RoomCommand: RoomCommand,
|
31134 | LogsCommand: LogsCommand,
|
31135 | RcpCommand: RcpCommand,
|
31136 | ReadTuple: ReadTuple,
|
31137 | MaxReadTuple: MaxReadTuple,
|
31138 | ReadCommand: ReadCommand,
|
31139 | PresenceCommand: PresenceCommand,
|
31140 | ReportCommand: ReportCommand,
|
31141 | GenericCommand: GenericCommand,
|
31142 | BlacklistCommand: BlacklistCommand,
|
31143 | PatchCommand: PatchCommand,
|
31144 | PatchItem: PatchItem,
|
31145 | ConvMemberInfo: ConvMemberInfo,
|
31146 | CommandType: CommandType,
|
31147 | OpType: OpType,
|
31148 | StatusType: StatusType
|
31149 | });
|
31150 | var adapters = {};
|
31151 |
|
31152 | var getAdapter = function getAdapter(name) {
|
31153 | var adapter = adapters[name];
|
31154 |
|
31155 | if (adapter === undefined) {
|
31156 | throw new Error("".concat(name, " adapter is not configured"));
|
31157 | }
|
31158 |
|
31159 | return adapter;
|
31160 | };
|
31161 |
|
31162 |
|
31163 |
|
31164 |
|
31165 |
|
31166 |
|
31167 |
|
31168 |
|
31169 | var setAdapters = function setAdapters(newAdapters) {
|
31170 | (0, _assign.default)(adapters, newAdapters);
|
31171 | };
|
31172 |
|
31173 |
|
31174 |
|
31175 | var global$1 = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {};
|
31176 | var EXPIRED = (0, _symbol.default)('expired');
|
31177 | var debug = d('LC:Expirable');
|
31178 |
|
31179 | var Expirable = function () {
|
31180 | function Expirable(value, ttl) {
|
31181 | this.originalValue = value;
|
31182 |
|
31183 | if (typeof ttl === 'number') {
|
31184 | this.expiredAt = Date.now() + ttl;
|
31185 | }
|
31186 | }
|
31187 |
|
31188 | _createClass(Expirable, [{
|
31189 | key: "value",
|
31190 | get: function get() {
|
31191 | var expired = this.expiredAt && this.expiredAt <= Date.now();
|
31192 | if (expired) debug("expired: ".concat(this.originalValue));
|
31193 | return expired ? EXPIRED : this.originalValue;
|
31194 | }
|
31195 | }]);
|
31196 |
|
31197 | return Expirable;
|
31198 | }();
|
31199 |
|
31200 | Expirable.EXPIRED = EXPIRED;
|
31201 | var debug$1 = d('LC:Cache');
|
31202 |
|
31203 | var Cache = function () {
|
31204 | function Cache() {
|
31205 | var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'anonymous';
|
31206 | this.name = name;
|
31207 | this._map = {};
|
31208 | }
|
31209 |
|
31210 | var _proto = Cache.prototype;
|
31211 |
|
31212 | _proto.get = function get(key) {
|
31213 | var _context5;
|
31214 |
|
31215 | var cache = this._map[key];
|
31216 |
|
31217 | if (cache) {
|
31218 | var value = cache.value;
|
31219 |
|
31220 | if (value !== Expirable.EXPIRED) {
|
31221 | debug$1('[%s] hit: %s', this.name, key);
|
31222 | return value;
|
31223 | }
|
31224 |
|
31225 | delete this._map[key];
|
31226 | }
|
31227 |
|
31228 | debug$1((0, _concat.default)(_context5 = "[".concat(this.name, "] missed: ")).call(_context5, key));
|
31229 | return null;
|
31230 | };
|
31231 |
|
31232 | _proto.set = function set(key, value, ttl) {
|
31233 | debug$1('[%s] set: %s %d', this.name, key, ttl);
|
31234 | this._map[key] = new Expirable(value, ttl);
|
31235 | };
|
31236 |
|
31237 | return Cache;
|
31238 | }();
|
31239 |
|
31240 | function ownKeys(object, enumerableOnly) {
|
31241 | var keys = (0, _keys.default)(object);
|
31242 |
|
31243 | if (_getOwnPropertySymbols.default) {
|
31244 | var symbols = (0, _getOwnPropertySymbols.default)(object);
|
31245 | if (enumerableOnly) symbols = (0, _filter.default)(symbols).call(symbols, function (sym) {
|
31246 | return (0, _getOwnPropertyDescriptor.default)(object, sym).enumerable;
|
31247 | });
|
31248 | keys.push.apply(keys, symbols);
|
31249 | }
|
31250 |
|
31251 | return keys;
|
31252 | }
|
31253 |
|
31254 | function _objectSpread(target) {
|
31255 | for (var i = 1; i < arguments.length; i++) {
|
31256 | var source = arguments[i] != null ? arguments[i] : {};
|
31257 |
|
31258 | if (i % 2) {
|
31259 | ownKeys(Object(source), true).forEach(function (key) {
|
31260 | _defineProperty(target, key, source[key]);
|
31261 | });
|
31262 | } else if (_getOwnPropertyDescriptors.default) {
|
31263 | (0, _defineProperties.default)(target, (0, _getOwnPropertyDescriptors.default)(source));
|
31264 | } else {
|
31265 | ownKeys(Object(source)).forEach(function (key) {
|
31266 | (0, _defineProperty2.default)(target, key, (0, _getOwnPropertyDescriptor.default)(source, key));
|
31267 | });
|
31268 | }
|
31269 | }
|
31270 |
|
31271 | return target;
|
31272 | }
|
31273 |
|
31274 |
|
31275 |
|
31276 |
|
31277 |
|
31278 |
|
31279 |
|
31280 |
|
31281 |
|
31282 |
|
31283 | var debug$2 = {
|
31284 | enable: function enable() {
|
31285 | var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'LC*';
|
31286 | return d.enable(namespaces);
|
31287 | },
|
31288 | disable: d.disable
|
31289 | };
|
31290 |
|
31291 | var tryAll = function tryAll(promiseConstructors) {
|
31292 | var promise = new _promise.default(promiseConstructors[0]);
|
31293 |
|
31294 | if (promiseConstructors.length === 1) {
|
31295 | return promise;
|
31296 | }
|
31297 |
|
31298 | return promise["catch"](function () {
|
31299 | return tryAll((0, _slice.default)(promiseConstructors).call(promiseConstructors, 1));
|
31300 | });
|
31301 | };
|
31302 |
|
31303 |
|
31304 | var tap = function tap(interceptor) {
|
31305 | return function (value) {
|
31306 | return interceptor(value), value;
|
31307 | };
|
31308 | };
|
31309 |
|
31310 | var isIE10 = global$1.navigator && global$1.navigator.userAgent && (0, _indexOf.default)(_context6 = global$1.navigator.userAgent).call(_context6, 'MSIE 10.') !== -1;
|
31311 | var map = new _weakMap.default();
|
31312 |
|
31313 | var internal = function internal(object) {
|
31314 | if (!map.has(object)) {
|
31315 | map.set(object, {});
|
31316 | }
|
31317 |
|
31318 | return map.get(object);
|
31319 | };
|
31320 |
|
31321 | var compact = function compact(obj, filter) {
|
31322 | if (!isPlainObject(obj)) return obj;
|
31323 |
|
31324 | var object = _objectSpread({}, obj);
|
31325 |
|
31326 | (0, _keys.default)(object).forEach(function (prop) {
|
31327 | var value = object[prop];
|
31328 |
|
31329 | if (value === filter) {
|
31330 | delete object[prop];
|
31331 | } else {
|
31332 | object[prop] = compact(value, filter);
|
31333 | }
|
31334 | });
|
31335 | return object;
|
31336 | };
|
31337 |
|
31338 |
|
31339 | var removeNull = function removeNull(obj) {
|
31340 | return compact(obj, null);
|
31341 | };
|
31342 |
|
31343 | var trim = function trim(message) {
|
31344 | return removeNull(JSON.parse((0, _stringify.default)(message)));
|
31345 | };
|
31346 |
|
31347 | var ensureArray = function ensureArray(target) {
|
31348 | if (Array.isArray(target)) {
|
31349 | return target;
|
31350 | }
|
31351 |
|
31352 | if (target === undefined || target === null) {
|
31353 | return [];
|
31354 | }
|
31355 |
|
31356 | return [target];
|
31357 | };
|
31358 |
|
31359 | var isWeapp =
|
31360 | (typeof wx === "undefined" ? "undefined" : _typeof(wx)) === 'object' && typeof wx.connectSocket === 'function';
|
31361 |
|
31362 | var isCNApp = function isCNApp(appId) {
|
31363 | return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
|
31364 | };
|
31365 |
|
31366 | var equalBuffer = function equalBuffer(buffer1, buffer2) {
|
31367 | if (!buffer1 || !buffer2) return false;
|
31368 | if (buffer1.byteLength !== buffer2.byteLength) return false;
|
31369 | var a = new Uint8Array(buffer1);
|
31370 | var b = new Uint8Array(buffer2);
|
31371 | return !a.some(function (value, index) {
|
31372 | return value !== b[index];
|
31373 | });
|
31374 | };
|
31375 |
|
31376 | var _class;
|
31377 |
|
31378 | function ownKeys$1(object, enumerableOnly) {
|
31379 | var keys = (0, _keys.default)(object);
|
31380 |
|
31381 | if (_getOwnPropertySymbols.default) {
|
31382 | var symbols = (0, _getOwnPropertySymbols.default)(object);
|
31383 | if (enumerableOnly) symbols = (0, _filter.default)(symbols).call(symbols, function (sym) {
|
31384 | return (0, _getOwnPropertyDescriptor.default)(object, sym).enumerable;
|
31385 | });
|
31386 | keys.push.apply(keys, symbols);
|
31387 | }
|
31388 |
|
31389 | return keys;
|
31390 | }
|
31391 |
|
31392 | function _objectSpread$1(target) {
|
31393 | for (var i = 1; i < arguments.length; i++) {
|
31394 | var source = arguments[i] != null ? arguments[i] : {};
|
31395 |
|
31396 | if (i % 2) {
|
31397 | ownKeys$1(Object(source), true).forEach(function (key) {
|
31398 | _defineProperty(target, key, source[key]);
|
31399 | });
|
31400 | } else if (_getOwnPropertyDescriptors.default) {
|
31401 | (0, _defineProperties.default)(target, (0, _getOwnPropertyDescriptors.default)(source));
|
31402 | } else {
|
31403 | ownKeys$1(Object(source)).forEach(function (key) {
|
31404 | (0, _defineProperty2.default)(target, key, (0, _getOwnPropertyDescriptor.default)(source, key));
|
31405 | });
|
31406 | }
|
31407 | }
|
31408 |
|
31409 | return target;
|
31410 | }
|
31411 |
|
31412 | var debug$3 = d('LC:WebSocketPlus');
|
31413 | var OPEN = 'open';
|
31414 | var DISCONNECT = 'disconnect';
|
31415 | var RECONNECT = 'reconnect';
|
31416 | var RETRY = 'retry';
|
31417 | var SCHEDULE = 'schedule';
|
31418 | var OFFLINE = 'offline';
|
31419 | var ONLINE = 'online';
|
31420 | var ERROR = 'error';
|
31421 | var MESSAGE = 'message';
|
31422 | var HEARTBEAT_TIME = 180000;
|
31423 | var TIMEOUT_TIME = 380000;
|
31424 |
|
31425 | var DEFAULT_RETRY_STRATEGY = function DEFAULT_RETRY_STRATEGY(attempt) {
|
31426 | return Math.min(1000 * Math.pow(2, attempt), 300000);
|
31427 | };
|
31428 |
|
31429 | var requireConnected = function requireConnected(target, name, descriptor) {
|
31430 | return _objectSpread$1(_objectSpread$1({}, descriptor), {}, {
|
31431 | value: function requireConnectedWrapper() {
|
31432 | var _context7;
|
31433 |
|
31434 | var _descriptor$value;
|
31435 |
|
31436 | this.checkConnectionAvailability(name);
|
31437 |
|
31438 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
31439 | args[_key] = arguments[_key];
|
31440 | }
|
31441 |
|
31442 | return (_descriptor$value = descriptor.value).call.apply(_descriptor$value, (0, _concat.default)(_context7 = [this]).call(_context7, args));
|
31443 | }
|
31444 | });
|
31445 | };
|
31446 |
|
31447 | var WebSocketPlus = (_class = function (_EventEmitter) {
|
31448 | _inheritsLoose(WebSocketPlus, _EventEmitter);
|
31449 |
|
31450 | _createClass(WebSocketPlus, [{
|
31451 | key: "urls",
|
31452 | get: function get() {
|
31453 | return this._urls;
|
31454 | },
|
31455 | set: function set(urls) {
|
31456 | this._urls = ensureArray(urls);
|
31457 | }
|
31458 | }]);
|
31459 |
|
31460 | function WebSocketPlus(getUrls, protocol) {
|
31461 | var _this;
|
31462 |
|
31463 | _this = _EventEmitter.call(this) || this;
|
31464 |
|
31465 | _this.init();
|
31466 |
|
31467 | _this._protocol = protocol;
|
31468 |
|
31469 | _promise.default.resolve(typeof getUrls === 'function' ? getUrls() : getUrls).then(ensureArray).then(function (urls) {
|
31470 | _this._urls = urls;
|
31471 | return _this._open();
|
31472 | }).then(function () {
|
31473 | _this.__postponeTimeoutTimer = _this._postponeTimeoutTimer.bind(_assertThisInitialized(_this));
|
31474 |
|
31475 | if (global$1.addEventListener) {
|
31476 | _this.__pause = function () {
|
31477 | if (_this.can('pause')) _this.pause();
|
31478 | };
|
31479 |
|
31480 | _this.__resume = function () {
|
31481 | if (_this.can('resume')) _this.resume();
|
31482 | };
|
31483 |
|
31484 | global$1.addEventListener('offline', _this.__pause);
|
31485 | global$1.addEventListener('online', _this.__resume);
|
31486 | }
|
31487 |
|
31488 | _this.open();
|
31489 | })["catch"](_this["throw"].bind(_assertThisInitialized(_this)));
|
31490 |
|
31491 | return _this;
|
31492 | }
|
31493 |
|
31494 | var _proto = WebSocketPlus.prototype;
|
31495 |
|
31496 | _proto._open = function _open() {
|
31497 | var _this2 = this;
|
31498 |
|
31499 | return this._createWs(this._urls, this._protocol).then(function (ws) {
|
31500 | var _context8;
|
31501 |
|
31502 | var _this2$_urls = _toArray(_this2._urls),
|
31503 | first = _this2$_urls[0],
|
31504 | reset = (0, _slice.default)(_this2$_urls).call(_this2$_urls, 1);
|
31505 |
|
31506 | _this2._urls = (0, _concat.default)(_context8 = []).call(_context8, _toConsumableArray(reset), [first]);
|
31507 | return ws;
|
31508 | });
|
31509 | };
|
31510 |
|
31511 | _proto._createWs = function _createWs(urls, protocol) {
|
31512 | var _this3 = this;
|
31513 |
|
31514 | return tryAll((0, _map.default)(urls).call(urls, function (url) {
|
31515 | return function (resolve, reject) {
|
31516 | var _context9;
|
31517 |
|
31518 | debug$3((0, _concat.default)(_context9 = "connect [".concat(url, "] ")).call(_context9, protocol));
|
31519 | var WebSocket = getAdapter('WebSocket');
|
31520 | var ws = protocol ? new WebSocket(url, protocol) : new WebSocket(url);
|
31521 | ws.binaryType = _this3.binaryType || 'arraybuffer';
|
31522 |
|
31523 | ws.onopen = function () {
|
31524 | return resolve(ws);
|
31525 | };
|
31526 |
|
31527 | ws.onclose = function (error) {
|
31528 | if (error instanceof Error) {
|
31529 | return reject(error);
|
31530 | }
|
31531 |
|
31532 |
|
31533 | return reject(new Error("Failed to connect [".concat(url, "]")));
|
31534 | };
|
31535 |
|
31536 | ws.onerror = ws.onclose;
|
31537 | };
|
31538 | })).then(function (ws) {
|
31539 | _this3._ws = ws;
|
31540 | _this3._ws.onclose = _this3._handleClose.bind(_this3);
|
31541 | _this3._ws.onmessage = _this3._handleMessage.bind(_this3);
|
31542 | return ws;
|
31543 | });
|
31544 | };
|
31545 |
|
31546 | _proto._destroyWs = function _destroyWs() {
|
31547 | var ws = this._ws;
|
31548 | if (!ws) return;
|
31549 | ws.onopen = null;
|
31550 | ws.onclose = null;
|
31551 | ws.onerror = null;
|
31552 | ws.onmessage = null;
|
31553 | this._ws = null;
|
31554 | ws.close();
|
31555 | }
|
31556 | ;
|
31557 |
|
31558 | _proto.onbeforeevent = function onbeforeevent(event, from, to) {
|
31559 | var _context10, _context11;
|
31560 |
|
31561 | for (var _len2 = arguments.length, payload = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
|
31562 | payload[_key2 - 3] = arguments[_key2];
|
31563 | }
|
31564 |
|
31565 | debug$3((0, _concat.default)(_context10 = (0, _concat.default)(_context11 = "".concat(event, ": ")).call(_context11, from, " -> ")).call(_context10, to, " %o"), payload);
|
31566 | };
|
31567 |
|
31568 | _proto.onopen = function onopen() {
|
31569 | this.emit(OPEN);
|
31570 | };
|
31571 |
|
31572 | _proto.onconnected = function onconnected() {
|
31573 | this._startConnectionKeeper();
|
31574 | };
|
31575 |
|
31576 | _proto.onleaveconnected = function onleaveconnected(event, from, to) {
|
31577 | this._stopConnectionKeeper();
|
31578 |
|
31579 | this._destroyWs();
|
31580 |
|
31581 | if (to === 'offline' || to === 'disconnected') {
|
31582 | this.emit(DISCONNECT);
|
31583 | }
|
31584 | };
|
31585 |
|
31586 | _proto.onpause = function onpause() {
|
31587 | this.emit(OFFLINE);
|
31588 | };
|
31589 |
|
31590 | _proto.onbeforeresume = function onbeforeresume() {
|
31591 | this.emit(ONLINE);
|
31592 | };
|
31593 |
|
31594 | _proto.onreconnect = function onreconnect() {
|
31595 | this.emit(RECONNECT);
|
31596 | };
|
31597 |
|
31598 | _proto.ondisconnected = function ondisconnected(event, from, to) {
|
31599 | var _context12;
|
31600 |
|
31601 | var _this4 = this;
|
31602 |
|
31603 | var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
31604 | var delay = from === OFFLINE ? 0 : DEFAULT_RETRY_STRATEGY.call(null, attempt);
|
31605 | debug$3((0, _concat.default)(_context12 = "schedule attempt=".concat(attempt, " delay=")).call(_context12, delay));
|
31606 | this.emit(SCHEDULE, attempt, delay);
|
31607 |
|
31608 | if (this.__scheduledRetry) {
|
31609 | clearTimeout(this.__scheduledRetry);
|
31610 | }
|
31611 |
|
31612 | this.__scheduledRetry = setTimeout(function () {
|
31613 | if (_this4.is('disconnected')) {
|
31614 | _this4.retry(attempt);
|
31615 | }
|
31616 | }, delay);
|
31617 | };
|
31618 |
|
31619 | _proto.onretry = function onretry(event, from, to) {
|
31620 | var _this5 = this;
|
31621 |
|
31622 | var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
31623 | this.emit(RETRY, attempt);
|
31624 |
|
31625 | this._open().then(function () {
|
31626 | return _this5.can('reconnect') && _this5.reconnect();
|
31627 | }, function () {
|
31628 | return _this5.can('fail') && _this5.fail(attempt + 1);
|
31629 | });
|
31630 | };
|
31631 |
|
31632 | _proto.onerror = function onerror(event, from, to, error) {
|
31633 | this.emit(ERROR, error);
|
31634 | };
|
31635 |
|
31636 | _proto.onclose = function onclose() {
|
31637 | if (global$1.removeEventListener) {
|
31638 | if (this.__pause) global$1.removeEventListener('offline', this.__pause);
|
31639 | if (this.__resume) global$1.removeEventListener('online', this.__resume);
|
31640 | }
|
31641 | };
|
31642 |
|
31643 | _proto.checkConnectionAvailability = function checkConnectionAvailability() {
|
31644 | var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'API';
|
31645 |
|
31646 | if (!this.is('connected')) {
|
31647 | var _context13;
|
31648 |
|
31649 | var currentState = this.current;
|
31650 | console.warn((0, _concat.default)(_context13 = "".concat(name, " should not be called when the connection is ")).call(_context13, currentState));
|
31651 |
|
31652 | if (this.is('disconnected') || this.is('reconnecting')) {
|
31653 | console.warn('disconnect and reconnect event should be handled to avoid such calls.');
|
31654 | }
|
31655 |
|
31656 | throw new Error('Connection unavailable');
|
31657 | }
|
31658 | }
|
31659 | ;
|
31660 |
|
31661 | _proto.
|
31662 | _ping = function _ping() {
|
31663 | debug$3('ping');
|
31664 |
|
31665 | try {
|
31666 | this.ping();
|
31667 | } catch (error) {
|
31668 | console.warn("websocket ping error: ".concat(error.message));
|
31669 | }
|
31670 | };
|
31671 |
|
31672 | _proto.ping = function ping() {
|
31673 | if (this._ws.ping) {
|
31674 | this._ws.ping();
|
31675 | } else {
|
31676 | console.warn("The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.");
|
31677 | }
|
31678 | };
|
31679 |
|
31680 | _proto._postponeTimeoutTimer = function _postponeTimeoutTimer() {
|
31681 | var _this6 = this;
|
31682 |
|
31683 | debug$3('_postponeTimeoutTimer');
|
31684 |
|
31685 | this._clearTimeoutTimers();
|
31686 |
|
31687 | this._timeoutTimer = setTimeout(function () {
|
31688 | debug$3('timeout');
|
31689 |
|
31690 | _this6.disconnect();
|
31691 | }, TIMEOUT_TIME);
|
31692 | };
|
31693 |
|
31694 | _proto._clearTimeoutTimers = function _clearTimeoutTimers() {
|
31695 | if (this._timeoutTimer) {
|
31696 | clearTimeout(this._timeoutTimer);
|
31697 | }
|
31698 | };
|
31699 |
|
31700 | _proto._startConnectionKeeper = function _startConnectionKeeper() {
|
31701 | debug$3('start connection keeper');
|
31702 | this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME);
|
31703 | var addListener = this._ws.addListener || this._ws.addEventListener;
|
31704 |
|
31705 | if (!addListener) {
|
31706 | debug$3('connection keeper disabled due to the lack of #addEventListener.');
|
31707 | return;
|
31708 | }
|
31709 |
|
31710 | addListener.call(this._ws, 'message', this.__postponeTimeoutTimer);
|
31711 | addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);
|
31712 |
|
31713 | this._postponeTimeoutTimer();
|
31714 | };
|
31715 |
|
31716 | _proto._stopConnectionKeeper = function _stopConnectionKeeper() {
|
31717 | debug$3('stop connection keeper');
|
31718 |
|
31719 | var removeListener = this._ws.removeListener || this._ws.removeEventListener;
|
31720 |
|
31721 | if (removeListener) {
|
31722 | removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer);
|
31723 | removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);
|
31724 |
|
31725 | this._clearTimeoutTimers();
|
31726 | }
|
31727 |
|
31728 | if (this._heartbeatTimer) {
|
31729 | clearInterval(this._heartbeatTimer);
|
31730 | }
|
31731 | };
|
31732 |
|
31733 | _proto._handleClose = function _handleClose(event) {
|
31734 | var _context14;
|
31735 |
|
31736 | debug$3((0, _concat.default)(_context14 = "ws closed [".concat(event.code, "] ")).call(_context14, event.reason));
|
31737 |
|
31738 | if (this.isFinished()) return;
|
31739 | this.handleClose(event);
|
31740 | };
|
31741 |
|
31742 | _proto.handleClose = function handleClose() {
|
31743 |
|
31744 | this.disconnect();
|
31745 | }
|
31746 | ;
|
31747 |
|
31748 | _proto.
|
31749 | send = function send(data) {
|
31750 | debug$3('send', data);
|
31751 |
|
31752 | this._ws.send(data);
|
31753 | };
|
31754 |
|
31755 | _proto._handleMessage = function _handleMessage(event) {
|
31756 | debug$3('message', event.data);
|
31757 | this.handleMessage(event.data);
|
31758 | };
|
31759 |
|
31760 | _proto.handleMessage = function handleMessage(message) {
|
31761 | this.emit(MESSAGE, message);
|
31762 | };
|
31763 |
|
31764 | return WebSocketPlus;
|
31765 | }(EventEmitter), (_applyDecoratedDescriptor(_class.prototype, "_ping", [requireConnected], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "_ping"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "send", [requireConnected], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "send"), _class.prototype)), _class);
|
31766 | StateMachine.create({
|
31767 | target: WebSocketPlus.prototype,
|
31768 | initial: {
|
31769 | state: 'initialized',
|
31770 | event: 'init',
|
31771 | defer: true
|
31772 | },
|
31773 | terminal: 'closed',
|
31774 | events: [{
|
31775 | name: 'open',
|
31776 | from: 'initialized',
|
31777 | to: 'connected'
|
31778 | }, {
|
31779 | name: 'disconnect',
|
31780 | from: 'connected',
|
31781 | to: 'disconnected'
|
31782 | }, {
|
31783 | name: 'retry',
|
31784 | from: 'disconnected',
|
31785 | to: 'reconnecting'
|
31786 | }, {
|
31787 | name: 'fail',
|
31788 | from: 'reconnecting',
|
31789 | to: 'disconnected'
|
31790 | }, {
|
31791 | name: 'reconnect',
|
31792 | from: 'reconnecting',
|
31793 | to: 'connected'
|
31794 | }, {
|
31795 | name: 'pause',
|
31796 | from: ['connected', 'disconnected', 'reconnecting'],
|
31797 | to: 'offline'
|
31798 | }, {}, {
|
31799 | name: 'resume',
|
31800 | from: 'offline',
|
31801 | to: 'disconnected'
|
31802 | }, {
|
31803 | name: 'close',
|
31804 | from: ['connected', 'disconnected', 'reconnecting', 'offline'],
|
31805 | to: 'closed'
|
31806 | }, {
|
31807 | name: 'throw',
|
31808 | from: '*',
|
31809 | to: 'error'
|
31810 | }]
|
31811 | });
|
31812 | var error = (0, _freeze.default)({
|
31813 | 1000: {
|
31814 | name: 'CLOSE_NORMAL'
|
31815 | },
|
31816 | 1006: {
|
31817 | name: 'CLOSE_ABNORMAL'
|
31818 | },
|
31819 | 4100: {
|
31820 | name: 'APP_NOT_AVAILABLE',
|
31821 | message: 'App not exists or realtime message service is disabled.'
|
31822 | },
|
31823 | 4102: {
|
31824 | name: 'SIGNATURE_FAILED',
|
31825 | message: 'Login signature mismatch.'
|
31826 | },
|
31827 | 4103: {
|
31828 | name: 'INVALID_LOGIN',
|
31829 | message: 'Malformed clientId.'
|
31830 | },
|
31831 | 4105: {
|
31832 | name: 'SESSION_REQUIRED',
|
31833 | message: 'Message sent before session opened.'
|
31834 | },
|
31835 | 4107: {
|
31836 | name: 'READ_TIMEOUT'
|
31837 | },
|
31838 | 4108: {
|
31839 | name: 'LOGIN_TIMEOUT'
|
31840 | },
|
31841 | 4109: {
|
31842 | name: 'FRAME_TOO_LONG'
|
31843 | },
|
31844 | 4110: {
|
31845 | name: 'INVALID_ORIGIN',
|
31846 | message: 'Access denied by domain whitelist.'
|
31847 | },
|
31848 | 4111: {
|
31849 | name: 'SESSION_CONFLICT'
|
31850 | },
|
31851 | 4112: {
|
31852 | name: 'SESSION_TOKEN_EXPIRED'
|
31853 | },
|
31854 | 4113: {
|
31855 | name: 'APP_QUOTA_EXCEEDED',
|
31856 | message: 'The daily active users limit exceeded.'
|
31857 | },
|
31858 | 4116: {
|
31859 | name: 'MESSAGE_SENT_QUOTA_EXCEEDED',
|
31860 | message: 'Command sent too fast.'
|
31861 | },
|
31862 | 4200: {
|
31863 | name: 'INTERNAL_ERROR',
|
31864 | message: 'Internal error, please contact LeanCloud for support.'
|
31865 | },
|
31866 | 4301: {
|
31867 | name: 'CONVERSATION_API_FAILED',
|
31868 | message: 'Upstream Conversatoin API failed, see error.detail for details.'
|
31869 | },
|
31870 | 4302: {
|
31871 | name: 'CONVERSATION_SIGNATURE_FAILED',
|
31872 | message: 'Conversation action signature mismatch.'
|
31873 | },
|
31874 | 4303: {
|
31875 | name: 'CONVERSATION_NOT_FOUND'
|
31876 | },
|
31877 | 4304: {
|
31878 | name: 'CONVERSATION_FULL'
|
31879 | },
|
31880 | 4305: {
|
31881 | name: 'CONVERSATION_REJECTED_BY_APP',
|
31882 | message: 'Conversation action rejected by hook.'
|
31883 | },
|
31884 | 4306: {
|
31885 | name: 'CONVERSATION_UPDATE_FAILED'
|
31886 | },
|
31887 | 4307: {
|
31888 | name: 'CONVERSATION_READ_ONLY'
|
31889 | },
|
31890 | 4308: {
|
31891 | name: 'CONVERSATION_NOT_ALLOWED'
|
31892 | },
|
31893 | 4309: {
|
31894 | name: 'CONVERSATION_UPDATE_REJECTED',
|
31895 | message: 'Conversation update rejected because the client is not a member.'
|
31896 | },
|
31897 | 4310: {
|
31898 | name: 'CONVERSATION_QUERY_FAILED',
|
31899 | message: 'Conversation query failed because it is too expansive.'
|
31900 | },
|
31901 | 4311: {
|
31902 | name: 'CONVERSATION_LOG_FAILED'
|
31903 | },
|
31904 | 4312: {
|
31905 | name: 'CONVERSATION_LOG_REJECTED',
|
31906 | message: 'Message query rejected because the client is not a member of the conversation.'
|
31907 | },
|
31908 | 4313: {
|
31909 | name: 'SYSTEM_CONVERSATION_REQUIRED'
|
31910 | },
|
31911 | 4314: {
|
31912 | name: 'NORMAL_CONVERSATION_REQUIRED'
|
31913 | },
|
31914 | 4315: {
|
31915 | name: 'CONVERSATION_BLACKLISTED',
|
31916 | message: 'Blacklisted in the conversation.'
|
31917 | },
|
31918 | 4316: {
|
31919 | name: 'TRANSIENT_CONVERSATION_REQUIRED'
|
31920 | },
|
31921 | 4317: {
|
31922 | name: 'CONVERSATION_MEMBERSHIP_REQUIRED'
|
31923 | },
|
31924 | 4318: {
|
31925 | name: 'CONVERSATION_API_QUOTA_EXCEEDED',
|
31926 | message: 'LeanCloud API quota exceeded. You may upgrade your plan.'
|
31927 | },
|
31928 | 4323: {
|
31929 | name: 'TEMPORARY_CONVERSATION_EXPIRED',
|
31930 | message: 'Temporary conversation expired or does not exist.'
|
31931 | },
|
31932 | 4401: {
|
31933 | name: 'INVALID_MESSAGING_TARGET',
|
31934 | message: 'Conversation does not exist or client is not a member.'
|
31935 | },
|
31936 | 4402: {
|
31937 | name: 'MESSAGE_REJECTED_BY_APP',
|
31938 | message: 'Message rejected by hook.'
|
31939 | },
|
31940 | 4403: {
|
31941 | name: 'MESSAGE_OWNERSHIP_REQUIRED'
|
31942 | },
|
31943 | 4404: {
|
31944 | name: 'MESSAGE_NOT_FOUND'
|
31945 | },
|
31946 | 4405: {
|
31947 | name: 'MESSAGE_UPDATE_REJECTED_BY_APP',
|
31948 | message: 'Message update rejected by hook.'
|
31949 | },
|
31950 | 4406: {
|
31951 | name: 'MESSAGE_EDIT_DISABLED'
|
31952 | },
|
31953 | 4407: {
|
31954 | name: 'MESSAGE_RECALL_DISABLED'
|
31955 | },
|
31956 | 5130: {
|
31957 | name: 'OWNER_PROMOTION_NOT_ALLOWED',
|
31958 | message: "Updating a member's role to owner is not allowed."
|
31959 | }
|
31960 | });
|
31961 | var ErrorCode = (0, _freeze.default)((0, _reduce.default)(_context15 = (0, _keys.default)(error)).call(_context15, function (result, code) {
|
31962 | return (0, _assign.default)(result, _defineProperty({}, error[code].name, Number(code)));
|
31963 | }, {}));
|
31964 |
|
31965 | var createError = function createError(_ref) {
|
31966 | var code = _ref.code,
|
31967 | reason = _ref.reason,
|
31968 | appCode = _ref.appCode,
|
31969 | detail = _ref.detail,
|
31970 | errorMessage = _ref.error;
|
31971 | var message = reason || detail || errorMessage;
|
31972 | var name = reason;
|
31973 |
|
31974 | if (!message && error[code]) {
|
31975 | name = error[code].name;
|
31976 | message = error[code].message || name;
|
31977 | }
|
31978 |
|
31979 | if (!message) {
|
31980 | message = "Unknow Error: ".concat(code);
|
31981 | }
|
31982 |
|
31983 | var err = new Error(message);
|
31984 | return (0, _assign.default)(err, {
|
31985 | code: code,
|
31986 | appCode: appCode,
|
31987 | detail: detail,
|
31988 | name: name
|
31989 | });
|
31990 | };
|
31991 |
|
31992 | var debug$4 = d('LC:Connection');
|
31993 | var COMMAND_TIMEOUT = 20000;
|
31994 | var EXPIRE = (0, _symbol.default)('expire');
|
31995 |
|
31996 | var isIdempotentCommand = function isIdempotentCommand(command) {
|
31997 | return !(command.cmd === CommandType.direct || command.cmd === CommandType.session && command.op === OpType.open || command.cmd === CommandType.conv && (command.op === OpType.start || command.op === OpType.update || command.op === OpType.members));
|
31998 | };
|
31999 |
|
32000 | var Connection = function (_WebSocketPlus) {
|
32001 | _inheritsLoose(Connection, _WebSocketPlus);
|
32002 |
|
32003 | function Connection(getUrl, _ref) {
|
32004 | var _context16;
|
32005 |
|
32006 | var _this;
|
32007 |
|
32008 | var format = _ref.format,
|
32009 | version = _ref.version;
|
32010 | debug$4('initializing Connection');
|
32011 | var protocolString = (0, _concat.default)(_context16 = "lc.".concat(format, ".")).call(_context16, version);
|
32012 | _this = _WebSocketPlus.call(this, getUrl, protocolString) || this;
|
32013 | _this._protocolFormat = format;
|
32014 | _this._commands = {};
|
32015 | _this._serialId = 0;
|
32016 | return _this;
|
32017 | }
|
32018 |
|
32019 | var _proto = Connection.prototype;
|
32020 |
|
32021 | _proto.send = function () {
|
32022 | var _send = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(command) {
|
32023 | var _this2 = this;
|
32024 |
|
32025 | var waitingForRespond,
|
32026 | buffer,
|
32027 | serialId,
|
32028 | duplicatedCommand,
|
32029 | message,
|
32030 | promise,
|
32031 | _args = arguments;
|
32032 | return _regeneratorRuntime.wrap(function _callee$(_context) {
|
32033 | var _context17, _context18;
|
32034 |
|
32035 | while (1) {
|
32036 | switch (_context.prev = _context.next) {
|
32037 | case 0:
|
32038 | waitingForRespond = _args.length > 1 && _args[1] !== undefined ? _args[1] : true;
|
32039 |
|
32040 | if (!waitingForRespond) {
|
32041 | _context.next = 11;
|
32042 | break;
|
32043 | }
|
32044 |
|
32045 | if (!isIdempotentCommand(command)) {
|
32046 | _context.next = 8;
|
32047 | break;
|
32048 | }
|
32049 |
|
32050 | buffer = command.toArrayBuffer();
|
32051 | duplicatedCommand = (0, _find.default)(_context17 = values(this._commands)).call(_context17, function (_ref2) {
|
32052 | var targetBuffer = _ref2.buffer,
|
32053 | targetCommand = _ref2.command;
|
32054 | return targetCommand.cmd === command.cmd && targetCommand.op === command.op && equalBuffer(targetBuffer, buffer);
|
32055 | });
|
32056 |
|
32057 | if (!duplicatedCommand) {
|
32058 | _context.next = 8;
|
32059 | break;
|
32060 | }
|
32061 |
|
32062 | console.warn((0, _concat.default)(_context18 = "Duplicated command [cmd:".concat(command.cmd, " op:")).call(_context18, command.op, "] is throttled."));
|
32063 | return _context.abrupt("return", duplicatedCommand.promise);
|
32064 |
|
32065 | case 8:
|
32066 | this._serialId += 1;
|
32067 | serialId = this._serialId;
|
32068 | command.i = serialId;
|
32069 |
|
32070 |
|
32071 | case 11:
|
32072 | if (debug$4.enabled) debug$4('↑ %O sent', trim(command));
|
32073 |
|
32074 | if (this._protocolFormat === 'proto2base64') {
|
32075 | message = command.toBase64();
|
32076 | } else if (command.toArrayBuffer) {
|
32077 | message = command.toArrayBuffer();
|
32078 | }
|
32079 |
|
32080 | if (message) {
|
32081 | _context.next = 15;
|
32082 | break;
|
32083 | }
|
32084 |
|
32085 | throw new TypeError("".concat(command, " is not a GenericCommand"));
|
32086 |
|
32087 | case 15:
|
32088 | _WebSocketPlus.prototype.send.call(this, message);
|
32089 |
|
32090 | if (waitingForRespond) {
|
32091 | _context.next = 18;
|
32092 | break;
|
32093 | }
|
32094 |
|
32095 | return _context.abrupt("return", undefined);
|
32096 |
|
32097 | case 18:
|
32098 | promise = new _promise.default(function (resolve, reject) {
|
32099 | _this2._commands[serialId] = {
|
32100 | command: command,
|
32101 | buffer: buffer,
|
32102 | resolve: resolve,
|
32103 | reject: reject,
|
32104 | timeout: setTimeout(function () {
|
32105 | if (_this2._commands[serialId]) {
|
32106 | var _context19;
|
32107 |
|
32108 | if (debug$4.enabled) debug$4('✗ %O timeout', trim(command));
|
32109 | reject(createError({
|
32110 | error: (0, _concat.default)(_context19 = "Command Timeout [cmd:".concat(command.cmd, " op:")).call(_context19, command.op, "]"),
|
32111 | name: 'COMMAND_TIMEOUT'
|
32112 | }));
|
32113 | delete _this2._commands[serialId];
|
32114 | }
|
32115 | }, COMMAND_TIMEOUT)
|
32116 | };
|
32117 | });
|
32118 | this._commands[serialId].promise = promise;
|
32119 | return _context.abrupt("return", promise);
|
32120 |
|
32121 | case 21:
|
32122 | case "end":
|
32123 | return _context.stop();
|
32124 | }
|
32125 | }
|
32126 | }, _callee, this);
|
32127 | }));
|
32128 |
|
32129 | function send(_x) {
|
32130 | return _send.apply(this, arguments);
|
32131 | }
|
32132 |
|
32133 | return send;
|
32134 | }();
|
32135 |
|
32136 | _proto.handleMessage = function handleMessage(msg) {
|
32137 | var message;
|
32138 |
|
32139 | try {
|
32140 | message = GenericCommand.decode(msg);
|
32141 | if (debug$4.enabled) debug$4('↓ %O received', trim(message));
|
32142 | } catch (e) {
|
32143 | console.warn('Decode message failed:', e.message, msg);
|
32144 | return;
|
32145 | }
|
32146 |
|
32147 | var serialId = message.i;
|
32148 |
|
32149 | if (serialId) {
|
32150 | if (this._commands[serialId]) {
|
32151 | clearTimeout(this._commands[serialId].timeout);
|
32152 |
|
32153 | if (message.cmd === CommandType.error) {
|
32154 | this._commands[serialId].reject(createError(message.errorMessage));
|
32155 | } else {
|
32156 | this._commands[serialId].resolve(message);
|
32157 | }
|
32158 |
|
32159 | delete this._commands[serialId];
|
32160 | } else {
|
32161 | console.warn("Unexpected command received with serialId [".concat(serialId, "],\n which have timed out or never been requested."));
|
32162 | }
|
32163 | } else {
|
32164 | switch (message.cmd) {
|
32165 | case CommandType.error:
|
32166 | {
|
32167 | this.emit(ERROR, createError(message.errorMessage));
|
32168 | return;
|
32169 | }
|
32170 |
|
32171 | case CommandType.goaway:
|
32172 | {
|
32173 | this.emit(EXPIRE);
|
32174 | return;
|
32175 | }
|
32176 |
|
32177 | default:
|
32178 | {
|
32179 | this.emit(MESSAGE, message);
|
32180 | }
|
32181 | }
|
32182 | }
|
32183 | };
|
32184 |
|
32185 | _proto.ping = function ping() {
|
32186 | return this.send(new GenericCommand({
|
32187 | cmd: CommandType.echo
|
32188 | }))["catch"](function (error) {
|
32189 | return debug$4('ping failed:', error);
|
32190 | });
|
32191 | };
|
32192 |
|
32193 | return Connection;
|
32194 | }(WebSocketPlus);
|
32195 |
|
32196 | var debug$5 = d('LC:request');
|
32197 |
|
32198 | var request = function request(_ref) {
|
32199 | var _ref$method = _ref.method,
|
32200 | method = _ref$method === void 0 ? 'GET' : _ref$method,
|
32201 | _url = _ref.url,
|
32202 | query = _ref.query,
|
32203 | headers = _ref.headers,
|
32204 | data = _ref.data,
|
32205 | time = _ref.timeout;
|
32206 | var url = _url;
|
32207 |
|
32208 | if (query) {
|
32209 | var _context20, _context21, _context23;
|
32210 |
|
32211 | var queryString = (0, _filter.default)(_context20 = (0, _map.default)(_context21 = (0, _keys.default)(query)).call(_context21, function (key) {
|
32212 | var _context22;
|
32213 |
|
32214 | var value = query[key];
|
32215 | if (value === undefined) return undefined;
|
32216 | var v = isPlainObject(value) ? (0, _stringify.default)(value) : value;
|
32217 | return (0, _concat.default)(_context22 = "".concat(encodeURIComponent(key), "=")).call(_context22, encodeURIComponent(v));
|
32218 | })).call(_context20, function (qs) {
|
32219 | return qs;
|
32220 | }).join('&');
|
32221 | url = (0, _concat.default)(_context23 = "".concat(url, "?")).call(_context23, queryString);
|
32222 | }
|
32223 |
|
32224 | debug$5('Req: %O %O %O', method, url, {
|
32225 | headers: headers,
|
32226 | data: data
|
32227 | });
|
32228 | var request = getAdapter('request');
|
32229 | var promise = request(url, {
|
32230 | method: method,
|
32231 | headers: headers,
|
32232 | data: data
|
32233 | }).then(function (response) {
|
32234 | if (response.ok === false) {
|
32235 | var error = createError(response.data);
|
32236 | error.response = response;
|
32237 | throw error;
|
32238 | }
|
32239 |
|
32240 | debug$5('Res: %O %O %O', url, response.status, response.data);
|
32241 | return response.data;
|
32242 | })["catch"](function (error) {
|
32243 | if (error.response) {
|
32244 | debug$5('Error: %O %O %O', url, error.response.status, error.response.data);
|
32245 | }
|
32246 |
|
32247 | throw error;
|
32248 | });
|
32249 | return time ? promiseTimeout.timeout(promise, time) : promise;
|
32250 | };
|
32251 |
|
32252 | var applyDecorators = function applyDecorators(decorators, target) {
|
32253 | if (decorators) {
|
32254 | decorators.forEach(function (decorator) {
|
32255 | try {
|
32256 | decorator(target);
|
32257 | } catch (error) {
|
32258 | if (decorator._pluginName) {
|
32259 | error.message += "[".concat(decorator._pluginName, "]");
|
32260 | }
|
32261 |
|
32262 | throw error;
|
32263 | }
|
32264 | });
|
32265 | }
|
32266 | };
|
32267 |
|
32268 | var applyDispatcher = function applyDispatcher(dispatchers, payload) {
|
32269 | var _context24;
|
32270 |
|
32271 | return (0, _reduce.default)(_context24 = ensureArray(dispatchers)).call(_context24, function (resultPromise, dispatcher) {
|
32272 | return resultPromise.then(function (shouldDispatch) {
|
32273 | return shouldDispatch === false ? false : dispatcher.apply(void 0, _toConsumableArray(payload));
|
32274 | })["catch"](function (error) {
|
32275 | if (dispatcher._pluginName) {
|
32276 |
|
32277 | error.message += "[".concat(dispatcher._pluginName, "]");
|
32278 | }
|
32279 |
|
32280 | throw error;
|
32281 | });
|
32282 | }, _promise.default.resolve(true));
|
32283 | };
|
32284 |
|
32285 | var version = "5.0.0-rc.7";
|
32286 |
|
32287 | function ownKeys$2(object, enumerableOnly) {
|
32288 | var keys = (0, _keys.default)(object);
|
32289 |
|
32290 | if (_getOwnPropertySymbols.default) {
|
32291 | var symbols = (0, _getOwnPropertySymbols.default)(object);
|
32292 | if (enumerableOnly) symbols = (0, _filter.default)(symbols).call(symbols, function (sym) {
|
32293 | return (0, _getOwnPropertyDescriptor.default)(object, sym).enumerable;
|
32294 | });
|
32295 | keys.push.apply(keys, symbols);
|
32296 | }
|
32297 |
|
32298 | return keys;
|
32299 | }
|
32300 |
|
32301 | function _objectSpread$2(target) {
|
32302 | for (var i = 1; i < arguments.length; i++) {
|
32303 | var source = arguments[i] != null ? arguments[i] : {};
|
32304 |
|
32305 | if (i % 2) {
|
32306 | ownKeys$2(Object(source), true).forEach(function (key) {
|
32307 | _defineProperty(target, key, source[key]);
|
32308 | });
|
32309 | } else if (_getOwnPropertyDescriptors.default) {
|
32310 | (0, _defineProperties.default)(target, (0, _getOwnPropertyDescriptors.default)(source));
|
32311 | } else {
|
32312 | ownKeys$2(Object(source)).forEach(function (key) {
|
32313 | (0, _defineProperty2.default)(target, key, (0, _getOwnPropertyDescriptor.default)(source, key));
|
32314 | });
|
32315 | }
|
32316 | }
|
32317 |
|
32318 | return target;
|
32319 | }
|
32320 |
|
32321 | var debug$6 = d('LC:Realtime');
|
32322 | var routerCache = new Cache('push-router');
|
32323 | var initializedApp = {};
|
32324 |
|
32325 | var Realtime = function (_EventEmitter) {
|
32326 | _inheritsLoose(Realtime, _EventEmitter);
|
32327 | |
32328 |
|
32329 |
|
32330 |
|
32331 |
|
32332 |
|
32333 |
|
32334 |
|
32335 |
|
32336 |
|
32337 |
|
32338 |
|
32339 |
|
32340 |
|
32341 | function Realtime(_ref) {
|
32342 | var _context25;
|
32343 |
|
32344 | var _this2;
|
32345 |
|
32346 | var plugins = _ref.plugins,
|
32347 | options = _objectWithoutProperties(_ref, ["plugins"]);
|
32348 |
|
32349 | debug$6('initializing Realtime %s %O', version, options);
|
32350 | _this2 = _EventEmitter.call(this) || this;
|
32351 | var appId = options.appId;
|
32352 |
|
32353 | if (typeof appId !== 'string') {
|
32354 | throw new TypeError("appId [".concat(appId, "] is not a string"));
|
32355 | }
|
32356 |
|
32357 | if (initializedApp[appId]) {
|
32358 | throw new Error("App [".concat(appId, "] is already initialized."));
|
32359 | }
|
32360 |
|
32361 | initializedApp[appId] = true;
|
32362 |
|
32363 | if (typeof options.appKey !== 'string') {
|
32364 | throw new TypeError("appKey [".concat(options.appKey, "] is not a string"));
|
32365 | }
|
32366 |
|
32367 | if (isCNApp(appId)) {
|
32368 | if (!options.server) {
|
32369 | throw new TypeError("server option is required for apps from CN region");
|
32370 | }
|
32371 | }
|
32372 |
|
32373 | _this2._options = _objectSpread$2({
|
32374 | appId: undefined,
|
32375 | appKey: undefined,
|
32376 | noBinary: false,
|
32377 | ssl: true,
|
32378 | RTMServerName: typeof process !== 'undefined' ? process.env.RTM_SERVER_NAME : undefined
|
32379 | }, options);
|
32380 | _this2._cache = new Cache('endpoints');
|
32381 |
|
32382 | var _this = internal(_assertThisInitialized(_this2));
|
32383 |
|
32384 | _this.clients = new _set.default();
|
32385 | _this.pendingClients = new _set.default();
|
32386 | var mergedPlugins = (0, _concat.default)(_context25 = []).call(_context25, _toConsumableArray(ensureArray(Realtime.__preRegisteredPlugins)), _toConsumableArray(ensureArray(plugins)));
|
32387 | debug$6('Using plugins %o', (0, _map.default)(mergedPlugins).call(mergedPlugins, function (plugin) {
|
32388 | return plugin.name;
|
32389 | }));
|
32390 | _this2._plugins = (0, _reduce.default)(mergedPlugins).call(mergedPlugins, function (result, plugin) {
|
32391 | (0, _keys.default)(plugin).forEach(function (hook) {
|
32392 | if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') {
|
32393 | var _context26;
|
32394 |
|
32395 | if (plugin.name) {
|
32396 | ensureArray(plugin[hook]).forEach(function (value) {
|
32397 |
|
32398 | value._pluginName = plugin.name;
|
32399 | });
|
32400 | }
|
32401 |
|
32402 |
|
32403 | result[hook] = (0, _concat.default)(_context26 = ensureArray(result[hook])).call(_context26, plugin[hook]);
|
32404 | }
|
32405 | });
|
32406 | return result;
|
32407 | }, {});
|
32408 |
|
32409 | applyDecorators(_this2._plugins.onRealtimeCreate, _assertThisInitialized(_this2));
|
32410 | return _this2;
|
32411 | }
|
32412 |
|
32413 | var _proto = Realtime.prototype;
|
32414 |
|
32415 | _proto._request = function () {
|
32416 | var _request2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(_ref2) {
|
32417 | var method, _url, _ref2$version, version, path, query, headers, data, url, _this$_options, appId, server, _yield$this$construct, api;
|
32418 |
|
32419 | return _regeneratorRuntime.wrap(function _callee$(_context) {
|
32420 | var _context27, _context28;
|
32421 |
|
32422 | while (1) {
|
32423 | switch (_context.prev = _context.next) {
|
32424 | case 0:
|
32425 | method = _ref2.method, _url = _ref2.url, _ref2$version = _ref2.version, version = _ref2$version === void 0 ? '1.1' : _ref2$version, path = _ref2.path, query = _ref2.query, headers = _ref2.headers, data = _ref2.data;
|
32426 | url = _url;
|
32427 |
|
32428 | if (url) {
|
32429 | _context.next = 9;
|
32430 | break;
|
32431 | }
|
32432 |
|
32433 | _this$_options = this._options, appId = _this$_options.appId, server = _this$_options.server;
|
32434 | _context.next = 6;
|
32435 | return this.constructor._getServerUrls({
|
32436 | appId: appId,
|
32437 | server: server
|
32438 | });
|
32439 |
|
32440 | case 6:
|
32441 | _yield$this$construct = _context.sent;
|
32442 | api = _yield$this$construct.api;
|
32443 | url = (0, _concat.default)(_context27 = (0, _concat.default)(_context28 = "".concat(api, "/")).call(_context28, version)).call(_context27, path);
|
32444 |
|
32445 | case 9:
|
32446 | return _context.abrupt("return", request({
|
32447 | url: url,
|
32448 | method: method,
|
32449 | query: query,
|
32450 | headers: _objectSpread$2({
|
32451 | 'X-LC-Id': this._options.appId,
|
32452 | 'X-LC-Key': this._options.appKey
|
32453 | }, headers),
|
32454 | data: data
|
32455 | }));
|
32456 |
|
32457 | case 10:
|
32458 | case "end":
|
32459 | return _context.stop();
|
32460 | }
|
32461 | }
|
32462 | }, _callee, this);
|
32463 | }));
|
32464 |
|
32465 | function _request(_x) {
|
32466 | return _request2.apply(this, arguments);
|
32467 | }
|
32468 |
|
32469 | return _request;
|
32470 | }();
|
32471 |
|
32472 | _proto._open = function _open() {
|
32473 | var _this3 = this;
|
32474 |
|
32475 | if (this._openPromise) return this._openPromise;
|
32476 | var format = 'protobuf2';
|
32477 |
|
32478 | if (this._options.noBinary) {
|
32479 |
|
32480 | format = 'proto2base64';
|
32481 | }
|
32482 |
|
32483 | var version = 3;
|
32484 | var protocol = {
|
32485 | format: format,
|
32486 | version: version
|
32487 | };
|
32488 | this._openPromise = new _promise.default(function (resolve, reject) {
|
32489 | debug$6('No connection established, create a new one.');
|
32490 | var connection = new Connection(function () {
|
32491 | return _this3._getRTMServers(_this3._options);
|
32492 | }, protocol);
|
32493 | connection.on(OPEN, function () {
|
32494 | return resolve(connection);
|
32495 | }).on(ERROR, function (error) {
|
32496 | delete _this3._openPromise;
|
32497 | reject(error);
|
32498 | }).on(EXPIRE, _asyncToGenerator( _regeneratorRuntime.mark(function _callee2() {
|
32499 | return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
32500 | while (1) {
|
32501 | switch (_context2.prev = _context2.next) {
|
32502 | case 0:
|
32503 | debug$6('Connection expired. Refresh endpoints.');
|
32504 |
|
32505 | _this3._cache.set('endpoints', null, 0);
|
32506 |
|
32507 | _context2.next = 4;
|
32508 | return _this3._getRTMServers(_this3._options);
|
32509 |
|
32510 | case 4:
|
32511 | connection.urls = _context2.sent;
|
32512 | connection.disconnect();
|
32513 |
|
32514 | case 6:
|
32515 | case "end":
|
32516 | return _context2.stop();
|
32517 | }
|
32518 | }
|
32519 | }, _callee2);
|
32520 | }))).on(MESSAGE, _this3._dispatchCommand.bind(_this3));
|
32521 | |
32522 |
|
32523 |
|
32524 |
|
32525 |
|
32526 |
|
32527 |
|
32528 | |
32529 |
|
32530 |
|
32531 |
|
32532 |
|
32533 |
|
32534 |
|
32535 | |
32536 |
|
32537 |
|
32538 |
|
32539 |
|
32540 |
|
32541 | |
32542 |
|
32543 |
|
32544 |
|
32545 |
|
32546 |
|
32547 | |
32548 |
|
32549 |
|
32550 |
|
32551 |
|
32552 |
|
32553 |
|
32554 | |
32555 |
|
32556 |
|
32557 |
|
32558 |
|
32559 |
|
32560 |
|
32561 |
|
32562 | |
32563 |
|
32564 |
|
32565 |
|
32566 |
|
32567 |
|
32568 |
|
32569 | |
32570 |
|
32571 |
|
32572 |
|
32573 |
|
32574 |
|
32575 |
|
32576 | |
32577 |
|
32578 |
|
32579 |
|
32580 |
|
32581 |
|
32582 |
|
32583 | |
32584 |
|
32585 |
|
32586 |
|
32587 |
|
32588 |
|
32589 |
|
32590 | |
32591 |
|
32592 |
|
32593 |
|
32594 |
|
32595 |
|
32596 |
|
32597 |
|
32598 | [DISCONNECT, RECONNECT, RETRY, SCHEDULE, OFFLINE, ONLINE].forEach(function (event) {
|
32599 | return connection.on(event, function () {
|
32600 | var _context29;
|
32601 |
|
32602 | for (var _len = arguments.length, payload = new Array(_len), _key = 0; _key < _len; _key++) {
|
32603 | payload[_key] = arguments[_key];
|
32604 | }
|
32605 |
|
32606 | debug$6("".concat(event, " event emitted. %o"), payload);
|
32607 |
|
32608 | _this3.emit.apply(_this3, (0, _concat.default)(_context29 = [event]).call(_context29, payload));
|
32609 |
|
32610 | if (event !== RECONNECT) {
|
32611 | internal(_this3).clients.forEach(function (client) {
|
32612 | var _context30;
|
32613 |
|
32614 | client.emit.apply(client, (0, _concat.default)(_context30 = [event]).call(_context30, payload));
|
32615 | });
|
32616 | }
|
32617 | });
|
32618 | });
|
32619 |
|
32620 | connection.handleClose = function handleClose(event) {
|
32621 | var isFatal = [ErrorCode.APP_NOT_AVAILABLE, ErrorCode.INVALID_LOGIN, ErrorCode.INVALID_ORIGIN].some(function (errorCode) {
|
32622 | return errorCode === event.code;
|
32623 | });
|
32624 |
|
32625 | if (isFatal) {
|
32626 |
|
32627 | this["throw"](createError(event));
|
32628 | } else {
|
32629 |
|
32630 | this.disconnect();
|
32631 | }
|
32632 | };
|
32633 |
|
32634 | internal(_this3).connection = connection;
|
32635 | });
|
32636 | return this._openPromise;
|
32637 | };
|
32638 |
|
32639 | _proto._getRTMServers = function () {
|
32640 | var _getRTMServers2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee3(options) {
|
32641 | var info, cachedEndPoints, _info, server, secondary, ttl;
|
32642 |
|
32643 | return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
32644 | while (1) {
|
32645 | switch (_context3.prev = _context3.next) {
|
32646 | case 0:
|
32647 | if (!options.RTMServers) {
|
32648 | _context3.next = 2;
|
32649 | break;
|
32650 | }
|
32651 |
|
32652 | return _context3.abrupt("return", shuffle(ensureArray(options.RTMServers)));
|
32653 |
|
32654 | case 2:
|
32655 | cachedEndPoints = this._cache.get('endpoints');
|
32656 |
|
32657 | if (!cachedEndPoints) {
|
32658 | _context3.next = 7;
|
32659 | break;
|
32660 | }
|
32661 |
|
32662 | info = cachedEndPoints;
|
32663 | _context3.next = 14;
|
32664 | break;
|
32665 |
|
32666 | case 7:
|
32667 | _context3.next = 9;
|
32668 | return this.constructor._fetchRTMServers(options);
|
32669 |
|
32670 | case 9:
|
32671 | info = _context3.sent;
|
32672 | _info = info, server = _info.server, secondary = _info.secondary, ttl = _info.ttl;
|
32673 |
|
32674 | if (!(typeof server !== 'string' && typeof secondary !== 'string' && typeof ttl !== 'number')) {
|
32675 | _context3.next = 13;
|
32676 | break;
|
32677 | }
|
32678 |
|
32679 | throw new Error("malformed RTM route response: ".concat((0, _stringify.default)(info)));
|
32680 |
|
32681 | case 13:
|
32682 | this._cache.set('endpoints', info, info.ttl * 1000);
|
32683 |
|
32684 | case 14:
|
32685 | debug$6('endpoint info: %O', info);
|
32686 | return _context3.abrupt("return", [info.server, info.secondary]);
|
32687 |
|
32688 | case 16:
|
32689 | case "end":
|
32690 | return _context3.stop();
|
32691 | }
|
32692 | }
|
32693 | }, _callee3, this);
|
32694 | }));
|
32695 |
|
32696 | function _getRTMServers(_x2) {
|
32697 | return _getRTMServers2.apply(this, arguments);
|
32698 | }
|
32699 |
|
32700 | return _getRTMServers;
|
32701 | }();
|
32702 |
|
32703 | Realtime._getServerUrls = function () {
|
32704 | var _getServerUrls2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee4(_ref4) {
|
32705 | var appId, server, cachedRouter, defaultProtocol;
|
32706 | return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
32707 | while (1) {
|
32708 | switch (_context4.prev = _context4.next) {
|
32709 | case 0:
|
32710 | appId = _ref4.appId, server = _ref4.server;
|
32711 | debug$6('fetch server urls');
|
32712 |
|
32713 | if (!server) {
|
32714 | _context4.next = 6;
|
32715 | break;
|
32716 | }
|
32717 |
|
32718 | if (!(typeof server !== 'string')) {
|
32719 | _context4.next = 5;
|
32720 | break;
|
32721 | }
|
32722 |
|
32723 | return _context4.abrupt("return", server);
|
32724 |
|
32725 | case 5:
|
32726 | return _context4.abrupt("return", {
|
32727 | RTMRouter: server,
|
32728 | api: server
|
32729 | });
|
32730 |
|
32731 | case 6:
|
32732 | cachedRouter = routerCache.get(appId);
|
32733 |
|
32734 | if (!cachedRouter) {
|
32735 | _context4.next = 9;
|
32736 | break;
|
32737 | }
|
32738 |
|
32739 | return _context4.abrupt("return", cachedRouter);
|
32740 |
|
32741 | case 9:
|
32742 | defaultProtocol = 'https://';
|
32743 | return _context4.abrupt("return", request({
|
32744 | url: 'https://app-router.com/2/route',
|
32745 | query: {
|
32746 | appId: appId
|
32747 | },
|
32748 | timeout: 20000
|
32749 | }).then(tap(debug$6)).then(function (_ref5) {
|
32750 | var _context31, _context32;
|
32751 |
|
32752 | var RTMRouterServer = _ref5.rtm_router_server,
|
32753 | APIServer = _ref5.api_server,
|
32754 | _ref5$ttl = _ref5.ttl,
|
32755 | ttl = _ref5$ttl === void 0 ? 3600 : _ref5$ttl;
|
32756 |
|
32757 | if (!RTMRouterServer) {
|
32758 | throw new Error('rtm router not exists');
|
32759 | }
|
32760 |
|
32761 | var serverUrls = {
|
32762 | RTMRouter: (0, _concat.default)(_context31 = "".concat(defaultProtocol)).call(_context31, RTMRouterServer),
|
32763 | api: (0, _concat.default)(_context32 = "".concat(defaultProtocol)).call(_context32, APIServer)
|
32764 | };
|
32765 | routerCache.set(appId, serverUrls, ttl * 1000);
|
32766 | return serverUrls;
|
32767 | })["catch"](function () {
|
32768 | var _context33, _context34, _context35, _context36;
|
32769 |
|
32770 | var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
|
32771 | var domain = 'lncldglobal.com';
|
32772 | return {
|
32773 | RTMRouter: (0, _concat.default)(_context33 = (0, _concat.default)(_context34 = "".concat(defaultProtocol)).call(_context34, id, ".rtm.")).call(_context33, domain),
|
32774 | api: (0, _concat.default)(_context35 = (0, _concat.default)(_context36 = "".concat(defaultProtocol)).call(_context36, id, ".api.")).call(_context35, domain)
|
32775 | };
|
32776 | }));
|
32777 |
|
32778 | case 11:
|
32779 | case "end":
|
32780 | return _context4.stop();
|
32781 | }
|
32782 | }
|
32783 | }, _callee4);
|
32784 | }));
|
32785 |
|
32786 | function _getServerUrls(_x3) {
|
32787 | return _getServerUrls2.apply(this, arguments);
|
32788 | }
|
32789 |
|
32790 | return _getServerUrls;
|
32791 | }();
|
32792 |
|
32793 | Realtime._fetchRTMServers = function _fetchRTMServers(_ref6) {
|
32794 | var appId = _ref6.appId,
|
32795 | ssl = _ref6.ssl,
|
32796 | server = _ref6.server,
|
32797 | RTMServerName = _ref6.RTMServerName;
|
32798 | debug$6('fetch endpoint info');
|
32799 | return this._getServerUrls({
|
32800 | appId: appId,
|
32801 | server: server
|
32802 | }).then(tap(debug$6)).then(function (_ref7) {
|
32803 | var RTMRouter = _ref7.RTMRouter;
|
32804 | return request({
|
32805 | url: "".concat(RTMRouter, "/v1/route"),
|
32806 | query: {
|
32807 | appId: appId,
|
32808 | secure: ssl,
|
32809 | features: isWeapp ? 'wechat' : undefined,
|
32810 | server: RTMServerName,
|
32811 | _t: Date.now()
|
32812 | },
|
32813 | timeout: 20000
|
32814 | }).then(tap(debug$6));
|
32815 | });
|
32816 | };
|
32817 |
|
32818 | _proto._close = function _close() {
|
32819 | if (this._openPromise) {
|
32820 | this._openPromise.then(function (connection) {
|
32821 | return connection.close();
|
32822 | });
|
32823 | }
|
32824 |
|
32825 | delete this._openPromise;
|
32826 | }
|
32827 | |
32828 |
|
32829 |
|
32830 |
|
32831 |
|
32832 | ;
|
32833 |
|
32834 | _proto.retry = function retry() {
|
32835 | var _internal = internal(this),
|
32836 | connection = _internal.connection;
|
32837 |
|
32838 | if (!connection) {
|
32839 | throw new Error('no connection established');
|
32840 | }
|
32841 |
|
32842 | if (connection.cannot('retry')) {
|
32843 | throw new Error("retrying not allowed when not disconnected. the connection is now ".concat(connection.current));
|
32844 | }
|
32845 |
|
32846 | return connection.retry();
|
32847 | }
|
32848 | |
32849 |
|
32850 |
|
32851 |
|
32852 |
|
32853 |
|
32854 |
|
32855 |
|
32856 | ;
|
32857 |
|
32858 | _proto.pause = function pause() {
|
32859 |
|
32860 |
|
32861 | var _internal2 = internal(this),
|
32862 | connection = _internal2.connection;
|
32863 |
|
32864 | if (!connection) return;
|
32865 | if (connection.can('pause')) connection.pause();
|
32866 | }
|
32867 | |
32868 |
|
32869 |
|
32870 |
|
32871 |
|
32872 |
|
32873 |
|
32874 | ;
|
32875 |
|
32876 | _proto.resume = function resume() {
|
32877 |
|
32878 | var _internal3 = internal(this),
|
32879 | connection = _internal3.connection;
|
32880 |
|
32881 | if (!connection) return;
|
32882 | if (connection.can('resume')) connection.resume();
|
32883 | };
|
32884 |
|
32885 | _proto._registerPending = function _registerPending(value) {
|
32886 | internal(this).pendingClients.add(value);
|
32887 | };
|
32888 |
|
32889 | _proto._deregisterPending = function _deregisterPending(client) {
|
32890 | internal(this).pendingClients["delete"](client);
|
32891 | };
|
32892 |
|
32893 | _proto._register = function _register(client) {
|
32894 | internal(this).clients.add(client);
|
32895 | };
|
32896 |
|
32897 | _proto._deregister = function _deregister(client) {
|
32898 | var _this = internal(this);
|
32899 |
|
32900 | _this.clients["delete"](client);
|
32901 |
|
32902 | if (_this.clients.size + _this.pendingClients.size === 0) {
|
32903 | this._close();
|
32904 | }
|
32905 | };
|
32906 |
|
32907 | _proto._dispatchCommand = function _dispatchCommand(command) {
|
32908 | return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this]).then(function (shouldDispatch) {
|
32909 |
|
32910 | if (shouldDispatch) return debug$6('[WARN] Unexpected message received: %O', trim(command));
|
32911 | return false;
|
32912 | });
|
32913 | };
|
32914 |
|
32915 | return Realtime;
|
32916 | }(EventEmitter);
|
32917 |
|
32918 |
|
32919 | var polyfilledPromise = _promise.default;
|
32920 | exports.EventEmitter = EventEmitter;
|
32921 | exports.Promise = polyfilledPromise;
|
32922 | exports.Protocals = message;
|
32923 | exports.Protocols = message;
|
32924 | exports.Realtime = Realtime;
|
32925 | exports.debug = debug$2;
|
32926 | exports.getAdapter = getAdapter;
|
32927 | exports.setAdapters = setAdapters;
|
32928 | }.call(exports, __webpack_require__(78)))
|
32929 |
|
32930 | }),
|
32931 |
|
32932 | (function(module, exports, __webpack_require__) {
|
32933 |
|
32934 | module.exports = __webpack_require__(623);
|
32935 |
|
32936 | }),
|
32937 |
|
32938 | (function(module, exports, __webpack_require__) {
|
32939 |
|
32940 | var parent = __webpack_require__(624);
|
32941 |
|
32942 | module.exports = parent;
|
32943 |
|
32944 |
|
32945 | }),
|
32946 |
|
32947 | (function(module, exports, __webpack_require__) {
|
32948 |
|
32949 | __webpack_require__(625);
|
32950 | var path = __webpack_require__(7);
|
32951 |
|
32952 | module.exports = path.Object.freeze;
|
32953 |
|
32954 |
|
32955 | }),
|
32956 |
|
32957 | (function(module, exports, __webpack_require__) {
|
32958 |
|
32959 | var $ = __webpack_require__(0);
|
32960 | var FREEZING = __webpack_require__(263);
|
32961 | var fails = __webpack_require__(2);
|
32962 | var isObject = __webpack_require__(11);
|
32963 | var onFreeze = __webpack_require__(97).onFreeze;
|
32964 |
|
32965 |
|
32966 | var $freeze = Object.freeze;
|
32967 | var FAILS_ON_PRIMITIVES = fails(function () { $freeze(1); });
|
32968 |
|
32969 |
|
32970 |
|
32971 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
32972 | freeze: function freeze(it) {
|
32973 | return $freeze && isObject(it) ? $freeze(onFreeze(it)) : it;
|
32974 | }
|
32975 | });
|
32976 |
|
32977 |
|
32978 | }),
|
32979 |
|
32980 | (function(module, exports, __webpack_require__) {
|
32981 |
|
32982 |
|
32983 | var fails = __webpack_require__(2);
|
32984 |
|
32985 | module.exports = fails(function () {
|
32986 | if (typeof ArrayBuffer == 'function') {
|
32987 | var buffer = new ArrayBuffer(8);
|
32988 |
|
32989 | if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
|
32990 | }
|
32991 | });
|
32992 |
|
32993 |
|
32994 | }),
|
32995 |
|
32996 | (function(module, exports, __webpack_require__) {
|
32997 |
|
32998 | var parent = __webpack_require__(628);
|
32999 |
|
33000 | module.exports = parent;
|
33001 |
|
33002 |
|
33003 | }),
|
33004 |
|
33005 | (function(module, exports, __webpack_require__) {
|
33006 |
|
33007 | __webpack_require__(629);
|
33008 | var path = __webpack_require__(7);
|
33009 |
|
33010 | module.exports = path.Object.assign;
|
33011 |
|
33012 |
|
33013 | }),
|
33014 |
|
33015 | (function(module, exports, __webpack_require__) {
|
33016 |
|
33017 | var $ = __webpack_require__(0);
|
33018 | var assign = __webpack_require__(630);
|
33019 |
|
33020 |
|
33021 |
|
33022 |
|
33023 | $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
33024 | assign: assign
|
33025 | });
|
33026 |
|
33027 |
|
33028 | }),
|
33029 |
|
33030 | (function(module, exports, __webpack_require__) {
|
33031 |
|
33032 | "use strict";
|
33033 |
|
33034 | var DESCRIPTORS = __webpack_require__(14);
|
33035 | var uncurryThis = __webpack_require__(4);
|
33036 | var call = __webpack_require__(15);
|
33037 | var fails = __webpack_require__(2);
|
33038 | var objectKeys = __webpack_require__(107);
|
33039 | var getOwnPropertySymbolsModule = __webpack_require__(106);
|
33040 | var propertyIsEnumerableModule = __webpack_require__(121);
|
33041 | var toObject = __webpack_require__(33);
|
33042 | var IndexedObject = __webpack_require__(98);
|
33043 |
|
33044 |
|
33045 | var $assign = Object.assign;
|
33046 |
|
33047 | var defineProperty = Object.defineProperty;
|
33048 | var concat = uncurryThis([].concat);
|
33049 |
|
33050 |
|
33051 |
|
33052 | module.exports = !$assign || fails(function () {
|
33053 |
|
33054 | if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
33055 | enumerable: true,
|
33056 | get: function () {
|
33057 | defineProperty(this, 'b', {
|
33058 | value: 3,
|
33059 | enumerable: false
|
33060 | });
|
33061 | }
|
33062 | }), { b: 2 })).b !== 1) return true;
|
33063 |
|
33064 | var A = {};
|
33065 | var B = {};
|
33066 |
|
33067 | var symbol = Symbol();
|
33068 | var alphabet = 'abcdefghijklmnopqrst';
|
33069 | A[symbol] = 7;
|
33070 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
33071 | return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
|
33072 | }) ? function assign(target, source) {
|
33073 | var T = toObject(target);
|
33074 | var argumentsLength = arguments.length;
|
33075 | var index = 1;
|
33076 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
33077 | var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
33078 | while (argumentsLength > index) {
|
33079 | var S = IndexedObject(arguments[index++]);
|
33080 | var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
|
33081 | var length = keys.length;
|
33082 | var j = 0;
|
33083 | var key;
|
33084 | while (length > j) {
|
33085 | key = keys[j++];
|
33086 | if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
|
33087 | }
|
33088 | } return T;
|
33089 | } : $assign;
|
33090 |
|
33091 |
|
33092 | }),
|
33093 |
|
33094 | (function(module, exports, __webpack_require__) {
|
33095 |
|
33096 | var parent = __webpack_require__(632);
|
33097 |
|
33098 | module.exports = parent;
|
33099 |
|
33100 |
|
33101 | }),
|
33102 |
|
33103 | (function(module, exports, __webpack_require__) {
|
33104 |
|
33105 | __webpack_require__(242);
|
33106 | var path = __webpack_require__(7);
|
33107 |
|
33108 | module.exports = path.Object.getOwnPropertySymbols;
|
33109 |
|
33110 |
|
33111 | }),
|
33112 |
|
33113 | (function(module, exports, __webpack_require__) {
|
33114 |
|
33115 | module.exports = __webpack_require__(634);
|
33116 |
|
33117 | }),
|
33118 |
|
33119 | (function(module, exports, __webpack_require__) {
|
33120 |
|
33121 | var parent = __webpack_require__(635);
|
33122 |
|
33123 | module.exports = parent;
|
33124 |
|
33125 |
|
33126 | }),
|
33127 |
|
33128 | (function(module, exports, __webpack_require__) {
|
33129 |
|
33130 | __webpack_require__(636);
|
33131 | var path = __webpack_require__(7);
|
33132 |
|
33133 | module.exports = path.Object.getOwnPropertyDescriptors;
|
33134 |
|
33135 |
|
33136 | }),
|
33137 |
|
33138 | (function(module, exports, __webpack_require__) {
|
33139 |
|
33140 | var $ = __webpack_require__(0);
|
33141 | var DESCRIPTORS = __webpack_require__(14);
|
33142 | var ownKeys = __webpack_require__(162);
|
33143 | var toIndexedObject = __webpack_require__(35);
|
33144 | var getOwnPropertyDescriptorModule = __webpack_require__(64);
|
33145 | var createProperty = __webpack_require__(93);
|
33146 |
|
33147 |
|
33148 |
|
33149 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
33150 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
33151 | var O = toIndexedObject(object);
|
33152 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
33153 | var keys = ownKeys(O);
|
33154 | var result = {};
|
33155 | var index = 0;
|
33156 | var key, descriptor;
|
33157 | while (keys.length > index) {
|
33158 | descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
|
33159 | if (descriptor !== undefined) createProperty(result, key, descriptor);
|
33160 | }
|
33161 | return result;
|
33162 | }
|
33163 | });
|
33164 |
|
33165 |
|
33166 | }),
|
33167 |
|
33168 | (function(module, exports, __webpack_require__) {
|
33169 |
|
33170 | module.exports = __webpack_require__(638);
|
33171 |
|
33172 | }),
|
33173 |
|
33174 | (function(module, exports, __webpack_require__) {
|
33175 |
|
33176 | var parent = __webpack_require__(639);
|
33177 |
|
33178 | module.exports = parent;
|
33179 |
|
33180 |
|
33181 | }),
|
33182 |
|
33183 | (function(module, exports, __webpack_require__) {
|
33184 |
|
33185 | __webpack_require__(640);
|
33186 | var path = __webpack_require__(7);
|
33187 |
|
33188 | var Object = path.Object;
|
33189 |
|
33190 | var defineProperties = module.exports = function defineProperties(T, D) {
|
33191 | return Object.defineProperties(T, D);
|
33192 | };
|
33193 |
|
33194 | if (Object.defineProperties.sham) defineProperties.sham = true;
|
33195 |
|
33196 |
|
33197 | }),
|
33198 |
|
33199 | (function(module, exports, __webpack_require__) {
|
33200 |
|
33201 | var $ = __webpack_require__(0);
|
33202 | var DESCRIPTORS = __webpack_require__(14);
|
33203 | var defineProperties = __webpack_require__(129).f;
|
33204 |
|
33205 |
|
33206 |
|
33207 |
|
33208 | $({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS }, {
|
33209 | defineProperties: defineProperties
|
33210 | });
|
33211 |
|
33212 |
|
33213 | }),
|
33214 |
|
33215 | (function(module, exports, __webpack_require__) {
|
33216 |
|
33217 | module.exports = __webpack_require__(642);
|
33218 |
|
33219 | }),
|
33220 |
|
33221 | (function(module, exports, __webpack_require__) {
|
33222 |
|
33223 | var parent = __webpack_require__(643);
|
33224 | __webpack_require__(46);
|
33225 |
|
33226 | module.exports = parent;
|
33227 |
|
33228 |
|
33229 | }),
|
33230 |
|
33231 | (function(module, exports, __webpack_require__) {
|
33232 |
|
33233 | __webpack_require__(43);
|
33234 | __webpack_require__(68);
|
33235 | __webpack_require__(644);
|
33236 | var path = __webpack_require__(7);
|
33237 |
|
33238 | module.exports = path.WeakMap;
|
33239 |
|
33240 |
|
33241 | }),
|
33242 |
|
33243 | (function(module, exports, __webpack_require__) {
|
33244 |
|
33245 |
|
33246 | __webpack_require__(645);
|
33247 |
|
33248 |
|
33249 | }),
|
33250 |
|
33251 | (function(module, exports, __webpack_require__) {
|
33252 |
|
33253 | "use strict";
|
33254 |
|
33255 | var global = __webpack_require__(8);
|
33256 | var uncurryThis = __webpack_require__(4);
|
33257 | var defineBuiltIns = __webpack_require__(156);
|
33258 | var InternalMetadataModule = __webpack_require__(97);
|
33259 | var collection = __webpack_require__(267);
|
33260 | var collectionWeak = __webpack_require__(646);
|
33261 | var isObject = __webpack_require__(11);
|
33262 | var isExtensible = __webpack_require__(264);
|
33263 | var enforceInternalState = __webpack_require__(44).enforce;
|
33264 | var NATIVE_WEAK_MAP = __webpack_require__(168);
|
33265 |
|
33266 | var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
|
33267 | var InternalWeakMap;
|
33268 |
|
33269 | var wrapper = function (init) {
|
33270 | return function WeakMap() {
|
33271 | return init(this, arguments.length ? arguments[0] : undefined);
|
33272 | };
|
33273 | };
|
33274 |
|
33275 |
|
33276 |
|
33277 | var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
|
33278 |
|
33279 |
|
33280 |
|
33281 |
|
33282 | if (NATIVE_WEAK_MAP && IS_IE11) {
|
33283 | InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
|
33284 | InternalMetadataModule.enable();
|
33285 | var WeakMapPrototype = $WeakMap.prototype;
|
33286 | var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
|
33287 | var nativeHas = uncurryThis(WeakMapPrototype.has);
|
33288 | var nativeGet = uncurryThis(WeakMapPrototype.get);
|
33289 | var nativeSet = uncurryThis(WeakMapPrototype.set);
|
33290 | defineBuiltIns(WeakMapPrototype, {
|
33291 | 'delete': function (key) {
|
33292 | if (isObject(key) && !isExtensible(key)) {
|
33293 | var state = enforceInternalState(this);
|
33294 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
33295 | return nativeDelete(this, key) || state.frozen['delete'](key);
|
33296 | } return nativeDelete(this, key);
|
33297 | },
|
33298 | has: function has(key) {
|
33299 | if (isObject(key) && !isExtensible(key)) {
|
33300 | var state = enforceInternalState(this);
|
33301 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
33302 | return nativeHas(this, key) || state.frozen.has(key);
|
33303 | } return nativeHas(this, key);
|
33304 | },
|
33305 | get: function get(key) {
|
33306 | if (isObject(key) && !isExtensible(key)) {
|
33307 | var state = enforceInternalState(this);
|
33308 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
33309 | return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
|
33310 | } return nativeGet(this, key);
|
33311 | },
|
33312 | set: function set(key, value) {
|
33313 | if (isObject(key) && !isExtensible(key)) {
|
33314 | var state = enforceInternalState(this);
|
33315 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
33316 | nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
|
33317 | } else nativeSet(this, key, value);
|
33318 | return this;
|
33319 | }
|
33320 | });
|
33321 | }
|
33322 |
|
33323 |
|
33324 | }),
|
33325 |
|
33326 | (function(module, exports, __webpack_require__) {
|
33327 |
|
33328 | "use strict";
|
33329 |
|
33330 | var uncurryThis = __webpack_require__(4);
|
33331 | var defineBuiltIns = __webpack_require__(156);
|
33332 | var getWeakData = __webpack_require__(97).getWeakData;
|
33333 | var anObject = __webpack_require__(21);
|
33334 | var isObject = __webpack_require__(11);
|
33335 | var anInstance = __webpack_require__(110);
|
33336 | var iterate = __webpack_require__(41);
|
33337 | var ArrayIterationModule = __webpack_require__(75);
|
33338 | var hasOwn = __webpack_require__(13);
|
33339 | var InternalStateModule = __webpack_require__(44);
|
33340 |
|
33341 | var setInternalState = InternalStateModule.set;
|
33342 | var internalStateGetterFor = InternalStateModule.getterFor;
|
33343 | var find = ArrayIterationModule.find;
|
33344 | var findIndex = ArrayIterationModule.findIndex;
|
33345 | var splice = uncurryThis([].splice);
|
33346 | var id = 0;
|
33347 |
|
33348 |
|
33349 | var uncaughtFrozenStore = function (store) {
|
33350 | return store.frozen || (store.frozen = new UncaughtFrozenStore());
|
33351 | };
|
33352 |
|
33353 | var UncaughtFrozenStore = function () {
|
33354 | this.entries = [];
|
33355 | };
|
33356 |
|
33357 | var findUncaughtFrozen = function (store, key) {
|
33358 | return find(store.entries, function (it) {
|
33359 | return it[0] === key;
|
33360 | });
|
33361 | };
|
33362 |
|
33363 | UncaughtFrozenStore.prototype = {
|
33364 | get: function (key) {
|
33365 | var entry = findUncaughtFrozen(this, key);
|
33366 | if (entry) return entry[1];
|
33367 | },
|
33368 | has: function (key) {
|
33369 | return !!findUncaughtFrozen(this, key);
|
33370 | },
|
33371 | set: function (key, value) {
|
33372 | var entry = findUncaughtFrozen(this, key);
|
33373 | if (entry) entry[1] = value;
|
33374 | else this.entries.push([key, value]);
|
33375 | },
|
33376 | 'delete': function (key) {
|
33377 | var index = findIndex(this.entries, function (it) {
|
33378 | return it[0] === key;
|
33379 | });
|
33380 | if (~index) splice(this.entries, index, 1);
|
33381 | return !!~index;
|
33382 | }
|
33383 | };
|
33384 |
|
33385 | module.exports = {
|
33386 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
33387 | var Constructor = wrapper(function (that, iterable) {
|
33388 | anInstance(that, Prototype);
|
33389 | setInternalState(that, {
|
33390 | type: CONSTRUCTOR_NAME,
|
33391 | id: id++,
|
33392 | frozen: undefined
|
33393 | });
|
33394 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
33395 | });
|
33396 |
|
33397 | var Prototype = Constructor.prototype;
|
33398 |
|
33399 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
33400 |
|
33401 | var define = function (that, key, value) {
|
33402 | var state = getInternalState(that);
|
33403 | var data = getWeakData(anObject(key), true);
|
33404 | if (data === true) uncaughtFrozenStore(state).set(key, value);
|
33405 | else data[state.id] = value;
|
33406 | return that;
|
33407 | };
|
33408 |
|
33409 | defineBuiltIns(Prototype, {
|
33410 |
|
33411 |
|
33412 |
|
33413 | 'delete': function (key) {
|
33414 | var state = getInternalState(this);
|
33415 | if (!isObject(key)) return false;
|
33416 | var data = getWeakData(key);
|
33417 | if (data === true) return uncaughtFrozenStore(state)['delete'](key);
|
33418 | return data && hasOwn(data, state.id) && delete data[state.id];
|
33419 | },
|
33420 |
|
33421 |
|
33422 |
|
33423 | has: function has(key) {
|
33424 | var state = getInternalState(this);
|
33425 | if (!isObject(key)) return false;
|
33426 | var data = getWeakData(key);
|
33427 | if (data === true) return uncaughtFrozenStore(state).has(key);
|
33428 | return data && hasOwn(data, state.id);
|
33429 | }
|
33430 | });
|
33431 |
|
33432 | defineBuiltIns(Prototype, IS_MAP ? {
|
33433 |
|
33434 |
|
33435 | get: function get(key) {
|
33436 | var state = getInternalState(this);
|
33437 | if (isObject(key)) {
|
33438 | var data = getWeakData(key);
|
33439 | if (data === true) return uncaughtFrozenStore(state).get(key);
|
33440 | return data ? data[state.id] : undefined;
|
33441 | }
|
33442 | },
|
33443 |
|
33444 |
|
33445 | set: function set(key, value) {
|
33446 | return define(this, key, value);
|
33447 | }
|
33448 | } : {
|
33449 |
|
33450 |
|
33451 | add: function add(value) {
|
33452 | return define(this, value, true);
|
33453 | }
|
33454 | });
|
33455 |
|
33456 | return Constructor;
|
33457 | }
|
33458 | };
|
33459 |
|
33460 |
|
33461 | }),
|
33462 |
|
33463 | (function(module, exports, __webpack_require__) {
|
33464 |
|
33465 | var parent = __webpack_require__(648);
|
33466 | __webpack_require__(46);
|
33467 |
|
33468 | module.exports = parent;
|
33469 |
|
33470 |
|
33471 | }),
|
33472 |
|
33473 | (function(module, exports, __webpack_require__) {
|
33474 |
|
33475 | __webpack_require__(43);
|
33476 | __webpack_require__(68);
|
33477 | __webpack_require__(649);
|
33478 | __webpack_require__(70);
|
33479 | var path = __webpack_require__(7);
|
33480 |
|
33481 | module.exports = path.Set;
|
33482 |
|
33483 |
|
33484 | }),
|
33485 |
|
33486 | (function(module, exports, __webpack_require__) {
|
33487 |
|
33488 |
|
33489 | __webpack_require__(650);
|
33490 |
|
33491 |
|
33492 | }),
|
33493 |
|
33494 | (function(module, exports, __webpack_require__) {
|
33495 |
|
33496 | "use strict";
|
33497 |
|
33498 | var collection = __webpack_require__(267);
|
33499 | var collectionStrong = __webpack_require__(651);
|
33500 |
|
33501 |
|
33502 |
|
33503 | collection('Set', function (init) {
|
33504 | return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
|
33505 | }, collectionStrong);
|
33506 |
|
33507 |
|
33508 | }),
|
33509 |
|
33510 | (function(module, exports, __webpack_require__) {
|
33511 |
|
33512 | "use strict";
|
33513 |
|
33514 | var defineProperty = __webpack_require__(23).f;
|
33515 | var create = __webpack_require__(53);
|
33516 | var defineBuiltIns = __webpack_require__(156);
|
33517 | var bind = __webpack_require__(52);
|
33518 | var anInstance = __webpack_require__(110);
|
33519 | var iterate = __webpack_require__(41);
|
33520 | var defineIterator = __webpack_require__(133);
|
33521 | var setSpecies = __webpack_require__(171);
|
33522 | var DESCRIPTORS = __webpack_require__(14);
|
33523 | var fastKey = __webpack_require__(97).fastKey;
|
33524 | var InternalStateModule = __webpack_require__(44);
|
33525 |
|
33526 | var setInternalState = InternalStateModule.set;
|
33527 | var internalStateGetterFor = InternalStateModule.getterFor;
|
33528 |
|
33529 | module.exports = {
|
33530 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
33531 | var Constructor = wrapper(function (that, iterable) {
|
33532 | anInstance(that, Prototype);
|
33533 | setInternalState(that, {
|
33534 | type: CONSTRUCTOR_NAME,
|
33535 | index: create(null),
|
33536 | first: undefined,
|
33537 | last: undefined,
|
33538 | size: 0
|
33539 | });
|
33540 | if (!DESCRIPTORS) that.size = 0;
|
33541 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
33542 | });
|
33543 |
|
33544 | var Prototype = Constructor.prototype;
|
33545 |
|
33546 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
33547 |
|
33548 | var define = function (that, key, value) {
|
33549 | var state = getInternalState(that);
|
33550 | var entry = getEntry(that, key);
|
33551 | var previous, index;
|
33552 |
|
33553 | if (entry) {
|
33554 | entry.value = value;
|
33555 |
|
33556 | } else {
|
33557 | state.last = entry = {
|
33558 | index: index = fastKey(key, true),
|
33559 | key: key,
|
33560 | value: value,
|
33561 | previous: previous = state.last,
|
33562 | next: undefined,
|
33563 | removed: false
|
33564 | };
|
33565 | if (!state.first) state.first = entry;
|
33566 | if (previous) previous.next = entry;
|
33567 | if (DESCRIPTORS) state.size++;
|
33568 | else that.size++;
|
33569 |
|
33570 | if (index !== 'F') state.index[index] = entry;
|
33571 | } return that;
|
33572 | };
|
33573 |
|
33574 | var getEntry = function (that, key) {
|
33575 | var state = getInternalState(that);
|
33576 |
|
33577 | var index = fastKey(key);
|
33578 | var entry;
|
33579 | if (index !== 'F') return state.index[index];
|
33580 |
|
33581 | for (entry = state.first; entry; entry = entry.next) {
|
33582 | if (entry.key == key) return entry;
|
33583 | }
|
33584 | };
|
33585 |
|
33586 | defineBuiltIns(Prototype, {
|
33587 |
|
33588 |
|
33589 |
|
33590 | clear: function clear() {
|
33591 | var that = this;
|
33592 | var state = getInternalState(that);
|
33593 | var data = state.index;
|
33594 | var entry = state.first;
|
33595 | while (entry) {
|
33596 | entry.removed = true;
|
33597 | if (entry.previous) entry.previous = entry.previous.next = undefined;
|
33598 | delete data[entry.index];
|
33599 | entry = entry.next;
|
33600 | }
|
33601 | state.first = state.last = undefined;
|
33602 | if (DESCRIPTORS) state.size = 0;
|
33603 | else that.size = 0;
|
33604 | },
|
33605 |
|
33606 |
|
33607 |
|
33608 | 'delete': function (key) {
|
33609 | var that = this;
|
33610 | var state = getInternalState(that);
|
33611 | var entry = getEntry(that, key);
|
33612 | if (entry) {
|
33613 | var next = entry.next;
|
33614 | var prev = entry.previous;
|
33615 | delete state.index[entry.index];
|
33616 | entry.removed = true;
|
33617 | if (prev) prev.next = next;
|
33618 | if (next) next.previous = prev;
|
33619 | if (state.first == entry) state.first = next;
|
33620 | if (state.last == entry) state.last = prev;
|
33621 | if (DESCRIPTORS) state.size--;
|
33622 | else that.size--;
|
33623 | } return !!entry;
|
33624 | },
|
33625 |
|
33626 |
|
33627 |
|
33628 | forEach: function forEach(callbackfn /* , that = undefined */) {
|
33629 | var state = getInternalState(this);
|
33630 | var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
33631 | var entry;
|
33632 | while (entry = entry ? entry.next : state.first) {
|
33633 | boundFunction(entry.value, entry.key, this);
|
33634 |
|
33635 | while (entry && entry.removed) entry = entry.previous;
|
33636 | }
|
33637 | },
|
33638 |
|
33639 |
|
33640 |
|
33641 | has: function has(key) {
|
33642 | return !!getEntry(this, key);
|
33643 | }
|
33644 | });
|
33645 |
|
33646 | defineBuiltIns(Prototype, IS_MAP ? {
|
33647 |
|
33648 |
|
33649 | get: function get(key) {
|
33650 | var entry = getEntry(this, key);
|
33651 | return entry && entry.value;
|
33652 | },
|
33653 |
|
33654 |
|
33655 | set: function set(key, value) {
|
33656 | return define(this, key === 0 ? 0 : key, value);
|
33657 | }
|
33658 | } : {
|
33659 |
|
33660 |
|
33661 | add: function add(value) {
|
33662 | return define(this, value = value === 0 ? 0 : value, value);
|
33663 | }
|
33664 | });
|
33665 | if (DESCRIPTORS) defineProperty(Prototype, 'size', {
|
33666 | get: function () {
|
33667 | return getInternalState(this).size;
|
33668 | }
|
33669 | });
|
33670 | return Constructor;
|
33671 | },
|
33672 | setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
|
33673 | var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
33674 | var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
33675 | var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
|
33676 |
|
33677 |
|
33678 |
|
33679 |
|
33680 |
|
33681 |
|
33682 |
|
33683 |
|
33684 |
|
33685 | defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
|
33686 | setInternalState(this, {
|
33687 | type: ITERATOR_NAME,
|
33688 | target: iterated,
|
33689 | state: getInternalCollectionState(iterated),
|
33690 | kind: kind,
|
33691 | last: undefined
|
33692 | });
|
33693 | }, function () {
|
33694 | var state = getInternalIteratorState(this);
|
33695 | var kind = state.kind;
|
33696 | var entry = state.last;
|
33697 |
|
33698 | while (entry && entry.removed) entry = entry.previous;
|
33699 |
|
33700 | if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
|
33701 |
|
33702 | state.target = undefined;
|
33703 | return { value: undefined, done: true };
|
33704 | }
|
33705 |
|
33706 | if (kind == 'keys') return { value: entry.key, done: false };
|
33707 | if (kind == 'values') return { value: entry.value, done: false };
|
33708 | return { value: [entry.key, entry.value], done: false };
|
33709 | }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
33710 |
|
33711 |
|
33712 |
|
33713 |
|
33714 | setSpecies(CONSTRUCTOR_NAME);
|
33715 | }
|
33716 | };
|
33717 |
|
33718 |
|
33719 | }),
|
33720 |
|
33721 | (function(module, exports, __webpack_require__) {
|
33722 |
|
33723 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
33724 |
|
33725 |
|
33726 |
|
33727 |
|
33728 |
|
33729 |
|
33730 |
|
33731 |
|
33732 |
|
33733 |
|
33734 |
|
33735 |
|
33736 |
|
33737 |
|
33738 |
|
33739 |
|
33740 |
|
33741 |
|
33742 |
|
33743 |
|
33744 | (function(global, factory) {
|
33745 |
|
33746 | if (true)
|
33747 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(653)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
33748 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
33749 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
33750 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
33751 | else if (typeof require === "function" && typeof module === "object" && module && module["exports"])
|
33752 | module["exports"] = factory(require("bytebuffer"), true);
|
33753 | else
|
33754 | (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]);
|
33755 |
|
33756 | })(this, function(ByteBuffer, isCommonJS) {
|
33757 | "use strict";
|
33758 |
|
33759 | |
33760 |
|
33761 |
|
33762 |
|
33763 |
|
33764 |
|
33765 | var ProtoBuf = {};
|
33766 |
|
33767 | |
33768 |
|
33769 |
|
33770 |
|
33771 | ProtoBuf.ByteBuffer = ByteBuffer;
|
33772 |
|
33773 | |
33774 |
|
33775 |
|
33776 |
|
33777 | ProtoBuf.Long = ByteBuffer.Long || null;
|
33778 |
|
33779 | |
33780 |
|
33781 |
|
33782 |
|
33783 |
|
33784 |
|
33785 | ProtoBuf.VERSION = "5.0.3";
|
33786 |
|
33787 | |
33788 |
|
33789 |
|
33790 |
|
33791 |
|
33792 |
|
33793 | ProtoBuf.WIRE_TYPES = {};
|
33794 |
|
33795 | |
33796 |
|
33797 |
|
33798 |
|
33799 |
|
33800 | ProtoBuf.WIRE_TYPES.VARINT = 0;
|
33801 |
|
33802 | |
33803 |
|
33804 |
|
33805 |
|
33806 |
|
33807 |
|
33808 | ProtoBuf.WIRE_TYPES.BITS64 = 1;
|
33809 |
|
33810 | |
33811 |
|
33812 |
|
33813 |
|
33814 |
|
33815 |
|
33816 | ProtoBuf.WIRE_TYPES.LDELIM = 2;
|
33817 |
|
33818 | |
33819 |
|
33820 |
|
33821 |
|
33822 |
|
33823 |
|
33824 | ProtoBuf.WIRE_TYPES.STARTGROUP = 3;
|
33825 |
|
33826 | |
33827 |
|
33828 |
|
33829 |
|
33830 |
|
33831 |
|
33832 | ProtoBuf.WIRE_TYPES.ENDGROUP = 4;
|
33833 |
|
33834 | |
33835 |
|
33836 |
|
33837 |
|
33838 |
|
33839 |
|
33840 | ProtoBuf.WIRE_TYPES.BITS32 = 5;
|
33841 |
|
33842 | |
33843 |
|
33844 |
|
33845 |
|
33846 |
|
33847 |
|
33848 | ProtoBuf.PACKABLE_WIRE_TYPES = [
|
33849 | ProtoBuf.WIRE_TYPES.VARINT,
|
33850 | ProtoBuf.WIRE_TYPES.BITS64,
|
33851 | ProtoBuf.WIRE_TYPES.BITS32
|
33852 | ];
|
33853 |
|
33854 | |
33855 |
|
33856 |
|
33857 |
|
33858 |
|
33859 |
|
33860 |
|
33861 | ProtoBuf.TYPES = {
|
33862 |
|
33863 | "int32": {
|
33864 | name: "int32",
|
33865 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33866 | defaultValue: 0
|
33867 | },
|
33868 | "uint32": {
|
33869 | name: "uint32",
|
33870 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33871 | defaultValue: 0
|
33872 | },
|
33873 | "sint32": {
|
33874 | name: "sint32",
|
33875 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33876 | defaultValue: 0
|
33877 | },
|
33878 | "int64": {
|
33879 | name: "int64",
|
33880 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33881 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined
|
33882 | },
|
33883 | "uint64": {
|
33884 | name: "uint64",
|
33885 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33886 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined
|
33887 | },
|
33888 | "sint64": {
|
33889 | name: "sint64",
|
33890 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33891 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined
|
33892 | },
|
33893 | "bool": {
|
33894 | name: "bool",
|
33895 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33896 | defaultValue: false
|
33897 | },
|
33898 | "double": {
|
33899 | name: "double",
|
33900 | wireType: ProtoBuf.WIRE_TYPES.BITS64,
|
33901 | defaultValue: 0
|
33902 | },
|
33903 | "string": {
|
33904 | name: "string",
|
33905 | wireType: ProtoBuf.WIRE_TYPES.LDELIM,
|
33906 | defaultValue: ""
|
33907 | },
|
33908 | "bytes": {
|
33909 | name: "bytes",
|
33910 | wireType: ProtoBuf.WIRE_TYPES.LDELIM,
|
33911 | defaultValue: null
|
33912 | },
|
33913 | "fixed32": {
|
33914 | name: "fixed32",
|
33915 | wireType: ProtoBuf.WIRE_TYPES.BITS32,
|
33916 | defaultValue: 0
|
33917 | },
|
33918 | "sfixed32": {
|
33919 | name: "sfixed32",
|
33920 | wireType: ProtoBuf.WIRE_TYPES.BITS32,
|
33921 | defaultValue: 0
|
33922 | },
|
33923 | "fixed64": {
|
33924 | name: "fixed64",
|
33925 | wireType: ProtoBuf.WIRE_TYPES.BITS64,
|
33926 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined
|
33927 | },
|
33928 | "sfixed64": {
|
33929 | name: "sfixed64",
|
33930 | wireType: ProtoBuf.WIRE_TYPES.BITS64,
|
33931 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined
|
33932 | },
|
33933 | "float": {
|
33934 | name: "float",
|
33935 | wireType: ProtoBuf.WIRE_TYPES.BITS32,
|
33936 | defaultValue: 0
|
33937 | },
|
33938 | "enum": {
|
33939 | name: "enum",
|
33940 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33941 | defaultValue: 0
|
33942 | },
|
33943 | "message": {
|
33944 | name: "message",
|
33945 | wireType: ProtoBuf.WIRE_TYPES.LDELIM,
|
33946 | defaultValue: null
|
33947 | },
|
33948 | "group": {
|
33949 | name: "group",
|
33950 | wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,
|
33951 | defaultValue: null
|
33952 | }
|
33953 | };
|
33954 |
|
33955 | |
33956 |
|
33957 |
|
33958 |
|
33959 |
|
33960 |
|
33961 | ProtoBuf.MAP_KEY_TYPES = [
|
33962 | ProtoBuf.TYPES["int32"],
|
33963 | ProtoBuf.TYPES["sint32"],
|
33964 | ProtoBuf.TYPES["sfixed32"],
|
33965 | ProtoBuf.TYPES["uint32"],
|
33966 | ProtoBuf.TYPES["fixed32"],
|
33967 | ProtoBuf.TYPES["int64"],
|
33968 | ProtoBuf.TYPES["sint64"],
|
33969 | ProtoBuf.TYPES["sfixed64"],
|
33970 | ProtoBuf.TYPES["uint64"],
|
33971 | ProtoBuf.TYPES["fixed64"],
|
33972 | ProtoBuf.TYPES["bool"],
|
33973 | ProtoBuf.TYPES["string"],
|
33974 | ProtoBuf.TYPES["bytes"]
|
33975 | ];
|
33976 |
|
33977 | |
33978 |
|
33979 |
|
33980 |
|
33981 |
|
33982 |
|
33983 | ProtoBuf.ID_MIN = 1;
|
33984 |
|
33985 | |
33986 |
|
33987 |
|
33988 |
|
33989 |
|
33990 |
|
33991 | ProtoBuf.ID_MAX = 0x1FFFFFFF;
|
33992 |
|
33993 | |
33994 |
|
33995 |
|
33996 |
|
33997 |
|
33998 |
|
33999 | ProtoBuf.convertFieldsToCamelCase = false;
|
34000 |
|
34001 | |
34002 |
|
34003 |
|
34004 |
|
34005 |
|
34006 |
|
34007 | ProtoBuf.populateAccessors = true;
|
34008 |
|
34009 | |
34010 |
|
34011 |
|
34012 |
|
34013 |
|
34014 |
|
34015 | ProtoBuf.populateDefaults = true;
|
34016 |
|
34017 | |
34018 |
|
34019 |
|
34020 |
|
34021 | ProtoBuf.Util = (function() {
|
34022 | "use strict";
|
34023 |
|
34024 | |
34025 |
|
34026 |
|
34027 |
|
34028 |
|
34029 | var Util = {};
|
34030 |
|
34031 | |
34032 |
|
34033 |
|
34034 |
|
34035 |
|
34036 |
|
34037 | Util.IS_NODE = !!(
|
34038 | typeof process === 'object' && process+'' === '[object process]' && !process['browser']
|
34039 | );
|
34040 |
|
34041 | |
34042 |
|
34043 |
|
34044 |
|
34045 |
|
34046 |
|
34047 | Util.XHR = function() {
|
34048 |
|
34049 | var XMLHttpFactories = [
|
34050 | function () {return new XMLHttpRequest()},
|
34051 | function () {return new ActiveXObject("Msxml2.XMLHTTP")},
|
34052 | function () {return new ActiveXObject("Msxml3.XMLHTTP")},
|
34053 | function () {return new ActiveXObject("Microsoft.XMLHTTP")}
|
34054 | ];
|
34055 |
|
34056 | var xhr = null;
|
34057 | for (var i=0;i<XMLHttpFactories.length;i++) {
|
34058 | try { xhr = XMLHttpFactories[i](); }
|
34059 | catch (e) { continue; }
|
34060 | break;
|
34061 | }
|
34062 | if (!xhr)
|
34063 | throw Error("XMLHttpRequest is not supported");
|
34064 | return xhr;
|
34065 | };
|
34066 |
|
34067 | |
34068 |
|
34069 |
|
34070 |
|
34071 |
|
34072 |
|
34073 |
|
34074 |
|
34075 | Util.fetch = function(path, callback) {
|
34076 | if (callback && typeof callback != 'function')
|
34077 | callback = null;
|
34078 | if (Util.IS_NODE) {
|
34079 | var fs = __webpack_require__(655);
|
34080 | if (callback) {
|
34081 | fs.readFile(path, function(err, data) {
|
34082 | if (err)
|
34083 | callback(null);
|
34084 | else
|
34085 | callback(""+data);
|
34086 | });
|
34087 | } else
|
34088 | try {
|
34089 | return fs.readFileSync(path);
|
34090 | } catch (e) {
|
34091 | return null;
|
34092 | }
|
34093 | } else {
|
34094 | var xhr = Util.XHR();
|
34095 | xhr.open('GET', path, callback ? true : false);
|
34096 |
|
34097 | xhr.setRequestHeader('Accept', 'text/plain');
|
34098 | if (typeof xhr.overrideMimeType === 'function') xhr.overrideMimeType('text/plain');
|
34099 | if (callback) {
|
34100 | xhr.onreadystatechange = function() {
|
34101 | if (xhr.readyState != 4) return;
|
34102 | if ( xhr.status == 200 || (xhr.status == 0 && typeof xhr.responseText === 'string'))
|
34103 | callback(xhr.responseText);
|
34104 | else
|
34105 | callback(null);
|
34106 | };
|
34107 | if (xhr.readyState == 4)
|
34108 | return;
|
34109 | xhr.send(null);
|
34110 | } else {
|
34111 | xhr.send(null);
|
34112 | if ( xhr.status == 200 || (xhr.status == 0 && typeof xhr.responseText === 'string'))
|
34113 | return xhr.responseText;
|
34114 | return null;
|
34115 | }
|
34116 | }
|
34117 | };
|
34118 |
|
34119 | |
34120 |
|
34121 |
|
34122 |
|
34123 |
|
34124 |
|
34125 | Util.toCamelCase = function(str) {
|
34126 | return str.replace(/_([a-zA-Z])/g, function ($0, $1) {
|
34127 | return $1.toUpperCase();
|
34128 | });
|
34129 | };
|
34130 |
|
34131 | return Util;
|
34132 | })();
|
34133 |
|
34134 | |
34135 |
|
34136 |
|
34137 |
|
34138 |
|
34139 | ProtoBuf.Lang = {
|
34140 |
|
34141 |
|
34142 | DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
|
34143 |
|
34144 |
|
34145 | RULE: /^(?:required|optional|repeated|map)$/,
|
34146 |
|
34147 |
|
34148 | TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
|
34149 |
|
34150 |
|
34151 | NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
|
34152 |
|
34153 |
|
34154 | TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
|
34155 |
|
34156 |
|
34157 | TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,
|
34158 |
|
34159 |
|
34160 | FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,
|
34161 |
|
34162 |
|
34163 | NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
|
34164 |
|
34165 |
|
34166 | NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
|
34167 |
|
34168 |
|
34169 | NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
|
34170 |
|
34171 |
|
34172 | NUMBER_OCT: /^0[0-7]+$/,
|
34173 |
|
34174 |
|
34175 | NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
|
34176 |
|
34177 |
|
34178 | BOOL: /^(?:true|false)$/i,
|
34179 |
|
34180 |
|
34181 | ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
|
34182 |
|
34183 |
|
34184 | NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
|
34185 |
|
34186 |
|
34187 | WHITESPACE: /\s/,
|
34188 |
|
34189 |
|
34190 | STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
|
34191 |
|
34192 |
|
34193 | STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
|
34194 |
|
34195 |
|
34196 | STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
|
34197 | };
|
34198 |
|
34199 |
|
34200 | |
34201 |
|
34202 |
|
34203 |
|
34204 | ProtoBuf.Reflect = (function(ProtoBuf) {
|
34205 | "use strict";
|
34206 |
|
34207 | |
34208 |
|
34209 |
|
34210 |
|
34211 |
|
34212 | var Reflect = {};
|
34213 |
|
34214 | |
34215 |
|
34216 |
|
34217 |
|
34218 |
|
34219 |
|
34220 |
|
34221 |
|
34222 |
|
34223 | var T = function(builder, parent, name) {
|
34224 |
|
34225 | |
34226 |
|
34227 |
|
34228 |
|
34229 |
|
34230 | this.builder = builder;
|
34231 |
|
34232 | |
34233 |
|
34234 |
|
34235 |
|
34236 |
|
34237 | this.parent = parent;
|
34238 |
|
34239 | |
34240 |
|
34241 |
|
34242 |
|
34243 |
|
34244 | this.name = name;
|
34245 |
|
34246 | |
34247 |
|
34248 |
|
34249 |
|
34250 |
|
34251 | this.className;
|
34252 | };
|
34253 |
|
34254 | |
34255 |
|
34256 |
|
34257 |
|
34258 | var TPrototype = T.prototype;
|
34259 |
|
34260 | |
34261 |
|
34262 |
|
34263 |
|
34264 |
|
34265 | TPrototype.fqn = function() {
|
34266 | var name = this.name,
|
34267 | ptr = this;
|
34268 | do {
|
34269 | ptr = ptr.parent;
|
34270 | if (ptr == null)
|
34271 | break;
|
34272 | name = ptr.name+"."+name;
|
34273 | } while (true);
|
34274 | return name;
|
34275 | };
|
34276 |
|
34277 | |
34278 |
|
34279 |
|
34280 |
|
34281 |
|
34282 |
|
34283 | TPrototype.toString = function(includeClass) {
|
34284 | return (includeClass ? this.className + " " : "") + this.fqn();
|
34285 | };
|
34286 |
|
34287 | |
34288 |
|
34289 |
|
34290 |
|
34291 |
|
34292 | TPrototype.build = function() {
|
34293 | throw Error(this.toString(true)+" cannot be built directly");
|
34294 | };
|
34295 |
|
34296 | |
34297 |
|
34298 |
|
34299 |
|
34300 | Reflect.T = T;
|
34301 |
|
34302 | |
34303 |
|
34304 |
|
34305 |
|
34306 |
|
34307 |
|
34308 |
|
34309 |
|
34310 |
|
34311 |
|
34312 |
|
34313 | var Namespace = function(builder, parent, name, options, syntax) {
|
34314 | T.call(this, builder, parent, name);
|
34315 |
|
34316 | |
34317 |
|
34318 |
|
34319 | this.className = "Namespace";
|
34320 |
|
34321 | |
34322 |
|
34323 |
|
34324 |
|
34325 | this.children = [];
|
34326 |
|
34327 | |
34328 |
|
34329 |
|
34330 |
|
34331 | this.options = options || {};
|
34332 |
|
34333 | |
34334 |
|
34335 |
|
34336 |
|
34337 | this.syntax = syntax || "proto2";
|
34338 | };
|
34339 |
|
34340 | |
34341 |
|
34342 |
|
34343 |
|
34344 | var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);
|
34345 |
|
34346 | |
34347 |
|
34348 |
|
34349 |
|
34350 |
|
34351 |
|
34352 | NamespacePrototype.getChildren = function(type) {
|
34353 | type = type || null;
|
34354 | if (type == null)
|
34355 | return this.children.slice();
|
34356 | var children = [];
|
34357 | for (var i=0, k=this.children.length; i<k; ++i)
|
34358 | if (this.children[i] instanceof type)
|
34359 | children.push(this.children[i]);
|
34360 | return children;
|
34361 | };
|
34362 |
|
34363 | |
34364 |
|
34365 |
|
34366 |
|
34367 |
|
34368 |
|
34369 | NamespacePrototype.addChild = function(child) {
|
34370 | var other;
|
34371 | if (other = this.getChild(child.name)) {
|
34372 |
|
34373 | if (other instanceof Message.Field && other.name !== other.originalName && this.getChild(other.originalName) === null)
|
34374 | other.name = other.originalName;
|
34375 | else if (child instanceof Message.Field && child.name !== child.originalName && this.getChild(child.originalName) === null)
|
34376 | child.name = child.originalName;
|
34377 | else
|
34378 | throw Error("Duplicate name in namespace "+this.toString(true)+": "+child.name);
|
34379 | }
|
34380 | this.children.push(child);
|
34381 | };
|
34382 |
|
34383 | |
34384 |
|
34385 |
|
34386 |
|
34387 |
|
34388 |
|
34389 | NamespacePrototype.getChild = function(nameOrId) {
|
34390 | var key = typeof nameOrId === 'number' ? 'id' : 'name';
|
34391 | for (var i=0, k=this.children.length; i<k; ++i)
|
34392 | if (this.children[i][key] === nameOrId)
|
34393 | return this.children[i];
|
34394 | return null;
|
34395 | };
|
34396 |
|
34397 | |
34398 |
|
34399 |
|
34400 |
|
34401 |
|
34402 |
|
34403 |
|
34404 | NamespacePrototype.resolve = function(qn, excludeNonNamespace) {
|
34405 | var part = typeof qn === 'string' ? qn.split(".") : qn,
|
34406 | ptr = this,
|
34407 | i = 0;
|
34408 | if (part[i] === "") {
|
34409 | while (ptr.parent !== null)
|
34410 | ptr = ptr.parent;
|
34411 | i++;
|
34412 | }
|
34413 | var child;
|
34414 | do {
|
34415 | do {
|
34416 | if (!(ptr instanceof Reflect.Namespace)) {
|
34417 | ptr = null;
|
34418 | break;
|
34419 | }
|
34420 | child = ptr.getChild(part[i]);
|
34421 | if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) {
|
34422 | ptr = null;
|
34423 | break;
|
34424 | }
|
34425 | ptr = child; i++;
|
34426 | } while (i < part.length);
|
34427 | if (ptr != null)
|
34428 | break;
|
34429 |
|
34430 | if (this.parent !== null)
|
34431 | return this.parent.resolve(qn, excludeNonNamespace);
|
34432 | } while (ptr != null);
|
34433 | return ptr;
|
34434 | };
|
34435 |
|
34436 | |
34437 |
|
34438 |
|
34439 |
|
34440 |
|
34441 |
|
34442 | NamespacePrototype.qn = function(t) {
|
34443 | var part = [], ptr = t;
|
34444 | do {
|
34445 | part.unshift(ptr.name);
|
34446 | ptr = ptr.parent;
|
34447 | } while (ptr !== null);
|
34448 | for (var len=1; len <= part.length; len++) {
|
34449 | var qn = part.slice(part.length-len);
|
34450 | if (t === this.resolve(qn, t instanceof Reflect.Namespace))
|
34451 | return qn.join(".");
|
34452 | }
|
34453 | return t.fqn();
|
34454 | };
|
34455 |
|
34456 | |
34457 |
|
34458 |
|
34459 |
|
34460 |
|
34461 | NamespacePrototype.build = function() {
|
34462 |
|
34463 | var ns = {};
|
34464 | var children = this.children;
|
34465 | for (var i=0, k=children.length, child; i<k; ++i) {
|
34466 | child = children[i];
|
34467 | if (child instanceof Namespace)
|
34468 | ns[child.name] = child.build();
|
34469 | }
|
34470 | if (Object.defineProperty)
|
34471 | Object.defineProperty(ns, "$options", { "value": this.buildOpt() });
|
34472 | return ns;
|
34473 | };
|
34474 |
|
34475 | |
34476 |
|
34477 |
|
34478 |
|
34479 | NamespacePrototype.buildOpt = function() {
|
34480 | var opt = {},
|
34481 | keys = Object.keys(this.options);
|
34482 | for (var i=0, k=keys.length; i<k; ++i) {
|
34483 | var key = keys[i],
|
34484 | val = this.options[keys[i]];
|
34485 |
|
34486 |
|
34487 |
|
34488 |
|
34489 | opt[key] = val;
|
34490 |
|
34491 | }
|
34492 | return opt;
|
34493 | };
|
34494 |
|
34495 | |
34496 |
|
34497 |
|
34498 |
|
34499 |
|
34500 | NamespacePrototype.getOption = function(name) {
|
34501 | if (typeof name === 'undefined')
|
34502 | return this.options;
|
34503 | return typeof this.options[name] !== 'undefined' ? this.options[name] : null;
|
34504 | };
|
34505 |
|
34506 | |
34507 |
|
34508 |
|
34509 |
|
34510 | Reflect.Namespace = Namespace;
|
34511 |
|
34512 | |
34513 |
|
34514 |
|
34515 |
|
34516 |
|
34517 |
|
34518 |
|
34519 |
|
34520 |
|
34521 |
|
34522 |
|
34523 |
|
34524 |
|
34525 |
|
34526 |
|
34527 |
|
34528 |
|
34529 |
|
34530 |
|
34531 |
|
34532 |
|
34533 | var Element = function(type, resolvedType, isMapKey, syntax, name) {
|
34534 |
|
34535 | |
34536 |
|
34537 |
|
34538 |
|
34539 | this.type = type;
|
34540 |
|
34541 | |
34542 |
|
34543 |
|
34544 |
|
34545 | this.resolvedType = resolvedType;
|
34546 |
|
34547 | |
34548 |
|
34549 |
|
34550 |
|
34551 | this.isMapKey = isMapKey;
|
34552 |
|
34553 | |
34554 |
|
34555 |
|
34556 |
|
34557 | this.syntax = syntax;
|
34558 |
|
34559 | |
34560 |
|
34561 |
|
34562 |
|
34563 | this.name = name;
|
34564 |
|
34565 | if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0)
|
34566 | throw Error("Invalid map key type: " + type.name);
|
34567 | };
|
34568 |
|
34569 | var ElementPrototype = Element.prototype;
|
34570 |
|
34571 | |
34572 |
|
34573 |
|
34574 |
|
34575 |
|
34576 |
|
34577 | function mkDefault(type) {
|
34578 | if (typeof type === 'string')
|
34579 | type = ProtoBuf.TYPES[type];
|
34580 | if (typeof type.defaultValue === 'undefined')
|
34581 | throw Error("default value for type "+type.name+" is not supported");
|
34582 | if (type == ProtoBuf.TYPES["bytes"])
|
34583 | return new ByteBuffer(0);
|
34584 | return type.defaultValue;
|
34585 | }
|
34586 |
|
34587 | |
34588 |
|
34589 |
|
34590 |
|
34591 |
|
34592 |
|
34593 | Element.defaultFieldValue = mkDefault;
|
34594 |
|
34595 | |
34596 |
|
34597 |
|
34598 |
|
34599 |
|
34600 |
|
34601 |
|
34602 |
|
34603 |
|
34604 | function mkLong(value, unsigned) {
|
34605 | if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean'
|
34606 | && value.low === value.low && value.high === value.high)
|
34607 | return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);
|
34608 | if (typeof value === 'string')
|
34609 | return ProtoBuf.Long.fromString(value, unsigned || false, 10);
|
34610 | if (typeof value === 'number')
|
34611 | return ProtoBuf.Long.fromNumber(value, unsigned || false);
|
34612 | throw Error("not convertible to Long");
|
34613 | }
|
34614 |
|
34615 | ElementPrototype.toString = function() {
|
34616 | return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element';
|
34617 | }
|
34618 |
|
34619 | |
34620 |
|
34621 |
|
34622 |
|
34623 |
|
34624 |
|
34625 |
|
34626 |
|
34627 | ElementPrototype.verifyValue = function(value) {
|
34628 | var self = this;
|
34629 | function fail(val, msg) {
|
34630 | throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");
|
34631 | }
|
34632 | switch (this.type) {
|
34633 |
|
34634 | case ProtoBuf.TYPES["int32"]:
|
34635 | case ProtoBuf.TYPES["sint32"]:
|
34636 | case ProtoBuf.TYPES["sfixed32"]:
|
34637 |
|
34638 | if (typeof value !== 'number' || (value === value && value % 1 !== 0))
|
34639 | fail(typeof value, "not an integer");
|
34640 | return value > 4294967295 ? value | 0 : value;
|
34641 |
|
34642 |
|
34643 | case ProtoBuf.TYPES["uint32"]:
|
34644 | case ProtoBuf.TYPES["fixed32"]:
|
34645 | if (typeof value !== 'number' || (value === value && value % 1 !== 0))
|
34646 | fail(typeof value, "not an integer");
|
34647 | return value < 0 ? value >>> 0 : value;
|
34648 |
|
34649 |
|
34650 | case ProtoBuf.TYPES["int64"]:
|
34651 | case ProtoBuf.TYPES["sint64"]:
|
34652 | case ProtoBuf.TYPES["sfixed64"]: {
|
34653 | if (ProtoBuf.Long)
|
34654 | try {
|
34655 | return mkLong(value, false);
|
34656 | } catch (e) {
|
34657 | fail(typeof value, e.message);
|
34658 | }
|
34659 | else
|
34660 | fail(typeof value, "requires Long.js");
|
34661 | }
|
34662 |
|
34663 |
|
34664 | case ProtoBuf.TYPES["uint64"]:
|
34665 | case ProtoBuf.TYPES["fixed64"]: {
|
34666 | if (ProtoBuf.Long)
|
34667 | try {
|
34668 | return mkLong(value, true);
|
34669 | } catch (e) {
|
34670 | fail(typeof value, e.message);
|
34671 | }
|
34672 | else
|
34673 | fail(typeof value, "requires Long.js");
|
34674 | }
|
34675 |
|
34676 |
|
34677 | case ProtoBuf.TYPES["bool"]:
|
34678 | if (typeof value !== 'boolean')
|
34679 | fail(typeof value, "not a boolean");
|
34680 | return value;
|
34681 |
|
34682 |
|
34683 | case ProtoBuf.TYPES["float"]:
|
34684 | case ProtoBuf.TYPES["double"]:
|
34685 | if (typeof value !== 'number')
|
34686 | fail(typeof value, "not a number");
|
34687 | return value;
|
34688 |
|
34689 |
|
34690 | case ProtoBuf.TYPES["string"]:
|
34691 | if (typeof value !== 'string' && !(value && value instanceof String))
|
34692 | fail(typeof value, "not a string");
|
34693 | return ""+value;
|
34694 |
|
34695 |
|
34696 | case ProtoBuf.TYPES["bytes"]:
|
34697 | if (ByteBuffer.isByteBuffer(value))
|
34698 | return value;
|
34699 | return ByteBuffer.wrap(value, "base64");
|
34700 |
|
34701 |
|
34702 | case ProtoBuf.TYPES["enum"]: {
|
34703 | var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);
|
34704 | for (i=0; i<values.length; i++)
|
34705 | if (values[i].name == value)
|
34706 | return values[i].id;
|
34707 | else if (values[i].id == value)
|
34708 | return values[i].id;
|
34709 |
|
34710 | if (this.syntax === 'proto3') {
|
34711 |
|
34712 | if (typeof value !== 'number' || (value === value && value % 1 !== 0))
|
34713 | fail(typeof value, "not an integer");
|
34714 | if (value > 4294967295 || value < 0)
|
34715 | fail(typeof value, "not in range for uint32")
|
34716 | return value;
|
34717 | } else {
|
34718 |
|
34719 | fail(value, "not a valid enum value");
|
34720 | }
|
34721 | }
|
34722 |
|
34723 | case ProtoBuf.TYPES["group"]:
|
34724 | case ProtoBuf.TYPES["message"]: {
|
34725 | if (!value || typeof value !== 'object')
|
34726 | fail(typeof value, "object expected");
|
34727 | if (value instanceof this.resolvedType.clazz)
|
34728 | return value;
|
34729 | if (value instanceof ProtoBuf.Builder.Message) {
|
34730 |
|
34731 | var obj = {};
|
34732 | for (var i in value)
|
34733 | if (value.hasOwnProperty(i))
|
34734 | obj[i] = value[i];
|
34735 | value = obj;
|
34736 | }
|
34737 |
|
34738 | return new (this.resolvedType.clazz)(value);
|
34739 | }
|
34740 | }
|
34741 |
|
34742 |
|
34743 | throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")");
|
34744 | };
|
34745 |
|
34746 | |
34747 |
|
34748 |
|
34749 |
|
34750 |
|
34751 |
|
34752 |
|
34753 |
|
34754 | ElementPrototype.calculateLength = function(id, value) {
|
34755 | if (value === null) return 0;
|
34756 |
|
34757 | var n;
|
34758 | switch (this.type) {
|
34759 | case ProtoBuf.TYPES["int32"]:
|
34760 | return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);
|
34761 | case ProtoBuf.TYPES["uint32"]:
|
34762 | return ByteBuffer.calculateVarint32(value);
|
34763 | case ProtoBuf.TYPES["sint32"]:
|
34764 | return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));
|
34765 | case ProtoBuf.TYPES["fixed32"]:
|
34766 | case ProtoBuf.TYPES["sfixed32"]:
|
34767 | case ProtoBuf.TYPES["float"]:
|
34768 | return 4;
|
34769 | case ProtoBuf.TYPES["int64"]:
|
34770 | case ProtoBuf.TYPES["uint64"]:
|
34771 | return ByteBuffer.calculateVarint64(value);
|
34772 | case ProtoBuf.TYPES["sint64"]:
|
34773 | return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));
|
34774 | case ProtoBuf.TYPES["fixed64"]:
|
34775 | case ProtoBuf.TYPES["sfixed64"]:
|
34776 | return 8;
|
34777 | case ProtoBuf.TYPES["bool"]:
|
34778 | return 1;
|
34779 | case ProtoBuf.TYPES["enum"]:
|
34780 | return ByteBuffer.calculateVarint32(value);
|
34781 | case ProtoBuf.TYPES["double"]:
|
34782 | return 8;
|
34783 | case ProtoBuf.TYPES["string"]:
|
34784 | n = ByteBuffer.calculateUTF8Bytes(value);
|
34785 | return ByteBuffer.calculateVarint32(n) + n;
|
34786 | case ProtoBuf.TYPES["bytes"]:
|
34787 | if (value.remaining() < 0)
|
34788 | throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");
|
34789 | return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();
|
34790 | case ProtoBuf.TYPES["message"]:
|
34791 | n = this.resolvedType.calculate(value);
|
34792 | return ByteBuffer.calculateVarint32(n) + n;
|
34793 | case ProtoBuf.TYPES["group"]:
|
34794 | n = this.resolvedType.calculate(value);
|
34795 | return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);
|
34796 | }
|
34797 |
|
34798 | throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");
|
34799 | };
|
34800 |
|
34801 | |
34802 |
|
34803 |
|
34804 |
|
34805 |
|
34806 |
|
34807 |
|
34808 |
|
34809 |
|
34810 | ElementPrototype.encodeValue = function(id, value, buffer) {
|
34811 | if (value === null) return buffer;
|
34812 |
|
34813 |
|
34814 | switch (this.type) {
|
34815 |
|
34816 | case ProtoBuf.TYPES["int32"]:
|
34817 |
|
34818 |
|
34819 | if (value < 0)
|
34820 | buffer.writeVarint64(value);
|
34821 | else
|
34822 | buffer.writeVarint32(value);
|
34823 | break;
|
34824 |
|
34825 |
|
34826 | case ProtoBuf.TYPES["uint32"]:
|
34827 | buffer.writeVarint32(value);
|
34828 | break;
|
34829 |
|
34830 |
|
34831 | case ProtoBuf.TYPES["sint32"]:
|
34832 | buffer.writeVarint32ZigZag(value);
|
34833 | break;
|
34834 |
|
34835 |
|
34836 | case ProtoBuf.TYPES["fixed32"]:
|
34837 | buffer.writeUint32(value);
|
34838 | break;
|
34839 |
|
34840 |
|
34841 | case ProtoBuf.TYPES["sfixed32"]:
|
34842 | buffer.writeInt32(value);
|
34843 | break;
|
34844 |
|
34845 |
|
34846 | case ProtoBuf.TYPES["int64"]:
|
34847 | case ProtoBuf.TYPES["uint64"]:
|
34848 | buffer.writeVarint64(value);
|
34849 | break;
|
34850 |
|
34851 |
|
34852 | case ProtoBuf.TYPES["sint64"]:
|
34853 | buffer.writeVarint64ZigZag(value);
|
34854 | break;
|
34855 |
|
34856 |
|
34857 | case ProtoBuf.TYPES["fixed64"]:
|
34858 | buffer.writeUint64(value);
|
34859 | break;
|
34860 |
|
34861 |
|
34862 | case ProtoBuf.TYPES["sfixed64"]:
|
34863 | buffer.writeInt64(value);
|
34864 | break;
|
34865 |
|
34866 |
|
34867 | case ProtoBuf.TYPES["bool"]:
|
34868 | if (typeof value === 'string')
|
34869 | buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);
|
34870 | else
|
34871 | buffer.writeVarint32(value ? 1 : 0);
|
34872 | break;
|
34873 |
|
34874 |
|
34875 | case ProtoBuf.TYPES["enum"]:
|
34876 | buffer.writeVarint32(value);
|
34877 | break;
|
34878 |
|
34879 |
|
34880 | case ProtoBuf.TYPES["float"]:
|
34881 | buffer.writeFloat32(value);
|
34882 | break;
|
34883 |
|
34884 |
|
34885 | case ProtoBuf.TYPES["double"]:
|
34886 | buffer.writeFloat64(value);
|
34887 | break;
|
34888 |
|
34889 |
|
34890 | case ProtoBuf.TYPES["string"]:
|
34891 | buffer.writeVString(value);
|
34892 | break;
|
34893 |
|
34894 |
|
34895 | case ProtoBuf.TYPES["bytes"]:
|
34896 | if (value.remaining() < 0)
|
34897 | throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");
|
34898 | var prevOffset = value.offset;
|
34899 | buffer.writeVarint32(value.remaining());
|
34900 | buffer.append(value);
|
34901 | value.offset = prevOffset;
|
34902 | break;
|
34903 |
|
34904 |
|
34905 | case ProtoBuf.TYPES["message"]:
|
34906 | var bb = new ByteBuffer().LE();
|
34907 | this.resolvedType.encode(value, bb);
|
34908 | buffer.writeVarint32(bb.offset);
|
34909 | buffer.append(bb.flip());
|
34910 | break;
|
34911 |
|
34912 |
|
34913 | case ProtoBuf.TYPES["group"]:
|
34914 | this.resolvedType.encode(value, buffer);
|
34915 | buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);
|
34916 | break;
|
34917 |
|
34918 | default:
|
34919 |
|
34920 | throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");
|
34921 | }
|
34922 | return buffer;
|
34923 | };
|
34924 |
|
34925 | |
34926 |
|
34927 |
|
34928 |
|
34929 |
|
34930 |
|
34931 |
|
34932 |
|
34933 |
|
34934 | ElementPrototype.decode = function(buffer, wireType, id) {
|
34935 | if (wireType != this.type.wireType)
|
34936 | throw Error("Unexpected wire type for element");
|
34937 |
|
34938 | var value, nBytes;
|
34939 | switch (this.type) {
|
34940 |
|
34941 | case ProtoBuf.TYPES["int32"]:
|
34942 | return buffer.readVarint32() | 0;
|
34943 |
|
34944 |
|
34945 | case ProtoBuf.TYPES["uint32"]:
|
34946 | return buffer.readVarint32() >>> 0;
|
34947 |
|
34948 |
|
34949 | case ProtoBuf.TYPES["sint32"]:
|
34950 | return buffer.readVarint32ZigZag() | 0;
|
34951 |
|
34952 |
|
34953 | case ProtoBuf.TYPES["fixed32"]:
|
34954 | return buffer.readUint32() >>> 0;
|
34955 |
|
34956 | case ProtoBuf.TYPES["sfixed32"]:
|
34957 | return buffer.readInt32() | 0;
|
34958 |
|
34959 |
|
34960 | case ProtoBuf.TYPES["int64"]:
|
34961 | return buffer.readVarint64();
|
34962 |
|
34963 |
|
34964 | case ProtoBuf.TYPES["uint64"]:
|
34965 | return buffer.readVarint64().toUnsigned();
|
34966 |
|
34967 |
|
34968 | case ProtoBuf.TYPES["sint64"]:
|
34969 | return buffer.readVarint64ZigZag();
|
34970 |
|
34971 |
|
34972 | case ProtoBuf.TYPES["fixed64"]:
|
34973 | return buffer.readUint64();
|
34974 |
|
34975 |
|
34976 | case ProtoBuf.TYPES["sfixed64"]:
|
34977 | return buffer.readInt64();
|
34978 |
|
34979 |
|
34980 | case ProtoBuf.TYPES["bool"]:
|
34981 | return !!buffer.readVarint32();
|
34982 |
|
34983 |
|
34984 | case ProtoBuf.TYPES["enum"]:
|
34985 |
|
34986 | return buffer.readVarint32();
|
34987 |
|
34988 |
|
34989 | case ProtoBuf.TYPES["float"]:
|
34990 | return buffer.readFloat();
|
34991 |
|
34992 |
|
34993 | case ProtoBuf.TYPES["double"]:
|
34994 | return buffer.readDouble();
|
34995 |
|
34996 |
|
34997 | case ProtoBuf.TYPES["string"]:
|
34998 | return buffer.readVString();
|
34999 |
|
35000 |
|
35001 | case ProtoBuf.TYPES["bytes"]: {
|
35002 | nBytes = buffer.readVarint32();
|
35003 | if (buffer.remaining() < nBytes)
|
35004 | throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());
|
35005 | value = buffer.clone();
|
35006 | value.limit = value.offset+nBytes;
|
35007 | buffer.offset += nBytes;
|
35008 | return value;
|
35009 | }
|
35010 |
|
35011 |
|
35012 | case ProtoBuf.TYPES["message"]: {
|
35013 | nBytes = buffer.readVarint32();
|
35014 | return this.resolvedType.decode(buffer, nBytes);
|
35015 | }
|
35016 |
|
35017 |
|
35018 | case ProtoBuf.TYPES["group"]:
|
35019 | return this.resolvedType.decode(buffer, -1, id);
|
35020 | }
|
35021 |
|
35022 |
|
35023 | throw Error("[INTERNAL] Illegal decode type");
|
35024 | };
|
35025 |
|
35026 | |
35027 |
|
35028 |
|
35029 |
|
35030 |
|
35031 |
|
35032 |
|
35033 |
|
35034 | ElementPrototype.valueFromString = function(str) {
|
35035 | if (!this.isMapKey) {
|
35036 | throw Error("valueFromString() called on non-map-key element");
|
35037 | }
|
35038 |
|
35039 | switch (this.type) {
|
35040 | case ProtoBuf.TYPES["int32"]:
|
35041 | case ProtoBuf.TYPES["sint32"]:
|
35042 | case ProtoBuf.TYPES["sfixed32"]:
|
35043 | case ProtoBuf.TYPES["uint32"]:
|
35044 | case ProtoBuf.TYPES["fixed32"]:
|
35045 | return this.verifyValue(parseInt(str));
|
35046 |
|
35047 | case ProtoBuf.TYPES["int64"]:
|
35048 | case ProtoBuf.TYPES["sint64"]:
|
35049 | case ProtoBuf.TYPES["sfixed64"]:
|
35050 | case ProtoBuf.TYPES["uint64"]:
|
35051 | case ProtoBuf.TYPES["fixed64"]:
|
35052 |
|
35053 | return this.verifyValue(str);
|
35054 |
|
35055 | case ProtoBuf.TYPES["bool"]:
|
35056 | return str === "true";
|
35057 |
|
35058 | case ProtoBuf.TYPES["string"]:
|
35059 | return this.verifyValue(str);
|
35060 |
|
35061 | case ProtoBuf.TYPES["bytes"]:
|
35062 | return ByteBuffer.fromBinary(str);
|
35063 | }
|
35064 | };
|
35065 |
|
35066 | |
35067 |
|
35068 |
|
35069 |
|
35070 |
|
35071 |
|
35072 |
|
35073 |
|
35074 |
|
35075 |
|
35076 |
|
35077 |
|
35078 |
|
35079 |
|
35080 |
|
35081 | ElementPrototype.valueToString = function(value) {
|
35082 | if (!this.isMapKey) {
|
35083 | throw Error("valueToString() called on non-map-key element");
|
35084 | }
|
35085 |
|
35086 | if (this.type === ProtoBuf.TYPES["bytes"]) {
|
35087 | return value.toString("binary");
|
35088 | } else {
|
35089 | return value.toString();
|
35090 | }
|
35091 | };
|
35092 |
|
35093 | |
35094 |
|
35095 |
|
35096 |
|
35097 | Reflect.Element = Element;
|
35098 |
|
35099 | |
35100 |
|
35101 |
|
35102 |
|
35103 |
|
35104 |
|
35105 |
|
35106 |
|
35107 |
|
35108 |
|
35109 |
|
35110 |
|
35111 | var Message = function(builder, parent, name, options, isGroup, syntax) {
|
35112 | Namespace.call(this, builder, parent, name, options, syntax);
|
35113 |
|
35114 | |
35115 |
|
35116 |
|
35117 | this.className = "Message";
|
35118 |
|
35119 | |
35120 |
|
35121 |
|
35122 |
|
35123 |
|
35124 | this.extensions = undefined;
|
35125 |
|
35126 | |
35127 |
|
35128 |
|
35129 |
|
35130 |
|
35131 | this.clazz = null;
|
35132 |
|
35133 | |
35134 |
|
35135 |
|
35136 |
|
35137 |
|
35138 | this.isGroup = !!isGroup;
|
35139 |
|
35140 |
|
35141 |
|
35142 | |
35143 |
|
35144 |
|
35145 |
|
35146 |
|
35147 | this._fields = null;
|
35148 |
|
35149 | |
35150 |
|
35151 |
|
35152 |
|
35153 |
|
35154 | this._fieldsById = null;
|
35155 |
|
35156 | |
35157 |
|
35158 |
|
35159 |
|
35160 |
|
35161 | this._fieldsByName = null;
|
35162 | };
|
35163 |
|
35164 | |
35165 |
|
35166 |
|
35167 |
|
35168 | var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);
|
35169 |
|
35170 | |
35171 |
|
35172 |
|
35173 |
|
35174 |
|
35175 |
|
35176 |
|
35177 |
|
35178 | MessagePrototype.build = function(rebuild) {
|
35179 | if (this.clazz && !rebuild)
|
35180 | return this.clazz;
|
35181 |
|
35182 |
|
35183 | var clazz = (function(ProtoBuf, T) {
|
35184 |
|
35185 | var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),
|
35186 | oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);
|
35187 |
|
35188 | |
35189 |
|
35190 |
|
35191 |
|
35192 |
|
35193 |
|
35194 |
|
35195 |
|
35196 |
|
35197 | var Message = function(values, var_args) {
|
35198 | ProtoBuf.Builder.Message.call(this);
|
35199 |
|
35200 |
|
35201 | for (var i=0, k=oneofs.length; i<k; ++i)
|
35202 | this[oneofs[i].name] = null;
|
35203 |
|
35204 | for (i=0, k=fields.length; i<k; ++i) {
|
35205 | var field = fields[i];
|
35206 | this[field.name] =
|
35207 | field.repeated ? [] :
|
35208 | (field.map ? new ProtoBuf.Map(field) : null);
|
35209 | if ((field.required || T.syntax === 'proto3') &&
|
35210 | field.defaultValue !== null)
|
35211 | this[field.name] = field.defaultValue;
|
35212 | }
|
35213 |
|
35214 | if (arguments.length > 0) {
|
35215 | var value;
|
35216 |
|
35217 | if (arguments.length === 1 && values !== null && typeof values === 'object' &&
|
35218 | (typeof values.encode !== 'function' || values instanceof Message) &&
|
35219 | !Array.isArray(values) &&
|
35220 | !(values instanceof ProtoBuf.Map) &&
|
35221 | !ByteBuffer.isByteBuffer(values) &&
|
35222 | !(values instanceof ArrayBuffer) &&
|
35223 | !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) {
|
35224 | this.$set(values);
|
35225 | } else // Set field values from arguments, in declaration order
|
35226 | for (i=0, k=arguments.length; i<k; ++i)
|
35227 | if (typeof (value = arguments[i]) !== 'undefined')
|
35228 | this.$set(fields[i].name, value); // May throw
|
35229 | }
|
35230 | };
|
35231 |
|
35232 | /**
|
35233 | * @alias ProtoBuf.Builder.Message.prototype
|
35234 | * @inner
|
35235 | */
|
35236 | var MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype);
|
35237 |
|
35238 | /**
|
35239 | * Adds a value to a repeated field.
|
35240 | * @name ProtoBuf.Builder.Message#add
|
35241 | * @function
|
35242 | * @param {string} key Field name
|
35243 | * @param {*} value Value to add
|
35244 | * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)
|
35245 | * @returns {!ProtoBuf.Builder.Message} this
|
35246 | * @throws {Error} If the value cannot be added
|
35247 | * @expose
|
35248 | */
|
35249 | MessagePrototype.add = function(key, value, noAssert) {
|
35250 | var field = T._fieldsByName[key];
|
35251 | if (!noAssert) {
|
35252 | if (!field)
|
35253 | throw Error(this+"#"+key+" is undefined");
|
35254 | if (!(field instanceof ProtoBuf.Reflect.Message.Field))
|
35255 | throw Error(this+"#"+key+" is not a field: "+field.toString(true));
|
35256 | if (!field.repeated)
|
35257 | throw Error(this+"#"+key+" is not a repeated field");
|
35258 | value = field.verifyValue(value, true);
|
35259 | }
|
35260 | if (this[key] === null)
|
35261 | this[key] = [];
|
35262 | this[key].push(value);
|
35263 | return this;
|
35264 | };
|
35265 |
|
35266 | |
35267 |
|
35268 |
|
35269 |
|
35270 |
|
35271 |
|
35272 |
|
35273 |
|
35274 |
|
35275 |
|
35276 |
|
35277 | MessagePrototype.$add = MessagePrototype.add;
|
35278 |
|
35279 | |
35280 |
|
35281 |
|
35282 |
|
35283 |
|
35284 |
|
35285 |
|
35286 |
|
35287 |
|
35288 |
|
35289 |
|
35290 | MessagePrototype.set = function(keyOrObj, value, noAssert) {
|
35291 | if (keyOrObj && typeof keyOrObj === 'object') {
|
35292 | noAssert = value;
|
35293 | for (var ikey in keyOrObj) {
|
35294 |
|
35295 | if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined)
|
35296 | this.$set(ikey, value, noAssert);
|
35297 | }
|
35298 | return this;
|
35299 | }
|
35300 | var field = T._fieldsByName[keyOrObj];
|
35301 | if (!noAssert) {
|
35302 | if (!field)
|
35303 | throw Error(this+"#"+keyOrObj+" is not a field: undefined");
|
35304 | if (!(field instanceof ProtoBuf.Reflect.Message.Field))
|
35305 | throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true));
|
35306 | this[field.name] = (value = field.verifyValue(value));
|
35307 | } else
|
35308 | this[keyOrObj] = value;
|
35309 | if (field && field.oneof) {
|
35310 | var currentField = this[field.oneof.name];
|
35311 | if (value !== null) {
|
35312 | if (currentField !== null && currentField !== field.name)
|
35313 | this[currentField] = null;
|
35314 | this[field.oneof.name] = field.name;
|
35315 | } else if (currentField === keyOrObj)
|
35316 | this[field.oneof.name] = null;
|
35317 | }
|
35318 | return this;
|
35319 | };
|
35320 |
|
35321 | |
35322 |
|
35323 |
|
35324 |
|
35325 |
|
35326 |
|
35327 |
|
35328 |
|
35329 |
|
35330 |
|
35331 | MessagePrototype.$set = MessagePrototype.set;
|
35332 |
|
35333 | /**
|
35334 | * Gets a field's value.
|
35335 | * @name ProtoBuf.Builder.Message#get
|
35336 | * @function
|
35337 | * @param {string} key Key
|
35338 | * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`
|
35339 | * @return {*} Value
|
35340 | * @throws {Error} If there is no such field
|
35341 | * @expose
|
35342 | */
|
35343 | MessagePrototype.get = function(key, noAssert) {
|
35344 | if (noAssert)
|
35345 | return this[key];
|
35346 | var field = T._fieldsByName[key];
|
35347 | if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))
|
35348 | throw Error(this+"#"+key+" is not a field: undefined");
|
35349 | if (!(field instanceof ProtoBuf.Reflect.Message.Field))
|
35350 | throw Error(this+"#"+key+" is not a field: "+field.toString(true));
|
35351 | return this[field.name];
|
35352 | };
|
35353 |
|
35354 | |
35355 |
|
35356 |
|
35357 |
|
35358 |
|
35359 |
|
35360 |
|
35361 |
|
35362 |
|
35363 | MessagePrototype.$get = MessagePrototype.get;
|
35364 |
|
35365 | // Getters and setters
|
35366 |
|
35367 | for (var i=0; i<fields.length; i++) {
|
35368 | var field = fields[i];
|
35369 |
|
35370 | if (field instanceof ProtoBuf.Reflect.Message.ExtensionField)
|
35371 | continue;
|
35372 |
|
35373 | if (T.builder.options['populateAccessors'])
|
35374 | (function(field) {
|
35375 |
|
35376 | var Name = field.originalName.replace(/(_[a-zA-Z])/g, function(match) {
|
35377 | return match.toUpperCase().replace('_','');
|
35378 | });
|
35379 | Name = Name.substring(0,1).toUpperCase() + Name.substring(1);
|
35380 |
|
35381 |
|
35382 | var name = field.originalName.replace(/([A-Z])/g, function(match) {
|
35383 | return "_"+match;
|
35384 | });
|
35385 |
|
35386 | |
35387 |
|
35388 |
|
35389 |
|
35390 |
|
35391 |
|
35392 |
|
35393 |
|
35394 | var setter = function(value, noAssert) {
|
35395 | this[field.name] = noAssert ? value : field.verifyValue(value);
|
35396 | return this;
|
35397 | };
|
35398 |
|
35399 | |
35400 |
|
35401 |
|
35402 |
|
35403 |
|
35404 |
|
35405 | var getter = function() {
|
35406 | return this[field.name];
|
35407 | };
|
35408 |
|
35409 | if (T.getChild("set"+Name) === null)
|
35410 | |
35411 |
|
35412 |
|
35413 |
|
35414 |
|
35415 |
|
35416 |
|
35417 |
|
35418 |
|
35419 |
|
35420 |
|
35421 | MessagePrototype["set"+Name] = setter;
|
35422 |
|
35423 | if (T.getChild("set_"+name) === null)
|
35424 | |
35425 |
|
35426 |
|
35427 |
|
35428 |
|
35429 |
|
35430 |
|
35431 |
|
35432 |
|
35433 |
|
35434 |
|
35435 | MessagePrototype["set_"+name] = setter;
|
35436 |
|
35437 | if (T.getChild("get"+Name) === null)
|
35438 | |
35439 |
|
35440 |
|
35441 |
|
35442 |
|
35443 |
|
35444 |
|
35445 |
|
35446 | MessagePrototype["get"+Name] = getter;
|
35447 |
|
35448 | if (T.getChild("get_"+name) === null)
|
35449 | |
35450 |
|
35451 |
|
35452 |
|
35453 |
|
35454 |
|
35455 |
|
35456 |
|
35457 | MessagePrototype["get_"+name] = getter;
|
35458 |
|
35459 | })(field);
|
35460 | }
|
35461 |
|
35462 |
|
35463 |
|
35464 | |
35465 |
|
35466 |
|
35467 |
|
35468 |
|
35469 |
|
35470 |
|
35471 |
|
35472 |
|
35473 |
|
35474 |
|
35475 |
|
35476 |
|
35477 |
|
35478 | MessagePrototype.encode = function(buffer, noVerify) {
|
35479 | if (typeof buffer === 'boolean')
|
35480 | noVerify = buffer,
|
35481 | buffer = undefined;
|
35482 | var isNew = false;
|
35483 | if (!buffer)
|
35484 | buffer = new ByteBuffer(),
|
35485 | isNew = true;
|
35486 | var le = buffer.littleEndian;
|
35487 | try {
|
35488 | T.encode(this, buffer.LE(), noVerify);
|
35489 | return (isNew ? buffer.flip() : buffer).LE(le);
|
35490 | } catch (e) {
|
35491 | buffer.LE(le);
|
35492 | throw(e);
|
35493 | }
|
35494 | };
|
35495 |
|
35496 | |
35497 |
|
35498 |
|
35499 |
|
35500 |
|
35501 |
|
35502 |
|
35503 |
|
35504 | Message.encode = function(data, buffer, noVerify) {
|
35505 | return new Message(data).encode(buffer, noVerify);
|
35506 | };
|
35507 |
|
35508 | |
35509 |
|
35510 |
|
35511 |
|
35512 |
|
35513 |
|
35514 |
|
35515 |
|
35516 | MessagePrototype.calculate = function() {
|
35517 | return T.calculate(this);
|
35518 | };
|
35519 |
|
35520 | |
35521 |
|
35522 |
|
35523 |
|
35524 |
|
35525 |
|
35526 |
|
35527 |
|
35528 |
|
35529 |
|
35530 |
|
35531 | MessagePrototype.encodeDelimited = function(buffer, noVerify) {
|
35532 | var isNew = false;
|
35533 | if (!buffer)
|
35534 | buffer = new ByteBuffer(),
|
35535 | isNew = true;
|
35536 | var enc = new ByteBuffer().LE();
|
35537 | T.encode(this, enc, noVerify).flip();
|
35538 | buffer.writeVarint32(enc.remaining());
|
35539 | buffer.append(enc);
|
35540 | return isNew ? buffer.flip() : buffer;
|
35541 | };
|
35542 |
|
35543 | |
35544 |
|
35545 |
|
35546 |
|
35547 |
|
35548 |
|
35549 |
|
35550 |
|
35551 |
|
35552 | MessagePrototype.encodeAB = function() {
|
35553 | try {
|
35554 | return this.encode().toArrayBuffer();
|
35555 | } catch (e) {
|
35556 | if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer();
|
35557 | throw(e);
|
35558 | }
|
35559 | };
|
35560 |
|
35561 | |
35562 |
|
35563 |
|
35564 |
|
35565 |
|
35566 |
|
35567 |
|
35568 |
|
35569 |
|
35570 | MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;
|
35571 |
|
35572 | |
35573 |
|
35574 |
|
35575 |
|
35576 |
|
35577 |
|
35578 |
|
35579 |
|
35580 |
|
35581 | MessagePrototype.encodeNB = function() {
|
35582 | try {
|
35583 | return this.encode().toBuffer();
|
35584 | } catch (e) {
|
35585 | if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer();
|
35586 | throw(e);
|
35587 | }
|
35588 | };
|
35589 |
|
35590 | |
35591 |
|
35592 |
|
35593 |
|
35594 |
|
35595 |
|
35596 |
|
35597 |
|
35598 |
|
35599 | MessagePrototype.toBuffer = MessagePrototype.encodeNB;
|
35600 |
|
35601 | |
35602 |
|
35603 |
|
35604 |
|
35605 |
|
35606 |
|
35607 |
|
35608 |
|
35609 |
|
35610 | MessagePrototype.encode64 = function() {
|
35611 | try {
|
35612 | return this.encode().toBase64();
|
35613 | } catch (e) {
|
35614 | if (e["encoded"]) e["encoded"] = e["encoded"].toBase64();
|
35615 | throw(e);
|
35616 | }
|
35617 | };
|
35618 |
|
35619 | |
35620 |
|
35621 |
|
35622 |
|
35623 |
|
35624 |
|
35625 |
|
35626 |
|
35627 |
|
35628 | MessagePrototype.toBase64 = MessagePrototype.encode64;
|
35629 |
|
35630 | |
35631 |
|
35632 |
|
35633 |
|
35634 |
|
35635 |
|
35636 |
|
35637 |
|
35638 |
|
35639 | MessagePrototype.encodeHex = function() {
|
35640 | try {
|
35641 | return this.encode().toHex();
|
35642 | } catch (e) {
|
35643 | if (e["encoded"]) e["encoded"] = e["encoded"].toHex();
|
35644 | throw(e);
|
35645 | }
|
35646 | };
|
35647 |
|
35648 | |
35649 |
|
35650 |
|
35651 |
|
35652 |
|
35653 |
|
35654 |
|
35655 |
|
35656 |
|
35657 | MessagePrototype.toHex = MessagePrototype.encodeHex;
|
35658 |
|
35659 | |
35660 |
|
35661 |
|
35662 |
|
35663 |
|
35664 |
|
35665 |
|
35666 |
|
35667 |
|
35668 | function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {
|
35669 | if (obj === null || typeof obj !== 'object') {
|
35670 |
|
35671 | if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) {
|
35672 | var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);
|
35673 | if (name !== null)
|
35674 | return name;
|
35675 | }
|
35676 |
|
35677 | return obj;
|
35678 | }
|
35679 |
|
35680 | if (ByteBuffer.isByteBuffer(obj))
|
35681 | return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();
|
35682 |
|
35683 | if (ProtoBuf.Long.isLong(obj))
|
35684 | return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);
|
35685 | var clone;
|
35686 |
|
35687 | if (Array.isArray(obj)) {
|
35688 | clone = [];
|
35689 | obj.forEach(function(v, k) {
|
35690 | clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);
|
35691 | });
|
35692 | return clone;
|
35693 | }
|
35694 | clone = {};
|
35695 |
|
35696 | if (obj instanceof ProtoBuf.Map) {
|
35697 | var it = obj.entries();
|
35698 | for (var e = it.next(); !e.done; e = it.next())
|
35699 | clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);
|
35700 | return clone;
|
35701 | }
|
35702 |
|
35703 | var type = obj.$type,
|
35704 | field = undefined;
|
35705 | for (var i in obj)
|
35706 | if (obj.hasOwnProperty(i)) {
|
35707 | if (type && (field = type.getChild(i)))
|
35708 | clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);
|
35709 | else
|
35710 | clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);
|
35711 | }
|
35712 | return clone;
|
35713 | }
|
35714 |
|
35715 | |
35716 |
|
35717 |
|
35718 |
|
35719 |
|
35720 |
|
35721 |
|
35722 | MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {
|
35723 | return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);
|
35724 | };
|
35725 |
|
35726 | |
35727 |
|
35728 |
|
35729 |
|
35730 |
|
35731 | MessagePrototype.encodeJSON = function() {
|
35732 | return JSON.stringify(
|
35733 | cloneRaw(this,
|
35734 | true,
|
35735 | true,
|
35736 | this.$type
|
35737 | )
|
35738 | );
|
35739 | };
|
35740 |
|
35741 | |
35742 |
|
35743 |
|
35744 |
|
35745 |
|
35746 |
|
35747 |
|
35748 |
|
35749 |
|
35750 |
|
35751 |
|
35752 |
|
35753 |
|
35754 |
|
35755 | Message.decode = function(buffer, length, enc) {
|
35756 | if (typeof length === 'string')
|
35757 | enc = length,
|
35758 | length = -1;
|
35759 | if (typeof buffer === 'string')
|
35760 | buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");
|
35761 | else if (!ByteBuffer.isByteBuffer(buffer))
|
35762 | buffer = ByteBuffer.wrap(buffer);
|
35763 | var le = buffer.littleEndian;
|
35764 | try {
|
35765 | var msg = T.decode(buffer.LE(), length);
|
35766 | buffer.LE(le);
|
35767 | return msg;
|
35768 | } catch (e) {
|
35769 | buffer.LE(le);
|
35770 | throw(e);
|
35771 | }
|
35772 | };
|
35773 |
|
35774 | |
35775 |
|
35776 |
|
35777 |
|
35778 |
|
35779 |
|
35780 |
|
35781 |
|
35782 |
|
35783 |
|
35784 |
|
35785 | Message.decodeDelimited = function(buffer, enc) {
|
35786 | if (typeof buffer === 'string')
|
35787 | buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");
|
35788 | else if (!ByteBuffer.isByteBuffer(buffer))
|
35789 | buffer = ByteBuffer.wrap(buffer);
|
35790 | if (buffer.remaining() < 1)
|
35791 | return null;
|
35792 | var off = buffer.offset,
|
35793 | len = buffer.readVarint32();
|
35794 | if (buffer.remaining() < len) {
|
35795 | buffer.offset = off;
|
35796 | return null;
|
35797 | }
|
35798 | try {
|
35799 | var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());
|
35800 | buffer.offset += len;
|
35801 | return msg;
|
35802 | } catch (err) {
|
35803 | buffer.offset += len;
|
35804 | throw err;
|
35805 | }
|
35806 | };
|
35807 |
|
35808 | |
35809 |
|
35810 |
|
35811 |
|
35812 |
|
35813 |
|
35814 |
|
35815 |
|
35816 |
|
35817 |
|
35818 | Message.decode64 = function(str) {
|
35819 | return Message.decode(str, "base64");
|
35820 | };
|
35821 |
|
35822 | |
35823 |
|
35824 |
|
35825 |
|
35826 |
|
35827 |
|
35828 |
|
35829 |
|
35830 |
|
35831 |
|
35832 | Message.decodeHex = function(str) {
|
35833 | return Message.decode(str, "hex");
|
35834 | };
|
35835 |
|
35836 | |
35837 |
|
35838 |
|
35839 |
|
35840 |
|
35841 |
|
35842 |
|
35843 |
|
35844 |
|
35845 |
|
35846 | Message.decodeJSON = function(str) {
|
35847 | return new Message(JSON.parse(str));
|
35848 | };
|
35849 |
|
35850 |
|
35851 |
|
35852 | |
35853 |
|
35854 |
|
35855 |
|
35856 |
|
35857 |
|
35858 |
|
35859 | MessagePrototype.toString = function() {
|
35860 | return T.toString();
|
35861 | };
|
35862 |
|
35863 |
|
35864 |
|
35865 | |
35866 |
|
35867 |
|
35868 |
|
35869 |
|
35870 |
|
35871 | var $optionsS;
|
35872 |
|
35873 | |
35874 |
|
35875 |
|
35876 |
|
35877 |
|
35878 |
|
35879 | var $options;
|
35880 |
|
35881 | |
35882 |
|
35883 |
|
35884 |
|
35885 |
|
35886 |
|
35887 | var $typeS;
|
35888 |
|
35889 | |
35890 |
|
35891 |
|
35892 |
|
35893 |
|
35894 |
|
35895 | var $type;
|
35896 |
|
35897 | if (Object.defineProperty)
|
35898 | Object.defineProperty(Message, '$options', { "value": T.buildOpt() }),
|
35899 | Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }),
|
35900 | Object.defineProperty(Message, "$type", { "value": T }),
|
35901 | Object.defineProperty(MessagePrototype, "$type", { "value": T });
|
35902 |
|
35903 | return Message;
|
35904 |
|
35905 | })(ProtoBuf, this);
|
35906 |
|
35907 |
|
35908 | this._fields = [];
|
35909 | this._fieldsById = {};
|
35910 | this._fieldsByName = {};
|
35911 | this._oneofsByName = {};
|
35912 | for (var i=0, k=this.children.length, child; i<k; i++) {
|
35913 | child = this.children[i];
|
35914 | if (child instanceof Enum || child instanceof Message || child instanceof Service) {
|
35915 | if (clazz.hasOwnProperty(child.name))
|
35916 | throw Error("Illegal reflect child of "+this.toString(true)+": "+child.toString(true)+" cannot override static property '"+child.name+"'");
|
35917 | clazz[child.name] = child.build();
|
35918 | } else if (child instanceof Message.Field)
|
35919 | child.build(),
|
35920 | this._fields.push(child),
|
35921 | this._fieldsById[child.id] = child,
|
35922 | this._fieldsByName[child.name] = child;
|
35923 | else if (child instanceof Message.OneOf) {
|
35924 | this._oneofsByName[child.name] = child;
|
35925 | }
|
35926 | else if (!(child instanceof Message.OneOf) && !(child instanceof Extension))
|
35927 | throw Error("Illegal reflect child of "+this.toString(true)+": "+this.children[i].toString(true));
|
35928 | }
|
35929 |
|
35930 | return this.clazz = clazz;
|
35931 | };
|
35932 |
|
35933 | |
35934 |
|
35935 |
|
35936 |
|
35937 |
|
35938 |
|
35939 |
|
35940 |
|
35941 |
|
35942 | MessagePrototype.encode = function(message, buffer, noVerify) {
|
35943 | var fieldMissing = null,
|
35944 | field;
|
35945 | for (var i=0, k=this._fields.length, val; i<k; ++i) {
|
35946 | field = this._fields[i];
|
35947 | val = message[field.name];
|
35948 | if (field.required && val === null) {
|
35949 | if (fieldMissing === null)
|
35950 | fieldMissing = field;
|
35951 | } else
|
35952 | field.encode(noVerify ? val : field.verifyValue(val), buffer, message);
|
35953 | }
|
35954 | if (fieldMissing !== null) {
|
35955 | var err = Error("Missing at least one required field for "+this.toString(true)+": "+fieldMissing);
|
35956 | err["encoded"] = buffer;
|
35957 | throw(err);
|
35958 | }
|
35959 | return buffer;
|
35960 | };
|
35961 |
|
35962 | |
35963 |
|
35964 |
|
35965 |
|
35966 |
|
35967 |
|
35968 |
|
35969 | MessagePrototype.calculate = function(message) {
|
35970 | for (var n=0, i=0, k=this._fields.length, field, val; i<k; ++i) {
|
35971 | field = this._fields[i];
|
35972 | val = message[field.name];
|
35973 | if (field.required && val === null)
|
35974 | throw Error("Missing at least one required field for "+this.toString(true)+": "+field);
|
35975 | else
|
35976 | n += field.calculate(val, message);
|
35977 | }
|
35978 | return n;
|
35979 | };
|
35980 |
|
35981 | |
35982 |
|
35983 |
|
35984 |
|
35985 |
|
35986 |
|
35987 |
|
35988 |
|
35989 | function skipTillGroupEnd(expectedId, buf) {
|
35990 | var tag = buf.readVarint32(),
|
35991 | wireType = tag & 0x07,
|
35992 | id = tag >>> 3;
|
35993 | switch (wireType) {
|
35994 | case ProtoBuf.WIRE_TYPES.VARINT:
|
35995 | do tag = buf.readUint8();
|
35996 | while ((tag & 0x80) === 0x80);
|
35997 | break;
|
35998 | case ProtoBuf.WIRE_TYPES.BITS64:
|
35999 | buf.offset += 8;
|
36000 | break;
|
36001 | case ProtoBuf.WIRE_TYPES.LDELIM:
|
36002 | tag = buf.readVarint32();
|
36003 | buf.offset += tag;
|
36004 | break;
|
36005 | case ProtoBuf.WIRE_TYPES.STARTGROUP:
|
36006 | skipTillGroupEnd(id, buf);
|
36007 | break;
|
36008 | case ProtoBuf.WIRE_TYPES.ENDGROUP:
|
36009 | if (id === expectedId)
|
36010 | return false;
|
36011 | else
|
36012 | throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)");
|
36013 | case ProtoBuf.WIRE_TYPES.BITS32:
|
36014 | buf.offset += 4;
|
36015 | break;
|
36016 | default:
|
36017 | throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType);
|
36018 | }
|
36019 | return true;
|
36020 | }
|
36021 |
|
36022 | |
36023 |
|
36024 |
|
36025 |
|
36026 |
|
36027 |
|
36028 |
|
36029 |
|
36030 |
|
36031 | MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {
|
36032 | if (typeof length !== 'number')
|
36033 | length = -1;
|
36034 | var start = buffer.offset,
|
36035 | msg = new (this.clazz)(),
|
36036 | tag, wireType, id, field;
|
36037 | while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) {
|
36038 | tag = buffer.readVarint32();
|
36039 | wireType = tag & 0x07;
|
36040 | id = tag >>> 3;
|
36041 | if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {
|
36042 | if (id !== expectedGroupEndId)
|
36043 | throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")");
|
36044 | break;
|
36045 | }
|
36046 | if (!(field = this._fieldsById[id])) {
|
36047 |
|
36048 | switch (wireType) {
|
36049 | case ProtoBuf.WIRE_TYPES.VARINT:
|
36050 | buffer.readVarint32();
|
36051 | break;
|
36052 | case ProtoBuf.WIRE_TYPES.BITS32:
|
36053 | buffer.offset += 4;
|
36054 | break;
|
36055 | case ProtoBuf.WIRE_TYPES.BITS64:
|
36056 | buffer.offset += 8;
|
36057 | break;
|
36058 | case ProtoBuf.WIRE_TYPES.LDELIM:
|
36059 | var len = buffer.readVarint32();
|
36060 | buffer.offset += len;
|
36061 | break;
|
36062 | case ProtoBuf.WIRE_TYPES.STARTGROUP:
|
36063 | while (skipTillGroupEnd(id, buffer)) {}
|
36064 | break;
|
36065 | default:
|
36066 | throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType);
|
36067 | }
|
36068 | continue;
|
36069 | }
|
36070 | if (field.repeated && !field.options["packed"]) {
|
36071 | msg[field.name].push(field.decode(wireType, buffer));
|
36072 | } else if (field.map) {
|
36073 | var keyval = field.decode(wireType, buffer);
|
36074 | msg[field.name].set(keyval[0], keyval[1]);
|
36075 | } else {
|
36076 | msg[field.name] = field.decode(wireType, buffer);
|
36077 | if (field.oneof) {
|
36078 | var currentField = msg[field.oneof.name];
|
36079 | if (currentField !== null && currentField !== field.name)
|
36080 | msg[currentField] = null;
|
36081 | msg[field.oneof.name] = field.name;
|
36082 | }
|
36083 | }
|
36084 | }
|
36085 |
|
36086 |
|
36087 | for (var i=0, k=this._fields.length; i<k; ++i) {
|
36088 | field = this._fields[i];
|
36089 | if (msg[field.name] === null) {
|
36090 | if (this.syntax === "proto3") {
|
36091 | msg[field.name] = field.defaultValue;
|
36092 | } else if (field.required) {
|
36093 | var err = Error("Missing at least one required field for " + this.toString(true) + ": " + field.name);
|
36094 | err["decoded"] = msg;
|
36095 | throw(err);
|
36096 | } else if (ProtoBuf.populateDefaults && field.defaultValue !== null)
|
36097 | msg[field.name] = field.defaultValue;
|
36098 | }
|
36099 | }
|
36100 | return msg;
|
36101 | };
|
36102 |
|
36103 | |
36104 |
|
36105 |
|
36106 |
|
36107 | Reflect.Message = Message;
|
36108 |
|
36109 | |
36110 |
|
36111 |
|
36112 |
|
36113 |
|
36114 |
|
36115 |
|
36116 |
|
36117 |
|
36118 |
|
36119 |
|
36120 |
|
36121 |
|
36122 |
|
36123 |
|
36124 |
|
36125 | var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {
|
36126 | T.call(this, builder, message, name);
|
36127 |
|
36128 | |
36129 |
|
36130 |
|
36131 | this.className = "Message.Field";
|
36132 |
|
36133 | |
36134 |
|
36135 |
|
36136 |
|
36137 |
|
36138 | this.required = rule === "required";
|
36139 |
|
36140 | |
36141 |
|
36142 |
|
36143 |
|
36144 |
|
36145 | this.repeated = rule === "repeated";
|
36146 |
|
36147 | |
36148 |
|
36149 |
|
36150 |
|
36151 |
|
36152 | this.map = rule === "map";
|
36153 |
|
36154 | |
36155 |
|
36156 |
|
36157 |
|
36158 |
|
36159 |
|
36160 | this.keyType = keytype || null;
|
36161 |
|
36162 | |
36163 |
|
36164 |
|
36165 |
|
36166 |
|
36167 |
|
36168 | this.type = type;
|
36169 |
|
36170 | |
36171 |
|
36172 |
|
36173 |
|
36174 |
|
36175 | this.resolvedType = null;
|
36176 |
|
36177 | |
36178 |
|
36179 |
|
36180 |
|
36181 |
|
36182 | this.id = id;
|
36183 |
|
36184 | |
36185 |
|
36186 |
|
36187 |
|
36188 |
|
36189 |
|
36190 | this.options = options || {};
|
36191 |
|
36192 | |
36193 |
|
36194 |
|
36195 |
|
36196 |
|
36197 | this.defaultValue = null;
|
36198 |
|
36199 | |
36200 |
|
36201 |
|
36202 |
|
36203 |
|
36204 | this.oneof = oneof || null;
|
36205 |
|
36206 | |
36207 |
|
36208 |
|
36209 |
|
36210 |
|
36211 | this.syntax = syntax || 'proto2';
|
36212 |
|
36213 | |
36214 |
|
36215 |
|
36216 |
|
36217 |
|
36218 | this.originalName = this.name;
|
36219 |
|
36220 | |
36221 |
|
36222 |
|
36223 |
|
36224 |
|
36225 | this.element = null;
|
36226 |
|
36227 | |
36228 |
|
36229 |
|
36230 |
|
36231 |
|
36232 |
|
36233 | this.keyElement = null;
|
36234 |
|
36235 |
|
36236 | if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField))
|
36237 | this.name = ProtoBuf.Util.toCamelCase(this.name);
|
36238 | };
|
36239 |
|
36240 | |
36241 |
|
36242 |
|
36243 |
|
36244 | var FieldPrototype = Field.prototype = Object.create(T.prototype);
|
36245 |
|
36246 | |
36247 |
|
36248 |
|
36249 |
|
36250 |
|
36251 | FieldPrototype.build = function() {
|
36252 | this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);
|
36253 | if (this.map)
|
36254 | this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name);
|
36255 |
|
36256 |
|
36257 |
|
36258 | if (this.syntax === 'proto3' && !this.repeated && !this.map)
|
36259 | this.defaultValue = Element.defaultFieldValue(this.type);
|
36260 |
|
36261 |
|
36262 | else if (typeof this.options['default'] !== 'undefined')
|
36263 | this.defaultValue = this.verifyValue(this.options['default']);
|
36264 | };
|
36265 |
|
36266 | |
36267 |
|
36268 |
|
36269 |
|
36270 |
|
36271 |
|
36272 |
|
36273 |
|
36274 | FieldPrototype.verifyValue = function(value, skipRepeated) {
|
36275 | skipRepeated = skipRepeated || false;
|
36276 | var self = this;
|
36277 | function fail(val, msg) {
|
36278 | throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");
|
36279 | }
|
36280 | if (value === null) {
|
36281 | if (this.required)
|
36282 | fail(typeof value, "required");
|
36283 | if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES["message"])
|
36284 | fail(typeof value, "proto3 field without field presence cannot be null");
|
36285 | return null;
|
36286 | }
|
36287 | var i;
|
36288 | if (this.repeated && !skipRepeated) {
|
36289 | if (!Array.isArray(value))
|
36290 | value = [value];
|
36291 | var res = [];
|
36292 | for (i=0; i<value.length; i++)
|
36293 | res.push(this.element.verifyValue(value[i]));
|
36294 | return res;
|
36295 | }
|
36296 | if (this.map && !skipRepeated) {
|
36297 | if (!(value instanceof ProtoBuf.Map)) {
|
36298 |
|
36299 | if (!(value instanceof Object)) {
|
36300 | fail(typeof value,
|
36301 | "expected ProtoBuf.Map or raw object for map field");
|
36302 | }
|
36303 | return new ProtoBuf.Map(this, value);
|
36304 | } else {
|
36305 | return value;
|
36306 | }
|
36307 | }
|
36308 |
|
36309 | if (!this.repeated && Array.isArray(value))
|
36310 | fail(typeof value, "no array expected");
|
36311 |
|
36312 | return this.element.verifyValue(value);
|
36313 | };
|
36314 |
|
36315 | |
36316 |
|
36317 |
|
36318 |
|
36319 |
|
36320 |
|
36321 |
|
36322 | FieldPrototype.hasWirePresence = function(value, message) {
|
36323 | if (this.syntax !== 'proto3')
|
36324 | return (value !== null);
|
36325 | if (this.oneof && message[this.oneof.name] === this.name)
|
36326 | return true;
|
36327 | switch (this.type) {
|
36328 | case ProtoBuf.TYPES["int32"]:
|
36329 | case ProtoBuf.TYPES["sint32"]:
|
36330 | case ProtoBuf.TYPES["sfixed32"]:
|
36331 | case ProtoBuf.TYPES["uint32"]:
|
36332 | case ProtoBuf.TYPES["fixed32"]:
|
36333 | return value !== 0;
|
36334 |
|
36335 | case ProtoBuf.TYPES["int64"]:
|
36336 | case ProtoBuf.TYPES["sint64"]:
|
36337 | case ProtoBuf.TYPES["sfixed64"]:
|
36338 | case ProtoBuf.TYPES["uint64"]:
|
36339 | case ProtoBuf.TYPES["fixed64"]:
|
36340 | return value.low !== 0 || value.high !== 0;
|
36341 |
|
36342 | case ProtoBuf.TYPES["bool"]:
|
36343 | return value;
|
36344 |
|
36345 | case ProtoBuf.TYPES["float"]:
|
36346 | case ProtoBuf.TYPES["double"]:
|
36347 | return value !== 0.0;
|
36348 |
|
36349 | case ProtoBuf.TYPES["string"]:
|
36350 | return value.length > 0;
|
36351 |
|
36352 | case ProtoBuf.TYPES["bytes"]:
|
36353 | return value.remaining() > 0;
|
36354 |
|
36355 | case ProtoBuf.TYPES["enum"]:
|
36356 | return value !== 0;
|
36357 |
|
36358 | case ProtoBuf.TYPES["message"]:
|
36359 | return value !== null;
|
36360 | default:
|
36361 | return true;
|
36362 | }
|
36363 | };
|
36364 |
|
36365 | |
36366 |
|
36367 |
|
36368 |
|
36369 |
|
36370 |
|
36371 |
|
36372 |
|
36373 |
|
36374 | FieldPrototype.encode = function(value, buffer, message) {
|
36375 | if (this.type === null || typeof this.type !== 'object')
|
36376 | throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);
|
36377 | if (value === null || (this.repeated && value.length == 0))
|
36378 | return buffer;
|
36379 | try {
|
36380 | if (this.repeated) {
|
36381 | var i;
|
36382 |
|
36383 |
|
36384 | if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
|
36385 |
|
36386 |
|
36387 |
|
36388 | buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
36389 | buffer.ensureCapacity(buffer.offset += 1);
|
36390 | var start = buffer.offset;
|
36391 | for (i=0; i<value.length; i++)
|
36392 | this.element.encodeValue(this.id, value[i], buffer);
|
36393 | var len = buffer.offset-start,
|
36394 | varintLen = ByteBuffer.calculateVarint32(len);
|
36395 | if (varintLen > 1) {
|
36396 | var contents = buffer.slice(start, buffer.offset);
|
36397 | start += varintLen-1;
|
36398 | buffer.offset = start;
|
36399 | buffer.append(contents);
|
36400 | }
|
36401 | buffer.writeVarint32(len, start-varintLen);
|
36402 | } else {
|
36403 |
|
36404 |
|
36405 | for (i=0; i<value.length; i++)
|
36406 | buffer.writeVarint32((this.id << 3) | this.type.wireType),
|
36407 | this.element.encodeValue(this.id, value[i], buffer);
|
36408 | }
|
36409 | } else if (this.map) {
|
36410 |
|
36411 | value.forEach(function(val, key, m) {
|
36412 |
|
36413 | var length =
|
36414 | ByteBuffer.calculateVarint32((1 << 3) | this.keyType.wireType) +
|
36415 | this.keyElement.calculateLength(1, key) +
|
36416 | ByteBuffer.calculateVarint32((2 << 3) | this.type.wireType) +
|
36417 | this.element.calculateLength(2, val);
|
36418 |
|
36419 |
|
36420 | buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
36421 | buffer.writeVarint32(length);
|
36422 |
|
36423 |
|
36424 | buffer.writeVarint32((1 << 3) | this.keyType.wireType);
|
36425 | this.keyElement.encodeValue(1, key, buffer);
|
36426 | buffer.writeVarint32((2 << 3) | this.type.wireType);
|
36427 | this.element.encodeValue(2, val, buffer);
|
36428 | }, this);
|
36429 | } else {
|
36430 | if (this.hasWirePresence(value, message)) {
|
36431 | buffer.writeVarint32((this.id << 3) | this.type.wireType);
|
36432 | this.element.encodeValue(this.id, value, buffer);
|
36433 | }
|
36434 | }
|
36435 | } catch (e) {
|
36436 | throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");
|
36437 | }
|
36438 | return buffer;
|
36439 | };
|
36440 |
|
36441 | |
36442 |
|
36443 |
|
36444 |
|
36445 |
|
36446 |
|
36447 |
|
36448 | FieldPrototype.calculate = function(value, message) {
|
36449 | value = this.verifyValue(value);
|
36450 | if (this.type === null || typeof this.type !== 'object')
|
36451 | throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);
|
36452 | if (value === null || (this.repeated && value.length == 0))
|
36453 | return 0;
|
36454 | var n = 0;
|
36455 | try {
|
36456 | if (this.repeated) {
|
36457 | var i, ni;
|
36458 | if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
|
36459 | n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
36460 | ni = 0;
|
36461 | for (i=0; i<value.length; i++)
|
36462 | ni += this.element.calculateLength(this.id, value[i]);
|
36463 | n += ByteBuffer.calculateVarint32(ni);
|
36464 | n += ni;
|
36465 | } else {
|
36466 | for (i=0; i<value.length; i++)
|
36467 | n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType),
|
36468 | n += this.element.calculateLength(this.id, value[i]);
|
36469 | }
|
36470 | } else if (this.map) {
|
36471 |
|
36472 | value.forEach(function(val, key, m) {
|
36473 |
|
36474 | var length =
|
36475 | ByteBuffer.calculateVarint32((1 << 3) | this.keyType.wireType) +
|
36476 | this.keyElement.calculateLength(1, key) +
|
36477 | ByteBuffer.calculateVarint32((2 << 3) | this.type.wireType) +
|
36478 | this.element.calculateLength(2, val);
|
36479 |
|
36480 | n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
36481 | n += ByteBuffer.calculateVarint32(length);
|
36482 | n += length;
|
36483 | }, this);
|
36484 | } else {
|
36485 | if (this.hasWirePresence(value, message)) {
|
36486 | n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType);
|
36487 | n += this.element.calculateLength(this.id, value);
|
36488 | }
|
36489 | }
|
36490 | } catch (e) {
|
36491 | throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");
|
36492 | }
|
36493 | return n;
|
36494 | };
|
36495 |
|
36496 | |
36497 |
|
36498 |
|
36499 |
|
36500 |
|
36501 |
|
36502 |
|
36503 |
|
36504 |
|
36505 |
|
36506 | FieldPrototype.decode = function(wireType, buffer, skipRepeated) {
|
36507 | var value, nBytes;
|
36508 |
|
36509 |
|
36510 |
|
36511 | var wireTypeOK =
|
36512 | (!this.map && wireType == this.type.wireType) ||
|
36513 | (!skipRepeated && this.repeated && this.options["packed"] &&
|
36514 | wireType == ProtoBuf.WIRE_TYPES.LDELIM) ||
|
36515 | (this.map && wireType == ProtoBuf.WIRE_TYPES.LDELIM);
|
36516 | if (!wireTypeOK)
|
36517 | throw Error("Illegal wire type for field "+this.toString(true)+": "+wireType+" ("+this.type.wireType+" expected)");
|
36518 |
|
36519 |
|
36520 | if (wireType == ProtoBuf.WIRE_TYPES.LDELIM && this.repeated && this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
|
36521 | if (!skipRepeated) {
|
36522 | nBytes = buffer.readVarint32();
|
36523 | nBytes = buffer.offset + nBytes;
|
36524 | var values = [];
|
36525 | while (buffer.offset < nBytes)
|
36526 | values.push(this.decode(this.type.wireType, buffer, true));
|
36527 | return values;
|
36528 | }
|
36529 |
|
36530 | }
|
36531 |
|
36532 |
|
36533 | if (this.map) {
|
36534 |
|
36535 | var key = Element.defaultFieldValue(this.keyType);
|
36536 | value = Element.defaultFieldValue(this.type);
|
36537 |
|
36538 |
|
36539 | nBytes = buffer.readVarint32();
|
36540 | if (buffer.remaining() < nBytes)
|
36541 | throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());
|
36542 |
|
36543 |
|
36544 | var msgbuf = buffer.clone();
|
36545 | msgbuf.limit = msgbuf.offset + nBytes;
|
36546 | buffer.offset += nBytes;
|
36547 |
|
36548 | while (msgbuf.remaining() > 0) {
|
36549 | var tag = msgbuf.readVarint32();
|
36550 | wireType = tag & 0x07;
|
36551 | var id = tag >>> 3;
|
36552 | if (id === 1) {
|
36553 | key = this.keyElement.decode(msgbuf, wireType, id);
|
36554 | } else if (id === 2) {
|
36555 | value = this.element.decode(msgbuf, wireType, id);
|
36556 | } else {
|
36557 | throw Error("Unexpected tag in map field key/value submessage");
|
36558 | }
|
36559 | }
|
36560 |
|
36561 | return [key, value];
|
36562 | }
|
36563 |
|
36564 |
|
36565 | return this.element.decode(buffer, wireType, this.id);
|
36566 | };
|
36567 |
|
36568 | |
36569 |
|
36570 |
|
36571 |
|
36572 | Reflect.Message.Field = Field;
|
36573 |
|
36574 | |
36575 |
|
36576 |
|
36577 |
|
36578 |
|
36579 |
|
36580 |
|
36581 |
|
36582 |
|
36583 |
|
36584 |
|
36585 |
|
36586 |
|
36587 | var ExtensionField = function(builder, message, rule, type, name, id, options) {
|
36588 | Field.call(this, builder, message, rule, null, type, name, id, options);
|
36589 |
|
36590 | |
36591 |
|
36592 |
|
36593 |
|
36594 |
|
36595 | this.extension;
|
36596 | };
|
36597 |
|
36598 |
|
36599 | ExtensionField.prototype = Object.create(Field.prototype);
|
36600 |
|
36601 | |
36602 |
|
36603 |
|
36604 |
|
36605 | Reflect.Message.ExtensionField = ExtensionField;
|
36606 |
|
36607 | |
36608 |
|
36609 |
|
36610 |
|
36611 |
|
36612 |
|
36613 |
|
36614 |
|
36615 |
|
36616 | var OneOf = function(builder, message, name) {
|
36617 | T.call(this, builder, message, name);
|
36618 |
|
36619 | |
36620 |
|
36621 |
|
36622 |
|
36623 |
|
36624 | this.fields = [];
|
36625 | };
|
36626 |
|
36627 | |
36628 |
|
36629 |
|
36630 |
|
36631 | Reflect.Message.OneOf = OneOf;
|
36632 |
|
36633 | |
36634 |
|
36635 |
|
36636 |
|
36637 |
|
36638 |
|
36639 |
|
36640 |
|
36641 |
|
36642 |
|
36643 |
|
36644 | var Enum = function(builder, parent, name, options, syntax) {
|
36645 | Namespace.call(this, builder, parent, name, options, syntax);
|
36646 |
|
36647 | |
36648 |
|
36649 |
|
36650 | this.className = "Enum";
|
36651 |
|
36652 | |
36653 |
|
36654 |
|
36655 |
|
36656 |
|
36657 | this.object = null;
|
36658 | };
|
36659 |
|
36660 | |
36661 |
|
36662 |
|
36663 |
|
36664 |
|
36665 |
|
36666 |
|
36667 | Enum.getName = function(enm, value) {
|
36668 | var keys = Object.keys(enm);
|
36669 | for (var i=0, key; i<keys.length; ++i)
|
36670 | if (enm[key = keys[i]] === value)
|
36671 | return key;
|
36672 | return null;
|
36673 | };
|
36674 |
|
36675 | |
36676 |
|
36677 |
|
36678 |
|
36679 | var EnumPrototype = Enum.prototype = Object.create(Namespace.prototype);
|
36680 |
|
36681 | |
36682 |
|
36683 |
|
36684 |
|
36685 |
|
36686 |
|
36687 | EnumPrototype.build = function(rebuild) {
|
36688 | if (this.object && !rebuild)
|
36689 | return this.object;
|
36690 | var enm = new ProtoBuf.Builder.Enum(),
|
36691 | values = this.getChildren(Enum.Value);
|
36692 | for (var i=0, k=values.length; i<k; ++i)
|
36693 | enm[values[i]['name']] = values[i]['id'];
|
36694 | if (Object.defineProperty)
|
36695 | Object.defineProperty(enm, '$options', {
|
36696 | "value": this.buildOpt(),
|
36697 | "enumerable": false
|
36698 | });
|
36699 | return this.object = enm;
|
36700 | };
|
36701 |
|
36702 | |
36703 |
|
36704 |
|
36705 |
|
36706 | Reflect.Enum = Enum;
|
36707 |
|
36708 | |
36709 |
|
36710 |
|
36711 |
|
36712 |
|
36713 |
|
36714 |
|
36715 |
|
36716 |
|
36717 |
|
36718 | var Value = function(builder, enm, name, id) {
|
36719 | T.call(this, builder, enm, name);
|
36720 |
|
36721 | |
36722 |
|
36723 |
|
36724 | this.className = "Enum.Value";
|
36725 |
|
36726 | |
36727 |
|
36728 |
|
36729 |
|
36730 |
|
36731 | this.id = id;
|
36732 | };
|
36733 |
|
36734 |
|
36735 | Value.prototype = Object.create(T.prototype);
|
36736 |
|
36737 | |
36738 |
|
36739 |
|
36740 |
|
36741 | Reflect.Enum.Value = Value;
|
36742 |
|
36743 | |
36744 |
|
36745 |
|
36746 |
|
36747 |
|
36748 |
|
36749 |
|
36750 |
|
36751 |
|
36752 | var Extension = function(builder, parent, name, field) {
|
36753 | T.call(this, builder, parent, name);
|
36754 |
|
36755 | |
36756 |
|
36757 |
|
36758 |
|
36759 |
|
36760 | this.field = field;
|
36761 | };
|
36762 |
|
36763 |
|
36764 | Extension.prototype = Object.create(T.prototype);
|
36765 |
|
36766 | |
36767 |
|
36768 |
|
36769 |
|
36770 | Reflect.Extension = Extension;
|
36771 |
|
36772 | |
36773 |
|
36774 |
|
36775 |
|
36776 |
|
36777 |
|
36778 |
|
36779 |
|
36780 |
|
36781 |
|
36782 | var Service = function(builder, root, name, options) {
|
36783 | Namespace.call(this, builder, root, name, options);
|
36784 |
|
36785 | |
36786 |
|
36787 |
|
36788 | this.className = "Service";
|
36789 |
|
36790 | |
36791 |
|
36792 |
|
36793 |
|
36794 | this.clazz = null;
|
36795 | };
|
36796 |
|
36797 | |
36798 |
|
36799 |
|
36800 |
|
36801 | var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);
|
36802 |
|
36803 | |
36804 |
|
36805 |
|
36806 |
|
36807 |
|
36808 |
|
36809 |
|
36810 |
|
36811 | ServicePrototype.build = function(rebuild) {
|
36812 | if (this.clazz && !rebuild)
|
36813 | return this.clazz;
|
36814 |
|
36815 |
|
36816 | return this.clazz = (function(ProtoBuf, T) {
|
36817 |
|
36818 | |
36819 |
|
36820 |
|
36821 |
|
36822 |
|
36823 |
|
36824 |
|
36825 |
|
36826 | var Service = function(rpcImpl) {
|
36827 | ProtoBuf.Builder.Service.call(this);
|
36828 |
|
36829 | |
36830 |
|
36831 |
|
36832 |
|
36833 |
|
36834 |
|
36835 | this.rpcImpl = rpcImpl || function(name, msg, callback) {
|
36836 |
|
36837 |
|
36838 |
|
36839 | setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0);
|
36840 | };
|
36841 | };
|
36842 |
|
36843 | |
36844 |
|
36845 |
|
36846 |
|
36847 | var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);
|
36848 |
|
36849 | |
36850 |
|
36851 |
|
36852 |
|
36853 |
|
36854 |
|
36855 |
|
36856 |
|
36857 |
|
36858 |
|
36859 |
|
36860 | |
36861 |
|
36862 |
|
36863 |
|
36864 |
|
36865 |
|
36866 |
|
36867 |
|
36868 |
|
36869 |
|
36870 | var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);
|
36871 | for (var i=0; i<rpc.length; i++) {
|
36872 | (function(method) {
|
36873 |
|
36874 |
|
36875 | ServicePrototype[method.name] = function(req, callback) {
|
36876 | try {
|
36877 | try {
|
36878 |
|
36879 | req = method.resolvedRequestType.clazz.decode(ByteBuffer.wrap(req));
|
36880 | } catch (err) {
|
36881 | if (!(err instanceof TypeError))
|
36882 | throw err;
|
36883 | }
|
36884 | if (req === null || typeof req !== 'object')
|
36885 | throw Error("Illegal arguments");
|
36886 | if (!(req instanceof method.resolvedRequestType.clazz))
|
36887 | req = new method.resolvedRequestType.clazz(req);
|
36888 | this.rpcImpl(method.fqn(), req, function(err, res) {
|
36889 | if (err) {
|
36890 | callback(err);
|
36891 | return;
|
36892 | }
|
36893 |
|
36894 | if (res === null)
|
36895 | res = ''
|
36896 | try { res = method.resolvedResponseType.clazz.decode(res); } catch (notABuffer) {}
|
36897 | if (!res || !(res instanceof method.resolvedResponseType.clazz)) {
|
36898 | callback(Error("Illegal response type received in service method "+ T.name+"#"+method.name));
|
36899 | return;
|
36900 | }
|
36901 | callback(null, res);
|
36902 | });
|
36903 | } catch (err) {
|
36904 | setTimeout(callback.bind(this, err), 0);
|
36905 | }
|
36906 | };
|
36907 |
|
36908 |
|
36909 | Service[method.name] = function(rpcImpl, req, callback) {
|
36910 | new Service(rpcImpl)[method.name](req, callback);
|
36911 | };
|
36912 |
|
36913 | if (Object.defineProperty)
|
36914 | Object.defineProperty(Service[method.name], "$options", { "value": method.buildOpt() }),
|
36915 | Object.defineProperty(ServicePrototype[method.name], "$options", { "value": Service[method.name]["$options"] });
|
36916 | })(rpc[i]);
|
36917 | }
|
36918 |
|
36919 |
|
36920 |
|
36921 | |
36922 |
|
36923 |
|
36924 |
|
36925 |
|
36926 |
|
36927 | var $optionsS;
|
36928 |
|
36929 | |
36930 |
|
36931 |
|
36932 |
|
36933 |
|
36934 |
|
36935 | var $options;
|
36936 |
|
36937 | |
36938 |
|
36939 |
|
36940 |
|
36941 |
|
36942 |
|
36943 | var $typeS;
|
36944 |
|
36945 | |
36946 |
|
36947 |
|
36948 |
|
36949 |
|
36950 |
|
36951 | var $type;
|
36952 |
|
36953 | if (Object.defineProperty)
|
36954 | Object.defineProperty(Service, "$options", { "value": T.buildOpt() }),
|
36955 | Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }),
|
36956 | Object.defineProperty(Service, "$type", { "value": T }),
|
36957 | Object.defineProperty(ServicePrototype, "$type", { "value": T });
|
36958 |
|
36959 | return Service;
|
36960 |
|
36961 | })(ProtoBuf, this);
|
36962 | };
|
36963 |
|
36964 | |
36965 |
|
36966 |
|
36967 |
|
36968 | Reflect.Service = Service;
|
36969 |
|
36970 | |
36971 |
|
36972 |
|
36973 |
|
36974 |
|
36975 |
|
36976 |
|
36977 |
|
36978 |
|
36979 |
|
36980 | var Method = function(builder, svc, name, options) {
|
36981 | T.call(this, builder, svc, name);
|
36982 |
|
36983 | |
36984 |
|
36985 |
|
36986 | this.className = "Service.Method";
|
36987 |
|
36988 | |
36989 |
|
36990 |
|
36991 |
|
36992 |
|
36993 | this.options = options || {};
|
36994 | };
|
36995 |
|
36996 | |
36997 |
|
36998 |
|
36999 |
|
37000 | var MethodPrototype = Method.prototype = Object.create(T.prototype);
|
37001 |
|
37002 | |
37003 |
|
37004 |
|
37005 |
|
37006 |
|
37007 |
|
37008 | MethodPrototype.buildOpt = NamespacePrototype.buildOpt;
|
37009 |
|
37010 | |
37011 |
|
37012 |
|
37013 |
|
37014 | Reflect.Service.Method = Method;
|
37015 |
|
37016 | |
37017 |
|
37018 |
|
37019 |
|
37020 |
|
37021 |
|
37022 |
|
37023 |
|
37024 |
|
37025 |
|
37026 |
|
37027 |
|
37028 |
|
37029 |
|
37030 | var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {
|
37031 | Method.call(this, builder, svc, name, options);
|
37032 |
|
37033 | |
37034 |
|
37035 |
|
37036 | this.className = "Service.RPCMethod";
|
37037 |
|
37038 | |
37039 |
|
37040 |
|
37041 |
|
37042 |
|
37043 | this.requestName = request;
|
37044 |
|
37045 | |
37046 |
|
37047 |
|
37048 |
|
37049 |
|
37050 | this.responseName = response;
|
37051 |
|
37052 | |
37053 |
|
37054 |
|
37055 |
|
37056 |
|
37057 | this.requestStream = request_stream;
|
37058 |
|
37059 | |
37060 |
|
37061 |
|
37062 |
|
37063 |
|
37064 | this.responseStream = response_stream;
|
37065 |
|
37066 | |
37067 |
|
37068 |
|
37069 |
|
37070 |
|
37071 | this.resolvedRequestType = null;
|
37072 |
|
37073 | |
37074 |
|
37075 |
|
37076 |
|
37077 |
|
37078 | this.resolvedResponseType = null;
|
37079 | };
|
37080 |
|
37081 |
|
37082 | RPCMethod.prototype = Object.create(Method.prototype);
|
37083 |
|
37084 | |
37085 |
|
37086 |
|
37087 |
|
37088 | Reflect.Service.RPCMethod = RPCMethod;
|
37089 |
|
37090 | return Reflect;
|
37091 |
|
37092 | })(ProtoBuf);
|
37093 |
|
37094 | |
37095 |
|
37096 |
|
37097 |
|
37098 | ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {
|
37099 | "use strict";
|
37100 |
|
37101 | |
37102 |
|
37103 |
|
37104 |
|
37105 |
|
37106 |
|
37107 |
|
37108 | var Builder = function(options) {
|
37109 |
|
37110 | |
37111 |
|
37112 |
|
37113 |
|
37114 |
|
37115 | this.ns = new Reflect.Namespace(this, null, "");
|
37116 |
|
37117 | |
37118 |
|
37119 |
|
37120 |
|
37121 |
|
37122 | this.ptr = this.ns;
|
37123 |
|
37124 | |
37125 |
|
37126 |
|
37127 |
|
37128 |
|
37129 | this.resolved = false;
|
37130 |
|
37131 | |
37132 |
|
37133 |
|
37134 |
|
37135 |
|
37136 | this.result = null;
|
37137 |
|
37138 | |
37139 |
|
37140 |
|
37141 |
|
37142 |
|
37143 | this.files = {};
|
37144 |
|
37145 | |
37146 |
|
37147 |
|
37148 |
|
37149 |
|
37150 | this.importRoot = null;
|
37151 |
|
37152 | |
37153 |
|
37154 |
|
37155 |
|
37156 |
|
37157 | this.options = options || {};
|
37158 | };
|
37159 |
|
37160 | |
37161 |
|
37162 |
|
37163 |
|
37164 | var BuilderPrototype = Builder.prototype;
|
37165 |
|
37166 |
|
37167 |
|
37168 | |
37169 |
|
37170 |
|
37171 |
|
37172 |
|
37173 |
|
37174 | Builder.isMessage = function(def) {
|
37175 |
|
37176 | if (typeof def["name"] !== 'string')
|
37177 | return false;
|
37178 |
|
37179 | if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined')
|
37180 | return false;
|
37181 | return true;
|
37182 | };
|
37183 |
|
37184 | |
37185 |
|
37186 |
|
37187 |
|
37188 |
|
37189 |
|
37190 | Builder.isMessageField = function(def) {
|
37191 |
|
37192 | if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined')
|
37193 | return false;
|
37194 | return true;
|
37195 | };
|
37196 |
|
37197 | |
37198 |
|
37199 |
|
37200 |
|
37201 |
|
37202 |
|
37203 | Builder.isEnum = function(def) {
|
37204 |
|
37205 | if (typeof def["name"] !== 'string')
|
37206 | return false;
|
37207 |
|
37208 | if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0)
|
37209 | return false;
|
37210 | return true;
|
37211 | };
|
37212 |
|
37213 | |
37214 |
|
37215 |
|
37216 |
|
37217 |
|
37218 |
|
37219 | Builder.isService = function(def) {
|
37220 |
|
37221 | if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"])
|
37222 | return false;
|
37223 | return true;
|
37224 | };
|
37225 |
|
37226 | |
37227 |
|
37228 |
|
37229 |
|
37230 |
|
37231 |
|
37232 | Builder.isExtend = function(def) {
|
37233 |
|
37234 | if (typeof def["ref"] !== 'string')
|
37235 | return false;
|
37236 | return true;
|
37237 | };
|
37238 |
|
37239 |
|
37240 |
|
37241 | |
37242 |
|
37243 |
|
37244 |
|
37245 |
|
37246 | BuilderPrototype.reset = function() {
|
37247 | this.ptr = this.ns;
|
37248 | return this;
|
37249 | };
|
37250 |
|
37251 | |
37252 |
|
37253 |
|
37254 |
|
37255 |
|
37256 |
|
37257 | BuilderPrototype.define = function(namespace) {
|
37258 | if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))
|
37259 | throw Error("illegal namespace: "+namespace);
|
37260 | namespace.split(".").forEach(function(part) {
|
37261 | var ns = this.ptr.getChild(part);
|
37262 | if (ns === null)
|
37263 | this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));
|
37264 | this.ptr = ns;
|
37265 | }, this);
|
37266 | return this;
|
37267 | };
|
37268 |
|
37269 | |
37270 |
|
37271 |
|
37272 |
|
37273 |
|
37274 |
|
37275 |
|
37276 | BuilderPrototype.create = function(defs) {
|
37277 | if (!defs)
|
37278 | return this;
|
37279 | if (!Array.isArray(defs))
|
37280 | defs = [defs];
|
37281 | else {
|
37282 | if (defs.length === 0)
|
37283 | return this;
|
37284 | defs = defs.slice();
|
37285 | }
|
37286 |
|
37287 |
|
37288 | var stack = [defs];
|
37289 | while (stack.length > 0) {
|
37290 | defs = stack.pop();
|
37291 |
|
37292 | if (!Array.isArray(defs))
|
37293 | throw Error("not a valid namespace: "+JSON.stringify(defs));
|
37294 |
|
37295 | while (defs.length > 0) {
|
37296 | var def = defs.shift();
|
37297 |
|
37298 | if (Builder.isMessage(def)) {
|
37299 | var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]);
|
37300 |
|
37301 |
|
37302 | var oneofs = {};
|
37303 | if (def["oneofs"])
|
37304 | Object.keys(def["oneofs"]).forEach(function(name) {
|
37305 | obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));
|
37306 | }, this);
|
37307 |
|
37308 |
|
37309 | if (def["fields"])
|
37310 | def["fields"].forEach(function(fld) {
|
37311 | if (obj.getChild(fld["id"]|0) !== null)
|
37312 | throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']);
|
37313 | if (fld["options"] && typeof fld["options"] !== 'object')
|
37314 | throw Error("illegal field options in "+obj.name+"#"+fld["name"]);
|
37315 | var oneof = null;
|
37316 | if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]]))
|
37317 | throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]);
|
37318 | fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]);
|
37319 | if (oneof)
|
37320 | oneof.fields.push(fld);
|
37321 | obj.addChild(fld);
|
37322 | }, this);
|
37323 |
|
37324 |
|
37325 | var subObj = [];
|
37326 | if (def["enums"])
|
37327 | def["enums"].forEach(function(enm) {
|
37328 | subObj.push(enm);
|
37329 | });
|
37330 | if (def["messages"])
|
37331 | def["messages"].forEach(function(msg) {
|
37332 | subObj.push(msg);
|
37333 | });
|
37334 | if (def["services"])
|
37335 | def["services"].forEach(function(svc) {
|
37336 | subObj.push(svc);
|
37337 | });
|
37338 |
|
37339 |
|
37340 | if (def["extensions"]) {
|
37341 | if (typeof def["extensions"][0] === 'number')
|
37342 | obj.extensions = [ def["extensions"] ];
|
37343 | else
|
37344 | obj.extensions = def["extensions"];
|
37345 | }
|
37346 |
|
37347 |
|
37348 | this.ptr.addChild(obj);
|
37349 | if (subObj.length > 0) {
|
37350 | stack.push(defs);
|
37351 | defs = subObj;
|
37352 | subObj = null;
|
37353 | this.ptr = obj;
|
37354 | obj = null;
|
37355 | continue;
|
37356 | }
|
37357 | subObj = null;
|
37358 |
|
37359 | } else if (Builder.isEnum(def)) {
|
37360 |
|
37361 | obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]);
|
37362 | def["values"].forEach(function(val) {
|
37363 | obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"]));
|
37364 | }, this);
|
37365 | this.ptr.addChild(obj);
|
37366 |
|
37367 | } else if (Builder.isService(def)) {
|
37368 |
|
37369 | obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]);
|
37370 | Object.keys(def["rpc"]).forEach(function(name) {
|
37371 | var mtd = def["rpc"][name];
|
37372 | obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"]));
|
37373 | }, this);
|
37374 | this.ptr.addChild(obj);
|
37375 |
|
37376 | } else if (Builder.isExtend(def)) {
|
37377 |
|
37378 | obj = this.ptr.resolve(def["ref"], true);
|
37379 | if (obj) {
|
37380 | def["fields"].forEach(function(fld) {
|
37381 | if (obj.getChild(fld['id']|0) !== null)
|
37382 | throw Error("duplicate extended field id in "+obj.name+": "+fld['id']);
|
37383 |
|
37384 | if (obj.extensions) {
|
37385 | var valid = false;
|
37386 | obj.extensions.forEach(function(range) {
|
37387 | if (fld["id"] >= range[0] && fld["id"] <= range[1])
|
37388 | valid = true;
|
37389 | });
|
37390 | if (!valid)
|
37391 | throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)");
|
37392 | }
|
37393 |
|
37394 | var name = fld["name"];
|
37395 | if (this.options['convertFieldsToCamelCase'])
|
37396 | name = ProtoBuf.Util.toCamelCase(name);
|
37397 |
|
37398 | var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]);
|
37399 |
|
37400 |
|
37401 |
|
37402 | var ext = new Reflect.Extension(this, this.ptr, fld["name"], field);
|
37403 | field.extension = ext;
|
37404 | this.ptr.addChild(ext);
|
37405 | obj.addChild(field);
|
37406 | }, this);
|
37407 |
|
37408 | } else if (!/\.?google\.protobuf\./.test(def["ref"]))
|
37409 | throw Error("extended message "+def["ref"]+" is not defined");
|
37410 |
|
37411 | } else
|
37412 | throw Error("not a valid definition: "+JSON.stringify(def));
|
37413 |
|
37414 | def = null;
|
37415 | obj = null;
|
37416 | }
|
37417 |
|
37418 | defs = null;
|
37419 | this.ptr = this.ptr.parent;
|
37420 | }
|
37421 | this.resolved = false;
|
37422 | this.result = null;
|
37423 | return this;
|
37424 | };
|
37425 |
|
37426 | |
37427 |
|
37428 |
|
37429 |
|
37430 |
|
37431 | function propagateSyntax(parent) {
|
37432 | if (parent['messages']) {
|
37433 | parent['messages'].forEach(function(child) {
|
37434 | child["syntax"] = parent["syntax"];
|
37435 | propagateSyntax(child);
|
37436 | });
|
37437 | }
|
37438 | if (parent['enums']) {
|
37439 | parent['enums'].forEach(function(child) {
|
37440 | child["syntax"] = parent["syntax"];
|
37441 | });
|
37442 | }
|
37443 | }
|
37444 |
|
37445 | |
37446 |
|
37447 |
|
37448 |
|
37449 |
|
37450 |
|
37451 |
|
37452 |
|
37453 | BuilderPrototype["import"] = function(json, filename) {
|
37454 | var delim = '/';
|
37455 |
|
37456 |
|
37457 |
|
37458 | if (typeof filename === 'string') {
|
37459 |
|
37460 | if (ProtoBuf.Util.IS_NODE)
|
37461 | filename = __webpack_require__(118)['resolve'](filename);
|
37462 | if (this.files[filename] === true)
|
37463 | return this.reset();
|
37464 | this.files[filename] = true;
|
37465 |
|
37466 | } else if (typeof filename === 'object') {
|
37467 |
|
37468 | var root = filename.root;
|
37469 | if (ProtoBuf.Util.IS_NODE)
|
37470 | root = __webpack_require__(118)['resolve'](root);
|
37471 | if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0)
|
37472 | delim = '\\';
|
37473 | var fname;
|
37474 | if (ProtoBuf.Util.IS_NODE)
|
37475 | fname = __webpack_require__(118)['join'](root, filename.file);
|
37476 | else
|
37477 | fname = root + delim + filename.file;
|
37478 | if (this.files[fname] === true)
|
37479 | return this.reset();
|
37480 | this.files[fname] = true;
|
37481 | }
|
37482 |
|
37483 |
|
37484 |
|
37485 | if (json['imports'] && json['imports'].length > 0) {
|
37486 | var importRoot,
|
37487 | resetRoot = false;
|
37488 |
|
37489 | if (typeof filename === 'object') {
|
37490 |
|
37491 | this.importRoot = filename["root"]; resetRoot = true;
|
37492 | importRoot = this.importRoot;
|
37493 | filename = filename["file"];
|
37494 | if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0)
|
37495 | delim = '\\';
|
37496 |
|
37497 | } else if (typeof filename === 'string') {
|
37498 |
|
37499 | if (this.importRoot)
|
37500 | importRoot = this.importRoot;
|
37501 | else {
|
37502 | if (filename.indexOf("/") >= 0) {
|
37503 | importRoot = filename.replace(/\/[^\/]*$/, "");
|
37504 | if ( importRoot === "")
|
37505 | importRoot = "/";
|
37506 | } else if (filename.indexOf("\\") >= 0) {
|
37507 | importRoot = filename.replace(/\\[^\\]*$/, "");
|
37508 | delim = '\\';
|
37509 | } else
|
37510 | importRoot = ".";
|
37511 | }
|
37512 |
|
37513 | } else
|
37514 | importRoot = null;
|
37515 |
|
37516 | for (var i=0; i<json['imports'].length; i++) {
|
37517 | if (typeof json['imports'][i] === 'string') {
|
37518 | if (!importRoot)
|
37519 | throw Error("cannot determine import root");
|
37520 | var importFilename = json['imports'][i];
|
37521 | if (importFilename === "google/protobuf/descriptor.proto")
|
37522 | continue;
|
37523 | if (ProtoBuf.Util.IS_NODE)
|
37524 | importFilename = __webpack_require__(118)['join'](importRoot, importFilename);
|
37525 | else
|
37526 | importFilename = importRoot + delim + importFilename;
|
37527 | if (this.files[importFilename] === true)
|
37528 | continue;
|
37529 | if (/\.proto$/i.test(importFilename) && !ProtoBuf.DotProto)
|
37530 | importFilename = importFilename.replace(/\.proto$/, ".json");
|
37531 | var contents = ProtoBuf.Util.fetch(importFilename);
|
37532 | if (contents === null)
|
37533 | throw Error("failed to import '"+importFilename+"' in '"+filename+"': file not found");
|
37534 | if (/\.json$/i.test(importFilename))
|
37535 | this["import"](JSON.parse(contents+""), importFilename);
|
37536 | else
|
37537 | this["import"](ProtoBuf.DotProto.Parser.parse(contents), importFilename);
|
37538 | } else
|
37539 | if (!filename)
|
37540 | this["import"](json['imports'][i]);
|
37541 | else if (/\.(\w+)$/.test(filename))
|
37542 | this["import"](json['imports'][i], filename.replace(/^(.+)\.(\w+)$/, function($0, $1, $2) { return $1+"_import"+i+"."+$2; }));
|
37543 | else
|
37544 | this["import"](json['imports'][i], filename+"_import"+i);
|
37545 | }
|
37546 | if (resetRoot)
|
37547 | this.importRoot = null;
|
37548 | }
|
37549 |
|
37550 |
|
37551 |
|
37552 | if (json['package'])
|
37553 | this.define(json['package']);
|
37554 | if (json['syntax'])
|
37555 | propagateSyntax(json);
|
37556 | var base = this.ptr;
|
37557 | if (json['options'])
|
37558 | Object.keys(json['options']).forEach(function(key) {
|
37559 | base.options[key] = json['options'][key];
|
37560 | });
|
37561 | if (json['messages'])
|
37562 | this.create(json['messages']),
|
37563 | this.ptr = base;
|
37564 | if (json['enums'])
|
37565 | this.create(json['enums']),
|
37566 | this.ptr = base;
|
37567 | if (json['services'])
|
37568 | this.create(json['services']),
|
37569 | this.ptr = base;
|
37570 | if (json['extends'])
|
37571 | this.create(json['extends']);
|
37572 |
|
37573 | return this.reset();
|
37574 | };
|
37575 |
|
37576 | |
37577 |
|
37578 |
|
37579 |
|
37580 |
|
37581 |
|
37582 | BuilderPrototype.resolveAll = function() {
|
37583 |
|
37584 | var res;
|
37585 | if (this.ptr == null || typeof this.ptr.type === 'object')
|
37586 | return this;
|
37587 |
|
37588 | if (this.ptr instanceof Reflect.Namespace) {
|
37589 |
|
37590 | this.ptr.children.forEach(function(child) {
|
37591 | this.ptr = child;
|
37592 | this.resolveAll();
|
37593 | }, this);
|
37594 |
|
37595 | } else if (this.ptr instanceof Reflect.Message.Field) {
|
37596 |
|
37597 | if (!Lang.TYPE.test(this.ptr.type)) {
|
37598 | if (!Lang.TYPEREF.test(this.ptr.type))
|
37599 | throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
|
37600 | res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, true);
|
37601 | if (!res)
|
37602 | throw Error("unresolvable type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
|
37603 | this.ptr.resolvedType = res;
|
37604 | if (res instanceof Reflect.Enum) {
|
37605 | this.ptr.type = ProtoBuf.TYPES["enum"];
|
37606 | if (this.ptr.syntax === 'proto3' && res.syntax !== 'proto3')
|
37607 | throw Error("proto3 message cannot reference proto2 enum");
|
37608 | }
|
37609 | else if (res instanceof Reflect.Message)
|
37610 | this.ptr.type = res.isGroup ? ProtoBuf.TYPES["group"] : ProtoBuf.TYPES["message"];
|
37611 | else
|
37612 | throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
|
37613 | } else
|
37614 | this.ptr.type = ProtoBuf.TYPES[this.ptr.type];
|
37615 |
|
37616 |
|
37617 |
|
37618 | if (this.ptr.map) {
|
37619 | if (!Lang.TYPE.test(this.ptr.keyType))
|
37620 | throw Error("illegal key type for map field in "+this.ptr.toString(true)+": "+this.ptr.keyType);
|
37621 | this.ptr.keyType = ProtoBuf.TYPES[this.ptr.keyType];
|
37622 | }
|
37623 |
|
37624 |
|
37625 |
|
37626 | if (
|
37627 | this.ptr.syntax === 'proto3' &&
|
37628 | this.ptr.repeated && this.ptr.options.packed === undefined &&
|
37629 | ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) !== -1
|
37630 | ) {
|
37631 | this.ptr.options.packed = true;
|
37632 | }
|
37633 |
|
37634 | } else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) {
|
37635 |
|
37636 | if (this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod) {
|
37637 | res = this.ptr.parent.resolve(this.ptr.requestName, true);
|
37638 | if (!res || !(res instanceof ProtoBuf.Reflect.Message))
|
37639 | throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.requestName);
|
37640 | this.ptr.resolvedRequestType = res;
|
37641 | res = this.ptr.parent.resolve(this.ptr.responseName, true);
|
37642 | if (!res || !(res instanceof ProtoBuf.Reflect.Message))
|
37643 | throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.responseName);
|
37644 | this.ptr.resolvedResponseType = res;
|
37645 | } else
|
37646 | throw Error("illegal service type in "+this.ptr.toString(true));
|
37647 |
|
37648 | } else if (
|
37649 | !(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf) &&
|
37650 | !(this.ptr instanceof ProtoBuf.Reflect.Extension) &&
|
37651 | !(this.ptr instanceof ProtoBuf.Reflect.Enum.Value)
|
37652 | )
|
37653 | throw Error("illegal object in namespace: "+typeof(this.ptr)+": "+this.ptr);
|
37654 |
|
37655 | return this.reset();
|
37656 | };
|
37657 |
|
37658 | |
37659 |
|
37660 |
|
37661 |
|
37662 |
|
37663 |
|
37664 |
|
37665 |
|
37666 | BuilderPrototype.build = function(path) {
|
37667 | this.reset();
|
37668 | if (!this.resolved)
|
37669 | this.resolveAll(),
|
37670 | this.resolved = true,
|
37671 | this.result = null;
|
37672 | if (this.result === null)
|
37673 | this.result = this.ns.build();
|
37674 | if (!path)
|
37675 | return this.result;
|
37676 | var part = typeof path === 'string' ? path.split(".") : path,
|
37677 | ptr = this.result;
|
37678 | for (var i=0; i<part.length; i++)
|
37679 | if (ptr[part[i]])
|
37680 | ptr = ptr[part[i]];
|
37681 | else {
|
37682 | ptr = null;
|
37683 | break;
|
37684 | }
|
37685 | return ptr;
|
37686 | };
|
37687 |
|
37688 | |
37689 |
|
37690 |
|
37691 |
|
37692 |
|
37693 |
|
37694 | BuilderPrototype.lookup = function(path, excludeNonNamespace) {
|
37695 | return path ? this.ns.resolve(path, excludeNonNamespace) : this.ns;
|
37696 | };
|
37697 |
|
37698 | |
37699 |
|
37700 |
|
37701 |
|
37702 |
|
37703 | BuilderPrototype.toString = function() {
|
37704 | return "Builder";
|
37705 | };
|
37706 |
|
37707 |
|
37708 |
|
37709 |
|
37710 | |
37711 |
|
37712 |
|
37713 | Builder.Message = function() {};
|
37714 |
|
37715 | |
37716 |
|
37717 |
|
37718 | Builder.Enum = function() {};
|
37719 |
|
37720 | |
37721 |
|
37722 |
|
37723 | Builder.Service = function() {};
|
37724 |
|
37725 | return Builder;
|
37726 |
|
37727 | })(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect);
|
37728 |
|
37729 | |
37730 |
|
37731 |
|
37732 |
|
37733 | ProtoBuf.Map = (function(ProtoBuf, Reflect) {
|
37734 | "use strict";
|
37735 |
|
37736 | |
37737 |
|
37738 |
|
37739 |
|
37740 |
|
37741 |
|
37742 |
|
37743 |
|
37744 |
|
37745 |
|
37746 |
|
37747 | var Map = function(field, contents) {
|
37748 | if (!field.map)
|
37749 | throw Error("field is not a map");
|
37750 |
|
37751 | |
37752 |
|
37753 |
|
37754 |
|
37755 | this.field = field;
|
37756 |
|
37757 | |
37758 |
|
37759 |
|
37760 |
|
37761 | this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);
|
37762 |
|
37763 | |
37764 |
|
37765 |
|
37766 |
|
37767 | this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);
|
37768 |
|
37769 | |
37770 |
|
37771 |
|
37772 |
|
37773 |
|
37774 |
|
37775 |
|
37776 |
|
37777 |
|
37778 |
|
37779 |
|
37780 |
|
37781 |
|
37782 |
|
37783 | this.map = {};
|
37784 |
|
37785 | |
37786 |
|
37787 |
|
37788 | Object.defineProperty(this, "size", {
|
37789 | get: function() { return Object.keys(this.map).length; }
|
37790 | });
|
37791 |
|
37792 |
|
37793 | if (contents) {
|
37794 | var keys = Object.keys(contents);
|
37795 | for (var i = 0; i < keys.length; i++) {
|
37796 | var key = this.keyElem.valueFromString(keys[i]);
|
37797 | var val = this.valueElem.verifyValue(contents[keys[i]]);
|
37798 | this.map[this.keyElem.valueToString(key)] =
|
37799 | { key: key, value: val };
|
37800 | }
|
37801 | }
|
37802 | };
|
37803 |
|
37804 | var MapPrototype = Map.prototype;
|
37805 |
|
37806 | |
37807 |
|
37808 |
|
37809 |
|
37810 |
|
37811 |
|
37812 | function arrayIterator(arr) {
|
37813 | var idx = 0;
|
37814 | return {
|
37815 | next: function() {
|
37816 | if (idx < arr.length)
|
37817 | return { done: false, value: arr[idx++] };
|
37818 | return { done: true };
|
37819 | }
|
37820 | }
|
37821 | }
|
37822 |
|
37823 | |
37824 |
|
37825 |
|
37826 | MapPrototype.clear = function() {
|
37827 | this.map = {};
|
37828 | };
|
37829 |
|
37830 | |
37831 |
|
37832 |
|
37833 |
|
37834 | MapPrototype["delete"] = function(key) {
|
37835 | var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
|
37836 | var hadKey = keyValue in this.map;
|
37837 | delete this.map[keyValue];
|
37838 | return hadKey;
|
37839 | };
|
37840 |
|
37841 | |
37842 |
|
37843 |
|
37844 |
|
37845 | MapPrototype.entries = function() {
|
37846 | var entries = [];
|
37847 | var strKeys = Object.keys(this.map);
|
37848 | for (var i = 0, entry; i < strKeys.length; i++)
|
37849 | entries.push([(entry=this.map[strKeys[i]]).key, entry.value]);
|
37850 | return arrayIterator(entries);
|
37851 | };
|
37852 |
|
37853 | |
37854 |
|
37855 |
|
37856 |
|
37857 | MapPrototype.keys = function() {
|
37858 | var keys = [];
|
37859 | var strKeys = Object.keys(this.map);
|
37860 | for (var i = 0; i < strKeys.length; i++)
|
37861 | keys.push(this.map[strKeys[i]].key);
|
37862 | return arrayIterator(keys);
|
37863 | };
|
37864 |
|
37865 | |
37866 |
|
37867 |
|
37868 |
|
37869 | MapPrototype.values = function() {
|
37870 | var values = [];
|
37871 | var strKeys = Object.keys(this.map);
|
37872 | for (var i = 0; i < strKeys.length; i++)
|
37873 | values.push(this.map[strKeys[i]].value);
|
37874 | return arrayIterator(values);
|
37875 | };
|
37876 |
|
37877 | |
37878 |
|
37879 |
|
37880 |
|
37881 |
|
37882 | MapPrototype.forEach = function(cb, thisArg) {
|
37883 | var strKeys = Object.keys(this.map);
|
37884 | for (var i = 0, entry; i < strKeys.length; i++)
|
37885 | cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this);
|
37886 | };
|
37887 |
|
37888 | |
37889 |
|
37890 |
|
37891 |
|
37892 |
|
37893 |
|
37894 | MapPrototype.set = function(key, value) {
|
37895 | var keyValue = this.keyElem.verifyValue(key);
|
37896 | var valValue = this.valueElem.verifyValue(value);
|
37897 | this.map[this.keyElem.valueToString(keyValue)] =
|
37898 | { key: keyValue, value: valValue };
|
37899 | return this;
|
37900 | };
|
37901 |
|
37902 | |
37903 |
|
37904 |
|
37905 |
|
37906 |
|
37907 | MapPrototype.get = function(key) {
|
37908 | var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
|
37909 | if (!(keyValue in this.map))
|
37910 | return undefined;
|
37911 | return this.map[keyValue].value;
|
37912 | };
|
37913 |
|
37914 | |
37915 |
|
37916 |
|
37917 |
|
37918 |
|
37919 | MapPrototype.has = function(key) {
|
37920 | var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
|
37921 | return (keyValue in this.map);
|
37922 | };
|
37923 |
|
37924 | return Map;
|
37925 | })(ProtoBuf, ProtoBuf.Reflect);
|
37926 |
|
37927 |
|
37928 | |
37929 |
|
37930 |
|
37931 |
|
37932 |
|
37933 |
|
37934 | ProtoBuf.newBuilder = function(options) {
|
37935 | options = options || {};
|
37936 | if (typeof options['convertFieldsToCamelCase'] === 'undefined')
|
37937 | options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;
|
37938 | if (typeof options['populateAccessors'] === 'undefined')
|
37939 | options['populateAccessors'] = ProtoBuf.populateAccessors;
|
37940 | return new ProtoBuf.Builder(options);
|
37941 | };
|
37942 |
|
37943 | |
37944 |
|
37945 |
|
37946 |
|
37947 |
|
37948 |
|
37949 |
|
37950 |
|
37951 |
|
37952 | ProtoBuf.loadJson = function(json, builder, filename) {
|
37953 | if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string'))
|
37954 | filename = builder,
|
37955 | builder = null;
|
37956 | if (!builder || typeof builder !== 'object')
|
37957 | builder = ProtoBuf.newBuilder();
|
37958 | if (typeof json === 'string')
|
37959 | json = JSON.parse(json);
|
37960 | builder["import"](json, filename);
|
37961 | builder.resolveAll();
|
37962 | return builder;
|
37963 | };
|
37964 |
|
37965 | |
37966 |
|
37967 |
|
37968 |
|
37969 |
|
37970 |
|
37971 |
|
37972 |
|
37973 |
|
37974 |
|
37975 |
|
37976 |
|
37977 | ProtoBuf.loadJsonFile = function(filename, callback, builder) {
|
37978 | if (callback && typeof callback === 'object')
|
37979 | builder = callback,
|
37980 | callback = null;
|
37981 | else if (!callback || typeof callback !== 'function')
|
37982 | callback = null;
|
37983 | if (callback)
|
37984 | return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {
|
37985 | if (contents === null) {
|
37986 | callback(Error("Failed to fetch file"));
|
37987 | return;
|
37988 | }
|
37989 | try {
|
37990 | callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));
|
37991 | } catch (e) {
|
37992 | callback(e);
|
37993 | }
|
37994 | });
|
37995 | var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);
|
37996 | return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);
|
37997 | };
|
37998 |
|
37999 | return ProtoBuf;
|
38000 | });
|
38001 |
|
38002 |
|
38003 | }),
|
38004 |
|
38005 | (function(module, exports, __webpack_require__) {
|
38006 |
|
38007 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
38008 |
|
38009 |
|
38010 |
|
38011 |
|
38012 |
|
38013 |
|
38014 |
|
38015 |
|
38016 |
|
38017 |
|
38018 |
|
38019 |
|
38020 |
|
38021 |
|
38022 |
|
38023 |
|
38024 |
|
38025 |
|
38026 |
|
38027 |
|
38028 |
|
38029 | (function(global, factory) {
|
38030 |
|
38031 | if (true)
|
38032 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(654)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
38033 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
38034 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
38035 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
38036 | else if (typeof require === 'function' && typeof module === "object" && module && module["exports"])
|
38037 | module['exports'] = (function() {
|
38038 | var Long; try { Long = require("long"); } catch (e) {}
|
38039 | return factory(Long);
|
38040 | })();
|
38041 | else
|
38042 | (global["dcodeIO"] = global["dcodeIO"] || {})["ByteBuffer"] = factory(global["dcodeIO"]["Long"]);
|
38043 |
|
38044 | })(this, function(Long) {
|
38045 | "use strict";
|
38046 |
|
38047 | |
38048 |
|
38049 |
|
38050 |
|
38051 |
|
38052 |
|
38053 |
|
38054 |
|
38055 |
|
38056 |
|
38057 |
|
38058 |
|
38059 | var ByteBuffer = function(capacity, littleEndian, noAssert) {
|
38060 | if (typeof capacity === 'undefined')
|
38061 | capacity = ByteBuffer.DEFAULT_CAPACITY;
|
38062 | if (typeof littleEndian === 'undefined')
|
38063 | littleEndian = ByteBuffer.DEFAULT_ENDIAN;
|
38064 | if (typeof noAssert === 'undefined')
|
38065 | noAssert = ByteBuffer.DEFAULT_NOASSERT;
|
38066 | if (!noAssert) {
|
38067 | capacity = capacity | 0;
|
38068 | if (capacity < 0)
|
38069 | throw RangeError("Illegal capacity");
|
38070 | littleEndian = !!littleEndian;
|
38071 | noAssert = !!noAssert;
|
38072 | }
|
38073 |
|
38074 | |
38075 |
|
38076 |
|
38077 |
|
38078 |
|
38079 | this.buffer = capacity === 0 ? EMPTY_BUFFER : new ArrayBuffer(capacity);
|
38080 |
|
38081 | |
38082 |
|
38083 |
|
38084 |
|
38085 |
|
38086 | this.view = capacity === 0 ? null : new Uint8Array(this.buffer);
|
38087 |
|
38088 | |
38089 |
|
38090 |
|
38091 |
|
38092 |
|
38093 |
|
38094 |
|
38095 | this.offset = 0;
|
38096 |
|
38097 | |
38098 |
|
38099 |
|
38100 |
|
38101 |
|
38102 |
|
38103 |
|
38104 | this.markedOffset = -1;
|
38105 |
|
38106 | |
38107 |
|
38108 |
|
38109 |
|
38110 |
|
38111 |
|
38112 |
|
38113 | this.limit = capacity;
|
38114 |
|
38115 | |
38116 |
|
38117 |
|
38118 |
|
38119 |
|
38120 | this.littleEndian = littleEndian;
|
38121 |
|
38122 | |
38123 |
|
38124 |
|
38125 |
|
38126 |
|
38127 | this.noAssert = noAssert;
|
38128 | };
|
38129 |
|
38130 | |
38131 |
|
38132 |
|
38133 |
|
38134 |
|
38135 |
|
38136 | ByteBuffer.VERSION = "5.0.1";
|
38137 |
|
38138 | |
38139 |
|
38140 |
|
38141 |
|
38142 |
|
38143 |
|
38144 | ByteBuffer.LITTLE_ENDIAN = true;
|
38145 |
|
38146 | |
38147 |
|
38148 |
|
38149 |
|
38150 |
|
38151 |
|
38152 | ByteBuffer.BIG_ENDIAN = false;
|
38153 |
|
38154 | |
38155 |
|
38156 |
|
38157 |
|
38158 |
|
38159 | ByteBuffer.DEFAULT_CAPACITY = 16;
|
38160 |
|
38161 | |
38162 |
|
38163 |
|
38164 |
|
38165 |
|
38166 | ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN;
|
38167 |
|
38168 | |
38169 |
|
38170 |
|
38171 |
|
38172 |
|
38173 | ByteBuffer.DEFAULT_NOASSERT = false;
|
38174 |
|
38175 | |
38176 |
|
38177 |
|
38178 |
|
38179 |
|
38180 |
|
38181 |
|
38182 |
|
38183 | ByteBuffer.Long = Long || null;
|
38184 |
|
38185 | |
38186 |
|
38187 |
|
38188 |
|
38189 | var ByteBufferPrototype = ByteBuffer.prototype;
|
38190 |
|
38191 | |
38192 |
|
38193 |
|
38194 |
|
38195 |
|
38196 |
|
38197 |
|
38198 | ByteBufferPrototype.__isByteBuffer__;
|
38199 |
|
38200 | Object.defineProperty(ByteBufferPrototype, "__isByteBuffer__", {
|
38201 | value: true,
|
38202 | enumerable: false,
|
38203 | configurable: false
|
38204 | });
|
38205 |
|
38206 |
|
38207 |
|
38208 | |
38209 |
|
38210 |
|
38211 |
|
38212 | var EMPTY_BUFFER = new ArrayBuffer(0);
|
38213 |
|
38214 | |
38215 |
|
38216 |
|
38217 |
|
38218 |
|
38219 | var stringFromCharCode = String.fromCharCode;
|
38220 |
|
38221 | |
38222 |
|
38223 |
|
38224 |
|
38225 |
|
38226 |
|
38227 |
|
38228 |
|
38229 | function stringSource(s) {
|
38230 | var i=0; return function() {
|
38231 | return i < s.length ? s.charCodeAt(i++) : null;
|
38232 | };
|
38233 | }
|
38234 |
|
38235 | |
38236 |
|
38237 |
|
38238 |
|
38239 |
|
38240 |
|
38241 | function stringDestination() {
|
38242 | var cs = [], ps = []; return function() {
|
38243 | if (arguments.length === 0)
|
38244 | return ps.join('')+stringFromCharCode.apply(String, cs);
|
38245 | if (cs.length + arguments.length > 1024)
|
38246 | ps.push(stringFromCharCode.apply(String, cs)),
|
38247 | cs.length = 0;
|
38248 | Array.prototype.push.apply(cs, arguments);
|
38249 | };
|
38250 | }
|
38251 |
|
38252 | |
38253 |
|
38254 |
|
38255 |
|
38256 |
|
38257 | ByteBuffer.accessor = function() {
|
38258 | return Uint8Array;
|
38259 | };
|
38260 | |
38261 |
|
38262 |
|
38263 |
|
38264 |
|
38265 |
|
38266 |
|
38267 |
|
38268 |
|
38269 |
|
38270 | ByteBuffer.allocate = function(capacity, littleEndian, noAssert) {
|
38271 | return new ByteBuffer(capacity, littleEndian, noAssert);
|
38272 | };
|
38273 |
|
38274 | |
38275 |
|
38276 |
|
38277 |
|
38278 |
|
38279 |
|
38280 |
|
38281 |
|
38282 |
|
38283 |
|
38284 |
|
38285 |
|
38286 | ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) {
|
38287 | if (typeof encoding === 'boolean' || typeof encoding !== 'string') {
|
38288 | noAssert = littleEndian;
|
38289 | littleEndian = encoding;
|
38290 | encoding = undefined;
|
38291 | }
|
38292 | var capacity = 0;
|
38293 | for (var i=0, k=buffers.length, length; i<k; ++i) {
|
38294 | if (!ByteBuffer.isByteBuffer(buffers[i]))
|
38295 | buffers[i] = ByteBuffer.wrap(buffers[i], encoding);
|
38296 | length = buffers[i].limit - buffers[i].offset;
|
38297 | if (length > 0) capacity += length;
|
38298 | }
|
38299 | if (capacity === 0)
|
38300 | return new ByteBuffer(0, littleEndian, noAssert);
|
38301 | var bb = new ByteBuffer(capacity, littleEndian, noAssert),
|
38302 | bi;
|
38303 | i=0; while (i<k) {
|
38304 | bi = buffers[i++];
|
38305 | length = bi.limit - bi.offset;
|
38306 | if (length <= 0) continue;
|
38307 | bb.view.set(bi.view.subarray(bi.offset, bi.limit), bb.offset);
|
38308 | bb.offset += length;
|
38309 | }
|
38310 | bb.limit = bb.offset;
|
38311 | bb.offset = 0;
|
38312 | return bb;
|
38313 | };
|
38314 |
|
38315 | |
38316 |
|
38317 |
|
38318 |
|
38319 |
|
38320 |
|
38321 | ByteBuffer.isByteBuffer = function(bb) {
|
38322 | return (bb && bb["__isByteBuffer__"]) === true;
|
38323 | };
|
38324 | |
38325 |
|
38326 |
|
38327 |
|
38328 |
|
38329 | ByteBuffer.type = function() {
|
38330 | return ArrayBuffer;
|
38331 | };
|
38332 | |
38333 |
|
38334 |
|
38335 |
|
38336 |
|
38337 |
|
38338 |
|
38339 |
|
38340 |
|
38341 |
|
38342 |
|
38343 |
|
38344 |
|
38345 | ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) {
|
38346 | if (typeof encoding !== 'string') {
|
38347 | noAssert = littleEndian;
|
38348 | littleEndian = encoding;
|
38349 | encoding = undefined;
|
38350 | }
|
38351 | if (typeof buffer === 'string') {
|
38352 | if (typeof encoding === 'undefined')
|
38353 | encoding = "utf8";
|
38354 | switch (encoding) {
|
38355 | case "base64":
|
38356 | return ByteBuffer.fromBase64(buffer, littleEndian);
|
38357 | case "hex":
|
38358 | return ByteBuffer.fromHex(buffer, littleEndian);
|
38359 | case "binary":
|
38360 | return ByteBuffer.fromBinary(buffer, littleEndian);
|
38361 | case "utf8":
|
38362 | return ByteBuffer.fromUTF8(buffer, littleEndian);
|
38363 | case "debug":
|
38364 | return ByteBuffer.fromDebug(buffer, littleEndian);
|
38365 | default:
|
38366 | throw Error("Unsupported encoding: "+encoding);
|
38367 | }
|
38368 | }
|
38369 | if (buffer === null || typeof buffer !== 'object')
|
38370 | throw TypeError("Illegal buffer");
|
38371 | var bb;
|
38372 | if (ByteBuffer.isByteBuffer(buffer)) {
|
38373 | bb = ByteBufferPrototype.clone.call(buffer);
|
38374 | bb.markedOffset = -1;
|
38375 | return bb;
|
38376 | }
|
38377 | if (buffer instanceof Uint8Array) {
|
38378 | bb = new ByteBuffer(0, littleEndian, noAssert);
|
38379 | if (buffer.length > 0) {
|
38380 | bb.buffer = buffer.buffer;
|
38381 | bb.offset = buffer.byteOffset;
|
38382 | bb.limit = buffer.byteOffset + buffer.byteLength;
|
38383 | bb.view = new Uint8Array(buffer.buffer);
|
38384 | }
|
38385 | } else if (buffer instanceof ArrayBuffer) {
|
38386 | bb = new ByteBuffer(0, littleEndian, noAssert);
|
38387 | if (buffer.byteLength > 0) {
|
38388 | bb.buffer = buffer;
|
38389 | bb.offset = 0;
|
38390 | bb.limit = buffer.byteLength;
|
38391 | bb.view = buffer.byteLength > 0 ? new Uint8Array(buffer) : null;
|
38392 | }
|
38393 | } else if (Object.prototype.toString.call(buffer) === "[object Array]") {
|
38394 | bb = new ByteBuffer(buffer.length, littleEndian, noAssert);
|
38395 | bb.limit = buffer.length;
|
38396 | for (var i=0; i<buffer.length; ++i)
|
38397 | bb.view[i] = buffer[i];
|
38398 | } else
|
38399 | throw TypeError("Illegal buffer");
|
38400 | return bb;
|
38401 | };
|
38402 |
|
38403 | |
38404 |
|
38405 |
|
38406 |
|
38407 |
|
38408 |
|
38409 |
|
38410 | ByteBufferPrototype.writeBitSet = function(value, offset) {
|
38411 | var relative = typeof offset === 'undefined';
|
38412 | if (relative) offset = this.offset;
|
38413 | if (!this.noAssert) {
|
38414 | if (!(value instanceof Array))
|
38415 | throw TypeError("Illegal BitSet: Not an array");
|
38416 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38417 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38418 | offset >>>= 0;
|
38419 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38420 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38421 | }
|
38422 |
|
38423 | var start = offset,
|
38424 | bits = value.length,
|
38425 | bytes = (bits >> 3),
|
38426 | bit = 0,
|
38427 | k;
|
38428 |
|
38429 | offset += this.writeVarint32(bits,offset);
|
38430 |
|
38431 | while(bytes--) {
|
38432 | k = (!!value[bit++] & 1) |
|
38433 | ((!!value[bit++] & 1) << 1) |
|
38434 | ((!!value[bit++] & 1) << 2) |
|
38435 | ((!!value[bit++] & 1) << 3) |
|
38436 | ((!!value[bit++] & 1) << 4) |
|
38437 | ((!!value[bit++] & 1) << 5) |
|
38438 | ((!!value[bit++] & 1) << 6) |
|
38439 | ((!!value[bit++] & 1) << 7);
|
38440 | this.writeByte(k,offset++);
|
38441 | }
|
38442 |
|
38443 | if(bit < bits) {
|
38444 | var m = 0; k = 0;
|
38445 | while(bit < bits) k = k | ((!!value[bit++] & 1) << (m++));
|
38446 | this.writeByte(k,offset++);
|
38447 | }
|
38448 |
|
38449 | if (relative) {
|
38450 | this.offset = offset;
|
38451 | return this;
|
38452 | }
|
38453 | return offset - start;
|
38454 | }
|
38455 |
|
38456 | |
38457 |
|
38458 |
|
38459 |
|
38460 |
|
38461 |
|
38462 | ByteBufferPrototype.readBitSet = function(offset) {
|
38463 | var relative = typeof offset === 'undefined';
|
38464 | if (relative) offset = this.offset;
|
38465 |
|
38466 | var ret = this.readVarint32(offset),
|
38467 | bits = ret.value,
|
38468 | bytes = (bits >> 3),
|
38469 | bit = 0,
|
38470 | value = [],
|
38471 | k;
|
38472 |
|
38473 | offset += ret.length;
|
38474 |
|
38475 | while(bytes--) {
|
38476 | k = this.readByte(offset++);
|
38477 | value[bit++] = !!(k & 0x01);
|
38478 | value[bit++] = !!(k & 0x02);
|
38479 | value[bit++] = !!(k & 0x04);
|
38480 | value[bit++] = !!(k & 0x08);
|
38481 | value[bit++] = !!(k & 0x10);
|
38482 | value[bit++] = !!(k & 0x20);
|
38483 | value[bit++] = !!(k & 0x40);
|
38484 | value[bit++] = !!(k & 0x80);
|
38485 | }
|
38486 |
|
38487 | if(bit < bits) {
|
38488 | var m = 0;
|
38489 | k = this.readByte(offset++);
|
38490 | while(bit < bits) value[bit++] = !!((k >> (m++)) & 1);
|
38491 | }
|
38492 |
|
38493 | if (relative) {
|
38494 | this.offset = offset;
|
38495 | }
|
38496 | return value;
|
38497 | }
|
38498 | |
38499 |
|
38500 |
|
38501 |
|
38502 |
|
38503 |
|
38504 |
|
38505 | ByteBufferPrototype.readBytes = function(length, offset) {
|
38506 | var relative = typeof offset === 'undefined';
|
38507 | if (relative) offset = this.offset;
|
38508 | if (!this.noAssert) {
|
38509 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38510 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38511 | offset >>>= 0;
|
38512 | if (offset < 0 || offset + length > this.buffer.byteLength)
|
38513 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength);
|
38514 | }
|
38515 | var slice = this.slice(offset, offset + length);
|
38516 | if (relative) this.offset += length;
|
38517 | return slice;
|
38518 | };
|
38519 |
|
38520 | |
38521 |
|
38522 |
|
38523 |
|
38524 |
|
38525 |
|
38526 |
|
38527 |
|
38528 |
|
38529 |
|
38530 |
|
38531 | ByteBufferPrototype.writeBytes = ByteBufferPrototype.append;
|
38532 |
|
38533 |
|
38534 |
|
38535 | |
38536 |
|
38537 |
|
38538 |
|
38539 |
|
38540 |
|
38541 |
|
38542 | ByteBufferPrototype.writeInt8 = function(value, offset) {
|
38543 | var relative = typeof offset === 'undefined';
|
38544 | if (relative) offset = this.offset;
|
38545 | if (!this.noAssert) {
|
38546 | if (typeof value !== 'number' || value % 1 !== 0)
|
38547 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38548 | value |= 0;
|
38549 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38550 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38551 | offset >>>= 0;
|
38552 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38553 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38554 | }
|
38555 | offset += 1;
|
38556 | var capacity0 = this.buffer.byteLength;
|
38557 | if (offset > capacity0)
|
38558 | this.resize((capacity0 *= 2) > offset ? capacity0 : offset);
|
38559 | offset -= 1;
|
38560 | this.view[offset] = value;
|
38561 | if (relative) this.offset += 1;
|
38562 | return this;
|
38563 | };
|
38564 |
|
38565 | |
38566 |
|
38567 |
|
38568 |
|
38569 |
|
38570 |
|
38571 |
|
38572 |
|
38573 | ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8;
|
38574 |
|
38575 | |
38576 |
|
38577 |
|
38578 |
|
38579 |
|
38580 |
|
38581 | ByteBufferPrototype.readInt8 = function(offset) {
|
38582 | var relative = typeof offset === 'undefined';
|
38583 | if (relative) offset = this.offset;
|
38584 | if (!this.noAssert) {
|
38585 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38586 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38587 | offset >>>= 0;
|
38588 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
38589 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
38590 | }
|
38591 | var value = this.view[offset];
|
38592 | if ((value & 0x80) === 0x80) value = -(0xFF - value + 1);
|
38593 | if (relative) this.offset += 1;
|
38594 | return value;
|
38595 | };
|
38596 |
|
38597 | |
38598 |
|
38599 |
|
38600 |
|
38601 |
|
38602 |
|
38603 |
|
38604 | ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8;
|
38605 |
|
38606 | |
38607 |
|
38608 |
|
38609 |
|
38610 |
|
38611 |
|
38612 |
|
38613 | ByteBufferPrototype.writeUint8 = function(value, offset) {
|
38614 | var relative = typeof offset === 'undefined';
|
38615 | if (relative) offset = this.offset;
|
38616 | if (!this.noAssert) {
|
38617 | if (typeof value !== 'number' || value % 1 !== 0)
|
38618 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38619 | value >>>= 0;
|
38620 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38621 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38622 | offset >>>= 0;
|
38623 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38624 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38625 | }
|
38626 | offset += 1;
|
38627 | var capacity1 = this.buffer.byteLength;
|
38628 | if (offset > capacity1)
|
38629 | this.resize((capacity1 *= 2) > offset ? capacity1 : offset);
|
38630 | offset -= 1;
|
38631 | this.view[offset] = value;
|
38632 | if (relative) this.offset += 1;
|
38633 | return this;
|
38634 | };
|
38635 |
|
38636 | |
38637 |
|
38638 |
|
38639 |
|
38640 |
|
38641 |
|
38642 |
|
38643 |
|
38644 | ByteBufferPrototype.writeUInt8 = ByteBufferPrototype.writeUint8;
|
38645 |
|
38646 | |
38647 |
|
38648 |
|
38649 |
|
38650 |
|
38651 |
|
38652 | ByteBufferPrototype.readUint8 = function(offset) {
|
38653 | var relative = typeof offset === 'undefined';
|
38654 | if (relative) offset = this.offset;
|
38655 | if (!this.noAssert) {
|
38656 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38657 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38658 | offset >>>= 0;
|
38659 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
38660 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
38661 | }
|
38662 | var value = this.view[offset];
|
38663 | if (relative) this.offset += 1;
|
38664 | return value;
|
38665 | };
|
38666 |
|
38667 | |
38668 |
|
38669 |
|
38670 |
|
38671 |
|
38672 |
|
38673 |
|
38674 | ByteBufferPrototype.readUInt8 = ByteBufferPrototype.readUint8;
|
38675 |
|
38676 |
|
38677 |
|
38678 | |
38679 |
|
38680 |
|
38681 |
|
38682 |
|
38683 |
|
38684 |
|
38685 |
|
38686 | ByteBufferPrototype.writeInt16 = function(value, offset) {
|
38687 | var relative = typeof offset === 'undefined';
|
38688 | if (relative) offset = this.offset;
|
38689 | if (!this.noAssert) {
|
38690 | if (typeof value !== 'number' || value % 1 !== 0)
|
38691 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38692 | value |= 0;
|
38693 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38694 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38695 | offset >>>= 0;
|
38696 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38697 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38698 | }
|
38699 | offset += 2;
|
38700 | var capacity2 = this.buffer.byteLength;
|
38701 | if (offset > capacity2)
|
38702 | this.resize((capacity2 *= 2) > offset ? capacity2 : offset);
|
38703 | offset -= 2;
|
38704 | if (this.littleEndian) {
|
38705 | this.view[offset+1] = (value & 0xFF00) >>> 8;
|
38706 | this.view[offset ] = value & 0x00FF;
|
38707 | } else {
|
38708 | this.view[offset] = (value & 0xFF00) >>> 8;
|
38709 | this.view[offset+1] = value & 0x00FF;
|
38710 | }
|
38711 | if (relative) this.offset += 2;
|
38712 | return this;
|
38713 | };
|
38714 |
|
38715 | |
38716 |
|
38717 |
|
38718 |
|
38719 |
|
38720 |
|
38721 |
|
38722 |
|
38723 |
|
38724 | ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16;
|
38725 |
|
38726 | |
38727 |
|
38728 |
|
38729 |
|
38730 |
|
38731 |
|
38732 |
|
38733 |
|
38734 | ByteBufferPrototype.readInt16 = function(offset) {
|
38735 | var relative = typeof offset === 'undefined';
|
38736 | if (relative) offset = this.offset;
|
38737 | if (!this.noAssert) {
|
38738 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38739 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38740 | offset >>>= 0;
|
38741 | if (offset < 0 || offset + 2 > this.buffer.byteLength)
|
38742 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength);
|
38743 | }
|
38744 | var value = 0;
|
38745 | if (this.littleEndian) {
|
38746 | value = this.view[offset ];
|
38747 | value |= this.view[offset+1] << 8;
|
38748 | } else {
|
38749 | value = this.view[offset ] << 8;
|
38750 | value |= this.view[offset+1];
|
38751 | }
|
38752 | if ((value & 0x8000) === 0x8000) value = -(0xFFFF - value + 1);
|
38753 | if (relative) this.offset += 2;
|
38754 | return value;
|
38755 | };
|
38756 |
|
38757 | |
38758 |
|
38759 |
|
38760 |
|
38761 |
|
38762 |
|
38763 |
|
38764 |
|
38765 |
|
38766 | ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16;
|
38767 |
|
38768 | |
38769 |
|
38770 |
|
38771 |
|
38772 |
|
38773 |
|
38774 |
|
38775 |
|
38776 | ByteBufferPrototype.writeUint16 = function(value, offset) {
|
38777 | var relative = typeof offset === 'undefined';
|
38778 | if (relative) offset = this.offset;
|
38779 | if (!this.noAssert) {
|
38780 | if (typeof value !== 'number' || value % 1 !== 0)
|
38781 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38782 | value >>>= 0;
|
38783 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38784 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38785 | offset >>>= 0;
|
38786 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38787 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38788 | }
|
38789 | offset += 2;
|
38790 | var capacity3 = this.buffer.byteLength;
|
38791 | if (offset > capacity3)
|
38792 | this.resize((capacity3 *= 2) > offset ? capacity3 : offset);
|
38793 | offset -= 2;
|
38794 | if (this.littleEndian) {
|
38795 | this.view[offset+1] = (value & 0xFF00) >>> 8;
|
38796 | this.view[offset ] = value & 0x00FF;
|
38797 | } else {
|
38798 | this.view[offset] = (value & 0xFF00) >>> 8;
|
38799 | this.view[offset+1] = value & 0x00FF;
|
38800 | }
|
38801 | if (relative) this.offset += 2;
|
38802 | return this;
|
38803 | };
|
38804 |
|
38805 | |
38806 |
|
38807 |
|
38808 |
|
38809 |
|
38810 |
|
38811 |
|
38812 |
|
38813 |
|
38814 | ByteBufferPrototype.writeUInt16 = ByteBufferPrototype.writeUint16;
|
38815 |
|
38816 | |
38817 |
|
38818 |
|
38819 |
|
38820 |
|
38821 |
|
38822 |
|
38823 |
|
38824 | ByteBufferPrototype.readUint16 = function(offset) {
|
38825 | var relative = typeof offset === 'undefined';
|
38826 | if (relative) offset = this.offset;
|
38827 | if (!this.noAssert) {
|
38828 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38829 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38830 | offset >>>= 0;
|
38831 | if (offset < 0 || offset + 2 > this.buffer.byteLength)
|
38832 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength);
|
38833 | }
|
38834 | var value = 0;
|
38835 | if (this.littleEndian) {
|
38836 | value = this.view[offset ];
|
38837 | value |= this.view[offset+1] << 8;
|
38838 | } else {
|
38839 | value = this.view[offset ] << 8;
|
38840 | value |= this.view[offset+1];
|
38841 | }
|
38842 | if (relative) this.offset += 2;
|
38843 | return value;
|
38844 | };
|
38845 |
|
38846 | |
38847 |
|
38848 |
|
38849 |
|
38850 |
|
38851 |
|
38852 |
|
38853 |
|
38854 |
|
38855 | ByteBufferPrototype.readUInt16 = ByteBufferPrototype.readUint16;
|
38856 |
|
38857 |
|
38858 |
|
38859 | |
38860 |
|
38861 |
|
38862 |
|
38863 |
|
38864 |
|
38865 | ByteBufferPrototype.writeInt32 = function(value, offset) {
|
38866 | var relative = typeof offset === 'undefined';
|
38867 | if (relative) offset = this.offset;
|
38868 | if (!this.noAssert) {
|
38869 | if (typeof value !== 'number' || value % 1 !== 0)
|
38870 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38871 | value |= 0;
|
38872 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38873 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38874 | offset >>>= 0;
|
38875 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38876 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38877 | }
|
38878 | offset += 4;
|
38879 | var capacity4 = this.buffer.byteLength;
|
38880 | if (offset > capacity4)
|
38881 | this.resize((capacity4 *= 2) > offset ? capacity4 : offset);
|
38882 | offset -= 4;
|
38883 | if (this.littleEndian) {
|
38884 | this.view[offset+3] = (value >>> 24) & 0xFF;
|
38885 | this.view[offset+2] = (value >>> 16) & 0xFF;
|
38886 | this.view[offset+1] = (value >>> 8) & 0xFF;
|
38887 | this.view[offset ] = value & 0xFF;
|
38888 | } else {
|
38889 | this.view[offset ] = (value >>> 24) & 0xFF;
|
38890 | this.view[offset+1] = (value >>> 16) & 0xFF;
|
38891 | this.view[offset+2] = (value >>> 8) & 0xFF;
|
38892 | this.view[offset+3] = value & 0xFF;
|
38893 | }
|
38894 | if (relative) this.offset += 4;
|
38895 | return this;
|
38896 | };
|
38897 |
|
38898 | |
38899 |
|
38900 |
|
38901 |
|
38902 |
|
38903 |
|
38904 | ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32;
|
38905 |
|
38906 | |
38907 |
|
38908 |
|
38909 |
|
38910 |
|
38911 |
|
38912 | ByteBufferPrototype.readInt32 = function(offset) {
|
38913 | var relative = typeof offset === 'undefined';
|
38914 | if (relative) offset = this.offset;
|
38915 | if (!this.noAssert) {
|
38916 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38917 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38918 | offset >>>= 0;
|
38919 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
38920 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
38921 | }
|
38922 | var value = 0;
|
38923 | if (this.littleEndian) {
|
38924 | value = this.view[offset+2] << 16;
|
38925 | value |= this.view[offset+1] << 8;
|
38926 | value |= this.view[offset ];
|
38927 | value += this.view[offset+3] << 24 >>> 0;
|
38928 | } else {
|
38929 | value = this.view[offset+1] << 16;
|
38930 | value |= this.view[offset+2] << 8;
|
38931 | value |= this.view[offset+3];
|
38932 | value += this.view[offset ] << 24 >>> 0;
|
38933 | }
|
38934 | value |= 0;
|
38935 | if (relative) this.offset += 4;
|
38936 | return value;
|
38937 | };
|
38938 |
|
38939 | |
38940 |
|
38941 |
|
38942 |
|
38943 |
|
38944 |
|
38945 | ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32;
|
38946 |
|
38947 | |
38948 |
|
38949 |
|
38950 |
|
38951 |
|
38952 |
|
38953 | ByteBufferPrototype.writeUint32 = function(value, offset) {
|
38954 | var relative = typeof offset === 'undefined';
|
38955 | if (relative) offset = this.offset;
|
38956 | if (!this.noAssert) {
|
38957 | if (typeof value !== 'number' || value % 1 !== 0)
|
38958 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38959 | value >>>= 0;
|
38960 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38961 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38962 | offset >>>= 0;
|
38963 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38964 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38965 | }
|
38966 | offset += 4;
|
38967 | var capacity5 = this.buffer.byteLength;
|
38968 | if (offset > capacity5)
|
38969 | this.resize((capacity5 *= 2) > offset ? capacity5 : offset);
|
38970 | offset -= 4;
|
38971 | if (this.littleEndian) {
|
38972 | this.view[offset+3] = (value >>> 24) & 0xFF;
|
38973 | this.view[offset+2] = (value >>> 16) & 0xFF;
|
38974 | this.view[offset+1] = (value >>> 8) & 0xFF;
|
38975 | this.view[offset ] = value & 0xFF;
|
38976 | } else {
|
38977 | this.view[offset ] = (value >>> 24) & 0xFF;
|
38978 | this.view[offset+1] = (value >>> 16) & 0xFF;
|
38979 | this.view[offset+2] = (value >>> 8) & 0xFF;
|
38980 | this.view[offset+3] = value & 0xFF;
|
38981 | }
|
38982 | if (relative) this.offset += 4;
|
38983 | return this;
|
38984 | };
|
38985 |
|
38986 | |
38987 |
|
38988 |
|
38989 |
|
38990 |
|
38991 |
|
38992 |
|
38993 | ByteBufferPrototype.writeUInt32 = ByteBufferPrototype.writeUint32;
|
38994 |
|
38995 | |
38996 |
|
38997 |
|
38998 |
|
38999 |
|
39000 |
|
39001 | ByteBufferPrototype.readUint32 = function(offset) {
|
39002 | var relative = typeof offset === 'undefined';
|
39003 | if (relative) offset = this.offset;
|
39004 | if (!this.noAssert) {
|
39005 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39006 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39007 | offset >>>= 0;
|
39008 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
39009 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
39010 | }
|
39011 | var value = 0;
|
39012 | if (this.littleEndian) {
|
39013 | value = this.view[offset+2] << 16;
|
39014 | value |= this.view[offset+1] << 8;
|
39015 | value |= this.view[offset ];
|
39016 | value += this.view[offset+3] << 24 >>> 0;
|
39017 | } else {
|
39018 | value = this.view[offset+1] << 16;
|
39019 | value |= this.view[offset+2] << 8;
|
39020 | value |= this.view[offset+3];
|
39021 | value += this.view[offset ] << 24 >>> 0;
|
39022 | }
|
39023 | if (relative) this.offset += 4;
|
39024 | return value;
|
39025 | };
|
39026 |
|
39027 | |
39028 |
|
39029 |
|
39030 |
|
39031 |
|
39032 |
|
39033 |
|
39034 | ByteBufferPrototype.readUInt32 = ByteBufferPrototype.readUint32;
|
39035 |
|
39036 |
|
39037 |
|
39038 | if (Long) {
|
39039 |
|
39040 | |
39041 |
|
39042 |
|
39043 |
|
39044 |
|
39045 |
|
39046 |
|
39047 | ByteBufferPrototype.writeInt64 = function(value, offset) {
|
39048 | var relative = typeof offset === 'undefined';
|
39049 | if (relative) offset = this.offset;
|
39050 | if (!this.noAssert) {
|
39051 | if (typeof value === 'number')
|
39052 | value = Long.fromNumber(value);
|
39053 | else if (typeof value === 'string')
|
39054 | value = Long.fromString(value);
|
39055 | else if (!(value && value instanceof Long))
|
39056 | throw TypeError("Illegal value: "+value+" (not an integer or Long)");
|
39057 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39058 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39059 | offset >>>= 0;
|
39060 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39061 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39062 | }
|
39063 | if (typeof value === 'number')
|
39064 | value = Long.fromNumber(value);
|
39065 | else if (typeof value === 'string')
|
39066 | value = Long.fromString(value);
|
39067 | offset += 8;
|
39068 | var capacity6 = this.buffer.byteLength;
|
39069 | if (offset > capacity6)
|
39070 | this.resize((capacity6 *= 2) > offset ? capacity6 : offset);
|
39071 | offset -= 8;
|
39072 | var lo = value.low,
|
39073 | hi = value.high;
|
39074 | if (this.littleEndian) {
|
39075 | this.view[offset+3] = (lo >>> 24) & 0xFF;
|
39076 | this.view[offset+2] = (lo >>> 16) & 0xFF;
|
39077 | this.view[offset+1] = (lo >>> 8) & 0xFF;
|
39078 | this.view[offset ] = lo & 0xFF;
|
39079 | offset += 4;
|
39080 | this.view[offset+3] = (hi >>> 24) & 0xFF;
|
39081 | this.view[offset+2] = (hi >>> 16) & 0xFF;
|
39082 | this.view[offset+1] = (hi >>> 8) & 0xFF;
|
39083 | this.view[offset ] = hi & 0xFF;
|
39084 | } else {
|
39085 | this.view[offset ] = (hi >>> 24) & 0xFF;
|
39086 | this.view[offset+1] = (hi >>> 16) & 0xFF;
|
39087 | this.view[offset+2] = (hi >>> 8) & 0xFF;
|
39088 | this.view[offset+3] = hi & 0xFF;
|
39089 | offset += 4;
|
39090 | this.view[offset ] = (lo >>> 24) & 0xFF;
|
39091 | this.view[offset+1] = (lo >>> 16) & 0xFF;
|
39092 | this.view[offset+2] = (lo >>> 8) & 0xFF;
|
39093 | this.view[offset+3] = lo & 0xFF;
|
39094 | }
|
39095 | if (relative) this.offset += 8;
|
39096 | return this;
|
39097 | };
|
39098 |
|
39099 | |
39100 |
|
39101 |
|
39102 |
|
39103 |
|
39104 |
|
39105 |
|
39106 | ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64;
|
39107 |
|
39108 | |
39109 |
|
39110 |
|
39111 |
|
39112 |
|
39113 |
|
39114 | ByteBufferPrototype.readInt64 = function(offset) {
|
39115 | var relative = typeof offset === 'undefined';
|
39116 | if (relative) offset = this.offset;
|
39117 | if (!this.noAssert) {
|
39118 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39119 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39120 | offset >>>= 0;
|
39121 | if (offset < 0 || offset + 8 > this.buffer.byteLength)
|
39122 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
|
39123 | }
|
39124 | var lo = 0,
|
39125 | hi = 0;
|
39126 | if (this.littleEndian) {
|
39127 | lo = this.view[offset+2] << 16;
|
39128 | lo |= this.view[offset+1] << 8;
|
39129 | lo |= this.view[offset ];
|
39130 | lo += this.view[offset+3] << 24 >>> 0;
|
39131 | offset += 4;
|
39132 | hi = this.view[offset+2] << 16;
|
39133 | hi |= this.view[offset+1] << 8;
|
39134 | hi |= this.view[offset ];
|
39135 | hi += this.view[offset+3] << 24 >>> 0;
|
39136 | } else {
|
39137 | hi = this.view[offset+1] << 16;
|
39138 | hi |= this.view[offset+2] << 8;
|
39139 | hi |= this.view[offset+3];
|
39140 | hi += this.view[offset ] << 24 >>> 0;
|
39141 | offset += 4;
|
39142 | lo = this.view[offset+1] << 16;
|
39143 | lo |= this.view[offset+2] << 8;
|
39144 | lo |= this.view[offset+3];
|
39145 | lo += this.view[offset ] << 24 >>> 0;
|
39146 | }
|
39147 | var value = new Long(lo, hi, false);
|
39148 | if (relative) this.offset += 8;
|
39149 | return value;
|
39150 | };
|
39151 |
|
39152 | |
39153 |
|
39154 |
|
39155 |
|
39156 |
|
39157 |
|
39158 | ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64;
|
39159 |
|
39160 | |
39161 |
|
39162 |
|
39163 |
|
39164 |
|
39165 |
|
39166 |
|
39167 | ByteBufferPrototype.writeUint64 = function(value, offset) {
|
39168 | var relative = typeof offset === 'undefined';
|
39169 | if (relative) offset = this.offset;
|
39170 | if (!this.noAssert) {
|
39171 | if (typeof value === 'number')
|
39172 | value = Long.fromNumber(value);
|
39173 | else if (typeof value === 'string')
|
39174 | value = Long.fromString(value);
|
39175 | else if (!(value && value instanceof Long))
|
39176 | throw TypeError("Illegal value: "+value+" (not an integer or Long)");
|
39177 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39178 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39179 | offset >>>= 0;
|
39180 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39181 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39182 | }
|
39183 | if (typeof value === 'number')
|
39184 | value = Long.fromNumber(value);
|
39185 | else if (typeof value === 'string')
|
39186 | value = Long.fromString(value);
|
39187 | offset += 8;
|
39188 | var capacity7 = this.buffer.byteLength;
|
39189 | if (offset > capacity7)
|
39190 | this.resize((capacity7 *= 2) > offset ? capacity7 : offset);
|
39191 | offset -= 8;
|
39192 | var lo = value.low,
|
39193 | hi = value.high;
|
39194 | if (this.littleEndian) {
|
39195 | this.view[offset+3] = (lo >>> 24) & 0xFF;
|
39196 | this.view[offset+2] = (lo >>> 16) & 0xFF;
|
39197 | this.view[offset+1] = (lo >>> 8) & 0xFF;
|
39198 | this.view[offset ] = lo & 0xFF;
|
39199 | offset += 4;
|
39200 | this.view[offset+3] = (hi >>> 24) & 0xFF;
|
39201 | this.view[offset+2] = (hi >>> 16) & 0xFF;
|
39202 | this.view[offset+1] = (hi >>> 8) & 0xFF;
|
39203 | this.view[offset ] = hi & 0xFF;
|
39204 | } else {
|
39205 | this.view[offset ] = (hi >>> 24) & 0xFF;
|
39206 | this.view[offset+1] = (hi >>> 16) & 0xFF;
|
39207 | this.view[offset+2] = (hi >>> 8) & 0xFF;
|
39208 | this.view[offset+3] = hi & 0xFF;
|
39209 | offset += 4;
|
39210 | this.view[offset ] = (lo >>> 24) & 0xFF;
|
39211 | this.view[offset+1] = (lo >>> 16) & 0xFF;
|
39212 | this.view[offset+2] = (lo >>> 8) & 0xFF;
|
39213 | this.view[offset+3] = lo & 0xFF;
|
39214 | }
|
39215 | if (relative) this.offset += 8;
|
39216 | return this;
|
39217 | };
|
39218 |
|
39219 | |
39220 |
|
39221 |
|
39222 |
|
39223 |
|
39224 |
|
39225 |
|
39226 |
|
39227 | ByteBufferPrototype.writeUInt64 = ByteBufferPrototype.writeUint64;
|
39228 |
|
39229 | |
39230 |
|
39231 |
|
39232 |
|
39233 |
|
39234 |
|
39235 | ByteBufferPrototype.readUint64 = function(offset) {
|
39236 | var relative = typeof offset === 'undefined';
|
39237 | if (relative) offset = this.offset;
|
39238 | if (!this.noAssert) {
|
39239 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39240 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39241 | offset >>>= 0;
|
39242 | if (offset < 0 || offset + 8 > this.buffer.byteLength)
|
39243 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
|
39244 | }
|
39245 | var lo = 0,
|
39246 | hi = 0;
|
39247 | if (this.littleEndian) {
|
39248 | lo = this.view[offset+2] << 16;
|
39249 | lo |= this.view[offset+1] << 8;
|
39250 | lo |= this.view[offset ];
|
39251 | lo += this.view[offset+3] << 24 >>> 0;
|
39252 | offset += 4;
|
39253 | hi = this.view[offset+2] << 16;
|
39254 | hi |= this.view[offset+1] << 8;
|
39255 | hi |= this.view[offset ];
|
39256 | hi += this.view[offset+3] << 24 >>> 0;
|
39257 | } else {
|
39258 | hi = this.view[offset+1] << 16;
|
39259 | hi |= this.view[offset+2] << 8;
|
39260 | hi |= this.view[offset+3];
|
39261 | hi += this.view[offset ] << 24 >>> 0;
|
39262 | offset += 4;
|
39263 | lo = this.view[offset+1] << 16;
|
39264 | lo |= this.view[offset+2] << 8;
|
39265 | lo |= this.view[offset+3];
|
39266 | lo += this.view[offset ] << 24 >>> 0;
|
39267 | }
|
39268 | var value = new Long(lo, hi, true);
|
39269 | if (relative) this.offset += 8;
|
39270 | return value;
|
39271 | };
|
39272 |
|
39273 | |
39274 |
|
39275 |
|
39276 |
|
39277 |
|
39278 |
|
39279 |
|
39280 | ByteBufferPrototype.readUInt64 = ByteBufferPrototype.readUint64;
|
39281 |
|
39282 | }
|
39283 |
|
39284 |
|
39285 |
|
39286 |
|
39287 | |
39288 |
|
39289 |
|
39290 |
|
39291 |
|
39292 |
|
39293 |
|
39294 |
|
39295 |
|
39296 |
|
39297 |
|
39298 |
|
39299 |
|
39300 |
|
39301 |
|
39302 |
|
39303 |
|
39304 |
|
39305 |
|
39306 |
|
39307 |
|
39308 |
|
39309 |
|
39310 |
|
39311 |
|
39312 |
|
39313 | |
39314 |
|
39315 |
|
39316 |
|
39317 |
|
39318 |
|
39319 |
|
39320 |
|
39321 |
|
39322 |
|
39323 | function ieee754_read(buffer, offset, isLE, mLen, nBytes) {
|
39324 | var e, m,
|
39325 | eLen = nBytes * 8 - mLen - 1,
|
39326 | eMax = (1 << eLen) - 1,
|
39327 | eBias = eMax >> 1,
|
39328 | nBits = -7,
|
39329 | i = isLE ? (nBytes - 1) : 0,
|
39330 | d = isLE ? -1 : 1,
|
39331 | s = buffer[offset + i];
|
39332 |
|
39333 | i += d;
|
39334 |
|
39335 | e = s & ((1 << (-nBits)) - 1);
|
39336 | s >>= (-nBits);
|
39337 | nBits += eLen;
|
39338 | for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
|
39339 |
|
39340 | m = e & ((1 << (-nBits)) - 1);
|
39341 | e >>= (-nBits);
|
39342 | nBits += mLen;
|
39343 | for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
|
39344 |
|
39345 | if (e === 0) {
|
39346 | e = 1 - eBias;
|
39347 | } else if (e === eMax) {
|
39348 | return m ? NaN : ((s ? -1 : 1) * Infinity);
|
39349 | } else {
|
39350 | m = m + Math.pow(2, mLen);
|
39351 | e = e - eBias;
|
39352 | }
|
39353 | return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
|
39354 | }
|
39355 |
|
39356 | |
39357 |
|
39358 |
|
39359 |
|
39360 |
|
39361 |
|
39362 |
|
39363 |
|
39364 |
|
39365 |
|
39366 | function ieee754_write(buffer, value, offset, isLE, mLen, nBytes) {
|
39367 | var e, m, c,
|
39368 | eLen = nBytes * 8 - mLen - 1,
|
39369 | eMax = (1 << eLen) - 1,
|
39370 | eBias = eMax >> 1,
|
39371 | rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),
|
39372 | i = isLE ? 0 : (nBytes - 1),
|
39373 | d = isLE ? 1 : -1,
|
39374 | s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
|
39375 |
|
39376 | value = Math.abs(value);
|
39377 |
|
39378 | if (isNaN(value) || value === Infinity) {
|
39379 | m = isNaN(value) ? 1 : 0;
|
39380 | e = eMax;
|
39381 | } else {
|
39382 | e = Math.floor(Math.log(value) / Math.LN2);
|
39383 | if (value * (c = Math.pow(2, -e)) < 1) {
|
39384 | e--;
|
39385 | c *= 2;
|
39386 | }
|
39387 | if (e + eBias >= 1) {
|
39388 | value += rt / c;
|
39389 | } else {
|
39390 | value += rt * Math.pow(2, 1 - eBias);
|
39391 | }
|
39392 | if (value * c >= 2) {
|
39393 | e++;
|
39394 | c /= 2;
|
39395 | }
|
39396 |
|
39397 | if (e + eBias >= eMax) {
|
39398 | m = 0;
|
39399 | e = eMax;
|
39400 | } else if (e + eBias >= 1) {
|
39401 | m = (value * c - 1) * Math.pow(2, mLen);
|
39402 | e = e + eBias;
|
39403 | } else {
|
39404 | m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
|
39405 | e = 0;
|
39406 | }
|
39407 | }
|
39408 |
|
39409 | for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
|
39410 |
|
39411 | e = (e << mLen) | m;
|
39412 | eLen += mLen;
|
39413 | for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
|
39414 |
|
39415 | buffer[offset + i - d] |= s * 128;
|
39416 | }
|
39417 |
|
39418 | |
39419 |
|
39420 |
|
39421 |
|
39422 |
|
39423 |
|
39424 |
|
39425 | ByteBufferPrototype.writeFloat32 = function(value, offset) {
|
39426 | var relative = typeof offset === 'undefined';
|
39427 | if (relative) offset = this.offset;
|
39428 | if (!this.noAssert) {
|
39429 | if (typeof value !== 'number')
|
39430 | throw TypeError("Illegal value: "+value+" (not a number)");
|
39431 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39432 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39433 | offset >>>= 0;
|
39434 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39435 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39436 | }
|
39437 | offset += 4;
|
39438 | var capacity8 = this.buffer.byteLength;
|
39439 | if (offset > capacity8)
|
39440 | this.resize((capacity8 *= 2) > offset ? capacity8 : offset);
|
39441 | offset -= 4;
|
39442 | ieee754_write(this.view, value, offset, this.littleEndian, 23, 4);
|
39443 | if (relative) this.offset += 4;
|
39444 | return this;
|
39445 | };
|
39446 |
|
39447 | |
39448 |
|
39449 |
|
39450 |
|
39451 |
|
39452 |
|
39453 |
|
39454 |
|
39455 | ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32;
|
39456 |
|
39457 | |
39458 |
|
39459 |
|
39460 |
|
39461 |
|
39462 |
|
39463 | ByteBufferPrototype.readFloat32 = function(offset) {
|
39464 | var relative = typeof offset === 'undefined';
|
39465 | if (relative) offset = this.offset;
|
39466 | if (!this.noAssert) {
|
39467 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39468 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39469 | offset >>>= 0;
|
39470 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
39471 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
39472 | }
|
39473 | var value = ieee754_read(this.view, offset, this.littleEndian, 23, 4);
|
39474 | if (relative) this.offset += 4;
|
39475 | return value;
|
39476 | };
|
39477 |
|
39478 | |
39479 |
|
39480 |
|
39481 |
|
39482 |
|
39483 |
|
39484 |
|
39485 | ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32;
|
39486 |
|
39487 |
|
39488 |
|
39489 | |
39490 |
|
39491 |
|
39492 |
|
39493 |
|
39494 |
|
39495 |
|
39496 | ByteBufferPrototype.writeFloat64 = function(value, offset) {
|
39497 | var relative = typeof offset === 'undefined';
|
39498 | if (relative) offset = this.offset;
|
39499 | if (!this.noAssert) {
|
39500 | if (typeof value !== 'number')
|
39501 | throw TypeError("Illegal value: "+value+" (not a number)");
|
39502 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39503 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39504 | offset >>>= 0;
|
39505 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39506 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39507 | }
|
39508 | offset += 8;
|
39509 | var capacity9 = this.buffer.byteLength;
|
39510 | if (offset > capacity9)
|
39511 | this.resize((capacity9 *= 2) > offset ? capacity9 : offset);
|
39512 | offset -= 8;
|
39513 | ieee754_write(this.view, value, offset, this.littleEndian, 52, 8);
|
39514 | if (relative) this.offset += 8;
|
39515 | return this;
|
39516 | };
|
39517 |
|
39518 | |
39519 |
|
39520 |
|
39521 |
|
39522 |
|
39523 |
|
39524 |
|
39525 |
|
39526 | ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64;
|
39527 |
|
39528 | |
39529 |
|
39530 |
|
39531 |
|
39532 |
|
39533 |
|
39534 | ByteBufferPrototype.readFloat64 = function(offset) {
|
39535 | var relative = typeof offset === 'undefined';
|
39536 | if (relative) offset = this.offset;
|
39537 | if (!this.noAssert) {
|
39538 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39539 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39540 | offset >>>= 0;
|
39541 | if (offset < 0 || offset + 8 > this.buffer.byteLength)
|
39542 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
|
39543 | }
|
39544 | var value = ieee754_read(this.view, offset, this.littleEndian, 52, 8);
|
39545 | if (relative) this.offset += 8;
|
39546 | return value;
|
39547 | };
|
39548 |
|
39549 | |
39550 |
|
39551 |
|
39552 |
|
39553 |
|
39554 |
|
39555 |
|
39556 | ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64;
|
39557 |
|
39558 |
|
39559 |
|
39560 |
|
39561 | |
39562 |
|
39563 |
|
39564 |
|
39565 |
|
39566 |
|
39567 | ByteBuffer.MAX_VARINT32_BYTES = 5;
|
39568 |
|
39569 | |
39570 |
|
39571 |
|
39572 |
|
39573 |
|
39574 |
|
39575 | ByteBuffer.calculateVarint32 = function(value) {
|
39576 |
|
39577 | value = value >>> 0;
|
39578 | if (value < 1 << 7 ) return 1;
|
39579 | else if (value < 1 << 14) return 2;
|
39580 | else if (value < 1 << 21) return 3;
|
39581 | else if (value < 1 << 28) return 4;
|
39582 | else return 5;
|
39583 | };
|
39584 |
|
39585 | |
39586 |
|
39587 |
|
39588 |
|
39589 |
|
39590 |
|
39591 | ByteBuffer.zigZagEncode32 = function(n) {
|
39592 | return (((n |= 0) << 1) ^ (n >> 31)) >>> 0;
|
39593 | };
|
39594 |
|
39595 | |
39596 |
|
39597 |
|
39598 |
|
39599 |
|
39600 |
|
39601 | ByteBuffer.zigZagDecode32 = function(n) {
|
39602 | return ((n >>> 1) ^ -(n & 1)) | 0;
|
39603 | };
|
39604 |
|
39605 | |
39606 |
|
39607 |
|
39608 |
|
39609 |
|
39610 |
|
39611 |
|
39612 |
|
39613 | ByteBufferPrototype.writeVarint32 = function(value, offset) {
|
39614 | var relative = typeof offset === 'undefined';
|
39615 | if (relative) offset = this.offset;
|
39616 | if (!this.noAssert) {
|
39617 | if (typeof value !== 'number' || value % 1 !== 0)
|
39618 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
39619 | value |= 0;
|
39620 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39621 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39622 | offset >>>= 0;
|
39623 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39624 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39625 | }
|
39626 | var size = ByteBuffer.calculateVarint32(value),
|
39627 | b;
|
39628 | offset += size;
|
39629 | var capacity10 = this.buffer.byteLength;
|
39630 | if (offset > capacity10)
|
39631 | this.resize((capacity10 *= 2) > offset ? capacity10 : offset);
|
39632 | offset -= size;
|
39633 | value >>>= 0;
|
39634 | while (value >= 0x80) {
|
39635 | b = (value & 0x7f) | 0x80;
|
39636 | this.view[offset++] = b;
|
39637 | value >>>= 7;
|
39638 | }
|
39639 | this.view[offset++] = value;
|
39640 | if (relative) {
|
39641 | this.offset = offset;
|
39642 | return this;
|
39643 | }
|
39644 | return size;
|
39645 | };
|
39646 |
|
39647 | |
39648 |
|
39649 |
|
39650 |
|
39651 |
|
39652 |
|
39653 |
|
39654 |
|
39655 | ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) {
|
39656 | return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset);
|
39657 | };
|
39658 |
|
39659 | |
39660 |
|
39661 |
|
39662 |
|
39663 |
|
39664 |
|
39665 |
|
39666 |
|
39667 |
|
39668 |
|
39669 | ByteBufferPrototype.readVarint32 = function(offset) {
|
39670 | var relative = typeof offset === 'undefined';
|
39671 | if (relative) offset = this.offset;
|
39672 | if (!this.noAssert) {
|
39673 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39674 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39675 | offset >>>= 0;
|
39676 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
39677 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
39678 | }
|
39679 | var c = 0,
|
39680 | value = 0 >>> 0,
|
39681 | b;
|
39682 | do {
|
39683 | if (!this.noAssert && offset > this.limit) {
|
39684 | var err = Error("Truncated");
|
39685 | err['truncated'] = true;
|
39686 | throw err;
|
39687 | }
|
39688 | b = this.view[offset++];
|
39689 | if (c < 5)
|
39690 | value |= (b & 0x7f) << (7*c);
|
39691 | ++c;
|
39692 | } while ((b & 0x80) !== 0);
|
39693 | value |= 0;
|
39694 | if (relative) {
|
39695 | this.offset = offset;
|
39696 | return value;
|
39697 | }
|
39698 | return {
|
39699 | "value": value,
|
39700 | "length": c
|
39701 | };
|
39702 | };
|
39703 |
|
39704 | |
39705 |
|
39706 |
|
39707 |
|
39708 |
|
39709 |
|
39710 |
|
39711 |
|
39712 |
|
39713 | ByteBufferPrototype.readVarint32ZigZag = function(offset) {
|
39714 | var val = this.readVarint32(offset);
|
39715 | if (typeof val === 'object')
|
39716 | val["value"] = ByteBuffer.zigZagDecode32(val["value"]);
|
39717 | else
|
39718 | val = ByteBuffer.zigZagDecode32(val);
|
39719 | return val;
|
39720 | };
|
39721 |
|
39722 |
|
39723 |
|
39724 | if (Long) {
|
39725 |
|
39726 | |
39727 |
|
39728 |
|
39729 |
|
39730 |
|
39731 |
|
39732 | ByteBuffer.MAX_VARINT64_BYTES = 10;
|
39733 |
|
39734 | |
39735 |
|
39736 |
|
39737 |
|
39738 |
|
39739 |
|
39740 | ByteBuffer.calculateVarint64 = function(value) {
|
39741 | if (typeof value === 'number')
|
39742 | value = Long.fromNumber(value);
|
39743 | else if (typeof value === 'string')
|
39744 | value = Long.fromString(value);
|
39745 |
|
39746 | var part0 = value.toInt() >>> 0,
|
39747 | part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
|
39748 | part2 = value.shiftRightUnsigned(56).toInt() >>> 0;
|
39749 | if (part2 == 0) {
|
39750 | if (part1 == 0) {
|
39751 | if (part0 < 1 << 14)
|
39752 | return part0 < 1 << 7 ? 1 : 2;
|
39753 | else
|
39754 | return part0 < 1 << 21 ? 3 : 4;
|
39755 | } else {
|
39756 | if (part1 < 1 << 14)
|
39757 | return part1 < 1 << 7 ? 5 : 6;
|
39758 | else
|
39759 | return part1 < 1 << 21 ? 7 : 8;
|
39760 | }
|
39761 | } else
|
39762 | return part2 < 1 << 7 ? 9 : 10;
|
39763 | };
|
39764 |
|
39765 | |
39766 |
|
39767 |
|
39768 |
|
39769 |
|
39770 |
|
39771 | ByteBuffer.zigZagEncode64 = function(value) {
|
39772 | if (typeof value === 'number')
|
39773 | value = Long.fromNumber(value, false);
|
39774 | else if (typeof value === 'string')
|
39775 | value = Long.fromString(value, false);
|
39776 | else if (value.unsigned !== false) value = value.toSigned();
|
39777 |
|
39778 | return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();
|
39779 | };
|
39780 |
|
39781 | |
39782 |
|
39783 |
|
39784 |
|
39785 |
|
39786 |
|
39787 | ByteBuffer.zigZagDecode64 = function(value) {
|
39788 | if (typeof value === 'number')
|
39789 | value = Long.fromNumber(value, false);
|
39790 | else if (typeof value === 'string')
|
39791 | value = Long.fromString(value, false);
|
39792 | else if (value.unsigned !== false) value = value.toSigned();
|
39793 |
|
39794 | return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();
|
39795 | };
|
39796 |
|
39797 | |
39798 |
|
39799 |
|
39800 |
|
39801 |
|
39802 |
|
39803 |
|
39804 |
|
39805 | ByteBufferPrototype.writeVarint64 = function(value, offset) {
|
39806 | var relative = typeof offset === 'undefined';
|
39807 | if (relative) offset = this.offset;
|
39808 | if (!this.noAssert) {
|
39809 | if (typeof value === 'number')
|
39810 | value = Long.fromNumber(value);
|
39811 | else if (typeof value === 'string')
|
39812 | value = Long.fromString(value);
|
39813 | else if (!(value && value instanceof Long))
|
39814 | throw TypeError("Illegal value: "+value+" (not an integer or Long)");
|
39815 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39816 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39817 | offset >>>= 0;
|
39818 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39819 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39820 | }
|
39821 | if (typeof value === 'number')
|
39822 | value = Long.fromNumber(value, false);
|
39823 | else if (typeof value === 'string')
|
39824 | value = Long.fromString(value, false);
|
39825 | else if (value.unsigned !== false) value = value.toSigned();
|
39826 | var size = ByteBuffer.calculateVarint64(value),
|
39827 | part0 = value.toInt() >>> 0,
|
39828 | part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
|
39829 | part2 = value.shiftRightUnsigned(56).toInt() >>> 0;
|
39830 | offset += size;
|
39831 | var capacity11 = this.buffer.byteLength;
|
39832 | if (offset > capacity11)
|
39833 | this.resize((capacity11 *= 2) > offset ? capacity11 : offset);
|
39834 | offset -= size;
|
39835 | switch (size) {
|
39836 | case 10: this.view[offset+9] = (part2 >>> 7) & 0x01;
|
39837 | case 9 : this.view[offset+8] = size !== 9 ? (part2 ) | 0x80 : (part2 ) & 0x7F;
|
39838 | case 8 : this.view[offset+7] = size !== 8 ? (part1 >>> 21) | 0x80 : (part1 >>> 21) & 0x7F;
|
39839 | case 7 : this.view[offset+6] = size !== 7 ? (part1 >>> 14) | 0x80 : (part1 >>> 14) & 0x7F;
|
39840 | case 6 : this.view[offset+5] = size !== 6 ? (part1 >>> 7) | 0x80 : (part1 >>> 7) & 0x7F;
|
39841 | case 5 : this.view[offset+4] = size !== 5 ? (part1 ) | 0x80 : (part1 ) & 0x7F;
|
39842 | case 4 : this.view[offset+3] = size !== 4 ? (part0 >>> 21) | 0x80 : (part0 >>> 21) & 0x7F;
|
39843 | case 3 : this.view[offset+2] = size !== 3 ? (part0 >>> 14) | 0x80 : (part0 >>> 14) & 0x7F;
|
39844 | case 2 : this.view[offset+1] = size !== 2 ? (part0 >>> 7) | 0x80 : (part0 >>> 7) & 0x7F;
|
39845 | case 1 : this.view[offset ] = size !== 1 ? (part0 ) | 0x80 : (part0 ) & 0x7F;
|
39846 | }
|
39847 | if (relative) {
|
39848 | this.offset += size;
|
39849 | return this;
|
39850 | } else {
|
39851 | return size;
|
39852 | }
|
39853 | };
|
39854 |
|
39855 | |
39856 |
|
39857 |
|
39858 |
|
39859 |
|
39860 |
|
39861 |
|
39862 |
|
39863 | ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) {
|
39864 | return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset);
|
39865 | };
|
39866 |
|
39867 | |
39868 |
|
39869 |
|
39870 |
|
39871 |
|
39872 |
|
39873 |
|
39874 |
|
39875 |
|
39876 | ByteBufferPrototype.readVarint64 = function(offset) {
|
39877 | var relative = typeof offset === 'undefined';
|
39878 | if (relative) offset = this.offset;
|
39879 | if (!this.noAssert) {
|
39880 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39881 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39882 | offset >>>= 0;
|
39883 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
39884 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
39885 | }
|
39886 |
|
39887 | var start = offset,
|
39888 | part0 = 0,
|
39889 | part1 = 0,
|
39890 | part2 = 0,
|
39891 | b = 0;
|
39892 | b = this.view[offset++]; part0 = (b & 0x7F) ; if ( b & 0x80 ) {
|
39893 | b = this.view[offset++]; part0 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39894 | b = this.view[offset++]; part0 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39895 | b = this.view[offset++]; part0 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39896 | b = this.view[offset++]; part1 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39897 | b = this.view[offset++]; part1 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39898 | b = this.view[offset++]; part1 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39899 | b = this.view[offset++]; part1 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39900 | b = this.view[offset++]; part2 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39901 | b = this.view[offset++]; part2 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39902 | throw Error("Buffer overrun"); }}}}}}}}}}
|
39903 | var value = Long.fromBits(part0 | (part1 << 28), (part1 >>> 4) | (part2) << 24, false);
|
39904 | if (relative) {
|
39905 | this.offset = offset;
|
39906 | return value;
|
39907 | } else {
|
39908 | return {
|
39909 | 'value': value,
|
39910 | 'length': offset-start
|
39911 | };
|
39912 | }
|
39913 | };
|
39914 |
|
39915 | |
39916 |
|
39917 |
|
39918 |
|
39919 |
|
39920 |
|
39921 |
|
39922 |
|
39923 |
|
39924 | ByteBufferPrototype.readVarint64ZigZag = function(offset) {
|
39925 | var val = this.readVarint64(offset);
|
39926 | if (val && val['value'] instanceof Long)
|
39927 | val["value"] = ByteBuffer.zigZagDecode64(val["value"]);
|
39928 | else
|
39929 | val = ByteBuffer.zigZagDecode64(val);
|
39930 | return val;
|
39931 | };
|
39932 |
|
39933 | }
|
39934 |
|
39935 |
|
39936 |
|
39937 |
|
39938 | |
39939 |
|
39940 |
|
39941 |
|
39942 |
|
39943 |
|
39944 |
|
39945 |
|
39946 |
|
39947 | ByteBufferPrototype.writeCString = function(str, offset) {
|
39948 | var relative = typeof offset === 'undefined';
|
39949 | if (relative) offset = this.offset;
|
39950 | var i,
|
39951 | k = str.length;
|
39952 | if (!this.noAssert) {
|
39953 | if (typeof str !== 'string')
|
39954 | throw TypeError("Illegal str: Not a string");
|
39955 | for (i=0; i<k; ++i) {
|
39956 | if (str.charCodeAt(i) === 0)
|
39957 | throw RangeError("Illegal str: Contains NULL-characters");
|
39958 | }
|
39959 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39960 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39961 | offset >>>= 0;
|
39962 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39963 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39964 | }
|
39965 |
|
39966 | k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
|
39967 | offset += k+1;
|
39968 | var capacity12 = this.buffer.byteLength;
|
39969 | if (offset > capacity12)
|
39970 | this.resize((capacity12 *= 2) > offset ? capacity12 : offset);
|
39971 | offset -= k+1;
|
39972 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
39973 | this.view[offset++] = b;
|
39974 | }.bind(this));
|
39975 | this.view[offset++] = 0;
|
39976 | if (relative) {
|
39977 | this.offset = offset;
|
39978 | return this;
|
39979 | }
|
39980 | return k;
|
39981 | };
|
39982 |
|
39983 | |
39984 |
|
39985 |
|
39986 |
|
39987 |
|
39988 |
|
39989 |
|
39990 |
|
39991 |
|
39992 | ByteBufferPrototype.readCString = function(offset) {
|
39993 | var relative = typeof offset === 'undefined';
|
39994 | if (relative) offset = this.offset;
|
39995 | if (!this.noAssert) {
|
39996 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39997 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39998 | offset >>>= 0;
|
39999 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
40000 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
40001 | }
|
40002 | var start = offset,
|
40003 | temp;
|
40004 |
|
40005 | var sd, b = -1;
|
40006 | utfx.decodeUTF8toUTF16(function() {
|
40007 | if (b === 0) return null;
|
40008 | if (offset >= this.limit)
|
40009 | throw RangeError("Illegal range: Truncated data, "+offset+" < "+this.limit);
|
40010 | b = this.view[offset++];
|
40011 | return b === 0 ? null : b;
|
40012 | }.bind(this), sd = stringDestination(), true);
|
40013 | if (relative) {
|
40014 | this.offset = offset;
|
40015 | return sd();
|
40016 | } else {
|
40017 | return {
|
40018 | "string": sd(),
|
40019 | "length": offset - start
|
40020 | };
|
40021 | }
|
40022 | };
|
40023 |
|
40024 |
|
40025 |
|
40026 | |
40027 |
|
40028 |
|
40029 |
|
40030 |
|
40031 |
|
40032 |
|
40033 |
|
40034 |
|
40035 | ByteBufferPrototype.writeIString = function(str, offset) {
|
40036 | var relative = typeof offset === 'undefined';
|
40037 | if (relative) offset = this.offset;
|
40038 | if (!this.noAssert) {
|
40039 | if (typeof str !== 'string')
|
40040 | throw TypeError("Illegal str: Not a string");
|
40041 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40042 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40043 | offset >>>= 0;
|
40044 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40045 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40046 | }
|
40047 | var start = offset,
|
40048 | k;
|
40049 | k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];
|
40050 | offset += 4+k;
|
40051 | var capacity13 = this.buffer.byteLength;
|
40052 | if (offset > capacity13)
|
40053 | this.resize((capacity13 *= 2) > offset ? capacity13 : offset);
|
40054 | offset -= 4+k;
|
40055 | if (this.littleEndian) {
|
40056 | this.view[offset+3] = (k >>> 24) & 0xFF;
|
40057 | this.view[offset+2] = (k >>> 16) & 0xFF;
|
40058 | this.view[offset+1] = (k >>> 8) & 0xFF;
|
40059 | this.view[offset ] = k & 0xFF;
|
40060 | } else {
|
40061 | this.view[offset ] = (k >>> 24) & 0xFF;
|
40062 | this.view[offset+1] = (k >>> 16) & 0xFF;
|
40063 | this.view[offset+2] = (k >>> 8) & 0xFF;
|
40064 | this.view[offset+3] = k & 0xFF;
|
40065 | }
|
40066 | offset += 4;
|
40067 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
40068 | this.view[offset++] = b;
|
40069 | }.bind(this));
|
40070 | if (offset !== start + 4 + k)
|
40071 | throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+4+k));
|
40072 | if (relative) {
|
40073 | this.offset = offset;
|
40074 | return this;
|
40075 | }
|
40076 | return offset - start;
|
40077 | };
|
40078 |
|
40079 | |
40080 |
|
40081 |
|
40082 |
|
40083 |
|
40084 |
|
40085 |
|
40086 |
|
40087 |
|
40088 | ByteBufferPrototype.readIString = function(offset) {
|
40089 | var relative = typeof offset === 'undefined';
|
40090 | if (relative) offset = this.offset;
|
40091 | if (!this.noAssert) {
|
40092 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40093 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40094 | offset >>>= 0;
|
40095 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
40096 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
40097 | }
|
40098 | var start = offset;
|
40099 | var len = this.readUint32(offset);
|
40100 | var str = this.readUTF8String(len, ByteBuffer.METRICS_BYTES, offset += 4);
|
40101 | offset += str['length'];
|
40102 | if (relative) {
|
40103 | this.offset = offset;
|
40104 | return str['string'];
|
40105 | } else {
|
40106 | return {
|
40107 | 'string': str['string'],
|
40108 | 'length': offset - start
|
40109 | };
|
40110 | }
|
40111 | };
|
40112 |
|
40113 |
|
40114 |
|
40115 | |
40116 |
|
40117 |
|
40118 |
|
40119 |
|
40120 |
|
40121 | ByteBuffer.METRICS_CHARS = 'c';
|
40122 |
|
40123 | |
40124 |
|
40125 |
|
40126 |
|
40127 |
|
40128 |
|
40129 | ByteBuffer.METRICS_BYTES = 'b';
|
40130 |
|
40131 | |
40132 |
|
40133 |
|
40134 |
|
40135 |
|
40136 |
|
40137 |
|
40138 | ByteBufferPrototype.writeUTF8String = function(str, offset) {
|
40139 | var relative = typeof offset === 'undefined';
|
40140 | if (relative) offset = this.offset;
|
40141 | if (!this.noAssert) {
|
40142 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40143 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40144 | offset >>>= 0;
|
40145 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40146 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40147 | }
|
40148 | var k;
|
40149 | var start = offset;
|
40150 | k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
|
40151 | offset += k;
|
40152 | var capacity14 = this.buffer.byteLength;
|
40153 | if (offset > capacity14)
|
40154 | this.resize((capacity14 *= 2) > offset ? capacity14 : offset);
|
40155 | offset -= k;
|
40156 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
40157 | this.view[offset++] = b;
|
40158 | }.bind(this));
|
40159 | if (relative) {
|
40160 | this.offset = offset;
|
40161 | return this;
|
40162 | }
|
40163 | return offset - start;
|
40164 | };
|
40165 |
|
40166 | |
40167 |
|
40168 |
|
40169 |
|
40170 |
|
40171 |
|
40172 |
|
40173 |
|
40174 | ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String;
|
40175 |
|
40176 | |
40177 |
|
40178 |
|
40179 |
|
40180 |
|
40181 |
|
40182 |
|
40183 | ByteBuffer.calculateUTF8Chars = function(str) {
|
40184 | return utfx.calculateUTF16asUTF8(stringSource(str))[0];
|
40185 | };
|
40186 |
|
40187 | |
40188 |
|
40189 |
|
40190 |
|
40191 |
|
40192 |
|
40193 | ByteBuffer.calculateUTF8Bytes = function(str) {
|
40194 | return utfx.calculateUTF16asUTF8(stringSource(str))[1];
|
40195 | };
|
40196 |
|
40197 | |
40198 |
|
40199 |
|
40200 |
|
40201 |
|
40202 |
|
40203 |
|
40204 | ByteBuffer.calculateString = ByteBuffer.calculateUTF8Bytes;
|
40205 |
|
40206 | |
40207 |
|
40208 |
|
40209 |
|
40210 |
|
40211 |
|
40212 |
|
40213 |
|
40214 |
|
40215 |
|
40216 |
|
40217 | ByteBufferPrototype.readUTF8String = function(length, metrics, offset) {
|
40218 | if (typeof metrics === 'number') {
|
40219 | offset = metrics;
|
40220 | metrics = undefined;
|
40221 | }
|
40222 | var relative = typeof offset === 'undefined';
|
40223 | if (relative) offset = this.offset;
|
40224 | if (typeof metrics === 'undefined') metrics = ByteBuffer.METRICS_CHARS;
|
40225 | if (!this.noAssert) {
|
40226 | if (typeof length !== 'number' || length % 1 !== 0)
|
40227 | throw TypeError("Illegal length: "+length+" (not an integer)");
|
40228 | length |= 0;
|
40229 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40230 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40231 | offset >>>= 0;
|
40232 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40233 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40234 | }
|
40235 | var i = 0,
|
40236 | start = offset,
|
40237 | sd;
|
40238 | if (metrics === ByteBuffer.METRICS_CHARS) {
|
40239 | sd = stringDestination();
|
40240 | utfx.decodeUTF8(function() {
|
40241 | return i < length && offset < this.limit ? this.view[offset++] : null;
|
40242 | }.bind(this), function(cp) {
|
40243 | ++i; utfx.UTF8toUTF16(cp, sd);
|
40244 | });
|
40245 | if (i !== length)
|
40246 | throw RangeError("Illegal range: Truncated data, "+i+" == "+length);
|
40247 | if (relative) {
|
40248 | this.offset = offset;
|
40249 | return sd();
|
40250 | } else {
|
40251 | return {
|
40252 | "string": sd(),
|
40253 | "length": offset - start
|
40254 | };
|
40255 | }
|
40256 | } else if (metrics === ByteBuffer.METRICS_BYTES) {
|
40257 | if (!this.noAssert) {
|
40258 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40259 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40260 | offset >>>= 0;
|
40261 | if (offset < 0 || offset + length > this.buffer.byteLength)
|
40262 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength);
|
40263 | }
|
40264 | var k = offset + length;
|
40265 | utfx.decodeUTF8toUTF16(function() {
|
40266 | return offset < k ? this.view[offset++] : null;
|
40267 | }.bind(this), sd = stringDestination(), this.noAssert);
|
40268 | if (offset !== k)
|
40269 | throw RangeError("Illegal range: Truncated data, "+offset+" == "+k);
|
40270 | if (relative) {
|
40271 | this.offset = offset;
|
40272 | return sd();
|
40273 | } else {
|
40274 | return {
|
40275 | 'string': sd(),
|
40276 | 'length': offset - start
|
40277 | };
|
40278 | }
|
40279 | } else
|
40280 | throw TypeError("Unsupported metrics: "+metrics);
|
40281 | };
|
40282 |
|
40283 | |
40284 |
|
40285 |
|
40286 |
|
40287 |
|
40288 |
|
40289 |
|
40290 |
|
40291 |
|
40292 |
|
40293 |
|
40294 |
|
40295 | ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String;
|
40296 |
|
40297 |
|
40298 |
|
40299 | |
40300 |
|
40301 |
|
40302 |
|
40303 |
|
40304 |
|
40305 |
|
40306 |
|
40307 |
|
40308 | ByteBufferPrototype.writeVString = function(str, offset) {
|
40309 | var relative = typeof offset === 'undefined';
|
40310 | if (relative) offset = this.offset;
|
40311 | if (!this.noAssert) {
|
40312 | if (typeof str !== 'string')
|
40313 | throw TypeError("Illegal str: Not a string");
|
40314 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40315 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40316 | offset >>>= 0;
|
40317 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40318 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40319 | }
|
40320 | var start = offset,
|
40321 | k, l;
|
40322 | k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];
|
40323 | l = ByteBuffer.calculateVarint32(k);
|
40324 | offset += l+k;
|
40325 | var capacity15 = this.buffer.byteLength;
|
40326 | if (offset > capacity15)
|
40327 | this.resize((capacity15 *= 2) > offset ? capacity15 : offset);
|
40328 | offset -= l+k;
|
40329 | offset += this.writeVarint32(k, offset);
|
40330 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
40331 | this.view[offset++] = b;
|
40332 | }.bind(this));
|
40333 | if (offset !== start+k+l)
|
40334 | throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+k+l));
|
40335 | if (relative) {
|
40336 | this.offset = offset;
|
40337 | return this;
|
40338 | }
|
40339 | return offset - start;
|
40340 | };
|
40341 |
|
40342 | |
40343 |
|
40344 |
|
40345 |
|
40346 |
|
40347 |
|
40348 |
|
40349 |
|
40350 |
|
40351 | ByteBufferPrototype.readVString = function(offset) {
|
40352 | var relative = typeof offset === 'undefined';
|
40353 | if (relative) offset = this.offset;
|
40354 | if (!this.noAssert) {
|
40355 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40356 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40357 | offset >>>= 0;
|
40358 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
40359 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
40360 | }
|
40361 | var start = offset;
|
40362 | var len = this.readVarint32(offset);
|
40363 | var str = this.readUTF8String(len['value'], ByteBuffer.METRICS_BYTES, offset += len['length']);
|
40364 | offset += str['length'];
|
40365 | if (relative) {
|
40366 | this.offset = offset;
|
40367 | return str['string'];
|
40368 | } else {
|
40369 | return {
|
40370 | 'string': str['string'],
|
40371 | 'length': offset - start
|
40372 | };
|
40373 | }
|
40374 | };
|
40375 |
|
40376 |
|
40377 | |
40378 |
|
40379 |
|
40380 |
|
40381 |
|
40382 |
|
40383 |
|
40384 |
|
40385 |
|
40386 |
|
40387 |
|
40388 |
|
40389 |
|
40390 | ByteBufferPrototype.append = function(source, encoding, offset) {
|
40391 | if (typeof encoding === 'number' || typeof encoding !== 'string') {
|
40392 | offset = encoding;
|
40393 | encoding = undefined;
|
40394 | }
|
40395 | var relative = typeof offset === 'undefined';
|
40396 | if (relative) offset = this.offset;
|
40397 | if (!this.noAssert) {
|
40398 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40399 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40400 | offset >>>= 0;
|
40401 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40402 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40403 | }
|
40404 | if (!(source instanceof ByteBuffer))
|
40405 | source = ByteBuffer.wrap(source, encoding);
|
40406 | var length = source.limit - source.offset;
|
40407 | if (length <= 0) return this;
|
40408 | offset += length;
|
40409 | var capacity16 = this.buffer.byteLength;
|
40410 | if (offset > capacity16)
|
40411 | this.resize((capacity16 *= 2) > offset ? capacity16 : offset);
|
40412 | offset -= length;
|
40413 | this.view.set(source.view.subarray(source.offset, source.limit), offset);
|
40414 | source.offset += length;
|
40415 | if (relative) this.offset += length;
|
40416 | return this;
|
40417 | };
|
40418 |
|
40419 | |
40420 |
|
40421 |
|
40422 |
|
40423 |
|
40424 |
|
40425 |
|
40426 |
|
40427 |
|
40428 |
|
40429 | ByteBufferPrototype.appendTo = function(target, offset) {
|
40430 | target.append(this, offset);
|
40431 | return this;
|
40432 | };
|
40433 |
|
40434 | |
40435 |
|
40436 |
|
40437 |
|
40438 |
|
40439 |
|
40440 |
|
40441 | ByteBufferPrototype.assert = function(assert) {
|
40442 | this.noAssert = !assert;
|
40443 | return this;
|
40444 | };
|
40445 |
|
40446 | |
40447 |
|
40448 |
|
40449 |
|
40450 |
|
40451 | ByteBufferPrototype.capacity = function() {
|
40452 | return this.buffer.byteLength;
|
40453 | };
|
40454 | |
40455 |
|
40456 |
|
40457 |
|
40458 |
|
40459 |
|
40460 | ByteBufferPrototype.clear = function() {
|
40461 | this.offset = 0;
|
40462 | this.limit = this.buffer.byteLength;
|
40463 | this.markedOffset = -1;
|
40464 | return this;
|
40465 | };
|
40466 |
|
40467 | |
40468 |
|
40469 |
|
40470 |
|
40471 |
|
40472 |
|
40473 |
|
40474 | ByteBufferPrototype.clone = function(copy) {
|
40475 | var bb = new ByteBuffer(0, this.littleEndian, this.noAssert);
|
40476 | if (copy) {
|
40477 | bb.buffer = new ArrayBuffer(this.buffer.byteLength);
|
40478 | bb.view = new Uint8Array(bb.buffer);
|
40479 | } else {
|
40480 | bb.buffer = this.buffer;
|
40481 | bb.view = this.view;
|
40482 | }
|
40483 | bb.offset = this.offset;
|
40484 | bb.markedOffset = this.markedOffset;
|
40485 | bb.limit = this.limit;
|
40486 | return bb;
|
40487 | };
|
40488 |
|
40489 | |
40490 |
|
40491 |
|
40492 |
|
40493 |
|
40494 |
|
40495 |
|
40496 |
|
40497 |
|
40498 | ByteBufferPrototype.compact = function(begin, end) {
|
40499 | if (typeof begin === 'undefined') begin = this.offset;
|
40500 | if (typeof end === 'undefined') end = this.limit;
|
40501 | if (!this.noAssert) {
|
40502 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
40503 | throw TypeError("Illegal begin: Not an integer");
|
40504 | begin >>>= 0;
|
40505 | if (typeof end !== 'number' || end % 1 !== 0)
|
40506 | throw TypeError("Illegal end: Not an integer");
|
40507 | end >>>= 0;
|
40508 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
40509 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
40510 | }
|
40511 | if (begin === 0 && end === this.buffer.byteLength)
|
40512 | return this;
|
40513 | var len = end - begin;
|
40514 | if (len === 0) {
|
40515 | this.buffer = EMPTY_BUFFER;
|
40516 | this.view = null;
|
40517 | if (this.markedOffset >= 0) this.markedOffset -= begin;
|
40518 | this.offset = 0;
|
40519 | this.limit = 0;
|
40520 | return this;
|
40521 | }
|
40522 | var buffer = new ArrayBuffer(len);
|
40523 | var view = new Uint8Array(buffer);
|
40524 | view.set(this.view.subarray(begin, end));
|
40525 | this.buffer = buffer;
|
40526 | this.view = view;
|
40527 | if (this.markedOffset >= 0) this.markedOffset -= begin;
|
40528 | this.offset = 0;
|
40529 | this.limit = len;
|
40530 | return this;
|
40531 | };
|
40532 |
|
40533 | |
40534 |
|
40535 |
|
40536 |
|
40537 |
|
40538 |
|
40539 |
|
40540 |
|
40541 | ByteBufferPrototype.copy = function(begin, end) {
|
40542 | if (typeof begin === 'undefined') begin = this.offset;
|
40543 | if (typeof end === 'undefined') end = this.limit;
|
40544 | if (!this.noAssert) {
|
40545 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
40546 | throw TypeError("Illegal begin: Not an integer");
|
40547 | begin >>>= 0;
|
40548 | if (typeof end !== 'number' || end % 1 !== 0)
|
40549 | throw TypeError("Illegal end: Not an integer");
|
40550 | end >>>= 0;
|
40551 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
40552 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
40553 | }
|
40554 | if (begin === end)
|
40555 | return new ByteBuffer(0, this.littleEndian, this.noAssert);
|
40556 | var capacity = end - begin,
|
40557 | bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert);
|
40558 | bb.offset = 0;
|
40559 | bb.limit = capacity;
|
40560 | if (bb.markedOffset >= 0) bb.markedOffset -= begin;
|
40561 | this.copyTo(bb, 0, begin, end);
|
40562 | return bb;
|
40563 | };
|
40564 |
|
40565 | |
40566 |
|
40567 |
|
40568 |
|
40569 |
|
40570 |
|
40571 |
|
40572 |
|
40573 |
|
40574 |
|
40575 |
|
40576 |
|
40577 | ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) {
|
40578 | var relative,
|
40579 | targetRelative;
|
40580 | if (!this.noAssert) {
|
40581 | if (!ByteBuffer.isByteBuffer(target))
|
40582 | throw TypeError("Illegal target: Not a ByteBuffer");
|
40583 | }
|
40584 | targetOffset = (targetRelative = typeof targetOffset === 'undefined') ? target.offset : targetOffset | 0;
|
40585 | sourceOffset = (relative = typeof sourceOffset === 'undefined') ? this.offset : sourceOffset | 0;
|
40586 | sourceLimit = typeof sourceLimit === 'undefined' ? this.limit : sourceLimit | 0;
|
40587 |
|
40588 | if (targetOffset < 0 || targetOffset > target.buffer.byteLength)
|
40589 | throw RangeError("Illegal target range: 0 <= "+targetOffset+" <= "+target.buffer.byteLength);
|
40590 | if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength)
|
40591 | throw RangeError("Illegal source range: 0 <= "+sourceOffset+" <= "+this.buffer.byteLength);
|
40592 |
|
40593 | var len = sourceLimit - sourceOffset;
|
40594 | if (len === 0)
|
40595 | return target;
|
40596 |
|
40597 | target.ensureCapacity(targetOffset + len);
|
40598 |
|
40599 | target.view.set(this.view.subarray(sourceOffset, sourceLimit), targetOffset);
|
40600 |
|
40601 | if (relative) this.offset += len;
|
40602 | if (targetRelative) target.offset += len;
|
40603 |
|
40604 | return this;
|
40605 | };
|
40606 |
|
40607 | |
40608 |
|
40609 |
|
40610 |
|
40611 |
|
40612 |
|
40613 |
|
40614 |
|
40615 | ByteBufferPrototype.ensureCapacity = function(capacity) {
|
40616 | var current = this.buffer.byteLength;
|
40617 | if (current < capacity)
|
40618 | return this.resize((current *= 2) > capacity ? current : capacity);
|
40619 | return this;
|
40620 | };
|
40621 |
|
40622 | |
40623 |
|
40624 |
|
40625 |
|
40626 |
|
40627 |
|
40628 |
|
40629 |
|
40630 |
|
40631 |
|
40632 |
|
40633 | ByteBufferPrototype.fill = function(value, begin, end) {
|
40634 | var relative = typeof begin === 'undefined';
|
40635 | if (relative) begin = this.offset;
|
40636 | if (typeof value === 'string' && value.length > 0)
|
40637 | value = value.charCodeAt(0);
|
40638 | if (typeof begin === 'undefined') begin = this.offset;
|
40639 | if (typeof end === 'undefined') end = this.limit;
|
40640 | if (!this.noAssert) {
|
40641 | if (typeof value !== 'number' || value % 1 !== 0)
|
40642 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
40643 | value |= 0;
|
40644 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
40645 | throw TypeError("Illegal begin: Not an integer");
|
40646 | begin >>>= 0;
|
40647 | if (typeof end !== 'number' || end % 1 !== 0)
|
40648 | throw TypeError("Illegal end: Not an integer");
|
40649 | end >>>= 0;
|
40650 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
40651 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
40652 | }
|
40653 | if (begin >= end)
|
40654 | return this;
|
40655 | while (begin < end) this.view[begin++] = value;
|
40656 | if (relative) this.offset = begin;
|
40657 | return this;
|
40658 | };
|
40659 |
|
40660 | |
40661 |
|
40662 |
|
40663 |
|
40664 |
|
40665 |
|
40666 | ByteBufferPrototype.flip = function() {
|
40667 | this.limit = this.offset;
|
40668 | this.offset = 0;
|
40669 | return this;
|
40670 | };
|
40671 | |
40672 |
|
40673 |
|
40674 |
|
40675 |
|
40676 |
|
40677 |
|
40678 |
|
40679 |
|
40680 | ByteBufferPrototype.mark = function(offset) {
|
40681 | offset = typeof offset === 'undefined' ? this.offset : offset;
|
40682 | if (!this.noAssert) {
|
40683 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40684 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40685 | offset >>>= 0;
|
40686 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40687 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40688 | }
|
40689 | this.markedOffset = offset;
|
40690 | return this;
|
40691 | };
|
40692 | |
40693 |
|
40694 |
|
40695 |
|
40696 |
|
40697 |
|
40698 | ByteBufferPrototype.order = function(littleEndian) {
|
40699 | if (!this.noAssert) {
|
40700 | if (typeof littleEndian !== 'boolean')
|
40701 | throw TypeError("Illegal littleEndian: Not a boolean");
|
40702 | }
|
40703 | this.littleEndian = !!littleEndian;
|
40704 | return this;
|
40705 | };
|
40706 |
|
40707 | |
40708 |
|
40709 |
|
40710 |
|
40711 |
|
40712 |
|
40713 | ByteBufferPrototype.LE = function(littleEndian) {
|
40714 | this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : true;
|
40715 | return this;
|
40716 | };
|
40717 |
|
40718 | |
40719 |
|
40720 |
|
40721 |
|
40722 |
|
40723 |
|
40724 | ByteBufferPrototype.BE = function(bigEndian) {
|
40725 | this.littleEndian = typeof bigEndian !== 'undefined' ? !bigEndian : false;
|
40726 | return this;
|
40727 | };
|
40728 | |
40729 |
|
40730 |
|
40731 |
|
40732 |
|
40733 |
|
40734 |
|
40735 |
|
40736 |
|
40737 |
|
40738 |
|
40739 |
|
40740 |
|
40741 |
|
40742 | ByteBufferPrototype.prepend = function(source, encoding, offset) {
|
40743 | if (typeof encoding === 'number' || typeof encoding !== 'string') {
|
40744 | offset = encoding;
|
40745 | encoding = undefined;
|
40746 | }
|
40747 | var relative = typeof offset === 'undefined';
|
40748 | if (relative) offset = this.offset;
|
40749 | if (!this.noAssert) {
|
40750 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40751 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40752 | offset >>>= 0;
|
40753 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40754 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40755 | }
|
40756 | if (!(source instanceof ByteBuffer))
|
40757 | source = ByteBuffer.wrap(source, encoding);
|
40758 | var len = source.limit - source.offset;
|
40759 | if (len <= 0) return this;
|
40760 | var diff = len - offset;
|
40761 | if (diff > 0) {
|
40762 | var buffer = new ArrayBuffer(this.buffer.byteLength + diff);
|
40763 | var view = new Uint8Array(buffer);
|
40764 | view.set(this.view.subarray(offset, this.buffer.byteLength), len);
|
40765 | this.buffer = buffer;
|
40766 | this.view = view;
|
40767 | this.offset += diff;
|
40768 | if (this.markedOffset >= 0) this.markedOffset += diff;
|
40769 | this.limit += diff;
|
40770 | offset += diff;
|
40771 | } else {
|
40772 | var arrayView = new Uint8Array(this.buffer);
|
40773 | }
|
40774 | this.view.set(source.view.subarray(source.offset, source.limit), offset - len);
|
40775 |
|
40776 | source.offset = source.limit;
|
40777 | if (relative)
|
40778 | this.offset -= len;
|
40779 | return this;
|
40780 | };
|
40781 |
|
40782 | |
40783 |
|
40784 |
|
40785 |
|
40786 |
|
40787 |
|
40788 |
|
40789 |
|
40790 |
|
40791 |
|
40792 |
|
40793 | ByteBufferPrototype.prependTo = function(target, offset) {
|
40794 | target.prepend(this, offset);
|
40795 | return this;
|
40796 | };
|
40797 | |
40798 |
|
40799 |
|
40800 |
|
40801 |
|
40802 | ByteBufferPrototype.printDebug = function(out) {
|
40803 | if (typeof out !== 'function') out = console.log.bind(console);
|
40804 | out(
|
40805 | this.toString()+"\n"+
|
40806 | "-------------------------------------------------------------------\n"+
|
40807 | this.toDebug( true)
|
40808 | );
|
40809 | };
|
40810 |
|
40811 | |
40812 |
|
40813 |
|
40814 |
|
40815 |
|
40816 |
|
40817 | ByteBufferPrototype.remaining = function() {
|
40818 | return this.limit - this.offset;
|
40819 | };
|
40820 | |
40821 |
|
40822 |
|
40823 |
|
40824 |
|
40825 |
|
40826 |
|
40827 |
|
40828 | ByteBufferPrototype.reset = function() {
|
40829 | if (this.markedOffset >= 0) {
|
40830 | this.offset = this.markedOffset;
|
40831 | this.markedOffset = -1;
|
40832 | } else {
|
40833 | this.offset = 0;
|
40834 | }
|
40835 | return this;
|
40836 | };
|
40837 | |
40838 |
|
40839 |
|
40840 |
|
40841 |
|
40842 |
|
40843 |
|
40844 |
|
40845 |
|
40846 | ByteBufferPrototype.resize = function(capacity) {
|
40847 | if (!this.noAssert) {
|
40848 | if (typeof capacity !== 'number' || capacity % 1 !== 0)
|
40849 | throw TypeError("Illegal capacity: "+capacity+" (not an integer)");
|
40850 | capacity |= 0;
|
40851 | if (capacity < 0)
|
40852 | throw RangeError("Illegal capacity: 0 <= "+capacity);
|
40853 | }
|
40854 | if (this.buffer.byteLength < capacity) {
|
40855 | var buffer = new ArrayBuffer(capacity);
|
40856 | var view = new Uint8Array(buffer);
|
40857 | view.set(this.view);
|
40858 | this.buffer = buffer;
|
40859 | this.view = view;
|
40860 | }
|
40861 | return this;
|
40862 | };
|
40863 | |
40864 |
|
40865 |
|
40866 |
|
40867 |
|
40868 |
|
40869 |
|
40870 | ByteBufferPrototype.reverse = function(begin, end) {
|
40871 | if (typeof begin === 'undefined') begin = this.offset;
|
40872 | if (typeof end === 'undefined') end = this.limit;
|
40873 | if (!this.noAssert) {
|
40874 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
40875 | throw TypeError("Illegal begin: Not an integer");
|
40876 | begin >>>= 0;
|
40877 | if (typeof end !== 'number' || end % 1 !== 0)
|
40878 | throw TypeError("Illegal end: Not an integer");
|
40879 | end >>>= 0;
|
40880 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
40881 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
40882 | }
|
40883 | if (begin === end)
|
40884 | return this;
|
40885 | Array.prototype.reverse.call(this.view.subarray(begin, end));
|
40886 | return this;
|
40887 | };
|
40888 | |
40889 |
|
40890 |
|
40891 |
|
40892 |
|
40893 |
|
40894 | ByteBufferPrototype.skip = function(length) {
|
40895 | if (!this.noAssert) {
|
40896 | if (typeof length !== 'number' || length % 1 !== 0)
|
40897 | throw TypeError("Illegal length: "+length+" (not an integer)");
|
40898 | length |= 0;
|
40899 | }
|
40900 | var offset = this.offset + length;
|
40901 | if (!this.noAssert) {
|
40902 | if (offset < 0 || offset > this.buffer.byteLength)
|
40903 | throw RangeError("Illegal length: 0 <= "+this.offset+" + "+length+" <= "+this.buffer.byteLength);
|
40904 | }
|
40905 | this.offset = offset;
|
40906 | return this;
|
40907 | };
|
40908 |
|
40909 | |
40910 |
|
40911 |
|
40912 |
|
40913 |
|
40914 |
|
40915 |
|
40916 | ByteBufferPrototype.slice = function(begin, end) {
|
40917 | if (typeof begin === 'undefined') begin = this.offset;
|
40918 | if (typeof end === 'undefined') end = this.limit;
|
40919 | if (!this.noAssert) {
|
40920 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
40921 | throw TypeError("Illegal begin: Not an integer");
|
40922 | begin >>>= 0;
|
40923 | if (typeof end !== 'number' || end % 1 !== 0)
|
40924 | throw TypeError("Illegal end: Not an integer");
|
40925 | end >>>= 0;
|
40926 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
40927 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
40928 | }
|
40929 | var bb = this.clone();
|
40930 | bb.offset = begin;
|
40931 | bb.limit = end;
|
40932 | return bb;
|
40933 | };
|
40934 | |
40935 |
|
40936 |
|
40937 |
|
40938 |
|
40939 |
|
40940 |
|
40941 |
|
40942 | ByteBufferPrototype.toBuffer = function(forceCopy) {
|
40943 | var offset = this.offset,
|
40944 | limit = this.limit;
|
40945 | if (!this.noAssert) {
|
40946 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40947 | throw TypeError("Illegal offset: Not an integer");
|
40948 | offset >>>= 0;
|
40949 | if (typeof limit !== 'number' || limit % 1 !== 0)
|
40950 | throw TypeError("Illegal limit: Not an integer");
|
40951 | limit >>>= 0;
|
40952 | if (offset < 0 || offset > limit || limit > this.buffer.byteLength)
|
40953 | throw RangeError("Illegal range: 0 <= "+offset+" <= "+limit+" <= "+this.buffer.byteLength);
|
40954 | }
|
40955 |
|
40956 |
|
40957 | if (!forceCopy && offset === 0 && limit === this.buffer.byteLength)
|
40958 | return this.buffer;
|
40959 | if (offset === limit)
|
40960 | return EMPTY_BUFFER;
|
40961 | var buffer = new ArrayBuffer(limit - offset);
|
40962 | new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0);
|
40963 | return buffer;
|
40964 | };
|
40965 |
|
40966 | |
40967 |
|
40968 |
|
40969 |
|
40970 |
|
40971 |
|
40972 |
|
40973 |
|
40974 |
|
40975 | ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer;
|
40976 |
|
40977 | |
40978 |
|
40979 |
|
40980 |
|
40981 |
|
40982 |
|
40983 |
|
40984 |
|
40985 |
|
40986 |
|
40987 |
|
40988 | ByteBufferPrototype.toString = function(encoding, begin, end) {
|
40989 | if (typeof encoding === 'undefined')
|
40990 | return "ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";
|
40991 | if (typeof encoding === 'number')
|
40992 | encoding = "utf8",
|
40993 | begin = encoding,
|
40994 | end = begin;
|
40995 | switch (encoding) {
|
40996 | case "utf8":
|
40997 | return this.toUTF8(begin, end);
|
40998 | case "base64":
|
40999 | return this.toBase64(begin, end);
|
41000 | case "hex":
|
41001 | return this.toHex(begin, end);
|
41002 | case "binary":
|
41003 | return this.toBinary(begin, end);
|
41004 | case "debug":
|
41005 | return this.toDebug();
|
41006 | case "columns":
|
41007 | return this.toColumns();
|
41008 | default:
|
41009 | throw Error("Unsupported encoding: "+encoding);
|
41010 | }
|
41011 | };
|
41012 |
|
41013 |
|
41014 |
|
41015 | |
41016 |
|
41017 |
|
41018 |
|
41019 |
|
41020 | var lxiv = function() {
|
41021 | "use strict";
|
41022 |
|
41023 | |
41024 |
|
41025 |
|
41026 |
|
41027 |
|
41028 | var lxiv = {};
|
41029 |
|
41030 | |
41031 |
|
41032 |
|
41033 |
|
41034 |
|
41035 | var aout = [
|
41036 | 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
|
41037 | 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,
|
41038 | 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
|
41039 | 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47
|
41040 | ];
|
41041 |
|
41042 | |
41043 |
|
41044 |
|
41045 |
|
41046 |
|
41047 | var ain = [];
|
41048 | for (var i=0, k=aout.length; i<k; ++i)
|
41049 | ain[aout[i]] = i;
|
41050 |
|
41051 | |
41052 |
|
41053 |
|
41054 |
|
41055 |
|
41056 |
|
41057 |
|
41058 | lxiv.encode = function(src, dst) {
|
41059 | var b, t;
|
41060 | while ((b = src()) !== null) {
|
41061 | dst(aout[(b>>2)&0x3f]);
|
41062 | t = (b&0x3)<<4;
|
41063 | if ((b = src()) !== null) {
|
41064 | t |= (b>>4)&0xf;
|
41065 | dst(aout[(t|((b>>4)&0xf))&0x3f]);
|
41066 | t = (b&0xf)<<2;
|
41067 | if ((b = src()) !== null)
|
41068 | dst(aout[(t|((b>>6)&0x3))&0x3f]),
|
41069 | dst(aout[b&0x3f]);
|
41070 | else
|
41071 | dst(aout[t&0x3f]),
|
41072 | dst(61);
|
41073 | } else
|
41074 | dst(aout[t&0x3f]),
|
41075 | dst(61),
|
41076 | dst(61);
|
41077 | }
|
41078 | };
|
41079 |
|
41080 | |
41081 |
|
41082 |
|
41083 |
|
41084 |
|
41085 |
|
41086 |
|
41087 | lxiv.decode = function(src, dst) {
|
41088 | var c, t1, t2;
|
41089 | function fail(c) {
|
41090 | throw Error("Illegal character code: "+c);
|
41091 | }
|
41092 | while ((c = src()) !== null) {
|
41093 | t1 = ain[c];
|
41094 | if (typeof t1 === 'undefined') fail(c);
|
41095 | if ((c = src()) !== null) {
|
41096 | t2 = ain[c];
|
41097 | if (typeof t2 === 'undefined') fail(c);
|
41098 | dst((t1<<2)>>>0|(t2&0x30)>>4);
|
41099 | if ((c = src()) !== null) {
|
41100 | t1 = ain[c];
|
41101 | if (typeof t1 === 'undefined')
|
41102 | if (c === 61) break; else fail(c);
|
41103 | dst(((t2&0xf)<<4)>>>0|(t1&0x3c)>>2);
|
41104 | if ((c = src()) !== null) {
|
41105 | t2 = ain[c];
|
41106 | if (typeof t2 === 'undefined')
|
41107 | if (c === 61) break; else fail(c);
|
41108 | dst(((t1&0x3)<<6)>>>0|t2);
|
41109 | }
|
41110 | }
|
41111 | }
|
41112 | }
|
41113 | };
|
41114 |
|
41115 | |
41116 |
|
41117 |
|
41118 |
|
41119 |
|
41120 | lxiv.test = function(str) {
|
41121 | return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str);
|
41122 | };
|
41123 |
|
41124 | return lxiv;
|
41125 | }();
|
41126 |
|
41127 |
|
41128 |
|
41129 | |
41130 |
|
41131 |
|
41132 |
|
41133 |
|
41134 |
|
41135 |
|
41136 |
|
41137 | ByteBufferPrototype.toBase64 = function(begin, end) {
|
41138 | if (typeof begin === 'undefined')
|
41139 | begin = this.offset;
|
41140 | if (typeof end === 'undefined')
|
41141 | end = this.limit;
|
41142 | begin = begin | 0; end = end | 0;
|
41143 | if (begin < 0 || end > this.capacity || begin > end)
|
41144 | throw RangeError("begin, end");
|
41145 | var sd; lxiv.encode(function() {
|
41146 | return begin < end ? this.view[begin++] : null;
|
41147 | }.bind(this), sd = stringDestination());
|
41148 | return sd();
|
41149 | };
|
41150 |
|
41151 | |
41152 |
|
41153 |
|
41154 |
|
41155 |
|
41156 |
|
41157 |
|
41158 |
|
41159 | ByteBuffer.fromBase64 = function(str, littleEndian) {
|
41160 | if (typeof str !== 'string')
|
41161 | throw TypeError("str");
|
41162 | var bb = new ByteBuffer(str.length/4*3, littleEndian),
|
41163 | i = 0;
|
41164 | lxiv.decode(stringSource(str), function(b) {
|
41165 | bb.view[i++] = b;
|
41166 | });
|
41167 | bb.limit = i;
|
41168 | return bb;
|
41169 | };
|
41170 |
|
41171 | |
41172 |
|
41173 |
|
41174 |
|
41175 |
|
41176 |
|
41177 |
|
41178 | ByteBuffer.btoa = function(str) {
|
41179 | return ByteBuffer.fromBinary(str).toBase64();
|
41180 | };
|
41181 |
|
41182 | |
41183 |
|
41184 |
|
41185 |
|
41186 |
|
41187 |
|
41188 |
|
41189 | ByteBuffer.atob = function(b64) {
|
41190 | return ByteBuffer.fromBase64(b64).toBinary();
|
41191 | };
|
41192 |
|
41193 |
|
41194 |
|
41195 | |
41196 |
|
41197 |
|
41198 |
|
41199 |
|
41200 |
|
41201 |
|
41202 |
|
41203 | ByteBufferPrototype.toBinary = function(begin, end) {
|
41204 | if (typeof begin === 'undefined')
|
41205 | begin = this.offset;
|
41206 | if (typeof end === 'undefined')
|
41207 | end = this.limit;
|
41208 | begin |= 0; end |= 0;
|
41209 | if (begin < 0 || end > this.capacity() || begin > end)
|
41210 | throw RangeError("begin, end");
|
41211 | if (begin === end)
|
41212 | return "";
|
41213 | var chars = [],
|
41214 | parts = [];
|
41215 | while (begin < end) {
|
41216 | chars.push(this.view[begin++]);
|
41217 | if (chars.length >= 1024)
|
41218 | parts.push(String.fromCharCode.apply(String, chars)),
|
41219 | chars = [];
|
41220 | }
|
41221 | return parts.join('') + String.fromCharCode.apply(String, chars);
|
41222 | };
|
41223 |
|
41224 | |
41225 |
|
41226 |
|
41227 |
|
41228 |
|
41229 |
|
41230 |
|
41231 |
|
41232 | ByteBuffer.fromBinary = function(str, littleEndian) {
|
41233 | if (typeof str !== 'string')
|
41234 | throw TypeError("str");
|
41235 | var i = 0,
|
41236 | k = str.length,
|
41237 | charCode,
|
41238 | bb = new ByteBuffer(k, littleEndian);
|
41239 | while (i<k) {
|
41240 | charCode = str.charCodeAt(i);
|
41241 | if (charCode > 0xff)
|
41242 | throw RangeError("illegal char code: "+charCode);
|
41243 | bb.view[i++] = charCode;
|
41244 | }
|
41245 | bb.limit = k;
|
41246 | return bb;
|
41247 | };
|
41248 |
|
41249 |
|
41250 |
|
41251 | |
41252 |
|
41253 |
|
41254 |
|
41255 |
|
41256 |
|
41257 |
|
41258 |
|
41259 |
|
41260 |
|
41261 |
|
41262 |
|
41263 |
|
41264 |
|
41265 |
|
41266 |
|
41267 |
|
41268 | ByteBufferPrototype.toDebug = function(columns) {
|
41269 | var i = -1,
|
41270 | k = this.buffer.byteLength,
|
41271 | b,
|
41272 | hex = "",
|
41273 | asc = "",
|
41274 | out = "";
|
41275 | while (i<k) {
|
41276 | if (i !== -1) {
|
41277 | b = this.view[i];
|
41278 | if (b < 0x10) hex += "0"+b.toString(16).toUpperCase();
|
41279 | else hex += b.toString(16).toUpperCase();
|
41280 | if (columns)
|
41281 | asc += b > 32 && b < 127 ? String.fromCharCode(b) : '.';
|
41282 | }
|
41283 | ++i;
|
41284 | if (columns) {
|
41285 | if (i > 0 && i % 16 === 0 && i !== k) {
|
41286 | while (hex.length < 3*16+3) hex += " ";
|
41287 | out += hex+asc+"\n";
|
41288 | hex = asc = "";
|
41289 | }
|
41290 | }
|
41291 | if (i === this.offset && i === this.limit)
|
41292 | hex += i === this.markedOffset ? "!" : "|";
|
41293 | else if (i === this.offset)
|
41294 | hex += i === this.markedOffset ? "[" : "<";
|
41295 | else if (i === this.limit)
|
41296 | hex += i === this.markedOffset ? "]" : ">";
|
41297 | else
|
41298 | hex += i === this.markedOffset ? "'" : (columns || (i !== 0 && i !== k) ? " " : "");
|
41299 | }
|
41300 | if (columns && hex !== " ") {
|
41301 | while (hex.length < 3*16+3)
|
41302 | hex += " ";
|
41303 | out += hex + asc + "\n";
|
41304 | }
|
41305 | return columns ? out : hex;
|
41306 | };
|
41307 |
|
41308 | |
41309 |
|
41310 |
|
41311 |
|
41312 |
|
41313 |
|
41314 |
|
41315 |
|
41316 |
|
41317 |
|
41318 |
|
41319 | ByteBuffer.fromDebug = function(str, littleEndian, noAssert) {
|
41320 | var k = str.length,
|
41321 | bb = new ByteBuffer(((k+1)/3)|0, littleEndian, noAssert);
|
41322 | var i = 0, j = 0, ch, b,
|
41323 | rs = false,
|
41324 | ho = false, hm = false, hl = false,
|
41325 | fail = false;
|
41326 | while (i<k) {
|
41327 | switch (ch = str.charAt(i++)) {
|
41328 | case '!':
|
41329 | if (!noAssert) {
|
41330 | if (ho || hm || hl) {
|
41331 | fail = true;
|
41332 | break;
|
41333 | }
|
41334 | ho = hm = hl = true;
|
41335 | }
|
41336 | bb.offset = bb.markedOffset = bb.limit = j;
|
41337 | rs = false;
|
41338 | break;
|
41339 | case '|':
|
41340 | if (!noAssert) {
|
41341 | if (ho || hl) {
|
41342 | fail = true;
|
41343 | break;
|
41344 | }
|
41345 | ho = hl = true;
|
41346 | }
|
41347 | bb.offset = bb.limit = j;
|
41348 | rs = false;
|
41349 | break;
|
41350 | case '[':
|
41351 | if (!noAssert) {
|
41352 | if (ho || hm) {
|
41353 | fail = true;
|
41354 | break;
|
41355 | }
|
41356 | ho = hm = true;
|
41357 | }
|
41358 | bb.offset = bb.markedOffset = j;
|
41359 | rs = false;
|
41360 | break;
|
41361 | case '<':
|
41362 | if (!noAssert) {
|
41363 | if (ho) {
|
41364 | fail = true;
|
41365 | break;
|
41366 | }
|
41367 | ho = true;
|
41368 | }
|
41369 | bb.offset = j;
|
41370 | rs = false;
|
41371 | break;
|
41372 | case ']':
|
41373 | if (!noAssert) {
|
41374 | if (hl || hm) {
|
41375 | fail = true;
|
41376 | break;
|
41377 | }
|
41378 | hl = hm = true;
|
41379 | }
|
41380 | bb.limit = bb.markedOffset = j;
|
41381 | rs = false;
|
41382 | break;
|
41383 | case '>':
|
41384 | if (!noAssert) {
|
41385 | if (hl) {
|
41386 | fail = true;
|
41387 | break;
|
41388 | }
|
41389 | hl = true;
|
41390 | }
|
41391 | bb.limit = j;
|
41392 | rs = false;
|
41393 | break;
|
41394 | case "'":
|
41395 | if (!noAssert) {
|
41396 | if (hm) {
|
41397 | fail = true;
|
41398 | break;
|
41399 | }
|
41400 | hm = true;
|
41401 | }
|
41402 | bb.markedOffset = j;
|
41403 | rs = false;
|
41404 | break;
|
41405 | case ' ':
|
41406 | rs = false;
|
41407 | break;
|
41408 | default:
|
41409 | if (!noAssert) {
|
41410 | if (rs) {
|
41411 | fail = true;
|
41412 | break;
|
41413 | }
|
41414 | }
|
41415 | b = parseInt(ch+str.charAt(i++), 16);
|
41416 | if (!noAssert) {
|
41417 | if (isNaN(b) || b < 0 || b > 255)
|
41418 | throw TypeError("Illegal str: Not a debug encoded string");
|
41419 | }
|
41420 | bb.view[j++] = b;
|
41421 | rs = true;
|
41422 | }
|
41423 | if (fail)
|
41424 | throw TypeError("Illegal str: Invalid symbol at "+i);
|
41425 | }
|
41426 | if (!noAssert) {
|
41427 | if (!ho || !hl)
|
41428 | throw TypeError("Illegal str: Missing offset or limit");
|
41429 | if (j<bb.buffer.byteLength)
|
41430 | throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+j+" < "+k);
|
41431 | }
|
41432 | return bb;
|
41433 | };
|
41434 |
|
41435 |
|
41436 |
|
41437 | |
41438 |
|
41439 |
|
41440 |
|
41441 |
|
41442 |
|
41443 |
|
41444 | ByteBufferPrototype.toHex = function(begin, end) {
|
41445 | begin = typeof begin === 'undefined' ? this.offset : begin;
|
41446 | end = typeof end === 'undefined' ? this.limit : end;
|
41447 | if (!this.noAssert) {
|
41448 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
41449 | throw TypeError("Illegal begin: Not an integer");
|
41450 | begin >>>= 0;
|
41451 | if (typeof end !== 'number' || end % 1 !== 0)
|
41452 | throw TypeError("Illegal end: Not an integer");
|
41453 | end >>>= 0;
|
41454 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
41455 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
41456 | }
|
41457 | var out = new Array(end - begin),
|
41458 | b;
|
41459 | while (begin < end) {
|
41460 | b = this.view[begin++];
|
41461 | if (b < 0x10)
|
41462 | out.push("0", b.toString(16));
|
41463 | else out.push(b.toString(16));
|
41464 | }
|
41465 | return out.join('');
|
41466 | };
|
41467 |
|
41468 | |
41469 |
|
41470 |
|
41471 |
|
41472 |
|
41473 |
|
41474 |
|
41475 |
|
41476 |
|
41477 |
|
41478 | ByteBuffer.fromHex = function(str, littleEndian, noAssert) {
|
41479 | if (!noAssert) {
|
41480 | if (typeof str !== 'string')
|
41481 | throw TypeError("Illegal str: Not a string");
|
41482 | if (str.length % 2 !== 0)
|
41483 | throw TypeError("Illegal str: Length not a multiple of 2");
|
41484 | }
|
41485 | var k = str.length,
|
41486 | bb = new ByteBuffer((k / 2) | 0, littleEndian),
|
41487 | b;
|
41488 | for (var i=0, j=0; i<k; i+=2) {
|
41489 | b = parseInt(str.substring(i, i+2), 16);
|
41490 | if (!noAssert)
|
41491 | if (!isFinite(b) || b < 0 || b > 255)
|
41492 | throw TypeError("Illegal str: Contains non-hex characters");
|
41493 | bb.view[j++] = b;
|
41494 | }
|
41495 | bb.limit = j;
|
41496 | return bb;
|
41497 | };
|
41498 |
|
41499 |
|
41500 |
|
41501 | |
41502 |
|
41503 |
|
41504 |
|
41505 |
|
41506 | var utfx = function() {
|
41507 | "use strict";
|
41508 |
|
41509 | |
41510 |
|
41511 |
|
41512 |
|
41513 |
|
41514 | var utfx = {};
|
41515 |
|
41516 | |
41517 |
|
41518 |
|
41519 |
|
41520 |
|
41521 | utfx.MAX_CODEPOINT = 0x10FFFF;
|
41522 |
|
41523 | |
41524 |
|
41525 |
|
41526 |
|
41527 |
|
41528 |
|
41529 | utfx.encodeUTF8 = function(src, dst) {
|
41530 | var cp = null;
|
41531 | if (typeof src === 'number')
|
41532 | cp = src,
|
41533 | src = function() { return null; };
|
41534 | while (cp !== null || (cp = src()) !== null) {
|
41535 | if (cp < 0x80)
|
41536 | dst(cp&0x7F);
|
41537 | else if (cp < 0x800)
|
41538 | dst(((cp>>6)&0x1F)|0xC0),
|
41539 | dst((cp&0x3F)|0x80);
|
41540 | else if (cp < 0x10000)
|
41541 | dst(((cp>>12)&0x0F)|0xE0),
|
41542 | dst(((cp>>6)&0x3F)|0x80),
|
41543 | dst((cp&0x3F)|0x80);
|
41544 | else
|
41545 | dst(((cp>>18)&0x07)|0xF0),
|
41546 | dst(((cp>>12)&0x3F)|0x80),
|
41547 | dst(((cp>>6)&0x3F)|0x80),
|
41548 | dst((cp&0x3F)|0x80);
|
41549 | cp = null;
|
41550 | }
|
41551 | };
|
41552 |
|
41553 | |
41554 |
|
41555 |
|
41556 |
|
41557 |
|
41558 |
|
41559 |
|
41560 |
|
41561 |
|
41562 | utfx.decodeUTF8 = function(src, dst) {
|
41563 | var a, b, c, d, fail = function(b) {
|
41564 | b = b.slice(0, b.indexOf(null));
|
41565 | var err = Error(b.toString());
|
41566 | err.name = "TruncatedError";
|
41567 | err['bytes'] = b;
|
41568 | throw err;
|
41569 | };
|
41570 | while ((a = src()) !== null) {
|
41571 | if ((a&0x80) === 0)
|
41572 | dst(a);
|
41573 | else if ((a&0xE0) === 0xC0)
|
41574 | ((b = src()) === null) && fail([a, b]),
|
41575 | dst(((a&0x1F)<<6) | (b&0x3F));
|
41576 | else if ((a&0xF0) === 0xE0)
|
41577 | ((b=src()) === null || (c=src()) === null) && fail([a, b, c]),
|
41578 | dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F));
|
41579 | else if ((a&0xF8) === 0xF0)
|
41580 | ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]),
|
41581 | dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F));
|
41582 | else throw RangeError("Illegal starting byte: "+a);
|
41583 | }
|
41584 | };
|
41585 |
|
41586 | |
41587 |
|
41588 |
|
41589 |
|
41590 |
|
41591 |
|
41592 |
|
41593 | utfx.UTF16toUTF8 = function(src, dst) {
|
41594 | var c1, c2 = null;
|
41595 | while (true) {
|
41596 | if ((c1 = c2 !== null ? c2 : src()) === null)
|
41597 | break;
|
41598 | if (c1 >= 0xD800 && c1 <= 0xDFFF) {
|
41599 | if ((c2 = src()) !== null) {
|
41600 | if (c2 >= 0xDC00 && c2 <= 0xDFFF) {
|
41601 | dst((c1-0xD800)*0x400+c2-0xDC00+0x10000);
|
41602 | c2 = null; continue;
|
41603 | }
|
41604 | }
|
41605 | }
|
41606 | dst(c1);
|
41607 | }
|
41608 | if (c2 !== null) dst(c2);
|
41609 | };
|
41610 |
|
41611 | |
41612 |
|
41613 |
|
41614 |
|
41615 |
|
41616 |
|
41617 |
|
41618 | utfx.UTF8toUTF16 = function(src, dst) {
|
41619 | var cp = null;
|
41620 | if (typeof src === 'number')
|
41621 | cp = src, src = function() { return null; };
|
41622 | while (cp !== null || (cp = src()) !== null) {
|
41623 | if (cp <= 0xFFFF)
|
41624 | dst(cp);
|
41625 | else
|
41626 | cp -= 0x10000,
|
41627 | dst((cp>>10)+0xD800),
|
41628 | dst((cp%0x400)+0xDC00);
|
41629 | cp = null;
|
41630 | }
|
41631 | };
|
41632 |
|
41633 | |
41634 |
|
41635 |
|
41636 |
|
41637 |
|
41638 |
|
41639 | utfx.encodeUTF16toUTF8 = function(src, dst) {
|
41640 | utfx.UTF16toUTF8(src, function(cp) {
|
41641 | utfx.encodeUTF8(cp, dst);
|
41642 | });
|
41643 | };
|
41644 |
|
41645 | |
41646 |
|
41647 |
|
41648 |
|
41649 |
|
41650 |
|
41651 |
|
41652 |
|
41653 | utfx.decodeUTF8toUTF16 = function(src, dst) {
|
41654 | utfx.decodeUTF8(src, function(cp) {
|
41655 | utfx.UTF8toUTF16(cp, dst);
|
41656 | });
|
41657 | };
|
41658 |
|
41659 | |
41660 |
|
41661 |
|
41662 |
|
41663 |
|
41664 | utfx.calculateCodePoint = function(cp) {
|
41665 | return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
|
41666 | };
|
41667 |
|
41668 | |
41669 |
|
41670 |
|
41671 |
|
41672 |
|
41673 |
|
41674 | utfx.calculateUTF8 = function(src) {
|
41675 | var cp, l=0;
|
41676 | while ((cp = src()) !== null)
|
41677 | l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
|
41678 | return l;
|
41679 | };
|
41680 |
|
41681 | |
41682 |
|
41683 |
|
41684 |
|
41685 |
|
41686 |
|
41687 | utfx.calculateUTF16asUTF8 = function(src) {
|
41688 | var n=0, l=0;
|
41689 | utfx.UTF16toUTF8(src, function(cp) {
|
41690 | ++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
|
41691 | });
|
41692 | return [n,l];
|
41693 | };
|
41694 |
|
41695 | return utfx;
|
41696 | }();
|
41697 |
|
41698 |
|
41699 |
|
41700 | |
41701 |
|
41702 |
|
41703 |
|
41704 |
|
41705 |
|
41706 |
|
41707 | ByteBufferPrototype.toUTF8 = function(begin, end) {
|
41708 | if (typeof begin === 'undefined') begin = this.offset;
|
41709 | if (typeof end === 'undefined') end = this.limit;
|
41710 | if (!this.noAssert) {
|
41711 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
41712 | throw TypeError("Illegal begin: Not an integer");
|
41713 | begin >>>= 0;
|
41714 | if (typeof end !== 'number' || end % 1 !== 0)
|
41715 | throw TypeError("Illegal end: Not an integer");
|
41716 | end >>>= 0;
|
41717 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
41718 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
41719 | }
|
41720 | var sd; try {
|
41721 | utfx.decodeUTF8toUTF16(function() {
|
41722 | return begin < end ? this.view[begin++] : null;
|
41723 | }.bind(this), sd = stringDestination());
|
41724 | } catch (e) {
|
41725 | if (begin !== end)
|
41726 | throw RangeError("Illegal range: Truncated data, "+begin+" != "+end);
|
41727 | }
|
41728 | return sd();
|
41729 | };
|
41730 |
|
41731 | |
41732 |
|
41733 |
|
41734 |
|
41735 |
|
41736 |
|
41737 |
|
41738 |
|
41739 |
|
41740 |
|
41741 | ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) {
|
41742 | if (!noAssert)
|
41743 | if (typeof str !== 'string')
|
41744 | throw TypeError("Illegal str: Not a string");
|
41745 | var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert),
|
41746 | i = 0;
|
41747 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
41748 | bb.view[i++] = b;
|
41749 | });
|
41750 | bb.limit = i;
|
41751 | return bb;
|
41752 | };
|
41753 |
|
41754 | return ByteBuffer;
|
41755 | });
|
41756 |
|
41757 |
|
41758 | }),
|
41759 |
|
41760 | (function(module, exports, __webpack_require__) {
|
41761 |
|
41762 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
41763 |
|
41764 |
|
41765 |
|
41766 |
|
41767 |
|
41768 |
|
41769 |
|
41770 |
|
41771 |
|
41772 |
|
41773 |
|
41774 |
|
41775 |
|
41776 |
|
41777 |
|
41778 |
|
41779 |
|
41780 |
|
41781 |
|
41782 |
|
41783 |
|
41784 | (function(global, factory) {
|
41785 |
|
41786 | if (true)
|
41787 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
41788 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
41789 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
41790 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
41791 | else if (typeof require === 'function' && typeof module === "object" && module && module["exports"])
|
41792 | module["exports"] = factory();
|
41793 | else
|
41794 | (global["dcodeIO"] = global["dcodeIO"] || {})["Long"] = factory();
|
41795 |
|
41796 | })(this, function() {
|
41797 | "use strict";
|
41798 |
|
41799 | |
41800 |
|
41801 |
|
41802 |
|
41803 |
|
41804 |
|
41805 |
|
41806 |
|
41807 |
|
41808 |
|
41809 | function Long(low, high, unsigned) {
|
41810 |
|
41811 | |
41812 |
|
41813 |
|
41814 |
|
41815 | this.low = low | 0;
|
41816 |
|
41817 | |
41818 |
|
41819 |
|
41820 |
|
41821 | this.high = high | 0;
|
41822 |
|
41823 | |
41824 |
|
41825 |
|
41826 |
|
41827 | this.unsigned = !!unsigned;
|
41828 | }
|
41829 |
|
41830 |
|
41831 |
|
41832 |
|
41833 |
|
41834 |
|
41835 |
|
41836 |
|
41837 |
|
41838 |
|
41839 |
|
41840 |
|
41841 |
|
41842 |
|
41843 |
|
41844 |
|
41845 |
|
41846 |
|
41847 | |
41848 |
|
41849 |
|
41850 |
|
41851 |
|
41852 |
|
41853 | Long.prototype.__isLong__;
|
41854 |
|
41855 | Object.defineProperty(Long.prototype, "__isLong__", {
|
41856 | value: true,
|
41857 | enumerable: false,
|
41858 | configurable: false
|
41859 | });
|
41860 |
|
41861 | |
41862 |
|
41863 |
|
41864 |
|
41865 |
|
41866 |
|
41867 | function isLong(obj) {
|
41868 | return (obj && obj["__isLong__"]) === true;
|
41869 | }
|
41870 |
|
41871 | |
41872 |
|
41873 |
|
41874 |
|
41875 |
|
41876 |
|
41877 | Long.isLong = isLong;
|
41878 |
|
41879 | |
41880 |
|
41881 |
|
41882 |
|
41883 |
|
41884 | var INT_CACHE = {};
|
41885 |
|
41886 | |
41887 |
|
41888 |
|
41889 |
|
41890 |
|
41891 | var UINT_CACHE = {};
|
41892 |
|
41893 | |
41894 |
|
41895 |
|
41896 |
|
41897 |
|
41898 |
|
41899 | function fromInt(value, unsigned) {
|
41900 | var obj, cachedObj, cache;
|
41901 | if (unsigned) {
|
41902 | value >>>= 0;
|
41903 | if (cache = (0 <= value && value < 256)) {
|
41904 | cachedObj = UINT_CACHE[value];
|
41905 | if (cachedObj)
|
41906 | return cachedObj;
|
41907 | }
|
41908 | obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);
|
41909 | if (cache)
|
41910 | UINT_CACHE[value] = obj;
|
41911 | return obj;
|
41912 | } else {
|
41913 | value |= 0;
|
41914 | if (cache = (-128 <= value && value < 128)) {
|
41915 | cachedObj = INT_CACHE[value];
|
41916 | if (cachedObj)
|
41917 | return cachedObj;
|
41918 | }
|
41919 | obj = fromBits(value, value < 0 ? -1 : 0, false);
|
41920 | if (cache)
|
41921 | INT_CACHE[value] = obj;
|
41922 | return obj;
|
41923 | }
|
41924 | }
|
41925 |
|
41926 | |
41927 |
|
41928 |
|
41929 |
|
41930 |
|
41931 |
|
41932 |
|
41933 | Long.fromInt = fromInt;
|
41934 |
|
41935 | |
41936 |
|
41937 |
|
41938 |
|
41939 |
|
41940 |
|
41941 | function fromNumber(value, unsigned) {
|
41942 | if (isNaN(value) || !isFinite(value))
|
41943 | return unsigned ? UZERO : ZERO;
|
41944 | if (unsigned) {
|
41945 | if (value < 0)
|
41946 | return UZERO;
|
41947 | if (value >= TWO_PWR_64_DBL)
|
41948 | return MAX_UNSIGNED_VALUE;
|
41949 | } else {
|
41950 | if (value <= -TWO_PWR_63_DBL)
|
41951 | return MIN_VALUE;
|
41952 | if (value + 1 >= TWO_PWR_63_DBL)
|
41953 | return MAX_VALUE;
|
41954 | }
|
41955 | if (value < 0)
|
41956 | return fromNumber(-value, unsigned).neg();
|
41957 | return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);
|
41958 | }
|
41959 |
|
41960 | |
41961 |
|
41962 |
|
41963 |
|
41964 |
|
41965 |
|
41966 |
|
41967 | Long.fromNumber = fromNumber;
|
41968 |
|
41969 | |
41970 |
|
41971 |
|
41972 |
|
41973 |
|
41974 |
|
41975 |
|
41976 | function fromBits(lowBits, highBits, unsigned) {
|
41977 | return new Long(lowBits, highBits, unsigned);
|
41978 | }
|
41979 |
|
41980 | |
41981 |
|
41982 |
|
41983 |
|
41984 |
|
41985 |
|
41986 |
|
41987 |
|
41988 |
|
41989 | Long.fromBits = fromBits;
|
41990 |
|
41991 | |
41992 |
|
41993 |
|
41994 |
|
41995 |
|
41996 |
|
41997 |
|
41998 | var pow_dbl = Math.pow;
|
41999 |
|
42000 | |
42001 |
|
42002 |
|
42003 |
|
42004 |
|
42005 |
|
42006 |
|
42007 | function fromString(str, unsigned, radix) {
|
42008 | if (str.length === 0)
|
42009 | throw Error('empty string');
|
42010 | if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
|
42011 | return ZERO;
|
42012 | if (typeof unsigned === 'number') {
|
42013 |
|
42014 | radix = unsigned,
|
42015 | unsigned = false;
|
42016 | } else {
|
42017 | unsigned = !! unsigned;
|
42018 | }
|
42019 | radix = radix || 10;
|
42020 | if (radix < 2 || 36 < radix)
|
42021 | throw RangeError('radix');
|
42022 |
|
42023 | var p;
|
42024 | if ((p = str.indexOf('-')) > 0)
|
42025 | throw Error('interior hyphen');
|
42026 | else if (p === 0) {
|
42027 | return fromString(str.substring(1), unsigned, radix).neg();
|
42028 | }
|
42029 |
|
42030 |
|
42031 |
|
42032 | var radixToPower = fromNumber(pow_dbl(radix, 8));
|
42033 |
|
42034 | var result = ZERO;
|
42035 | for (var i = 0; i < str.length; i += 8) {
|
42036 | var size = Math.min(8, str.length - i),
|
42037 | value = parseInt(str.substring(i, i + size), radix);
|
42038 | if (size < 8) {
|
42039 | var power = fromNumber(pow_dbl(radix, size));
|
42040 | result = result.mul(power).add(fromNumber(value));
|
42041 | } else {
|
42042 | result = result.mul(radixToPower);
|
42043 | result = result.add(fromNumber(value));
|
42044 | }
|
42045 | }
|
42046 | result.unsigned = unsigned;
|
42047 | return result;
|
42048 | }
|
42049 |
|
42050 | |
42051 |
|
42052 |
|
42053 |
|
42054 |
|
42055 |
|
42056 |
|
42057 |
|
42058 | Long.fromString = fromString;
|
42059 |
|
42060 | |
42061 |
|
42062 |
|
42063 |
|
42064 |
|
42065 |
|
42066 | function fromValue(val) {
|
42067 | if (val instanceof Long)
|
42068 | return val;
|
42069 | if (typeof val === 'number')
|
42070 | return fromNumber(val);
|
42071 | if (typeof val === 'string')
|
42072 | return fromString(val);
|
42073 |
|
42074 | return fromBits(val.low, val.high, val.unsigned);
|
42075 | }
|
42076 |
|
42077 | |
42078 |
|
42079 |
|
42080 |
|
42081 |
|
42082 |
|
42083 | Long.fromValue = fromValue;
|
42084 |
|
42085 |
|
42086 |
|
42087 |
|
42088 | |
42089 |
|
42090 |
|
42091 |
|
42092 |
|
42093 | var TWO_PWR_16_DBL = 1 << 16;
|
42094 |
|
42095 | |
42096 |
|
42097 |
|
42098 |
|
42099 |
|
42100 | var TWO_PWR_24_DBL = 1 << 24;
|
42101 |
|
42102 | |
42103 |
|
42104 |
|
42105 |
|
42106 |
|
42107 | var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
|
42108 |
|
42109 | |
42110 |
|
42111 |
|
42112 |
|
42113 |
|
42114 | var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;
|
42115 |
|
42116 | |
42117 |
|
42118 |
|
42119 |
|
42120 |
|
42121 | var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;
|
42122 |
|
42123 | |
42124 |
|
42125 |
|
42126 |
|
42127 |
|
42128 | var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);
|
42129 |
|
42130 | |
42131 |
|
42132 |
|
42133 |
|
42134 | var ZERO = fromInt(0);
|
42135 |
|
42136 | |
42137 |
|
42138 |
|
42139 |
|
42140 | Long.ZERO = ZERO;
|
42141 |
|
42142 | |
42143 |
|
42144 |
|
42145 |
|
42146 | var UZERO = fromInt(0, true);
|
42147 |
|
42148 | |
42149 |
|
42150 |
|
42151 |
|
42152 | Long.UZERO = UZERO;
|
42153 |
|
42154 | |
42155 |
|
42156 |
|
42157 |
|
42158 | var ONE = fromInt(1);
|
42159 |
|
42160 | |
42161 |
|
42162 |
|
42163 |
|
42164 | Long.ONE = ONE;
|
42165 |
|
42166 | |
42167 |
|
42168 |
|
42169 |
|
42170 | var UONE = fromInt(1, true);
|
42171 |
|
42172 | |
42173 |
|
42174 |
|
42175 |
|
42176 | Long.UONE = UONE;
|
42177 |
|
42178 | |
42179 |
|
42180 |
|
42181 |
|
42182 | var NEG_ONE = fromInt(-1);
|
42183 |
|
42184 | |
42185 |
|
42186 |
|
42187 |
|
42188 | Long.NEG_ONE = NEG_ONE;
|
42189 |
|
42190 | |
42191 |
|
42192 |
|
42193 |
|
42194 | var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);
|
42195 |
|
42196 | |
42197 |
|
42198 |
|
42199 |
|
42200 | Long.MAX_VALUE = MAX_VALUE;
|
42201 |
|
42202 | |
42203 |
|
42204 |
|
42205 |
|
42206 | var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);
|
42207 |
|
42208 | |
42209 |
|
42210 |
|
42211 |
|
42212 | Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;
|
42213 |
|
42214 | |
42215 |
|
42216 |
|
42217 |
|
42218 | var MIN_VALUE = fromBits(0, 0x80000000|0, false);
|
42219 |
|
42220 | |
42221 |
|
42222 |
|
42223 |
|
42224 | Long.MIN_VALUE = MIN_VALUE;
|
42225 |
|
42226 | |
42227 |
|
42228 |
|
42229 |
|
42230 | var LongPrototype = Long.prototype;
|
42231 |
|
42232 | |
42233 |
|
42234 |
|
42235 |
|
42236 | LongPrototype.toInt = function toInt() {
|
42237 | return this.unsigned ? this.low >>> 0 : this.low;
|
42238 | };
|
42239 |
|
42240 | |
42241 |
|
42242 |
|
42243 |
|
42244 | LongPrototype.toNumber = function toNumber() {
|
42245 | if (this.unsigned)
|
42246 | return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);
|
42247 | return this.high * TWO_PWR_32_DBL + (this.low >>> 0);
|
42248 | };
|
42249 |
|
42250 | |
42251 |
|
42252 |
|
42253 |
|
42254 |
|
42255 |
|
42256 |
|
42257 | LongPrototype.toString = function toString(radix) {
|
42258 | radix = radix || 10;
|
42259 | if (radix < 2 || 36 < radix)
|
42260 | throw RangeError('radix');
|
42261 | if (this.isZero())
|
42262 | return '0';
|
42263 | if (this.isNegative()) {
|
42264 | if (this.eq(MIN_VALUE)) {
|
42265 |
|
42266 |
|
42267 | var radixLong = fromNumber(radix),
|
42268 | div = this.div(radixLong),
|
42269 | rem1 = div.mul(radixLong).sub(this);
|
42270 | return div.toString(radix) + rem1.toInt().toString(radix);
|
42271 | } else
|
42272 | return '-' + this.neg().toString(radix);
|
42273 | }
|
42274 |
|
42275 |
|
42276 |
|
42277 | var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),
|
42278 | rem = this;
|
42279 | var result = '';
|
42280 | while (true) {
|
42281 | var remDiv = rem.div(radixToPower),
|
42282 | intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,
|
42283 | digits = intval.toString(radix);
|
42284 | rem = remDiv;
|
42285 | if (rem.isZero())
|
42286 | return digits + result;
|
42287 | else {
|
42288 | while (digits.length < 6)
|
42289 | digits = '0' + digits;
|
42290 | result = '' + digits + result;
|
42291 | }
|
42292 | }
|
42293 | };
|
42294 |
|
42295 | |
42296 |
|
42297 |
|
42298 |
|
42299 | LongPrototype.getHighBits = function getHighBits() {
|
42300 | return this.high;
|
42301 | };
|
42302 |
|
42303 | |
42304 |
|
42305 |
|
42306 |
|
42307 | LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {
|
42308 | return this.high >>> 0;
|
42309 | };
|
42310 |
|
42311 | |
42312 |
|
42313 |
|
42314 |
|
42315 | LongPrototype.getLowBits = function getLowBits() {
|
42316 | return this.low;
|
42317 | };
|
42318 |
|
42319 | |
42320 |
|
42321 |
|
42322 |
|
42323 | LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {
|
42324 | return this.low >>> 0;
|
42325 | };
|
42326 |
|
42327 | |
42328 |
|
42329 |
|
42330 |
|
42331 | LongPrototype.getNumBitsAbs = function getNumBitsAbs() {
|
42332 | if (this.isNegative())
|
42333 | return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();
|
42334 | var val = this.high != 0 ? this.high : this.low;
|
42335 | for (var bit = 31; bit > 0; bit--)
|
42336 | if ((val & (1 << bit)) != 0)
|
42337 | break;
|
42338 | return this.high != 0 ? bit + 33 : bit + 1;
|
42339 | };
|
42340 |
|
42341 | |
42342 |
|
42343 |
|
42344 |
|
42345 | LongPrototype.isZero = function isZero() {
|
42346 | return this.high === 0 && this.low === 0;
|
42347 | };
|
42348 |
|
42349 | |
42350 |
|
42351 |
|
42352 |
|
42353 | LongPrototype.isNegative = function isNegative() {
|
42354 | return !this.unsigned && this.high < 0;
|
42355 | };
|
42356 |
|
42357 | |
42358 |
|
42359 |
|
42360 |
|
42361 | LongPrototype.isPositive = function isPositive() {
|
42362 | return this.unsigned || this.high >= 0;
|
42363 | };
|
42364 |
|
42365 | |
42366 |
|
42367 |
|
42368 |
|
42369 | LongPrototype.isOdd = function isOdd() {
|
42370 | return (this.low & 1) === 1;
|
42371 | };
|
42372 |
|
42373 | |
42374 |
|
42375 |
|
42376 |
|
42377 | LongPrototype.isEven = function isEven() {
|
42378 | return (this.low & 1) === 0;
|
42379 | };
|
42380 |
|
42381 | |
42382 |
|
42383 |
|
42384 |
|
42385 |
|
42386 | LongPrototype.equals = function equals(other) {
|
42387 | if (!isLong(other))
|
42388 | other = fromValue(other);
|
42389 | if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)
|
42390 | return false;
|
42391 | return this.high === other.high && this.low === other.low;
|
42392 | };
|
42393 |
|
42394 | |
42395 |
|
42396 |
|
42397 |
|
42398 |
|
42399 |
|
42400 | LongPrototype.eq = LongPrototype.equals;
|
42401 |
|
42402 | |
42403 |
|
42404 |
|
42405 |
|
42406 |
|
42407 | LongPrototype.notEquals = function notEquals(other) {
|
42408 | return !this.eq( other);
|
42409 | };
|
42410 |
|
42411 | |
42412 |
|
42413 |
|
42414 |
|
42415 |
|
42416 |
|
42417 | LongPrototype.neq = LongPrototype.notEquals;
|
42418 |
|
42419 | |
42420 |
|
42421 |
|
42422 |
|
42423 |
|
42424 | LongPrototype.lessThan = function lessThan(other) {
|
42425 | return this.comp( other) < 0;
|
42426 | };
|
42427 |
|
42428 | |
42429 |
|
42430 |
|
42431 |
|
42432 |
|
42433 |
|
42434 | LongPrototype.lt = LongPrototype.lessThan;
|
42435 |
|
42436 | |
42437 |
|
42438 |
|
42439 |
|
42440 |
|
42441 | LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {
|
42442 | return this.comp( other) <= 0;
|
42443 | };
|
42444 |
|
42445 | |
42446 |
|
42447 |
|
42448 |
|
42449 |
|
42450 |
|
42451 | LongPrototype.lte = LongPrototype.lessThanOrEqual;
|
42452 |
|
42453 | |
42454 |
|
42455 |
|
42456 |
|
42457 |
|
42458 | LongPrototype.greaterThan = function greaterThan(other) {
|
42459 | return this.comp( other) > 0;
|
42460 | };
|
42461 |
|
42462 | |
42463 |
|
42464 |
|
42465 |
|
42466 |
|
42467 |
|
42468 | LongPrototype.gt = LongPrototype.greaterThan;
|
42469 |
|
42470 | |
42471 |
|
42472 |
|
42473 |
|
42474 |
|
42475 | LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {
|
42476 | return this.comp( other) >= 0;
|
42477 | };
|
42478 |
|
42479 | |
42480 |
|
42481 |
|
42482 |
|
42483 |
|
42484 |
|
42485 | LongPrototype.gte = LongPrototype.greaterThanOrEqual;
|
42486 |
|
42487 | |
42488 |
|
42489 |
|
42490 |
|
42491 |
|
42492 |
|
42493 | LongPrototype.compare = function compare(other) {
|
42494 | if (!isLong(other))
|
42495 | other = fromValue(other);
|
42496 | if (this.eq(other))
|
42497 | return 0;
|
42498 | var thisNeg = this.isNegative(),
|
42499 | otherNeg = other.isNegative();
|
42500 | if (thisNeg && !otherNeg)
|
42501 | return -1;
|
42502 | if (!thisNeg && otherNeg)
|
42503 | return 1;
|
42504 |
|
42505 | if (!this.unsigned)
|
42506 | return this.sub(other).isNegative() ? -1 : 1;
|
42507 |
|
42508 | return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;
|
42509 | };
|
42510 |
|
42511 | |
42512 |
|
42513 |
|
42514 |
|
42515 |
|
42516 |
|
42517 |
|
42518 | LongPrototype.comp = LongPrototype.compare;
|
42519 |
|
42520 | |
42521 |
|
42522 |
|
42523 |
|
42524 | LongPrototype.negate = function negate() {
|
42525 | if (!this.unsigned && this.eq(MIN_VALUE))
|
42526 | return MIN_VALUE;
|
42527 | return this.not().add(ONE);
|
42528 | };
|
42529 |
|
42530 | |
42531 |
|
42532 |
|
42533 |
|
42534 |
|
42535 | LongPrototype.neg = LongPrototype.negate;
|
42536 |
|
42537 | |
42538 |
|
42539 |
|
42540 |
|
42541 |
|
42542 | LongPrototype.add = function add(addend) {
|
42543 | if (!isLong(addend))
|
42544 | addend = fromValue(addend);
|
42545 |
|
42546 |
|
42547 |
|
42548 | var a48 = this.high >>> 16;
|
42549 | var a32 = this.high & 0xFFFF;
|
42550 | var a16 = this.low >>> 16;
|
42551 | var a00 = this.low & 0xFFFF;
|
42552 |
|
42553 | var b48 = addend.high >>> 16;
|
42554 | var b32 = addend.high & 0xFFFF;
|
42555 | var b16 = addend.low >>> 16;
|
42556 | var b00 = addend.low & 0xFFFF;
|
42557 |
|
42558 | var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
|
42559 | c00 += a00 + b00;
|
42560 | c16 += c00 >>> 16;
|
42561 | c00 &= 0xFFFF;
|
42562 | c16 += a16 + b16;
|
42563 | c32 += c16 >>> 16;
|
42564 | c16 &= 0xFFFF;
|
42565 | c32 += a32 + b32;
|
42566 | c48 += c32 >>> 16;
|
42567 | c32 &= 0xFFFF;
|
42568 | c48 += a48 + b48;
|
42569 | c48 &= 0xFFFF;
|
42570 | return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
|
42571 | };
|
42572 |
|
42573 | |
42574 |
|
42575 |
|
42576 |
|
42577 |
|
42578 | LongPrototype.subtract = function subtract(subtrahend) {
|
42579 | if (!isLong(subtrahend))
|
42580 | subtrahend = fromValue(subtrahend);
|
42581 | return this.add(subtrahend.neg());
|
42582 | };
|
42583 |
|
42584 | |
42585 |
|
42586 |
|
42587 |
|
42588 |
|
42589 |
|
42590 | LongPrototype.sub = LongPrototype.subtract;
|
42591 |
|
42592 | |
42593 |
|
42594 |
|
42595 |
|
42596 |
|
42597 | LongPrototype.multiply = function multiply(multiplier) {
|
42598 | if (this.isZero())
|
42599 | return ZERO;
|
42600 | if (!isLong(multiplier))
|
42601 | multiplier = fromValue(multiplier);
|
42602 | if (multiplier.isZero())
|
42603 | return ZERO;
|
42604 | if (this.eq(MIN_VALUE))
|
42605 | return multiplier.isOdd() ? MIN_VALUE : ZERO;
|
42606 | if (multiplier.eq(MIN_VALUE))
|
42607 | return this.isOdd() ? MIN_VALUE : ZERO;
|
42608 |
|
42609 | if (this.isNegative()) {
|
42610 | if (multiplier.isNegative())
|
42611 | return this.neg().mul(multiplier.neg());
|
42612 | else
|
42613 | return this.neg().mul(multiplier).neg();
|
42614 | } else if (multiplier.isNegative())
|
42615 | return this.mul(multiplier.neg()).neg();
|
42616 |
|
42617 |
|
42618 | if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))
|
42619 | return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
|
42620 |
|
42621 |
|
42622 |
|
42623 |
|
42624 | var a48 = this.high >>> 16;
|
42625 | var a32 = this.high & 0xFFFF;
|
42626 | var a16 = this.low >>> 16;
|
42627 | var a00 = this.low & 0xFFFF;
|
42628 |
|
42629 | var b48 = multiplier.high >>> 16;
|
42630 | var b32 = multiplier.high & 0xFFFF;
|
42631 | var b16 = multiplier.low >>> 16;
|
42632 | var b00 = multiplier.low & 0xFFFF;
|
42633 |
|
42634 | var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
|
42635 | c00 += a00 * b00;
|
42636 | c16 += c00 >>> 16;
|
42637 | c00 &= 0xFFFF;
|
42638 | c16 += a16 * b00;
|
42639 | c32 += c16 >>> 16;
|
42640 | c16 &= 0xFFFF;
|
42641 | c16 += a00 * b16;
|
42642 | c32 += c16 >>> 16;
|
42643 | c16 &= 0xFFFF;
|
42644 | c32 += a32 * b00;
|
42645 | c48 += c32 >>> 16;
|
42646 | c32 &= 0xFFFF;
|
42647 | c32 += a16 * b16;
|
42648 | c48 += c32 >>> 16;
|
42649 | c32 &= 0xFFFF;
|
42650 | c32 += a00 * b32;
|
42651 | c48 += c32 >>> 16;
|
42652 | c32 &= 0xFFFF;
|
42653 | c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
|
42654 | c48 &= 0xFFFF;
|
42655 | return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
|
42656 | };
|
42657 |
|
42658 | |
42659 |
|
42660 |
|
42661 |
|
42662 |
|
42663 |
|
42664 | LongPrototype.mul = LongPrototype.multiply;
|
42665 |
|
42666 | |
42667 |
|
42668 |
|
42669 |
|
42670 |
|
42671 |
|
42672 | LongPrototype.divide = function divide(divisor) {
|
42673 | if (!isLong(divisor))
|
42674 | divisor = fromValue(divisor);
|
42675 | if (divisor.isZero())
|
42676 | throw Error('division by zero');
|
42677 | if (this.isZero())
|
42678 | return this.unsigned ? UZERO : ZERO;
|
42679 | var approx, rem, res;
|
42680 | if (!this.unsigned) {
|
42681 |
|
42682 |
|
42683 | if (this.eq(MIN_VALUE)) {
|
42684 | if (divisor.eq(ONE) || divisor.eq(NEG_ONE))
|
42685 | return MIN_VALUE;
|
42686 | else if (divisor.eq(MIN_VALUE))
|
42687 | return ONE;
|
42688 | else {
|
42689 |
|
42690 | var halfThis = this.shr(1);
|
42691 | approx = halfThis.div(divisor).shl(1);
|
42692 | if (approx.eq(ZERO)) {
|
42693 | return divisor.isNegative() ? ONE : NEG_ONE;
|
42694 | } else {
|
42695 | rem = this.sub(divisor.mul(approx));
|
42696 | res = approx.add(rem.div(divisor));
|
42697 | return res;
|
42698 | }
|
42699 | }
|
42700 | } else if (divisor.eq(MIN_VALUE))
|
42701 | return this.unsigned ? UZERO : ZERO;
|
42702 | if (this.isNegative()) {
|
42703 | if (divisor.isNegative())
|
42704 | return this.neg().div(divisor.neg());
|
42705 | return this.neg().div(divisor).neg();
|
42706 | } else if (divisor.isNegative())
|
42707 | return this.div(divisor.neg()).neg();
|
42708 | res = ZERO;
|
42709 | } else {
|
42710 |
|
42711 |
|
42712 | if (!divisor.unsigned)
|
42713 | divisor = divisor.toUnsigned();
|
42714 | if (divisor.gt(this))
|
42715 | return UZERO;
|
42716 | if (divisor.gt(this.shru(1)))
|
42717 | return UONE;
|
42718 | res = UZERO;
|
42719 | }
|
42720 |
|
42721 |
|
42722 |
|
42723 |
|
42724 |
|
42725 |
|
42726 | rem = this;
|
42727 | while (rem.gte(divisor)) {
|
42728 |
|
42729 |
|
42730 | approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));
|
42731 |
|
42732 |
|
42733 |
|
42734 | var log2 = Math.ceil(Math.log(approx) / Math.LN2),
|
42735 | delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),
|
42736 |
|
42737 |
|
42738 |
|
42739 | approxRes = fromNumber(approx),
|
42740 | approxRem = approxRes.mul(divisor);
|
42741 | while (approxRem.isNegative() || approxRem.gt(rem)) {
|
42742 | approx -= delta;
|
42743 | approxRes = fromNumber(approx, this.unsigned);
|
42744 | approxRem = approxRes.mul(divisor);
|
42745 | }
|
42746 |
|
42747 |
|
42748 |
|
42749 | if (approxRes.isZero())
|
42750 | approxRes = ONE;
|
42751 |
|
42752 | res = res.add(approxRes);
|
42753 | rem = rem.sub(approxRem);
|
42754 | }
|
42755 | return res;
|
42756 | };
|
42757 |
|
42758 | |
42759 |
|
42760 |
|
42761 |
|
42762 |
|
42763 |
|
42764 | LongPrototype.div = LongPrototype.divide;
|
42765 |
|
42766 | |
42767 |
|
42768 |
|
42769 |
|
42770 |
|
42771 | LongPrototype.modulo = function modulo(divisor) {
|
42772 | if (!isLong(divisor))
|
42773 | divisor = fromValue(divisor);
|
42774 | return this.sub(this.div(divisor).mul(divisor));
|
42775 | };
|
42776 |
|
42777 | |
42778 |
|
42779 |
|
42780 |
|
42781 |
|
42782 |
|
42783 | LongPrototype.mod = LongPrototype.modulo;
|
42784 |
|
42785 | |
42786 |
|
42787 |
|
42788 |
|
42789 | LongPrototype.not = function not() {
|
42790 | return fromBits(~this.low, ~this.high, this.unsigned);
|
42791 | };
|
42792 |
|
42793 | |
42794 |
|
42795 |
|
42796 |
|
42797 |
|
42798 | LongPrototype.and = function and(other) {
|
42799 | if (!isLong(other))
|
42800 | other = fromValue(other);
|
42801 | return fromBits(this.low & other.low, this.high & other.high, this.unsigned);
|
42802 | };
|
42803 |
|
42804 | |
42805 |
|
42806 |
|
42807 |
|
42808 |
|
42809 | LongPrototype.or = function or(other) {
|
42810 | if (!isLong(other))
|
42811 | other = fromValue(other);
|
42812 | return fromBits(this.low | other.low, this.high | other.high, this.unsigned);
|
42813 | };
|
42814 |
|
42815 | |
42816 |
|
42817 |
|
42818 |
|
42819 |
|
42820 | LongPrototype.xor = function xor(other) {
|
42821 | if (!isLong(other))
|
42822 | other = fromValue(other);
|
42823 | return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
|
42824 | };
|
42825 |
|
42826 | |
42827 |
|
42828 |
|
42829 |
|
42830 |
|
42831 | LongPrototype.shiftLeft = function shiftLeft(numBits) {
|
42832 | if (isLong(numBits))
|
42833 | numBits = numBits.toInt();
|
42834 | if ((numBits &= 63) === 0)
|
42835 | return this;
|
42836 | else if (numBits < 32)
|
42837 | return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);
|
42838 | else
|
42839 | return fromBits(0, this.low << (numBits - 32), this.unsigned);
|
42840 | };
|
42841 |
|
42842 | |
42843 |
|
42844 |
|
42845 |
|
42846 |
|
42847 |
|
42848 | LongPrototype.shl = LongPrototype.shiftLeft;
|
42849 |
|
42850 | |
42851 |
|
42852 |
|
42853 |
|
42854 |
|
42855 | LongPrototype.shiftRight = function shiftRight(numBits) {
|
42856 | if (isLong(numBits))
|
42857 | numBits = numBits.toInt();
|
42858 | if ((numBits &= 63) === 0)
|
42859 | return this;
|
42860 | else if (numBits < 32)
|
42861 | return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);
|
42862 | else
|
42863 | return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);
|
42864 | };
|
42865 |
|
42866 | |
42867 |
|
42868 |
|
42869 |
|
42870 |
|
42871 |
|
42872 | LongPrototype.shr = LongPrototype.shiftRight;
|
42873 |
|
42874 | |
42875 |
|
42876 |
|
42877 |
|
42878 |
|
42879 | LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {
|
42880 | if (isLong(numBits))
|
42881 | numBits = numBits.toInt();
|
42882 | numBits &= 63;
|
42883 | if (numBits === 0)
|
42884 | return this;
|
42885 | else {
|
42886 | var high = this.high;
|
42887 | if (numBits < 32) {
|
42888 | var low = this.low;
|
42889 | return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);
|
42890 | } else if (numBits === 32)
|
42891 | return fromBits(high, 0, this.unsigned);
|
42892 | else
|
42893 | return fromBits(high >>> (numBits - 32), 0, this.unsigned);
|
42894 | }
|
42895 | };
|
42896 |
|
42897 | |
42898 |
|
42899 |
|
42900 |
|
42901 |
|
42902 |
|
42903 | LongPrototype.shru = LongPrototype.shiftRightUnsigned;
|
42904 |
|
42905 | |
42906 |
|
42907 |
|
42908 |
|
42909 | LongPrototype.toSigned = function toSigned() {
|
42910 | if (!this.unsigned)
|
42911 | return this;
|
42912 | return fromBits(this.low, this.high, false);
|
42913 | };
|
42914 |
|
42915 | |
42916 |
|
42917 |
|
42918 |
|
42919 | LongPrototype.toUnsigned = function toUnsigned() {
|
42920 | if (this.unsigned)
|
42921 | return this;
|
42922 | return fromBits(this.low, this.high, true);
|
42923 | };
|
42924 |
|
42925 | |
42926 |
|
42927 |
|
42928 |
|
42929 |
|
42930 | LongPrototype.toBytes = function(le) {
|
42931 | return le ? this.toBytesLE() : this.toBytesBE();
|
42932 | }
|
42933 |
|
42934 | |
42935 |
|
42936 |
|
42937 |
|
42938 | LongPrototype.toBytesLE = function() {
|
42939 | var hi = this.high,
|
42940 | lo = this.low;
|
42941 | return [
|
42942 | lo & 0xff,
|
42943 | (lo >>> 8) & 0xff,
|
42944 | (lo >>> 16) & 0xff,
|
42945 | (lo >>> 24) & 0xff,
|
42946 | hi & 0xff,
|
42947 | (hi >>> 8) & 0xff,
|
42948 | (hi >>> 16) & 0xff,
|
42949 | (hi >>> 24) & 0xff
|
42950 | ];
|
42951 | }
|
42952 |
|
42953 | |
42954 |
|
42955 |
|
42956 |
|
42957 | LongPrototype.toBytesBE = function() {
|
42958 | var hi = this.high,
|
42959 | lo = this.low;
|
42960 | return [
|
42961 | (hi >>> 24) & 0xff,
|
42962 | (hi >>> 16) & 0xff,
|
42963 | (hi >>> 8) & 0xff,
|
42964 | hi & 0xff,
|
42965 | (lo >>> 24) & 0xff,
|
42966 | (lo >>> 16) & 0xff,
|
42967 | (lo >>> 8) & 0xff,
|
42968 | lo & 0xff
|
42969 | ];
|
42970 | }
|
42971 |
|
42972 | return Long;
|
42973 | });
|
42974 |
|
42975 |
|
42976 | }),
|
42977 |
|
42978 | (function(module, exports) {
|
42979 |
|
42980 |
|
42981 |
|
42982 | }),
|
42983 |
|
42984 | (function(module, exports, __webpack_require__) {
|
42985 |
|
42986 | "use strict";
|
42987 |
|
42988 |
|
42989 | var _interopRequireDefault = __webpack_require__(1);
|
42990 |
|
42991 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
42992 |
|
42993 | var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(266));
|
42994 |
|
42995 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
42996 |
|
42997 | var has = Object.prototype.hasOwnProperty,
|
42998 | prefix = '~';
|
42999 |
|
43000 |
|
43001 |
|
43002 |
|
43003 |
|
43004 |
|
43005 |
|
43006 |
|
43007 | function Events() {}
|
43008 |
|
43009 |
|
43010 |
|
43011 |
|
43012 |
|
43013 |
|
43014 |
|
43015 |
|
43016 | if (Object.create) {
|
43017 | Events.prototype = Object.create(null);
|
43018 |
|
43019 |
|
43020 |
|
43021 |
|
43022 | if (!new Events().__proto__) prefix = false;
|
43023 | }
|
43024 |
|
43025 |
|
43026 |
|
43027 |
|
43028 |
|
43029 |
|
43030 |
|
43031 |
|
43032 |
|
43033 |
|
43034 |
|
43035 | function EE(fn, context, once) {
|
43036 | this.fn = fn;
|
43037 | this.context = context;
|
43038 | this.once = once || false;
|
43039 | }
|
43040 |
|
43041 |
|
43042 |
|
43043 |
|
43044 |
|
43045 |
|
43046 |
|
43047 |
|
43048 |
|
43049 |
|
43050 |
|
43051 |
|
43052 |
|
43053 | function addListener(emitter, event, fn, context, once) {
|
43054 | if (typeof fn !== 'function') {
|
43055 | throw new TypeError('The listener must be a function');
|
43056 | }
|
43057 |
|
43058 | var listener = new EE(fn, context || emitter, once),
|
43059 | evt = prefix ? prefix + event : event;
|
43060 | if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);else emitter._events[evt] = [emitter._events[evt], listener];
|
43061 | return emitter;
|
43062 | }
|
43063 |
|
43064 |
|
43065 |
|
43066 |
|
43067 |
|
43068 |
|
43069 |
|
43070 |
|
43071 |
|
43072 | function clearEvent(emitter, evt) {
|
43073 | if (--emitter._eventsCount === 0) emitter._events = new Events();else delete emitter._events[evt];
|
43074 | }
|
43075 |
|
43076 |
|
43077 |
|
43078 |
|
43079 |
|
43080 |
|
43081 |
|
43082 |
|
43083 |
|
43084 | function EventEmitter() {
|
43085 | this._events = new Events();
|
43086 | this._eventsCount = 0;
|
43087 | }
|
43088 |
|
43089 |
|
43090 |
|
43091 |
|
43092 |
|
43093 |
|
43094 |
|
43095 |
|
43096 |
|
43097 | EventEmitter.prototype.eventNames = function eventNames() {
|
43098 | var names = [],
|
43099 | events,
|
43100 | name;
|
43101 | if (this._eventsCount === 0) return names;
|
43102 |
|
43103 | for (name in events = this._events) {
|
43104 | if (has.call(events, name)) names.push(prefix ? (0, _slice.default)(name).call(name, 1) : name);
|
43105 | }
|
43106 |
|
43107 | if (_getOwnPropertySymbols.default) {
|
43108 | return (0, _concat.default)(names).call(names, (0, _getOwnPropertySymbols.default)(events));
|
43109 | }
|
43110 |
|
43111 | return names;
|
43112 | };
|
43113 |
|
43114 |
|
43115 |
|
43116 |
|
43117 |
|
43118 |
|
43119 |
|
43120 |
|
43121 |
|
43122 | EventEmitter.prototype.listeners = function listeners(event) {
|
43123 | var evt = prefix ? prefix + event : event,
|
43124 | handlers = this._events[evt];
|
43125 | if (!handlers) return [];
|
43126 | if (handlers.fn) return [handlers.fn];
|
43127 |
|
43128 | for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
|
43129 | ee[i] = handlers[i].fn;
|
43130 | }
|
43131 |
|
43132 | return ee;
|
43133 | };
|
43134 |
|
43135 |
|
43136 |
|
43137 |
|
43138 |
|
43139 |
|
43140 |
|
43141 |
|
43142 |
|
43143 | EventEmitter.prototype.listenerCount = function listenerCount(event) {
|
43144 | var evt = prefix ? prefix + event : event,
|
43145 | listeners = this._events[evt];
|
43146 | if (!listeners) return 0;
|
43147 | if (listeners.fn) return 1;
|
43148 | return listeners.length;
|
43149 | };
|
43150 |
|
43151 |
|
43152 |
|
43153 |
|
43154 |
|
43155 |
|
43156 |
|
43157 |
|
43158 |
|
43159 | EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
43160 | var evt = prefix ? prefix + event : event;
|
43161 | if (!this._events[evt]) return false;
|
43162 | var listeners = this._events[evt],
|
43163 | len = arguments.length,
|
43164 | args,
|
43165 | i;
|
43166 |
|
43167 | if (listeners.fn) {
|
43168 | if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
43169 |
|
43170 | switch (len) {
|
43171 | case 1:
|
43172 | return listeners.fn.call(listeners.context), true;
|
43173 |
|
43174 | case 2:
|
43175 | return listeners.fn.call(listeners.context, a1), true;
|
43176 |
|
43177 | case 3:
|
43178 | return listeners.fn.call(listeners.context, a1, a2), true;
|
43179 |
|
43180 | case 4:
|
43181 | return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
43182 |
|
43183 | case 5:
|
43184 | return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
43185 |
|
43186 | case 6:
|
43187 | return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
43188 | }
|
43189 |
|
43190 | for (i = 1, args = new Array(len - 1); i < len; i++) {
|
43191 | args[i - 1] = arguments[i];
|
43192 | }
|
43193 |
|
43194 | listeners.fn.apply(listeners.context, args);
|
43195 | } else {
|
43196 | var length = listeners.length,
|
43197 | j;
|
43198 |
|
43199 | for (i = 0; i < length; i++) {
|
43200 | if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
43201 |
|
43202 | switch (len) {
|
43203 | case 1:
|
43204 | listeners[i].fn.call(listeners[i].context);
|
43205 | break;
|
43206 |
|
43207 | case 2:
|
43208 | listeners[i].fn.call(listeners[i].context, a1);
|
43209 | break;
|
43210 |
|
43211 | case 3:
|
43212 | listeners[i].fn.call(listeners[i].context, a1, a2);
|
43213 | break;
|
43214 |
|
43215 | case 4:
|
43216 | listeners[i].fn.call(listeners[i].context, a1, a2, a3);
|
43217 | break;
|
43218 |
|
43219 | default:
|
43220 | if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
|
43221 | args[j - 1] = arguments[j];
|
43222 | }
|
43223 | listeners[i].fn.apply(listeners[i].context, args);
|
43224 | }
|
43225 | }
|
43226 | }
|
43227 |
|
43228 | return true;
|
43229 | };
|
43230 |
|
43231 |
|
43232 |
|
43233 |
|
43234 |
|
43235 |
|
43236 |
|
43237 |
|
43238 |
|
43239 |
|
43240 |
|
43241 | EventEmitter.prototype.on = function on(event, fn, context) {
|
43242 | return addListener(this, event, fn, context, false);
|
43243 | };
|
43244 |
|
43245 |
|
43246 |
|
43247 |
|
43248 |
|
43249 |
|
43250 |
|
43251 |
|
43252 |
|
43253 |
|
43254 |
|
43255 | EventEmitter.prototype.once = function once(event, fn, context) {
|
43256 | return addListener(this, event, fn, context, true);
|
43257 | };
|
43258 |
|
43259 |
|
43260 |
|
43261 |
|
43262 |
|
43263 |
|
43264 |
|
43265 |
|
43266 |
|
43267 |
|
43268 |
|
43269 |
|
43270 | EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
43271 | var evt = prefix ? prefix + event : event;
|
43272 | if (!this._events[evt]) return this;
|
43273 |
|
43274 | if (!fn) {
|
43275 | clearEvent(this, evt);
|
43276 | return this;
|
43277 | }
|
43278 |
|
43279 | var listeners = this._events[evt];
|
43280 |
|
43281 | if (listeners.fn) {
|
43282 | if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
|
43283 | clearEvent(this, evt);
|
43284 | }
|
43285 | } else {
|
43286 | for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
43287 | if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
|
43288 | events.push(listeners[i]);
|
43289 | }
|
43290 | }
|
43291 |
|
43292 |
|
43293 |
|
43294 |
|
43295 | if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else clearEvent(this, evt);
|
43296 | }
|
43297 |
|
43298 | return this;
|
43299 | };
|
43300 |
|
43301 |
|
43302 |
|
43303 |
|
43304 |
|
43305 |
|
43306 |
|
43307 |
|
43308 |
|
43309 | EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
43310 | var evt;
|
43311 |
|
43312 | if (event) {
|
43313 | evt = prefix ? prefix + event : event;
|
43314 | if (this._events[evt]) clearEvent(this, evt);
|
43315 | } else {
|
43316 | this._events = new Events();
|
43317 | this._eventsCount = 0;
|
43318 | }
|
43319 |
|
43320 | return this;
|
43321 | };
|
43322 |
|
43323 |
|
43324 |
|
43325 |
|
43326 | EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
43327 | EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
43328 |
|
43329 |
|
43330 |
|
43331 | EventEmitter.prefixed = prefix;
|
43332 |
|
43333 |
|
43334 |
|
43335 | EventEmitter.EventEmitter = EventEmitter;
|
43336 |
|
43337 |
|
43338 |
|
43339 | if (true) {
|
43340 | module.exports = EventEmitter;
|
43341 | }
|
43342 |
|
43343 | }),
|
43344 |
|
43345 | (function(module, exports, __webpack_require__) {
|
43346 |
|
43347 | module.exports = __webpack_require__(658);
|
43348 |
|
43349 |
|
43350 | }),
|
43351 |
|
43352 | (function(module, exports, __webpack_require__) {
|
43353 |
|
43354 |
|
43355 |
|
43356 |
|
43357 |
|
43358 |
|
43359 |
|
43360 |
|
43361 | var runtime = (function (exports) {
|
43362 | "use strict";
|
43363 |
|
43364 | var Op = Object.prototype;
|
43365 | var hasOwn = Op.hasOwnProperty;
|
43366 | var undefined;
|
43367 | var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
43368 | var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
43369 | var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
43370 | var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
43371 |
|
43372 | function define(obj, key, value) {
|
43373 | Object.defineProperty(obj, key, {
|
43374 | value: value,
|
43375 | enumerable: true,
|
43376 | configurable: true,
|
43377 | writable: true
|
43378 | });
|
43379 | return obj[key];
|
43380 | }
|
43381 | try {
|
43382 |
|
43383 | define({}, "");
|
43384 | } catch (err) {
|
43385 | define = function(obj, key, value) {
|
43386 | return obj[key] = value;
|
43387 | };
|
43388 | }
|
43389 |
|
43390 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
43391 |
|
43392 | var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
43393 | var generator = Object.create(protoGenerator.prototype);
|
43394 | var context = new Context(tryLocsList || []);
|
43395 |
|
43396 |
|
43397 |
|
43398 | generator._invoke = makeInvokeMethod(innerFn, self, context);
|
43399 |
|
43400 | return generator;
|
43401 | }
|
43402 | exports.wrap = wrap;
|
43403 |
|
43404 |
|
43405 |
|
43406 |
|
43407 |
|
43408 |
|
43409 |
|
43410 |
|
43411 |
|
43412 |
|
43413 |
|
43414 | function tryCatch(fn, obj, arg) {
|
43415 | try {
|
43416 | return { type: "normal", arg: fn.call(obj, arg) };
|
43417 | } catch (err) {
|
43418 | return { type: "throw", arg: err };
|
43419 | }
|
43420 | }
|
43421 |
|
43422 | var GenStateSuspendedStart = "suspendedStart";
|
43423 | var GenStateSuspendedYield = "suspendedYield";
|
43424 | var GenStateExecuting = "executing";
|
43425 | var GenStateCompleted = "completed";
|
43426 |
|
43427 |
|
43428 |
|
43429 | var ContinueSentinel = {};
|
43430 |
|
43431 |
|
43432 |
|
43433 |
|
43434 |
|
43435 | function Generator() {}
|
43436 | function GeneratorFunction() {}
|
43437 | function GeneratorFunctionPrototype() {}
|
43438 |
|
43439 |
|
43440 |
|
43441 | var IteratorPrototype = {};
|
43442 | IteratorPrototype[iteratorSymbol] = function () {
|
43443 | return this;
|
43444 | };
|
43445 |
|
43446 | var getProto = Object.getPrototypeOf;
|
43447 | var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
43448 | if (NativeIteratorPrototype &&
|
43449 | NativeIteratorPrototype !== Op &&
|
43450 | hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
43451 |
|
43452 |
|
43453 | IteratorPrototype = NativeIteratorPrototype;
|
43454 | }
|
43455 |
|
43456 | var Gp = GeneratorFunctionPrototype.prototype =
|
43457 | Generator.prototype = Object.create(IteratorPrototype);
|
43458 | GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
43459 | GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
43460 | GeneratorFunction.displayName = define(
|
43461 | GeneratorFunctionPrototype,
|
43462 | toStringTagSymbol,
|
43463 | "GeneratorFunction"
|
43464 | );
|
43465 |
|
43466 |
|
43467 |
|
43468 | function defineIteratorMethods(prototype) {
|
43469 | ["next", "throw", "return"].forEach(function(method) {
|
43470 | define(prototype, method, function(arg) {
|
43471 | return this._invoke(method, arg);
|
43472 | });
|
43473 | });
|
43474 | }
|
43475 |
|
43476 | exports.isGeneratorFunction = function(genFun) {
|
43477 | var ctor = typeof genFun === "function" && genFun.constructor;
|
43478 | return ctor
|
43479 | ? ctor === GeneratorFunction ||
|
43480 |
|
43481 |
|
43482 | (ctor.displayName || ctor.name) === "GeneratorFunction"
|
43483 | : false;
|
43484 | };
|
43485 |
|
43486 | exports.mark = function(genFun) {
|
43487 | if (Object.setPrototypeOf) {
|
43488 | Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
43489 | } else {
|
43490 | genFun.__proto__ = GeneratorFunctionPrototype;
|
43491 | define(genFun, toStringTagSymbol, "GeneratorFunction");
|
43492 | }
|
43493 | genFun.prototype = Object.create(Gp);
|
43494 | return genFun;
|
43495 | };
|
43496 |
|
43497 |
|
43498 |
|
43499 |
|
43500 |
|
43501 | exports.awrap = function(arg) {
|
43502 | return { __await: arg };
|
43503 | };
|
43504 |
|
43505 | function AsyncIterator(generator, PromiseImpl) {
|
43506 | function invoke(method, arg, resolve, reject) {
|
43507 | var record = tryCatch(generator[method], generator, arg);
|
43508 | if (record.type === "throw") {
|
43509 | reject(record.arg);
|
43510 | } else {
|
43511 | var result = record.arg;
|
43512 | var value = result.value;
|
43513 | if (value &&
|
43514 | typeof value === "object" &&
|
43515 | hasOwn.call(value, "__await")) {
|
43516 | return PromiseImpl.resolve(value.__await).then(function(value) {
|
43517 | invoke("next", value, resolve, reject);
|
43518 | }, function(err) {
|
43519 | invoke("throw", err, resolve, reject);
|
43520 | });
|
43521 | }
|
43522 |
|
43523 | return PromiseImpl.resolve(value).then(function(unwrapped) {
|
43524 |
|
43525 |
|
43526 |
|
43527 | result.value = unwrapped;
|
43528 | resolve(result);
|
43529 | }, function(error) {
|
43530 |
|
43531 |
|
43532 | return invoke("throw", error, resolve, reject);
|
43533 | });
|
43534 | }
|
43535 | }
|
43536 |
|
43537 | var previousPromise;
|
43538 |
|
43539 | function enqueue(method, arg) {
|
43540 | function callInvokeWithMethodAndArg() {
|
43541 | return new PromiseImpl(function(resolve, reject) {
|
43542 | invoke(method, arg, resolve, reject);
|
43543 | });
|
43544 | }
|
43545 |
|
43546 | return previousPromise =
|
43547 |
|
43548 |
|
43549 |
|
43550 |
|
43551 |
|
43552 |
|
43553 |
|
43554 |
|
43555 |
|
43556 |
|
43557 |
|
43558 |
|
43559 | previousPromise ? previousPromise.then(
|
43560 | callInvokeWithMethodAndArg,
|
43561 |
|
43562 |
|
43563 | callInvokeWithMethodAndArg
|
43564 | ) : callInvokeWithMethodAndArg();
|
43565 | }
|
43566 |
|
43567 |
|
43568 |
|
43569 | this._invoke = enqueue;
|
43570 | }
|
43571 |
|
43572 | defineIteratorMethods(AsyncIterator.prototype);
|
43573 | AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
43574 | return this;
|
43575 | };
|
43576 | exports.AsyncIterator = AsyncIterator;
|
43577 |
|
43578 |
|
43579 |
|
43580 |
|
43581 | exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
43582 | if (PromiseImpl === void 0) PromiseImpl = Promise;
|
43583 |
|
43584 | var iter = new AsyncIterator(
|
43585 | wrap(innerFn, outerFn, self, tryLocsList),
|
43586 | PromiseImpl
|
43587 | );
|
43588 |
|
43589 | return exports.isGeneratorFunction(outerFn)
|
43590 | ? iter
|
43591 | : iter.next().then(function(result) {
|
43592 | return result.done ? result.value : iter.next();
|
43593 | });
|
43594 | };
|
43595 |
|
43596 | function makeInvokeMethod(innerFn, self, context) {
|
43597 | var state = GenStateSuspendedStart;
|
43598 |
|
43599 | return function invoke(method, arg) {
|
43600 | if (state === GenStateExecuting) {
|
43601 | throw new Error("Generator is already running");
|
43602 | }
|
43603 |
|
43604 | if (state === GenStateCompleted) {
|
43605 | if (method === "throw") {
|
43606 | throw arg;
|
43607 | }
|
43608 |
|
43609 |
|
43610 |
|
43611 | return doneResult();
|
43612 | }
|
43613 |
|
43614 | context.method = method;
|
43615 | context.arg = arg;
|
43616 |
|
43617 | while (true) {
|
43618 | var delegate = context.delegate;
|
43619 | if (delegate) {
|
43620 | var delegateResult = maybeInvokeDelegate(delegate, context);
|
43621 | if (delegateResult) {
|
43622 | if (delegateResult === ContinueSentinel) continue;
|
43623 | return delegateResult;
|
43624 | }
|
43625 | }
|
43626 |
|
43627 | if (context.method === "next") {
|
43628 |
|
43629 |
|
43630 | context.sent = context._sent = context.arg;
|
43631 |
|
43632 | } else if (context.method === "throw") {
|
43633 | if (state === GenStateSuspendedStart) {
|
43634 | state = GenStateCompleted;
|
43635 | throw context.arg;
|
43636 | }
|
43637 |
|
43638 | context.dispatchException(context.arg);
|
43639 |
|
43640 | } else if (context.method === "return") {
|
43641 | context.abrupt("return", context.arg);
|
43642 | }
|
43643 |
|
43644 | state = GenStateExecuting;
|
43645 |
|
43646 | var record = tryCatch(innerFn, self, context);
|
43647 | if (record.type === "normal") {
|
43648 |
|
43649 |
|
43650 | state = context.done
|
43651 | ? GenStateCompleted
|
43652 | : GenStateSuspendedYield;
|
43653 |
|
43654 | if (record.arg === ContinueSentinel) {
|
43655 | continue;
|
43656 | }
|
43657 |
|
43658 | return {
|
43659 | value: record.arg,
|
43660 | done: context.done
|
43661 | };
|
43662 |
|
43663 | } else if (record.type === "throw") {
|
43664 | state = GenStateCompleted;
|
43665 |
|
43666 |
|
43667 | context.method = "throw";
|
43668 | context.arg = record.arg;
|
43669 | }
|
43670 | }
|
43671 | };
|
43672 | }
|
43673 |
|
43674 |
|
43675 |
|
43676 |
|
43677 |
|
43678 | function maybeInvokeDelegate(delegate, context) {
|
43679 | var method = delegate.iterator[context.method];
|
43680 | if (method === undefined) {
|
43681 |
|
43682 |
|
43683 | context.delegate = null;
|
43684 |
|
43685 | if (context.method === "throw") {
|
43686 |
|
43687 | if (delegate.iterator["return"]) {
|
43688 |
|
43689 |
|
43690 | context.method = "return";
|
43691 | context.arg = undefined;
|
43692 | maybeInvokeDelegate(delegate, context);
|
43693 |
|
43694 | if (context.method === "throw") {
|
43695 |
|
43696 |
|
43697 | return ContinueSentinel;
|
43698 | }
|
43699 | }
|
43700 |
|
43701 | context.method = "throw";
|
43702 | context.arg = new TypeError(
|
43703 | "The iterator does not provide a 'throw' method");
|
43704 | }
|
43705 |
|
43706 | return ContinueSentinel;
|
43707 | }
|
43708 |
|
43709 | var record = tryCatch(method, delegate.iterator, context.arg);
|
43710 |
|
43711 | if (record.type === "throw") {
|
43712 | context.method = "throw";
|
43713 | context.arg = record.arg;
|
43714 | context.delegate = null;
|
43715 | return ContinueSentinel;
|
43716 | }
|
43717 |
|
43718 | var info = record.arg;
|
43719 |
|
43720 | if (! info) {
|
43721 | context.method = "throw";
|
43722 | context.arg = new TypeError("iterator result is not an object");
|
43723 | context.delegate = null;
|
43724 | return ContinueSentinel;
|
43725 | }
|
43726 |
|
43727 | if (info.done) {
|
43728 |
|
43729 |
|
43730 | context[delegate.resultName] = info.value;
|
43731 |
|
43732 |
|
43733 | context.next = delegate.nextLoc;
|
43734 |
|
43735 |
|
43736 |
|
43737 |
|
43738 |
|
43739 |
|
43740 |
|
43741 | if (context.method !== "return") {
|
43742 | context.method = "next";
|
43743 | context.arg = undefined;
|
43744 | }
|
43745 |
|
43746 | } else {
|
43747 |
|
43748 | return info;
|
43749 | }
|
43750 |
|
43751 |
|
43752 |
|
43753 | context.delegate = null;
|
43754 | return ContinueSentinel;
|
43755 | }
|
43756 |
|
43757 |
|
43758 |
|
43759 | defineIteratorMethods(Gp);
|
43760 |
|
43761 | define(Gp, toStringTagSymbol, "Generator");
|
43762 |
|
43763 |
|
43764 |
|
43765 |
|
43766 |
|
43767 |
|
43768 | Gp[iteratorSymbol] = function() {
|
43769 | return this;
|
43770 | };
|
43771 |
|
43772 | Gp.toString = function() {
|
43773 | return "[object Generator]";
|
43774 | };
|
43775 |
|
43776 | function pushTryEntry(locs) {
|
43777 | var entry = { tryLoc: locs[0] };
|
43778 |
|
43779 | if (1 in locs) {
|
43780 | entry.catchLoc = locs[1];
|
43781 | }
|
43782 |
|
43783 | if (2 in locs) {
|
43784 | entry.finallyLoc = locs[2];
|
43785 | entry.afterLoc = locs[3];
|
43786 | }
|
43787 |
|
43788 | this.tryEntries.push(entry);
|
43789 | }
|
43790 |
|
43791 | function resetTryEntry(entry) {
|
43792 | var record = entry.completion || {};
|
43793 | record.type = "normal";
|
43794 | delete record.arg;
|
43795 | entry.completion = record;
|
43796 | }
|
43797 |
|
43798 | function Context(tryLocsList) {
|
43799 |
|
43800 |
|
43801 |
|
43802 | this.tryEntries = [{ tryLoc: "root" }];
|
43803 | tryLocsList.forEach(pushTryEntry, this);
|
43804 | this.reset(true);
|
43805 | }
|
43806 |
|
43807 | exports.keys = function(object) {
|
43808 | var keys = [];
|
43809 | for (var key in object) {
|
43810 | keys.push(key);
|
43811 | }
|
43812 | keys.reverse();
|
43813 |
|
43814 |
|
43815 |
|
43816 | return function next() {
|
43817 | while (keys.length) {
|
43818 | var key = keys.pop();
|
43819 | if (key in object) {
|
43820 | next.value = key;
|
43821 | next.done = false;
|
43822 | return next;
|
43823 | }
|
43824 | }
|
43825 |
|
43826 |
|
43827 |
|
43828 |
|
43829 | next.done = true;
|
43830 | return next;
|
43831 | };
|
43832 | };
|
43833 |
|
43834 | function values(iterable) {
|
43835 | if (iterable) {
|
43836 | var iteratorMethod = iterable[iteratorSymbol];
|
43837 | if (iteratorMethod) {
|
43838 | return iteratorMethod.call(iterable);
|
43839 | }
|
43840 |
|
43841 | if (typeof iterable.next === "function") {
|
43842 | return iterable;
|
43843 | }
|
43844 |
|
43845 | if (!isNaN(iterable.length)) {
|
43846 | var i = -1, next = function next() {
|
43847 | while (++i < iterable.length) {
|
43848 | if (hasOwn.call(iterable, i)) {
|
43849 | next.value = iterable[i];
|
43850 | next.done = false;
|
43851 | return next;
|
43852 | }
|
43853 | }
|
43854 |
|
43855 | next.value = undefined;
|
43856 | next.done = true;
|
43857 |
|
43858 | return next;
|
43859 | };
|
43860 |
|
43861 | return next.next = next;
|
43862 | }
|
43863 | }
|
43864 |
|
43865 |
|
43866 | return { next: doneResult };
|
43867 | }
|
43868 | exports.values = values;
|
43869 |
|
43870 | function doneResult() {
|
43871 | return { value: undefined, done: true };
|
43872 | }
|
43873 |
|
43874 | Context.prototype = {
|
43875 | constructor: Context,
|
43876 |
|
43877 | reset: function(skipTempReset) {
|
43878 | this.prev = 0;
|
43879 | this.next = 0;
|
43880 |
|
43881 |
|
43882 | this.sent = this._sent = undefined;
|
43883 | this.done = false;
|
43884 | this.delegate = null;
|
43885 |
|
43886 | this.method = "next";
|
43887 | this.arg = undefined;
|
43888 |
|
43889 | this.tryEntries.forEach(resetTryEntry);
|
43890 |
|
43891 | if (!skipTempReset) {
|
43892 | for (var name in this) {
|
43893 |
|
43894 | if (name.charAt(0) === "t" &&
|
43895 | hasOwn.call(this, name) &&
|
43896 | !isNaN(+name.slice(1))) {
|
43897 | this[name] = undefined;
|
43898 | }
|
43899 | }
|
43900 | }
|
43901 | },
|
43902 |
|
43903 | stop: function() {
|
43904 | this.done = true;
|
43905 |
|
43906 | var rootEntry = this.tryEntries[0];
|
43907 | var rootRecord = rootEntry.completion;
|
43908 | if (rootRecord.type === "throw") {
|
43909 | throw rootRecord.arg;
|
43910 | }
|
43911 |
|
43912 | return this.rval;
|
43913 | },
|
43914 |
|
43915 | dispatchException: function(exception) {
|
43916 | if (this.done) {
|
43917 | throw exception;
|
43918 | }
|
43919 |
|
43920 | var context = this;
|
43921 | function handle(loc, caught) {
|
43922 | record.type = "throw";
|
43923 | record.arg = exception;
|
43924 | context.next = loc;
|
43925 |
|
43926 | if (caught) {
|
43927 |
|
43928 |
|
43929 | context.method = "next";
|
43930 | context.arg = undefined;
|
43931 | }
|
43932 |
|
43933 | return !! caught;
|
43934 | }
|
43935 |
|
43936 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
43937 | var entry = this.tryEntries[i];
|
43938 | var record = entry.completion;
|
43939 |
|
43940 | if (entry.tryLoc === "root") {
|
43941 |
|
43942 |
|
43943 |
|
43944 | return handle("end");
|
43945 | }
|
43946 |
|
43947 | if (entry.tryLoc <= this.prev) {
|
43948 | var hasCatch = hasOwn.call(entry, "catchLoc");
|
43949 | var hasFinally = hasOwn.call(entry, "finallyLoc");
|
43950 |
|
43951 | if (hasCatch && hasFinally) {
|
43952 | if (this.prev < entry.catchLoc) {
|
43953 | return handle(entry.catchLoc, true);
|
43954 | } else if (this.prev < entry.finallyLoc) {
|
43955 | return handle(entry.finallyLoc);
|
43956 | }
|
43957 |
|
43958 | } else if (hasCatch) {
|
43959 | if (this.prev < entry.catchLoc) {
|
43960 | return handle(entry.catchLoc, true);
|
43961 | }
|
43962 |
|
43963 | } else if (hasFinally) {
|
43964 | if (this.prev < entry.finallyLoc) {
|
43965 | return handle(entry.finallyLoc);
|
43966 | }
|
43967 |
|
43968 | } else {
|
43969 | throw new Error("try statement without catch or finally");
|
43970 | }
|
43971 | }
|
43972 | }
|
43973 | },
|
43974 |
|
43975 | abrupt: function(type, arg) {
|
43976 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
43977 | var entry = this.tryEntries[i];
|
43978 | if (entry.tryLoc <= this.prev &&
|
43979 | hasOwn.call(entry, "finallyLoc") &&
|
43980 | this.prev < entry.finallyLoc) {
|
43981 | var finallyEntry = entry;
|
43982 | break;
|
43983 | }
|
43984 | }
|
43985 |
|
43986 | if (finallyEntry &&
|
43987 | (type === "break" ||
|
43988 | type === "continue") &&
|
43989 | finallyEntry.tryLoc <= arg &&
|
43990 | arg <= finallyEntry.finallyLoc) {
|
43991 |
|
43992 |
|
43993 | finallyEntry = null;
|
43994 | }
|
43995 |
|
43996 | var record = finallyEntry ? finallyEntry.completion : {};
|
43997 | record.type = type;
|
43998 | record.arg = arg;
|
43999 |
|
44000 | if (finallyEntry) {
|
44001 | this.method = "next";
|
44002 | this.next = finallyEntry.finallyLoc;
|
44003 | return ContinueSentinel;
|
44004 | }
|
44005 |
|
44006 | return this.complete(record);
|
44007 | },
|
44008 |
|
44009 | complete: function(record, afterLoc) {
|
44010 | if (record.type === "throw") {
|
44011 | throw record.arg;
|
44012 | }
|
44013 |
|
44014 | if (record.type === "break" ||
|
44015 | record.type === "continue") {
|
44016 | this.next = record.arg;
|
44017 | } else if (record.type === "return") {
|
44018 | this.rval = this.arg = record.arg;
|
44019 | this.method = "return";
|
44020 | this.next = "end";
|
44021 | } else if (record.type === "normal" && afterLoc) {
|
44022 | this.next = afterLoc;
|
44023 | }
|
44024 |
|
44025 | return ContinueSentinel;
|
44026 | },
|
44027 |
|
44028 | finish: function(finallyLoc) {
|
44029 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
44030 | var entry = this.tryEntries[i];
|
44031 | if (entry.finallyLoc === finallyLoc) {
|
44032 | this.complete(entry.completion, entry.afterLoc);
|
44033 | resetTryEntry(entry);
|
44034 | return ContinueSentinel;
|
44035 | }
|
44036 | }
|
44037 | },
|
44038 |
|
44039 | "catch": function(tryLoc) {
|
44040 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
44041 | var entry = this.tryEntries[i];
|
44042 | if (entry.tryLoc === tryLoc) {
|
44043 | var record = entry.completion;
|
44044 | if (record.type === "throw") {
|
44045 | var thrown = record.arg;
|
44046 | resetTryEntry(entry);
|
44047 | }
|
44048 | return thrown;
|
44049 | }
|
44050 | }
|
44051 |
|
44052 |
|
44053 |
|
44054 | throw new Error("illegal catch attempt");
|
44055 | },
|
44056 |
|
44057 | delegateYield: function(iterable, resultName, nextLoc) {
|
44058 | this.delegate = {
|
44059 | iterator: values(iterable),
|
44060 | resultName: resultName,
|
44061 | nextLoc: nextLoc
|
44062 | };
|
44063 |
|
44064 | if (this.method === "next") {
|
44065 |
|
44066 |
|
44067 | this.arg = undefined;
|
44068 | }
|
44069 |
|
44070 | return ContinueSentinel;
|
44071 | }
|
44072 | };
|
44073 |
|
44074 |
|
44075 |
|
44076 |
|
44077 |
|
44078 | return exports;
|
44079 |
|
44080 | }(
|
44081 |
|
44082 |
|
44083 |
|
44084 |
|
44085 | true ? module.exports : {}
|
44086 | ));
|
44087 |
|
44088 | try {
|
44089 | regeneratorRuntime = runtime;
|
44090 | } catch (accidentalStrictMode) {
|
44091 |
|
44092 |
|
44093 |
|
44094 |
|
44095 |
|
44096 |
|
44097 |
|
44098 |
|
44099 |
|
44100 | Function("r", "regeneratorRuntime = r")(runtime);
|
44101 | }
|
44102 |
|
44103 |
|
44104 | }),
|
44105 |
|
44106 | (function(module, exports) {
|
44107 |
|
44108 | function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
44109 | try {
|
44110 | var info = gen[key](arg);
|
44111 | var value = info.value;
|
44112 | } catch (error) {
|
44113 | reject(error);
|
44114 | return;
|
44115 | }
|
44116 |
|
44117 | if (info.done) {
|
44118 | resolve(value);
|
44119 | } else {
|
44120 | Promise.resolve(value).then(_next, _throw);
|
44121 | }
|
44122 | }
|
44123 |
|
44124 | function _asyncToGenerator(fn) {
|
44125 | return function () {
|
44126 | var self = this,
|
44127 | args = arguments;
|
44128 | return new Promise(function (resolve, reject) {
|
44129 | var gen = fn.apply(self, args);
|
44130 |
|
44131 | function _next(value) {
|
44132 | asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
44133 | }
|
44134 |
|
44135 | function _throw(err) {
|
44136 | asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
44137 | }
|
44138 |
|
44139 | _next(undefined);
|
44140 | });
|
44141 | };
|
44142 | }
|
44143 |
|
44144 | module.exports = _asyncToGenerator;
|
44145 |
|
44146 | }),
|
44147 |
|
44148 | (function(module, exports, __webpack_require__) {
|
44149 |
|
44150 | var arrayWithoutHoles = __webpack_require__(661);
|
44151 |
|
44152 | var iterableToArray = __webpack_require__(270);
|
44153 |
|
44154 | var unsupportedIterableToArray = __webpack_require__(271);
|
44155 |
|
44156 | var nonIterableSpread = __webpack_require__(662);
|
44157 |
|
44158 | function _toConsumableArray(arr) {
|
44159 | return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
|
44160 | }
|
44161 |
|
44162 | module.exports = _toConsumableArray;
|
44163 |
|
44164 | }),
|
44165 |
|
44166 | (function(module, exports, __webpack_require__) {
|
44167 |
|
44168 | var arrayLikeToArray = __webpack_require__(269);
|
44169 |
|
44170 | function _arrayWithoutHoles(arr) {
|
44171 | if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
44172 | }
|
44173 |
|
44174 | module.exports = _arrayWithoutHoles;
|
44175 |
|
44176 | }),
|
44177 |
|
44178 | (function(module, exports) {
|
44179 |
|
44180 | function _nonIterableSpread() {
|
44181 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
44182 | }
|
44183 |
|
44184 | module.exports = _nonIterableSpread;
|
44185 |
|
44186 | }),
|
44187 |
|
44188 | (function(module, exports) {
|
44189 |
|
44190 | function _defineProperty(obj, key, value) {
|
44191 | if (key in obj) {
|
44192 | Object.defineProperty(obj, key, {
|
44193 | value: value,
|
44194 | enumerable: true,
|
44195 | configurable: true,
|
44196 | writable: true
|
44197 | });
|
44198 | } else {
|
44199 | obj[key] = value;
|
44200 | }
|
44201 |
|
44202 | return obj;
|
44203 | }
|
44204 |
|
44205 | module.exports = _defineProperty;
|
44206 |
|
44207 | }),
|
44208 |
|
44209 | (function(module, exports, __webpack_require__) {
|
44210 |
|
44211 | var objectWithoutPropertiesLoose = __webpack_require__(665);
|
44212 |
|
44213 | function _objectWithoutProperties(source, excluded) {
|
44214 | if (source == null) return {};
|
44215 | var target = objectWithoutPropertiesLoose(source, excluded);
|
44216 | var key, i;
|
44217 |
|
44218 | if (Object.getOwnPropertySymbols) {
|
44219 | var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
44220 |
|
44221 | for (i = 0; i < sourceSymbolKeys.length; i++) {
|
44222 | key = sourceSymbolKeys[i];
|
44223 | if (excluded.indexOf(key) >= 0) continue;
|
44224 | if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
44225 | target[key] = source[key];
|
44226 | }
|
44227 | }
|
44228 |
|
44229 | return target;
|
44230 | }
|
44231 |
|
44232 | module.exports = _objectWithoutProperties;
|
44233 |
|
44234 | }),
|
44235 |
|
44236 | (function(module, exports) {
|
44237 |
|
44238 | function _objectWithoutPropertiesLoose(source, excluded) {
|
44239 | if (source == null) return {};
|
44240 | var target = {};
|
44241 | var sourceKeys = Object.keys(source);
|
44242 | var key, i;
|
44243 |
|
44244 | for (i = 0; i < sourceKeys.length; i++) {
|
44245 | key = sourceKeys[i];
|
44246 | if (excluded.indexOf(key) >= 0) continue;
|
44247 | target[key] = source[key];
|
44248 | }
|
44249 |
|
44250 | return target;
|
44251 | }
|
44252 |
|
44253 | module.exports = _objectWithoutPropertiesLoose;
|
44254 |
|
44255 | }),
|
44256 |
|
44257 | (function(module, exports) {
|
44258 |
|
44259 | function _assertThisInitialized(self) {
|
44260 | if (self === void 0) {
|
44261 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
44262 | }
|
44263 |
|
44264 | return self;
|
44265 | }
|
44266 |
|
44267 | module.exports = _assertThisInitialized;
|
44268 |
|
44269 | }),
|
44270 |
|
44271 | (function(module, exports) {
|
44272 |
|
44273 | function _inheritsLoose(subClass, superClass) {
|
44274 | subClass.prototype = Object.create(superClass.prototype);
|
44275 | subClass.prototype.constructor = subClass;
|
44276 | subClass.__proto__ = superClass;
|
44277 | }
|
44278 |
|
44279 | module.exports = _inheritsLoose;
|
44280 |
|
44281 | }),
|
44282 |
|
44283 | (function(module, exports, __webpack_require__) {
|
44284 |
|
44285 | var arrayShuffle = __webpack_require__(669),
|
44286 | baseShuffle = __webpack_require__(672),
|
44287 | isArray = __webpack_require__(277);
|
44288 |
|
44289 |
|
44290 |
|
44291 |
|
44292 |
|
44293 |
|
44294 |
|
44295 |
|
44296 |
|
44297 |
|
44298 |
|
44299 |
|
44300 |
|
44301 |
|
44302 |
|
44303 |
|
44304 | function shuffle(collection) {
|
44305 | var func = isArray(collection) ? arrayShuffle : baseShuffle;
|
44306 | return func(collection);
|
44307 | }
|
44308 |
|
44309 | module.exports = shuffle;
|
44310 |
|
44311 |
|
44312 | }),
|
44313 |
|
44314 | (function(module, exports, __webpack_require__) {
|
44315 |
|
44316 | var copyArray = __webpack_require__(670),
|
44317 | shuffleSelf = __webpack_require__(272);
|
44318 |
|
44319 |
|
44320 |
|
44321 |
|
44322 |
|
44323 |
|
44324 |
|
44325 |
|
44326 | function arrayShuffle(array) {
|
44327 | return shuffleSelf(copyArray(array));
|
44328 | }
|
44329 |
|
44330 | module.exports = arrayShuffle;
|
44331 |
|
44332 |
|
44333 | }),
|
44334 |
|
44335 | (function(module, exports) {
|
44336 |
|
44337 |
|
44338 |
|
44339 |
|
44340 |
|
44341 |
|
44342 |
|
44343 |
|
44344 |
|
44345 | function copyArray(source, array) {
|
44346 | var index = -1,
|
44347 | length = source.length;
|
44348 |
|
44349 | array || (array = Array(length));
|
44350 | while (++index < length) {
|
44351 | array[index] = source[index];
|
44352 | }
|
44353 | return array;
|
44354 | }
|
44355 |
|
44356 | module.exports = copyArray;
|
44357 |
|
44358 |
|
44359 | }),
|
44360 |
|
44361 | (function(module, exports) {
|
44362 |
|
44363 |
|
44364 | var nativeFloor = Math.floor,
|
44365 | nativeRandom = Math.random;
|
44366 |
|
44367 |
|
44368 |
|
44369 |
|
44370 |
|
44371 |
|
44372 |
|
44373 |
|
44374 |
|
44375 |
|
44376 | function baseRandom(lower, upper) {
|
44377 | return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
|
44378 | }
|
44379 |
|
44380 | module.exports = baseRandom;
|
44381 |
|
44382 |
|
44383 | }),
|
44384 |
|
44385 | (function(module, exports, __webpack_require__) {
|
44386 |
|
44387 | var shuffleSelf = __webpack_require__(272),
|
44388 | values = __webpack_require__(273);
|
44389 |
|
44390 |
|
44391 |
|
44392 |
|
44393 |
|
44394 |
|
44395 |
|
44396 |
|
44397 | function baseShuffle(collection) {
|
44398 | return shuffleSelf(values(collection));
|
44399 | }
|
44400 |
|
44401 | module.exports = baseShuffle;
|
44402 |
|
44403 |
|
44404 | }),
|
44405 |
|
44406 | (function(module, exports, __webpack_require__) {
|
44407 |
|
44408 | var arrayMap = __webpack_require__(674);
|
44409 |
|
44410 |
|
44411 |
|
44412 |
|
44413 |
|
44414 |
|
44415 |
|
44416 |
|
44417 |
|
44418 |
|
44419 |
|
44420 | function baseValues(object, props) {
|
44421 | return arrayMap(props, function(key) {
|
44422 | return object[key];
|
44423 | });
|
44424 | }
|
44425 |
|
44426 | module.exports = baseValues;
|
44427 |
|
44428 |
|
44429 | }),
|
44430 |
|
44431 | (function(module, exports) {
|
44432 |
|
44433 |
|
44434 |
|
44435 |
|
44436 |
|
44437 |
|
44438 |
|
44439 |
|
44440 |
|
44441 |
|
44442 | function arrayMap(array, iteratee) {
|
44443 | var index = -1,
|
44444 | length = array == null ? 0 : array.length,
|
44445 | result = Array(length);
|
44446 |
|
44447 | while (++index < length) {
|
44448 | result[index] = iteratee(array[index], index, array);
|
44449 | }
|
44450 | return result;
|
44451 | }
|
44452 |
|
44453 | module.exports = arrayMap;
|
44454 |
|
44455 |
|
44456 | }),
|
44457 |
|
44458 | (function(module, exports, __webpack_require__) {
|
44459 |
|
44460 | var arrayLikeKeys = __webpack_require__(676),
|
44461 | baseKeys = __webpack_require__(689),
|
44462 | isArrayLike = __webpack_require__(692);
|
44463 |
|
44464 |
|
44465 |
|
44466 |
|
44467 |
|
44468 |
|
44469 |
|
44470 |
|
44471 |
|
44472 |
|
44473 |
|
44474 |
|
44475 |
|
44476 |
|
44477 |
|
44478 |
|
44479 |
|
44480 |
|
44481 |
|
44482 |
|
44483 |
|
44484 |
|
44485 |
|
44486 |
|
44487 |
|
44488 |
|
44489 |
|
44490 |
|
44491 |
|
44492 | function keys(object) {
|
44493 | return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
44494 | }
|
44495 |
|
44496 | module.exports = keys;
|
44497 |
|
44498 |
|
44499 | }),
|
44500 |
|
44501 | (function(module, exports, __webpack_require__) {
|
44502 |
|
44503 | var baseTimes = __webpack_require__(677),
|
44504 | isArguments = __webpack_require__(678),
|
44505 | isArray = __webpack_require__(277),
|
44506 | isBuffer = __webpack_require__(682),
|
44507 | isIndex = __webpack_require__(684),
|
44508 | isTypedArray = __webpack_require__(685);
|
44509 |
|
44510 |
|
44511 | var objectProto = Object.prototype;
|
44512 |
|
44513 |
|
44514 | var hasOwnProperty = objectProto.hasOwnProperty;
|
44515 |
|
44516 |
|
44517 |
|
44518 |
|
44519 |
|
44520 |
|
44521 |
|
44522 |
|
44523 |
|
44524 | function arrayLikeKeys(value, inherited) {
|
44525 | var isArr = isArray(value),
|
44526 | isArg = !isArr && isArguments(value),
|
44527 | isBuff = !isArr && !isArg && isBuffer(value),
|
44528 | isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
44529 | skipIndexes = isArr || isArg || isBuff || isType,
|
44530 | result = skipIndexes ? baseTimes(value.length, String) : [],
|
44531 | length = result.length;
|
44532 |
|
44533 | for (var key in value) {
|
44534 | if ((inherited || hasOwnProperty.call(value, key)) &&
|
44535 | !(skipIndexes && (
|
44536 |
|
44537 | key == 'length' ||
|
44538 |
|
44539 | (isBuff && (key == 'offset' || key == 'parent')) ||
|
44540 |
|
44541 | (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
44542 |
|
44543 | isIndex(key, length)
|
44544 | ))) {
|
44545 | result.push(key);
|
44546 | }
|
44547 | }
|
44548 | return result;
|
44549 | }
|
44550 |
|
44551 | module.exports = arrayLikeKeys;
|
44552 |
|
44553 |
|
44554 | }),
|
44555 |
|
44556 | (function(module, exports) {
|
44557 |
|
44558 |
|
44559 |
|
44560 |
|
44561 |
|
44562 |
|
44563 |
|
44564 |
|
44565 |
|
44566 |
|
44567 | function baseTimes(n, iteratee) {
|
44568 | var index = -1,
|
44569 | result = Array(n);
|
44570 |
|
44571 | while (++index < n) {
|
44572 | result[index] = iteratee(index);
|
44573 | }
|
44574 | return result;
|
44575 | }
|
44576 |
|
44577 | module.exports = baseTimes;
|
44578 |
|
44579 |
|
44580 | }),
|
44581 |
|
44582 | (function(module, exports, __webpack_require__) {
|
44583 |
|
44584 | var baseIsArguments = __webpack_require__(679),
|
44585 | isObjectLike = __webpack_require__(120);
|
44586 |
|
44587 |
|
44588 | var objectProto = Object.prototype;
|
44589 |
|
44590 |
|
44591 | var hasOwnProperty = objectProto.hasOwnProperty;
|
44592 |
|
44593 |
|
44594 | var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
44595 |
|
44596 |
|
44597 |
|
44598 |
|
44599 |
|
44600 |
|
44601 |
|
44602 |
|
44603 |
|
44604 |
|
44605 |
|
44606 |
|
44607 |
|
44608 |
|
44609 |
|
44610 |
|
44611 |
|
44612 |
|
44613 |
|
44614 | var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
44615 | return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
44616 | !propertyIsEnumerable.call(value, 'callee');
|
44617 | };
|
44618 |
|
44619 | module.exports = isArguments;
|
44620 |
|
44621 |
|
44622 | }),
|
44623 |
|
44624 | (function(module, exports, __webpack_require__) {
|
44625 |
|
44626 | var baseGetTag = __webpack_require__(119),
|
44627 | isObjectLike = __webpack_require__(120);
|
44628 |
|
44629 |
|
44630 | var argsTag = '[object Arguments]';
|
44631 |
|
44632 |
|
44633 |
|
44634 |
|
44635 |
|
44636 |
|
44637 |
|
44638 |
|
44639 | function baseIsArguments(value) {
|
44640 | return isObjectLike(value) && baseGetTag(value) == argsTag;
|
44641 | }
|
44642 |
|
44643 | module.exports = baseIsArguments;
|
44644 |
|
44645 |
|
44646 | }),
|
44647 |
|
44648 | (function(module, exports, __webpack_require__) {
|
44649 |
|
44650 | var Symbol = __webpack_require__(274);
|
44651 |
|
44652 |
|
44653 | var objectProto = Object.prototype;
|
44654 |
|
44655 |
|
44656 | var hasOwnProperty = objectProto.hasOwnProperty;
|
44657 |
|
44658 |
|
44659 |
|
44660 |
|
44661 |
|
44662 |
|
44663 | var nativeObjectToString = objectProto.toString;
|
44664 |
|
44665 |
|
44666 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
44667 |
|
44668 |
|
44669 |
|
44670 |
|
44671 |
|
44672 |
|
44673 |
|
44674 |
|
44675 | function getRawTag(value) {
|
44676 | var isOwn = hasOwnProperty.call(value, symToStringTag),
|
44677 | tag = value[symToStringTag];
|
44678 |
|
44679 | try {
|
44680 | value[symToStringTag] = undefined;
|
44681 | var unmasked = true;
|
44682 | } catch (e) {}
|
44683 |
|
44684 | var result = nativeObjectToString.call(value);
|
44685 | if (unmasked) {
|
44686 | if (isOwn) {
|
44687 | value[symToStringTag] = tag;
|
44688 | } else {
|
44689 | delete value[symToStringTag];
|
44690 | }
|
44691 | }
|
44692 | return result;
|
44693 | }
|
44694 |
|
44695 | module.exports = getRawTag;
|
44696 |
|
44697 |
|
44698 | }),
|
44699 |
|
44700 | (function(module, exports) {
|
44701 |
|
44702 |
|
44703 | var objectProto = Object.prototype;
|
44704 |
|
44705 |
|
44706 |
|
44707 |
|
44708 |
|
44709 |
|
44710 | var nativeObjectToString = objectProto.toString;
|
44711 |
|
44712 |
|
44713 |
|
44714 |
|
44715 |
|
44716 |
|
44717 |
|
44718 |
|
44719 | function objectToString(value) {
|
44720 | return nativeObjectToString.call(value);
|
44721 | }
|
44722 |
|
44723 | module.exports = objectToString;
|
44724 |
|
44725 |
|
44726 | }),
|
44727 |
|
44728 | (function(module, exports, __webpack_require__) {
|
44729 |
|
44730 | (function(module) {var root = __webpack_require__(275),
|
44731 | stubFalse = __webpack_require__(683);
|
44732 |
|
44733 |
|
44734 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
44735 |
|
44736 |
|
44737 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
44738 |
|
44739 |
|
44740 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
44741 |
|
44742 |
|
44743 | var Buffer = moduleExports ? root.Buffer : undefined;
|
44744 |
|
44745 |
|
44746 | var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
44747 |
|
44748 |
|
44749 |
|
44750 |
|
44751 |
|
44752 |
|
44753 |
|
44754 |
|
44755 |
|
44756 |
|
44757 |
|
44758 |
|
44759 |
|
44760 |
|
44761 |
|
44762 |
|
44763 |
|
44764 |
|
44765 | var isBuffer = nativeIsBuffer || stubFalse;
|
44766 |
|
44767 | module.exports = isBuffer;
|
44768 |
|
44769 | }.call(exports, __webpack_require__(278)(module)))
|
44770 |
|
44771 | }),
|
44772 |
|
44773 | (function(module, exports) {
|
44774 |
|
44775 |
|
44776 |
|
44777 |
|
44778 |
|
44779 |
|
44780 |
|
44781 |
|
44782 |
|
44783 |
|
44784 |
|
44785 |
|
44786 |
|
44787 |
|
44788 | function stubFalse() {
|
44789 | return false;
|
44790 | }
|
44791 |
|
44792 | module.exports = stubFalse;
|
44793 |
|
44794 |
|
44795 | }),
|
44796 |
|
44797 | (function(module, exports) {
|
44798 |
|
44799 |
|
44800 | var MAX_SAFE_INTEGER = 9007199254740991;
|
44801 |
|
44802 |
|
44803 | var reIsUint = /^(?:0|[1-9]\d*)$/;
|
44804 |
|
44805 |
|
44806 |
|
44807 |
|
44808 |
|
44809 |
|
44810 |
|
44811 |
|
44812 |
|
44813 | function isIndex(value, length) {
|
44814 | var type = typeof value;
|
44815 | length = length == null ? MAX_SAFE_INTEGER : length;
|
44816 |
|
44817 | return !!length &&
|
44818 | (type == 'number' ||
|
44819 | (type != 'symbol' && reIsUint.test(value))) &&
|
44820 | (value > -1 && value % 1 == 0 && value < length);
|
44821 | }
|
44822 |
|
44823 | module.exports = isIndex;
|
44824 |
|
44825 |
|
44826 | }),
|
44827 |
|
44828 | (function(module, exports, __webpack_require__) {
|
44829 |
|
44830 | var baseIsTypedArray = __webpack_require__(686),
|
44831 | baseUnary = __webpack_require__(687),
|
44832 | nodeUtil = __webpack_require__(688);
|
44833 |
|
44834 |
|
44835 | var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
44836 |
|
44837 |
|
44838 |
|
44839 |
|
44840 |
|
44841 |
|
44842 |
|
44843 |
|
44844 |
|
44845 |
|
44846 |
|
44847 |
|
44848 |
|
44849 |
|
44850 |
|
44851 |
|
44852 |
|
44853 |
|
44854 | var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
44855 |
|
44856 | module.exports = isTypedArray;
|
44857 |
|
44858 |
|
44859 | }),
|
44860 |
|
44861 | (function(module, exports, __webpack_require__) {
|
44862 |
|
44863 | var baseGetTag = __webpack_require__(119),
|
44864 | isLength = __webpack_require__(279),
|
44865 | isObjectLike = __webpack_require__(120);
|
44866 |
|
44867 |
|
44868 | var argsTag = '[object Arguments]',
|
44869 | arrayTag = '[object Array]',
|
44870 | boolTag = '[object Boolean]',
|
44871 | dateTag = '[object Date]',
|
44872 | errorTag = '[object Error]',
|
44873 | funcTag = '[object Function]',
|
44874 | mapTag = '[object Map]',
|
44875 | numberTag = '[object Number]',
|
44876 | objectTag = '[object Object]',
|
44877 | regexpTag = '[object RegExp]',
|
44878 | setTag = '[object Set]',
|
44879 | stringTag = '[object String]',
|
44880 | weakMapTag = '[object WeakMap]';
|
44881 |
|
44882 | var arrayBufferTag = '[object ArrayBuffer]',
|
44883 | dataViewTag = '[object DataView]',
|
44884 | float32Tag = '[object Float32Array]',
|
44885 | float64Tag = '[object Float64Array]',
|
44886 | int8Tag = '[object Int8Array]',
|
44887 | int16Tag = '[object Int16Array]',
|
44888 | int32Tag = '[object Int32Array]',
|
44889 | uint8Tag = '[object Uint8Array]',
|
44890 | uint8ClampedTag = '[object Uint8ClampedArray]',
|
44891 | uint16Tag = '[object Uint16Array]',
|
44892 | uint32Tag = '[object Uint32Array]';
|
44893 |
|
44894 |
|
44895 | var typedArrayTags = {};
|
44896 | typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
44897 | typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
44898 | typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
44899 | typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
44900 | typedArrayTags[uint32Tag] = true;
|
44901 | typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
44902 | typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
44903 | typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
44904 | typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
44905 | typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
44906 | typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
44907 | typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
44908 | typedArrayTags[weakMapTag] = false;
|
44909 |
|
44910 |
|
44911 |
|
44912 |
|
44913 |
|
44914 |
|
44915 |
|
44916 |
|
44917 | function baseIsTypedArray(value) {
|
44918 | return isObjectLike(value) &&
|
44919 | isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
44920 | }
|
44921 |
|
44922 | module.exports = baseIsTypedArray;
|
44923 |
|
44924 |
|
44925 | }),
|
44926 |
|
44927 | (function(module, exports) {
|
44928 |
|
44929 |
|
44930 |
|
44931 |
|
44932 |
|
44933 |
|
44934 |
|
44935 |
|
44936 | function baseUnary(func) {
|
44937 | return function(value) {
|
44938 | return func(value);
|
44939 | };
|
44940 | }
|
44941 |
|
44942 | module.exports = baseUnary;
|
44943 |
|
44944 |
|
44945 | }),
|
44946 |
|
44947 | (function(module, exports, __webpack_require__) {
|
44948 |
|
44949 | (function(module) {var freeGlobal = __webpack_require__(276);
|
44950 |
|
44951 |
|
44952 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
44953 |
|
44954 |
|
44955 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
44956 |
|
44957 |
|
44958 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
44959 |
|
44960 |
|
44961 | var freeProcess = moduleExports && freeGlobal.process;
|
44962 |
|
44963 |
|
44964 | var nodeUtil = (function() {
|
44965 | try {
|
44966 |
|
44967 | var types = freeModule && freeModule.require && freeModule.require('util').types;
|
44968 |
|
44969 | if (types) {
|
44970 | return types;
|
44971 | }
|
44972 |
|
44973 |
|
44974 | return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
44975 | } catch (e) {}
|
44976 | }());
|
44977 |
|
44978 | module.exports = nodeUtil;
|
44979 |
|
44980 | }.call(exports, __webpack_require__(278)(module)))
|
44981 |
|
44982 | }),
|
44983 |
|
44984 | (function(module, exports, __webpack_require__) {
|
44985 |
|
44986 | var isPrototype = __webpack_require__(690),
|
44987 | nativeKeys = __webpack_require__(691);
|
44988 |
|
44989 |
|
44990 | var objectProto = Object.prototype;
|
44991 |
|
44992 |
|
44993 | var hasOwnProperty = objectProto.hasOwnProperty;
|
44994 |
|
44995 |
|
44996 |
|
44997 |
|
44998 |
|
44999 |
|
45000 |
|
45001 |
|
45002 | function baseKeys(object) {
|
45003 | if (!isPrototype(object)) {
|
45004 | return nativeKeys(object);
|
45005 | }
|
45006 | var result = [];
|
45007 | for (var key in Object(object)) {
|
45008 | if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
45009 | result.push(key);
|
45010 | }
|
45011 | }
|
45012 | return result;
|
45013 | }
|
45014 |
|
45015 | module.exports = baseKeys;
|
45016 |
|
45017 |
|
45018 | }),
|
45019 |
|
45020 | (function(module, exports) {
|
45021 |
|
45022 |
|
45023 | var objectProto = Object.prototype;
|
45024 |
|
45025 |
|
45026 |
|
45027 |
|
45028 |
|
45029 |
|
45030 |
|
45031 |
|
45032 | function isPrototype(value) {
|
45033 | var Ctor = value && value.constructor,
|
45034 | proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
45035 |
|
45036 | return value === proto;
|
45037 | }
|
45038 |
|
45039 | module.exports = isPrototype;
|
45040 |
|
45041 |
|
45042 | }),
|
45043 |
|
45044 | (function(module, exports, __webpack_require__) {
|
45045 |
|
45046 | var overArg = __webpack_require__(280);
|
45047 |
|
45048 |
|
45049 | var nativeKeys = overArg(Object.keys, Object);
|
45050 |
|
45051 | module.exports = nativeKeys;
|
45052 |
|
45053 |
|
45054 | }),
|
45055 |
|
45056 | (function(module, exports, __webpack_require__) {
|
45057 |
|
45058 | var isFunction = __webpack_require__(693),
|
45059 | isLength = __webpack_require__(279);
|
45060 |
|
45061 |
|
45062 |
|
45063 |
|
45064 |
|
45065 |
|
45066 |
|
45067 |
|
45068 |
|
45069 |
|
45070 |
|
45071 |
|
45072 |
|
45073 |
|
45074 |
|
45075 |
|
45076 |
|
45077 |
|
45078 |
|
45079 |
|
45080 |
|
45081 |
|
45082 |
|
45083 |
|
45084 |
|
45085 |
|
45086 | function isArrayLike(value) {
|
45087 | return value != null && isLength(value.length) && !isFunction(value);
|
45088 | }
|
45089 |
|
45090 | module.exports = isArrayLike;
|
45091 |
|
45092 |
|
45093 | }),
|
45094 |
|
45095 | (function(module, exports, __webpack_require__) {
|
45096 |
|
45097 | var baseGetTag = __webpack_require__(119),
|
45098 | isObject = __webpack_require__(694);
|
45099 |
|
45100 |
|
45101 | var asyncTag = '[object AsyncFunction]',
|
45102 | funcTag = '[object Function]',
|
45103 | genTag = '[object GeneratorFunction]',
|
45104 | proxyTag = '[object Proxy]';
|
45105 |
|
45106 |
|
45107 |
|
45108 |
|
45109 |
|
45110 |
|
45111 |
|
45112 |
|
45113 |
|
45114 |
|
45115 |
|
45116 |
|
45117 |
|
45118 |
|
45119 |
|
45120 |
|
45121 |
|
45122 |
|
45123 | function isFunction(value) {
|
45124 | if (!isObject(value)) {
|
45125 | return false;
|
45126 | }
|
45127 |
|
45128 |
|
45129 | var tag = baseGetTag(value);
|
45130 | return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
45131 | }
|
45132 |
|
45133 | module.exports = isFunction;
|
45134 |
|
45135 |
|
45136 | }),
|
45137 |
|
45138 | (function(module, exports) {
|
45139 |
|
45140 |
|
45141 |
|
45142 |
|
45143 |
|
45144 |
|
45145 |
|
45146 |
|
45147 |
|
45148 |
|
45149 |
|
45150 |
|
45151 |
|
45152 |
|
45153 |
|
45154 |
|
45155 |
|
45156 |
|
45157 |
|
45158 |
|
45159 |
|
45160 |
|
45161 |
|
45162 |
|
45163 |
|
45164 |
|
45165 | function isObject(value) {
|
45166 | var type = typeof value;
|
45167 | return value != null && (type == 'object' || type == 'function');
|
45168 | }
|
45169 |
|
45170 | module.exports = isObject;
|
45171 |
|
45172 |
|
45173 | }),
|
45174 |
|
45175 | (function(module, exports, __webpack_require__) {
|
45176 |
|
45177 | var arrayWithHoles = __webpack_require__(696);
|
45178 |
|
45179 | var iterableToArray = __webpack_require__(270);
|
45180 |
|
45181 | var unsupportedIterableToArray = __webpack_require__(271);
|
45182 |
|
45183 | var nonIterableRest = __webpack_require__(697);
|
45184 |
|
45185 | function _toArray(arr) {
|
45186 | return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();
|
45187 | }
|
45188 |
|
45189 | module.exports = _toArray;
|
45190 |
|
45191 | }),
|
45192 |
|
45193 | (function(module, exports) {
|
45194 |
|
45195 | function _arrayWithHoles(arr) {
|
45196 | if (Array.isArray(arr)) return arr;
|
45197 | }
|
45198 |
|
45199 | module.exports = _arrayWithHoles;
|
45200 |
|
45201 | }),
|
45202 |
|
45203 | (function(module, exports) {
|
45204 |
|
45205 | function _nonIterableRest() {
|
45206 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
45207 | }
|
45208 |
|
45209 | module.exports = _nonIterableRest;
|
45210 |
|
45211 | }),
|
45212 |
|
45213 | (function(module, exports) {
|
45214 |
|
45215 | function _defineProperties(target, props) {
|
45216 | for (var i = 0; i < props.length; i++) {
|
45217 | var descriptor = props[i];
|
45218 | descriptor.enumerable = descriptor.enumerable || false;
|
45219 | descriptor.configurable = true;
|
45220 | if ("value" in descriptor) descriptor.writable = true;
|
45221 | Object.defineProperty(target, descriptor.key, descriptor);
|
45222 | }
|
45223 | }
|
45224 |
|
45225 | function _createClass(Constructor, protoProps, staticProps) {
|
45226 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
45227 | if (staticProps) _defineProperties(Constructor, staticProps);
|
45228 | return Constructor;
|
45229 | }
|
45230 |
|
45231 | module.exports = _createClass;
|
45232 |
|
45233 | }),
|
45234 |
|
45235 | (function(module, exports) {
|
45236 |
|
45237 | function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
|
45238 | var desc = {};
|
45239 | Object.keys(descriptor).forEach(function (key) {
|
45240 | desc[key] = descriptor[key];
|
45241 | });
|
45242 | desc.enumerable = !!desc.enumerable;
|
45243 | desc.configurable = !!desc.configurable;
|
45244 |
|
45245 | if ('value' in desc || desc.initializer) {
|
45246 | desc.writable = true;
|
45247 | }
|
45248 |
|
45249 | desc = decorators.slice().reverse().reduce(function (desc, decorator) {
|
45250 | return decorator(target, property, desc) || desc;
|
45251 | }, desc);
|
45252 |
|
45253 | if (context && desc.initializer !== void 0) {
|
45254 | desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
45255 | desc.initializer = undefined;
|
45256 | }
|
45257 |
|
45258 | if (desc.initializer === void 0) {
|
45259 | Object.defineProperty(target, property, desc);
|
45260 | desc = null;
|
45261 | }
|
45262 |
|
45263 | return desc;
|
45264 | }
|
45265 |
|
45266 | module.exports = _applyDecoratedDescriptor;
|
45267 |
|
45268 | }),
|
45269 |
|
45270 | (function(module, exports, __webpack_require__) {
|
45271 |
|
45272 |
|
45273 |
|
45274 |
|
45275 |
|
45276 |
|
45277 |
|
45278 |
|
45279 |
|
45280 |
|
45281 | (function () {
|
45282 |
|
45283 | var StateMachine = {
|
45284 |
|
45285 |
|
45286 |
|
45287 | VERSION: "2.4.0",
|
45288 |
|
45289 |
|
45290 |
|
45291 | Result: {
|
45292 | SUCCEEDED: 1,
|
45293 | NOTRANSITION: 2,
|
45294 | CANCELLED: 3,
|
45295 | PENDING: 4
|
45296 | },
|
45297 |
|
45298 | Error: {
|
45299 | INVALID_TRANSITION: 100,
|
45300 | PENDING_TRANSITION: 200,
|
45301 | INVALID_CALLBACK: 300
|
45302 | },
|
45303 |
|
45304 | WILDCARD: '*',
|
45305 | ASYNC: 'async',
|
45306 |
|
45307 |
|
45308 |
|
45309 | create: function(cfg, target) {
|
45310 |
|
45311 | var initial = (typeof cfg.initial == 'string') ? { state: cfg.initial } : cfg.initial;
|
45312 | var terminal = cfg.terminal || cfg['final'];
|
45313 | var fsm = target || cfg.target || {};
|
45314 | var events = cfg.events || [];
|
45315 | var callbacks = cfg.callbacks || {};
|
45316 | var map = {};
|
45317 | var transitions = {};
|
45318 |
|
45319 | var add = function(e) {
|
45320 | var from = Array.isArray(e.from) ? e.from : (e.from ? [e.from] : [StateMachine.WILDCARD]);
|
45321 | map[e.name] = map[e.name] || {};
|
45322 | for (var n = 0 ; n < from.length ; n++) {
|
45323 | transitions[from[n]] = transitions[from[n]] || [];
|
45324 | transitions[from[n]].push(e.name);
|
45325 |
|
45326 | map[e.name][from[n]] = e.to || from[n];
|
45327 | }
|
45328 | if (e.to)
|
45329 | transitions[e.to] = transitions[e.to] || [];
|
45330 | };
|
45331 |
|
45332 | if (initial) {
|
45333 | initial.event = initial.event || 'startup';
|
45334 | add({ name: initial.event, from: 'none', to: initial.state });
|
45335 | }
|
45336 |
|
45337 | for(var n = 0 ; n < events.length ; n++)
|
45338 | add(events[n]);
|
45339 |
|
45340 | for(var name in map) {
|
45341 | if (map.hasOwnProperty(name))
|
45342 | fsm[name] = StateMachine.buildEvent(name, map[name]);
|
45343 | }
|
45344 |
|
45345 | for(var name in callbacks) {
|
45346 | if (callbacks.hasOwnProperty(name))
|
45347 | fsm[name] = callbacks[name]
|
45348 | }
|
45349 |
|
45350 | fsm.current = 'none';
|
45351 | fsm.is = function(state) { return Array.isArray(state) ? (state.indexOf(this.current) >= 0) : (this.current === state); };
|
45352 | fsm.can = function(event) { return !this.transition && (map[event] !== undefined) && (map[event].hasOwnProperty(this.current) || map[event].hasOwnProperty(StateMachine.WILDCARD)); }
|
45353 | fsm.cannot = function(event) { return !this.can(event); };
|
45354 | fsm.transitions = function() { return (transitions[this.current] || []).concat(transitions[StateMachine.WILDCARD] || []); };
|
45355 | fsm.isFinished = function() { return this.is(terminal); };
|
45356 | fsm.error = cfg.error || function(name, from, to, args, error, msg, e) { throw e || msg; };
|
45357 | fsm.states = function() { return Object.keys(transitions).sort() };
|
45358 |
|
45359 | if (initial && !initial.defer)
|
45360 | fsm[initial.event]();
|
45361 |
|
45362 | return fsm;
|
45363 |
|
45364 | },
|
45365 |
|
45366 |
|
45367 |
|
45368 | doCallback: function(fsm, func, name, from, to, args) {
|
45369 | if (func) {
|
45370 | try {
|
45371 | return func.apply(fsm, [name, from, to].concat(args));
|
45372 | }
|
45373 | catch(e) {
|
45374 | return fsm.error(name, from, to, args, StateMachine.Error.INVALID_CALLBACK, "an exception occurred in a caller-provided callback function", e);
|
45375 | }
|
45376 | }
|
45377 | },
|
45378 |
|
45379 | beforeAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbeforeevent'], name, from, to, args); },
|
45380 | afterAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafterevent'] || fsm['onevent'], name, from, to, args); },
|
45381 | leaveAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleavestate'], name, from, to, args); },
|
45382 | enterAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenterstate'] || fsm['onstate'], name, from, to, args); },
|
45383 | changeState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onchangestate'], name, from, to, args); },
|
45384 |
|
45385 | beforeThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbefore' + name], name, from, to, args); },
|
45386 | afterThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafter' + name] || fsm['on' + name], name, from, to, args); },
|
45387 | leaveThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleave' + from], name, from, to, args); },
|
45388 | enterThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenter' + to] || fsm['on' + to], name, from, to, args); },
|
45389 |
|
45390 | beforeEvent: function(fsm, name, from, to, args) {
|
45391 | if ((false === StateMachine.beforeThisEvent(fsm, name, from, to, args)) ||
|
45392 | (false === StateMachine.beforeAnyEvent( fsm, name, from, to, args)))
|
45393 | return false;
|
45394 | },
|
45395 |
|
45396 | afterEvent: function(fsm, name, from, to, args) {
|
45397 | StateMachine.afterThisEvent(fsm, name, from, to, args);
|
45398 | StateMachine.afterAnyEvent( fsm, name, from, to, args);
|
45399 | },
|
45400 |
|
45401 | leaveState: function(fsm, name, from, to, args) {
|
45402 | var specific = StateMachine.leaveThisState(fsm, name, from, to, args),
|
45403 | general = StateMachine.leaveAnyState( fsm, name, from, to, args);
|
45404 | if ((false === specific) || (false === general))
|
45405 | return false;
|
45406 | else if ((StateMachine.ASYNC === specific) || (StateMachine.ASYNC === general))
|
45407 | return StateMachine.ASYNC;
|
45408 | },
|
45409 |
|
45410 | enterState: function(fsm, name, from, to, args) {
|
45411 | StateMachine.enterThisState(fsm, name, from, to, args);
|
45412 | StateMachine.enterAnyState( fsm, name, from, to, args);
|
45413 | },
|
45414 |
|
45415 |
|
45416 |
|
45417 | buildEvent: function(name, map) {
|
45418 | return function() {
|
45419 |
|
45420 | var from = this.current;
|
45421 | var to = map[from] || (map[StateMachine.WILDCARD] != StateMachine.WILDCARD ? map[StateMachine.WILDCARD] : from) || from;
|
45422 | var args = Array.prototype.slice.call(arguments);
|
45423 |
|
45424 | if (this.transition)
|
45425 | return this.error(name, from, to, args, StateMachine.Error.PENDING_TRANSITION, "event " + name + " inappropriate because previous transition did not complete");
|
45426 |
|
45427 | if (this.cannot(name))
|
45428 | return this.error(name, from, to, args, StateMachine.Error.INVALID_TRANSITION, "event " + name + " inappropriate in current state " + this.current);
|
45429 |
|
45430 | if (false === StateMachine.beforeEvent(this, name, from, to, args))
|
45431 | return StateMachine.Result.CANCELLED;
|
45432 |
|
45433 | if (from === to) {
|
45434 | StateMachine.afterEvent(this, name, from, to, args);
|
45435 | return StateMachine.Result.NOTRANSITION;
|
45436 | }
|
45437 |
|
45438 |
|
45439 | var fsm = this;
|
45440 | this.transition = function() {
|
45441 | fsm.transition = null;
|
45442 | fsm.current = to;
|
45443 | StateMachine.enterState( fsm, name, from, to, args);
|
45444 | StateMachine.changeState(fsm, name, from, to, args);
|
45445 | StateMachine.afterEvent( fsm, name, from, to, args);
|
45446 | return StateMachine.Result.SUCCEEDED;
|
45447 | };
|
45448 | this.transition.cancel = function() {
|
45449 | fsm.transition = null;
|
45450 | StateMachine.afterEvent(fsm, name, from, to, args);
|
45451 | }
|
45452 |
|
45453 | var leave = StateMachine.leaveState(this, name, from, to, args);
|
45454 | if (false === leave) {
|
45455 | this.transition = null;
|
45456 | return StateMachine.Result.CANCELLED;
|
45457 | }
|
45458 | else if (StateMachine.ASYNC === leave) {
|
45459 | return StateMachine.Result.PENDING;
|
45460 | }
|
45461 | else {
|
45462 | if (this.transition)
|
45463 | return this.transition();
|
45464 | }
|
45465 |
|
45466 | };
|
45467 | }
|
45468 |
|
45469 | };
|
45470 |
|
45471 |
|
45472 |
|
45473 |
|
45474 |
|
45475 |
|
45476 | if (true) {
|
45477 | if (typeof module !== 'undefined' && module.exports) {
|
45478 | exports = module.exports = StateMachine;
|
45479 | }
|
45480 | exports.StateMachine = StateMachine;
|
45481 | }
|
45482 |
|
45483 |
|
45484 |
|
45485 | else if (typeof define === 'function' && define.amd) {
|
45486 | define(function(require) { return StateMachine; });
|
45487 | }
|
45488 |
|
45489 |
|
45490 |
|
45491 | else if (typeof window !== 'undefined') {
|
45492 | window.StateMachine = StateMachine;
|
45493 | }
|
45494 |
|
45495 |
|
45496 |
|
45497 | else if (typeof self !== 'undefined') {
|
45498 | self.StateMachine = StateMachine;
|
45499 | }
|
45500 |
|
45501 | }());
|
45502 |
|
45503 |
|
45504 | }),
|
45505 |
|
45506 | (function(module, exports) {
|
45507 |
|
45508 | function _typeof(obj) {
|
45509 | "@babel/helpers - typeof";
|
45510 |
|
45511 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
45512 | module.exports = _typeof = function _typeof(obj) {
|
45513 | return typeof obj;
|
45514 | };
|
45515 | } else {
|
45516 | module.exports = _typeof = function _typeof(obj) {
|
45517 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
45518 | };
|
45519 | }
|
45520 |
|
45521 | return _typeof(obj);
|
45522 | }
|
45523 |
|
45524 | module.exports = _typeof;
|
45525 |
|
45526 | }),
|
45527 |
|
45528 | (function(module, exports, __webpack_require__) {
|
45529 |
|
45530 | var baseGetTag = __webpack_require__(119),
|
45531 | getPrototype = __webpack_require__(703),
|
45532 | isObjectLike = __webpack_require__(120);
|
45533 |
|
45534 |
|
45535 | var objectTag = '[object Object]';
|
45536 |
|
45537 |
|
45538 | var funcProto = Function.prototype,
|
45539 | objectProto = Object.prototype;
|
45540 |
|
45541 |
|
45542 | var funcToString = funcProto.toString;
|
45543 |
|
45544 |
|
45545 | var hasOwnProperty = objectProto.hasOwnProperty;
|
45546 |
|
45547 |
|
45548 | var objectCtorString = funcToString.call(Object);
|
45549 |
|
45550 |
|
45551 |
|
45552 |
|
45553 |
|
45554 |
|
45555 |
|
45556 |
|
45557 |
|
45558 |
|
45559 |
|
45560 |
|
45561 |
|
45562 |
|
45563 |
|
45564 |
|
45565 |
|
45566 |
|
45567 |
|
45568 |
|
45569 |
|
45570 |
|
45571 |
|
45572 |
|
45573 |
|
45574 |
|
45575 |
|
45576 |
|
45577 |
|
45578 | function isPlainObject(value) {
|
45579 | if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
45580 | return false;
|
45581 | }
|
45582 | var proto = getPrototype(value);
|
45583 | if (proto === null) {
|
45584 | return true;
|
45585 | }
|
45586 | var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
45587 | return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
45588 | funcToString.call(Ctor) == objectCtorString;
|
45589 | }
|
45590 |
|
45591 | module.exports = isPlainObject;
|
45592 |
|
45593 |
|
45594 | }),
|
45595 |
|
45596 | (function(module, exports, __webpack_require__) {
|
45597 |
|
45598 | var overArg = __webpack_require__(280);
|
45599 |
|
45600 |
|
45601 | var getPrototype = overArg(Object.getPrototypeOf, Object);
|
45602 |
|
45603 | module.exports = getPrototype;
|
45604 |
|
45605 |
|
45606 | }),
|
45607 |
|
45608 | (function(module, exports, __webpack_require__) {
|
45609 |
|
45610 | "use strict";
|
45611 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
|
45612 |
|
45613 | var _interopRequireDefault = __webpack_require__(1);
|
45614 |
|
45615 | var _isIterable2 = _interopRequireDefault(__webpack_require__(262));
|
45616 |
|
45617 | var _from = _interopRequireDefault(__webpack_require__(152));
|
45618 |
|
45619 | var _set = _interopRequireDefault(__webpack_require__(268));
|
45620 |
|
45621 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
45622 |
|
45623 | var _assign = _interopRequireDefault(__webpack_require__(265));
|
45624 |
|
45625 | var _map = _interopRequireDefault(__webpack_require__(37));
|
45626 |
|
45627 | var _defineProperty = _interopRequireDefault(__webpack_require__(94));
|
45628 |
|
45629 | var _typeof2 = _interopRequireDefault(__webpack_require__(95));
|
45630 |
|
45631 | (function (global, factory) {
|
45632 | ( false ? "undefined" : (0, _typeof2.default)(exports)) === 'object' && typeof module !== 'undefined' ? factory(exports, __webpack_require__(155)) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(155)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
45633 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
45634 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
45635 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (global = global || self, factory(global.AV = global.AV || {}, global.AV));
|
45636 | })(void 0, function (exports, core) {
|
45637 | 'use strict';
|
45638 |
|
45639 | function _inheritsLoose(subClass, superClass) {
|
45640 | subClass.prototype = Object.create(superClass.prototype);
|
45641 | subClass.prototype.constructor = subClass;
|
45642 | subClass.__proto__ = superClass;
|
45643 | }
|
45644 |
|
45645 | function _toConsumableArray(arr) {
|
45646 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
45647 | }
|
45648 |
|
45649 | function _arrayWithoutHoles(arr) {
|
45650 | if (Array.isArray(arr)) {
|
45651 | for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
|
45652 | arr2[i] = arr[i];
|
45653 | }
|
45654 |
|
45655 | return arr2;
|
45656 | }
|
45657 | }
|
45658 |
|
45659 | function _iterableToArray(iter) {
|
45660 | if ((0, _isIterable2.default)(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return (0, _from.default)(iter);
|
45661 | }
|
45662 |
|
45663 | function _nonIterableSpread() {
|
45664 | throw new TypeError("Invalid attempt to spread non-iterable instance");
|
45665 | }
|
45666 |
|
45667 |
|
45668 |
|
45669 | if (!core.Protocals) {
|
45670 | throw new Error('LeanCloud Realtime SDK not installed');
|
45671 | }
|
45672 |
|
45673 | var CommandType = core.Protocals.CommandType,
|
45674 | GenericCommand = core.Protocals.GenericCommand,
|
45675 | AckCommand = core.Protocals.AckCommand;
|
45676 |
|
45677 | var warn = function warn(error) {
|
45678 | return console.warn(error.message);
|
45679 | };
|
45680 |
|
45681 | var LiveQueryClient = function (_EventEmitter) {
|
45682 | _inheritsLoose(LiveQueryClient, _EventEmitter);
|
45683 |
|
45684 | function LiveQueryClient(appId, subscriptionId, connection) {
|
45685 | var _this;
|
45686 |
|
45687 | _this = _EventEmitter.call(this) || this;
|
45688 | _this._appId = appId;
|
45689 | _this.id = subscriptionId;
|
45690 | _this._connection = connection;
|
45691 | _this._eventemitter = new core.EventEmitter();
|
45692 | _this._querys = new _set.default();
|
45693 | return _this;
|
45694 | }
|
45695 |
|
45696 | var _proto = LiveQueryClient.prototype;
|
45697 |
|
45698 | _proto._send = function _send(cmd) {
|
45699 | var _context;
|
45700 |
|
45701 | var _this$_connection;
|
45702 |
|
45703 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
45704 | args[_key - 1] = arguments[_key];
|
45705 | }
|
45706 |
|
45707 | return (_this$_connection = this._connection).send.apply(_this$_connection, (0, _concat.default)(_context = [(0, _assign.default)(cmd, {
|
45708 | appId: this._appId,
|
45709 | installationId: this.id,
|
45710 | service: 1
|
45711 | })]).call(_context, args));
|
45712 | };
|
45713 |
|
45714 | _proto._open = function _open() {
|
45715 | return this._send(new GenericCommand({
|
45716 | cmd: CommandType.login
|
45717 | }));
|
45718 | };
|
45719 |
|
45720 | _proto.close = function close() {
|
45721 | var _ee = this._eventemitter;
|
45722 |
|
45723 | _ee.emit('beforeclose');
|
45724 |
|
45725 | return this._send(new GenericCommand({
|
45726 | cmd: CommandType.logout
|
45727 | })).then(function () {
|
45728 | return _ee.emit('close');
|
45729 | });
|
45730 | };
|
45731 |
|
45732 | _proto.register = function register(liveQuery) {
|
45733 | this._querys.add(liveQuery);
|
45734 | };
|
45735 |
|
45736 | _proto.deregister = function deregister(liveQuery) {
|
45737 | var _this2 = this;
|
45738 |
|
45739 | this._querys.delete(liveQuery);
|
45740 |
|
45741 | setTimeout(function () {
|
45742 | if (!_this2._querys.size) _this2.close().catch(warn);
|
45743 | }, 0);
|
45744 | };
|
45745 |
|
45746 | _proto._dispatchCommand = function _dispatchCommand(command) {
|
45747 | if (command.cmd !== CommandType.data) {
|
45748 | this.emit('unhandledmessage', command);
|
45749 | return core.Promise.resolve();
|
45750 | }
|
45751 |
|
45752 | return this._dispatchDataCommand(command);
|
45753 | };
|
45754 |
|
45755 | _proto._dispatchDataCommand = function _dispatchDataCommand(_ref) {
|
45756 | var _ref$dataMessage = _ref.dataMessage,
|
45757 | ids = _ref$dataMessage.ids,
|
45758 | msg = _ref$dataMessage.msg;
|
45759 | this.emit('message', (0, _map.default)(msg).call(msg, function (_ref2) {
|
45760 | var data = _ref2.data;
|
45761 | return JSON.parse(data);
|
45762 | }));
|
45763 |
|
45764 | var command = new GenericCommand({
|
45765 | cmd: CommandType.ack,
|
45766 | ackMessage: new AckCommand({
|
45767 | ids: ids
|
45768 | })
|
45769 | });
|
45770 | return this._send(command, false).catch(warn);
|
45771 | };
|
45772 |
|
45773 | return LiveQueryClient;
|
45774 | }(core.EventEmitter);
|
45775 |
|
45776 | var finalize = function finalize(callback) {
|
45777 | return [
|
45778 | function (value) {
|
45779 | return callback(), value;
|
45780 | }, function (error) {
|
45781 | callback();
|
45782 | throw error;
|
45783 | }];
|
45784 | };
|
45785 |
|
45786 | var onRealtimeCreate = function onRealtimeCreate(realtime) {
|
45787 |
|
45788 | realtime._liveQueryClients = {};
|
45789 |
|
45790 | realtime.createLiveQueryClient = function (subscriptionId) {
|
45791 | var _realtime$_open$then;
|
45792 |
|
45793 | if (realtime._liveQueryClients[subscriptionId] !== undefined) {
|
45794 | return core.Promise.resolve(realtime._liveQueryClients[subscriptionId]);
|
45795 | }
|
45796 |
|
45797 | var promise = (_realtime$_open$then = realtime._open().then(function (connection) {
|
45798 | var client = new LiveQueryClient(realtime._options.appId, subscriptionId, connection);
|
45799 | connection.on('reconnect', function () {
|
45800 | return client._open().then(function () {
|
45801 | return client.emit('reconnect');
|
45802 | }, function (error) {
|
45803 | return client.emit('reconnecterror', error);
|
45804 | });
|
45805 | });
|
45806 |
|
45807 | client._eventemitter.on('beforeclose', function () {
|
45808 | delete realtime._liveQueryClients[client.id];
|
45809 | }, realtime);
|
45810 |
|
45811 | client._eventemitter.on('close', function () {
|
45812 | realtime._deregister(client);
|
45813 | }, realtime);
|
45814 |
|
45815 | return client._open().then(function () {
|
45816 | realtime._liveQueryClients[client.id] = client;
|
45817 |
|
45818 | realtime._register(client);
|
45819 |
|
45820 | return client;
|
45821 | });
|
45822 | })).then.apply(_realtime$_open$then, _toConsumableArray(finalize(function () {
|
45823 | if (realtime._deregisterPending) realtime._deregisterPending(promise);
|
45824 | })));
|
45825 |
|
45826 | realtime._liveQueryClients[subscriptionId] = promise;
|
45827 | if (realtime._registerPending) realtime._registerPending(promise);
|
45828 | return promise;
|
45829 | };
|
45830 |
|
45831 |
|
45832 | };
|
45833 |
|
45834 | var beforeCommandDispatch = function beforeCommandDispatch(command, realtime) {
|
45835 | var isLiveQueryCommand = command.installationId && command.service === 1;
|
45836 | if (!isLiveQueryCommand) return true;
|
45837 | var targetClient = realtime._liveQueryClients[command.installationId];
|
45838 |
|
45839 | if (targetClient) {
|
45840 | targetClient._dispatchCommand(command).catch(function (error) {
|
45841 | return console.warn(error);
|
45842 | });
|
45843 | } else {
|
45844 | console.warn('Unexpected message received without any live client match: %O', command);
|
45845 | }
|
45846 |
|
45847 | return false;
|
45848 | };
|
45849 |
|
45850 |
|
45851 | var LiveQueryPlugin = {
|
45852 | name: 'leancloud-realtime-plugin-live-query',
|
45853 | onRealtimeCreate: onRealtimeCreate,
|
45854 | beforeCommandDispatch: beforeCommandDispatch
|
45855 | };
|
45856 | exports.LiveQueryPlugin = LiveQueryPlugin;
|
45857 | (0, _defineProperty.default)(exports, '__esModule', {
|
45858 | value: true
|
45859 | });
|
45860 | });
|
45861 |
|
45862 | })
|
45863 | ]);
|
45864 | });
|
45865 |
|
\ | No newline at end of file |