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 = 283);
|
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__(160);
|
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__(323);
|
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__(135);
|
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__(158);
|
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__(152);
|
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__(287);
|
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__(190);
|
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__(395);
|
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__(200);
|
724 | var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(201);
|
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__(159);
|
743 | var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(161);
|
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__(188);
|
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__(531);
|
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__(189);
|
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__(232));
|
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__(239);
|
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__(400);
|
1410 |
|
1411 | }),
|
1412 |
|
1413 | (function(module, exports, __webpack_require__) {
|
1414 |
|
1415 | module.exports = __webpack_require__(407);
|
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__(297);
|
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__(166);
|
1455 | var lengthOfArrayLike = __webpack_require__(40);
|
1456 | var isPrototypeOf = __webpack_require__(16);
|
1457 | var getIterator = __webpack_require__(167);
|
1458 | var getIteratorMethod = __webpack_require__(108);
|
1459 | var iteratorClose = __webpack_require__(168);
|
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__(132);
|
1539 | var Iterators = __webpack_require__(54);
|
1540 | var InternalStateModule = __webpack_require__(44);
|
1541 | var defineProperty = __webpack_require__(23).f;
|
1542 | var defineIterator = __webpack_require__(134);
|
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__(169);
|
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__(124);
|
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__(322);
|
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__(422));
|
1736 |
|
1737 | var _getPrototypeOf = _interopRequireDefault(__webpack_require__(232));
|
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__(130);
|
2160 | var enumBugKeys = __webpack_require__(129);
|
2161 | var hiddenKeys = __webpack_require__(83);
|
2162 | var html = __webpack_require__(165);
|
2163 | var documentCreateElement = __webpack_require__(125);
|
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__(131);
|
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__(131);
|
2289 | var defineProperty = __webpack_require__(23).f;
|
2290 | var createNonEnumerableProperty = __webpack_require__(39);
|
2291 | var hasOwn = __webpack_require__(13);
|
2292 | var toString = __webpack_require__(303);
|
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__(409);
|
2403 |
|
2404 | }),
|
2405 |
|
2406 | (function(module, exports, __webpack_require__) {
|
2407 |
|
2408 | module.exports = __webpack_require__(413);
|
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__(418)(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__(122);
|
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__(159);
|
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__(321).charAt;
|
2715 | var toString = __webpack_require__(42);
|
2716 | var InternalStateModule = __webpack_require__(44);
|
2717 | var defineIterator = __webpack_require__(134);
|
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__(138);
|
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__(150));
|
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__(231);
|
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__(234);
|
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__(229);
|
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__(235);
|
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__(242);
|
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__(124);
|
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__(160);
|
3619 | var inspectSource = __webpack_require__(133);
|
3620 | var wellKnownSymbol = __webpack_require__(5);
|
3621 | var IS_BROWSER = __webpack_require__(312);
|
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__(329);
|
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__(190);
|
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__(199);
|
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__(215);
|
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__(240);
|
3834 |
|
3835 | }),
|
3836 |
|
3837 | (function(module, exports, __webpack_require__) {
|
3838 |
|
3839 | var _Symbol = __webpack_require__(241);
|
3840 |
|
3841 | var _Symbol$iterator = __webpack_require__(464);
|
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__(477);
|
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__(244);
|
3873 | var isExtensible = __webpack_require__(265);
|
3874 | var uid = __webpack_require__(101);
|
3875 | var FREEZING = __webpack_require__(264);
|
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__(291);
|
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__(158);
|
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__(162);
|
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__(294);
|
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__(164);
|
4105 | var enumBugKeys = __webpack_require__(129);
|
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__(164);
|
4130 | var enumBugKeys = __webpack_require__(129);
|
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__(123);
|
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__(133);
|
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__(142);
|
4256 | var __WEBPACK_IMPORTED_MODULE_1__isMatch_js__ = __webpack_require__(191);
|
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__(207);
|
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__(250));
|
4366 |
|
4367 | var _map = _interopRequireDefault(__webpack_require__(37));
|
4368 |
|
4369 | var _keys = _interopRequireDefault(__webpack_require__(150));
|
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__(251),
|
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) {
|
4462 |
|
4463 | function _typeof(o) {
|
4464 | "@babel/helpers - typeof";
|
4465 |
|
4466 | return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
4467 | return typeof o;
|
4468 | } : function (o) {
|
4469 | return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
4470 | }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
4471 | }
|
4472 | module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
4473 |
|
4474 | }),
|
4475 |
|
4476 | (function(module, exports, __webpack_require__) {
|
4477 |
|
4478 | var Symbol = __webpack_require__(276),
|
4479 | getRawTag = __webpack_require__(684),
|
4480 | objectToString = __webpack_require__(685);
|
4481 |
|
4482 |
|
4483 | var nullTag = '[object Null]',
|
4484 | undefinedTag = '[object Undefined]';
|
4485 |
|
4486 |
|
4487 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
4488 |
|
4489 |
|
4490 |
|
4491 |
|
4492 |
|
4493 |
|
4494 |
|
4495 |
|
4496 | function baseGetTag(value) {
|
4497 | if (value == null) {
|
4498 | return value === undefined ? undefinedTag : nullTag;
|
4499 | }
|
4500 | return (symToStringTag && symToStringTag in Object(value))
|
4501 | ? getRawTag(value)
|
4502 | : objectToString(value);
|
4503 | }
|
4504 |
|
4505 | module.exports = baseGetTag;
|
4506 |
|
4507 |
|
4508 | }),
|
4509 |
|
4510 | (function(module, exports) {
|
4511 |
|
4512 |
|
4513 |
|
4514 |
|
4515 |
|
4516 |
|
4517 |
|
4518 |
|
4519 |
|
4520 |
|
4521 |
|
4522 |
|
4523 |
|
4524 |
|
4525 |
|
4526 |
|
4527 |
|
4528 |
|
4529 |
|
4530 |
|
4531 |
|
4532 |
|
4533 |
|
4534 |
|
4535 |
|
4536 | function isObjectLike(value) {
|
4537 | return value != null && typeof value == 'object';
|
4538 | }
|
4539 |
|
4540 | module.exports = isObjectLike;
|
4541 |
|
4542 |
|
4543 | }),
|
4544 |
|
4545 | (function(module, exports, __webpack_require__) {
|
4546 |
|
4547 | "use strict";
|
4548 |
|
4549 | var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
4550 |
|
4551 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
4552 |
|
4553 |
|
4554 | var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
4555 |
|
4556 |
|
4557 |
|
4558 | exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
4559 | var descriptor = getOwnPropertyDescriptor(this, V);
|
4560 | return !!descriptor && descriptor.enumerable;
|
4561 | } : $propertyIsEnumerable;
|
4562 |
|
4563 |
|
4564 | }),
|
4565 |
|
4566 | (function(module, exports, __webpack_require__) {
|
4567 |
|
4568 | var aCallable = __webpack_require__(29);
|
4569 |
|
4570 |
|
4571 |
|
4572 | module.exports = function (V, P) {
|
4573 | var func = V[P];
|
4574 | return func == null ? undefined : aCallable(func);
|
4575 | };
|
4576 |
|
4577 |
|
4578 | }),
|
4579 |
|
4580 | (function(module, exports, __webpack_require__) {
|
4581 |
|
4582 | var global = __webpack_require__(8);
|
4583 | var defineGlobalProperty = __webpack_require__(293);
|
4584 |
|
4585 | var SHARED = '__core-js_shared__';
|
4586 | var store = global[SHARED] || defineGlobalProperty(SHARED, {});
|
4587 |
|
4588 | module.exports = store;
|
4589 |
|
4590 |
|
4591 | }),
|
4592 |
|
4593 | (function(module, exports, __webpack_require__) {
|
4594 |
|
4595 | var global = __webpack_require__(8);
|
4596 | var isObject = __webpack_require__(11);
|
4597 |
|
4598 | var document = global.document;
|
4599 |
|
4600 | var EXISTS = isObject(document) && isObject(document.createElement);
|
4601 |
|
4602 | module.exports = function (it) {
|
4603 | return EXISTS ? document.createElement(it) : {};
|
4604 | };
|
4605 |
|
4606 |
|
4607 | }),
|
4608 |
|
4609 | (function(module, exports, __webpack_require__) {
|
4610 |
|
4611 | var toIndexedObject = __webpack_require__(35);
|
4612 | var toAbsoluteIndex = __webpack_require__(127);
|
4613 | var lengthOfArrayLike = __webpack_require__(40);
|
4614 |
|
4615 |
|
4616 | var createMethod = function (IS_INCLUDES) {
|
4617 | return function ($this, el, fromIndex) {
|
4618 | var O = toIndexedObject($this);
|
4619 | var length = lengthOfArrayLike(O);
|
4620 | var index = toAbsoluteIndex(fromIndex, length);
|
4621 | var value;
|
4622 |
|
4623 |
|
4624 | if (IS_INCLUDES && el != el) while (length > index) {
|
4625 | value = O[index++];
|
4626 |
|
4627 | if (value != value) return true;
|
4628 |
|
4629 | } else for (;length > index; index++) {
|
4630 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
4631 | } return !IS_INCLUDES && -1;
|
4632 | };
|
4633 | };
|
4634 |
|
4635 | module.exports = {
|
4636 |
|
4637 |
|
4638 | includes: createMethod(true),
|
4639 |
|
4640 |
|
4641 | indexOf: createMethod(false)
|
4642 | };
|
4643 |
|
4644 |
|
4645 | }),
|
4646 |
|
4647 | (function(module, exports, __webpack_require__) {
|
4648 |
|
4649 | var toIntegerOrInfinity = __webpack_require__(128);
|
4650 |
|
4651 | var max = Math.max;
|
4652 | var min = Math.min;
|
4653 |
|
4654 |
|
4655 |
|
4656 |
|
4657 | module.exports = function (index, length) {
|
4658 | var integer = toIntegerOrInfinity(index);
|
4659 | return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
4660 | };
|
4661 |
|
4662 |
|
4663 | }),
|
4664 |
|
4665 | (function(module, exports, __webpack_require__) {
|
4666 |
|
4667 | var trunc = __webpack_require__(296);
|
4668 |
|
4669 |
|
4670 |
|
4671 | module.exports = function (argument) {
|
4672 | var number = +argument;
|
4673 |
|
4674 | return number !== number || number === 0 ? 0 : trunc(number);
|
4675 | };
|
4676 |
|
4677 |
|
4678 | }),
|
4679 |
|
4680 | (function(module, exports) {
|
4681 |
|
4682 |
|
4683 | module.exports = [
|
4684 | 'constructor',
|
4685 | 'hasOwnProperty',
|
4686 | 'isPrototypeOf',
|
4687 | 'propertyIsEnumerable',
|
4688 | 'toLocaleString',
|
4689 | 'toString',
|
4690 | 'valueOf'
|
4691 | ];
|
4692 |
|
4693 |
|
4694 | }),
|
4695 |
|
4696 | (function(module, exports, __webpack_require__) {
|
4697 |
|
4698 | var DESCRIPTORS = __webpack_require__(14);
|
4699 | var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(161);
|
4700 | var definePropertyModule = __webpack_require__(23);
|
4701 | var anObject = __webpack_require__(21);
|
4702 | var toIndexedObject = __webpack_require__(35);
|
4703 | var objectKeys = __webpack_require__(107);
|
4704 |
|
4705 |
|
4706 |
|
4707 |
|
4708 | exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
4709 | anObject(O);
|
4710 | var props = toIndexedObject(Properties);
|
4711 | var keys = objectKeys(Properties);
|
4712 | var length = keys.length;
|
4713 | var index = 0;
|
4714 | var key;
|
4715 | while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
4716 | return O;
|
4717 | };
|
4718 |
|
4719 |
|
4720 | }),
|
4721 |
|
4722 | (function(module, exports, __webpack_require__) {
|
4723 |
|
4724 | var wellKnownSymbol = __webpack_require__(5);
|
4725 |
|
4726 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
4727 | var test = {};
|
4728 |
|
4729 | test[TO_STRING_TAG] = 'z';
|
4730 |
|
4731 | module.exports = String(test) === '[object z]';
|
4732 |
|
4733 |
|
4734 | }),
|
4735 |
|
4736 | (function(module, exports) {
|
4737 |
|
4738 | module.exports = function () { };
|
4739 |
|
4740 |
|
4741 | }),
|
4742 |
|
4743 | (function(module, exports, __webpack_require__) {
|
4744 |
|
4745 | var uncurryThis = __webpack_require__(4);
|
4746 | var isCallable = __webpack_require__(9);
|
4747 | var store = __webpack_require__(124);
|
4748 |
|
4749 | var functionToString = uncurryThis(Function.toString);
|
4750 |
|
4751 |
|
4752 | if (!isCallable(store.inspectSource)) {
|
4753 | store.inspectSource = function (it) {
|
4754 | return functionToString(it);
|
4755 | };
|
4756 | }
|
4757 |
|
4758 | module.exports = store.inspectSource;
|
4759 |
|
4760 |
|
4761 | }),
|
4762 |
|
4763 | (function(module, exports, __webpack_require__) {
|
4764 |
|
4765 | "use strict";
|
4766 |
|
4767 | var $ = __webpack_require__(0);
|
4768 | var call = __webpack_require__(15);
|
4769 | var IS_PURE = __webpack_require__(36);
|
4770 | var FunctionName = __webpack_require__(170);
|
4771 | var isCallable = __webpack_require__(9);
|
4772 | var createIteratorConstructor = __webpack_require__(302);
|
4773 | var getPrototypeOf = __webpack_require__(102);
|
4774 | var setPrototypeOf = __webpack_require__(104);
|
4775 | var setToStringTag = __webpack_require__(56);
|
4776 | var createNonEnumerableProperty = __webpack_require__(39);
|
4777 | var defineBuiltIn = __webpack_require__(45);
|
4778 | var wellKnownSymbol = __webpack_require__(5);
|
4779 | var Iterators = __webpack_require__(54);
|
4780 | var IteratorsCore = __webpack_require__(171);
|
4781 |
|
4782 | var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
4783 | var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
4784 | var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
4785 | var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
4786 | var ITERATOR = wellKnownSymbol('iterator');
|
4787 | var KEYS = 'keys';
|
4788 | var VALUES = 'values';
|
4789 | var ENTRIES = 'entries';
|
4790 |
|
4791 | var returnThis = function () { return this; };
|
4792 |
|
4793 | module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
4794 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
4795 |
|
4796 | var getIterationMethod = function (KIND) {
|
4797 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
4798 | if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
4799 | switch (KIND) {
|
4800 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
4801 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
4802 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
4803 | } return function () { return new IteratorConstructor(this); };
|
4804 | };
|
4805 |
|
4806 | var TO_STRING_TAG = NAME + ' Iterator';
|
4807 | var INCORRECT_VALUES_NAME = false;
|
4808 | var IterablePrototype = Iterable.prototype;
|
4809 | var nativeIterator = IterablePrototype[ITERATOR]
|
4810 | || IterablePrototype['@@iterator']
|
4811 | || DEFAULT && IterablePrototype[DEFAULT];
|
4812 | var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
4813 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
4814 | var CurrentIteratorPrototype, methods, KEY;
|
4815 |
|
4816 |
|
4817 | if (anyNativeIterator) {
|
4818 | CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
4819 | if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
4820 | if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
4821 | if (setPrototypeOf) {
|
4822 | setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
4823 | } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
|
4824 | defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
|
4825 | }
|
4826 | }
|
4827 |
|
4828 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
4829 | if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
|
4830 | }
|
4831 | }
|
4832 |
|
4833 |
|
4834 | if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
4835 | if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
|
4836 | createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
|
4837 | } else {
|
4838 | INCORRECT_VALUES_NAME = true;
|
4839 | defaultIterator = function values() { return call(nativeIterator, this); };
|
4840 | }
|
4841 | }
|
4842 |
|
4843 |
|
4844 | if (DEFAULT) {
|
4845 | methods = {
|
4846 | values: getIterationMethod(VALUES),
|
4847 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
4848 | entries: getIterationMethod(ENTRIES)
|
4849 | };
|
4850 | if (FORCED) for (KEY in methods) {
|
4851 | if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
4852 | defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
|
4853 | }
|
4854 | } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
4855 | }
|
4856 |
|
4857 |
|
4858 | if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
|
4859 | defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
|
4860 | }
|
4861 | Iterators[NAME] = defaultIterator;
|
4862 |
|
4863 | return methods;
|
4864 | };
|
4865 |
|
4866 |
|
4867 | }),
|
4868 |
|
4869 | (function(module, __webpack_exports__, __webpack_require__) {
|
4870 |
|
4871 | "use strict";
|
4872 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
4873 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
4874 | __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__setup_js__["e"]; });
|
4875 | var __WEBPACK_IMPORTED_MODULE_1__restArguments_js__ = __webpack_require__(24);
|
4876 | __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__restArguments_js__["a"]; });
|
4877 | var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(58);
|
4878 | __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_2__isObject_js__["a"]; });
|
4879 | var __WEBPACK_IMPORTED_MODULE_3__isNull_js__ = __webpack_require__(324);
|
4880 | __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_3__isNull_js__["a"]; });
|
4881 | var __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__ = __webpack_require__(180);
|
4882 | __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__["a"]; });
|
4883 | var __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__ = __webpack_require__(181);
|
4884 | __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__["a"]; });
|
4885 | var __WEBPACK_IMPORTED_MODULE_6__isElement_js__ = __webpack_require__(325);
|
4886 | __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_6__isElement_js__["a"]; });
|
4887 | var __WEBPACK_IMPORTED_MODULE_7__isString_js__ = __webpack_require__(136);
|
4888 | __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_7__isString_js__["a"]; });
|
4889 | var __WEBPACK_IMPORTED_MODULE_8__isNumber_js__ = __webpack_require__(182);
|
4890 | __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_8__isNumber_js__["a"]; });
|
4891 | var __WEBPACK_IMPORTED_MODULE_9__isDate_js__ = __webpack_require__(326);
|
4892 | __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_9__isDate_js__["a"]; });
|
4893 | var __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__ = __webpack_require__(327);
|
4894 | __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__["a"]; });
|
4895 | var __WEBPACK_IMPORTED_MODULE_11__isError_js__ = __webpack_require__(328);
|
4896 | __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_11__isError_js__["a"]; });
|
4897 | var __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__ = __webpack_require__(183);
|
4898 | __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__["a"]; });
|
4899 | var __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__ = __webpack_require__(184);
|
4900 | __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__["a"]; });
|
4901 | var __WEBPACK_IMPORTED_MODULE_14__isDataView_js__ = __webpack_require__(137);
|
4902 | __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_14__isDataView_js__["a"]; });
|
4903 | var __WEBPACK_IMPORTED_MODULE_15__isArray_js__ = __webpack_require__(59);
|
4904 | __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_15__isArray_js__["a"]; });
|
4905 | var __WEBPACK_IMPORTED_MODULE_16__isFunction_js__ = __webpack_require__(30);
|
4906 | __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_16__isFunction_js__["a"]; });
|
4907 | var __WEBPACK_IMPORTED_MODULE_17__isArguments_js__ = __webpack_require__(138);
|
4908 | __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_17__isArguments_js__["a"]; });
|
4909 | var __WEBPACK_IMPORTED_MODULE_18__isFinite_js__ = __webpack_require__(330);
|
4910 | __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_18__isFinite_js__["a"]; });
|
4911 | var __WEBPACK_IMPORTED_MODULE_19__isNaN_js__ = __webpack_require__(185);
|
4912 | __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_19__isNaN_js__["a"]; });
|
4913 | var __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__ = __webpack_require__(186);
|
4914 | __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__["a"]; });
|
4915 | var __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__ = __webpack_require__(332);
|
4916 | __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__["a"]; });
|
4917 | var __WEBPACK_IMPORTED_MODULE_22__isMatch_js__ = __webpack_require__(191);
|
4918 | __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_22__isMatch_js__["a"]; });
|
4919 | var __WEBPACK_IMPORTED_MODULE_23__isEqual_js__ = __webpack_require__(333);
|
4920 | __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_23__isEqual_js__["a"]; });
|
4921 | var __WEBPACK_IMPORTED_MODULE_24__isMap_js__ = __webpack_require__(335);
|
4922 | __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_24__isMap_js__["a"]; });
|
4923 | var __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__ = __webpack_require__(336);
|
4924 | __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__["a"]; });
|
4925 | var __WEBPACK_IMPORTED_MODULE_26__isSet_js__ = __webpack_require__(337);
|
4926 | __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_26__isSet_js__["a"]; });
|
4927 | var __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__ = __webpack_require__(338);
|
4928 | __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__["a"]; });
|
4929 | var __WEBPACK_IMPORTED_MODULE_28__keys_js__ = __webpack_require__(17);
|
4930 | __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_28__keys_js__["a"]; });
|
4931 | var __WEBPACK_IMPORTED_MODULE_29__allKeys_js__ = __webpack_require__(87);
|
4932 | __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_29__allKeys_js__["a"]; });
|
4933 | var __WEBPACK_IMPORTED_MODULE_30__values_js__ = __webpack_require__(71);
|
4934 | __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_30__values_js__["a"]; });
|
4935 | var __WEBPACK_IMPORTED_MODULE_31__pairs_js__ = __webpack_require__(339);
|
4936 | __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_31__pairs_js__["a"]; });
|
4937 | var __WEBPACK_IMPORTED_MODULE_32__invert_js__ = __webpack_require__(192);
|
4938 | __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_32__invert_js__["a"]; });
|
4939 | var __WEBPACK_IMPORTED_MODULE_33__functions_js__ = __webpack_require__(193);
|
4940 | __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
|
4941 | __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
|
4942 | var __WEBPACK_IMPORTED_MODULE_34__extend_js__ = __webpack_require__(194);
|
4943 | __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_34__extend_js__["a"]; });
|
4944 | var __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__ = __webpack_require__(142);
|
4945 | __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
|
4946 | __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
|
4947 | var __WEBPACK_IMPORTED_MODULE_36__defaults_js__ = __webpack_require__(195);
|
4948 | __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_36__defaults_js__["a"]; });
|
4949 | var __WEBPACK_IMPORTED_MODULE_37__create_js__ = __webpack_require__(340);
|
4950 | __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_37__create_js__["a"]; });
|
4951 | var __WEBPACK_IMPORTED_MODULE_38__clone_js__ = __webpack_require__(197);
|
4952 | __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_38__clone_js__["a"]; });
|
4953 | var __WEBPACK_IMPORTED_MODULE_39__tap_js__ = __webpack_require__(341);
|
4954 | __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_39__tap_js__["a"]; });
|
4955 | var __WEBPACK_IMPORTED_MODULE_40__get_js__ = __webpack_require__(198);
|
4956 | __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_40__get_js__["a"]; });
|
4957 | var __WEBPACK_IMPORTED_MODULE_41__has_js__ = __webpack_require__(342);
|
4958 | __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_41__has_js__["a"]; });
|
4959 | var __WEBPACK_IMPORTED_MODULE_42__mapObject_js__ = __webpack_require__(343);
|
4960 | __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_42__mapObject_js__["a"]; });
|
4961 | var __WEBPACK_IMPORTED_MODULE_43__identity_js__ = __webpack_require__(144);
|
4962 | __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_43__identity_js__["a"]; });
|
4963 | var __WEBPACK_IMPORTED_MODULE_44__constant_js__ = __webpack_require__(187);
|
4964 | __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_44__constant_js__["a"]; });
|
4965 | var __WEBPACK_IMPORTED_MODULE_45__noop_js__ = __webpack_require__(202);
|
4966 | __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_45__noop_js__["a"]; });
|
4967 | var __WEBPACK_IMPORTED_MODULE_46__toPath_js__ = __webpack_require__(199);
|
4968 | __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_46__toPath_js__["a"]; });
|
4969 | var __WEBPACK_IMPORTED_MODULE_47__property_js__ = __webpack_require__(145);
|
4970 | __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_47__property_js__["a"]; });
|
4971 | var __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__ = __webpack_require__(344);
|
4972 | __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__["a"]; });
|
4973 | var __WEBPACK_IMPORTED_MODULE_49__matcher_js__ = __webpack_require__(113);
|
4974 | __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
|
4975 | __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
|
4976 | var __WEBPACK_IMPORTED_MODULE_50__times_js__ = __webpack_require__(345);
|
4977 | __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_50__times_js__["a"]; });
|
4978 | var __WEBPACK_IMPORTED_MODULE_51__random_js__ = __webpack_require__(203);
|
4979 | __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_51__random_js__["a"]; });
|
4980 | var __WEBPACK_IMPORTED_MODULE_52__now_js__ = __webpack_require__(146);
|
4981 | __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_52__now_js__["a"]; });
|
4982 | var __WEBPACK_IMPORTED_MODULE_53__escape_js__ = __webpack_require__(346);
|
4983 | __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_53__escape_js__["a"]; });
|
4984 | var __WEBPACK_IMPORTED_MODULE_54__unescape_js__ = __webpack_require__(347);
|
4985 | __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_54__unescape_js__["a"]; });
|
4986 | var __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__ = __webpack_require__(206);
|
4987 | __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__["a"]; });
|
4988 | var __WEBPACK_IMPORTED_MODULE_56__template_js__ = __webpack_require__(349);
|
4989 | __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_56__template_js__["a"]; });
|
4990 | var __WEBPACK_IMPORTED_MODULE_57__result_js__ = __webpack_require__(350);
|
4991 | __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_57__result_js__["a"]; });
|
4992 | var __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__ = __webpack_require__(351);
|
4993 | __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__["a"]; });
|
4994 | var __WEBPACK_IMPORTED_MODULE_59__chain_js__ = __webpack_require__(352);
|
4995 | __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_59__chain_js__["a"]; });
|
4996 | var __WEBPACK_IMPORTED_MODULE_60__iteratee_js__ = __webpack_require__(201);
|
4997 | __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_60__iteratee_js__["a"]; });
|
4998 | var __WEBPACK_IMPORTED_MODULE_61__partial_js__ = __webpack_require__(114);
|
4999 | __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_61__partial_js__["a"]; });
|
5000 | var __WEBPACK_IMPORTED_MODULE_62__bind_js__ = __webpack_require__(208);
|
5001 | __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_62__bind_js__["a"]; });
|
5002 | var __WEBPACK_IMPORTED_MODULE_63__bindAll_js__ = __webpack_require__(353);
|
5003 | __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_63__bindAll_js__["a"]; });
|
5004 | var __WEBPACK_IMPORTED_MODULE_64__memoize_js__ = __webpack_require__(354);
|
5005 | __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_64__memoize_js__["a"]; });
|
5006 | var __WEBPACK_IMPORTED_MODULE_65__delay_js__ = __webpack_require__(209);
|
5007 | __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_65__delay_js__["a"]; });
|
5008 | var __WEBPACK_IMPORTED_MODULE_66__defer_js__ = __webpack_require__(355);
|
5009 | __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_66__defer_js__["a"]; });
|
5010 | var __WEBPACK_IMPORTED_MODULE_67__throttle_js__ = __webpack_require__(356);
|
5011 | __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_67__throttle_js__["a"]; });
|
5012 | var __WEBPACK_IMPORTED_MODULE_68__debounce_js__ = __webpack_require__(357);
|
5013 | __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_68__debounce_js__["a"]; });
|
5014 | var __WEBPACK_IMPORTED_MODULE_69__wrap_js__ = __webpack_require__(358);
|
5015 | __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_69__wrap_js__["a"]; });
|
5016 | var __WEBPACK_IMPORTED_MODULE_70__negate_js__ = __webpack_require__(147);
|
5017 | __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_70__negate_js__["a"]; });
|
5018 | var __WEBPACK_IMPORTED_MODULE_71__compose_js__ = __webpack_require__(359);
|
5019 | __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_71__compose_js__["a"]; });
|
5020 | var __WEBPACK_IMPORTED_MODULE_72__after_js__ = __webpack_require__(360);
|
5021 | __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_72__after_js__["a"]; });
|
5022 | var __WEBPACK_IMPORTED_MODULE_73__before_js__ = __webpack_require__(210);
|
5023 | __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_73__before_js__["a"]; });
|
5024 | var __WEBPACK_IMPORTED_MODULE_74__once_js__ = __webpack_require__(361);
|
5025 | __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_74__once_js__["a"]; });
|
5026 | var __WEBPACK_IMPORTED_MODULE_75__findKey_js__ = __webpack_require__(211);
|
5027 | __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_75__findKey_js__["a"]; });
|
5028 | var __WEBPACK_IMPORTED_MODULE_76__findIndex_js__ = __webpack_require__(148);
|
5029 | __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_76__findIndex_js__["a"]; });
|
5030 | var __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__ = __webpack_require__(213);
|
5031 | __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__["a"]; });
|
5032 | var __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__ = __webpack_require__(214);
|
5033 | __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__["a"]; });
|
5034 | var __WEBPACK_IMPORTED_MODULE_79__indexOf_js__ = __webpack_require__(215);
|
5035 | __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_79__indexOf_js__["a"]; });
|
5036 | var __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__ = __webpack_require__(362);
|
5037 | __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__["a"]; });
|
5038 | var __WEBPACK_IMPORTED_MODULE_81__find_js__ = __webpack_require__(217);
|
5039 | __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
|
5040 | __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
|
5041 | var __WEBPACK_IMPORTED_MODULE_82__findWhere_js__ = __webpack_require__(363);
|
5042 | __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_82__findWhere_js__["a"]; });
|
5043 | var __WEBPACK_IMPORTED_MODULE_83__each_js__ = __webpack_require__(60);
|
5044 | __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
|
5045 | __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
|
5046 | var __WEBPACK_IMPORTED_MODULE_84__map_js__ = __webpack_require__(73);
|
5047 | __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
|
5048 | __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
|
5049 | var __WEBPACK_IMPORTED_MODULE_85__reduce_js__ = __webpack_require__(364);
|
5050 | __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
|
5051 | __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
|
5052 | __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
|
5053 | var __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__ = __webpack_require__(365);
|
5054 | __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
|
5055 | __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
|
5056 | var __WEBPACK_IMPORTED_MODULE_87__filter_js__ = __webpack_require__(90);
|
5057 | __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
|
5058 | __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
|
5059 | var __WEBPACK_IMPORTED_MODULE_88__reject_js__ = __webpack_require__(366);
|
5060 | __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_88__reject_js__["a"]; });
|
5061 | var __WEBPACK_IMPORTED_MODULE_89__every_js__ = __webpack_require__(367);
|
5062 | __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
|
5063 | __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
|
5064 | var __WEBPACK_IMPORTED_MODULE_90__some_js__ = __webpack_require__(368);
|
5065 | __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
|
5066 | __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
|
5067 | var __WEBPACK_IMPORTED_MODULE_91__contains_js__ = __webpack_require__(91);
|
5068 | __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
|
5069 | __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
|
5070 | __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
|
5071 | var __WEBPACK_IMPORTED_MODULE_92__invoke_js__ = __webpack_require__(369);
|
5072 | __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_92__invoke_js__["a"]; });
|
5073 | var __WEBPACK_IMPORTED_MODULE_93__pluck_js__ = __webpack_require__(149);
|
5074 | __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_93__pluck_js__["a"]; });
|
5075 | var __WEBPACK_IMPORTED_MODULE_94__where_js__ = __webpack_require__(370);
|
5076 | __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_94__where_js__["a"]; });
|
5077 | var __WEBPACK_IMPORTED_MODULE_95__max_js__ = __webpack_require__(219);
|
5078 | __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_95__max_js__["a"]; });
|
5079 | var __WEBPACK_IMPORTED_MODULE_96__min_js__ = __webpack_require__(371);
|
5080 | __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_96__min_js__["a"]; });
|
5081 | var __WEBPACK_IMPORTED_MODULE_97__shuffle_js__ = __webpack_require__(372);
|
5082 | __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_97__shuffle_js__["a"]; });
|
5083 | var __WEBPACK_IMPORTED_MODULE_98__sample_js__ = __webpack_require__(220);
|
5084 | __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_98__sample_js__["a"]; });
|
5085 | var __WEBPACK_IMPORTED_MODULE_99__sortBy_js__ = __webpack_require__(373);
|
5086 | __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_99__sortBy_js__["a"]; });
|
5087 | var __WEBPACK_IMPORTED_MODULE_100__groupBy_js__ = __webpack_require__(374);
|
5088 | __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_100__groupBy_js__["a"]; });
|
5089 | var __WEBPACK_IMPORTED_MODULE_101__indexBy_js__ = __webpack_require__(375);
|
5090 | __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_101__indexBy_js__["a"]; });
|
5091 | var __WEBPACK_IMPORTED_MODULE_102__countBy_js__ = __webpack_require__(376);
|
5092 | __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_102__countBy_js__["a"]; });
|
5093 | var __WEBPACK_IMPORTED_MODULE_103__partition_js__ = __webpack_require__(377);
|
5094 | __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_103__partition_js__["a"]; });
|
5095 | var __WEBPACK_IMPORTED_MODULE_104__toArray_js__ = __webpack_require__(378);
|
5096 | __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_104__toArray_js__["a"]; });
|
5097 | var __WEBPACK_IMPORTED_MODULE_105__size_js__ = __webpack_require__(379);
|
5098 | __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_105__size_js__["a"]; });
|
5099 | var __WEBPACK_IMPORTED_MODULE_106__pick_js__ = __webpack_require__(221);
|
5100 | __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_106__pick_js__["a"]; });
|
5101 | var __WEBPACK_IMPORTED_MODULE_107__omit_js__ = __webpack_require__(381);
|
5102 | __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_107__omit_js__["a"]; });
|
5103 | var __WEBPACK_IMPORTED_MODULE_108__first_js__ = __webpack_require__(382);
|
5104 | __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
|
5105 | __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
|
5106 | __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
|
5107 | var __WEBPACK_IMPORTED_MODULE_109__initial_js__ = __webpack_require__(222);
|
5108 | __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_109__initial_js__["a"]; });
|
5109 | var __WEBPACK_IMPORTED_MODULE_110__last_js__ = __webpack_require__(383);
|
5110 | __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_110__last_js__["a"]; });
|
5111 | var __WEBPACK_IMPORTED_MODULE_111__rest_js__ = __webpack_require__(223);
|
5112 | __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
|
5113 | __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
|
5114 | __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
|
5115 | var __WEBPACK_IMPORTED_MODULE_112__compact_js__ = __webpack_require__(384);
|
5116 | __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_112__compact_js__["a"]; });
|
5117 | var __WEBPACK_IMPORTED_MODULE_113__flatten_js__ = __webpack_require__(385);
|
5118 | __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_113__flatten_js__["a"]; });
|
5119 | var __WEBPACK_IMPORTED_MODULE_114__without_js__ = __webpack_require__(386);
|
5120 | __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_114__without_js__["a"]; });
|
5121 | var __WEBPACK_IMPORTED_MODULE_115__uniq_js__ = __webpack_require__(225);
|
5122 | __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
|
5123 | __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
|
5124 | var __WEBPACK_IMPORTED_MODULE_116__union_js__ = __webpack_require__(387);
|
5125 | __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_116__union_js__["a"]; });
|
5126 | var __WEBPACK_IMPORTED_MODULE_117__intersection_js__ = __webpack_require__(388);
|
5127 | __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_117__intersection_js__["a"]; });
|
5128 | var __WEBPACK_IMPORTED_MODULE_118__difference_js__ = __webpack_require__(224);
|
5129 | __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_118__difference_js__["a"]; });
|
5130 | var __WEBPACK_IMPORTED_MODULE_119__unzip_js__ = __webpack_require__(226);
|
5131 | __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
|
5132 | __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
|
5133 | var __WEBPACK_IMPORTED_MODULE_120__zip_js__ = __webpack_require__(389);
|
5134 | __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_120__zip_js__["a"]; });
|
5135 | var __WEBPACK_IMPORTED_MODULE_121__object_js__ = __webpack_require__(390);
|
5136 | __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_121__object_js__["a"]; });
|
5137 | var __WEBPACK_IMPORTED_MODULE_122__range_js__ = __webpack_require__(391);
|
5138 | __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_122__range_js__["a"]; });
|
5139 | var __WEBPACK_IMPORTED_MODULE_123__chunk_js__ = __webpack_require__(392);
|
5140 | __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_123__chunk_js__["a"]; });
|
5141 | var __WEBPACK_IMPORTED_MODULE_124__mixin_js__ = __webpack_require__(393);
|
5142 | __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_124__mixin_js__["a"]; });
|
5143 | var __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__ = __webpack_require__(394);
|
5144 | __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__["a"]; });
|
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 |
|
5315 |
|
5316 |
|
5317 |
|
5318 |
|
5319 |
|
5320 |
|
5321 |
|
5322 |
|
5323 |
|
5324 |
|
5325 |
|
5326 |
|
5327 | }),
|
5328 |
|
5329 | (function(module, __webpack_exports__, __webpack_require__) {
|
5330 |
|
5331 | "use strict";
|
5332 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
5333 |
|
5334 |
|
5335 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('String'));
|
5336 |
|
5337 |
|
5338 | }),
|
5339 |
|
5340 | (function(module, __webpack_exports__, __webpack_require__) {
|
5341 |
|
5342 | "use strict";
|
5343 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
5344 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
5345 | var __WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__ = __webpack_require__(184);
|
5346 | var __WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__ = __webpack_require__(86);
|
5347 |
|
5348 |
|
5349 |
|
5350 |
|
5351 |
|
5352 | var isDataView = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('DataView');
|
5353 |
|
5354 |
|
5355 |
|
5356 | function ie10IsDataView(obj) {
|
5357 | return obj != null && Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(obj.getInt8) && Object(__WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__["a" ])(obj.buffer);
|
5358 | }
|
5359 |
|
5360 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__["a" ] ? ie10IsDataView : isDataView);
|
5361 |
|
5362 |
|
5363 | }),
|
5364 |
|
5365 | (function(module, __webpack_exports__, __webpack_require__) {
|
5366 |
|
5367 | "use strict";
|
5368 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
5369 | var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(47);
|
5370 |
|
5371 |
|
5372 |
|
5373 | var isArguments = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Arguments');
|
5374 |
|
5375 |
|
5376 |
|
5377 | (function() {
|
5378 | if (!isArguments(arguments)) {
|
5379 | isArguments = function(obj) {
|
5380 | return Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" ])(obj, 'callee');
|
5381 | };
|
5382 | }
|
5383 | }());
|
5384 |
|
5385 | __webpack_exports__["a"] = (isArguments);
|
5386 |
|
5387 |
|
5388 | }),
|
5389 |
|
5390 | (function(module, __webpack_exports__, __webpack_require__) {
|
5391 |
|
5392 | "use strict";
|
5393 | var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(189);
|
5394 |
|
5395 |
|
5396 |
|
5397 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" ])('byteLength'));
|
5398 |
|
5399 |
|
5400 | }),
|
5401 |
|
5402 | (function(module, __webpack_exports__, __webpack_require__) {
|
5403 |
|
5404 | "use strict";
|
5405 | __webpack_exports__["a"] = ie11fingerprint;
|
5406 | __webpack_require__.d(__webpack_exports__, "b", function() { return mapMethods; });
|
5407 | __webpack_require__.d(__webpack_exports__, "d", function() { return weakMapMethods; });
|
5408 | __webpack_require__.d(__webpack_exports__, "c", function() { return setMethods; });
|
5409 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
5410 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
5411 | var __WEBPACK_IMPORTED_MODULE_2__allKeys_js__ = __webpack_require__(87);
|
5412 |
|
5413 |
|
5414 |
|
5415 |
|
5416 |
|
5417 |
|
5418 |
|
5419 |
|
5420 | function ie11fingerprint(methods) {
|
5421 | var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(methods);
|
5422 | return function(obj) {
|
5423 | if (obj == null) return false;
|
5424 |
|
5425 | var keys = Object(__WEBPACK_IMPORTED_MODULE_2__allKeys_js__["a" ])(obj);
|
5426 | if (Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(keys)) return false;
|
5427 | for (var i = 0; i < length; i++) {
|
5428 | if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(obj[methods[i]])) return false;
|
5429 | }
|
5430 |
|
5431 |
|
5432 |
|
5433 | return methods !== weakMapMethods || !Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(obj[forEachName]);
|
5434 | };
|
5435 | }
|
5436 |
|
5437 |
|
5438 |
|
5439 | var forEachName = 'forEach',
|
5440 | hasName = 'has',
|
5441 | commonInit = ['clear', 'delete'],
|
5442 | mapTail = ['get', hasName, 'set'];
|
5443 |
|
5444 |
|
5445 |
|
5446 | var mapMethods = commonInit.concat(forEachName, mapTail),
|
5447 | weakMapMethods = commonInit.concat(mapTail),
|
5448 | setMethods = ['add'].concat(commonInit, forEachName, hasName);
|
5449 |
|
5450 |
|
5451 | }),
|
5452 |
|
5453 | (function(module, __webpack_exports__, __webpack_require__) {
|
5454 |
|
5455 | "use strict";
|
5456 | __webpack_exports__["a"] = createAssigner;
|
5457 |
|
5458 | function createAssigner(keysFunc, defaults) {
|
5459 | return function(obj) {
|
5460 | var length = arguments.length;
|
5461 | if (defaults) obj = Object(obj);
|
5462 | if (length < 2 || obj == null) return obj;
|
5463 | for (var index = 1; index < length; index++) {
|
5464 | var source = arguments[index],
|
5465 | keys = keysFunc(source),
|
5466 | l = keys.length;
|
5467 | for (var i = 0; i < l; i++) {
|
5468 | var key = keys[i];
|
5469 | if (!defaults || obj[key] === void 0) obj[key] = source[key];
|
5470 | }
|
5471 | }
|
5472 | return obj;
|
5473 | };
|
5474 | }
|
5475 |
|
5476 |
|
5477 | }),
|
5478 |
|
5479 | (function(module, __webpack_exports__, __webpack_require__) {
|
5480 |
|
5481 | "use strict";
|
5482 | var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(141);
|
5483 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(17);
|
5484 |
|
5485 |
|
5486 |
|
5487 |
|
5488 |
|
5489 |
|
5490 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ]));
|
5491 |
|
5492 |
|
5493 | }),
|
5494 |
|
5495 | (function(module, __webpack_exports__, __webpack_require__) {
|
5496 |
|
5497 | "use strict";
|
5498 | __webpack_exports__["a"] = deepGet;
|
5499 |
|
5500 | function deepGet(obj, path) {
|
5501 | var length = path.length;
|
5502 | for (var i = 0; i < length; i++) {
|
5503 | if (obj == null) return void 0;
|
5504 | obj = obj[path[i]];
|
5505 | }
|
5506 | return length ? obj : void 0;
|
5507 | }
|
5508 |
|
5509 |
|
5510 | }),
|
5511 |
|
5512 | (function(module, __webpack_exports__, __webpack_require__) {
|
5513 |
|
5514 | "use strict";
|
5515 | __webpack_exports__["a"] = identity;
|
5516 |
|
5517 | function identity(value) {
|
5518 | return value;
|
5519 | }
|
5520 |
|
5521 |
|
5522 | }),
|
5523 |
|
5524 | (function(module, __webpack_exports__, __webpack_require__) {
|
5525 |
|
5526 | "use strict";
|
5527 | __webpack_exports__["a"] = property;
|
5528 | var __WEBPACK_IMPORTED_MODULE_0__deepGet_js__ = __webpack_require__(143);
|
5529 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(88);
|
5530 |
|
5531 |
|
5532 |
|
5533 |
|
5534 |
|
5535 | function property(path) {
|
5536 | path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" ])(path);
|
5537 | return function(obj) {
|
5538 | return Object(__WEBPACK_IMPORTED_MODULE_0__deepGet_js__["a" ])(obj, path);
|
5539 | };
|
5540 | }
|
5541 |
|
5542 |
|
5543 | }),
|
5544 |
|
5545 | (function(module, __webpack_exports__, __webpack_require__) {
|
5546 |
|
5547 | "use strict";
|
5548 |
|
5549 | __webpack_exports__["a"] = (Date.now || function() {
|
5550 | return new Date().getTime();
|
5551 | });
|
5552 |
|
5553 |
|
5554 | }),
|
5555 |
|
5556 | (function(module, __webpack_exports__, __webpack_require__) {
|
5557 |
|
5558 | "use strict";
|
5559 | __webpack_exports__["a"] = negate;
|
5560 |
|
5561 | function negate(predicate) {
|
5562 | return function() {
|
5563 | return !predicate.apply(this, arguments);
|
5564 | };
|
5565 | }
|
5566 |
|
5567 |
|
5568 | }),
|
5569 |
|
5570 | (function(module, __webpack_exports__, __webpack_require__) {
|
5571 |
|
5572 | "use strict";
|
5573 | var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(212);
|
5574 |
|
5575 |
|
5576 |
|
5577 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" ])(1));
|
5578 |
|
5579 |
|
5580 | }),
|
5581 |
|
5582 | (function(module, __webpack_exports__, __webpack_require__) {
|
5583 |
|
5584 | "use strict";
|
5585 | __webpack_exports__["a"] = pluck;
|
5586 | var __WEBPACK_IMPORTED_MODULE_0__map_js__ = __webpack_require__(73);
|
5587 | var __WEBPACK_IMPORTED_MODULE_1__property_js__ = __webpack_require__(145);
|
5588 |
|
5589 |
|
5590 |
|
5591 |
|
5592 | function pluck(obj, key) {
|
5593 | return Object(__WEBPACK_IMPORTED_MODULE_0__map_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__property_js__["a" ])(key));
|
5594 | }
|
5595 |
|
5596 |
|
5597 | }),
|
5598 |
|
5599 | (function(module, exports, __webpack_require__) {
|
5600 |
|
5601 | module.exports = __webpack_require__(404);
|
5602 |
|
5603 | }),
|
5604 |
|
5605 | (function(module, exports, __webpack_require__) {
|
5606 |
|
5607 | "use strict";
|
5608 |
|
5609 | var fails = __webpack_require__(2);
|
5610 |
|
5611 | module.exports = function (METHOD_NAME, argument) {
|
5612 | var method = [][METHOD_NAME];
|
5613 | return !!method && fails(function () {
|
5614 |
|
5615 | method.call(null, argument || function () { return 1; }, 1);
|
5616 | });
|
5617 | };
|
5618 |
|
5619 |
|
5620 | }),
|
5621 |
|
5622 | (function(module, exports, __webpack_require__) {
|
5623 |
|
5624 | var wellKnownSymbol = __webpack_require__(5);
|
5625 |
|
5626 | exports.f = wellKnownSymbol;
|
5627 |
|
5628 |
|
5629 | }),
|
5630 |
|
5631 | (function(module, exports, __webpack_require__) {
|
5632 |
|
5633 | module.exports = __webpack_require__(252);
|
5634 |
|
5635 | }),
|
5636 |
|
5637 | (function(module, exports, __webpack_require__) {
|
5638 |
|
5639 | module.exports = __webpack_require__(506);
|
5640 |
|
5641 | }),
|
5642 |
|
5643 | (function(module, exports, __webpack_require__) {
|
5644 |
|
5645 | module.exports = __webpack_require__(249);
|
5646 |
|
5647 | }),
|
5648 |
|
5649 | (function(module, exports, __webpack_require__) {
|
5650 |
|
5651 | "use strict";
|
5652 |
|
5653 |
|
5654 | module.exports = __webpack_require__(623);
|
5655 |
|
5656 | }),
|
5657 |
|
5658 | (function(module, exports, __webpack_require__) {
|
5659 |
|
5660 | var defineBuiltIn = __webpack_require__(45);
|
5661 |
|
5662 | module.exports = function (target, src, options) {
|
5663 | for (var key in src) {
|
5664 | if (options && options.unsafe && target[key]) target[key] = src[key];
|
5665 | else defineBuiltIn(target, key, src[key], options);
|
5666 | } return target;
|
5667 | };
|
5668 |
|
5669 |
|
5670 | }),
|
5671 |
|
5672 | (function(module, exports, __webpack_require__) {
|
5673 |
|
5674 |
|
5675 | var NATIVE_SYMBOL = __webpack_require__(65);
|
5676 |
|
5677 | module.exports = NATIVE_SYMBOL
|
5678 | && !Symbol.sham
|
5679 | && typeof Symbol.iterator == 'symbol';
|
5680 |
|
5681 |
|
5682 | }),
|
5683 |
|
5684 | (function(module, exports, __webpack_require__) {
|
5685 |
|
5686 | var DESCRIPTORS = __webpack_require__(14);
|
5687 | var fails = __webpack_require__(2);
|
5688 | var createElement = __webpack_require__(125);
|
5689 |
|
5690 |
|
5691 | module.exports = !DESCRIPTORS && !fails(function () {
|
5692 |
|
5693 | return Object.defineProperty(createElement('div'), 'a', {
|
5694 | get: function () { return 7; }
|
5695 | }).a != 7;
|
5696 | });
|
5697 |
|
5698 |
|
5699 | }),
|
5700 |
|
5701 | (function(module, exports, __webpack_require__) {
|
5702 |
|
5703 | var fails = __webpack_require__(2);
|
5704 | var isCallable = __webpack_require__(9);
|
5705 |
|
5706 | var replacement = /#|\.prototype\./;
|
5707 |
|
5708 | var isForced = function (feature, detection) {
|
5709 | var value = data[normalize(feature)];
|
5710 | return value == POLYFILL ? true
|
5711 | : value == NATIVE ? false
|
5712 | : isCallable(detection) ? fails(detection)
|
5713 | : !!detection;
|
5714 | };
|
5715 |
|
5716 | var normalize = isForced.normalize = function (string) {
|
5717 | return String(string).replace(replacement, '.').toLowerCase();
|
5718 | };
|
5719 |
|
5720 | var data = isForced.data = {};
|
5721 | var NATIVE = isForced.NATIVE = 'N';
|
5722 | var POLYFILL = isForced.POLYFILL = 'P';
|
5723 |
|
5724 | module.exports = isForced;
|
5725 |
|
5726 |
|
5727 | }),
|
5728 |
|
5729 | (function(module, exports, __webpack_require__) {
|
5730 |
|
5731 | var DESCRIPTORS = __webpack_require__(14);
|
5732 | var fails = __webpack_require__(2);
|
5733 |
|
5734 |
|
5735 |
|
5736 | module.exports = DESCRIPTORS && fails(function () {
|
5737 |
|
5738 | return Object.defineProperty(function () { }, 'prototype', {
|
5739 | value: 42,
|
5740 | writable: false
|
5741 | }).prototype != 42;
|
5742 | });
|
5743 |
|
5744 |
|
5745 | }),
|
5746 |
|
5747 | (function(module, exports, __webpack_require__) {
|
5748 |
|
5749 | var fails = __webpack_require__(2);
|
5750 |
|
5751 | module.exports = !fails(function () {
|
5752 | function F() { }
|
5753 | F.prototype.constructor = null;
|
5754 |
|
5755 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
5756 | });
|
5757 |
|
5758 |
|
5759 | }),
|
5760 |
|
5761 | (function(module, exports, __webpack_require__) {
|
5762 |
|
5763 | var getBuiltIn = __webpack_require__(20);
|
5764 | var uncurryThis = __webpack_require__(4);
|
5765 | var getOwnPropertyNamesModule = __webpack_require__(105);
|
5766 | var getOwnPropertySymbolsModule = __webpack_require__(106);
|
5767 | var anObject = __webpack_require__(21);
|
5768 |
|
5769 | var concat = uncurryThis([].concat);
|
5770 |
|
5771 |
|
5772 | module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
5773 | var keys = getOwnPropertyNamesModule.f(anObject(it));
|
5774 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
5775 | return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
5776 | };
|
5777 |
|
5778 |
|
5779 | }),
|
5780 |
|
5781 | (function(module, exports, __webpack_require__) {
|
5782 |
|
5783 | var uncurryThis = __webpack_require__(4);
|
5784 | var hasOwn = __webpack_require__(13);
|
5785 | var toIndexedObject = __webpack_require__(35);
|
5786 | var indexOf = __webpack_require__(126).indexOf;
|
5787 | var hiddenKeys = __webpack_require__(83);
|
5788 |
|
5789 | var push = uncurryThis([].push);
|
5790 |
|
5791 | module.exports = function (object, names) {
|
5792 | var O = toIndexedObject(object);
|
5793 | var i = 0;
|
5794 | var result = [];
|
5795 | var key;
|
5796 | for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
|
5797 |
|
5798 | while (names.length > i) if (hasOwn(O, key = names[i++])) {
|
5799 | ~indexOf(result, key) || push(result, key);
|
5800 | }
|
5801 | return result;
|
5802 | };
|
5803 |
|
5804 |
|
5805 | }),
|
5806 |
|
5807 | (function(module, exports, __webpack_require__) {
|
5808 |
|
5809 | var getBuiltIn = __webpack_require__(20);
|
5810 |
|
5811 | module.exports = getBuiltIn('document', 'documentElement');
|
5812 |
|
5813 |
|
5814 | }),
|
5815 |
|
5816 | (function(module, exports, __webpack_require__) {
|
5817 |
|
5818 | var wellKnownSymbol = __webpack_require__(5);
|
5819 | var Iterators = __webpack_require__(54);
|
5820 |
|
5821 | var ITERATOR = wellKnownSymbol('iterator');
|
5822 | var ArrayPrototype = Array.prototype;
|
5823 |
|
5824 |
|
5825 | module.exports = function (it) {
|
5826 | return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
5827 | };
|
5828 |
|
5829 |
|
5830 | }),
|
5831 |
|
5832 | (function(module, exports, __webpack_require__) {
|
5833 |
|
5834 | var call = __webpack_require__(15);
|
5835 | var aCallable = __webpack_require__(29);
|
5836 | var anObject = __webpack_require__(21);
|
5837 | var tryToString = __webpack_require__(67);
|
5838 | var getIteratorMethod = __webpack_require__(108);
|
5839 |
|
5840 | var $TypeError = TypeError;
|
5841 |
|
5842 | module.exports = function (argument, usingIterator) {
|
5843 | var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
5844 | if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
|
5845 | throw $TypeError(tryToString(argument) + ' is not iterable');
|
5846 | };
|
5847 |
|
5848 |
|
5849 | }),
|
5850 |
|
5851 | (function(module, exports, __webpack_require__) {
|
5852 |
|
5853 | var call = __webpack_require__(15);
|
5854 | var anObject = __webpack_require__(21);
|
5855 | var getMethod = __webpack_require__(123);
|
5856 |
|
5857 | module.exports = function (iterator, kind, value) {
|
5858 | var innerResult, innerError;
|
5859 | anObject(iterator);
|
5860 | try {
|
5861 | innerResult = getMethod(iterator, 'return');
|
5862 | if (!innerResult) {
|
5863 | if (kind === 'throw') throw value;
|
5864 | return value;
|
5865 | }
|
5866 | innerResult = call(innerResult, iterator);
|
5867 | } catch (error) {
|
5868 | innerError = true;
|
5869 | innerResult = error;
|
5870 | }
|
5871 | if (kind === 'throw') throw value;
|
5872 | if (innerError) throw innerResult;
|
5873 | anObject(innerResult);
|
5874 | return value;
|
5875 | };
|
5876 |
|
5877 |
|
5878 | }),
|
5879 |
|
5880 | (function(module, exports, __webpack_require__) {
|
5881 |
|
5882 | var global = __webpack_require__(8);
|
5883 | var isCallable = __webpack_require__(9);
|
5884 | var inspectSource = __webpack_require__(133);
|
5885 |
|
5886 | var WeakMap = global.WeakMap;
|
5887 |
|
5888 | module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
|
5889 |
|
5890 |
|
5891 | }),
|
5892 |
|
5893 | (function(module, exports, __webpack_require__) {
|
5894 |
|
5895 | var DESCRIPTORS = __webpack_require__(14);
|
5896 | var hasOwn = __webpack_require__(13);
|
5897 |
|
5898 | var FunctionPrototype = Function.prototype;
|
5899 |
|
5900 | var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
|
5901 |
|
5902 | var EXISTS = hasOwn(FunctionPrototype, 'name');
|
5903 |
|
5904 | var PROPER = EXISTS && (function something() { }).name === 'something';
|
5905 | var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
|
5906 |
|
5907 | module.exports = {
|
5908 | EXISTS: EXISTS,
|
5909 | PROPER: PROPER,
|
5910 | CONFIGURABLE: CONFIGURABLE
|
5911 | };
|
5912 |
|
5913 |
|
5914 | }),
|
5915 |
|
5916 | (function(module, exports, __webpack_require__) {
|
5917 |
|
5918 | "use strict";
|
5919 |
|
5920 | var fails = __webpack_require__(2);
|
5921 | var isCallable = __webpack_require__(9);
|
5922 | var create = __webpack_require__(53);
|
5923 | var getPrototypeOf = __webpack_require__(102);
|
5924 | var defineBuiltIn = __webpack_require__(45);
|
5925 | var wellKnownSymbol = __webpack_require__(5);
|
5926 | var IS_PURE = __webpack_require__(36);
|
5927 |
|
5928 | var ITERATOR = wellKnownSymbol('iterator');
|
5929 | var BUGGY_SAFARI_ITERATORS = false;
|
5930 |
|
5931 |
|
5932 |
|
5933 | var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
5934 |
|
5935 |
|
5936 | if ([].keys) {
|
5937 | arrayIterator = [].keys();
|
5938 |
|
5939 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
5940 | else {
|
5941 | PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
|
5942 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
5943 | }
|
5944 | }
|
5945 |
|
5946 | var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
|
5947 | var test = {};
|
5948 |
|
5949 | return IteratorPrototype[ITERATOR].call(test) !== test;
|
5950 | });
|
5951 |
|
5952 | if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
|
5953 | else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
|
5954 |
|
5955 |
|
5956 |
|
5957 | if (!isCallable(IteratorPrototype[ITERATOR])) {
|
5958 | defineBuiltIn(IteratorPrototype, ITERATOR, function () {
|
5959 | return this;
|
5960 | });
|
5961 | }
|
5962 |
|
5963 | module.exports = {
|
5964 | IteratorPrototype: IteratorPrototype,
|
5965 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
5966 | };
|
5967 |
|
5968 |
|
5969 | }),
|
5970 |
|
5971 | (function(module, exports, __webpack_require__) {
|
5972 |
|
5973 | "use strict";
|
5974 |
|
5975 | var getBuiltIn = __webpack_require__(20);
|
5976 | var definePropertyModule = __webpack_require__(23);
|
5977 | var wellKnownSymbol = __webpack_require__(5);
|
5978 | var DESCRIPTORS = __webpack_require__(14);
|
5979 |
|
5980 | var SPECIES = wellKnownSymbol('species');
|
5981 |
|
5982 | module.exports = function (CONSTRUCTOR_NAME) {
|
5983 | var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
5984 | var defineProperty = definePropertyModule.f;
|
5985 |
|
5986 | if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
|
5987 | defineProperty(Constructor, SPECIES, {
|
5988 | configurable: true,
|
5989 | get: function () { return this; }
|
5990 | });
|
5991 | }
|
5992 | };
|
5993 |
|
5994 |
|
5995 | }),
|
5996 |
|
5997 | (function(module, exports, __webpack_require__) {
|
5998 |
|
5999 | var anObject = __webpack_require__(21);
|
6000 | var aConstructor = __webpack_require__(174);
|
6001 | var wellKnownSymbol = __webpack_require__(5);
|
6002 |
|
6003 | var SPECIES = wellKnownSymbol('species');
|
6004 |
|
6005 |
|
6006 |
|
6007 | module.exports = function (O, defaultConstructor) {
|
6008 | var C = anObject(O).constructor;
|
6009 | var S;
|
6010 | return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
|
6011 | };
|
6012 |
|
6013 |
|
6014 | }),
|
6015 |
|
6016 | (function(module, exports, __webpack_require__) {
|
6017 |
|
6018 | var isConstructor = __webpack_require__(111);
|
6019 | var tryToString = __webpack_require__(67);
|
6020 |
|
6021 | var $TypeError = TypeError;
|
6022 |
|
6023 |
|
6024 | module.exports = function (argument) {
|
6025 | if (isConstructor(argument)) return argument;
|
6026 | throw $TypeError(tryToString(argument) + ' is not a constructor');
|
6027 | };
|
6028 |
|
6029 |
|
6030 | }),
|
6031 |
|
6032 | (function(module, exports, __webpack_require__) {
|
6033 |
|
6034 | var global = __webpack_require__(8);
|
6035 | var apply = __webpack_require__(79);
|
6036 | var bind = __webpack_require__(52);
|
6037 | var isCallable = __webpack_require__(9);
|
6038 | var hasOwn = __webpack_require__(13);
|
6039 | var fails = __webpack_require__(2);
|
6040 | var html = __webpack_require__(165);
|
6041 | var arraySlice = __webpack_require__(112);
|
6042 | var createElement = __webpack_require__(125);
|
6043 | var validateArgumentsLength = __webpack_require__(306);
|
6044 | var IS_IOS = __webpack_require__(176);
|
6045 | var IS_NODE = __webpack_require__(109);
|
6046 |
|
6047 | var set = global.setImmediate;
|
6048 | var clear = global.clearImmediate;
|
6049 | var process = global.process;
|
6050 | var Dispatch = global.Dispatch;
|
6051 | var Function = global.Function;
|
6052 | var MessageChannel = global.MessageChannel;
|
6053 | var String = global.String;
|
6054 | var counter = 0;
|
6055 | var queue = {};
|
6056 | var ONREADYSTATECHANGE = 'onreadystatechange';
|
6057 | var location, defer, channel, port;
|
6058 |
|
6059 | try {
|
6060 |
|
6061 | location = global.location;
|
6062 | } catch (error) { }
|
6063 |
|
6064 | var run = function (id) {
|
6065 | if (hasOwn(queue, id)) {
|
6066 | var fn = queue[id];
|
6067 | delete queue[id];
|
6068 | fn();
|
6069 | }
|
6070 | };
|
6071 |
|
6072 | var runner = function (id) {
|
6073 | return function () {
|
6074 | run(id);
|
6075 | };
|
6076 | };
|
6077 |
|
6078 | var listener = function (event) {
|
6079 | run(event.data);
|
6080 | };
|
6081 |
|
6082 | var post = function (id) {
|
6083 |
|
6084 | global.postMessage(String(id), location.protocol + '//' + location.host);
|
6085 | };
|
6086 |
|
6087 |
|
6088 | if (!set || !clear) {
|
6089 | set = function setImmediate(handler) {
|
6090 | validateArgumentsLength(arguments.length, 1);
|
6091 | var fn = isCallable(handler) ? handler : Function(handler);
|
6092 | var args = arraySlice(arguments, 1);
|
6093 | queue[++counter] = function () {
|
6094 | apply(fn, undefined, args);
|
6095 | };
|
6096 | defer(counter);
|
6097 | return counter;
|
6098 | };
|
6099 | clear = function clearImmediate(id) {
|
6100 | delete queue[id];
|
6101 | };
|
6102 |
|
6103 | if (IS_NODE) {
|
6104 | defer = function (id) {
|
6105 | process.nextTick(runner(id));
|
6106 | };
|
6107 |
|
6108 | } else if (Dispatch && Dispatch.now) {
|
6109 | defer = function (id) {
|
6110 | Dispatch.now(runner(id));
|
6111 | };
|
6112 |
|
6113 |
|
6114 | } else if (MessageChannel && !IS_IOS) {
|
6115 | channel = new MessageChannel();
|
6116 | port = channel.port2;
|
6117 | channel.port1.onmessage = listener;
|
6118 | defer = bind(port.postMessage, port);
|
6119 |
|
6120 |
|
6121 | } else if (
|
6122 | global.addEventListener &&
|
6123 | isCallable(global.postMessage) &&
|
6124 | !global.importScripts &&
|
6125 | location && location.protocol !== 'file:' &&
|
6126 | !fails(post)
|
6127 | ) {
|
6128 | defer = post;
|
6129 | global.addEventListener('message', listener, false);
|
6130 |
|
6131 | } else if (ONREADYSTATECHANGE in createElement('script')) {
|
6132 | defer = function (id) {
|
6133 | html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
6134 | html.removeChild(this);
|
6135 | run(id);
|
6136 | };
|
6137 | };
|
6138 |
|
6139 | } else {
|
6140 | defer = function (id) {
|
6141 | setTimeout(runner(id), 0);
|
6142 | };
|
6143 | }
|
6144 | }
|
6145 |
|
6146 | module.exports = {
|
6147 | set: set,
|
6148 | clear: clear
|
6149 | };
|
6150 |
|
6151 |
|
6152 | /***/ }),
|
6153 | /* 176 */
|
6154 | /***/ (function(module, exports, __webpack_require__) {
|
6155 |
|
6156 | var userAgent = __webpack_require__(51);
|
6157 |
|
6158 | module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
|
6159 |
|
6160 |
|
6161 | }),
|
6162 |
|
6163 | (function(module, exports, __webpack_require__) {
|
6164 |
|
6165 | var NativePromiseConstructor = __webpack_require__(69);
|
6166 | var checkCorrectnessOfIteration = __webpack_require__(178);
|
6167 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(85).CONSTRUCTOR;
|
6168 |
|
6169 | module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
|
6170 | NativePromiseConstructor.all(iterable).then(undefined, function () { });
|
6171 | });
|
6172 |
|
6173 |
|
6174 | }),
|
6175 |
|
6176 | (function(module, exports, __webpack_require__) {
|
6177 |
|
6178 | var wellKnownSymbol = __webpack_require__(5);
|
6179 |
|
6180 | var ITERATOR = wellKnownSymbol('iterator');
|
6181 | var SAFE_CLOSING = false;
|
6182 |
|
6183 | try {
|
6184 | var called = 0;
|
6185 | var iteratorWithReturn = {
|
6186 | next: function () {
|
6187 | return { done: !!called++ };
|
6188 | },
|
6189 | 'return': function () {
|
6190 | SAFE_CLOSING = true;
|
6191 | }
|
6192 | };
|
6193 | iteratorWithReturn[ITERATOR] = function () {
|
6194 | return this;
|
6195 | };
|
6196 |
|
6197 | Array.from(iteratorWithReturn, function () { throw 2; });
|
6198 | } catch (error) { }
|
6199 |
|
6200 | module.exports = function (exec, SKIP_CLOSING) {
|
6201 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
6202 | var ITERATION_SUPPORT = false;
|
6203 | try {
|
6204 | var object = {};
|
6205 | object[ITERATOR] = function () {
|
6206 | return {
|
6207 | next: function () {
|
6208 | return { done: ITERATION_SUPPORT = true };
|
6209 | }
|
6210 | };
|
6211 | };
|
6212 | exec(object);
|
6213 | } catch (error) { }
|
6214 | return ITERATION_SUPPORT;
|
6215 | };
|
6216 |
|
6217 |
|
6218 | }),
|
6219 |
|
6220 | (function(module, exports, __webpack_require__) {
|
6221 |
|
6222 | var anObject = __webpack_require__(21);
|
6223 | var isObject = __webpack_require__(11);
|
6224 | var newPromiseCapability = __webpack_require__(57);
|
6225 |
|
6226 | module.exports = function (C, x) {
|
6227 | anObject(C);
|
6228 | if (isObject(x) && x.constructor === C) return x;
|
6229 | var promiseCapability = newPromiseCapability.f(C);
|
6230 | var resolve = promiseCapability.resolve;
|
6231 | resolve(x);
|
6232 | return promiseCapability.promise;
|
6233 | };
|
6234 |
|
6235 |
|
6236 | }),
|
6237 |
|
6238 | (function(module, __webpack_exports__, __webpack_require__) {
|
6239 |
|
6240 | "use strict";
|
6241 | __webpack_exports__["a"] = isUndefined;
|
6242 |
|
6243 | function isUndefined(obj) {
|
6244 | return obj === void 0;
|
6245 | }
|
6246 |
|
6247 |
|
6248 | }),
|
6249 |
|
6250 | (function(module, __webpack_exports__, __webpack_require__) {
|
6251 |
|
6252 | "use strict";
|
6253 | __webpack_exports__["a"] = isBoolean;
|
6254 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6255 |
|
6256 |
|
6257 |
|
6258 | function isBoolean(obj) {
|
6259 | return obj === true || obj === false || __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" ].call(obj) === '[object Boolean]';
|
6260 | }
|
6261 |
|
6262 |
|
6263 | }),
|
6264 |
|
6265 | (function(module, __webpack_exports__, __webpack_require__) {
|
6266 |
|
6267 | "use strict";
|
6268 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
6269 |
|
6270 |
|
6271 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Number'));
|
6272 |
|
6273 |
|
6274 | }),
|
6275 |
|
6276 | (function(module, __webpack_exports__, __webpack_require__) {
|
6277 |
|
6278 | "use strict";
|
6279 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
6280 |
|
6281 |
|
6282 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Symbol'));
|
6283 |
|
6284 |
|
6285 | }),
|
6286 |
|
6287 | (function(module, __webpack_exports__, __webpack_require__) {
|
6288 |
|
6289 | "use strict";
|
6290 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
6291 |
|
6292 |
|
6293 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('ArrayBuffer'));
|
6294 |
|
6295 |
|
6296 | }),
|
6297 |
|
6298 | (function(module, __webpack_exports__, __webpack_require__) {
|
6299 |
|
6300 | "use strict";
|
6301 | __webpack_exports__["a"] = isNaN;
|
6302 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6303 | var __WEBPACK_IMPORTED_MODULE_1__isNumber_js__ = __webpack_require__(182);
|
6304 |
|
6305 |
|
6306 |
|
6307 |
|
6308 | function isNaN(obj) {
|
6309 | return Object(__WEBPACK_IMPORTED_MODULE_1__isNumber_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["g" ])(obj);
|
6310 | }
|
6311 |
|
6312 |
|
6313 | }),
|
6314 |
|
6315 | (function(module, __webpack_exports__, __webpack_require__) {
|
6316 |
|
6317 | "use strict";
|
6318 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6319 | var __WEBPACK_IMPORTED_MODULE_1__isDataView_js__ = __webpack_require__(137);
|
6320 | var __WEBPACK_IMPORTED_MODULE_2__constant_js__ = __webpack_require__(187);
|
6321 | var __WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__ = __webpack_require__(331);
|
6322 |
|
6323 |
|
6324 |
|
6325 |
|
6326 |
|
6327 |
|
6328 | var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
|
6329 | function isTypedArray(obj) {
|
6330 |
|
6331 |
|
6332 | 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)) :
|
6333 | Object(__WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__["a" ])(obj) && typedArrayPattern.test(__WEBPACK_IMPORTED_MODULE_0__setup_js__["t" ].call(obj));
|
6334 | }
|
6335 |
|
6336 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["r" ] ? isTypedArray : Object(__WEBPACK_IMPORTED_MODULE_2__constant_js__["a" ])(false));
|
6337 |
|
6338 |
|
6339 | }),
|
6340 |
|
6341 | (function(module, __webpack_exports__, __webpack_require__) {
|
6342 |
|
6343 | "use strict";
|
6344 | __webpack_exports__["a"] = constant;
|
6345 |
|
6346 | function constant(value) {
|
6347 | return function() {
|
6348 | return value;
|
6349 | };
|
6350 | }
|
6351 |
|
6352 |
|
6353 | }),
|
6354 |
|
6355 | (function(module, __webpack_exports__, __webpack_require__) {
|
6356 |
|
6357 | "use strict";
|
6358 | __webpack_exports__["a"] = createSizePropertyCheck;
|
6359 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6360 |
|
6361 |
|
6362 |
|
6363 | function createSizePropertyCheck(getSizeProperty) {
|
6364 | return function(collection) {
|
6365 | var sizeProperty = getSizeProperty(collection);
|
6366 | return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= __WEBPACK_IMPORTED_MODULE_0__setup_js__["b" ];
|
6367 | }
|
6368 | }
|
6369 |
|
6370 |
|
6371 | }),
|
6372 |
|
6373 | (function(module, __webpack_exports__, __webpack_require__) {
|
6374 |
|
6375 | "use strict";
|
6376 | __webpack_exports__["a"] = shallowProperty;
|
6377 |
|
6378 | function shallowProperty(key) {
|
6379 | return function(obj) {
|
6380 | return obj == null ? void 0 : obj[key];
|
6381 | };
|
6382 | }
|
6383 |
|
6384 |
|
6385 | }),
|
6386 |
|
6387 | (function(module, __webpack_exports__, __webpack_require__) {
|
6388 |
|
6389 | "use strict";
|
6390 | __webpack_exports__["a"] = collectNonEnumProps;
|
6391 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6392 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
6393 | var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(47);
|
6394 |
|
6395 |
|
6396 |
|
6397 |
|
6398 |
|
6399 |
|
6400 |
|
6401 |
|
6402 | function emulatedSet(keys) {
|
6403 | var hash = {};
|
6404 | for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
|
6405 | return {
|
6406 | contains: function(key) { return hash[key]; },
|
6407 | push: function(key) {
|
6408 | hash[key] = true;
|
6409 | return keys.push(key);
|
6410 | }
|
6411 | };
|
6412 | }
|
6413 |
|
6414 |
|
6415 |
|
6416 |
|
6417 | function collectNonEnumProps(obj, keys) {
|
6418 | keys = emulatedSet(keys);
|
6419 | var nonEnumIdx = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" ].length;
|
6420 | var constructor = obj.constructor;
|
6421 | var proto = Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(constructor) && constructor.prototype || __WEBPACK_IMPORTED_MODULE_0__setup_js__["c" /* ObjProto */];
|
6422 |
|
6423 | // Constructor is a special case.
|
6424 | var prop = 'constructor';
|
6425 | if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, prop) && !keys.contains(prop)) keys.push(prop);
|
6426 |
|
6427 | while (nonEnumIdx--) {
|
6428 | prop = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" ][nonEnumIdx];
|
6429 | if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
|
6430 | keys.push(prop);
|
6431 | }
|
6432 | }
|
6433 | }
|
6434 |
|
6435 |
|
6436 | }),
|
6437 |
|
6438 | (function(module, __webpack_exports__, __webpack_require__) {
|
6439 |
|
6440 | "use strict";
|
6441 | __webpack_exports__["a"] = isMatch;
|
6442 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(17);
|
6443 |
|
6444 |
|
6445 |
|
6446 | function isMatch(object, attrs) {
|
6447 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(attrs), length = _keys.length;
|
6448 | if (object == null) return !length;
|
6449 | var obj = Object(object);
|
6450 | for (var i = 0; i < length; i++) {
|
6451 | var key = _keys[i];
|
6452 | if (attrs[key] !== obj[key] || !(key in obj)) return false;
|
6453 | }
|
6454 | return true;
|
6455 | }
|
6456 |
|
6457 |
|
6458 | }),
|
6459 |
|
6460 | (function(module, __webpack_exports__, __webpack_require__) {
|
6461 |
|
6462 | "use strict";
|
6463 | __webpack_exports__["a"] = invert;
|
6464 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(17);
|
6465 |
|
6466 |
|
6467 |
|
6468 | function invert(obj) {
|
6469 | var result = {};
|
6470 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(obj);
|
6471 | for (var i = 0, length = _keys.length; i < length; i++) {
|
6472 | result[obj[_keys[i]]] = _keys[i];
|
6473 | }
|
6474 | return result;
|
6475 | }
|
6476 |
|
6477 |
|
6478 | }),
|
6479 |
|
6480 | (function(module, __webpack_exports__, __webpack_require__) {
|
6481 |
|
6482 | "use strict";
|
6483 | __webpack_exports__["a"] = functions;
|
6484 | var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(30);
|
6485 |
|
6486 |
|
6487 |
|
6488 | function functions(obj) {
|
6489 | var names = [];
|
6490 | for (var key in obj) {
|
6491 | if (Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" ])(obj[key])) names.push(key);
|
6492 | }
|
6493 | return names.sort();
|
6494 | }
|
6495 |
|
6496 |
|
6497 | }),
|
6498 |
|
6499 | (function(module, __webpack_exports__, __webpack_require__) {
|
6500 |
|
6501 | "use strict";
|
6502 | var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(141);
|
6503 | var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(87);
|
6504 |
|
6505 |
|
6506 |
|
6507 |
|
6508 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" ]));
|
6509 |
|
6510 |
|
6511 | }),
|
6512 |
|
6513 | (function(module, __webpack_exports__, __webpack_require__) {
|
6514 |
|
6515 | "use strict";
|
6516 | var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(141);
|
6517 | var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(87);
|
6518 |
|
6519 |
|
6520 |
|
6521 |
|
6522 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" ], true));
|
6523 |
|
6524 |
|
6525 | }),
|
6526 |
|
6527 | (function(module, __webpack_exports__, __webpack_require__) {
|
6528 |
|
6529 | "use strict";
|
6530 | __webpack_exports__["a"] = baseCreate;
|
6531 | var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(58);
|
6532 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
6533 |
|
6534 |
|
6535 |
|
6536 |
|
6537 | function ctor() {
|
6538 | return function(){};
|
6539 | }
|
6540 |
|
6541 |
|
6542 | function baseCreate(prototype) {
|
6543 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" ])(prototype)) return {};
|
6544 | if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" ]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" ])(prototype);
|
6545 | var Ctor = ctor();
|
6546 | Ctor.prototype = prototype;
|
6547 | var result = new Ctor;
|
6548 | Ctor.prototype = null;
|
6549 | return result;
|
6550 | }
|
6551 |
|
6552 |
|
6553 | }),
|
6554 |
|
6555 | (function(module, __webpack_exports__, __webpack_require__) {
|
6556 |
|
6557 | "use strict";
|
6558 | __webpack_exports__["a"] = clone;
|
6559 | var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(58);
|
6560 | var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(59);
|
6561 | var __WEBPACK_IMPORTED_MODULE_2__extend_js__ = __webpack_require__(194);
|
6562 |
|
6563 |
|
6564 |
|
6565 |
|
6566 |
|
6567 | function clone(obj) {
|
6568 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" ])(obj)) return obj;
|
6569 | return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" ])(obj) ? obj.slice() : Object(__WEBPACK_IMPORTED_MODULE_2__extend_js__["a" ])({}, obj);
|
6570 | }
|
6571 |
|
6572 |
|
6573 | }),
|
6574 |
|
6575 | (function(module, __webpack_exports__, __webpack_require__) {
|
6576 |
|
6577 | "use strict";
|
6578 | __webpack_exports__["a"] = get;
|
6579 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__toPath_js__ = __webpack_require__(88);
|
6580 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deepGet_js__ = __webpack_require__(143);
|
6581 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isUndefined_js__ = __webpack_require__(180);
|
6582 |
|
6583 |
|
6584 |
|
6585 |
|
6586 | // Get the value of the (deep) property on `path` from `object`.
|
6587 | // If any property in `path` does not exist or if the value is
|
6588 | // `undefined`, return `defaultValue` instead.
|
6589 | // The `path` is normalized through `_.toPath`.
|
6590 | function get(object, path, defaultValue) {
|
6591 | var value = Object(__WEBPACK_IMPORTED_MODULE_1__deepGet_js__["a" ])(object, Object(__WEBPACK_IMPORTED_MODULE_0__toPath_js__["a" ])(path));
|
6592 | return Object(__WEBPACK_IMPORTED_MODULE_2__isUndefined_js__["a" ])(value) ? defaultValue : value;
|
6593 | }
|
6594 |
|
6595 |
|
6596 | }),
|
6597 |
|
6598 | (function(module, __webpack_exports__, __webpack_require__) {
|
6599 |
|
6600 | "use strict";
|
6601 | __webpack_exports__["a"] = toPath;
|
6602 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
6603 | var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(59);
|
6604 |
|
6605 |
|
6606 |
|
6607 |
|
6608 |
|
6609 | function toPath(path) {
|
6610 | return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" ])(path) ? path : [path];
|
6611 | }
|
6612 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].toPath = toPath;
|
6613 |
|
6614 |
|
6615 | }),
|
6616 |
|
6617 | (function(module, __webpack_exports__, __webpack_require__) {
|
6618 |
|
6619 | "use strict";
|
6620 | __webpack_exports__["a"] = baseIteratee;
|
6621 | var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(144);
|
6622 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
6623 | var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(58);
|
6624 | var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(59);
|
6625 | var __WEBPACK_IMPORTED_MODULE_4__matcher_js__ = __webpack_require__(113);
|
6626 | var __WEBPACK_IMPORTED_MODULE_5__property_js__ = __webpack_require__(145);
|
6627 | var __WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__ = __webpack_require__(89);
|
6628 |
|
6629 |
|
6630 |
|
6631 |
|
6632 |
|
6633 |
|
6634 |
|
6635 |
|
6636 |
|
6637 |
|
6638 |
|
6639 | function baseIteratee(value, context, argCount) {
|
6640 | if (value == null) return __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" ];
|
6641 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(value)) return Object(__WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__["a" ])(value, context, argCount);
|
6642 | 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);
|
6643 | return Object(__WEBPACK_IMPORTED_MODULE_5__property_js__["a" ])(value);
|
6644 | }
|
6645 |
|
6646 |
|
6647 | }),
|
6648 |
|
6649 | (function(module, __webpack_exports__, __webpack_require__) {
|
6650 |
|
6651 | "use strict";
|
6652 | __webpack_exports__["a"] = iteratee;
|
6653 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
6654 | var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(200);
|
6655 |
|
6656 |
|
6657 |
|
6658 |
|
6659 |
|
6660 |
|
6661 | function iteratee(value, context) {
|
6662 | return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" ])(value, context, Infinity);
|
6663 | }
|
6664 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].iteratee = iteratee;
|
6665 |
|
6666 |
|
6667 | }),
|
6668 |
|
6669 | (function(module, __webpack_exports__, __webpack_require__) {
|
6670 |
|
6671 | "use strict";
|
6672 | __webpack_exports__["a"] = noop;
|
6673 |
|
6674 | function noop(){}
|
6675 |
|
6676 |
|
6677 | }),
|
6678 |
|
6679 | (function(module, __webpack_exports__, __webpack_require__) {
|
6680 |
|
6681 | "use strict";
|
6682 | __webpack_exports__["a"] = random;
|
6683 |
|
6684 | function random(min, max) {
|
6685 | if (max == null) {
|
6686 | max = min;
|
6687 | min = 0;
|
6688 | }
|
6689 | return min + Math.floor(Math.random() * (max - min + 1));
|
6690 | }
|
6691 |
|
6692 |
|
6693 | }),
|
6694 |
|
6695 | (function(module, __webpack_exports__, __webpack_require__) {
|
6696 |
|
6697 | "use strict";
|
6698 | __webpack_exports__["a"] = createEscaper;
|
6699 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(17);
|
6700 |
|
6701 |
|
6702 |
|
6703 |
|
6704 | function createEscaper(map) {
|
6705 | var escaper = function(match) {
|
6706 | return map[match];
|
6707 | };
|
6708 |
|
6709 | var source = '(?:' + Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(map).join('|') + ')';
|
6710 | var testRegexp = RegExp(source);
|
6711 | var replaceRegexp = RegExp(source, 'g');
|
6712 | return function(string) {
|
6713 | string = string == null ? '' : '' + string;
|
6714 | return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
|
6715 | };
|
6716 | }
|
6717 |
|
6718 |
|
6719 | }),
|
6720 |
|
6721 | (function(module, __webpack_exports__, __webpack_require__) {
|
6722 |
|
6723 | "use strict";
|
6724 |
|
6725 | __webpack_exports__["a"] = ({
|
6726 | '&': '&',
|
6727 | '<': '<',
|
6728 | '>': '>',
|
6729 | '"': '"',
|
6730 | "'": ''',
|
6731 | '`': '`'
|
6732 | });
|
6733 |
|
6734 |
|
6735 | }),
|
6736 |
|
6737 | (function(module, __webpack_exports__, __webpack_require__) {
|
6738 |
|
6739 | "use strict";
|
6740 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
6741 |
|
6742 |
|
6743 |
|
6744 |
|
6745 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].templateSettings = {
|
6746 | evaluate: /<%([\s\S]+?)%>/g,
|
6747 | interpolate: /<%=([\s\S]+?)%>/g,
|
6748 | escape: /<%-([\s\S]+?)%>/g
|
6749 | });
|
6750 |
|
6751 |
|
6752 | }),
|
6753 |
|
6754 | (function(module, __webpack_exports__, __webpack_require__) {
|
6755 |
|
6756 | "use strict";
|
6757 | __webpack_exports__["a"] = executeBound;
|
6758 | var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(196);
|
6759 | var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(58);
|
6760 |
|
6761 |
|
6762 |
|
6763 |
|
6764 |
|
6765 |
|
6766 | function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
|
6767 | if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
|
6768 | var self = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" ])(sourceFunc.prototype);
|
6769 | var result = sourceFunc.apply(self, args);
|
6770 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" ])(result)) return result;
|
6771 | return self;
|
6772 | }
|
6773 |
|
6774 |
|
6775 | }),
|
6776 |
|
6777 | (function(module, __webpack_exports__, __webpack_require__) {
|
6778 |
|
6779 | "use strict";
|
6780 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
6781 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
6782 | var __WEBPACK_IMPORTED_MODULE_2__executeBound_js__ = __webpack_require__(207);
|
6783 |
|
6784 |
|
6785 |
|
6786 |
|
6787 |
|
6788 |
|
6789 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(func, context, args) {
|
6790 | if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(func)) throw new TypeError('Bind must be called on a function');
|
6791 | var bound = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(callArgs) {
|
6792 | return Object(__WEBPACK_IMPORTED_MODULE_2__executeBound_js__["a" ])(func, bound, context, this, args.concat(callArgs));
|
6793 | });
|
6794 | return bound;
|
6795 | }));
|
6796 |
|
6797 |
|
6798 | }),
|
6799 |
|
6800 | (function(module, __webpack_exports__, __webpack_require__) {
|
6801 |
|
6802 | "use strict";
|
6803 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
6804 |
|
6805 |
|
6806 |
|
6807 |
|
6808 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(func, wait, args) {
|
6809 | return setTimeout(function() {
|
6810 | return func.apply(null, args);
|
6811 | }, wait);
|
6812 | }));
|
6813 |
|
6814 |
|
6815 | }),
|
6816 |
|
6817 | (function(module, __webpack_exports__, __webpack_require__) {
|
6818 |
|
6819 | "use strict";
|
6820 | __webpack_exports__["a"] = before;
|
6821 |
|
6822 |
|
6823 | function before(times, func) {
|
6824 | var memo;
|
6825 | return function() {
|
6826 | if (--times > 0) {
|
6827 | memo = func.apply(this, arguments);
|
6828 | }
|
6829 | if (times <= 1) func = null;
|
6830 | return memo;
|
6831 | };
|
6832 | }
|
6833 |
|
6834 |
|
6835 | }),
|
6836 |
|
6837 | (function(module, __webpack_exports__, __webpack_require__) {
|
6838 |
|
6839 | "use strict";
|
6840 | __webpack_exports__["a"] = findKey;
|
6841 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
6842 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(17);
|
6843 |
|
6844 |
|
6845 |
|
6846 |
|
6847 | function findKey(obj, predicate, context) {
|
6848 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
6849 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj), key;
|
6850 | for (var i = 0, length = _keys.length; i < length; i++) {
|
6851 | key = _keys[i];
|
6852 | if (predicate(obj[key], key, obj)) return key;
|
6853 | }
|
6854 | }
|
6855 |
|
6856 |
|
6857 | }),
|
6858 |
|
6859 | (function(module, __webpack_exports__, __webpack_require__) {
|
6860 |
|
6861 | "use strict";
|
6862 | __webpack_exports__["a"] = createPredicateIndexFinder;
|
6863 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
6864 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(31);
|
6865 |
|
6866 |
|
6867 |
|
6868 |
|
6869 | function createPredicateIndexFinder(dir) {
|
6870 | return function(array, predicate, context) {
|
6871 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
6872 | var length = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ])(array);
|
6873 | var index = dir > 0 ? 0 : length - 1;
|
6874 | for (; index >= 0 && index < length; index += dir) {
|
6875 | if (predicate(array[index], index, array)) return index;
|
6876 | }
|
6877 | return -1;
|
6878 | };
|
6879 | }
|
6880 |
|
6881 |
|
6882 | }),
|
6883 |
|
6884 | (function(module, __webpack_exports__, __webpack_require__) {
|
6885 |
|
6886 | "use strict";
|
6887 | var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(212);
|
6888 |
|
6889 |
|
6890 |
|
6891 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" ])(-1));
|
6892 |
|
6893 |
|
6894 | }),
|
6895 |
|
6896 | (function(module, __webpack_exports__, __webpack_require__) {
|
6897 |
|
6898 | "use strict";
|
6899 | __webpack_exports__["a"] = sortedIndex;
|
6900 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
6901 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(31);
|
6902 |
|
6903 |
|
6904 |
|
6905 |
|
6906 |
|
6907 | function sortedIndex(array, obj, iteratee, context) {
|
6908 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context, 1);
|
6909 | var value = iteratee(obj);
|
6910 | var low = 0, high = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ])(array);
|
6911 | while (low < high) {
|
6912 | var mid = Math.floor((low + high) / 2);
|
6913 | if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
|
6914 | }
|
6915 | return low;
|
6916 | }
|
6917 |
|
6918 |
|
6919 | }),
|
6920 |
|
6921 | (function(module, __webpack_exports__, __webpack_require__) {
|
6922 |
|
6923 | "use strict";
|
6924 | var __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__ = __webpack_require__(214);
|
6925 | var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(148);
|
6926 | var __WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__ = __webpack_require__(216);
|
6927 |
|
6928 |
|
6929 |
|
6930 |
|
6931 |
|
6932 |
|
6933 |
|
6934 |
|
6935 | __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" ]));
|
6936 |
|
6937 |
|
6938 | }),
|
6939 |
|
6940 | (function(module, __webpack_exports__, __webpack_require__) {
|
6941 |
|
6942 | "use strict";
|
6943 | __webpack_exports__["a"] = createIndexFinder;
|
6944 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
6945 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
6946 | var __WEBPACK_IMPORTED_MODULE_2__isNaN_js__ = __webpack_require__(185);
|
6947 |
|
6948 |
|
6949 |
|
6950 |
|
6951 |
|
6952 | function createIndexFinder(dir, predicateFind, sortedIndex) {
|
6953 | return function(array, item, idx) {
|
6954 | var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(array);
|
6955 | if (typeof idx == 'number') {
|
6956 | if (dir > 0) {
|
6957 | i = idx >= 0 ? idx : Math.max(idx + length, i);
|
6958 | } else {
|
6959 | length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
|
6960 | }
|
6961 | } else if (sortedIndex && idx && length) {
|
6962 | idx = sortedIndex(array, item);
|
6963 | return array[idx] === item ? idx : -1;
|
6964 | }
|
6965 | if (item !== item) {
|
6966 | idx = predicateFind(__WEBPACK_IMPORTED_MODULE_1__setup_js__["q" ].call(array, i, length), __WEBPACK_IMPORTED_MODULE_2__isNaN_js__["a" ]);
|
6967 | return idx >= 0 ? idx + i : -1;
|
6968 | }
|
6969 | for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
|
6970 | if (array[idx] === item) return idx;
|
6971 | }
|
6972 | return -1;
|
6973 | };
|
6974 | }
|
6975 |
|
6976 |
|
6977 | }),
|
6978 |
|
6979 | (function(module, __webpack_exports__, __webpack_require__) {
|
6980 |
|
6981 | "use strict";
|
6982 | __webpack_exports__["a"] = find;
|
6983 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
6984 | var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(148);
|
6985 | var __WEBPACK_IMPORTED_MODULE_2__findKey_js__ = __webpack_require__(211);
|
6986 |
|
6987 |
|
6988 |
|
6989 |
|
6990 |
|
6991 | function find(obj, predicate, context) {
|
6992 | 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" ];
|
6993 | var key = keyFinder(obj, predicate, context);
|
6994 | if (key !== void 0 && key !== -1) return obj[key];
|
6995 | }
|
6996 |
|
6997 |
|
6998 | }),
|
6999 |
|
7000 | (function(module, __webpack_exports__, __webpack_require__) {
|
7001 |
|
7002 | "use strict";
|
7003 | __webpack_exports__["a"] = createReduce;
|
7004 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
7005 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(17);
|
7006 | var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(89);
|
7007 |
|
7008 |
|
7009 |
|
7010 |
|
7011 |
|
7012 | function createReduce(dir) {
|
7013 |
|
7014 |
|
7015 | var reducer = function(obj, iteratee, memo, initial) {
|
7016 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj),
|
7017 | length = (_keys || obj).length,
|
7018 | index = dir > 0 ? 0 : length - 1;
|
7019 | if (!initial) {
|
7020 | memo = obj[_keys ? _keys[index] : index];
|
7021 | index += dir;
|
7022 | }
|
7023 | for (; index >= 0 && index < length; index += dir) {
|
7024 | var currentKey = _keys ? _keys[index] : index;
|
7025 | memo = iteratee(memo, obj[currentKey], currentKey, obj);
|
7026 | }
|
7027 | return memo;
|
7028 | };
|
7029 |
|
7030 | return function(obj, iteratee, memo, context) {
|
7031 | var initial = arguments.length >= 3;
|
7032 | return reducer(obj, Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" ])(iteratee, context, 4), memo, initial);
|
7033 | };
|
7034 | }
|
7035 |
|
7036 |
|
7037 | }),
|
7038 |
|
7039 | (function(module, __webpack_exports__, __webpack_require__) {
|
7040 |
|
7041 | "use strict";
|
7042 | __webpack_exports__["a"] = max;
|
7043 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
7044 | var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(71);
|
7045 | var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(22);
|
7046 | var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(60);
|
7047 |
|
7048 |
|
7049 |
|
7050 |
|
7051 |
|
7052 |
|
7053 | function max(obj, iteratee, context) {
|
7054 | var result = -Infinity, lastComputed = -Infinity,
|
7055 | value, computed;
|
7056 | if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
|
7057 | obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" ])(obj);
|
7058 | for (var i = 0, length = obj.length; i < length; i++) {
|
7059 | value = obj[i];
|
7060 | if (value != null && value > result) {
|
7061 | result = value;
|
7062 | }
|
7063 | }
|
7064 | } else {
|
7065 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" ])(iteratee, context);
|
7066 | Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" ])(obj, function(v, index, list) {
|
7067 | computed = iteratee(v, index, list);
|
7068 | if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
|
7069 | result = v;
|
7070 | lastComputed = computed;
|
7071 | }
|
7072 | });
|
7073 | }
|
7074 | return result;
|
7075 | }
|
7076 |
|
7077 |
|
7078 | }),
|
7079 |
|
7080 | (function(module, __webpack_exports__, __webpack_require__) {
|
7081 |
|
7082 | "use strict";
|
7083 | __webpack_exports__["a"] = sample;
|
7084 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
7085 | var __WEBPACK_IMPORTED_MODULE_1__clone_js__ = __webpack_require__(197);
|
7086 | var __WEBPACK_IMPORTED_MODULE_2__values_js__ = __webpack_require__(71);
|
7087 | var __WEBPACK_IMPORTED_MODULE_3__getLength_js__ = __webpack_require__(31);
|
7088 | var __WEBPACK_IMPORTED_MODULE_4__random_js__ = __webpack_require__(203);
|
7089 |
|
7090 |
|
7091 |
|
7092 |
|
7093 |
|
7094 |
|
7095 |
|
7096 |
|
7097 |
|
7098 |
|
7099 | function sample(obj, n, guard) {
|
7100 | if (n == null || guard) {
|
7101 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" ])(obj);
|
7102 | return obj[Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" ])(obj.length - 1)];
|
7103 | }
|
7104 | 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);
|
7105 | var length = Object(__WEBPACK_IMPORTED_MODULE_3__getLength_js__["a" ])(sample);
|
7106 | n = Math.max(Math.min(n, length), 0);
|
7107 | var last = length - 1;
|
7108 | for (var index = 0; index < n; index++) {
|
7109 | var rand = Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" ])(index, last);
|
7110 | var temp = sample[index];
|
7111 | sample[index] = sample[rand];
|
7112 | sample[rand] = temp;
|
7113 | }
|
7114 | return sample.slice(0, n);
|
7115 | }
|
7116 |
|
7117 |
|
7118 | }),
|
7119 |
|
7120 | (function(module, __webpack_exports__, __webpack_require__) {
|
7121 |
|
7122 | "use strict";
|
7123 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
7124 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
7125 | var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(89);
|
7126 | var __WEBPACK_IMPORTED_MODULE_3__allKeys_js__ = __webpack_require__(87);
|
7127 | var __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__ = __webpack_require__(380);
|
7128 | var __WEBPACK_IMPORTED_MODULE_5__flatten_js__ = __webpack_require__(72);
|
7129 |
|
7130 |
|
7131 |
|
7132 |
|
7133 |
|
7134 |
|
7135 |
|
7136 |
|
7137 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, keys) {
|
7138 | var result = {}, iteratee = keys[0];
|
7139 | if (obj == null) return result;
|
7140 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(iteratee)) {
|
7141 | if (keys.length > 1) iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" ])(iteratee, keys[1]);
|
7142 | keys = Object(__WEBPACK_IMPORTED_MODULE_3__allKeys_js__["a" ])(obj);
|
7143 | } else {
|
7144 | iteratee = __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__["a" ];
|
7145 | keys = Object(__WEBPACK_IMPORTED_MODULE_5__flatten_js__["a" ])(keys, false, false);
|
7146 | obj = Object(obj);
|
7147 | }
|
7148 | for (var i = 0, length = keys.length; i < length; i++) {
|
7149 | var key = keys[i];
|
7150 | var value = obj[key];
|
7151 | if (iteratee(value, key, obj)) result[key] = value;
|
7152 | }
|
7153 | return result;
|
7154 | }));
|
7155 |
|
7156 |
|
7157 | }),
|
7158 |
|
7159 | (function(module, __webpack_exports__, __webpack_require__) {
|
7160 |
|
7161 | "use strict";
|
7162 | __webpack_exports__["a"] = initial;
|
7163 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
7164 |
|
7165 |
|
7166 |
|
7167 |
|
7168 |
|
7169 | function initial(array, n, guard) {
|
7170 | return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" ].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
|
7171 | }
|
7172 |
|
7173 |
|
7174 | }),
|
7175 |
|
7176 | (function(module, __webpack_exports__, __webpack_require__) {
|
7177 |
|
7178 | "use strict";
|
7179 | __webpack_exports__["a"] = rest;
|
7180 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
7181 |
|
7182 |
|
7183 |
|
7184 |
|
7185 |
|
7186 | function rest(array, n, guard) {
|
7187 | return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" ].call(array, n == null || guard ? 1 : n);
|
7188 | }
|
7189 |
|
7190 |
|
7191 | }),
|
7192 |
|
7193 | (function(module, __webpack_exports__, __webpack_require__) {
|
7194 |
|
7195 | "use strict";
|
7196 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
7197 | var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(72);
|
7198 | var __WEBPACK_IMPORTED_MODULE_2__filter_js__ = __webpack_require__(90);
|
7199 | var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(91);
|
7200 |
|
7201 |
|
7202 |
|
7203 |
|
7204 |
|
7205 |
|
7206 |
|
7207 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(array, rest) {
|
7208 | rest = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" ])(rest, true, true);
|
7209 | return Object(__WEBPACK_IMPORTED_MODULE_2__filter_js__["a" ])(array, function(value){
|
7210 | return !Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" ])(rest, value);
|
7211 | });
|
7212 | }));
|
7213 |
|
7214 |
|
7215 | }),
|
7216 |
|
7217 | (function(module, __webpack_exports__, __webpack_require__) {
|
7218 |
|
7219 | "use strict";
|
7220 | __webpack_exports__["a"] = uniq;
|
7221 | var __WEBPACK_IMPORTED_MODULE_0__isBoolean_js__ = __webpack_require__(181);
|
7222 | var __WEBPACK_IMPORTED_MODULE_1__cb_js__ = __webpack_require__(22);
|
7223 | var __WEBPACK_IMPORTED_MODULE_2__getLength_js__ = __webpack_require__(31);
|
7224 | var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(91);
|
7225 |
|
7226 |
|
7227 |
|
7228 |
|
7229 |
|
7230 |
|
7231 |
|
7232 |
|
7233 |
|
7234 |
|
7235 | function uniq(array, isSorted, iteratee, context) {
|
7236 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isBoolean_js__["a" ])(isSorted)) {
|
7237 | context = iteratee;
|
7238 | iteratee = isSorted;
|
7239 | isSorted = false;
|
7240 | }
|
7241 | if (iteratee != null) iteratee = Object(__WEBPACK_IMPORTED_MODULE_1__cb_js__["a" ])(iteratee, context);
|
7242 | var result = [];
|
7243 | var seen = [];
|
7244 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_2__getLength_js__["a" ])(array); i < length; i++) {
|
7245 | var value = array[i],
|
7246 | computed = iteratee ? iteratee(value, i, array) : value;
|
7247 | if (isSorted && !iteratee) {
|
7248 | if (!i || seen !== computed) result.push(value);
|
7249 | seen = computed;
|
7250 | } else if (iteratee) {
|
7251 | if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" ])(seen, computed)) {
|
7252 | seen.push(computed);
|
7253 | result.push(value);
|
7254 | }
|
7255 | } else if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" ])(result, value)) {
|
7256 | result.push(value);
|
7257 | }
|
7258 | }
|
7259 | return result;
|
7260 | }
|
7261 |
|
7262 |
|
7263 | }),
|
7264 |
|
7265 | (function(module, __webpack_exports__, __webpack_require__) {
|
7266 |
|
7267 | "use strict";
|
7268 | __webpack_exports__["a"] = unzip;
|
7269 | var __WEBPACK_IMPORTED_MODULE_0__max_js__ = __webpack_require__(219);
|
7270 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(31);
|
7271 | var __WEBPACK_IMPORTED_MODULE_2__pluck_js__ = __webpack_require__(149);
|
7272 |
|
7273 |
|
7274 |
|
7275 |
|
7276 |
|
7277 |
|
7278 | function unzip(array) {
|
7279 | var length = array && Object(__WEBPACK_IMPORTED_MODULE_0__max_js__["a" ])(array, __WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ]).length || 0;
|
7280 | var result = Array(length);
|
7281 |
|
7282 | for (var index = 0; index < length; index++) {
|
7283 | result[index] = Object(__WEBPACK_IMPORTED_MODULE_2__pluck_js__["a" ])(array, index);
|
7284 | }
|
7285 | return result;
|
7286 | }
|
7287 |
|
7288 |
|
7289 | }),
|
7290 |
|
7291 | (function(module, __webpack_exports__, __webpack_require__) {
|
7292 |
|
7293 | "use strict";
|
7294 | __webpack_exports__["a"] = chainResult;
|
7295 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
7296 |
|
7297 |
|
7298 |
|
7299 | function chainResult(instance, obj) {
|
7300 | return instance._chain ? Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ])(obj).chain() : obj;
|
7301 | }
|
7302 |
|
7303 |
|
7304 | }),
|
7305 |
|
7306 | (function(module, exports, __webpack_require__) {
|
7307 |
|
7308 | "use strict";
|
7309 |
|
7310 | var $ = __webpack_require__(0);
|
7311 | var fails = __webpack_require__(2);
|
7312 | var isArray = __webpack_require__(92);
|
7313 | var isObject = __webpack_require__(11);
|
7314 | var toObject = __webpack_require__(33);
|
7315 | var lengthOfArrayLike = __webpack_require__(40);
|
7316 | var doesNotExceedSafeInteger = __webpack_require__(398);
|
7317 | var createProperty = __webpack_require__(93);
|
7318 | var arraySpeciesCreate = __webpack_require__(229);
|
7319 | var arrayMethodHasSpeciesSupport = __webpack_require__(116);
|
7320 | var wellKnownSymbol = __webpack_require__(5);
|
7321 | var V8_VERSION = __webpack_require__(66);
|
7322 |
|
7323 | var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
7324 |
|
7325 |
|
7326 |
|
7327 |
|
7328 | var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
|
7329 | var array = [];
|
7330 | array[IS_CONCAT_SPREADABLE] = false;
|
7331 | return array.concat()[0] !== array;
|
7332 | });
|
7333 |
|
7334 | var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
7335 |
|
7336 | var isConcatSpreadable = function (O) {
|
7337 | if (!isObject(O)) return false;
|
7338 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
7339 | return spreadable !== undefined ? !!spreadable : isArray(O);
|
7340 | };
|
7341 |
|
7342 | var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
7343 |
|
7344 |
|
7345 |
|
7346 |
|
7347 | $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
|
7348 |
|
7349 | concat: function concat(arg) {
|
7350 | var O = toObject(this);
|
7351 | var A = arraySpeciesCreate(O, 0);
|
7352 | var n = 0;
|
7353 | var i, k, length, len, E;
|
7354 | for (i = -1, length = arguments.length; i < length; i++) {
|
7355 | E = i === -1 ? O : arguments[i];
|
7356 | if (isConcatSpreadable(E)) {
|
7357 | len = lengthOfArrayLike(E);
|
7358 | doesNotExceedSafeInteger(n + len);
|
7359 | for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
7360 | } else {
|
7361 | doesNotExceedSafeInteger(n + 1);
|
7362 | createProperty(A, n++, E);
|
7363 | }
|
7364 | }
|
7365 | A.length = n;
|
7366 | return A;
|
7367 | }
|
7368 | });
|
7369 |
|
7370 |
|
7371 | }),
|
7372 |
|
7373 | (function(module, exports, __webpack_require__) {
|
7374 |
|
7375 | var arraySpeciesConstructor = __webpack_require__(399);
|
7376 |
|
7377 |
|
7378 |
|
7379 | module.exports = function (originalArray, length) {
|
7380 | return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
7381 | };
|
7382 |
|
7383 |
|
7384 | }),
|
7385 |
|
7386 | (function(module, exports, __webpack_require__) {
|
7387 |
|
7388 | var $ = __webpack_require__(0);
|
7389 | var getBuiltIn = __webpack_require__(20);
|
7390 | var apply = __webpack_require__(79);
|
7391 | var call = __webpack_require__(15);
|
7392 | var uncurryThis = __webpack_require__(4);
|
7393 | var fails = __webpack_require__(2);
|
7394 | var isArray = __webpack_require__(92);
|
7395 | var isCallable = __webpack_require__(9);
|
7396 | var isObject = __webpack_require__(11);
|
7397 | var isSymbol = __webpack_require__(100);
|
7398 | var arraySlice = __webpack_require__(112);
|
7399 | var NATIVE_SYMBOL = __webpack_require__(65);
|
7400 |
|
7401 | var $stringify = getBuiltIn('JSON', 'stringify');
|
7402 | var exec = uncurryThis(/./.exec);
|
7403 | var charAt = uncurryThis(''.charAt);
|
7404 | var charCodeAt = uncurryThis(''.charCodeAt);
|
7405 | var replace = uncurryThis(''.replace);
|
7406 | var numberToString = uncurryThis(1.0.toString);
|
7407 |
|
7408 | var tester = /[\uD800-\uDFFF]/g;
|
7409 | var low = /^[\uD800-\uDBFF]$/;
|
7410 | var hi = /^[\uDC00-\uDFFF]$/;
|
7411 |
|
7412 | var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
|
7413 | var symbol = getBuiltIn('Symbol')();
|
7414 |
|
7415 | return $stringify([symbol]) != '[null]'
|
7416 |
|
7417 | || $stringify({ a: symbol }) != '{}'
|
7418 |
|
7419 | || $stringify(Object(symbol)) != '{}';
|
7420 | });
|
7421 |
|
7422 |
|
7423 | var ILL_FORMED_UNICODE = fails(function () {
|
7424 | return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|
7425 | || $stringify('\uDEAD') !== '"\\udead"';
|
7426 | });
|
7427 |
|
7428 | var stringifyWithSymbolsFix = function (it, replacer) {
|
7429 | var args = arraySlice(arguments);
|
7430 | var $replacer = replacer;
|
7431 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
7432 | if (!isArray(replacer)) replacer = function (key, value) {
|
7433 | if (isCallable($replacer)) value = call($replacer, this, key, value);
|
7434 | if (!isSymbol(value)) return value;
|
7435 | };
|
7436 | args[1] = replacer;
|
7437 | return apply($stringify, null, args);
|
7438 | };
|
7439 |
|
7440 | var fixIllFormed = function (match, offset, string) {
|
7441 | var prev = charAt(string, offset - 1);
|
7442 | var next = charAt(string, offset + 1);
|
7443 | if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
|
7444 | return '\\u' + numberToString(charCodeAt(match, 0), 16);
|
7445 | } return match;
|
7446 | };
|
7447 |
|
7448 | if ($stringify) {
|
7449 |
|
7450 |
|
7451 | $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
|
7452 |
|
7453 | stringify: function stringify(it, replacer, space) {
|
7454 | var args = arraySlice(arguments);
|
7455 | var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
|
7456 | return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
|
7457 | }
|
7458 | });
|
7459 | }
|
7460 |
|
7461 |
|
7462 | }),
|
7463 |
|
7464 | (function(module, exports, __webpack_require__) {
|
7465 |
|
7466 | var rng = __webpack_require__(416);
|
7467 | var bytesToUuid = __webpack_require__(417);
|
7468 |
|
7469 | function v4(options, buf, offset) {
|
7470 | var i = buf && offset || 0;
|
7471 |
|
7472 | if (typeof(options) == 'string') {
|
7473 | buf = options === 'binary' ? new Array(16) : null;
|
7474 | options = null;
|
7475 | }
|
7476 | options = options || {};
|
7477 |
|
7478 | var rnds = options.random || (options.rng || rng)();
|
7479 |
|
7480 |
|
7481 | rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
7482 | rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
7483 |
|
7484 |
|
7485 | if (buf) {
|
7486 | for (var ii = 0; ii < 16; ++ii) {
|
7487 | buf[i + ii] = rnds[ii];
|
7488 | }
|
7489 | }
|
7490 |
|
7491 | return buf || bytesToUuid(rnds);
|
7492 | }
|
7493 |
|
7494 | module.exports = v4;
|
7495 |
|
7496 |
|
7497 | }),
|
7498 |
|
7499 | (function(module, exports, __webpack_require__) {
|
7500 |
|
7501 | module.exports = __webpack_require__(233);
|
7502 |
|
7503 | }),
|
7504 |
|
7505 | (function(module, exports, __webpack_require__) {
|
7506 |
|
7507 | var parent = __webpack_require__(420);
|
7508 |
|
7509 | module.exports = parent;
|
7510 |
|
7511 |
|
7512 | }),
|
7513 |
|
7514 | (function(module, exports, __webpack_require__) {
|
7515 |
|
7516 | "use strict";
|
7517 |
|
7518 |
|
7519 | module.exports = '4.15.2';
|
7520 |
|
7521 | }),
|
7522 |
|
7523 | (function(module, exports, __webpack_require__) {
|
7524 |
|
7525 | "use strict";
|
7526 |
|
7527 |
|
7528 | var has = Object.prototype.hasOwnProperty
|
7529 | , prefix = '~';
|
7530 |
|
7531 |
|
7532 |
|
7533 |
|
7534 |
|
7535 |
|
7536 |
|
7537 |
|
7538 | function Events() {}
|
7539 |
|
7540 |
|
7541 |
|
7542 |
|
7543 |
|
7544 |
|
7545 |
|
7546 |
|
7547 | if (Object.create) {
|
7548 | Events.prototype = Object.create(null);
|
7549 |
|
7550 |
|
7551 |
|
7552 |
|
7553 |
|
7554 | if (!new Events().__proto__) prefix = false;
|
7555 | }
|
7556 |
|
7557 |
|
7558 |
|
7559 |
|
7560 |
|
7561 |
|
7562 |
|
7563 |
|
7564 |
|
7565 |
|
7566 | function EE(fn, context, once) {
|
7567 | this.fn = fn;
|
7568 | this.context = context;
|
7569 | this.once = once || false;
|
7570 | }
|
7571 |
|
7572 |
|
7573 |
|
7574 |
|
7575 |
|
7576 |
|
7577 |
|
7578 |
|
7579 | function EventEmitter() {
|
7580 | this._events = new Events();
|
7581 | this._eventsCount = 0;
|
7582 | }
|
7583 |
|
7584 |
|
7585 |
|
7586 |
|
7587 |
|
7588 |
|
7589 |
|
7590 |
|
7591 | EventEmitter.prototype.eventNames = function eventNames() {
|
7592 | var names = []
|
7593 | , events
|
7594 | , name;
|
7595 |
|
7596 | if (this._eventsCount === 0) return names;
|
7597 |
|
7598 | for (name in (events = this._events)) {
|
7599 | if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
7600 | }
|
7601 |
|
7602 | if (Object.getOwnPropertySymbols) {
|
7603 | return names.concat(Object.getOwnPropertySymbols(events));
|
7604 | }
|
7605 |
|
7606 | return names;
|
7607 | };
|
7608 |
|
7609 |
|
7610 |
|
7611 |
|
7612 |
|
7613 |
|
7614 |
|
7615 |
|
7616 |
|
7617 | EventEmitter.prototype.listeners = function listeners(event, exists) {
|
7618 | var evt = prefix ? prefix + event : event
|
7619 | , available = this._events[evt];
|
7620 |
|
7621 | if (exists) return !!available;
|
7622 | if (!available) return [];
|
7623 | if (available.fn) return [available.fn];
|
7624 |
|
7625 | for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
|
7626 | ee[i] = available[i].fn;
|
7627 | }
|
7628 |
|
7629 | return ee;
|
7630 | };
|
7631 |
|
7632 |
|
7633 |
|
7634 |
|
7635 |
|
7636 |
|
7637 |
|
7638 |
|
7639 | EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
7640 | var evt = prefix ? prefix + event : event;
|
7641 |
|
7642 | if (!this._events[evt]) return false;
|
7643 |
|
7644 | var listeners = this._events[evt]
|
7645 | , len = arguments.length
|
7646 | , args
|
7647 | , i;
|
7648 |
|
7649 | if (listeners.fn) {
|
7650 | if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
7651 |
|
7652 | switch (len) {
|
7653 | case 1: return listeners.fn.call(listeners.context), true;
|
7654 | case 2: return listeners.fn.call(listeners.context, a1), true;
|
7655 | case 3: return listeners.fn.call(listeners.context, a1, a2), true;
|
7656 | case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
7657 | case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
7658 | case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
7659 | }
|
7660 |
|
7661 | for (i = 1, args = new Array(len -1); i < len; i++) {
|
7662 | args[i - 1] = arguments[i];
|
7663 | }
|
7664 |
|
7665 | listeners.fn.apply(listeners.context, args);
|
7666 | } else {
|
7667 | var length = listeners.length
|
7668 | , j;
|
7669 |
|
7670 | for (i = 0; i < length; i++) {
|
7671 | if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
7672 |
|
7673 | switch (len) {
|
7674 | case 1: listeners[i].fn.call(listeners[i].context); break;
|
7675 | case 2: listeners[i].fn.call(listeners[i].context, a1); break;
|
7676 | case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
|
7677 | case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
|
7678 | default:
|
7679 | if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
|
7680 | args[j - 1] = arguments[j];
|
7681 | }
|
7682 |
|
7683 | listeners[i].fn.apply(listeners[i].context, args);
|
7684 | }
|
7685 | }
|
7686 | }
|
7687 |
|
7688 | return true;
|
7689 | };
|
7690 |
|
7691 |
|
7692 |
|
7693 |
|
7694 |
|
7695 |
|
7696 |
|
7697 |
|
7698 |
|
7699 |
|
7700 | EventEmitter.prototype.on = function on(event, fn, context) {
|
7701 | var listener = new EE(fn, context || this)
|
7702 | , evt = prefix ? prefix + event : event;
|
7703 |
|
7704 | if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
|
7705 | else if (!this._events[evt].fn) this._events[evt].push(listener);
|
7706 | else this._events[evt] = [this._events[evt], listener];
|
7707 |
|
7708 | return this;
|
7709 | };
|
7710 |
|
7711 |
|
7712 |
|
7713 |
|
7714 |
|
7715 |
|
7716 |
|
7717 |
|
7718 |
|
7719 |
|
7720 | EventEmitter.prototype.once = function once(event, fn, context) {
|
7721 | var listener = new EE(fn, context || this, true)
|
7722 | , evt = prefix ? prefix + event : event;
|
7723 |
|
7724 | if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
|
7725 | else if (!this._events[evt].fn) this._events[evt].push(listener);
|
7726 | else this._events[evt] = [this._events[evt], listener];
|
7727 |
|
7728 | return this;
|
7729 | };
|
7730 |
|
7731 |
|
7732 |
|
7733 |
|
7734 |
|
7735 |
|
7736 |
|
7737 |
|
7738 |
|
7739 |
|
7740 |
|
7741 | EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
7742 | var evt = prefix ? prefix + event : event;
|
7743 |
|
7744 | if (!this._events[evt]) return this;
|
7745 | if (!fn) {
|
7746 | if (--this._eventsCount === 0) this._events = new Events();
|
7747 | else delete this._events[evt];
|
7748 | return this;
|
7749 | }
|
7750 |
|
7751 | var listeners = this._events[evt];
|
7752 |
|
7753 | if (listeners.fn) {
|
7754 | if (
|
7755 | listeners.fn === fn
|
7756 | && (!once || listeners.once)
|
7757 | && (!context || listeners.context === context)
|
7758 | ) {
|
7759 | if (--this._eventsCount === 0) this._events = new Events();
|
7760 | else delete this._events[evt];
|
7761 | }
|
7762 | } else {
|
7763 | for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
7764 | if (
|
7765 | listeners[i].fn !== fn
|
7766 | || (once && !listeners[i].once)
|
7767 | || (context && listeners[i].context !== context)
|
7768 | ) {
|
7769 | events.push(listeners[i]);
|
7770 | }
|
7771 | }
|
7772 |
|
7773 |
|
7774 |
|
7775 |
|
7776 | if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
|
7777 | else if (--this._eventsCount === 0) this._events = new Events();
|
7778 | else delete this._events[evt];
|
7779 | }
|
7780 |
|
7781 | return this;
|
7782 | };
|
7783 |
|
7784 |
|
7785 |
|
7786 |
|
7787 |
|
7788 |
|
7789 |
|
7790 |
|
7791 | EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
7792 | var evt;
|
7793 |
|
7794 | if (event) {
|
7795 | evt = prefix ? prefix + event : event;
|
7796 | if (this._events[evt]) {
|
7797 | if (--this._eventsCount === 0) this._events = new Events();
|
7798 | else delete this._events[evt];
|
7799 | }
|
7800 | } else {
|
7801 | this._events = new Events();
|
7802 | this._eventsCount = 0;
|
7803 | }
|
7804 |
|
7805 | return this;
|
7806 | };
|
7807 |
|
7808 |
|
7809 |
|
7810 |
|
7811 | EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
7812 | EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
7813 |
|
7814 |
|
7815 |
|
7816 |
|
7817 | EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
|
7818 | return this;
|
7819 | };
|
7820 |
|
7821 |
|
7822 |
|
7823 |
|
7824 | EventEmitter.prefixed = prefix;
|
7825 |
|
7826 |
|
7827 |
|
7828 |
|
7829 | EventEmitter.EventEmitter = EventEmitter;
|
7830 |
|
7831 |
|
7832 |
|
7833 |
|
7834 | if (true) {
|
7835 | module.exports = EventEmitter;
|
7836 | }
|
7837 |
|
7838 |
|
7839 | }),
|
7840 |
|
7841 | (function(module, exports, __webpack_require__) {
|
7842 |
|
7843 | "use strict";
|
7844 |
|
7845 |
|
7846 | var _interopRequireDefault = __webpack_require__(1);
|
7847 |
|
7848 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
7849 |
|
7850 | var _require = __webpack_require__(76),
|
7851 | getAdapter = _require.getAdapter;
|
7852 |
|
7853 | var syncApiNames = ['getItem', 'setItem', 'removeItem', 'clear'];
|
7854 | var localStorage = {
|
7855 | get async() {
|
7856 | return getAdapter('storage').async;
|
7857 | }
|
7858 |
|
7859 | };
|
7860 |
|
7861 | syncApiNames.forEach(function (apiName) {
|
7862 | localStorage[apiName + 'Async'] = function () {
|
7863 | var storage = getAdapter('storage');
|
7864 | return _promise.default.resolve(storage[apiName].apply(storage, arguments));
|
7865 | };
|
7866 |
|
7867 | localStorage[apiName] = function () {
|
7868 | var storage = getAdapter('storage');
|
7869 |
|
7870 | if (!storage.async) {
|
7871 | return storage[apiName].apply(storage, arguments);
|
7872 | }
|
7873 |
|
7874 | var error = new Error('Synchronous API [' + apiName + '] is not available in this runtime.');
|
7875 | error.code = 'SYNC_API_NOT_AVAILABLE';
|
7876 | throw error;
|
7877 | };
|
7878 | });
|
7879 | module.exports = localStorage;
|
7880 |
|
7881 | }),
|
7882 |
|
7883 | (function(module, exports, __webpack_require__) {
|
7884 |
|
7885 | "use strict";
|
7886 |
|
7887 |
|
7888 | var _interopRequireDefault = __webpack_require__(1);
|
7889 |
|
7890 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
7891 |
|
7892 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
7893 |
|
7894 | var storage = __webpack_require__(236);
|
7895 |
|
7896 | var AV = __webpack_require__(74);
|
7897 |
|
7898 | var removeAsync = exports.removeAsync = storage.removeItemAsync.bind(storage);
|
7899 |
|
7900 | var getCacheData = function getCacheData(cacheData, key) {
|
7901 | try {
|
7902 | cacheData = JSON.parse(cacheData);
|
7903 | } catch (e) {
|
7904 | return null;
|
7905 | }
|
7906 |
|
7907 | if (cacheData) {
|
7908 | var expired = cacheData.expiredAt && cacheData.expiredAt < Date.now();
|
7909 |
|
7910 | if (!expired) {
|
7911 | return cacheData.value;
|
7912 | }
|
7913 |
|
7914 | return removeAsync(key).then(function () {
|
7915 | return null;
|
7916 | });
|
7917 | }
|
7918 |
|
7919 | return null;
|
7920 | };
|
7921 |
|
7922 | exports.getAsync = function (key) {
|
7923 | var _context;
|
7924 |
|
7925 | key = (0, _concat.default)(_context = "AV/".concat(AV.applicationId, "/")).call(_context, key);
|
7926 | return storage.getItemAsync(key).then(function (cache) {
|
7927 | return getCacheData(cache, key);
|
7928 | });
|
7929 | };
|
7930 |
|
7931 | exports.setAsync = function (key, value, ttl) {
|
7932 | var _context2;
|
7933 |
|
7934 | var cache = {
|
7935 | value: value
|
7936 | };
|
7937 |
|
7938 | if (typeof ttl === 'number') {
|
7939 | cache.expiredAt = Date.now() + ttl;
|
7940 | }
|
7941 |
|
7942 | return storage.setItemAsync((0, _concat.default)(_context2 = "AV/".concat(AV.applicationId, "/")).call(_context2, key), (0, _stringify.default)(cache));
|
7943 | };
|
7944 |
|
7945 | }),
|
7946 |
|
7947 | (function(module, exports, __webpack_require__) {
|
7948 |
|
7949 | var parent = __webpack_require__(423);
|
7950 |
|
7951 | module.exports = parent;
|
7952 |
|
7953 |
|
7954 | }),
|
7955 |
|
7956 | (function(module, exports, __webpack_require__) {
|
7957 |
|
7958 | var parent = __webpack_require__(426);
|
7959 |
|
7960 | module.exports = parent;
|
7961 |
|
7962 |
|
7963 | }),
|
7964 |
|
7965 | (function(module, exports, __webpack_require__) {
|
7966 |
|
7967 | var parent = __webpack_require__(429);
|
7968 |
|
7969 | module.exports = parent;
|
7970 |
|
7971 |
|
7972 | }),
|
7973 |
|
7974 | (function(module, exports, __webpack_require__) {
|
7975 |
|
7976 | module.exports = __webpack_require__(432);
|
7977 |
|
7978 | }),
|
7979 |
|
7980 | (function(module, exports, __webpack_require__) {
|
7981 |
|
7982 | var parent = __webpack_require__(435);
|
7983 | __webpack_require__(46);
|
7984 |
|
7985 | module.exports = parent;
|
7986 |
|
7987 |
|
7988 | }),
|
7989 |
|
7990 | (function(module, exports, __webpack_require__) {
|
7991 |
|
7992 |
|
7993 | __webpack_require__(436);
|
7994 | __webpack_require__(437);
|
7995 | __webpack_require__(438);
|
7996 | __webpack_require__(230);
|
7997 | __webpack_require__(439);
|
7998 |
|
7999 |
|
8000 | }),
|
8001 |
|
8002 | (function(module, exports, __webpack_require__) {
|
8003 |
|
8004 |
|
8005 | var classof = __webpack_require__(50);
|
8006 | var toIndexedObject = __webpack_require__(35);
|
8007 | var $getOwnPropertyNames = __webpack_require__(105).f;
|
8008 | var arraySlice = __webpack_require__(245);
|
8009 |
|
8010 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
8011 | ? Object.getOwnPropertyNames(window) : [];
|
8012 |
|
8013 | var getWindowNames = function (it) {
|
8014 | try {
|
8015 | return $getOwnPropertyNames(it);
|
8016 | } catch (error) {
|
8017 | return arraySlice(windowNames);
|
8018 | }
|
8019 | };
|
8020 |
|
8021 |
|
8022 | module.exports.f = function getOwnPropertyNames(it) {
|
8023 | return windowNames && classof(it) == 'Window'
|
8024 | ? getWindowNames(it)
|
8025 | : $getOwnPropertyNames(toIndexedObject(it));
|
8026 | };
|
8027 |
|
8028 |
|
8029 | }),
|
8030 |
|
8031 | (function(module, exports, __webpack_require__) {
|
8032 |
|
8033 | var toAbsoluteIndex = __webpack_require__(127);
|
8034 | var lengthOfArrayLike = __webpack_require__(40);
|
8035 | var createProperty = __webpack_require__(93);
|
8036 |
|
8037 | var $Array = Array;
|
8038 | var max = Math.max;
|
8039 |
|
8040 | module.exports = function (O, start, end) {
|
8041 | var length = lengthOfArrayLike(O);
|
8042 | var k = toAbsoluteIndex(start, length);
|
8043 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
8044 | var result = $Array(max(fin - k, 0));
|
8045 | for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
|
8046 | result.length = n;
|
8047 | return result;
|
8048 | };
|
8049 |
|
8050 |
|
8051 | }),
|
8052 |
|
8053 | (function(module, exports, __webpack_require__) {
|
8054 |
|
8055 | var call = __webpack_require__(15);
|
8056 | var getBuiltIn = __webpack_require__(20);
|
8057 | var wellKnownSymbol = __webpack_require__(5);
|
8058 | var defineBuiltIn = __webpack_require__(45);
|
8059 |
|
8060 | module.exports = function () {
|
8061 | var Symbol = getBuiltIn('Symbol');
|
8062 | var SymbolPrototype = Symbol && Symbol.prototype;
|
8063 | var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
|
8064 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
8065 |
|
8066 | if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
|
8067 |
|
8068 |
|
8069 |
|
8070 | defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
|
8071 | return call(valueOf, this);
|
8072 | }, { arity: 1 });
|
8073 | }
|
8074 | };
|
8075 |
|
8076 |
|
8077 | }),
|
8078 |
|
8079 | (function(module, exports, __webpack_require__) {
|
8080 |
|
8081 | var NATIVE_SYMBOL = __webpack_require__(65);
|
8082 |
|
8083 |
|
8084 | module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
|
8085 |
|
8086 |
|
8087 | }),
|
8088 |
|
8089 | (function(module, exports, __webpack_require__) {
|
8090 |
|
8091 | var defineWellKnownSymbol = __webpack_require__(10);
|
8092 |
|
8093 |
|
8094 |
|
8095 | defineWellKnownSymbol('iterator');
|
8096 |
|
8097 |
|
8098 | }),
|
8099 |
|
8100 | (function(module, exports, __webpack_require__) {
|
8101 |
|
8102 | var parent = __webpack_require__(468);
|
8103 | __webpack_require__(46);
|
8104 |
|
8105 | module.exports = parent;
|
8106 |
|
8107 |
|
8108 | }),
|
8109 |
|
8110 | (function(module, exports, __webpack_require__) {
|
8111 |
|
8112 | module.exports = __webpack_require__(469);
|
8113 |
|
8114 | }),
|
8115 |
|
8116 | (function(module, exports, __webpack_require__) {
|
8117 |
|
8118 | "use strict";
|
8119 |
|
8120 |
|
8121 |
|
8122 |
|
8123 |
|
8124 |
|
8125 |
|
8126 | var TimeoutError;
|
8127 |
|
8128 |
|
8129 |
|
8130 |
|
8131 |
|
8132 |
|
8133 |
|
8134 |
|
8135 |
|
8136 |
|
8137 | var timeout = module.exports.timeout = function(promise, timeoutMillis) {
|
8138 | var error = new TimeoutError(),
|
8139 | timeout;
|
8140 |
|
8141 | return Promise.race([
|
8142 | promise,
|
8143 | new Promise(function(resolve, reject) {
|
8144 | timeout = setTimeout(function() {
|
8145 | reject(error);
|
8146 | }, timeoutMillis);
|
8147 | }),
|
8148 | ]).then(function(v) {
|
8149 | clearTimeout(timeout);
|
8150 | return v;
|
8151 | }, function(err) {
|
8152 | clearTimeout(timeout);
|
8153 | throw err;
|
8154 | });
|
8155 | };
|
8156 |
|
8157 |
|
8158 |
|
8159 |
|
8160 | TimeoutError = module.exports.TimeoutError = function() {
|
8161 | Error.call(this)
|
8162 | this.stack = Error().stack
|
8163 | this.message = 'Timeout';
|
8164 | };
|
8165 |
|
8166 | TimeoutError.prototype = Object.create(Error.prototype);
|
8167 | TimeoutError.prototype.name = "TimeoutError";
|
8168 |
|
8169 |
|
8170 | }),
|
8171 |
|
8172 | (function(module, exports, __webpack_require__) {
|
8173 |
|
8174 | var parent = __webpack_require__(485);
|
8175 |
|
8176 | module.exports = parent;
|
8177 |
|
8178 |
|
8179 | }),
|
8180 |
|
8181 | (function(module, exports, __webpack_require__) {
|
8182 |
|
8183 | module.exports = __webpack_require__(489);
|
8184 |
|
8185 | }),
|
8186 |
|
8187 | (function(module, exports, __webpack_require__) {
|
8188 |
|
8189 | "use strict";
|
8190 |
|
8191 | var uncurryThis = __webpack_require__(4);
|
8192 | var aCallable = __webpack_require__(29);
|
8193 | var isObject = __webpack_require__(11);
|
8194 | var hasOwn = __webpack_require__(13);
|
8195 | var arraySlice = __webpack_require__(112);
|
8196 | var NATIVE_BIND = __webpack_require__(80);
|
8197 |
|
8198 | var $Function = Function;
|
8199 | var concat = uncurryThis([].concat);
|
8200 | var join = uncurryThis([].join);
|
8201 | var factories = {};
|
8202 |
|
8203 | var construct = function (C, argsLength, args) {
|
8204 | if (!hasOwn(factories, argsLength)) {
|
8205 | for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
8206 | factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
|
8207 | } return factories[argsLength](C, args);
|
8208 | };
|
8209 |
|
8210 |
|
8211 |
|
8212 | module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
|
8213 | var F = aCallable(this);
|
8214 | var Prototype = F.prototype;
|
8215 | var partArgs = arraySlice(arguments, 1);
|
8216 | var boundFunction = function bound(/* args... */) {
|
8217 | var args = concat(partArgs, arraySlice(arguments));
|
8218 | return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
|
8219 | };
|
8220 | if (isObject(Prototype)) boundFunction.prototype = Prototype;
|
8221 | return boundFunction;
|
8222 | };
|
8223 |
|
8224 |
|
8225 | }),
|
8226 |
|
8227 | (function(module, exports, __webpack_require__) {
|
8228 |
|
8229 | module.exports = __webpack_require__(510);
|
8230 |
|
8231 | }),
|
8232 |
|
8233 | (function(module, exports, __webpack_require__) {
|
8234 |
|
8235 | module.exports = __webpack_require__(513);
|
8236 |
|
8237 | }),
|
8238 |
|
8239 | (function(module, exports) {
|
8240 |
|
8241 | var charenc = {
|
8242 |
|
8243 | utf8: {
|
8244 |
|
8245 | stringToBytes: function(str) {
|
8246 | return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
|
8247 | },
|
8248 |
|
8249 |
|
8250 | bytesToString: function(bytes) {
|
8251 | return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
|
8252 | }
|
8253 | },
|
8254 |
|
8255 |
|
8256 | bin: {
|
8257 |
|
8258 | stringToBytes: function(str) {
|
8259 | for (var bytes = [], i = 0; i < str.length; i++)
|
8260 | bytes.push(str.charCodeAt(i) & 0xFF);
|
8261 | return bytes;
|
8262 | },
|
8263 |
|
8264 |
|
8265 | bytesToString: function(bytes) {
|
8266 | for (var str = [], i = 0; i < bytes.length; i++)
|
8267 | str.push(String.fromCharCode(bytes[i]));
|
8268 | return str.join('');
|
8269 | }
|
8270 | }
|
8271 | };
|
8272 |
|
8273 | module.exports = charenc;
|
8274 |
|
8275 |
|
8276 | }),
|
8277 |
|
8278 | (function(module, exports, __webpack_require__) {
|
8279 |
|
8280 | module.exports = __webpack_require__(557);
|
8281 |
|
8282 | }),
|
8283 |
|
8284 | (function(module, exports, __webpack_require__) {
|
8285 |
|
8286 | "use strict";
|
8287 |
|
8288 |
|
8289 | var adapters = __webpack_require__(574);
|
8290 |
|
8291 | module.exports = function (AV) {
|
8292 | AV.setAdapters(adapters);
|
8293 | return AV;
|
8294 | };
|
8295 |
|
8296 | }),
|
8297 |
|
8298 | (function(module, exports) {
|
8299 |
|
8300 |
|
8301 | module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
8302 | '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
8303 |
|
8304 |
|
8305 | }),
|
8306 |
|
8307 | (function(module, exports, __webpack_require__) {
|
8308 |
|
8309 | "use strict";
|
8310 |
|
8311 |
|
8312 | var _interopRequireDefault = __webpack_require__(1);
|
8313 |
|
8314 | var _symbol = _interopRequireDefault(__webpack_require__(77));
|
8315 |
|
8316 | var _iterator = _interopRequireDefault(__webpack_require__(155));
|
8317 |
|
8318 | function _typeof(obj) {
|
8319 | "@babel/helpers - typeof";
|
8320 |
|
8321 | if (typeof _symbol.default === "function" && typeof _iterator.default === "symbol") {
|
8322 | _typeof = function _typeof(obj) {
|
8323 | return typeof obj;
|
8324 | };
|
8325 | } else {
|
8326 | _typeof = function _typeof(obj) {
|
8327 | return obj && typeof _symbol.default === "function" && obj.constructor === _symbol.default && obj !== _symbol.default.prototype ? "symbol" : typeof obj;
|
8328 | };
|
8329 | }
|
8330 |
|
8331 | return _typeof(obj);
|
8332 | }
|
8333 |
|
8334 |
|
8335 |
|
8336 |
|
8337 |
|
8338 |
|
8339 |
|
8340 |
|
8341 |
|
8342 | function isObject(obj) {
|
8343 | return obj !== null && _typeof(obj) === 'object';
|
8344 | }
|
8345 |
|
8346 | module.exports = isObject;
|
8347 |
|
8348 | }),
|
8349 |
|
8350 | (function(module, exports, __webpack_require__) {
|
8351 |
|
8352 | module.exports = __webpack_require__(610);
|
8353 |
|
8354 | }),
|
8355 |
|
8356 | (function(module, exports, __webpack_require__) {
|
8357 |
|
8358 | module.exports = __webpack_require__(616);
|
8359 |
|
8360 | }),
|
8361 |
|
8362 | (function(module, exports, __webpack_require__) {
|
8363 |
|
8364 | var fails = __webpack_require__(2);
|
8365 |
|
8366 | module.exports = !fails(function () {
|
8367 |
|
8368 | return Object.isExtensible(Object.preventExtensions({}));
|
8369 | });
|
8370 |
|
8371 |
|
8372 | }),
|
8373 |
|
8374 | (function(module, exports, __webpack_require__) {
|
8375 |
|
8376 | var fails = __webpack_require__(2);
|
8377 | var isObject = __webpack_require__(11);
|
8378 | var classof = __webpack_require__(50);
|
8379 | var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(628);
|
8380 |
|
8381 |
|
8382 | var $isExtensible = Object.isExtensible;
|
8383 | var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
|
8384 |
|
8385 |
|
8386 |
|
8387 | module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
|
8388 | if (!isObject(it)) return false;
|
8389 | if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;
|
8390 | return $isExtensible ? $isExtensible(it) : true;
|
8391 | } : $isExtensible;
|
8392 |
|
8393 |
|
8394 | }),
|
8395 |
|
8396 | (function(module, exports, __webpack_require__) {
|
8397 |
|
8398 | module.exports = __webpack_require__(629);
|
8399 |
|
8400 | }),
|
8401 |
|
8402 | (function(module, exports, __webpack_require__) {
|
8403 |
|
8404 | module.exports = __webpack_require__(633);
|
8405 |
|
8406 | }),
|
8407 |
|
8408 | (function(module, exports, __webpack_require__) {
|
8409 |
|
8410 | "use strict";
|
8411 |
|
8412 | var $ = __webpack_require__(0);
|
8413 | var global = __webpack_require__(8);
|
8414 | var InternalMetadataModule = __webpack_require__(97);
|
8415 | var fails = __webpack_require__(2);
|
8416 | var createNonEnumerableProperty = __webpack_require__(39);
|
8417 | var iterate = __webpack_require__(41);
|
8418 | var anInstance = __webpack_require__(110);
|
8419 | var isCallable = __webpack_require__(9);
|
8420 | var isObject = __webpack_require__(11);
|
8421 | var setToStringTag = __webpack_require__(56);
|
8422 | var defineProperty = __webpack_require__(23).f;
|
8423 | var forEach = __webpack_require__(75).forEach;
|
8424 | var DESCRIPTORS = __webpack_require__(14);
|
8425 | var InternalStateModule = __webpack_require__(44);
|
8426 |
|
8427 | var setInternalState = InternalStateModule.set;
|
8428 | var internalStateGetterFor = InternalStateModule.getterFor;
|
8429 |
|
8430 | module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
|
8431 | var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
8432 | var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
8433 | var ADDER = IS_MAP ? 'set' : 'add';
|
8434 | var NativeConstructor = global[CONSTRUCTOR_NAME];
|
8435 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
8436 | var exported = {};
|
8437 | var Constructor;
|
8438 |
|
8439 | if (!DESCRIPTORS || !isCallable(NativeConstructor)
|
8440 | || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))
|
8441 | ) {
|
8442 |
|
8443 | Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
8444 | InternalMetadataModule.enable();
|
8445 | } else {
|
8446 | Constructor = wrapper(function (target, iterable) {
|
8447 | setInternalState(anInstance(target, Prototype), {
|
8448 | type: CONSTRUCTOR_NAME,
|
8449 | collection: new NativeConstructor()
|
8450 | });
|
8451 | if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
|
8452 | });
|
8453 |
|
8454 | var Prototype = Constructor.prototype;
|
8455 |
|
8456 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
8457 |
|
8458 | forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
|
8459 | var IS_ADDER = KEY == 'add' || KEY == 'set';
|
8460 | if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
|
8461 | createNonEnumerableProperty(Prototype, KEY, function (a, b) {
|
8462 | var collection = getInternalState(this).collection;
|
8463 | if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
|
8464 | var result = collection[KEY](a === 0 ? 0 : a, b);
|
8465 | return IS_ADDER ? this : result;
|
8466 | });
|
8467 | }
|
8468 | });
|
8469 |
|
8470 | IS_WEAK || defineProperty(Prototype, 'size', {
|
8471 | configurable: true,
|
8472 | get: function () {
|
8473 | return getInternalState(this).collection.size;
|
8474 | }
|
8475 | });
|
8476 | }
|
8477 |
|
8478 | setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
|
8479 |
|
8480 | exported[CONSTRUCTOR_NAME] = Constructor;
|
8481 | $({ global: true, forced: true }, exported);
|
8482 |
|
8483 | if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
8484 |
|
8485 | return Constructor;
|
8486 | };
|
8487 |
|
8488 |
|
8489 | }),
|
8490 |
|
8491 | (function(module, exports, __webpack_require__) {
|
8492 |
|
8493 | module.exports = __webpack_require__(649);
|
8494 |
|
8495 | }),
|
8496 |
|
8497 | (function(module, exports) {
|
8498 |
|
8499 | function _arrayLikeToArray(arr, len) {
|
8500 | if (len == null || len > arr.length) len = arr.length;
|
8501 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
8502 | return arr2;
|
8503 | }
|
8504 | module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
8505 |
|
8506 | }),
|
8507 |
|
8508 | (function(module, exports) {
|
8509 |
|
8510 | function _iterableToArray(iter) {
|
8511 | if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
8512 | }
|
8513 | module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
8514 |
|
8515 | }),
|
8516 |
|
8517 | (function(module, exports, __webpack_require__) {
|
8518 |
|
8519 | var arrayLikeToArray = __webpack_require__(270);
|
8520 | function _unsupportedIterableToArray(o, minLen) {
|
8521 | if (!o) return;
|
8522 | if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
8523 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
8524 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
8525 | if (n === "Map" || n === "Set") return Array.from(o);
|
8526 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
8527 | }
|
8528 | module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
8529 |
|
8530 | }),
|
8531 |
|
8532 | (function(module, exports, __webpack_require__) {
|
8533 |
|
8534 | var _typeof = __webpack_require__(119)["default"];
|
8535 | var toPrimitive = __webpack_require__(664);
|
8536 | function _toPropertyKey(arg) {
|
8537 | var key = toPrimitive(arg, "string");
|
8538 | return _typeof(key) === "symbol" ? key : String(key);
|
8539 | }
|
8540 | module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
8541 |
|
8542 | }),
|
8543 |
|
8544 | (function(module, exports, __webpack_require__) {
|
8545 |
|
8546 | var baseRandom = __webpack_require__(675);
|
8547 |
|
8548 |
|
8549 |
|
8550 |
|
8551 |
|
8552 |
|
8553 |
|
8554 |
|
8555 |
|
8556 | function shuffleSelf(array, size) {
|
8557 | var index = -1,
|
8558 | length = array.length,
|
8559 | lastIndex = length - 1;
|
8560 |
|
8561 | size = size === undefined ? length : size;
|
8562 | while (++index < size) {
|
8563 | var rand = baseRandom(index, lastIndex),
|
8564 | value = array[rand];
|
8565 |
|
8566 | array[rand] = array[index];
|
8567 | array[index] = value;
|
8568 | }
|
8569 | array.length = size;
|
8570 | return array;
|
8571 | }
|
8572 |
|
8573 | module.exports = shuffleSelf;
|
8574 |
|
8575 |
|
8576 | }),
|
8577 |
|
8578 | (function(module, exports, __webpack_require__) {
|
8579 |
|
8580 | var baseValues = __webpack_require__(677),
|
8581 | keys = __webpack_require__(679);
|
8582 |
|
8583 |
|
8584 |
|
8585 |
|
8586 |
|
8587 |
|
8588 |
|
8589 |
|
8590 |
|
8591 |
|
8592 |
|
8593 |
|
8594 |
|
8595 |
|
8596 |
|
8597 |
|
8598 |
|
8599 |
|
8600 |
|
8601 |
|
8602 |
|
8603 |
|
8604 |
|
8605 |
|
8606 |
|
8607 |
|
8608 |
|
8609 | function values(object) {
|
8610 | return object == null ? [] : baseValues(object, keys(object));
|
8611 | }
|
8612 |
|
8613 | module.exports = values;
|
8614 |
|
8615 |
|
8616 | }),
|
8617 |
|
8618 | (function(module, exports, __webpack_require__) {
|
8619 |
|
8620 | var root = __webpack_require__(277);
|
8621 |
|
8622 |
|
8623 | var Symbol = root.Symbol;
|
8624 |
|
8625 | module.exports = Symbol;
|
8626 |
|
8627 |
|
8628 | }),
|
8629 |
|
8630 | (function(module, exports, __webpack_require__) {
|
8631 |
|
8632 | var freeGlobal = __webpack_require__(278);
|
8633 |
|
8634 |
|
8635 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
8636 |
|
8637 |
|
8638 | var root = freeGlobal || freeSelf || Function('return this')();
|
8639 |
|
8640 | module.exports = root;
|
8641 |
|
8642 |
|
8643 | }),
|
8644 |
|
8645 | (function(module, exports, __webpack_require__) {
|
8646 |
|
8647 | (function(global) {
|
8648 | var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
8649 |
|
8650 | module.exports = freeGlobal;
|
8651 |
|
8652 | }.call(exports, __webpack_require__(78)))
|
8653 |
|
8654 | }),
|
8655 |
|
8656 | (function(module, exports) {
|
8657 |
|
8658 |
|
8659 |
|
8660 |
|
8661 |
|
8662 |
|
8663 |
|
8664 |
|
8665 |
|
8666 |
|
8667 |
|
8668 |
|
8669 |
|
8670 |
|
8671 |
|
8672 |
|
8673 |
|
8674 |
|
8675 |
|
8676 |
|
8677 |
|
8678 |
|
8679 |
|
8680 |
|
8681 | var isArray = Array.isArray;
|
8682 |
|
8683 | module.exports = isArray;
|
8684 |
|
8685 |
|
8686 | }),
|
8687 |
|
8688 | (function(module, exports) {
|
8689 |
|
8690 | module.exports = function(module) {
|
8691 | if(!module.webpackPolyfill) {
|
8692 | module.deprecate = function() {};
|
8693 | module.paths = [];
|
8694 |
|
8695 | if(!module.children) module.children = [];
|
8696 | Object.defineProperty(module, "loaded", {
|
8697 | enumerable: true,
|
8698 | get: function() {
|
8699 | return module.l;
|
8700 | }
|
8701 | });
|
8702 | Object.defineProperty(module, "id", {
|
8703 | enumerable: true,
|
8704 | get: function() {
|
8705 | return module.i;
|
8706 | }
|
8707 | });
|
8708 | module.webpackPolyfill = 1;
|
8709 | }
|
8710 | return module;
|
8711 | };
|
8712 |
|
8713 |
|
8714 | }),
|
8715 |
|
8716 | (function(module, exports) {
|
8717 |
|
8718 |
|
8719 | var MAX_SAFE_INTEGER = 9007199254740991;
|
8720 |
|
8721 |
|
8722 |
|
8723 |
|
8724 |
|
8725 |
|
8726 |
|
8727 |
|
8728 |
|
8729 |
|
8730 |
|
8731 |
|
8732 |
|
8733 |
|
8734 |
|
8735 |
|
8736 |
|
8737 |
|
8738 |
|
8739 |
|
8740 |
|
8741 |
|
8742 |
|
8743 |
|
8744 |
|
8745 |
|
8746 |
|
8747 | function isLength(value) {
|
8748 | return typeof value == 'number' &&
|
8749 | value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
8750 | }
|
8751 |
|
8752 | module.exports = isLength;
|
8753 |
|
8754 |
|
8755 | }),
|
8756 |
|
8757 | (function(module, exports) {
|
8758 |
|
8759 |
|
8760 |
|
8761 |
|
8762 |
|
8763 |
|
8764 |
|
8765 |
|
8766 |
|
8767 | function overArg(func, transform) {
|
8768 | return function(arg) {
|
8769 | return func(transform(arg));
|
8770 | };
|
8771 | }
|
8772 |
|
8773 | module.exports = overArg;
|
8774 |
|
8775 |
|
8776 | }),
|
8777 |
|
8778 | (function(module, exports, __webpack_require__) {
|
8779 |
|
8780 | "use strict";
|
8781 |
|
8782 |
|
8783 | var AV = __webpack_require__(284);
|
8784 |
|
8785 | var useLiveQuery = __webpack_require__(622);
|
8786 |
|
8787 | var useAdatpers = __webpack_require__(259);
|
8788 |
|
8789 | module.exports = useAdatpers(useLiveQuery(AV));
|
8790 |
|
8791 | }),
|
8792 |
|
8793 | (function(module, exports, __webpack_require__) {
|
8794 |
|
8795 | "use strict";
|
8796 |
|
8797 |
|
8798 | var AV = __webpack_require__(285);
|
8799 |
|
8800 | var useAdatpers = __webpack_require__(259);
|
8801 |
|
8802 | module.exports = useAdatpers(AV);
|
8803 |
|
8804 | }),
|
8805 |
|
8806 | (function(module, exports, __webpack_require__) {
|
8807 |
|
8808 | "use strict";
|
8809 |
|
8810 |
|
8811 | module.exports = __webpack_require__(286);
|
8812 |
|
8813 | }),
|
8814 |
|
8815 | (function(module, exports, __webpack_require__) {
|
8816 |
|
8817 | "use strict";
|
8818 |
|
8819 |
|
8820 | var _interopRequireDefault = __webpack_require__(1);
|
8821 |
|
8822 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
8823 |
|
8824 |
|
8825 |
|
8826 |
|
8827 |
|
8828 |
|
8829 |
|
8830 |
|
8831 | var _ = __webpack_require__(3);
|
8832 |
|
8833 | var AV = __webpack_require__(74);
|
8834 |
|
8835 | AV._ = _;
|
8836 | AV.version = __webpack_require__(234);
|
8837 | AV.Promise = _promise.default;
|
8838 | AV.localStorage = __webpack_require__(236);
|
8839 | AV.Cache = __webpack_require__(237);
|
8840 | AV.Error = __webpack_require__(48);
|
8841 |
|
8842 | __webpack_require__(425);
|
8843 |
|
8844 | __webpack_require__(473)(AV);
|
8845 |
|
8846 | __webpack_require__(474)(AV);
|
8847 |
|
8848 | __webpack_require__(475)(AV);
|
8849 |
|
8850 | __webpack_require__(476)(AV);
|
8851 |
|
8852 | __webpack_require__(481)(AV);
|
8853 |
|
8854 | __webpack_require__(482)(AV);
|
8855 |
|
8856 | __webpack_require__(535)(AV);
|
8857 |
|
8858 | __webpack_require__(560)(AV);
|
8859 |
|
8860 | __webpack_require__(561)(AV);
|
8861 |
|
8862 | __webpack_require__(563)(AV);
|
8863 |
|
8864 | __webpack_require__(564)(AV);
|
8865 |
|
8866 | __webpack_require__(565)(AV);
|
8867 |
|
8868 | __webpack_require__(566)(AV);
|
8869 |
|
8870 | __webpack_require__(567)(AV);
|
8871 |
|
8872 | __webpack_require__(568)(AV);
|
8873 |
|
8874 | __webpack_require__(569)(AV);
|
8875 |
|
8876 | __webpack_require__(570)(AV);
|
8877 |
|
8878 | __webpack_require__(571)(AV);
|
8879 |
|
8880 | AV.Conversation = __webpack_require__(572);
|
8881 |
|
8882 | __webpack_require__(573);
|
8883 |
|
8884 | module.exports = AV;
|
8885 |
|
8886 |
|
8887 |
|
8888 |
|
8889 |
|
8890 |
|
8891 |
|
8892 |
|
8893 |
|
8894 |
|
8895 |
|
8896 |
|
8897 |
|
8898 |
|
8899 |
|
8900 |
|
8901 |
|
8902 | }),
|
8903 |
|
8904 | (function(module, exports, __webpack_require__) {
|
8905 |
|
8906 | var parent = __webpack_require__(288);
|
8907 | __webpack_require__(46);
|
8908 |
|
8909 | module.exports = parent;
|
8910 |
|
8911 |
|
8912 | }),
|
8913 |
|
8914 | (function(module, exports, __webpack_require__) {
|
8915 |
|
8916 | __webpack_require__(289);
|
8917 | __webpack_require__(43);
|
8918 | __webpack_require__(68);
|
8919 | __webpack_require__(304);
|
8920 | __webpack_require__(318);
|
8921 | __webpack_require__(319);
|
8922 | __webpack_require__(320);
|
8923 | __webpack_require__(70);
|
8924 | var path = __webpack_require__(7);
|
8925 |
|
8926 | module.exports = path.Promise;
|
8927 |
|
8928 |
|
8929 | }),
|
8930 |
|
8931 | (function(module, exports, __webpack_require__) {
|
8932 |
|
8933 |
|
8934 | __webpack_require__(290);
|
8935 |
|
8936 |
|
8937 | }),
|
8938 |
|
8939 | (function(module, exports, __webpack_require__) {
|
8940 |
|
8941 | "use strict";
|
8942 |
|
8943 | var $ = __webpack_require__(0);
|
8944 | var isPrototypeOf = __webpack_require__(16);
|
8945 | var getPrototypeOf = __webpack_require__(102);
|
8946 | var setPrototypeOf = __webpack_require__(104);
|
8947 | var copyConstructorProperties = __webpack_require__(295);
|
8948 | var create = __webpack_require__(53);
|
8949 | var createNonEnumerableProperty = __webpack_require__(39);
|
8950 | var createPropertyDescriptor = __webpack_require__(49);
|
8951 | var clearErrorStack = __webpack_require__(298);
|
8952 | var installErrorCause = __webpack_require__(299);
|
8953 | var iterate = __webpack_require__(41);
|
8954 | var normalizeStringArgument = __webpack_require__(300);
|
8955 | var wellKnownSymbol = __webpack_require__(5);
|
8956 | var ERROR_STACK_INSTALLABLE = __webpack_require__(301);
|
8957 |
|
8958 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
8959 | var $Error = Error;
|
8960 | var push = [].push;
|
8961 |
|
8962 | var $AggregateError = function AggregateError(errors, message /* , options */) {
|
8963 | var options = arguments.length > 2 ? arguments[2] : undefined;
|
8964 | var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
|
8965 | var that;
|
8966 | if (setPrototypeOf) {
|
8967 | that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
|
8968 | } else {
|
8969 | that = isInstance ? this : create(AggregateErrorPrototype);
|
8970 | createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
|
8971 | }
|
8972 | if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
|
8973 | if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
|
8974 | installErrorCause(that, options);
|
8975 | var errorsArray = [];
|
8976 | iterate(errors, push, { that: errorsArray });
|
8977 | createNonEnumerableProperty(that, 'errors', errorsArray);
|
8978 | return that;
|
8979 | };
|
8980 |
|
8981 | if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
|
8982 | else copyConstructorProperties($AggregateError, $Error, { name: true });
|
8983 |
|
8984 | var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
|
8985 | constructor: createPropertyDescriptor(1, $AggregateError),
|
8986 | message: createPropertyDescriptor(1, ''),
|
8987 | name: createPropertyDescriptor(1, 'AggregateError')
|
8988 | });
|
8989 |
|
8990 | // `AggregateError` constructor
|
8991 | // https://tc39.es/ecma262/#sec-aggregate-error-constructor
|
8992 | $({ global: true, constructor: true, arity: 2 }, {
|
8993 | AggregateError: $AggregateError
|
8994 | });
|
8995 |
|
8996 |
|
8997 | }),
|
8998 |
|
8999 | (function(module, exports, __webpack_require__) {
|
9000 |
|
9001 | var call = __webpack_require__(15);
|
9002 | var isObject = __webpack_require__(11);
|
9003 | var isSymbol = __webpack_require__(100);
|
9004 | var getMethod = __webpack_require__(123);
|
9005 | var ordinaryToPrimitive = __webpack_require__(292);
|
9006 | var wellKnownSymbol = __webpack_require__(5);
|
9007 |
|
9008 | var $TypeError = TypeError;
|
9009 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
9010 |
|
9011 |
|
9012 |
|
9013 | module.exports = function (input, pref) {
|
9014 | if (!isObject(input) || isSymbol(input)) return input;
|
9015 | var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
9016 | var result;
|
9017 | if (exoticToPrim) {
|
9018 | if (pref === undefined) pref = 'default';
|
9019 | result = call(exoticToPrim, input, pref);
|
9020 | if (!isObject(result) || isSymbol(result)) return result;
|
9021 | throw $TypeError("Can't convert object to primitive value");
|
9022 | }
|
9023 | if (pref === undefined) pref = 'number';
|
9024 | return ordinaryToPrimitive(input, pref);
|
9025 | };
|
9026 |
|
9027 |
|
9028 | }),
|
9029 |
|
9030 | (function(module, exports, __webpack_require__) {
|
9031 |
|
9032 | var call = __webpack_require__(15);
|
9033 | var isCallable = __webpack_require__(9);
|
9034 | var isObject = __webpack_require__(11);
|
9035 |
|
9036 | var $TypeError = TypeError;
|
9037 |
|
9038 |
|
9039 |
|
9040 | module.exports = function (input, pref) {
|
9041 | var fn, val;
|
9042 | if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
9043 | if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
|
9044 | if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
9045 | throw $TypeError("Can't convert object to primitive value");
|
9046 | };
|
9047 |
|
9048 |
|
9049 | }),
|
9050 |
|
9051 | (function(module, exports, __webpack_require__) {
|
9052 |
|
9053 | var global = __webpack_require__(8);
|
9054 |
|
9055 |
|
9056 | var defineProperty = Object.defineProperty;
|
9057 |
|
9058 | module.exports = function (key, value) {
|
9059 | try {
|
9060 | defineProperty(global, key, { value: value, configurable: true, writable: true });
|
9061 | } catch (error) {
|
9062 | global[key] = value;
|
9063 | } return value;
|
9064 | };
|
9065 |
|
9066 |
|
9067 | }),
|
9068 |
|
9069 | (function(module, exports, __webpack_require__) {
|
9070 |
|
9071 | var isCallable = __webpack_require__(9);
|
9072 |
|
9073 | var $String = String;
|
9074 | var $TypeError = TypeError;
|
9075 |
|
9076 | module.exports = function (argument) {
|
9077 | if (typeof argument == 'object' || isCallable(argument)) return argument;
|
9078 | throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
|
9079 | };
|
9080 |
|
9081 |
|
9082 | }),
|
9083 |
|
9084 | (function(module, exports, __webpack_require__) {
|
9085 |
|
9086 | var hasOwn = __webpack_require__(13);
|
9087 | var ownKeys = __webpack_require__(163);
|
9088 | var getOwnPropertyDescriptorModule = __webpack_require__(64);
|
9089 | var definePropertyModule = __webpack_require__(23);
|
9090 |
|
9091 | module.exports = function (target, source, exceptions) {
|
9092 | var keys = ownKeys(source);
|
9093 | var defineProperty = definePropertyModule.f;
|
9094 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
9095 | for (var i = 0; i < keys.length; i++) {
|
9096 | var key = keys[i];
|
9097 | if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
|
9098 | defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
9099 | }
|
9100 | }
|
9101 | };
|
9102 |
|
9103 |
|
9104 | }),
|
9105 |
|
9106 | (function(module, exports) {
|
9107 |
|
9108 | var ceil = Math.ceil;
|
9109 | var floor = Math.floor;
|
9110 |
|
9111 |
|
9112 |
|
9113 |
|
9114 | module.exports = Math.trunc || function trunc(x) {
|
9115 | var n = +x;
|
9116 | return (n > 0 ? floor : ceil)(n);
|
9117 | };
|
9118 |
|
9119 |
|
9120 | }),
|
9121 |
|
9122 | (function(module, exports, __webpack_require__) {
|
9123 |
|
9124 | var toIntegerOrInfinity = __webpack_require__(128);
|
9125 |
|
9126 | var min = Math.min;
|
9127 |
|
9128 |
|
9129 |
|
9130 | module.exports = function (argument) {
|
9131 | return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0;
|
9132 | };
|
9133 |
|
9134 |
|
9135 | }),
|
9136 |
|
9137 | (function(module, exports, __webpack_require__) {
|
9138 |
|
9139 | var uncurryThis = __webpack_require__(4);
|
9140 |
|
9141 | var $Error = Error;
|
9142 | var replace = uncurryThis(''.replace);
|
9143 |
|
9144 | var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
|
9145 | var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
|
9146 | var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
|
9147 |
|
9148 | module.exports = function (stack, dropEntries) {
|
9149 | if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
|
9150 | while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
|
9151 | } return stack;
|
9152 | };
|
9153 |
|
9154 |
|
9155 | }),
|
9156 |
|
9157 | (function(module, exports, __webpack_require__) {
|
9158 |
|
9159 | var isObject = __webpack_require__(11);
|
9160 | var createNonEnumerableProperty = __webpack_require__(39);
|
9161 |
|
9162 |
|
9163 |
|
9164 | module.exports = function (O, options) {
|
9165 | if (isObject(options) && 'cause' in options) {
|
9166 | createNonEnumerableProperty(O, 'cause', options.cause);
|
9167 | }
|
9168 | };
|
9169 |
|
9170 |
|
9171 | }),
|
9172 |
|
9173 | (function(module, exports, __webpack_require__) {
|
9174 |
|
9175 | var toString = __webpack_require__(42);
|
9176 |
|
9177 | module.exports = function (argument, $default) {
|
9178 | return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
|
9179 | };
|
9180 |
|
9181 |
|
9182 | }),
|
9183 |
|
9184 | (function(module, exports, __webpack_require__) {
|
9185 |
|
9186 | var fails = __webpack_require__(2);
|
9187 | var createPropertyDescriptor = __webpack_require__(49);
|
9188 |
|
9189 | module.exports = !fails(function () {
|
9190 | var error = Error('a');
|
9191 | if (!('stack' in error)) return true;
|
9192 |
|
9193 | Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
|
9194 | return error.stack !== 7;
|
9195 | });
|
9196 |
|
9197 |
|
9198 | }),
|
9199 |
|
9200 | (function(module, exports, __webpack_require__) {
|
9201 |
|
9202 | "use strict";
|
9203 |
|
9204 | var IteratorPrototype = __webpack_require__(171).IteratorPrototype;
|
9205 | var create = __webpack_require__(53);
|
9206 | var createPropertyDescriptor = __webpack_require__(49);
|
9207 | var setToStringTag = __webpack_require__(56);
|
9208 | var Iterators = __webpack_require__(54);
|
9209 |
|
9210 | var returnThis = function () { return this; };
|
9211 |
|
9212 | module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
9213 | var TO_STRING_TAG = NAME + ' Iterator';
|
9214 | IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
9215 | setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
|
9216 | Iterators[TO_STRING_TAG] = returnThis;
|
9217 | return IteratorConstructor;
|
9218 | };
|
9219 |
|
9220 |
|
9221 | }),
|
9222 |
|
9223 | (function(module, exports, __webpack_require__) {
|
9224 |
|
9225 | "use strict";
|
9226 |
|
9227 | var TO_STRING_TAG_SUPPORT = __webpack_require__(131);
|
9228 | var classof = __webpack_require__(55);
|
9229 |
|
9230 |
|
9231 |
|
9232 | module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
|
9233 | return '[object ' + classof(this) + ']';
|
9234 | };
|
9235 |
|
9236 |
|
9237 | }),
|
9238 |
|
9239 | (function(module, exports, __webpack_require__) {
|
9240 |
|
9241 |
|
9242 | __webpack_require__(305);
|
9243 | __webpack_require__(313);
|
9244 | __webpack_require__(314);
|
9245 | __webpack_require__(315);
|
9246 | __webpack_require__(316);
|
9247 | __webpack_require__(317);
|
9248 |
|
9249 |
|
9250 | }),
|
9251 |
|
9252 | (function(module, exports, __webpack_require__) {
|
9253 |
|
9254 | "use strict";
|
9255 |
|
9256 | var $ = __webpack_require__(0);
|
9257 | var IS_PURE = __webpack_require__(36);
|
9258 | var IS_NODE = __webpack_require__(109);
|
9259 | var global = __webpack_require__(8);
|
9260 | var call = __webpack_require__(15);
|
9261 | var defineBuiltIn = __webpack_require__(45);
|
9262 | var setPrototypeOf = __webpack_require__(104);
|
9263 | var setToStringTag = __webpack_require__(56);
|
9264 | var setSpecies = __webpack_require__(172);
|
9265 | var aCallable = __webpack_require__(29);
|
9266 | var isCallable = __webpack_require__(9);
|
9267 | var isObject = __webpack_require__(11);
|
9268 | var anInstance = __webpack_require__(110);
|
9269 | var speciesConstructor = __webpack_require__(173);
|
9270 | var task = __webpack_require__(175).set;
|
9271 | var microtask = __webpack_require__(307);
|
9272 | var hostReportErrors = __webpack_require__(310);
|
9273 | var perform = __webpack_require__(84);
|
9274 | var Queue = __webpack_require__(311);
|
9275 | var InternalStateModule = __webpack_require__(44);
|
9276 | var NativePromiseConstructor = __webpack_require__(69);
|
9277 | var PromiseConstructorDetection = __webpack_require__(85);
|
9278 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9279 |
|
9280 | var PROMISE = 'Promise';
|
9281 | var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
|
9282 | var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
|
9283 | var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
|
9284 | var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
|
9285 | var setInternalState = InternalStateModule.set;
|
9286 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
9287 | var PromiseConstructor = NativePromiseConstructor;
|
9288 | var PromisePrototype = NativePromisePrototype;
|
9289 | var TypeError = global.TypeError;
|
9290 | var document = global.document;
|
9291 | var process = global.process;
|
9292 | var newPromiseCapability = newPromiseCapabilityModule.f;
|
9293 | var newGenericPromiseCapability = newPromiseCapability;
|
9294 |
|
9295 | var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
|
9296 | var UNHANDLED_REJECTION = 'unhandledrejection';
|
9297 | var REJECTION_HANDLED = 'rejectionhandled';
|
9298 | var PENDING = 0;
|
9299 | var FULFILLED = 1;
|
9300 | var REJECTED = 2;
|
9301 | var HANDLED = 1;
|
9302 | var UNHANDLED = 2;
|
9303 |
|
9304 | var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
9305 |
|
9306 |
|
9307 | var isThenable = function (it) {
|
9308 | var then;
|
9309 | return isObject(it) && isCallable(then = it.then) ? then : false;
|
9310 | };
|
9311 |
|
9312 | var callReaction = function (reaction, state) {
|
9313 | var value = state.value;
|
9314 | var ok = state.state == FULFILLED;
|
9315 | var handler = ok ? reaction.ok : reaction.fail;
|
9316 | var resolve = reaction.resolve;
|
9317 | var reject = reaction.reject;
|
9318 | var domain = reaction.domain;
|
9319 | var result, then, exited;
|
9320 | try {
|
9321 | if (handler) {
|
9322 | if (!ok) {
|
9323 | if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
9324 | state.rejection = HANDLED;
|
9325 | }
|
9326 | if (handler === true) result = value;
|
9327 | else {
|
9328 | if (domain) domain.enter();
|
9329 | result = handler(value);
|
9330 | if (domain) {
|
9331 | domain.exit();
|
9332 | exited = true;
|
9333 | }
|
9334 | }
|
9335 | if (result === reaction.promise) {
|
9336 | reject(TypeError('Promise-chain cycle'));
|
9337 | } else if (then = isThenable(result)) {
|
9338 | call(then, result, resolve, reject);
|
9339 | } else resolve(result);
|
9340 | } else reject(value);
|
9341 | } catch (error) {
|
9342 | if (domain && !exited) domain.exit();
|
9343 | reject(error);
|
9344 | }
|
9345 | };
|
9346 |
|
9347 | var notify = function (state, isReject) {
|
9348 | if (state.notified) return;
|
9349 | state.notified = true;
|
9350 | microtask(function () {
|
9351 | var reactions = state.reactions;
|
9352 | var reaction;
|
9353 | while (reaction = reactions.get()) {
|
9354 | callReaction(reaction, state);
|
9355 | }
|
9356 | state.notified = false;
|
9357 | if (isReject && !state.rejection) onUnhandled(state);
|
9358 | });
|
9359 | };
|
9360 |
|
9361 | var dispatchEvent = function (name, promise, reason) {
|
9362 | var event, handler;
|
9363 | if (DISPATCH_EVENT) {
|
9364 | event = document.createEvent('Event');
|
9365 | event.promise = promise;
|
9366 | event.reason = reason;
|
9367 | event.initEvent(name, false, true);
|
9368 | global.dispatchEvent(event);
|
9369 | } else event = { promise: promise, reason: reason };
|
9370 | if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
|
9371 | else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
9372 | };
|
9373 |
|
9374 | var onUnhandled = function (state) {
|
9375 | call(task, global, function () {
|
9376 | var promise = state.facade;
|
9377 | var value = state.value;
|
9378 | var IS_UNHANDLED = isUnhandled(state);
|
9379 | var result;
|
9380 | if (IS_UNHANDLED) {
|
9381 | result = perform(function () {
|
9382 | if (IS_NODE) {
|
9383 | process.emit('unhandledRejection', value, promise);
|
9384 | } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
9385 | });
|
9386 |
|
9387 | state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
|
9388 | if (result.error) throw result.value;
|
9389 | }
|
9390 | });
|
9391 | };
|
9392 |
|
9393 | var isUnhandled = function (state) {
|
9394 | return state.rejection !== HANDLED && !state.parent;
|
9395 | };
|
9396 |
|
9397 | var onHandleUnhandled = function (state) {
|
9398 | call(task, global, function () {
|
9399 | var promise = state.facade;
|
9400 | if (IS_NODE) {
|
9401 | process.emit('rejectionHandled', promise);
|
9402 | } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
9403 | });
|
9404 | };
|
9405 |
|
9406 | var bind = function (fn, state, unwrap) {
|
9407 | return function (value) {
|
9408 | fn(state, value, unwrap);
|
9409 | };
|
9410 | };
|
9411 |
|
9412 | var internalReject = function (state, value, unwrap) {
|
9413 | if (state.done) return;
|
9414 | state.done = true;
|
9415 | if (unwrap) state = unwrap;
|
9416 | state.value = value;
|
9417 | state.state = REJECTED;
|
9418 | notify(state, true);
|
9419 | };
|
9420 |
|
9421 | var internalResolve = function (state, value, unwrap) {
|
9422 | if (state.done) return;
|
9423 | state.done = true;
|
9424 | if (unwrap) state = unwrap;
|
9425 | try {
|
9426 | if (state.facade === value) throw TypeError("Promise can't be resolved itself");
|
9427 | var then = isThenable(value);
|
9428 | if (then) {
|
9429 | microtask(function () {
|
9430 | var wrapper = { done: false };
|
9431 | try {
|
9432 | call(then, value,
|
9433 | bind(internalResolve, wrapper, state),
|
9434 | bind(internalReject, wrapper, state)
|
9435 | );
|
9436 | } catch (error) {
|
9437 | internalReject(wrapper, error, state);
|
9438 | }
|
9439 | });
|
9440 | } else {
|
9441 | state.value = value;
|
9442 | state.state = FULFILLED;
|
9443 | notify(state, false);
|
9444 | }
|
9445 | } catch (error) {
|
9446 | internalReject({ done: false }, error, state);
|
9447 | }
|
9448 | };
|
9449 |
|
9450 |
|
9451 | if (FORCED_PROMISE_CONSTRUCTOR) {
|
9452 |
|
9453 | PromiseConstructor = function Promise(executor) {
|
9454 | anInstance(this, PromisePrototype);
|
9455 | aCallable(executor);
|
9456 | call(Internal, this);
|
9457 | var state = getInternalPromiseState(this);
|
9458 | try {
|
9459 | executor(bind(internalResolve, state), bind(internalReject, state));
|
9460 | } catch (error) {
|
9461 | internalReject(state, error);
|
9462 | }
|
9463 | };
|
9464 |
|
9465 | PromisePrototype = PromiseConstructor.prototype;
|
9466 |
|
9467 |
|
9468 | Internal = function Promise(executor) {
|
9469 | setInternalState(this, {
|
9470 | type: PROMISE,
|
9471 | done: false,
|
9472 | notified: false,
|
9473 | parent: false,
|
9474 | reactions: new Queue(),
|
9475 | rejection: false,
|
9476 | state: PENDING,
|
9477 | value: undefined
|
9478 | });
|
9479 | };
|
9480 |
|
9481 |
|
9482 |
|
9483 | Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
9484 | var state = getInternalPromiseState(this);
|
9485 | var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
9486 | state.parent = true;
|
9487 | reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
|
9488 | reaction.fail = isCallable(onRejected) && onRejected;
|
9489 | reaction.domain = IS_NODE ? process.domain : undefined;
|
9490 | if (state.state == PENDING) state.reactions.add(reaction);
|
9491 | else microtask(function () {
|
9492 | callReaction(reaction, state);
|
9493 | });
|
9494 | return reaction.promise;
|
9495 | });
|
9496 |
|
9497 | OwnPromiseCapability = function () {
|
9498 | var promise = new Internal();
|
9499 | var state = getInternalPromiseState(promise);
|
9500 | this.promise = promise;
|
9501 | this.resolve = bind(internalResolve, state);
|
9502 | this.reject = bind(internalReject, state);
|
9503 | };
|
9504 |
|
9505 | newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
9506 | return C === PromiseConstructor || C === PromiseWrapper
|
9507 | ? new OwnPromiseCapability(C)
|
9508 | : newGenericPromiseCapability(C);
|
9509 | };
|
9510 |
|
9511 | if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
|
9512 | nativeThen = NativePromisePrototype.then;
|
9513 |
|
9514 | if (!NATIVE_PROMISE_SUBCLASSING) {
|
9515 |
|
9516 | defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
9517 | var that = this;
|
9518 | return new PromiseConstructor(function (resolve, reject) {
|
9519 | call(nativeThen, that, resolve, reject);
|
9520 | }).then(onFulfilled, onRejected);
|
9521 |
|
9522 | }, { unsafe: true });
|
9523 | }
|
9524 |
|
9525 |
|
9526 | try {
|
9527 | delete NativePromisePrototype.constructor;
|
9528 | } catch (error) { }
|
9529 |
|
9530 |
|
9531 | if (setPrototypeOf) {
|
9532 | setPrototypeOf(NativePromisePrototype, PromisePrototype);
|
9533 | }
|
9534 | }
|
9535 | }
|
9536 |
|
9537 | $({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
9538 | Promise: PromiseConstructor
|
9539 | });
|
9540 |
|
9541 | setToStringTag(PromiseConstructor, PROMISE, false, true);
|
9542 | setSpecies(PROMISE);
|
9543 |
|
9544 |
|
9545 | }),
|
9546 |
|
9547 | (function(module, exports) {
|
9548 |
|
9549 | var $TypeError = TypeError;
|
9550 |
|
9551 | module.exports = function (passed, required) {
|
9552 | if (passed < required) throw $TypeError('Not enough arguments');
|
9553 | return passed;
|
9554 | };
|
9555 |
|
9556 |
|
9557 | }),
|
9558 |
|
9559 | (function(module, exports, __webpack_require__) {
|
9560 |
|
9561 | var global = __webpack_require__(8);
|
9562 | var bind = __webpack_require__(52);
|
9563 | var getOwnPropertyDescriptor = __webpack_require__(64).f;
|
9564 | var macrotask = __webpack_require__(175).set;
|
9565 | var IS_IOS = __webpack_require__(176);
|
9566 | var IS_IOS_PEBBLE = __webpack_require__(308);
|
9567 | var IS_WEBOS_WEBKIT = __webpack_require__(309);
|
9568 | var IS_NODE = __webpack_require__(109);
|
9569 |
|
9570 | var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
|
9571 | var document = global.document;
|
9572 | var process = global.process;
|
9573 | var Promise = global.Promise;
|
9574 |
|
9575 | var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
|
9576 | var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
9577 |
|
9578 | var flush, head, last, notify, toggle, node, promise, then;
|
9579 |
|
9580 |
|
9581 | if (!queueMicrotask) {
|
9582 | flush = function () {
|
9583 | var parent, fn;
|
9584 | if (IS_NODE && (parent = process.domain)) parent.exit();
|
9585 | while (head) {
|
9586 | fn = head.fn;
|
9587 | head = head.next;
|
9588 | try {
|
9589 | fn();
|
9590 | } catch (error) {
|
9591 | if (head) notify();
|
9592 | else last = undefined;
|
9593 | throw error;
|
9594 | }
|
9595 | } last = undefined;
|
9596 | if (parent) parent.enter();
|
9597 | };
|
9598 |
|
9599 |
|
9600 |
|
9601 | if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
|
9602 | toggle = true;
|
9603 | node = document.createTextNode('');
|
9604 | new MutationObserver(flush).observe(node, { characterData: true });
|
9605 | notify = function () {
|
9606 | node.data = toggle = !toggle;
|
9607 | };
|
9608 |
|
9609 | } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
|
9610 |
|
9611 | promise = Promise.resolve(undefined);
|
9612 |
|
9613 | promise.constructor = Promise;
|
9614 | then = bind(promise.then, promise);
|
9615 | notify = function () {
|
9616 | then(flush);
|
9617 | };
|
9618 |
|
9619 | } else if (IS_NODE) {
|
9620 | notify = function () {
|
9621 | process.nextTick(flush);
|
9622 | };
|
9623 |
|
9624 |
|
9625 |
|
9626 |
|
9627 |
|
9628 |
|
9629 | } else {
|
9630 |
|
9631 | macrotask = bind(macrotask, global);
|
9632 | notify = function () {
|
9633 | macrotask(flush);
|
9634 | };
|
9635 | }
|
9636 | }
|
9637 |
|
9638 | module.exports = queueMicrotask || function (fn) {
|
9639 | var task = { fn: fn, next: undefined };
|
9640 | if (last) last.next = task;
|
9641 | if (!head) {
|
9642 | head = task;
|
9643 | notify();
|
9644 | } last = task;
|
9645 | };
|
9646 |
|
9647 |
|
9648 | }),
|
9649 |
|
9650 | (function(module, exports, __webpack_require__) {
|
9651 |
|
9652 | var userAgent = __webpack_require__(51);
|
9653 | var global = __webpack_require__(8);
|
9654 |
|
9655 | module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
|
9656 |
|
9657 |
|
9658 | }),
|
9659 |
|
9660 | (function(module, exports, __webpack_require__) {
|
9661 |
|
9662 | var userAgent = __webpack_require__(51);
|
9663 |
|
9664 | module.exports = /web0s(?!.*chrome)/i.test(userAgent);
|
9665 |
|
9666 |
|
9667 | }),
|
9668 |
|
9669 | (function(module, exports, __webpack_require__) {
|
9670 |
|
9671 | var global = __webpack_require__(8);
|
9672 |
|
9673 | module.exports = function (a, b) {
|
9674 | var console = global.console;
|
9675 | if (console && console.error) {
|
9676 | arguments.length == 1 ? console.error(a) : console.error(a, b);
|
9677 | }
|
9678 | };
|
9679 |
|
9680 |
|
9681 | }),
|
9682 |
|
9683 | (function(module, exports) {
|
9684 |
|
9685 | var Queue = function () {
|
9686 | this.head = null;
|
9687 | this.tail = null;
|
9688 | };
|
9689 |
|
9690 | Queue.prototype = {
|
9691 | add: function (item) {
|
9692 | var entry = { item: item, next: null };
|
9693 | if (this.head) this.tail.next = entry;
|
9694 | else this.head = entry;
|
9695 | this.tail = entry;
|
9696 | },
|
9697 | get: function () {
|
9698 | var entry = this.head;
|
9699 | if (entry) {
|
9700 | this.head = entry.next;
|
9701 | if (this.tail === entry) this.tail = null;
|
9702 | return entry.item;
|
9703 | }
|
9704 | }
|
9705 | };
|
9706 |
|
9707 | module.exports = Queue;
|
9708 |
|
9709 |
|
9710 | }),
|
9711 |
|
9712 | (function(module, exports) {
|
9713 |
|
9714 | module.exports = typeof window == 'object' && typeof Deno != 'object';
|
9715 |
|
9716 |
|
9717 | }),
|
9718 |
|
9719 | (function(module, exports, __webpack_require__) {
|
9720 |
|
9721 | "use strict";
|
9722 |
|
9723 | var $ = __webpack_require__(0);
|
9724 | var call = __webpack_require__(15);
|
9725 | var aCallable = __webpack_require__(29);
|
9726 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9727 | var perform = __webpack_require__(84);
|
9728 | var iterate = __webpack_require__(41);
|
9729 | var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(177);
|
9730 |
|
9731 |
|
9732 |
|
9733 | $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
|
9734 | all: function all(iterable) {
|
9735 | var C = this;
|
9736 | var capability = newPromiseCapabilityModule.f(C);
|
9737 | var resolve = capability.resolve;
|
9738 | var reject = capability.reject;
|
9739 | var result = perform(function () {
|
9740 | var $promiseResolve = aCallable(C.resolve);
|
9741 | var values = [];
|
9742 | var counter = 0;
|
9743 | var remaining = 1;
|
9744 | iterate(iterable, function (promise) {
|
9745 | var index = counter++;
|
9746 | var alreadyCalled = false;
|
9747 | remaining++;
|
9748 | call($promiseResolve, C, promise).then(function (value) {
|
9749 | if (alreadyCalled) return;
|
9750 | alreadyCalled = true;
|
9751 | values[index] = value;
|
9752 | --remaining || resolve(values);
|
9753 | }, reject);
|
9754 | });
|
9755 | --remaining || resolve(values);
|
9756 | });
|
9757 | if (result.error) reject(result.value);
|
9758 | return capability.promise;
|
9759 | }
|
9760 | });
|
9761 |
|
9762 |
|
9763 | }),
|
9764 |
|
9765 | (function(module, exports, __webpack_require__) {
|
9766 |
|
9767 | "use strict";
|
9768 |
|
9769 | var $ = __webpack_require__(0);
|
9770 | var IS_PURE = __webpack_require__(36);
|
9771 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(85).CONSTRUCTOR;
|
9772 | var NativePromiseConstructor = __webpack_require__(69);
|
9773 | var getBuiltIn = __webpack_require__(20);
|
9774 | var isCallable = __webpack_require__(9);
|
9775 | var defineBuiltIn = __webpack_require__(45);
|
9776 |
|
9777 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
9778 |
|
9779 |
|
9780 |
|
9781 | $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
|
9782 | 'catch': function (onRejected) {
|
9783 | return this.then(undefined, onRejected);
|
9784 | }
|
9785 | });
|
9786 |
|
9787 |
|
9788 | if (!IS_PURE && isCallable(NativePromiseConstructor)) {
|
9789 | var method = getBuiltIn('Promise').prototype['catch'];
|
9790 | if (NativePromisePrototype['catch'] !== method) {
|
9791 | defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
|
9792 | }
|
9793 | }
|
9794 |
|
9795 |
|
9796 | }),
|
9797 |
|
9798 | (function(module, exports, __webpack_require__) {
|
9799 |
|
9800 | "use strict";
|
9801 |
|
9802 | var $ = __webpack_require__(0);
|
9803 | var call = __webpack_require__(15);
|
9804 | var aCallable = __webpack_require__(29);
|
9805 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9806 | var perform = __webpack_require__(84);
|
9807 | var iterate = __webpack_require__(41);
|
9808 | var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(177);
|
9809 |
|
9810 |
|
9811 |
|
9812 | $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
|
9813 | race: function race(iterable) {
|
9814 | var C = this;
|
9815 | var capability = newPromiseCapabilityModule.f(C);
|
9816 | var reject = capability.reject;
|
9817 | var result = perform(function () {
|
9818 | var $promiseResolve = aCallable(C.resolve);
|
9819 | iterate(iterable, function (promise) {
|
9820 | call($promiseResolve, C, promise).then(capability.resolve, reject);
|
9821 | });
|
9822 | });
|
9823 | if (result.error) reject(result.value);
|
9824 | return capability.promise;
|
9825 | }
|
9826 | });
|
9827 |
|
9828 |
|
9829 | }),
|
9830 |
|
9831 | (function(module, exports, __webpack_require__) {
|
9832 |
|
9833 | "use strict";
|
9834 |
|
9835 | var $ = __webpack_require__(0);
|
9836 | var call = __webpack_require__(15);
|
9837 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9838 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(85).CONSTRUCTOR;
|
9839 |
|
9840 |
|
9841 |
|
9842 | $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
9843 | reject: function reject(r) {
|
9844 | var capability = newPromiseCapabilityModule.f(this);
|
9845 | call(capability.reject, undefined, r);
|
9846 | return capability.promise;
|
9847 | }
|
9848 | });
|
9849 |
|
9850 |
|
9851 | }),
|
9852 |
|
9853 | (function(module, exports, __webpack_require__) {
|
9854 |
|
9855 | "use strict";
|
9856 |
|
9857 | var $ = __webpack_require__(0);
|
9858 | var getBuiltIn = __webpack_require__(20);
|
9859 | var IS_PURE = __webpack_require__(36);
|
9860 | var NativePromiseConstructor = __webpack_require__(69);
|
9861 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(85).CONSTRUCTOR;
|
9862 | var promiseResolve = __webpack_require__(179);
|
9863 |
|
9864 | var PromiseConstructorWrapper = getBuiltIn('Promise');
|
9865 | var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
|
9866 |
|
9867 |
|
9868 |
|
9869 | $({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
|
9870 | resolve: function resolve(x) {
|
9871 | return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
|
9872 | }
|
9873 | });
|
9874 |
|
9875 |
|
9876 | }),
|
9877 |
|
9878 | (function(module, exports, __webpack_require__) {
|
9879 |
|
9880 | "use strict";
|
9881 |
|
9882 | var $ = __webpack_require__(0);
|
9883 | var call = __webpack_require__(15);
|
9884 | var aCallable = __webpack_require__(29);
|
9885 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9886 | var perform = __webpack_require__(84);
|
9887 | var iterate = __webpack_require__(41);
|
9888 |
|
9889 |
|
9890 |
|
9891 | $({ target: 'Promise', stat: true }, {
|
9892 | allSettled: function allSettled(iterable) {
|
9893 | var C = this;
|
9894 | var capability = newPromiseCapabilityModule.f(C);
|
9895 | var resolve = capability.resolve;
|
9896 | var reject = capability.reject;
|
9897 | var result = perform(function () {
|
9898 | var promiseResolve = aCallable(C.resolve);
|
9899 | var values = [];
|
9900 | var counter = 0;
|
9901 | var remaining = 1;
|
9902 | iterate(iterable, function (promise) {
|
9903 | var index = counter++;
|
9904 | var alreadyCalled = false;
|
9905 | remaining++;
|
9906 | call(promiseResolve, C, promise).then(function (value) {
|
9907 | if (alreadyCalled) return;
|
9908 | alreadyCalled = true;
|
9909 | values[index] = { status: 'fulfilled', value: value };
|
9910 | --remaining || resolve(values);
|
9911 | }, function (error) {
|
9912 | if (alreadyCalled) return;
|
9913 | alreadyCalled = true;
|
9914 | values[index] = { status: 'rejected', reason: error };
|
9915 | --remaining || resolve(values);
|
9916 | });
|
9917 | });
|
9918 | --remaining || resolve(values);
|
9919 | });
|
9920 | if (result.error) reject(result.value);
|
9921 | return capability.promise;
|
9922 | }
|
9923 | });
|
9924 |
|
9925 |
|
9926 | }),
|
9927 |
|
9928 | (function(module, exports, __webpack_require__) {
|
9929 |
|
9930 | "use strict";
|
9931 |
|
9932 | var $ = __webpack_require__(0);
|
9933 | var call = __webpack_require__(15);
|
9934 | var aCallable = __webpack_require__(29);
|
9935 | var getBuiltIn = __webpack_require__(20);
|
9936 | var newPromiseCapabilityModule = __webpack_require__(57);
|
9937 | var perform = __webpack_require__(84);
|
9938 | var iterate = __webpack_require__(41);
|
9939 |
|
9940 | var PROMISE_ANY_ERROR = 'No one promise resolved';
|
9941 |
|
9942 |
|
9943 |
|
9944 | $({ target: 'Promise', stat: true }, {
|
9945 | any: function any(iterable) {
|
9946 | var C = this;
|
9947 | var AggregateError = getBuiltIn('AggregateError');
|
9948 | var capability = newPromiseCapabilityModule.f(C);
|
9949 | var resolve = capability.resolve;
|
9950 | var reject = capability.reject;
|
9951 | var result = perform(function () {
|
9952 | var promiseResolve = aCallable(C.resolve);
|
9953 | var errors = [];
|
9954 | var counter = 0;
|
9955 | var remaining = 1;
|
9956 | var alreadyResolved = false;
|
9957 | iterate(iterable, function (promise) {
|
9958 | var index = counter++;
|
9959 | var alreadyRejected = false;
|
9960 | remaining++;
|
9961 | call(promiseResolve, C, promise).then(function (value) {
|
9962 | if (alreadyRejected || alreadyResolved) return;
|
9963 | alreadyResolved = true;
|
9964 | resolve(value);
|
9965 | }, function (error) {
|
9966 | if (alreadyRejected || alreadyResolved) return;
|
9967 | alreadyRejected = true;
|
9968 | errors[index] = error;
|
9969 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
9970 | });
|
9971 | });
|
9972 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
9973 | });
|
9974 | if (result.error) reject(result.value);
|
9975 | return capability.promise;
|
9976 | }
|
9977 | });
|
9978 |
|
9979 |
|
9980 | }),
|
9981 |
|
9982 | (function(module, exports, __webpack_require__) {
|
9983 |
|
9984 | "use strict";
|
9985 |
|
9986 | var $ = __webpack_require__(0);
|
9987 | var IS_PURE = __webpack_require__(36);
|
9988 | var NativePromiseConstructor = __webpack_require__(69);
|
9989 | var fails = __webpack_require__(2);
|
9990 | var getBuiltIn = __webpack_require__(20);
|
9991 | var isCallable = __webpack_require__(9);
|
9992 | var speciesConstructor = __webpack_require__(173);
|
9993 | var promiseResolve = __webpack_require__(179);
|
9994 | var defineBuiltIn = __webpack_require__(45);
|
9995 |
|
9996 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
9997 |
|
9998 |
|
9999 | var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
|
10000 |
|
10001 | NativePromisePrototype['finally'].call({ then: function () { } }, function () { });
|
10002 | });
|
10003 |
|
10004 |
|
10005 |
|
10006 | $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
|
10007 | 'finally': function (onFinally) {
|
10008 | var C = speciesConstructor(this, getBuiltIn('Promise'));
|
10009 | var isFunction = isCallable(onFinally);
|
10010 | return this.then(
|
10011 | isFunction ? function (x) {
|
10012 | return promiseResolve(C, onFinally()).then(function () { return x; });
|
10013 | } : onFinally,
|
10014 | isFunction ? function (e) {
|
10015 | return promiseResolve(C, onFinally()).then(function () { throw e; });
|
10016 | } : onFinally
|
10017 | );
|
10018 | }
|
10019 | });
|
10020 |
|
10021 |
|
10022 | if (!IS_PURE && isCallable(NativePromiseConstructor)) {
|
10023 | var method = getBuiltIn('Promise').prototype['finally'];
|
10024 | if (NativePromisePrototype['finally'] !== method) {
|
10025 | defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
|
10026 | }
|
10027 | }
|
10028 |
|
10029 |
|
10030 | }),
|
10031 |
|
10032 | (function(module, exports, __webpack_require__) {
|
10033 |
|
10034 | var uncurryThis = __webpack_require__(4);
|
10035 | var toIntegerOrInfinity = __webpack_require__(128);
|
10036 | var toString = __webpack_require__(42);
|
10037 | var requireObjectCoercible = __webpack_require__(81);
|
10038 |
|
10039 | var charAt = uncurryThis(''.charAt);
|
10040 | var charCodeAt = uncurryThis(''.charCodeAt);
|
10041 | var stringSlice = uncurryThis(''.slice);
|
10042 |
|
10043 | var createMethod = function (CONVERT_TO_STRING) {
|
10044 | return function ($this, pos) {
|
10045 | var S = toString(requireObjectCoercible($this));
|
10046 | var position = toIntegerOrInfinity(pos);
|
10047 | var size = S.length;
|
10048 | var first, second;
|
10049 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
10050 | first = charCodeAt(S, position);
|
10051 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
10052 | || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
10053 | ? CONVERT_TO_STRING
|
10054 | ? charAt(S, position)
|
10055 | : first
|
10056 | : CONVERT_TO_STRING
|
10057 | ? stringSlice(S, position, position + 2)
|
10058 | : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
10059 | };
|
10060 | };
|
10061 |
|
10062 | module.exports = {
|
10063 |
|
10064 |
|
10065 | codeAt: createMethod(false),
|
10066 |
|
10067 |
|
10068 | charAt: createMethod(true)
|
10069 | };
|
10070 |
|
10071 |
|
10072 | }),
|
10073 |
|
10074 | (function(module, exports) {
|
10075 |
|
10076 |
|
10077 |
|
10078 | module.exports = {
|
10079 | CSSRuleList: 0,
|
10080 | CSSStyleDeclaration: 0,
|
10081 | CSSValueList: 0,
|
10082 | ClientRectList: 0,
|
10083 | DOMRectList: 0,
|
10084 | DOMStringList: 0,
|
10085 | DOMTokenList: 1,
|
10086 | DataTransferItemList: 0,
|
10087 | FileList: 0,
|
10088 | HTMLAllCollection: 0,
|
10089 | HTMLCollection: 0,
|
10090 | HTMLFormElement: 0,
|
10091 | HTMLSelectElement: 0,
|
10092 | MediaList: 0,
|
10093 | MimeTypeArray: 0,
|
10094 | NamedNodeMap: 0,
|
10095 | NodeList: 1,
|
10096 | PaintRequestList: 0,
|
10097 | Plugin: 0,
|
10098 | PluginArray: 0,
|
10099 | SVGLengthList: 0,
|
10100 | SVGNumberList: 0,
|
10101 | SVGPathSegList: 0,
|
10102 | SVGPointList: 0,
|
10103 | SVGStringList: 0,
|
10104 | SVGTransformList: 0,
|
10105 | SourceBufferList: 0,
|
10106 | StyleSheetList: 0,
|
10107 | TextTrackCueList: 0,
|
10108 | TextTrackList: 0,
|
10109 | TouchList: 0
|
10110 | };
|
10111 |
|
10112 |
|
10113 | }),
|
10114 |
|
10115 | (function(module, __webpack_exports__, __webpack_require__) {
|
10116 |
|
10117 | "use strict";
|
10118 | var __WEBPACK_IMPORTED_MODULE_0__index_js__ = __webpack_require__(135);
|
10119 |
|
10120 |
|
10121 |
|
10122 |
|
10123 |
|
10124 |
|
10125 |
|
10126 |
|
10127 |
|
10128 |
|
10129 |
|
10130 |
|
10131 |
|
10132 |
|
10133 |
|
10134 |
|
10135 |
|
10136 |
|
10137 |
|
10138 |
|
10139 |
|
10140 |
|
10141 | var _ = Object(__WEBPACK_IMPORTED_MODULE_0__index_js__["mixin"])(__WEBPACK_IMPORTED_MODULE_0__index_js__);
|
10142 |
|
10143 | _._ = _;
|
10144 |
|
10145 | __webpack_exports__["a"] = (_);
|
10146 |
|
10147 |
|
10148 | }),
|
10149 |
|
10150 | (function(module, __webpack_exports__, __webpack_require__) {
|
10151 |
|
10152 | "use strict";
|
10153 | __webpack_exports__["a"] = isNull;
|
10154 |
|
10155 | function isNull(obj) {
|
10156 | return obj === null;
|
10157 | }
|
10158 |
|
10159 |
|
10160 | }),
|
10161 |
|
10162 | (function(module, __webpack_exports__, __webpack_require__) {
|
10163 |
|
10164 | "use strict";
|
10165 | __webpack_exports__["a"] = isElement;
|
10166 |
|
10167 | function isElement(obj) {
|
10168 | return !!(obj && obj.nodeType === 1);
|
10169 | }
|
10170 |
|
10171 |
|
10172 | }),
|
10173 |
|
10174 | (function(module, __webpack_exports__, __webpack_require__) {
|
10175 |
|
10176 | "use strict";
|
10177 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10178 |
|
10179 |
|
10180 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Date'));
|
10181 |
|
10182 |
|
10183 | }),
|
10184 |
|
10185 | (function(module, __webpack_exports__, __webpack_require__) {
|
10186 |
|
10187 | "use strict";
|
10188 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10189 |
|
10190 |
|
10191 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('RegExp'));
|
10192 |
|
10193 |
|
10194 | }),
|
10195 |
|
10196 | (function(module, __webpack_exports__, __webpack_require__) {
|
10197 |
|
10198 | "use strict";
|
10199 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10200 |
|
10201 |
|
10202 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Error'));
|
10203 |
|
10204 |
|
10205 | }),
|
10206 |
|
10207 | (function(module, __webpack_exports__, __webpack_require__) {
|
10208 |
|
10209 | "use strict";
|
10210 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10211 |
|
10212 |
|
10213 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Object'));
|
10214 |
|
10215 |
|
10216 | }),
|
10217 |
|
10218 | (function(module, __webpack_exports__, __webpack_require__) {
|
10219 |
|
10220 | "use strict";
|
10221 | __webpack_exports__["a"] = isFinite;
|
10222 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
10223 | var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(183);
|
10224 |
|
10225 |
|
10226 |
|
10227 |
|
10228 | function isFinite(obj) {
|
10229 | return !Object(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["f" ])(obj) && !isNaN(parseFloat(obj));
|
10230 | }
|
10231 |
|
10232 |
|
10233 | }),
|
10234 |
|
10235 | (function(module, __webpack_exports__, __webpack_require__) {
|
10236 |
|
10237 | "use strict";
|
10238 | var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(188);
|
10239 | var __WEBPACK_IMPORTED_MODULE_1__getByteLength_js__ = __webpack_require__(139);
|
10240 |
|
10241 |
|
10242 |
|
10243 |
|
10244 |
|
10245 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__getByteLength_js__["a" ]));
|
10246 |
|
10247 |
|
10248 | }),
|
10249 |
|
10250 | (function(module, __webpack_exports__, __webpack_require__) {
|
10251 |
|
10252 | "use strict";
|
10253 | __webpack_exports__["a"] = isEmpty;
|
10254 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
10255 | var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(59);
|
10256 | var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(136);
|
10257 | var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(138);
|
10258 | var __WEBPACK_IMPORTED_MODULE_4__keys_js__ = __webpack_require__(17);
|
10259 |
|
10260 |
|
10261 |
|
10262 |
|
10263 |
|
10264 |
|
10265 |
|
10266 |
|
10267 | function isEmpty(obj) {
|
10268 | if (obj == null) return true;
|
10269 |
|
10270 |
|
10271 | var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(obj);
|
10272 | if (typeof length == 'number' && (
|
10273 | 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)
|
10274 | )) return length === 0;
|
10275 | return Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_4__keys_js__["a" ])(obj)) === 0;
|
10276 | }
|
10277 |
|
10278 |
|
10279 | }),
|
10280 |
|
10281 | (function(module, __webpack_exports__, __webpack_require__) {
|
10282 |
|
10283 | "use strict";
|
10284 | __webpack_exports__["a"] = isEqual;
|
10285 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
10286 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
10287 | var __WEBPACK_IMPORTED_MODULE_2__getByteLength_js__ = __webpack_require__(139);
|
10288 | var __WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__ = __webpack_require__(186);
|
10289 | var __WEBPACK_IMPORTED_MODULE_4__isFunction_js__ = __webpack_require__(30);
|
10290 | var __WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__ = __webpack_require__(86);
|
10291 | var __WEBPACK_IMPORTED_MODULE_6__isDataView_js__ = __webpack_require__(137);
|
10292 | var __WEBPACK_IMPORTED_MODULE_7__keys_js__ = __webpack_require__(17);
|
10293 | var __WEBPACK_IMPORTED_MODULE_8__has_js__ = __webpack_require__(47);
|
10294 | var __WEBPACK_IMPORTED_MODULE_9__toBufferView_js__ = __webpack_require__(334);
|
10295 |
|
10296 |
|
10297 |
|
10298 |
|
10299 |
|
10300 |
|
10301 |
|
10302 |
|
10303 |
|
10304 |
|
10305 |
|
10306 |
|
10307 | var tagDataView = '[object DataView]';
|
10308 |
|
10309 |
|
10310 | function eq(a, b, aStack, bStack) {
|
10311 |
|
10312 |
|
10313 | if (a === b) return a !== 0 || 1 / a === 1 / b;
|
10314 |
|
10315 | if (a == null || b == null) return false;
|
10316 |
|
10317 | if (a !== a) return b !== b;
|
10318 |
|
10319 | var type = typeof a;
|
10320 | if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
|
10321 | return deepEq(a, b, aStack, bStack);
|
10322 | }
|
10323 |
|
10324 |
|
10325 | function deepEq(a, b, aStack, bStack) {
|
10326 |
|
10327 | if (a instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ]) a = a._wrapped;
|
10328 | if (b instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ]) b = b._wrapped;
|
10329 |
|
10330 | var className = __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" ].call(a);
|
10331 | if (className !== __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" ].call(b)) return false;
|
10332 |
|
10333 | if (__WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__["a" ] && className == '[object Object]' && Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" ])(a)) {
|
10334 | if (!Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" ])(b)) return false;
|
10335 | className = tagDataView;
|
10336 | }
|
10337 | switch (className) {
|
10338 |
|
10339 | case '[object RegExp]':
|
10340 |
|
10341 | case '[object String]':
|
10342 |
|
10343 |
|
10344 | return '' + a === '' + b;
|
10345 | case '[object Number]':
|
10346 |
|
10347 |
|
10348 | if (+a !== +a) return +b !== +b;
|
10349 |
|
10350 | return +a === 0 ? 1 / +a === 1 / b : +a === +b;
|
10351 | case '[object Date]':
|
10352 | case '[object Boolean]':
|
10353 |
|
10354 |
|
10355 |
|
10356 | return +a === +b;
|
10357 | case '[object Symbol]':
|
10358 | return __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" ].valueOf.call(a) === __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" ].valueOf.call(b);
|
10359 | case '[object ArrayBuffer]':
|
10360 | case tagDataView:
|
10361 |
|
10362 | return deepEq(Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" ])(a), Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" ])(b), aStack, bStack);
|
10363 | }
|
10364 |
|
10365 | var areArrays = className === '[object Array]';
|
10366 | if (!areArrays && Object(__WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__["a" ])(a)) {
|
10367 | var byteLength = Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" ])(a);
|
10368 | if (byteLength !== Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" ])(b)) return false;
|
10369 | if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
|
10370 | areArrays = true;
|
10371 | }
|
10372 | if (!areArrays) {
|
10373 | if (typeof a != 'object' || typeof b != 'object') return false;
|
10374 |
|
10375 |
|
10376 |
|
10377 | var aCtor = a.constructor, bCtor = b.constructor;
|
10378 | if (aCtor !== bCtor && !(Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" ])(aCtor) && aCtor instanceof aCtor &&
|
10379 | Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" ])(bCtor) && bCtor instanceof bCtor)
|
10380 | && ('constructor' in a && 'constructor' in b)) {
|
10381 | return false;
|
10382 | }
|
10383 | }
|
10384 |
|
10385 |
|
10386 |
|
10387 |
|
10388 |
|
10389 | aStack = aStack || [];
|
10390 | bStack = bStack || [];
|
10391 | var length = aStack.length;
|
10392 | while (length--) {
|
10393 |
|
10394 |
|
10395 | if (aStack[length] === a) return bStack[length] === b;
|
10396 | }
|
10397 |
|
10398 |
|
10399 | aStack.push(a);
|
10400 | bStack.push(b);
|
10401 |
|
10402 |
|
10403 | if (areArrays) {
|
10404 |
|
10405 | length = a.length;
|
10406 | if (length !== b.length) return false;
|
10407 |
|
10408 | while (length--) {
|
10409 | if (!eq(a[length], b[length], aStack, bStack)) return false;
|
10410 | }
|
10411 | } else {
|
10412 |
|
10413 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" ])(a), key;
|
10414 | length = _keys.length;
|
10415 |
|
10416 | if (Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" ])(b).length !== length) return false;
|
10417 | while (length--) {
|
10418 |
|
10419 | key = _keys[length];
|
10420 | if (!(Object(__WEBPACK_IMPORTED_MODULE_8__has_js__["a" ])(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
|
10421 | }
|
10422 | }
|
10423 |
|
10424 | aStack.pop();
|
10425 | bStack.pop();
|
10426 | return true;
|
10427 | }
|
10428 |
|
10429 |
|
10430 | function isEqual(a, b) {
|
10431 | return eq(a, b);
|
10432 | }
|
10433 |
|
10434 |
|
10435 | }),
|
10436 |
|
10437 | (function(module, __webpack_exports__, __webpack_require__) {
|
10438 |
|
10439 | "use strict";
|
10440 | __webpack_exports__["a"] = toBufferView;
|
10441 | var __WEBPACK_IMPORTED_MODULE_0__getByteLength_js__ = __webpack_require__(139);
|
10442 |
|
10443 |
|
10444 |
|
10445 |
|
10446 | function toBufferView(bufferSource) {
|
10447 | return new Uint8Array(
|
10448 | bufferSource.buffer || bufferSource,
|
10449 | bufferSource.byteOffset || 0,
|
10450 | Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__["a" ])(bufferSource)
|
10451 | );
|
10452 | }
|
10453 |
|
10454 |
|
10455 | }),
|
10456 |
|
10457 | (function(module, __webpack_exports__, __webpack_require__) {
|
10458 |
|
10459 | "use strict";
|
10460 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10461 | var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(86);
|
10462 | var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(140);
|
10463 |
|
10464 |
|
10465 |
|
10466 |
|
10467 | __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'));
|
10468 |
|
10469 |
|
10470 | }),
|
10471 |
|
10472 | (function(module, __webpack_exports__, __webpack_require__) {
|
10473 |
|
10474 | "use strict";
|
10475 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10476 | var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(86);
|
10477 | var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(140);
|
10478 |
|
10479 |
|
10480 |
|
10481 |
|
10482 | __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'));
|
10483 |
|
10484 |
|
10485 | }),
|
10486 |
|
10487 | (function(module, __webpack_exports__, __webpack_require__) {
|
10488 |
|
10489 | "use strict";
|
10490 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10491 | var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(86);
|
10492 | var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(140);
|
10493 |
|
10494 |
|
10495 |
|
10496 |
|
10497 | __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'));
|
10498 |
|
10499 |
|
10500 | }),
|
10501 |
|
10502 | (function(module, __webpack_exports__, __webpack_require__) {
|
10503 |
|
10504 | "use strict";
|
10505 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(18);
|
10506 |
|
10507 |
|
10508 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('WeakSet'));
|
10509 |
|
10510 |
|
10511 | }),
|
10512 |
|
10513 | (function(module, __webpack_exports__, __webpack_require__) {
|
10514 |
|
10515 | "use strict";
|
10516 | __webpack_exports__["a"] = pairs;
|
10517 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(17);
|
10518 |
|
10519 |
|
10520 |
|
10521 |
|
10522 | function pairs(obj) {
|
10523 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(obj);
|
10524 | var length = _keys.length;
|
10525 | var pairs = Array(length);
|
10526 | for (var i = 0; i < length; i++) {
|
10527 | pairs[i] = [_keys[i], obj[_keys[i]]];
|
10528 | }
|
10529 | return pairs;
|
10530 | }
|
10531 |
|
10532 |
|
10533 | }),
|
10534 |
|
10535 | (function(module, __webpack_exports__, __webpack_require__) {
|
10536 |
|
10537 | "use strict";
|
10538 | __webpack_exports__["a"] = create;
|
10539 | var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(196);
|
10540 | var __WEBPACK_IMPORTED_MODULE_1__extendOwn_js__ = __webpack_require__(142);
|
10541 |
|
10542 |
|
10543 |
|
10544 |
|
10545 |
|
10546 |
|
10547 | function create(prototype, props) {
|
10548 | var result = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" ])(prototype);
|
10549 | if (props) Object(__WEBPACK_IMPORTED_MODULE_1__extendOwn_js__["a" ])(result, props);
|
10550 | return result;
|
10551 | }
|
10552 |
|
10553 |
|
10554 | }),
|
10555 |
|
10556 | (function(module, __webpack_exports__, __webpack_require__) {
|
10557 |
|
10558 | "use strict";
|
10559 | __webpack_exports__["a"] = tap;
|
10560 |
|
10561 |
|
10562 |
|
10563 | function tap(obj, interceptor) {
|
10564 | interceptor(obj);
|
10565 | return obj;
|
10566 | }
|
10567 |
|
10568 |
|
10569 | }),
|
10570 |
|
10571 | (function(module, __webpack_exports__, __webpack_require__) {
|
10572 |
|
10573 | "use strict";
|
10574 | __webpack_exports__["a"] = has;
|
10575 | var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(47);
|
10576 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(88);
|
10577 |
|
10578 |
|
10579 |
|
10580 |
|
10581 |
|
10582 |
|
10583 | function has(obj, path) {
|
10584 | path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" ])(path);
|
10585 | var length = path.length;
|
10586 | for (var i = 0; i < length; i++) {
|
10587 | var key = path[i];
|
10588 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" ])(obj, key)) return false;
|
10589 | obj = obj[key];
|
10590 | }
|
10591 | return !!length;
|
10592 | }
|
10593 |
|
10594 |
|
10595 | }),
|
10596 |
|
10597 | (function(module, __webpack_exports__, __webpack_require__) {
|
10598 |
|
10599 | "use strict";
|
10600 | __webpack_exports__["a"] = mapObject;
|
10601 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
10602 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(17);
|
10603 |
|
10604 |
|
10605 |
|
10606 |
|
10607 |
|
10608 | function mapObject(obj, iteratee, context) {
|
10609 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context);
|
10610 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj),
|
10611 | length = _keys.length,
|
10612 | results = {};
|
10613 | for (var index = 0; index < length; index++) {
|
10614 | var currentKey = _keys[index];
|
10615 | results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
|
10616 | }
|
10617 | return results;
|
10618 | }
|
10619 |
|
10620 |
|
10621 | }),
|
10622 |
|
10623 | (function(module, __webpack_exports__, __webpack_require__) {
|
10624 |
|
10625 | "use strict";
|
10626 | __webpack_exports__["a"] = propertyOf;
|
10627 | var __WEBPACK_IMPORTED_MODULE_0__noop_js__ = __webpack_require__(202);
|
10628 | var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(198);
|
10629 |
|
10630 |
|
10631 |
|
10632 |
|
10633 | function propertyOf(obj) {
|
10634 | if (obj == null) return __WEBPACK_IMPORTED_MODULE_0__noop_js__["a" ];
|
10635 | return function(path) {
|
10636 | return Object(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" ])(obj, path);
|
10637 | };
|
10638 | }
|
10639 |
|
10640 |
|
10641 | }),
|
10642 |
|
10643 | (function(module, __webpack_exports__, __webpack_require__) {
|
10644 |
|
10645 | "use strict";
|
10646 | __webpack_exports__["a"] = times;
|
10647 | var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(89);
|
10648 |
|
10649 |
|
10650 |
|
10651 | function times(n, iteratee, context) {
|
10652 | var accum = Array(Math.max(0, n));
|
10653 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" ])(iteratee, context, 1);
|
10654 | for (var i = 0; i < n; i++) accum[i] = iteratee(i);
|
10655 | return accum;
|
10656 | }
|
10657 |
|
10658 |
|
10659 | }),
|
10660 |
|
10661 | (function(module, __webpack_exports__, __webpack_require__) {
|
10662 |
|
10663 | "use strict";
|
10664 | var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(204);
|
10665 | var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(205);
|
10666 |
|
10667 |
|
10668 |
|
10669 |
|
10670 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" ]));
|
10671 |
|
10672 |
|
10673 | }),
|
10674 |
|
10675 | (function(module, __webpack_exports__, __webpack_require__) {
|
10676 |
|
10677 | "use strict";
|
10678 | var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(204);
|
10679 | var __WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__ = __webpack_require__(348);
|
10680 |
|
10681 |
|
10682 |
|
10683 |
|
10684 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__["a" ]));
|
10685 |
|
10686 |
|
10687 | }),
|
10688 |
|
10689 | (function(module, __webpack_exports__, __webpack_require__) {
|
10690 |
|
10691 | "use strict";
|
10692 | var __WEBPACK_IMPORTED_MODULE_0__invert_js__ = __webpack_require__(192);
|
10693 | var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(205);
|
10694 |
|
10695 |
|
10696 |
|
10697 |
|
10698 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__invert_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" ]));
|
10699 |
|
10700 |
|
10701 | }),
|
10702 |
|
10703 | (function(module, __webpack_exports__, __webpack_require__) {
|
10704 |
|
10705 | "use strict";
|
10706 | __webpack_exports__["a"] = template;
|
10707 | var __WEBPACK_IMPORTED_MODULE_0__defaults_js__ = __webpack_require__(195);
|
10708 | var __WEBPACK_IMPORTED_MODULE_1__underscore_js__ = __webpack_require__(25);
|
10709 | var __WEBPACK_IMPORTED_MODULE_2__templateSettings_js__ = __webpack_require__(206);
|
10710 |
|
10711 |
|
10712 |
|
10713 |
|
10714 |
|
10715 |
|
10716 |
|
10717 | var noMatch = /(.)^/;
|
10718 |
|
10719 |
|
10720 |
|
10721 | var escapes = {
|
10722 | "'": "'",
|
10723 | '\\': '\\',
|
10724 | '\r': 'r',
|
10725 | '\n': 'n',
|
10726 | '\u2028': 'u2028',
|
10727 | '\u2029': 'u2029'
|
10728 | };
|
10729 |
|
10730 | var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
|
10731 |
|
10732 | function escapeChar(match) {
|
10733 | return '\\' + escapes[match];
|
10734 | }
|
10735 |
|
10736 | var bareIdentifier = /^\s*(\w|\$)+\s*$/;
|
10737 |
|
10738 |
|
10739 |
|
10740 |
|
10741 |
|
10742 | function template(text, settings, oldSettings) {
|
10743 | if (!settings && oldSettings) settings = oldSettings;
|
10744 | settings = Object(__WEBPACK_IMPORTED_MODULE_0__defaults_js__["a" ])({}, settings, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" ].templateSettings);
|
10745 |
|
10746 |
|
10747 | var matcher = RegExp([
|
10748 | (settings.escape || noMatch).source,
|
10749 | (settings.interpolate || noMatch).source,
|
10750 | (settings.evaluate || noMatch).source
|
10751 | ].join('|') + '|$', 'g');
|
10752 |
|
10753 |
|
10754 | var index = 0;
|
10755 | var source = "__p+='";
|
10756 | text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
|
10757 | source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
|
10758 | index = offset + match.length;
|
10759 |
|
10760 | if (escape) {
|
10761 | source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
|
10762 | } else if (interpolate) {
|
10763 | source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
|
10764 | } else if (evaluate) {
|
10765 | source += "';\n" + evaluate + "\n__p+='";
|
10766 | }
|
10767 |
|
10768 |
|
10769 | return match;
|
10770 | });
|
10771 | source += "';\n";
|
10772 |
|
10773 | var argument = settings.variable;
|
10774 | if (argument) {
|
10775 | if (!bareIdentifier.test(argument)) throw new Error(argument);
|
10776 | } else {
|
10777 |
|
10778 | source = 'with(obj||{}){\n' + source + '}\n';
|
10779 | argument = 'obj';
|
10780 | }
|
10781 |
|
10782 | source = "var __t,__p='',__j=Array.prototype.join," +
|
10783 | "print=function(){__p+=__j.call(arguments,'');};\n" +
|
10784 | source + 'return __p;\n';
|
10785 |
|
10786 | var render;
|
10787 | try {
|
10788 | render = new Function(argument, '_', source);
|
10789 | } catch (e) {
|
10790 | e.source = source;
|
10791 | throw e;
|
10792 | }
|
10793 |
|
10794 | var template = function(data) {
|
10795 | return render.call(this, data, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" ]);
|
10796 | };
|
10797 |
|
10798 |
|
10799 | template.source = 'function(' + argument + '){\n' + source + '}';
|
10800 |
|
10801 | return template;
|
10802 | }
|
10803 |
|
10804 |
|
10805 | }),
|
10806 |
|
10807 | (function(module, __webpack_exports__, __webpack_require__) {
|
10808 |
|
10809 | "use strict";
|
10810 | __webpack_exports__["a"] = result;
|
10811 | var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(30);
|
10812 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(88);
|
10813 |
|
10814 |
|
10815 |
|
10816 |
|
10817 |
|
10818 |
|
10819 | function result(obj, path, fallback) {
|
10820 | path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" ])(path);
|
10821 | var length = path.length;
|
10822 | if (!length) {
|
10823 | return Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" ])(fallback) ? fallback.call(obj) : fallback;
|
10824 | }
|
10825 | for (var i = 0; i < length; i++) {
|
10826 | var prop = obj == null ? void 0 : obj[path[i]];
|
10827 | if (prop === void 0) {
|
10828 | prop = fallback;
|
10829 | i = length;
|
10830 | }
|
10831 | obj = Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" ])(prop) ? prop.call(obj) : prop;
|
10832 | }
|
10833 | return obj;
|
10834 | }
|
10835 |
|
10836 |
|
10837 | }),
|
10838 |
|
10839 | (function(module, __webpack_exports__, __webpack_require__) {
|
10840 |
|
10841 | "use strict";
|
10842 | __webpack_exports__["a"] = uniqueId;
|
10843 |
|
10844 |
|
10845 | var idCounter = 0;
|
10846 | function uniqueId(prefix) {
|
10847 | var id = ++idCounter + '';
|
10848 | return prefix ? prefix + id : id;
|
10849 | }
|
10850 |
|
10851 |
|
10852 | }),
|
10853 |
|
10854 | (function(module, __webpack_exports__, __webpack_require__) {
|
10855 |
|
10856 | "use strict";
|
10857 | __webpack_exports__["a"] = chain;
|
10858 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
10859 |
|
10860 |
|
10861 |
|
10862 | function chain(obj) {
|
10863 | var instance = Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ])(obj);
|
10864 | instance._chain = true;
|
10865 | return instance;
|
10866 | }
|
10867 |
|
10868 |
|
10869 | }),
|
10870 |
|
10871 | (function(module, __webpack_exports__, __webpack_require__) {
|
10872 |
|
10873 | "use strict";
|
10874 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
10875 | var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(72);
|
10876 | var __WEBPACK_IMPORTED_MODULE_2__bind_js__ = __webpack_require__(208);
|
10877 |
|
10878 |
|
10879 |
|
10880 |
|
10881 |
|
10882 |
|
10883 |
|
10884 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, keys) {
|
10885 | keys = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" ])(keys, false, false);
|
10886 | var index = keys.length;
|
10887 | if (index < 1) throw new Error('bindAll must be passed function names');
|
10888 | while (index--) {
|
10889 | var key = keys[index];
|
10890 | obj[key] = Object(__WEBPACK_IMPORTED_MODULE_2__bind_js__["a" ])(obj[key], obj);
|
10891 | }
|
10892 | return obj;
|
10893 | }));
|
10894 |
|
10895 |
|
10896 | }),
|
10897 |
|
10898 | (function(module, __webpack_exports__, __webpack_require__) {
|
10899 |
|
10900 | "use strict";
|
10901 | __webpack_exports__["a"] = memoize;
|
10902 | var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(47);
|
10903 |
|
10904 |
|
10905 |
|
10906 | function memoize(func, hasher) {
|
10907 | var memoize = function(key) {
|
10908 | var cache = memoize.cache;
|
10909 | var address = '' + (hasher ? hasher.apply(this, arguments) : key);
|
10910 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" ])(cache, address)) cache[address] = func.apply(this, arguments);
|
10911 | return cache[address];
|
10912 | };
|
10913 | memoize.cache = {};
|
10914 | return memoize;
|
10915 | }
|
10916 |
|
10917 |
|
10918 | }),
|
10919 |
|
10920 | (function(module, __webpack_exports__, __webpack_require__) {
|
10921 |
|
10922 | "use strict";
|
10923 | var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(114);
|
10924 | var __WEBPACK_IMPORTED_MODULE_1__delay_js__ = __webpack_require__(209);
|
10925 | var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(25);
|
10926 |
|
10927 |
|
10928 |
|
10929 |
|
10930 |
|
10931 |
|
10932 | __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));
|
10933 |
|
10934 |
|
10935 | }),
|
10936 |
|
10937 | (function(module, __webpack_exports__, __webpack_require__) {
|
10938 |
|
10939 | "use strict";
|
10940 | __webpack_exports__["a"] = throttle;
|
10941 | var __WEBPACK_IMPORTED_MODULE_0__now_js__ = __webpack_require__(146);
|
10942 |
|
10943 |
|
10944 |
|
10945 |
|
10946 |
|
10947 |
|
10948 |
|
10949 | function throttle(func, wait, options) {
|
10950 | var timeout, context, args, result;
|
10951 | var previous = 0;
|
10952 | if (!options) options = {};
|
10953 |
|
10954 | var later = function() {
|
10955 | previous = options.leading === false ? 0 : Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" ])();
|
10956 | timeout = null;
|
10957 | result = func.apply(context, args);
|
10958 | if (!timeout) context = args = null;
|
10959 | };
|
10960 |
|
10961 | var throttled = function() {
|
10962 | var _now = Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" ])();
|
10963 | if (!previous && options.leading === false) previous = _now;
|
10964 | var remaining = wait - (_now - previous);
|
10965 | context = this;
|
10966 | args = arguments;
|
10967 | if (remaining <= 0 || remaining > wait) {
|
10968 | if (timeout) {
|
10969 | clearTimeout(timeout);
|
10970 | timeout = null;
|
10971 | }
|
10972 | previous = _now;
|
10973 | result = func.apply(context, args);
|
10974 | if (!timeout) context = args = null;
|
10975 | } else if (!timeout && options.trailing !== false) {
|
10976 | timeout = setTimeout(later, remaining);
|
10977 | }
|
10978 | return result;
|
10979 | };
|
10980 |
|
10981 | throttled.cancel = function() {
|
10982 | clearTimeout(timeout);
|
10983 | previous = 0;
|
10984 | timeout = context = args = null;
|
10985 | };
|
10986 |
|
10987 | return throttled;
|
10988 | }
|
10989 |
|
10990 |
|
10991 | }),
|
10992 |
|
10993 | (function(module, __webpack_exports__, __webpack_require__) {
|
10994 |
|
10995 | "use strict";
|
10996 | __webpack_exports__["a"] = debounce;
|
10997 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
10998 | var __WEBPACK_IMPORTED_MODULE_1__now_js__ = __webpack_require__(146);
|
10999 |
|
11000 |
|
11001 |
|
11002 |
|
11003 |
|
11004 |
|
11005 |
|
11006 | function debounce(func, wait, immediate) {
|
11007 | var timeout, previous, args, result, context;
|
11008 |
|
11009 | var later = function() {
|
11010 | var passed = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" ])() - previous;
|
11011 | if (wait > passed) {
|
11012 | timeout = setTimeout(later, wait - passed);
|
11013 | } else {
|
11014 | timeout = null;
|
11015 | if (!immediate) result = func.apply(context, args);
|
11016 |
|
11017 | if (!timeout) args = context = null;
|
11018 | }
|
11019 | };
|
11020 |
|
11021 | var debounced = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(_args) {
|
11022 | context = this;
|
11023 | args = _args;
|
11024 | previous = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" ])();
|
11025 | if (!timeout) {
|
11026 | timeout = setTimeout(later, wait);
|
11027 | if (immediate) result = func.apply(context, args);
|
11028 | }
|
11029 | return result;
|
11030 | });
|
11031 |
|
11032 | debounced.cancel = function() {
|
11033 | clearTimeout(timeout);
|
11034 | timeout = args = context = null;
|
11035 | };
|
11036 |
|
11037 | return debounced;
|
11038 | }
|
11039 |
|
11040 |
|
11041 | }),
|
11042 |
|
11043 | (function(module, __webpack_exports__, __webpack_require__) {
|
11044 |
|
11045 | "use strict";
|
11046 | __webpack_exports__["a"] = wrap;
|
11047 | var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(114);
|
11048 |
|
11049 |
|
11050 |
|
11051 |
|
11052 |
|
11053 | function wrap(func, wrapper) {
|
11054 | return Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" ])(wrapper, func);
|
11055 | }
|
11056 |
|
11057 |
|
11058 | }),
|
11059 |
|
11060 | (function(module, __webpack_exports__, __webpack_require__) {
|
11061 |
|
11062 | "use strict";
|
11063 | __webpack_exports__["a"] = compose;
|
11064 |
|
11065 |
|
11066 | function compose() {
|
11067 | var args = arguments;
|
11068 | var start = args.length - 1;
|
11069 | return function() {
|
11070 | var i = start;
|
11071 | var result = args[start].apply(this, arguments);
|
11072 | while (i--) result = args[i].call(this, result);
|
11073 | return result;
|
11074 | };
|
11075 | }
|
11076 |
|
11077 |
|
11078 | }),
|
11079 |
|
11080 | (function(module, __webpack_exports__, __webpack_require__) {
|
11081 |
|
11082 | "use strict";
|
11083 | __webpack_exports__["a"] = after;
|
11084 |
|
11085 | function after(times, func) {
|
11086 | return function() {
|
11087 | if (--times < 1) {
|
11088 | return func.apply(this, arguments);
|
11089 | }
|
11090 | };
|
11091 | }
|
11092 |
|
11093 |
|
11094 | }),
|
11095 |
|
11096 | (function(module, __webpack_exports__, __webpack_require__) {
|
11097 |
|
11098 | "use strict";
|
11099 | var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(114);
|
11100 | var __WEBPACK_IMPORTED_MODULE_1__before_js__ = __webpack_require__(210);
|
11101 |
|
11102 |
|
11103 |
|
11104 |
|
11105 |
|
11106 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__before_js__["a" ], 2));
|
11107 |
|
11108 |
|
11109 | }),
|
11110 |
|
11111 | (function(module, __webpack_exports__, __webpack_require__) {
|
11112 |
|
11113 | "use strict";
|
11114 | var __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__ = __webpack_require__(213);
|
11115 | var __WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__ = __webpack_require__(216);
|
11116 |
|
11117 |
|
11118 |
|
11119 |
|
11120 |
|
11121 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__["a" ])(-1, __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__["a" ]));
|
11122 |
|
11123 |
|
11124 | }),
|
11125 |
|
11126 | (function(module, __webpack_exports__, __webpack_require__) {
|
11127 |
|
11128 | "use strict";
|
11129 | __webpack_exports__["a"] = findWhere;
|
11130 | var __WEBPACK_IMPORTED_MODULE_0__find_js__ = __webpack_require__(217);
|
11131 | var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(113);
|
11132 |
|
11133 |
|
11134 |
|
11135 |
|
11136 |
|
11137 | function findWhere(obj, attrs) {
|
11138 | return Object(__WEBPACK_IMPORTED_MODULE_0__find_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" ])(attrs));
|
11139 | }
|
11140 |
|
11141 |
|
11142 | }),
|
11143 |
|
11144 | (function(module, __webpack_exports__, __webpack_require__) {
|
11145 |
|
11146 | "use strict";
|
11147 | var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(218);
|
11148 |
|
11149 |
|
11150 |
|
11151 |
|
11152 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" ])(1));
|
11153 |
|
11154 |
|
11155 | }),
|
11156 |
|
11157 | (function(module, __webpack_exports__, __webpack_require__) {
|
11158 |
|
11159 | "use strict";
|
11160 | var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(218);
|
11161 |
|
11162 |
|
11163 |
|
11164 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" ])(-1));
|
11165 |
|
11166 |
|
11167 | }),
|
11168 |
|
11169 | (function(module, __webpack_exports__, __webpack_require__) {
|
11170 |
|
11171 | "use strict";
|
11172 | __webpack_exports__["a"] = reject;
|
11173 | var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(90);
|
11174 | var __WEBPACK_IMPORTED_MODULE_1__negate_js__ = __webpack_require__(147);
|
11175 | var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(22);
|
11176 |
|
11177 |
|
11178 |
|
11179 |
|
11180 |
|
11181 | function reject(obj, predicate, context) {
|
11182 | 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);
|
11183 | }
|
11184 |
|
11185 |
|
11186 | }),
|
11187 |
|
11188 | (function(module, __webpack_exports__, __webpack_require__) {
|
11189 |
|
11190 | "use strict";
|
11191 | __webpack_exports__["a"] = every;
|
11192 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
11193 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
11194 | var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(17);
|
11195 |
|
11196 |
|
11197 |
|
11198 |
|
11199 |
|
11200 | function every(obj, predicate, context) {
|
11201 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
11202 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" ])(obj),
|
11203 | length = (_keys || obj).length;
|
11204 | for (var index = 0; index < length; index++) {
|
11205 | var currentKey = _keys ? _keys[index] : index;
|
11206 | if (!predicate(obj[currentKey], currentKey, obj)) return false;
|
11207 | }
|
11208 | return true;
|
11209 | }
|
11210 |
|
11211 |
|
11212 | }),
|
11213 |
|
11214 | (function(module, __webpack_exports__, __webpack_require__) {
|
11215 |
|
11216 | "use strict";
|
11217 | __webpack_exports__["a"] = some;
|
11218 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
11219 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
11220 | var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(17);
|
11221 |
|
11222 |
|
11223 |
|
11224 |
|
11225 |
|
11226 | function some(obj, predicate, context) {
|
11227 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
11228 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" ])(obj),
|
11229 | length = (_keys || obj).length;
|
11230 | for (var index = 0; index < length; index++) {
|
11231 | var currentKey = _keys ? _keys[index] : index;
|
11232 | if (predicate(obj[currentKey], currentKey, obj)) return true;
|
11233 | }
|
11234 | return false;
|
11235 | }
|
11236 |
|
11237 |
|
11238 | }),
|
11239 |
|
11240 | (function(module, __webpack_exports__, __webpack_require__) {
|
11241 |
|
11242 | "use strict";
|
11243 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11244 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
11245 | var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(73);
|
11246 | var __WEBPACK_IMPORTED_MODULE_3__deepGet_js__ = __webpack_require__(143);
|
11247 | var __WEBPACK_IMPORTED_MODULE_4__toPath_js__ = __webpack_require__(88);
|
11248 |
|
11249 |
|
11250 |
|
11251 |
|
11252 |
|
11253 |
|
11254 |
|
11255 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, path, args) {
|
11256 | var contextPath, func;
|
11257 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(path)) {
|
11258 | func = path;
|
11259 | } else {
|
11260 | path = Object(__WEBPACK_IMPORTED_MODULE_4__toPath_js__["a" ])(path);
|
11261 | contextPath = path.slice(0, -1);
|
11262 | path = path[path.length - 1];
|
11263 | }
|
11264 | return Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" ])(obj, function(context) {
|
11265 | var method = func;
|
11266 | if (!method) {
|
11267 | if (contextPath && contextPath.length) {
|
11268 | context = Object(__WEBPACK_IMPORTED_MODULE_3__deepGet_js__["a" ])(context, contextPath);
|
11269 | }
|
11270 | if (context == null) return void 0;
|
11271 | method = context[path];
|
11272 | }
|
11273 | return method == null ? method : method.apply(context, args);
|
11274 | });
|
11275 | }));
|
11276 |
|
11277 |
|
11278 | }),
|
11279 |
|
11280 | (function(module, __webpack_exports__, __webpack_require__) {
|
11281 |
|
11282 | "use strict";
|
11283 | __webpack_exports__["a"] = where;
|
11284 | var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(90);
|
11285 | var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(113);
|
11286 |
|
11287 |
|
11288 |
|
11289 |
|
11290 |
|
11291 | function where(obj, attrs) {
|
11292 | return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" ])(attrs));
|
11293 | }
|
11294 |
|
11295 |
|
11296 | }),
|
11297 |
|
11298 | (function(module, __webpack_exports__, __webpack_require__) {
|
11299 |
|
11300 | "use strict";
|
11301 | __webpack_exports__["a"] = min;
|
11302 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
11303 | var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(71);
|
11304 | var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(22);
|
11305 | var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(60);
|
11306 |
|
11307 |
|
11308 |
|
11309 |
|
11310 |
|
11311 |
|
11312 | function min(obj, iteratee, context) {
|
11313 | var result = Infinity, lastComputed = Infinity,
|
11314 | value, computed;
|
11315 | if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
|
11316 | obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" ])(obj);
|
11317 | for (var i = 0, length = obj.length; i < length; i++) {
|
11318 | value = obj[i];
|
11319 | if (value != null && value < result) {
|
11320 | result = value;
|
11321 | }
|
11322 | }
|
11323 | } else {
|
11324 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" ])(iteratee, context);
|
11325 | Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" ])(obj, function(v, index, list) {
|
11326 | computed = iteratee(v, index, list);
|
11327 | if (computed < lastComputed || computed === Infinity && result === Infinity) {
|
11328 | result = v;
|
11329 | lastComputed = computed;
|
11330 | }
|
11331 | });
|
11332 | }
|
11333 | return result;
|
11334 | }
|
11335 |
|
11336 |
|
11337 | }),
|
11338 |
|
11339 | (function(module, __webpack_exports__, __webpack_require__) {
|
11340 |
|
11341 | "use strict";
|
11342 | __webpack_exports__["a"] = shuffle;
|
11343 | var __WEBPACK_IMPORTED_MODULE_0__sample_js__ = __webpack_require__(220);
|
11344 |
|
11345 |
|
11346 |
|
11347 | function shuffle(obj) {
|
11348 | return Object(__WEBPACK_IMPORTED_MODULE_0__sample_js__["a" ])(obj, Infinity);
|
11349 | }
|
11350 |
|
11351 |
|
11352 | }),
|
11353 |
|
11354 | (function(module, __webpack_exports__, __webpack_require__) {
|
11355 |
|
11356 | "use strict";
|
11357 | __webpack_exports__["a"] = sortBy;
|
11358 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(22);
|
11359 | var __WEBPACK_IMPORTED_MODULE_1__pluck_js__ = __webpack_require__(149);
|
11360 | var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(73);
|
11361 |
|
11362 |
|
11363 |
|
11364 |
|
11365 |
|
11366 | function sortBy(obj, iteratee, context) {
|
11367 | var index = 0;
|
11368 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context);
|
11369 | return Object(__WEBPACK_IMPORTED_MODULE_1__pluck_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" ])(obj, function(value, key, list) {
|
11370 | return {
|
11371 | value: value,
|
11372 | index: index++,
|
11373 | criteria: iteratee(value, key, list)
|
11374 | };
|
11375 | }).sort(function(left, right) {
|
11376 | var a = left.criteria;
|
11377 | var b = right.criteria;
|
11378 | if (a !== b) {
|
11379 | if (a > b || a === void 0) return 1;
|
11380 | if (a < b || b === void 0) return -1;
|
11381 | }
|
11382 | return left.index - right.index;
|
11383 | }), 'value');
|
11384 | }
|
11385 |
|
11386 |
|
11387 | }),
|
11388 |
|
11389 | (function(module, __webpack_exports__, __webpack_require__) {
|
11390 |
|
11391 | "use strict";
|
11392 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(115);
|
11393 | var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(47);
|
11394 |
|
11395 |
|
11396 |
|
11397 |
|
11398 |
|
11399 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, key) {
|
11400 | if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" ])(result, key)) result[key].push(value); else result[key] = [value];
|
11401 | }));
|
11402 |
|
11403 |
|
11404 | }),
|
11405 |
|
11406 | (function(module, __webpack_exports__, __webpack_require__) {
|
11407 |
|
11408 | "use strict";
|
11409 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(115);
|
11410 |
|
11411 |
|
11412 |
|
11413 |
|
11414 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, key) {
|
11415 | result[key] = value;
|
11416 | }));
|
11417 |
|
11418 |
|
11419 | }),
|
11420 |
|
11421 | (function(module, __webpack_exports__, __webpack_require__) {
|
11422 |
|
11423 | "use strict";
|
11424 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(115);
|
11425 | var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(47);
|
11426 |
|
11427 |
|
11428 |
|
11429 |
|
11430 |
|
11431 |
|
11432 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, key) {
|
11433 | if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" ])(result, key)) result[key]++; else result[key] = 1;
|
11434 | }));
|
11435 |
|
11436 |
|
11437 | }),
|
11438 |
|
11439 | (function(module, __webpack_exports__, __webpack_require__) {
|
11440 |
|
11441 | "use strict";
|
11442 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(115);
|
11443 |
|
11444 |
|
11445 |
|
11446 |
|
11447 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, pass) {
|
11448 | result[pass ? 0 : 1].push(value);
|
11449 | }, true));
|
11450 |
|
11451 |
|
11452 | }),
|
11453 |
|
11454 | (function(module, __webpack_exports__, __webpack_require__) {
|
11455 |
|
11456 | "use strict";
|
11457 | __webpack_exports__["a"] = toArray;
|
11458 | var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(59);
|
11459 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
11460 | var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(136);
|
11461 | var __WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__ = __webpack_require__(26);
|
11462 | var __WEBPACK_IMPORTED_MODULE_4__map_js__ = __webpack_require__(73);
|
11463 | var __WEBPACK_IMPORTED_MODULE_5__identity_js__ = __webpack_require__(144);
|
11464 | var __WEBPACK_IMPORTED_MODULE_6__values_js__ = __webpack_require__(71);
|
11465 |
|
11466 |
|
11467 |
|
11468 |
|
11469 |
|
11470 |
|
11471 |
|
11472 |
|
11473 |
|
11474 | var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
|
11475 | function toArray(obj) {
|
11476 | if (!obj) return [];
|
11477 | if (Object(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" ])(obj)) return __WEBPACK_IMPORTED_MODULE_1__setup_js__["q" ].call(obj);
|
11478 | if (Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" ])(obj)) {
|
11479 |
|
11480 | return obj.match(reStrSymbol);
|
11481 | }
|
11482 | 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" ]);
|
11483 | return Object(__WEBPACK_IMPORTED_MODULE_6__values_js__["a" ])(obj);
|
11484 | }
|
11485 |
|
11486 |
|
11487 | }),
|
11488 |
|
11489 | (function(module, __webpack_exports__, __webpack_require__) {
|
11490 |
|
11491 | "use strict";
|
11492 | __webpack_exports__["a"] = size;
|
11493 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
11494 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(17);
|
11495 |
|
11496 |
|
11497 |
|
11498 |
|
11499 | function size(obj) {
|
11500 | if (obj == null) return 0;
|
11501 | return Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? obj.length : Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj).length;
|
11502 | }
|
11503 |
|
11504 |
|
11505 | }),
|
11506 |
|
11507 | (function(module, __webpack_exports__, __webpack_require__) {
|
11508 |
|
11509 | "use strict";
|
11510 | __webpack_exports__["a"] = keyInObj;
|
11511 |
|
11512 |
|
11513 | function keyInObj(value, key, obj) {
|
11514 | return key in obj;
|
11515 | }
|
11516 |
|
11517 |
|
11518 | }),
|
11519 |
|
11520 | (function(module, __webpack_exports__, __webpack_require__) {
|
11521 |
|
11522 | "use strict";
|
11523 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11524 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(30);
|
11525 | var __WEBPACK_IMPORTED_MODULE_2__negate_js__ = __webpack_require__(147);
|
11526 | var __WEBPACK_IMPORTED_MODULE_3__map_js__ = __webpack_require__(73);
|
11527 | var __WEBPACK_IMPORTED_MODULE_4__flatten_js__ = __webpack_require__(72);
|
11528 | var __WEBPACK_IMPORTED_MODULE_5__contains_js__ = __webpack_require__(91);
|
11529 | var __WEBPACK_IMPORTED_MODULE_6__pick_js__ = __webpack_require__(221);
|
11530 |
|
11531 |
|
11532 |
|
11533 |
|
11534 |
|
11535 |
|
11536 |
|
11537 |
|
11538 |
|
11539 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, keys) {
|
11540 | var iteratee = keys[0], context;
|
11541 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(iteratee)) {
|
11542 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__negate_js__["a" ])(iteratee);
|
11543 | if (keys.length > 1) context = keys[1];
|
11544 | } else {
|
11545 | keys = Object(__WEBPACK_IMPORTED_MODULE_3__map_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_4__flatten_js__["a" ])(keys, false, false), String);
|
11546 | iteratee = function(value, key) {
|
11547 | return !Object(__WEBPACK_IMPORTED_MODULE_5__contains_js__["a" ])(keys, key);
|
11548 | };
|
11549 | }
|
11550 | return Object(__WEBPACK_IMPORTED_MODULE_6__pick_js__["a" ])(obj, iteratee, context);
|
11551 | }));
|
11552 |
|
11553 |
|
11554 | }),
|
11555 |
|
11556 | (function(module, __webpack_exports__, __webpack_require__) {
|
11557 |
|
11558 | "use strict";
|
11559 | __webpack_exports__["a"] = first;
|
11560 | var __WEBPACK_IMPORTED_MODULE_0__initial_js__ = __webpack_require__(222);
|
11561 |
|
11562 |
|
11563 |
|
11564 |
|
11565 | function first(array, n, guard) {
|
11566 | if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
|
11567 | if (n == null || guard) return array[0];
|
11568 | return Object(__WEBPACK_IMPORTED_MODULE_0__initial_js__["a" ])(array, array.length - n);
|
11569 | }
|
11570 |
|
11571 |
|
11572 | }),
|
11573 |
|
11574 | (function(module, __webpack_exports__, __webpack_require__) {
|
11575 |
|
11576 | "use strict";
|
11577 | __webpack_exports__["a"] = last;
|
11578 | var __WEBPACK_IMPORTED_MODULE_0__rest_js__ = __webpack_require__(223);
|
11579 |
|
11580 |
|
11581 |
|
11582 |
|
11583 | function last(array, n, guard) {
|
11584 | if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
|
11585 | if (n == null || guard) return array[array.length - 1];
|
11586 | return Object(__WEBPACK_IMPORTED_MODULE_0__rest_js__["a" ])(array, Math.max(0, array.length - n));
|
11587 | }
|
11588 |
|
11589 |
|
11590 | }),
|
11591 |
|
11592 | (function(module, __webpack_exports__, __webpack_require__) {
|
11593 |
|
11594 | "use strict";
|
11595 | __webpack_exports__["a"] = compact;
|
11596 | var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(90);
|
11597 |
|
11598 |
|
11599 |
|
11600 | function compact(array) {
|
11601 | return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" ])(array, Boolean);
|
11602 | }
|
11603 |
|
11604 |
|
11605 | }),
|
11606 |
|
11607 | (function(module, __webpack_exports__, __webpack_require__) {
|
11608 |
|
11609 | "use strict";
|
11610 | __webpack_exports__["a"] = flatten;
|
11611 | var __WEBPACK_IMPORTED_MODULE_0__flatten_js__ = __webpack_require__(72);
|
11612 |
|
11613 |
|
11614 |
|
11615 |
|
11616 | function flatten(array, depth) {
|
11617 | return Object(__WEBPACK_IMPORTED_MODULE_0__flatten_js__["a" ])(array, depth, false);
|
11618 | }
|
11619 |
|
11620 |
|
11621 | }),
|
11622 |
|
11623 | (function(module, __webpack_exports__, __webpack_require__) {
|
11624 |
|
11625 | "use strict";
|
11626 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11627 | var __WEBPACK_IMPORTED_MODULE_1__difference_js__ = __webpack_require__(224);
|
11628 |
|
11629 |
|
11630 |
|
11631 |
|
11632 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(array, otherArrays) {
|
11633 | return Object(__WEBPACK_IMPORTED_MODULE_1__difference_js__["a" ])(array, otherArrays);
|
11634 | }));
|
11635 |
|
11636 |
|
11637 | }),
|
11638 |
|
11639 | (function(module, __webpack_exports__, __webpack_require__) {
|
11640 |
|
11641 | "use strict";
|
11642 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11643 | var __WEBPACK_IMPORTED_MODULE_1__uniq_js__ = __webpack_require__(225);
|
11644 | var __WEBPACK_IMPORTED_MODULE_2__flatten_js__ = __webpack_require__(72);
|
11645 |
|
11646 |
|
11647 |
|
11648 |
|
11649 |
|
11650 |
|
11651 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(arrays) {
|
11652 | return Object(__WEBPACK_IMPORTED_MODULE_1__uniq_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__flatten_js__["a" ])(arrays, true, true));
|
11653 | }));
|
11654 |
|
11655 |
|
11656 | }),
|
11657 |
|
11658 | (function(module, __webpack_exports__, __webpack_require__) {
|
11659 |
|
11660 | "use strict";
|
11661 | __webpack_exports__["a"] = intersection;
|
11662 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
11663 | var __WEBPACK_IMPORTED_MODULE_1__contains_js__ = __webpack_require__(91);
|
11664 |
|
11665 |
|
11666 |
|
11667 |
|
11668 |
|
11669 | function intersection(array) {
|
11670 | var result = [];
|
11671 | var argsLength = arguments.length;
|
11672 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(array); i < length; i++) {
|
11673 | var item = array[i];
|
11674 | if (Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" ])(result, item)) continue;
|
11675 | var j;
|
11676 | for (j = 1; j < argsLength; j++) {
|
11677 | if (!Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" ])(arguments[j], item)) break;
|
11678 | }
|
11679 | if (j === argsLength) result.push(item);
|
11680 | }
|
11681 | return result;
|
11682 | }
|
11683 |
|
11684 |
|
11685 | }),
|
11686 |
|
11687 | (function(module, __webpack_exports__, __webpack_require__) {
|
11688 |
|
11689 | "use strict";
|
11690 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11691 | var __WEBPACK_IMPORTED_MODULE_1__unzip_js__ = __webpack_require__(226);
|
11692 |
|
11693 |
|
11694 |
|
11695 |
|
11696 |
|
11697 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__unzip_js__["a" ]));
|
11698 |
|
11699 |
|
11700 | }),
|
11701 |
|
11702 | (function(module, __webpack_exports__, __webpack_require__) {
|
11703 |
|
11704 | "use strict";
|
11705 | __webpack_exports__["a"] = object;
|
11706 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(31);
|
11707 |
|
11708 |
|
11709 |
|
11710 |
|
11711 |
|
11712 | function object(list, values) {
|
11713 | var result = {};
|
11714 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(list); i < length; i++) {
|
11715 | if (values) {
|
11716 | result[list[i]] = values[i];
|
11717 | } else {
|
11718 | result[list[i][0]] = list[i][1];
|
11719 | }
|
11720 | }
|
11721 | return result;
|
11722 | }
|
11723 |
|
11724 |
|
11725 | }),
|
11726 |
|
11727 | (function(module, __webpack_exports__, __webpack_require__) {
|
11728 |
|
11729 | "use strict";
|
11730 | __webpack_exports__["a"] = range;
|
11731 |
|
11732 |
|
11733 |
|
11734 | function range(start, stop, step) {
|
11735 | if (stop == null) {
|
11736 | stop = start || 0;
|
11737 | start = 0;
|
11738 | }
|
11739 | if (!step) {
|
11740 | step = stop < start ? -1 : 1;
|
11741 | }
|
11742 |
|
11743 | var length = Math.max(Math.ceil((stop - start) / step), 0);
|
11744 | var range = Array(length);
|
11745 |
|
11746 | for (var idx = 0; idx < length; idx++, start += step) {
|
11747 | range[idx] = start;
|
11748 | }
|
11749 |
|
11750 | return range;
|
11751 | }
|
11752 |
|
11753 |
|
11754 | }),
|
11755 |
|
11756 | (function(module, __webpack_exports__, __webpack_require__) {
|
11757 |
|
11758 | "use strict";
|
11759 | __webpack_exports__["a"] = chunk;
|
11760 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
11761 |
|
11762 |
|
11763 |
|
11764 |
|
11765 | function chunk(array, count) {
|
11766 | if (count == null || count < 1) return [];
|
11767 | var result = [];
|
11768 | var i = 0, length = array.length;
|
11769 | while (i < length) {
|
11770 | result.push(__WEBPACK_IMPORTED_MODULE_0__setup_js__["q" ].call(array, i, i += count));
|
11771 | }
|
11772 | return result;
|
11773 | }
|
11774 |
|
11775 |
|
11776 | }),
|
11777 |
|
11778 | (function(module, __webpack_exports__, __webpack_require__) {
|
11779 |
|
11780 | "use strict";
|
11781 | __webpack_exports__["a"] = mixin;
|
11782 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
11783 | var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(60);
|
11784 | var __WEBPACK_IMPORTED_MODULE_2__functions_js__ = __webpack_require__(193);
|
11785 | var __WEBPACK_IMPORTED_MODULE_3__setup_js__ = __webpack_require__(6);
|
11786 | var __WEBPACK_IMPORTED_MODULE_4__chainResult_js__ = __webpack_require__(227);
|
11787 |
|
11788 |
|
11789 |
|
11790 |
|
11791 |
|
11792 |
|
11793 |
|
11794 | function mixin(obj) {
|
11795 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__functions_js__["a" ])(obj), function(name) {
|
11796 | var func = __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ][name] = obj[name];
|
11797 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].prototype[name] = function() {
|
11798 | var args = [this._wrapped];
|
11799 | __WEBPACK_IMPORTED_MODULE_3__setup_js__["o" ].apply(args, arguments);
|
11800 | return Object(__WEBPACK_IMPORTED_MODULE_4__chainResult_js__["a" ])(this, func.apply(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ], args));
|
11801 | };
|
11802 | });
|
11803 | return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ];
|
11804 | }
|
11805 |
|
11806 |
|
11807 | }),
|
11808 |
|
11809 | (function(module, __webpack_exports__, __webpack_require__) {
|
11810 |
|
11811 | "use strict";
|
11812 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
11813 | var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(60);
|
11814 | var __WEBPACK_IMPORTED_MODULE_2__setup_js__ = __webpack_require__(6);
|
11815 | var __WEBPACK_IMPORTED_MODULE_3__chainResult_js__ = __webpack_require__(227);
|
11816 |
|
11817 |
|
11818 |
|
11819 |
|
11820 |
|
11821 |
|
11822 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
|
11823 | var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" ][name];
|
11824 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].prototype[name] = function() {
|
11825 | var obj = this._wrapped;
|
11826 | if (obj != null) {
|
11827 | method.apply(obj, arguments);
|
11828 | if ((name === 'shift' || name === 'splice') && obj.length === 0) {
|
11829 | delete obj[0];
|
11830 | }
|
11831 | }
|
11832 | return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" ])(this, obj);
|
11833 | };
|
11834 | });
|
11835 |
|
11836 |
|
11837 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(['concat', 'join', 'slice'], function(name) {
|
11838 | var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" ][name];
|
11839 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].prototype[name] = function() {
|
11840 | var obj = this._wrapped;
|
11841 | if (obj != null) obj = method.apply(obj, arguments);
|
11842 | return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" ])(this, obj);
|
11843 | };
|
11844 | });
|
11845 |
|
11846 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ]);
|
11847 |
|
11848 |
|
11849 | }),
|
11850 |
|
11851 | (function(module, exports, __webpack_require__) {
|
11852 |
|
11853 | var parent = __webpack_require__(396);
|
11854 |
|
11855 | module.exports = parent;
|
11856 |
|
11857 |
|
11858 | }),
|
11859 |
|
11860 | (function(module, exports, __webpack_require__) {
|
11861 |
|
11862 | var isPrototypeOf = __webpack_require__(16);
|
11863 | var method = __webpack_require__(397);
|
11864 |
|
11865 | var ArrayPrototype = Array.prototype;
|
11866 |
|
11867 | module.exports = function (it) {
|
11868 | var own = it.concat;
|
11869 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;
|
11870 | };
|
11871 |
|
11872 |
|
11873 | }),
|
11874 |
|
11875 | (function(module, exports, __webpack_require__) {
|
11876 |
|
11877 | __webpack_require__(228);
|
11878 | var entryVirtual = __webpack_require__(27);
|
11879 |
|
11880 | module.exports = entryVirtual('Array').concat;
|
11881 |
|
11882 |
|
11883 | }),
|
11884 |
|
11885 | (function(module, exports) {
|
11886 |
|
11887 | var $TypeError = TypeError;
|
11888 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
11889 |
|
11890 | module.exports = function (it) {
|
11891 | if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
|
11892 | return it;
|
11893 | };
|
11894 |
|
11895 |
|
11896 | }),
|
11897 |
|
11898 | (function(module, exports, __webpack_require__) {
|
11899 |
|
11900 | var isArray = __webpack_require__(92);
|
11901 | var isConstructor = __webpack_require__(111);
|
11902 | var isObject = __webpack_require__(11);
|
11903 | var wellKnownSymbol = __webpack_require__(5);
|
11904 |
|
11905 | var SPECIES = wellKnownSymbol('species');
|
11906 | var $Array = Array;
|
11907 |
|
11908 |
|
11909 |
|
11910 | module.exports = function (originalArray) {
|
11911 | var C;
|
11912 | if (isArray(originalArray)) {
|
11913 | C = originalArray.constructor;
|
11914 |
|
11915 | if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
|
11916 | else if (isObject(C)) {
|
11917 | C = C[SPECIES];
|
11918 | if (C === null) C = undefined;
|
11919 | }
|
11920 | } return C === undefined ? $Array : C;
|
11921 | };
|
11922 |
|
11923 |
|
11924 | }),
|
11925 |
|
11926 | (function(module, exports, __webpack_require__) {
|
11927 |
|
11928 | var parent = __webpack_require__(401);
|
11929 |
|
11930 | module.exports = parent;
|
11931 |
|
11932 |
|
11933 | }),
|
11934 |
|
11935 | (function(module, exports, __webpack_require__) {
|
11936 |
|
11937 | var isPrototypeOf = __webpack_require__(16);
|
11938 | var method = __webpack_require__(402);
|
11939 |
|
11940 | var ArrayPrototype = Array.prototype;
|
11941 |
|
11942 | module.exports = function (it) {
|
11943 | var own = it.map;
|
11944 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;
|
11945 | };
|
11946 |
|
11947 |
|
11948 | }),
|
11949 |
|
11950 | (function(module, exports, __webpack_require__) {
|
11951 |
|
11952 | __webpack_require__(403);
|
11953 | var entryVirtual = __webpack_require__(27);
|
11954 |
|
11955 | module.exports = entryVirtual('Array').map;
|
11956 |
|
11957 |
|
11958 | }),
|
11959 |
|
11960 | (function(module, exports, __webpack_require__) {
|
11961 |
|
11962 | "use strict";
|
11963 |
|
11964 | var $ = __webpack_require__(0);
|
11965 | var $map = __webpack_require__(75).map;
|
11966 | var arrayMethodHasSpeciesSupport = __webpack_require__(116);
|
11967 |
|
11968 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
|
11969 |
|
11970 |
|
11971 |
|
11972 |
|
11973 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
11974 | map: function map(callbackfn /* , thisArg */) {
|
11975 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
11976 | }
|
11977 | });
|
11978 |
|
11979 |
|
11980 | }),
|
11981 |
|
11982 | (function(module, exports, __webpack_require__) {
|
11983 |
|
11984 | var parent = __webpack_require__(405);
|
11985 |
|
11986 | module.exports = parent;
|
11987 |
|
11988 |
|
11989 | }),
|
11990 |
|
11991 | (function(module, exports, __webpack_require__) {
|
11992 |
|
11993 | __webpack_require__(406);
|
11994 | var path = __webpack_require__(7);
|
11995 |
|
11996 | module.exports = path.Object.keys;
|
11997 |
|
11998 |
|
11999 | }),
|
12000 |
|
12001 | (function(module, exports, __webpack_require__) {
|
12002 |
|
12003 | var $ = __webpack_require__(0);
|
12004 | var toObject = __webpack_require__(33);
|
12005 | var nativeKeys = __webpack_require__(107);
|
12006 | var fails = __webpack_require__(2);
|
12007 |
|
12008 | var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
|
12009 |
|
12010 |
|
12011 |
|
12012 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
12013 | keys: function keys(it) {
|
12014 | return nativeKeys(toObject(it));
|
12015 | }
|
12016 | });
|
12017 |
|
12018 |
|
12019 | }),
|
12020 |
|
12021 | (function(module, exports, __webpack_require__) {
|
12022 |
|
12023 | var parent = __webpack_require__(408);
|
12024 |
|
12025 | module.exports = parent;
|
12026 |
|
12027 |
|
12028 | }),
|
12029 |
|
12030 | (function(module, exports, __webpack_require__) {
|
12031 |
|
12032 | __webpack_require__(230);
|
12033 | var path = __webpack_require__(7);
|
12034 | var apply = __webpack_require__(79);
|
12035 |
|
12036 |
|
12037 | if (!path.JSON) path.JSON = { stringify: JSON.stringify };
|
12038 |
|
12039 |
|
12040 | module.exports = function stringify(it, replacer, space) {
|
12041 | return apply(path.JSON.stringify, null, arguments);
|
12042 | };
|
12043 |
|
12044 |
|
12045 | }),
|
12046 |
|
12047 | (function(module, exports, __webpack_require__) {
|
12048 |
|
12049 | var parent = __webpack_require__(410);
|
12050 |
|
12051 | module.exports = parent;
|
12052 |
|
12053 |
|
12054 | }),
|
12055 |
|
12056 | (function(module, exports, __webpack_require__) {
|
12057 |
|
12058 | var isPrototypeOf = __webpack_require__(16);
|
12059 | var method = __webpack_require__(411);
|
12060 |
|
12061 | var ArrayPrototype = Array.prototype;
|
12062 |
|
12063 | module.exports = function (it) {
|
12064 | var own = it.indexOf;
|
12065 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;
|
12066 | };
|
12067 |
|
12068 |
|
12069 | }),
|
12070 |
|
12071 | (function(module, exports, __webpack_require__) {
|
12072 |
|
12073 | __webpack_require__(412);
|
12074 | var entryVirtual = __webpack_require__(27);
|
12075 |
|
12076 | module.exports = entryVirtual('Array').indexOf;
|
12077 |
|
12078 |
|
12079 | }),
|
12080 |
|
12081 | (function(module, exports, __webpack_require__) {
|
12082 |
|
12083 | "use strict";
|
12084 |
|
12085 |
|
12086 | var $ = __webpack_require__(0);
|
12087 | var uncurryThis = __webpack_require__(4);
|
12088 | var $IndexOf = __webpack_require__(126).indexOf;
|
12089 | var arrayMethodIsStrict = __webpack_require__(151);
|
12090 |
|
12091 | var un$IndexOf = uncurryThis([].indexOf);
|
12092 |
|
12093 | var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
|
12094 | var STRICT_METHOD = arrayMethodIsStrict('indexOf');
|
12095 |
|
12096 |
|
12097 |
|
12098 | $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
|
12099 | indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
12100 | var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
|
12101 | return NEGATIVE_ZERO
|
12102 |
|
12103 | ? un$IndexOf(this, searchElement, fromIndex) || 0
|
12104 | : $IndexOf(this, searchElement, fromIndex);
|
12105 | }
|
12106 | });
|
12107 |
|
12108 |
|
12109 | }),
|
12110 |
|
12111 | (function(module, exports, __webpack_require__) {
|
12112 |
|
12113 | __webpack_require__(46);
|
12114 | var classof = __webpack_require__(55);
|
12115 | var hasOwn = __webpack_require__(13);
|
12116 | var isPrototypeOf = __webpack_require__(16);
|
12117 | var method = __webpack_require__(414);
|
12118 |
|
12119 | var ArrayPrototype = Array.prototype;
|
12120 |
|
12121 | var DOMIterables = {
|
12122 | DOMTokenList: true,
|
12123 | NodeList: true
|
12124 | };
|
12125 |
|
12126 | module.exports = function (it) {
|
12127 | var own = it.keys;
|
12128 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
|
12129 | || hasOwn(DOMIterables, classof(it)) ? method : own;
|
12130 | };
|
12131 |
|
12132 |
|
12133 | }),
|
12134 |
|
12135 | (function(module, exports, __webpack_require__) {
|
12136 |
|
12137 | var parent = __webpack_require__(415);
|
12138 |
|
12139 | module.exports = parent;
|
12140 |
|
12141 |
|
12142 | }),
|
12143 |
|
12144 | (function(module, exports, __webpack_require__) {
|
12145 |
|
12146 | __webpack_require__(43);
|
12147 | __webpack_require__(68);
|
12148 | var entryVirtual = __webpack_require__(27);
|
12149 |
|
12150 | module.exports = entryVirtual('Array').keys;
|
12151 |
|
12152 |
|
12153 | }),
|
12154 |
|
12155 | (function(module, exports) {
|
12156 |
|
12157 |
|
12158 |
|
12159 |
|
12160 |
|
12161 |
|
12162 |
|
12163 |
|
12164 | var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
|
12165 | (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
|
12166 |
|
12167 | if (getRandomValues) {
|
12168 |
|
12169 | var rnds8 = new Uint8Array(16);
|
12170 |
|
12171 | module.exports = function whatwgRNG() {
|
12172 | getRandomValues(rnds8);
|
12173 | return rnds8;
|
12174 | };
|
12175 | } else {
|
12176 |
|
12177 |
|
12178 |
|
12179 |
|
12180 | var rnds = new Array(16);
|
12181 |
|
12182 | module.exports = function mathRNG() {
|
12183 | for (var i = 0, r; i < 16; i++) {
|
12184 | if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
12185 | rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
12186 | }
|
12187 |
|
12188 | return rnds;
|
12189 | };
|
12190 | }
|
12191 |
|
12192 |
|
12193 | }),
|
12194 |
|
12195 | (function(module, exports) {
|
12196 |
|
12197 |
|
12198 |
|
12199 |
|
12200 |
|
12201 | var byteToHex = [];
|
12202 | for (var i = 0; i < 256; ++i) {
|
12203 | byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
12204 | }
|
12205 |
|
12206 | function bytesToUuid(buf, offset) {
|
12207 | var i = offset || 0;
|
12208 | var bth = byteToHex;
|
12209 |
|
12210 | return ([bth[buf[i++]], bth[buf[i++]],
|
12211 | bth[buf[i++]], bth[buf[i++]], '-',
|
12212 | bth[buf[i++]], bth[buf[i++]], '-',
|
12213 | bth[buf[i++]], bth[buf[i++]], '-',
|
12214 | bth[buf[i++]], bth[buf[i++]], '-',
|
12215 | bth[buf[i++]], bth[buf[i++]],
|
12216 | bth[buf[i++]], bth[buf[i++]],
|
12217 | bth[buf[i++]], bth[buf[i++]]]).join('');
|
12218 | }
|
12219 |
|
12220 | module.exports = bytesToUuid;
|
12221 |
|
12222 |
|
12223 | }),
|
12224 |
|
12225 | (function(module, exports, __webpack_require__) {
|
12226 |
|
12227 | "use strict";
|
12228 |
|
12229 |
|
12230 |
|
12231 |
|
12232 |
|
12233 |
|
12234 | function setup(env) {
|
12235 | createDebug.debug = createDebug;
|
12236 | createDebug.default = createDebug;
|
12237 | createDebug.coerce = coerce;
|
12238 | createDebug.disable = disable;
|
12239 | createDebug.enable = enable;
|
12240 | createDebug.enabled = enabled;
|
12241 | createDebug.humanize = __webpack_require__(419);
|
12242 | Object.keys(env).forEach(function (key) {
|
12243 | createDebug[key] = env[key];
|
12244 | });
|
12245 | |
12246 |
|
12247 |
|
12248 |
|
12249 | createDebug.instances = [];
|
12250 | |
12251 |
|
12252 |
|
12253 |
|
12254 | createDebug.names = [];
|
12255 | createDebug.skips = [];
|
12256 | |
12257 |
|
12258 |
|
12259 |
|
12260 |
|
12261 |
|
12262 | createDebug.formatters = {};
|
12263 | |
12264 |
|
12265 |
|
12266 |
|
12267 |
|
12268 |
|
12269 |
|
12270 | function selectColor(namespace) {
|
12271 | var hash = 0;
|
12272 |
|
12273 | for (var i = 0; i < namespace.length; i++) {
|
12274 | hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
12275 | hash |= 0;
|
12276 | }
|
12277 |
|
12278 | return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
12279 | }
|
12280 |
|
12281 | createDebug.selectColor = selectColor;
|
12282 | |
12283 |
|
12284 |
|
12285 |
|
12286 |
|
12287 |
|
12288 |
|
12289 |
|
12290 | function createDebug(namespace) {
|
12291 | var prevTime;
|
12292 |
|
12293 | function debug() {
|
12294 |
|
12295 | if (!debug.enabled) {
|
12296 | return;
|
12297 | }
|
12298 |
|
12299 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
12300 | args[_key] = arguments[_key];
|
12301 | }
|
12302 |
|
12303 | var self = debug;
|
12304 |
|
12305 | var curr = Number(new Date());
|
12306 | var ms = curr - (prevTime || curr);
|
12307 | self.diff = ms;
|
12308 | self.prev = prevTime;
|
12309 | self.curr = curr;
|
12310 | prevTime = curr;
|
12311 | args[0] = createDebug.coerce(args[0]);
|
12312 |
|
12313 | if (typeof args[0] !== 'string') {
|
12314 |
|
12315 | args.unshift('%O');
|
12316 | }
|
12317 |
|
12318 |
|
12319 | var index = 0;
|
12320 | args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
|
12321 |
|
12322 | if (match === '%%') {
|
12323 | return match;
|
12324 | }
|
12325 |
|
12326 | index++;
|
12327 | var formatter = createDebug.formatters[format];
|
12328 |
|
12329 | if (typeof formatter === 'function') {
|
12330 | var val = args[index];
|
12331 | match = formatter.call(self, val);
|
12332 |
|
12333 | args.splice(index, 1);
|
12334 | index--;
|
12335 | }
|
12336 |
|
12337 | return match;
|
12338 | });
|
12339 |
|
12340 | createDebug.formatArgs.call(self, args);
|
12341 | var logFn = self.log || createDebug.log;
|
12342 | logFn.apply(self, args);
|
12343 | }
|
12344 |
|
12345 | debug.namespace = namespace;
|
12346 | debug.enabled = createDebug.enabled(namespace);
|
12347 | debug.useColors = createDebug.useColors();
|
12348 | debug.color = selectColor(namespace);
|
12349 | debug.destroy = destroy;
|
12350 | debug.extend = extend;
|
12351 |
|
12352 |
|
12353 |
|
12354 | if (typeof createDebug.init === 'function') {
|
12355 | createDebug.init(debug);
|
12356 | }
|
12357 |
|
12358 | createDebug.instances.push(debug);
|
12359 | return debug;
|
12360 | }
|
12361 |
|
12362 | function destroy() {
|
12363 | var index = createDebug.instances.indexOf(this);
|
12364 |
|
12365 | if (index !== -1) {
|
12366 | createDebug.instances.splice(index, 1);
|
12367 | return true;
|
12368 | }
|
12369 |
|
12370 | return false;
|
12371 | }
|
12372 |
|
12373 | function extend(namespace, delimiter) {
|
12374 | return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
12375 | }
|
12376 | |
12377 |
|
12378 |
|
12379 |
|
12380 |
|
12381 |
|
12382 |
|
12383 |
|
12384 |
|
12385 | function enable(namespaces) {
|
12386 | createDebug.save(namespaces);
|
12387 | createDebug.names = [];
|
12388 | createDebug.skips = [];
|
12389 | var i;
|
12390 | var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
12391 | var len = split.length;
|
12392 |
|
12393 | for (i = 0; i < len; i++) {
|
12394 | if (!split[i]) {
|
12395 |
|
12396 | continue;
|
12397 | }
|
12398 |
|
12399 | namespaces = split[i].replace(/\*/g, '.*?');
|
12400 |
|
12401 | if (namespaces[0] === '-') {
|
12402 | createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
12403 | } else {
|
12404 | createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
12405 | }
|
12406 | }
|
12407 |
|
12408 | for (i = 0; i < createDebug.instances.length; i++) {
|
12409 | var instance = createDebug.instances[i];
|
12410 | instance.enabled = createDebug.enabled(instance.namespace);
|
12411 | }
|
12412 | }
|
12413 | |
12414 |
|
12415 |
|
12416 |
|
12417 |
|
12418 |
|
12419 |
|
12420 | function disable() {
|
12421 | createDebug.enable('');
|
12422 | }
|
12423 | |
12424 |
|
12425 |
|
12426 |
|
12427 |
|
12428 |
|
12429 |
|
12430 |
|
12431 |
|
12432 | function enabled(name) {
|
12433 | if (name[name.length - 1] === '*') {
|
12434 | return true;
|
12435 | }
|
12436 |
|
12437 | var i;
|
12438 | var len;
|
12439 |
|
12440 | for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
12441 | if (createDebug.skips[i].test(name)) {
|
12442 | return false;
|
12443 | }
|
12444 | }
|
12445 |
|
12446 | for (i = 0, len = createDebug.names.length; i < len; i++) {
|
12447 | if (createDebug.names[i].test(name)) {
|
12448 | return true;
|
12449 | }
|
12450 | }
|
12451 |
|
12452 | return false;
|
12453 | }
|
12454 | |
12455 |
|
12456 |
|
12457 |
|
12458 |
|
12459 |
|
12460 |
|
12461 |
|
12462 |
|
12463 | function coerce(val) {
|
12464 | if (val instanceof Error) {
|
12465 | return val.stack || val.message;
|
12466 | }
|
12467 |
|
12468 | return val;
|
12469 | }
|
12470 |
|
12471 | createDebug.enable(createDebug.load());
|
12472 | return createDebug;
|
12473 | }
|
12474 |
|
12475 | module.exports = setup;
|
12476 |
|
12477 |
|
12478 |
|
12479 | }),
|
12480 |
|
12481 | (function(module, exports) {
|
12482 |
|
12483 |
|
12484 |
|
12485 |
|
12486 |
|
12487 | var s = 1000;
|
12488 | var m = s * 60;
|
12489 | var h = m * 60;
|
12490 | var d = h * 24;
|
12491 | var w = d * 7;
|
12492 | var y = d * 365.25;
|
12493 |
|
12494 |
|
12495 |
|
12496 |
|
12497 |
|
12498 |
|
12499 |
|
12500 |
|
12501 |
|
12502 |
|
12503 |
|
12504 |
|
12505 |
|
12506 |
|
12507 |
|
12508 | module.exports = function(val, options) {
|
12509 | options = options || {};
|
12510 | var type = typeof val;
|
12511 | if (type === 'string' && val.length > 0) {
|
12512 | return parse(val);
|
12513 | } else if (type === 'number' && isFinite(val)) {
|
12514 | return options.long ? fmtLong(val) : fmtShort(val);
|
12515 | }
|
12516 | throw new Error(
|
12517 | 'val is not a non-empty string or a valid number. val=' +
|
12518 | JSON.stringify(val)
|
12519 | );
|
12520 | };
|
12521 |
|
12522 |
|
12523 |
|
12524 |
|
12525 |
|
12526 |
|
12527 |
|
12528 |
|
12529 |
|
12530 | function parse(str) {
|
12531 | str = String(str);
|
12532 | if (str.length > 100) {
|
12533 | return;
|
12534 | }
|
12535 | 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(
|
12536 | str
|
12537 | );
|
12538 | if (!match) {
|
12539 | return;
|
12540 | }
|
12541 | var n = parseFloat(match[1]);
|
12542 | var type = (match[2] || 'ms').toLowerCase();
|
12543 | switch (type) {
|
12544 | case 'years':
|
12545 | case 'year':
|
12546 | case 'yrs':
|
12547 | case 'yr':
|
12548 | case 'y':
|
12549 | return n * y;
|
12550 | case 'weeks':
|
12551 | case 'week':
|
12552 | case 'w':
|
12553 | return n * w;
|
12554 | case 'days':
|
12555 | case 'day':
|
12556 | case 'd':
|
12557 | return n * d;
|
12558 | case 'hours':
|
12559 | case 'hour':
|
12560 | case 'hrs':
|
12561 | case 'hr':
|
12562 | case 'h':
|
12563 | return n * h;
|
12564 | case 'minutes':
|
12565 | case 'minute':
|
12566 | case 'mins':
|
12567 | case 'min':
|
12568 | case 'm':
|
12569 | return n * m;
|
12570 | case 'seconds':
|
12571 | case 'second':
|
12572 | case 'secs':
|
12573 | case 'sec':
|
12574 | case 's':
|
12575 | return n * s;
|
12576 | case 'milliseconds':
|
12577 | case 'millisecond':
|
12578 | case 'msecs':
|
12579 | case 'msec':
|
12580 | case 'ms':
|
12581 | return n;
|
12582 | default:
|
12583 | return undefined;
|
12584 | }
|
12585 | }
|
12586 |
|
12587 |
|
12588 |
|
12589 |
|
12590 |
|
12591 |
|
12592 |
|
12593 |
|
12594 |
|
12595 | function fmtShort(ms) {
|
12596 | var msAbs = Math.abs(ms);
|
12597 | if (msAbs >= d) {
|
12598 | return Math.round(ms / d) + 'd';
|
12599 | }
|
12600 | if (msAbs >= h) {
|
12601 | return Math.round(ms / h) + 'h';
|
12602 | }
|
12603 | if (msAbs >= m) {
|
12604 | return Math.round(ms / m) + 'm';
|
12605 | }
|
12606 | if (msAbs >= s) {
|
12607 | return Math.round(ms / s) + 's';
|
12608 | }
|
12609 | return ms + 'ms';
|
12610 | }
|
12611 |
|
12612 |
|
12613 |
|
12614 |
|
12615 |
|
12616 |
|
12617 |
|
12618 |
|
12619 |
|
12620 | function fmtLong(ms) {
|
12621 | var msAbs = Math.abs(ms);
|
12622 | if (msAbs >= d) {
|
12623 | return plural(ms, msAbs, d, 'day');
|
12624 | }
|
12625 | if (msAbs >= h) {
|
12626 | return plural(ms, msAbs, h, 'hour');
|
12627 | }
|
12628 | if (msAbs >= m) {
|
12629 | return plural(ms, msAbs, m, 'minute');
|
12630 | }
|
12631 | if (msAbs >= s) {
|
12632 | return plural(ms, msAbs, s, 'second');
|
12633 | }
|
12634 | return ms + ' ms';
|
12635 | }
|
12636 |
|
12637 |
|
12638 |
|
12639 |
|
12640 |
|
12641 | function plural(ms, msAbs, n, name) {
|
12642 | var isPlural = msAbs >= n * 1.5;
|
12643 | return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
12644 | }
|
12645 |
|
12646 |
|
12647 | }),
|
12648 |
|
12649 | (function(module, exports, __webpack_require__) {
|
12650 |
|
12651 | __webpack_require__(421);
|
12652 | var path = __webpack_require__(7);
|
12653 |
|
12654 | module.exports = path.Object.getPrototypeOf;
|
12655 |
|
12656 |
|
12657 | }),
|
12658 |
|
12659 | (function(module, exports, __webpack_require__) {
|
12660 |
|
12661 | var $ = __webpack_require__(0);
|
12662 | var fails = __webpack_require__(2);
|
12663 | var toObject = __webpack_require__(33);
|
12664 | var nativeGetPrototypeOf = __webpack_require__(102);
|
12665 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(162);
|
12666 |
|
12667 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
|
12668 |
|
12669 |
|
12670 |
|
12671 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
|
12672 | getPrototypeOf: function getPrototypeOf(it) {
|
12673 | return nativeGetPrototypeOf(toObject(it));
|
12674 | }
|
12675 | });
|
12676 |
|
12677 |
|
12678 |
|
12679 | }),
|
12680 |
|
12681 | (function(module, exports, __webpack_require__) {
|
12682 |
|
12683 | module.exports = __webpack_require__(238);
|
12684 |
|
12685 | }),
|
12686 |
|
12687 | (function(module, exports, __webpack_require__) {
|
12688 |
|
12689 | __webpack_require__(424);
|
12690 | var path = __webpack_require__(7);
|
12691 |
|
12692 | module.exports = path.Object.setPrototypeOf;
|
12693 |
|
12694 |
|
12695 | }),
|
12696 |
|
12697 | (function(module, exports, __webpack_require__) {
|
12698 |
|
12699 | var $ = __webpack_require__(0);
|
12700 | var setPrototypeOf = __webpack_require__(104);
|
12701 |
|
12702 |
|
12703 |
|
12704 | $({ target: 'Object', stat: true }, {
|
12705 | setPrototypeOf: setPrototypeOf
|
12706 | });
|
12707 |
|
12708 |
|
12709 | }),
|
12710 |
|
12711 | (function(module, exports, __webpack_require__) {
|
12712 |
|
12713 | "use strict";
|
12714 |
|
12715 |
|
12716 | var _interopRequireDefault = __webpack_require__(1);
|
12717 |
|
12718 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
12719 |
|
12720 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
12721 |
|
12722 | var _defineProperty = _interopRequireDefault(__webpack_require__(94));
|
12723 |
|
12724 | var AV = __webpack_require__(74);
|
12725 |
|
12726 | var AppRouter = __webpack_require__(431);
|
12727 |
|
12728 | var _require = __webpack_require__(32),
|
12729 | isNullOrUndefined = _require.isNullOrUndefined;
|
12730 |
|
12731 | var _require2 = __webpack_require__(3),
|
12732 | extend = _require2.extend,
|
12733 | isObject = _require2.isObject,
|
12734 | isEmpty = _require2.isEmpty;
|
12735 |
|
12736 | var isCNApp = function isCNApp(appId) {
|
12737 | return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
|
12738 | };
|
12739 |
|
12740 | var fillServerURLs = function fillServerURLs(url) {
|
12741 | return {
|
12742 | push: url,
|
12743 | stats: url,
|
12744 | engine: url,
|
12745 | api: url,
|
12746 | rtm: url
|
12747 | };
|
12748 | };
|
12749 |
|
12750 | function getDefaultServerURLs(appId) {
|
12751 | var _context, _context2, _context3, _context4, _context5;
|
12752 |
|
12753 | if (isCNApp(appId)) {
|
12754 | return {};
|
12755 | }
|
12756 |
|
12757 | var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
|
12758 | var domain = 'lncldglobal.com';
|
12759 | return {
|
12760 | push: (0, _concat.default)(_context = "https://".concat(id, ".push.")).call(_context, domain),
|
12761 | stats: (0, _concat.default)(_context2 = "https://".concat(id, ".stats.")).call(_context2, domain),
|
12762 | engine: (0, _concat.default)(_context3 = "https://".concat(id, ".engine.")).call(_context3, domain),
|
12763 | api: (0, _concat.default)(_context4 = "https://".concat(id, ".api.")).call(_context4, domain),
|
12764 | rtm: (0, _concat.default)(_context5 = "https://".concat(id, ".rtm.")).call(_context5, domain)
|
12765 | };
|
12766 | }
|
12767 |
|
12768 | var _disableAppRouter = false;
|
12769 | var _initialized = false;
|
12770 |
|
12771 |
|
12772 |
|
12773 |
|
12774 |
|
12775 |
|
12776 |
|
12777 |
|
12778 |
|
12779 |
|
12780 |
|
12781 |
|
12782 |
|
12783 |
|
12784 |
|
12785 |
|
12786 |
|
12787 |
|
12788 |
|
12789 |
|
12790 |
|
12791 |
|
12792 |
|
12793 | AV.init = function init(options) {
|
12794 | if (!isObject(options)) {
|
12795 | return AV.init({
|
12796 | appId: options,
|
12797 | appKey: arguments.length <= 1 ? undefined : arguments[1],
|
12798 | masterKey: arguments.length <= 2 ? undefined : arguments[2]
|
12799 | });
|
12800 | }
|
12801 |
|
12802 | var appId = options.appId,
|
12803 | appKey = options.appKey,
|
12804 | masterKey = options.masterKey,
|
12805 | hookKey = options.hookKey,
|
12806 | serverURL = options.serverURL,
|
12807 | _options$serverURLs = options.serverURLs,
|
12808 | serverURLs = _options$serverURLs === void 0 ? serverURL : _options$serverURLs,
|
12809 | disableCurrentUser = options.disableCurrentUser,
|
12810 | production = options.production,
|
12811 | realtime = options.realtime;
|
12812 | 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.');
|
12813 | if (!appId) throw new TypeError('appId must be a string');
|
12814 | if (!appKey) throw new TypeError('appKey must be a string');
|
12815 | if ("Browser" !== 'NODE_JS' && masterKey) console.warn('MasterKey is not supposed to be used at client side.');
|
12816 |
|
12817 | if (isCNApp(appId)) {
|
12818 | if (!serverURLs && isEmpty(AV._config.serverURLs)) {
|
12819 | throw new TypeError("serverURL option is required for apps from CN region");
|
12820 | }
|
12821 | }
|
12822 |
|
12823 | if (appId !== AV._config.applicationId) {
|
12824 |
|
12825 | AV._config.masterKey = masterKey;
|
12826 | AV._config.hookKey = hookKey;
|
12827 | } else {
|
12828 | if (masterKey) AV._config.masterKey = masterKey;
|
12829 | if (hookKey) AV._config.hookKey = hookKey;
|
12830 | }
|
12831 |
|
12832 | AV._config.applicationId = appId;
|
12833 | AV._config.applicationKey = appKey;
|
12834 |
|
12835 | if (!isNullOrUndefined(production)) {
|
12836 | AV.setProduction(production);
|
12837 | }
|
12838 |
|
12839 | if (typeof disableCurrentUser !== 'undefined') AV._config.disableCurrentUser = disableCurrentUser;
|
12840 | var disableAppRouter = _disableAppRouter || typeof serverURLs !== 'undefined';
|
12841 |
|
12842 | if (!disableAppRouter) {
|
12843 | AV._appRouter = new AppRouter(AV);
|
12844 | }
|
12845 |
|
12846 | AV._setServerURLs(extend({}, getDefaultServerURLs(appId), AV._config.serverURLs, typeof serverURLs === 'string' ? fillServerURLs(serverURLs) : serverURLs), disableAppRouter);
|
12847 |
|
12848 | if (realtime) {
|
12849 | AV._config.realtime = realtime;
|
12850 | } else if (AV._sharedConfig.liveQueryRealtime) {
|
12851 | var _AV$_config$serverURL = AV._config.serverURLs,
|
12852 | api = _AV$_config$serverURL.api,
|
12853 | rtm = _AV$_config$serverURL.rtm;
|
12854 | AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
|
12855 | appId: appId,
|
12856 | appKey: appKey,
|
12857 | server: {
|
12858 | api: api,
|
12859 | RTMRouter: rtm
|
12860 | }
|
12861 | });
|
12862 | }
|
12863 |
|
12864 | _initialized = true;
|
12865 | };
|
12866 |
|
12867 |
|
12868 | if (false) {
|
12869 | AV.Cloud = AV.Cloud || {};
|
12870 | |
12871 |
|
12872 |
|
12873 |
|
12874 |
|
12875 |
|
12876 |
|
12877 |
|
12878 | AV.Cloud.useMasterKey = function () {
|
12879 | AV._config.useMasterKey = true;
|
12880 | };
|
12881 | }
|
12882 |
|
12883 |
|
12884 |
|
12885 |
|
12886 |
|
12887 |
|
12888 |
|
12889 |
|
12890 | AV.setProduction = function (production) {
|
12891 | if (!isNullOrUndefined(production)) {
|
12892 | AV._config.production = production ? 1 : 0;
|
12893 | } else {
|
12894 |
|
12895 | AV._config.production = null;
|
12896 | }
|
12897 | };
|
12898 |
|
12899 | AV._setServerURLs = function (urls) {
|
12900 | var disableAppRouter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
12901 |
|
12902 | if (typeof urls !== 'string') {
|
12903 | extend(AV._config.serverURLs, urls);
|
12904 | } else {
|
12905 | AV._config.serverURLs = fillServerURLs(urls);
|
12906 | }
|
12907 |
|
12908 | if (disableAppRouter) {
|
12909 | if (AV._appRouter) {
|
12910 | AV._appRouter.disable();
|
12911 | } else {
|
12912 | _disableAppRouter = true;
|
12913 | }
|
12914 | }
|
12915 | };
|
12916 |
|
12917 |
|
12918 |
|
12919 |
|
12920 |
|
12921 |
|
12922 |
|
12923 |
|
12924 |
|
12925 | AV.setServerURL = function (urls) {
|
12926 | return AV._setServerURLs(urls);
|
12927 | };
|
12928 |
|
12929 | AV.setServerURLs = AV.setServerURL;
|
12930 |
|
12931 | AV.keepErrorRawMessage = function (value) {
|
12932 | AV._sharedConfig.keepErrorRawMessage = value;
|
12933 | };
|
12934 |
|
12935 |
|
12936 |
|
12937 |
|
12938 |
|
12939 |
|
12940 |
|
12941 |
|
12942 |
|
12943 | AV.setRequestTimeout = function (ms) {
|
12944 | AV._config.requestTimeout = ms;
|
12945 | };
|
12946 |
|
12947 |
|
12948 | AV.initialize = AV.init;
|
12949 |
|
12950 | var defineConfig = function defineConfig(property) {
|
12951 | return (0, _defineProperty.default)(AV, property, {
|
12952 | get: function get() {
|
12953 | return AV._config[property];
|
12954 | },
|
12955 | set: function set(value) {
|
12956 | AV._config[property] = value;
|
12957 | }
|
12958 | });
|
12959 | };
|
12960 |
|
12961 | ['applicationId', 'applicationKey', 'masterKey', 'hookKey'].forEach(defineConfig);
|
12962 |
|
12963 | }),
|
12964 |
|
12965 | (function(module, exports, __webpack_require__) {
|
12966 |
|
12967 | var isPrototypeOf = __webpack_require__(16);
|
12968 | var method = __webpack_require__(427);
|
12969 |
|
12970 | var ArrayPrototype = Array.prototype;
|
12971 |
|
12972 | module.exports = function (it) {
|
12973 | var own = it.slice;
|
12974 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
|
12975 | };
|
12976 |
|
12977 |
|
12978 | }),
|
12979 |
|
12980 | (function(module, exports, __webpack_require__) {
|
12981 |
|
12982 | __webpack_require__(428);
|
12983 | var entryVirtual = __webpack_require__(27);
|
12984 |
|
12985 | module.exports = entryVirtual('Array').slice;
|
12986 |
|
12987 |
|
12988 | }),
|
12989 |
|
12990 | (function(module, exports, __webpack_require__) {
|
12991 |
|
12992 | "use strict";
|
12993 |
|
12994 | var $ = __webpack_require__(0);
|
12995 | var isArray = __webpack_require__(92);
|
12996 | var isConstructor = __webpack_require__(111);
|
12997 | var isObject = __webpack_require__(11);
|
12998 | var toAbsoluteIndex = __webpack_require__(127);
|
12999 | var lengthOfArrayLike = __webpack_require__(40);
|
13000 | var toIndexedObject = __webpack_require__(35);
|
13001 | var createProperty = __webpack_require__(93);
|
13002 | var wellKnownSymbol = __webpack_require__(5);
|
13003 | var arrayMethodHasSpeciesSupport = __webpack_require__(116);
|
13004 | var un$Slice = __webpack_require__(112);
|
13005 |
|
13006 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
|
13007 |
|
13008 | var SPECIES = wellKnownSymbol('species');
|
13009 | var $Array = Array;
|
13010 | var max = Math.max;
|
13011 |
|
13012 |
|
13013 |
|
13014 |
|
13015 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
13016 | slice: function slice(start, end) {
|
13017 | var O = toIndexedObject(this);
|
13018 | var length = lengthOfArrayLike(O);
|
13019 | var k = toAbsoluteIndex(start, length);
|
13020 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
13021 |
|
13022 | var Constructor, result, n;
|
13023 | if (isArray(O)) {
|
13024 | Constructor = O.constructor;
|
13025 |
|
13026 | if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
|
13027 | Constructor = undefined;
|
13028 | } else if (isObject(Constructor)) {
|
13029 | Constructor = Constructor[SPECIES];
|
13030 | if (Constructor === null) Constructor = undefined;
|
13031 | }
|
13032 | if (Constructor === $Array || Constructor === undefined) {
|
13033 | return un$Slice(O, k, fin);
|
13034 | }
|
13035 | }
|
13036 | result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
|
13037 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
|
13038 | result.length = n;
|
13039 | return result;
|
13040 | }
|
13041 | });
|
13042 |
|
13043 |
|
13044 | }),
|
13045 |
|
13046 | (function(module, exports, __webpack_require__) {
|
13047 |
|
13048 | __webpack_require__(430);
|
13049 | var path = __webpack_require__(7);
|
13050 |
|
13051 | var Object = path.Object;
|
13052 |
|
13053 | var defineProperty = module.exports = function defineProperty(it, key, desc) {
|
13054 | return Object.defineProperty(it, key, desc);
|
13055 | };
|
13056 |
|
13057 | if (Object.defineProperty.sham) defineProperty.sham = true;
|
13058 |
|
13059 |
|
13060 | }),
|
13061 |
|
13062 | (function(module, exports, __webpack_require__) {
|
13063 |
|
13064 | var $ = __webpack_require__(0);
|
13065 | var DESCRIPTORS = __webpack_require__(14);
|
13066 | var defineProperty = __webpack_require__(23).f;
|
13067 |
|
13068 |
|
13069 |
|
13070 |
|
13071 | $({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
|
13072 | defineProperty: defineProperty
|
13073 | });
|
13074 |
|
13075 |
|
13076 | }),
|
13077 |
|
13078 | (function(module, exports, __webpack_require__) {
|
13079 |
|
13080 | "use strict";
|
13081 |
|
13082 |
|
13083 | var ajax = __webpack_require__(117);
|
13084 |
|
13085 | var Cache = __webpack_require__(237);
|
13086 |
|
13087 | function AppRouter(AV) {
|
13088 | var _this = this;
|
13089 |
|
13090 | this.AV = AV;
|
13091 | this.lockedUntil = 0;
|
13092 | Cache.getAsync('serverURLs').then(function (data) {
|
13093 | if (_this.disabled) return;
|
13094 | if (!data) return _this.lock(0);
|
13095 | var serverURLs = data.serverURLs,
|
13096 | lockedUntil = data.lockedUntil;
|
13097 |
|
13098 | _this.AV._setServerURLs(serverURLs, false);
|
13099 |
|
13100 | _this.lockedUntil = lockedUntil;
|
13101 | }).catch(function () {
|
13102 | return _this.lock(0);
|
13103 | });
|
13104 | }
|
13105 |
|
13106 | AppRouter.prototype.disable = function disable() {
|
13107 | this.disabled = true;
|
13108 | };
|
13109 |
|
13110 | AppRouter.prototype.lock = function lock(ttl) {
|
13111 | this.lockedUntil = Date.now() + ttl;
|
13112 | };
|
13113 |
|
13114 | AppRouter.prototype.refresh = function refresh() {
|
13115 | var _this2 = this;
|
13116 |
|
13117 | if (this.disabled) return;
|
13118 | if (Date.now() < this.lockedUntil) return;
|
13119 | this.lock(10);
|
13120 | var url = 'https://app-router.com/2/route';
|
13121 | return ajax({
|
13122 | method: 'get',
|
13123 | url: url,
|
13124 | query: {
|
13125 | appId: this.AV.applicationId
|
13126 | }
|
13127 | }).then(function (servers) {
|
13128 | if (_this2.disabled) return;
|
13129 | var ttl = servers.ttl;
|
13130 | if (!ttl) throw new Error('missing ttl');
|
13131 | ttl = ttl * 1000;
|
13132 | var protocal = 'https://';
|
13133 | var serverURLs = {
|
13134 | push: protocal + servers.push_server,
|
13135 | stats: protocal + servers.stats_server,
|
13136 | engine: protocal + servers.engine_server,
|
13137 | api: protocal + servers.api_server
|
13138 | };
|
13139 |
|
13140 | _this2.AV._setServerURLs(serverURLs, false);
|
13141 |
|
13142 | _this2.lock(ttl);
|
13143 |
|
13144 | return Cache.setAsync('serverURLs', {
|
13145 | serverURLs: serverURLs,
|
13146 | lockedUntil: _this2.lockedUntil
|
13147 | }, ttl);
|
13148 | }).catch(function (error) {
|
13149 |
|
13150 | console.warn("refresh server URLs failed: ".concat(error.message));
|
13151 |
|
13152 | _this2.lock(600);
|
13153 | });
|
13154 | };
|
13155 |
|
13156 | module.exports = AppRouter;
|
13157 |
|
13158 | }),
|
13159 |
|
13160 | (function(module, exports, __webpack_require__) {
|
13161 |
|
13162 | module.exports = __webpack_require__(433);
|
13163 |
|
13164 |
|
13165 | }),
|
13166 |
|
13167 | (function(module, exports, __webpack_require__) {
|
13168 |
|
13169 | var parent = __webpack_require__(434);
|
13170 | __webpack_require__(456);
|
13171 | __webpack_require__(457);
|
13172 | __webpack_require__(458);
|
13173 | __webpack_require__(459);
|
13174 | __webpack_require__(460);
|
13175 |
|
13176 | __webpack_require__(461);
|
13177 | __webpack_require__(462);
|
13178 | __webpack_require__(463);
|
13179 |
|
13180 | module.exports = parent;
|
13181 |
|
13182 |
|
13183 | }),
|
13184 |
|
13185 | (function(module, exports, __webpack_require__) {
|
13186 |
|
13187 | var parent = __webpack_require__(242);
|
13188 |
|
13189 | module.exports = parent;
|
13190 |
|
13191 |
|
13192 | }),
|
13193 |
|
13194 | (function(module, exports, __webpack_require__) {
|
13195 |
|
13196 | __webpack_require__(228);
|
13197 | __webpack_require__(68);
|
13198 | __webpack_require__(243);
|
13199 | __webpack_require__(440);
|
13200 | __webpack_require__(441);
|
13201 | __webpack_require__(442);
|
13202 | __webpack_require__(443);
|
13203 | __webpack_require__(248);
|
13204 | __webpack_require__(444);
|
13205 | __webpack_require__(445);
|
13206 | __webpack_require__(446);
|
13207 | __webpack_require__(447);
|
13208 | __webpack_require__(448);
|
13209 | __webpack_require__(449);
|
13210 | __webpack_require__(450);
|
13211 | __webpack_require__(451);
|
13212 | __webpack_require__(452);
|
13213 | __webpack_require__(453);
|
13214 | __webpack_require__(454);
|
13215 | __webpack_require__(455);
|
13216 | var path = __webpack_require__(7);
|
13217 |
|
13218 | module.exports = path.Symbol;
|
13219 |
|
13220 |
|
13221 | }),
|
13222 |
|
13223 | (function(module, exports, __webpack_require__) {
|
13224 |
|
13225 | "use strict";
|
13226 |
|
13227 | var $ = __webpack_require__(0);
|
13228 | var global = __webpack_require__(8);
|
13229 | var call = __webpack_require__(15);
|
13230 | var uncurryThis = __webpack_require__(4);
|
13231 | var IS_PURE = __webpack_require__(36);
|
13232 | var DESCRIPTORS = __webpack_require__(14);
|
13233 | var NATIVE_SYMBOL = __webpack_require__(65);
|
13234 | var fails = __webpack_require__(2);
|
13235 | var hasOwn = __webpack_require__(13);
|
13236 | var isPrototypeOf = __webpack_require__(16);
|
13237 | var anObject = __webpack_require__(21);
|
13238 | var toIndexedObject = __webpack_require__(35);
|
13239 | var toPropertyKey = __webpack_require__(99);
|
13240 | var $toString = __webpack_require__(42);
|
13241 | var createPropertyDescriptor = __webpack_require__(49);
|
13242 | var nativeObjectCreate = __webpack_require__(53);
|
13243 | var objectKeys = __webpack_require__(107);
|
13244 | var getOwnPropertyNamesModule = __webpack_require__(105);
|
13245 | var getOwnPropertyNamesExternal = __webpack_require__(244);
|
13246 | var getOwnPropertySymbolsModule = __webpack_require__(106);
|
13247 | var getOwnPropertyDescriptorModule = __webpack_require__(64);
|
13248 | var definePropertyModule = __webpack_require__(23);
|
13249 | var definePropertiesModule = __webpack_require__(130);
|
13250 | var propertyIsEnumerableModule = __webpack_require__(122);
|
13251 | var defineBuiltIn = __webpack_require__(45);
|
13252 | var shared = __webpack_require__(82);
|
13253 | var sharedKey = __webpack_require__(103);
|
13254 | var hiddenKeys = __webpack_require__(83);
|
13255 | var uid = __webpack_require__(101);
|
13256 | var wellKnownSymbol = __webpack_require__(5);
|
13257 | var wrappedWellKnownSymbolModule = __webpack_require__(152);
|
13258 | var defineWellKnownSymbol = __webpack_require__(10);
|
13259 | var defineSymbolToPrimitive = __webpack_require__(246);
|
13260 | var setToStringTag = __webpack_require__(56);
|
13261 | var InternalStateModule = __webpack_require__(44);
|
13262 | var $forEach = __webpack_require__(75).forEach;
|
13263 |
|
13264 | var HIDDEN = sharedKey('hidden');
|
13265 | var SYMBOL = 'Symbol';
|
13266 | var PROTOTYPE = 'prototype';
|
13267 |
|
13268 | var setInternalState = InternalStateModule.set;
|
13269 | var getInternalState = InternalStateModule.getterFor(SYMBOL);
|
13270 |
|
13271 | var ObjectPrototype = Object[PROTOTYPE];
|
13272 | var $Symbol = global.Symbol;
|
13273 | var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
|
13274 | var TypeError = global.TypeError;
|
13275 | var QObject = global.QObject;
|
13276 | var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
13277 | var nativeDefineProperty = definePropertyModule.f;
|
13278 | var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
|
13279 | var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
|
13280 | var push = uncurryThis([].push);
|
13281 |
|
13282 | var AllSymbols = shared('symbols');
|
13283 | var ObjectPrototypeSymbols = shared('op-symbols');
|
13284 | var WellKnownSymbolsStore = shared('wks');
|
13285 |
|
13286 |
|
13287 | var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
13288 |
|
13289 |
|
13290 | var setSymbolDescriptor = DESCRIPTORS && fails(function () {
|
13291 | return nativeObjectCreate(nativeDefineProperty({}, 'a', {
|
13292 | get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
|
13293 | })).a != 7;
|
13294 | }) ? function (O, P, Attributes) {
|
13295 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
|
13296 | if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
|
13297 | nativeDefineProperty(O, P, Attributes);
|
13298 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
|
13299 | nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
|
13300 | }
|
13301 | } : nativeDefineProperty;
|
13302 |
|
13303 | var wrap = function (tag, description) {
|
13304 | var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
|
13305 | setInternalState(symbol, {
|
13306 | type: SYMBOL,
|
13307 | tag: tag,
|
13308 | description: description
|
13309 | });
|
13310 | if (!DESCRIPTORS) symbol.description = description;
|
13311 | return symbol;
|
13312 | };
|
13313 |
|
13314 | var $defineProperty = function defineProperty(O, P, Attributes) {
|
13315 | if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
13316 | anObject(O);
|
13317 | var key = toPropertyKey(P);
|
13318 | anObject(Attributes);
|
13319 | if (hasOwn(AllSymbols, key)) {
|
13320 | if (!Attributes.enumerable) {
|
13321 | if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
|
13322 | O[HIDDEN][key] = true;
|
13323 | } else {
|
13324 | if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
13325 | Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
|
13326 | } return setSymbolDescriptor(O, key, Attributes);
|
13327 | } return nativeDefineProperty(O, key, Attributes);
|
13328 | };
|
13329 |
|
13330 | var $defineProperties = function defineProperties(O, Properties) {
|
13331 | anObject(O);
|
13332 | var properties = toIndexedObject(Properties);
|
13333 | var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
|
13334 | $forEach(keys, function (key) {
|
13335 | if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
|
13336 | });
|
13337 | return O;
|
13338 | };
|
13339 |
|
13340 | var $create = function create(O, Properties) {
|
13341 | return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
|
13342 | };
|
13343 |
|
13344 | var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
13345 | var P = toPropertyKey(V);
|
13346 | var enumerable = call(nativePropertyIsEnumerable, this, P);
|
13347 | if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
|
13348 | return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
|
13349 | ? enumerable : true;
|
13350 | };
|
13351 |
|
13352 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
13353 | var it = toIndexedObject(O);
|
13354 | var key = toPropertyKey(P);
|
13355 | if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
|
13356 | var descriptor = nativeGetOwnPropertyDescriptor(it, key);
|
13357 | if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
|
13358 | descriptor.enumerable = true;
|
13359 | }
|
13360 | return descriptor;
|
13361 | };
|
13362 |
|
13363 | var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
13364 | var names = nativeGetOwnPropertyNames(toIndexedObject(O));
|
13365 | var result = [];
|
13366 | $forEach(names, function (key) {
|
13367 | if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
|
13368 | });
|
13369 | return result;
|
13370 | };
|
13371 |
|
13372 | var $getOwnPropertySymbols = function (O) {
|
13373 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
|
13374 | var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
|
13375 | var result = [];
|
13376 | $forEach(names, function (key) {
|
13377 | if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
|
13378 | push(result, AllSymbols[key]);
|
13379 | }
|
13380 | });
|
13381 | return result;
|
13382 | };
|
13383 |
|
13384 |
|
13385 |
|
13386 | if (!NATIVE_SYMBOL) {
|
13387 | $Symbol = function Symbol() {
|
13388 | if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
|
13389 | var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
|
13390 | var tag = uid(description);
|
13391 | var setter = function (value) {
|
13392 | if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
|
13393 | if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
13394 | setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
|
13395 | };
|
13396 | if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
|
13397 | return wrap(tag, description);
|
13398 | };
|
13399 |
|
13400 | SymbolPrototype = $Symbol[PROTOTYPE];
|
13401 |
|
13402 | defineBuiltIn(SymbolPrototype, 'toString', function toString() {
|
13403 | return getInternalState(this).tag;
|
13404 | });
|
13405 |
|
13406 | defineBuiltIn($Symbol, 'withoutSetter', function (description) {
|
13407 | return wrap(uid(description), description);
|
13408 | });
|
13409 |
|
13410 | propertyIsEnumerableModule.f = $propertyIsEnumerable;
|
13411 | definePropertyModule.f = $defineProperty;
|
13412 | definePropertiesModule.f = $defineProperties;
|
13413 | getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
|
13414 | getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
13415 | getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
|
13416 |
|
13417 | wrappedWellKnownSymbolModule.f = function (name) {
|
13418 | return wrap(wellKnownSymbol(name), name);
|
13419 | };
|
13420 |
|
13421 | if (DESCRIPTORS) {
|
13422 |
|
13423 | nativeDefineProperty(SymbolPrototype, 'description', {
|
13424 | configurable: true,
|
13425 | get: function description() {
|
13426 | return getInternalState(this).description;
|
13427 | }
|
13428 | });
|
13429 | if (!IS_PURE) {
|
13430 | defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
|
13431 | }
|
13432 | }
|
13433 | }
|
13434 |
|
13435 | $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
|
13436 | Symbol: $Symbol
|
13437 | });
|
13438 |
|
13439 | $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
|
13440 | defineWellKnownSymbol(name);
|
13441 | });
|
13442 |
|
13443 | $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
|
13444 | useSetter: function () { USE_SETTER = true; },
|
13445 | useSimple: function () { USE_SETTER = false; }
|
13446 | });
|
13447 |
|
13448 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
|
13449 |
|
13450 |
|
13451 | create: $create,
|
13452 |
|
13453 |
|
13454 | defineProperty: $defineProperty,
|
13455 |
|
13456 |
|
13457 | defineProperties: $defineProperties,
|
13458 |
|
13459 |
|
13460 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
13461 | });
|
13462 |
|
13463 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
|
13464 |
|
13465 |
|
13466 | getOwnPropertyNames: $getOwnPropertyNames
|
13467 | });
|
13468 |
|
13469 |
|
13470 |
|
13471 | defineSymbolToPrimitive();
|
13472 |
|
13473 |
|
13474 |
|
13475 | setToStringTag($Symbol, SYMBOL);
|
13476 |
|
13477 | hiddenKeys[HIDDEN] = true;
|
13478 |
|
13479 |
|
13480 | }),
|
13481 |
|
13482 | (function(module, exports, __webpack_require__) {
|
13483 |
|
13484 | var $ = __webpack_require__(0);
|
13485 | var getBuiltIn = __webpack_require__(20);
|
13486 | var hasOwn = __webpack_require__(13);
|
13487 | var toString = __webpack_require__(42);
|
13488 | var shared = __webpack_require__(82);
|
13489 | var NATIVE_SYMBOL_REGISTRY = __webpack_require__(247);
|
13490 |
|
13491 | var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
13492 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
13493 |
|
13494 |
|
13495 |
|
13496 | $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
|
13497 | 'for': function (key) {
|
13498 | var string = toString(key);
|
13499 | if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
13500 | var symbol = getBuiltIn('Symbol')(string);
|
13501 | StringToSymbolRegistry[string] = symbol;
|
13502 | SymbolToStringRegistry[symbol] = string;
|
13503 | return symbol;
|
13504 | }
|
13505 | });
|
13506 |
|
13507 |
|
13508 | }),
|
13509 |
|
13510 | (function(module, exports, __webpack_require__) {
|
13511 |
|
13512 | var $ = __webpack_require__(0);
|
13513 | var hasOwn = __webpack_require__(13);
|
13514 | var isSymbol = __webpack_require__(100);
|
13515 | var tryToString = __webpack_require__(67);
|
13516 | var shared = __webpack_require__(82);
|
13517 | var NATIVE_SYMBOL_REGISTRY = __webpack_require__(247);
|
13518 |
|
13519 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
13520 |
|
13521 |
|
13522 |
|
13523 | $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
|
13524 | keyFor: function keyFor(sym) {
|
13525 | if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');
|
13526 | if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
13527 | }
|
13528 | });
|
13529 |
|
13530 |
|
13531 | }),
|
13532 |
|
13533 | (function(module, exports, __webpack_require__) {
|
13534 |
|
13535 | var $ = __webpack_require__(0);
|
13536 | var NATIVE_SYMBOL = __webpack_require__(65);
|
13537 | var fails = __webpack_require__(2);
|
13538 | var getOwnPropertySymbolsModule = __webpack_require__(106);
|
13539 | var toObject = __webpack_require__(33);
|
13540 |
|
13541 |
|
13542 |
|
13543 | var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
|
13544 |
|
13545 |
|
13546 |
|
13547 | $({ target: 'Object', stat: true, forced: FORCED }, {
|
13548 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
13549 | var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
13550 | return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
|
13551 | }
|
13552 | });
|
13553 |
|
13554 |
|
13555 | }),
|
13556 |
|
13557 | (function(module, exports, __webpack_require__) {
|
13558 |
|
13559 | var defineWellKnownSymbol = __webpack_require__(10);
|
13560 |
|
13561 |
|
13562 |
|
13563 | defineWellKnownSymbol('asyncIterator');
|
13564 |
|
13565 |
|
13566 | }),
|
13567 |
|
13568 | (function(module, exports) {
|
13569 |
|
13570 |
|
13571 |
|
13572 |
|
13573 | }),
|
13574 |
|
13575 | (function(module, exports, __webpack_require__) {
|
13576 |
|
13577 | var defineWellKnownSymbol = __webpack_require__(10);
|
13578 |
|
13579 |
|
13580 |
|
13581 | defineWellKnownSymbol('hasInstance');
|
13582 |
|
13583 |
|
13584 | }),
|
13585 |
|
13586 | (function(module, exports, __webpack_require__) {
|
13587 |
|
13588 | var defineWellKnownSymbol = __webpack_require__(10);
|
13589 |
|
13590 |
|
13591 |
|
13592 | defineWellKnownSymbol('isConcatSpreadable');
|
13593 |
|
13594 |
|
13595 | }),
|
13596 |
|
13597 | (function(module, exports, __webpack_require__) {
|
13598 |
|
13599 | var defineWellKnownSymbol = __webpack_require__(10);
|
13600 |
|
13601 |
|
13602 |
|
13603 | defineWellKnownSymbol('match');
|
13604 |
|
13605 |
|
13606 | }),
|
13607 |
|
13608 | (function(module, exports, __webpack_require__) {
|
13609 |
|
13610 | var defineWellKnownSymbol = __webpack_require__(10);
|
13611 |
|
13612 |
|
13613 |
|
13614 | defineWellKnownSymbol('matchAll');
|
13615 |
|
13616 |
|
13617 | }),
|
13618 |
|
13619 | (function(module, exports, __webpack_require__) {
|
13620 |
|
13621 | var defineWellKnownSymbol = __webpack_require__(10);
|
13622 |
|
13623 |
|
13624 |
|
13625 | defineWellKnownSymbol('replace');
|
13626 |
|
13627 |
|
13628 | }),
|
13629 |
|
13630 | (function(module, exports, __webpack_require__) {
|
13631 |
|
13632 | var defineWellKnownSymbol = __webpack_require__(10);
|
13633 |
|
13634 |
|
13635 |
|
13636 | defineWellKnownSymbol('search');
|
13637 |
|
13638 |
|
13639 | }),
|
13640 |
|
13641 | (function(module, exports, __webpack_require__) {
|
13642 |
|
13643 | var defineWellKnownSymbol = __webpack_require__(10);
|
13644 |
|
13645 |
|
13646 |
|
13647 | defineWellKnownSymbol('species');
|
13648 |
|
13649 |
|
13650 | }),
|
13651 |
|
13652 | (function(module, exports, __webpack_require__) {
|
13653 |
|
13654 | var defineWellKnownSymbol = __webpack_require__(10);
|
13655 |
|
13656 |
|
13657 |
|
13658 | defineWellKnownSymbol('split');
|
13659 |
|
13660 |
|
13661 | }),
|
13662 |
|
13663 | (function(module, exports, __webpack_require__) {
|
13664 |
|
13665 | var defineWellKnownSymbol = __webpack_require__(10);
|
13666 | var defineSymbolToPrimitive = __webpack_require__(246);
|
13667 |
|
13668 |
|
13669 |
|
13670 | defineWellKnownSymbol('toPrimitive');
|
13671 |
|
13672 |
|
13673 |
|
13674 | defineSymbolToPrimitive();
|
13675 |
|
13676 |
|
13677 | }),
|
13678 |
|
13679 | (function(module, exports, __webpack_require__) {
|
13680 |
|
13681 | var getBuiltIn = __webpack_require__(20);
|
13682 | var defineWellKnownSymbol = __webpack_require__(10);
|
13683 | var setToStringTag = __webpack_require__(56);
|
13684 |
|
13685 |
|
13686 |
|
13687 | defineWellKnownSymbol('toStringTag');
|
13688 |
|
13689 |
|
13690 |
|
13691 | setToStringTag(getBuiltIn('Symbol'), 'Symbol');
|
13692 |
|
13693 |
|
13694 | }),
|
13695 |
|
13696 | (function(module, exports, __webpack_require__) {
|
13697 |
|
13698 | var defineWellKnownSymbol = __webpack_require__(10);
|
13699 |
|
13700 |
|
13701 |
|
13702 | defineWellKnownSymbol('unscopables');
|
13703 |
|
13704 |
|
13705 | }),
|
13706 |
|
13707 | (function(module, exports, __webpack_require__) {
|
13708 |
|
13709 | var global = __webpack_require__(8);
|
13710 | var setToStringTag = __webpack_require__(56);
|
13711 |
|
13712 |
|
13713 |
|
13714 | setToStringTag(global.JSON, 'JSON', true);
|
13715 |
|
13716 |
|
13717 | }),
|
13718 |
|
13719 | (function(module, exports) {
|
13720 |
|
13721 |
|
13722 |
|
13723 |
|
13724 | }),
|
13725 |
|
13726 | (function(module, exports) {
|
13727 |
|
13728 |
|
13729 |
|
13730 |
|
13731 | }),
|
13732 |
|
13733 | (function(module, exports, __webpack_require__) {
|
13734 |
|
13735 | var defineWellKnownSymbol = __webpack_require__(10);
|
13736 |
|
13737 |
|
13738 |
|
13739 | defineWellKnownSymbol('asyncDispose');
|
13740 |
|
13741 |
|
13742 | }),
|
13743 |
|
13744 | (function(module, exports, __webpack_require__) {
|
13745 |
|
13746 | var defineWellKnownSymbol = __webpack_require__(10);
|
13747 |
|
13748 |
|
13749 |
|
13750 | defineWellKnownSymbol('dispose');
|
13751 |
|
13752 |
|
13753 | }),
|
13754 |
|
13755 | (function(module, exports, __webpack_require__) {
|
13756 |
|
13757 | var defineWellKnownSymbol = __webpack_require__(10);
|
13758 |
|
13759 |
|
13760 |
|
13761 | defineWellKnownSymbol('matcher');
|
13762 |
|
13763 |
|
13764 | }),
|
13765 |
|
13766 | (function(module, exports, __webpack_require__) {
|
13767 |
|
13768 | var defineWellKnownSymbol = __webpack_require__(10);
|
13769 |
|
13770 |
|
13771 |
|
13772 | defineWellKnownSymbol('metadataKey');
|
13773 |
|
13774 |
|
13775 | }),
|
13776 |
|
13777 | (function(module, exports, __webpack_require__) {
|
13778 |
|
13779 | var defineWellKnownSymbol = __webpack_require__(10);
|
13780 |
|
13781 |
|
13782 |
|
13783 | defineWellKnownSymbol('observable');
|
13784 |
|
13785 |
|
13786 | }),
|
13787 |
|
13788 | (function(module, exports, __webpack_require__) {
|
13789 |
|
13790 |
|
13791 | var defineWellKnownSymbol = __webpack_require__(10);
|
13792 |
|
13793 |
|
13794 |
|
13795 | defineWellKnownSymbol('metadata');
|
13796 |
|
13797 |
|
13798 | }),
|
13799 |
|
13800 | (function(module, exports, __webpack_require__) {
|
13801 |
|
13802 |
|
13803 | var defineWellKnownSymbol = __webpack_require__(10);
|
13804 |
|
13805 |
|
13806 |
|
13807 | defineWellKnownSymbol('patternMatch');
|
13808 |
|
13809 |
|
13810 | }),
|
13811 |
|
13812 | (function(module, exports, __webpack_require__) {
|
13813 |
|
13814 |
|
13815 | var defineWellKnownSymbol = __webpack_require__(10);
|
13816 |
|
13817 | defineWellKnownSymbol('replaceAll');
|
13818 |
|
13819 |
|
13820 | }),
|
13821 |
|
13822 | (function(module, exports, __webpack_require__) {
|
13823 |
|
13824 | module.exports = __webpack_require__(465);
|
13825 |
|
13826 | }),
|
13827 |
|
13828 | (function(module, exports, __webpack_require__) {
|
13829 |
|
13830 | module.exports = __webpack_require__(466);
|
13831 |
|
13832 |
|
13833 | }),
|
13834 |
|
13835 | (function(module, exports, __webpack_require__) {
|
13836 |
|
13837 | var parent = __webpack_require__(467);
|
13838 |
|
13839 | module.exports = parent;
|
13840 |
|
13841 |
|
13842 | }),
|
13843 |
|
13844 | (function(module, exports, __webpack_require__) {
|
13845 |
|
13846 | var parent = __webpack_require__(249);
|
13847 |
|
13848 | module.exports = parent;
|
13849 |
|
13850 |
|
13851 | }),
|
13852 |
|
13853 | (function(module, exports, __webpack_require__) {
|
13854 |
|
13855 | __webpack_require__(43);
|
13856 | __webpack_require__(68);
|
13857 | __webpack_require__(70);
|
13858 | __webpack_require__(248);
|
13859 | var WrappedWellKnownSymbolModule = __webpack_require__(152);
|
13860 |
|
13861 | module.exports = WrappedWellKnownSymbolModule.f('iterator');
|
13862 |
|
13863 |
|
13864 | }),
|
13865 |
|
13866 | (function(module, exports, __webpack_require__) {
|
13867 |
|
13868 | var parent = __webpack_require__(470);
|
13869 |
|
13870 | module.exports = parent;
|
13871 |
|
13872 |
|
13873 | }),
|
13874 |
|
13875 | (function(module, exports, __webpack_require__) {
|
13876 |
|
13877 | var isPrototypeOf = __webpack_require__(16);
|
13878 | var method = __webpack_require__(471);
|
13879 |
|
13880 | var ArrayPrototype = Array.prototype;
|
13881 |
|
13882 | module.exports = function (it) {
|
13883 | var own = it.filter;
|
13884 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;
|
13885 | };
|
13886 |
|
13887 |
|
13888 | }),
|
13889 |
|
13890 | (function(module, exports, __webpack_require__) {
|
13891 |
|
13892 | __webpack_require__(472);
|
13893 | var entryVirtual = __webpack_require__(27);
|
13894 |
|
13895 | module.exports = entryVirtual('Array').filter;
|
13896 |
|
13897 |
|
13898 | }),
|
13899 |
|
13900 | (function(module, exports, __webpack_require__) {
|
13901 |
|
13902 | "use strict";
|
13903 |
|
13904 | var $ = __webpack_require__(0);
|
13905 | var $filter = __webpack_require__(75).filter;
|
13906 | var arrayMethodHasSpeciesSupport = __webpack_require__(116);
|
13907 |
|
13908 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
13909 |
|
13910 |
|
13911 |
|
13912 |
|
13913 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
13914 | filter: function filter(callbackfn /* , thisArg */) {
|
13915 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
13916 | }
|
13917 | });
|
13918 |
|
13919 |
|
13920 | }),
|
13921 |
|
13922 | (function(module, exports, __webpack_require__) {
|
13923 |
|
13924 | "use strict";
|
13925 |
|
13926 |
|
13927 | var _interopRequireDefault = __webpack_require__(1);
|
13928 |
|
13929 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
13930 |
|
13931 | var _keys = _interopRequireDefault(__webpack_require__(62));
|
13932 |
|
13933 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
13934 |
|
13935 | var _ = __webpack_require__(3);
|
13936 |
|
13937 | module.exports = function (AV) {
|
13938 | var eventSplitter = /\s+/;
|
13939 | var slice = (0, _slice.default)(Array.prototype);
|
13940 | |
13941 |
|
13942 |
|
13943 |
|
13944 |
|
13945 |
|
13946 |
|
13947 |
|
13948 |
|
13949 |
|
13950 |
|
13951 |
|
13952 |
|
13953 |
|
13954 |
|
13955 |
|
13956 |
|
13957 |
|
13958 |
|
13959 |
|
13960 |
|
13961 | AV.Events = {
|
13962 | |
13963 |
|
13964 |
|
13965 |
|
13966 | on: function on(events, callback, context) {
|
13967 | var calls, event, node, tail, list;
|
13968 |
|
13969 | if (!callback) {
|
13970 | return this;
|
13971 | }
|
13972 |
|
13973 | events = events.split(eventSplitter);
|
13974 | calls = this._callbacks || (this._callbacks = {});
|
13975 |
|
13976 |
|
13977 |
|
13978 | event = events.shift();
|
13979 |
|
13980 | while (event) {
|
13981 | list = calls[event];
|
13982 | node = list ? list.tail : {};
|
13983 | node.next = tail = {};
|
13984 | node.context = context;
|
13985 | node.callback = callback;
|
13986 | calls[event] = {
|
13987 | tail: tail,
|
13988 | next: list ? list.next : node
|
13989 | };
|
13990 | event = events.shift();
|
13991 | }
|
13992 |
|
13993 | return this;
|
13994 | },
|
13995 |
|
13996 | |
13997 |
|
13998 |
|
13999 |
|
14000 |
|
14001 | off: function off(events, callback, context) {
|
14002 | var event, calls, node, tail, cb, ctx;
|
14003 |
|
14004 | if (!(calls = this._callbacks)) {
|
14005 | return;
|
14006 | }
|
14007 |
|
14008 | if (!(events || callback || context)) {
|
14009 | delete this._callbacks;
|
14010 | return this;
|
14011 | }
|
14012 |
|
14013 |
|
14014 |
|
14015 | events = events ? events.split(eventSplitter) : (0, _keys.default)(_).call(_, calls);
|
14016 | event = events.shift();
|
14017 |
|
14018 | while (event) {
|
14019 | node = calls[event];
|
14020 | delete calls[event];
|
14021 |
|
14022 | if (!node || !(callback || context)) {
|
14023 | continue;
|
14024 | }
|
14025 |
|
14026 |
|
14027 | tail = node.tail;
|
14028 | node = node.next;
|
14029 |
|
14030 | while (node !== tail) {
|
14031 | cb = node.callback;
|
14032 | ctx = node.context;
|
14033 |
|
14034 | if (callback && cb !== callback || context && ctx !== context) {
|
14035 | this.on(event, cb, ctx);
|
14036 | }
|
14037 |
|
14038 | node = node.next;
|
14039 | }
|
14040 |
|
14041 | event = events.shift();
|
14042 | }
|
14043 |
|
14044 | return this;
|
14045 | },
|
14046 |
|
14047 | |
14048 |
|
14049 |
|
14050 |
|
14051 |
|
14052 |
|
14053 | trigger: function trigger(events) {
|
14054 | var event, node, calls, tail, args, all, rest;
|
14055 |
|
14056 | if (!(calls = this._callbacks)) {
|
14057 | return this;
|
14058 | }
|
14059 |
|
14060 | all = calls.all;
|
14061 | events = events.split(eventSplitter);
|
14062 | rest = slice.call(arguments, 1);
|
14063 |
|
14064 |
|
14065 | event = events.shift();
|
14066 |
|
14067 | while (event) {
|
14068 | node = calls[event];
|
14069 |
|
14070 | if (node) {
|
14071 | tail = node.tail;
|
14072 |
|
14073 | while ((node = node.next) !== tail) {
|
14074 | node.callback.apply(node.context || this, rest);
|
14075 | }
|
14076 | }
|
14077 |
|
14078 | node = all;
|
14079 |
|
14080 | if (node) {
|
14081 | var _context;
|
14082 |
|
14083 | tail = node.tail;
|
14084 | args = (0, _concat.default)(_context = [event]).call(_context, rest);
|
14085 |
|
14086 | while ((node = node.next) !== tail) {
|
14087 | node.callback.apply(node.context || this, args);
|
14088 | }
|
14089 | }
|
14090 |
|
14091 | event = events.shift();
|
14092 | }
|
14093 |
|
14094 | return this;
|
14095 | }
|
14096 | };
|
14097 | |
14098 |
|
14099 |
|
14100 |
|
14101 | AV.Events.bind = AV.Events.on;
|
14102 | |
14103 |
|
14104 |
|
14105 |
|
14106 | AV.Events.unbind = AV.Events.off;
|
14107 | };
|
14108 |
|
14109 | }),
|
14110 |
|
14111 | (function(module, exports, __webpack_require__) {
|
14112 |
|
14113 | "use strict";
|
14114 |
|
14115 |
|
14116 | var _interopRequireDefault = __webpack_require__(1);
|
14117 |
|
14118 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
14119 |
|
14120 | var _ = __webpack_require__(3);
|
14121 |
|
14122 |
|
14123 |
|
14124 | module.exports = function (AV) {
|
14125 | |
14126 |
|
14127 |
|
14128 |
|
14129 |
|
14130 |
|
14131 |
|
14132 |
|
14133 |
|
14134 |
|
14135 |
|
14136 |
|
14137 |
|
14138 |
|
14139 |
|
14140 |
|
14141 |
|
14142 |
|
14143 |
|
14144 |
|
14145 |
|
14146 |
|
14147 | AV.GeoPoint = function (arg1, arg2) {
|
14148 | if (_.isArray(arg1)) {
|
14149 | AV.GeoPoint._validate(arg1[0], arg1[1]);
|
14150 |
|
14151 | this.latitude = arg1[0];
|
14152 | this.longitude = arg1[1];
|
14153 | } else if (_.isObject(arg1)) {
|
14154 | AV.GeoPoint._validate(arg1.latitude, arg1.longitude);
|
14155 |
|
14156 | this.latitude = arg1.latitude;
|
14157 | this.longitude = arg1.longitude;
|
14158 | } else if (_.isNumber(arg1) && _.isNumber(arg2)) {
|
14159 | AV.GeoPoint._validate(arg1, arg2);
|
14160 |
|
14161 | this.latitude = arg1;
|
14162 | this.longitude = arg2;
|
14163 | } else {
|
14164 | this.latitude = 0;
|
14165 | this.longitude = 0;
|
14166 | }
|
14167 |
|
14168 |
|
14169 |
|
14170 | var self = this;
|
14171 |
|
14172 | if (this.__defineGetter__ && this.__defineSetter__) {
|
14173 |
|
14174 |
|
14175 | this._latitude = this.latitude;
|
14176 | this._longitude = this.longitude;
|
14177 |
|
14178 | this.__defineGetter__('latitude', function () {
|
14179 | return self._latitude;
|
14180 | });
|
14181 |
|
14182 | this.__defineGetter__('longitude', function () {
|
14183 | return self._longitude;
|
14184 | });
|
14185 |
|
14186 | this.__defineSetter__('latitude', function (val) {
|
14187 | AV.GeoPoint._validate(val, self.longitude);
|
14188 |
|
14189 | self._latitude = val;
|
14190 | });
|
14191 |
|
14192 | this.__defineSetter__('longitude', function (val) {
|
14193 | AV.GeoPoint._validate(self.latitude, val);
|
14194 |
|
14195 | self._longitude = val;
|
14196 | });
|
14197 | }
|
14198 | };
|
14199 | |
14200 |
|
14201 |
|
14202 |
|
14203 |
|
14204 |
|
14205 |
|
14206 |
|
14207 | |
14208 |
|
14209 |
|
14210 |
|
14211 |
|
14212 |
|
14213 | AV.GeoPoint._validate = function (latitude, longitude) {
|
14214 | if (latitude < -90.0) {
|
14215 | throw new Error('AV.GeoPoint latitude ' + latitude + ' < -90.0.');
|
14216 | }
|
14217 |
|
14218 | if (latitude > 90.0) {
|
14219 | throw new Error('AV.GeoPoint latitude ' + latitude + ' > 90.0.');
|
14220 | }
|
14221 |
|
14222 | if (longitude < -180.0) {
|
14223 | throw new Error('AV.GeoPoint longitude ' + longitude + ' < -180.0.');
|
14224 | }
|
14225 |
|
14226 | if (longitude > 180.0) {
|
14227 | throw new Error('AV.GeoPoint longitude ' + longitude + ' > 180.0.');
|
14228 | }
|
14229 | };
|
14230 | |
14231 |
|
14232 |
|
14233 |
|
14234 |
|
14235 |
|
14236 | AV.GeoPoint.current = function () {
|
14237 | return new _promise.default(function (resolve, reject) {
|
14238 | navigator.geolocation.getCurrentPosition(function (location) {
|
14239 | resolve(new AV.GeoPoint({
|
14240 | latitude: location.coords.latitude,
|
14241 | longitude: location.coords.longitude
|
14242 | }));
|
14243 | }, reject);
|
14244 | });
|
14245 | };
|
14246 |
|
14247 | _.extend(AV.GeoPoint.prototype,
|
14248 |
|
14249 | {
|
14250 | |
14251 |
|
14252 |
|
14253 |
|
14254 | toJSON: function toJSON() {
|
14255 | AV.GeoPoint._validate(this.latitude, this.longitude);
|
14256 |
|
14257 | return {
|
14258 | __type: 'GeoPoint',
|
14259 | latitude: this.latitude,
|
14260 | longitude: this.longitude
|
14261 | };
|
14262 | },
|
14263 |
|
14264 | |
14265 |
|
14266 |
|
14267 |
|
14268 |
|
14269 | radiansTo: function radiansTo(point) {
|
14270 | var d2r = Math.PI / 180.0;
|
14271 | var lat1rad = this.latitude * d2r;
|
14272 | var long1rad = this.longitude * d2r;
|
14273 | var lat2rad = point.latitude * d2r;
|
14274 | var long2rad = point.longitude * d2r;
|
14275 | var deltaLat = lat1rad - lat2rad;
|
14276 | var deltaLong = long1rad - long2rad;
|
14277 | var sinDeltaLatDiv2 = Math.sin(deltaLat / 2);
|
14278 | var sinDeltaLongDiv2 = Math.sin(deltaLong / 2);
|
14279 |
|
14280 | var a = sinDeltaLatDiv2 * sinDeltaLatDiv2 + Math.cos(lat1rad) * Math.cos(lat2rad) * sinDeltaLongDiv2 * sinDeltaLongDiv2;
|
14281 | a = Math.min(1.0, a);
|
14282 | return 2 * Math.asin(Math.sqrt(a));
|
14283 | },
|
14284 |
|
14285 | |
14286 |
|
14287 |
|
14288 |
|
14289 |
|
14290 | kilometersTo: function kilometersTo(point) {
|
14291 | return this.radiansTo(point) * 6371.0;
|
14292 | },
|
14293 |
|
14294 | |
14295 |
|
14296 |
|
14297 |
|
14298 |
|
14299 | milesTo: function milesTo(point) {
|
14300 | return this.radiansTo(point) * 3958.8;
|
14301 | }
|
14302 | });
|
14303 | };
|
14304 |
|
14305 | }),
|
14306 |
|
14307 | (function(module, exports, __webpack_require__) {
|
14308 |
|
14309 | "use strict";
|
14310 |
|
14311 |
|
14312 | var _ = __webpack_require__(3);
|
14313 |
|
14314 | module.exports = function (AV) {
|
14315 | var PUBLIC_KEY = '*';
|
14316 | |
14317 |
|
14318 |
|
14319 |
|
14320 |
|
14321 |
|
14322 |
|
14323 |
|
14324 |
|
14325 |
|
14326 |
|
14327 |
|
14328 |
|
14329 |
|
14330 |
|
14331 | AV.ACL = function (arg1) {
|
14332 | var self = this;
|
14333 | self.permissionsById = {};
|
14334 |
|
14335 | if (_.isObject(arg1)) {
|
14336 | if (arg1 instanceof AV.User) {
|
14337 | self.setReadAccess(arg1, true);
|
14338 | self.setWriteAccess(arg1, true);
|
14339 | } else {
|
14340 | if (_.isFunction(arg1)) {
|
14341 | throw new Error('AV.ACL() called with a function. Did you forget ()?');
|
14342 | }
|
14343 |
|
14344 | AV._objectEach(arg1, function (accessList, userId) {
|
14345 | if (!_.isString(userId)) {
|
14346 | throw new Error('Tried to create an ACL with an invalid userId.');
|
14347 | }
|
14348 |
|
14349 | self.permissionsById[userId] = {};
|
14350 |
|
14351 | AV._objectEach(accessList, function (allowed, permission) {
|
14352 | if (permission !== 'read' && permission !== 'write') {
|
14353 | throw new Error('Tried to create an ACL with an invalid permission type.');
|
14354 | }
|
14355 |
|
14356 | if (!_.isBoolean(allowed)) {
|
14357 | throw new Error('Tried to create an ACL with an invalid permission value.');
|
14358 | }
|
14359 |
|
14360 | self.permissionsById[userId][permission] = allowed;
|
14361 | });
|
14362 | });
|
14363 | }
|
14364 | }
|
14365 | };
|
14366 | |
14367 |
|
14368 |
|
14369 |
|
14370 |
|
14371 |
|
14372 | AV.ACL.prototype.toJSON = function () {
|
14373 | return _.clone(this.permissionsById);
|
14374 | };
|
14375 |
|
14376 | AV.ACL.prototype._setAccess = function (accessType, userId, allowed) {
|
14377 | if (userId instanceof AV.User) {
|
14378 | userId = userId.id;
|
14379 | } else if (userId instanceof AV.Role) {
|
14380 | userId = 'role:' + userId.getName();
|
14381 | }
|
14382 |
|
14383 | if (!_.isString(userId)) {
|
14384 | throw new Error('userId must be a string.');
|
14385 | }
|
14386 |
|
14387 | if (!_.isBoolean(allowed)) {
|
14388 | throw new Error('allowed must be either true or false.');
|
14389 | }
|
14390 |
|
14391 | var permissions = this.permissionsById[userId];
|
14392 |
|
14393 | if (!permissions) {
|
14394 | if (!allowed) {
|
14395 |
|
14396 | return;
|
14397 | } else {
|
14398 | permissions = {};
|
14399 | this.permissionsById[userId] = permissions;
|
14400 | }
|
14401 | }
|
14402 |
|
14403 | if (allowed) {
|
14404 | this.permissionsById[userId][accessType] = true;
|
14405 | } else {
|
14406 | delete permissions[accessType];
|
14407 |
|
14408 | if (_.isEmpty(permissions)) {
|
14409 | delete this.permissionsById[userId];
|
14410 | }
|
14411 | }
|
14412 | };
|
14413 |
|
14414 | AV.ACL.prototype._getAccess = function (accessType, userId) {
|
14415 | if (userId instanceof AV.User) {
|
14416 | userId = userId.id;
|
14417 | } else if (userId instanceof AV.Role) {
|
14418 | userId = 'role:' + userId.getName();
|
14419 | }
|
14420 |
|
14421 | var permissions = this.permissionsById[userId];
|
14422 |
|
14423 | if (!permissions) {
|
14424 | return false;
|
14425 | }
|
14426 |
|
14427 | return permissions[accessType] ? true : false;
|
14428 | };
|
14429 | |
14430 |
|
14431 |
|
14432 |
|
14433 |
|
14434 |
|
14435 |
|
14436 | AV.ACL.prototype.setReadAccess = function (userId, allowed) {
|
14437 | this._setAccess('read', userId, allowed);
|
14438 | };
|
14439 | |
14440 |
|
14441 |
|
14442 |
|
14443 |
|
14444 |
|
14445 |
|
14446 |
|
14447 |
|
14448 |
|
14449 | AV.ACL.prototype.getReadAccess = function (userId) {
|
14450 | return this._getAccess('read', userId);
|
14451 | };
|
14452 | |
14453 |
|
14454 |
|
14455 |
|
14456 |
|
14457 |
|
14458 |
|
14459 | AV.ACL.prototype.setWriteAccess = function (userId, allowed) {
|
14460 | this._setAccess('write', userId, allowed);
|
14461 | };
|
14462 | |
14463 |
|
14464 |
|
14465 |
|
14466 |
|
14467 |
|
14468 |
|
14469 |
|
14470 |
|
14471 |
|
14472 | AV.ACL.prototype.getWriteAccess = function (userId) {
|
14473 | return this._getAccess('write', userId);
|
14474 | };
|
14475 | |
14476 |
|
14477 |
|
14478 |
|
14479 |
|
14480 |
|
14481 | AV.ACL.prototype.setPublicReadAccess = function (allowed) {
|
14482 | this.setReadAccess(PUBLIC_KEY, allowed);
|
14483 | };
|
14484 | |
14485 |
|
14486 |
|
14487 |
|
14488 |
|
14489 |
|
14490 | AV.ACL.prototype.getPublicReadAccess = function () {
|
14491 | return this.getReadAccess(PUBLIC_KEY);
|
14492 | };
|
14493 | |
14494 |
|
14495 |
|
14496 |
|
14497 |
|
14498 |
|
14499 | AV.ACL.prototype.setPublicWriteAccess = function (allowed) {
|
14500 | this.setWriteAccess(PUBLIC_KEY, allowed);
|
14501 | };
|
14502 | |
14503 |
|
14504 |
|
14505 |
|
14506 |
|
14507 |
|
14508 | AV.ACL.prototype.getPublicWriteAccess = function () {
|
14509 | return this.getWriteAccess(PUBLIC_KEY);
|
14510 | };
|
14511 | |
14512 |
|
14513 |
|
14514 |
|
14515 |
|
14516 |
|
14517 |
|
14518 |
|
14519 |
|
14520 |
|
14521 |
|
14522 | AV.ACL.prototype.getRoleReadAccess = function (role) {
|
14523 | if (role instanceof AV.Role) {
|
14524 |
|
14525 | role = role.getName();
|
14526 | }
|
14527 |
|
14528 | if (_.isString(role)) {
|
14529 | return this.getReadAccess('role:' + role);
|
14530 | }
|
14531 |
|
14532 | throw new Error('role must be a AV.Role or a String');
|
14533 | };
|
14534 | |
14535 |
|
14536 |
|
14537 |
|
14538 |
|
14539 |
|
14540 |
|
14541 |
|
14542 |
|
14543 |
|
14544 |
|
14545 | AV.ACL.prototype.getRoleWriteAccess = function (role) {
|
14546 | if (role instanceof AV.Role) {
|
14547 |
|
14548 | role = role.getName();
|
14549 | }
|
14550 |
|
14551 | if (_.isString(role)) {
|
14552 | return this.getWriteAccess('role:' + role);
|
14553 | }
|
14554 |
|
14555 | throw new Error('role must be a AV.Role or a String');
|
14556 | };
|
14557 | |
14558 |
|
14559 |
|
14560 |
|
14561 |
|
14562 |
|
14563 |
|
14564 |
|
14565 |
|
14566 |
|
14567 | AV.ACL.prototype.setRoleReadAccess = function (role, allowed) {
|
14568 | if (role instanceof AV.Role) {
|
14569 |
|
14570 | role = role.getName();
|
14571 | }
|
14572 |
|
14573 | if (_.isString(role)) {
|
14574 | this.setReadAccess('role:' + role, allowed);
|
14575 | return;
|
14576 | }
|
14577 |
|
14578 | throw new Error('role must be a AV.Role or a String');
|
14579 | };
|
14580 | |
14581 |
|
14582 |
|
14583 |
|
14584 |
|
14585 |
|
14586 |
|
14587 |
|
14588 |
|
14589 |
|
14590 | AV.ACL.prototype.setRoleWriteAccess = function (role, allowed) {
|
14591 | if (role instanceof AV.Role) {
|
14592 |
|
14593 | role = role.getName();
|
14594 | }
|
14595 |
|
14596 | if (_.isString(role)) {
|
14597 | this.setWriteAccess('role:' + role, allowed);
|
14598 | return;
|
14599 | }
|
14600 |
|
14601 | throw new Error('role must be a AV.Role or a String');
|
14602 | };
|
14603 | };
|
14604 |
|
14605 | }),
|
14606 |
|
14607 | (function(module, exports, __webpack_require__) {
|
14608 |
|
14609 | "use strict";
|
14610 |
|
14611 |
|
14612 | var _interopRequireDefault = __webpack_require__(1);
|
14613 |
|
14614 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
14615 |
|
14616 | var _find = _interopRequireDefault(__webpack_require__(96));
|
14617 |
|
14618 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
14619 |
|
14620 | var _map = _interopRequireDefault(__webpack_require__(37));
|
14621 |
|
14622 | var _ = __webpack_require__(3);
|
14623 |
|
14624 | module.exports = function (AV) {
|
14625 | |
14626 |
|
14627 |
|
14628 |
|
14629 |
|
14630 |
|
14631 |
|
14632 |
|
14633 |
|
14634 |
|
14635 |
|
14636 |
|
14637 |
|
14638 | AV.Op = function () {
|
14639 | this._initialize.apply(this, arguments);
|
14640 | };
|
14641 |
|
14642 | _.extend(AV.Op.prototype,
|
14643 |
|
14644 | {
|
14645 | _initialize: function _initialize() {}
|
14646 | });
|
14647 |
|
14648 | _.extend(AV.Op, {
|
14649 | |
14650 |
|
14651 |
|
14652 |
|
14653 | _extend: AV._extend,
|
14654 |
|
14655 | _opDecoderMap: {},
|
14656 |
|
14657 | |
14658 |
|
14659 |
|
14660 |
|
14661 |
|
14662 | _registerDecoder: function _registerDecoder(opName, decoder) {
|
14663 | AV.Op._opDecoderMap[opName] = decoder;
|
14664 | },
|
14665 |
|
14666 | |
14667 |
|
14668 |
|
14669 |
|
14670 | _decode: function _decode(json) {
|
14671 | var decoder = AV.Op._opDecoderMap[json.__op];
|
14672 |
|
14673 | if (decoder) {
|
14674 | return decoder(json);
|
14675 | } else {
|
14676 | return undefined;
|
14677 | }
|
14678 | }
|
14679 | });
|
14680 | |
14681 |
|
14682 |
|
14683 |
|
14684 |
|
14685 | AV.Op._registerDecoder('Batch', function (json) {
|
14686 | var op = null;
|
14687 |
|
14688 | AV._arrayEach(json.ops, function (nextOp) {
|
14689 | nextOp = AV.Op._decode(nextOp);
|
14690 | op = nextOp._mergeWithPrevious(op);
|
14691 | });
|
14692 |
|
14693 | return op;
|
14694 | });
|
14695 | |
14696 |
|
14697 |
|
14698 |
|
14699 |
|
14700 |
|
14701 |
|
14702 |
|
14703 |
|
14704 | AV.Op.Set = AV.Op._extend(
|
14705 |
|
14706 | {
|
14707 | _initialize: function _initialize(value) {
|
14708 | this._value = value;
|
14709 | },
|
14710 |
|
14711 | |
14712 |
|
14713 |
|
14714 | value: function value() {
|
14715 | return this._value;
|
14716 | },
|
14717 |
|
14718 | |
14719 |
|
14720 |
|
14721 |
|
14722 | toJSON: function toJSON() {
|
14723 | return AV._encode(this.value());
|
14724 | },
|
14725 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14726 | return this;
|
14727 | },
|
14728 | _estimate: function _estimate(oldValue) {
|
14729 | return this.value();
|
14730 | }
|
14731 | });
|
14732 | |
14733 |
|
14734 |
|
14735 |
|
14736 |
|
14737 |
|
14738 | AV.Op._UNSET = {};
|
14739 | |
14740 |
|
14741 |
|
14742 |
|
14743 |
|
14744 |
|
14745 |
|
14746 | AV.Op.Unset = AV.Op._extend(
|
14747 |
|
14748 | {
|
14749 | |
14750 |
|
14751 |
|
14752 |
|
14753 | toJSON: function toJSON() {
|
14754 | return {
|
14755 | __op: 'Delete'
|
14756 | };
|
14757 | },
|
14758 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14759 | return this;
|
14760 | },
|
14761 | _estimate: function _estimate(oldValue) {
|
14762 | return AV.Op._UNSET;
|
14763 | }
|
14764 | });
|
14765 |
|
14766 | AV.Op._registerDecoder('Delete', function (json) {
|
14767 | return new AV.Op.Unset();
|
14768 | });
|
14769 | |
14770 |
|
14771 |
|
14772 |
|
14773 |
|
14774 |
|
14775 |
|
14776 |
|
14777 | AV.Op.Increment = AV.Op._extend(
|
14778 |
|
14779 | {
|
14780 | _initialize: function _initialize(amount) {
|
14781 | this._amount = amount;
|
14782 | },
|
14783 |
|
14784 | |
14785 |
|
14786 |
|
14787 |
|
14788 | amount: function amount() {
|
14789 | return this._amount;
|
14790 | },
|
14791 |
|
14792 | |
14793 |
|
14794 |
|
14795 |
|
14796 | toJSON: function toJSON() {
|
14797 | return {
|
14798 | __op: 'Increment',
|
14799 | amount: this._amount
|
14800 | };
|
14801 | },
|
14802 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14803 | if (!previous) {
|
14804 | return this;
|
14805 | } else if (previous instanceof AV.Op.Unset) {
|
14806 | return new AV.Op.Set(this.amount());
|
14807 | } else if (previous instanceof AV.Op.Set) {
|
14808 | return new AV.Op.Set(previous.value() + this.amount());
|
14809 | } else if (previous instanceof AV.Op.Increment) {
|
14810 | return new AV.Op.Increment(this.amount() + previous.amount());
|
14811 | } else {
|
14812 | throw new Error('Op is invalid after previous op.');
|
14813 | }
|
14814 | },
|
14815 | _estimate: function _estimate(oldValue) {
|
14816 | if (!oldValue) {
|
14817 | return this.amount();
|
14818 | }
|
14819 |
|
14820 | return oldValue + this.amount();
|
14821 | }
|
14822 | });
|
14823 |
|
14824 | AV.Op._registerDecoder('Increment', function (json) {
|
14825 | return new AV.Op.Increment(json.amount);
|
14826 | });
|
14827 | |
14828 |
|
14829 |
|
14830 |
|
14831 |
|
14832 |
|
14833 |
|
14834 |
|
14835 | AV.Op.BitAnd = AV.Op._extend(
|
14836 |
|
14837 | {
|
14838 | _initialize: function _initialize(value) {
|
14839 | this._value = value;
|
14840 | },
|
14841 | value: function value() {
|
14842 | return this._value;
|
14843 | },
|
14844 |
|
14845 | |
14846 |
|
14847 |
|
14848 |
|
14849 | toJSON: function toJSON() {
|
14850 | return {
|
14851 | __op: 'BitAnd',
|
14852 | value: this.value()
|
14853 | };
|
14854 | },
|
14855 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14856 | if (!previous) {
|
14857 | return this;
|
14858 | } else if (previous instanceof AV.Op.Unset) {
|
14859 | return new AV.Op.Set(0);
|
14860 | } else if (previous instanceof AV.Op.Set) {
|
14861 | return new AV.Op.Set(previous.value() & this.value());
|
14862 | } else {
|
14863 | throw new Error('Op is invalid after previous op.');
|
14864 | }
|
14865 | },
|
14866 | _estimate: function _estimate(oldValue) {
|
14867 | return oldValue & this.value();
|
14868 | }
|
14869 | });
|
14870 |
|
14871 | AV.Op._registerDecoder('BitAnd', function (json) {
|
14872 | return new AV.Op.BitAnd(json.value);
|
14873 | });
|
14874 | |
14875 |
|
14876 |
|
14877 |
|
14878 |
|
14879 |
|
14880 |
|
14881 |
|
14882 | AV.Op.BitOr = AV.Op._extend(
|
14883 |
|
14884 | {
|
14885 | _initialize: function _initialize(value) {
|
14886 | this._value = value;
|
14887 | },
|
14888 | value: function value() {
|
14889 | return this._value;
|
14890 | },
|
14891 |
|
14892 | |
14893 |
|
14894 |
|
14895 |
|
14896 | toJSON: function toJSON() {
|
14897 | return {
|
14898 | __op: 'BitOr',
|
14899 | value: this.value()
|
14900 | };
|
14901 | },
|
14902 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14903 | if (!previous) {
|
14904 | return this;
|
14905 | } else if (previous instanceof AV.Op.Unset) {
|
14906 | return new AV.Op.Set(this.value());
|
14907 | } else if (previous instanceof AV.Op.Set) {
|
14908 | return new AV.Op.Set(previous.value() | this.value());
|
14909 | } else {
|
14910 | throw new Error('Op is invalid after previous op.');
|
14911 | }
|
14912 | },
|
14913 | _estimate: function _estimate(oldValue) {
|
14914 | return oldValue | this.value();
|
14915 | }
|
14916 | });
|
14917 |
|
14918 | AV.Op._registerDecoder('BitOr', function (json) {
|
14919 | return new AV.Op.BitOr(json.value);
|
14920 | });
|
14921 | |
14922 |
|
14923 |
|
14924 |
|
14925 |
|
14926 |
|
14927 |
|
14928 |
|
14929 | AV.Op.BitXor = AV.Op._extend(
|
14930 |
|
14931 | {
|
14932 | _initialize: function _initialize(value) {
|
14933 | this._value = value;
|
14934 | },
|
14935 | value: function value() {
|
14936 | return this._value;
|
14937 | },
|
14938 |
|
14939 | |
14940 |
|
14941 |
|
14942 |
|
14943 | toJSON: function toJSON() {
|
14944 | return {
|
14945 | __op: 'BitXor',
|
14946 | value: this.value()
|
14947 | };
|
14948 | },
|
14949 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14950 | if (!previous) {
|
14951 | return this;
|
14952 | } else if (previous instanceof AV.Op.Unset) {
|
14953 | return new AV.Op.Set(this.value());
|
14954 | } else if (previous instanceof AV.Op.Set) {
|
14955 | return new AV.Op.Set(previous.value() ^ this.value());
|
14956 | } else {
|
14957 | throw new Error('Op is invalid after previous op.');
|
14958 | }
|
14959 | },
|
14960 | _estimate: function _estimate(oldValue) {
|
14961 | return oldValue ^ this.value();
|
14962 | }
|
14963 | });
|
14964 |
|
14965 | AV.Op._registerDecoder('BitXor', function (json) {
|
14966 | return new AV.Op.BitXor(json.value);
|
14967 | });
|
14968 | |
14969 |
|
14970 |
|
14971 |
|
14972 |
|
14973 |
|
14974 |
|
14975 |
|
14976 | AV.Op.Add = AV.Op._extend(
|
14977 |
|
14978 | {
|
14979 | _initialize: function _initialize(objects) {
|
14980 | this._objects = objects;
|
14981 | },
|
14982 |
|
14983 | |
14984 |
|
14985 |
|
14986 |
|
14987 | objects: function objects() {
|
14988 | return this._objects;
|
14989 | },
|
14990 |
|
14991 | |
14992 |
|
14993 |
|
14994 |
|
14995 | toJSON: function toJSON() {
|
14996 | return {
|
14997 | __op: 'Add',
|
14998 | objects: AV._encode(this.objects())
|
14999 | };
|
15000 | },
|
15001 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15002 | if (!previous) {
|
15003 | return this;
|
15004 | } else if (previous instanceof AV.Op.Unset) {
|
15005 | return new AV.Op.Set(this.objects());
|
15006 | } else if (previous instanceof AV.Op.Set) {
|
15007 | return new AV.Op.Set(this._estimate(previous.value()));
|
15008 | } else if (previous instanceof AV.Op.Add) {
|
15009 | var _context;
|
15010 |
|
15011 | return new AV.Op.Add((0, _concat.default)(_context = previous.objects()).call(_context, this.objects()));
|
15012 | } else {
|
15013 | throw new Error('Op is invalid after previous op.');
|
15014 | }
|
15015 | },
|
15016 | _estimate: function _estimate(oldValue) {
|
15017 | if (!oldValue) {
|
15018 | return _.clone(this.objects());
|
15019 | } else {
|
15020 | return (0, _concat.default)(oldValue).call(oldValue, this.objects());
|
15021 | }
|
15022 | }
|
15023 | });
|
15024 |
|
15025 | AV.Op._registerDecoder('Add', function (json) {
|
15026 | return new AV.Op.Add(AV._decode(json.objects));
|
15027 | });
|
15028 | |
15029 |
|
15030 |
|
15031 |
|
15032 |
|
15033 |
|
15034 |
|
15035 |
|
15036 |
|
15037 | AV.Op.AddUnique = AV.Op._extend(
|
15038 |
|
15039 | {
|
15040 | _initialize: function _initialize(objects) {
|
15041 | this._objects = _.uniq(objects);
|
15042 | },
|
15043 |
|
15044 | |
15045 |
|
15046 |
|
15047 |
|
15048 | objects: function objects() {
|
15049 | return this._objects;
|
15050 | },
|
15051 |
|
15052 | |
15053 |
|
15054 |
|
15055 |
|
15056 | toJSON: function toJSON() {
|
15057 | return {
|
15058 | __op: 'AddUnique',
|
15059 | objects: AV._encode(this.objects())
|
15060 | };
|
15061 | },
|
15062 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15063 | if (!previous) {
|
15064 | return this;
|
15065 | } else if (previous instanceof AV.Op.Unset) {
|
15066 | return new AV.Op.Set(this.objects());
|
15067 | } else if (previous instanceof AV.Op.Set) {
|
15068 | return new AV.Op.Set(this._estimate(previous.value()));
|
15069 | } else if (previous instanceof AV.Op.AddUnique) {
|
15070 | return new AV.Op.AddUnique(this._estimate(previous.objects()));
|
15071 | } else {
|
15072 | throw new Error('Op is invalid after previous op.');
|
15073 | }
|
15074 | },
|
15075 | _estimate: function _estimate(oldValue) {
|
15076 | if (!oldValue) {
|
15077 | return _.clone(this.objects());
|
15078 | } else {
|
15079 |
|
15080 |
|
15081 |
|
15082 | var newValue = _.clone(oldValue);
|
15083 |
|
15084 | AV._arrayEach(this.objects(), function (obj) {
|
15085 | if (obj instanceof AV.Object && obj.id) {
|
15086 | var matchingObj = (0, _find.default)(_).call(_, newValue, function (anObj) {
|
15087 | return anObj instanceof AV.Object && anObj.id === obj.id;
|
15088 | });
|
15089 |
|
15090 | if (!matchingObj) {
|
15091 | newValue.push(obj);
|
15092 | } else {
|
15093 | var index = (0, _indexOf.default)(_).call(_, newValue, matchingObj);
|
15094 | newValue[index] = obj;
|
15095 | }
|
15096 | } else if (!_.contains(newValue, obj)) {
|
15097 | newValue.push(obj);
|
15098 | }
|
15099 | });
|
15100 |
|
15101 | return newValue;
|
15102 | }
|
15103 | }
|
15104 | });
|
15105 |
|
15106 | AV.Op._registerDecoder('AddUnique', function (json) {
|
15107 | return new AV.Op.AddUnique(AV._decode(json.objects));
|
15108 | });
|
15109 | |
15110 |
|
15111 |
|
15112 |
|
15113 |
|
15114 |
|
15115 |
|
15116 |
|
15117 | AV.Op.Remove = AV.Op._extend(
|
15118 |
|
15119 | {
|
15120 | _initialize: function _initialize(objects) {
|
15121 | this._objects = _.uniq(objects);
|
15122 | },
|
15123 |
|
15124 | |
15125 |
|
15126 |
|
15127 |
|
15128 | objects: function objects() {
|
15129 | return this._objects;
|
15130 | },
|
15131 |
|
15132 | |
15133 |
|
15134 |
|
15135 |
|
15136 | toJSON: function toJSON() {
|
15137 | return {
|
15138 | __op: 'Remove',
|
15139 | objects: AV._encode(this.objects())
|
15140 | };
|
15141 | },
|
15142 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15143 | if (!previous) {
|
15144 | return this;
|
15145 | } else if (previous instanceof AV.Op.Unset) {
|
15146 | return previous;
|
15147 | } else if (previous instanceof AV.Op.Set) {
|
15148 | return new AV.Op.Set(this._estimate(previous.value()));
|
15149 | } else if (previous instanceof AV.Op.Remove) {
|
15150 | return new AV.Op.Remove(_.union(previous.objects(), this.objects()));
|
15151 | } else {
|
15152 | throw new Error('Op is invalid after previous op.');
|
15153 | }
|
15154 | },
|
15155 | _estimate: function _estimate(oldValue) {
|
15156 | if (!oldValue) {
|
15157 | return [];
|
15158 | } else {
|
15159 | var newValue = _.difference(oldValue, this.objects());
|
15160 |
|
15161 |
|
15162 | AV._arrayEach(this.objects(), function (obj) {
|
15163 | if (obj instanceof AV.Object && obj.id) {
|
15164 | newValue = _.reject(newValue, function (other) {
|
15165 | return other instanceof AV.Object && other.id === obj.id;
|
15166 | });
|
15167 | }
|
15168 | });
|
15169 |
|
15170 | return newValue;
|
15171 | }
|
15172 | }
|
15173 | });
|
15174 |
|
15175 | AV.Op._registerDecoder('Remove', function (json) {
|
15176 | return new AV.Op.Remove(AV._decode(json.objects));
|
15177 | });
|
15178 | |
15179 |
|
15180 |
|
15181 |
|
15182 |
|
15183 |
|
15184 |
|
15185 |
|
15186 |
|
15187 | AV.Op.Relation = AV.Op._extend(
|
15188 |
|
15189 | {
|
15190 | _initialize: function _initialize(adds, removes) {
|
15191 | this._targetClassName = null;
|
15192 | var self = this;
|
15193 |
|
15194 | var pointerToId = function pointerToId(object) {
|
15195 | if (object instanceof AV.Object) {
|
15196 | if (!object.id) {
|
15197 | throw new Error("You can't add an unsaved AV.Object to a relation.");
|
15198 | }
|
15199 |
|
15200 | if (!self._targetClassName) {
|
15201 | self._targetClassName = object.className;
|
15202 | }
|
15203 |
|
15204 | if (self._targetClassName !== object.className) {
|
15205 | throw new Error('Tried to create a AV.Relation with 2 different types: ' + self._targetClassName + ' and ' + object.className + '.');
|
15206 | }
|
15207 |
|
15208 | return object.id;
|
15209 | }
|
15210 |
|
15211 | return object;
|
15212 | };
|
15213 |
|
15214 | this.relationsToAdd = _.uniq((0, _map.default)(_).call(_, adds, pointerToId));
|
15215 | this.relationsToRemove = _.uniq((0, _map.default)(_).call(_, removes, pointerToId));
|
15216 | },
|
15217 |
|
15218 | |
15219 |
|
15220 |
|
15221 |
|
15222 |
|
15223 | added: function added() {
|
15224 | var self = this;
|
15225 | return (0, _map.default)(_).call(_, this.relationsToAdd, function (objectId) {
|
15226 | var object = AV.Object._create(self._targetClassName);
|
15227 |
|
15228 | object.id = objectId;
|
15229 | return object;
|
15230 | });
|
15231 | },
|
15232 |
|
15233 | |
15234 |
|
15235 |
|
15236 |
|
15237 |
|
15238 | removed: function removed() {
|
15239 | var self = this;
|
15240 | return (0, _map.default)(_).call(_, this.relationsToRemove, function (objectId) {
|
15241 | var object = AV.Object._create(self._targetClassName);
|
15242 |
|
15243 | object.id = objectId;
|
15244 | return object;
|
15245 | });
|
15246 | },
|
15247 |
|
15248 | |
15249 |
|
15250 |
|
15251 |
|
15252 | toJSON: function toJSON() {
|
15253 | var adds = null;
|
15254 | var removes = null;
|
15255 | var self = this;
|
15256 |
|
15257 | var idToPointer = function idToPointer(id) {
|
15258 | return {
|
15259 | __type: 'Pointer',
|
15260 | className: self._targetClassName,
|
15261 | objectId: id
|
15262 | };
|
15263 | };
|
15264 |
|
15265 | var pointers = null;
|
15266 |
|
15267 | if (this.relationsToAdd.length > 0) {
|
15268 | pointers = (0, _map.default)(_).call(_, this.relationsToAdd, idToPointer);
|
15269 | adds = {
|
15270 | __op: 'AddRelation',
|
15271 | objects: pointers
|
15272 | };
|
15273 | }
|
15274 |
|
15275 | if (this.relationsToRemove.length > 0) {
|
15276 | pointers = (0, _map.default)(_).call(_, this.relationsToRemove, idToPointer);
|
15277 | removes = {
|
15278 | __op: 'RemoveRelation',
|
15279 | objects: pointers
|
15280 | };
|
15281 | }
|
15282 |
|
15283 | if (adds && removes) {
|
15284 | return {
|
15285 | __op: 'Batch',
|
15286 | ops: [adds, removes]
|
15287 | };
|
15288 | }
|
15289 |
|
15290 | return adds || removes || {};
|
15291 | },
|
15292 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15293 | if (!previous) {
|
15294 | return this;
|
15295 | } else if (previous instanceof AV.Op.Unset) {
|
15296 | throw new Error("You can't modify a relation after deleting it.");
|
15297 | } else if (previous instanceof AV.Op.Relation) {
|
15298 | if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
|
15299 | throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + this._targetClassName + ' was passed in.');
|
15300 | }
|
15301 |
|
15302 | var newAdd = _.union(_.difference(previous.relationsToAdd, this.relationsToRemove), this.relationsToAdd);
|
15303 |
|
15304 | var newRemove = _.union(_.difference(previous.relationsToRemove, this.relationsToAdd), this.relationsToRemove);
|
15305 |
|
15306 | var newRelation = new AV.Op.Relation(newAdd, newRemove);
|
15307 | newRelation._targetClassName = this._targetClassName;
|
15308 | return newRelation;
|
15309 | } else {
|
15310 | throw new Error('Op is invalid after previous op.');
|
15311 | }
|
15312 | },
|
15313 | _estimate: function _estimate(oldValue, object, key) {
|
15314 | if (!oldValue) {
|
15315 | var relation = new AV.Relation(object, key);
|
15316 | relation.targetClassName = this._targetClassName;
|
15317 | } else if (oldValue instanceof AV.Relation) {
|
15318 | if (this._targetClassName) {
|
15319 | if (oldValue.targetClassName) {
|
15320 | if (oldValue.targetClassName !== this._targetClassName) {
|
15321 | throw new Error('Related object must be a ' + oldValue.targetClassName + ', but a ' + this._targetClassName + ' was passed in.');
|
15322 | }
|
15323 | } else {
|
15324 | oldValue.targetClassName = this._targetClassName;
|
15325 | }
|
15326 | }
|
15327 |
|
15328 | return oldValue;
|
15329 | } else {
|
15330 | throw new Error('Op is invalid after previous op.');
|
15331 | }
|
15332 | }
|
15333 | });
|
15334 |
|
15335 | AV.Op._registerDecoder('AddRelation', function (json) {
|
15336 | return new AV.Op.Relation(AV._decode(json.objects), []);
|
15337 | });
|
15338 |
|
15339 | AV.Op._registerDecoder('RemoveRelation', function (json) {
|
15340 | return new AV.Op.Relation([], AV._decode(json.objects));
|
15341 | });
|
15342 | };
|
15343 |
|
15344 | }),
|
15345 |
|
15346 | (function(module, exports, __webpack_require__) {
|
15347 |
|
15348 | var parent = __webpack_require__(478);
|
15349 |
|
15350 | module.exports = parent;
|
15351 |
|
15352 |
|
15353 | }),
|
15354 |
|
15355 | (function(module, exports, __webpack_require__) {
|
15356 |
|
15357 | var isPrototypeOf = __webpack_require__(16);
|
15358 | var method = __webpack_require__(479);
|
15359 |
|
15360 | var ArrayPrototype = Array.prototype;
|
15361 |
|
15362 | module.exports = function (it) {
|
15363 | var own = it.find;
|
15364 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;
|
15365 | };
|
15366 |
|
15367 |
|
15368 | }),
|
15369 |
|
15370 | (function(module, exports, __webpack_require__) {
|
15371 |
|
15372 | __webpack_require__(480);
|
15373 | var entryVirtual = __webpack_require__(27);
|
15374 |
|
15375 | module.exports = entryVirtual('Array').find;
|
15376 |
|
15377 |
|
15378 | }),
|
15379 |
|
15380 | (function(module, exports, __webpack_require__) {
|
15381 |
|
15382 | "use strict";
|
15383 |
|
15384 | var $ = __webpack_require__(0);
|
15385 | var $find = __webpack_require__(75).find;
|
15386 | var addToUnscopables = __webpack_require__(132);
|
15387 |
|
15388 | var FIND = 'find';
|
15389 | var SKIPS_HOLES = true;
|
15390 |
|
15391 |
|
15392 | if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
15393 |
|
15394 |
|
15395 |
|
15396 | $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
15397 | find: function find(callbackfn /* , that = undefined */) {
|
15398 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
15399 | }
|
15400 | });
|
15401 |
|
15402 |
|
15403 | addToUnscopables(FIND);
|
15404 |
|
15405 |
|
15406 | }),
|
15407 |
|
15408 | (function(module, exports, __webpack_require__) {
|
15409 |
|
15410 | "use strict";
|
15411 |
|
15412 |
|
15413 | var _ = __webpack_require__(3);
|
15414 |
|
15415 | module.exports = function (AV) {
|
15416 | |
15417 |
|
15418 |
|
15419 |
|
15420 |
|
15421 |
|
15422 |
|
15423 |
|
15424 |
|
15425 |
|
15426 |
|
15427 |
|
15428 |
|
15429 |
|
15430 |
|
15431 | AV.Relation = function (parent, key) {
|
15432 | if (!_.isString(key)) {
|
15433 | throw new TypeError('key must be a string');
|
15434 | }
|
15435 |
|
15436 | this.parent = parent;
|
15437 | this.key = key;
|
15438 | this.targetClassName = null;
|
15439 | };
|
15440 | |
15441 |
|
15442 |
|
15443 |
|
15444 |
|
15445 |
|
15446 |
|
15447 |
|
15448 |
|
15449 | AV.Relation.reverseQuery = function (parentClass, relationKey, child) {
|
15450 | var query = new AV.Query(parentClass);
|
15451 | query.equalTo(relationKey, child._toPointer());
|
15452 | return query;
|
15453 | };
|
15454 |
|
15455 | _.extend(AV.Relation.prototype,
|
15456 |
|
15457 | {
|
15458 | |
15459 |
|
15460 |
|
15461 |
|
15462 | _ensureParentAndKey: function _ensureParentAndKey(parent, key) {
|
15463 | this.parent = this.parent || parent;
|
15464 | this.key = this.key || key;
|
15465 |
|
15466 | if (this.parent !== parent) {
|
15467 | throw new Error('Internal Error. Relation retrieved from two different Objects.');
|
15468 | }
|
15469 |
|
15470 | if (this.key !== key) {
|
15471 | throw new Error('Internal Error. Relation retrieved from two different keys.');
|
15472 | }
|
15473 | },
|
15474 |
|
15475 | |
15476 |
|
15477 |
|
15478 |
|
15479 | add: function add(objects) {
|
15480 | if (!_.isArray(objects)) {
|
15481 | objects = [objects];
|
15482 | }
|
15483 |
|
15484 | var change = new AV.Op.Relation(objects, []);
|
15485 | this.parent.set(this.key, change);
|
15486 | this.targetClassName = change._targetClassName;
|
15487 | },
|
15488 |
|
15489 | |
15490 |
|
15491 |
|
15492 |
|
15493 | remove: function remove(objects) {
|
15494 | if (!_.isArray(objects)) {
|
15495 | objects = [objects];
|
15496 | }
|
15497 |
|
15498 | var change = new AV.Op.Relation([], objects);
|
15499 | this.parent.set(this.key, change);
|
15500 | this.targetClassName = change._targetClassName;
|
15501 | },
|
15502 |
|
15503 | |
15504 |
|
15505 |
|
15506 |
|
15507 | toJSON: function toJSON() {
|
15508 | return {
|
15509 | __type: 'Relation',
|
15510 | className: this.targetClassName
|
15511 | };
|
15512 | },
|
15513 |
|
15514 | |
15515 |
|
15516 |
|
15517 |
|
15518 |
|
15519 | query: function query() {
|
15520 | var targetClass;
|
15521 | var query;
|
15522 |
|
15523 | if (!this.targetClassName) {
|
15524 | targetClass = AV.Object._getSubclass(this.parent.className);
|
15525 | query = new AV.Query(targetClass);
|
15526 | query._defaultParams.redirectClassNameForKey = this.key;
|
15527 | } else {
|
15528 | targetClass = AV.Object._getSubclass(this.targetClassName);
|
15529 | query = new AV.Query(targetClass);
|
15530 | }
|
15531 |
|
15532 | query._addCondition('$relatedTo', 'object', this.parent._toPointer());
|
15533 |
|
15534 | query._addCondition('$relatedTo', 'key', this.key);
|
15535 |
|
15536 | return query;
|
15537 | }
|
15538 | });
|
15539 | };
|
15540 |
|
15541 | }),
|
15542 |
|
15543 | (function(module, exports, __webpack_require__) {
|
15544 |
|
15545 | "use strict";
|
15546 |
|
15547 |
|
15548 | var _interopRequireDefault = __webpack_require__(1);
|
15549 |
|
15550 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
15551 |
|
15552 | var _ = __webpack_require__(3);
|
15553 |
|
15554 | var cos = __webpack_require__(483);
|
15555 |
|
15556 | var qiniu = __webpack_require__(484);
|
15557 |
|
15558 | var s3 = __webpack_require__(530);
|
15559 |
|
15560 | var AVError = __webpack_require__(48);
|
15561 |
|
15562 | var _require = __webpack_require__(28),
|
15563 | request = _require.request,
|
15564 | AVRequest = _require._request;
|
15565 |
|
15566 | var _require2 = __webpack_require__(32),
|
15567 | tap = _require2.tap,
|
15568 | transformFetchOptions = _require2.transformFetchOptions;
|
15569 |
|
15570 | var debug = __webpack_require__(63)('leancloud:file');
|
15571 |
|
15572 | var parseBase64 = __webpack_require__(534);
|
15573 |
|
15574 | module.exports = function (AV) {
|
15575 |
|
15576 |
|
15577 | var extname = function extname(path) {
|
15578 | if (!_.isString(path)) return '';
|
15579 | return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
|
15580 | };
|
15581 |
|
15582 | var b64Digit = function b64Digit(number) {
|
15583 | if (number < 26) {
|
15584 | return String.fromCharCode(65 + number);
|
15585 | }
|
15586 |
|
15587 | if (number < 52) {
|
15588 | return String.fromCharCode(97 + (number - 26));
|
15589 | }
|
15590 |
|
15591 | if (number < 62) {
|
15592 | return String.fromCharCode(48 + (number - 52));
|
15593 | }
|
15594 |
|
15595 | if (number === 62) {
|
15596 | return '+';
|
15597 | }
|
15598 |
|
15599 | if (number === 63) {
|
15600 | return '/';
|
15601 | }
|
15602 |
|
15603 | throw new Error('Tried to encode large digit ' + number + ' in base64.');
|
15604 | };
|
15605 |
|
15606 | var encodeBase64 = function encodeBase64(array) {
|
15607 | var chunks = [];
|
15608 | chunks.length = Math.ceil(array.length / 3);
|
15609 |
|
15610 | _.times(chunks.length, function (i) {
|
15611 | var b1 = array[i * 3];
|
15612 | var b2 = array[i * 3 + 1] || 0;
|
15613 | var b3 = array[i * 3 + 2] || 0;
|
15614 | var has2 = i * 3 + 1 < array.length;
|
15615 | var has3 = i * 3 + 2 < array.length;
|
15616 | 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('');
|
15617 | });
|
15618 |
|
15619 | return chunks.join('');
|
15620 | };
|
15621 | |
15622 |
|
15623 |
|
15624 |
|
15625 |
|
15626 |
|
15627 |
|
15628 |
|
15629 |
|
15630 |
|
15631 |
|
15632 |
|
15633 |
|
15634 |
|
15635 |
|
15636 |
|
15637 |
|
15638 |
|
15639 |
|
15640 |
|
15641 |
|
15642 |
|
15643 |
|
15644 |
|
15645 |
|
15646 |
|
15647 |
|
15648 |
|
15649 |
|
15650 |
|
15651 |
|
15652 |
|
15653 |
|
15654 |
|
15655 | AV.File = function (name, data, mimeType) {
|
15656 | this.attributes = {
|
15657 | name: name,
|
15658 | url: '',
|
15659 | metaData: {},
|
15660 |
|
15661 | base64: ''
|
15662 | };
|
15663 |
|
15664 | if (_.isString(data)) {
|
15665 | throw new TypeError('Creating an AV.File from a String is not yet supported.');
|
15666 | }
|
15667 |
|
15668 | if (_.isArray(data)) {
|
15669 | this.attributes.metaData.size = data.length;
|
15670 | data = {
|
15671 | base64: encodeBase64(data)
|
15672 | };
|
15673 | }
|
15674 |
|
15675 | this._extName = '';
|
15676 | this._data = data;
|
15677 | this._uploadHeaders = {};
|
15678 |
|
15679 | if (data && data.blob && typeof data.blob.uri === 'string') {
|
15680 | this._extName = extname(data.blob.uri);
|
15681 | }
|
15682 |
|
15683 | if (typeof Blob !== 'undefined' && data instanceof Blob) {
|
15684 | if (data.size) {
|
15685 | this.attributes.metaData.size = data.size;
|
15686 | }
|
15687 |
|
15688 | if (data.name) {
|
15689 | this._extName = extname(data.name);
|
15690 | }
|
15691 | }
|
15692 |
|
15693 | var owner;
|
15694 |
|
15695 | if (data && data.owner) {
|
15696 | owner = data.owner;
|
15697 | } else if (!AV._config.disableCurrentUser) {
|
15698 | try {
|
15699 | owner = AV.User.current();
|
15700 | } catch (error) {
|
15701 | if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
|
15702 | throw error;
|
15703 | }
|
15704 | }
|
15705 | }
|
15706 |
|
15707 | this.attributes.metaData.owner = owner ? owner.id : 'unknown';
|
15708 | this.set('mime_type', mimeType);
|
15709 | };
|
15710 | |
15711 |
|
15712 |
|
15713 |
|
15714 |
|
15715 |
|
15716 |
|
15717 |
|
15718 |
|
15719 |
|
15720 |
|
15721 |
|
15722 | AV.File.withURL = function (name, url, metaData, type) {
|
15723 | if (!name || !url) {
|
15724 | throw new Error('Please provide file name and url');
|
15725 | }
|
15726 |
|
15727 | var file = new AV.File(name, null, type);
|
15728 |
|
15729 | if (metaData) {
|
15730 | for (var prop in metaData) {
|
15731 | if (!file.attributes.metaData[prop]) file.attributes.metaData[prop] = metaData[prop];
|
15732 | }
|
15733 | }
|
15734 |
|
15735 | file.attributes.url = url;
|
15736 |
|
15737 | file.attributes.metaData.__source = 'external';
|
15738 | file.attributes.metaData.size = 0;
|
15739 | return file;
|
15740 | };
|
15741 | |
15742 |
|
15743 |
|
15744 |
|
15745 |
|
15746 |
|
15747 |
|
15748 | AV.File.createWithoutData = function (objectId) {
|
15749 | if (!objectId) {
|
15750 | throw new TypeError('The objectId must be provided');
|
15751 | }
|
15752 |
|
15753 | var file = new AV.File();
|
15754 | file.id = objectId;
|
15755 | return file;
|
15756 | };
|
15757 | |
15758 |
|
15759 |
|
15760 |
|
15761 |
|
15762 |
|
15763 |
|
15764 |
|
15765 | AV.File.censor = function (objectId) {
|
15766 | if (!AV._config.masterKey) {
|
15767 | throw new Error('Cannot censor a file without masterKey');
|
15768 | }
|
15769 |
|
15770 | return request({
|
15771 | method: 'POST',
|
15772 | path: "/files/".concat(objectId, "/censor"),
|
15773 | authOptions: {
|
15774 | useMasterKey: true
|
15775 | }
|
15776 | }).then(function (res) {
|
15777 | return res.censorResult;
|
15778 | });
|
15779 | };
|
15780 |
|
15781 | _.extend(AV.File.prototype,
|
15782 |
|
15783 | {
|
15784 | className: '_File',
|
15785 | _toFullJSON: function _toFullJSON(seenObjects) {
|
15786 | var _this = this;
|
15787 |
|
15788 | var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
15789 |
|
15790 | var json = _.clone(this.attributes);
|
15791 |
|
15792 | AV._objectEach(json, function (val, key) {
|
15793 | json[key] = AV._encode(val, seenObjects, undefined, full);
|
15794 | });
|
15795 |
|
15796 | AV._objectEach(this._operations, function (val, key) {
|
15797 | json[key] = val;
|
15798 | });
|
15799 |
|
15800 | if (_.has(this, 'id')) {
|
15801 | json.objectId = this.id;
|
15802 | }
|
15803 |
|
15804 | ['createdAt', 'updatedAt'].forEach(function (key) {
|
15805 | if (_.has(_this, key)) {
|
15806 | var val = _this[key];
|
15807 | json[key] = _.isDate(val) ? val.toJSON() : val;
|
15808 | }
|
15809 | });
|
15810 |
|
15811 | if (full) {
|
15812 | json.__type = 'File';
|
15813 | }
|
15814 |
|
15815 | return json;
|
15816 | },
|
15817 |
|
15818 | |
15819 |
|
15820 |
|
15821 |
|
15822 |
|
15823 |
|
15824 | toFullJSON: function toFullJSON() {
|
15825 | var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
15826 | return this._toFullJSON(seenObjects);
|
15827 | },
|
15828 |
|
15829 | |
15830 |
|
15831 |
|
15832 |
|
15833 | toJSON: function toJSON(key, holder) {
|
15834 | var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [this];
|
15835 | return this._toFullJSON(seenObjects, false);
|
15836 | },
|
15837 |
|
15838 | |
15839 |
|
15840 |
|
15841 |
|
15842 | _toPointer: function _toPointer() {
|
15843 | return {
|
15844 | __type: 'Pointer',
|
15845 | className: this.className,
|
15846 | objectId: this.id
|
15847 | };
|
15848 | },
|
15849 |
|
15850 | |
15851 |
|
15852 |
|
15853 |
|
15854 | getACL: function getACL() {
|
15855 | return this._acl;
|
15856 | },
|
15857 |
|
15858 | |
15859 |
|
15860 |
|
15861 |
|
15862 | setACL: function setACL(acl) {
|
15863 | if (!(acl instanceof AV.ACL)) {
|
15864 | return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
|
15865 | }
|
15866 |
|
15867 | this._acl = acl;
|
15868 | return this;
|
15869 | },
|
15870 |
|
15871 | |
15872 |
|
15873 |
|
15874 |
|
15875 |
|
15876 | name: function name() {
|
15877 | return this.get('name');
|
15878 | },
|
15879 |
|
15880 | |
15881 |
|
15882 |
|
15883 |
|
15884 |
|
15885 | url: function url() {
|
15886 | return this.get('url');
|
15887 | },
|
15888 |
|
15889 | |
15890 |
|
15891 |
|
15892 |
|
15893 |
|
15894 | get: function get(attrName) {
|
15895 | switch (attrName) {
|
15896 | case 'objectId':
|
15897 | return this.id;
|
15898 |
|
15899 | case 'url':
|
15900 | case 'name':
|
15901 | case 'mime_type':
|
15902 | case 'metaData':
|
15903 | case 'createdAt':
|
15904 | case 'updatedAt':
|
15905 | return this.attributes[attrName];
|
15906 |
|
15907 | default:
|
15908 | return this.attributes.metaData[attrName];
|
15909 | }
|
15910 | },
|
15911 |
|
15912 | |
15913 |
|
15914 |
|
15915 |
|
15916 |
|
15917 |
|
15918 |
|
15919 | set: function set() {
|
15920 | var _this2 = this;
|
15921 |
|
15922 | var set = function set(attrName, value) {
|
15923 | switch (attrName) {
|
15924 | case 'name':
|
15925 | case 'url':
|
15926 | case 'mime_type':
|
15927 | case 'base64':
|
15928 | case 'metaData':
|
15929 | _this2.attributes[attrName] = value;
|
15930 | break;
|
15931 |
|
15932 | default:
|
15933 |
|
15934 | _this2.attributes.metaData[attrName] = value;
|
15935 | break;
|
15936 | }
|
15937 | };
|
15938 |
|
15939 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
15940 | args[_key] = arguments[_key];
|
15941 | }
|
15942 |
|
15943 | switch (args.length) {
|
15944 | case 1:
|
15945 |
|
15946 | for (var k in args[0]) {
|
15947 | set(k, args[0][k]);
|
15948 | }
|
15949 |
|
15950 | break;
|
15951 |
|
15952 | case 2:
|
15953 | set(args[0], args[1]);
|
15954 | break;
|
15955 | }
|
15956 |
|
15957 | return this;
|
15958 | },
|
15959 |
|
15960 | /**
|
15961 | * Set a header for the upload request.
|
15962 | * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
|
15963 | *
|
15964 | * @param {String} key header key
|
15965 | * @param {String} value header value
|
15966 | * @return {AV.File} this
|
15967 | */
|
15968 | setUploadHeader: function setUploadHeader(key, value) {
|
15969 | this._uploadHeaders[key] = value;
|
15970 | return this;
|
15971 | },
|
15972 |
|
15973 | |
15974 |
|
15975 |
|
15976 |
|
15977 |
|
15978 |
|
15979 |
|
15980 |
|
15981 |
|
15982 |
|
15983 |
|
15984 |
|
15985 | metaData: function metaData(attr, value) {
|
15986 | if (attr && value) {
|
15987 | this.attributes.metaData[attr] = value;
|
15988 | return this;
|
15989 | } else if (attr && !value) {
|
15990 | return this.attributes.metaData[attr];
|
15991 | } else {
|
15992 | return this.attributes.metaData;
|
15993 | }
|
15994 | },
|
15995 |
|
15996 | |
15997 |
|
15998 |
|
15999 |
|
16000 |
|
16001 |
|
16002 |
|
16003 |
|
16004 |
|
16005 | thumbnailURL: function thumbnailURL(width, height) {
|
16006 | var quality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
|
16007 | var scaleToFit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
16008 | var fmt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'png';
|
16009 | var url = this.attributes.url;
|
16010 |
|
16011 | if (!url) {
|
16012 | throw new Error('Invalid url.');
|
16013 | }
|
16014 |
|
16015 | if (!width || !height || width <= 0 || height <= 0) {
|
16016 | throw new Error('Invalid width or height value.');
|
16017 | }
|
16018 |
|
16019 | if (quality <= 0 || quality > 100) {
|
16020 | throw new Error('Invalid quality value.');
|
16021 | }
|
16022 |
|
16023 | var mode = scaleToFit ? 2 : 1;
|
16024 | return url + '?imageView/' + mode + '/w/' + width + '/h/' + height + '/q/' + quality + '/format/' + fmt;
|
16025 | },
|
16026 |
|
16027 | |
16028 |
|
16029 |
|
16030 |
|
16031 | size: function size() {
|
16032 | return this.metaData().size;
|
16033 | },
|
16034 |
|
16035 | |
16036 |
|
16037 |
|
16038 |
|
16039 | ownerId: function ownerId() {
|
16040 | return this.metaData().owner;
|
16041 | },
|
16042 |
|
16043 | |
16044 |
|
16045 |
|
16046 |
|
16047 |
|
16048 |
|
16049 | destroy: function destroy(options) {
|
16050 | if (!this.id) {
|
16051 | return _promise.default.reject(new Error('The file id does not eixst.'));
|
16052 | }
|
16053 |
|
16054 | var request = AVRequest('files', null, this.id, 'DELETE', null, options);
|
16055 | return request;
|
16056 | },
|
16057 |
|
16058 | |
16059 |
|
16060 |
|
16061 |
|
16062 |
|
16063 |
|
16064 | _fileToken: function _fileToken(type, authOptions) {
|
16065 | var name = this.attributes.name;
|
16066 | var extName = extname(name);
|
16067 |
|
16068 | if (!extName && this._extName) {
|
16069 | name += this._extName;
|
16070 | extName = this._extName;
|
16071 | }
|
16072 |
|
16073 | var data = {
|
16074 | name: name,
|
16075 | keep_file_name: authOptions.keepFileName,
|
16076 | key: authOptions.key,
|
16077 | ACL: this._acl,
|
16078 | mime_type: type,
|
16079 | metaData: this.attributes.metaData
|
16080 | };
|
16081 | return AVRequest('fileTokens', null, null, 'POST', data, authOptions);
|
16082 | },
|
16083 |
|
16084 | |
16085 |
|
16086 |
|
16087 |
|
16088 |
|
16089 | |
16090 |
|
16091 |
|
16092 |
|
16093 |
|
16094 |
|
16095 |
|
16096 |
|
16097 | save: function save() {
|
16098 | var _this3 = this;
|
16099 |
|
16100 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
16101 |
|
16102 | if (this.id) {
|
16103 | throw new Error('File is already saved.');
|
16104 | }
|
16105 |
|
16106 | if (!this._previousSave) {
|
16107 | if (this._data) {
|
16108 | var mimeType = this.get('mime_type');
|
16109 | this._previousSave = this._fileToken(mimeType, options).then(function (uploadInfo) {
|
16110 | if (uploadInfo.mime_type) {
|
16111 | mimeType = uploadInfo.mime_type;
|
16112 |
|
16113 | _this3.set('mime_type', mimeType);
|
16114 | }
|
16115 |
|
16116 | _this3._token = uploadInfo.token;
|
16117 | return _promise.default.resolve().then(function () {
|
16118 | var data = _this3._data;
|
16119 |
|
16120 | if (data && data.base64) {
|
16121 | return parseBase64(data.base64, mimeType);
|
16122 | }
|
16123 |
|
16124 | if (data && data.blob) {
|
16125 | if (!data.blob.type && mimeType) {
|
16126 | data.blob.type = mimeType;
|
16127 | }
|
16128 |
|
16129 | if (!data.blob.name) {
|
16130 | data.blob.name = _this3.get('name');
|
16131 | }
|
16132 |
|
16133 | return data.blob;
|
16134 | }
|
16135 |
|
16136 | if (typeof Blob !== 'undefined' && data instanceof Blob) {
|
16137 | return data;
|
16138 | }
|
16139 |
|
16140 | throw new TypeError('malformed file data');
|
16141 | }).then(function (data) {
|
16142 | var _options = _.extend({}, options);
|
16143 |
|
16144 |
|
16145 | if (options.onprogress) {
|
16146 | _options.onprogress = function (event) {
|
16147 | if (event.direction === 'download') return;
|
16148 | return options.onprogress(event);
|
16149 | };
|
16150 | }
|
16151 |
|
16152 | switch (uploadInfo.provider) {
|
16153 | case 's3':
|
16154 | return s3(uploadInfo, data, _this3, _options);
|
16155 |
|
16156 | case 'qcloud':
|
16157 | return cos(uploadInfo, data, _this3, _options);
|
16158 |
|
16159 | case 'qiniu':
|
16160 | default:
|
16161 | return qiniu(uploadInfo, data, _this3, _options);
|
16162 | }
|
16163 | }).then(tap(function () {
|
16164 | return _this3._callback(true);
|
16165 | }), function (error) {
|
16166 | _this3._callback(false);
|
16167 |
|
16168 | throw error;
|
16169 | });
|
16170 | });
|
16171 | } else if (this.attributes.url && this.attributes.metaData.__source === 'external') {
|
16172 |
|
16173 | var data = {
|
16174 | name: this.attributes.name,
|
16175 | ACL: this._acl,
|
16176 | metaData: this.attributes.metaData,
|
16177 | mime_type: this.mimeType,
|
16178 | url: this.attributes.url
|
16179 | };
|
16180 | this._previousSave = AVRequest('files', null, null, 'post', data, options).then(function (response) {
|
16181 | _this3.id = response.objectId;
|
16182 | return _this3;
|
16183 | });
|
16184 | }
|
16185 | }
|
16186 |
|
16187 | return this._previousSave;
|
16188 | },
|
16189 | _callback: function _callback(success) {
|
16190 | AVRequest('fileCallback', null, null, 'post', {
|
16191 | token: this._token,
|
16192 | result: success
|
16193 | }).catch(debug);
|
16194 | delete this._token;
|
16195 | delete this._data;
|
16196 | },
|
16197 |
|
16198 | |
16199 |
|
16200 |
|
16201 |
|
16202 |
|
16203 |
|
16204 |
|
16205 |
|
16206 |
|
16207 | fetch: function fetch(fetchOptions, options) {
|
16208 | if (!this.id) {
|
16209 | throw new Error('Cannot fetch unsaved file');
|
16210 | }
|
16211 |
|
16212 | var request = AVRequest('files', null, this.id, 'GET', transformFetchOptions(fetchOptions), options);
|
16213 | return request.then(this._finishFetch.bind(this));
|
16214 | },
|
16215 | _finishFetch: function _finishFetch(response) {
|
16216 | var value = AV.Object.prototype.parse(response);
|
16217 | value.attributes = {
|
16218 | name: value.name,
|
16219 | url: value.url,
|
16220 | mime_type: value.mime_type,
|
16221 | bucket: value.bucket
|
16222 | };
|
16223 | value.attributes.metaData = value.metaData || {};
|
16224 | value.id = value.objectId;
|
16225 |
|
16226 | delete value.objectId;
|
16227 | delete value.metaData;
|
16228 | delete value.url;
|
16229 | delete value.name;
|
16230 | delete value.mime_type;
|
16231 | delete value.bucket;
|
16232 |
|
16233 | _.extend(this, value);
|
16234 |
|
16235 | return this;
|
16236 | },
|
16237 |
|
16238 | |
16239 |
|
16240 |
|
16241 |
|
16242 |
|
16243 | censor: function censor() {
|
16244 | if (!this.id) {
|
16245 | throw new Error('Cannot censor an unsaved file');
|
16246 | }
|
16247 |
|
16248 | return AV.File.censor(this.id);
|
16249 | }
|
16250 | });
|
16251 | };
|
16252 |
|
16253 | }),
|
16254 |
|
16255 | (function(module, exports, __webpack_require__) {
|
16256 |
|
16257 | "use strict";
|
16258 |
|
16259 |
|
16260 | var _require = __webpack_require__(76),
|
16261 | getAdapter = _require.getAdapter;
|
16262 |
|
16263 | var debug = __webpack_require__(63)('cos');
|
16264 |
|
16265 | module.exports = function (uploadInfo, data, file) {
|
16266 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
16267 | var url = uploadInfo.upload_url + '?sign=' + encodeURIComponent(uploadInfo.token);
|
16268 | var fileFormData = {
|
16269 | field: 'fileContent',
|
16270 | data: data,
|
16271 | name: file.attributes.name
|
16272 | };
|
16273 | var options = {
|
16274 | headers: file._uploadHeaders,
|
16275 | data: {
|
16276 | op: 'upload'
|
16277 | },
|
16278 | onprogress: saveOptions.onprogress
|
16279 | };
|
16280 | debug('url: %s, file: %o, options: %o', url, fileFormData, options);
|
16281 | var upload = getAdapter('upload');
|
16282 | return upload(url, fileFormData, options).then(function (response) {
|
16283 | debug(response.status, response.data);
|
16284 |
|
16285 | if (response.ok === false) {
|
16286 | var error = new Error(response.status);
|
16287 | error.response = response;
|
16288 | throw error;
|
16289 | }
|
16290 |
|
16291 | file.attributes.url = uploadInfo.url;
|
16292 | file._bucket = uploadInfo.bucket;
|
16293 | file.id = uploadInfo.objectId;
|
16294 | return file;
|
16295 | }, function (error) {
|
16296 | var response = error.response;
|
16297 |
|
16298 | if (response) {
|
16299 | debug(response.status, response.data);
|
16300 | error.statusCode = response.status;
|
16301 | error.response = response.data;
|
16302 | }
|
16303 |
|
16304 | throw error;
|
16305 | });
|
16306 | };
|
16307 |
|
16308 | }),
|
16309 |
|
16310 | (function(module, exports, __webpack_require__) {
|
16311 |
|
16312 | "use strict";
|
16313 |
|
16314 |
|
16315 | var _sliceInstanceProperty2 = __webpack_require__(34);
|
16316 |
|
16317 | var _Array$from = __webpack_require__(153);
|
16318 |
|
16319 | var _Symbol = __webpack_require__(77);
|
16320 |
|
16321 | var _getIteratorMethod = __webpack_require__(253);
|
16322 |
|
16323 | var _Reflect$construct = __webpack_require__(494);
|
16324 |
|
16325 | var _interopRequireDefault = __webpack_require__(1);
|
16326 |
|
16327 | var _inherits2 = _interopRequireDefault(__webpack_require__(498));
|
16328 |
|
16329 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(520));
|
16330 |
|
16331 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(522));
|
16332 |
|
16333 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(527));
|
16334 |
|
16335 | var _createClass2 = _interopRequireDefault(__webpack_require__(528));
|
16336 |
|
16337 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
16338 |
|
16339 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
16340 |
|
16341 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
16342 |
|
16343 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
16344 |
|
16345 | 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); }; }
|
16346 |
|
16347 | 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; } }
|
16348 |
|
16349 | 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; } } }; }
|
16350 |
|
16351 | 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); }
|
16352 |
|
16353 | 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; }
|
16354 |
|
16355 | var _require = __webpack_require__(76),
|
16356 | getAdapter = _require.getAdapter;
|
16357 |
|
16358 | var debug = __webpack_require__(63)('leancloud:qiniu');
|
16359 |
|
16360 | var ajax = __webpack_require__(117);
|
16361 |
|
16362 | var btoa = __webpack_require__(529);
|
16363 |
|
16364 | var SHARD_THRESHOLD = 1024 * 1024 * 64;
|
16365 | var CHUNK_SIZE = 1024 * 1024 * 16;
|
16366 |
|
16367 | function upload(uploadInfo, data, file) {
|
16368 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
16369 |
|
16370 | var uptoken = uploadInfo.token;
|
16371 | var url = uploadInfo.upload_url || 'https://upload.qiniup.com';
|
16372 | var fileFormData = {
|
16373 | field: 'file',
|
16374 | data: data,
|
16375 | name: file.attributes.name
|
16376 | };
|
16377 | var options = {
|
16378 | headers: file._uploadHeaders,
|
16379 | data: {
|
16380 | name: file.attributes.name,
|
16381 | key: uploadInfo.key,
|
16382 | token: uptoken
|
16383 | },
|
16384 | onprogress: saveOptions.onprogress
|
16385 | };
|
16386 | debug('url: %s, file: %o, options: %o', url, fileFormData, options);
|
16387 | var upload = getAdapter('upload');
|
16388 | return upload(url, fileFormData, options).then(function (response) {
|
16389 | debug(response.status, response.data);
|
16390 |
|
16391 | if (response.ok === false) {
|
16392 | var message = response.status;
|
16393 |
|
16394 | if (response.data) {
|
16395 | if (response.data.error) {
|
16396 | message = response.data.error;
|
16397 | } else {
|
16398 | message = (0, _stringify.default)(response.data);
|
16399 | }
|
16400 | }
|
16401 |
|
16402 | var error = new Error(message);
|
16403 | error.response = response;
|
16404 | throw error;
|
16405 | }
|
16406 |
|
16407 | file.attributes.url = uploadInfo.url;
|
16408 | file._bucket = uploadInfo.bucket;
|
16409 | file.id = uploadInfo.objectId;
|
16410 | return file;
|
16411 | }, function (error) {
|
16412 | var response = error.response;
|
16413 |
|
16414 | if (response) {
|
16415 | debug(response.status, response.data);
|
16416 | error.statusCode = response.status;
|
16417 | error.response = response.data;
|
16418 | }
|
16419 |
|
16420 | throw error;
|
16421 | });
|
16422 | }
|
16423 |
|
16424 | function urlSafeBase64(string) {
|
16425 | var base64 = btoa(unescape(encodeURIComponent(string)));
|
16426 | var result = '';
|
16427 |
|
16428 | var _iterator = _createForOfIteratorHelper(base64),
|
16429 | _step;
|
16430 |
|
16431 | try {
|
16432 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
16433 | var ch = _step.value;
|
16434 |
|
16435 | switch (ch) {
|
16436 | case '+':
|
16437 | result += '-';
|
16438 | break;
|
16439 |
|
16440 | case '/':
|
16441 | result += '_';
|
16442 | break;
|
16443 |
|
16444 | default:
|
16445 | result += ch;
|
16446 | }
|
16447 | }
|
16448 | } catch (err) {
|
16449 | _iterator.e(err);
|
16450 | } finally {
|
16451 | _iterator.f();
|
16452 | }
|
16453 |
|
16454 | return result;
|
16455 | }
|
16456 |
|
16457 | var ShardUploader = function () {
|
16458 | function ShardUploader(uploadInfo, data, file, saveOptions) {
|
16459 | var _context,
|
16460 | _context2,
|
16461 | _this = this;
|
16462 |
|
16463 | (0, _classCallCheck2.default)(this, ShardUploader);
|
16464 | this.uploadInfo = uploadInfo;
|
16465 | this.data = data;
|
16466 | this.file = file;
|
16467 | this.size = undefined;
|
16468 | this.offset = 0;
|
16469 | this.uploadedChunks = 0;
|
16470 | var key = urlSafeBase64(uploadInfo.key);
|
16471 | var uploadURL = uploadInfo.upload_url || 'https://upload.qiniup.com';
|
16472 | this.baseURL = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(uploadURL, "/buckets/")).call(_context2, uploadInfo.bucket, "/objects/")).call(_context, key, "/uploads");
|
16473 | this.upToken = 'UpToken ' + uploadInfo.token;
|
16474 | this.uploaded = 0;
|
16475 |
|
16476 | if (saveOptions && saveOptions.onprogress) {
|
16477 | this.onProgress = function (_ref) {
|
16478 | var loaded = _ref.loaded;
|
16479 | loaded += _this.uploadedChunks * CHUNK_SIZE;
|
16480 |
|
16481 | if (loaded <= _this.uploaded) {
|
16482 | return;
|
16483 | }
|
16484 |
|
16485 | if (_this.size) {
|
16486 | saveOptions.onprogress({
|
16487 | loaded: loaded,
|
16488 | total: _this.size,
|
16489 | percent: loaded / _this.size * 100
|
16490 | });
|
16491 | } else {
|
16492 | saveOptions.onprogress({
|
16493 | loaded: loaded
|
16494 | });
|
16495 | }
|
16496 |
|
16497 | _this.uploaded = loaded;
|
16498 | };
|
16499 | }
|
16500 | }
|
16501 | |
16502 |
|
16503 |
|
16504 |
|
16505 |
|
16506 | (0, _createClass2.default)(ShardUploader, [{
|
16507 | key: "getUploadId",
|
16508 | value: function getUploadId() {
|
16509 | return ajax({
|
16510 | method: 'POST',
|
16511 | url: this.baseURL,
|
16512 | headers: {
|
16513 | Authorization: this.upToken
|
16514 | }
|
16515 | }).then(function (res) {
|
16516 | return res.uploadId;
|
16517 | });
|
16518 | }
|
16519 | }, {
|
16520 | key: "getChunk",
|
16521 | value: function getChunk() {
|
16522 | throw new Error('Not implemented');
|
16523 | }
|
16524 | |
16525 |
|
16526 |
|
16527 |
|
16528 |
|
16529 |
|
16530 |
|
16531 | }, {
|
16532 | key: "uploadPart",
|
16533 | value: function uploadPart(uploadId, partNumber, data) {
|
16534 | var _context3, _context4;
|
16535 |
|
16536 | return ajax({
|
16537 | method: 'PUT',
|
16538 | url: (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.baseURL, "/")).call(_context4, uploadId, "/")).call(_context3, partNumber),
|
16539 | headers: {
|
16540 | Authorization: this.upToken
|
16541 | },
|
16542 | data: data,
|
16543 | onprogress: this.onProgress
|
16544 | }).then(function (_ref2) {
|
16545 | var etag = _ref2.etag;
|
16546 | return {
|
16547 | partNumber: partNumber,
|
16548 | etag: etag
|
16549 | };
|
16550 | });
|
16551 | }
|
16552 | }, {
|
16553 | key: "stopUpload",
|
16554 | value: function stopUpload(uploadId) {
|
16555 | var _context5;
|
16556 |
|
16557 | return ajax({
|
16558 | method: 'DELETE',
|
16559 | url: (0, _concat.default)(_context5 = "".concat(this.baseURL, "/")).call(_context5, uploadId),
|
16560 | headers: {
|
16561 | Authorization: this.upToken
|
16562 | }
|
16563 | });
|
16564 | }
|
16565 | }, {
|
16566 | key: "upload",
|
16567 | value: function upload() {
|
16568 | var _this2 = this;
|
16569 |
|
16570 | var parts = [];
|
16571 | return this.getUploadId().then(function (uploadId) {
|
16572 | var uploadPart = function uploadPart() {
|
16573 | return _promise.default.resolve(_this2.getChunk()).then(function (chunk) {
|
16574 | if (!chunk) {
|
16575 | return;
|
16576 | }
|
16577 |
|
16578 | var partNumber = parts.length + 1;
|
16579 | return _this2.uploadPart(uploadId, partNumber, chunk).then(function (part) {
|
16580 | parts.push(part);
|
16581 | _this2.uploadedChunks++;
|
16582 | return uploadPart();
|
16583 | });
|
16584 | }).catch(function (error) {
|
16585 | return _this2.stopUpload(uploadId).then(function () {
|
16586 | return _promise.default.reject(error);
|
16587 | });
|
16588 | });
|
16589 | };
|
16590 |
|
16591 | return uploadPart().then(function () {
|
16592 | var _context6;
|
16593 |
|
16594 | return ajax({
|
16595 | method: 'POST',
|
16596 | url: (0, _concat.default)(_context6 = "".concat(_this2.baseURL, "/")).call(_context6, uploadId),
|
16597 | headers: {
|
16598 | Authorization: _this2.upToken
|
16599 | },
|
16600 | data: {
|
16601 | parts: parts,
|
16602 | fname: _this2.file.attributes.name,
|
16603 | mimeType: _this2.file.attributes.mime_type
|
16604 | }
|
16605 | });
|
16606 | });
|
16607 | }).then(function () {
|
16608 | _this2.file.attributes.url = _this2.uploadInfo.url;
|
16609 | _this2.file._bucket = _this2.uploadInfo.bucket;
|
16610 | _this2.file.id = _this2.uploadInfo.objectId;
|
16611 | return _this2.file;
|
16612 | });
|
16613 | }
|
16614 | }]);
|
16615 | return ShardUploader;
|
16616 | }();
|
16617 |
|
16618 | var BlobUploader = function (_ShardUploader) {
|
16619 | (0, _inherits2.default)(BlobUploader, _ShardUploader);
|
16620 |
|
16621 | var _super = _createSuper(BlobUploader);
|
16622 |
|
16623 | function BlobUploader(uploadInfo, data, file, saveOptions) {
|
16624 | var _this3;
|
16625 |
|
16626 | (0, _classCallCheck2.default)(this, BlobUploader);
|
16627 | _this3 = _super.call(this, uploadInfo, data, file, saveOptions);
|
16628 | _this3.size = data.size;
|
16629 | return _this3;
|
16630 | }
|
16631 | |
16632 |
|
16633 |
|
16634 |
|
16635 |
|
16636 | (0, _createClass2.default)(BlobUploader, [{
|
16637 | key: "getChunk",
|
16638 | value: function getChunk() {
|
16639 | var _context7;
|
16640 |
|
16641 | if (this.offset >= this.size) {
|
16642 | return null;
|
16643 | }
|
16644 |
|
16645 | var chunk = (0, _slice.default)(_context7 = this.data).call(_context7, this.offset, this.offset + CHUNK_SIZE);
|
16646 | this.offset += chunk.size;
|
16647 | return chunk;
|
16648 | }
|
16649 | }]);
|
16650 | return BlobUploader;
|
16651 | }(ShardUploader);
|
16652 |
|
16653 | function isBlob(data) {
|
16654 | return typeof Blob !== 'undefined' && data instanceof Blob;
|
16655 | }
|
16656 |
|
16657 | module.exports = function (uploadInfo, data, file) {
|
16658 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
16659 |
|
16660 | if (isBlob(data) && data.size >= SHARD_THRESHOLD) {
|
16661 | return new BlobUploader(uploadInfo, data, file, saveOptions).upload();
|
16662 | }
|
16663 |
|
16664 | return upload(uploadInfo, data, file, saveOptions);
|
16665 | };
|
16666 |
|
16667 | }),
|
16668 |
|
16669 | (function(module, exports, __webpack_require__) {
|
16670 |
|
16671 | __webpack_require__(70);
|
16672 | __webpack_require__(486);
|
16673 | var path = __webpack_require__(7);
|
16674 |
|
16675 | module.exports = path.Array.from;
|
16676 |
|
16677 |
|
16678 | }),
|
16679 |
|
16680 | (function(module, exports, __webpack_require__) {
|
16681 |
|
16682 | var $ = __webpack_require__(0);
|
16683 | var from = __webpack_require__(487);
|
16684 | var checkCorrectnessOfIteration = __webpack_require__(178);
|
16685 |
|
16686 | var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
|
16687 |
|
16688 | Array.from(iterable);
|
16689 | });
|
16690 |
|
16691 |
|
16692 |
|
16693 | $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
|
16694 | from: from
|
16695 | });
|
16696 |
|
16697 |
|
16698 | }),
|
16699 |
|
16700 | (function(module, exports, __webpack_require__) {
|
16701 |
|
16702 | "use strict";
|
16703 |
|
16704 | var bind = __webpack_require__(52);
|
16705 | var call = __webpack_require__(15);
|
16706 | var toObject = __webpack_require__(33);
|
16707 | var callWithSafeIterationClosing = __webpack_require__(488);
|
16708 | var isArrayIteratorMethod = __webpack_require__(166);
|
16709 | var isConstructor = __webpack_require__(111);
|
16710 | var lengthOfArrayLike = __webpack_require__(40);
|
16711 | var createProperty = __webpack_require__(93);
|
16712 | var getIterator = __webpack_require__(167);
|
16713 | var getIteratorMethod = __webpack_require__(108);
|
16714 |
|
16715 | var $Array = Array;
|
16716 |
|
16717 |
|
16718 |
|
16719 | module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
|
16720 | var O = toObject(arrayLike);
|
16721 | var IS_CONSTRUCTOR = isConstructor(this);
|
16722 | var argumentsLength = arguments.length;
|
16723 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
16724 | var mapping = mapfn !== undefined;
|
16725 | if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
|
16726 | var iteratorMethod = getIteratorMethod(O);
|
16727 | var index = 0;
|
16728 | var length, result, step, iterator, next, value;
|
16729 |
|
16730 | if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
|
16731 | iterator = getIterator(O, iteratorMethod);
|
16732 | next = iterator.next;
|
16733 | result = IS_CONSTRUCTOR ? new this() : [];
|
16734 | for (;!(step = call(next, iterator)).done; index++) {
|
16735 | value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
|
16736 | createProperty(result, index, value);
|
16737 | }
|
16738 | } else {
|
16739 | length = lengthOfArrayLike(O);
|
16740 | result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
|
16741 | for (;length > index; index++) {
|
16742 | value = mapping ? mapfn(O[index], index) : O[index];
|
16743 | createProperty(result, index, value);
|
16744 | }
|
16745 | }
|
16746 | result.length = index;
|
16747 | return result;
|
16748 | };
|
16749 |
|
16750 |
|
16751 | }),
|
16752 |
|
16753 | (function(module, exports, __webpack_require__) {
|
16754 |
|
16755 | var anObject = __webpack_require__(21);
|
16756 | var iteratorClose = __webpack_require__(168);
|
16757 |
|
16758 |
|
16759 | module.exports = function (iterator, fn, value, ENTRIES) {
|
16760 | try {
|
16761 | return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
16762 | } catch (error) {
|
16763 | iteratorClose(iterator, 'throw', error);
|
16764 | }
|
16765 | };
|
16766 |
|
16767 |
|
16768 | }),
|
16769 |
|
16770 | (function(module, exports, __webpack_require__) {
|
16771 |
|
16772 | module.exports = __webpack_require__(490);
|
16773 |
|
16774 |
|
16775 | }),
|
16776 |
|
16777 | (function(module, exports, __webpack_require__) {
|
16778 |
|
16779 | var parent = __webpack_require__(491);
|
16780 |
|
16781 | module.exports = parent;
|
16782 |
|
16783 |
|
16784 | }),
|
16785 |
|
16786 | (function(module, exports, __webpack_require__) {
|
16787 |
|
16788 | var parent = __webpack_require__(492);
|
16789 |
|
16790 | module.exports = parent;
|
16791 |
|
16792 |
|
16793 | }),
|
16794 |
|
16795 | (function(module, exports, __webpack_require__) {
|
16796 |
|
16797 | var parent = __webpack_require__(493);
|
16798 | __webpack_require__(46);
|
16799 |
|
16800 | module.exports = parent;
|
16801 |
|
16802 |
|
16803 | }),
|
16804 |
|
16805 | (function(module, exports, __webpack_require__) {
|
16806 |
|
16807 | __webpack_require__(43);
|
16808 | __webpack_require__(70);
|
16809 | var getIteratorMethod = __webpack_require__(108);
|
16810 |
|
16811 | module.exports = getIteratorMethod;
|
16812 |
|
16813 |
|
16814 | }),
|
16815 |
|
16816 | (function(module, exports, __webpack_require__) {
|
16817 |
|
16818 | module.exports = __webpack_require__(495);
|
16819 |
|
16820 | }),
|
16821 |
|
16822 | (function(module, exports, __webpack_require__) {
|
16823 |
|
16824 | var parent = __webpack_require__(496);
|
16825 |
|
16826 | module.exports = parent;
|
16827 |
|
16828 |
|
16829 | }),
|
16830 |
|
16831 | (function(module, exports, __webpack_require__) {
|
16832 |
|
16833 | __webpack_require__(497);
|
16834 | var path = __webpack_require__(7);
|
16835 |
|
16836 | module.exports = path.Reflect.construct;
|
16837 |
|
16838 |
|
16839 | }),
|
16840 |
|
16841 | (function(module, exports, __webpack_require__) {
|
16842 |
|
16843 | var $ = __webpack_require__(0);
|
16844 | var getBuiltIn = __webpack_require__(20);
|
16845 | var apply = __webpack_require__(79);
|
16846 | var bind = __webpack_require__(254);
|
16847 | var aConstructor = __webpack_require__(174);
|
16848 | var anObject = __webpack_require__(21);
|
16849 | var isObject = __webpack_require__(11);
|
16850 | var create = __webpack_require__(53);
|
16851 | var fails = __webpack_require__(2);
|
16852 |
|
16853 | var nativeConstruct = getBuiltIn('Reflect', 'construct');
|
16854 | var ObjectPrototype = Object.prototype;
|
16855 | var push = [].push;
|
16856 |
|
16857 |
|
16858 |
|
16859 |
|
16860 |
|
16861 | var NEW_TARGET_BUG = fails(function () {
|
16862 | function F() { }
|
16863 | return !(nativeConstruct(function () { }, [], F) instanceof F);
|
16864 | });
|
16865 |
|
16866 | var ARGS_BUG = !fails(function () {
|
16867 | nativeConstruct(function () { });
|
16868 | });
|
16869 |
|
16870 | var FORCED = NEW_TARGET_BUG || ARGS_BUG;
|
16871 |
|
16872 | $({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
|
16873 | construct: function construct(Target, args /* , newTarget */) {
|
16874 | aConstructor(Target);
|
16875 | anObject(args);
|
16876 | var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
|
16877 | if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
|
16878 | if (Target == newTarget) {
|
16879 |
|
16880 | switch (args.length) {
|
16881 | case 0: return new Target();
|
16882 | case 1: return new Target(args[0]);
|
16883 | case 2: return new Target(args[0], args[1]);
|
16884 | case 3: return new Target(args[0], args[1], args[2]);
|
16885 | case 4: return new Target(args[0], args[1], args[2], args[3]);
|
16886 | }
|
16887 |
|
16888 | var $args = [null];
|
16889 | apply(push, $args, args);
|
16890 | return new (apply(bind, Target, $args))();
|
16891 | }
|
16892 |
|
16893 | var proto = newTarget.prototype;
|
16894 | var instance = create(isObject(proto) ? proto : ObjectPrototype);
|
16895 | var result = apply(Target, instance, args);
|
16896 | return isObject(result) ? result : instance;
|
16897 | }
|
16898 | });
|
16899 |
|
16900 |
|
16901 | }),
|
16902 |
|
16903 | (function(module, exports, __webpack_require__) {
|
16904 |
|
16905 | var _Object$create = __webpack_require__(499);
|
16906 |
|
16907 | var _Object$defineProperty = __webpack_require__(154);
|
16908 |
|
16909 | var setPrototypeOf = __webpack_require__(509);
|
16910 |
|
16911 | function _inherits(subClass, superClass) {
|
16912 | if (typeof superClass !== "function" && superClass !== null) {
|
16913 | throw new TypeError("Super expression must either be null or a function");
|
16914 | }
|
16915 |
|
16916 | subClass.prototype = _Object$create(superClass && superClass.prototype, {
|
16917 | constructor: {
|
16918 | value: subClass,
|
16919 | writable: true,
|
16920 | configurable: true
|
16921 | }
|
16922 | });
|
16923 |
|
16924 | _Object$defineProperty(subClass, "prototype", {
|
16925 | writable: false
|
16926 | });
|
16927 |
|
16928 | if (superClass) setPrototypeOf(subClass, superClass);
|
16929 | }
|
16930 |
|
16931 | module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
16932 |
|
16933 | }),
|
16934 |
|
16935 | (function(module, exports, __webpack_require__) {
|
16936 |
|
16937 | module.exports = __webpack_require__(500);
|
16938 |
|
16939 | }),
|
16940 |
|
16941 | (function(module, exports, __webpack_require__) {
|
16942 |
|
16943 | module.exports = __webpack_require__(501);
|
16944 |
|
16945 |
|
16946 | }),
|
16947 |
|
16948 | (function(module, exports, __webpack_require__) {
|
16949 |
|
16950 | var parent = __webpack_require__(502);
|
16951 |
|
16952 | module.exports = parent;
|
16953 |
|
16954 |
|
16955 | }),
|
16956 |
|
16957 | (function(module, exports, __webpack_require__) {
|
16958 |
|
16959 | var parent = __webpack_require__(503);
|
16960 |
|
16961 | module.exports = parent;
|
16962 |
|
16963 |
|
16964 | }),
|
16965 |
|
16966 | (function(module, exports, __webpack_require__) {
|
16967 |
|
16968 | var parent = __webpack_require__(504);
|
16969 |
|
16970 | module.exports = parent;
|
16971 |
|
16972 |
|
16973 | }),
|
16974 |
|
16975 | (function(module, exports, __webpack_require__) {
|
16976 |
|
16977 | __webpack_require__(505);
|
16978 | var path = __webpack_require__(7);
|
16979 |
|
16980 | var Object = path.Object;
|
16981 |
|
16982 | module.exports = function create(P, D) {
|
16983 | return Object.create(P, D);
|
16984 | };
|
16985 |
|
16986 |
|
16987 | }),
|
16988 |
|
16989 | (function(module, exports, __webpack_require__) {
|
16990 |
|
16991 |
|
16992 | var $ = __webpack_require__(0);
|
16993 | var DESCRIPTORS = __webpack_require__(14);
|
16994 | var create = __webpack_require__(53);
|
16995 |
|
16996 |
|
16997 |
|
16998 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
16999 | create: create
|
17000 | });
|
17001 |
|
17002 |
|
17003 | }),
|
17004 |
|
17005 | (function(module, exports, __webpack_require__) {
|
17006 |
|
17007 | module.exports = __webpack_require__(507);
|
17008 |
|
17009 |
|
17010 | }),
|
17011 |
|
17012 | (function(module, exports, __webpack_require__) {
|
17013 |
|
17014 | var parent = __webpack_require__(508);
|
17015 |
|
17016 | module.exports = parent;
|
17017 |
|
17018 |
|
17019 | }),
|
17020 |
|
17021 | (function(module, exports, __webpack_require__) {
|
17022 |
|
17023 | var parent = __webpack_require__(240);
|
17024 |
|
17025 | module.exports = parent;
|
17026 |
|
17027 |
|
17028 | }),
|
17029 |
|
17030 | (function(module, exports, __webpack_require__) {
|
17031 |
|
17032 | var _Object$setPrototypeOf = __webpack_require__(255);
|
17033 |
|
17034 | var _bindInstanceProperty = __webpack_require__(256);
|
17035 |
|
17036 | function _setPrototypeOf(o, p) {
|
17037 | var _context;
|
17038 |
|
17039 | module.exports = _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
|
17040 | o.__proto__ = p;
|
17041 | return o;
|
17042 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17043 | return _setPrototypeOf(o, p);
|
17044 | }
|
17045 |
|
17046 | module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17047 |
|
17048 | }),
|
17049 |
|
17050 | (function(module, exports, __webpack_require__) {
|
17051 |
|
17052 | module.exports = __webpack_require__(511);
|
17053 |
|
17054 |
|
17055 | }),
|
17056 |
|
17057 | (function(module, exports, __webpack_require__) {
|
17058 |
|
17059 | var parent = __webpack_require__(512);
|
17060 |
|
17061 | module.exports = parent;
|
17062 |
|
17063 |
|
17064 | }),
|
17065 |
|
17066 | (function(module, exports, __webpack_require__) {
|
17067 |
|
17068 | var parent = __webpack_require__(238);
|
17069 |
|
17070 | module.exports = parent;
|
17071 |
|
17072 |
|
17073 | }),
|
17074 |
|
17075 | (function(module, exports, __webpack_require__) {
|
17076 |
|
17077 | module.exports = __webpack_require__(514);
|
17078 |
|
17079 |
|
17080 | }),
|
17081 |
|
17082 | (function(module, exports, __webpack_require__) {
|
17083 |
|
17084 | var parent = __webpack_require__(515);
|
17085 |
|
17086 | module.exports = parent;
|
17087 |
|
17088 |
|
17089 | }),
|
17090 |
|
17091 | (function(module, exports, __webpack_require__) {
|
17092 |
|
17093 | var parent = __webpack_require__(516);
|
17094 |
|
17095 | module.exports = parent;
|
17096 |
|
17097 |
|
17098 | }),
|
17099 |
|
17100 | (function(module, exports, __webpack_require__) {
|
17101 |
|
17102 | var parent = __webpack_require__(517);
|
17103 |
|
17104 | module.exports = parent;
|
17105 |
|
17106 |
|
17107 | }),
|
17108 |
|
17109 | (function(module, exports, __webpack_require__) {
|
17110 |
|
17111 | var isPrototypeOf = __webpack_require__(16);
|
17112 | var method = __webpack_require__(518);
|
17113 |
|
17114 | var FunctionPrototype = Function.prototype;
|
17115 |
|
17116 | module.exports = function (it) {
|
17117 | var own = it.bind;
|
17118 | return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;
|
17119 | };
|
17120 |
|
17121 |
|
17122 | }),
|
17123 |
|
17124 | (function(module, exports, __webpack_require__) {
|
17125 |
|
17126 | __webpack_require__(519);
|
17127 | var entryVirtual = __webpack_require__(27);
|
17128 |
|
17129 | module.exports = entryVirtual('Function').bind;
|
17130 |
|
17131 |
|
17132 | }),
|
17133 |
|
17134 | (function(module, exports, __webpack_require__) {
|
17135 |
|
17136 |
|
17137 | var $ = __webpack_require__(0);
|
17138 | var bind = __webpack_require__(254);
|
17139 |
|
17140 |
|
17141 |
|
17142 | $({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
|
17143 | bind: bind
|
17144 | });
|
17145 |
|
17146 |
|
17147 | }),
|
17148 |
|
17149 | (function(module, exports, __webpack_require__) {
|
17150 |
|
17151 | var _typeof = __webpack_require__(95)["default"];
|
17152 |
|
17153 | var assertThisInitialized = __webpack_require__(521);
|
17154 |
|
17155 | function _possibleConstructorReturn(self, call) {
|
17156 | if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
17157 | return call;
|
17158 | } else if (call !== void 0) {
|
17159 | throw new TypeError("Derived constructors may only return object or undefined");
|
17160 | }
|
17161 |
|
17162 | return assertThisInitialized(self);
|
17163 | }
|
17164 |
|
17165 | module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17166 |
|
17167 | }),
|
17168 |
|
17169 | (function(module, exports) {
|
17170 |
|
17171 | function _assertThisInitialized(self) {
|
17172 | if (self === void 0) {
|
17173 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
17174 | }
|
17175 |
|
17176 | return self;
|
17177 | }
|
17178 |
|
17179 | module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17180 |
|
17181 | }),
|
17182 |
|
17183 | (function(module, exports, __webpack_require__) {
|
17184 |
|
17185 | var _Object$setPrototypeOf = __webpack_require__(255);
|
17186 |
|
17187 | var _bindInstanceProperty = __webpack_require__(256);
|
17188 |
|
17189 | var _Object$getPrototypeOf = __webpack_require__(523);
|
17190 |
|
17191 | function _getPrototypeOf(o) {
|
17192 | var _context;
|
17193 |
|
17194 | module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
|
17195 | return o.__proto__ || _Object$getPrototypeOf(o);
|
17196 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17197 | return _getPrototypeOf(o);
|
17198 | }
|
17199 |
|
17200 | module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17201 |
|
17202 | }),
|
17203 |
|
17204 | (function(module, exports, __webpack_require__) {
|
17205 |
|
17206 | module.exports = __webpack_require__(524);
|
17207 |
|
17208 | }),
|
17209 |
|
17210 | (function(module, exports, __webpack_require__) {
|
17211 |
|
17212 | module.exports = __webpack_require__(525);
|
17213 |
|
17214 |
|
17215 | }),
|
17216 |
|
17217 | (function(module, exports, __webpack_require__) {
|
17218 |
|
17219 | var parent = __webpack_require__(526);
|
17220 |
|
17221 | module.exports = parent;
|
17222 |
|
17223 |
|
17224 | }),
|
17225 |
|
17226 | (function(module, exports, __webpack_require__) {
|
17227 |
|
17228 | var parent = __webpack_require__(233);
|
17229 |
|
17230 | module.exports = parent;
|
17231 |
|
17232 |
|
17233 | }),
|
17234 |
|
17235 | (function(module, exports) {
|
17236 |
|
17237 | function _classCallCheck(instance, Constructor) {
|
17238 | if (!(instance instanceof Constructor)) {
|
17239 | throw new TypeError("Cannot call a class as a function");
|
17240 | }
|
17241 | }
|
17242 |
|
17243 | module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17244 |
|
17245 | }),
|
17246 |
|
17247 | (function(module, exports, __webpack_require__) {
|
17248 |
|
17249 | var _Object$defineProperty = __webpack_require__(154);
|
17250 |
|
17251 | function _defineProperties(target, props) {
|
17252 | for (var i = 0; i < props.length; i++) {
|
17253 | var descriptor = props[i];
|
17254 | descriptor.enumerable = descriptor.enumerable || false;
|
17255 | descriptor.configurable = true;
|
17256 | if ("value" in descriptor) descriptor.writable = true;
|
17257 |
|
17258 | _Object$defineProperty(target, descriptor.key, descriptor);
|
17259 | }
|
17260 | }
|
17261 |
|
17262 | function _createClass(Constructor, protoProps, staticProps) {
|
17263 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
17264 | if (staticProps) _defineProperties(Constructor, staticProps);
|
17265 |
|
17266 | _Object$defineProperty(Constructor, "prototype", {
|
17267 | writable: false
|
17268 | });
|
17269 |
|
17270 | return Constructor;
|
17271 | }
|
17272 |
|
17273 | module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17274 |
|
17275 | }),
|
17276 |
|
17277 | (function(module, exports, __webpack_require__) {
|
17278 |
|
17279 | "use strict";
|
17280 |
|
17281 |
|
17282 | var _interopRequireDefault = __webpack_require__(1);
|
17283 |
|
17284 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
17285 |
|
17286 |
|
17287 | var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
17288 |
|
17289 | module.exports = function (string) {
|
17290 | var result = '';
|
17291 |
|
17292 | for (var i = 0; i < string.length;) {
|
17293 | var a = string.charCodeAt(i++);
|
17294 | var b = string.charCodeAt(i++);
|
17295 | var c = string.charCodeAt(i++);
|
17296 |
|
17297 | if (a > 255 || b > 255 || c > 255) {
|
17298 | throw new TypeError('Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.');
|
17299 | }
|
17300 |
|
17301 | var bitmap = a << 16 | b << 8 | c;
|
17302 | result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
|
17303 | }
|
17304 |
|
17305 |
|
17306 | var rest = string.length % 3;
|
17307 |
|
17308 | return rest ? (0, _slice.default)(result).call(result, 0, rest - 3) + '==='.substring(rest) : result;
|
17309 | };
|
17310 |
|
17311 | }),
|
17312 |
|
17313 | (function(module, exports, __webpack_require__) {
|
17314 |
|
17315 | "use strict";
|
17316 |
|
17317 |
|
17318 | var _ = __webpack_require__(3);
|
17319 |
|
17320 | var ajax = __webpack_require__(117);
|
17321 |
|
17322 | module.exports = function upload(uploadInfo, data, file) {
|
17323 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
17324 | return ajax({
|
17325 | url: uploadInfo.upload_url,
|
17326 | method: 'PUT',
|
17327 | data: data,
|
17328 | headers: _.extend({
|
17329 | 'Content-Type': file.get('mime_type'),
|
17330 | 'Cache-Control': 'public, max-age=31536000'
|
17331 | }, file._uploadHeaders),
|
17332 | onprogress: saveOptions.onprogress
|
17333 | }).then(function () {
|
17334 | file.attributes.url = uploadInfo.url;
|
17335 | file._bucket = uploadInfo.bucket;
|
17336 | file.id = uploadInfo.objectId;
|
17337 | return file;
|
17338 | });
|
17339 | };
|
17340 |
|
17341 | }),
|
17342 |
|
17343 | (function(module, exports, __webpack_require__) {
|
17344 |
|
17345 | (function(){
|
17346 | var crypt = __webpack_require__(532),
|
17347 | utf8 = __webpack_require__(257).utf8,
|
17348 | isBuffer = __webpack_require__(533),
|
17349 | bin = __webpack_require__(257).bin,
|
17350 |
|
17351 |
|
17352 | md5 = function (message, options) {
|
17353 |
|
17354 | if (message.constructor == String)
|
17355 | if (options && options.encoding === 'binary')
|
17356 | message = bin.stringToBytes(message);
|
17357 | else
|
17358 | message = utf8.stringToBytes(message);
|
17359 | else if (isBuffer(message))
|
17360 | message = Array.prototype.slice.call(message, 0);
|
17361 | else if (!Array.isArray(message))
|
17362 | message = message.toString();
|
17363 |
|
17364 |
|
17365 | var m = crypt.bytesToWords(message),
|
17366 | l = message.length * 8,
|
17367 | a = 1732584193,
|
17368 | b = -271733879,
|
17369 | c = -1732584194,
|
17370 | d = 271733878;
|
17371 |
|
17372 |
|
17373 | for (var i = 0; i < m.length; i++) {
|
17374 | m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
|
17375 | ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
|
17376 | }
|
17377 |
|
17378 |
|
17379 | m[l >>> 5] |= 0x80 << (l % 32);
|
17380 | m[(((l + 64) >>> 9) << 4) + 14] = l;
|
17381 |
|
17382 |
|
17383 | var FF = md5._ff,
|
17384 | GG = md5._gg,
|
17385 | HH = md5._hh,
|
17386 | II = md5._ii;
|
17387 |
|
17388 | for (var i = 0; i < m.length; i += 16) {
|
17389 |
|
17390 | var aa = a,
|
17391 | bb = b,
|
17392 | cc = c,
|
17393 | dd = d;
|
17394 |
|
17395 | a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
|
17396 | d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
|
17397 | c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
|
17398 | b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
|
17399 | a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
|
17400 | d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
|
17401 | c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
|
17402 | b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
|
17403 | a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
|
17404 | d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
|
17405 | c = FF(c, d, a, b, m[i+10], 17, -42063);
|
17406 | b = FF(b, c, d, a, m[i+11], 22, -1990404162);
|
17407 | a = FF(a, b, c, d, m[i+12], 7, 1804603682);
|
17408 | d = FF(d, a, b, c, m[i+13], 12, -40341101);
|
17409 | c = FF(c, d, a, b, m[i+14], 17, -1502002290);
|
17410 | b = FF(b, c, d, a, m[i+15], 22, 1236535329);
|
17411 |
|
17412 | a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
|
17413 | d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
|
17414 | c = GG(c, d, a, b, m[i+11], 14, 643717713);
|
17415 | b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
|
17416 | a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
|
17417 | d = GG(d, a, b, c, m[i+10], 9, 38016083);
|
17418 | c = GG(c, d, a, b, m[i+15], 14, -660478335);
|
17419 | b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
|
17420 | a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
|
17421 | d = GG(d, a, b, c, m[i+14], 9, -1019803690);
|
17422 | c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
|
17423 | b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
|
17424 | a = GG(a, b, c, d, m[i+13], 5, -1444681467);
|
17425 | d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
|
17426 | c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
|
17427 | b = GG(b, c, d, a, m[i+12], 20, -1926607734);
|
17428 |
|
17429 | a = HH(a, b, c, d, m[i+ 5], 4, -378558);
|
17430 | d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
|
17431 | c = HH(c, d, a, b, m[i+11], 16, 1839030562);
|
17432 | b = HH(b, c, d, a, m[i+14], 23, -35309556);
|
17433 | a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
|
17434 | d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
|
17435 | c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
|
17436 | b = HH(b, c, d, a, m[i+10], 23, -1094730640);
|
17437 | a = HH(a, b, c, d, m[i+13], 4, 681279174);
|
17438 | d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
|
17439 | c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
|
17440 | b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
|
17441 | a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
|
17442 | d = HH(d, a, b, c, m[i+12], 11, -421815835);
|
17443 | c = HH(c, d, a, b, m[i+15], 16, 530742520);
|
17444 | b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
|
17445 |
|
17446 | a = II(a, b, c, d, m[i+ 0], 6, -198630844);
|
17447 | d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
|
17448 | c = II(c, d, a, b, m[i+14], 15, -1416354905);
|
17449 | b = II(b, c, d, a, m[i+ 5], 21, -57434055);
|
17450 | a = II(a, b, c, d, m[i+12], 6, 1700485571);
|
17451 | d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
|
17452 | c = II(c, d, a, b, m[i+10], 15, -1051523);
|
17453 | b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
|
17454 | a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
|
17455 | d = II(d, a, b, c, m[i+15], 10, -30611744);
|
17456 | c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
|
17457 | b = II(b, c, d, a, m[i+13], 21, 1309151649);
|
17458 | a = II(a, b, c, d, m[i+ 4], 6, -145523070);
|
17459 | d = II(d, a, b, c, m[i+11], 10, -1120210379);
|
17460 | c = II(c, d, a, b, m[i+ 2], 15, 718787259);
|
17461 | b = II(b, c, d, a, m[i+ 9], 21, -343485551);
|
17462 |
|
17463 | a = (a + aa) >>> 0;
|
17464 | b = (b + bb) >>> 0;
|
17465 | c = (c + cc) >>> 0;
|
17466 | d = (d + dd) >>> 0;
|
17467 | }
|
17468 |
|
17469 | return crypt.endian([a, b, c, d]);
|
17470 | };
|
17471 |
|
17472 |
|
17473 | md5._ff = function (a, b, c, d, x, s, t) {
|
17474 | var n = a + (b & c | ~b & d) + (x >>> 0) + t;
|
17475 | return ((n << s) | (n >>> (32 - s))) + b;
|
17476 | };
|
17477 | md5._gg = function (a, b, c, d, x, s, t) {
|
17478 | var n = a + (b & d | c & ~d) + (x >>> 0) + t;
|
17479 | return ((n << s) | (n >>> (32 - s))) + b;
|
17480 | };
|
17481 | md5._hh = function (a, b, c, d, x, s, t) {
|
17482 | var n = a + (b ^ c ^ d) + (x >>> 0) + t;
|
17483 | return ((n << s) | (n >>> (32 - s))) + b;
|
17484 | };
|
17485 | md5._ii = function (a, b, c, d, x, s, t) {
|
17486 | var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
|
17487 | return ((n << s) | (n >>> (32 - s))) + b;
|
17488 | };
|
17489 |
|
17490 |
|
17491 | md5._blocksize = 16;
|
17492 | md5._digestsize = 16;
|
17493 |
|
17494 | module.exports = function (message, options) {
|
17495 | if (message === undefined || message === null)
|
17496 | throw new Error('Illegal argument ' + message);
|
17497 |
|
17498 | var digestbytes = crypt.wordsToBytes(md5(message, options));
|
17499 | return options && options.asBytes ? digestbytes :
|
17500 | options && options.asString ? bin.bytesToString(digestbytes) :
|
17501 | crypt.bytesToHex(digestbytes);
|
17502 | };
|
17503 |
|
17504 | })();
|
17505 |
|
17506 |
|
17507 | }),
|
17508 |
|
17509 | (function(module, exports) {
|
17510 |
|
17511 | (function() {
|
17512 | var base64map
|
17513 | = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
|
17514 |
|
17515 | crypt = {
|
17516 |
|
17517 | rotl: function(n, b) {
|
17518 | return (n << b) | (n >>> (32 - b));
|
17519 | },
|
17520 |
|
17521 |
|
17522 | rotr: function(n, b) {
|
17523 | return (n << (32 - b)) | (n >>> b);
|
17524 | },
|
17525 |
|
17526 |
|
17527 | endian: function(n) {
|
17528 |
|
17529 | if (n.constructor == Number) {
|
17530 | return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
|
17531 | }
|
17532 |
|
17533 |
|
17534 | for (var i = 0; i < n.length; i++)
|
17535 | n[i] = crypt.endian(n[i]);
|
17536 | return n;
|
17537 | },
|
17538 |
|
17539 |
|
17540 | randomBytes: function(n) {
|
17541 | for (var bytes = []; n > 0; n--)
|
17542 | bytes.push(Math.floor(Math.random() * 256));
|
17543 | return bytes;
|
17544 | },
|
17545 |
|
17546 |
|
17547 | bytesToWords: function(bytes) {
|
17548 | for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
|
17549 | words[b >>> 5] |= bytes[i] << (24 - b % 32);
|
17550 | return words;
|
17551 | },
|
17552 |
|
17553 |
|
17554 | wordsToBytes: function(words) {
|
17555 | for (var bytes = [], b = 0; b < words.length * 32; b += 8)
|
17556 | bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
|
17557 | return bytes;
|
17558 | },
|
17559 |
|
17560 |
|
17561 | bytesToHex: function(bytes) {
|
17562 | for (var hex = [], i = 0; i < bytes.length; i++) {
|
17563 | hex.push((bytes[i] >>> 4).toString(16));
|
17564 | hex.push((bytes[i] & 0xF).toString(16));
|
17565 | }
|
17566 | return hex.join('');
|
17567 | },
|
17568 |
|
17569 |
|
17570 | hexToBytes: function(hex) {
|
17571 | for (var bytes = [], c = 0; c < hex.length; c += 2)
|
17572 | bytes.push(parseInt(hex.substr(c, 2), 16));
|
17573 | return bytes;
|
17574 | },
|
17575 |
|
17576 |
|
17577 | bytesToBase64: function(bytes) {
|
17578 | for (var base64 = [], i = 0; i < bytes.length; i += 3) {
|
17579 | var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
|
17580 | for (var j = 0; j < 4; j++)
|
17581 | if (i * 8 + j * 6 <= bytes.length * 8)
|
17582 | base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
|
17583 | else
|
17584 | base64.push('=');
|
17585 | }
|
17586 | return base64.join('');
|
17587 | },
|
17588 |
|
17589 |
|
17590 | base64ToBytes: function(base64) {
|
17591 |
|
17592 | base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
|
17593 |
|
17594 | for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
|
17595 | imod4 = ++i % 4) {
|
17596 | if (imod4 == 0) continue;
|
17597 | bytes.push(((base64map.indexOf(base64.charAt(i - 1))
|
17598 | & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
|
17599 | | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
|
17600 | }
|
17601 | return bytes;
|
17602 | }
|
17603 | };
|
17604 |
|
17605 | module.exports = crypt;
|
17606 | })();
|
17607 |
|
17608 |
|
17609 | }),
|
17610 |
|
17611 | (function(module, exports) {
|
17612 |
|
17613 |
|
17614 |
|
17615 |
|
17616 |
|
17617 |
|
17618 |
|
17619 |
|
17620 |
|
17621 |
|
17622 | module.exports = function (obj) {
|
17623 | return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
|
17624 | }
|
17625 |
|
17626 | function isBuffer (obj) {
|
17627 | return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
|
17628 | }
|
17629 |
|
17630 |
|
17631 | function isSlowBuffer (obj) {
|
17632 | return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
|
17633 | }
|
17634 |
|
17635 |
|
17636 | }),
|
17637 |
|
17638 | (function(module, exports, __webpack_require__) {
|
17639 |
|
17640 | "use strict";
|
17641 |
|
17642 |
|
17643 | var _interopRequireDefault = __webpack_require__(1);
|
17644 |
|
17645 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
17646 |
|
17647 | var dataURItoBlob = function dataURItoBlob(dataURI, type) {
|
17648 | var _context;
|
17649 |
|
17650 | var byteString;
|
17651 |
|
17652 | if ((0, _indexOf.default)(dataURI).call(dataURI, 'base64') < 0) {
|
17653 | byteString = atob(dataURI);
|
17654 | } else if ((0, _indexOf.default)(_context = dataURI.split(',')[0]).call(_context, 'base64') >= 0) {
|
17655 | type = type || dataURI.split(',')[0].split(':')[1].split(';')[0];
|
17656 | byteString = atob(dataURI.split(',')[1]);
|
17657 | } else {
|
17658 | byteString = unescape(dataURI.split(',')[1]);
|
17659 | }
|
17660 |
|
17661 | var ia = new Uint8Array(byteString.length);
|
17662 |
|
17663 | for (var i = 0; i < byteString.length; i++) {
|
17664 | ia[i] = byteString.charCodeAt(i);
|
17665 | }
|
17666 |
|
17667 | return new Blob([ia], {
|
17668 | type: type
|
17669 | });
|
17670 | };
|
17671 |
|
17672 | module.exports = dataURItoBlob;
|
17673 |
|
17674 | }),
|
17675 |
|
17676 | (function(module, exports, __webpack_require__) {
|
17677 |
|
17678 | "use strict";
|
17679 |
|
17680 |
|
17681 | var _interopRequireDefault = __webpack_require__(1);
|
17682 |
|
17683 | var _slicedToArray2 = _interopRequireDefault(__webpack_require__(536));
|
17684 |
|
17685 | var _map = _interopRequireDefault(__webpack_require__(37));
|
17686 |
|
17687 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
17688 |
|
17689 | var _find = _interopRequireDefault(__webpack_require__(96));
|
17690 |
|
17691 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
17692 |
|
17693 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
17694 |
|
17695 | var _keys2 = _interopRequireDefault(__webpack_require__(62));
|
17696 |
|
17697 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
17698 |
|
17699 | var _defineProperty = _interopRequireDefault(__webpack_require__(94));
|
17700 |
|
17701 | var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(258));
|
17702 |
|
17703 | var _ = __webpack_require__(3);
|
17704 |
|
17705 | var AVError = __webpack_require__(48);
|
17706 |
|
17707 | var _require = __webpack_require__(28),
|
17708 | _request = _require._request;
|
17709 |
|
17710 | var _require2 = __webpack_require__(32),
|
17711 | isNullOrUndefined = _require2.isNullOrUndefined,
|
17712 | ensureArray = _require2.ensureArray,
|
17713 | transformFetchOptions = _require2.transformFetchOptions,
|
17714 | setValue = _require2.setValue,
|
17715 | findValue = _require2.findValue,
|
17716 | isPlainObject = _require2.isPlainObject,
|
17717 | continueWhile = _require2.continueWhile;
|
17718 |
|
17719 | var recursiveToPointer = function recursiveToPointer(value) {
|
17720 | if (_.isArray(value)) return (0, _map.default)(value).call(value, recursiveToPointer);
|
17721 | if (isPlainObject(value)) return _.mapObject(value, recursiveToPointer);
|
17722 | if (_.isObject(value) && value._toPointer) return value._toPointer();
|
17723 | return value;
|
17724 | };
|
17725 |
|
17726 | var RESERVED_KEYS = ['objectId', 'createdAt', 'updatedAt'];
|
17727 |
|
17728 | var checkReservedKey = function checkReservedKey(key) {
|
17729 | if ((0, _indexOf.default)(RESERVED_KEYS).call(RESERVED_KEYS, key) !== -1) {
|
17730 | throw new Error("key[".concat(key, "] is reserved"));
|
17731 | }
|
17732 | };
|
17733 |
|
17734 | var handleBatchResults = function handleBatchResults(results) {
|
17735 | var firstError = (0, _find.default)(_).call(_, results, function (result) {
|
17736 | return result instanceof Error;
|
17737 | });
|
17738 |
|
17739 | if (!firstError) {
|
17740 | return results;
|
17741 | }
|
17742 |
|
17743 | var error = new AVError(firstError.code, firstError.message);
|
17744 | error.results = results;
|
17745 | throw error;
|
17746 | };
|
17747 |
|
17748 |
|
17749 |
|
17750 | function getValue(object, prop) {
|
17751 | if (!(object && object[prop])) {
|
17752 | return null;
|
17753 | }
|
17754 |
|
17755 | return _.isFunction(object[prop]) ? object[prop]() : object[prop];
|
17756 | }
|
17757 |
|
17758 |
|
17759 |
|
17760 | module.exports = function (AV) {
|
17761 | |
17762 |
|
17763 |
|
17764 |
|
17765 |
|
17766 |
|
17767 |
|
17768 |
|
17769 |
|
17770 |
|
17771 |
|
17772 |
|
17773 |
|
17774 |
|
17775 |
|
17776 |
|
17777 |
|
17778 |
|
17779 |
|
17780 |
|
17781 |
|
17782 |
|
17783 |
|
17784 |
|
17785 |
|
17786 |
|
17787 |
|
17788 | AV.Object = function (attributes, options) {
|
17789 |
|
17790 | if (_.isString(attributes)) {
|
17791 | return AV.Object._create.apply(this, arguments);
|
17792 | }
|
17793 |
|
17794 | attributes = attributes || {};
|
17795 |
|
17796 | if (options && options.parse) {
|
17797 | attributes = this.parse(attributes);
|
17798 | attributes = this._mergeMagicFields(attributes);
|
17799 | }
|
17800 |
|
17801 | var defaults = getValue(this, 'defaults');
|
17802 |
|
17803 | if (defaults) {
|
17804 | attributes = _.extend({}, defaults, attributes);
|
17805 | }
|
17806 |
|
17807 | if (options && options.collection) {
|
17808 | this.collection = options.collection;
|
17809 | }
|
17810 |
|
17811 | this._serverData = {};
|
17812 |
|
17813 | this._opSetQueue = [{}];
|
17814 |
|
17815 | this._flags = {};
|
17816 | this.attributes = {};
|
17817 |
|
17818 | this._hashedJSON = {};
|
17819 |
|
17820 | this._escapedAttributes = {};
|
17821 | this.cid = _.uniqueId('c');
|
17822 | this.changed = {};
|
17823 | this._silent = {};
|
17824 | this._pending = {};
|
17825 | this.set(attributes, {
|
17826 | silent: true
|
17827 | });
|
17828 | this.changed = {};
|
17829 | this._silent = {};
|
17830 | this._pending = {};
|
17831 | this._hasData = true;
|
17832 | this._previousAttributes = _.clone(this.attributes);
|
17833 | this.initialize.apply(this, arguments);
|
17834 | };
|
17835 | |
17836 |
|
17837 |
|
17838 |
|
17839 |
|
17840 | |
17841 |
|
17842 |
|
17843 |
|
17844 |
|
17845 |
|
17846 |
|
17847 |
|
17848 |
|
17849 |
|
17850 |
|
17851 |
|
17852 |
|
17853 |
|
17854 |
|
17855 | AV.Object.saveAll = function (list, options) {
|
17856 | return AV.Object._deepSaveAsync(list, null, options);
|
17857 | };
|
17858 | |
17859 |
|
17860 |
|
17861 |
|
17862 |
|
17863 |
|
17864 |
|
17865 |
|
17866 |
|
17867 | AV.Object.fetchAll = function (objects, options) {
|
17868 | return _promise.default.resolve().then(function () {
|
17869 | return _request('batch', null, null, 'POST', {
|
17870 | requests: (0, _map.default)(_).call(_, objects, function (object) {
|
17871 | var _context;
|
17872 |
|
17873 | if (!object.className) throw new Error('object must have className to fetch');
|
17874 | if (!object.id) throw new Error('object must have id to fetch');
|
17875 | if (object.dirty()) throw new Error('object is modified but not saved');
|
17876 | return {
|
17877 | method: 'GET',
|
17878 | path: (0, _concat.default)(_context = "/1.1/classes/".concat(object.className, "/")).call(_context, object.id)
|
17879 | };
|
17880 | })
|
17881 | }, options);
|
17882 | }).then(function (response) {
|
17883 | var results = (0, _map.default)(_).call(_, objects, function (object, i) {
|
17884 | if (response[i].success) {
|
17885 | var fetchedAttrs = object.parse(response[i].success);
|
17886 |
|
17887 | object._cleanupUnsetKeys(fetchedAttrs);
|
17888 |
|
17889 | object._finishFetch(fetchedAttrs);
|
17890 |
|
17891 | return object;
|
17892 | }
|
17893 |
|
17894 | if (response[i].success === null) {
|
17895 | return new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
|
17896 | }
|
17897 |
|
17898 | return new AVError(response[i].error.code, response[i].error.error);
|
17899 | });
|
17900 | return handleBatchResults(results);
|
17901 | });
|
17902 | };
|
17903 |
|
17904 |
|
17905 | _.extend(AV.Object.prototype, AV.Events,
|
17906 |
|
17907 | {
|
17908 | _fetchWhenSave: false,
|
17909 |
|
17910 | |
17911 |
|
17912 |
|
17913 |
|
17914 | initialize: function initialize() {},
|
17915 |
|
17916 | |
17917 |
|
17918 |
|
17919 |
|
17920 |
|
17921 |
|
17922 |
|
17923 |
|
17924 | fetchWhenSave: function fetchWhenSave(enable) {
|
17925 | console.warn('AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead.');
|
17926 |
|
17927 | if (!_.isBoolean(enable)) {
|
17928 | throw new Error('Expect boolean value for fetchWhenSave');
|
17929 | }
|
17930 |
|
17931 | this._fetchWhenSave = enable;
|
17932 | },
|
17933 |
|
17934 | |
17935 |
|
17936 |
|
17937 |
|
17938 | getObjectId: function getObjectId() {
|
17939 | return this.id;
|
17940 | },
|
17941 |
|
17942 | |
17943 |
|
17944 |
|
17945 |
|
17946 | getCreatedAt: function getCreatedAt() {
|
17947 | return this.createdAt;
|
17948 | },
|
17949 |
|
17950 | |
17951 |
|
17952 |
|
17953 |
|
17954 | getUpdatedAt: function getUpdatedAt() {
|
17955 | return this.updatedAt;
|
17956 | },
|
17957 |
|
17958 | |
17959 |
|
17960 |
|
17961 |
|
17962 | toJSON: function toJSON(key, holder) {
|
17963 | var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
17964 | return this._toFullJSON(seenObjects, false);
|
17965 | },
|
17966 |
|
17967 | |
17968 |
|
17969 |
|
17970 |
|
17971 |
|
17972 |
|
17973 | toFullJSON: function toFullJSON() {
|
17974 | var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
17975 | return this._toFullJSON(seenObjects);
|
17976 | },
|
17977 | _toFullJSON: function _toFullJSON(seenObjects) {
|
17978 | var _this = this;
|
17979 |
|
17980 | var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
17981 |
|
17982 | var json = _.clone(this.attributes);
|
17983 |
|
17984 | if (_.isArray(seenObjects)) {
|
17985 | var newSeenObjects = (0, _concat.default)(seenObjects).call(seenObjects, this);
|
17986 | }
|
17987 |
|
17988 | AV._objectEach(json, function (val, key) {
|
17989 | json[key] = AV._encode(val, newSeenObjects, undefined, full);
|
17990 | });
|
17991 |
|
17992 | AV._objectEach(this._operations, function (val, key) {
|
17993 | json[key] = val;
|
17994 | });
|
17995 |
|
17996 | if (_.has(this, 'id')) {
|
17997 | json.objectId = this.id;
|
17998 | }
|
17999 |
|
18000 | ['createdAt', 'updatedAt'].forEach(function (key) {
|
18001 | if (_.has(_this, key)) {
|
18002 | var val = _this[key];
|
18003 | json[key] = _.isDate(val) ? val.toJSON() : val;
|
18004 | }
|
18005 | });
|
18006 |
|
18007 | if (full) {
|
18008 | json.__type = 'Object';
|
18009 | if (_.isArray(seenObjects) && seenObjects.length) json.__type = 'Pointer';
|
18010 | json.className = this.className;
|
18011 | }
|
18012 |
|
18013 | return json;
|
18014 | },
|
18015 |
|
18016 | |
18017 |
|
18018 |
|
18019 |
|
18020 |
|
18021 | _refreshCache: function _refreshCache() {
|
18022 | var self = this;
|
18023 |
|
18024 | if (self._refreshingCache) {
|
18025 | return;
|
18026 | }
|
18027 |
|
18028 | self._refreshingCache = true;
|
18029 |
|
18030 | AV._objectEach(this.attributes, function (value, key) {
|
18031 | if (value instanceof AV.Object) {
|
18032 | value._refreshCache();
|
18033 | } else if (_.isObject(value)) {
|
18034 | if (self._resetCacheForKey(key)) {
|
18035 | self.set(key, new AV.Op.Set(value), {
|
18036 | silent: true
|
18037 | });
|
18038 | }
|
18039 | }
|
18040 | });
|
18041 |
|
18042 | delete self._refreshingCache;
|
18043 | },
|
18044 |
|
18045 | |
18046 |
|
18047 |
|
18048 |
|
18049 |
|
18050 |
|
18051 |
|
18052 | dirty: function dirty(attr) {
|
18053 | this._refreshCache();
|
18054 |
|
18055 | var currentChanges = _.last(this._opSetQueue);
|
18056 |
|
18057 | if (attr) {
|
18058 | return currentChanges[attr] ? true : false;
|
18059 | }
|
18060 |
|
18061 | if (!this.id) {
|
18062 | return true;
|
18063 | }
|
18064 |
|
18065 | if ((0, _keys2.default)(_).call(_, currentChanges).length > 0) {
|
18066 | return true;
|
18067 | }
|
18068 |
|
18069 | return false;
|
18070 | },
|
18071 |
|
18072 | |
18073 |
|
18074 |
|
18075 |
|
18076 | dirtyKeys: function dirtyKeys() {
|
18077 | this._refreshCache();
|
18078 |
|
18079 | var currentChanges = _.last(this._opSetQueue);
|
18080 |
|
18081 | return (0, _keys2.default)(_).call(_, currentChanges);
|
18082 | },
|
18083 |
|
18084 | |
18085 |
|
18086 |
|
18087 |
|
18088 | _toPointer: function _toPointer() {
|
18089 |
|
18090 |
|
18091 |
|
18092 | return {
|
18093 | __type: 'Pointer',
|
18094 | className: this.className,
|
18095 | objectId: this.id
|
18096 | };
|
18097 | },
|
18098 |
|
18099 | |
18100 |
|
18101 |
|
18102 |
|
18103 | get: function get(attr) {
|
18104 | switch (attr) {
|
18105 | case 'objectId':
|
18106 | return this.id;
|
18107 |
|
18108 | case 'createdAt':
|
18109 | case 'updatedAt':
|
18110 | return this[attr];
|
18111 |
|
18112 | default:
|
18113 | return this.attributes[attr];
|
18114 | }
|
18115 | },
|
18116 |
|
18117 | |
18118 |
|
18119 |
|
18120 |
|
18121 |
|
18122 | relation: function relation(attr) {
|
18123 | var value = this.get(attr);
|
18124 |
|
18125 | if (value) {
|
18126 | if (!(value instanceof AV.Relation)) {
|
18127 | throw new Error('Called relation() on non-relation field ' + attr);
|
18128 | }
|
18129 |
|
18130 | value._ensureParentAndKey(this, attr);
|
18131 |
|
18132 | return value;
|
18133 | } else {
|
18134 | return new AV.Relation(this, attr);
|
18135 | }
|
18136 | },
|
18137 |
|
18138 | |
18139 |
|
18140 |
|
18141 | escape: function escape(attr) {
|
18142 | var html = this._escapedAttributes[attr];
|
18143 |
|
18144 | if (html) {
|
18145 | return html;
|
18146 | }
|
18147 |
|
18148 | var val = this.attributes[attr];
|
18149 | var escaped;
|
18150 |
|
18151 | if (isNullOrUndefined(val)) {
|
18152 | escaped = '';
|
18153 | } else {
|
18154 | escaped = _.escape(val.toString());
|
18155 | }
|
18156 |
|
18157 | this._escapedAttributes[attr] = escaped;
|
18158 | return escaped;
|
18159 | },
|
18160 |
|
18161 | |
18162 |
|
18163 |
|
18164 |
|
18165 |
|
18166 |
|
18167 | has: function has(attr) {
|
18168 | return !isNullOrUndefined(this.attributes[attr]);
|
18169 | },
|
18170 |
|
18171 | |
18172 |
|
18173 |
|
18174 |
|
18175 |
|
18176 |
|
18177 | _mergeMagicFields: function _mergeMagicFields(attrs) {
|
18178 |
|
18179 | var model = this;
|
18180 | var specialFields = ['objectId', 'createdAt', 'updatedAt'];
|
18181 |
|
18182 | AV._arrayEach(specialFields, function (attr) {
|
18183 | if (attrs[attr]) {
|
18184 | if (attr === 'objectId') {
|
18185 | model.id = attrs[attr];
|
18186 | } else if ((attr === 'createdAt' || attr === 'updatedAt') && !_.isDate(attrs[attr])) {
|
18187 | model[attr] = AV._parseDate(attrs[attr]);
|
18188 | } else {
|
18189 | model[attr] = attrs[attr];
|
18190 | }
|
18191 |
|
18192 | delete attrs[attr];
|
18193 | }
|
18194 | });
|
18195 |
|
18196 | return attrs;
|
18197 | },
|
18198 |
|
18199 | |
18200 |
|
18201 |
|
18202 |
|
18203 | _startSave: function _startSave() {
|
18204 | this._opSetQueue.push({});
|
18205 | },
|
18206 |
|
18207 | |
18208 |
|
18209 |
|
18210 |
|
18211 |
|
18212 |
|
18213 |
|
18214 |
|
18215 |
|
18216 |
|
18217 |
|
18218 |
|
18219 |
|
18220 | _cancelSave: function _cancelSave() {
|
18221 | var failedChanges = _.first(this._opSetQueue);
|
18222 |
|
18223 | this._opSetQueue = _.rest(this._opSetQueue);
|
18224 |
|
18225 | var nextChanges = _.first(this._opSetQueue);
|
18226 |
|
18227 | AV._objectEach(failedChanges, function (op, key) {
|
18228 | var op1 = failedChanges[key];
|
18229 | var op2 = nextChanges[key];
|
18230 |
|
18231 | if (op1 && op2) {
|
18232 | nextChanges[key] = op2._mergeWithPrevious(op1);
|
18233 | } else if (op1) {
|
18234 | nextChanges[key] = op1;
|
18235 | }
|
18236 | });
|
18237 |
|
18238 | this._saving = this._saving - 1;
|
18239 | },
|
18240 |
|
18241 | |
18242 |
|
18243 |
|
18244 |
|
18245 |
|
18246 |
|
18247 | _finishSave: function _finishSave(serverData) {
|
18248 | var _context2;
|
18249 |
|
18250 |
|
18251 |
|
18252 |
|
18253 |
|
18254 | var fetchedObjects = {};
|
18255 |
|
18256 | AV._traverse(this.attributes, function (object) {
|
18257 | if (object instanceof AV.Object && object.id && object._hasData) {
|
18258 | fetchedObjects[object.id] = object;
|
18259 | }
|
18260 | });
|
18261 |
|
18262 | var savedChanges = _.first(this._opSetQueue);
|
18263 |
|
18264 | this._opSetQueue = _.rest(this._opSetQueue);
|
18265 |
|
18266 | this._applyOpSet(savedChanges, this._serverData);
|
18267 |
|
18268 | this._mergeMagicFields(serverData);
|
18269 |
|
18270 | var self = this;
|
18271 |
|
18272 | AV._objectEach(serverData, function (value, key) {
|
18273 | self._serverData[key] = AV._decode(value, key);
|
18274 |
|
18275 |
|
18276 | var fetched = AV._traverse(self._serverData[key], function (object) {
|
18277 | if (object instanceof AV.Object && fetchedObjects[object.id]) {
|
18278 | return fetchedObjects[object.id];
|
18279 | }
|
18280 | });
|
18281 |
|
18282 | if (fetched) {
|
18283 | self._serverData[key] = fetched;
|
18284 | }
|
18285 | });
|
18286 |
|
18287 | this._rebuildAllEstimatedData();
|
18288 |
|
18289 | var opSetQueue = (0, _map.default)(_context2 = this._opSetQueue).call(_context2, _.clone);
|
18290 |
|
18291 | this._refreshCache();
|
18292 |
|
18293 | this._opSetQueue = opSetQueue;
|
18294 | this._saving = this._saving - 1;
|
18295 | },
|
18296 |
|
18297 | |
18298 |
|
18299 |
|
18300 |
|
18301 |
|
18302 | _finishFetch: function _finishFetch(serverData, hasData) {
|
18303 |
|
18304 | this._opSetQueue = [{}];
|
18305 |
|
18306 | this._mergeMagicFields(serverData);
|
18307 |
|
18308 | var self = this;
|
18309 |
|
18310 | AV._objectEach(serverData, function (value, key) {
|
18311 | self._serverData[key] = AV._decode(value, key);
|
18312 | });
|
18313 |
|
18314 |
|
18315 | this._rebuildAllEstimatedData();
|
18316 |
|
18317 |
|
18318 | this._refreshCache();
|
18319 |
|
18320 | this._opSetQueue = [{}];
|
18321 | this._hasData = hasData;
|
18322 | },
|
18323 |
|
18324 | |
18325 |
|
18326 |
|
18327 |
|
18328 | _applyOpSet: function _applyOpSet(opSet, target) {
|
18329 | var self = this;
|
18330 |
|
18331 | AV._objectEach(opSet, function (change, key) {
|
18332 | var _findValue = findValue(target, key),
|
18333 | _findValue2 = (0, _slicedToArray2.default)(_findValue, 3),
|
18334 | value = _findValue2[0],
|
18335 | actualTarget = _findValue2[1],
|
18336 | actualKey = _findValue2[2];
|
18337 |
|
18338 | setValue(target, key, change._estimate(value, self, key));
|
18339 |
|
18340 | if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
|
18341 | delete actualTarget[actualKey];
|
18342 | }
|
18343 | });
|
18344 | },
|
18345 |
|
18346 | |
18347 |
|
18348 |
|
18349 |
|
18350 |
|
18351 | _resetCacheForKey: function _resetCacheForKey(key) {
|
18352 | var value = this.attributes[key];
|
18353 |
|
18354 | if (_.isObject(value) && !(value instanceof AV.Object) && !(value instanceof AV.File)) {
|
18355 | var json = (0, _stringify.default)(recursiveToPointer(value));
|
18356 |
|
18357 | if (this._hashedJSON[key] !== json) {
|
18358 | var wasSet = !!this._hashedJSON[key];
|
18359 | this._hashedJSON[key] = json;
|
18360 | return wasSet;
|
18361 | }
|
18362 | }
|
18363 |
|
18364 | return false;
|
18365 | },
|
18366 |
|
18367 | |
18368 |
|
18369 |
|
18370 |
|
18371 |
|
18372 |
|
18373 | _rebuildEstimatedDataForKey: function _rebuildEstimatedDataForKey(key) {
|
18374 | var self = this;
|
18375 | delete this.attributes[key];
|
18376 |
|
18377 | if (this._serverData[key]) {
|
18378 | this.attributes[key] = this._serverData[key];
|
18379 | }
|
18380 |
|
18381 | AV._arrayEach(this._opSetQueue, function (opSet) {
|
18382 | var op = opSet[key];
|
18383 |
|
18384 | if (op) {
|
18385 | var _findValue3 = findValue(self.attributes, key),
|
18386 | _findValue4 = (0, _slicedToArray2.default)(_findValue3, 4),
|
18387 | value = _findValue4[0],
|
18388 | actualTarget = _findValue4[1],
|
18389 | actualKey = _findValue4[2],
|
18390 | firstKey = _findValue4[3];
|
18391 |
|
18392 | setValue(self.attributes, key, op._estimate(value, self, key));
|
18393 |
|
18394 | if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
|
18395 | delete actualTarget[actualKey];
|
18396 | }
|
18397 |
|
18398 | self._resetCacheForKey(firstKey);
|
18399 | }
|
18400 | });
|
18401 | },
|
18402 |
|
18403 | |
18404 |
|
18405 |
|
18406 |
|
18407 |
|
18408 |
|
18409 | _rebuildAllEstimatedData: function _rebuildAllEstimatedData() {
|
18410 | var self = this;
|
18411 |
|
18412 | var previousAttributes = _.clone(this.attributes);
|
18413 |
|
18414 | this.attributes = _.clone(this._serverData);
|
18415 |
|
18416 | AV._arrayEach(this._opSetQueue, function (opSet) {
|
18417 | self._applyOpSet(opSet, self.attributes);
|
18418 |
|
18419 | AV._objectEach(opSet, function (op, key) {
|
18420 | self._resetCacheForKey(key);
|
18421 | });
|
18422 | });
|
18423 |
|
18424 |
|
18425 | AV._objectEach(previousAttributes, function (oldValue, key) {
|
18426 | if (self.attributes[key] !== oldValue) {
|
18427 | self.trigger('change:' + key, self, self.attributes[key], {});
|
18428 | }
|
18429 | });
|
18430 |
|
18431 | AV._objectEach(this.attributes, function (newValue, key) {
|
18432 | if (!_.has(previousAttributes, key)) {
|
18433 | self.trigger('change:' + key, self, newValue, {});
|
18434 | }
|
18435 | });
|
18436 | },
|
18437 |
|
18438 | |
18439 |
|
18440 |
|
18441 |
|
18442 |
|
18443 |
|
18444 |
|
18445 |
|
18446 |
|
18447 |
|
18448 |
|
18449 |
|
18450 |
|
18451 |
|
18452 |
|
18453 |
|
18454 |
|
18455 |
|
18456 |
|
18457 |
|
18458 |
|
18459 |
|
18460 |
|
18461 |
|
18462 | set: function set(key, value, options) {
|
18463 | var attrs;
|
18464 |
|
18465 | if (_.isObject(key) || isNullOrUndefined(key)) {
|
18466 | attrs = _.mapObject(key, function (v, k) {
|
18467 | checkReservedKey(k);
|
18468 | return AV._decode(v, k);
|
18469 | });
|
18470 | options = value;
|
18471 | } else {
|
18472 | attrs = {};
|
18473 | checkReservedKey(key);
|
18474 | attrs[key] = AV._decode(value, key);
|
18475 | }
|
18476 |
|
18477 |
|
18478 | options = options || {};
|
18479 |
|
18480 | if (!attrs) {
|
18481 | return this;
|
18482 | }
|
18483 |
|
18484 | if (attrs instanceof AV.Object) {
|
18485 | attrs = attrs.attributes;
|
18486 | }
|
18487 |
|
18488 |
|
18489 | if (options.unset) {
|
18490 | AV._objectEach(attrs, function (unused_value, key) {
|
18491 | attrs[key] = new AV.Op.Unset();
|
18492 | });
|
18493 | }
|
18494 |
|
18495 |
|
18496 | var dataToValidate = _.clone(attrs);
|
18497 |
|
18498 | var self = this;
|
18499 |
|
18500 | AV._objectEach(dataToValidate, function (value, key) {
|
18501 | if (value instanceof AV.Op) {
|
18502 | dataToValidate[key] = value._estimate(self.attributes[key], self, key);
|
18503 |
|
18504 | if (dataToValidate[key] === AV.Op._UNSET) {
|
18505 | delete dataToValidate[key];
|
18506 | }
|
18507 | }
|
18508 | });
|
18509 |
|
18510 |
|
18511 | this._validate(attrs, options);
|
18512 |
|
18513 | options.changes = {};
|
18514 | var escaped = this._escapedAttributes;
|
18515 |
|
18516 | AV._arrayEach((0, _keys2.default)(_).call(_, attrs), function (attr) {
|
18517 | var val = attrs[attr];
|
18518 |
|
18519 |
|
18520 |
|
18521 | if (val instanceof AV.Relation) {
|
18522 | val.parent = self;
|
18523 | }
|
18524 |
|
18525 | if (!(val instanceof AV.Op)) {
|
18526 | val = new AV.Op.Set(val);
|
18527 | }
|
18528 |
|
18529 |
|
18530 | var isRealChange = true;
|
18531 |
|
18532 | if (val instanceof AV.Op.Set && _.isEqual(self.attributes[attr], val.value)) {
|
18533 | isRealChange = false;
|
18534 | }
|
18535 |
|
18536 | if (isRealChange) {
|
18537 | delete escaped[attr];
|
18538 |
|
18539 | if (options.silent) {
|
18540 | self._silent[attr] = true;
|
18541 | } else {
|
18542 | options.changes[attr] = true;
|
18543 | }
|
18544 | }
|
18545 |
|
18546 | var currentChanges = _.last(self._opSetQueue);
|
18547 |
|
18548 | currentChanges[attr] = val._mergeWithPrevious(currentChanges[attr]);
|
18549 |
|
18550 | self._rebuildEstimatedDataForKey(attr);
|
18551 |
|
18552 | if (isRealChange) {
|
18553 | self.changed[attr] = self.attributes[attr];
|
18554 |
|
18555 | if (!options.silent) {
|
18556 | self._pending[attr] = true;
|
18557 | }
|
18558 | } else {
|
18559 | delete self.changed[attr];
|
18560 | delete self._pending[attr];
|
18561 | }
|
18562 | });
|
18563 |
|
18564 | if (!options.silent) {
|
18565 | this.change(options);
|
18566 | }
|
18567 |
|
18568 | return this;
|
18569 | },
|
18570 |
|
18571 | |
18572 |
|
18573 |
|
18574 |
|
18575 |
|
18576 |
|
18577 | unset: function unset(attr, options) {
|
18578 | options = options || {};
|
18579 | options.unset = true;
|
18580 | return this.set(attr, null, options);
|
18581 | },
|
18582 |
|
18583 | |
18584 |
|
18585 |
|
18586 |
|
18587 |
|
18588 |
|
18589 |
|
18590 | increment: function increment(attr, amount) {
|
18591 | if (_.isUndefined(amount) || _.isNull(amount)) {
|
18592 | amount = 1;
|
18593 | }
|
18594 |
|
18595 | return this.set(attr, new AV.Op.Increment(amount));
|
18596 | },
|
18597 |
|
18598 | |
18599 |
|
18600 |
|
18601 |
|
18602 |
|
18603 |
|
18604 | add: function add(attr, item) {
|
18605 | return this.set(attr, new AV.Op.Add(ensureArray(item)));
|
18606 | },
|
18607 |
|
18608 | |
18609 |
|
18610 |
|
18611 |
|
18612 |
|
18613 |
|
18614 |
|
18615 |
|
18616 | addUnique: function addUnique(attr, item) {
|
18617 | return this.set(attr, new AV.Op.AddUnique(ensureArray(item)));
|
18618 | },
|
18619 |
|
18620 | |
18621 |
|
18622 |
|
18623 |
|
18624 |
|
18625 |
|
18626 |
|
18627 | remove: function remove(attr, item) {
|
18628 | return this.set(attr, new AV.Op.Remove(ensureArray(item)));
|
18629 | },
|
18630 |
|
18631 | |
18632 |
|
18633 |
|
18634 |
|
18635 |
|
18636 |
|
18637 |
|
18638 | bitAnd: function bitAnd(attr, value) {
|
18639 | return this.set(attr, new AV.Op.BitAnd(value));
|
18640 | },
|
18641 |
|
18642 | |
18643 |
|
18644 |
|
18645 |
|
18646 |
|
18647 |
|
18648 |
|
18649 | bitOr: function bitOr(attr, value) {
|
18650 | return this.set(attr, new AV.Op.BitOr(value));
|
18651 | },
|
18652 |
|
18653 | |
18654 |
|
18655 |
|
18656 |
|
18657 |
|
18658 |
|
18659 |
|
18660 | bitXor: function bitXor(attr, value) {
|
18661 | return this.set(attr, new AV.Op.BitXor(value));
|
18662 | },
|
18663 |
|
18664 | |
18665 |
|
18666 |
|
18667 |
|
18668 |
|
18669 |
|
18670 |
|
18671 |
|
18672 |
|
18673 | op: function op(attr) {
|
18674 | return _.last(this._opSetQueue)[attr];
|
18675 | },
|
18676 |
|
18677 | |
18678 |
|
18679 |
|
18680 |
|
18681 | clear: function clear(options) {
|
18682 | options = options || {};
|
18683 | options.unset = true;
|
18684 |
|
18685 | var keysToClear = _.extend(this.attributes, this._operations);
|
18686 |
|
18687 | return this.set(keysToClear, options);
|
18688 | },
|
18689 |
|
18690 | |
18691 |
|
18692 |
|
18693 |
|
18694 | revert: function revert(keys) {
|
18695 | var lastOp = _.last(this._opSetQueue);
|
18696 |
|
18697 | var _keys = ensureArray(keys || (0, _keys2.default)(_).call(_, lastOp));
|
18698 |
|
18699 | _keys.forEach(function (key) {
|
18700 | delete lastOp[key];
|
18701 | });
|
18702 |
|
18703 | this._rebuildAllEstimatedData();
|
18704 |
|
18705 | return this;
|
18706 | },
|
18707 |
|
18708 | |
18709 |
|
18710 |
|
18711 |
|
18712 |
|
18713 | _getSaveJSON: function _getSaveJSON() {
|
18714 | var json = _.clone(_.first(this._opSetQueue));
|
18715 |
|
18716 | AV._objectEach(json, function (op, key) {
|
18717 | json[key] = op.toJSON();
|
18718 | });
|
18719 |
|
18720 | return json;
|
18721 | },
|
18722 |
|
18723 | |
18724 |
|
18725 |
|
18726 |
|
18727 | _canBeSerialized: function _canBeSerialized() {
|
18728 | return AV.Object._canBeSerializedAsValue(this.attributes);
|
18729 | },
|
18730 |
|
18731 | |
18732 |
|
18733 |
|
18734 |
|
18735 |
|
18736 |
|
18737 |
|
18738 |
|
18739 |
|
18740 |
|
18741 | fetch: function fetch() {
|
18742 | var fetchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
18743 | var options = arguments.length > 1 ? arguments[1] : undefined;
|
18744 |
|
18745 | if (!this.id) {
|
18746 | throw new Error('Cannot fetch unsaved object');
|
18747 | }
|
18748 |
|
18749 | var self = this;
|
18750 |
|
18751 | var request = _request('classes', this.className, this.id, 'GET', transformFetchOptions(fetchOptions), options);
|
18752 |
|
18753 | return request.then(function (response) {
|
18754 | var fetchedAttrs = self.parse(response);
|
18755 |
|
18756 | self._cleanupUnsetKeys(fetchedAttrs, (0, _keys2.default)(fetchOptions) ? ensureArray((0, _keys2.default)(fetchOptions)).join(',').split(',') : undefined);
|
18757 |
|
18758 | self._finishFetch(fetchedAttrs, true);
|
18759 |
|
18760 | return self;
|
18761 | });
|
18762 | },
|
18763 | _cleanupUnsetKeys: function _cleanupUnsetKeys(fetchedAttrs) {
|
18764 | var _this2 = this;
|
18765 |
|
18766 | var fetchedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _keys2.default)(_).call(_, this._serverData);
|
18767 |
|
18768 | _.forEach(fetchedKeys, function (key) {
|
18769 | if (fetchedAttrs[key] === undefined) delete _this2._serverData[key];
|
18770 | });
|
18771 | },
|
18772 |
|
18773 | |
18774 |
|
18775 |
|
18776 |
|
18777 |
|
18778 |
|
18779 |
|
18780 |
|
18781 |
|
18782 |
|
18783 |
|
18784 |
|
18785 |
|
18786 |
|
18787 |
|
18788 |
|
18789 |
|
18790 |
|
18791 |
|
18792 |
|
18793 |
|
18794 |
|
18795 |
|
18796 |
|
18797 |
|
18798 |
|
18799 |
|
18800 |
|
18801 |
|
18802 | save: function save(arg1, arg2, arg3) {
|
18803 | var attrs, current, options;
|
18804 |
|
18805 | if (_.isObject(arg1) || isNullOrUndefined(arg1)) {
|
18806 | attrs = arg1;
|
18807 | options = arg2;
|
18808 | } else {
|
18809 | attrs = {};
|
18810 | attrs[arg1] = arg2;
|
18811 | options = arg3;
|
18812 | }
|
18813 |
|
18814 | options = _.clone(options) || {};
|
18815 |
|
18816 | if (options.wait) {
|
18817 | current = _.clone(this.attributes);
|
18818 | }
|
18819 |
|
18820 | var setOptions = _.clone(options) || {};
|
18821 |
|
18822 | if (setOptions.wait) {
|
18823 | setOptions.silent = true;
|
18824 | }
|
18825 |
|
18826 | if (attrs) {
|
18827 | this.set(attrs, setOptions);
|
18828 | }
|
18829 |
|
18830 | var model = this;
|
18831 | var unsavedChildren = [];
|
18832 | var unsavedFiles = [];
|
18833 |
|
18834 | AV.Object._findUnsavedChildren(model, unsavedChildren, unsavedFiles);
|
18835 |
|
18836 | if (unsavedChildren.length + unsavedFiles.length > 1) {
|
18837 | return AV.Object._deepSaveAsync(this, model, options);
|
18838 | }
|
18839 |
|
18840 | this._startSave();
|
18841 |
|
18842 | this._saving = (this._saving || 0) + 1;
|
18843 | this._allPreviousSaves = this._allPreviousSaves || _promise.default.resolve();
|
18844 | this._allPreviousSaves = this._allPreviousSaves.catch(function (e) {}).then(function () {
|
18845 | var method = model.id ? 'PUT' : 'POST';
|
18846 |
|
18847 | var json = model._getSaveJSON();
|
18848 |
|
18849 | var query = {};
|
18850 |
|
18851 | if (model._fetchWhenSave || options.fetchWhenSave) {
|
18852 | query['new'] = 'true';
|
18853 | }
|
18854 |
|
18855 |
|
18856 | if (options._failOnNotExist) {
|
18857 | query.failOnNotExist = 'true';
|
18858 | }
|
18859 |
|
18860 | if (options.query) {
|
18861 | var queryParams;
|
18862 |
|
18863 | if (typeof options.query._getParams === 'function') {
|
18864 | queryParams = options.query._getParams();
|
18865 |
|
18866 | if (queryParams) {
|
18867 | query.where = queryParams.where;
|
18868 | }
|
18869 | }
|
18870 |
|
18871 | if (!query.where) {
|
18872 | var error = new Error('options.query is not an AV.Query');
|
18873 | throw error;
|
18874 | }
|
18875 | }
|
18876 |
|
18877 | _.extend(json, model._flags);
|
18878 |
|
18879 | var route = 'classes';
|
18880 | var className = model.className;
|
18881 |
|
18882 | if (model.className === '_User' && !model.id) {
|
18883 |
|
18884 | route = 'users';
|
18885 | className = null;
|
18886 | }
|
18887 |
|
18888 |
|
18889 | var makeRequest = options._makeRequest || _request;
|
18890 | var requestPromise = makeRequest(route, className, model.id, method, json, options, query);
|
18891 | requestPromise = requestPromise.then(function (resp) {
|
18892 | var serverAttrs = model.parse(resp);
|
18893 |
|
18894 | if (options.wait) {
|
18895 | serverAttrs = _.extend(attrs || {}, serverAttrs);
|
18896 | }
|
18897 |
|
18898 | model._finishSave(serverAttrs);
|
18899 |
|
18900 | if (options.wait) {
|
18901 | model.set(current, setOptions);
|
18902 | }
|
18903 |
|
18904 | return model;
|
18905 | }, function (error) {
|
18906 | model._cancelSave();
|
18907 |
|
18908 | throw error;
|
18909 | });
|
18910 | return requestPromise;
|
18911 | });
|
18912 | return this._allPreviousSaves;
|
18913 | },
|
18914 |
|
18915 | |
18916 |
|
18917 |
|
18918 |
|
18919 |
|
18920 |
|
18921 |
|
18922 |
|
18923 |
|
18924 |
|
18925 | destroy: function destroy(options) {
|
18926 | options = options || {};
|
18927 | var model = this;
|
18928 |
|
18929 | var triggerDestroy = function triggerDestroy() {
|
18930 | model.trigger('destroy', model, model.collection, options);
|
18931 | };
|
18932 |
|
18933 | if (!this.id) {
|
18934 | return triggerDestroy();
|
18935 | }
|
18936 |
|
18937 | if (!options.wait) {
|
18938 | triggerDestroy();
|
18939 | }
|
18940 |
|
18941 | var request = _request('classes', this.className, this.id, 'DELETE', this._flags, options);
|
18942 |
|
18943 | return request.then(function () {
|
18944 | if (options.wait) {
|
18945 | triggerDestroy();
|
18946 | }
|
18947 |
|
18948 | return model;
|
18949 | });
|
18950 | },
|
18951 |
|
18952 | |
18953 |
|
18954 |
|
18955 |
|
18956 | parse: function parse(resp) {
|
18957 | var output = _.clone(resp);
|
18958 |
|
18959 | ['createdAt', 'updatedAt'].forEach(function (key) {
|
18960 | if (output[key]) {
|
18961 | output[key] = AV._parseDate(output[key]);
|
18962 | }
|
18963 | });
|
18964 |
|
18965 | if (output.createdAt && !output.updatedAt) {
|
18966 | output.updatedAt = output.createdAt;
|
18967 | }
|
18968 |
|
18969 | return output;
|
18970 | },
|
18971 |
|
18972 | |
18973 |
|
18974 |
|
18975 |
|
18976 | clone: function clone() {
|
18977 | return new this.constructor(this.attributes);
|
18978 | },
|
18979 |
|
18980 | |
18981 |
|
18982 |
|
18983 |
|
18984 | isNew: function isNew() {
|
18985 | return !this.id;
|
18986 | },
|
18987 |
|
18988 | |
18989 |
|
18990 |
|
18991 |
|
18992 |
|
18993 | change: function change(options) {
|
18994 | options = options || {};
|
18995 | var changing = this._changing;
|
18996 | this._changing = true;
|
18997 |
|
18998 | var self = this;
|
18999 |
|
19000 | AV._objectEach(this._silent, function (attr) {
|
19001 | self._pending[attr] = true;
|
19002 | });
|
19003 |
|
19004 |
|
19005 | var changes = _.extend({}, options.changes, this._silent);
|
19006 |
|
19007 | this._silent = {};
|
19008 |
|
19009 | AV._objectEach(changes, function (unused_value, attr) {
|
19010 | self.trigger('change:' + attr, self, self.get(attr), options);
|
19011 | });
|
19012 |
|
19013 | if (changing) {
|
19014 | return this;
|
19015 | }
|
19016 |
|
19017 |
|
19018 | var deleteChanged = function deleteChanged(value, attr) {
|
19019 | if (!self._pending[attr] && !self._silent[attr]) {
|
19020 | delete self.changed[attr];
|
19021 | }
|
19022 | };
|
19023 |
|
19024 |
|
19025 | while (!_.isEmpty(this._pending)) {
|
19026 | this._pending = {};
|
19027 | this.trigger('change', this, options);
|
19028 |
|
19029 | AV._objectEach(this.changed, deleteChanged);
|
19030 |
|
19031 | self._previousAttributes = _.clone(this.attributes);
|
19032 | }
|
19033 |
|
19034 | this._changing = false;
|
19035 | return this;
|
19036 | },
|
19037 |
|
19038 | |
19039 |
|
19040 |
|
19041 |
|
19042 |
|
19043 | previous: function previous(attr) {
|
19044 | if (!arguments.length || !this._previousAttributes) {
|
19045 | return null;
|
19046 | }
|
19047 |
|
19048 | return this._previousAttributes[attr];
|
19049 | },
|
19050 |
|
19051 | |
19052 |
|
19053 |
|
19054 |
|
19055 |
|
19056 | previousAttributes: function previousAttributes() {
|
19057 | return _.clone(this._previousAttributes);
|
19058 | },
|
19059 |
|
19060 | |
19061 |
|
19062 |
|
19063 |
|
19064 |
|
19065 | isValid: function isValid() {
|
19066 | try {
|
19067 | this.validate(this.attributes);
|
19068 | } catch (error) {
|
19069 | return false;
|
19070 | }
|
19071 |
|
19072 | return true;
|
19073 | },
|
19074 |
|
19075 | |
19076 |
|
19077 |
|
19078 |
|
19079 |
|
19080 |
|
19081 |
|
19082 |
|
19083 |
|
19084 |
|
19085 | validate: function validate(attrs) {
|
19086 | if (_.has(attrs, 'ACL') && !(attrs.ACL instanceof AV.ACL)) {
|
19087 | throw new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
|
19088 | }
|
19089 | },
|
19090 |
|
19091 | |
19092 |
|
19093 |
|
19094 |
|
19095 |
|
19096 |
|
19097 | _validate: function _validate(attrs, options) {
|
19098 | if (options.silent || !this.validate) {
|
19099 | return;
|
19100 | }
|
19101 |
|
19102 | attrs = _.extend({}, this.attributes, attrs);
|
19103 | this.validate(attrs);
|
19104 | },
|
19105 |
|
19106 | |
19107 |
|
19108 |
|
19109 |
|
19110 |
|
19111 | getACL: function getACL() {
|
19112 | return this.get('ACL');
|
19113 | },
|
19114 |
|
19115 | |
19116 |
|
19117 |
|
19118 |
|
19119 |
|
19120 |
|
19121 |
|
19122 |
|
19123 | setACL: function setACL(acl, options) {
|
19124 | return this.set('ACL', acl, options);
|
19125 | },
|
19126 | disableBeforeHook: function disableBeforeHook() {
|
19127 | this.ignoreHook('beforeSave');
|
19128 | this.ignoreHook('beforeUpdate');
|
19129 | this.ignoreHook('beforeDelete');
|
19130 | },
|
19131 | disableAfterHook: function disableAfterHook() {
|
19132 | this.ignoreHook('afterSave');
|
19133 | this.ignoreHook('afterUpdate');
|
19134 | this.ignoreHook('afterDelete');
|
19135 | },
|
19136 | ignoreHook: function ignoreHook(hookName) {
|
19137 | if (!_.contains(['beforeSave', 'afterSave', 'beforeUpdate', 'afterUpdate', 'beforeDelete', 'afterDelete'], hookName)) {
|
19138 | throw new Error('Unsupported hookName: ' + hookName);
|
19139 | }
|
19140 |
|
19141 | if (!AV.hookKey) {
|
19142 | throw new Error('ignoreHook required hookKey');
|
19143 | }
|
19144 |
|
19145 | if (!this._flags.__ignore_hooks) {
|
19146 | this._flags.__ignore_hooks = [];
|
19147 | }
|
19148 |
|
19149 | this._flags.__ignore_hooks.push(hookName);
|
19150 | }
|
19151 | });
|
19152 | |
19153 |
|
19154 |
|
19155 |
|
19156 |
|
19157 |
|
19158 |
|
19159 |
|
19160 |
|
19161 | AV.Object.createWithoutData = function (klass, id, hasData) {
|
19162 | var _klass;
|
19163 |
|
19164 | if (_.isString(klass)) {
|
19165 | _klass = AV.Object._getSubclass(klass);
|
19166 | } else if (klass.prototype && klass.prototype instanceof AV.Object) {
|
19167 | _klass = klass;
|
19168 | } else {
|
19169 | throw new Error('class must be a string or a subclass of AV.Object.');
|
19170 | }
|
19171 |
|
19172 | if (!id) {
|
19173 | throw new TypeError('The objectId must be provided');
|
19174 | }
|
19175 |
|
19176 | var object = new _klass();
|
19177 | object.id = id;
|
19178 | object._hasData = hasData;
|
19179 | return object;
|
19180 | };
|
19181 | |
19182 |
|
19183 |
|
19184 |
|
19185 |
|
19186 |
|
19187 |
|
19188 |
|
19189 |
|
19190 | AV.Object.destroyAll = function (objects) {
|
19191 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
19192 |
|
19193 | if (!objects || objects.length === 0) {
|
19194 | return _promise.default.resolve();
|
19195 | }
|
19196 |
|
19197 | var objectsByClassNameAndFlags = _.groupBy(objects, function (object) {
|
19198 | return (0, _stringify.default)({
|
19199 | className: object.className,
|
19200 | flags: object._flags
|
19201 | });
|
19202 | });
|
19203 |
|
19204 | var body = {
|
19205 | requests: (0, _map.default)(_).call(_, objectsByClassNameAndFlags, function (objects) {
|
19206 | var _context3;
|
19207 |
|
19208 | var ids = (0, _map.default)(_).call(_, objects, 'id').join(',');
|
19209 | return {
|
19210 | method: 'DELETE',
|
19211 | path: (0, _concat.default)(_context3 = "/1.1/classes/".concat(objects[0].className, "/")).call(_context3, ids),
|
19212 | body: objects[0]._flags
|
19213 | };
|
19214 | })
|
19215 | };
|
19216 | return _request('batch', null, null, 'POST', body, options).then(function (response) {
|
19217 | var firstError = (0, _find.default)(_).call(_, response, function (result) {
|
19218 | return !result.success;
|
19219 | });
|
19220 | if (firstError) throw new AVError(firstError.error.code, firstError.error.error);
|
19221 | return undefined;
|
19222 | });
|
19223 | };
|
19224 | |
19225 |
|
19226 |
|
19227 |
|
19228 |
|
19229 |
|
19230 |
|
19231 | AV.Object._getSubclass = function (className) {
|
19232 | if (!_.isString(className)) {
|
19233 | throw new Error('AV.Object._getSubclass requires a string argument.');
|
19234 | }
|
19235 |
|
19236 | var ObjectClass = AV.Object._classMap[className];
|
19237 |
|
19238 | if (!ObjectClass) {
|
19239 | ObjectClass = AV.Object.extend(className);
|
19240 | AV.Object._classMap[className] = ObjectClass;
|
19241 | }
|
19242 |
|
19243 | return ObjectClass;
|
19244 | };
|
19245 | |
19246 |
|
19247 |
|
19248 |
|
19249 |
|
19250 |
|
19251 | AV.Object._create = function (className, attributes, options) {
|
19252 | var ObjectClass = AV.Object._getSubclass(className);
|
19253 |
|
19254 | return new ObjectClass(attributes, options);
|
19255 | };
|
19256 |
|
19257 |
|
19258 |
|
19259 | AV.Object._classMap = {};
|
19260 | AV.Object._extend = AV._extend;
|
19261 | |
19262 |
|
19263 |
|
19264 |
|
19265 |
|
19266 |
|
19267 |
|
19268 |
|
19269 |
|
19270 |
|
19271 |
|
19272 |
|
19273 |
|
19274 |
|
19275 |
|
19276 | AV.Object['new'] = function (attributes, options) {
|
19277 | return new AV.Object(attributes, options);
|
19278 | };
|
19279 | |
19280 |
|
19281 |
|
19282 |
|
19283 |
|
19284 |
|
19285 |
|
19286 |
|
19287 |
|
19288 |
|
19289 |
|
19290 |
|
19291 |
|
19292 |
|
19293 |
|
19294 |
|
19295 |
|
19296 |
|
19297 |
|
19298 |
|
19299 |
|
19300 |
|
19301 |
|
19302 |
|
19303 | AV.Object.extend = function (className, protoProps, classProps) {
|
19304 |
|
19305 | if (!_.isString(className)) {
|
19306 | if (className && _.has(className, 'className')) {
|
19307 | return AV.Object.extend(className.className, className, protoProps);
|
19308 | } else {
|
19309 | throw new Error("AV.Object.extend's first argument should be the className.");
|
19310 | }
|
19311 | }
|
19312 |
|
19313 |
|
19314 | if (className === 'User') {
|
19315 | className = '_User';
|
19316 | }
|
19317 |
|
19318 | var NewClassObject = null;
|
19319 |
|
19320 | if (_.has(AV.Object._classMap, className)) {
|
19321 | var OldClassObject = AV.Object._classMap[className];
|
19322 |
|
19323 |
|
19324 |
|
19325 | if (protoProps || classProps) {
|
19326 | NewClassObject = OldClassObject._extend(protoProps, classProps);
|
19327 | } else {
|
19328 | return OldClassObject;
|
19329 | }
|
19330 | } else {
|
19331 | protoProps = protoProps || {};
|
19332 | protoProps._className = className;
|
19333 | NewClassObject = this._extend(protoProps, classProps);
|
19334 | }
|
19335 |
|
19336 |
|
19337 | NewClassObject.extend = function (arg0) {
|
19338 | var _context4;
|
19339 |
|
19340 | if (_.isString(arg0) || arg0 && _.has(arg0, 'className')) {
|
19341 | return AV.Object.extend.apply(NewClassObject, arguments);
|
19342 | }
|
19343 |
|
19344 | var newArguments = (0, _concat.default)(_context4 = [className]).call(_context4, _.toArray(arguments));
|
19345 | return AV.Object.extend.apply(NewClassObject, newArguments);
|
19346 | };
|
19347 |
|
19348 |
|
19349 | (0, _defineProperty.default)(NewClassObject, 'query', (0, _getOwnPropertyDescriptor.default)(AV.Object, 'query'));
|
19350 |
|
19351 | NewClassObject['new'] = function (attributes, options) {
|
19352 | return new NewClassObject(attributes, options);
|
19353 | };
|
19354 |
|
19355 | AV.Object._classMap[className] = NewClassObject;
|
19356 | return NewClassObject;
|
19357 | };
|
19358 |
|
19359 |
|
19360 | (0, _defineProperty.default)(AV.Object.prototype, 'className', {
|
19361 | get: function get() {
|
19362 | var className = this._className || this.constructor._LCClassName || this.constructor.name;
|
19363 |
|
19364 | if (className === 'User') {
|
19365 | return '_User';
|
19366 | }
|
19367 |
|
19368 | return className;
|
19369 | }
|
19370 | });
|
19371 | |
19372 |
|
19373 |
|
19374 |
|
19375 |
|
19376 |
|
19377 |
|
19378 |
|
19379 |
|
19380 |
|
19381 |
|
19382 | AV.Object.register = function (klass, name) {
|
19383 | if (!(klass.prototype instanceof AV.Object)) {
|
19384 | throw new Error('registered class is not a subclass of AV.Object');
|
19385 | }
|
19386 |
|
19387 | var className = name || klass.name;
|
19388 |
|
19389 | if (!className.length) {
|
19390 | throw new Error('registered class must be named');
|
19391 | }
|
19392 |
|
19393 | if (name) {
|
19394 | klass._LCClassName = name;
|
19395 | }
|
19396 |
|
19397 | AV.Object._classMap[className] = klass;
|
19398 | };
|
19399 | |
19400 |
|
19401 |
|
19402 |
|
19403 |
|
19404 |
|
19405 |
|
19406 |
|
19407 |
|
19408 |
|
19409 |
|
19410 |
|
19411 |
|
19412 | (0, _defineProperty.default)(AV.Object, 'query', {
|
19413 | get: function get() {
|
19414 | return new AV.Query(this.prototype.className);
|
19415 | }
|
19416 | });
|
19417 |
|
19418 | AV.Object._findUnsavedChildren = function (objects, children, files) {
|
19419 | AV._traverse(objects, function (object) {
|
19420 | if (object instanceof AV.Object) {
|
19421 | if (object.dirty()) {
|
19422 | children.push(object);
|
19423 | }
|
19424 |
|
19425 | return;
|
19426 | }
|
19427 |
|
19428 | if (object instanceof AV.File) {
|
19429 | if (!object.id) {
|
19430 | files.push(object);
|
19431 | }
|
19432 |
|
19433 | return;
|
19434 | }
|
19435 | });
|
19436 | };
|
19437 |
|
19438 | AV.Object._canBeSerializedAsValue = function (object) {
|
19439 | var canBeSerializedAsValue = true;
|
19440 |
|
19441 | if (object instanceof AV.Object || object instanceof AV.File) {
|
19442 | canBeSerializedAsValue = !!object.id;
|
19443 | } else if (_.isArray(object)) {
|
19444 | AV._arrayEach(object, function (child) {
|
19445 | if (!AV.Object._canBeSerializedAsValue(child)) {
|
19446 | canBeSerializedAsValue = false;
|
19447 | }
|
19448 | });
|
19449 | } else if (_.isObject(object)) {
|
19450 | AV._objectEach(object, function (child) {
|
19451 | if (!AV.Object._canBeSerializedAsValue(child)) {
|
19452 | canBeSerializedAsValue = false;
|
19453 | }
|
19454 | });
|
19455 | }
|
19456 |
|
19457 | return canBeSerializedAsValue;
|
19458 | };
|
19459 |
|
19460 | AV.Object._deepSaveAsync = function (object, model, options) {
|
19461 | var unsavedChildren = [];
|
19462 | var unsavedFiles = [];
|
19463 |
|
19464 | AV.Object._findUnsavedChildren(object, unsavedChildren, unsavedFiles);
|
19465 |
|
19466 | unsavedFiles = _.uniq(unsavedFiles);
|
19467 |
|
19468 | var promise = _promise.default.resolve();
|
19469 |
|
19470 | _.each(unsavedFiles, function (file) {
|
19471 | promise = promise.then(function () {
|
19472 | return file.save();
|
19473 | });
|
19474 | });
|
19475 |
|
19476 | var objects = _.uniq(unsavedChildren);
|
19477 |
|
19478 | var remaining = _.uniq(objects);
|
19479 |
|
19480 | return promise.then(function () {
|
19481 | return continueWhile(function () {
|
19482 | return remaining.length > 0;
|
19483 | }, function () {
|
19484 |
|
19485 | var batch = [];
|
19486 | var newRemaining = [];
|
19487 |
|
19488 | AV._arrayEach(remaining, function (object) {
|
19489 | if (object._canBeSerialized()) {
|
19490 | batch.push(object);
|
19491 | } else {
|
19492 | newRemaining.push(object);
|
19493 | }
|
19494 | });
|
19495 |
|
19496 | remaining = newRemaining;
|
19497 |
|
19498 | if (batch.length === 0) {
|
19499 | return _promise.default.reject(new AVError(AVError.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
|
19500 | }
|
19501 |
|
19502 |
|
19503 | var readyToStart = _promise.default.resolve((0, _map.default)(_).call(_, batch, function (object) {
|
19504 | return object._allPreviousSaves || _promise.default.resolve();
|
19505 | }));
|
19506 |
|
19507 |
|
19508 | var bathSavePromise = readyToStart.then(function () {
|
19509 | return _request('batch', null, null, 'POST', {
|
19510 | requests: (0, _map.default)(_).call(_, batch, function (object) {
|
19511 | var method = object.id ? 'PUT' : 'POST';
|
19512 |
|
19513 | var json = object._getSaveJSON();
|
19514 |
|
19515 | _.extend(json, object._flags);
|
19516 |
|
19517 | var route = 'classes';
|
19518 | var className = object.className;
|
19519 | var path = "/".concat(route, "/").concat(className);
|
19520 |
|
19521 | if (object.className === '_User' && !object.id) {
|
19522 |
|
19523 | path = '/users';
|
19524 | }
|
19525 |
|
19526 | var path = "/1.1".concat(path);
|
19527 |
|
19528 | if (object.id) {
|
19529 | path = path + '/' + object.id;
|
19530 | }
|
19531 |
|
19532 | object._startSave();
|
19533 |
|
19534 | return {
|
19535 | method: method,
|
19536 | path: path,
|
19537 | body: json,
|
19538 | params: options && options.fetchWhenSave ? {
|
19539 | fetchWhenSave: true
|
19540 | } : undefined
|
19541 | };
|
19542 | })
|
19543 | }, options).then(function (response) {
|
19544 | var results = (0, _map.default)(_).call(_, batch, function (object, i) {
|
19545 | if (response[i].success) {
|
19546 | object._finishSave(object.parse(response[i].success));
|
19547 |
|
19548 | return object;
|
19549 | }
|
19550 |
|
19551 | object._cancelSave();
|
19552 |
|
19553 | return new AVError(response[i].error.code, response[i].error.error);
|
19554 | });
|
19555 | return handleBatchResults(results);
|
19556 | });
|
19557 | });
|
19558 |
|
19559 | AV._arrayEach(batch, function (object) {
|
19560 | object._allPreviousSaves = bathSavePromise;
|
19561 | });
|
19562 |
|
19563 | return bathSavePromise;
|
19564 | });
|
19565 | }).then(function () {
|
19566 | return object;
|
19567 | });
|
19568 | };
|
19569 | };
|
19570 |
|
19571 | }),
|
19572 |
|
19573 | (function(module, exports, __webpack_require__) {
|
19574 |
|
19575 | var arrayWithHoles = __webpack_require__(537);
|
19576 |
|
19577 | var iterableToArrayLimit = __webpack_require__(545);
|
19578 |
|
19579 | var unsupportedIterableToArray = __webpack_require__(546);
|
19580 |
|
19581 | var nonIterableRest = __webpack_require__(556);
|
19582 |
|
19583 | function _slicedToArray(arr, i) {
|
19584 | return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
|
19585 | }
|
19586 |
|
19587 | module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19588 |
|
19589 | }),
|
19590 |
|
19591 | (function(module, exports, __webpack_require__) {
|
19592 |
|
19593 | var _Array$isArray = __webpack_require__(538);
|
19594 |
|
19595 | function _arrayWithHoles(arr) {
|
19596 | if (_Array$isArray(arr)) return arr;
|
19597 | }
|
19598 |
|
19599 | module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19600 |
|
19601 | }),
|
19602 |
|
19603 | (function(module, exports, __webpack_require__) {
|
19604 |
|
19605 | module.exports = __webpack_require__(539);
|
19606 |
|
19607 | }),
|
19608 |
|
19609 | (function(module, exports, __webpack_require__) {
|
19610 |
|
19611 | module.exports = __webpack_require__(540);
|
19612 |
|
19613 |
|
19614 | }),
|
19615 |
|
19616 | (function(module, exports, __webpack_require__) {
|
19617 |
|
19618 | var parent = __webpack_require__(541);
|
19619 |
|
19620 | module.exports = parent;
|
19621 |
|
19622 |
|
19623 | }),
|
19624 |
|
19625 | (function(module, exports, __webpack_require__) {
|
19626 |
|
19627 | var parent = __webpack_require__(542);
|
19628 |
|
19629 | module.exports = parent;
|
19630 |
|
19631 |
|
19632 | }),
|
19633 |
|
19634 | (function(module, exports, __webpack_require__) {
|
19635 |
|
19636 | var parent = __webpack_require__(543);
|
19637 |
|
19638 | module.exports = parent;
|
19639 |
|
19640 |
|
19641 | }),
|
19642 |
|
19643 | (function(module, exports, __webpack_require__) {
|
19644 |
|
19645 | __webpack_require__(544);
|
19646 | var path = __webpack_require__(7);
|
19647 |
|
19648 | module.exports = path.Array.isArray;
|
19649 |
|
19650 |
|
19651 | }),
|
19652 |
|
19653 | (function(module, exports, __webpack_require__) {
|
19654 |
|
19655 | var $ = __webpack_require__(0);
|
19656 | var isArray = __webpack_require__(92);
|
19657 |
|
19658 |
|
19659 |
|
19660 | $({ target: 'Array', stat: true }, {
|
19661 | isArray: isArray
|
19662 | });
|
19663 |
|
19664 |
|
19665 | }),
|
19666 |
|
19667 | (function(module, exports, __webpack_require__) {
|
19668 |
|
19669 | var _Symbol = __webpack_require__(241);
|
19670 |
|
19671 | var _getIteratorMethod = __webpack_require__(253);
|
19672 |
|
19673 | function _iterableToArrayLimit(arr, i) {
|
19674 | var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"];
|
19675 |
|
19676 | if (_i == null) return;
|
19677 | var _arr = [];
|
19678 | var _n = true;
|
19679 | var _d = false;
|
19680 |
|
19681 | var _s, _e;
|
19682 |
|
19683 | try {
|
19684 | for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
19685 | _arr.push(_s.value);
|
19686 |
|
19687 | if (i && _arr.length === i) break;
|
19688 | }
|
19689 | } catch (err) {
|
19690 | _d = true;
|
19691 | _e = err;
|
19692 | } finally {
|
19693 | try {
|
19694 | if (!_n && _i["return"] != null) _i["return"]();
|
19695 | } finally {
|
19696 | if (_d) throw _e;
|
19697 | }
|
19698 | }
|
19699 |
|
19700 | return _arr;
|
19701 | }
|
19702 |
|
19703 | module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19704 |
|
19705 | }),
|
19706 |
|
19707 | (function(module, exports, __webpack_require__) {
|
19708 |
|
19709 | var _sliceInstanceProperty = __webpack_require__(547);
|
19710 |
|
19711 | var _Array$from = __webpack_require__(551);
|
19712 |
|
19713 | var arrayLikeToArray = __webpack_require__(555);
|
19714 |
|
19715 | function _unsupportedIterableToArray(o, minLen) {
|
19716 | var _context;
|
19717 |
|
19718 | if (!o) return;
|
19719 | if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
19720 |
|
19721 | var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
|
19722 |
|
19723 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
19724 | if (n === "Map" || n === "Set") return _Array$from(o);
|
19725 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
19726 | }
|
19727 |
|
19728 | module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19729 |
|
19730 | }),
|
19731 |
|
19732 | (function(module, exports, __webpack_require__) {
|
19733 |
|
19734 | module.exports = __webpack_require__(548);
|
19735 |
|
19736 | }),
|
19737 |
|
19738 | (function(module, exports, __webpack_require__) {
|
19739 |
|
19740 | module.exports = __webpack_require__(549);
|
19741 |
|
19742 |
|
19743 | }),
|
19744 |
|
19745 | (function(module, exports, __webpack_require__) {
|
19746 |
|
19747 | var parent = __webpack_require__(550);
|
19748 |
|
19749 | module.exports = parent;
|
19750 |
|
19751 |
|
19752 | }),
|
19753 |
|
19754 | (function(module, exports, __webpack_require__) {
|
19755 |
|
19756 | var parent = __webpack_require__(239);
|
19757 |
|
19758 | module.exports = parent;
|
19759 |
|
19760 |
|
19761 | }),
|
19762 |
|
19763 | (function(module, exports, __webpack_require__) {
|
19764 |
|
19765 | module.exports = __webpack_require__(552);
|
19766 |
|
19767 | }),
|
19768 |
|
19769 | (function(module, exports, __webpack_require__) {
|
19770 |
|
19771 | module.exports = __webpack_require__(553);
|
19772 |
|
19773 |
|
19774 | }),
|
19775 |
|
19776 | (function(module, exports, __webpack_require__) {
|
19777 |
|
19778 | var parent = __webpack_require__(554);
|
19779 |
|
19780 | module.exports = parent;
|
19781 |
|
19782 |
|
19783 | }),
|
19784 |
|
19785 | (function(module, exports, __webpack_require__) {
|
19786 |
|
19787 | var parent = __webpack_require__(252);
|
19788 |
|
19789 | module.exports = parent;
|
19790 |
|
19791 |
|
19792 | }),
|
19793 |
|
19794 | (function(module, exports) {
|
19795 |
|
19796 | function _arrayLikeToArray(arr, len) {
|
19797 | if (len == null || len > arr.length) len = arr.length;
|
19798 |
|
19799 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
19800 | arr2[i] = arr[i];
|
19801 | }
|
19802 |
|
19803 | return arr2;
|
19804 | }
|
19805 |
|
19806 | module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19807 |
|
19808 | }),
|
19809 |
|
19810 | (function(module, exports) {
|
19811 |
|
19812 | function _nonIterableRest() {
|
19813 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
19814 | }
|
19815 |
|
19816 | module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19817 |
|
19818 | }),
|
19819 |
|
19820 | (function(module, exports, __webpack_require__) {
|
19821 |
|
19822 | var parent = __webpack_require__(558);
|
19823 |
|
19824 | module.exports = parent;
|
19825 |
|
19826 |
|
19827 | }),
|
19828 |
|
19829 | (function(module, exports, __webpack_require__) {
|
19830 |
|
19831 | __webpack_require__(559);
|
19832 | var path = __webpack_require__(7);
|
19833 |
|
19834 | var Object = path.Object;
|
19835 |
|
19836 | var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
|
19837 | return Object.getOwnPropertyDescriptor(it, key);
|
19838 | };
|
19839 |
|
19840 | if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
|
19841 |
|
19842 |
|
19843 | }),
|
19844 |
|
19845 | (function(module, exports, __webpack_require__) {
|
19846 |
|
19847 | var $ = __webpack_require__(0);
|
19848 | var fails = __webpack_require__(2);
|
19849 | var toIndexedObject = __webpack_require__(35);
|
19850 | var nativeGetOwnPropertyDescriptor = __webpack_require__(64).f;
|
19851 | var DESCRIPTORS = __webpack_require__(14);
|
19852 |
|
19853 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
|
19854 | var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
|
19855 |
|
19856 |
|
19857 |
|
19858 | $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
|
19859 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
19860 | return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
|
19861 | }
|
19862 | });
|
19863 |
|
19864 |
|
19865 | }),
|
19866 |
|
19867 | (function(module, exports, __webpack_require__) {
|
19868 |
|
19869 | "use strict";
|
19870 |
|
19871 |
|
19872 | var _ = __webpack_require__(3);
|
19873 |
|
19874 | var AVError = __webpack_require__(48);
|
19875 |
|
19876 | module.exports = function (AV) {
|
19877 | AV.Role = AV.Object.extend('_Role',
|
19878 |
|
19879 | {
|
19880 |
|
19881 |
|
19882 | |
19883 |
|
19884 |
|
19885 |
|
19886 |
|
19887 |
|
19888 |
|
19889 |
|
19890 |
|
19891 |
|
19892 |
|
19893 |
|
19894 |
|
19895 |
|
19896 |
|
19897 | constructor: function constructor(name, acl) {
|
19898 | if (_.isString(name)) {
|
19899 | AV.Object.prototype.constructor.call(this, null, null);
|
19900 | this.setName(name);
|
19901 | } else {
|
19902 | AV.Object.prototype.constructor.call(this, name, acl);
|
19903 | }
|
19904 |
|
19905 | if (acl) {
|
19906 | if (!(acl instanceof AV.ACL)) {
|
19907 | throw new TypeError('acl must be an instance of AV.ACL');
|
19908 | } else {
|
19909 | this.setACL(acl);
|
19910 | }
|
19911 | }
|
19912 | },
|
19913 |
|
19914 | |
19915 |
|
19916 |
|
19917 |
|
19918 |
|
19919 | getName: function getName() {
|
19920 | return this.get('name');
|
19921 | },
|
19922 |
|
19923 | |
19924 |
|
19925 |
|
19926 |
|
19927 |
|
19928 |
|
19929 |
|
19930 |
|
19931 |
|
19932 |
|
19933 |
|
19934 |
|
19935 |
|
19936 |
|
19937 | setName: function setName(name, options) {
|
19938 | return this.set('name', name, options);
|
19939 | },
|
19940 |
|
19941 | |
19942 |
|
19943 |
|
19944 |
|
19945 |
|
19946 |
|
19947 |
|
19948 |
|
19949 |
|
19950 |
|
19951 |
|
19952 | getUsers: function getUsers() {
|
19953 | return this.relation('users');
|
19954 | },
|
19955 |
|
19956 | |
19957 |
|
19958 |
|
19959 |
|
19960 |
|
19961 |
|
19962 |
|
19963 |
|
19964 |
|
19965 |
|
19966 |
|
19967 | getRoles: function getRoles() {
|
19968 | return this.relation('roles');
|
19969 | },
|
19970 |
|
19971 | |
19972 |
|
19973 |
|
19974 | validate: function validate(attrs, options) {
|
19975 | if ('name' in attrs && attrs.name !== this.getName()) {
|
19976 | var newName = attrs.name;
|
19977 |
|
19978 | if (this.id && this.id !== attrs.objectId) {
|
19979 |
|
19980 |
|
19981 |
|
19982 | return new AVError(AVError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
|
19983 | }
|
19984 |
|
19985 | if (!_.isString(newName)) {
|
19986 | return new AVError(AVError.OTHER_CAUSE, "A role's name must be a String.");
|
19987 | }
|
19988 |
|
19989 | if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
|
19990 | return new AVError(AVError.OTHER_CAUSE, "A role's name can only contain alphanumeric characters, _," + ' -, and spaces.');
|
19991 | }
|
19992 | }
|
19993 |
|
19994 | if (AV.Object.prototype.validate) {
|
19995 | return AV.Object.prototype.validate.call(this, attrs, options);
|
19996 | }
|
19997 |
|
19998 | return false;
|
19999 | }
|
20000 | });
|
20001 | };
|
20002 |
|
20003 | }),
|
20004 |
|
20005 | (function(module, exports, __webpack_require__) {
|
20006 |
|
20007 | "use strict";
|
20008 |
|
20009 |
|
20010 | var _interopRequireDefault = __webpack_require__(1);
|
20011 |
|
20012 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(562));
|
20013 |
|
20014 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
20015 |
|
20016 | var _map = _interopRequireDefault(__webpack_require__(37));
|
20017 |
|
20018 | var _find = _interopRequireDefault(__webpack_require__(96));
|
20019 |
|
20020 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
20021 |
|
20022 | var _ = __webpack_require__(3);
|
20023 |
|
20024 | var uuid = __webpack_require__(231);
|
20025 |
|
20026 | var AVError = __webpack_require__(48);
|
20027 |
|
20028 | var _require = __webpack_require__(28),
|
20029 | AVRequest = _require._request,
|
20030 | request = _require.request;
|
20031 |
|
20032 | var _require2 = __webpack_require__(76),
|
20033 | getAdapter = _require2.getAdapter;
|
20034 |
|
20035 | var PLATFORM_ANONYMOUS = 'anonymous';
|
20036 | var PLATFORM_QQAPP = 'lc_qqapp';
|
20037 |
|
20038 | var mergeUnionDataIntoAuthData = function mergeUnionDataIntoAuthData() {
|
20039 | var defaultUnionIdPlatform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'weixin';
|
20040 | return function (authData, unionId) {
|
20041 | var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
20042 | _ref$unionIdPlatform = _ref.unionIdPlatform,
|
20043 | unionIdPlatform = _ref$unionIdPlatform === void 0 ? defaultUnionIdPlatform : _ref$unionIdPlatform,
|
20044 | _ref$asMainAccount = _ref.asMainAccount,
|
20045 | asMainAccount = _ref$asMainAccount === void 0 ? false : _ref$asMainAccount;
|
20046 |
|
20047 | if (typeof unionId !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionId is not a string');
|
20048 | if (typeof unionIdPlatform !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionIdPlatform is not a string');
|
20049 | return _.extend({}, authData, {
|
20050 | platform: unionIdPlatform,
|
20051 | unionid: unionId,
|
20052 | main_account: Boolean(asMainAccount)
|
20053 | });
|
20054 | };
|
20055 | };
|
20056 |
|
20057 | module.exports = function (AV) {
|
20058 | |
20059 |
|
20060 |
|
20061 |
|
20062 |
|
20063 |
|
20064 |
|
20065 |
|
20066 |
|
20067 | AV.User = AV.Object.extend('_User',
|
20068 |
|
20069 | {
|
20070 |
|
20071 | _isCurrentUser: false,
|
20072 |
|
20073 |
|
20074 | |
20075 |
|
20076 |
|
20077 |
|
20078 | _mergeMagicFields: function _mergeMagicFields(attrs) {
|
20079 | if (attrs.sessionToken) {
|
20080 | this._sessionToken = attrs.sessionToken;
|
20081 | delete attrs.sessionToken;
|
20082 | }
|
20083 |
|
20084 | return AV.User.__super__._mergeMagicFields.call(this, attrs);
|
20085 | },
|
20086 |
|
20087 | |
20088 |
|
20089 |
|
20090 |
|
20091 |
|
20092 | _cleanupAuthData: function _cleanupAuthData() {
|
20093 | if (!this.isCurrent()) {
|
20094 | return;
|
20095 | }
|
20096 |
|
20097 | var authData = this.get('authData');
|
20098 |
|
20099 | if (!authData) {
|
20100 | return;
|
20101 | }
|
20102 |
|
20103 | AV._objectEach(this.get('authData'), function (value, key) {
|
20104 | if (!authData[key]) {
|
20105 | delete authData[key];
|
20106 | }
|
20107 | });
|
20108 | },
|
20109 |
|
20110 | |
20111 |
|
20112 |
|
20113 |
|
20114 | _synchronizeAllAuthData: function _synchronizeAllAuthData() {
|
20115 | var authData = this.get('authData');
|
20116 |
|
20117 | if (!authData) {
|
20118 | return;
|
20119 | }
|
20120 |
|
20121 | var self = this;
|
20122 |
|
20123 | AV._objectEach(this.get('authData'), function (value, key) {
|
20124 | self._synchronizeAuthData(key);
|
20125 | });
|
20126 | },
|
20127 |
|
20128 | |
20129 |
|
20130 |
|
20131 |
|
20132 |
|
20133 | _synchronizeAuthData: function _synchronizeAuthData(provider) {
|
20134 | if (!this.isCurrent()) {
|
20135 | return;
|
20136 | }
|
20137 |
|
20138 | var authType;
|
20139 |
|
20140 | if (_.isString(provider)) {
|
20141 | authType = provider;
|
20142 | provider = AV.User._authProviders[authType];
|
20143 | } else {
|
20144 | authType = provider.getAuthType();
|
20145 | }
|
20146 |
|
20147 | var authData = this.get('authData');
|
20148 |
|
20149 | if (!authData || !provider) {
|
20150 | return;
|
20151 | }
|
20152 |
|
20153 | var success = provider.restoreAuthentication(authData[authType]);
|
20154 |
|
20155 | if (!success) {
|
20156 | this.dissociateAuthData(provider);
|
20157 | }
|
20158 | },
|
20159 | _handleSaveResult: function _handleSaveResult(makeCurrent) {
|
20160 |
|
20161 | if (makeCurrent && !AV._config.disableCurrentUser) {
|
20162 | this._isCurrentUser = true;
|
20163 | }
|
20164 |
|
20165 | this._cleanupAuthData();
|
20166 |
|
20167 | this._synchronizeAllAuthData();
|
20168 |
|
20169 |
|
20170 | delete this._serverData.password;
|
20171 |
|
20172 | this._rebuildEstimatedDataForKey('password');
|
20173 |
|
20174 | this._refreshCache();
|
20175 |
|
20176 | if ((makeCurrent || this.isCurrent()) && !AV._config.disableCurrentUser) {
|
20177 |
|
20178 |
|
20179 |
|
20180 | return _promise.default.resolve(AV.User._saveCurrentUser(this));
|
20181 | } else {
|
20182 | return _promise.default.resolve();
|
20183 | }
|
20184 | },
|
20185 |
|
20186 | |
20187 |
|
20188 |
|
20189 |
|
20190 |
|
20191 | _linkWith: function _linkWith(provider, data) {
|
20192 | var _this = this;
|
20193 |
|
20194 | var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
20195 | _ref2$failOnNotExist = _ref2.failOnNotExist,
|
20196 | failOnNotExist = _ref2$failOnNotExist === void 0 ? false : _ref2$failOnNotExist,
|
20197 | useMasterKey = _ref2.useMasterKey,
|
20198 | sessionToken = _ref2.sessionToken,
|
20199 | user = _ref2.user;
|
20200 |
|
20201 | var authType;
|
20202 |
|
20203 | if (_.isString(provider)) {
|
20204 | authType = provider;
|
20205 | provider = AV.User._authProviders[provider];
|
20206 | } else {
|
20207 | authType = provider.getAuthType();
|
20208 | }
|
20209 |
|
20210 | if (data) {
|
20211 | return this.save({
|
20212 | authData: (0, _defineProperty2.default)({}, authType, data)
|
20213 | }, {
|
20214 | useMasterKey: useMasterKey,
|
20215 | sessionToken: sessionToken,
|
20216 | user: user,
|
20217 | fetchWhenSave: !!this.get('authData'),
|
20218 | _failOnNotExist: failOnNotExist
|
20219 | }).then(function (model) {
|
20220 | return model._handleSaveResult(true).then(function () {
|
20221 | return model;
|
20222 | });
|
20223 | });
|
20224 | } else {
|
20225 | return provider.authenticate().then(function (result) {
|
20226 | return _this._linkWith(provider, result);
|
20227 | });
|
20228 | }
|
20229 | },
|
20230 |
|
20231 | |
20232 |
|
20233 |
|
20234 |
|
20235 |
|
20236 |
|
20237 |
|
20238 |
|
20239 |
|
20240 |
|
20241 |
|
20242 |
|
20243 |
|
20244 |
|
20245 |
|
20246 |
|
20247 | associateWithAuthData: function associateWithAuthData(authData, platform) {
|
20248 | return this._linkWith(platform, authData);
|
20249 | },
|
20250 |
|
20251 | |
20252 |
|
20253 |
|
20254 |
|
20255 |
|
20256 |
|
20257 |
|
20258 |
|
20259 |
|
20260 |
|
20261 |
|
20262 |
|
20263 |
|
20264 |
|
20265 |
|
20266 |
|
20267 |
|
20268 |
|
20269 |
|
20270 |
|
20271 |
|
20272 |
|
20273 |
|
20274 | associateWithAuthDataAndUnionId: function associateWithAuthDataAndUnionId(authData, platform, unionId, unionOptions) {
|
20275 | return this._linkWith(platform, mergeUnionDataIntoAuthData()(authData, unionId, unionOptions));
|
20276 | },
|
20277 |
|
20278 | |
20279 |
|
20280 |
|
20281 |
|
20282 |
|
20283 |
|
20284 |
|
20285 |
|
20286 | associateWithMiniApp: function associateWithMiniApp(authInfo, option) {
|
20287 | var _this2 = this;
|
20288 |
|
20289 | if (authInfo === undefined) {
|
20290 | var getAuthInfo = getAdapter('getAuthInfo');
|
20291 | return getAuthInfo().then(function (authInfo) {
|
20292 | return _this2._linkWith(authInfo.provider, authInfo.authData, option);
|
20293 | });
|
20294 | }
|
20295 |
|
20296 | return this._linkWith(authInfo.provider, authInfo.authData, option);
|
20297 | },
|
20298 |
|
20299 | |
20300 |
|
20301 |
|
20302 |
|
20303 |
|
20304 |
|
20305 |
|
20306 |
|
20307 |
|
20308 |
|
20309 |
|
20310 |
|
20311 | associateWithQQApp: function associateWithQQApp() {
|
20312 | var _this3 = this;
|
20313 |
|
20314 | var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20315 | _ref3$preferUnionId = _ref3.preferUnionId,
|
20316 | preferUnionId = _ref3$preferUnionId === void 0 ? false : _ref3$preferUnionId,
|
20317 | _ref3$unionIdPlatform = _ref3.unionIdPlatform,
|
20318 | unionIdPlatform = _ref3$unionIdPlatform === void 0 ? 'qq' : _ref3$unionIdPlatform,
|
20319 | _ref3$asMainAccount = _ref3.asMainAccount,
|
20320 | asMainAccount = _ref3$asMainAccount === void 0 ? true : _ref3$asMainAccount;
|
20321 |
|
20322 | var getAuthInfo = getAdapter('getAuthInfo');
|
20323 | return getAuthInfo({
|
20324 | preferUnionId: preferUnionId,
|
20325 | asMainAccount: asMainAccount,
|
20326 | platform: unionIdPlatform
|
20327 | }).then(function (authInfo) {
|
20328 | authInfo.provider = PLATFORM_QQAPP;
|
20329 | return _this3.associateWithMiniApp(authInfo);
|
20330 | });
|
20331 | },
|
20332 |
|
20333 | |
20334 |
|
20335 |
|
20336 |
|
20337 |
|
20338 |
|
20339 |
|
20340 |
|
20341 |
|
20342 |
|
20343 |
|
20344 |
|
20345 | associateWithWeapp: function associateWithWeapp() {
|
20346 | var _this4 = this;
|
20347 |
|
20348 | var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20349 | _ref4$preferUnionId = _ref4.preferUnionId,
|
20350 | preferUnionId = _ref4$preferUnionId === void 0 ? false : _ref4$preferUnionId,
|
20351 | _ref4$unionIdPlatform = _ref4.unionIdPlatform,
|
20352 | unionIdPlatform = _ref4$unionIdPlatform === void 0 ? 'weixin' : _ref4$unionIdPlatform,
|
20353 | _ref4$asMainAccount = _ref4.asMainAccount,
|
20354 | asMainAccount = _ref4$asMainAccount === void 0 ? true : _ref4$asMainAccount;
|
20355 |
|
20356 | var getAuthInfo = getAdapter('getAuthInfo');
|
20357 | return getAuthInfo({
|
20358 | preferUnionId: preferUnionId,
|
20359 | asMainAccount: asMainAccount,
|
20360 | platform: unionIdPlatform
|
20361 | }).then(function (authInfo) {
|
20362 | return _this4.associateWithMiniApp(authInfo);
|
20363 | });
|
20364 | },
|
20365 |
|
20366 | |
20367 |
|
20368 |
|
20369 |
|
20370 | linkWithWeapp: function linkWithWeapp(options) {
|
20371 | console.warn('DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替');
|
20372 | return this.associateWithWeapp(options);
|
20373 | },
|
20374 |
|
20375 | |
20376 |
|
20377 |
|
20378 |
|
20379 |
|
20380 |
|
20381 |
|
20382 |
|
20383 |
|
20384 |
|
20385 |
|
20386 |
|
20387 | associateWithQQAppWithUnionId: function associateWithQQAppWithUnionId(unionId) {
|
20388 | var _this5 = this;
|
20389 |
|
20390 | var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20391 | _ref5$unionIdPlatform = _ref5.unionIdPlatform,
|
20392 | unionIdPlatform = _ref5$unionIdPlatform === void 0 ? 'qq' : _ref5$unionIdPlatform,
|
20393 | _ref5$asMainAccount = _ref5.asMainAccount,
|
20394 | asMainAccount = _ref5$asMainAccount === void 0 ? false : _ref5$asMainAccount;
|
20395 |
|
20396 | var getAuthInfo = getAdapter('getAuthInfo');
|
20397 | return getAuthInfo({
|
20398 | platform: unionIdPlatform
|
20399 | }).then(function (authInfo) {
|
20400 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20401 | asMainAccount: asMainAccount
|
20402 | });
|
20403 | authInfo.provider = PLATFORM_QQAPP;
|
20404 | return _this5.associateWithMiniApp(authInfo);
|
20405 | });
|
20406 | },
|
20407 |
|
20408 | |
20409 |
|
20410 |
|
20411 |
|
20412 |
|
20413 |
|
20414 |
|
20415 |
|
20416 |
|
20417 |
|
20418 |
|
20419 |
|
20420 | associateWithWeappWithUnionId: function associateWithWeappWithUnionId(unionId) {
|
20421 | var _this6 = this;
|
20422 |
|
20423 | var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20424 | _ref6$unionIdPlatform = _ref6.unionIdPlatform,
|
20425 | unionIdPlatform = _ref6$unionIdPlatform === void 0 ? 'weixin' : _ref6$unionIdPlatform,
|
20426 | _ref6$asMainAccount = _ref6.asMainAccount,
|
20427 | asMainAccount = _ref6$asMainAccount === void 0 ? false : _ref6$asMainAccount;
|
20428 |
|
20429 | var getAuthInfo = getAdapter('getAuthInfo');
|
20430 | return getAuthInfo({
|
20431 | platform: unionIdPlatform
|
20432 | }).then(function (authInfo) {
|
20433 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20434 | asMainAccount: asMainAccount
|
20435 | });
|
20436 | return _this6.associateWithMiniApp(authInfo);
|
20437 | });
|
20438 | },
|
20439 |
|
20440 | |
20441 |
|
20442 |
|
20443 |
|
20444 |
|
20445 |
|
20446 | dissociateAuthData: function dissociateAuthData(provider) {
|
20447 | this.unset("authData.".concat(provider));
|
20448 | return this.save().then(function (model) {
|
20449 | return model._handleSaveResult(true).then(function () {
|
20450 | return model;
|
20451 | });
|
20452 | });
|
20453 | },
|
20454 |
|
20455 | |
20456 |
|
20457 |
|
20458 |
|
20459 | _unlinkFrom: function _unlinkFrom(provider) {
|
20460 | console.warn('DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替');
|
20461 | return this.dissociateAuthData(provider);
|
20462 | },
|
20463 |
|
20464 | |
20465 |
|
20466 |
|
20467 |
|
20468 | _isLinked: function _isLinked(provider) {
|
20469 | var authType;
|
20470 |
|
20471 | if (_.isString(provider)) {
|
20472 | authType = provider;
|
20473 | } else {
|
20474 | authType = provider.getAuthType();
|
20475 | }
|
20476 |
|
20477 | var authData = this.get('authData') || {};
|
20478 | return !!authData[authType];
|
20479 | },
|
20480 |
|
20481 | |
20482 |
|
20483 |
|
20484 |
|
20485 |
|
20486 | isAnonymous: function isAnonymous() {
|
20487 | return this._isLinked(PLATFORM_ANONYMOUS);
|
20488 | },
|
20489 | logOut: function logOut() {
|
20490 | this._logOutWithAll();
|
20491 |
|
20492 | this._isCurrentUser = false;
|
20493 | },
|
20494 |
|
20495 | |
20496 |
|
20497 |
|
20498 |
|
20499 | _logOutWithAll: function _logOutWithAll() {
|
20500 | var authData = this.get('authData');
|
20501 |
|
20502 | if (!authData) {
|
20503 | return;
|
20504 | }
|
20505 |
|
20506 | var self = this;
|
20507 |
|
20508 | AV._objectEach(this.get('authData'), function (value, key) {
|
20509 | self._logOutWith(key);
|
20510 | });
|
20511 | },
|
20512 |
|
20513 | |
20514 |
|
20515 |
|
20516 |
|
20517 |
|
20518 | _logOutWith: function _logOutWith(provider) {
|
20519 | if (!this.isCurrent()) {
|
20520 | return;
|
20521 | }
|
20522 |
|
20523 | if (_.isString(provider)) {
|
20524 | provider = AV.User._authProviders[provider];
|
20525 | }
|
20526 |
|
20527 | if (provider && provider.deauthenticate) {
|
20528 | provider.deauthenticate();
|
20529 | }
|
20530 | },
|
20531 |
|
20532 | |
20533 |
|
20534 |
|
20535 |
|
20536 |
|
20537 |
|
20538 |
|
20539 |
|
20540 |
|
20541 |
|
20542 |
|
20543 |
|
20544 |
|
20545 |
|
20546 | signUp: function signUp(attrs, options) {
|
20547 | var error;
|
20548 | var username = attrs && attrs.username || this.get('username');
|
20549 |
|
20550 | if (!username || username === '') {
|
20551 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty name.');
|
20552 | throw error;
|
20553 | }
|
20554 |
|
20555 | var password = attrs && attrs.password || this.get('password');
|
20556 |
|
20557 | if (!password || password === '') {
|
20558 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty password.');
|
20559 | throw error;
|
20560 | }
|
20561 |
|
20562 | return this.save(attrs, options).then(function (model) {
|
20563 | if (model.isAnonymous()) {
|
20564 | model.unset("authData.".concat(PLATFORM_ANONYMOUS));
|
20565 | model._opSetQueue = [{}];
|
20566 | }
|
20567 |
|
20568 | return model._handleSaveResult(true).then(function () {
|
20569 | return model;
|
20570 | });
|
20571 | });
|
20572 | },
|
20573 |
|
20574 | |
20575 |
|
20576 |
|
20577 |
|
20578 |
|
20579 |
|
20580 |
|
20581 |
|
20582 |
|
20583 |
|
20584 |
|
20585 |
|
20586 |
|
20587 |
|
20588 |
|
20589 |
|
20590 | signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(attrs) {
|
20591 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
20592 | var error;
|
20593 | var mobilePhoneNumber = attrs && attrs.mobilePhoneNumber || this.get('mobilePhoneNumber');
|
20594 |
|
20595 | if (!mobilePhoneNumber || mobilePhoneNumber === '') {
|
20596 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty mobilePhoneNumber.');
|
20597 | throw error;
|
20598 | }
|
20599 |
|
20600 | var smsCode = attrs && attrs.smsCode || this.get('smsCode');
|
20601 |
|
20602 | if (!smsCode || smsCode === '') {
|
20603 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty smsCode.');
|
20604 | throw error;
|
20605 | }
|
20606 |
|
20607 | options._makeRequest = function (route, className, id, method, json) {
|
20608 | return AVRequest('usersByMobilePhone', null, null, 'POST', json);
|
20609 | };
|
20610 |
|
20611 | return this.save(attrs, options).then(function (model) {
|
20612 | delete model.attributes.smsCode;
|
20613 | delete model._serverData.smsCode;
|
20614 | return model._handleSaveResult(true).then(function () {
|
20615 | return model;
|
20616 | });
|
20617 | });
|
20618 | },
|
20619 |
|
20620 | |
20621 |
|
20622 |
|
20623 |
|
20624 | loginWithAuthData: function loginWithAuthData(authData, platform, options) {
|
20625 | return this._linkWith(platform, authData, options);
|
20626 | },
|
20627 |
|
20628 | |
20629 |
|
20630 |
|
20631 |
|
20632 | loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
|
20633 | return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
|
20634 | },
|
20635 |
|
20636 | |
20637 |
|
20638 |
|
20639 |
|
20640 |
|
20641 |
|
20642 |
|
20643 |
|
20644 |
|
20645 |
|
20646 |
|
20647 | loginWithWeapp: function loginWithWeapp() {
|
20648 | var _this7 = this;
|
20649 |
|
20650 | var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20651 | _ref7$preferUnionId = _ref7.preferUnionId,
|
20652 | preferUnionId = _ref7$preferUnionId === void 0 ? false : _ref7$preferUnionId,
|
20653 | _ref7$unionIdPlatform = _ref7.unionIdPlatform,
|
20654 | unionIdPlatform = _ref7$unionIdPlatform === void 0 ? 'weixin' : _ref7$unionIdPlatform,
|
20655 | _ref7$asMainAccount = _ref7.asMainAccount,
|
20656 | asMainAccount = _ref7$asMainAccount === void 0 ? true : _ref7$asMainAccount,
|
20657 | _ref7$failOnNotExist = _ref7.failOnNotExist,
|
20658 | failOnNotExist = _ref7$failOnNotExist === void 0 ? false : _ref7$failOnNotExist,
|
20659 | useMasterKey = _ref7.useMasterKey,
|
20660 | sessionToken = _ref7.sessionToken,
|
20661 | user = _ref7.user;
|
20662 |
|
20663 | var getAuthInfo = getAdapter('getAuthInfo');
|
20664 | return getAuthInfo({
|
20665 | preferUnionId: preferUnionId,
|
20666 | asMainAccount: asMainAccount,
|
20667 | platform: unionIdPlatform
|
20668 | }).then(function (authInfo) {
|
20669 | return _this7.loginWithMiniApp(authInfo, {
|
20670 | failOnNotExist: failOnNotExist,
|
20671 | useMasterKey: useMasterKey,
|
20672 | sessionToken: sessionToken,
|
20673 | user: user
|
20674 | });
|
20675 | });
|
20676 | },
|
20677 |
|
20678 | |
20679 |
|
20680 |
|
20681 |
|
20682 |
|
20683 | loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
|
20684 | var _this8 = this;
|
20685 |
|
20686 | var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20687 | _ref8$unionIdPlatform = _ref8.unionIdPlatform,
|
20688 | unionIdPlatform = _ref8$unionIdPlatform === void 0 ? 'weixin' : _ref8$unionIdPlatform,
|
20689 | _ref8$asMainAccount = _ref8.asMainAccount,
|
20690 | asMainAccount = _ref8$asMainAccount === void 0 ? false : _ref8$asMainAccount,
|
20691 | _ref8$failOnNotExist = _ref8.failOnNotExist,
|
20692 | failOnNotExist = _ref8$failOnNotExist === void 0 ? false : _ref8$failOnNotExist,
|
20693 | useMasterKey = _ref8.useMasterKey,
|
20694 | sessionToken = _ref8.sessionToken,
|
20695 | user = _ref8.user;
|
20696 |
|
20697 | var getAuthInfo = getAdapter('getAuthInfo');
|
20698 | return getAuthInfo({
|
20699 | platform: unionIdPlatform
|
20700 | }).then(function (authInfo) {
|
20701 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20702 | asMainAccount: asMainAccount
|
20703 | });
|
20704 | return _this8.loginWithMiniApp(authInfo, {
|
20705 | failOnNotExist: failOnNotExist,
|
20706 | useMasterKey: useMasterKey,
|
20707 | sessionToken: sessionToken,
|
20708 | user: user
|
20709 | });
|
20710 | });
|
20711 | },
|
20712 |
|
20713 | |
20714 |
|
20715 |
|
20716 |
|
20717 |
|
20718 |
|
20719 |
|
20720 |
|
20721 |
|
20722 |
|
20723 | loginWithQQApp: function loginWithQQApp() {
|
20724 | var _this9 = this;
|
20725 |
|
20726 | var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20727 | _ref9$preferUnionId = _ref9.preferUnionId,
|
20728 | preferUnionId = _ref9$preferUnionId === void 0 ? false : _ref9$preferUnionId,
|
20729 | _ref9$unionIdPlatform = _ref9.unionIdPlatform,
|
20730 | unionIdPlatform = _ref9$unionIdPlatform === void 0 ? 'qq' : _ref9$unionIdPlatform,
|
20731 | _ref9$asMainAccount = _ref9.asMainAccount,
|
20732 | asMainAccount = _ref9$asMainAccount === void 0 ? true : _ref9$asMainAccount,
|
20733 | _ref9$failOnNotExist = _ref9.failOnNotExist,
|
20734 | failOnNotExist = _ref9$failOnNotExist === void 0 ? false : _ref9$failOnNotExist,
|
20735 | useMasterKey = _ref9.useMasterKey,
|
20736 | sessionToken = _ref9.sessionToken,
|
20737 | user = _ref9.user;
|
20738 |
|
20739 | var getAuthInfo = getAdapter('getAuthInfo');
|
20740 | return getAuthInfo({
|
20741 | preferUnionId: preferUnionId,
|
20742 | asMainAccount: asMainAccount,
|
20743 | platform: unionIdPlatform
|
20744 | }).then(function (authInfo) {
|
20745 | authInfo.provider = PLATFORM_QQAPP;
|
20746 | return _this9.loginWithMiniApp(authInfo, {
|
20747 | failOnNotExist: failOnNotExist,
|
20748 | useMasterKey: useMasterKey,
|
20749 | sessionToken: sessionToken,
|
20750 | user: user
|
20751 | });
|
20752 | });
|
20753 | },
|
20754 |
|
20755 | |
20756 |
|
20757 |
|
20758 |
|
20759 |
|
20760 | loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
|
20761 | var _this10 = this;
|
20762 |
|
20763 | var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20764 | _ref10$unionIdPlatfor = _ref10.unionIdPlatform,
|
20765 | unionIdPlatform = _ref10$unionIdPlatfor === void 0 ? 'qq' : _ref10$unionIdPlatfor,
|
20766 | _ref10$asMainAccount = _ref10.asMainAccount,
|
20767 | asMainAccount = _ref10$asMainAccount === void 0 ? false : _ref10$asMainAccount,
|
20768 | _ref10$failOnNotExist = _ref10.failOnNotExist,
|
20769 | failOnNotExist = _ref10$failOnNotExist === void 0 ? false : _ref10$failOnNotExist,
|
20770 | useMasterKey = _ref10.useMasterKey,
|
20771 | sessionToken = _ref10.sessionToken,
|
20772 | user = _ref10.user;
|
20773 |
|
20774 | var getAuthInfo = getAdapter('getAuthInfo');
|
20775 | return getAuthInfo({
|
20776 | platform: unionIdPlatform
|
20777 | }).then(function (authInfo) {
|
20778 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20779 | asMainAccount: asMainAccount
|
20780 | });
|
20781 | authInfo.provider = PLATFORM_QQAPP;
|
20782 | return _this10.loginWithMiniApp(authInfo, {
|
20783 | failOnNotExist: failOnNotExist,
|
20784 | useMasterKey: useMasterKey,
|
20785 | sessionToken: sessionToken,
|
20786 | user: user
|
20787 | });
|
20788 | });
|
20789 | },
|
20790 |
|
20791 | |
20792 |
|
20793 |
|
20794 |
|
20795 | loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
|
20796 | var _this11 = this;
|
20797 |
|
20798 | if (authInfo === undefined) {
|
20799 | var getAuthInfo = getAdapter('getAuthInfo');
|
20800 | return getAuthInfo().then(function (authInfo) {
|
20801 | return _this11.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
20802 | });
|
20803 | }
|
20804 |
|
20805 | return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
20806 | },
|
20807 |
|
20808 | |
20809 |
|
20810 |
|
20811 |
|
20812 |
|
20813 |
|
20814 |
|
20815 |
|
20816 |
|
20817 |
|
20818 |
|
20819 | logIn: function logIn() {
|
20820 | var model = this;
|
20821 | var request = AVRequest('login', null, null, 'POST', this.toJSON());
|
20822 | return request.then(function (resp) {
|
20823 | var serverAttrs = model.parse(resp);
|
20824 |
|
20825 | model._finishFetch(serverAttrs);
|
20826 |
|
20827 | return model._handleSaveResult(true).then(function () {
|
20828 | if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
|
20829 | return model;
|
20830 | });
|
20831 | });
|
20832 | },
|
20833 |
|
20834 | |
20835 |
|
20836 |
|
20837 | save: function save(arg1, arg2, arg3) {
|
20838 | var attrs, options;
|
20839 |
|
20840 | if (_.isObject(arg1) || _.isNull(arg1) || _.isUndefined(arg1)) {
|
20841 | attrs = arg1;
|
20842 | options = arg2;
|
20843 | } else {
|
20844 | attrs = {};
|
20845 | attrs[arg1] = arg2;
|
20846 | options = arg3;
|
20847 | }
|
20848 |
|
20849 | options = options || {};
|
20850 | return AV.Object.prototype.save.call(this, attrs, options).then(function (model) {
|
20851 | return model._handleSaveResult(false).then(function () {
|
20852 | return model;
|
20853 | });
|
20854 | });
|
20855 | },
|
20856 |
|
20857 | |
20858 |
|
20859 |
|
20860 |
|
20861 |
|
20862 |
|
20863 |
|
20864 |
|
20865 |
|
20866 | follow: function follow(options, authOptions) {
|
20867 | if (!this.id) {
|
20868 | throw new Error('Please signin.');
|
20869 | }
|
20870 |
|
20871 | var user;
|
20872 | var attributes;
|
20873 |
|
20874 | if (options.user) {
|
20875 | user = options.user;
|
20876 | attributes = options.attributes;
|
20877 | } else {
|
20878 | user = options;
|
20879 | }
|
20880 |
|
20881 | var userObjectId = _.isString(user) ? user : user.id;
|
20882 |
|
20883 | if (!userObjectId) {
|
20884 | throw new Error('Invalid target user.');
|
20885 | }
|
20886 |
|
20887 | var route = 'users/' + this.id + '/friendship/' + userObjectId;
|
20888 | var request = AVRequest(route, null, null, 'POST', AV._encode(attributes), authOptions);
|
20889 | return request;
|
20890 | },
|
20891 |
|
20892 | |
20893 |
|
20894 |
|
20895 |
|
20896 |
|
20897 |
|
20898 |
|
20899 | unfollow: function unfollow(options, authOptions) {
|
20900 | if (!this.id) {
|
20901 | throw new Error('Please signin.');
|
20902 | }
|
20903 |
|
20904 | var user;
|
20905 |
|
20906 | if (options.user) {
|
20907 | user = options.user;
|
20908 | } else {
|
20909 | user = options;
|
20910 | }
|
20911 |
|
20912 | var userObjectId = _.isString(user) ? user : user.id;
|
20913 |
|
20914 | if (!userObjectId) {
|
20915 | throw new Error('Invalid target user.');
|
20916 | }
|
20917 |
|
20918 | var route = 'users/' + this.id + '/friendship/' + userObjectId;
|
20919 | var request = AVRequest(route, null, null, 'DELETE', null, authOptions);
|
20920 | return request;
|
20921 | },
|
20922 |
|
20923 | |
20924 |
|
20925 |
|
20926 |
|
20927 |
|
20928 |
|
20929 |
|
20930 |
|
20931 | getFollowersAndFollowees: function getFollowersAndFollowees(options, authOptions) {
|
20932 | if (!this.id) {
|
20933 | throw new Error('Please signin.');
|
20934 | }
|
20935 |
|
20936 | return request({
|
20937 | method: 'GET',
|
20938 | path: "/users/".concat(this.id, "/followersAndFollowees"),
|
20939 | query: {
|
20940 | skip: options && options.skip,
|
20941 | limit: options && options.limit,
|
20942 | include: 'follower,followee',
|
20943 | keys: 'follower,followee'
|
20944 | },
|
20945 | authOptions: authOptions
|
20946 | }).then(function (_ref11) {
|
20947 | var followers = _ref11.followers,
|
20948 | followees = _ref11.followees;
|
20949 | return {
|
20950 | followers: (0, _map.default)(followers).call(followers, function (_ref12) {
|
20951 | var follower = _ref12.follower;
|
20952 | return AV._decode(follower);
|
20953 | }),
|
20954 | followees: (0, _map.default)(followees).call(followees, function (_ref13) {
|
20955 | var followee = _ref13.followee;
|
20956 | return AV._decode(followee);
|
20957 | })
|
20958 | };
|
20959 | });
|
20960 | },
|
20961 |
|
20962 | |
20963 |
|
20964 |
|
20965 |
|
20966 |
|
20967 | followerQuery: function followerQuery() {
|
20968 | return AV.User.followerQuery(this.id);
|
20969 | },
|
20970 |
|
20971 | |
20972 |
|
20973 |
|
20974 |
|
20975 |
|
20976 | followeeQuery: function followeeQuery() {
|
20977 | return AV.User.followeeQuery(this.id);
|
20978 | },
|
20979 |
|
20980 | |
20981 |
|
20982 |
|
20983 | fetch: function fetch(fetchOptions, options) {
|
20984 | return AV.Object.prototype.fetch.call(this, fetchOptions, options).then(function (model) {
|
20985 | return model._handleSaveResult(false).then(function () {
|
20986 | return model;
|
20987 | });
|
20988 | });
|
20989 | },
|
20990 |
|
20991 | |
20992 |
|
20993 |
|
20994 |
|
20995 |
|
20996 |
|
20997 | updatePassword: function updatePassword(oldPassword, newPassword, options) {
|
20998 | var _this12 = this;
|
20999 |
|
21000 | var route = 'users/' + this.id + '/updatePassword';
|
21001 | var params = {
|
21002 | old_password: oldPassword,
|
21003 | new_password: newPassword
|
21004 | };
|
21005 | var request = AVRequest(route, null, null, 'PUT', params, options);
|
21006 | return request.then(function (resp) {
|
21007 | _this12._finishFetch(_this12.parse(resp));
|
21008 |
|
21009 | return _this12._handleSaveResult(true).then(function () {
|
21010 | return resp;
|
21011 | });
|
21012 | });
|
21013 | },
|
21014 |
|
21015 | |
21016 |
|
21017 |
|
21018 |
|
21019 | isCurrent: function isCurrent() {
|
21020 | return this._isCurrentUser;
|
21021 | },
|
21022 |
|
21023 | |
21024 |
|
21025 |
|
21026 |
|
21027 |
|
21028 | getUsername: function getUsername() {
|
21029 | return this.get('username');
|
21030 | },
|
21031 |
|
21032 | |
21033 |
|
21034 |
|
21035 |
|
21036 |
|
21037 | getMobilePhoneNumber: function getMobilePhoneNumber() {
|
21038 | return this.get('mobilePhoneNumber');
|
21039 | },
|
21040 |
|
21041 | |
21042 |
|
21043 |
|
21044 |
|
21045 |
|
21046 |
|
21047 | setMobilePhoneNumber: function setMobilePhoneNumber(phone, options) {
|
21048 | return this.set('mobilePhoneNumber', phone, options);
|
21049 | },
|
21050 |
|
21051 | |
21052 |
|
21053 |
|
21054 |
|
21055 |
|
21056 |
|
21057 | setUsername: function setUsername(username, options) {
|
21058 | return this.set('username', username, options);
|
21059 | },
|
21060 |
|
21061 | |
21062 |
|
21063 |
|
21064 |
|
21065 |
|
21066 |
|
21067 | setPassword: function setPassword(password, options) {
|
21068 | return this.set('password', password, options);
|
21069 | },
|
21070 |
|
21071 | |
21072 |
|
21073 |
|
21074 |
|
21075 |
|
21076 | getEmail: function getEmail() {
|
21077 | return this.get('email');
|
21078 | },
|
21079 |
|
21080 | |
21081 |
|
21082 |
|
21083 |
|
21084 |
|
21085 |
|
21086 |
|
21087 | setEmail: function setEmail(email, options) {
|
21088 | return this.set('email', email, options);
|
21089 | },
|
21090 |
|
21091 | |
21092 |
|
21093 |
|
21094 |
|
21095 |
|
21096 |
|
21097 | authenticated: function authenticated() {
|
21098 | console.warn('DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。');
|
21099 | return !!this._sessionToken && !AV._config.disableCurrentUser && AV.User.current() && AV.User.current().id === this.id;
|
21100 | },
|
21101 |
|
21102 | |
21103 |
|
21104 |
|
21105 |
|
21106 |
|
21107 |
|
21108 | isAuthenticated: function isAuthenticated() {
|
21109 | var _this13 = this;
|
21110 |
|
21111 | return _promise.default.resolve().then(function () {
|
21112 | return !!_this13._sessionToken && AV.User._fetchUserBySessionToken(_this13._sessionToken).then(function () {
|
21113 | return true;
|
21114 | }, function (error) {
|
21115 | if (error.code === 211) {
|
21116 | return false;
|
21117 | }
|
21118 |
|
21119 | throw error;
|
21120 | });
|
21121 | });
|
21122 | },
|
21123 |
|
21124 | |
21125 |
|
21126 |
|
21127 |
|
21128 | getSessionToken: function getSessionToken() {
|
21129 | return this._sessionToken;
|
21130 | },
|
21131 |
|
21132 | |
21133 |
|
21134 |
|
21135 |
|
21136 |
|
21137 |
|
21138 | refreshSessionToken: function refreshSessionToken(options) {
|
21139 | var _this14 = this;
|
21140 |
|
21141 | return AVRequest("users/".concat(this.id, "/refreshSessionToken"), null, null, 'PUT', null, options).then(function (response) {
|
21142 | _this14._finishFetch(response);
|
21143 |
|
21144 | return _this14._handleSaveResult(true).then(function () {
|
21145 | return _this14;
|
21146 | });
|
21147 | });
|
21148 | },
|
21149 |
|
21150 | |
21151 |
|
21152 |
|
21153 |
|
21154 |
|
21155 |
|
21156 | getRoles: function getRoles(options) {
|
21157 | var _context;
|
21158 |
|
21159 | return (0, _find.default)(_context = AV.Relation.reverseQuery('_Role', 'users', this)).call(_context, options);
|
21160 | }
|
21161 | },
|
21162 |
|
21163 | {
|
21164 |
|
21165 |
|
21166 | _currentUser: null,
|
21167 |
|
21168 |
|
21169 |
|
21170 | _currentUserMatchesDisk: false,
|
21171 |
|
21172 | _CURRENT_USER_KEY: 'currentUser',
|
21173 |
|
21174 | _authProviders: {},
|
21175 |
|
21176 |
|
21177 | |
21178 |
|
21179 |
|
21180 |
|
21181 |
|
21182 |
|
21183 |
|
21184 |
|
21185 |
|
21186 |
|
21187 |
|
21188 |
|
21189 |
|
21190 |
|
21191 | signUp: function signUp(username, password, attrs, options) {
|
21192 | attrs = attrs || {};
|
21193 | attrs.username = username;
|
21194 | attrs.password = password;
|
21195 |
|
21196 | var user = AV.Object._create('_User');
|
21197 |
|
21198 | return user.signUp(attrs, options);
|
21199 | },
|
21200 |
|
21201 | |
21202 |
|
21203 |
|
21204 |
|
21205 |
|
21206 |
|
21207 |
|
21208 |
|
21209 |
|
21210 |
|
21211 |
|
21212 | logIn: function logIn(username, password) {
|
21213 | var user = AV.Object._create('_User');
|
21214 |
|
21215 | user._finishFetch({
|
21216 | username: username,
|
21217 | password: password
|
21218 | });
|
21219 |
|
21220 | return user.logIn();
|
21221 | },
|
21222 |
|
21223 | |
21224 |
|
21225 |
|
21226 |
|
21227 |
|
21228 |
|
21229 |
|
21230 |
|
21231 |
|
21232 | become: function become(sessionToken) {
|
21233 | return this._fetchUserBySessionToken(sessionToken).then(function (user) {
|
21234 | return user._handleSaveResult(true).then(function () {
|
21235 | return user;
|
21236 | });
|
21237 | });
|
21238 | },
|
21239 | _fetchUserBySessionToken: function _fetchUserBySessionToken(sessionToken) {
|
21240 | if (sessionToken === undefined) {
|
21241 | return _promise.default.reject(new Error('The sessionToken cannot be undefined'));
|
21242 | }
|
21243 |
|
21244 | var user = AV.Object._create('_User');
|
21245 |
|
21246 | return request({
|
21247 | method: 'GET',
|
21248 | path: '/users/me',
|
21249 | authOptions: {
|
21250 | sessionToken: sessionToken
|
21251 | }
|
21252 | }).then(function (resp) {
|
21253 | var serverAttrs = user.parse(resp);
|
21254 |
|
21255 | user._finishFetch(serverAttrs);
|
21256 |
|
21257 | return user;
|
21258 | });
|
21259 | },
|
21260 |
|
21261 | |
21262 |
|
21263 |
|
21264 |
|
21265 |
|
21266 |
|
21267 |
|
21268 |
|
21269 |
|
21270 |
|
21271 |
|
21272 |
|
21273 | logInWithMobilePhoneSmsCode: function logInWithMobilePhoneSmsCode(mobilePhone, smsCode) {
|
21274 | var user = AV.Object._create('_User');
|
21275 |
|
21276 | user._finishFetch({
|
21277 | mobilePhoneNumber: mobilePhone,
|
21278 | smsCode: smsCode
|
21279 | });
|
21280 |
|
21281 | return user.logIn();
|
21282 | },
|
21283 |
|
21284 | |
21285 |
|
21286 |
|
21287 |
|
21288 |
|
21289 |
|
21290 |
|
21291 |
|
21292 |
|
21293 |
|
21294 |
|
21295 |
|
21296 |
|
21297 |
|
21298 | signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attrs, options) {
|
21299 | attrs = attrs || {};
|
21300 | attrs.mobilePhoneNumber = mobilePhoneNumber;
|
21301 | attrs.smsCode = smsCode;
|
21302 |
|
21303 | var user = AV.Object._create('_User');
|
21304 |
|
21305 | return user.signUpOrlogInWithMobilePhone(attrs, options);
|
21306 | },
|
21307 |
|
21308 | |
21309 |
|
21310 |
|
21311 |
|
21312 |
|
21313 |
|
21314 |
|
21315 |
|
21316 |
|
21317 |
|
21318 |
|
21319 | logInWithMobilePhone: function logInWithMobilePhone(mobilePhone, password) {
|
21320 | var user = AV.Object._create('_User');
|
21321 |
|
21322 | user._finishFetch({
|
21323 | mobilePhoneNumber: mobilePhone,
|
21324 | password: password
|
21325 | });
|
21326 |
|
21327 | return user.logIn();
|
21328 | },
|
21329 |
|
21330 | |
21331 |
|
21332 |
|
21333 |
|
21334 |
|
21335 |
|
21336 |
|
21337 |
|
21338 |
|
21339 | loginWithEmail: function loginWithEmail(email, password) {
|
21340 | var user = AV.Object._create('_User');
|
21341 |
|
21342 | user._finishFetch({
|
21343 | email: email,
|
21344 | password: password
|
21345 | });
|
21346 |
|
21347 | return user.logIn();
|
21348 | },
|
21349 |
|
21350 | |
21351 |
|
21352 |
|
21353 |
|
21354 |
|
21355 |
|
21356 |
|
21357 |
|
21358 |
|
21359 |
|
21360 |
|
21361 |
|
21362 |
|
21363 |
|
21364 |
|
21365 |
|
21366 |
|
21367 |
|
21368 |
|
21369 |
|
21370 |
|
21371 |
|
21372 |
|
21373 | loginWithAuthData: function loginWithAuthData(authData, platform, options) {
|
21374 | return AV.User._logInWith(platform, authData, options);
|
21375 | },
|
21376 |
|
21377 | |
21378 |
|
21379 |
|
21380 | signUpOrlogInWithAuthData: function signUpOrlogInWithAuthData() {
|
21381 | console.warn('DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替');
|
21382 | return this.loginWithAuthData.apply(this, arguments);
|
21383 | },
|
21384 |
|
21385 | |
21386 |
|
21387 |
|
21388 |
|
21389 |
|
21390 |
|
21391 |
|
21392 |
|
21393 |
|
21394 |
|
21395 |
|
21396 |
|
21397 |
|
21398 |
|
21399 |
|
21400 |
|
21401 |
|
21402 |
|
21403 |
|
21404 |
|
21405 |
|
21406 |
|
21407 |
|
21408 |
|
21409 | loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
|
21410 | return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
|
21411 | },
|
21412 |
|
21413 | |
21414 |
|
21415 |
|
21416 |
|
21417 | signUpOrlogInWithAuthDataAndUnionId: function signUpOrlogInWithAuthDataAndUnionId() {
|
21418 | console.warn('DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替');
|
21419 | return this.loginWithAuthDataAndUnionId.apply(this, arguments);
|
21420 | },
|
21421 |
|
21422 | |
21423 |
|
21424 |
|
21425 |
|
21426 |
|
21427 |
|
21428 |
|
21429 |
|
21430 | mergeUnionId: function mergeUnionId(authInfo, unionId) {
|
21431 | var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
21432 | _ref14$asMainAccount = _ref14.asMainAccount,
|
21433 | asMainAccount = _ref14$asMainAccount === void 0 ? false : _ref14$asMainAccount;
|
21434 |
|
21435 | authInfo = JSON.parse((0, _stringify.default)(authInfo));
|
21436 | var _authInfo = authInfo,
|
21437 | authData = _authInfo.authData,
|
21438 | platform = _authInfo.platform;
|
21439 | authData.platform = platform;
|
21440 | authData.main_account = asMainAccount;
|
21441 | authData.unionid = unionId;
|
21442 | return authInfo;
|
21443 | },
|
21444 |
|
21445 | |
21446 |
|
21447 |
|
21448 |
|
21449 |
|
21450 |
|
21451 |
|
21452 |
|
21453 |
|
21454 |
|
21455 |
|
21456 |
|
21457 |
|
21458 | loginWithWeapp: function loginWithWeapp() {
|
21459 | var _this15 = this;
|
21460 |
|
21461 | var _ref15 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
21462 | _ref15$preferUnionId = _ref15.preferUnionId,
|
21463 | preferUnionId = _ref15$preferUnionId === void 0 ? false : _ref15$preferUnionId,
|
21464 | _ref15$unionIdPlatfor = _ref15.unionIdPlatform,
|
21465 | unionIdPlatform = _ref15$unionIdPlatfor === void 0 ? 'weixin' : _ref15$unionIdPlatfor,
|
21466 | _ref15$asMainAccount = _ref15.asMainAccount,
|
21467 | asMainAccount = _ref15$asMainAccount === void 0 ? true : _ref15$asMainAccount,
|
21468 | _ref15$failOnNotExist = _ref15.failOnNotExist,
|
21469 | failOnNotExist = _ref15$failOnNotExist === void 0 ? false : _ref15$failOnNotExist,
|
21470 | useMasterKey = _ref15.useMasterKey,
|
21471 | sessionToken = _ref15.sessionToken,
|
21472 | user = _ref15.user;
|
21473 |
|
21474 | var getAuthInfo = getAdapter('getAuthInfo');
|
21475 | return getAuthInfo({
|
21476 | preferUnionId: preferUnionId,
|
21477 | asMainAccount: asMainAccount,
|
21478 | platform: unionIdPlatform
|
21479 | }).then(function (authInfo) {
|
21480 | return _this15.loginWithMiniApp(authInfo, {
|
21481 | failOnNotExist: failOnNotExist,
|
21482 | useMasterKey: useMasterKey,
|
21483 | sessionToken: sessionToken,
|
21484 | user: user
|
21485 | });
|
21486 | });
|
21487 | },
|
21488 |
|
21489 | |
21490 |
|
21491 |
|
21492 |
|
21493 |
|
21494 |
|
21495 |
|
21496 |
|
21497 |
|
21498 |
|
21499 |
|
21500 | loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
|
21501 | var _this16 = this;
|
21502 |
|
21503 | var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
21504 | _ref16$unionIdPlatfor = _ref16.unionIdPlatform,
|
21505 | unionIdPlatform = _ref16$unionIdPlatfor === void 0 ? 'weixin' : _ref16$unionIdPlatfor,
|
21506 | _ref16$asMainAccount = _ref16.asMainAccount,
|
21507 | asMainAccount = _ref16$asMainAccount === void 0 ? false : _ref16$asMainAccount,
|
21508 | _ref16$failOnNotExist = _ref16.failOnNotExist,
|
21509 | failOnNotExist = _ref16$failOnNotExist === void 0 ? false : _ref16$failOnNotExist,
|
21510 | useMasterKey = _ref16.useMasterKey,
|
21511 | sessionToken = _ref16.sessionToken,
|
21512 | user = _ref16.user;
|
21513 |
|
21514 | var getAuthInfo = getAdapter('getAuthInfo');
|
21515 | return getAuthInfo({
|
21516 | platform: unionIdPlatform
|
21517 | }).then(function (authInfo) {
|
21518 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
21519 | asMainAccount: asMainAccount
|
21520 | });
|
21521 | return _this16.loginWithMiniApp(authInfo, {
|
21522 | failOnNotExist: failOnNotExist,
|
21523 | useMasterKey: useMasterKey,
|
21524 | sessionToken: sessionToken,
|
21525 | user: user
|
21526 | });
|
21527 | });
|
21528 | },
|
21529 |
|
21530 | |
21531 |
|
21532 |
|
21533 |
|
21534 |
|
21535 |
|
21536 |
|
21537 |
|
21538 |
|
21539 |
|
21540 |
|
21541 |
|
21542 |
|
21543 | loginWithQQApp: function loginWithQQApp() {
|
21544 | var _this17 = this;
|
21545 |
|
21546 | var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
21547 | _ref17$preferUnionId = _ref17.preferUnionId,
|
21548 | preferUnionId = _ref17$preferUnionId === void 0 ? false : _ref17$preferUnionId,
|
21549 | _ref17$unionIdPlatfor = _ref17.unionIdPlatform,
|
21550 | unionIdPlatform = _ref17$unionIdPlatfor === void 0 ? 'qq' : _ref17$unionIdPlatfor,
|
21551 | _ref17$asMainAccount = _ref17.asMainAccount,
|
21552 | asMainAccount = _ref17$asMainAccount === void 0 ? true : _ref17$asMainAccount,
|
21553 | _ref17$failOnNotExist = _ref17.failOnNotExist,
|
21554 | failOnNotExist = _ref17$failOnNotExist === void 0 ? false : _ref17$failOnNotExist,
|
21555 | useMasterKey = _ref17.useMasterKey,
|
21556 | sessionToken = _ref17.sessionToken,
|
21557 | user = _ref17.user;
|
21558 |
|
21559 | var getAuthInfo = getAdapter('getAuthInfo');
|
21560 | return getAuthInfo({
|
21561 | preferUnionId: preferUnionId,
|
21562 | asMainAccount: asMainAccount,
|
21563 | platform: unionIdPlatform
|
21564 | }).then(function (authInfo) {
|
21565 | authInfo.provider = PLATFORM_QQAPP;
|
21566 | return _this17.loginWithMiniApp(authInfo, {
|
21567 | failOnNotExist: failOnNotExist,
|
21568 | useMasterKey: useMasterKey,
|
21569 | sessionToken: sessionToken,
|
21570 | user: user
|
21571 | });
|
21572 | });
|
21573 | },
|
21574 |
|
21575 | |
21576 |
|
21577 |
|
21578 |
|
21579 |
|
21580 |
|
21581 |
|
21582 |
|
21583 |
|
21584 |
|
21585 |
|
21586 |
|
21587 | loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
|
21588 | var _this18 = this;
|
21589 |
|
21590 | var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
21591 | _ref18$unionIdPlatfor = _ref18.unionIdPlatform,
|
21592 | unionIdPlatform = _ref18$unionIdPlatfor === void 0 ? 'qq' : _ref18$unionIdPlatfor,
|
21593 | _ref18$asMainAccount = _ref18.asMainAccount,
|
21594 | asMainAccount = _ref18$asMainAccount === void 0 ? false : _ref18$asMainAccount,
|
21595 | _ref18$failOnNotExist = _ref18.failOnNotExist,
|
21596 | failOnNotExist = _ref18$failOnNotExist === void 0 ? false : _ref18$failOnNotExist,
|
21597 | useMasterKey = _ref18.useMasterKey,
|
21598 | sessionToken = _ref18.sessionToken,
|
21599 | user = _ref18.user;
|
21600 |
|
21601 | var getAuthInfo = getAdapter('getAuthInfo');
|
21602 | return getAuthInfo({
|
21603 | platform: unionIdPlatform
|
21604 | }).then(function (authInfo) {
|
21605 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
21606 | asMainAccount: asMainAccount
|
21607 | });
|
21608 | authInfo.provider = PLATFORM_QQAPP;
|
21609 | return _this18.loginWithMiniApp(authInfo, {
|
21610 | failOnNotExist: failOnNotExist,
|
21611 | useMasterKey: useMasterKey,
|
21612 | sessionToken: sessionToken,
|
21613 | user: user
|
21614 | });
|
21615 | });
|
21616 | },
|
21617 |
|
21618 | |
21619 |
|
21620 |
|
21621 |
|
21622 |
|
21623 |
|
21624 | loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
|
21625 | var _this19 = this;
|
21626 |
|
21627 | if (authInfo === undefined) {
|
21628 | var getAuthInfo = getAdapter('getAuthInfo');
|
21629 | return getAuthInfo().then(function (authInfo) {
|
21630 | return _this19.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
21631 | });
|
21632 | }
|
21633 |
|
21634 | return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
21635 | },
|
21636 |
|
21637 | |
21638 |
|
21639 |
|
21640 | _genId: function _genId() {
|
21641 | return uuid();
|
21642 | },
|
21643 |
|
21644 | |
21645 |
|
21646 |
|
21647 |
|
21648 |
|
21649 |
|
21650 | loginAnonymously: function loginAnonymously() {
|
21651 | return this.loginWithAuthData({
|
21652 | id: AV.User._genId()
|
21653 | }, 'anonymous');
|
21654 | },
|
21655 | associateWithAuthData: function associateWithAuthData(userObj, platform, authData) {
|
21656 | console.warn('DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替');
|
21657 | return userObj._linkWith(platform, authData);
|
21658 | },
|
21659 |
|
21660 | |
21661 |
|
21662 |
|
21663 |
|
21664 |
|
21665 |
|
21666 | logOut: function logOut() {
|
21667 | if (AV._config.disableCurrentUser) {
|
21668 | 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');
|
21669 | return _promise.default.resolve(null);
|
21670 | }
|
21671 |
|
21672 | if (AV.User._currentUser !== null) {
|
21673 | AV.User._currentUser._logOutWithAll();
|
21674 |
|
21675 | AV.User._currentUser._isCurrentUser = false;
|
21676 | }
|
21677 |
|
21678 | AV.User._currentUserMatchesDisk = true;
|
21679 | AV.User._currentUser = null;
|
21680 | return AV.localStorage.removeItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function () {
|
21681 | return AV._refreshSubscriptionId();
|
21682 | });
|
21683 | },
|
21684 |
|
21685 | |
21686 |
|
21687 |
|
21688 |
|
21689 |
|
21690 |
|
21691 | followerQuery: function followerQuery(userObjectId) {
|
21692 | if (!userObjectId || !_.isString(userObjectId)) {
|
21693 | throw new Error('Invalid user object id.');
|
21694 | }
|
21695 |
|
21696 | var query = new AV.FriendShipQuery('_Follower');
|
21697 | query._friendshipTag = 'follower';
|
21698 | query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
|
21699 | return query;
|
21700 | },
|
21701 |
|
21702 | |
21703 |
|
21704 |
|
21705 |
|
21706 |
|
21707 |
|
21708 | followeeQuery: function followeeQuery(userObjectId) {
|
21709 | if (!userObjectId || !_.isString(userObjectId)) {
|
21710 | throw new Error('Invalid user object id.');
|
21711 | }
|
21712 |
|
21713 | var query = new AV.FriendShipQuery('_Followee');
|
21714 | query._friendshipTag = 'followee';
|
21715 | query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
|
21716 | return query;
|
21717 | },
|
21718 |
|
21719 | |
21720 |
|
21721 |
|
21722 |
|
21723 |
|
21724 |
|
21725 |
|
21726 |
|
21727 |
|
21728 | requestPasswordReset: function requestPasswordReset(email) {
|
21729 | var json = {
|
21730 | email: email
|
21731 | };
|
21732 | var request = AVRequest('requestPasswordReset', null, null, 'POST', json);
|
21733 | return request;
|
21734 | },
|
21735 |
|
21736 | |
21737 |
|
21738 |
|
21739 |
|
21740 |
|
21741 |
|
21742 |
|
21743 |
|
21744 |
|
21745 | requestEmailVerify: function requestEmailVerify(email) {
|
21746 | var json = {
|
21747 | email: email
|
21748 | };
|
21749 | var request = AVRequest('requestEmailVerify', null, null, 'POST', json);
|
21750 | return request;
|
21751 | },
|
21752 |
|
21753 | |
21754 |
|
21755 |
|
21756 |
|
21757 |
|
21758 |
|
21759 |
|
21760 |
|
21761 |
|
21762 |
|
21763 | requestMobilePhoneVerify: function requestMobilePhoneVerify(mobilePhoneNumber) {
|
21764 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
21765 | var data = {
|
21766 | mobilePhoneNumber: mobilePhoneNumber
|
21767 | };
|
21768 |
|
21769 | if (options.validateToken) {
|
21770 | data.validate_token = options.validateToken;
|
21771 | }
|
21772 |
|
21773 | var request = AVRequest('requestMobilePhoneVerify', null, null, 'POST', data, options);
|
21774 | return request;
|
21775 | },
|
21776 |
|
21777 | |
21778 |
|
21779 |
|
21780 |
|
21781 |
|
21782 |
|
21783 |
|
21784 |
|
21785 |
|
21786 |
|
21787 | requestPasswordResetBySmsCode: function requestPasswordResetBySmsCode(mobilePhoneNumber) {
|
21788 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
21789 | var data = {
|
21790 | mobilePhoneNumber: mobilePhoneNumber
|
21791 | };
|
21792 |
|
21793 | if (options.validateToken) {
|
21794 | data.validate_token = options.validateToken;
|
21795 | }
|
21796 |
|
21797 | var request = AVRequest('requestPasswordResetBySmsCode', null, null, 'POST', data, options);
|
21798 | return request;
|
21799 | },
|
21800 |
|
21801 | |
21802 |
|
21803 |
|
21804 |
|
21805 |
|
21806 |
|
21807 |
|
21808 |
|
21809 |
|
21810 |
|
21811 | requestChangePhoneNumber: function requestChangePhoneNumber(mobilePhoneNumber, ttl, options) {
|
21812 | var data = {
|
21813 | mobilePhoneNumber: mobilePhoneNumber
|
21814 | };
|
21815 |
|
21816 | if (ttl) {
|
21817 | data.ttl = options.ttl;
|
21818 | }
|
21819 |
|
21820 | if (options && options.validateToken) {
|
21821 | data.validate_token = options.validateToken;
|
21822 | }
|
21823 |
|
21824 | return AVRequest('requestChangePhoneNumber', null, null, 'POST', data, options);
|
21825 | },
|
21826 |
|
21827 | |
21828 |
|
21829 |
|
21830 |
|
21831 |
|
21832 |
|
21833 |
|
21834 |
|
21835 | changePhoneNumber: function changePhoneNumber(mobilePhoneNumber, code) {
|
21836 | var data = {
|
21837 | mobilePhoneNumber: mobilePhoneNumber,
|
21838 | code: code
|
21839 | };
|
21840 | return AVRequest('changePhoneNumber', null, null, 'POST', data);
|
21841 | },
|
21842 |
|
21843 | |
21844 |
|
21845 |
|
21846 |
|
21847 |
|
21848 |
|
21849 |
|
21850 |
|
21851 | resetPasswordBySmsCode: function resetPasswordBySmsCode(code, password) {
|
21852 | var json = {
|
21853 | password: password
|
21854 | };
|
21855 | var request = AVRequest('resetPasswordBySmsCode', null, code, 'PUT', json);
|
21856 | return request;
|
21857 | },
|
21858 |
|
21859 | |
21860 |
|
21861 |
|
21862 |
|
21863 |
|
21864 |
|
21865 |
|
21866 | verifyMobilePhone: function verifyMobilePhone(code) {
|
21867 | var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
|
21868 | return request;
|
21869 | },
|
21870 |
|
21871 | |
21872 |
|
21873 |
|
21874 |
|
21875 |
|
21876 |
|
21877 |
|
21878 |
|
21879 |
|
21880 |
|
21881 | requestLoginSmsCode: function requestLoginSmsCode(mobilePhoneNumber) {
|
21882 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
21883 | var data = {
|
21884 | mobilePhoneNumber: mobilePhoneNumber
|
21885 | };
|
21886 |
|
21887 | if (options.validateToken) {
|
21888 | data.validate_token = options.validateToken;
|
21889 | }
|
21890 |
|
21891 | var request = AVRequest('requestLoginSmsCode', null, null, 'POST', data, options);
|
21892 | return request;
|
21893 | },
|
21894 |
|
21895 | |
21896 |
|
21897 |
|
21898 |
|
21899 |
|
21900 | currentAsync: function currentAsync() {
|
21901 | if (AV._config.disableCurrentUser) {
|
21902 | 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');
|
21903 | return _promise.default.resolve(null);
|
21904 | }
|
21905 |
|
21906 | if (AV.User._currentUser) {
|
21907 | return _promise.default.resolve(AV.User._currentUser);
|
21908 | }
|
21909 |
|
21910 | if (AV.User._currentUserMatchesDisk) {
|
21911 | return _promise.default.resolve(AV.User._currentUser);
|
21912 | }
|
21913 |
|
21914 | return AV.localStorage.getItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function (userData) {
|
21915 | if (!userData) {
|
21916 | return null;
|
21917 | }
|
21918 |
|
21919 |
|
21920 | AV.User._currentUserMatchesDisk = true;
|
21921 | AV.User._currentUser = AV.Object._create('_User');
|
21922 | AV.User._currentUser._isCurrentUser = true;
|
21923 | var json = JSON.parse(userData);
|
21924 | AV.User._currentUser.id = json._id;
|
21925 | delete json._id;
|
21926 | AV.User._currentUser._sessionToken = json._sessionToken;
|
21927 | delete json._sessionToken;
|
21928 |
|
21929 | AV.User._currentUser._finishFetch(json);
|
21930 |
|
21931 |
|
21932 | AV.User._currentUser._synchronizeAllAuthData();
|
21933 |
|
21934 | AV.User._currentUser._refreshCache();
|
21935 |
|
21936 | AV.User._currentUser._opSetQueue = [{}];
|
21937 | return AV.User._currentUser;
|
21938 | });
|
21939 | },
|
21940 |
|
21941 | |
21942 |
|
21943 |
|
21944 |
|
21945 |
|
21946 | current: function current() {
|
21947 | if (AV._config.disableCurrentUser) {
|
21948 | 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');
|
21949 | return null;
|
21950 | }
|
21951 |
|
21952 | if (AV.localStorage.async) {
|
21953 | var error = new Error('Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.');
|
21954 | error.code = 'SYNC_API_NOT_AVAILABLE';
|
21955 | throw error;
|
21956 | }
|
21957 |
|
21958 | if (AV.User._currentUser) {
|
21959 | return AV.User._currentUser;
|
21960 | }
|
21961 |
|
21962 | if (AV.User._currentUserMatchesDisk) {
|
21963 | return AV.User._currentUser;
|
21964 | }
|
21965 |
|
21966 |
|
21967 | AV.User._currentUserMatchesDisk = true;
|
21968 | var userData = AV.localStorage.getItem(AV._getAVPath(AV.User._CURRENT_USER_KEY));
|
21969 |
|
21970 | if (!userData) {
|
21971 | return null;
|
21972 | }
|
21973 |
|
21974 | AV.User._currentUser = AV.Object._create('_User');
|
21975 | AV.User._currentUser._isCurrentUser = true;
|
21976 | var json = JSON.parse(userData);
|
21977 | AV.User._currentUser.id = json._id;
|
21978 | delete json._id;
|
21979 | AV.User._currentUser._sessionToken = json._sessionToken;
|
21980 | delete json._sessionToken;
|
21981 |
|
21982 | AV.User._currentUser._finishFetch(json);
|
21983 |
|
21984 |
|
21985 | AV.User._currentUser._synchronizeAllAuthData();
|
21986 |
|
21987 | AV.User._currentUser._refreshCache();
|
21988 |
|
21989 | AV.User._currentUser._opSetQueue = [{}];
|
21990 | return AV.User._currentUser;
|
21991 | },
|
21992 |
|
21993 | |
21994 |
|
21995 |
|
21996 |
|
21997 | _saveCurrentUser: function _saveCurrentUser(user) {
|
21998 | var promise;
|
21999 |
|
22000 | if (AV.User._currentUser !== user) {
|
22001 | promise = AV.User.logOut();
|
22002 | } else {
|
22003 | promise = _promise.default.resolve();
|
22004 | }
|
22005 |
|
22006 | return promise.then(function () {
|
22007 | user._isCurrentUser = true;
|
22008 | AV.User._currentUser = user;
|
22009 |
|
22010 | var json = user._toFullJSON();
|
22011 |
|
22012 | json._id = user.id;
|
22013 | json._sessionToken = user._sessionToken;
|
22014 | return AV.localStorage.setItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY), (0, _stringify.default)(json)).then(function () {
|
22015 | AV.User._currentUserMatchesDisk = true;
|
22016 | return AV._refreshSubscriptionId();
|
22017 | });
|
22018 | });
|
22019 | },
|
22020 | _registerAuthenticationProvider: function _registerAuthenticationProvider(provider) {
|
22021 | AV.User._authProviders[provider.getAuthType()] = provider;
|
22022 |
|
22023 | if (!AV._config.disableCurrentUser && AV.User.current()) {
|
22024 | AV.User.current()._synchronizeAuthData(provider.getAuthType());
|
22025 | }
|
22026 | },
|
22027 | _logInWith: function _logInWith(provider, authData, options) {
|
22028 | var user = AV.Object._create('_User');
|
22029 |
|
22030 | return user._linkWith(provider, authData, options);
|
22031 | }
|
22032 | });
|
22033 | };
|
22034 |
|
22035 | }),
|
22036 |
|
22037 | (function(module, exports, __webpack_require__) {
|
22038 |
|
22039 | var _Object$defineProperty = __webpack_require__(154);
|
22040 |
|
22041 | function _defineProperty(obj, key, value) {
|
22042 | if (key in obj) {
|
22043 | _Object$defineProperty(obj, key, {
|
22044 | value: value,
|
22045 | enumerable: true,
|
22046 | configurable: true,
|
22047 | writable: true
|
22048 | });
|
22049 | } else {
|
22050 | obj[key] = value;
|
22051 | }
|
22052 |
|
22053 | return obj;
|
22054 | }
|
22055 |
|
22056 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
22057 |
|
22058 | }),
|
22059 |
|
22060 | (function(module, exports, __webpack_require__) {
|
22061 |
|
22062 | "use strict";
|
22063 |
|
22064 |
|
22065 | var _interopRequireDefault = __webpack_require__(1);
|
22066 |
|
22067 | var _map = _interopRequireDefault(__webpack_require__(37));
|
22068 |
|
22069 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
22070 |
|
22071 | var _keys = _interopRequireDefault(__webpack_require__(62));
|
22072 |
|
22073 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
22074 |
|
22075 | var _find = _interopRequireDefault(__webpack_require__(96));
|
22076 |
|
22077 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
22078 |
|
22079 | var _ = __webpack_require__(3);
|
22080 |
|
22081 | var debug = __webpack_require__(63)('leancloud:query');
|
22082 |
|
22083 | var AVError = __webpack_require__(48);
|
22084 |
|
22085 | var _require = __webpack_require__(28),
|
22086 | _request = _require._request,
|
22087 | request = _require.request;
|
22088 |
|
22089 | var _require2 = __webpack_require__(32),
|
22090 | ensureArray = _require2.ensureArray,
|
22091 | transformFetchOptions = _require2.transformFetchOptions,
|
22092 | continueWhile = _require2.continueWhile;
|
22093 |
|
22094 | var requires = function requires(value, message) {
|
22095 | if (value === undefined) {
|
22096 | throw new Error(message);
|
22097 | }
|
22098 | };
|
22099 |
|
22100 |
|
22101 | module.exports = function (AV) {
|
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 |
|
22127 |
|
22128 |
|
22129 |
|
22130 |
|
22131 |
|
22132 |
|
22133 |
|
22134 |
|
22135 |
|
22136 |
|
22137 |
|
22138 |
|
22139 |
|
22140 |
|
22141 |
|
22142 |
|
22143 |
|
22144 |
|
22145 | AV.Query = function (objectClass) {
|
22146 | if (_.isString(objectClass)) {
|
22147 | objectClass = AV.Object._getSubclass(objectClass);
|
22148 | }
|
22149 |
|
22150 | this.objectClass = objectClass;
|
22151 | this.className = objectClass.prototype.className;
|
22152 | this._where = {};
|
22153 | this._include = [];
|
22154 | this._select = [];
|
22155 | this._limit = -1;
|
22156 |
|
22157 | this._skip = 0;
|
22158 | this._defaultParams = {};
|
22159 | };
|
22160 | |
22161 |
|
22162 |
|
22163 |
|
22164 |
|
22165 |
|
22166 |
|
22167 |
|
22168 |
|
22169 |
|
22170 |
|
22171 |
|
22172 | AV.Query.or = function () {
|
22173 | var queries = _.toArray(arguments);
|
22174 |
|
22175 | var className = null;
|
22176 |
|
22177 | AV._arrayEach(queries, function (q) {
|
22178 | if (_.isNull(className)) {
|
22179 | className = q.className;
|
22180 | }
|
22181 |
|
22182 | if (className !== q.className) {
|
22183 | throw new Error('All queries must be for the same class');
|
22184 | }
|
22185 | });
|
22186 |
|
22187 | var query = new AV.Query(className);
|
22188 |
|
22189 | query._orQuery(queries);
|
22190 |
|
22191 | return query;
|
22192 | };
|
22193 | |
22194 |
|
22195 |
|
22196 |
|
22197 |
|
22198 |
|
22199 |
|
22200 |
|
22201 |
|
22202 |
|
22203 |
|
22204 |
|
22205 | AV.Query.and = function () {
|
22206 | var queries = _.toArray(arguments);
|
22207 |
|
22208 | var className = null;
|
22209 |
|
22210 | AV._arrayEach(queries, function (q) {
|
22211 | if (_.isNull(className)) {
|
22212 | className = q.className;
|
22213 | }
|
22214 |
|
22215 | if (className !== q.className) {
|
22216 | throw new Error('All queries must be for the same class');
|
22217 | }
|
22218 | });
|
22219 |
|
22220 | var query = new AV.Query(className);
|
22221 |
|
22222 | query._andQuery(queries);
|
22223 |
|
22224 | return query;
|
22225 | };
|
22226 | |
22227 |
|
22228 |
|
22229 |
|
22230 |
|
22231 |
|
22232 |
|
22233 |
|
22234 |
|
22235 |
|
22236 |
|
22237 |
|
22238 | AV.Query.doCloudQuery = function (cql, pvalues, options) {
|
22239 | var params = {
|
22240 | cql: cql
|
22241 | };
|
22242 |
|
22243 | if (_.isArray(pvalues)) {
|
22244 | params.pvalues = pvalues;
|
22245 | } else {
|
22246 | options = pvalues;
|
22247 | }
|
22248 |
|
22249 | var request = _request('cloudQuery', null, null, 'GET', params, options);
|
22250 |
|
22251 | return request.then(function (response) {
|
22252 |
|
22253 | var query = new AV.Query(response.className);
|
22254 | var results = (0, _map.default)(_).call(_, response.results, function (json) {
|
22255 | var obj = query._newObject(response);
|
22256 |
|
22257 | if (obj._finishFetch) {
|
22258 | obj._finishFetch(query._processResult(json), true);
|
22259 | }
|
22260 |
|
22261 | return obj;
|
22262 | });
|
22263 | return {
|
22264 | results: results,
|
22265 | count: response.count,
|
22266 | className: response.className
|
22267 | };
|
22268 | });
|
22269 | };
|
22270 | |
22271 |
|
22272 |
|
22273 |
|
22274 |
|
22275 |
|
22276 |
|
22277 |
|
22278 |
|
22279 | AV.Query.fromJSON = function (_ref) {
|
22280 | var className = _ref.className,
|
22281 | where = _ref.where,
|
22282 | include = _ref.include,
|
22283 | select = _ref.select,
|
22284 | includeACL = _ref.includeACL,
|
22285 | limit = _ref.limit,
|
22286 | skip = _ref.skip,
|
22287 | order = _ref.order;
|
22288 |
|
22289 | if (typeof className !== 'string') {
|
22290 | throw new TypeError('Invalid Query JSON, className must be a String.');
|
22291 | }
|
22292 |
|
22293 | var query = new AV.Query(className);
|
22294 |
|
22295 | _.extend(query, {
|
22296 | _where: where,
|
22297 | _include: include,
|
22298 | _select: select,
|
22299 | _includeACL: includeACL,
|
22300 | _limit: limit,
|
22301 | _skip: skip,
|
22302 | _order: order
|
22303 | });
|
22304 |
|
22305 | return query;
|
22306 | };
|
22307 |
|
22308 | AV.Query._extend = AV._extend;
|
22309 |
|
22310 | _.extend(AV.Query.prototype,
|
22311 |
|
22312 | {
|
22313 |
|
22314 | _processResult: function _processResult(obj) {
|
22315 | return obj;
|
22316 | },
|
22317 |
|
22318 | |
22319 |
|
22320 |
|
22321 |
|
22322 |
|
22323 |
|
22324 |
|
22325 |
|
22326 | get: function get(objectId, options) {
|
22327 | if (!_.isString(objectId)) {
|
22328 | throw new Error('objectId must be a string');
|
22329 | }
|
22330 |
|
22331 | if (objectId === '') {
|
22332 | return _promise.default.reject(new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.'));
|
22333 | }
|
22334 |
|
22335 | var obj = this._newObject();
|
22336 |
|
22337 | obj.id = objectId;
|
22338 |
|
22339 | var queryJSON = this._getParams();
|
22340 |
|
22341 | var fetchOptions = {};
|
22342 | if ((0, _keys.default)(queryJSON)) fetchOptions.keys = (0, _keys.default)(queryJSON);
|
22343 | if (queryJSON.include) fetchOptions.include = queryJSON.include;
|
22344 | if (queryJSON.includeACL) fetchOptions.includeACL = queryJSON.includeACL;
|
22345 | return _request('classes', this.className, objectId, 'GET', transformFetchOptions(fetchOptions), options).then(function (response) {
|
22346 | if (_.isEmpty(response)) throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
|
22347 |
|
22348 | obj._finishFetch(obj.parse(response), true);
|
22349 |
|
22350 | return obj;
|
22351 | });
|
22352 | },
|
22353 |
|
22354 | |
22355 |
|
22356 |
|
22357 |
|
22358 | toJSON: function toJSON() {
|
22359 | var className = this.className,
|
22360 | where = this._where,
|
22361 | include = this._include,
|
22362 | select = this._select,
|
22363 | includeACL = this._includeACL,
|
22364 | limit = this._limit,
|
22365 | skip = this._skip,
|
22366 | order = this._order;
|
22367 | return {
|
22368 | className: className,
|
22369 | where: where,
|
22370 | include: include,
|
22371 | select: select,
|
22372 | includeACL: includeACL,
|
22373 | limit: limit,
|
22374 | skip: skip,
|
22375 | order: order
|
22376 | };
|
22377 | },
|
22378 | _getParams: function _getParams() {
|
22379 | var params = _.extend({}, this._defaultParams, {
|
22380 | where: this._where
|
22381 | });
|
22382 |
|
22383 | if (this._include.length > 0) {
|
22384 | params.include = this._include.join(',');
|
22385 | }
|
22386 |
|
22387 | if (this._select.length > 0) {
|
22388 | params.keys = this._select.join(',');
|
22389 | }
|
22390 |
|
22391 | if (this._includeACL !== undefined) {
|
22392 | params.returnACL = this._includeACL;
|
22393 | }
|
22394 |
|
22395 | if (this._limit >= 0) {
|
22396 | params.limit = this._limit;
|
22397 | }
|
22398 |
|
22399 | if (this._skip > 0) {
|
22400 | params.skip = this._skip;
|
22401 | }
|
22402 |
|
22403 | if (this._order !== undefined) {
|
22404 | params.order = this._order;
|
22405 | }
|
22406 |
|
22407 | return params;
|
22408 | },
|
22409 | _newObject: function _newObject(response) {
|
22410 | var obj;
|
22411 |
|
22412 | if (response && response.className) {
|
22413 | obj = new AV.Object(response.className);
|
22414 | } else {
|
22415 | obj = new this.objectClass();
|
22416 | }
|
22417 |
|
22418 | return obj;
|
22419 | },
|
22420 | _createRequest: function _createRequest() {
|
22421 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getParams();
|
22422 | var options = arguments.length > 1 ? arguments[1] : undefined;
|
22423 | var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "/classes/".concat(this.className);
|
22424 |
|
22425 | if (encodeURIComponent((0, _stringify.default)(params)).length > 2000) {
|
22426 | var body = {
|
22427 | requests: [{
|
22428 | method: 'GET',
|
22429 | path: "/1.1".concat(path),
|
22430 | params: params
|
22431 | }]
|
22432 | };
|
22433 | return request({
|
22434 | path: '/batch',
|
22435 | method: 'POST',
|
22436 | data: body,
|
22437 | authOptions: options
|
22438 | }).then(function (response) {
|
22439 | var result = response[0];
|
22440 |
|
22441 | if (result.success) {
|
22442 | return result.success;
|
22443 | }
|
22444 |
|
22445 | var error = new AVError(result.error.code, result.error.error || 'Unknown batch error');
|
22446 | throw error;
|
22447 | });
|
22448 | }
|
22449 |
|
22450 | return request({
|
22451 | method: 'GET',
|
22452 | path: path,
|
22453 | query: params,
|
22454 | authOptions: options
|
22455 | });
|
22456 | },
|
22457 | _parseResponse: function _parseResponse(response) {
|
22458 | var _this = this;
|
22459 |
|
22460 | return (0, _map.default)(_).call(_, response.results, function (json) {
|
22461 | var obj = _this._newObject(response);
|
22462 |
|
22463 | if (obj._finishFetch) {
|
22464 | obj._finishFetch(_this._processResult(json), true);
|
22465 | }
|
22466 |
|
22467 | return obj;
|
22468 | });
|
22469 | },
|
22470 |
|
22471 | |
22472 |
|
22473 |
|
22474 |
|
22475 |
|
22476 |
|
22477 |
|
22478 | find: function find(options) {
|
22479 | var request = this._createRequest(undefined, options);
|
22480 |
|
22481 | return request.then(this._parseResponse.bind(this));
|
22482 | },
|
22483 |
|
22484 | |
22485 |
|
22486 |
|
22487 |
|
22488 |
|
22489 |
|
22490 |
|
22491 | findAndCount: function findAndCount(options) {
|
22492 | var _this2 = this;
|
22493 |
|
22494 | var params = this._getParams();
|
22495 |
|
22496 | params.count = 1;
|
22497 |
|
22498 | var request = this._createRequest(params, options);
|
22499 |
|
22500 | return request.then(function (response) {
|
22501 | return [_this2._parseResponse(response), response.count];
|
22502 | });
|
22503 | },
|
22504 |
|
22505 | |
22506 |
|
22507 |
|
22508 |
|
22509 |
|
22510 |
|
22511 |
|
22512 |
|
22513 |
|
22514 |
|
22515 |
|
22516 |
|
22517 |
|
22518 |
|
22519 |
|
22520 |
|
22521 |
|
22522 |
|
22523 | scan: function scan() {
|
22524 | var _this3 = this;
|
22525 |
|
22526 | var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
22527 | orderedBy = _ref2.orderedBy,
|
22528 | batchSize = _ref2.batchSize;
|
22529 |
|
22530 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
22531 |
|
22532 | var condition = this._getParams();
|
22533 |
|
22534 | debug('scan %O', condition);
|
22535 |
|
22536 | if (condition.order) {
|
22537 | console.warn('The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan.');
|
22538 | delete condition.order;
|
22539 | }
|
22540 |
|
22541 | if (condition.skip) {
|
22542 | console.warn('The skip option of the query is ignored for Query#scan.');
|
22543 | delete condition.skip;
|
22544 | }
|
22545 |
|
22546 | if (condition.limit) {
|
22547 | console.warn('The limit option of the query is ignored for Query#scan.');
|
22548 | delete condition.limit;
|
22549 | }
|
22550 |
|
22551 | if (orderedBy) condition.scan_key = orderedBy;
|
22552 | if (batchSize) condition.limit = batchSize;
|
22553 | var cursor;
|
22554 | var remainResults = [];
|
22555 | return {
|
22556 | next: function next() {
|
22557 | if (remainResults.length) {
|
22558 | return _promise.default.resolve({
|
22559 | done: false,
|
22560 | value: remainResults.shift()
|
22561 | });
|
22562 | }
|
22563 |
|
22564 | if (cursor === null) {
|
22565 | return _promise.default.resolve({
|
22566 | done: true
|
22567 | });
|
22568 | }
|
22569 |
|
22570 | return _request('scan/classes', _this3.className, null, 'GET', cursor ? _.extend({}, condition, {
|
22571 | cursor: cursor
|
22572 | }) : condition, authOptions).then(function (response) {
|
22573 | cursor = response.cursor;
|
22574 |
|
22575 | if (response.results.length) {
|
22576 | var results = _this3._parseResponse(response);
|
22577 |
|
22578 | results.forEach(function (result) {
|
22579 | return remainResults.push(result);
|
22580 | });
|
22581 | }
|
22582 |
|
22583 | if (cursor === null && remainResults.length === 0) {
|
22584 | return {
|
22585 | done: true
|
22586 | };
|
22587 | }
|
22588 |
|
22589 | return {
|
22590 | done: false,
|
22591 | value: remainResults.shift()
|
22592 | };
|
22593 | });
|
22594 | }
|
22595 | };
|
22596 | },
|
22597 |
|
22598 | |
22599 |
|
22600 |
|
22601 |
|
22602 |
|
22603 |
|
22604 | destroyAll: function destroyAll(options) {
|
22605 | var self = this;
|
22606 | return (0, _find.default)(self).call(self, options).then(function (objects) {
|
22607 | return AV.Object.destroyAll(objects, options);
|
22608 | });
|
22609 | },
|
22610 |
|
22611 | |
22612 |
|
22613 |
|
22614 |
|
22615 |
|
22616 |
|
22617 |
|
22618 | count: function count(options) {
|
22619 | var params = this._getParams();
|
22620 |
|
22621 | params.limit = 0;
|
22622 | params.count = 1;
|
22623 |
|
22624 | var request = this._createRequest(params, options);
|
22625 |
|
22626 | return request.then(function (response) {
|
22627 | return response.count;
|
22628 | });
|
22629 | },
|
22630 |
|
22631 | |
22632 |
|
22633 |
|
22634 |
|
22635 |
|
22636 |
|
22637 |
|
22638 | first: function first(options) {
|
22639 | var self = this;
|
22640 |
|
22641 | var params = this._getParams();
|
22642 |
|
22643 | params.limit = 1;
|
22644 |
|
22645 | var request = this._createRequest(params, options);
|
22646 |
|
22647 | return request.then(function (response) {
|
22648 | return (0, _map.default)(_).call(_, response.results, function (json) {
|
22649 | var obj = self._newObject();
|
22650 |
|
22651 | if (obj._finishFetch) {
|
22652 | obj._finishFetch(self._processResult(json), true);
|
22653 | }
|
22654 |
|
22655 | return obj;
|
22656 | })[0];
|
22657 | });
|
22658 | },
|
22659 |
|
22660 | |
22661 |
|
22662 |
|
22663 |
|
22664 |
|
22665 |
|
22666 |
|
22667 | skip: function skip(n) {
|
22668 | requires(n, 'undefined is not a valid skip value');
|
22669 | this._skip = n;
|
22670 | return this;
|
22671 | },
|
22672 |
|
22673 | |
22674 |
|
22675 |
|
22676 |
|
22677 |
|
22678 |
|
22679 | limit: function limit(n) {
|
22680 | requires(n, 'undefined is not a valid limit value');
|
22681 | this._limit = n;
|
22682 | return this;
|
22683 | },
|
22684 |
|
22685 | |
22686 |
|
22687 |
|
22688 |
|
22689 |
|
22690 |
|
22691 |
|
22692 | equalTo: function equalTo(key, value) {
|
22693 | requires(key, 'undefined is not a valid key');
|
22694 | requires(value, 'undefined is not a valid value');
|
22695 | this._where[key] = AV._encode(value);
|
22696 | return this;
|
22697 | },
|
22698 |
|
22699 | |
22700 |
|
22701 |
|
22702 |
|
22703 | _addCondition: function _addCondition(key, condition, value) {
|
22704 | requires(key, 'undefined is not a valid condition key');
|
22705 | requires(condition, 'undefined is not a valid condition');
|
22706 | requires(value, 'undefined is not a valid condition value');
|
22707 |
|
22708 | if (!this._where[key]) {
|
22709 | this._where[key] = {};
|
22710 | }
|
22711 |
|
22712 | this._where[key][condition] = AV._encode(value);
|
22713 | return this;
|
22714 | },
|
22715 |
|
22716 | |
22717 |
|
22718 |
|
22719 |
|
22720 |
|
22721 |
|
22722 |
|
22723 | sizeEqualTo: function sizeEqualTo(key, value) {
|
22724 | this._addCondition(key, '$size', value);
|
22725 |
|
22726 | return this;
|
22727 | },
|
22728 |
|
22729 | |
22730 |
|
22731 |
|
22732 |
|
22733 |
|
22734 |
|
22735 |
|
22736 | notEqualTo: function notEqualTo(key, value) {
|
22737 | this._addCondition(key, '$ne', value);
|
22738 |
|
22739 | return this;
|
22740 | },
|
22741 |
|
22742 | |
22743 |
|
22744 |
|
22745 |
|
22746 |
|
22747 |
|
22748 |
|
22749 | lessThan: function lessThan(key, value) {
|
22750 | this._addCondition(key, '$lt', value);
|
22751 |
|
22752 | return this;
|
22753 | },
|
22754 |
|
22755 | |
22756 |
|
22757 |
|
22758 |
|
22759 |
|
22760 |
|
22761 |
|
22762 | greaterThan: function greaterThan(key, value) {
|
22763 | this._addCondition(key, '$gt', value);
|
22764 |
|
22765 | return this;
|
22766 | },
|
22767 |
|
22768 | |
22769 |
|
22770 |
|
22771 |
|
22772 |
|
22773 |
|
22774 |
|
22775 | lessThanOrEqualTo: function lessThanOrEqualTo(key, value) {
|
22776 | this._addCondition(key, '$lte', value);
|
22777 |
|
22778 | return this;
|
22779 | },
|
22780 |
|
22781 | |
22782 |
|
22783 |
|
22784 |
|
22785 |
|
22786 |
|
22787 |
|
22788 | greaterThanOrEqualTo: function greaterThanOrEqualTo(key, value) {
|
22789 | this._addCondition(key, '$gte', value);
|
22790 |
|
22791 | return this;
|
22792 | },
|
22793 |
|
22794 | |
22795 |
|
22796 |
|
22797 |
|
22798 |
|
22799 |
|
22800 |
|
22801 | containedIn: function containedIn(key, values) {
|
22802 | this._addCondition(key, '$in', values);
|
22803 |
|
22804 | return this;
|
22805 | },
|
22806 |
|
22807 | |
22808 |
|
22809 |
|
22810 |
|
22811 |
|
22812 |
|
22813 |
|
22814 | notContainedIn: function notContainedIn(key, values) {
|
22815 | this._addCondition(key, '$nin', values);
|
22816 |
|
22817 | return this;
|
22818 | },
|
22819 |
|
22820 | |
22821 |
|
22822 |
|
22823 |
|
22824 |
|
22825 |
|
22826 |
|
22827 | containsAll: function containsAll(key, values) {
|
22828 | this._addCondition(key, '$all', values);
|
22829 |
|
22830 | return this;
|
22831 | },
|
22832 |
|
22833 | |
22834 |
|
22835 |
|
22836 |
|
22837 |
|
22838 | exists: function exists(key) {
|
22839 | this._addCondition(key, '$exists', true);
|
22840 |
|
22841 | return this;
|
22842 | },
|
22843 |
|
22844 | |
22845 |
|
22846 |
|
22847 |
|
22848 |
|
22849 | doesNotExist: function doesNotExist(key) {
|
22850 | this._addCondition(key, '$exists', false);
|
22851 |
|
22852 | return this;
|
22853 | },
|
22854 |
|
22855 | |
22856 |
|
22857 |
|
22858 |
|
22859 |
|
22860 |
|
22861 |
|
22862 |
|
22863 | matches: function matches(key, regex, modifiers) {
|
22864 | this._addCondition(key, '$regex', regex);
|
22865 |
|
22866 | if (!modifiers) {
|
22867 | modifiers = '';
|
22868 | }
|
22869 |
|
22870 |
|
22871 |
|
22872 |
|
22873 | if (regex.ignoreCase) {
|
22874 | modifiers += 'i';
|
22875 | }
|
22876 |
|
22877 | if (regex.multiline) {
|
22878 | modifiers += 'm';
|
22879 | }
|
22880 |
|
22881 | if (modifiers && modifiers.length) {
|
22882 | this._addCondition(key, '$options', modifiers);
|
22883 | }
|
22884 |
|
22885 | return this;
|
22886 | },
|
22887 |
|
22888 | |
22889 |
|
22890 |
|
22891 |
|
22892 |
|
22893 |
|
22894 |
|
22895 |
|
22896 | matchesQuery: function matchesQuery(key, query) {
|
22897 | var queryJSON = query._getParams();
|
22898 |
|
22899 | queryJSON.className = query.className;
|
22900 |
|
22901 | this._addCondition(key, '$inQuery', queryJSON);
|
22902 |
|
22903 | return this;
|
22904 | },
|
22905 |
|
22906 | |
22907 |
|
22908 |
|
22909 |
|
22910 |
|
22911 |
|
22912 |
|
22913 |
|
22914 | doesNotMatchQuery: function doesNotMatchQuery(key, query) {
|
22915 | var queryJSON = query._getParams();
|
22916 |
|
22917 | queryJSON.className = query.className;
|
22918 |
|
22919 | this._addCondition(key, '$notInQuery', queryJSON);
|
22920 |
|
22921 | return this;
|
22922 | },
|
22923 |
|
22924 | |
22925 |
|
22926 |
|
22927 |
|
22928 |
|
22929 |
|
22930 |
|
22931 |
|
22932 |
|
22933 |
|
22934 | matchesKeyInQuery: function matchesKeyInQuery(key, queryKey, query) {
|
22935 | var queryJSON = query._getParams();
|
22936 |
|
22937 | queryJSON.className = query.className;
|
22938 |
|
22939 | this._addCondition(key, '$select', {
|
22940 | key: queryKey,
|
22941 | query: queryJSON
|
22942 | });
|
22943 |
|
22944 | return this;
|
22945 | },
|
22946 |
|
22947 | |
22948 |
|
22949 |
|
22950 |
|
22951 |
|
22952 |
|
22953 |
|
22954 |
|
22955 |
|
22956 |
|
22957 | doesNotMatchKeyInQuery: function doesNotMatchKeyInQuery(key, queryKey, query) {
|
22958 | var queryJSON = query._getParams();
|
22959 |
|
22960 | queryJSON.className = query.className;
|
22961 |
|
22962 | this._addCondition(key, '$dontSelect', {
|
22963 | key: queryKey,
|
22964 | query: queryJSON
|
22965 | });
|
22966 |
|
22967 | return this;
|
22968 | },
|
22969 |
|
22970 | |
22971 |
|
22972 |
|
22973 |
|
22974 |
|
22975 |
|
22976 | _orQuery: function _orQuery(queries) {
|
22977 | var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
|
22978 | return q._getParams().where;
|
22979 | });
|
22980 | this._where.$or = queryJSON;
|
22981 | return this;
|
22982 | },
|
22983 |
|
22984 | |
22985 |
|
22986 |
|
22987 |
|
22988 |
|
22989 |
|
22990 | _andQuery: function _andQuery(queries) {
|
22991 | var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
|
22992 | return q._getParams().where;
|
22993 | });
|
22994 | this._where.$and = queryJSON;
|
22995 | return this;
|
22996 | },
|
22997 |
|
22998 | |
22999 |
|
23000 |
|
23001 |
|
23002 |
|
23003 |
|
23004 | _quote: function _quote(s) {
|
23005 | return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
|
23006 | },
|
23007 |
|
23008 | |
23009 |
|
23010 |
|
23011 |
|
23012 |
|
23013 |
|
23014 |
|
23015 | contains: function contains(key, value) {
|
23016 | this._addCondition(key, '$regex', this._quote(value));
|
23017 |
|
23018 | return this;
|
23019 | },
|
23020 |
|
23021 | |
23022 |
|
23023 |
|
23024 |
|
23025 |
|
23026 |
|
23027 |
|
23028 |
|
23029 | startsWith: function startsWith(key, value) {
|
23030 | this._addCondition(key, '$regex', '^' + this._quote(value));
|
23031 |
|
23032 | return this;
|
23033 | },
|
23034 |
|
23035 | |
23036 |
|
23037 |
|
23038 |
|
23039 |
|
23040 |
|
23041 |
|
23042 | endsWith: function endsWith(key, value) {
|
23043 | this._addCondition(key, '$regex', this._quote(value) + '$');
|
23044 |
|
23045 | return this;
|
23046 | },
|
23047 |
|
23048 | |
23049 |
|
23050 |
|
23051 |
|
23052 |
|
23053 |
|
23054 | ascending: function ascending(key) {
|
23055 | requires(key, 'undefined is not a valid key');
|
23056 | this._order = key;
|
23057 | return this;
|
23058 | },
|
23059 |
|
23060 | |
23061 |
|
23062 |
|
23063 |
|
23064 |
|
23065 |
|
23066 |
|
23067 | addAscending: function addAscending(key) {
|
23068 | requires(key, 'undefined is not a valid key');
|
23069 | if (this._order) this._order += ',' + key;else this._order = key;
|
23070 | return this;
|
23071 | },
|
23072 |
|
23073 | |
23074 |
|
23075 |
|
23076 |
|
23077 |
|
23078 |
|
23079 | descending: function descending(key) {
|
23080 | requires(key, 'undefined is not a valid key');
|
23081 | this._order = '-' + key;
|
23082 | return this;
|
23083 | },
|
23084 |
|
23085 | |
23086 |
|
23087 |
|
23088 |
|
23089 |
|
23090 |
|
23091 |
|
23092 | addDescending: function addDescending(key) {
|
23093 | requires(key, 'undefined is not a valid key');
|
23094 | if (this._order) this._order += ',-' + key;else this._order = '-' + key;
|
23095 | return this;
|
23096 | },
|
23097 |
|
23098 | |
23099 |
|
23100 |
|
23101 |
|
23102 |
|
23103 |
|
23104 |
|
23105 | near: function near(key, point) {
|
23106 | if (!(point instanceof AV.GeoPoint)) {
|
23107 |
|
23108 | point = new AV.GeoPoint(point);
|
23109 | }
|
23110 |
|
23111 | this._addCondition(key, '$nearSphere', point);
|
23112 |
|
23113 | return this;
|
23114 | },
|
23115 |
|
23116 | |
23117 |
|
23118 |
|
23119 |
|
23120 |
|
23121 |
|
23122 |
|
23123 |
|
23124 | withinRadians: function withinRadians(key, point, distance) {
|
23125 | this.near(key, point);
|
23126 |
|
23127 | this._addCondition(key, '$maxDistance', distance);
|
23128 |
|
23129 | return this;
|
23130 | },
|
23131 |
|
23132 | |
23133 |
|
23134 |
|
23135 |
|
23136 |
|
23137 |
|
23138 |
|
23139 |
|
23140 |
|
23141 |
|
23142 | withinMiles: function withinMiles(key, point, distance) {
|
23143 | return this.withinRadians(key, point, distance / 3958.8);
|
23144 | },
|
23145 |
|
23146 | |
23147 |
|
23148 |
|
23149 |
|
23150 |
|
23151 |
|
23152 |
|
23153 |
|
23154 |
|
23155 |
|
23156 | withinKilometers: function withinKilometers(key, point, distance) {
|
23157 | return this.withinRadians(key, point, distance / 6371.0);
|
23158 | },
|
23159 |
|
23160 | |
23161 |
|
23162 |
|
23163 |
|
23164 |
|
23165 |
|
23166 |
|
23167 |
|
23168 |
|
23169 |
|
23170 |
|
23171 | withinGeoBox: function withinGeoBox(key, southwest, northeast) {
|
23172 | if (!(southwest instanceof AV.GeoPoint)) {
|
23173 | southwest = new AV.GeoPoint(southwest);
|
23174 | }
|
23175 |
|
23176 | if (!(northeast instanceof AV.GeoPoint)) {
|
23177 | northeast = new AV.GeoPoint(northeast);
|
23178 | }
|
23179 |
|
23180 | this._addCondition(key, '$within', {
|
23181 | $box: [southwest, northeast]
|
23182 | });
|
23183 |
|
23184 | return this;
|
23185 | },
|
23186 |
|
23187 | |
23188 |
|
23189 |
|
23190 |
|
23191 |
|
23192 |
|
23193 | include: function include(keys) {
|
23194 | var _this4 = this;
|
23195 |
|
23196 | requires(keys, 'undefined is not a valid key');
|
23197 |
|
23198 | _.forEach(arguments, function (keys) {
|
23199 | var _context;
|
23200 |
|
23201 | _this4._include = (0, _concat.default)(_context = _this4._include).call(_context, ensureArray(keys));
|
23202 | });
|
23203 |
|
23204 | return this;
|
23205 | },
|
23206 |
|
23207 | |
23208 |
|
23209 |
|
23210 |
|
23211 |
|
23212 | includeACL: function includeACL() {
|
23213 | var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
23214 | this._includeACL = value;
|
23215 | return this;
|
23216 | },
|
23217 |
|
23218 | |
23219 |
|
23220 |
|
23221 |
|
23222 |
|
23223 |
|
23224 |
|
23225 | select: function select(keys) {
|
23226 | var _this5 = this;
|
23227 |
|
23228 | requires(keys, 'undefined is not a valid key');
|
23229 |
|
23230 | _.forEach(arguments, function (keys) {
|
23231 | var _context2;
|
23232 |
|
23233 | _this5._select = (0, _concat.default)(_context2 = _this5._select).call(_context2, ensureArray(keys));
|
23234 | });
|
23235 |
|
23236 | return this;
|
23237 | },
|
23238 |
|
23239 | |
23240 |
|
23241 |
|
23242 |
|
23243 |
|
23244 |
|
23245 |
|
23246 |
|
23247 |
|
23248 |
|
23249 |
|
23250 |
|
23251 | each: function each(callback) {
|
23252 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
23253 |
|
23254 | if (this._order || this._skip || this._limit >= 0) {
|
23255 | var error = new Error('Cannot iterate on a query with sort, skip, or limit.');
|
23256 | return _promise.default.reject(error);
|
23257 | }
|
23258 |
|
23259 | var query = new AV.Query(this.objectClass);
|
23260 |
|
23261 |
|
23262 | query._limit = options.batchSize || 100;
|
23263 | query._where = _.clone(this._where);
|
23264 | query._include = _.clone(this._include);
|
23265 | query.ascending('objectId');
|
23266 | var finished = false;
|
23267 | return continueWhile(function () {
|
23268 | return !finished;
|
23269 | }, function () {
|
23270 | return (0, _find.default)(query).call(query, options).then(function (results) {
|
23271 | var callbacksDone = _promise.default.resolve();
|
23272 |
|
23273 | _.each(results, function (result) {
|
23274 | callbacksDone = callbacksDone.then(function () {
|
23275 | return callback(result);
|
23276 | });
|
23277 | });
|
23278 |
|
23279 | return callbacksDone.then(function () {
|
23280 | if (results.length >= query._limit) {
|
23281 | query.greaterThan('objectId', results[results.length - 1].id);
|
23282 | } else {
|
23283 | finished = true;
|
23284 | }
|
23285 | });
|
23286 | });
|
23287 | });
|
23288 | },
|
23289 |
|
23290 | |
23291 |
|
23292 |
|
23293 |
|
23294 |
|
23295 |
|
23296 |
|
23297 |
|
23298 | subscribe: function subscribe(options) {
|
23299 | return AV.LiveQuery.init(this, options);
|
23300 | }
|
23301 | });
|
23302 |
|
23303 | AV.FriendShipQuery = AV.Query._extend({
|
23304 | _newObject: function _newObject() {
|
23305 | var UserClass = AV.Object._getSubclass('_User');
|
23306 |
|
23307 | return new UserClass();
|
23308 | },
|
23309 | _processResult: function _processResult(json) {
|
23310 | if (json && json[this._friendshipTag]) {
|
23311 | var user = json[this._friendshipTag];
|
23312 |
|
23313 | if (user.__type === 'Pointer' && user.className === '_User') {
|
23314 | delete user.__type;
|
23315 | delete user.className;
|
23316 | }
|
23317 |
|
23318 | return user;
|
23319 | } else {
|
23320 | return null;
|
23321 | }
|
23322 | }
|
23323 | });
|
23324 | };
|
23325 |
|
23326 | }),
|
23327 |
|
23328 | (function(module, exports, __webpack_require__) {
|
23329 |
|
23330 | "use strict";
|
23331 |
|
23332 |
|
23333 | var _interopRequireDefault = __webpack_require__(1);
|
23334 |
|
23335 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
23336 |
|
23337 | var _keys = _interopRequireDefault(__webpack_require__(62));
|
23338 |
|
23339 | var _ = __webpack_require__(3);
|
23340 |
|
23341 | var EventEmitter = __webpack_require__(235);
|
23342 |
|
23343 | var _require = __webpack_require__(32),
|
23344 | inherits = _require.inherits;
|
23345 |
|
23346 | var _require2 = __webpack_require__(28),
|
23347 | request = _require2.request;
|
23348 |
|
23349 | var subscribe = function subscribe(queryJSON, subscriptionId) {
|
23350 | return request({
|
23351 | method: 'POST',
|
23352 | path: '/LiveQuery/subscribe',
|
23353 | data: {
|
23354 | query: queryJSON,
|
23355 | id: subscriptionId
|
23356 | }
|
23357 | });
|
23358 | };
|
23359 |
|
23360 | module.exports = function (AV) {
|
23361 | var requireRealtime = function requireRealtime() {
|
23362 | if (!AV._config.realtime) {
|
23363 | throw new Error('LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query');
|
23364 | }
|
23365 | };
|
23366 | |
23367 |
|
23368 |
|
23369 |
|
23370 |
|
23371 |
|
23372 |
|
23373 | AV.LiveQuery = inherits(EventEmitter,
|
23374 |
|
23375 | {
|
23376 | constructor: function constructor(id, client, queryJSON, subscriptionId) {
|
23377 | var _this = this;
|
23378 |
|
23379 | EventEmitter.apply(this);
|
23380 | this.id = id;
|
23381 | this._client = client;
|
23382 |
|
23383 | this._client.register(this);
|
23384 |
|
23385 | this._queryJSON = queryJSON;
|
23386 | this._subscriptionId = subscriptionId;
|
23387 | this._onMessage = this._dispatch.bind(this);
|
23388 |
|
23389 | this._onReconnect = function () {
|
23390 | subscribe(_this._queryJSON, _this._subscriptionId).catch(function (error) {
|
23391 | return console.error("LiveQuery resubscribe error: ".concat(error.message));
|
23392 | });
|
23393 | };
|
23394 |
|
23395 | client.on('message', this._onMessage);
|
23396 | client.on('reconnect', this._onReconnect);
|
23397 | },
|
23398 | _dispatch: function _dispatch(message) {
|
23399 | var _this2 = this;
|
23400 |
|
23401 | message.forEach(function (_ref) {
|
23402 | var op = _ref.op,
|
23403 | object = _ref.object,
|
23404 | queryId = _ref.query_id,
|
23405 | updatedKeys = _ref.updatedKeys;
|
23406 | if (queryId !== _this2.id) return;
|
23407 | var target = AV.parseJSON(_.extend({
|
23408 | __type: object.className === '_File' ? 'File' : 'Object'
|
23409 | }, object));
|
23410 |
|
23411 | if (updatedKeys) {
|
23412 | |
23413 |
|
23414 |
|
23415 |
|
23416 |
|
23417 |
|
23418 |
|
23419 | |
23420 |
|
23421 |
|
23422 |
|
23423 |
|
23424 |
|
23425 |
|
23426 | |
23427 |
|
23428 |
|
23429 |
|
23430 |
|
23431 |
|
23432 | _this2.emit(op, target, updatedKeys);
|
23433 | } else {
|
23434 | |
23435 |
|
23436 |
|
23437 |
|
23438 |
|
23439 |
|
23440 | |
23441 |
|
23442 |
|
23443 |
|
23444 |
|
23445 | _this2.emit(op, target);
|
23446 | }
|
23447 | });
|
23448 | },
|
23449 |
|
23450 | |
23451 |
|
23452 |
|
23453 |
|
23454 |
|
23455 | unsubscribe: function unsubscribe() {
|
23456 | var client = this._client;
|
23457 | client.off('message', this._onMessage);
|
23458 | client.off('reconnect', this._onReconnect);
|
23459 | client.deregister(this);
|
23460 | return request({
|
23461 | method: 'POST',
|
23462 | path: '/LiveQuery/unsubscribe',
|
23463 | data: {
|
23464 | id: client.id,
|
23465 | query_id: this.id
|
23466 | }
|
23467 | });
|
23468 | }
|
23469 | },
|
23470 |
|
23471 | {
|
23472 | init: function init(query) {
|
23473 | var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
23474 | _ref2$subscriptionId = _ref2.subscriptionId,
|
23475 | userDefinedSubscriptionId = _ref2$subscriptionId === void 0 ? AV._getSubscriptionId() : _ref2$subscriptionId;
|
23476 |
|
23477 | requireRealtime();
|
23478 | if (!(query instanceof AV.Query)) throw new TypeError('LiveQuery must be inited with a Query');
|
23479 | return _promise.default.resolve(userDefinedSubscriptionId).then(function (subscriptionId) {
|
23480 | return AV._config.realtime.createLiveQueryClient(subscriptionId).then(function (liveQueryClient) {
|
23481 | var _query$_getParams = query._getParams(),
|
23482 | where = _query$_getParams.where,
|
23483 | keys = (0, _keys.default)(_query$_getParams),
|
23484 | returnACL = _query$_getParams.returnACL;
|
23485 |
|
23486 | var queryJSON = {
|
23487 | where: where,
|
23488 | keys: keys,
|
23489 | returnACL: returnACL,
|
23490 | className: query.className
|
23491 | };
|
23492 | var promise = subscribe(queryJSON, subscriptionId).then(function (_ref3) {
|
23493 | var queryId = _ref3.query_id;
|
23494 | return new AV.LiveQuery(queryId, liveQueryClient, queryJSON, subscriptionId);
|
23495 | }).finally(function () {
|
23496 | liveQueryClient.deregister(promise);
|
23497 | });
|
23498 | liveQueryClient.register(promise);
|
23499 | return promise;
|
23500 | });
|
23501 | });
|
23502 | },
|
23503 |
|
23504 | |
23505 |
|
23506 |
|
23507 |
|
23508 |
|
23509 | pause: function pause() {
|
23510 | requireRealtime();
|
23511 | return AV._config.realtime.pause();
|
23512 | },
|
23513 |
|
23514 | |
23515 |
|
23516 |
|
23517 |
|
23518 |
|
23519 | resume: function resume() {
|
23520 | requireRealtime();
|
23521 | return AV._config.realtime.resume();
|
23522 | }
|
23523 | });
|
23524 | };
|
23525 |
|
23526 | }),
|
23527 |
|
23528 | (function(module, exports, __webpack_require__) {
|
23529 |
|
23530 | "use strict";
|
23531 |
|
23532 |
|
23533 | var _ = __webpack_require__(3);
|
23534 |
|
23535 | var _require = __webpack_require__(32),
|
23536 | tap = _require.tap;
|
23537 |
|
23538 | module.exports = function (AV) {
|
23539 | |
23540 |
|
23541 |
|
23542 |
|
23543 |
|
23544 |
|
23545 |
|
23546 |
|
23547 |
|
23548 |
|
23549 |
|
23550 |
|
23551 |
|
23552 |
|
23553 | AV.Captcha = function Captcha(options, authOptions) {
|
23554 | this._options = options;
|
23555 | this._authOptions = authOptions;
|
23556 | |
23557 |
|
23558 |
|
23559 |
|
23560 |
|
23561 | this.url = undefined;
|
23562 | |
23563 |
|
23564 |
|
23565 |
|
23566 |
|
23567 | this.captchaToken = undefined;
|
23568 | |
23569 |
|
23570 |
|
23571 |
|
23572 |
|
23573 | this.validateToken = undefined;
|
23574 | };
|
23575 | |
23576 |
|
23577 |
|
23578 |
|
23579 |
|
23580 |
|
23581 | AV.Captcha.prototype.refresh = function refresh() {
|
23582 | var _this = this;
|
23583 |
|
23584 | return AV.Cloud._requestCaptcha(this._options, this._authOptions).then(function (_ref) {
|
23585 | var captchaToken = _ref.captchaToken,
|
23586 | url = _ref.url;
|
23587 |
|
23588 | _.extend(_this, {
|
23589 | captchaToken: captchaToken,
|
23590 | url: url
|
23591 | });
|
23592 |
|
23593 | return url;
|
23594 | });
|
23595 | };
|
23596 | |
23597 |
|
23598 |
|
23599 |
|
23600 |
|
23601 |
|
23602 |
|
23603 | AV.Captcha.prototype.verify = function verify(code) {
|
23604 | var _this2 = this;
|
23605 |
|
23606 | return AV.Cloud.verifyCaptcha(code, this.captchaToken).then(tap(function (validateToken) {
|
23607 | return _this2.validateToken = validateToken;
|
23608 | }));
|
23609 | };
|
23610 |
|
23611 | if (true) {
|
23612 | |
23613 |
|
23614 |
|
23615 |
|
23616 |
|
23617 |
|
23618 |
|
23619 |
|
23620 |
|
23621 |
|
23622 | AV.Captcha.prototype.bind = function bind(_ref2, _ref3) {
|
23623 | var _this3 = this;
|
23624 |
|
23625 | var textInput = _ref2.textInput,
|
23626 | image = _ref2.image,
|
23627 | verifyButton = _ref2.verifyButton;
|
23628 | var success = _ref3.success,
|
23629 | error = _ref3.error;
|
23630 |
|
23631 | if (typeof textInput === 'string') {
|
23632 | textInput = document.getElementById(textInput);
|
23633 | if (!textInput) throw new Error("textInput with id ".concat(textInput, " not found"));
|
23634 | }
|
23635 |
|
23636 | if (typeof image === 'string') {
|
23637 | image = document.getElementById(image);
|
23638 | if (!image) throw new Error("image with id ".concat(image, " not found"));
|
23639 | }
|
23640 |
|
23641 | if (typeof verifyButton === 'string') {
|
23642 | verifyButton = document.getElementById(verifyButton);
|
23643 | if (!verifyButton) throw new Error("verifyButton with id ".concat(verifyButton, " not found"));
|
23644 | }
|
23645 |
|
23646 | this.__refresh = function () {
|
23647 | return _this3.refresh().then(function (url) {
|
23648 | image.src = url;
|
23649 |
|
23650 | if (textInput) {
|
23651 | textInput.value = '';
|
23652 | textInput.focus();
|
23653 | }
|
23654 | }).catch(function (err) {
|
23655 | return console.warn("refresh captcha fail: ".concat(err.message));
|
23656 | });
|
23657 | };
|
23658 |
|
23659 | if (image) {
|
23660 | this.__image = image;
|
23661 | image.src = this.url;
|
23662 | image.addEventListener('click', this.__refresh);
|
23663 | }
|
23664 |
|
23665 | this.__verify = function () {
|
23666 | var code = textInput.value;
|
23667 |
|
23668 | _this3.verify(code).catch(function (err) {
|
23669 | _this3.__refresh();
|
23670 |
|
23671 | throw err;
|
23672 | }).then(success, error).catch(function (err) {
|
23673 | return console.warn("verify captcha fail: ".concat(err.message));
|
23674 | });
|
23675 | };
|
23676 |
|
23677 | if (textInput && verifyButton) {
|
23678 | this.__verifyButton = verifyButton;
|
23679 | verifyButton.addEventListener('click', this.__verify);
|
23680 | }
|
23681 | };
|
23682 | |
23683 |
|
23684 |
|
23685 |
|
23686 |
|
23687 | AV.Captcha.prototype.unbind = function unbind() {
|
23688 | if (this.__image) this.__image.removeEventListener('click', this.__refresh);
|
23689 | if (this.__verifyButton) this.__verifyButton.removeEventListener('click', this.__verify);
|
23690 | };
|
23691 | }
|
23692 | |
23693 |
|
23694 |
|
23695 |
|
23696 |
|
23697 |
|
23698 |
|
23699 |
|
23700 |
|
23701 |
|
23702 |
|
23703 | AV.Captcha.request = function (options, authOptions) {
|
23704 | var captcha = new AV.Captcha(options, authOptions);
|
23705 | return captcha.refresh().then(function () {
|
23706 | return captcha;
|
23707 | });
|
23708 | };
|
23709 | };
|
23710 |
|
23711 | }),
|
23712 |
|
23713 | (function(module, exports, __webpack_require__) {
|
23714 |
|
23715 | "use strict";
|
23716 |
|
23717 |
|
23718 | var _interopRequireDefault = __webpack_require__(1);
|
23719 |
|
23720 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
23721 |
|
23722 | var _ = __webpack_require__(3);
|
23723 |
|
23724 | var _require = __webpack_require__(28),
|
23725 | _request = _require._request,
|
23726 | request = _require.request;
|
23727 |
|
23728 | module.exports = function (AV) {
|
23729 | |
23730 |
|
23731 |
|
23732 |
|
23733 |
|
23734 |
|
23735 |
|
23736 |
|
23737 |
|
23738 | AV.Cloud = AV.Cloud || {};
|
23739 |
|
23740 | _.extend(AV.Cloud,
|
23741 |
|
23742 | {
|
23743 | |
23744 |
|
23745 |
|
23746 |
|
23747 |
|
23748 |
|
23749 |
|
23750 |
|
23751 | run: function run(name, data, options) {
|
23752 | return request({
|
23753 | service: 'engine',
|
23754 | method: 'POST',
|
23755 | path: "/functions/".concat(name),
|
23756 | data: AV._encode(data, null, true),
|
23757 | authOptions: options
|
23758 | }).then(function (resp) {
|
23759 | return AV._decode(resp).result;
|
23760 | });
|
23761 | },
|
23762 |
|
23763 | |
23764 |
|
23765 |
|
23766 |
|
23767 |
|
23768 |
|
23769 |
|
23770 |
|
23771 | rpc: function rpc(name, data, options) {
|
23772 | if (_.isArray(data)) {
|
23773 | return _promise.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK."));
|
23774 | }
|
23775 |
|
23776 | return request({
|
23777 | service: 'engine',
|
23778 | method: 'POST',
|
23779 | path: "/call/".concat(name),
|
23780 | data: AV._encodeObjectOrArray(data),
|
23781 | authOptions: options
|
23782 | }).then(function (resp) {
|
23783 | return AV._decode(resp).result;
|
23784 | });
|
23785 | },
|
23786 |
|
23787 | |
23788 |
|
23789 |
|
23790 |
|
23791 |
|
23792 |
|
23793 | getServerDate: function getServerDate() {
|
23794 | return _request('date', null, null, 'GET').then(function (resp) {
|
23795 | return AV._decode(resp);
|
23796 | });
|
23797 | },
|
23798 |
|
23799 | |
23800 |
|
23801 |
|
23802 |
|
23803 |
|
23804 |
|
23805 |
|
23806 |
|
23807 |
|
23808 |
|
23809 |
|
23810 | requestSmsCode: function requestSmsCode(data) {
|
23811 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
23812 |
|
23813 | if (_.isString(data)) {
|
23814 | data = {
|
23815 | mobilePhoneNumber: data
|
23816 | };
|
23817 | }
|
23818 |
|
23819 | if (!data.mobilePhoneNumber) {
|
23820 | throw new Error('Missing mobilePhoneNumber.');
|
23821 | }
|
23822 |
|
23823 | if (options.validateToken) {
|
23824 | data = _.extend({}, data, {
|
23825 | validate_token: options.validateToken
|
23826 | });
|
23827 | }
|
23828 |
|
23829 | return _request('requestSmsCode', null, null, 'POST', data, options);
|
23830 | },
|
23831 |
|
23832 | |
23833 |
|
23834 |
|
23835 |
|
23836 |
|
23837 |
|
23838 |
|
23839 | verifySmsCode: function verifySmsCode(code, phone) {
|
23840 | if (!code) throw new Error('Missing sms code.');
|
23841 | var params = {};
|
23842 |
|
23843 | if (_.isString(phone)) {
|
23844 | params['mobilePhoneNumber'] = phone;
|
23845 | }
|
23846 |
|
23847 | return _request('verifySmsCode', code, null, 'POST', params);
|
23848 | },
|
23849 | _requestCaptcha: function _requestCaptcha(options, authOptions) {
|
23850 | return _request('requestCaptcha', null, null, 'GET', options, authOptions).then(function (_ref) {
|
23851 | var url = _ref.captcha_url,
|
23852 | captchaToken = _ref.captcha_token;
|
23853 | return {
|
23854 | captchaToken: captchaToken,
|
23855 | url: url
|
23856 | };
|
23857 | });
|
23858 | },
|
23859 |
|
23860 | |
23861 |
|
23862 |
|
23863 | requestCaptcha: AV.Captcha.request,
|
23864 |
|
23865 | |
23866 |
|
23867 |
|
23868 |
|
23869 |
|
23870 |
|
23871 |
|
23872 | verifyCaptcha: function verifyCaptcha(code, captchaToken) {
|
23873 | return _request('verifyCaptcha', null, null, 'POST', {
|
23874 | captcha_code: code,
|
23875 | captcha_token: captchaToken
|
23876 | }).then(function (_ref2) {
|
23877 | var validateToken = _ref2.validate_token;
|
23878 | return validateToken;
|
23879 | });
|
23880 | }
|
23881 | });
|
23882 | };
|
23883 |
|
23884 | }),
|
23885 |
|
23886 | (function(module, exports, __webpack_require__) {
|
23887 |
|
23888 | "use strict";
|
23889 |
|
23890 |
|
23891 | var request = __webpack_require__(28).request;
|
23892 |
|
23893 | module.exports = function (AV) {
|
23894 | AV.Installation = AV.Object.extend('_Installation');
|
23895 | |
23896 |
|
23897 |
|
23898 |
|
23899 | AV.Push = AV.Push || {};
|
23900 | |
23901 |
|
23902 |
|
23903 |
|
23904 |
|
23905 |
|
23906 |
|
23907 |
|
23908 |
|
23909 |
|
23910 |
|
23911 |
|
23912 |
|
23913 |
|
23914 |
|
23915 |
|
23916 |
|
23917 |
|
23918 |
|
23919 | AV.Push.send = function (data, options) {
|
23920 | if (data.where) {
|
23921 | data.where = data.where._getParams().where;
|
23922 | }
|
23923 |
|
23924 | if (data.where && data.cql) {
|
23925 | throw new Error("Both where and cql can't be set");
|
23926 | }
|
23927 |
|
23928 | if (data.push_time) {
|
23929 | data.push_time = data.push_time.toJSON();
|
23930 | }
|
23931 |
|
23932 | if (data.expiration_time) {
|
23933 | data.expiration_time = data.expiration_time.toJSON();
|
23934 | }
|
23935 |
|
23936 | if (data.expiration_time && data.expiration_interval) {
|
23937 | throw new Error("Both expiration_time and expiration_interval can't be set");
|
23938 | }
|
23939 |
|
23940 | return request({
|
23941 | service: 'push',
|
23942 | method: 'POST',
|
23943 | path: '/push',
|
23944 | data: data,
|
23945 | authOptions: options
|
23946 | });
|
23947 | };
|
23948 | };
|
23949 |
|
23950 | }),
|
23951 |
|
23952 | (function(module, exports, __webpack_require__) {
|
23953 |
|
23954 | "use strict";
|
23955 |
|
23956 |
|
23957 | var _interopRequireDefault = __webpack_require__(1);
|
23958 |
|
23959 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
23960 |
|
23961 | var _typeof2 = _interopRequireDefault(__webpack_require__(95));
|
23962 |
|
23963 | var _ = __webpack_require__(3);
|
23964 |
|
23965 | var AVRequest = __webpack_require__(28)._request;
|
23966 |
|
23967 | var _require = __webpack_require__(32),
|
23968 | getSessionToken = _require.getSessionToken;
|
23969 |
|
23970 | module.exports = function (AV) {
|
23971 | var getUser = function getUser() {
|
23972 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
23973 | var sessionToken = getSessionToken(options);
|
23974 |
|
23975 | if (sessionToken) {
|
23976 | return AV.User._fetchUserBySessionToken(getSessionToken(options));
|
23977 | }
|
23978 |
|
23979 | return AV.User.currentAsync();
|
23980 | };
|
23981 |
|
23982 | var getUserPointer = function getUserPointer(options) {
|
23983 | return getUser(options).then(function (currUser) {
|
23984 | return AV.Object.createWithoutData('_User', currUser.id)._toPointer();
|
23985 | });
|
23986 | };
|
23987 | |
23988 |
|
23989 |
|
23990 |
|
23991 |
|
23992 |
|
23993 | AV.Status = function (imageUrl, message) {
|
23994 | this.data = {};
|
23995 | this.inboxType = 'default';
|
23996 | this.query = null;
|
23997 |
|
23998 | if (imageUrl && (0, _typeof2.default)(imageUrl) === 'object') {
|
23999 | this.data = imageUrl;
|
24000 | } else {
|
24001 | if (imageUrl) {
|
24002 | this.data.image = imageUrl;
|
24003 | }
|
24004 |
|
24005 | if (message) {
|
24006 | this.data.message = message;
|
24007 | }
|
24008 | }
|
24009 |
|
24010 | return this;
|
24011 | };
|
24012 |
|
24013 | _.extend(AV.Status.prototype,
|
24014 |
|
24015 | {
|
24016 | |
24017 |
|
24018 |
|
24019 |
|
24020 | get: function get(attr) {
|
24021 | return this.data[attr];
|
24022 | },
|
24023 |
|
24024 | |
24025 |
|
24026 |
|
24027 |
|
24028 |
|
24029 | set: function set(key, value) {
|
24030 | this.data[key] = value;
|
24031 | return this;
|
24032 | },
|
24033 |
|
24034 | |
24035 |
|
24036 |
|
24037 |
|
24038 |
|
24039 |
|
24040 | destroy: function destroy(options) {
|
24041 | if (!this.id) return _promise.default.reject(new Error('The status id is not exists.'));
|
24042 | var request = AVRequest('statuses', null, this.id, 'DELETE', options);
|
24043 | return request;
|
24044 | },
|
24045 |
|
24046 | |
24047 |
|
24048 |
|
24049 |
|
24050 | toObject: function toObject() {
|
24051 | if (!this.id) return null;
|
24052 | return AV.Object.createWithoutData('_Status', this.id);
|
24053 | },
|
24054 | _getDataJSON: function _getDataJSON() {
|
24055 | var json = _.clone(this.data);
|
24056 |
|
24057 | return AV._encode(json);
|
24058 | },
|
24059 |
|
24060 | |
24061 |
|
24062 |
|
24063 |
|
24064 |
|
24065 |
|
24066 |
|
24067 |
|
24068 |
|
24069 |
|
24070 |
|
24071 |
|
24072 |
|
24073 |
|
24074 |
|
24075 |
|
24076 |
|
24077 |
|
24078 | send: function send() {
|
24079 | var _this = this;
|
24080 |
|
24081 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
24082 |
|
24083 | if (!getSessionToken(options) && !AV.User.current()) {
|
24084 | throw new Error('Please signin an user.');
|
24085 | }
|
24086 |
|
24087 | if (!this.query) {
|
24088 | return AV.Status.sendStatusToFollowers(this, options);
|
24089 | }
|
24090 |
|
24091 | return getUserPointer(options).then(function (currUser) {
|
24092 | var query = _this.query._getParams();
|
24093 |
|
24094 | query.className = _this.query.className;
|
24095 | var data = {};
|
24096 | data.query = query;
|
24097 | _this.data = _this.data || {};
|
24098 | _this.data.source = _this.data.source || currUser;
|
24099 | data.data = _this._getDataJSON();
|
24100 | data.inboxType = _this.inboxType || 'default';
|
24101 | return AVRequest('statuses', null, null, 'POST', data, options);
|
24102 | }).then(function (response) {
|
24103 | _this.id = response.objectId;
|
24104 | _this.createdAt = AV._parseDate(response.createdAt);
|
24105 | return _this;
|
24106 | });
|
24107 | },
|
24108 | _finishFetch: function _finishFetch(serverData) {
|
24109 | this.id = serverData.objectId;
|
24110 | this.createdAt = AV._parseDate(serverData.createdAt);
|
24111 | this.updatedAt = AV._parseDate(serverData.updatedAt);
|
24112 | this.messageId = serverData.messageId;
|
24113 | delete serverData.messageId;
|
24114 | delete serverData.objectId;
|
24115 | delete serverData.createdAt;
|
24116 | delete serverData.updatedAt;
|
24117 | this.data = AV._decode(serverData);
|
24118 | }
|
24119 | });
|
24120 | |
24121 |
|
24122 |
|
24123 |
|
24124 |
|
24125 |
|
24126 |
|
24127 |
|
24128 |
|
24129 |
|
24130 |
|
24131 |
|
24132 |
|
24133 |
|
24134 |
|
24135 |
|
24136 |
|
24137 |
|
24138 | AV.Status.sendStatusToFollowers = function (status) {
|
24139 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
24140 |
|
24141 | if (!getSessionToken(options) && !AV.User.current()) {
|
24142 | throw new Error('Please signin an user.');
|
24143 | }
|
24144 |
|
24145 | return getUserPointer(options).then(function (currUser) {
|
24146 | var query = {};
|
24147 | query.className = '_Follower';
|
24148 | query.keys = 'follower';
|
24149 | query.where = {
|
24150 | user: currUser
|
24151 | };
|
24152 | var data = {};
|
24153 | data.query = query;
|
24154 | status.data = status.data || {};
|
24155 | status.data.source = status.data.source || currUser;
|
24156 | data.data = status._getDataJSON();
|
24157 | data.inboxType = status.inboxType || 'default';
|
24158 | var request = AVRequest('statuses', null, null, 'POST', data, options);
|
24159 | return request.then(function (response) {
|
24160 | status.id = response.objectId;
|
24161 | status.createdAt = AV._parseDate(response.createdAt);
|
24162 | return status;
|
24163 | });
|
24164 | });
|
24165 | };
|
24166 | |
24167 |
|
24168 |
|
24169 |
|
24170 |
|
24171 |
|
24172 |
|
24173 |
|
24174 |
|
24175 |
|
24176 |
|
24177 |
|
24178 |
|
24179 |
|
24180 |
|
24181 |
|
24182 |
|
24183 |
|
24184 |
|
24185 |
|
24186 | AV.Status.sendPrivateStatus = function (status, target) {
|
24187 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
24188 |
|
24189 | if (!getSessionToken(options) && !AV.User.current()) {
|
24190 | throw new Error('Please signin an user.');
|
24191 | }
|
24192 |
|
24193 | if (!target) {
|
24194 | throw new Error('Invalid target user.');
|
24195 | }
|
24196 |
|
24197 | var userObjectId = _.isString(target) ? target : target.id;
|
24198 |
|
24199 | if (!userObjectId) {
|
24200 | throw new Error('Invalid target user.');
|
24201 | }
|
24202 |
|
24203 | return getUserPointer(options).then(function (currUser) {
|
24204 | var query = {};
|
24205 | query.className = '_User';
|
24206 | query.where = {
|
24207 | objectId: userObjectId
|
24208 | };
|
24209 | var data = {};
|
24210 | data.query = query;
|
24211 | status.data = status.data || {};
|
24212 | status.data.source = status.data.source || currUser;
|
24213 | data.data = status._getDataJSON();
|
24214 | data.inboxType = 'private';
|
24215 | status.inboxType = 'private';
|
24216 | var request = AVRequest('statuses', null, null, 'POST', data, options);
|
24217 | return request.then(function (response) {
|
24218 | status.id = response.objectId;
|
24219 | status.createdAt = AV._parseDate(response.createdAt);
|
24220 | return status;
|
24221 | });
|
24222 | });
|
24223 | };
|
24224 | |
24225 |
|
24226 |
|
24227 |
|
24228 |
|
24229 |
|
24230 |
|
24231 |
|
24232 |
|
24233 |
|
24234 |
|
24235 |
|
24236 |
|
24237 |
|
24238 |
|
24239 |
|
24240 | AV.Status.countUnreadStatuses = function (owner) {
|
24241 | var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
24242 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
24243 | if (!_.isString(inboxType)) options = inboxType;
|
24244 |
|
24245 | if (!getSessionToken(options) && owner == null && !AV.User.current()) {
|
24246 | throw new Error('Please signin an user or pass the owner objectId.');
|
24247 | }
|
24248 |
|
24249 | return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
|
24250 | var params = {};
|
24251 | params.inboxType = AV._encode(inboxType);
|
24252 | params.owner = AV._encode(owner);
|
24253 | return AVRequest('subscribe/statuses/count', null, null, 'GET', params, options);
|
24254 | });
|
24255 | };
|
24256 | |
24257 |
|
24258 |
|
24259 |
|
24260 |
|
24261 |
|
24262 |
|
24263 |
|
24264 |
|
24265 |
|
24266 |
|
24267 |
|
24268 |
|
24269 |
|
24270 |
|
24271 |
|
24272 | AV.Status.resetUnreadCount = function (owner) {
|
24273 | var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
24274 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
24275 | if (!_.isString(inboxType)) options = inboxType;
|
24276 |
|
24277 | if (!getSessionToken(options) && owner == null && !AV.User.current()) {
|
24278 | throw new Error('Please signin an user or pass the owner objectId.');
|
24279 | }
|
24280 |
|
24281 | return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
|
24282 | var params = {};
|
24283 | params.inboxType = AV._encode(inboxType);
|
24284 | params.owner = AV._encode(owner);
|
24285 | return AVRequest('subscribe/statuses/resetUnreadCount', null, null, 'POST', params, options);
|
24286 | });
|
24287 | };
|
24288 | |
24289 |
|
24290 |
|
24291 |
|
24292 |
|
24293 |
|
24294 |
|
24295 |
|
24296 |
|
24297 |
|
24298 |
|
24299 |
|
24300 |
|
24301 |
|
24302 | AV.Status.statusQuery = function (source) {
|
24303 | var query = new AV.Query('_Status');
|
24304 |
|
24305 | if (source) {
|
24306 | query.equalTo('source', source);
|
24307 | }
|
24308 |
|
24309 | return query;
|
24310 | };
|
24311 | |
24312 |
|
24313 |
|
24314 |
|
24315 |
|
24316 |
|
24317 | AV.InboxQuery = AV.Query._extend(
|
24318 |
|
24319 | {
|
24320 | _objectClass: AV.Status,
|
24321 | _sinceId: 0,
|
24322 | _maxId: 0,
|
24323 | _inboxType: 'default',
|
24324 | _owner: null,
|
24325 | _newObject: function _newObject() {
|
24326 | return new AV.Status();
|
24327 | },
|
24328 | _createRequest: function _createRequest(params, options) {
|
24329 | return AV.InboxQuery.__super__._createRequest.call(this, params, options, '/subscribe/statuses');
|
24330 | },
|
24331 |
|
24332 | |
24333 |
|
24334 |
|
24335 |
|
24336 |
|
24337 |
|
24338 |
|
24339 | sinceId: function sinceId(id) {
|
24340 | this._sinceId = id;
|
24341 | return this;
|
24342 | },
|
24343 |
|
24344 | |
24345 |
|
24346 |
|
24347 |
|
24348 |
|
24349 |
|
24350 |
|
24351 | maxId: function maxId(id) {
|
24352 | this._maxId = id;
|
24353 | return this;
|
24354 | },
|
24355 |
|
24356 | |
24357 |
|
24358 |
|
24359 |
|
24360 |
|
24361 | owner: function owner(_owner) {
|
24362 | this._owner = _owner;
|
24363 | return this;
|
24364 | },
|
24365 |
|
24366 | |
24367 |
|
24368 |
|
24369 |
|
24370 |
|
24371 | inboxType: function inboxType(type) {
|
24372 | this._inboxType = type;
|
24373 | return this;
|
24374 | },
|
24375 | _getParams: function _getParams() {
|
24376 | var params = AV.InboxQuery.__super__._getParams.call(this);
|
24377 |
|
24378 | params.owner = AV._encode(this._owner);
|
24379 | params.inboxType = AV._encode(this._inboxType);
|
24380 | params.sinceId = AV._encode(this._sinceId);
|
24381 | params.maxId = AV._encode(this._maxId);
|
24382 | return params;
|
24383 | }
|
24384 | });
|
24385 | |
24386 |
|
24387 |
|
24388 |
|
24389 |
|
24390 |
|
24391 |
|
24392 |
|
24393 |
|
24394 |
|
24395 |
|
24396 |
|
24397 |
|
24398 |
|
24399 |
|
24400 |
|
24401 |
|
24402 | AV.Status.inboxQuery = function (owner, inboxType) {
|
24403 | var query = new AV.InboxQuery(AV.Status);
|
24404 |
|
24405 | if (owner) {
|
24406 | query._owner = owner;
|
24407 | }
|
24408 |
|
24409 | if (inboxType) {
|
24410 | query._inboxType = inboxType;
|
24411 | }
|
24412 |
|
24413 | return query;
|
24414 | };
|
24415 | };
|
24416 |
|
24417 | }),
|
24418 |
|
24419 | (function(module, exports, __webpack_require__) {
|
24420 |
|
24421 | "use strict";
|
24422 |
|
24423 |
|
24424 | var _interopRequireDefault = __webpack_require__(1);
|
24425 |
|
24426 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
24427 |
|
24428 | var _map = _interopRequireDefault(__webpack_require__(37));
|
24429 |
|
24430 | var _ = __webpack_require__(3);
|
24431 |
|
24432 | var AVRequest = __webpack_require__(28)._request;
|
24433 |
|
24434 | module.exports = function (AV) {
|
24435 | |
24436 |
|
24437 |
|
24438 |
|
24439 |
|
24440 |
|
24441 |
|
24442 |
|
24443 |
|
24444 |
|
24445 |
|
24446 | AV.SearchSortBuilder = function () {
|
24447 | this._sortFields = [];
|
24448 | };
|
24449 |
|
24450 | _.extend(AV.SearchSortBuilder.prototype,
|
24451 |
|
24452 | {
|
24453 | _addField: function _addField(key, order, mode, missing) {
|
24454 | var field = {};
|
24455 | field[key] = {
|
24456 | order: order || 'asc',
|
24457 | mode: mode || 'avg',
|
24458 | missing: '_' + (missing || 'last')
|
24459 | };
|
24460 |
|
24461 | this._sortFields.push(field);
|
24462 |
|
24463 | return this;
|
24464 | },
|
24465 |
|
24466 | |
24467 |
|
24468 |
|
24469 |
|
24470 |
|
24471 |
|
24472 |
|
24473 |
|
24474 |
|
24475 |
|
24476 | ascending: function ascending(key, mode, missing) {
|
24477 | return this._addField(key, 'asc', mode, missing);
|
24478 | },
|
24479 |
|
24480 | |
24481 |
|
24482 |
|
24483 |
|
24484 |
|
24485 |
|
24486 |
|
24487 |
|
24488 |
|
24489 |
|
24490 | descending: function descending(key, mode, missing) {
|
24491 | return this._addField(key, 'desc', mode, missing);
|
24492 | },
|
24493 |
|
24494 | |
24495 |
|
24496 |
|
24497 |
|
24498 |
|
24499 |
|
24500 |
|
24501 |
|
24502 | whereNear: function whereNear(key, point, options) {
|
24503 | options = options || {};
|
24504 | var field = {};
|
24505 | var geo = {
|
24506 | lat: point.latitude,
|
24507 | lon: point.longitude
|
24508 | };
|
24509 | var m = {
|
24510 | order: options.order || 'asc',
|
24511 | mode: options.mode || 'avg',
|
24512 | unit: options.unit || 'km'
|
24513 | };
|
24514 | m[key] = geo;
|
24515 | field['_geo_distance'] = m;
|
24516 |
|
24517 | this._sortFields.push(field);
|
24518 |
|
24519 | return this;
|
24520 | },
|
24521 |
|
24522 | |
24523 |
|
24524 |
|
24525 |
|
24526 | build: function build() {
|
24527 | return (0, _stringify.default)(AV._encode(this._sortFields));
|
24528 | }
|
24529 | });
|
24530 | |
24531 |
|
24532 |
|
24533 |
|
24534 |
|
24535 |
|
24536 |
|
24537 |
|
24538 |
|
24539 |
|
24540 |
|
24541 |
|
24542 |
|
24543 |
|
24544 |
|
24545 |
|
24546 |
|
24547 | AV.SearchQuery = AV.Query._extend(
|
24548 |
|
24549 | {
|
24550 | _sid: null,
|
24551 | _hits: 0,
|
24552 | _queryString: null,
|
24553 | _highlights: null,
|
24554 | _sortBuilder: null,
|
24555 | _clazz: null,
|
24556 | constructor: function constructor(className) {
|
24557 | if (className) {
|
24558 | this._clazz = className;
|
24559 | } else {
|
24560 | className = '__INVALID_CLASS';
|
24561 | }
|
24562 |
|
24563 | AV.Query.call(this, className);
|
24564 | },
|
24565 | _createRequest: function _createRequest(params, options) {
|
24566 | return AVRequest('search/select', null, null, 'GET', params || this._getParams(), options);
|
24567 | },
|
24568 |
|
24569 | |
24570 |
|
24571 |
|
24572 |
|
24573 |
|
24574 | sid: function sid(_sid) {
|
24575 | this._sid = _sid;
|
24576 | return this;
|
24577 | },
|
24578 |
|
24579 | |
24580 |
|
24581 |
|
24582 |
|
24583 |
|
24584 | queryString: function queryString(q) {
|
24585 | this._queryString = q;
|
24586 | return this;
|
24587 | },
|
24588 |
|
24589 | |
24590 |
|
24591 |
|
24592 |
|
24593 |
|
24594 |
|
24595 |
|
24596 |
|
24597 |
|
24598 |
|
24599 | highlights: function highlights(_highlights) {
|
24600 | var objects;
|
24601 |
|
24602 | if (_highlights && _.isString(_highlights)) {
|
24603 | objects = _.toArray(arguments);
|
24604 | } else {
|
24605 | objects = _highlights;
|
24606 | }
|
24607 |
|
24608 | this._highlights = objects;
|
24609 | return this;
|
24610 | },
|
24611 |
|
24612 | |
24613 |
|
24614 |
|
24615 |
|
24616 |
|
24617 |
|
24618 |
|
24619 | sortBy: function sortBy(builder) {
|
24620 | this._sortBuilder = builder;
|
24621 | return this;
|
24622 | },
|
24623 |
|
24624 | |
24625 |
|
24626 |
|
24627 |
|
24628 | hits: function hits() {
|
24629 | if (!this._hits) {
|
24630 | this._hits = 0;
|
24631 | }
|
24632 |
|
24633 | return this._hits;
|
24634 | },
|
24635 | _processResult: function _processResult(json) {
|
24636 | delete json['className'];
|
24637 | delete json['_app_url'];
|
24638 | delete json['_deeplink'];
|
24639 | return json;
|
24640 | },
|
24641 |
|
24642 | |
24643 |
|
24644 |
|
24645 |
|
24646 |
|
24647 |
|
24648 | hasMore: function hasMore() {
|
24649 | return !this._hitEnd;
|
24650 | },
|
24651 |
|
24652 | |
24653 |
|
24654 |
|
24655 |
|
24656 | reset: function reset() {
|
24657 | this._hitEnd = false;
|
24658 | this._sid = null;
|
24659 | this._hits = 0;
|
24660 | },
|
24661 |
|
24662 | |
24663 |
|
24664 |
|
24665 |
|
24666 |
|
24667 |
|
24668 |
|
24669 |
|
24670 |
|
24671 |
|
24672 | find: function find(options) {
|
24673 | var self = this;
|
24674 |
|
24675 | var request = this._createRequest(undefined, options);
|
24676 |
|
24677 | return request.then(function (response) {
|
24678 |
|
24679 | if (response.sid) {
|
24680 | self._oldSid = self._sid;
|
24681 | self._sid = response.sid;
|
24682 | } else {
|
24683 | self._sid = null;
|
24684 | self._hitEnd = true;
|
24685 | }
|
24686 |
|
24687 | self._hits = response.hits || 0;
|
24688 | return (0, _map.default)(_).call(_, response.results, function (json) {
|
24689 | if (json.className) {
|
24690 | response.className = json.className;
|
24691 | }
|
24692 |
|
24693 | var obj = self._newObject(response);
|
24694 |
|
24695 | obj.appURL = json['_app_url'];
|
24696 |
|
24697 | obj._finishFetch(self._processResult(json), true);
|
24698 |
|
24699 | return obj;
|
24700 | });
|
24701 | });
|
24702 | },
|
24703 | _getParams: function _getParams() {
|
24704 | var params = AV.SearchQuery.__super__._getParams.call(this);
|
24705 |
|
24706 | delete params.where;
|
24707 |
|
24708 | if (this._clazz) {
|
24709 | params.clazz = this.className;
|
24710 | }
|
24711 |
|
24712 | if (this._sid) {
|
24713 | params.sid = this._sid;
|
24714 | }
|
24715 |
|
24716 | if (!this._queryString) {
|
24717 | throw new Error('Please set query string.');
|
24718 | } else {
|
24719 | params.q = this._queryString;
|
24720 | }
|
24721 |
|
24722 | if (this._highlights) {
|
24723 | params.highlights = this._highlights.join(',');
|
24724 | }
|
24725 |
|
24726 | if (this._sortBuilder && params.order) {
|
24727 | throw new Error('sort and order can not be set at same time.');
|
24728 | }
|
24729 |
|
24730 | if (this._sortBuilder) {
|
24731 | params.sort = this._sortBuilder.build();
|
24732 | }
|
24733 |
|
24734 | return params;
|
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 |
|
24781 |
|
24782 |
|
24783 |
|
24784 |
|
24785 |
|
24786 |
|
24787 |
|
24788 |
|
24789 |
|
24790 |
|
24791 |
|
24792 |
|
24793 |
|
24794 |
|
24795 |
|
24796 |
|
24797 | }),
|
24798 |
|
24799 | (function(module, exports, __webpack_require__) {
|
24800 |
|
24801 | "use strict";
|
24802 |
|
24803 |
|
24804 | var _interopRequireDefault = __webpack_require__(1);
|
24805 |
|
24806 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
24807 |
|
24808 | var _ = __webpack_require__(3);
|
24809 |
|
24810 | var AVError = __webpack_require__(48);
|
24811 |
|
24812 | var _require = __webpack_require__(28),
|
24813 | request = _require.request;
|
24814 |
|
24815 | module.exports = function (AV) {
|
24816 | |
24817 |
|
24818 |
|
24819 |
|
24820 |
|
24821 |
|
24822 |
|
24823 |
|
24824 | AV.Insight = AV.Insight || {};
|
24825 |
|
24826 | _.extend(AV.Insight,
|
24827 |
|
24828 | {
|
24829 | |
24830 |
|
24831 |
|
24832 |
|
24833 |
|
24834 |
|
24835 |
|
24836 |
|
24837 |
|
24838 |
|
24839 |
|
24840 |
|
24841 |
|
24842 |
|
24843 |
|
24844 |
|
24845 | startJob: function startJob(jobConfig, options) {
|
24846 | if (!jobConfig || !jobConfig.sql) {
|
24847 | throw new Error('Please provide the sql to run the job.');
|
24848 | }
|
24849 |
|
24850 | var data = {
|
24851 | jobConfig: jobConfig,
|
24852 | appId: AV.applicationId
|
24853 | };
|
24854 | return request({
|
24855 | path: '/bigquery/jobs',
|
24856 | method: 'POST',
|
24857 | data: AV._encode(data, null, true),
|
24858 | authOptions: options,
|
24859 | signKey: false
|
24860 | }).then(function (resp) {
|
24861 | return AV._decode(resp).id;
|
24862 | });
|
24863 | },
|
24864 |
|
24865 | |
24866 |
|
24867 |
|
24868 |
|
24869 |
|
24870 |
|
24871 |
|
24872 |
|
24873 |
|
24874 |
|
24875 | on: function on(event, cb) {}
|
24876 | });
|
24877 | |
24878 |
|
24879 |
|
24880 |
|
24881 |
|
24882 |
|
24883 |
|
24884 |
|
24885 | AV.Insight.JobQuery = function (id, className) {
|
24886 | if (!id) {
|
24887 | throw new Error('Please provide the job id.');
|
24888 | }
|
24889 |
|
24890 | this.id = id;
|
24891 | this.className = className;
|
24892 | this._skip = 0;
|
24893 | this._limit = 100;
|
24894 | };
|
24895 |
|
24896 | _.extend(AV.Insight.JobQuery.prototype,
|
24897 |
|
24898 | {
|
24899 | |
24900 |
|
24901 |
|
24902 |
|
24903 |
|
24904 |
|
24905 |
|
24906 | skip: function skip(n) {
|
24907 | this._skip = n;
|
24908 | return this;
|
24909 | },
|
24910 |
|
24911 | |
24912 |
|
24913 |
|
24914 |
|
24915 |
|
24916 |
|
24917 | limit: function limit(n) {
|
24918 | this._limit = n;
|
24919 | return this;
|
24920 | },
|
24921 |
|
24922 | |
24923 |
|
24924 |
|
24925 |
|
24926 |
|
24927 |
|
24928 |
|
24929 |
|
24930 |
|
24931 |
|
24932 | find: function find(options) {
|
24933 | var params = {
|
24934 | skip: this._skip,
|
24935 | limit: this._limit
|
24936 | };
|
24937 | return request({
|
24938 | path: "/bigquery/jobs/".concat(this.id),
|
24939 | method: 'GET',
|
24940 | query: params,
|
24941 | authOptions: options,
|
24942 | signKey: false
|
24943 | }).then(function (response) {
|
24944 | if (response.error) {
|
24945 | return _promise.default.reject(new AVError(response.code, response.error));
|
24946 | }
|
24947 |
|
24948 | return _promise.default.resolve(response);
|
24949 | });
|
24950 | }
|
24951 | });
|
24952 | };
|
24953 |
|
24954 | }),
|
24955 |
|
24956 | (function(module, exports, __webpack_require__) {
|
24957 |
|
24958 | "use strict";
|
24959 |
|
24960 |
|
24961 | var _interopRequireDefault = __webpack_require__(1);
|
24962 |
|
24963 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
24964 |
|
24965 | var _ = __webpack_require__(3);
|
24966 |
|
24967 | var _require = __webpack_require__(28),
|
24968 | LCRequest = _require.request;
|
24969 |
|
24970 | var _require2 = __webpack_require__(32),
|
24971 | getSessionToken = _require2.getSessionToken;
|
24972 |
|
24973 | module.exports = function (AV) {
|
24974 | var getUserWithSessionToken = function getUserWithSessionToken(authOptions) {
|
24975 | if (authOptions.user) {
|
24976 | if (!authOptions.user._sessionToken) {
|
24977 | throw new Error('authOptions.user is not signed in.');
|
24978 | }
|
24979 |
|
24980 | return _promise.default.resolve(authOptions.user);
|
24981 | }
|
24982 |
|
24983 | if (authOptions.sessionToken) {
|
24984 | return AV.User._fetchUserBySessionToken(authOptions.sessionToken);
|
24985 | }
|
24986 |
|
24987 | return AV.User.currentAsync();
|
24988 | };
|
24989 |
|
24990 | var getSessionTokenAsync = function getSessionTokenAsync(authOptions) {
|
24991 | var sessionToken = getSessionToken(authOptions);
|
24992 |
|
24993 | if (sessionToken) {
|
24994 | return _promise.default.resolve(sessionToken);
|
24995 | }
|
24996 |
|
24997 | return AV.User.currentAsync().then(function (user) {
|
24998 | if (user) {
|
24999 | return user.getSessionToken();
|
25000 | }
|
25001 | });
|
25002 | };
|
25003 | |
25004 |
|
25005 |
|
25006 |
|
25007 |
|
25008 |
|
25009 | AV.Friendship = {
|
25010 | |
25011 |
|
25012 |
|
25013 |
|
25014 |
|
25015 |
|
25016 |
|
25017 |
|
25018 |
|
25019 | request: function request(options) {
|
25020 | var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25021 | var friend;
|
25022 | var attributes;
|
25023 |
|
25024 | if (options.friend) {
|
25025 | friend = options.friend;
|
25026 | attributes = options.attributes;
|
25027 | } else {
|
25028 | friend = options;
|
25029 | }
|
25030 |
|
25031 | var friendObj = _.isString(friend) ? AV.Object.createWithoutData('_User', friend) : friend;
|
25032 | return getUserWithSessionToken(authOptions).then(function (userObj) {
|
25033 | if (!userObj) {
|
25034 | throw new Error('Please signin an user.');
|
25035 | }
|
25036 |
|
25037 | return LCRequest({
|
25038 | method: 'POST',
|
25039 | path: '/users/friendshipRequests',
|
25040 | data: {
|
25041 | user: userObj._toPointer(),
|
25042 | friend: friendObj._toPointer(),
|
25043 | friendship: attributes
|
25044 | },
|
25045 | authOptions: authOptions
|
25046 | });
|
25047 | });
|
25048 | },
|
25049 |
|
25050 | |
25051 |
|
25052 |
|
25053 |
|
25054 |
|
25055 |
|
25056 |
|
25057 |
|
25058 |
|
25059 | acceptRequest: function acceptRequest(options) {
|
25060 | var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25061 | var request;
|
25062 | var attributes;
|
25063 |
|
25064 | if (options.request) {
|
25065 | request = options.request;
|
25066 | attributes = options.attributes;
|
25067 | } else {
|
25068 | request = options;
|
25069 | }
|
25070 |
|
25071 | var requestId = _.isString(request) ? request : request.id;
|
25072 | return getSessionTokenAsync(authOptions).then(function (sessionToken) {
|
25073 | if (!sessionToken) {
|
25074 | throw new Error('Please signin an user.');
|
25075 | }
|
25076 |
|
25077 | return LCRequest({
|
25078 | method: 'PUT',
|
25079 | path: '/users/friendshipRequests/' + requestId + '/accept',
|
25080 | data: {
|
25081 | friendship: AV._encode(attributes)
|
25082 | },
|
25083 | authOptions: authOptions
|
25084 | });
|
25085 | });
|
25086 | },
|
25087 |
|
25088 | |
25089 |
|
25090 |
|
25091 |
|
25092 |
|
25093 |
|
25094 | declineRequest: function declineRequest(request) {
|
25095 | var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25096 | var requestId = _.isString(request) ? request : request.id;
|
25097 | return getSessionTokenAsync(authOptions).then(function (sessionToken) {
|
25098 | if (!sessionToken) {
|
25099 | throw new Error('Please signin an user.');
|
25100 | }
|
25101 |
|
25102 | return LCRequest({
|
25103 | method: 'PUT',
|
25104 | path: '/users/friendshipRequests/' + requestId + '/decline',
|
25105 | authOptions: authOptions
|
25106 | });
|
25107 | });
|
25108 | }
|
25109 | };
|
25110 | };
|
25111 |
|
25112 | }),
|
25113 |
|
25114 | (function(module, exports, __webpack_require__) {
|
25115 |
|
25116 | "use strict";
|
25117 |
|
25118 |
|
25119 | var _interopRequireDefault = __webpack_require__(1);
|
25120 |
|
25121 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
25122 |
|
25123 | var _ = __webpack_require__(3);
|
25124 |
|
25125 | var _require = __webpack_require__(28),
|
25126 | _request = _require._request;
|
25127 |
|
25128 | var AV = __webpack_require__(74);
|
25129 |
|
25130 | var serializeMessage = function serializeMessage(message) {
|
25131 | if (typeof message === 'string') {
|
25132 | return message;
|
25133 | }
|
25134 |
|
25135 | if (typeof message.getPayload === 'function') {
|
25136 | return (0, _stringify.default)(message.getPayload());
|
25137 | }
|
25138 |
|
25139 | return (0, _stringify.default)(message);
|
25140 | };
|
25141 |
|
25142 |
|
25143 |
|
25144 |
|
25145 |
|
25146 |
|
25147 |
|
25148 |
|
25149 |
|
25150 |
|
25151 |
|
25152 |
|
25153 |
|
25154 |
|
25155 |
|
25156 | module.exports = AV.Object.extend('_Conversation',
|
25157 |
|
25158 | {
|
25159 | constructor: function constructor(name) {
|
25160 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25161 | AV.Object.prototype.constructor.call(this, null, null);
|
25162 | this.set('name', name);
|
25163 |
|
25164 | if (options.isSystem !== undefined) {
|
25165 | this.set('sys', options.isSystem ? true : false);
|
25166 | }
|
25167 |
|
25168 | if (options.isTransient !== undefined) {
|
25169 | this.set('tr', options.isTransient ? true : false);
|
25170 | }
|
25171 | },
|
25172 |
|
25173 | |
25174 |
|
25175 |
|
25176 |
|
25177 |
|
25178 | getCreator: function getCreator() {
|
25179 | return this.get('c');
|
25180 | },
|
25181 |
|
25182 | |
25183 |
|
25184 |
|
25185 |
|
25186 |
|
25187 | getLastMessageAt: function getLastMessageAt() {
|
25188 | return this.get('lm');
|
25189 | },
|
25190 |
|
25191 | |
25192 |
|
25193 |
|
25194 |
|
25195 |
|
25196 | getMembers: function getMembers() {
|
25197 | return this.get('m');
|
25198 | },
|
25199 |
|
25200 | |
25201 |
|
25202 |
|
25203 |
|
25204 |
|
25205 | addMember: function addMember(member) {
|
25206 | return this.add('m', member);
|
25207 | },
|
25208 |
|
25209 | |
25210 |
|
25211 |
|
25212 |
|
25213 |
|
25214 | getMutedMembers: function getMutedMembers() {
|
25215 | return this.get('mu');
|
25216 | },
|
25217 |
|
25218 | |
25219 |
|
25220 |
|
25221 |
|
25222 |
|
25223 | getName: function getName() {
|
25224 | return this.get('name');
|
25225 | },
|
25226 |
|
25227 | |
25228 |
|
25229 |
|
25230 |
|
25231 |
|
25232 | isTransient: function isTransient() {
|
25233 | return this.get('tr');
|
25234 | },
|
25235 |
|
25236 | |
25237 |
|
25238 |
|
25239 |
|
25240 |
|
25241 | isSystem: function isSystem() {
|
25242 | return this.get('sys');
|
25243 | },
|
25244 |
|
25245 | |
25246 |
|
25247 |
|
25248 |
|
25249 |
|
25250 |
|
25251 |
|
25252 |
|
25253 |
|
25254 |
|
25255 |
|
25256 |
|
25257 |
|
25258 |
|
25259 | send: function send(fromClient, message) {
|
25260 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
25261 | var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
25262 | var data = {
|
25263 | from_peer: fromClient,
|
25264 | conv_id: this.id,
|
25265 | transient: false,
|
25266 | message: serializeMessage(message)
|
25267 | };
|
25268 |
|
25269 | if (options.toClients !== undefined) {
|
25270 | data.to_peers = options.toClients;
|
25271 | }
|
25272 |
|
25273 | if (options.transient !== undefined) {
|
25274 | data.transient = options.transient ? true : false;
|
25275 | }
|
25276 |
|
25277 | if (options.pushData !== undefined) {
|
25278 | data.push_data = options.pushData;
|
25279 | }
|
25280 |
|
25281 | return _request('rtm', 'messages', null, 'POST', data, authOptions);
|
25282 | },
|
25283 |
|
25284 | |
25285 |
|
25286 |
|
25287 |
|
25288 |
|
25289 |
|
25290 |
|
25291 |
|
25292 |
|
25293 |
|
25294 |
|
25295 |
|
25296 |
|
25297 | broadcast: function broadcast(fromClient, message) {
|
25298 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
25299 | var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
25300 | var data = {
|
25301 | from_peer: fromClient,
|
25302 | conv_id: this.id,
|
25303 | message: serializeMessage(message)
|
25304 | };
|
25305 |
|
25306 | if (options.pushData !== undefined) {
|
25307 | data.push = options.pushData;
|
25308 | }
|
25309 |
|
25310 | if (options.validTill !== undefined) {
|
25311 | var ts = options.validTill;
|
25312 |
|
25313 | if (_.isDate(ts)) {
|
25314 | ts = ts.getTime();
|
25315 | }
|
25316 |
|
25317 | options.valid_till = ts;
|
25318 | }
|
25319 |
|
25320 | return _request('rtm', 'broadcast', null, 'POST', data, authOptions);
|
25321 | }
|
25322 | });
|
25323 |
|
25324 | }),
|
25325 |
|
25326 | (function(module, exports, __webpack_require__) {
|
25327 |
|
25328 | "use strict";
|
25329 |
|
25330 |
|
25331 | var _interopRequireDefault = __webpack_require__(1);
|
25332 |
|
25333 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
25334 |
|
25335 | var _map = _interopRequireDefault(__webpack_require__(37));
|
25336 |
|
25337 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
25338 |
|
25339 | var _ = __webpack_require__(3);
|
25340 |
|
25341 | var _require = __webpack_require__(28),
|
25342 | request = _require.request;
|
25343 |
|
25344 | var _require2 = __webpack_require__(32),
|
25345 | ensureArray = _require2.ensureArray,
|
25346 | parseDate = _require2.parseDate;
|
25347 |
|
25348 | var AV = __webpack_require__(74);
|
25349 |
|
25350 |
|
25351 |
|
25352 |
|
25353 |
|
25354 |
|
25355 | AV.LeaderboardVersionChangeInterval = {
|
25356 | NEVER: 'never',
|
25357 | DAY: 'day',
|
25358 | WEEK: 'week',
|
25359 | MONTH: 'month'
|
25360 | };
|
25361 |
|
25362 |
|
25363 |
|
25364 |
|
25365 |
|
25366 | AV.LeaderboardOrder = {
|
25367 | ASCENDING: 'ascending',
|
25368 | DESCENDING: 'descending'
|
25369 | };
|
25370 |
|
25371 |
|
25372 |
|
25373 |
|
25374 |
|
25375 | AV.LeaderboardUpdateStrategy = {
|
25376 |
|
25377 | BETTER: 'better',
|
25378 |
|
25379 |
|
25380 | LAST: 'last',
|
25381 |
|
25382 |
|
25383 | SUM: 'sum'
|
25384 | };
|
25385 |
|
25386 |
|
25387 |
|
25388 |
|
25389 |
|
25390 |
|
25391 |
|
25392 |
|
25393 |
|
25394 |
|
25395 |
|
25396 |
|
25397 |
|
25398 |
|
25399 |
|
25400 |
|
25401 |
|
25402 |
|
25403 |
|
25404 |
|
25405 |
|
25406 |
|
25407 | function Statistic(_ref) {
|
25408 | var name = _ref.name,
|
25409 | value = _ref.value,
|
25410 | version = _ref.version;
|
25411 |
|
25412 | |
25413 |
|
25414 |
|
25415 | this.name = name;
|
25416 | |
25417 |
|
25418 |
|
25419 |
|
25420 | this.value = value;
|
25421 | |
25422 |
|
25423 |
|
25424 |
|
25425 | this.version = version;
|
25426 | }
|
25427 |
|
25428 | var parseStatisticData = function parseStatisticData(statisticData) {
|
25429 | var _AV$_decode = AV._decode(statisticData),
|
25430 | name = _AV$_decode.statisticName,
|
25431 | value = _AV$_decode.statisticValue,
|
25432 | version = _AV$_decode.version;
|
25433 |
|
25434 | return new Statistic({
|
25435 | name: name,
|
25436 | value: value,
|
25437 | version: version
|
25438 | });
|
25439 | };
|
25440 |
|
25441 |
|
25442 |
|
25443 |
|
25444 |
|
25445 | AV.Leaderboard = function Leaderboard(statisticName) {
|
25446 | |
25447 |
|
25448 |
|
25449 | this.statisticName = statisticName;
|
25450 | |
25451 |
|
25452 |
|
25453 |
|
25454 | this.order = undefined;
|
25455 | |
25456 |
|
25457 |
|
25458 |
|
25459 | this.updateStrategy = undefined;
|
25460 | |
25461 |
|
25462 |
|
25463 |
|
25464 | this.versionChangeInterval = undefined;
|
25465 | |
25466 |
|
25467 |
|
25468 |
|
25469 | this.version = undefined;
|
25470 | |
25471 |
|
25472 |
|
25473 |
|
25474 | this.nextResetAt = undefined;
|
25475 | |
25476 |
|
25477 |
|
25478 |
|
25479 | this.createdAt = undefined;
|
25480 | };
|
25481 |
|
25482 | var Leaderboard = AV.Leaderboard;
|
25483 |
|
25484 |
|
25485 |
|
25486 |
|
25487 |
|
25488 |
|
25489 | AV.Leaderboard.createWithoutData = function (statisticName) {
|
25490 | return new Leaderboard(statisticName);
|
25491 | };
|
25492 |
|
25493 |
|
25494 |
|
25495 |
|
25496 |
|
25497 |
|
25498 |
|
25499 |
|
25500 |
|
25501 |
|
25502 |
|
25503 |
|
25504 | AV.Leaderboard.createLeaderboard = function (_ref2, authOptions) {
|
25505 | var statisticName = _ref2.statisticName,
|
25506 | order = _ref2.order,
|
25507 | versionChangeInterval = _ref2.versionChangeInterval,
|
25508 | updateStrategy = _ref2.updateStrategy;
|
25509 | return request({
|
25510 | method: 'POST',
|
25511 | path: '/leaderboard/leaderboards',
|
25512 | data: {
|
25513 | statisticName: statisticName,
|
25514 | order: order,
|
25515 | versionChangeInterval: versionChangeInterval,
|
25516 | updateStrategy: updateStrategy
|
25517 | },
|
25518 | authOptions: authOptions
|
25519 | }).then(function (data) {
|
25520 | var leaderboard = new Leaderboard(statisticName);
|
25521 | return leaderboard._finishFetch(data);
|
25522 | });
|
25523 | };
|
25524 |
|
25525 |
|
25526 |
|
25527 |
|
25528 |
|
25529 |
|
25530 |
|
25531 |
|
25532 | AV.Leaderboard.getLeaderboard = function (statisticName, authOptions) {
|
25533 | return Leaderboard.createWithoutData(statisticName).fetch(authOptions);
|
25534 | };
|
25535 |
|
25536 |
|
25537 |
|
25538 |
|
25539 |
|
25540 |
|
25541 |
|
25542 |
|
25543 |
|
25544 |
|
25545 | AV.Leaderboard.getStatistics = function (user) {
|
25546 | var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
25547 | statisticNames = _ref3.statisticNames;
|
25548 |
|
25549 | var authOptions = arguments.length > 2 ? arguments[2] : undefined;
|
25550 | return _promise.default.resolve().then(function () {
|
25551 | if (!(user && user.id)) throw new Error('user must be an AV.User');
|
25552 | return request({
|
25553 | method: 'GET',
|
25554 | path: "/leaderboard/users/".concat(user.id, "/statistics"),
|
25555 | query: {
|
25556 | statistics: statisticNames ? ensureArray(statisticNames).join(',') : undefined
|
25557 | },
|
25558 | authOptions: authOptions
|
25559 | }).then(function (_ref4) {
|
25560 | var results = _ref4.results;
|
25561 | return (0, _map.default)(results).call(results, parseStatisticData);
|
25562 | });
|
25563 | });
|
25564 | };
|
25565 |
|
25566 |
|
25567 |
|
25568 |
|
25569 |
|
25570 |
|
25571 |
|
25572 |
|
25573 |
|
25574 |
|
25575 | AV.Leaderboard.updateStatistics = function (user, statistics) {
|
25576 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
25577 | return _promise.default.resolve().then(function () {
|
25578 | if (!(user && user.id)) throw new Error('user must be an AV.User');
|
25579 | var data = (0, _map.default)(_).call(_, statistics, function (value, key) {
|
25580 | return {
|
25581 | statisticName: key,
|
25582 | statisticValue: value
|
25583 | };
|
25584 | });
|
25585 | var overwrite = options.overwrite;
|
25586 | return request({
|
25587 | method: 'POST',
|
25588 | path: "/leaderboard/users/".concat(user.id, "/statistics"),
|
25589 | query: {
|
25590 | overwrite: overwrite ? 1 : undefined
|
25591 | },
|
25592 | data: data,
|
25593 | authOptions: options
|
25594 | }).then(function (_ref5) {
|
25595 | var results = _ref5.results;
|
25596 | return (0, _map.default)(results).call(results, parseStatisticData);
|
25597 | });
|
25598 | });
|
25599 | };
|
25600 |
|
25601 |
|
25602 |
|
25603 |
|
25604 |
|
25605 |
|
25606 |
|
25607 |
|
25608 |
|
25609 | AV.Leaderboard.deleteStatistics = function (user, statisticNames, authOptions) {
|
25610 | return _promise.default.resolve().then(function () {
|
25611 | if (!(user && user.id)) throw new Error('user must be an AV.User');
|
25612 | return request({
|
25613 | method: 'DELETE',
|
25614 | path: "/leaderboard/users/".concat(user.id, "/statistics"),
|
25615 | query: {
|
25616 | statistics: ensureArray(statisticNames).join(',')
|
25617 | },
|
25618 | authOptions: authOptions
|
25619 | }).then(function () {
|
25620 | return undefined;
|
25621 | });
|
25622 | });
|
25623 | };
|
25624 |
|
25625 | _.extend(Leaderboard.prototype,
|
25626 |
|
25627 | {
|
25628 | _finishFetch: function _finishFetch(data) {
|
25629 | var _this = this;
|
25630 |
|
25631 | _.forEach(data, function (value, key) {
|
25632 | if (key === 'updatedAt' || key === 'objectId') return;
|
25633 |
|
25634 | if (key === 'expiredAt') {
|
25635 | key = 'nextResetAt';
|
25636 | }
|
25637 |
|
25638 | if (key === 'createdAt') {
|
25639 | value = parseDate(value);
|
25640 | }
|
25641 |
|
25642 | if (value && value.__type === 'Date') {
|
25643 | value = parseDate(value.iso);
|
25644 | }
|
25645 |
|
25646 | _this[key] = value;
|
25647 | });
|
25648 |
|
25649 | return this;
|
25650 | },
|
25651 |
|
25652 | |
25653 |
|
25654 |
|
25655 |
|
25656 |
|
25657 | fetch: function fetch(authOptions) {
|
25658 | var _this2 = this;
|
25659 |
|
25660 | return request({
|
25661 | method: 'GET',
|
25662 | path: "/leaderboard/leaderboards/".concat(this.statisticName),
|
25663 | authOptions: authOptions
|
25664 | }).then(function (data) {
|
25665 | return _this2._finishFetch(data);
|
25666 | });
|
25667 | },
|
25668 |
|
25669 | |
25670 |
|
25671 |
|
25672 |
|
25673 |
|
25674 |
|
25675 |
|
25676 | count: function count() {
|
25677 | var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
25678 | version = _ref6.version;
|
25679 |
|
25680 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
25681 | return request({
|
25682 | method: 'GET',
|
25683 | path: "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks"),
|
25684 | query: {
|
25685 | count: 1,
|
25686 | limit: 0,
|
25687 | version: version
|
25688 | },
|
25689 | authOptions: authOptions
|
25690 | }).then(function (_ref7) {
|
25691 | var count = _ref7.count;
|
25692 | return count;
|
25693 | });
|
25694 | },
|
25695 | _getResults: function _getResults(_ref8, authOptions, userId) {
|
25696 | var _context;
|
25697 |
|
25698 | var skip = _ref8.skip,
|
25699 | limit = _ref8.limit,
|
25700 | selectUserKeys = _ref8.selectUserKeys,
|
25701 | includeUserKeys = _ref8.includeUserKeys,
|
25702 | includeStatistics = _ref8.includeStatistics,
|
25703 | version = _ref8.version;
|
25704 | return request({
|
25705 | method: 'GET',
|
25706 | path: (0, _concat.default)(_context = "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks")).call(_context, userId ? "/".concat(userId) : ''),
|
25707 | query: {
|
25708 | skip: skip,
|
25709 | limit: limit,
|
25710 | selectUserKeys: _.union(ensureArray(selectUserKeys), ensureArray(includeUserKeys)).join(',') || undefined,
|
25711 | includeUser: includeUserKeys ? ensureArray(includeUserKeys).join(',') : undefined,
|
25712 | includeStatistics: includeStatistics ? ensureArray(includeStatistics).join(',') : undefined,
|
25713 | version: version
|
25714 | },
|
25715 | authOptions: authOptions
|
25716 | }).then(function (_ref9) {
|
25717 | var rankings = _ref9.results;
|
25718 | return (0, _map.default)(rankings).call(rankings, function (rankingData) {
|
25719 | var _AV$_decode2 = AV._decode(rankingData),
|
25720 | user = _AV$_decode2.user,
|
25721 | value = _AV$_decode2.statisticValue,
|
25722 | rank = _AV$_decode2.rank,
|
25723 | _AV$_decode2$statisti = _AV$_decode2.statistics,
|
25724 | statistics = _AV$_decode2$statisti === void 0 ? [] : _AV$_decode2$statisti;
|
25725 |
|
25726 | return {
|
25727 | user: user,
|
25728 | value: value,
|
25729 | rank: rank,
|
25730 | includedStatistics: (0, _map.default)(statistics).call(statistics, parseStatisticData)
|
25731 | };
|
25732 | });
|
25733 | });
|
25734 | },
|
25735 |
|
25736 | |
25737 |
|
25738 |
|
25739 |
|
25740 |
|
25741 |
|
25742 |
|
25743 |
|
25744 |
|
25745 |
|
25746 |
|
25747 |
|
25748 | getResults: function getResults() {
|
25749 | var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
25750 | skip = _ref10.skip,
|
25751 | limit = _ref10.limit,
|
25752 | selectUserKeys = _ref10.selectUserKeys,
|
25753 | includeUserKeys = _ref10.includeUserKeys,
|
25754 | includeStatistics = _ref10.includeStatistics,
|
25755 | version = _ref10.version;
|
25756 |
|
25757 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
25758 | return this._getResults({
|
25759 | skip: skip,
|
25760 | limit: limit,
|
25761 | selectUserKeys: selectUserKeys,
|
25762 | includeUserKeys: includeUserKeys,
|
25763 | includeStatistics: includeStatistics,
|
25764 | version: version
|
25765 | }, authOptions);
|
25766 | },
|
25767 |
|
25768 | |
25769 |
|
25770 |
|
25771 |
|
25772 |
|
25773 |
|
25774 |
|
25775 |
|
25776 |
|
25777 |
|
25778 |
|
25779 |
|
25780 | getResultsAroundUser: function getResultsAroundUser(user) {
|
25781 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25782 | var authOptions = arguments.length > 2 ? arguments[2] : undefined;
|
25783 |
|
25784 |
|
25785 | if (user && typeof user.id !== 'string') {
|
25786 | return this.getResultsAroundUser(undefined, user, options);
|
25787 | }
|
25788 |
|
25789 | var limit = options.limit,
|
25790 | selectUserKeys = options.selectUserKeys,
|
25791 | includeUserKeys = options.includeUserKeys,
|
25792 | includeStatistics = options.includeStatistics,
|
25793 | version = options.version;
|
25794 | return this._getResults({
|
25795 | limit: limit,
|
25796 | selectUserKeys: selectUserKeys,
|
25797 | includeUserKeys: includeUserKeys,
|
25798 | includeStatistics: includeStatistics,
|
25799 | version: version
|
25800 | }, authOptions, user ? user.id : 'self');
|
25801 | },
|
25802 | _update: function _update(data, authOptions) {
|
25803 | var _this3 = this;
|
25804 |
|
25805 | return request({
|
25806 | method: 'PUT',
|
25807 | path: "/leaderboard/leaderboards/".concat(this.statisticName),
|
25808 | data: data,
|
25809 | authOptions: authOptions
|
25810 | }).then(function (result) {
|
25811 | return _this3._finishFetch(result);
|
25812 | });
|
25813 | },
|
25814 |
|
25815 | |
25816 |
|
25817 |
|
25818 |
|
25819 |
|
25820 |
|
25821 | updateVersionChangeInterval: function updateVersionChangeInterval(versionChangeInterval, authOptions) {
|
25822 | return this._update({
|
25823 | versionChangeInterval: versionChangeInterval
|
25824 | }, authOptions);
|
25825 | },
|
25826 |
|
25827 | |
25828 |
|
25829 |
|
25830 |
|
25831 |
|
25832 |
|
25833 | updateUpdateStrategy: function updateUpdateStrategy(updateStrategy, authOptions) {
|
25834 | return this._update({
|
25835 | updateStrategy: updateStrategy
|
25836 | }, authOptions);
|
25837 | },
|
25838 |
|
25839 | |
25840 |
|
25841 |
|
25842 |
|
25843 |
|
25844 | reset: function reset(authOptions) {
|
25845 | var _this4 = this;
|
25846 |
|
25847 | return request({
|
25848 | method: 'PUT',
|
25849 | path: "/leaderboard/leaderboards/".concat(this.statisticName, "/incrementVersion"),
|
25850 | authOptions: authOptions
|
25851 | }).then(function (data) {
|
25852 | return _this4._finishFetch(data);
|
25853 | });
|
25854 | },
|
25855 |
|
25856 | |
25857 |
|
25858 |
|
25859 |
|
25860 |
|
25861 | destroy: function destroy(authOptions) {
|
25862 | return AV.request({
|
25863 | method: 'DELETE',
|
25864 | path: "/leaderboard/leaderboards/".concat(this.statisticName),
|
25865 | authOptions: authOptions
|
25866 | }).then(function () {
|
25867 | return undefined;
|
25868 | });
|
25869 | },
|
25870 |
|
25871 | |
25872 |
|
25873 |
|
25874 |
|
25875 |
|
25876 |
|
25877 |
|
25878 |
|
25879 | getArchives: function getArchives() {
|
25880 | var _this5 = this;
|
25881 |
|
25882 | var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
25883 | skip = _ref11.skip,
|
25884 | limit = _ref11.limit;
|
25885 |
|
25886 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
25887 | return request({
|
25888 | method: 'GET',
|
25889 | path: "/leaderboard/leaderboards/".concat(this.statisticName, "/archives"),
|
25890 | query: {
|
25891 | skip: skip,
|
25892 | limit: limit
|
25893 | },
|
25894 | authOptions: authOptions
|
25895 | }).then(function (_ref12) {
|
25896 | var results = _ref12.results;
|
25897 | return (0, _map.default)(results).call(results, function (_ref13) {
|
25898 | var version = _ref13.version,
|
25899 | status = _ref13.status,
|
25900 | url = _ref13.url,
|
25901 | activatedAt = _ref13.activatedAt,
|
25902 | deactivatedAt = _ref13.deactivatedAt;
|
25903 | return {
|
25904 | statisticName: _this5.statisticName,
|
25905 | version: version,
|
25906 | status: status,
|
25907 | url: url,
|
25908 | activatedAt: parseDate(activatedAt.iso),
|
25909 | deactivatedAt: parseDate(deactivatedAt.iso)
|
25910 | };
|
25911 | });
|
25912 | });
|
25913 | }
|
25914 | });
|
25915 |
|
25916 | }),
|
25917 |
|
25918 | (function(module, exports, __webpack_require__) {
|
25919 |
|
25920 | "use strict";
|
25921 |
|
25922 |
|
25923 | var _Object$defineProperty = __webpack_require__(94);
|
25924 |
|
25925 | _Object$defineProperty(exports, "__esModule", {
|
25926 | value: true
|
25927 | });
|
25928 |
|
25929 | exports.platformInfo = exports.WebSocket = void 0;
|
25930 |
|
25931 | _Object$defineProperty(exports, "request", {
|
25932 | enumerable: true,
|
25933 | get: function get() {
|
25934 | return _adaptersSuperagent.request;
|
25935 | }
|
25936 | });
|
25937 |
|
25938 | exports.storage = void 0;
|
25939 |
|
25940 | _Object$defineProperty(exports, "upload", {
|
25941 | enumerable: true,
|
25942 | get: function get() {
|
25943 | return _adaptersSuperagent.upload;
|
25944 | }
|
25945 | });
|
25946 |
|
25947 | var _adaptersSuperagent = __webpack_require__(575);
|
25948 |
|
25949 | var storage = window.localStorage;
|
25950 | exports.storage = storage;
|
25951 | var WebSocket = window.WebSocket;
|
25952 | exports.WebSocket = WebSocket;
|
25953 | var platformInfo = {
|
25954 | name: "Browser"
|
25955 | };
|
25956 | exports.platformInfo = platformInfo;
|
25957 |
|
25958 | }),
|
25959 |
|
25960 | (function(module, exports, __webpack_require__) {
|
25961 |
|
25962 | "use strict";
|
25963 |
|
25964 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
25965 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
25966 | return new (P || (P = Promise))(function (resolve, reject) {
|
25967 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
25968 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
25969 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
25970 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
25971 | });
|
25972 | };
|
25973 | var __generator = (this && this.__generator) || function (thisArg, body) {
|
25974 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
25975 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
25976 | function verb(n) { return function (v) { return step([n, v]); }; }
|
25977 | function step(op) {
|
25978 | if (f) throw new TypeError("Generator is already executing.");
|
25979 | while (_) try {
|
25980 | 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;
|
25981 | if (y = 0, t) op = [op[0] & 2, t.value];
|
25982 | switch (op[0]) {
|
25983 | case 0: case 1: t = op; break;
|
25984 | case 4: _.label++; return { value: op[1], done: false };
|
25985 | case 5: _.label++; y = op[1]; op = [0]; continue;
|
25986 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
25987 | default:
|
25988 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
25989 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
25990 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
25991 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
25992 | if (t[2]) _.ops.pop();
|
25993 | _.trys.pop(); continue;
|
25994 | }
|
25995 | op = body.call(thisArg, _);
|
25996 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
25997 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
25998 | }
|
25999 | };
|
26000 | Object.defineProperty(exports, "__esModule", { value: true });
|
26001 | exports.upload = exports.request = void 0;
|
26002 | var adapter_utils_1 = __webpack_require__(576);
|
26003 | var superagent = __webpack_require__(577);
|
26004 | function convertResponse(res) {
|
26005 | return {
|
26006 | ok: res.ok,
|
26007 | status: res.status,
|
26008 | headers: res.header,
|
26009 | data: res.body,
|
26010 | };
|
26011 | }
|
26012 | var request = function (url, options) {
|
26013 | if (options === void 0) { options = {}; }
|
26014 | return __awaiter(void 0, void 0, void 0, function () {
|
26015 | var _a, method, data, headers, onprogress, signal, req, aborted, onAbort, res, error_1;
|
26016 | return __generator(this, function (_b) {
|
26017 | switch (_b.label) {
|
26018 | case 0:
|
26019 | _a = options.method, method = _a === void 0 ? "GET" : _a, data = options.data, headers = options.headers, onprogress = options.onprogress, signal = options.signal;
|
26020 | if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
26021 | throw new adapter_utils_1.AbortError("Request aborted");
|
26022 | }
|
26023 | req = superagent(method, url).ok(function () { return true; });
|
26024 | if (headers) {
|
26025 | req.set(headers);
|
26026 | }
|
26027 | if (onprogress) {
|
26028 | req.on("progress", onprogress);
|
26029 | }
|
26030 | aborted = false;
|
26031 | onAbort = function () {
|
26032 | aborted = true;
|
26033 | req.abort();
|
26034 | };
|
26035 | signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", onAbort);
|
26036 | _b.label = 1;
|
26037 | case 1:
|
26038 | _b.trys.push([1, 3, 4, 5]);
|
26039 | return [4 , req.send(data)];
|
26040 | case 2:
|
26041 | res = _b.sent();
|
26042 | return [2 , convertResponse(res)];
|
26043 | case 3:
|
26044 | error_1 = _b.sent();
|
26045 | if (aborted) {
|
26046 | throw new adapter_utils_1.AbortError("Request aborted");
|
26047 | }
|
26048 | throw error_1;
|
26049 | case 4:
|
26050 | signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", onAbort);
|
26051 | return [7 ];
|
26052 | case 5: return [2 ];
|
26053 | }
|
26054 | });
|
26055 | });
|
26056 | };
|
26057 | exports.request = request;
|
26058 | var upload = function (url, file, options) {
|
26059 | if (options === void 0) { options = {}; }
|
26060 | return __awaiter(void 0, void 0, void 0, function () {
|
26061 | var _a, method, data, headers, onprogress, signal, req, aborted, onAbort, res, error_2;
|
26062 | return __generator(this, function (_b) {
|
26063 | switch (_b.label) {
|
26064 | case 0:
|
26065 | _a = options.method, method = _a === void 0 ? "POST" : _a, data = options.data, headers = options.headers, onprogress = options.onprogress, signal = options.signal;
|
26066 | if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
26067 | throw new adapter_utils_1.AbortError("Request aborted");
|
26068 | }
|
26069 | req = superagent(method, url)
|
26070 | .ok(function () { return true; })
|
26071 | .attach(file.field, file.data, file.name);
|
26072 | if (data) {
|
26073 | req.field(data);
|
26074 | }
|
26075 | if (headers) {
|
26076 | req.set(headers);
|
26077 | }
|
26078 | if (onprogress) {
|
26079 | req.on("progress", onprogress);
|
26080 | }
|
26081 | aborted = false;
|
26082 | onAbort = function () {
|
26083 | aborted = true;
|
26084 | req.abort();
|
26085 | };
|
26086 | signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", onAbort);
|
26087 | _b.label = 1;
|
26088 | case 1:
|
26089 | _b.trys.push([1, 3, 4, 5]);
|
26090 | return [4 , req];
|
26091 | case 2:
|
26092 | res = _b.sent();
|
26093 | return [2 , convertResponse(res)];
|
26094 | case 3:
|
26095 | error_2 = _b.sent();
|
26096 | if (aborted) {
|
26097 | throw new adapter_utils_1.AbortError("Request aborted");
|
26098 | }
|
26099 | throw error_2;
|
26100 | case 4:
|
26101 | signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", onAbort);
|
26102 | return [7 ];
|
26103 | case 5: return [2 ];
|
26104 | }
|
26105 | });
|
26106 | });
|
26107 | };
|
26108 | exports.upload = upload;
|
26109 |
|
26110 |
|
26111 | }),
|
26112 |
|
26113 | (function(module, __webpack_exports__, __webpack_require__) {
|
26114 |
|
26115 | "use strict";
|
26116 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
26117 | __webpack_require__.d(__webpack_exports__, "AbortError", function() { return AbortError; });
|
26118 |
|
26119 |
|
26120 |
|
26121 |
|
26122 |
|
26123 |
|
26124 |
|
26125 |
|
26126 |
|
26127 |
|
26128 |
|
26129 |
|
26130 |
|
26131 |
|
26132 |
|
26133 |
|
26134 | var extendStatics = function(d, b) {
|
26135 | extendStatics = Object.setPrototypeOf ||
|
26136 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
26137 | function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
26138 | return extendStatics(d, b);
|
26139 | };
|
26140 |
|
26141 | function __extends(d, b) {
|
26142 | extendStatics(d, b);
|
26143 | function __() { this.constructor = d; }
|
26144 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
26145 | }
|
26146 |
|
26147 | var AbortError = (function (_super) {
|
26148 | __extends(AbortError, _super);
|
26149 | function AbortError() {
|
26150 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
26151 | _this.name = "AbortError";
|
26152 | return _this;
|
26153 | }
|
26154 | return AbortError;
|
26155 | }(Error));
|
26156 |
|
26157 |
|
26158 |
|
26159 |
|
26160 |
|
26161 | }),
|
26162 |
|
26163 | (function(module, exports, __webpack_require__) {
|
26164 |
|
26165 | "use strict";
|
26166 |
|
26167 |
|
26168 | var _interopRequireDefault = __webpack_require__(1);
|
26169 |
|
26170 | var _symbol = _interopRequireDefault(__webpack_require__(77));
|
26171 |
|
26172 | var _iterator = _interopRequireDefault(__webpack_require__(155));
|
26173 |
|
26174 | var _trim = _interopRequireDefault(__webpack_require__(578));
|
26175 |
|
26176 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
26177 |
|
26178 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
26179 |
|
26180 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
26181 |
|
26182 | function _typeof(obj) {
|
26183 | "@babel/helpers - typeof";
|
26184 |
|
26185 | if (typeof _symbol.default === "function" && typeof _iterator.default === "symbol") {
|
26186 | _typeof = function _typeof(obj) {
|
26187 | return typeof obj;
|
26188 | };
|
26189 | } else {
|
26190 | _typeof = function _typeof(obj) {
|
26191 | return obj && typeof _symbol.default === "function" && obj.constructor === _symbol.default && obj !== _symbol.default.prototype ? "symbol" : typeof obj;
|
26192 | };
|
26193 | }
|
26194 |
|
26195 | return _typeof(obj);
|
26196 | }
|
26197 |
|
26198 |
|
26199 |
|
26200 |
|
26201 |
|
26202 | var root;
|
26203 |
|
26204 | if (typeof window !== 'undefined') {
|
26205 |
|
26206 | root = window;
|
26207 | } else if (typeof self === 'undefined') {
|
26208 |
|
26209 | console.warn('Using browser-only version of superagent in non-browser environment');
|
26210 | root = void 0;
|
26211 | } else {
|
26212 |
|
26213 | root = self;
|
26214 | }
|
26215 |
|
26216 | var Emitter = __webpack_require__(585);
|
26217 |
|
26218 | var safeStringify = __webpack_require__(586);
|
26219 |
|
26220 | var RequestBase = __webpack_require__(587);
|
26221 |
|
26222 | var isObject = __webpack_require__(261);
|
26223 |
|
26224 | var ResponseBase = __webpack_require__(608);
|
26225 |
|
26226 | var Agent = __webpack_require__(615);
|
26227 |
|
26228 |
|
26229 |
|
26230 |
|
26231 |
|
26232 | function noop() {}
|
26233 |
|
26234 |
|
26235 |
|
26236 |
|
26237 |
|
26238 | module.exports = function (method, url) {
|
26239 |
|
26240 | if (typeof url === 'function') {
|
26241 | return new exports.Request('GET', method).end(url);
|
26242 | }
|
26243 |
|
26244 |
|
26245 | if (arguments.length === 1) {
|
26246 | return new exports.Request('GET', method);
|
26247 | }
|
26248 |
|
26249 | return new exports.Request(method, url);
|
26250 | };
|
26251 |
|
26252 | exports = module.exports;
|
26253 | var request = exports;
|
26254 | exports.Request = Request;
|
26255 |
|
26256 |
|
26257 |
|
26258 |
|
26259 | request.getXHR = function () {
|
26260 | if (root.XMLHttpRequest && (!root.location || root.location.protocol !== 'file:' || !root.ActiveXObject)) {
|
26261 | return new XMLHttpRequest();
|
26262 | }
|
26263 |
|
26264 | try {
|
26265 | return new ActiveXObject('Microsoft.XMLHTTP');
|
26266 | } catch (_unused) {}
|
26267 |
|
26268 | try {
|
26269 | return new ActiveXObject('Msxml2.XMLHTTP.6.0');
|
26270 | } catch (_unused2) {}
|
26271 |
|
26272 | try {
|
26273 | return new ActiveXObject('Msxml2.XMLHTTP.3.0');
|
26274 | } catch (_unused3) {}
|
26275 |
|
26276 | try {
|
26277 | return new ActiveXObject('Msxml2.XMLHTTP');
|
26278 | } catch (_unused4) {}
|
26279 |
|
26280 | throw new Error('Browser-only version of superagent could not find XHR');
|
26281 | };
|
26282 |
|
26283 |
|
26284 |
|
26285 |
|
26286 |
|
26287 |
|
26288 |
|
26289 |
|
26290 |
|
26291 | var trim = (0, _trim.default)('') ? function (s) {
|
26292 | return (0, _trim.default)(s).call(s);
|
26293 | } : function (s) {
|
26294 | return s.replace(/(^\s*|\s*$)/g, '');
|
26295 | };
|
26296 |
|
26297 |
|
26298 |
|
26299 |
|
26300 |
|
26301 |
|
26302 |
|
26303 |
|
26304 | function serialize(obj) {
|
26305 | if (!isObject(obj)) return obj;
|
26306 | var pairs = [];
|
26307 |
|
26308 | for (var key in obj) {
|
26309 | if (Object.prototype.hasOwnProperty.call(obj, key)) pushEncodedKeyValuePair(pairs, key, obj[key]);
|
26310 | }
|
26311 |
|
26312 | return pairs.join('&');
|
26313 | }
|
26314 |
|
26315 |
|
26316 |
|
26317 |
|
26318 |
|
26319 |
|
26320 |
|
26321 |
|
26322 |
|
26323 |
|
26324 | function pushEncodedKeyValuePair(pairs, key, val) {
|
26325 | if (val === undefined) return;
|
26326 |
|
26327 | if (val === null) {
|
26328 | pairs.push(encodeURI(key));
|
26329 | return;
|
26330 | }
|
26331 |
|
26332 | if (Array.isArray(val)) {
|
26333 | val.forEach(function (v) {
|
26334 | pushEncodedKeyValuePair(pairs, key, v);
|
26335 | });
|
26336 | } else if (isObject(val)) {
|
26337 | for (var subkey in val) {
|
26338 | var _context;
|
26339 |
|
26340 | if (Object.prototype.hasOwnProperty.call(val, subkey)) pushEncodedKeyValuePair(pairs, (0, _concat.default)(_context = "".concat(key, "[")).call(_context, subkey, "]"), val[subkey]);
|
26341 | }
|
26342 | } else {
|
26343 | pairs.push(encodeURI(key) + '=' + encodeURIComponent(val));
|
26344 | }
|
26345 | }
|
26346 |
|
26347 |
|
26348 |
|
26349 |
|
26350 |
|
26351 | request.serializeObject = serialize;
|
26352 |
|
26353 |
|
26354 |
|
26355 |
|
26356 |
|
26357 |
|
26358 |
|
26359 |
|
26360 | function parseString(str) {
|
26361 | var obj = {};
|
26362 | var pairs = str.split('&');
|
26363 | var pair;
|
26364 | var pos;
|
26365 |
|
26366 | for (var i = 0, len = pairs.length; i < len; ++i) {
|
26367 | pair = pairs[i];
|
26368 | pos = (0, _indexOf.default)(pair).call(pair, '=');
|
26369 |
|
26370 | if (pos === -1) {
|
26371 | obj[decodeURIComponent(pair)] = '';
|
26372 | } else {
|
26373 | obj[decodeURIComponent((0, _slice.default)(pair).call(pair, 0, pos))] = decodeURIComponent((0, _slice.default)(pair).call(pair, pos + 1));
|
26374 | }
|
26375 | }
|
26376 |
|
26377 | return obj;
|
26378 | }
|
26379 |
|
26380 |
|
26381 |
|
26382 |
|
26383 |
|
26384 | request.parseString = parseString;
|
26385 |
|
26386 |
|
26387 |
|
26388 |
|
26389 |
|
26390 |
|
26391 |
|
26392 | request.types = {
|
26393 | html: 'text/html',
|
26394 | json: 'application/json',
|
26395 | xml: 'text/xml',
|
26396 | urlencoded: 'application/x-www-form-urlencoded',
|
26397 | form: 'application/x-www-form-urlencoded',
|
26398 | 'form-data': 'application/x-www-form-urlencoded'
|
26399 | };
|
26400 |
|
26401 |
|
26402 |
|
26403 |
|
26404 |
|
26405 |
|
26406 |
|
26407 |
|
26408 |
|
26409 | request.serialize = {
|
26410 | 'application/x-www-form-urlencoded': serialize,
|
26411 | 'application/json': safeStringify
|
26412 | };
|
26413 |
|
26414 |
|
26415 |
|
26416 |
|
26417 |
|
26418 |
|
26419 |
|
26420 |
|
26421 |
|
26422 | request.parse = {
|
26423 | 'application/x-www-form-urlencoded': parseString,
|
26424 | 'application/json': JSON.parse
|
26425 | };
|
26426 |
|
26427 |
|
26428 |
|
26429 |
|
26430 |
|
26431 |
|
26432 |
|
26433 |
|
26434 |
|
26435 | function parseHeader(str) {
|
26436 | var lines = str.split(/\r?\n/);
|
26437 | var fields = {};
|
26438 | var index;
|
26439 | var line;
|
26440 | var field;
|
26441 | var val;
|
26442 |
|
26443 | for (var i = 0, len = lines.length; i < len; ++i) {
|
26444 | line = lines[i];
|
26445 | index = (0, _indexOf.default)(line).call(line, ':');
|
26446 |
|
26447 | if (index === -1) {
|
26448 |
|
26449 | continue;
|
26450 | }
|
26451 |
|
26452 | field = (0, _slice.default)(line).call(line, 0, index).toLowerCase();
|
26453 | val = trim((0, _slice.default)(line).call(line, index + 1));
|
26454 | fields[field] = val;
|
26455 | }
|
26456 |
|
26457 | return fields;
|
26458 | }
|
26459 |
|
26460 |
|
26461 |
|
26462 |
|
26463 |
|
26464 |
|
26465 |
|
26466 |
|
26467 |
|
26468 | function isJSON(mime) {
|
26469 |
|
26470 |
|
26471 | return /[/+]json($|[^-\w])/.test(mime);
|
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 |
|
26502 |
|
26503 |
|
26504 |
|
26505 |
|
26506 |
|
26507 |
|
26508 |
|
26509 |
|
26510 |
|
26511 |
|
26512 |
|
26513 |
|
26514 |
|
26515 |
|
26516 |
|
26517 |
|
26518 |
|
26519 |
|
26520 | function Response(req) {
|
26521 | this.req = req;
|
26522 | this.xhr = this.req.xhr;
|
26523 |
|
26524 | this.text = this.req.method !== 'HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text') || typeof this.xhr.responseType === 'undefined' ? this.xhr.responseText : null;
|
26525 | this.statusText = this.req.xhr.statusText;
|
26526 | var status = this.xhr.status;
|
26527 |
|
26528 | if (status === 1223) {
|
26529 | status = 204;
|
26530 | }
|
26531 |
|
26532 | this._setStatusProperties(status);
|
26533 |
|
26534 | this.headers = parseHeader(this.xhr.getAllResponseHeaders());
|
26535 | this.header = this.headers;
|
26536 |
|
26537 |
|
26538 |
|
26539 | this.header['content-type'] = this.xhr.getResponseHeader('content-type');
|
26540 |
|
26541 | this._setHeaderProperties(this.header);
|
26542 |
|
26543 | if (this.text === null && req._responseType) {
|
26544 | this.body = this.xhr.response;
|
26545 | } else {
|
26546 | this.body = this.req.method === 'HEAD' ? null : this._parseBody(this.text ? this.text : this.xhr.response);
|
26547 | }
|
26548 | }
|
26549 |
|
26550 |
|
26551 | ResponseBase(Response.prototype);
|
26552 |
|
26553 |
|
26554 |
|
26555 |
|
26556 |
|
26557 |
|
26558 |
|
26559 |
|
26560 |
|
26561 |
|
26562 |
|
26563 | Response.prototype._parseBody = function (str) {
|
26564 | var parse = request.parse[this.type];
|
26565 |
|
26566 | if (this.req._parser) {
|
26567 | return this.req._parser(this, str);
|
26568 | }
|
26569 |
|
26570 | if (!parse && isJSON(this.type)) {
|
26571 | parse = request.parse['application/json'];
|
26572 | }
|
26573 |
|
26574 | return parse && str && (str.length > 0 || str instanceof Object) ? parse(str) : null;
|
26575 | };
|
26576 |
|
26577 |
|
26578 |
|
26579 |
|
26580 |
|
26581 |
|
26582 |
|
26583 |
|
26584 | Response.prototype.toError = function () {
|
26585 | var _context2, _context3;
|
26586 |
|
26587 | var req = this.req;
|
26588 | var method = req.method;
|
26589 | var url = req.url;
|
26590 | var msg = (0, _concat.default)(_context2 = (0, _concat.default)(_context3 = "cannot ".concat(method, " ")).call(_context3, url, " (")).call(_context2, this.status, ")");
|
26591 | var err = new Error(msg);
|
26592 | err.status = this.status;
|
26593 | err.method = method;
|
26594 | err.url = url;
|
26595 | return err;
|
26596 | };
|
26597 |
|
26598 |
|
26599 |
|
26600 |
|
26601 |
|
26602 | request.Response = Response;
|
26603 |
|
26604 |
|
26605 |
|
26606 |
|
26607 |
|
26608 |
|
26609 |
|
26610 |
|
26611 | function Request(method, url) {
|
26612 | var self = this;
|
26613 | this._query = this._query || [];
|
26614 | this.method = method;
|
26615 | this.url = url;
|
26616 | this.header = {};
|
26617 |
|
26618 | this._header = {};
|
26619 |
|
26620 | this.on('end', function () {
|
26621 | var err = null;
|
26622 | var res = null;
|
26623 |
|
26624 | try {
|
26625 | res = new Response(self);
|
26626 | } catch (err_) {
|
26627 | err = new Error('Parser is unable to parse the response');
|
26628 | err.parse = true;
|
26629 | err.original = err_;
|
26630 |
|
26631 | if (self.xhr) {
|
26632 |
|
26633 | err.rawResponse = typeof self.xhr.responseType === 'undefined' ? self.xhr.responseText : self.xhr.response;
|
26634 |
|
26635 | err.status = self.xhr.status ? self.xhr.status : null;
|
26636 | err.statusCode = err.status;
|
26637 | } else {
|
26638 | err.rawResponse = null;
|
26639 | err.status = null;
|
26640 | }
|
26641 |
|
26642 | return self.callback(err);
|
26643 | }
|
26644 |
|
26645 | self.emit('response', res);
|
26646 | var new_err;
|
26647 |
|
26648 | try {
|
26649 | if (!self._isResponseOK(res)) {
|
26650 | new_err = new Error(res.statusText || res.text || 'Unsuccessful HTTP response');
|
26651 | }
|
26652 | } catch (err_) {
|
26653 | new_err = err_;
|
26654 | }
|
26655 |
|
26656 |
|
26657 | if (new_err) {
|
26658 | new_err.original = err;
|
26659 | new_err.response = res;
|
26660 | new_err.status = res.status;
|
26661 | self.callback(new_err, res);
|
26662 | } else {
|
26663 | self.callback(null, res);
|
26664 | }
|
26665 | });
|
26666 | }
|
26667 |
|
26668 |
|
26669 |
|
26670 |
|
26671 |
|
26672 |
|
26673 | Emitter(Request.prototype);
|
26674 |
|
26675 | RequestBase(Request.prototype);
|
26676 |
|
26677 |
|
26678 |
|
26679 |
|
26680 |
|
26681 |
|
26682 |
|
26683 |
|
26684 |
|
26685 |
|
26686 |
|
26687 |
|
26688 |
|
26689 |
|
26690 |
|
26691 |
|
26692 |
|
26693 |
|
26694 |
|
26695 |
|
26696 |
|
26697 |
|
26698 | Request.prototype.type = function (type) {
|
26699 | this.set('Content-Type', request.types[type] || type);
|
26700 | return this;
|
26701 | };
|
26702 |
|
26703 |
|
26704 |
|
26705 |
|
26706 |
|
26707 |
|
26708 |
|
26709 |
|
26710 |
|
26711 |
|
26712 |
|
26713 |
|
26714 |
|
26715 |
|
26716 |
|
26717 |
|
26718 |
|
26719 |
|
26720 |
|
26721 |
|
26722 |
|
26723 | Request.prototype.accept = function (type) {
|
26724 | this.set('Accept', request.types[type] || type);
|
26725 | return this;
|
26726 | };
|
26727 |
|
26728 |
|
26729 |
|
26730 |
|
26731 |
|
26732 |
|
26733 |
|
26734 |
|
26735 |
|
26736 |
|
26737 |
|
26738 | Request.prototype.auth = function (user, pass, options) {
|
26739 | if (arguments.length === 1) pass = '';
|
26740 |
|
26741 | if (_typeof(pass) === 'object' && pass !== null) {
|
26742 |
|
26743 | options = pass;
|
26744 | pass = '';
|
26745 | }
|
26746 |
|
26747 | if (!options) {
|
26748 | options = {
|
26749 | type: typeof btoa === 'function' ? 'basic' : 'auto'
|
26750 | };
|
26751 | }
|
26752 |
|
26753 | var encoder = function encoder(string) {
|
26754 | if (typeof btoa === 'function') {
|
26755 | return btoa(string);
|
26756 | }
|
26757 |
|
26758 | throw new Error('Cannot use basic auth, btoa is not a function');
|
26759 | };
|
26760 |
|
26761 | return this._auth(user, pass, options, encoder);
|
26762 | };
|
26763 |
|
26764 |
|
26765 |
|
26766 |
|
26767 |
|
26768 |
|
26769 |
|
26770 |
|
26771 |
|
26772 |
|
26773 |
|
26774 |
|
26775 |
|
26776 |
|
26777 |
|
26778 | Request.prototype.query = function (val) {
|
26779 | if (typeof val !== 'string') val = serialize(val);
|
26780 | if (val) this._query.push(val);
|
26781 | return this;
|
26782 | };
|
26783 |
|
26784 |
|
26785 |
|
26786 |
|
26787 |
|
26788 |
|
26789 |
|
26790 |
|
26791 |
|
26792 |
|
26793 |
|
26794 |
|
26795 |
|
26796 |
|
26797 |
|
26798 |
|
26799 |
|
26800 |
|
26801 | Request.prototype.attach = function (field, file, options) {
|
26802 | if (file) {
|
26803 | if (this._data) {
|
26804 | throw new Error("superagent can't mix .send() and .attach()");
|
26805 | }
|
26806 |
|
26807 | this._getFormData().append(field, file, options || file.name);
|
26808 | }
|
26809 |
|
26810 | return this;
|
26811 | };
|
26812 |
|
26813 | Request.prototype._getFormData = function () {
|
26814 | if (!this._formData) {
|
26815 | this._formData = new root.FormData();
|
26816 | }
|
26817 |
|
26818 | return this._formData;
|
26819 | };
|
26820 |
|
26821 |
|
26822 |
|
26823 |
|
26824 |
|
26825 |
|
26826 |
|
26827 |
|
26828 |
|
26829 |
|
26830 | Request.prototype.callback = function (err, res) {
|
26831 | if (this._shouldRetry(err, res)) {
|
26832 | return this._retry();
|
26833 | }
|
26834 |
|
26835 | var fn = this._callback;
|
26836 | this.clearTimeout();
|
26837 |
|
26838 | if (err) {
|
26839 | if (this._maxRetries) err.retries = this._retries - 1;
|
26840 | this.emit('error', err);
|
26841 | }
|
26842 |
|
26843 | fn(err, res);
|
26844 | };
|
26845 |
|
26846 |
|
26847 |
|
26848 |
|
26849 |
|
26850 |
|
26851 |
|
26852 | Request.prototype.crossDomainError = function () {
|
26853 | 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.');
|
26854 | err.crossDomain = true;
|
26855 | err.status = this.status;
|
26856 | err.method = this.method;
|
26857 | err.url = this.url;
|
26858 | this.callback(err);
|
26859 | };
|
26860 |
|
26861 |
|
26862 | Request.prototype.agent = function () {
|
26863 | console.warn('This is not supported in browser version of superagent');
|
26864 | return this;
|
26865 | };
|
26866 |
|
26867 | Request.prototype.ca = Request.prototype.agent;
|
26868 | Request.prototype.buffer = Request.prototype.ca;
|
26869 |
|
26870 | Request.prototype.write = function () {
|
26871 | throw new Error('Streaming is not supported in browser version of superagent');
|
26872 | };
|
26873 |
|
26874 | Request.prototype.pipe = Request.prototype.write;
|
26875 |
|
26876 |
|
26877 |
|
26878 |
|
26879 |
|
26880 |
|
26881 |
|
26882 |
|
26883 |
|
26884 | Request.prototype._isHost = function (obj) {
|
26885 |
|
26886 | return obj && _typeof(obj) === 'object' && !Array.isArray(obj) && Object.prototype.toString.call(obj) !== '[object Object]';
|
26887 | };
|
26888 |
|
26889 |
|
26890 |
|
26891 |
|
26892 |
|
26893 |
|
26894 |
|
26895 |
|
26896 |
|
26897 |
|
26898 | Request.prototype.end = function (fn) {
|
26899 | if (this._endCalled) {
|
26900 | console.warn('Warning: .end() was called twice. This is not supported in superagent');
|
26901 | }
|
26902 |
|
26903 | this._endCalled = true;
|
26904 |
|
26905 | this._callback = fn || noop;
|
26906 |
|
26907 | this._finalizeQueryString();
|
26908 |
|
26909 | this._end();
|
26910 | };
|
26911 |
|
26912 | Request.prototype._setUploadTimeout = function () {
|
26913 | var self = this;
|
26914 |
|
26915 | if (this._uploadTimeout && !this._uploadTimeoutTimer) {
|
26916 | this._uploadTimeoutTimer = setTimeout(function () {
|
26917 | self._timeoutError('Upload timeout of ', self._uploadTimeout, 'ETIMEDOUT');
|
26918 | }, this._uploadTimeout);
|
26919 | }
|
26920 | };
|
26921 |
|
26922 |
|
26923 | Request.prototype._end = function () {
|
26924 | if (this._aborted) return this.callback(new Error('The request has been aborted even before .end() was called'));
|
26925 | var self = this;
|
26926 | this.xhr = request.getXHR();
|
26927 | var xhr = this.xhr;
|
26928 | var data = this._formData || this._data;
|
26929 |
|
26930 | this._setTimeouts();
|
26931 |
|
26932 |
|
26933 | xhr.onreadystatechange = function () {
|
26934 | var readyState = xhr.readyState;
|
26935 |
|
26936 | if (readyState >= 2 && self._responseTimeoutTimer) {
|
26937 | clearTimeout(self._responseTimeoutTimer);
|
26938 | }
|
26939 |
|
26940 | if (readyState !== 4) {
|
26941 | return;
|
26942 | }
|
26943 |
|
26944 |
|
26945 |
|
26946 | var status;
|
26947 |
|
26948 | try {
|
26949 | status = xhr.status;
|
26950 | } catch (_unused5) {
|
26951 | status = 0;
|
26952 | }
|
26953 |
|
26954 | if (!status) {
|
26955 | if (self.timedout || self._aborted) return;
|
26956 | return self.crossDomainError();
|
26957 | }
|
26958 |
|
26959 | self.emit('end');
|
26960 | };
|
26961 |
|
26962 |
|
26963 | var handleProgress = function handleProgress(direction, e) {
|
26964 | if (e.total > 0) {
|
26965 | e.percent = e.loaded / e.total * 100;
|
26966 |
|
26967 | if (e.percent === 100) {
|
26968 | clearTimeout(self._uploadTimeoutTimer);
|
26969 | }
|
26970 | }
|
26971 |
|
26972 | e.direction = direction;
|
26973 | self.emit('progress', e);
|
26974 | };
|
26975 |
|
26976 | if (this.hasListeners('progress')) {
|
26977 | try {
|
26978 | xhr.addEventListener('progress', handleProgress.bind(null, 'download'));
|
26979 |
|
26980 | if (xhr.upload) {
|
26981 | xhr.upload.addEventListener('progress', handleProgress.bind(null, 'upload'));
|
26982 | }
|
26983 | } catch (_unused6) {
|
26984 |
|
26985 |
|
26986 | }
|
26987 | }
|
26988 |
|
26989 | if (xhr.upload) {
|
26990 | this._setUploadTimeout();
|
26991 | }
|
26992 |
|
26993 |
|
26994 | try {
|
26995 | if (this.username && this.password) {
|
26996 | xhr.open(this.method, this.url, true, this.username, this.password);
|
26997 | } else {
|
26998 | xhr.open(this.method, this.url, true);
|
26999 | }
|
27000 | } catch (err) {
|
27001 |
|
27002 | return this.callback(err);
|
27003 | }
|
27004 |
|
27005 |
|
27006 | if (this._withCredentials) xhr.withCredentials = true;
|
27007 |
|
27008 | if (!this._formData && this.method !== 'GET' && this.method !== 'HEAD' && typeof data !== 'string' && !this._isHost(data)) {
|
27009 |
|
27010 | var contentType = this._header['content-type'];
|
27011 |
|
27012 | var _serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : ''];
|
27013 |
|
27014 | if (!_serialize && isJSON(contentType)) {
|
27015 | _serialize = request.serialize['application/json'];
|
27016 | }
|
27017 |
|
27018 | if (_serialize) data = _serialize(data);
|
27019 | }
|
27020 |
|
27021 |
|
27022 | for (var field in this.header) {
|
27023 | if (this.header[field] === null) continue;
|
27024 | if (Object.prototype.hasOwnProperty.call(this.header, field)) xhr.setRequestHeader(field, this.header[field]);
|
27025 | }
|
27026 |
|
27027 | if (this._responseType) {
|
27028 | xhr.responseType = this._responseType;
|
27029 | }
|
27030 |
|
27031 |
|
27032 | this.emit('request', this);
|
27033 |
|
27034 |
|
27035 | xhr.send(typeof data === 'undefined' ? null : data);
|
27036 | };
|
27037 |
|
27038 | request.agent = function () {
|
27039 | return new Agent();
|
27040 | };
|
27041 |
|
27042 | ['GET', 'POST', 'OPTIONS', 'PATCH', 'PUT', 'DELETE'].forEach(function (method) {
|
27043 | Agent.prototype[method.toLowerCase()] = function (url, fn) {
|
27044 | var req = new request.Request(method, url);
|
27045 |
|
27046 | this._setDefaults(req);
|
27047 |
|
27048 | if (fn) {
|
27049 | req.end(fn);
|
27050 | }
|
27051 |
|
27052 | return req;
|
27053 | };
|
27054 | });
|
27055 | Agent.prototype.del = Agent.prototype.delete;
|
27056 |
|
27057 |
|
27058 |
|
27059 |
|
27060 |
|
27061 |
|
27062 |
|
27063 |
|
27064 |
|
27065 |
|
27066 | request.get = function (url, data, fn) {
|
27067 | var req = request('GET', url);
|
27068 |
|
27069 | if (typeof data === 'function') {
|
27070 | fn = data;
|
27071 | data = null;
|
27072 | }
|
27073 |
|
27074 | if (data) req.query(data);
|
27075 | if (fn) req.end(fn);
|
27076 | return req;
|
27077 | };
|
27078 |
|
27079 |
|
27080 |
|
27081 |
|
27082 |
|
27083 |
|
27084 |
|
27085 |
|
27086 |
|
27087 |
|
27088 |
|
27089 | request.head = function (url, data, fn) {
|
27090 | var req = request('HEAD', url);
|
27091 |
|
27092 | if (typeof data === 'function') {
|
27093 | fn = data;
|
27094 | data = null;
|
27095 | }
|
27096 |
|
27097 | if (data) req.query(data);
|
27098 | if (fn) req.end(fn);
|
27099 | return req;
|
27100 | };
|
27101 |
|
27102 |
|
27103 |
|
27104 |
|
27105 |
|
27106 |
|
27107 |
|
27108 |
|
27109 |
|
27110 |
|
27111 |
|
27112 | request.options = function (url, data, fn) {
|
27113 | var req = request('OPTIONS', url);
|
27114 |
|
27115 | if (typeof data === 'function') {
|
27116 | fn = data;
|
27117 | data = null;
|
27118 | }
|
27119 |
|
27120 | if (data) req.send(data);
|
27121 | if (fn) req.end(fn);
|
27122 | return req;
|
27123 | };
|
27124 |
|
27125 |
|
27126 |
|
27127 |
|
27128 |
|
27129 |
|
27130 |
|
27131 |
|
27132 |
|
27133 |
|
27134 |
|
27135 | function del(url, data, fn) {
|
27136 | var req = request('DELETE', url);
|
27137 |
|
27138 | if (typeof data === 'function') {
|
27139 | fn = data;
|
27140 | data = null;
|
27141 | }
|
27142 |
|
27143 | if (data) req.send(data);
|
27144 | if (fn) req.end(fn);
|
27145 | return req;
|
27146 | }
|
27147 |
|
27148 | request.del = del;
|
27149 | request.delete = del;
|
27150 |
|
27151 |
|
27152 |
|
27153 |
|
27154 |
|
27155 |
|
27156 |
|
27157 |
|
27158 |
|
27159 |
|
27160 | request.patch = function (url, data, fn) {
|
27161 | var req = request('PATCH', url);
|
27162 |
|
27163 | if (typeof data === 'function') {
|
27164 | fn = data;
|
27165 | data = null;
|
27166 | }
|
27167 |
|
27168 | if (data) req.send(data);
|
27169 | if (fn) req.end(fn);
|
27170 | return req;
|
27171 | };
|
27172 |
|
27173 |
|
27174 |
|
27175 |
|
27176 |
|
27177 |
|
27178 |
|
27179 |
|
27180 |
|
27181 |
|
27182 |
|
27183 | request.post = function (url, data, fn) {
|
27184 | var req = request('POST', url);
|
27185 |
|
27186 | if (typeof data === 'function') {
|
27187 | fn = data;
|
27188 | data = null;
|
27189 | }
|
27190 |
|
27191 | if (data) req.send(data);
|
27192 | if (fn) req.end(fn);
|
27193 | return req;
|
27194 | };
|
27195 |
|
27196 |
|
27197 |
|
27198 |
|
27199 |
|
27200 |
|
27201 |
|
27202 |
|
27203 |
|
27204 |
|
27205 |
|
27206 | request.put = function (url, data, fn) {
|
27207 | var req = request('PUT', url);
|
27208 |
|
27209 | if (typeof data === 'function') {
|
27210 | fn = data;
|
27211 | data = null;
|
27212 | }
|
27213 |
|
27214 | if (data) req.send(data);
|
27215 | if (fn) req.end(fn);
|
27216 | return req;
|
27217 | };
|
27218 |
|
27219 | }),
|
27220 |
|
27221 | (function(module, exports, __webpack_require__) {
|
27222 |
|
27223 | module.exports = __webpack_require__(579);
|
27224 |
|
27225 | }),
|
27226 |
|
27227 | (function(module, exports, __webpack_require__) {
|
27228 |
|
27229 | var parent = __webpack_require__(580);
|
27230 |
|
27231 | module.exports = parent;
|
27232 |
|
27233 |
|
27234 | }),
|
27235 |
|
27236 | (function(module, exports, __webpack_require__) {
|
27237 |
|
27238 | var isPrototypeOf = __webpack_require__(16);
|
27239 | var method = __webpack_require__(581);
|
27240 |
|
27241 | var StringPrototype = String.prototype;
|
27242 |
|
27243 | module.exports = function (it) {
|
27244 | var own = it.trim;
|
27245 | return typeof it == 'string' || it === StringPrototype
|
27246 | || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.trim) ? method : own;
|
27247 | };
|
27248 |
|
27249 |
|
27250 | }),
|
27251 |
|
27252 | (function(module, exports, __webpack_require__) {
|
27253 |
|
27254 | __webpack_require__(582);
|
27255 | var entryVirtual = __webpack_require__(27);
|
27256 |
|
27257 | module.exports = entryVirtual('String').trim;
|
27258 |
|
27259 |
|
27260 | }),
|
27261 |
|
27262 | (function(module, exports, __webpack_require__) {
|
27263 |
|
27264 | "use strict";
|
27265 |
|
27266 | var $ = __webpack_require__(0);
|
27267 | var $trim = __webpack_require__(583).trim;
|
27268 | var forcedStringTrimMethod = __webpack_require__(584);
|
27269 |
|
27270 |
|
27271 |
|
27272 | $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
27273 | trim: function trim() {
|
27274 | return $trim(this);
|
27275 | }
|
27276 | });
|
27277 |
|
27278 |
|
27279 | }),
|
27280 |
|
27281 | (function(module, exports, __webpack_require__) {
|
27282 |
|
27283 | var uncurryThis = __webpack_require__(4);
|
27284 | var requireObjectCoercible = __webpack_require__(81);
|
27285 | var toString = __webpack_require__(42);
|
27286 | var whitespaces = __webpack_require__(260);
|
27287 |
|
27288 | var replace = uncurryThis(''.replace);
|
27289 | var whitespace = '[' + whitespaces + ']';
|
27290 | var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
27291 | var rtrim = RegExp(whitespace + whitespace + '*$');
|
27292 |
|
27293 |
|
27294 | var createMethod = function (TYPE) {
|
27295 | return function ($this) {
|
27296 | var string = toString(requireObjectCoercible($this));
|
27297 | if (TYPE & 1) string = replace(string, ltrim, '');
|
27298 | if (TYPE & 2) string = replace(string, rtrim, '');
|
27299 | return string;
|
27300 | };
|
27301 | };
|
27302 |
|
27303 | module.exports = {
|
27304 |
|
27305 |
|
27306 | start: createMethod(1),
|
27307 |
|
27308 |
|
27309 | end: createMethod(2),
|
27310 |
|
27311 |
|
27312 | trim: createMethod(3)
|
27313 | };
|
27314 |
|
27315 |
|
27316 | }),
|
27317 |
|
27318 | (function(module, exports, __webpack_require__) {
|
27319 |
|
27320 | var PROPER_FUNCTION_NAME = __webpack_require__(170).PROPER;
|
27321 | var fails = __webpack_require__(2);
|
27322 | var whitespaces = __webpack_require__(260);
|
27323 |
|
27324 | var non = '\u200B\u0085\u180E';
|
27325 |
|
27326 |
|
27327 |
|
27328 | module.exports = function (METHOD_NAME) {
|
27329 | return fails(function () {
|
27330 | return !!whitespaces[METHOD_NAME]()
|
27331 | || non[METHOD_NAME]() !== non
|
27332 | || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
|
27333 | });
|
27334 | };
|
27335 |
|
27336 |
|
27337 | }),
|
27338 |
|
27339 | (function(module, exports, __webpack_require__) {
|
27340 |
|
27341 |
|
27342 |
|
27343 |
|
27344 |
|
27345 |
|
27346 | if (true) {
|
27347 | module.exports = Emitter;
|
27348 | }
|
27349 |
|
27350 |
|
27351 |
|
27352 |
|
27353 |
|
27354 |
|
27355 |
|
27356 | function Emitter(obj) {
|
27357 | if (obj) return mixin(obj);
|
27358 | };
|
27359 |
|
27360 |
|
27361 |
|
27362 |
|
27363 |
|
27364 |
|
27365 |
|
27366 |
|
27367 |
|
27368 | function mixin(obj) {
|
27369 | for (var key in Emitter.prototype) {
|
27370 | obj[key] = Emitter.prototype[key];
|
27371 | }
|
27372 | return obj;
|
27373 | }
|
27374 |
|
27375 |
|
27376 |
|
27377 |
|
27378 |
|
27379 |
|
27380 |
|
27381 |
|
27382 |
|
27383 |
|
27384 | Emitter.prototype.on =
|
27385 | Emitter.prototype.addEventListener = function(event, fn){
|
27386 | this._callbacks = this._callbacks || {};
|
27387 | (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
|
27388 | .push(fn);
|
27389 | return this;
|
27390 | };
|
27391 |
|
27392 |
|
27393 |
|
27394 |
|
27395 |
|
27396 |
|
27397 |
|
27398 |
|
27399 |
|
27400 |
|
27401 |
|
27402 | Emitter.prototype.once = function(event, fn){
|
27403 | function on() {
|
27404 | this.off(event, on);
|
27405 | fn.apply(this, arguments);
|
27406 | }
|
27407 |
|
27408 | on.fn = fn;
|
27409 | this.on(event, on);
|
27410 | return this;
|
27411 | };
|
27412 |
|
27413 |
|
27414 |
|
27415 |
|
27416 |
|
27417 |
|
27418 |
|
27419 |
|
27420 |
|
27421 |
|
27422 |
|
27423 | Emitter.prototype.off =
|
27424 | Emitter.prototype.removeListener =
|
27425 | Emitter.prototype.removeAllListeners =
|
27426 | Emitter.prototype.removeEventListener = function(event, fn){
|
27427 | this._callbacks = this._callbacks || {};
|
27428 |
|
27429 |
|
27430 | if (0 == arguments.length) {
|
27431 | this._callbacks = {};
|
27432 | return this;
|
27433 | }
|
27434 |
|
27435 |
|
27436 | var callbacks = this._callbacks['$' + event];
|
27437 | if (!callbacks) return this;
|
27438 |
|
27439 |
|
27440 | if (1 == arguments.length) {
|
27441 | delete this._callbacks['$' + event];
|
27442 | return this;
|
27443 | }
|
27444 |
|
27445 |
|
27446 | var cb;
|
27447 | for (var i = 0; i < callbacks.length; i++) {
|
27448 | cb = callbacks[i];
|
27449 | if (cb === fn || cb.fn === fn) {
|
27450 | callbacks.splice(i, 1);
|
27451 | break;
|
27452 | }
|
27453 | }
|
27454 |
|
27455 |
|
27456 |
|
27457 | if (callbacks.length === 0) {
|
27458 | delete this._callbacks['$' + event];
|
27459 | }
|
27460 |
|
27461 | return this;
|
27462 | };
|
27463 |
|
27464 |
|
27465 |
|
27466 |
|
27467 |
|
27468 |
|
27469 |
|
27470 |
|
27471 |
|
27472 | Emitter.prototype.emit = function(event){
|
27473 | this._callbacks = this._callbacks || {};
|
27474 |
|
27475 | var args = new Array(arguments.length - 1)
|
27476 | , callbacks = this._callbacks['$' + event];
|
27477 |
|
27478 | for (var i = 1; i < arguments.length; i++) {
|
27479 | args[i - 1] = arguments[i];
|
27480 | }
|
27481 |
|
27482 | if (callbacks) {
|
27483 | callbacks = callbacks.slice(0);
|
27484 | for (var i = 0, len = callbacks.length; i < len; ++i) {
|
27485 | callbacks[i].apply(this, args);
|
27486 | }
|
27487 | }
|
27488 |
|
27489 | return this;
|
27490 | };
|
27491 |
|
27492 |
|
27493 |
|
27494 |
|
27495 |
|
27496 |
|
27497 |
|
27498 |
|
27499 |
|
27500 | Emitter.prototype.listeners = function(event){
|
27501 | this._callbacks = this._callbacks || {};
|
27502 | return this._callbacks['$' + event] || [];
|
27503 | };
|
27504 |
|
27505 |
|
27506 |
|
27507 |
|
27508 |
|
27509 |
|
27510 |
|
27511 |
|
27512 |
|
27513 | Emitter.prototype.hasListeners = function(event){
|
27514 | return !! this.listeners(event).length;
|
27515 | };
|
27516 |
|
27517 |
|
27518 | }),
|
27519 |
|
27520 | (function(module, exports) {
|
27521 |
|
27522 | module.exports = stringify
|
27523 | stringify.default = stringify
|
27524 | stringify.stable = deterministicStringify
|
27525 | stringify.stableStringify = deterministicStringify
|
27526 |
|
27527 | var LIMIT_REPLACE_NODE = '[...]'
|
27528 | var CIRCULAR_REPLACE_NODE = '[Circular]'
|
27529 |
|
27530 | var arr = []
|
27531 | var replacerStack = []
|
27532 |
|
27533 | function defaultOptions () {
|
27534 | return {
|
27535 | depthLimit: Number.MAX_SAFE_INTEGER,
|
27536 | edgesLimit: Number.MAX_SAFE_INTEGER
|
27537 | }
|
27538 | }
|
27539 |
|
27540 |
|
27541 | function stringify (obj, replacer, spacer, options) {
|
27542 | if (typeof options === 'undefined') {
|
27543 | options = defaultOptions()
|
27544 | }
|
27545 |
|
27546 | decirc(obj, '', 0, [], undefined, 0, options)
|
27547 | var res
|
27548 | try {
|
27549 | if (replacerStack.length === 0) {
|
27550 | res = JSON.stringify(obj, replacer, spacer)
|
27551 | } else {
|
27552 | res = JSON.stringify(obj, replaceGetterValues(replacer), spacer)
|
27553 | }
|
27554 | } catch (_) {
|
27555 | return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]')
|
27556 | } finally {
|
27557 | while (arr.length !== 0) {
|
27558 | var part = arr.pop()
|
27559 | if (part.length === 4) {
|
27560 | Object.defineProperty(part[0], part[1], part[3])
|
27561 | } else {
|
27562 | part[0][part[1]] = part[2]
|
27563 | }
|
27564 | }
|
27565 | }
|
27566 | return res
|
27567 | }
|
27568 |
|
27569 | function setReplace (replace, val, k, parent) {
|
27570 | var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k)
|
27571 | if (propertyDescriptor.get !== undefined) {
|
27572 | if (propertyDescriptor.configurable) {
|
27573 | Object.defineProperty(parent, k, { value: replace })
|
27574 | arr.push([parent, k, val, propertyDescriptor])
|
27575 | } else {
|
27576 | replacerStack.push([val, k, replace])
|
27577 | }
|
27578 | } else {
|
27579 | parent[k] = replace
|
27580 | arr.push([parent, k, val])
|
27581 | }
|
27582 | }
|
27583 |
|
27584 | function decirc (val, k, edgeIndex, stack, parent, depth, options) {
|
27585 | depth += 1
|
27586 | var i
|
27587 | if (typeof val === 'object' && val !== null) {
|
27588 | for (i = 0; i < stack.length; i++) {
|
27589 | if (stack[i] === val) {
|
27590 | setReplace(CIRCULAR_REPLACE_NODE, val, k, parent)
|
27591 | return
|
27592 | }
|
27593 | }
|
27594 |
|
27595 | if (
|
27596 | typeof options.depthLimit !== 'undefined' &&
|
27597 | depth > options.depthLimit
|
27598 | ) {
|
27599 | setReplace(LIMIT_REPLACE_NODE, val, k, parent)
|
27600 | return
|
27601 | }
|
27602 |
|
27603 | if (
|
27604 | typeof options.edgesLimit !== 'undefined' &&
|
27605 | edgeIndex + 1 > options.edgesLimit
|
27606 | ) {
|
27607 | setReplace(LIMIT_REPLACE_NODE, val, k, parent)
|
27608 | return
|
27609 | }
|
27610 |
|
27611 | stack.push(val)
|
27612 |
|
27613 | if (Array.isArray(val)) {
|
27614 | for (i = 0; i < val.length; i++) {
|
27615 | decirc(val[i], i, i, stack, val, depth, options)
|
27616 | }
|
27617 | } else {
|
27618 | var keys = Object.keys(val)
|
27619 | for (i = 0; i < keys.length; i++) {
|
27620 | var key = keys[i]
|
27621 | decirc(val[key], key, i, stack, val, depth, options)
|
27622 | }
|
27623 | }
|
27624 | stack.pop()
|
27625 | }
|
27626 | }
|
27627 |
|
27628 |
|
27629 | function compareFunction (a, b) {
|
27630 | if (a < b) {
|
27631 | return -1
|
27632 | }
|
27633 | if (a > b) {
|
27634 | return 1
|
27635 | }
|
27636 | return 0
|
27637 | }
|
27638 |
|
27639 | function deterministicStringify (obj, replacer, spacer, options) {
|
27640 | if (typeof options === 'undefined') {
|
27641 | options = defaultOptions()
|
27642 | }
|
27643 |
|
27644 | var tmp = deterministicDecirc(obj, '', 0, [], undefined, 0, options) || obj
|
27645 | var res
|
27646 | try {
|
27647 | if (replacerStack.length === 0) {
|
27648 | res = JSON.stringify(tmp, replacer, spacer)
|
27649 | } else {
|
27650 | res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer)
|
27651 | }
|
27652 | } catch (_) {
|
27653 | return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]')
|
27654 | } finally {
|
27655 |
|
27656 | while (arr.length !== 0) {
|
27657 | var part = arr.pop()
|
27658 | if (part.length === 4) {
|
27659 | Object.defineProperty(part[0], part[1], part[3])
|
27660 | } else {
|
27661 | part[0][part[1]] = part[2]
|
27662 | }
|
27663 | }
|
27664 | }
|
27665 | return res
|
27666 | }
|
27667 |
|
27668 | function deterministicDecirc (val, k, edgeIndex, stack, parent, depth, options) {
|
27669 | depth += 1
|
27670 | var i
|
27671 | if (typeof val === 'object' && val !== null) {
|
27672 | for (i = 0; i < stack.length; i++) {
|
27673 | if (stack[i] === val) {
|
27674 | setReplace(CIRCULAR_REPLACE_NODE, val, k, parent)
|
27675 | return
|
27676 | }
|
27677 | }
|
27678 | try {
|
27679 | if (typeof val.toJSON === 'function') {
|
27680 | return
|
27681 | }
|
27682 | } catch (_) {
|
27683 | return
|
27684 | }
|
27685 |
|
27686 | if (
|
27687 | typeof options.depthLimit !== 'undefined' &&
|
27688 | depth > options.depthLimit
|
27689 | ) {
|
27690 | setReplace(LIMIT_REPLACE_NODE, val, k, parent)
|
27691 | return
|
27692 | }
|
27693 |
|
27694 | if (
|
27695 | typeof options.edgesLimit !== 'undefined' &&
|
27696 | edgeIndex + 1 > options.edgesLimit
|
27697 | ) {
|
27698 | setReplace(LIMIT_REPLACE_NODE, val, k, parent)
|
27699 | return
|
27700 | }
|
27701 |
|
27702 | stack.push(val)
|
27703 |
|
27704 | if (Array.isArray(val)) {
|
27705 | for (i = 0; i < val.length; i++) {
|
27706 | deterministicDecirc(val[i], i, i, stack, val, depth, options)
|
27707 | }
|
27708 | } else {
|
27709 |
|
27710 | var tmp = {}
|
27711 | var keys = Object.keys(val).sort(compareFunction)
|
27712 | for (i = 0; i < keys.length; i++) {
|
27713 | var key = keys[i]
|
27714 | deterministicDecirc(val[key], key, i, stack, val, depth, options)
|
27715 | tmp[key] = val[key]
|
27716 | }
|
27717 | if (typeof parent !== 'undefined') {
|
27718 | arr.push([parent, k, val])
|
27719 | parent[k] = tmp
|
27720 | } else {
|
27721 | return tmp
|
27722 | }
|
27723 | }
|
27724 | stack.pop()
|
27725 | }
|
27726 | }
|
27727 |
|
27728 |
|
27729 |
|
27730 | function replaceGetterValues (replacer) {
|
27731 | replacer =
|
27732 | typeof replacer !== 'undefined'
|
27733 | ? replacer
|
27734 | : function (k, v) {
|
27735 | return v
|
27736 | }
|
27737 | return function (key, val) {
|
27738 | if (replacerStack.length > 0) {
|
27739 | for (var i = 0; i < replacerStack.length; i++) {
|
27740 | var part = replacerStack[i]
|
27741 | if (part[1] === key && part[0] === val) {
|
27742 | val = part[2]
|
27743 | replacerStack.splice(i, 1)
|
27744 | break
|
27745 | }
|
27746 | }
|
27747 | }
|
27748 | return replacer.call(this, key, val)
|
27749 | }
|
27750 | }
|
27751 |
|
27752 |
|
27753 | }),
|
27754 |
|
27755 | (function(module, exports, __webpack_require__) {
|
27756 |
|
27757 | "use strict";
|
27758 |
|
27759 |
|
27760 | var _interopRequireDefault = __webpack_require__(1);
|
27761 |
|
27762 | var _symbol = _interopRequireDefault(__webpack_require__(77));
|
27763 |
|
27764 | var _iterator = _interopRequireDefault(__webpack_require__(155));
|
27765 |
|
27766 | var _includes = _interopRequireDefault(__webpack_require__(588));
|
27767 |
|
27768 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
27769 |
|
27770 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
27771 |
|
27772 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
27773 |
|
27774 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
27775 |
|
27776 | var _sort = _interopRequireDefault(__webpack_require__(598));
|
27777 |
|
27778 | function _typeof(obj) {
|
27779 | "@babel/helpers - typeof";
|
27780 |
|
27781 | if (typeof _symbol.default === "function" && typeof _iterator.default === "symbol") {
|
27782 | _typeof = function _typeof(obj) {
|
27783 | return typeof obj;
|
27784 | };
|
27785 | } else {
|
27786 | _typeof = function _typeof(obj) {
|
27787 | return obj && typeof _symbol.default === "function" && obj.constructor === _symbol.default && obj !== _symbol.default.prototype ? "symbol" : typeof obj;
|
27788 | };
|
27789 | }
|
27790 |
|
27791 | return _typeof(obj);
|
27792 | }
|
27793 |
|
27794 |
|
27795 |
|
27796 |
|
27797 |
|
27798 | var isObject = __webpack_require__(261);
|
27799 |
|
27800 |
|
27801 |
|
27802 |
|
27803 |
|
27804 | module.exports = RequestBase;
|
27805 |
|
27806 |
|
27807 |
|
27808 |
|
27809 |
|
27810 |
|
27811 | function RequestBase(obj) {
|
27812 | if (obj) return mixin(obj);
|
27813 | }
|
27814 |
|
27815 |
|
27816 |
|
27817 |
|
27818 |
|
27819 |
|
27820 |
|
27821 |
|
27822 |
|
27823 | function mixin(obj) {
|
27824 | for (var key in RequestBase.prototype) {
|
27825 | if (Object.prototype.hasOwnProperty.call(RequestBase.prototype, key)) obj[key] = RequestBase.prototype[key];
|
27826 | }
|
27827 |
|
27828 | return obj;
|
27829 | }
|
27830 |
|
27831 |
|
27832 |
|
27833 |
|
27834 |
|
27835 |
|
27836 |
|
27837 |
|
27838 | RequestBase.prototype.clearTimeout = function () {
|
27839 | clearTimeout(this._timer);
|
27840 | clearTimeout(this._responseTimeoutTimer);
|
27841 | clearTimeout(this._uploadTimeoutTimer);
|
27842 | delete this._timer;
|
27843 | delete this._responseTimeoutTimer;
|
27844 | delete this._uploadTimeoutTimer;
|
27845 | return this;
|
27846 | };
|
27847 |
|
27848 |
|
27849 |
|
27850 |
|
27851 |
|
27852 |
|
27853 |
|
27854 |
|
27855 |
|
27856 |
|
27857 | RequestBase.prototype.parse = function (fn) {
|
27858 | this._parser = fn;
|
27859 | return this;
|
27860 | };
|
27861 |
|
27862 |
|
27863 |
|
27864 |
|
27865 |
|
27866 |
|
27867 |
|
27868 |
|
27869 |
|
27870 |
|
27871 |
|
27872 |
|
27873 |
|
27874 |
|
27875 |
|
27876 |
|
27877 |
|
27878 |
|
27879 |
|
27880 | RequestBase.prototype.responseType = function (val) {
|
27881 | this._responseType = val;
|
27882 | return this;
|
27883 | };
|
27884 |
|
27885 |
|
27886 |
|
27887 |
|
27888 |
|
27889 |
|
27890 |
|
27891 |
|
27892 |
|
27893 |
|
27894 | RequestBase.prototype.serialize = function (fn) {
|
27895 | this._serializer = fn;
|
27896 | return this;
|
27897 | };
|
27898 |
|
27899 |
|
27900 |
|
27901 |
|
27902 |
|
27903 |
|
27904 |
|
27905 |
|
27906 |
|
27907 |
|
27908 |
|
27909 |
|
27910 |
|
27911 |
|
27912 |
|
27913 | RequestBase.prototype.timeout = function (options) {
|
27914 | if (!options || _typeof(options) !== 'object') {
|
27915 | this._timeout = options;
|
27916 | this._responseTimeout = 0;
|
27917 | this._uploadTimeout = 0;
|
27918 | return this;
|
27919 | }
|
27920 |
|
27921 | for (var option in options) {
|
27922 | if (Object.prototype.hasOwnProperty.call(options, option)) {
|
27923 | switch (option) {
|
27924 | case 'deadline':
|
27925 | this._timeout = options.deadline;
|
27926 | break;
|
27927 |
|
27928 | case 'response':
|
27929 | this._responseTimeout = options.response;
|
27930 | break;
|
27931 |
|
27932 | case 'upload':
|
27933 | this._uploadTimeout = options.upload;
|
27934 | break;
|
27935 |
|
27936 | default:
|
27937 | console.warn('Unknown timeout option', option);
|
27938 | }
|
27939 | }
|
27940 | }
|
27941 |
|
27942 | return this;
|
27943 | };
|
27944 |
|
27945 |
|
27946 |
|
27947 |
|
27948 |
|
27949 |
|
27950 |
|
27951 |
|
27952 |
|
27953 |
|
27954 |
|
27955 |
|
27956 | RequestBase.prototype.retry = function (count, fn) {
|
27957 |
|
27958 | if (arguments.length === 0 || count === true) count = 1;
|
27959 | if (count <= 0) count = 0;
|
27960 | this._maxRetries = count;
|
27961 | this._retries = 0;
|
27962 | this._retryCallback = fn;
|
27963 | return this;
|
27964 | };
|
27965 |
|
27966 | var ERROR_CODES = ['ECONNRESET', 'ETIMEDOUT', 'EADDRINFO', 'ESOCKETTIMEDOUT'];
|
27967 |
|
27968 |
|
27969 |
|
27970 |
|
27971 |
|
27972 |
|
27973 |
|
27974 |
|
27975 |
|
27976 | RequestBase.prototype._shouldRetry = function (err, res) {
|
27977 | if (!this._maxRetries || this._retries++ >= this._maxRetries) {
|
27978 | return false;
|
27979 | }
|
27980 |
|
27981 | if (this._retryCallback) {
|
27982 | try {
|
27983 | var override = this._retryCallback(err, res);
|
27984 |
|
27985 | if (override === true) return true;
|
27986 | if (override === false) return false;
|
27987 | } catch (err_) {
|
27988 | console.error(err_);
|
27989 | }
|
27990 | }
|
27991 |
|
27992 | if (res && res.status && res.status >= 500 && res.status !== 501) return true;
|
27993 |
|
27994 | if (err) {
|
27995 | if (err.code && (0, _includes.default)(ERROR_CODES).call(ERROR_CODES, err.code)) return true;
|
27996 |
|
27997 | if (err.timeout && err.code === 'ECONNABORTED') return true;
|
27998 | if (err.crossDomain) return true;
|
27999 | }
|
28000 |
|
28001 | return false;
|
28002 | };
|
28003 |
|
28004 |
|
28005 |
|
28006 |
|
28007 |
|
28008 |
|
28009 |
|
28010 |
|
28011 | RequestBase.prototype._retry = function () {
|
28012 | this.clearTimeout();
|
28013 |
|
28014 | if (this.req) {
|
28015 | this.req = null;
|
28016 | this.req = this.request();
|
28017 | }
|
28018 |
|
28019 | this._aborted = false;
|
28020 | this.timedout = false;
|
28021 | this.timedoutError = null;
|
28022 | return this._end();
|
28023 | };
|
28024 |
|
28025 |
|
28026 |
|
28027 |
|
28028 |
|
28029 |
|
28030 |
|
28031 |
|
28032 |
|
28033 | RequestBase.prototype.then = function (resolve, reject) {
|
28034 | var _this = this;
|
28035 |
|
28036 | if (!this._fullfilledPromise) {
|
28037 | var self = this;
|
28038 |
|
28039 | if (this._endCalled) {
|
28040 | console.warn('Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises');
|
28041 | }
|
28042 |
|
28043 | this._fullfilledPromise = new _promise.default(function (resolve, reject) {
|
28044 | self.on('abort', function () {
|
28045 | if (_this._maxRetries && _this._maxRetries > _this._retries) {
|
28046 | return;
|
28047 | }
|
28048 |
|
28049 | if (_this.timedout && _this.timedoutError) {
|
28050 | reject(_this.timedoutError);
|
28051 | return;
|
28052 | }
|
28053 |
|
28054 | var err = new Error('Aborted');
|
28055 | err.code = 'ABORTED';
|
28056 | err.status = _this.status;
|
28057 | err.method = _this.method;
|
28058 | err.url = _this.url;
|
28059 | reject(err);
|
28060 | });
|
28061 | self.end(function (err, res) {
|
28062 | if (err) reject(err);else resolve(res);
|
28063 | });
|
28064 | });
|
28065 | }
|
28066 |
|
28067 | return this._fullfilledPromise.then(resolve, reject);
|
28068 | };
|
28069 |
|
28070 | RequestBase.prototype.catch = function (cb) {
|
28071 | return this.then(undefined, cb);
|
28072 | };
|
28073 |
|
28074 |
|
28075 |
|
28076 |
|
28077 |
|
28078 | RequestBase.prototype.use = function (fn) {
|
28079 | fn(this);
|
28080 | return this;
|
28081 | };
|
28082 |
|
28083 | RequestBase.prototype.ok = function (cb) {
|
28084 | if (typeof cb !== 'function') throw new Error('Callback required');
|
28085 | this._okCallback = cb;
|
28086 | return this;
|
28087 | };
|
28088 |
|
28089 | RequestBase.prototype._isResponseOK = function (res) {
|
28090 | if (!res) {
|
28091 | return false;
|
28092 | }
|
28093 |
|
28094 | if (this._okCallback) {
|
28095 | return this._okCallback(res);
|
28096 | }
|
28097 |
|
28098 | return res.status >= 200 && res.status < 300;
|
28099 | };
|
28100 |
|
28101 |
|
28102 |
|
28103 |
|
28104 |
|
28105 |
|
28106 |
|
28107 |
|
28108 |
|
28109 |
|
28110 | RequestBase.prototype.get = function (field) {
|
28111 | return this._header[field.toLowerCase()];
|
28112 | };
|
28113 |
|
28114 |
|
28115 |
|
28116 |
|
28117 |
|
28118 |
|
28119 |
|
28120 |
|
28121 |
|
28122 |
|
28123 |
|
28124 |
|
28125 |
|
28126 | RequestBase.prototype.getHeader = RequestBase.prototype.get;
|
28127 |
|
28128 |
|
28129 |
|
28130 |
|
28131 |
|
28132 |
|
28133 |
|
28134 |
|
28135 |
|
28136 |
|
28137 |
|
28138 |
|
28139 |
|
28140 |
|
28141 |
|
28142 |
|
28143 |
|
28144 |
|
28145 |
|
28146 |
|
28147 |
|
28148 | RequestBase.prototype.set = function (field, val) {
|
28149 | if (isObject(field)) {
|
28150 | for (var key in field) {
|
28151 | if (Object.prototype.hasOwnProperty.call(field, key)) this.set(key, field[key]);
|
28152 | }
|
28153 |
|
28154 | return this;
|
28155 | }
|
28156 |
|
28157 | this._header[field.toLowerCase()] = val;
|
28158 | this.header[field] = val;
|
28159 | return this;
|
28160 | };
|
28161 |
|
28162 |
|
28163 |
|
28164 |
|
28165 |
|
28166 |
|
28167 |
|
28168 |
|
28169 |
|
28170 |
|
28171 |
|
28172 |
|
28173 |
|
28174 |
|
28175 | RequestBase.prototype.unset = function (field) {
|
28176 | delete this._header[field.toLowerCase()];
|
28177 | delete this.header[field];
|
28178 | return this;
|
28179 | };
|
28180 |
|
28181 |
|
28182 |
|
28183 |
|
28184 |
|
28185 |
|
28186 |
|
28187 |
|
28188 |
|
28189 |
|
28190 |
|
28191 |
|
28192 |
|
28193 |
|
28194 |
|
28195 |
|
28196 |
|
28197 |
|
28198 |
|
28199 |
|
28200 |
|
28201 | RequestBase.prototype.field = function (name, val) {
|
28202 |
|
28203 | if (name === null || undefined === name) {
|
28204 | throw new Error('.field(name, val) name can not be empty');
|
28205 | }
|
28206 |
|
28207 | if (this._data) {
|
28208 | throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");
|
28209 | }
|
28210 |
|
28211 | if (isObject(name)) {
|
28212 | for (var key in name) {
|
28213 | if (Object.prototype.hasOwnProperty.call(name, key)) this.field(key, name[key]);
|
28214 | }
|
28215 |
|
28216 | return this;
|
28217 | }
|
28218 |
|
28219 | if (Array.isArray(val)) {
|
28220 | for (var i in val) {
|
28221 | if (Object.prototype.hasOwnProperty.call(val, i)) this.field(name, val[i]);
|
28222 | }
|
28223 |
|
28224 | return this;
|
28225 | }
|
28226 |
|
28227 |
|
28228 | if (val === null || undefined === val) {
|
28229 | throw new Error('.field(name, val) val can not be empty');
|
28230 | }
|
28231 |
|
28232 | if (typeof val === 'boolean') {
|
28233 | val = String(val);
|
28234 | }
|
28235 |
|
28236 | this._getFormData().append(name, val);
|
28237 |
|
28238 | return this;
|
28239 | };
|
28240 |
|
28241 |
|
28242 |
|
28243 |
|
28244 |
|
28245 |
|
28246 |
|
28247 |
|
28248 | RequestBase.prototype.abort = function () {
|
28249 | if (this._aborted) {
|
28250 | return this;
|
28251 | }
|
28252 |
|
28253 | this._aborted = true;
|
28254 | if (this.xhr) this.xhr.abort();
|
28255 |
|
28256 | if (this.req) this.req.abort();
|
28257 |
|
28258 | this.clearTimeout();
|
28259 | this.emit('abort');
|
28260 | return this;
|
28261 | };
|
28262 |
|
28263 | RequestBase.prototype._auth = function (user, pass, options, base64Encoder) {
|
28264 | var _context;
|
28265 |
|
28266 | switch (options.type) {
|
28267 | case 'basic':
|
28268 | this.set('Authorization', "Basic ".concat(base64Encoder((0, _concat.default)(_context = "".concat(user, ":")).call(_context, pass))));
|
28269 | break;
|
28270 |
|
28271 | case 'auto':
|
28272 | this.username = user;
|
28273 | this.password = pass;
|
28274 | break;
|
28275 |
|
28276 | case 'bearer':
|
28277 |
|
28278 | this.set('Authorization', "Bearer ".concat(user));
|
28279 | break;
|
28280 |
|
28281 | default:
|
28282 | break;
|
28283 | }
|
28284 |
|
28285 | return this;
|
28286 | };
|
28287 |
|
28288 |
|
28289 |
|
28290 |
|
28291 |
|
28292 |
|
28293 |
|
28294 |
|
28295 |
|
28296 |
|
28297 |
|
28298 |
|
28299 | RequestBase.prototype.withCredentials = function (on) {
|
28300 |
|
28301 | if (on === undefined) on = true;
|
28302 | this._withCredentials = on;
|
28303 | return this;
|
28304 | };
|
28305 |
|
28306 |
|
28307 |
|
28308 |
|
28309 |
|
28310 |
|
28311 |
|
28312 |
|
28313 |
|
28314 | RequestBase.prototype.redirects = function (n) {
|
28315 | this._maxRedirects = n;
|
28316 | return this;
|
28317 | };
|
28318 |
|
28319 |
|
28320 |
|
28321 |
|
28322 |
|
28323 |
|
28324 |
|
28325 |
|
28326 |
|
28327 | RequestBase.prototype.maxResponseSize = function (n) {
|
28328 | if (typeof n !== 'number') {
|
28329 | throw new TypeError('Invalid argument');
|
28330 | }
|
28331 |
|
28332 | this._maxResponseSize = n;
|
28333 | return this;
|
28334 | };
|
28335 |
|
28336 |
|
28337 |
|
28338 |
|
28339 |
|
28340 |
|
28341 |
|
28342 |
|
28343 |
|
28344 |
|
28345 | RequestBase.prototype.toJSON = function () {
|
28346 | return {
|
28347 | method: this.method,
|
28348 | url: this.url,
|
28349 | data: this._data,
|
28350 | headers: this._header
|
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 |
|
28377 |
|
28378 |
|
28379 |
|
28380 |
|
28381 |
|
28382 |
|
28383 |
|
28384 |
|
28385 |
|
28386 |
|
28387 |
|
28388 |
|
28389 |
|
28390 |
|
28391 |
|
28392 |
|
28393 |
|
28394 |
|
28395 | RequestBase.prototype.send = function (data) {
|
28396 | var isObj = isObject(data);
|
28397 | var type = this._header['content-type'];
|
28398 |
|
28399 | if (this._formData) {
|
28400 | throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");
|
28401 | }
|
28402 |
|
28403 | if (isObj && !this._data) {
|
28404 | if (Array.isArray(data)) {
|
28405 | this._data = [];
|
28406 | } else if (!this._isHost(data)) {
|
28407 | this._data = {};
|
28408 | }
|
28409 | } else if (data && this._data && this._isHost(this._data)) {
|
28410 | throw new Error("Can't merge these send calls");
|
28411 | }
|
28412 |
|
28413 |
|
28414 | if (isObj && isObject(this._data)) {
|
28415 | for (var key in data) {
|
28416 | if (Object.prototype.hasOwnProperty.call(data, key)) this._data[key] = data[key];
|
28417 | }
|
28418 | } else if (typeof data === 'string') {
|
28419 |
|
28420 | if (!type) this.type('form');
|
28421 | type = this._header['content-type'];
|
28422 |
|
28423 | if (type === 'application/x-www-form-urlencoded') {
|
28424 | var _context2;
|
28425 |
|
28426 | this._data = this._data ? (0, _concat.default)(_context2 = "".concat(this._data, "&")).call(_context2, data) : data;
|
28427 | } else {
|
28428 | this._data = (this._data || '') + data;
|
28429 | }
|
28430 | } else {
|
28431 | this._data = data;
|
28432 | }
|
28433 |
|
28434 | if (!isObj || this._isHost(data)) {
|
28435 | return this;
|
28436 | }
|
28437 |
|
28438 |
|
28439 | if (!type) this.type('json');
|
28440 | return this;
|
28441 | };
|
28442 |
|
28443 |
|
28444 |
|
28445 |
|
28446 |
|
28447 |
|
28448 |
|
28449 |
|
28450 |
|
28451 |
|
28452 |
|
28453 |
|
28454 |
|
28455 |
|
28456 |
|
28457 |
|
28458 |
|
28459 |
|
28460 |
|
28461 |
|
28462 |
|
28463 |
|
28464 |
|
28465 |
|
28466 |
|
28467 |
|
28468 |
|
28469 |
|
28470 |
|
28471 | RequestBase.prototype.sortQuery = function (sort) {
|
28472 |
|
28473 | this._sort = typeof sort === 'undefined' ? true : sort;
|
28474 | return this;
|
28475 | };
|
28476 |
|
28477 |
|
28478 |
|
28479 |
|
28480 |
|
28481 |
|
28482 |
|
28483 | RequestBase.prototype._finalizeQueryString = function () {
|
28484 | var query = this._query.join('&');
|
28485 |
|
28486 | if (query) {
|
28487 | var _context3;
|
28488 |
|
28489 | this.url += ((0, _includes.default)(_context3 = this.url).call(_context3, '?') ? '&' : '?') + query;
|
28490 | }
|
28491 |
|
28492 | this._query.length = 0;
|
28493 |
|
28494 | if (this._sort) {
|
28495 | var _context4;
|
28496 |
|
28497 | var index = (0, _indexOf.default)(_context4 = this.url).call(_context4, '?');
|
28498 |
|
28499 | if (index >= 0) {
|
28500 | var _context5, _context6;
|
28501 |
|
28502 | var queryArr = (0, _slice.default)(_context5 = this.url).call(_context5, index + 1).split('&');
|
28503 |
|
28504 | if (typeof this._sort === 'function') {
|
28505 | (0, _sort.default)(queryArr).call(queryArr, this._sort);
|
28506 | } else {
|
28507 | (0, _sort.default)(queryArr).call(queryArr);
|
28508 | }
|
28509 |
|
28510 | this.url = (0, _slice.default)(_context6 = this.url).call(_context6, 0, index) + '?' + queryArr.join('&');
|
28511 | }
|
28512 | }
|
28513 | };
|
28514 |
|
28515 |
|
28516 | RequestBase.prototype._appendQueryString = function () {
|
28517 | console.warn('Unsupported');
|
28518 | };
|
28519 |
|
28520 |
|
28521 |
|
28522 |
|
28523 |
|
28524 |
|
28525 |
|
28526 | RequestBase.prototype._timeoutError = function (reason, timeout, errno) {
|
28527 | if (this._aborted) {
|
28528 | return;
|
28529 | }
|
28530 |
|
28531 | var err = new Error("".concat(reason + timeout, "ms exceeded"));
|
28532 | err.timeout = timeout;
|
28533 | err.code = 'ECONNABORTED';
|
28534 | err.errno = errno;
|
28535 | this.timedout = true;
|
28536 | this.timedoutError = err;
|
28537 | this.abort();
|
28538 | this.callback(err);
|
28539 | };
|
28540 |
|
28541 | RequestBase.prototype._setTimeouts = function () {
|
28542 | var self = this;
|
28543 |
|
28544 | if (this._timeout && !this._timer) {
|
28545 | this._timer = setTimeout(function () {
|
28546 | self._timeoutError('Timeout of ', self._timeout, 'ETIME');
|
28547 | }, this._timeout);
|
28548 | }
|
28549 |
|
28550 |
|
28551 | if (this._responseTimeout && !this._responseTimeoutTimer) {
|
28552 | this._responseTimeoutTimer = setTimeout(function () {
|
28553 | self._timeoutError('Response timeout of ', self._responseTimeout, 'ETIMEDOUT');
|
28554 | }, this._responseTimeout);
|
28555 | }
|
28556 | };
|
28557 |
|
28558 | }),
|
28559 |
|
28560 | (function(module, exports, __webpack_require__) {
|
28561 |
|
28562 | module.exports = __webpack_require__(589);
|
28563 |
|
28564 | }),
|
28565 |
|
28566 | (function(module, exports, __webpack_require__) {
|
28567 |
|
28568 | var parent = __webpack_require__(590);
|
28569 |
|
28570 | module.exports = parent;
|
28571 |
|
28572 |
|
28573 | }),
|
28574 |
|
28575 | (function(module, exports, __webpack_require__) {
|
28576 |
|
28577 | var isPrototypeOf = __webpack_require__(16);
|
28578 | var arrayMethod = __webpack_require__(591);
|
28579 | var stringMethod = __webpack_require__(593);
|
28580 |
|
28581 | var ArrayPrototype = Array.prototype;
|
28582 | var StringPrototype = String.prototype;
|
28583 |
|
28584 | module.exports = function (it) {
|
28585 | var own = it.includes;
|
28586 | if (it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.includes)) return arrayMethod;
|
28587 | if (typeof it == 'string' || it === StringPrototype || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.includes)) {
|
28588 | return stringMethod;
|
28589 | } return own;
|
28590 | };
|
28591 |
|
28592 |
|
28593 | }),
|
28594 |
|
28595 | (function(module, exports, __webpack_require__) {
|
28596 |
|
28597 | __webpack_require__(592);
|
28598 | var entryVirtual = __webpack_require__(27);
|
28599 |
|
28600 | module.exports = entryVirtual('Array').includes;
|
28601 |
|
28602 |
|
28603 | }),
|
28604 |
|
28605 | (function(module, exports, __webpack_require__) {
|
28606 |
|
28607 | "use strict";
|
28608 |
|
28609 | var $ = __webpack_require__(0);
|
28610 | var $includes = __webpack_require__(126).includes;
|
28611 | var fails = __webpack_require__(2);
|
28612 | var addToUnscopables = __webpack_require__(132);
|
28613 |
|
28614 |
|
28615 | var BROKEN_ON_SPARSE = fails(function () {
|
28616 | return !Array(1).includes();
|
28617 | });
|
28618 |
|
28619 |
|
28620 |
|
28621 | $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
28622 | includes: function includes(el /* , fromIndex = 0 */) {
|
28623 | return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
28624 | }
|
28625 | });
|
28626 |
|
28627 |
|
28628 | addToUnscopables('includes');
|
28629 |
|
28630 |
|
28631 | }),
|
28632 |
|
28633 | (function(module, exports, __webpack_require__) {
|
28634 |
|
28635 | __webpack_require__(594);
|
28636 | var entryVirtual = __webpack_require__(27);
|
28637 |
|
28638 | module.exports = entryVirtual('String').includes;
|
28639 |
|
28640 |
|
28641 | }),
|
28642 |
|
28643 | (function(module, exports, __webpack_require__) {
|
28644 |
|
28645 | "use strict";
|
28646 |
|
28647 | var $ = __webpack_require__(0);
|
28648 | var uncurryThis = __webpack_require__(4);
|
28649 | var notARegExp = __webpack_require__(595);
|
28650 | var requireObjectCoercible = __webpack_require__(81);
|
28651 | var toString = __webpack_require__(42);
|
28652 | var correctIsRegExpLogic = __webpack_require__(597);
|
28653 |
|
28654 | var stringIndexOf = uncurryThis(''.indexOf);
|
28655 |
|
28656 |
|
28657 |
|
28658 | $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
28659 | includes: function includes(searchString /* , position = 0 */) {
|
28660 | return !!~stringIndexOf(
|
28661 | toString(requireObjectCoercible(this)),
|
28662 | toString(notARegExp(searchString)),
|
28663 | arguments.length > 1 ? arguments[1] : undefined
|
28664 | );
|
28665 | }
|
28666 | });
|
28667 |
|
28668 |
|
28669 | }),
|
28670 |
|
28671 | (function(module, exports, __webpack_require__) {
|
28672 |
|
28673 | var isRegExp = __webpack_require__(596);
|
28674 |
|
28675 | var $TypeError = TypeError;
|
28676 |
|
28677 | module.exports = function (it) {
|
28678 | if (isRegExp(it)) {
|
28679 | throw $TypeError("The method doesn't accept regular expressions");
|
28680 | } return it;
|
28681 | };
|
28682 |
|
28683 |
|
28684 | }),
|
28685 |
|
28686 | (function(module, exports, __webpack_require__) {
|
28687 |
|
28688 | var isObject = __webpack_require__(11);
|
28689 | var classof = __webpack_require__(50);
|
28690 | var wellKnownSymbol = __webpack_require__(5);
|
28691 |
|
28692 | var MATCH = wellKnownSymbol('match');
|
28693 |
|
28694 |
|
28695 |
|
28696 | module.exports = function (it) {
|
28697 | var isRegExp;
|
28698 | return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
|
28699 | };
|
28700 |
|
28701 |
|
28702 | }),
|
28703 |
|
28704 | (function(module, exports, __webpack_require__) {
|
28705 |
|
28706 | var wellKnownSymbol = __webpack_require__(5);
|
28707 |
|
28708 | var MATCH = wellKnownSymbol('match');
|
28709 |
|
28710 | module.exports = function (METHOD_NAME) {
|
28711 | var regexp = /./;
|
28712 | try {
|
28713 | '/./'[METHOD_NAME](regexp);
|
28714 | } catch (error1) {
|
28715 | try {
|
28716 | regexp[MATCH] = false;
|
28717 | return '/./'[METHOD_NAME](regexp);
|
28718 | } catch (error2) { }
|
28719 | } return false;
|
28720 | };
|
28721 |
|
28722 |
|
28723 | }),
|
28724 |
|
28725 | (function(module, exports, __webpack_require__) {
|
28726 |
|
28727 | module.exports = __webpack_require__(599);
|
28728 |
|
28729 | }),
|
28730 |
|
28731 | (function(module, exports, __webpack_require__) {
|
28732 |
|
28733 | var parent = __webpack_require__(600);
|
28734 |
|
28735 | module.exports = parent;
|
28736 |
|
28737 |
|
28738 | }),
|
28739 |
|
28740 | (function(module, exports, __webpack_require__) {
|
28741 |
|
28742 | var isPrototypeOf = __webpack_require__(16);
|
28743 | var method = __webpack_require__(601);
|
28744 |
|
28745 | var ArrayPrototype = Array.prototype;
|
28746 |
|
28747 | module.exports = function (it) {
|
28748 | var own = it.sort;
|
28749 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.sort) ? method : own;
|
28750 | };
|
28751 |
|
28752 |
|
28753 | }),
|
28754 |
|
28755 | (function(module, exports, __webpack_require__) {
|
28756 |
|
28757 | __webpack_require__(602);
|
28758 | var entryVirtual = __webpack_require__(27);
|
28759 |
|
28760 | module.exports = entryVirtual('Array').sort;
|
28761 |
|
28762 |
|
28763 | }),
|
28764 |
|
28765 | (function(module, exports, __webpack_require__) {
|
28766 |
|
28767 | "use strict";
|
28768 |
|
28769 | var $ = __webpack_require__(0);
|
28770 | var uncurryThis = __webpack_require__(4);
|
28771 | var aCallable = __webpack_require__(29);
|
28772 | var toObject = __webpack_require__(33);
|
28773 | var lengthOfArrayLike = __webpack_require__(40);
|
28774 | var deletePropertyOrThrow = __webpack_require__(603);
|
28775 | var toString = __webpack_require__(42);
|
28776 | var fails = __webpack_require__(2);
|
28777 | var internalSort = __webpack_require__(604);
|
28778 | var arrayMethodIsStrict = __webpack_require__(151);
|
28779 | var FF = __webpack_require__(605);
|
28780 | var IE_OR_EDGE = __webpack_require__(606);
|
28781 | var V8 = __webpack_require__(66);
|
28782 | var WEBKIT = __webpack_require__(607);
|
28783 |
|
28784 | var test = [];
|
28785 | var un$Sort = uncurryThis(test.sort);
|
28786 | var push = uncurryThis(test.push);
|
28787 |
|
28788 |
|
28789 | var FAILS_ON_UNDEFINED = fails(function () {
|
28790 | test.sort(undefined);
|
28791 | });
|
28792 |
|
28793 | var FAILS_ON_NULL = fails(function () {
|
28794 | test.sort(null);
|
28795 | });
|
28796 |
|
28797 | var STRICT_METHOD = arrayMethodIsStrict('sort');
|
28798 |
|
28799 | var STABLE_SORT = !fails(function () {
|
28800 |
|
28801 | if (V8) return V8 < 70;
|
28802 | if (FF && FF > 3) return;
|
28803 | if (IE_OR_EDGE) return true;
|
28804 | if (WEBKIT) return WEBKIT < 603;
|
28805 |
|
28806 | var result = '';
|
28807 | var code, chr, value, index;
|
28808 |
|
28809 |
|
28810 | for (code = 65; code < 76; code++) {
|
28811 | chr = String.fromCharCode(code);
|
28812 |
|
28813 | switch (code) {
|
28814 | case 66: case 69: case 70: case 72: value = 3; break;
|
28815 | case 68: case 71: value = 4; break;
|
28816 | default: value = 2;
|
28817 | }
|
28818 |
|
28819 | for (index = 0; index < 47; index++) {
|
28820 | test.push({ k: chr + index, v: value });
|
28821 | }
|
28822 | }
|
28823 |
|
28824 | test.sort(function (a, b) { return b.v - a.v; });
|
28825 |
|
28826 | for (index = 0; index < test.length; index++) {
|
28827 | chr = test[index].k.charAt(0);
|
28828 | if (result.charAt(result.length - 1) !== chr) result += chr;
|
28829 | }
|
28830 |
|
28831 | return result !== 'DGBEFHACIJK';
|
28832 | });
|
28833 |
|
28834 | var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
28835 |
|
28836 | var getSortCompare = function (comparefn) {
|
28837 | return function (x, y) {
|
28838 | if (y === undefined) return -1;
|
28839 | if (x === undefined) return 1;
|
28840 | if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
28841 | return toString(x) > toString(y) ? 1 : -1;
|
28842 | };
|
28843 | };
|
28844 |
|
28845 |
|
28846 |
|
28847 | $({ target: 'Array', proto: true, forced: FORCED }, {
|
28848 | sort: function sort(comparefn) {
|
28849 | if (comparefn !== undefined) aCallable(comparefn);
|
28850 |
|
28851 | var array = toObject(this);
|
28852 |
|
28853 | if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
|
28854 |
|
28855 | var items = [];
|
28856 | var arrayLength = lengthOfArrayLike(array);
|
28857 | var itemsLength, index;
|
28858 |
|
28859 | for (index = 0; index < arrayLength; index++) {
|
28860 | if (index in array) push(items, array[index]);
|
28861 | }
|
28862 |
|
28863 | internalSort(items, getSortCompare(comparefn));
|
28864 |
|
28865 | itemsLength = items.length;
|
28866 | index = 0;
|
28867 |
|
28868 | while (index < itemsLength) array[index] = items[index++];
|
28869 | while (index < arrayLength) deletePropertyOrThrow(array, index++);
|
28870 |
|
28871 | return array;
|
28872 | }
|
28873 | });
|
28874 |
|
28875 |
|
28876 | }),
|
28877 |
|
28878 | (function(module, exports, __webpack_require__) {
|
28879 |
|
28880 | "use strict";
|
28881 |
|
28882 | var tryToString = __webpack_require__(67);
|
28883 |
|
28884 | var $TypeError = TypeError;
|
28885 |
|
28886 | module.exports = function (O, P) {
|
28887 | if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
|
28888 | };
|
28889 |
|
28890 |
|
28891 | }),
|
28892 |
|
28893 | (function(module, exports, __webpack_require__) {
|
28894 |
|
28895 | var arraySlice = __webpack_require__(245);
|
28896 |
|
28897 | var floor = Math.floor;
|
28898 |
|
28899 | var mergeSort = function (array, comparefn) {
|
28900 | var length = array.length;
|
28901 | var middle = floor(length / 2);
|
28902 | return length < 8 ? insertionSort(array, comparefn) : merge(
|
28903 | array,
|
28904 | mergeSort(arraySlice(array, 0, middle), comparefn),
|
28905 | mergeSort(arraySlice(array, middle), comparefn),
|
28906 | comparefn
|
28907 | );
|
28908 | };
|
28909 |
|
28910 | var insertionSort = function (array, comparefn) {
|
28911 | var length = array.length;
|
28912 | var i = 1;
|
28913 | var element, j;
|
28914 |
|
28915 | while (i < length) {
|
28916 | j = i;
|
28917 | element = array[i];
|
28918 | while (j && comparefn(array[j - 1], element) > 0) {
|
28919 | array[j] = array[--j];
|
28920 | }
|
28921 | if (j !== i++) array[j] = element;
|
28922 | } return array;
|
28923 | };
|
28924 |
|
28925 | var merge = function (array, left, right, comparefn) {
|
28926 | var llength = left.length;
|
28927 | var rlength = right.length;
|
28928 | var lindex = 0;
|
28929 | var rindex = 0;
|
28930 |
|
28931 | while (lindex < llength || rindex < rlength) {
|
28932 | array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
28933 | ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
28934 | : lindex < llength ? left[lindex++] : right[rindex++];
|
28935 | } return array;
|
28936 | };
|
28937 |
|
28938 | module.exports = mergeSort;
|
28939 |
|
28940 |
|
28941 | }),
|
28942 |
|
28943 | (function(module, exports, __webpack_require__) {
|
28944 |
|
28945 | var userAgent = __webpack_require__(51);
|
28946 |
|
28947 | var firefox = userAgent.match(/firefox\/(\d+)/i);
|
28948 |
|
28949 | module.exports = !!firefox && +firefox[1];
|
28950 |
|
28951 |
|
28952 | }),
|
28953 |
|
28954 | (function(module, exports, __webpack_require__) {
|
28955 |
|
28956 | var UA = __webpack_require__(51);
|
28957 |
|
28958 | module.exports = /MSIE|Trident/.test(UA);
|
28959 |
|
28960 |
|
28961 | }),
|
28962 |
|
28963 | (function(module, exports, __webpack_require__) {
|
28964 |
|
28965 | var userAgent = __webpack_require__(51);
|
28966 |
|
28967 | var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
28968 |
|
28969 | module.exports = !!webkit && +webkit[1];
|
28970 |
|
28971 |
|
28972 | }),
|
28973 |
|
28974 | (function(module, exports, __webpack_require__) {
|
28975 |
|
28976 | "use strict";
|
28977 |
|
28978 |
|
28979 |
|
28980 |
|
28981 |
|
28982 | var utils = __webpack_require__(609);
|
28983 |
|
28984 |
|
28985 |
|
28986 |
|
28987 |
|
28988 | module.exports = ResponseBase;
|
28989 |
|
28990 |
|
28991 |
|
28992 |
|
28993 |
|
28994 |
|
28995 | function ResponseBase(obj) {
|
28996 | if (obj) return mixin(obj);
|
28997 | }
|
28998 |
|
28999 |
|
29000 |
|
29001 |
|
29002 |
|
29003 |
|
29004 |
|
29005 |
|
29006 |
|
29007 | function mixin(obj) {
|
29008 | for (var key in ResponseBase.prototype) {
|
29009 | if (Object.prototype.hasOwnProperty.call(ResponseBase.prototype, key)) obj[key] = ResponseBase.prototype[key];
|
29010 | }
|
29011 |
|
29012 | return obj;
|
29013 | }
|
29014 |
|
29015 |
|
29016 |
|
29017 |
|
29018 |
|
29019 |
|
29020 |
|
29021 |
|
29022 |
|
29023 | ResponseBase.prototype.get = function (field) {
|
29024 | return this.header[field.toLowerCase()];
|
29025 | };
|
29026 |
|
29027 |
|
29028 |
|
29029 |
|
29030 |
|
29031 |
|
29032 |
|
29033 |
|
29034 |
|
29035 |
|
29036 |
|
29037 |
|
29038 |
|
29039 | ResponseBase.prototype._setHeaderProperties = function (header) {
|
29040 |
|
29041 |
|
29042 |
|
29043 | var ct = header['content-type'] || '';
|
29044 | this.type = utils.type(ct);
|
29045 |
|
29046 | var params = utils.params(ct);
|
29047 |
|
29048 | for (var key in params) {
|
29049 | if (Object.prototype.hasOwnProperty.call(params, key)) this[key] = params[key];
|
29050 | }
|
29051 |
|
29052 | this.links = {};
|
29053 |
|
29054 | try {
|
29055 | if (header.link) {
|
29056 | this.links = utils.parseLinks(header.link);
|
29057 | }
|
29058 | } catch (_unused) {
|
29059 | }
|
29060 | };
|
29061 |
|
29062 |
|
29063 |
|
29064 |
|
29065 |
|
29066 |
|
29067 |
|
29068 |
|
29069 |
|
29070 |
|
29071 |
|
29072 |
|
29073 |
|
29074 |
|
29075 |
|
29076 |
|
29077 |
|
29078 |
|
29079 |
|
29080 |
|
29081 |
|
29082 |
|
29083 | ResponseBase.prototype._setStatusProperties = function (status) {
|
29084 | var type = status / 100 | 0;
|
29085 |
|
29086 | this.statusCode = status;
|
29087 | this.status = this.statusCode;
|
29088 | this.statusType = type;
|
29089 |
|
29090 | this.info = type === 1;
|
29091 | this.ok = type === 2;
|
29092 | this.redirect = type === 3;
|
29093 | this.clientError = type === 4;
|
29094 | this.serverError = type === 5;
|
29095 | this.error = type === 4 || type === 5 ? this.toError() : false;
|
29096 |
|
29097 | this.created = status === 201;
|
29098 | this.accepted = status === 202;
|
29099 | this.noContent = status === 204;
|
29100 | this.badRequest = status === 400;
|
29101 | this.unauthorized = status === 401;
|
29102 | this.notAcceptable = status === 406;
|
29103 | this.forbidden = status === 403;
|
29104 | this.notFound = status === 404;
|
29105 | this.unprocessableEntity = status === 422;
|
29106 | };
|
29107 |
|
29108 | }),
|
29109 |
|
29110 | (function(module, exports, __webpack_require__) {
|
29111 |
|
29112 | "use strict";
|
29113 |
|
29114 |
|
29115 |
|
29116 |
|
29117 |
|
29118 |
|
29119 |
|
29120 |
|
29121 |
|
29122 | var _interopRequireDefault = __webpack_require__(1);
|
29123 |
|
29124 | var _reduce = _interopRequireDefault(__webpack_require__(262));
|
29125 |
|
29126 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
29127 |
|
29128 | exports.type = function (str) {
|
29129 | return str.split(/ *; */).shift();
|
29130 | };
|
29131 |
|
29132 |
|
29133 |
|
29134 |
|
29135 |
|
29136 |
|
29137 |
|
29138 |
|
29139 |
|
29140 | exports.params = function (str) {
|
29141 | var _context;
|
29142 |
|
29143 | return (0, _reduce.default)(_context = str.split(/ *; */)).call(_context, function (obj, str) {
|
29144 | var parts = str.split(/ *= */);
|
29145 | var key = parts.shift();
|
29146 | var val = parts.shift();
|
29147 | if (key && val) obj[key] = val;
|
29148 | return obj;
|
29149 | }, {});
|
29150 | };
|
29151 |
|
29152 |
|
29153 |
|
29154 |
|
29155 |
|
29156 |
|
29157 |
|
29158 |
|
29159 |
|
29160 | exports.parseLinks = function (str) {
|
29161 | var _context2;
|
29162 |
|
29163 | return (0, _reduce.default)(_context2 = str.split(/ *, */)).call(_context2, function (obj, str) {
|
29164 | var _context3, _context4;
|
29165 |
|
29166 | var parts = str.split(/ *; */);
|
29167 | var url = (0, _slice.default)(_context3 = parts[0]).call(_context3, 1, -1);
|
29168 | var rel = (0, _slice.default)(_context4 = parts[1].split(/ *= */)[1]).call(_context4, 1, -1);
|
29169 | obj[rel] = url;
|
29170 | return obj;
|
29171 | }, {});
|
29172 | };
|
29173 |
|
29174 |
|
29175 |
|
29176 |
|
29177 |
|
29178 |
|
29179 |
|
29180 |
|
29181 |
|
29182 | exports.cleanHeader = function (header, changesOrigin) {
|
29183 | delete header['content-type'];
|
29184 | delete header['content-length'];
|
29185 | delete header['transfer-encoding'];
|
29186 | delete header.host;
|
29187 |
|
29188 | if (changesOrigin) {
|
29189 | delete header.authorization;
|
29190 | delete header.cookie;
|
29191 | }
|
29192 |
|
29193 | return header;
|
29194 | };
|
29195 |
|
29196 | }),
|
29197 |
|
29198 | (function(module, exports, __webpack_require__) {
|
29199 |
|
29200 | var parent = __webpack_require__(611);
|
29201 |
|
29202 | module.exports = parent;
|
29203 |
|
29204 |
|
29205 | }),
|
29206 |
|
29207 | (function(module, exports, __webpack_require__) {
|
29208 |
|
29209 | var isPrototypeOf = __webpack_require__(16);
|
29210 | var method = __webpack_require__(612);
|
29211 |
|
29212 | var ArrayPrototype = Array.prototype;
|
29213 |
|
29214 | module.exports = function (it) {
|
29215 | var own = it.reduce;
|
29216 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.reduce) ? method : own;
|
29217 | };
|
29218 |
|
29219 |
|
29220 | }),
|
29221 |
|
29222 | (function(module, exports, __webpack_require__) {
|
29223 |
|
29224 | __webpack_require__(613);
|
29225 | var entryVirtual = __webpack_require__(27);
|
29226 |
|
29227 | module.exports = entryVirtual('Array').reduce;
|
29228 |
|
29229 |
|
29230 | }),
|
29231 |
|
29232 | (function(module, exports, __webpack_require__) {
|
29233 |
|
29234 | "use strict";
|
29235 |
|
29236 | var $ = __webpack_require__(0);
|
29237 | var $reduce = __webpack_require__(614).left;
|
29238 | var arrayMethodIsStrict = __webpack_require__(151);
|
29239 | var CHROME_VERSION = __webpack_require__(66);
|
29240 | var IS_NODE = __webpack_require__(109);
|
29241 |
|
29242 | var STRICT_METHOD = arrayMethodIsStrict('reduce');
|
29243 |
|
29244 |
|
29245 | var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
29246 |
|
29247 |
|
29248 |
|
29249 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
|
29250 | reduce: function reduce(callbackfn /* , initialValue */) {
|
29251 | var length = arguments.length;
|
29252 | return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
29253 | }
|
29254 | });
|
29255 |
|
29256 |
|
29257 | }),
|
29258 |
|
29259 | (function(module, exports, __webpack_require__) {
|
29260 |
|
29261 | var aCallable = __webpack_require__(29);
|
29262 | var toObject = __webpack_require__(33);
|
29263 | var IndexedObject = __webpack_require__(98);
|
29264 | var lengthOfArrayLike = __webpack_require__(40);
|
29265 |
|
29266 | var $TypeError = TypeError;
|
29267 |
|
29268 |
|
29269 | var createMethod = function (IS_RIGHT) {
|
29270 | return function (that, callbackfn, argumentsLength, memo) {
|
29271 | aCallable(callbackfn);
|
29272 | var O = toObject(that);
|
29273 | var self = IndexedObject(O);
|
29274 | var length = lengthOfArrayLike(O);
|
29275 | var index = IS_RIGHT ? length - 1 : 0;
|
29276 | var i = IS_RIGHT ? -1 : 1;
|
29277 | if (argumentsLength < 2) while (true) {
|
29278 | if (index in self) {
|
29279 | memo = self[index];
|
29280 | index += i;
|
29281 | break;
|
29282 | }
|
29283 | index += i;
|
29284 | if (IS_RIGHT ? index < 0 : length <= index) {
|
29285 | throw $TypeError('Reduce of empty array with no initial value');
|
29286 | }
|
29287 | }
|
29288 | for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
29289 | memo = callbackfn(memo, self[index], index, O);
|
29290 | }
|
29291 | return memo;
|
29292 | };
|
29293 | };
|
29294 |
|
29295 | module.exports = {
|
29296 |
|
29297 |
|
29298 | left: createMethod(false),
|
29299 |
|
29300 |
|
29301 | right: createMethod(true)
|
29302 | };
|
29303 |
|
29304 |
|
29305 | }),
|
29306 |
|
29307 | (function(module, exports, __webpack_require__) {
|
29308 |
|
29309 | "use strict";
|
29310 |
|
29311 |
|
29312 | var _interopRequireDefault = __webpack_require__(1);
|
29313 |
|
29314 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
29315 |
|
29316 | var _from = _interopRequireDefault(__webpack_require__(153));
|
29317 |
|
29318 | var _symbol = _interopRequireDefault(__webpack_require__(77));
|
29319 |
|
29320 | var _isIterable2 = _interopRequireDefault(__webpack_require__(263));
|
29321 |
|
29322 | function _toConsumableArray(arr) {
|
29323 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
29324 | }
|
29325 |
|
29326 | function _nonIterableSpread() {
|
29327 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
29328 | }
|
29329 |
|
29330 | function _unsupportedIterableToArray(o, minLen) {
|
29331 | var _context;
|
29332 |
|
29333 | if (!o) return;
|
29334 | if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
29335 | var n = (0, _slice.default)(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
|
29336 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
29337 | if (n === "Map" || n === "Set") return (0, _from.default)(o);
|
29338 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
29339 | }
|
29340 |
|
29341 | function _iterableToArray(iter) {
|
29342 | if (typeof _symbol.default !== "undefined" && (0, _isIterable2.default)(Object(iter))) return (0, _from.default)(iter);
|
29343 | }
|
29344 |
|
29345 | function _arrayWithoutHoles(arr) {
|
29346 | if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
29347 | }
|
29348 |
|
29349 | function _arrayLikeToArray(arr, len) {
|
29350 | if (len == null || len > arr.length) len = arr.length;
|
29351 |
|
29352 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
29353 | arr2[i] = arr[i];
|
29354 | }
|
29355 |
|
29356 | return arr2;
|
29357 | }
|
29358 |
|
29359 | function Agent() {
|
29360 | this._defaults = [];
|
29361 | }
|
29362 |
|
29363 | ['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) {
|
29364 |
|
29365 | Agent.prototype[fn] = function () {
|
29366 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
29367 | args[_key] = arguments[_key];
|
29368 | }
|
29369 |
|
29370 | this._defaults.push({
|
29371 | fn: fn,
|
29372 | args: args
|
29373 | });
|
29374 |
|
29375 | return this;
|
29376 | };
|
29377 | });
|
29378 |
|
29379 | Agent.prototype._setDefaults = function (req) {
|
29380 | this._defaults.forEach(function (def) {
|
29381 | req[def.fn].apply(req, _toConsumableArray(def.args));
|
29382 | });
|
29383 | };
|
29384 |
|
29385 | module.exports = Agent;
|
29386 |
|
29387 | }),
|
29388 |
|
29389 | (function(module, exports, __webpack_require__) {
|
29390 |
|
29391 | module.exports = __webpack_require__(617);
|
29392 |
|
29393 |
|
29394 | }),
|
29395 |
|
29396 | (function(module, exports, __webpack_require__) {
|
29397 |
|
29398 | var parent = __webpack_require__(618);
|
29399 |
|
29400 | module.exports = parent;
|
29401 |
|
29402 |
|
29403 | }),
|
29404 |
|
29405 | (function(module, exports, __webpack_require__) {
|
29406 |
|
29407 | var parent = __webpack_require__(619);
|
29408 |
|
29409 | module.exports = parent;
|
29410 |
|
29411 |
|
29412 | }),
|
29413 |
|
29414 | (function(module, exports, __webpack_require__) {
|
29415 |
|
29416 | var parent = __webpack_require__(620);
|
29417 | __webpack_require__(46);
|
29418 |
|
29419 | module.exports = parent;
|
29420 |
|
29421 |
|
29422 | }),
|
29423 |
|
29424 | (function(module, exports, __webpack_require__) {
|
29425 |
|
29426 | __webpack_require__(43);
|
29427 | __webpack_require__(70);
|
29428 | var isIterable = __webpack_require__(621);
|
29429 |
|
29430 | module.exports = isIterable;
|
29431 |
|
29432 |
|
29433 | }),
|
29434 |
|
29435 | (function(module, exports, __webpack_require__) {
|
29436 |
|
29437 | var classof = __webpack_require__(55);
|
29438 | var hasOwn = __webpack_require__(13);
|
29439 | var wellKnownSymbol = __webpack_require__(5);
|
29440 | var Iterators = __webpack_require__(54);
|
29441 |
|
29442 | var ITERATOR = wellKnownSymbol('iterator');
|
29443 | var $Object = Object;
|
29444 |
|
29445 | module.exports = function (it) {
|
29446 | var O = $Object(it);
|
29447 | return O[ITERATOR] !== undefined
|
29448 | || '@@iterator' in O
|
29449 | || hasOwn(Iterators, classof(O));
|
29450 | };
|
29451 |
|
29452 |
|
29453 | }),
|
29454 |
|
29455 | (function(module, exports, __webpack_require__) {
|
29456 |
|
29457 | "use strict";
|
29458 |
|
29459 |
|
29460 | var _require = __webpack_require__(156),
|
29461 | Realtime = _require.Realtime,
|
29462 | setRTMAdapters = _require.setAdapters;
|
29463 |
|
29464 | var _require2 = __webpack_require__(707),
|
29465 | LiveQueryPlugin = _require2.LiveQueryPlugin;
|
29466 |
|
29467 | Realtime.__preRegisteredPlugins = [LiveQueryPlugin];
|
29468 |
|
29469 | module.exports = function (AV) {
|
29470 | AV._sharedConfig.liveQueryRealtime = Realtime;
|
29471 | var setAdapters = AV.setAdapters;
|
29472 |
|
29473 | AV.setAdapters = function (adapters) {
|
29474 | setAdapters(adapters);
|
29475 | setRTMAdapters(adapters);
|
29476 | };
|
29477 |
|
29478 | return AV;
|
29479 | };
|
29480 |
|
29481 | }),
|
29482 |
|
29483 | (function(module, exports, __webpack_require__) {
|
29484 |
|
29485 | "use strict";
|
29486 | (function(global) {
|
29487 |
|
29488 | var _interopRequireDefault = __webpack_require__(1);
|
29489 |
|
29490 | var _typeof3 = _interopRequireDefault(__webpack_require__(95));
|
29491 |
|
29492 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(94));
|
29493 |
|
29494 | var _freeze = _interopRequireDefault(__webpack_require__(624));
|
29495 |
|
29496 | var _assign = _interopRequireDefault(__webpack_require__(266));
|
29497 |
|
29498 | var _symbol = _interopRequireDefault(__webpack_require__(77));
|
29499 |
|
29500 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
29501 |
|
29502 | var _keys = _interopRequireDefault(__webpack_require__(150));
|
29503 |
|
29504 | var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(267));
|
29505 |
|
29506 | var _filter = _interopRequireDefault(__webpack_require__(250));
|
29507 |
|
29508 | var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(258));
|
29509 |
|
29510 | var _getOwnPropertyDescriptors = _interopRequireDefault(__webpack_require__(635));
|
29511 |
|
29512 | var _defineProperties = _interopRequireDefault(__webpack_require__(639));
|
29513 |
|
29514 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
29515 |
|
29516 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
29517 |
|
29518 | var _indexOf = _interopRequireDefault(__webpack_require__(61));
|
29519 |
|
29520 | var _weakMap = _interopRequireDefault(__webpack_require__(643));
|
29521 |
|
29522 | var _stringify = _interopRequireDefault(__webpack_require__(38));
|
29523 |
|
29524 | var _map = _interopRequireDefault(__webpack_require__(37));
|
29525 |
|
29526 | var _reduce = _interopRequireDefault(__webpack_require__(262));
|
29527 |
|
29528 | var _find = _interopRequireDefault(__webpack_require__(96));
|
29529 |
|
29530 | var _set = _interopRequireDefault(__webpack_require__(269));
|
29531 |
|
29532 | var _context6, _context15;
|
29533 |
|
29534 | (0, _defineProperty2.default)(exports, '__esModule', {
|
29535 | value: true
|
29536 | });
|
29537 |
|
29538 | function _interopDefault(ex) {
|
29539 | return ex && (0, _typeof3.default)(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
|
29540 | }
|
29541 |
|
29542 | var protobufLight = _interopDefault(__webpack_require__(654));
|
29543 |
|
29544 | var EventEmitter = _interopDefault(__webpack_require__(658));
|
29545 |
|
29546 | var _asyncToGenerator = _interopDefault(__webpack_require__(659));
|
29547 |
|
29548 | var _toConsumableArray = _interopDefault(__webpack_require__(660));
|
29549 |
|
29550 | var _defineProperty = _interopDefault(__webpack_require__(663));
|
29551 |
|
29552 | var _objectWithoutProperties = _interopDefault(__webpack_require__(665));
|
29553 |
|
29554 | var _assertThisInitialized = _interopDefault(__webpack_require__(667));
|
29555 |
|
29556 | var _inheritsLoose = _interopDefault(__webpack_require__(668));
|
29557 |
|
29558 | var _regeneratorRuntime = _interopDefault(__webpack_require__(670));
|
29559 |
|
29560 | var d = _interopDefault(__webpack_require__(63));
|
29561 |
|
29562 | var shuffle = _interopDefault(__webpack_require__(672));
|
29563 |
|
29564 | var values = _interopDefault(__webpack_require__(275));
|
29565 |
|
29566 | var _toArray = _interopDefault(__webpack_require__(699));
|
29567 |
|
29568 | var _createClass = _interopDefault(__webpack_require__(702));
|
29569 |
|
29570 | var _applyDecoratedDescriptor = _interopDefault(__webpack_require__(703));
|
29571 |
|
29572 | var StateMachine = _interopDefault(__webpack_require__(704));
|
29573 |
|
29574 | var _typeof = _interopDefault(__webpack_require__(119));
|
29575 |
|
29576 | var isPlainObject = _interopDefault(__webpack_require__(705));
|
29577 |
|
29578 | var promiseTimeout = __webpack_require__(251);
|
29579 |
|
29580 | var messageCompiled = protobufLight.newBuilder({})['import']({
|
29581 | "package": 'push_server.messages2',
|
29582 | syntax: 'proto2',
|
29583 | options: {
|
29584 | objc_class_prefix: 'AVIM'
|
29585 | },
|
29586 | messages: [{
|
29587 | name: 'JsonObjectMessage',
|
29588 | syntax: 'proto2',
|
29589 | fields: [{
|
29590 | rule: 'required',
|
29591 | type: 'string',
|
29592 | name: 'data',
|
29593 | id: 1
|
29594 | }]
|
29595 | }, {
|
29596 | name: 'UnreadTuple',
|
29597 | syntax: 'proto2',
|
29598 | fields: [{
|
29599 | rule: 'required',
|
29600 | type: 'string',
|
29601 | name: 'cid',
|
29602 | id: 1
|
29603 | }, {
|
29604 | rule: 'required',
|
29605 | type: 'int32',
|
29606 | name: 'unread',
|
29607 | id: 2
|
29608 | }, {
|
29609 | rule: 'optional',
|
29610 | type: 'string',
|
29611 | name: 'mid',
|
29612 | id: 3
|
29613 | }, {
|
29614 | rule: 'optional',
|
29615 | type: 'int64',
|
29616 | name: 'timestamp',
|
29617 | id: 4
|
29618 | }, {
|
29619 | rule: 'optional',
|
29620 | type: 'string',
|
29621 | name: 'from',
|
29622 | id: 5
|
29623 | }, {
|
29624 | rule: 'optional',
|
29625 | type: 'string',
|
29626 | name: 'data',
|
29627 | id: 6
|
29628 | }, {
|
29629 | rule: 'optional',
|
29630 | type: 'int64',
|
29631 | name: 'patchTimestamp',
|
29632 | id: 7
|
29633 | }, {
|
29634 | rule: 'optional',
|
29635 | type: 'bool',
|
29636 | name: 'mentioned',
|
29637 | id: 8
|
29638 | }, {
|
29639 | rule: 'optional',
|
29640 | type: 'bytes',
|
29641 | name: 'binaryMsg',
|
29642 | id: 9
|
29643 | }, {
|
29644 | rule: 'optional',
|
29645 | type: 'int32',
|
29646 | name: 'convType',
|
29647 | id: 10
|
29648 | }]
|
29649 | }, {
|
29650 | name: 'LogItem',
|
29651 | syntax: 'proto2',
|
29652 | fields: [{
|
29653 | rule: 'optional',
|
29654 | type: 'string',
|
29655 | name: 'from',
|
29656 | id: 1
|
29657 | }, {
|
29658 | rule: 'optional',
|
29659 | type: 'string',
|
29660 | name: 'data',
|
29661 | id: 2
|
29662 | }, {
|
29663 | rule: 'optional',
|
29664 | type: 'int64',
|
29665 | name: 'timestamp',
|
29666 | id: 3
|
29667 | }, {
|
29668 | rule: 'optional',
|
29669 | type: 'string',
|
29670 | name: 'msgId',
|
29671 | id: 4
|
29672 | }, {
|
29673 | rule: 'optional',
|
29674 | type: 'int64',
|
29675 | name: 'ackAt',
|
29676 | id: 5
|
29677 | }, {
|
29678 | rule: 'optional',
|
29679 | type: 'int64',
|
29680 | name: 'readAt',
|
29681 | id: 6
|
29682 | }, {
|
29683 | rule: 'optional',
|
29684 | type: 'int64',
|
29685 | name: 'patchTimestamp',
|
29686 | id: 7
|
29687 | }, {
|
29688 | rule: 'optional',
|
29689 | type: 'bool',
|
29690 | name: 'mentionAll',
|
29691 | id: 8
|
29692 | }, {
|
29693 | rule: 'repeated',
|
29694 | type: 'string',
|
29695 | name: 'mentionPids',
|
29696 | id: 9
|
29697 | }, {
|
29698 | rule: 'optional',
|
29699 | type: 'bool',
|
29700 | name: 'bin',
|
29701 | id: 10
|
29702 | }, {
|
29703 | rule: 'optional',
|
29704 | type: 'int32',
|
29705 | name: 'convType',
|
29706 | id: 11
|
29707 | }]
|
29708 | }, {
|
29709 | name: 'ConvMemberInfo',
|
29710 | syntax: 'proto2',
|
29711 | fields: [{
|
29712 | rule: 'optional',
|
29713 | type: 'string',
|
29714 | name: 'pid',
|
29715 | id: 1
|
29716 | }, {
|
29717 | rule: 'optional',
|
29718 | type: 'string',
|
29719 | name: 'role',
|
29720 | id: 2
|
29721 | }, {
|
29722 | rule: 'optional',
|
29723 | type: 'string',
|
29724 | name: 'infoId',
|
29725 | id: 3
|
29726 | }]
|
29727 | }, {
|
29728 | name: 'DataCommand',
|
29729 | syntax: 'proto2',
|
29730 | fields: [{
|
29731 | rule: 'repeated',
|
29732 | type: 'string',
|
29733 | name: 'ids',
|
29734 | id: 1
|
29735 | }, {
|
29736 | rule: 'repeated',
|
29737 | type: 'JsonObjectMessage',
|
29738 | name: 'msg',
|
29739 | id: 2
|
29740 | }, {
|
29741 | rule: 'optional',
|
29742 | type: 'bool',
|
29743 | name: 'offline',
|
29744 | id: 3
|
29745 | }]
|
29746 | }, {
|
29747 | name: 'SessionCommand',
|
29748 | syntax: 'proto2',
|
29749 | fields: [{
|
29750 | rule: 'optional',
|
29751 | type: 'int64',
|
29752 | name: 't',
|
29753 | id: 1
|
29754 | }, {
|
29755 | rule: 'optional',
|
29756 | type: 'string',
|
29757 | name: 'n',
|
29758 | id: 2
|
29759 | }, {
|
29760 | rule: 'optional',
|
29761 | type: 'string',
|
29762 | name: 's',
|
29763 | id: 3
|
29764 | }, {
|
29765 | rule: 'optional',
|
29766 | type: 'string',
|
29767 | name: 'ua',
|
29768 | id: 4
|
29769 | }, {
|
29770 | rule: 'optional',
|
29771 | type: 'bool',
|
29772 | name: 'r',
|
29773 | id: 5
|
29774 | }, {
|
29775 | rule: 'optional',
|
29776 | type: 'string',
|
29777 | name: 'tag',
|
29778 | id: 6
|
29779 | }, {
|
29780 | rule: 'optional',
|
29781 | type: 'string',
|
29782 | name: 'deviceId',
|
29783 | id: 7
|
29784 | }, {
|
29785 | rule: 'repeated',
|
29786 | type: 'string',
|
29787 | name: 'sessionPeerIds',
|
29788 | id: 8
|
29789 | }, {
|
29790 | rule: 'repeated',
|
29791 | type: 'string',
|
29792 | name: 'onlineSessionPeerIds',
|
29793 | id: 9
|
29794 | }, {
|
29795 | rule: 'optional',
|
29796 | type: 'string',
|
29797 | name: 'st',
|
29798 | id: 10
|
29799 | }, {
|
29800 | rule: 'optional',
|
29801 | type: 'int32',
|
29802 | name: 'stTtl',
|
29803 | id: 11
|
29804 | }, {
|
29805 | rule: 'optional',
|
29806 | type: 'int32',
|
29807 | name: 'code',
|
29808 | id: 12
|
29809 | }, {
|
29810 | rule: 'optional',
|
29811 | type: 'string',
|
29812 | name: 'reason',
|
29813 | id: 13
|
29814 | }, {
|
29815 | rule: 'optional',
|
29816 | type: 'string',
|
29817 | name: 'deviceToken',
|
29818 | id: 14
|
29819 | }, {
|
29820 | rule: 'optional',
|
29821 | type: 'bool',
|
29822 | name: 'sp',
|
29823 | id: 15
|
29824 | }, {
|
29825 | rule: 'optional',
|
29826 | type: 'string',
|
29827 | name: 'detail',
|
29828 | id: 16
|
29829 | }, {
|
29830 | rule: 'optional',
|
29831 | type: 'int64',
|
29832 | name: 'lastUnreadNotifTime',
|
29833 | id: 17
|
29834 | }, {
|
29835 | rule: 'optional',
|
29836 | type: 'int64',
|
29837 | name: 'lastPatchTime',
|
29838 | id: 18
|
29839 | }, {
|
29840 | rule: 'optional',
|
29841 | type: 'int64',
|
29842 | name: 'configBitmap',
|
29843 | id: 19
|
29844 | }]
|
29845 | }, {
|
29846 | name: 'ErrorCommand',
|
29847 | syntax: 'proto2',
|
29848 | fields: [{
|
29849 | rule: 'required',
|
29850 | type: 'int32',
|
29851 | name: 'code',
|
29852 | id: 1
|
29853 | }, {
|
29854 | rule: 'required',
|
29855 | type: 'string',
|
29856 | name: 'reason',
|
29857 | id: 2
|
29858 | }, {
|
29859 | rule: 'optional',
|
29860 | type: 'int32',
|
29861 | name: 'appCode',
|
29862 | id: 3
|
29863 | }, {
|
29864 | rule: 'optional',
|
29865 | type: 'string',
|
29866 | name: 'detail',
|
29867 | id: 4
|
29868 | }, {
|
29869 | rule: 'repeated',
|
29870 | type: 'string',
|
29871 | name: 'pids',
|
29872 | id: 5
|
29873 | }, {
|
29874 | rule: 'optional',
|
29875 | type: 'string',
|
29876 | name: 'appMsg',
|
29877 | id: 6
|
29878 | }]
|
29879 | }, {
|
29880 | name: 'DirectCommand',
|
29881 | syntax: 'proto2',
|
29882 | fields: [{
|
29883 | rule: 'optional',
|
29884 | type: 'string',
|
29885 | name: 'msg',
|
29886 | id: 1
|
29887 | }, {
|
29888 | rule: 'optional',
|
29889 | type: 'string',
|
29890 | name: 'uid',
|
29891 | id: 2
|
29892 | }, {
|
29893 | rule: 'optional',
|
29894 | type: 'string',
|
29895 | name: 'fromPeerId',
|
29896 | id: 3
|
29897 | }, {
|
29898 | rule: 'optional',
|
29899 | type: 'int64',
|
29900 | name: 'timestamp',
|
29901 | id: 4
|
29902 | }, {
|
29903 | rule: 'optional',
|
29904 | type: 'bool',
|
29905 | name: 'offline',
|
29906 | id: 5
|
29907 | }, {
|
29908 | rule: 'optional',
|
29909 | type: 'bool',
|
29910 | name: 'hasMore',
|
29911 | id: 6
|
29912 | }, {
|
29913 | rule: 'repeated',
|
29914 | type: 'string',
|
29915 | name: 'toPeerIds',
|
29916 | id: 7
|
29917 | }, {
|
29918 | rule: 'optional',
|
29919 | type: 'bool',
|
29920 | name: 'r',
|
29921 | id: 10
|
29922 | }, {
|
29923 | rule: 'optional',
|
29924 | type: 'string',
|
29925 | name: 'cid',
|
29926 | id: 11
|
29927 | }, {
|
29928 | rule: 'optional',
|
29929 | type: 'string',
|
29930 | name: 'id',
|
29931 | id: 12
|
29932 | }, {
|
29933 | rule: 'optional',
|
29934 | type: 'bool',
|
29935 | name: 'transient',
|
29936 | id: 13
|
29937 | }, {
|
29938 | rule: 'optional',
|
29939 | type: 'string',
|
29940 | name: 'dt',
|
29941 | id: 14
|
29942 | }, {
|
29943 | rule: 'optional',
|
29944 | type: 'string',
|
29945 | name: 'roomId',
|
29946 | id: 15
|
29947 | }, {
|
29948 | rule: 'optional',
|
29949 | type: 'string',
|
29950 | name: 'pushData',
|
29951 | id: 16
|
29952 | }, {
|
29953 | rule: 'optional',
|
29954 | type: 'bool',
|
29955 | name: 'will',
|
29956 | id: 17
|
29957 | }, {
|
29958 | rule: 'optional',
|
29959 | type: 'int64',
|
29960 | name: 'patchTimestamp',
|
29961 | id: 18
|
29962 | }, {
|
29963 | rule: 'optional',
|
29964 | type: 'bytes',
|
29965 | name: 'binaryMsg',
|
29966 | id: 19
|
29967 | }, {
|
29968 | rule: 'repeated',
|
29969 | type: 'string',
|
29970 | name: 'mentionPids',
|
29971 | id: 20
|
29972 | }, {
|
29973 | rule: 'optional',
|
29974 | type: 'bool',
|
29975 | name: 'mentionAll',
|
29976 | id: 21
|
29977 | }, {
|
29978 | rule: 'optional',
|
29979 | type: 'int32',
|
29980 | name: 'convType',
|
29981 | id: 22
|
29982 | }]
|
29983 | }, {
|
29984 | name: 'AckCommand',
|
29985 | syntax: 'proto2',
|
29986 | fields: [{
|
29987 | rule: 'optional',
|
29988 | type: 'int32',
|
29989 | name: 'code',
|
29990 | id: 1
|
29991 | }, {
|
29992 | rule: 'optional',
|
29993 | type: 'string',
|
29994 | name: 'reason',
|
29995 | id: 2
|
29996 | }, {
|
29997 | rule: 'optional',
|
29998 | type: 'string',
|
29999 | name: 'mid',
|
30000 | id: 3
|
30001 | }, {
|
30002 | rule: 'optional',
|
30003 | type: 'string',
|
30004 | name: 'cid',
|
30005 | id: 4
|
30006 | }, {
|
30007 | rule: 'optional',
|
30008 | type: 'int64',
|
30009 | name: 't',
|
30010 | id: 5
|
30011 | }, {
|
30012 | rule: 'optional',
|
30013 | type: 'string',
|
30014 | name: 'uid',
|
30015 | id: 6
|
30016 | }, {
|
30017 | rule: 'optional',
|
30018 | type: 'int64',
|
30019 | name: 'fromts',
|
30020 | id: 7
|
30021 | }, {
|
30022 | rule: 'optional',
|
30023 | type: 'int64',
|
30024 | name: 'tots',
|
30025 | id: 8
|
30026 | }, {
|
30027 | rule: 'optional',
|
30028 | type: 'string',
|
30029 | name: 'type',
|
30030 | id: 9
|
30031 | }, {
|
30032 | rule: 'repeated',
|
30033 | type: 'string',
|
30034 | name: 'ids',
|
30035 | id: 10
|
30036 | }, {
|
30037 | rule: 'optional',
|
30038 | type: 'int32',
|
30039 | name: 'appCode',
|
30040 | id: 11
|
30041 | }, {
|
30042 | rule: 'optional',
|
30043 | type: 'string',
|
30044 | name: 'appMsg',
|
30045 | id: 12
|
30046 | }]
|
30047 | }, {
|
30048 | name: 'UnreadCommand',
|
30049 | syntax: 'proto2',
|
30050 | fields: [{
|
30051 | rule: 'repeated',
|
30052 | type: 'UnreadTuple',
|
30053 | name: 'convs',
|
30054 | id: 1
|
30055 | }, {
|
30056 | rule: 'optional',
|
30057 | type: 'int64',
|
30058 | name: 'notifTime',
|
30059 | id: 2
|
30060 | }]
|
30061 | }, {
|
30062 | name: 'ConvCommand',
|
30063 | syntax: 'proto2',
|
30064 | fields: [{
|
30065 | rule: 'repeated',
|
30066 | type: 'string',
|
30067 | name: 'm',
|
30068 | id: 1
|
30069 | }, {
|
30070 | rule: 'optional',
|
30071 | type: 'bool',
|
30072 | name: 'transient',
|
30073 | id: 2
|
30074 | }, {
|
30075 | rule: 'optional',
|
30076 | type: 'bool',
|
30077 | name: 'unique',
|
30078 | id: 3
|
30079 | }, {
|
30080 | rule: 'optional',
|
30081 | type: 'string',
|
30082 | name: 'cid',
|
30083 | id: 4
|
30084 | }, {
|
30085 | rule: 'optional',
|
30086 | type: 'string',
|
30087 | name: 'cdate',
|
30088 | id: 5
|
30089 | }, {
|
30090 | rule: 'optional',
|
30091 | type: 'string',
|
30092 | name: 'initBy',
|
30093 | id: 6
|
30094 | }, {
|
30095 | rule: 'optional',
|
30096 | type: 'string',
|
30097 | name: 'sort',
|
30098 | id: 7
|
30099 | }, {
|
30100 | rule: 'optional',
|
30101 | type: 'int32',
|
30102 | name: 'limit',
|
30103 | id: 8
|
30104 | }, {
|
30105 | rule: 'optional',
|
30106 | type: 'int32',
|
30107 | name: 'skip',
|
30108 | id: 9
|
30109 | }, {
|
30110 | rule: 'optional',
|
30111 | type: 'int32',
|
30112 | name: 'flag',
|
30113 | id: 10
|
30114 | }, {
|
30115 | rule: 'optional',
|
30116 | type: 'int32',
|
30117 | name: 'count',
|
30118 | id: 11
|
30119 | }, {
|
30120 | rule: 'optional',
|
30121 | type: 'string',
|
30122 | name: 'udate',
|
30123 | id: 12
|
30124 | }, {
|
30125 | rule: 'optional',
|
30126 | type: 'int64',
|
30127 | name: 't',
|
30128 | id: 13
|
30129 | }, {
|
30130 | rule: 'optional',
|
30131 | type: 'string',
|
30132 | name: 'n',
|
30133 | id: 14
|
30134 | }, {
|
30135 | rule: 'optional',
|
30136 | type: 'string',
|
30137 | name: 's',
|
30138 | id: 15
|
30139 | }, {
|
30140 | rule: 'optional',
|
30141 | type: 'bool',
|
30142 | name: 'statusSub',
|
30143 | id: 16
|
30144 | }, {
|
30145 | rule: 'optional',
|
30146 | type: 'bool',
|
30147 | name: 'statusPub',
|
30148 | id: 17
|
30149 | }, {
|
30150 | rule: 'optional',
|
30151 | type: 'int32',
|
30152 | name: 'statusTTL',
|
30153 | id: 18
|
30154 | }, {
|
30155 | rule: 'optional',
|
30156 | type: 'string',
|
30157 | name: 'uniqueId',
|
30158 | id: 19
|
30159 | }, {
|
30160 | rule: 'optional',
|
30161 | type: 'string',
|
30162 | name: 'targetClientId',
|
30163 | id: 20
|
30164 | }, {
|
30165 | rule: 'optional',
|
30166 | type: 'int64',
|
30167 | name: 'maxReadTimestamp',
|
30168 | id: 21
|
30169 | }, {
|
30170 | rule: 'optional',
|
30171 | type: 'int64',
|
30172 | name: 'maxAckTimestamp',
|
30173 | id: 22
|
30174 | }, {
|
30175 | rule: 'optional',
|
30176 | type: 'bool',
|
30177 | name: 'queryAllMembers',
|
30178 | id: 23
|
30179 | }, {
|
30180 | rule: 'repeated',
|
30181 | type: 'MaxReadTuple',
|
30182 | name: 'maxReadTuples',
|
30183 | id: 24
|
30184 | }, {
|
30185 | rule: 'repeated',
|
30186 | type: 'string',
|
30187 | name: 'cids',
|
30188 | id: 25
|
30189 | }, {
|
30190 | rule: 'optional',
|
30191 | type: 'ConvMemberInfo',
|
30192 | name: 'info',
|
30193 | id: 26
|
30194 | }, {
|
30195 | rule: 'optional',
|
30196 | type: 'bool',
|
30197 | name: 'tempConv',
|
30198 | id: 27
|
30199 | }, {
|
30200 | rule: 'optional',
|
30201 | type: 'int32',
|
30202 | name: 'tempConvTTL',
|
30203 | id: 28
|
30204 | }, {
|
30205 | rule: 'repeated',
|
30206 | type: 'string',
|
30207 | name: 'tempConvIds',
|
30208 | id: 29
|
30209 | }, {
|
30210 | rule: 'repeated',
|
30211 | type: 'string',
|
30212 | name: 'allowedPids',
|
30213 | id: 30
|
30214 | }, {
|
30215 | rule: 'repeated',
|
30216 | type: 'ErrorCommand',
|
30217 | name: 'failedPids',
|
30218 | id: 31
|
30219 | }, {
|
30220 | rule: 'optional',
|
30221 | type: 'string',
|
30222 | name: 'next',
|
30223 | id: 40
|
30224 | }, {
|
30225 | rule: 'optional',
|
30226 | type: 'JsonObjectMessage',
|
30227 | name: 'results',
|
30228 | id: 100
|
30229 | }, {
|
30230 | rule: 'optional',
|
30231 | type: 'JsonObjectMessage',
|
30232 | name: 'where',
|
30233 | id: 101
|
30234 | }, {
|
30235 | rule: 'optional',
|
30236 | type: 'JsonObjectMessage',
|
30237 | name: 'attr',
|
30238 | id: 103
|
30239 | }, {
|
30240 | rule: 'optional',
|
30241 | type: 'JsonObjectMessage',
|
30242 | name: 'attrModified',
|
30243 | id: 104
|
30244 | }]
|
30245 | }, {
|
30246 | name: 'RoomCommand',
|
30247 | syntax: 'proto2',
|
30248 | fields: [{
|
30249 | rule: 'optional',
|
30250 | type: 'string',
|
30251 | name: 'roomId',
|
30252 | id: 1
|
30253 | }, {
|
30254 | rule: 'optional',
|
30255 | type: 'string',
|
30256 | name: 's',
|
30257 | id: 2
|
30258 | }, {
|
30259 | rule: 'optional',
|
30260 | type: 'int64',
|
30261 | name: 't',
|
30262 | id: 3
|
30263 | }, {
|
30264 | rule: 'optional',
|
30265 | type: 'string',
|
30266 | name: 'n',
|
30267 | id: 4
|
30268 | }, {
|
30269 | rule: 'optional',
|
30270 | type: 'bool',
|
30271 | name: 'transient',
|
30272 | id: 5
|
30273 | }, {
|
30274 | rule: 'repeated',
|
30275 | type: 'string',
|
30276 | name: 'roomPeerIds',
|
30277 | id: 6
|
30278 | }, {
|
30279 | rule: 'optional',
|
30280 | type: 'string',
|
30281 | name: 'byPeerId',
|
30282 | id: 7
|
30283 | }]
|
30284 | }, {
|
30285 | name: 'LogsCommand',
|
30286 | syntax: 'proto2',
|
30287 | fields: [{
|
30288 | rule: 'optional',
|
30289 | type: 'string',
|
30290 | name: 'cid',
|
30291 | id: 1
|
30292 | }, {
|
30293 | rule: 'optional',
|
30294 | type: 'int32',
|
30295 | name: 'l',
|
30296 | id: 2
|
30297 | }, {
|
30298 | rule: 'optional',
|
30299 | type: 'int32',
|
30300 | name: 'limit',
|
30301 | id: 3
|
30302 | }, {
|
30303 | rule: 'optional',
|
30304 | type: 'int64',
|
30305 | name: 't',
|
30306 | id: 4
|
30307 | }, {
|
30308 | rule: 'optional',
|
30309 | type: 'int64',
|
30310 | name: 'tt',
|
30311 | id: 5
|
30312 | }, {
|
30313 | rule: 'optional',
|
30314 | type: 'string',
|
30315 | name: 'tmid',
|
30316 | id: 6
|
30317 | }, {
|
30318 | rule: 'optional',
|
30319 | type: 'string',
|
30320 | name: 'mid',
|
30321 | id: 7
|
30322 | }, {
|
30323 | rule: 'optional',
|
30324 | type: 'string',
|
30325 | name: 'checksum',
|
30326 | id: 8
|
30327 | }, {
|
30328 | rule: 'optional',
|
30329 | type: 'bool',
|
30330 | name: 'stored',
|
30331 | id: 9
|
30332 | }, {
|
30333 | rule: 'optional',
|
30334 | type: 'QueryDirection',
|
30335 | name: 'direction',
|
30336 | id: 10,
|
30337 | options: {
|
30338 | "default": 'OLD'
|
30339 | }
|
30340 | }, {
|
30341 | rule: 'optional',
|
30342 | type: 'bool',
|
30343 | name: 'tIncluded',
|
30344 | id: 11
|
30345 | }, {
|
30346 | rule: 'optional',
|
30347 | type: 'bool',
|
30348 | name: 'ttIncluded',
|
30349 | id: 12
|
30350 | }, {
|
30351 | rule: 'optional',
|
30352 | type: 'int32',
|
30353 | name: 'lctype',
|
30354 | id: 13
|
30355 | }, {
|
30356 | rule: 'repeated',
|
30357 | type: 'LogItem',
|
30358 | name: 'logs',
|
30359 | id: 105
|
30360 | }],
|
30361 | enums: [{
|
30362 | name: 'QueryDirection',
|
30363 | syntax: 'proto2',
|
30364 | values: [{
|
30365 | name: 'OLD',
|
30366 | id: 1
|
30367 | }, {
|
30368 | name: 'NEW',
|
30369 | id: 2
|
30370 | }]
|
30371 | }]
|
30372 | }, {
|
30373 | name: 'RcpCommand',
|
30374 | syntax: 'proto2',
|
30375 | fields: [{
|
30376 | rule: 'optional',
|
30377 | type: 'string',
|
30378 | name: 'id',
|
30379 | id: 1
|
30380 | }, {
|
30381 | rule: 'optional',
|
30382 | type: 'string',
|
30383 | name: 'cid',
|
30384 | id: 2
|
30385 | }, {
|
30386 | rule: 'optional',
|
30387 | type: 'int64',
|
30388 | name: 't',
|
30389 | id: 3
|
30390 | }, {
|
30391 | rule: 'optional',
|
30392 | type: 'bool',
|
30393 | name: 'read',
|
30394 | id: 4
|
30395 | }, {
|
30396 | rule: 'optional',
|
30397 | type: 'string',
|
30398 | name: 'from',
|
30399 | id: 5
|
30400 | }]
|
30401 | }, {
|
30402 | name: 'ReadTuple',
|
30403 | syntax: 'proto2',
|
30404 | fields: [{
|
30405 | rule: 'required',
|
30406 | type: 'string',
|
30407 | name: 'cid',
|
30408 | id: 1
|
30409 | }, {
|
30410 | rule: 'optional',
|
30411 | type: 'int64',
|
30412 | name: 'timestamp',
|
30413 | id: 2
|
30414 | }, {
|
30415 | rule: 'optional',
|
30416 | type: 'string',
|
30417 | name: 'mid',
|
30418 | id: 3
|
30419 | }]
|
30420 | }, {
|
30421 | name: 'MaxReadTuple',
|
30422 | syntax: 'proto2',
|
30423 | fields: [{
|
30424 | rule: 'optional',
|
30425 | type: 'string',
|
30426 | name: 'pid',
|
30427 | id: 1
|
30428 | }, {
|
30429 | rule: 'optional',
|
30430 | type: 'int64',
|
30431 | name: 'maxAckTimestamp',
|
30432 | id: 2
|
30433 | }, {
|
30434 | rule: 'optional',
|
30435 | type: 'int64',
|
30436 | name: 'maxReadTimestamp',
|
30437 | id: 3
|
30438 | }]
|
30439 | }, {
|
30440 | name: 'ReadCommand',
|
30441 | syntax: 'proto2',
|
30442 | fields: [{
|
30443 | rule: 'optional',
|
30444 | type: 'string',
|
30445 | name: 'cid',
|
30446 | id: 1
|
30447 | }, {
|
30448 | rule: 'repeated',
|
30449 | type: 'string',
|
30450 | name: 'cids',
|
30451 | id: 2
|
30452 | }, {
|
30453 | rule: 'repeated',
|
30454 | type: 'ReadTuple',
|
30455 | name: 'convs',
|
30456 | id: 3
|
30457 | }]
|
30458 | }, {
|
30459 | name: 'PresenceCommand',
|
30460 | syntax: 'proto2',
|
30461 | fields: [{
|
30462 | rule: 'optional',
|
30463 | type: 'StatusType',
|
30464 | name: 'status',
|
30465 | id: 1
|
30466 | }, {
|
30467 | rule: 'repeated',
|
30468 | type: 'string',
|
30469 | name: 'sessionPeerIds',
|
30470 | id: 2
|
30471 | }, {
|
30472 | rule: 'optional',
|
30473 | type: 'string',
|
30474 | name: 'cid',
|
30475 | id: 3
|
30476 | }]
|
30477 | }, {
|
30478 | name: 'ReportCommand',
|
30479 | syntax: 'proto2',
|
30480 | fields: [{
|
30481 | rule: 'optional',
|
30482 | type: 'bool',
|
30483 | name: 'initiative',
|
30484 | id: 1
|
30485 | }, {
|
30486 | rule: 'optional',
|
30487 | type: 'string',
|
30488 | name: 'type',
|
30489 | id: 2
|
30490 | }, {
|
30491 | rule: 'optional',
|
30492 | type: 'string',
|
30493 | name: 'data',
|
30494 | id: 3
|
30495 | }]
|
30496 | }, {
|
30497 | name: 'PatchItem',
|
30498 | syntax: 'proto2',
|
30499 | fields: [{
|
30500 | rule: 'optional',
|
30501 | type: 'string',
|
30502 | name: 'cid',
|
30503 | id: 1
|
30504 | }, {
|
30505 | rule: 'optional',
|
30506 | type: 'string',
|
30507 | name: 'mid',
|
30508 | id: 2
|
30509 | }, {
|
30510 | rule: 'optional',
|
30511 | type: 'int64',
|
30512 | name: 'timestamp',
|
30513 | id: 3
|
30514 | }, {
|
30515 | rule: 'optional',
|
30516 | type: 'bool',
|
30517 | name: 'recall',
|
30518 | id: 4
|
30519 | }, {
|
30520 | rule: 'optional',
|
30521 | type: 'string',
|
30522 | name: 'data',
|
30523 | id: 5
|
30524 | }, {
|
30525 | rule: 'optional',
|
30526 | type: 'int64',
|
30527 | name: 'patchTimestamp',
|
30528 | id: 6
|
30529 | }, {
|
30530 | rule: 'optional',
|
30531 | type: 'string',
|
30532 | name: 'from',
|
30533 | id: 7
|
30534 | }, {
|
30535 | rule: 'optional',
|
30536 | type: 'bytes',
|
30537 | name: 'binaryMsg',
|
30538 | id: 8
|
30539 | }, {
|
30540 | rule: 'optional',
|
30541 | type: 'bool',
|
30542 | name: 'mentionAll',
|
30543 | id: 9
|
30544 | }, {
|
30545 | rule: 'repeated',
|
30546 | type: 'string',
|
30547 | name: 'mentionPids',
|
30548 | id: 10
|
30549 | }, {
|
30550 | rule: 'optional',
|
30551 | type: 'int64',
|
30552 | name: 'patchCode',
|
30553 | id: 11
|
30554 | }, {
|
30555 | rule: 'optional',
|
30556 | type: 'string',
|
30557 | name: 'patchReason',
|
30558 | id: 12
|
30559 | }]
|
30560 | }, {
|
30561 | name: 'PatchCommand',
|
30562 | syntax: 'proto2',
|
30563 | fields: [{
|
30564 | rule: 'repeated',
|
30565 | type: 'PatchItem',
|
30566 | name: 'patches',
|
30567 | id: 1
|
30568 | }, {
|
30569 | rule: 'optional',
|
30570 | type: 'int64',
|
30571 | name: 'lastPatchTime',
|
30572 | id: 2
|
30573 | }]
|
30574 | }, {
|
30575 | name: 'PubsubCommand',
|
30576 | syntax: 'proto2',
|
30577 | fields: [{
|
30578 | rule: 'optional',
|
30579 | type: 'string',
|
30580 | name: 'cid',
|
30581 | id: 1
|
30582 | }, {
|
30583 | rule: 'repeated',
|
30584 | type: 'string',
|
30585 | name: 'cids',
|
30586 | id: 2
|
30587 | }, {
|
30588 | rule: 'optional',
|
30589 | type: 'string',
|
30590 | name: 'topic',
|
30591 | id: 3
|
30592 | }, {
|
30593 | rule: 'optional',
|
30594 | type: 'string',
|
30595 | name: 'subtopic',
|
30596 | id: 4
|
30597 | }, {
|
30598 | rule: 'repeated',
|
30599 | type: 'string',
|
30600 | name: 'topics',
|
30601 | id: 5
|
30602 | }, {
|
30603 | rule: 'repeated',
|
30604 | type: 'string',
|
30605 | name: 'subtopics',
|
30606 | id: 6
|
30607 | }, {
|
30608 | rule: 'optional',
|
30609 | type: 'JsonObjectMessage',
|
30610 | name: 'results',
|
30611 | id: 7
|
30612 | }]
|
30613 | }, {
|
30614 | name: 'BlacklistCommand',
|
30615 | syntax: 'proto2',
|
30616 | fields: [{
|
30617 | rule: 'optional',
|
30618 | type: 'string',
|
30619 | name: 'srcCid',
|
30620 | id: 1
|
30621 | }, {
|
30622 | rule: 'repeated',
|
30623 | type: 'string',
|
30624 | name: 'toPids',
|
30625 | id: 2
|
30626 | }, {
|
30627 | rule: 'optional',
|
30628 | type: 'string',
|
30629 | name: 'srcPid',
|
30630 | id: 3
|
30631 | }, {
|
30632 | rule: 'repeated',
|
30633 | type: 'string',
|
30634 | name: 'toCids',
|
30635 | id: 4
|
30636 | }, {
|
30637 | rule: 'optional',
|
30638 | type: 'int32',
|
30639 | name: 'limit',
|
30640 | id: 5
|
30641 | }, {
|
30642 | rule: 'optional',
|
30643 | type: 'string',
|
30644 | name: 'next',
|
30645 | id: 6
|
30646 | }, {
|
30647 | rule: 'repeated',
|
30648 | type: 'string',
|
30649 | name: 'blockedPids',
|
30650 | id: 8
|
30651 | }, {
|
30652 | rule: 'repeated',
|
30653 | type: 'string',
|
30654 | name: 'blockedCids',
|
30655 | id: 9
|
30656 | }, {
|
30657 | rule: 'repeated',
|
30658 | type: 'string',
|
30659 | name: 'allowedPids',
|
30660 | id: 10
|
30661 | }, {
|
30662 | rule: 'repeated',
|
30663 | type: 'ErrorCommand',
|
30664 | name: 'failedPids',
|
30665 | id: 11
|
30666 | }, {
|
30667 | rule: 'optional',
|
30668 | type: 'int64',
|
30669 | name: 't',
|
30670 | id: 12
|
30671 | }, {
|
30672 | rule: 'optional',
|
30673 | type: 'string',
|
30674 | name: 'n',
|
30675 | id: 13
|
30676 | }, {
|
30677 | rule: 'optional',
|
30678 | type: 'string',
|
30679 | name: 's',
|
30680 | id: 14
|
30681 | }]
|
30682 | }, {
|
30683 | name: 'GenericCommand',
|
30684 | syntax: 'proto2',
|
30685 | fields: [{
|
30686 | rule: 'optional',
|
30687 | type: 'CommandType',
|
30688 | name: 'cmd',
|
30689 | id: 1
|
30690 | }, {
|
30691 | rule: 'optional',
|
30692 | type: 'OpType',
|
30693 | name: 'op',
|
30694 | id: 2
|
30695 | }, {
|
30696 | rule: 'optional',
|
30697 | type: 'string',
|
30698 | name: 'appId',
|
30699 | id: 3
|
30700 | }, {
|
30701 | rule: 'optional',
|
30702 | type: 'string',
|
30703 | name: 'peerId',
|
30704 | id: 4
|
30705 | }, {
|
30706 | rule: 'optional',
|
30707 | type: 'int32',
|
30708 | name: 'i',
|
30709 | id: 5
|
30710 | }, {
|
30711 | rule: 'optional',
|
30712 | type: 'string',
|
30713 | name: 'installationId',
|
30714 | id: 6
|
30715 | }, {
|
30716 | rule: 'optional',
|
30717 | type: 'int32',
|
30718 | name: 'priority',
|
30719 | id: 7
|
30720 | }, {
|
30721 | rule: 'optional',
|
30722 | type: 'int32',
|
30723 | name: 'service',
|
30724 | id: 8
|
30725 | }, {
|
30726 | rule: 'optional',
|
30727 | type: 'int64',
|
30728 | name: 'serverTs',
|
30729 | id: 9
|
30730 | }, {
|
30731 | rule: 'optional',
|
30732 | type: 'int64',
|
30733 | name: 'clientTs',
|
30734 | id: 10
|
30735 | }, {
|
30736 | rule: 'optional',
|
30737 | type: 'int32',
|
30738 | name: 'notificationType',
|
30739 | id: 11
|
30740 | }, {
|
30741 | rule: 'optional',
|
30742 | type: 'DataCommand',
|
30743 | name: 'dataMessage',
|
30744 | id: 101
|
30745 | }, {
|
30746 | rule: 'optional',
|
30747 | type: 'SessionCommand',
|
30748 | name: 'sessionMessage',
|
30749 | id: 102
|
30750 | }, {
|
30751 | rule: 'optional',
|
30752 | type: 'ErrorCommand',
|
30753 | name: 'errorMessage',
|
30754 | id: 103
|
30755 | }, {
|
30756 | rule: 'optional',
|
30757 | type: 'DirectCommand',
|
30758 | name: 'directMessage',
|
30759 | id: 104
|
30760 | }, {
|
30761 | rule: 'optional',
|
30762 | type: 'AckCommand',
|
30763 | name: 'ackMessage',
|
30764 | id: 105
|
30765 | }, {
|
30766 | rule: 'optional',
|
30767 | type: 'UnreadCommand',
|
30768 | name: 'unreadMessage',
|
30769 | id: 106
|
30770 | }, {
|
30771 | rule: 'optional',
|
30772 | type: 'ReadCommand',
|
30773 | name: 'readMessage',
|
30774 | id: 107
|
30775 | }, {
|
30776 | rule: 'optional',
|
30777 | type: 'RcpCommand',
|
30778 | name: 'rcpMessage',
|
30779 | id: 108
|
30780 | }, {
|
30781 | rule: 'optional',
|
30782 | type: 'LogsCommand',
|
30783 | name: 'logsMessage',
|
30784 | id: 109
|
30785 | }, {
|
30786 | rule: 'optional',
|
30787 | type: 'ConvCommand',
|
30788 | name: 'convMessage',
|
30789 | id: 110
|
30790 | }, {
|
30791 | rule: 'optional',
|
30792 | type: 'RoomCommand',
|
30793 | name: 'roomMessage',
|
30794 | id: 111
|
30795 | }, {
|
30796 | rule: 'optional',
|
30797 | type: 'PresenceCommand',
|
30798 | name: 'presenceMessage',
|
30799 | id: 112
|
30800 | }, {
|
30801 | rule: 'optional',
|
30802 | type: 'ReportCommand',
|
30803 | name: 'reportMessage',
|
30804 | id: 113
|
30805 | }, {
|
30806 | rule: 'optional',
|
30807 | type: 'PatchCommand',
|
30808 | name: 'patchMessage',
|
30809 | id: 114
|
30810 | }, {
|
30811 | rule: 'optional',
|
30812 | type: 'PubsubCommand',
|
30813 | name: 'pubsubMessage',
|
30814 | id: 115
|
30815 | }, {
|
30816 | rule: 'optional',
|
30817 | type: 'BlacklistCommand',
|
30818 | name: 'blacklistMessage',
|
30819 | id: 116
|
30820 | }]
|
30821 | }],
|
30822 | enums: [{
|
30823 | name: 'CommandType',
|
30824 | syntax: 'proto2',
|
30825 | values: [{
|
30826 | name: 'session',
|
30827 | id: 0
|
30828 | }, {
|
30829 | name: 'conv',
|
30830 | id: 1
|
30831 | }, {
|
30832 | name: 'direct',
|
30833 | id: 2
|
30834 | }, {
|
30835 | name: 'ack',
|
30836 | id: 3
|
30837 | }, {
|
30838 | name: 'rcp',
|
30839 | id: 4
|
30840 | }, {
|
30841 | name: 'unread',
|
30842 | id: 5
|
30843 | }, {
|
30844 | name: 'logs',
|
30845 | id: 6
|
30846 | }, {
|
30847 | name: 'error',
|
30848 | id: 7
|
30849 | }, {
|
30850 | name: 'login',
|
30851 | id: 8
|
30852 | }, {
|
30853 | name: 'data',
|
30854 | id: 9
|
30855 | }, {
|
30856 | name: 'room',
|
30857 | id: 10
|
30858 | }, {
|
30859 | name: 'read',
|
30860 | id: 11
|
30861 | }, {
|
30862 | name: 'presence',
|
30863 | id: 12
|
30864 | }, {
|
30865 | name: 'report',
|
30866 | id: 13
|
30867 | }, {
|
30868 | name: 'echo',
|
30869 | id: 14
|
30870 | }, {
|
30871 | name: 'loggedin',
|
30872 | id: 15
|
30873 | }, {
|
30874 | name: 'logout',
|
30875 | id: 16
|
30876 | }, {
|
30877 | name: 'loggedout',
|
30878 | id: 17
|
30879 | }, {
|
30880 | name: 'patch',
|
30881 | id: 18
|
30882 | }, {
|
30883 | name: 'pubsub',
|
30884 | id: 19
|
30885 | }, {
|
30886 | name: 'blacklist',
|
30887 | id: 20
|
30888 | }, {
|
30889 | name: 'goaway',
|
30890 | id: 21
|
30891 | }]
|
30892 | }, {
|
30893 | name: 'OpType',
|
30894 | syntax: 'proto2',
|
30895 | values: [{
|
30896 | name: 'open',
|
30897 | id: 1
|
30898 | }, {
|
30899 | name: 'add',
|
30900 | id: 2
|
30901 | }, {
|
30902 | name: 'remove',
|
30903 | id: 3
|
30904 | }, {
|
30905 | name: 'close',
|
30906 | id: 4
|
30907 | }, {
|
30908 | name: 'opened',
|
30909 | id: 5
|
30910 | }, {
|
30911 | name: 'closed',
|
30912 | id: 6
|
30913 | }, {
|
30914 | name: 'query',
|
30915 | id: 7
|
30916 | }, {
|
30917 | name: 'query_result',
|
30918 | id: 8
|
30919 | }, {
|
30920 | name: 'conflict',
|
30921 | id: 9
|
30922 | }, {
|
30923 | name: 'added',
|
30924 | id: 10
|
30925 | }, {
|
30926 | name: 'removed',
|
30927 | id: 11
|
30928 | }, {
|
30929 | name: 'refresh',
|
30930 | id: 12
|
30931 | }, {
|
30932 | name: 'refreshed',
|
30933 | id: 13
|
30934 | }, {
|
30935 | name: 'start',
|
30936 | id: 30
|
30937 | }, {
|
30938 | name: 'started',
|
30939 | id: 31
|
30940 | }, {
|
30941 | name: 'joined',
|
30942 | id: 32
|
30943 | }, {
|
30944 | name: 'members_joined',
|
30945 | id: 33
|
30946 | }, {
|
30947 | name: 'left',
|
30948 | id: 39
|
30949 | }, {
|
30950 | name: 'members_left',
|
30951 | id: 40
|
30952 | }, {
|
30953 | name: 'results',
|
30954 | id: 42
|
30955 | }, {
|
30956 | name: 'count',
|
30957 | id: 43
|
30958 | }, {
|
30959 | name: 'result',
|
30960 | id: 44
|
30961 | }, {
|
30962 | name: 'update',
|
30963 | id: 45
|
30964 | }, {
|
30965 | name: 'updated',
|
30966 | id: 46
|
30967 | }, {
|
30968 | name: 'mute',
|
30969 | id: 47
|
30970 | }, {
|
30971 | name: 'unmute',
|
30972 | id: 48
|
30973 | }, {
|
30974 | name: 'status',
|
30975 | id: 49
|
30976 | }, {
|
30977 | name: 'members',
|
30978 | id: 50
|
30979 | }, {
|
30980 | name: 'max_read',
|
30981 | id: 51
|
30982 | }, {
|
30983 | name: 'is_member',
|
30984 | id: 52
|
30985 | }, {
|
30986 | name: 'member_info_update',
|
30987 | id: 53
|
30988 | }, {
|
30989 | name: 'member_info_updated',
|
30990 | id: 54
|
30991 | }, {
|
30992 | name: 'member_info_changed',
|
30993 | id: 55
|
30994 | }, {
|
30995 | name: 'join',
|
30996 | id: 80
|
30997 | }, {
|
30998 | name: 'invite',
|
30999 | id: 81
|
31000 | }, {
|
31001 | name: 'leave',
|
31002 | id: 82
|
31003 | }, {
|
31004 | name: 'kick',
|
31005 | id: 83
|
31006 | }, {
|
31007 | name: 'reject',
|
31008 | id: 84
|
31009 | }, {
|
31010 | name: 'invited',
|
31011 | id: 85
|
31012 | }, {
|
31013 | name: 'kicked',
|
31014 | id: 86
|
31015 | }, {
|
31016 | name: 'upload',
|
31017 | id: 100
|
31018 | }, {
|
31019 | name: 'uploaded',
|
31020 | id: 101
|
31021 | }, {
|
31022 | name: 'subscribe',
|
31023 | id: 120
|
31024 | }, {
|
31025 | name: 'subscribed',
|
31026 | id: 121
|
31027 | }, {
|
31028 | name: 'unsubscribe',
|
31029 | id: 122
|
31030 | }, {
|
31031 | name: 'unsubscribed',
|
31032 | id: 123
|
31033 | }, {
|
31034 | name: 'is_subscribed',
|
31035 | id: 124
|
31036 | }, {
|
31037 | name: 'modify',
|
31038 | id: 150
|
31039 | }, {
|
31040 | name: 'modified',
|
31041 | id: 151
|
31042 | }, {
|
31043 | name: 'block',
|
31044 | id: 170
|
31045 | }, {
|
31046 | name: 'unblock',
|
31047 | id: 171
|
31048 | }, {
|
31049 | name: 'blocked',
|
31050 | id: 172
|
31051 | }, {
|
31052 | name: 'unblocked',
|
31053 | id: 173
|
31054 | }, {
|
31055 | name: 'members_blocked',
|
31056 | id: 174
|
31057 | }, {
|
31058 | name: 'members_unblocked',
|
31059 | id: 175
|
31060 | }, {
|
31061 | name: 'check_block',
|
31062 | id: 176
|
31063 | }, {
|
31064 | name: 'check_result',
|
31065 | id: 177
|
31066 | }, {
|
31067 | name: 'add_shutup',
|
31068 | id: 180
|
31069 | }, {
|
31070 | name: 'remove_shutup',
|
31071 | id: 181
|
31072 | }, {
|
31073 | name: 'query_shutup',
|
31074 | id: 182
|
31075 | }, {
|
31076 | name: 'shutup_added',
|
31077 | id: 183
|
31078 | }, {
|
31079 | name: 'shutup_removed',
|
31080 | id: 184
|
31081 | }, {
|
31082 | name: 'shutup_result',
|
31083 | id: 185
|
31084 | }, {
|
31085 | name: 'shutuped',
|
31086 | id: 186
|
31087 | }, {
|
31088 | name: 'unshutuped',
|
31089 | id: 187
|
31090 | }, {
|
31091 | name: 'members_shutuped',
|
31092 | id: 188
|
31093 | }, {
|
31094 | name: 'members_unshutuped',
|
31095 | id: 189
|
31096 | }, {
|
31097 | name: 'check_shutup',
|
31098 | id: 190
|
31099 | }]
|
31100 | }, {
|
31101 | name: 'StatusType',
|
31102 | syntax: 'proto2',
|
31103 | values: [{
|
31104 | name: 'on',
|
31105 | id: 1
|
31106 | }, {
|
31107 | name: 'off',
|
31108 | id: 2
|
31109 | }]
|
31110 | }],
|
31111 | isNamespace: true
|
31112 | }).build();
|
31113 | var _messages$push_server = messageCompiled.push_server.messages2,
|
31114 | JsonObjectMessage = _messages$push_server.JsonObjectMessage,
|
31115 | UnreadTuple = _messages$push_server.UnreadTuple,
|
31116 | LogItem = _messages$push_server.LogItem,
|
31117 | DataCommand = _messages$push_server.DataCommand,
|
31118 | SessionCommand = _messages$push_server.SessionCommand,
|
31119 | ErrorCommand = _messages$push_server.ErrorCommand,
|
31120 | DirectCommand = _messages$push_server.DirectCommand,
|
31121 | AckCommand = _messages$push_server.AckCommand,
|
31122 | UnreadCommand = _messages$push_server.UnreadCommand,
|
31123 | ConvCommand = _messages$push_server.ConvCommand,
|
31124 | RoomCommand = _messages$push_server.RoomCommand,
|
31125 | LogsCommand = _messages$push_server.LogsCommand,
|
31126 | RcpCommand = _messages$push_server.RcpCommand,
|
31127 | ReadTuple = _messages$push_server.ReadTuple,
|
31128 | MaxReadTuple = _messages$push_server.MaxReadTuple,
|
31129 | ReadCommand = _messages$push_server.ReadCommand,
|
31130 | PresenceCommand = _messages$push_server.PresenceCommand,
|
31131 | ReportCommand = _messages$push_server.ReportCommand,
|
31132 | GenericCommand = _messages$push_server.GenericCommand,
|
31133 | BlacklistCommand = _messages$push_server.BlacklistCommand,
|
31134 | PatchCommand = _messages$push_server.PatchCommand,
|
31135 | PatchItem = _messages$push_server.PatchItem,
|
31136 | ConvMemberInfo = _messages$push_server.ConvMemberInfo,
|
31137 | CommandType = _messages$push_server.CommandType,
|
31138 | OpType = _messages$push_server.OpType,
|
31139 | StatusType = _messages$push_server.StatusType;
|
31140 | var message = (0, _freeze.default)({
|
31141 | __proto__: null,
|
31142 | JsonObjectMessage: JsonObjectMessage,
|
31143 | UnreadTuple: UnreadTuple,
|
31144 | LogItem: LogItem,
|
31145 | DataCommand: DataCommand,
|
31146 | SessionCommand: SessionCommand,
|
31147 | ErrorCommand: ErrorCommand,
|
31148 | DirectCommand: DirectCommand,
|
31149 | AckCommand: AckCommand,
|
31150 | UnreadCommand: UnreadCommand,
|
31151 | ConvCommand: ConvCommand,
|
31152 | RoomCommand: RoomCommand,
|
31153 | LogsCommand: LogsCommand,
|
31154 | RcpCommand: RcpCommand,
|
31155 | ReadTuple: ReadTuple,
|
31156 | MaxReadTuple: MaxReadTuple,
|
31157 | ReadCommand: ReadCommand,
|
31158 | PresenceCommand: PresenceCommand,
|
31159 | ReportCommand: ReportCommand,
|
31160 | GenericCommand: GenericCommand,
|
31161 | BlacklistCommand: BlacklistCommand,
|
31162 | PatchCommand: PatchCommand,
|
31163 | PatchItem: PatchItem,
|
31164 | ConvMemberInfo: ConvMemberInfo,
|
31165 | CommandType: CommandType,
|
31166 | OpType: OpType,
|
31167 | StatusType: StatusType
|
31168 | });
|
31169 | var adapters = {};
|
31170 |
|
31171 | var getAdapter = function getAdapter(name) {
|
31172 | var adapter = adapters[name];
|
31173 |
|
31174 | if (adapter === undefined) {
|
31175 | throw new Error("".concat(name, " adapter is not configured"));
|
31176 | }
|
31177 |
|
31178 | return adapter;
|
31179 | };
|
31180 |
|
31181 |
|
31182 |
|
31183 |
|
31184 |
|
31185 |
|
31186 |
|
31187 |
|
31188 | var setAdapters = function setAdapters(newAdapters) {
|
31189 | (0, _assign.default)(adapters, newAdapters);
|
31190 | };
|
31191 |
|
31192 |
|
31193 |
|
31194 | var global$1 = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {};
|
31195 | var EXPIRED = (0, _symbol.default)('expired');
|
31196 | var debug = d('LC:Expirable');
|
31197 |
|
31198 | var Expirable = function () {
|
31199 | function Expirable(value, ttl) {
|
31200 | this.originalValue = value;
|
31201 |
|
31202 | if (typeof ttl === 'number') {
|
31203 | this.expiredAt = Date.now() + ttl;
|
31204 | }
|
31205 | }
|
31206 |
|
31207 | _createClass(Expirable, [{
|
31208 | key: "value",
|
31209 | get: function get() {
|
31210 | var expired = this.expiredAt && this.expiredAt <= Date.now();
|
31211 | if (expired) debug("expired: ".concat(this.originalValue));
|
31212 | return expired ? EXPIRED : this.originalValue;
|
31213 | }
|
31214 | }]);
|
31215 |
|
31216 | return Expirable;
|
31217 | }();
|
31218 |
|
31219 | Expirable.EXPIRED = EXPIRED;
|
31220 | var debug$1 = d('LC:Cache');
|
31221 |
|
31222 | var Cache = function () {
|
31223 | function Cache() {
|
31224 | var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'anonymous';
|
31225 | this.name = name;
|
31226 | this._map = {};
|
31227 | }
|
31228 |
|
31229 | var _proto = Cache.prototype;
|
31230 |
|
31231 | _proto.get = function get(key) {
|
31232 | var _context5;
|
31233 |
|
31234 | var cache = this._map[key];
|
31235 |
|
31236 | if (cache) {
|
31237 | var value = cache.value;
|
31238 |
|
31239 | if (value !== Expirable.EXPIRED) {
|
31240 | debug$1('[%s] hit: %s', this.name, key);
|
31241 | return value;
|
31242 | }
|
31243 |
|
31244 | delete this._map[key];
|
31245 | }
|
31246 |
|
31247 | debug$1((0, _concat.default)(_context5 = "[".concat(this.name, "] missed: ")).call(_context5, key));
|
31248 | return null;
|
31249 | };
|
31250 |
|
31251 | _proto.set = function set(key, value, ttl) {
|
31252 | debug$1('[%s] set: %s %d', this.name, key, ttl);
|
31253 | this._map[key] = new Expirable(value, ttl);
|
31254 | };
|
31255 |
|
31256 | return Cache;
|
31257 | }();
|
31258 |
|
31259 | function ownKeys(object, enumerableOnly) {
|
31260 | var keys = (0, _keys.default)(object);
|
31261 |
|
31262 | if (_getOwnPropertySymbols.default) {
|
31263 | var symbols = (0, _getOwnPropertySymbols.default)(object);
|
31264 | enumerableOnly && (symbols = (0, _filter.default)(symbols).call(symbols, function (sym) {
|
31265 | return (0, _getOwnPropertyDescriptor.default)(object, sym).enumerable;
|
31266 | })), keys.push.apply(keys, symbols);
|
31267 | }
|
31268 |
|
31269 | return keys;
|
31270 | }
|
31271 |
|
31272 | function _objectSpread(target) {
|
31273 | for (var i = 1; i < arguments.length; i++) {
|
31274 | var source = null != arguments[i] ? arguments[i] : {};
|
31275 | i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
31276 | _defineProperty(target, key, source[key]);
|
31277 | }) : _getOwnPropertyDescriptors.default ? (0, _defineProperties.default)(target, (0, _getOwnPropertyDescriptors.default)(source)) : ownKeys(Object(source)).forEach(function (key) {
|
31278 | (0, _defineProperty2.default)(target, key, (0, _getOwnPropertyDescriptor.default)(source, key));
|
31279 | });
|
31280 | }
|
31281 |
|
31282 | return target;
|
31283 | }
|
31284 |
|
31285 |
|
31286 |
|
31287 |
|
31288 |
|
31289 |
|
31290 |
|
31291 |
|
31292 |
|
31293 |
|
31294 | var debug$2 = {
|
31295 | enable: function enable() {
|
31296 | var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'LC*';
|
31297 | return d.enable(namespaces);
|
31298 | },
|
31299 | disable: d.disable
|
31300 | };
|
31301 |
|
31302 | var tryAll = function tryAll(promiseConstructors) {
|
31303 | var promise = new _promise.default(promiseConstructors[0]);
|
31304 |
|
31305 | if (promiseConstructors.length === 1) {
|
31306 | return promise;
|
31307 | }
|
31308 |
|
31309 | return promise["catch"](function () {
|
31310 | return tryAll((0, _slice.default)(promiseConstructors).call(promiseConstructors, 1));
|
31311 | });
|
31312 | };
|
31313 |
|
31314 |
|
31315 | var tap = function tap(interceptor) {
|
31316 | return function (value) {
|
31317 | return interceptor(value), value;
|
31318 | };
|
31319 | };
|
31320 |
|
31321 | var isIE10 = global$1.navigator && global$1.navigator.userAgent && (0, _indexOf.default)(_context6 = global$1.navigator.userAgent).call(_context6, 'MSIE 10.') !== -1;
|
31322 | var map = new _weakMap.default();
|
31323 |
|
31324 | var internal = function internal(object) {
|
31325 | if (!map.has(object)) {
|
31326 | map.set(object, {});
|
31327 | }
|
31328 |
|
31329 | return map.get(object);
|
31330 | };
|
31331 |
|
31332 | var compact = function compact(obj, filter) {
|
31333 | if (!isPlainObject(obj)) return obj;
|
31334 |
|
31335 | var object = _objectSpread({}, obj);
|
31336 |
|
31337 | (0, _keys.default)(object).forEach(function (prop) {
|
31338 | var value = object[prop];
|
31339 |
|
31340 | if (value === filter) {
|
31341 | delete object[prop];
|
31342 | } else {
|
31343 | object[prop] = compact(value, filter);
|
31344 | }
|
31345 | });
|
31346 | return object;
|
31347 | };
|
31348 |
|
31349 |
|
31350 | var removeNull = function removeNull(obj) {
|
31351 | return compact(obj, null);
|
31352 | };
|
31353 |
|
31354 | var trim = function trim(message) {
|
31355 | return removeNull(JSON.parse((0, _stringify.default)(message)));
|
31356 | };
|
31357 |
|
31358 | var ensureArray = function ensureArray(target) {
|
31359 | if (Array.isArray(target)) {
|
31360 | return target;
|
31361 | }
|
31362 |
|
31363 | if (target === undefined || target === null) {
|
31364 | return [];
|
31365 | }
|
31366 |
|
31367 | return [target];
|
31368 | };
|
31369 |
|
31370 | var isWeapp =
|
31371 | (typeof wx === "undefined" ? "undefined" : _typeof(wx)) === 'object' && typeof wx.connectSocket === 'function';
|
31372 |
|
31373 | var isCNApp = function isCNApp(appId) {
|
31374 | return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
|
31375 | };
|
31376 |
|
31377 | var equalBuffer = function equalBuffer(buffer1, buffer2) {
|
31378 | if (!buffer1 || !buffer2) return false;
|
31379 | if (buffer1.byteLength !== buffer2.byteLength) return false;
|
31380 | var a = new Uint8Array(buffer1);
|
31381 | var b = new Uint8Array(buffer2);
|
31382 | return !a.some(function (value, index) {
|
31383 | return value !== b[index];
|
31384 | });
|
31385 | };
|
31386 |
|
31387 | var _class;
|
31388 |
|
31389 | function ownKeys$1(object, enumerableOnly) {
|
31390 | var keys = (0, _keys.default)(object);
|
31391 |
|
31392 | if (_getOwnPropertySymbols.default) {
|
31393 | var symbols = (0, _getOwnPropertySymbols.default)(object);
|
31394 | enumerableOnly && (symbols = (0, _filter.default)(symbols).call(symbols, function (sym) {
|
31395 | return (0, _getOwnPropertyDescriptor.default)(object, sym).enumerable;
|
31396 | })), keys.push.apply(keys, symbols);
|
31397 | }
|
31398 |
|
31399 | return keys;
|
31400 | }
|
31401 |
|
31402 | function _objectSpread$1(target) {
|
31403 | for (var i = 1; i < arguments.length; i++) {
|
31404 | var source = null != arguments[i] ? arguments[i] : {};
|
31405 | i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
|
31406 | _defineProperty(target, key, source[key]);
|
31407 | }) : _getOwnPropertyDescriptors.default ? (0, _defineProperties.default)(target, (0, _getOwnPropertyDescriptors.default)(source)) : ownKeys$1(Object(source)).forEach(function (key) {
|
31408 | (0, _defineProperty2.default)(target, key, (0, _getOwnPropertyDescriptor.default)(source, key));
|
31409 | });
|
31410 | }
|
31411 |
|
31412 | return target;
|
31413 | }
|
31414 |
|
31415 | var debug$3 = d('LC:WebSocketPlus');
|
31416 | var OPEN = 'open';
|
31417 | var DISCONNECT = 'disconnect';
|
31418 | var RECONNECT = 'reconnect';
|
31419 | var RETRY = 'retry';
|
31420 | var SCHEDULE = 'schedule';
|
31421 | var OFFLINE = 'offline';
|
31422 | var ONLINE = 'online';
|
31423 | var ERROR = 'error';
|
31424 | var MESSAGE = 'message';
|
31425 | var HEARTBEAT_TIME = 180000;
|
31426 | var TIMEOUT_TIME = 380000;
|
31427 |
|
31428 | var DEFAULT_RETRY_STRATEGY = function DEFAULT_RETRY_STRATEGY(attempt) {
|
31429 | return Math.min(1000 * Math.pow(2, attempt), 300000);
|
31430 | };
|
31431 |
|
31432 | var requireConnected = function requireConnected(target, name, descriptor) {
|
31433 | return _objectSpread$1(_objectSpread$1({}, descriptor), {}, {
|
31434 | value: function requireConnectedWrapper() {
|
31435 | var _context7;
|
31436 |
|
31437 | var _descriptor$value;
|
31438 |
|
31439 | this.checkConnectionAvailability(name);
|
31440 |
|
31441 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
31442 | args[_key] = arguments[_key];
|
31443 | }
|
31444 |
|
31445 | return (_descriptor$value = descriptor.value).call.apply(_descriptor$value, (0, _concat.default)(_context7 = [this]).call(_context7, args));
|
31446 | }
|
31447 | });
|
31448 | };
|
31449 |
|
31450 | var WebSocketPlus = (_class = function (_EventEmitter) {
|
31451 | _inheritsLoose(WebSocketPlus, _EventEmitter);
|
31452 |
|
31453 | function WebSocketPlus(getUrls, protocol) {
|
31454 | var _this;
|
31455 |
|
31456 | _this = _EventEmitter.call(this) || this;
|
31457 |
|
31458 | _this.init();
|
31459 |
|
31460 | _this._protocol = protocol;
|
31461 |
|
31462 | _promise.default.resolve(typeof getUrls === 'function' ? getUrls() : getUrls).then(ensureArray).then(function (urls) {
|
31463 | _this._urls = urls;
|
31464 | return _this._open();
|
31465 | }).then(function () {
|
31466 | _this.__postponeTimeoutTimer = _this._postponeTimeoutTimer.bind(_assertThisInitialized(_this));
|
31467 |
|
31468 | if (global$1.addEventListener) {
|
31469 | _this.__pause = function () {
|
31470 | if (_this.can('pause')) _this.pause();
|
31471 | };
|
31472 |
|
31473 | _this.__resume = function () {
|
31474 | if (_this.can('resume')) _this.resume();
|
31475 | };
|
31476 |
|
31477 | global$1.addEventListener('offline', _this.__pause);
|
31478 | global$1.addEventListener('online', _this.__resume);
|
31479 | }
|
31480 |
|
31481 | _this.open();
|
31482 | })["catch"](_this["throw"].bind(_assertThisInitialized(_this)));
|
31483 |
|
31484 | return _this;
|
31485 | }
|
31486 |
|
31487 | var _proto = WebSocketPlus.prototype;
|
31488 |
|
31489 | _proto._open = function _open() {
|
31490 | var _this2 = this;
|
31491 |
|
31492 | return this._createWs(this._urls, this._protocol).then(function (ws) {
|
31493 | var _context8;
|
31494 |
|
31495 | var _this2$_urls = _toArray(_this2._urls),
|
31496 | first = _this2$_urls[0],
|
31497 | reset = (0, _slice.default)(_this2$_urls).call(_this2$_urls, 1);
|
31498 |
|
31499 | _this2._urls = (0, _concat.default)(_context8 = []).call(_context8, _toConsumableArray(reset), [first]);
|
31500 | return ws;
|
31501 | });
|
31502 | };
|
31503 |
|
31504 | _proto._createWs = function _createWs(urls, protocol) {
|
31505 | var _this3 = this;
|
31506 |
|
31507 | return tryAll((0, _map.default)(urls).call(urls, function (url) {
|
31508 | return function (resolve, reject) {
|
31509 | var _context9;
|
31510 |
|
31511 | debug$3((0, _concat.default)(_context9 = "connect [".concat(url, "] ")).call(_context9, protocol));
|
31512 | var WebSocket = getAdapter('WebSocket');
|
31513 | var ws = protocol ? new WebSocket(url, protocol) : new WebSocket(url);
|
31514 | ws.binaryType = _this3.binaryType || 'arraybuffer';
|
31515 |
|
31516 | ws.onopen = function () {
|
31517 | return resolve(ws);
|
31518 | };
|
31519 |
|
31520 | ws.onclose = function (error) {
|
31521 | if (error instanceof Error) {
|
31522 | return reject(error);
|
31523 | }
|
31524 |
|
31525 |
|
31526 | return reject(new Error("Failed to connect [".concat(url, "]")));
|
31527 | };
|
31528 |
|
31529 | ws.onerror = ws.onclose;
|
31530 | };
|
31531 | })).then(function (ws) {
|
31532 | _this3._ws = ws;
|
31533 | _this3._ws.onclose = _this3._handleClose.bind(_this3);
|
31534 | _this3._ws.onmessage = _this3._handleMessage.bind(_this3);
|
31535 | return ws;
|
31536 | });
|
31537 | };
|
31538 |
|
31539 | _proto._destroyWs = function _destroyWs() {
|
31540 | var ws = this._ws;
|
31541 | if (!ws) return;
|
31542 | ws.onopen = null;
|
31543 | ws.onclose = null;
|
31544 | ws.onerror = null;
|
31545 | ws.onmessage = null;
|
31546 | this._ws = null;
|
31547 | ws.close();
|
31548 | }
|
31549 | ;
|
31550 |
|
31551 | _proto.onbeforeevent = function onbeforeevent(event, from, to) {
|
31552 | var _context10, _context11;
|
31553 |
|
31554 | for (var _len2 = arguments.length, payload = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
|
31555 | payload[_key2 - 3] = arguments[_key2];
|
31556 | }
|
31557 |
|
31558 | debug$3((0, _concat.default)(_context10 = (0, _concat.default)(_context11 = "".concat(event, ": ")).call(_context11, from, " -> ")).call(_context10, to, " %o"), payload);
|
31559 | };
|
31560 |
|
31561 | _proto.onopen = function onopen() {
|
31562 | this.emit(OPEN);
|
31563 | };
|
31564 |
|
31565 | _proto.onconnected = function onconnected() {
|
31566 | this._startConnectionKeeper();
|
31567 | };
|
31568 |
|
31569 | _proto.onleaveconnected = function onleaveconnected(event, from, to) {
|
31570 | this._stopConnectionKeeper();
|
31571 |
|
31572 | this._destroyWs();
|
31573 |
|
31574 | if (to === 'offline' || to === 'disconnected') {
|
31575 | this.emit(DISCONNECT);
|
31576 | }
|
31577 | };
|
31578 |
|
31579 | _proto.onpause = function onpause() {
|
31580 | this.emit(OFFLINE);
|
31581 | };
|
31582 |
|
31583 | _proto.onbeforeresume = function onbeforeresume() {
|
31584 | this.emit(ONLINE);
|
31585 | };
|
31586 |
|
31587 | _proto.onreconnect = function onreconnect() {
|
31588 | this.emit(RECONNECT);
|
31589 | };
|
31590 |
|
31591 | _proto.ondisconnected = function ondisconnected(event, from, to) {
|
31592 | var _context12;
|
31593 |
|
31594 | var _this4 = this;
|
31595 |
|
31596 | var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
31597 | var delay = from === OFFLINE ? 0 : DEFAULT_RETRY_STRATEGY.call(null, attempt);
|
31598 | debug$3((0, _concat.default)(_context12 = "schedule attempt=".concat(attempt, " delay=")).call(_context12, delay));
|
31599 | this.emit(SCHEDULE, attempt, delay);
|
31600 |
|
31601 | if (this.__scheduledRetry) {
|
31602 | clearTimeout(this.__scheduledRetry);
|
31603 | }
|
31604 |
|
31605 | this.__scheduledRetry = setTimeout(function () {
|
31606 | if (_this4.is('disconnected')) {
|
31607 | _this4.retry(attempt);
|
31608 | }
|
31609 | }, delay);
|
31610 | };
|
31611 |
|
31612 | _proto.onretry = function onretry(event, from, to) {
|
31613 | var _this5 = this;
|
31614 |
|
31615 | var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
31616 | this.emit(RETRY, attempt);
|
31617 |
|
31618 | this._open().then(function () {
|
31619 | return _this5.can('reconnect') && _this5.reconnect();
|
31620 | }, function () {
|
31621 | return _this5.can('fail') && _this5.fail(attempt + 1);
|
31622 | });
|
31623 | };
|
31624 |
|
31625 | _proto.onerror = function onerror(event, from, to, error) {
|
31626 | this.emit(ERROR, error);
|
31627 | };
|
31628 |
|
31629 | _proto.onclose = function onclose() {
|
31630 | if (global$1.removeEventListener) {
|
31631 | if (this.__pause) global$1.removeEventListener('offline', this.__pause);
|
31632 | if (this.__resume) global$1.removeEventListener('online', this.__resume);
|
31633 | }
|
31634 | };
|
31635 |
|
31636 | _proto.checkConnectionAvailability = function checkConnectionAvailability() {
|
31637 | var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'API';
|
31638 |
|
31639 | if (!this.is('connected')) {
|
31640 | var _context13;
|
31641 |
|
31642 | var currentState = this.current;
|
31643 | console.warn((0, _concat.default)(_context13 = "".concat(name, " should not be called when the connection is ")).call(_context13, currentState));
|
31644 |
|
31645 | if (this.is('disconnected') || this.is('reconnecting')) {
|
31646 | console.warn('disconnect and reconnect event should be handled to avoid such calls.');
|
31647 | }
|
31648 |
|
31649 | throw new Error('Connection unavailable');
|
31650 | }
|
31651 | }
|
31652 | ;
|
31653 |
|
31654 | _proto.
|
31655 | _ping = function _ping() {
|
31656 | debug$3('ping');
|
31657 |
|
31658 | try {
|
31659 | this.ping();
|
31660 | } catch (error) {
|
31661 | console.warn("websocket ping error: ".concat(error.message));
|
31662 | }
|
31663 | };
|
31664 |
|
31665 | _proto.ping = function ping() {
|
31666 | if (this._ws.ping) {
|
31667 | this._ws.ping();
|
31668 | } else {
|
31669 | console.warn("The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.");
|
31670 | }
|
31671 | };
|
31672 |
|
31673 | _proto._postponeTimeoutTimer = function _postponeTimeoutTimer() {
|
31674 | var _this6 = this;
|
31675 |
|
31676 | debug$3('_postponeTimeoutTimer');
|
31677 |
|
31678 | this._clearTimeoutTimers();
|
31679 |
|
31680 | this._timeoutTimer = setTimeout(function () {
|
31681 | debug$3('timeout');
|
31682 |
|
31683 | _this6.disconnect();
|
31684 | }, TIMEOUT_TIME);
|
31685 | };
|
31686 |
|
31687 | _proto._clearTimeoutTimers = function _clearTimeoutTimers() {
|
31688 | if (this._timeoutTimer) {
|
31689 | clearTimeout(this._timeoutTimer);
|
31690 | }
|
31691 | };
|
31692 |
|
31693 | _proto._startConnectionKeeper = function _startConnectionKeeper() {
|
31694 | debug$3('start connection keeper');
|
31695 | this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME);
|
31696 | var addListener = this._ws.addListener || this._ws.addEventListener;
|
31697 |
|
31698 | if (!addListener) {
|
31699 | debug$3('connection keeper disabled due to the lack of #addEventListener.');
|
31700 | return;
|
31701 | }
|
31702 |
|
31703 | addListener.call(this._ws, 'message', this.__postponeTimeoutTimer);
|
31704 | addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);
|
31705 |
|
31706 | this._postponeTimeoutTimer();
|
31707 | };
|
31708 |
|
31709 | _proto._stopConnectionKeeper = function _stopConnectionKeeper() {
|
31710 | debug$3('stop connection keeper');
|
31711 |
|
31712 | var removeListener = this._ws.removeListener || this._ws.removeEventListener;
|
31713 |
|
31714 | if (removeListener) {
|
31715 | removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer);
|
31716 | removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);
|
31717 |
|
31718 | this._clearTimeoutTimers();
|
31719 | }
|
31720 |
|
31721 | if (this._heartbeatTimer) {
|
31722 | clearInterval(this._heartbeatTimer);
|
31723 | }
|
31724 | };
|
31725 |
|
31726 | _proto._handleClose = function _handleClose(event) {
|
31727 | var _context14;
|
31728 |
|
31729 | debug$3((0, _concat.default)(_context14 = "ws closed [".concat(event.code, "] ")).call(_context14, event.reason));
|
31730 |
|
31731 | if (this.isFinished()) return;
|
31732 | this.handleClose(event);
|
31733 | };
|
31734 |
|
31735 | _proto.handleClose = function handleClose() {
|
31736 |
|
31737 | this.disconnect();
|
31738 | }
|
31739 | ;
|
31740 |
|
31741 | _proto.
|
31742 | send = function send(data) {
|
31743 | debug$3('send', data);
|
31744 |
|
31745 | this._ws.send(data);
|
31746 | };
|
31747 |
|
31748 | _proto._handleMessage = function _handleMessage(event) {
|
31749 | debug$3('message', event.data);
|
31750 | this.handleMessage(event.data);
|
31751 | };
|
31752 |
|
31753 | _proto.handleMessage = function handleMessage(message) {
|
31754 | this.emit(MESSAGE, message);
|
31755 | };
|
31756 |
|
31757 | _createClass(WebSocketPlus, [{
|
31758 | key: "urls",
|
31759 | get: function get() {
|
31760 | return this._urls;
|
31761 | },
|
31762 | set: function set(urls) {
|
31763 | this._urls = ensureArray(urls);
|
31764 | }
|
31765 | }]);
|
31766 |
|
31767 | return WebSocketPlus;
|
31768 | }(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);
|
31769 | StateMachine.create({
|
31770 | target: WebSocketPlus.prototype,
|
31771 | initial: {
|
31772 | state: 'initialized',
|
31773 | event: 'init',
|
31774 | defer: true
|
31775 | },
|
31776 | terminal: 'closed',
|
31777 | events: [{
|
31778 | name: 'open',
|
31779 | from: 'initialized',
|
31780 | to: 'connected'
|
31781 | }, {
|
31782 | name: 'disconnect',
|
31783 | from: 'connected',
|
31784 | to: 'disconnected'
|
31785 | }, {
|
31786 | name: 'retry',
|
31787 | from: 'disconnected',
|
31788 | to: 'reconnecting'
|
31789 | }, {
|
31790 | name: 'fail',
|
31791 | from: 'reconnecting',
|
31792 | to: 'disconnected'
|
31793 | }, {
|
31794 | name: 'reconnect',
|
31795 | from: 'reconnecting',
|
31796 | to: 'connected'
|
31797 | }, {
|
31798 | name: 'pause',
|
31799 | from: ['connected', 'disconnected', 'reconnecting'],
|
31800 | to: 'offline'
|
31801 | }, {}, {
|
31802 | name: 'resume',
|
31803 | from: 'offline',
|
31804 | to: 'disconnected'
|
31805 | }, {
|
31806 | name: 'close',
|
31807 | from: ['connected', 'disconnected', 'reconnecting', 'offline'],
|
31808 | to: 'closed'
|
31809 | }, {
|
31810 | name: 'throw',
|
31811 | from: '*',
|
31812 | to: 'error'
|
31813 | }]
|
31814 | });
|
31815 | var error = (0, _freeze.default)({
|
31816 | 1000: {
|
31817 | name: 'CLOSE_NORMAL'
|
31818 | },
|
31819 | 1006: {
|
31820 | name: 'CLOSE_ABNORMAL'
|
31821 | },
|
31822 | 4100: {
|
31823 | name: 'APP_NOT_AVAILABLE',
|
31824 | message: 'App not exists or realtime message service is disabled.'
|
31825 | },
|
31826 | 4102: {
|
31827 | name: 'SIGNATURE_FAILED',
|
31828 | message: 'Login signature mismatch.'
|
31829 | },
|
31830 | 4103: {
|
31831 | name: 'INVALID_LOGIN',
|
31832 | message: 'Malformed clientId.'
|
31833 | },
|
31834 | 4105: {
|
31835 | name: 'SESSION_REQUIRED',
|
31836 | message: 'Message sent before session opened.'
|
31837 | },
|
31838 | 4107: {
|
31839 | name: 'READ_TIMEOUT'
|
31840 | },
|
31841 | 4108: {
|
31842 | name: 'LOGIN_TIMEOUT'
|
31843 | },
|
31844 | 4109: {
|
31845 | name: 'FRAME_TOO_LONG'
|
31846 | },
|
31847 | 4110: {
|
31848 | name: 'INVALID_ORIGIN',
|
31849 | message: 'Access denied by domain whitelist.'
|
31850 | },
|
31851 | 4111: {
|
31852 | name: 'SESSION_CONFLICT'
|
31853 | },
|
31854 | 4112: {
|
31855 | name: 'SESSION_TOKEN_EXPIRED'
|
31856 | },
|
31857 | 4113: {
|
31858 | name: 'APP_QUOTA_EXCEEDED',
|
31859 | message: 'The daily active users limit exceeded.'
|
31860 | },
|
31861 | 4116: {
|
31862 | name: 'MESSAGE_SENT_QUOTA_EXCEEDED',
|
31863 | message: 'Command sent too fast.'
|
31864 | },
|
31865 | 4200: {
|
31866 | name: 'INTERNAL_ERROR',
|
31867 | message: 'Internal error, please contact LeanCloud for support.'
|
31868 | },
|
31869 | 4301: {
|
31870 | name: 'CONVERSATION_API_FAILED',
|
31871 | message: 'Upstream Conversatoin API failed, see error.detail for details.'
|
31872 | },
|
31873 | 4302: {
|
31874 | name: 'CONVERSATION_SIGNATURE_FAILED',
|
31875 | message: 'Conversation action signature mismatch.'
|
31876 | },
|
31877 | 4303: {
|
31878 | name: 'CONVERSATION_NOT_FOUND'
|
31879 | },
|
31880 | 4304: {
|
31881 | name: 'CONVERSATION_FULL'
|
31882 | },
|
31883 | 4305: {
|
31884 | name: 'CONVERSATION_REJECTED_BY_APP',
|
31885 | message: 'Conversation action rejected by hook.'
|
31886 | },
|
31887 | 4306: {
|
31888 | name: 'CONVERSATION_UPDATE_FAILED'
|
31889 | },
|
31890 | 4307: {
|
31891 | name: 'CONVERSATION_READ_ONLY'
|
31892 | },
|
31893 | 4308: {
|
31894 | name: 'CONVERSATION_NOT_ALLOWED'
|
31895 | },
|
31896 | 4309: {
|
31897 | name: 'CONVERSATION_UPDATE_REJECTED',
|
31898 | message: 'Conversation update rejected because the client is not a member.'
|
31899 | },
|
31900 | 4310: {
|
31901 | name: 'CONVERSATION_QUERY_FAILED',
|
31902 | message: 'Conversation query failed because it is too expansive.'
|
31903 | },
|
31904 | 4311: {
|
31905 | name: 'CONVERSATION_LOG_FAILED'
|
31906 | },
|
31907 | 4312: {
|
31908 | name: 'CONVERSATION_LOG_REJECTED',
|
31909 | message: 'Message query rejected because the client is not a member of the conversation.'
|
31910 | },
|
31911 | 4313: {
|
31912 | name: 'SYSTEM_CONVERSATION_REQUIRED'
|
31913 | },
|
31914 | 4314: {
|
31915 | name: 'NORMAL_CONVERSATION_REQUIRED'
|
31916 | },
|
31917 | 4315: {
|
31918 | name: 'CONVERSATION_BLACKLISTED',
|
31919 | message: 'Blacklisted in the conversation.'
|
31920 | },
|
31921 | 4316: {
|
31922 | name: 'TRANSIENT_CONVERSATION_REQUIRED'
|
31923 | },
|
31924 | 4317: {
|
31925 | name: 'CONVERSATION_MEMBERSHIP_REQUIRED'
|
31926 | },
|
31927 | 4318: {
|
31928 | name: 'CONVERSATION_API_QUOTA_EXCEEDED',
|
31929 | message: 'LeanCloud API quota exceeded. You may upgrade your plan.'
|
31930 | },
|
31931 | 4323: {
|
31932 | name: 'TEMPORARY_CONVERSATION_EXPIRED',
|
31933 | message: 'Temporary conversation expired or does not exist.'
|
31934 | },
|
31935 | 4401: {
|
31936 | name: 'INVALID_MESSAGING_TARGET',
|
31937 | message: 'Conversation does not exist or client is not a member.'
|
31938 | },
|
31939 | 4402: {
|
31940 | name: 'MESSAGE_REJECTED_BY_APP',
|
31941 | message: 'Message rejected by hook.'
|
31942 | },
|
31943 | 4403: {
|
31944 | name: 'MESSAGE_OWNERSHIP_REQUIRED'
|
31945 | },
|
31946 | 4404: {
|
31947 | name: 'MESSAGE_NOT_FOUND'
|
31948 | },
|
31949 | 4405: {
|
31950 | name: 'MESSAGE_UPDATE_REJECTED_BY_APP',
|
31951 | message: 'Message update rejected by hook.'
|
31952 | },
|
31953 | 4406: {
|
31954 | name: 'MESSAGE_EDIT_DISABLED'
|
31955 | },
|
31956 | 4407: {
|
31957 | name: 'MESSAGE_RECALL_DISABLED'
|
31958 | },
|
31959 | 5130: {
|
31960 | name: 'OWNER_PROMOTION_NOT_ALLOWED',
|
31961 | message: "Updating a member's role to owner is not allowed."
|
31962 | }
|
31963 | });
|
31964 | var ErrorCode = (0, _freeze.default)((0, _reduce.default)(_context15 = (0, _keys.default)(error)).call(_context15, function (result, code) {
|
31965 | return (0, _assign.default)(result, _defineProperty({}, error[code].name, Number(code)));
|
31966 | }, {}));
|
31967 |
|
31968 | var createError = function createError(_ref) {
|
31969 | var code = _ref.code,
|
31970 | reason = _ref.reason,
|
31971 | appCode = _ref.appCode,
|
31972 | detail = _ref.detail,
|
31973 | errorMessage = _ref.error;
|
31974 | var message = reason || detail || errorMessage;
|
31975 | var name = reason;
|
31976 |
|
31977 | if (!message && error[code]) {
|
31978 | name = error[code].name;
|
31979 | message = error[code].message || name;
|
31980 | }
|
31981 |
|
31982 | if (!message) {
|
31983 | message = "Unknow Error: ".concat(code);
|
31984 | }
|
31985 |
|
31986 | var err = new Error(message);
|
31987 | return (0, _assign.default)(err, {
|
31988 | code: code,
|
31989 | appCode: appCode,
|
31990 | detail: detail,
|
31991 | name: name
|
31992 | });
|
31993 | };
|
31994 |
|
31995 | var debug$4 = d('LC:Connection');
|
31996 | var COMMAND_TIMEOUT = 20000;
|
31997 | var EXPIRE = (0, _symbol.default)('expire');
|
31998 |
|
31999 | var isIdempotentCommand = function isIdempotentCommand(command) {
|
32000 | 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));
|
32001 | };
|
32002 |
|
32003 | var Connection = function (_WebSocketPlus) {
|
32004 | _inheritsLoose(Connection, _WebSocketPlus);
|
32005 |
|
32006 | function Connection(getUrl, _ref) {
|
32007 | var _context16;
|
32008 |
|
32009 | var _this;
|
32010 |
|
32011 | var format = _ref.format,
|
32012 | version = _ref.version;
|
32013 | debug$4('initializing Connection');
|
32014 | var protocolString = (0, _concat.default)(_context16 = "lc.".concat(format, ".")).call(_context16, version);
|
32015 | _this = _WebSocketPlus.call(this, getUrl, protocolString) || this;
|
32016 | _this._protocolFormat = format;
|
32017 | _this._commands = {};
|
32018 | _this._serialId = 0;
|
32019 | return _this;
|
32020 | }
|
32021 |
|
32022 | var _proto = Connection.prototype;
|
32023 |
|
32024 | _proto.send = function () {
|
32025 | var _send = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(command) {
|
32026 | var _this2 = this;
|
32027 |
|
32028 | var waitingForRespond,
|
32029 | buffer,
|
32030 | serialId,
|
32031 | duplicatedCommand,
|
32032 | message,
|
32033 | promise,
|
32034 | _args = arguments;
|
32035 | return _regeneratorRuntime.wrap(function _callee$(_context) {
|
32036 | var _context17, _context18;
|
32037 |
|
32038 | while (1) {
|
32039 | switch (_context.prev = _context.next) {
|
32040 | case 0:
|
32041 | waitingForRespond = _args.length > 1 && _args[1] !== undefined ? _args[1] : true;
|
32042 |
|
32043 | if (!waitingForRespond) {
|
32044 | _context.next = 11;
|
32045 | break;
|
32046 | }
|
32047 |
|
32048 | if (!isIdempotentCommand(command)) {
|
32049 | _context.next = 8;
|
32050 | break;
|
32051 | }
|
32052 |
|
32053 | buffer = command.toArrayBuffer();
|
32054 | duplicatedCommand = (0, _find.default)(_context17 = values(this._commands)).call(_context17, function (_ref2) {
|
32055 | var targetBuffer = _ref2.buffer,
|
32056 | targetCommand = _ref2.command;
|
32057 | return targetCommand.cmd === command.cmd && targetCommand.op === command.op && equalBuffer(targetBuffer, buffer);
|
32058 | });
|
32059 |
|
32060 | if (!duplicatedCommand) {
|
32061 | _context.next = 8;
|
32062 | break;
|
32063 | }
|
32064 |
|
32065 | console.warn((0, _concat.default)(_context18 = "Duplicated command [cmd:".concat(command.cmd, " op:")).call(_context18, command.op, "] is throttled."));
|
32066 | return _context.abrupt("return", duplicatedCommand.promise);
|
32067 |
|
32068 | case 8:
|
32069 | this._serialId += 1;
|
32070 | serialId = this._serialId;
|
32071 | command.i = serialId;
|
32072 |
|
32073 |
|
32074 | case 11:
|
32075 | if (debug$4.enabled) debug$4('↑ %O sent', trim(command));
|
32076 |
|
32077 | if (this._protocolFormat === 'proto2base64') {
|
32078 | message = command.toBase64();
|
32079 | } else if (command.toArrayBuffer) {
|
32080 | message = command.toArrayBuffer();
|
32081 | }
|
32082 |
|
32083 | if (message) {
|
32084 | _context.next = 15;
|
32085 | break;
|
32086 | }
|
32087 |
|
32088 | throw new TypeError("".concat(command, " is not a GenericCommand"));
|
32089 |
|
32090 | case 15:
|
32091 | _WebSocketPlus.prototype.send.call(this, message);
|
32092 |
|
32093 | if (waitingForRespond) {
|
32094 | _context.next = 18;
|
32095 | break;
|
32096 | }
|
32097 |
|
32098 | return _context.abrupt("return", undefined);
|
32099 |
|
32100 | case 18:
|
32101 | promise = new _promise.default(function (resolve, reject) {
|
32102 | _this2._commands[serialId] = {
|
32103 | command: command,
|
32104 | buffer: buffer,
|
32105 | resolve: resolve,
|
32106 | reject: reject,
|
32107 | timeout: setTimeout(function () {
|
32108 | if (_this2._commands[serialId]) {
|
32109 | var _context19;
|
32110 |
|
32111 | if (debug$4.enabled) debug$4('✗ %O timeout', trim(command));
|
32112 | reject(createError({
|
32113 | error: (0, _concat.default)(_context19 = "Command Timeout [cmd:".concat(command.cmd, " op:")).call(_context19, command.op, "]"),
|
32114 | name: 'COMMAND_TIMEOUT'
|
32115 | }));
|
32116 | delete _this2._commands[serialId];
|
32117 | }
|
32118 | }, COMMAND_TIMEOUT)
|
32119 | };
|
32120 | });
|
32121 | this._commands[serialId].promise = promise;
|
32122 | return _context.abrupt("return", promise);
|
32123 |
|
32124 | case 21:
|
32125 | case "end":
|
32126 | return _context.stop();
|
32127 | }
|
32128 | }
|
32129 | }, _callee, this);
|
32130 | }));
|
32131 |
|
32132 | function send(_x) {
|
32133 | return _send.apply(this, arguments);
|
32134 | }
|
32135 |
|
32136 | return send;
|
32137 | }();
|
32138 |
|
32139 | _proto.handleMessage = function handleMessage(msg) {
|
32140 | var message;
|
32141 |
|
32142 | try {
|
32143 | message = GenericCommand.decode(msg);
|
32144 | if (debug$4.enabled) debug$4('↓ %O received', trim(message));
|
32145 | } catch (e) {
|
32146 | console.warn('Decode message failed:', e.message, msg);
|
32147 | return;
|
32148 | }
|
32149 |
|
32150 | var serialId = message.i;
|
32151 |
|
32152 | if (serialId) {
|
32153 | if (this._commands[serialId]) {
|
32154 | clearTimeout(this._commands[serialId].timeout);
|
32155 |
|
32156 | if (message.cmd === CommandType.error) {
|
32157 | this._commands[serialId].reject(createError(message.errorMessage));
|
32158 | } else {
|
32159 | this._commands[serialId].resolve(message);
|
32160 | }
|
32161 |
|
32162 | delete this._commands[serialId];
|
32163 | } else {
|
32164 | console.warn("Unexpected command received with serialId [".concat(serialId, "],\n which have timed out or never been requested."));
|
32165 | }
|
32166 | } else {
|
32167 | switch (message.cmd) {
|
32168 | case CommandType.error:
|
32169 | {
|
32170 | this.emit(ERROR, createError(message.errorMessage));
|
32171 | return;
|
32172 | }
|
32173 |
|
32174 | case CommandType.goaway:
|
32175 | {
|
32176 | this.emit(EXPIRE);
|
32177 | return;
|
32178 | }
|
32179 |
|
32180 | default:
|
32181 | {
|
32182 | this.emit(MESSAGE, message);
|
32183 | }
|
32184 | }
|
32185 | }
|
32186 | };
|
32187 |
|
32188 | _proto.ping = function ping() {
|
32189 | return this.send(new GenericCommand({
|
32190 | cmd: CommandType.echo
|
32191 | }))["catch"](function (error) {
|
32192 | return debug$4('ping failed:', error);
|
32193 | });
|
32194 | };
|
32195 |
|
32196 | return Connection;
|
32197 | }(WebSocketPlus);
|
32198 |
|
32199 | var debug$5 = d('LC:request');
|
32200 |
|
32201 | var request = function request(_ref) {
|
32202 | var _ref$method = _ref.method,
|
32203 | method = _ref$method === void 0 ? 'GET' : _ref$method,
|
32204 | _url = _ref.url,
|
32205 | query = _ref.query,
|
32206 | headers = _ref.headers,
|
32207 | data = _ref.data,
|
32208 | time = _ref.timeout;
|
32209 | var url = _url;
|
32210 |
|
32211 | if (query) {
|
32212 | var _context20, _context21, _context23;
|
32213 |
|
32214 | var queryString = (0, _filter.default)(_context20 = (0, _map.default)(_context21 = (0, _keys.default)(query)).call(_context21, function (key) {
|
32215 | var _context22;
|
32216 |
|
32217 | var value = query[key];
|
32218 | if (value === undefined) return undefined;
|
32219 | var v = isPlainObject(value) ? (0, _stringify.default)(value) : value;
|
32220 | return (0, _concat.default)(_context22 = "".concat(encodeURIComponent(key), "=")).call(_context22, encodeURIComponent(v));
|
32221 | })).call(_context20, function (qs) {
|
32222 | return qs;
|
32223 | }).join('&');
|
32224 | url = (0, _concat.default)(_context23 = "".concat(url, "?")).call(_context23, queryString);
|
32225 | }
|
32226 |
|
32227 | debug$5('Req: %O %O %O', method, url, {
|
32228 | headers: headers,
|
32229 | data: data
|
32230 | });
|
32231 | var request = getAdapter('request');
|
32232 | var promise = request(url, {
|
32233 | method: method,
|
32234 | headers: headers,
|
32235 | data: data
|
32236 | }).then(function (response) {
|
32237 | if (response.ok === false) {
|
32238 | var error = createError(response.data);
|
32239 | error.response = response;
|
32240 | throw error;
|
32241 | }
|
32242 |
|
32243 | debug$5('Res: %O %O %O', url, response.status, response.data);
|
32244 | return response.data;
|
32245 | })["catch"](function (error) {
|
32246 | if (error.response) {
|
32247 | debug$5('Error: %O %O %O', url, error.response.status, error.response.data);
|
32248 | }
|
32249 |
|
32250 | throw error;
|
32251 | });
|
32252 | return time ? promiseTimeout.timeout(promise, time) : promise;
|
32253 | };
|
32254 |
|
32255 | var applyDecorators = function applyDecorators(decorators, target) {
|
32256 | if (decorators) {
|
32257 | decorators.forEach(function (decorator) {
|
32258 | try {
|
32259 | decorator(target);
|
32260 | } catch (error) {
|
32261 | if (decorator._pluginName) {
|
32262 | error.message += "[".concat(decorator._pluginName, "]");
|
32263 | }
|
32264 |
|
32265 | throw error;
|
32266 | }
|
32267 | });
|
32268 | }
|
32269 | };
|
32270 |
|
32271 | var applyDispatcher = function applyDispatcher(dispatchers, payload) {
|
32272 | var _context24;
|
32273 |
|
32274 | return (0, _reduce.default)(_context24 = ensureArray(dispatchers)).call(_context24, function (resultPromise, dispatcher) {
|
32275 | return resultPromise.then(function (shouldDispatch) {
|
32276 | return shouldDispatch === false ? false : dispatcher.apply(void 0, _toConsumableArray(payload));
|
32277 | })["catch"](function (error) {
|
32278 | if (dispatcher._pluginName) {
|
32279 |
|
32280 | error.message += "[".concat(dispatcher._pluginName, "]");
|
32281 | }
|
32282 |
|
32283 | throw error;
|
32284 | });
|
32285 | }, _promise.default.resolve(true));
|
32286 | };
|
32287 |
|
32288 | var version = "5.0.0-rc.8";
|
32289 | var _excluded = ["plugins"];
|
32290 |
|
32291 | function ownKeys$2(object, enumerableOnly) {
|
32292 | var keys = (0, _keys.default)(object);
|
32293 |
|
32294 | if (_getOwnPropertySymbols.default) {
|
32295 | var symbols = (0, _getOwnPropertySymbols.default)(object);
|
32296 | enumerableOnly && (symbols = (0, _filter.default)(symbols).call(symbols, function (sym) {
|
32297 | return (0, _getOwnPropertyDescriptor.default)(object, sym).enumerable;
|
32298 | })), keys.push.apply(keys, symbols);
|
32299 | }
|
32300 |
|
32301 | return keys;
|
32302 | }
|
32303 |
|
32304 | function _objectSpread$2(target) {
|
32305 | for (var i = 1; i < arguments.length; i++) {
|
32306 | var source = null != arguments[i] ? arguments[i] : {};
|
32307 | i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) {
|
32308 | _defineProperty(target, key, source[key]);
|
32309 | }) : _getOwnPropertyDescriptors.default ? (0, _defineProperties.default)(target, (0, _getOwnPropertyDescriptors.default)(source)) : ownKeys$2(Object(source)).forEach(function (key) {
|
32310 | (0, _defineProperty2.default)(target, key, (0, _getOwnPropertyDescriptor.default)(source, key));
|
32311 | });
|
32312 | }
|
32313 |
|
32314 | return target;
|
32315 | }
|
32316 |
|
32317 | var debug$6 = d('LC:Realtime');
|
32318 | var routerCache = new Cache('push-router');
|
32319 | var initializedApp = {};
|
32320 |
|
32321 | var Realtime = function (_EventEmitter) {
|
32322 | _inheritsLoose(Realtime, _EventEmitter);
|
32323 | |
32324 |
|
32325 |
|
32326 |
|
32327 |
|
32328 |
|
32329 |
|
32330 |
|
32331 |
|
32332 |
|
32333 |
|
32334 |
|
32335 |
|
32336 |
|
32337 | function Realtime(_ref) {
|
32338 | var _context25;
|
32339 |
|
32340 | var _this2;
|
32341 |
|
32342 | var plugins = _ref.plugins,
|
32343 | options = _objectWithoutProperties(_ref, _excluded);
|
32344 |
|
32345 | debug$6('initializing Realtime %s %O', version, options);
|
32346 | _this2 = _EventEmitter.call(this) || this;
|
32347 | var appId = options.appId;
|
32348 |
|
32349 | if (typeof appId !== 'string') {
|
32350 | throw new TypeError("appId [".concat(appId, "] is not a string"));
|
32351 | }
|
32352 |
|
32353 | if (initializedApp[appId]) {
|
32354 | throw new Error("App [".concat(appId, "] is already initialized."));
|
32355 | }
|
32356 |
|
32357 | initializedApp[appId] = true;
|
32358 |
|
32359 | if (typeof options.appKey !== 'string') {
|
32360 | throw new TypeError("appKey [".concat(options.appKey, "] is not a string"));
|
32361 | }
|
32362 |
|
32363 | if (isCNApp(appId)) {
|
32364 | if (!options.server) {
|
32365 | throw new TypeError("server option is required for apps from CN region");
|
32366 | }
|
32367 | }
|
32368 |
|
32369 | _this2._options = _objectSpread$2({
|
32370 | appId: undefined,
|
32371 | appKey: undefined,
|
32372 | noBinary: false,
|
32373 | ssl: true,
|
32374 | RTMServerName: typeof process !== 'undefined' ? process.env.RTM_SERVER_NAME : undefined
|
32375 | }, options);
|
32376 | _this2._cache = new Cache('endpoints');
|
32377 |
|
32378 | var _this = internal(_assertThisInitialized(_this2));
|
32379 |
|
32380 | _this.clients = new _set.default();
|
32381 | _this.pendingClients = new _set.default();
|
32382 | var mergedPlugins = (0, _concat.default)(_context25 = []).call(_context25, _toConsumableArray(ensureArray(Realtime.__preRegisteredPlugins)), _toConsumableArray(ensureArray(plugins)));
|
32383 | debug$6('Using plugins %o', (0, _map.default)(mergedPlugins).call(mergedPlugins, function (plugin) {
|
32384 | return plugin.name;
|
32385 | }));
|
32386 | _this2._plugins = (0, _reduce.default)(mergedPlugins).call(mergedPlugins, function (result, plugin) {
|
32387 | (0, _keys.default)(plugin).forEach(function (hook) {
|
32388 | if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') {
|
32389 | var _context26;
|
32390 |
|
32391 | if (plugin.name) {
|
32392 | ensureArray(plugin[hook]).forEach(function (value) {
|
32393 |
|
32394 | value._pluginName = plugin.name;
|
32395 | });
|
32396 | }
|
32397 |
|
32398 |
|
32399 | result[hook] = (0, _concat.default)(_context26 = ensureArray(result[hook])).call(_context26, plugin[hook]);
|
32400 | }
|
32401 | });
|
32402 | return result;
|
32403 | }, {});
|
32404 |
|
32405 | applyDecorators(_this2._plugins.onRealtimeCreate, _assertThisInitialized(_this2));
|
32406 | return _this2;
|
32407 | }
|
32408 |
|
32409 | var _proto = Realtime.prototype;
|
32410 |
|
32411 | _proto._request = function () {
|
32412 | var _request2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(_ref2) {
|
32413 | var method, _url, _ref2$version, version, path, query, headers, data, url, _this$_options, appId, server, _yield$this$construct, api;
|
32414 |
|
32415 | return _regeneratorRuntime.wrap(function _callee$(_context) {
|
32416 | var _context27, _context28;
|
32417 |
|
32418 | while (1) {
|
32419 | switch (_context.prev = _context.next) {
|
32420 | case 0:
|
32421 | 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;
|
32422 | url = _url;
|
32423 |
|
32424 | if (url) {
|
32425 | _context.next = 9;
|
32426 | break;
|
32427 | }
|
32428 |
|
32429 | _this$_options = this._options, appId = _this$_options.appId, server = _this$_options.server;
|
32430 | _context.next = 6;
|
32431 | return this.constructor._getServerUrls({
|
32432 | appId: appId,
|
32433 | server: server
|
32434 | });
|
32435 |
|
32436 | case 6:
|
32437 | _yield$this$construct = _context.sent;
|
32438 | api = _yield$this$construct.api;
|
32439 | url = (0, _concat.default)(_context27 = (0, _concat.default)(_context28 = "".concat(api, "/")).call(_context28, version)).call(_context27, path);
|
32440 |
|
32441 | case 9:
|
32442 | return _context.abrupt("return", request({
|
32443 | url: url,
|
32444 | method: method,
|
32445 | query: query,
|
32446 | headers: _objectSpread$2({
|
32447 | 'X-LC-Id': this._options.appId,
|
32448 | 'X-LC-Key': this._options.appKey
|
32449 | }, headers),
|
32450 | data: data
|
32451 | }));
|
32452 |
|
32453 | case 10:
|
32454 | case "end":
|
32455 | return _context.stop();
|
32456 | }
|
32457 | }
|
32458 | }, _callee, this);
|
32459 | }));
|
32460 |
|
32461 | function _request(_x) {
|
32462 | return _request2.apply(this, arguments);
|
32463 | }
|
32464 |
|
32465 | return _request;
|
32466 | }();
|
32467 |
|
32468 | _proto._open = function _open() {
|
32469 | var _this3 = this;
|
32470 |
|
32471 | if (this._openPromise) return this._openPromise;
|
32472 | var format = 'protobuf2';
|
32473 |
|
32474 | if (this._options.noBinary) {
|
32475 |
|
32476 | format = 'proto2base64';
|
32477 | }
|
32478 |
|
32479 | var version = 3;
|
32480 | var protocol = {
|
32481 | format: format,
|
32482 | version: version
|
32483 | };
|
32484 | this._openPromise = new _promise.default(function (resolve, reject) {
|
32485 | debug$6('No connection established, create a new one.');
|
32486 | var connection = new Connection(function () {
|
32487 | return _this3._getRTMServers(_this3._options);
|
32488 | }, protocol);
|
32489 | connection.on(OPEN, function () {
|
32490 | return resolve(connection);
|
32491 | }).on(ERROR, function (error) {
|
32492 | delete _this3._openPromise;
|
32493 | reject(error);
|
32494 | }).on(EXPIRE, _asyncToGenerator( _regeneratorRuntime.mark(function _callee2() {
|
32495 | return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
32496 | while (1) {
|
32497 | switch (_context2.prev = _context2.next) {
|
32498 | case 0:
|
32499 | debug$6('Connection expired. Refresh endpoints.');
|
32500 |
|
32501 | _this3._cache.set('endpoints', null, 0);
|
32502 |
|
32503 | _context2.next = 4;
|
32504 | return _this3._getRTMServers(_this3._options);
|
32505 |
|
32506 | case 4:
|
32507 | connection.urls = _context2.sent;
|
32508 | connection.disconnect();
|
32509 |
|
32510 | case 6:
|
32511 | case "end":
|
32512 | return _context2.stop();
|
32513 | }
|
32514 | }
|
32515 | }, _callee2);
|
32516 | }))).on(MESSAGE, _this3._dispatchCommand.bind(_this3));
|
32517 | |
32518 |
|
32519 |
|
32520 |
|
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 | [DISCONNECT, RECONNECT, RETRY, SCHEDULE, OFFLINE, ONLINE].forEach(function (event) {
|
32595 | return connection.on(event, function () {
|
32596 | var _context29;
|
32597 |
|
32598 | for (var _len = arguments.length, payload = new Array(_len), _key = 0; _key < _len; _key++) {
|
32599 | payload[_key] = arguments[_key];
|
32600 | }
|
32601 |
|
32602 | debug$6("".concat(event, " event emitted. %o"), payload);
|
32603 |
|
32604 | _this3.emit.apply(_this3, (0, _concat.default)(_context29 = [event]).call(_context29, payload));
|
32605 |
|
32606 | if (event !== RECONNECT) {
|
32607 | internal(_this3).clients.forEach(function (client) {
|
32608 | var _context30;
|
32609 |
|
32610 | client.emit.apply(client, (0, _concat.default)(_context30 = [event]).call(_context30, payload));
|
32611 | });
|
32612 | }
|
32613 | });
|
32614 | });
|
32615 |
|
32616 | connection.handleClose = function handleClose(event) {
|
32617 | var isFatal = [ErrorCode.APP_NOT_AVAILABLE, ErrorCode.INVALID_LOGIN, ErrorCode.INVALID_ORIGIN].some(function (errorCode) {
|
32618 | return errorCode === event.code;
|
32619 | });
|
32620 |
|
32621 | if (isFatal) {
|
32622 |
|
32623 | this["throw"](createError(event));
|
32624 | } else {
|
32625 |
|
32626 | this.disconnect();
|
32627 | }
|
32628 | };
|
32629 |
|
32630 | internal(_this3).connection = connection;
|
32631 | });
|
32632 | return this._openPromise;
|
32633 | };
|
32634 |
|
32635 | _proto._getRTMServers = function () {
|
32636 | var _getRTMServers2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee3(options) {
|
32637 | var info, cachedEndPoints, _info, server, secondary, ttl;
|
32638 |
|
32639 | return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
32640 | while (1) {
|
32641 | switch (_context3.prev = _context3.next) {
|
32642 | case 0:
|
32643 | if (!options.RTMServers) {
|
32644 | _context3.next = 2;
|
32645 | break;
|
32646 | }
|
32647 |
|
32648 | return _context3.abrupt("return", shuffle(ensureArray(options.RTMServers)));
|
32649 |
|
32650 | case 2:
|
32651 | cachedEndPoints = this._cache.get('endpoints');
|
32652 |
|
32653 | if (!cachedEndPoints) {
|
32654 | _context3.next = 7;
|
32655 | break;
|
32656 | }
|
32657 |
|
32658 | info = cachedEndPoints;
|
32659 | _context3.next = 14;
|
32660 | break;
|
32661 |
|
32662 | case 7:
|
32663 | _context3.next = 9;
|
32664 | return this.constructor._fetchRTMServers(options);
|
32665 |
|
32666 | case 9:
|
32667 | info = _context3.sent;
|
32668 | _info = info, server = _info.server, secondary = _info.secondary, ttl = _info.ttl;
|
32669 |
|
32670 | if (!(typeof server !== 'string' && typeof secondary !== 'string' && typeof ttl !== 'number')) {
|
32671 | _context3.next = 13;
|
32672 | break;
|
32673 | }
|
32674 |
|
32675 | throw new Error("malformed RTM route response: ".concat((0, _stringify.default)(info)));
|
32676 |
|
32677 | case 13:
|
32678 | this._cache.set('endpoints', info, info.ttl * 1000);
|
32679 |
|
32680 | case 14:
|
32681 | debug$6('endpoint info: %O', info);
|
32682 | return _context3.abrupt("return", [info.server, info.secondary]);
|
32683 |
|
32684 | case 16:
|
32685 | case "end":
|
32686 | return _context3.stop();
|
32687 | }
|
32688 | }
|
32689 | }, _callee3, this);
|
32690 | }));
|
32691 |
|
32692 | function _getRTMServers(_x2) {
|
32693 | return _getRTMServers2.apply(this, arguments);
|
32694 | }
|
32695 |
|
32696 | return _getRTMServers;
|
32697 | }();
|
32698 |
|
32699 | Realtime._getServerUrls = function () {
|
32700 | var _getServerUrls2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee4(_ref4) {
|
32701 | var appId, server, cachedRouter, defaultProtocol;
|
32702 | return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
32703 | while (1) {
|
32704 | switch (_context4.prev = _context4.next) {
|
32705 | case 0:
|
32706 | appId = _ref4.appId, server = _ref4.server;
|
32707 | debug$6('fetch server urls');
|
32708 |
|
32709 | if (!server) {
|
32710 | _context4.next = 6;
|
32711 | break;
|
32712 | }
|
32713 |
|
32714 | if (!(typeof server !== 'string')) {
|
32715 | _context4.next = 5;
|
32716 | break;
|
32717 | }
|
32718 |
|
32719 | return _context4.abrupt("return", server);
|
32720 |
|
32721 | case 5:
|
32722 | return _context4.abrupt("return", {
|
32723 | RTMRouter: server,
|
32724 | api: server
|
32725 | });
|
32726 |
|
32727 | case 6:
|
32728 | cachedRouter = routerCache.get(appId);
|
32729 |
|
32730 | if (!cachedRouter) {
|
32731 | _context4.next = 9;
|
32732 | break;
|
32733 | }
|
32734 |
|
32735 | return _context4.abrupt("return", cachedRouter);
|
32736 |
|
32737 | case 9:
|
32738 | defaultProtocol = 'https://';
|
32739 | return _context4.abrupt("return", request({
|
32740 | url: 'https://app-router.com/2/route',
|
32741 | query: {
|
32742 | appId: appId
|
32743 | },
|
32744 | timeout: 20000
|
32745 | }).then(tap(debug$6)).then(function (_ref5) {
|
32746 | var _context31, _context32;
|
32747 |
|
32748 | var RTMRouterServer = _ref5.rtm_router_server,
|
32749 | APIServer = _ref5.api_server,
|
32750 | _ref5$ttl = _ref5.ttl,
|
32751 | ttl = _ref5$ttl === void 0 ? 3600 : _ref5$ttl;
|
32752 |
|
32753 | if (!RTMRouterServer) {
|
32754 | throw new Error('rtm router not exists');
|
32755 | }
|
32756 |
|
32757 | var serverUrls = {
|
32758 | RTMRouter: (0, _concat.default)(_context31 = "".concat(defaultProtocol)).call(_context31, RTMRouterServer),
|
32759 | api: (0, _concat.default)(_context32 = "".concat(defaultProtocol)).call(_context32, APIServer)
|
32760 | };
|
32761 | routerCache.set(appId, serverUrls, ttl * 1000);
|
32762 | return serverUrls;
|
32763 | })["catch"](function () {
|
32764 | var _context33, _context34, _context35, _context36;
|
32765 |
|
32766 | var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
|
32767 | var domain = 'lncldglobal.com';
|
32768 | return {
|
32769 | RTMRouter: (0, _concat.default)(_context33 = (0, _concat.default)(_context34 = "".concat(defaultProtocol)).call(_context34, id, ".rtm.")).call(_context33, domain),
|
32770 | api: (0, _concat.default)(_context35 = (0, _concat.default)(_context36 = "".concat(defaultProtocol)).call(_context36, id, ".api.")).call(_context35, domain)
|
32771 | };
|
32772 | }));
|
32773 |
|
32774 | case 11:
|
32775 | case "end":
|
32776 | return _context4.stop();
|
32777 | }
|
32778 | }
|
32779 | }, _callee4);
|
32780 | }));
|
32781 |
|
32782 | function _getServerUrls(_x3) {
|
32783 | return _getServerUrls2.apply(this, arguments);
|
32784 | }
|
32785 |
|
32786 | return _getServerUrls;
|
32787 | }();
|
32788 |
|
32789 | Realtime._fetchRTMServers = function _fetchRTMServers(_ref6) {
|
32790 | var appId = _ref6.appId,
|
32791 | ssl = _ref6.ssl,
|
32792 | server = _ref6.server,
|
32793 | RTMServerName = _ref6.RTMServerName;
|
32794 | debug$6('fetch endpoint info');
|
32795 | return this._getServerUrls({
|
32796 | appId: appId,
|
32797 | server: server
|
32798 | }).then(tap(debug$6)).then(function (_ref7) {
|
32799 | var RTMRouter = _ref7.RTMRouter;
|
32800 | return request({
|
32801 | url: "".concat(RTMRouter, "/v1/route"),
|
32802 | query: {
|
32803 | appId: appId,
|
32804 | secure: ssl,
|
32805 | features: isWeapp ? 'wechat' : undefined,
|
32806 | server: RTMServerName,
|
32807 | _t: Date.now()
|
32808 | },
|
32809 | timeout: 20000
|
32810 | }).then(tap(debug$6));
|
32811 | });
|
32812 | };
|
32813 |
|
32814 | _proto._close = function _close() {
|
32815 | if (this._openPromise) {
|
32816 | this._openPromise.then(function (connection) {
|
32817 | return connection.close();
|
32818 | });
|
32819 | }
|
32820 |
|
32821 | delete this._openPromise;
|
32822 | }
|
32823 | |
32824 |
|
32825 |
|
32826 |
|
32827 |
|
32828 | ;
|
32829 |
|
32830 | _proto.retry = function retry() {
|
32831 | var _internal = internal(this),
|
32832 | connection = _internal.connection;
|
32833 |
|
32834 | if (!connection) {
|
32835 | throw new Error('no connection established');
|
32836 | }
|
32837 |
|
32838 | if (connection.cannot('retry')) {
|
32839 | throw new Error("retrying not allowed when not disconnected. the connection is now ".concat(connection.current));
|
32840 | }
|
32841 |
|
32842 | return connection.retry();
|
32843 | }
|
32844 | |
32845 |
|
32846 |
|
32847 |
|
32848 |
|
32849 |
|
32850 |
|
32851 |
|
32852 | ;
|
32853 |
|
32854 | _proto.pause = function pause() {
|
32855 |
|
32856 |
|
32857 | var _internal2 = internal(this),
|
32858 | connection = _internal2.connection;
|
32859 |
|
32860 | if (!connection) return;
|
32861 | if (connection.can('pause')) connection.pause();
|
32862 | }
|
32863 | |
32864 |
|
32865 |
|
32866 |
|
32867 |
|
32868 |
|
32869 |
|
32870 | ;
|
32871 |
|
32872 | _proto.resume = function resume() {
|
32873 |
|
32874 | var _internal3 = internal(this),
|
32875 | connection = _internal3.connection;
|
32876 |
|
32877 | if (!connection) return;
|
32878 | if (connection.can('resume')) connection.resume();
|
32879 | };
|
32880 |
|
32881 | _proto._registerPending = function _registerPending(value) {
|
32882 | internal(this).pendingClients.add(value);
|
32883 | };
|
32884 |
|
32885 | _proto._deregisterPending = function _deregisterPending(client) {
|
32886 | internal(this).pendingClients["delete"](client);
|
32887 | };
|
32888 |
|
32889 | _proto._register = function _register(client) {
|
32890 | internal(this).clients.add(client);
|
32891 | };
|
32892 |
|
32893 | _proto._deregister = function _deregister(client) {
|
32894 | var _this = internal(this);
|
32895 |
|
32896 | _this.clients["delete"](client);
|
32897 |
|
32898 | if (_this.clients.size + _this.pendingClients.size === 0) {
|
32899 | this._close();
|
32900 | }
|
32901 | };
|
32902 |
|
32903 | _proto._dispatchCommand = function _dispatchCommand(command) {
|
32904 | return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this]).then(function (shouldDispatch) {
|
32905 |
|
32906 | if (shouldDispatch) return debug$6('[WARN] Unexpected message received: %O', trim(command));
|
32907 | return false;
|
32908 | });
|
32909 | };
|
32910 |
|
32911 | return Realtime;
|
32912 | }(EventEmitter);
|
32913 |
|
32914 |
|
32915 | var polyfilledPromise = _promise.default;
|
32916 | exports.EventEmitter = EventEmitter;
|
32917 | exports.Promise = polyfilledPromise;
|
32918 | exports.Protocals = message;
|
32919 | exports.Protocols = message;
|
32920 | exports.Realtime = Realtime;
|
32921 | exports.debug = debug$2;
|
32922 | exports.getAdapter = getAdapter;
|
32923 | exports.setAdapters = setAdapters;
|
32924 | }.call(exports, __webpack_require__(78)))
|
32925 |
|
32926 | }),
|
32927 |
|
32928 | (function(module, exports, __webpack_require__) {
|
32929 |
|
32930 | module.exports = __webpack_require__(625);
|
32931 |
|
32932 | }),
|
32933 |
|
32934 | (function(module, exports, __webpack_require__) {
|
32935 |
|
32936 | var parent = __webpack_require__(626);
|
32937 |
|
32938 | module.exports = parent;
|
32939 |
|
32940 |
|
32941 | }),
|
32942 |
|
32943 | (function(module, exports, __webpack_require__) {
|
32944 |
|
32945 | __webpack_require__(627);
|
32946 | var path = __webpack_require__(7);
|
32947 |
|
32948 | module.exports = path.Object.freeze;
|
32949 |
|
32950 |
|
32951 | }),
|
32952 |
|
32953 | (function(module, exports, __webpack_require__) {
|
32954 |
|
32955 | var $ = __webpack_require__(0);
|
32956 | var FREEZING = __webpack_require__(264);
|
32957 | var fails = __webpack_require__(2);
|
32958 | var isObject = __webpack_require__(11);
|
32959 | var onFreeze = __webpack_require__(97).onFreeze;
|
32960 |
|
32961 |
|
32962 | var $freeze = Object.freeze;
|
32963 | var FAILS_ON_PRIMITIVES = fails(function () { $freeze(1); });
|
32964 |
|
32965 |
|
32966 |
|
32967 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
32968 | freeze: function freeze(it) {
|
32969 | return $freeze && isObject(it) ? $freeze(onFreeze(it)) : it;
|
32970 | }
|
32971 | });
|
32972 |
|
32973 |
|
32974 | }),
|
32975 |
|
32976 | (function(module, exports, __webpack_require__) {
|
32977 |
|
32978 |
|
32979 | var fails = __webpack_require__(2);
|
32980 |
|
32981 | module.exports = fails(function () {
|
32982 | if (typeof ArrayBuffer == 'function') {
|
32983 | var buffer = new ArrayBuffer(8);
|
32984 |
|
32985 | if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
|
32986 | }
|
32987 | });
|
32988 |
|
32989 |
|
32990 | }),
|
32991 |
|
32992 | (function(module, exports, __webpack_require__) {
|
32993 |
|
32994 | var parent = __webpack_require__(630);
|
32995 |
|
32996 | module.exports = parent;
|
32997 |
|
32998 |
|
32999 | }),
|
33000 |
|
33001 | (function(module, exports, __webpack_require__) {
|
33002 |
|
33003 | __webpack_require__(631);
|
33004 | var path = __webpack_require__(7);
|
33005 |
|
33006 | module.exports = path.Object.assign;
|
33007 |
|
33008 |
|
33009 | }),
|
33010 |
|
33011 | (function(module, exports, __webpack_require__) {
|
33012 |
|
33013 | var $ = __webpack_require__(0);
|
33014 | var assign = __webpack_require__(632);
|
33015 |
|
33016 |
|
33017 |
|
33018 |
|
33019 | $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
33020 | assign: assign
|
33021 | });
|
33022 |
|
33023 |
|
33024 | }),
|
33025 |
|
33026 | (function(module, exports, __webpack_require__) {
|
33027 |
|
33028 | "use strict";
|
33029 |
|
33030 | var DESCRIPTORS = __webpack_require__(14);
|
33031 | var uncurryThis = __webpack_require__(4);
|
33032 | var call = __webpack_require__(15);
|
33033 | var fails = __webpack_require__(2);
|
33034 | var objectKeys = __webpack_require__(107);
|
33035 | var getOwnPropertySymbolsModule = __webpack_require__(106);
|
33036 | var propertyIsEnumerableModule = __webpack_require__(122);
|
33037 | var toObject = __webpack_require__(33);
|
33038 | var IndexedObject = __webpack_require__(98);
|
33039 |
|
33040 |
|
33041 | var $assign = Object.assign;
|
33042 |
|
33043 | var defineProperty = Object.defineProperty;
|
33044 | var concat = uncurryThis([].concat);
|
33045 |
|
33046 |
|
33047 |
|
33048 | module.exports = !$assign || fails(function () {
|
33049 |
|
33050 | if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
33051 | enumerable: true,
|
33052 | get: function () {
|
33053 | defineProperty(this, 'b', {
|
33054 | value: 3,
|
33055 | enumerable: false
|
33056 | });
|
33057 | }
|
33058 | }), { b: 2 })).b !== 1) return true;
|
33059 |
|
33060 | var A = {};
|
33061 | var B = {};
|
33062 |
|
33063 | var symbol = Symbol();
|
33064 | var alphabet = 'abcdefghijklmnopqrst';
|
33065 | A[symbol] = 7;
|
33066 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
33067 | return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
|
33068 | }) ? function assign(target, source) {
|
33069 | var T = toObject(target);
|
33070 | var argumentsLength = arguments.length;
|
33071 | var index = 1;
|
33072 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
33073 | var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
33074 | while (argumentsLength > index) {
|
33075 | var S = IndexedObject(arguments[index++]);
|
33076 | var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
|
33077 | var length = keys.length;
|
33078 | var j = 0;
|
33079 | var key;
|
33080 | while (length > j) {
|
33081 | key = keys[j++];
|
33082 | if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
|
33083 | }
|
33084 | } return T;
|
33085 | } : $assign;
|
33086 |
|
33087 |
|
33088 | }),
|
33089 |
|
33090 | (function(module, exports, __webpack_require__) {
|
33091 |
|
33092 | var parent = __webpack_require__(634);
|
33093 |
|
33094 | module.exports = parent;
|
33095 |
|
33096 |
|
33097 | }),
|
33098 |
|
33099 | (function(module, exports, __webpack_require__) {
|
33100 |
|
33101 | __webpack_require__(243);
|
33102 | var path = __webpack_require__(7);
|
33103 |
|
33104 | module.exports = path.Object.getOwnPropertySymbols;
|
33105 |
|
33106 |
|
33107 | }),
|
33108 |
|
33109 | (function(module, exports, __webpack_require__) {
|
33110 |
|
33111 | module.exports = __webpack_require__(636);
|
33112 |
|
33113 | }),
|
33114 |
|
33115 | (function(module, exports, __webpack_require__) {
|
33116 |
|
33117 | var parent = __webpack_require__(637);
|
33118 |
|
33119 | module.exports = parent;
|
33120 |
|
33121 |
|
33122 | }),
|
33123 |
|
33124 | (function(module, exports, __webpack_require__) {
|
33125 |
|
33126 | __webpack_require__(638);
|
33127 | var path = __webpack_require__(7);
|
33128 |
|
33129 | module.exports = path.Object.getOwnPropertyDescriptors;
|
33130 |
|
33131 |
|
33132 | }),
|
33133 |
|
33134 | (function(module, exports, __webpack_require__) {
|
33135 |
|
33136 | var $ = __webpack_require__(0);
|
33137 | var DESCRIPTORS = __webpack_require__(14);
|
33138 | var ownKeys = __webpack_require__(163);
|
33139 | var toIndexedObject = __webpack_require__(35);
|
33140 | var getOwnPropertyDescriptorModule = __webpack_require__(64);
|
33141 | var createProperty = __webpack_require__(93);
|
33142 |
|
33143 |
|
33144 |
|
33145 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
33146 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
33147 | var O = toIndexedObject(object);
|
33148 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
33149 | var keys = ownKeys(O);
|
33150 | var result = {};
|
33151 | var index = 0;
|
33152 | var key, descriptor;
|
33153 | while (keys.length > index) {
|
33154 | descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
|
33155 | if (descriptor !== undefined) createProperty(result, key, descriptor);
|
33156 | }
|
33157 | return result;
|
33158 | }
|
33159 | });
|
33160 |
|
33161 |
|
33162 | }),
|
33163 |
|
33164 | (function(module, exports, __webpack_require__) {
|
33165 |
|
33166 | module.exports = __webpack_require__(640);
|
33167 |
|
33168 | }),
|
33169 |
|
33170 | (function(module, exports, __webpack_require__) {
|
33171 |
|
33172 | var parent = __webpack_require__(641);
|
33173 |
|
33174 | module.exports = parent;
|
33175 |
|
33176 |
|
33177 | }),
|
33178 |
|
33179 | (function(module, exports, __webpack_require__) {
|
33180 |
|
33181 | __webpack_require__(642);
|
33182 | var path = __webpack_require__(7);
|
33183 |
|
33184 | var Object = path.Object;
|
33185 |
|
33186 | var defineProperties = module.exports = function defineProperties(T, D) {
|
33187 | return Object.defineProperties(T, D);
|
33188 | };
|
33189 |
|
33190 | if (Object.defineProperties.sham) defineProperties.sham = true;
|
33191 |
|
33192 |
|
33193 | }),
|
33194 |
|
33195 | (function(module, exports, __webpack_require__) {
|
33196 |
|
33197 | var $ = __webpack_require__(0);
|
33198 | var DESCRIPTORS = __webpack_require__(14);
|
33199 | var defineProperties = __webpack_require__(130).f;
|
33200 |
|
33201 |
|
33202 |
|
33203 |
|
33204 | $({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS }, {
|
33205 | defineProperties: defineProperties
|
33206 | });
|
33207 |
|
33208 |
|
33209 | }),
|
33210 |
|
33211 | (function(module, exports, __webpack_require__) {
|
33212 |
|
33213 | module.exports = __webpack_require__(644);
|
33214 |
|
33215 | }),
|
33216 |
|
33217 | (function(module, exports, __webpack_require__) {
|
33218 |
|
33219 | var parent = __webpack_require__(645);
|
33220 | __webpack_require__(46);
|
33221 |
|
33222 | module.exports = parent;
|
33223 |
|
33224 |
|
33225 | }),
|
33226 |
|
33227 | (function(module, exports, __webpack_require__) {
|
33228 |
|
33229 | __webpack_require__(43);
|
33230 | __webpack_require__(68);
|
33231 | __webpack_require__(646);
|
33232 | var path = __webpack_require__(7);
|
33233 |
|
33234 | module.exports = path.WeakMap;
|
33235 |
|
33236 |
|
33237 | }),
|
33238 |
|
33239 | (function(module, exports, __webpack_require__) {
|
33240 |
|
33241 |
|
33242 | __webpack_require__(647);
|
33243 |
|
33244 |
|
33245 | }),
|
33246 |
|
33247 | (function(module, exports, __webpack_require__) {
|
33248 |
|
33249 | "use strict";
|
33250 |
|
33251 | var global = __webpack_require__(8);
|
33252 | var uncurryThis = __webpack_require__(4);
|
33253 | var defineBuiltIns = __webpack_require__(157);
|
33254 | var InternalMetadataModule = __webpack_require__(97);
|
33255 | var collection = __webpack_require__(268);
|
33256 | var collectionWeak = __webpack_require__(648);
|
33257 | var isObject = __webpack_require__(11);
|
33258 | var isExtensible = __webpack_require__(265);
|
33259 | var enforceInternalState = __webpack_require__(44).enforce;
|
33260 | var NATIVE_WEAK_MAP = __webpack_require__(169);
|
33261 |
|
33262 | var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
|
33263 | var InternalWeakMap;
|
33264 |
|
33265 | var wrapper = function (init) {
|
33266 | return function WeakMap() {
|
33267 | return init(this, arguments.length ? arguments[0] : undefined);
|
33268 | };
|
33269 | };
|
33270 |
|
33271 |
|
33272 |
|
33273 | var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
|
33274 |
|
33275 |
|
33276 |
|
33277 |
|
33278 | if (NATIVE_WEAK_MAP && IS_IE11) {
|
33279 | InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
|
33280 | InternalMetadataModule.enable();
|
33281 | var WeakMapPrototype = $WeakMap.prototype;
|
33282 | var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
|
33283 | var nativeHas = uncurryThis(WeakMapPrototype.has);
|
33284 | var nativeGet = uncurryThis(WeakMapPrototype.get);
|
33285 | var nativeSet = uncurryThis(WeakMapPrototype.set);
|
33286 | defineBuiltIns(WeakMapPrototype, {
|
33287 | 'delete': function (key) {
|
33288 | if (isObject(key) && !isExtensible(key)) {
|
33289 | var state = enforceInternalState(this);
|
33290 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
33291 | return nativeDelete(this, key) || state.frozen['delete'](key);
|
33292 | } return nativeDelete(this, key);
|
33293 | },
|
33294 | has: function has(key) {
|
33295 | if (isObject(key) && !isExtensible(key)) {
|
33296 | var state = enforceInternalState(this);
|
33297 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
33298 | return nativeHas(this, key) || state.frozen.has(key);
|
33299 | } return nativeHas(this, key);
|
33300 | },
|
33301 | get: function get(key) {
|
33302 | if (isObject(key) && !isExtensible(key)) {
|
33303 | var state = enforceInternalState(this);
|
33304 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
33305 | return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
|
33306 | } return nativeGet(this, key);
|
33307 | },
|
33308 | set: function set(key, value) {
|
33309 | if (isObject(key) && !isExtensible(key)) {
|
33310 | var state = enforceInternalState(this);
|
33311 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
33312 | nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
|
33313 | } else nativeSet(this, key, value);
|
33314 | return this;
|
33315 | }
|
33316 | });
|
33317 | }
|
33318 |
|
33319 |
|
33320 | }),
|
33321 |
|
33322 | (function(module, exports, __webpack_require__) {
|
33323 |
|
33324 | "use strict";
|
33325 |
|
33326 | var uncurryThis = __webpack_require__(4);
|
33327 | var defineBuiltIns = __webpack_require__(157);
|
33328 | var getWeakData = __webpack_require__(97).getWeakData;
|
33329 | var anObject = __webpack_require__(21);
|
33330 | var isObject = __webpack_require__(11);
|
33331 | var anInstance = __webpack_require__(110);
|
33332 | var iterate = __webpack_require__(41);
|
33333 | var ArrayIterationModule = __webpack_require__(75);
|
33334 | var hasOwn = __webpack_require__(13);
|
33335 | var InternalStateModule = __webpack_require__(44);
|
33336 |
|
33337 | var setInternalState = InternalStateModule.set;
|
33338 | var internalStateGetterFor = InternalStateModule.getterFor;
|
33339 | var find = ArrayIterationModule.find;
|
33340 | var findIndex = ArrayIterationModule.findIndex;
|
33341 | var splice = uncurryThis([].splice);
|
33342 | var id = 0;
|
33343 |
|
33344 |
|
33345 | var uncaughtFrozenStore = function (store) {
|
33346 | return store.frozen || (store.frozen = new UncaughtFrozenStore());
|
33347 | };
|
33348 |
|
33349 | var UncaughtFrozenStore = function () {
|
33350 | this.entries = [];
|
33351 | };
|
33352 |
|
33353 | var findUncaughtFrozen = function (store, key) {
|
33354 | return find(store.entries, function (it) {
|
33355 | return it[0] === key;
|
33356 | });
|
33357 | };
|
33358 |
|
33359 | UncaughtFrozenStore.prototype = {
|
33360 | get: function (key) {
|
33361 | var entry = findUncaughtFrozen(this, key);
|
33362 | if (entry) return entry[1];
|
33363 | },
|
33364 | has: function (key) {
|
33365 | return !!findUncaughtFrozen(this, key);
|
33366 | },
|
33367 | set: function (key, value) {
|
33368 | var entry = findUncaughtFrozen(this, key);
|
33369 | if (entry) entry[1] = value;
|
33370 | else this.entries.push([key, value]);
|
33371 | },
|
33372 | 'delete': function (key) {
|
33373 | var index = findIndex(this.entries, function (it) {
|
33374 | return it[0] === key;
|
33375 | });
|
33376 | if (~index) splice(this.entries, index, 1);
|
33377 | return !!~index;
|
33378 | }
|
33379 | };
|
33380 |
|
33381 | module.exports = {
|
33382 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
33383 | var Constructor = wrapper(function (that, iterable) {
|
33384 | anInstance(that, Prototype);
|
33385 | setInternalState(that, {
|
33386 | type: CONSTRUCTOR_NAME,
|
33387 | id: id++,
|
33388 | frozen: undefined
|
33389 | });
|
33390 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
33391 | });
|
33392 |
|
33393 | var Prototype = Constructor.prototype;
|
33394 |
|
33395 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
33396 |
|
33397 | var define = function (that, key, value) {
|
33398 | var state = getInternalState(that);
|
33399 | var data = getWeakData(anObject(key), true);
|
33400 | if (data === true) uncaughtFrozenStore(state).set(key, value);
|
33401 | else data[state.id] = value;
|
33402 | return that;
|
33403 | };
|
33404 |
|
33405 | defineBuiltIns(Prototype, {
|
33406 |
|
33407 |
|
33408 |
|
33409 | 'delete': function (key) {
|
33410 | var state = getInternalState(this);
|
33411 | if (!isObject(key)) return false;
|
33412 | var data = getWeakData(key);
|
33413 | if (data === true) return uncaughtFrozenStore(state)['delete'](key);
|
33414 | return data && hasOwn(data, state.id) && delete data[state.id];
|
33415 | },
|
33416 |
|
33417 |
|
33418 |
|
33419 | has: function has(key) {
|
33420 | var state = getInternalState(this);
|
33421 | if (!isObject(key)) return false;
|
33422 | var data = getWeakData(key);
|
33423 | if (data === true) return uncaughtFrozenStore(state).has(key);
|
33424 | return data && hasOwn(data, state.id);
|
33425 | }
|
33426 | });
|
33427 |
|
33428 | defineBuiltIns(Prototype, IS_MAP ? {
|
33429 |
|
33430 |
|
33431 | get: function get(key) {
|
33432 | var state = getInternalState(this);
|
33433 | if (isObject(key)) {
|
33434 | var data = getWeakData(key);
|
33435 | if (data === true) return uncaughtFrozenStore(state).get(key);
|
33436 | return data ? data[state.id] : undefined;
|
33437 | }
|
33438 | },
|
33439 |
|
33440 |
|
33441 | set: function set(key, value) {
|
33442 | return define(this, key, value);
|
33443 | }
|
33444 | } : {
|
33445 |
|
33446 |
|
33447 | add: function add(value) {
|
33448 | return define(this, value, true);
|
33449 | }
|
33450 | });
|
33451 |
|
33452 | return Constructor;
|
33453 | }
|
33454 | };
|
33455 |
|
33456 |
|
33457 | }),
|
33458 |
|
33459 | (function(module, exports, __webpack_require__) {
|
33460 |
|
33461 | var parent = __webpack_require__(650);
|
33462 | __webpack_require__(46);
|
33463 |
|
33464 | module.exports = parent;
|
33465 |
|
33466 |
|
33467 | }),
|
33468 |
|
33469 | (function(module, exports, __webpack_require__) {
|
33470 |
|
33471 | __webpack_require__(43);
|
33472 | __webpack_require__(68);
|
33473 | __webpack_require__(651);
|
33474 | __webpack_require__(70);
|
33475 | var path = __webpack_require__(7);
|
33476 |
|
33477 | module.exports = path.Set;
|
33478 |
|
33479 |
|
33480 | }),
|
33481 |
|
33482 | (function(module, exports, __webpack_require__) {
|
33483 |
|
33484 |
|
33485 | __webpack_require__(652);
|
33486 |
|
33487 |
|
33488 | }),
|
33489 |
|
33490 | (function(module, exports, __webpack_require__) {
|
33491 |
|
33492 | "use strict";
|
33493 |
|
33494 | var collection = __webpack_require__(268);
|
33495 | var collectionStrong = __webpack_require__(653);
|
33496 |
|
33497 |
|
33498 |
|
33499 | collection('Set', function (init) {
|
33500 | return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
|
33501 | }, collectionStrong);
|
33502 |
|
33503 |
|
33504 | }),
|
33505 |
|
33506 | (function(module, exports, __webpack_require__) {
|
33507 |
|
33508 | "use strict";
|
33509 |
|
33510 | var defineProperty = __webpack_require__(23).f;
|
33511 | var create = __webpack_require__(53);
|
33512 | var defineBuiltIns = __webpack_require__(157);
|
33513 | var bind = __webpack_require__(52);
|
33514 | var anInstance = __webpack_require__(110);
|
33515 | var iterate = __webpack_require__(41);
|
33516 | var defineIterator = __webpack_require__(134);
|
33517 | var setSpecies = __webpack_require__(172);
|
33518 | var DESCRIPTORS = __webpack_require__(14);
|
33519 | var fastKey = __webpack_require__(97).fastKey;
|
33520 | var InternalStateModule = __webpack_require__(44);
|
33521 |
|
33522 | var setInternalState = InternalStateModule.set;
|
33523 | var internalStateGetterFor = InternalStateModule.getterFor;
|
33524 |
|
33525 | module.exports = {
|
33526 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
33527 | var Constructor = wrapper(function (that, iterable) {
|
33528 | anInstance(that, Prototype);
|
33529 | setInternalState(that, {
|
33530 | type: CONSTRUCTOR_NAME,
|
33531 | index: create(null),
|
33532 | first: undefined,
|
33533 | last: undefined,
|
33534 | size: 0
|
33535 | });
|
33536 | if (!DESCRIPTORS) that.size = 0;
|
33537 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
33538 | });
|
33539 |
|
33540 | var Prototype = Constructor.prototype;
|
33541 |
|
33542 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
33543 |
|
33544 | var define = function (that, key, value) {
|
33545 | var state = getInternalState(that);
|
33546 | var entry = getEntry(that, key);
|
33547 | var previous, index;
|
33548 |
|
33549 | if (entry) {
|
33550 | entry.value = value;
|
33551 |
|
33552 | } else {
|
33553 | state.last = entry = {
|
33554 | index: index = fastKey(key, true),
|
33555 | key: key,
|
33556 | value: value,
|
33557 | previous: previous = state.last,
|
33558 | next: undefined,
|
33559 | removed: false
|
33560 | };
|
33561 | if (!state.first) state.first = entry;
|
33562 | if (previous) previous.next = entry;
|
33563 | if (DESCRIPTORS) state.size++;
|
33564 | else that.size++;
|
33565 |
|
33566 | if (index !== 'F') state.index[index] = entry;
|
33567 | } return that;
|
33568 | };
|
33569 |
|
33570 | var getEntry = function (that, key) {
|
33571 | var state = getInternalState(that);
|
33572 |
|
33573 | var index = fastKey(key);
|
33574 | var entry;
|
33575 | if (index !== 'F') return state.index[index];
|
33576 |
|
33577 | for (entry = state.first; entry; entry = entry.next) {
|
33578 | if (entry.key == key) return entry;
|
33579 | }
|
33580 | };
|
33581 |
|
33582 | defineBuiltIns(Prototype, {
|
33583 |
|
33584 |
|
33585 |
|
33586 | clear: function clear() {
|
33587 | var that = this;
|
33588 | var state = getInternalState(that);
|
33589 | var data = state.index;
|
33590 | var entry = state.first;
|
33591 | while (entry) {
|
33592 | entry.removed = true;
|
33593 | if (entry.previous) entry.previous = entry.previous.next = undefined;
|
33594 | delete data[entry.index];
|
33595 | entry = entry.next;
|
33596 | }
|
33597 | state.first = state.last = undefined;
|
33598 | if (DESCRIPTORS) state.size = 0;
|
33599 | else that.size = 0;
|
33600 | },
|
33601 |
|
33602 |
|
33603 |
|
33604 | 'delete': function (key) {
|
33605 | var that = this;
|
33606 | var state = getInternalState(that);
|
33607 | var entry = getEntry(that, key);
|
33608 | if (entry) {
|
33609 | var next = entry.next;
|
33610 | var prev = entry.previous;
|
33611 | delete state.index[entry.index];
|
33612 | entry.removed = true;
|
33613 | if (prev) prev.next = next;
|
33614 | if (next) next.previous = prev;
|
33615 | if (state.first == entry) state.first = next;
|
33616 | if (state.last == entry) state.last = prev;
|
33617 | if (DESCRIPTORS) state.size--;
|
33618 | else that.size--;
|
33619 | } return !!entry;
|
33620 | },
|
33621 |
|
33622 |
|
33623 |
|
33624 | forEach: function forEach(callbackfn /* , that = undefined */) {
|
33625 | var state = getInternalState(this);
|
33626 | var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
33627 | var entry;
|
33628 | while (entry = entry ? entry.next : state.first) {
|
33629 | boundFunction(entry.value, entry.key, this);
|
33630 |
|
33631 | while (entry && entry.removed) entry = entry.previous;
|
33632 | }
|
33633 | },
|
33634 |
|
33635 |
|
33636 |
|
33637 | has: function has(key) {
|
33638 | return !!getEntry(this, key);
|
33639 | }
|
33640 | });
|
33641 |
|
33642 | defineBuiltIns(Prototype, IS_MAP ? {
|
33643 |
|
33644 |
|
33645 | get: function get(key) {
|
33646 | var entry = getEntry(this, key);
|
33647 | return entry && entry.value;
|
33648 | },
|
33649 |
|
33650 |
|
33651 | set: function set(key, value) {
|
33652 | return define(this, key === 0 ? 0 : key, value);
|
33653 | }
|
33654 | } : {
|
33655 |
|
33656 |
|
33657 | add: function add(value) {
|
33658 | return define(this, value = value === 0 ? 0 : value, value);
|
33659 | }
|
33660 | });
|
33661 | if (DESCRIPTORS) defineProperty(Prototype, 'size', {
|
33662 | get: function () {
|
33663 | return getInternalState(this).size;
|
33664 | }
|
33665 | });
|
33666 | return Constructor;
|
33667 | },
|
33668 | setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
|
33669 | var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
33670 | var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
33671 | var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
|
33672 |
|
33673 |
|
33674 |
|
33675 |
|
33676 |
|
33677 |
|
33678 |
|
33679 |
|
33680 |
|
33681 | defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
|
33682 | setInternalState(this, {
|
33683 | type: ITERATOR_NAME,
|
33684 | target: iterated,
|
33685 | state: getInternalCollectionState(iterated),
|
33686 | kind: kind,
|
33687 | last: undefined
|
33688 | });
|
33689 | }, function () {
|
33690 | var state = getInternalIteratorState(this);
|
33691 | var kind = state.kind;
|
33692 | var entry = state.last;
|
33693 |
|
33694 | while (entry && entry.removed) entry = entry.previous;
|
33695 |
|
33696 | if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
|
33697 |
|
33698 | state.target = undefined;
|
33699 | return { value: undefined, done: true };
|
33700 | }
|
33701 |
|
33702 | if (kind == 'keys') return { value: entry.key, done: false };
|
33703 | if (kind == 'values') return { value: entry.value, done: false };
|
33704 | return { value: [entry.key, entry.value], done: false };
|
33705 | }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
33706 |
|
33707 |
|
33708 |
|
33709 |
|
33710 | setSpecies(CONSTRUCTOR_NAME);
|
33711 | }
|
33712 | };
|
33713 |
|
33714 |
|
33715 | }),
|
33716 |
|
33717 | (function(module, exports, __webpack_require__) {
|
33718 |
|
33719 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
33720 |
|
33721 |
|
33722 |
|
33723 |
|
33724 |
|
33725 |
|
33726 |
|
33727 |
|
33728 |
|
33729 |
|
33730 |
|
33731 |
|
33732 |
|
33733 |
|
33734 |
|
33735 |
|
33736 |
|
33737 |
|
33738 |
|
33739 |
|
33740 | (function(global, factory) {
|
33741 |
|
33742 | if (true)
|
33743 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(655)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
33744 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
33745 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
33746 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
33747 | else if (typeof require === "function" && typeof module === "object" && module && module["exports"])
|
33748 | module["exports"] = factory(require("bytebuffer"), true);
|
33749 | else
|
33750 | (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]);
|
33751 |
|
33752 | })(this, function(ByteBuffer, isCommonJS) {
|
33753 | "use strict";
|
33754 |
|
33755 | |
33756 |
|
33757 |
|
33758 |
|
33759 |
|
33760 |
|
33761 | var ProtoBuf = {};
|
33762 |
|
33763 | |
33764 |
|
33765 |
|
33766 |
|
33767 | ProtoBuf.ByteBuffer = ByteBuffer;
|
33768 |
|
33769 | |
33770 |
|
33771 |
|
33772 |
|
33773 | ProtoBuf.Long = ByteBuffer.Long || null;
|
33774 |
|
33775 | |
33776 |
|
33777 |
|
33778 |
|
33779 |
|
33780 |
|
33781 | ProtoBuf.VERSION = "5.0.3";
|
33782 |
|
33783 | |
33784 |
|
33785 |
|
33786 |
|
33787 |
|
33788 |
|
33789 | ProtoBuf.WIRE_TYPES = {};
|
33790 |
|
33791 | |
33792 |
|
33793 |
|
33794 |
|
33795 |
|
33796 | ProtoBuf.WIRE_TYPES.VARINT = 0;
|
33797 |
|
33798 | |
33799 |
|
33800 |
|
33801 |
|
33802 |
|
33803 |
|
33804 | ProtoBuf.WIRE_TYPES.BITS64 = 1;
|
33805 |
|
33806 | |
33807 |
|
33808 |
|
33809 |
|
33810 |
|
33811 |
|
33812 | ProtoBuf.WIRE_TYPES.LDELIM = 2;
|
33813 |
|
33814 | |
33815 |
|
33816 |
|
33817 |
|
33818 |
|
33819 |
|
33820 | ProtoBuf.WIRE_TYPES.STARTGROUP = 3;
|
33821 |
|
33822 | |
33823 |
|
33824 |
|
33825 |
|
33826 |
|
33827 |
|
33828 | ProtoBuf.WIRE_TYPES.ENDGROUP = 4;
|
33829 |
|
33830 | |
33831 |
|
33832 |
|
33833 |
|
33834 |
|
33835 |
|
33836 | ProtoBuf.WIRE_TYPES.BITS32 = 5;
|
33837 |
|
33838 | |
33839 |
|
33840 |
|
33841 |
|
33842 |
|
33843 |
|
33844 | ProtoBuf.PACKABLE_WIRE_TYPES = [
|
33845 | ProtoBuf.WIRE_TYPES.VARINT,
|
33846 | ProtoBuf.WIRE_TYPES.BITS64,
|
33847 | ProtoBuf.WIRE_TYPES.BITS32
|
33848 | ];
|
33849 |
|
33850 | |
33851 |
|
33852 |
|
33853 |
|
33854 |
|
33855 |
|
33856 |
|
33857 | ProtoBuf.TYPES = {
|
33858 |
|
33859 | "int32": {
|
33860 | name: "int32",
|
33861 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33862 | defaultValue: 0
|
33863 | },
|
33864 | "uint32": {
|
33865 | name: "uint32",
|
33866 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33867 | defaultValue: 0
|
33868 | },
|
33869 | "sint32": {
|
33870 | name: "sint32",
|
33871 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33872 | defaultValue: 0
|
33873 | },
|
33874 | "int64": {
|
33875 | name: "int64",
|
33876 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33877 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined
|
33878 | },
|
33879 | "uint64": {
|
33880 | name: "uint64",
|
33881 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33882 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined
|
33883 | },
|
33884 | "sint64": {
|
33885 | name: "sint64",
|
33886 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33887 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined
|
33888 | },
|
33889 | "bool": {
|
33890 | name: "bool",
|
33891 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33892 | defaultValue: false
|
33893 | },
|
33894 | "double": {
|
33895 | name: "double",
|
33896 | wireType: ProtoBuf.WIRE_TYPES.BITS64,
|
33897 | defaultValue: 0
|
33898 | },
|
33899 | "string": {
|
33900 | name: "string",
|
33901 | wireType: ProtoBuf.WIRE_TYPES.LDELIM,
|
33902 | defaultValue: ""
|
33903 | },
|
33904 | "bytes": {
|
33905 | name: "bytes",
|
33906 | wireType: ProtoBuf.WIRE_TYPES.LDELIM,
|
33907 | defaultValue: null
|
33908 | },
|
33909 | "fixed32": {
|
33910 | name: "fixed32",
|
33911 | wireType: ProtoBuf.WIRE_TYPES.BITS32,
|
33912 | defaultValue: 0
|
33913 | },
|
33914 | "sfixed32": {
|
33915 | name: "sfixed32",
|
33916 | wireType: ProtoBuf.WIRE_TYPES.BITS32,
|
33917 | defaultValue: 0
|
33918 | },
|
33919 | "fixed64": {
|
33920 | name: "fixed64",
|
33921 | wireType: ProtoBuf.WIRE_TYPES.BITS64,
|
33922 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined
|
33923 | },
|
33924 | "sfixed64": {
|
33925 | name: "sfixed64",
|
33926 | wireType: ProtoBuf.WIRE_TYPES.BITS64,
|
33927 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined
|
33928 | },
|
33929 | "float": {
|
33930 | name: "float",
|
33931 | wireType: ProtoBuf.WIRE_TYPES.BITS32,
|
33932 | defaultValue: 0
|
33933 | },
|
33934 | "enum": {
|
33935 | name: "enum",
|
33936 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
33937 | defaultValue: 0
|
33938 | },
|
33939 | "message": {
|
33940 | name: "message",
|
33941 | wireType: ProtoBuf.WIRE_TYPES.LDELIM,
|
33942 | defaultValue: null
|
33943 | },
|
33944 | "group": {
|
33945 | name: "group",
|
33946 | wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,
|
33947 | defaultValue: null
|
33948 | }
|
33949 | };
|
33950 |
|
33951 | |
33952 |
|
33953 |
|
33954 |
|
33955 |
|
33956 |
|
33957 | ProtoBuf.MAP_KEY_TYPES = [
|
33958 | ProtoBuf.TYPES["int32"],
|
33959 | ProtoBuf.TYPES["sint32"],
|
33960 | ProtoBuf.TYPES["sfixed32"],
|
33961 | ProtoBuf.TYPES["uint32"],
|
33962 | ProtoBuf.TYPES["fixed32"],
|
33963 | ProtoBuf.TYPES["int64"],
|
33964 | ProtoBuf.TYPES["sint64"],
|
33965 | ProtoBuf.TYPES["sfixed64"],
|
33966 | ProtoBuf.TYPES["uint64"],
|
33967 | ProtoBuf.TYPES["fixed64"],
|
33968 | ProtoBuf.TYPES["bool"],
|
33969 | ProtoBuf.TYPES["string"],
|
33970 | ProtoBuf.TYPES["bytes"]
|
33971 | ];
|
33972 |
|
33973 | |
33974 |
|
33975 |
|
33976 |
|
33977 |
|
33978 |
|
33979 | ProtoBuf.ID_MIN = 1;
|
33980 |
|
33981 | |
33982 |
|
33983 |
|
33984 |
|
33985 |
|
33986 |
|
33987 | ProtoBuf.ID_MAX = 0x1FFFFFFF;
|
33988 |
|
33989 | |
33990 |
|
33991 |
|
33992 |
|
33993 |
|
33994 |
|
33995 | ProtoBuf.convertFieldsToCamelCase = false;
|
33996 |
|
33997 | |
33998 |
|
33999 |
|
34000 |
|
34001 |
|
34002 |
|
34003 | ProtoBuf.populateAccessors = true;
|
34004 |
|
34005 | |
34006 |
|
34007 |
|
34008 |
|
34009 |
|
34010 |
|
34011 | ProtoBuf.populateDefaults = true;
|
34012 |
|
34013 | |
34014 |
|
34015 |
|
34016 |
|
34017 | ProtoBuf.Util = (function() {
|
34018 | "use strict";
|
34019 |
|
34020 | |
34021 |
|
34022 |
|
34023 |
|
34024 |
|
34025 | var Util = {};
|
34026 |
|
34027 | |
34028 |
|
34029 |
|
34030 |
|
34031 |
|
34032 |
|
34033 | Util.IS_NODE = !!(
|
34034 | typeof process === 'object' && process+'' === '[object process]' && !process['browser']
|
34035 | );
|
34036 |
|
34037 | |
34038 |
|
34039 |
|
34040 |
|
34041 |
|
34042 |
|
34043 | Util.XHR = function() {
|
34044 |
|
34045 | var XMLHttpFactories = [
|
34046 | function () {return new XMLHttpRequest()},
|
34047 | function () {return new ActiveXObject("Msxml2.XMLHTTP")},
|
34048 | function () {return new ActiveXObject("Msxml3.XMLHTTP")},
|
34049 | function () {return new ActiveXObject("Microsoft.XMLHTTP")}
|
34050 | ];
|
34051 |
|
34052 | var xhr = null;
|
34053 | for (var i=0;i<XMLHttpFactories.length;i++) {
|
34054 | try { xhr = XMLHttpFactories[i](); }
|
34055 | catch (e) { continue; }
|
34056 | break;
|
34057 | }
|
34058 | if (!xhr)
|
34059 | throw Error("XMLHttpRequest is not supported");
|
34060 | return xhr;
|
34061 | };
|
34062 |
|
34063 | |
34064 |
|
34065 |
|
34066 |
|
34067 |
|
34068 |
|
34069 |
|
34070 |
|
34071 | Util.fetch = function(path, callback) {
|
34072 | if (callback && typeof callback != 'function')
|
34073 | callback = null;
|
34074 | if (Util.IS_NODE) {
|
34075 | var fs = __webpack_require__(657);
|
34076 | if (callback) {
|
34077 | fs.readFile(path, function(err, data) {
|
34078 | if (err)
|
34079 | callback(null);
|
34080 | else
|
34081 | callback(""+data);
|
34082 | });
|
34083 | } else
|
34084 | try {
|
34085 | return fs.readFileSync(path);
|
34086 | } catch (e) {
|
34087 | return null;
|
34088 | }
|
34089 | } else {
|
34090 | var xhr = Util.XHR();
|
34091 | xhr.open('GET', path, callback ? true : false);
|
34092 |
|
34093 | xhr.setRequestHeader('Accept', 'text/plain');
|
34094 | if (typeof xhr.overrideMimeType === 'function') xhr.overrideMimeType('text/plain');
|
34095 | if (callback) {
|
34096 | xhr.onreadystatechange = function() {
|
34097 | if (xhr.readyState != 4) return;
|
34098 | if ( xhr.status == 200 || (xhr.status == 0 && typeof xhr.responseText === 'string'))
|
34099 | callback(xhr.responseText);
|
34100 | else
|
34101 | callback(null);
|
34102 | };
|
34103 | if (xhr.readyState == 4)
|
34104 | return;
|
34105 | xhr.send(null);
|
34106 | } else {
|
34107 | xhr.send(null);
|
34108 | if ( xhr.status == 200 || (xhr.status == 0 && typeof xhr.responseText === 'string'))
|
34109 | return xhr.responseText;
|
34110 | return null;
|
34111 | }
|
34112 | }
|
34113 | };
|
34114 |
|
34115 | |
34116 |
|
34117 |
|
34118 |
|
34119 |
|
34120 |
|
34121 | Util.toCamelCase = function(str) {
|
34122 | return str.replace(/_([a-zA-Z])/g, function ($0, $1) {
|
34123 | return $1.toUpperCase();
|
34124 | });
|
34125 | };
|
34126 |
|
34127 | return Util;
|
34128 | })();
|
34129 |
|
34130 | |
34131 |
|
34132 |
|
34133 |
|
34134 |
|
34135 | ProtoBuf.Lang = {
|
34136 |
|
34137 |
|
34138 | DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
|
34139 |
|
34140 |
|
34141 | RULE: /^(?:required|optional|repeated|map)$/,
|
34142 |
|
34143 |
|
34144 | TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
|
34145 |
|
34146 |
|
34147 | NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
|
34148 |
|
34149 |
|
34150 | TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
|
34151 |
|
34152 |
|
34153 | TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,
|
34154 |
|
34155 |
|
34156 | FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,
|
34157 |
|
34158 |
|
34159 | NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
|
34160 |
|
34161 |
|
34162 | NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
|
34163 |
|
34164 |
|
34165 | NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
|
34166 |
|
34167 |
|
34168 | NUMBER_OCT: /^0[0-7]+$/,
|
34169 |
|
34170 |
|
34171 | NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
|
34172 |
|
34173 |
|
34174 | BOOL: /^(?:true|false)$/i,
|
34175 |
|
34176 |
|
34177 | ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
|
34178 |
|
34179 |
|
34180 | NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
|
34181 |
|
34182 |
|
34183 | WHITESPACE: /\s/,
|
34184 |
|
34185 |
|
34186 | STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
|
34187 |
|
34188 |
|
34189 | STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
|
34190 |
|
34191 |
|
34192 | STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
|
34193 | };
|
34194 |
|
34195 |
|
34196 | |
34197 |
|
34198 |
|
34199 |
|
34200 | ProtoBuf.Reflect = (function(ProtoBuf) {
|
34201 | "use strict";
|
34202 |
|
34203 | |
34204 |
|
34205 |
|
34206 |
|
34207 |
|
34208 | var Reflect = {};
|
34209 |
|
34210 | |
34211 |
|
34212 |
|
34213 |
|
34214 |
|
34215 |
|
34216 |
|
34217 |
|
34218 |
|
34219 | var T = function(builder, parent, name) {
|
34220 |
|
34221 | |
34222 |
|
34223 |
|
34224 |
|
34225 |
|
34226 | this.builder = builder;
|
34227 |
|
34228 | |
34229 |
|
34230 |
|
34231 |
|
34232 |
|
34233 | this.parent = parent;
|
34234 |
|
34235 | |
34236 |
|
34237 |
|
34238 |
|
34239 |
|
34240 | this.name = name;
|
34241 |
|
34242 | |
34243 |
|
34244 |
|
34245 |
|
34246 |
|
34247 | this.className;
|
34248 | };
|
34249 |
|
34250 | |
34251 |
|
34252 |
|
34253 |
|
34254 | var TPrototype = T.prototype;
|
34255 |
|
34256 | |
34257 |
|
34258 |
|
34259 |
|
34260 |
|
34261 | TPrototype.fqn = function() {
|
34262 | var name = this.name,
|
34263 | ptr = this;
|
34264 | do {
|
34265 | ptr = ptr.parent;
|
34266 | if (ptr == null)
|
34267 | break;
|
34268 | name = ptr.name+"."+name;
|
34269 | } while (true);
|
34270 | return name;
|
34271 | };
|
34272 |
|
34273 | |
34274 |
|
34275 |
|
34276 |
|
34277 |
|
34278 |
|
34279 | TPrototype.toString = function(includeClass) {
|
34280 | return (includeClass ? this.className + " " : "") + this.fqn();
|
34281 | };
|
34282 |
|
34283 | |
34284 |
|
34285 |
|
34286 |
|
34287 |
|
34288 | TPrototype.build = function() {
|
34289 | throw Error(this.toString(true)+" cannot be built directly");
|
34290 | };
|
34291 |
|
34292 | |
34293 |
|
34294 |
|
34295 |
|
34296 | Reflect.T = T;
|
34297 |
|
34298 | |
34299 |
|
34300 |
|
34301 |
|
34302 |
|
34303 |
|
34304 |
|
34305 |
|
34306 |
|
34307 |
|
34308 |
|
34309 | var Namespace = function(builder, parent, name, options, syntax) {
|
34310 | T.call(this, builder, parent, name);
|
34311 |
|
34312 | |
34313 |
|
34314 |
|
34315 | this.className = "Namespace";
|
34316 |
|
34317 | |
34318 |
|
34319 |
|
34320 |
|
34321 | this.children = [];
|
34322 |
|
34323 | |
34324 |
|
34325 |
|
34326 |
|
34327 | this.options = options || {};
|
34328 |
|
34329 | |
34330 |
|
34331 |
|
34332 |
|
34333 | this.syntax = syntax || "proto2";
|
34334 | };
|
34335 |
|
34336 | |
34337 |
|
34338 |
|
34339 |
|
34340 | var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);
|
34341 |
|
34342 | |
34343 |
|
34344 |
|
34345 |
|
34346 |
|
34347 |
|
34348 | NamespacePrototype.getChildren = function(type) {
|
34349 | type = type || null;
|
34350 | if (type == null)
|
34351 | return this.children.slice();
|
34352 | var children = [];
|
34353 | for (var i=0, k=this.children.length; i<k; ++i)
|
34354 | if (this.children[i] instanceof type)
|
34355 | children.push(this.children[i]);
|
34356 | return children;
|
34357 | };
|
34358 |
|
34359 | |
34360 |
|
34361 |
|
34362 |
|
34363 |
|
34364 |
|
34365 | NamespacePrototype.addChild = function(child) {
|
34366 | var other;
|
34367 | if (other = this.getChild(child.name)) {
|
34368 |
|
34369 | if (other instanceof Message.Field && other.name !== other.originalName && this.getChild(other.originalName) === null)
|
34370 | other.name = other.originalName;
|
34371 | else if (child instanceof Message.Field && child.name !== child.originalName && this.getChild(child.originalName) === null)
|
34372 | child.name = child.originalName;
|
34373 | else
|
34374 | throw Error("Duplicate name in namespace "+this.toString(true)+": "+child.name);
|
34375 | }
|
34376 | this.children.push(child);
|
34377 | };
|
34378 |
|
34379 | |
34380 |
|
34381 |
|
34382 |
|
34383 |
|
34384 |
|
34385 | NamespacePrototype.getChild = function(nameOrId) {
|
34386 | var key = typeof nameOrId === 'number' ? 'id' : 'name';
|
34387 | for (var i=0, k=this.children.length; i<k; ++i)
|
34388 | if (this.children[i][key] === nameOrId)
|
34389 | return this.children[i];
|
34390 | return null;
|
34391 | };
|
34392 |
|
34393 | |
34394 |
|
34395 |
|
34396 |
|
34397 |
|
34398 |
|
34399 |
|
34400 | NamespacePrototype.resolve = function(qn, excludeNonNamespace) {
|
34401 | var part = typeof qn === 'string' ? qn.split(".") : qn,
|
34402 | ptr = this,
|
34403 | i = 0;
|
34404 | if (part[i] === "") {
|
34405 | while (ptr.parent !== null)
|
34406 | ptr = ptr.parent;
|
34407 | i++;
|
34408 | }
|
34409 | var child;
|
34410 | do {
|
34411 | do {
|
34412 | if (!(ptr instanceof Reflect.Namespace)) {
|
34413 | ptr = null;
|
34414 | break;
|
34415 | }
|
34416 | child = ptr.getChild(part[i]);
|
34417 | if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) {
|
34418 | ptr = null;
|
34419 | break;
|
34420 | }
|
34421 | ptr = child; i++;
|
34422 | } while (i < part.length);
|
34423 | if (ptr != null)
|
34424 | break;
|
34425 |
|
34426 | if (this.parent !== null)
|
34427 | return this.parent.resolve(qn, excludeNonNamespace);
|
34428 | } while (ptr != null);
|
34429 | return ptr;
|
34430 | };
|
34431 |
|
34432 | |
34433 |
|
34434 |
|
34435 |
|
34436 |
|
34437 |
|
34438 | NamespacePrototype.qn = function(t) {
|
34439 | var part = [], ptr = t;
|
34440 | do {
|
34441 | part.unshift(ptr.name);
|
34442 | ptr = ptr.parent;
|
34443 | } while (ptr !== null);
|
34444 | for (var len=1; len <= part.length; len++) {
|
34445 | var qn = part.slice(part.length-len);
|
34446 | if (t === this.resolve(qn, t instanceof Reflect.Namespace))
|
34447 | return qn.join(".");
|
34448 | }
|
34449 | return t.fqn();
|
34450 | };
|
34451 |
|
34452 | |
34453 |
|
34454 |
|
34455 |
|
34456 |
|
34457 | NamespacePrototype.build = function() {
|
34458 |
|
34459 | var ns = {};
|
34460 | var children = this.children;
|
34461 | for (var i=0, k=children.length, child; i<k; ++i) {
|
34462 | child = children[i];
|
34463 | if (child instanceof Namespace)
|
34464 | ns[child.name] = child.build();
|
34465 | }
|
34466 | if (Object.defineProperty)
|
34467 | Object.defineProperty(ns, "$options", { "value": this.buildOpt() });
|
34468 | return ns;
|
34469 | };
|
34470 |
|
34471 | |
34472 |
|
34473 |
|
34474 |
|
34475 | NamespacePrototype.buildOpt = function() {
|
34476 | var opt = {},
|
34477 | keys = Object.keys(this.options);
|
34478 | for (var i=0, k=keys.length; i<k; ++i) {
|
34479 | var key = keys[i],
|
34480 | val = this.options[keys[i]];
|
34481 |
|
34482 |
|
34483 |
|
34484 |
|
34485 | opt[key] = val;
|
34486 |
|
34487 | }
|
34488 | return opt;
|
34489 | };
|
34490 |
|
34491 | |
34492 |
|
34493 |
|
34494 |
|
34495 |
|
34496 | NamespacePrototype.getOption = function(name) {
|
34497 | if (typeof name === 'undefined')
|
34498 | return this.options;
|
34499 | return typeof this.options[name] !== 'undefined' ? this.options[name] : null;
|
34500 | };
|
34501 |
|
34502 | |
34503 |
|
34504 |
|
34505 |
|
34506 | Reflect.Namespace = Namespace;
|
34507 |
|
34508 | |
34509 |
|
34510 |
|
34511 |
|
34512 |
|
34513 |
|
34514 |
|
34515 |
|
34516 |
|
34517 |
|
34518 |
|
34519 |
|
34520 |
|
34521 |
|
34522 |
|
34523 |
|
34524 |
|
34525 |
|
34526 |
|
34527 |
|
34528 |
|
34529 | var Element = function(type, resolvedType, isMapKey, syntax, name) {
|
34530 |
|
34531 | |
34532 |
|
34533 |
|
34534 |
|
34535 | this.type = type;
|
34536 |
|
34537 | |
34538 |
|
34539 |
|
34540 |
|
34541 | this.resolvedType = resolvedType;
|
34542 |
|
34543 | |
34544 |
|
34545 |
|
34546 |
|
34547 | this.isMapKey = isMapKey;
|
34548 |
|
34549 | |
34550 |
|
34551 |
|
34552 |
|
34553 | this.syntax = syntax;
|
34554 |
|
34555 | |
34556 |
|
34557 |
|
34558 |
|
34559 | this.name = name;
|
34560 |
|
34561 | if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0)
|
34562 | throw Error("Invalid map key type: " + type.name);
|
34563 | };
|
34564 |
|
34565 | var ElementPrototype = Element.prototype;
|
34566 |
|
34567 | |
34568 |
|
34569 |
|
34570 |
|
34571 |
|
34572 |
|
34573 | function mkDefault(type) {
|
34574 | if (typeof type === 'string')
|
34575 | type = ProtoBuf.TYPES[type];
|
34576 | if (typeof type.defaultValue === 'undefined')
|
34577 | throw Error("default value for type "+type.name+" is not supported");
|
34578 | if (type == ProtoBuf.TYPES["bytes"])
|
34579 | return new ByteBuffer(0);
|
34580 | return type.defaultValue;
|
34581 | }
|
34582 |
|
34583 | |
34584 |
|
34585 |
|
34586 |
|
34587 |
|
34588 |
|
34589 | Element.defaultFieldValue = mkDefault;
|
34590 |
|
34591 | |
34592 |
|
34593 |
|
34594 |
|
34595 |
|
34596 |
|
34597 |
|
34598 |
|
34599 |
|
34600 | function mkLong(value, unsigned) {
|
34601 | if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean'
|
34602 | && value.low === value.low && value.high === value.high)
|
34603 | return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);
|
34604 | if (typeof value === 'string')
|
34605 | return ProtoBuf.Long.fromString(value, unsigned || false, 10);
|
34606 | if (typeof value === 'number')
|
34607 | return ProtoBuf.Long.fromNumber(value, unsigned || false);
|
34608 | throw Error("not convertible to Long");
|
34609 | }
|
34610 |
|
34611 | ElementPrototype.toString = function() {
|
34612 | return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element';
|
34613 | }
|
34614 |
|
34615 | |
34616 |
|
34617 |
|
34618 |
|
34619 |
|
34620 |
|
34621 |
|
34622 |
|
34623 | ElementPrototype.verifyValue = function(value) {
|
34624 | var self = this;
|
34625 | function fail(val, msg) {
|
34626 | throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");
|
34627 | }
|
34628 | switch (this.type) {
|
34629 |
|
34630 | case ProtoBuf.TYPES["int32"]:
|
34631 | case ProtoBuf.TYPES["sint32"]:
|
34632 | case ProtoBuf.TYPES["sfixed32"]:
|
34633 |
|
34634 | if (typeof value !== 'number' || (value === value && value % 1 !== 0))
|
34635 | fail(typeof value, "not an integer");
|
34636 | return value > 4294967295 ? value | 0 : value;
|
34637 |
|
34638 |
|
34639 | case ProtoBuf.TYPES["uint32"]:
|
34640 | case ProtoBuf.TYPES["fixed32"]:
|
34641 | if (typeof value !== 'number' || (value === value && value % 1 !== 0))
|
34642 | fail(typeof value, "not an integer");
|
34643 | return value < 0 ? value >>> 0 : value;
|
34644 |
|
34645 |
|
34646 | case ProtoBuf.TYPES["int64"]:
|
34647 | case ProtoBuf.TYPES["sint64"]:
|
34648 | case ProtoBuf.TYPES["sfixed64"]: {
|
34649 | if (ProtoBuf.Long)
|
34650 | try {
|
34651 | return mkLong(value, false);
|
34652 | } catch (e) {
|
34653 | fail(typeof value, e.message);
|
34654 | }
|
34655 | else
|
34656 | fail(typeof value, "requires Long.js");
|
34657 | }
|
34658 |
|
34659 |
|
34660 | case ProtoBuf.TYPES["uint64"]:
|
34661 | case ProtoBuf.TYPES["fixed64"]: {
|
34662 | if (ProtoBuf.Long)
|
34663 | try {
|
34664 | return mkLong(value, true);
|
34665 | } catch (e) {
|
34666 | fail(typeof value, e.message);
|
34667 | }
|
34668 | else
|
34669 | fail(typeof value, "requires Long.js");
|
34670 | }
|
34671 |
|
34672 |
|
34673 | case ProtoBuf.TYPES["bool"]:
|
34674 | if (typeof value !== 'boolean')
|
34675 | fail(typeof value, "not a boolean");
|
34676 | return value;
|
34677 |
|
34678 |
|
34679 | case ProtoBuf.TYPES["float"]:
|
34680 | case ProtoBuf.TYPES["double"]:
|
34681 | if (typeof value !== 'number')
|
34682 | fail(typeof value, "not a number");
|
34683 | return value;
|
34684 |
|
34685 |
|
34686 | case ProtoBuf.TYPES["string"]:
|
34687 | if (typeof value !== 'string' && !(value && value instanceof String))
|
34688 | fail(typeof value, "not a string");
|
34689 | return ""+value;
|
34690 |
|
34691 |
|
34692 | case ProtoBuf.TYPES["bytes"]:
|
34693 | if (ByteBuffer.isByteBuffer(value))
|
34694 | return value;
|
34695 | return ByteBuffer.wrap(value, "base64");
|
34696 |
|
34697 |
|
34698 | case ProtoBuf.TYPES["enum"]: {
|
34699 | var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);
|
34700 | for (i=0; i<values.length; i++)
|
34701 | if (values[i].name == value)
|
34702 | return values[i].id;
|
34703 | else if (values[i].id == value)
|
34704 | return values[i].id;
|
34705 |
|
34706 | if (this.syntax === 'proto3') {
|
34707 |
|
34708 | if (typeof value !== 'number' || (value === value && value % 1 !== 0))
|
34709 | fail(typeof value, "not an integer");
|
34710 | if (value > 4294967295 || value < 0)
|
34711 | fail(typeof value, "not in range for uint32")
|
34712 | return value;
|
34713 | } else {
|
34714 |
|
34715 | fail(value, "not a valid enum value");
|
34716 | }
|
34717 | }
|
34718 |
|
34719 | case ProtoBuf.TYPES["group"]:
|
34720 | case ProtoBuf.TYPES["message"]: {
|
34721 | if (!value || typeof value !== 'object')
|
34722 | fail(typeof value, "object expected");
|
34723 | if (value instanceof this.resolvedType.clazz)
|
34724 | return value;
|
34725 | if (value instanceof ProtoBuf.Builder.Message) {
|
34726 |
|
34727 | var obj = {};
|
34728 | for (var i in value)
|
34729 | if (value.hasOwnProperty(i))
|
34730 | obj[i] = value[i];
|
34731 | value = obj;
|
34732 | }
|
34733 |
|
34734 | return new (this.resolvedType.clazz)(value);
|
34735 | }
|
34736 | }
|
34737 |
|
34738 |
|
34739 | throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")");
|
34740 | };
|
34741 |
|
34742 | |
34743 |
|
34744 |
|
34745 |
|
34746 |
|
34747 |
|
34748 |
|
34749 |
|
34750 | ElementPrototype.calculateLength = function(id, value) {
|
34751 | if (value === null) return 0;
|
34752 |
|
34753 | var n;
|
34754 | switch (this.type) {
|
34755 | case ProtoBuf.TYPES["int32"]:
|
34756 | return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);
|
34757 | case ProtoBuf.TYPES["uint32"]:
|
34758 | return ByteBuffer.calculateVarint32(value);
|
34759 | case ProtoBuf.TYPES["sint32"]:
|
34760 | return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));
|
34761 | case ProtoBuf.TYPES["fixed32"]:
|
34762 | case ProtoBuf.TYPES["sfixed32"]:
|
34763 | case ProtoBuf.TYPES["float"]:
|
34764 | return 4;
|
34765 | case ProtoBuf.TYPES["int64"]:
|
34766 | case ProtoBuf.TYPES["uint64"]:
|
34767 | return ByteBuffer.calculateVarint64(value);
|
34768 | case ProtoBuf.TYPES["sint64"]:
|
34769 | return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));
|
34770 | case ProtoBuf.TYPES["fixed64"]:
|
34771 | case ProtoBuf.TYPES["sfixed64"]:
|
34772 | return 8;
|
34773 | case ProtoBuf.TYPES["bool"]:
|
34774 | return 1;
|
34775 | case ProtoBuf.TYPES["enum"]:
|
34776 | return ByteBuffer.calculateVarint32(value);
|
34777 | case ProtoBuf.TYPES["double"]:
|
34778 | return 8;
|
34779 | case ProtoBuf.TYPES["string"]:
|
34780 | n = ByteBuffer.calculateUTF8Bytes(value);
|
34781 | return ByteBuffer.calculateVarint32(n) + n;
|
34782 | case ProtoBuf.TYPES["bytes"]:
|
34783 | if (value.remaining() < 0)
|
34784 | throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");
|
34785 | return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();
|
34786 | case ProtoBuf.TYPES["message"]:
|
34787 | n = this.resolvedType.calculate(value);
|
34788 | return ByteBuffer.calculateVarint32(n) + n;
|
34789 | case ProtoBuf.TYPES["group"]:
|
34790 | n = this.resolvedType.calculate(value);
|
34791 | return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);
|
34792 | }
|
34793 |
|
34794 | throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");
|
34795 | };
|
34796 |
|
34797 | |
34798 |
|
34799 |
|
34800 |
|
34801 |
|
34802 |
|
34803 |
|
34804 |
|
34805 |
|
34806 | ElementPrototype.encodeValue = function(id, value, buffer) {
|
34807 | if (value === null) return buffer;
|
34808 |
|
34809 |
|
34810 | switch (this.type) {
|
34811 |
|
34812 | case ProtoBuf.TYPES["int32"]:
|
34813 |
|
34814 |
|
34815 | if (value < 0)
|
34816 | buffer.writeVarint64(value);
|
34817 | else
|
34818 | buffer.writeVarint32(value);
|
34819 | break;
|
34820 |
|
34821 |
|
34822 | case ProtoBuf.TYPES["uint32"]:
|
34823 | buffer.writeVarint32(value);
|
34824 | break;
|
34825 |
|
34826 |
|
34827 | case ProtoBuf.TYPES["sint32"]:
|
34828 | buffer.writeVarint32ZigZag(value);
|
34829 | break;
|
34830 |
|
34831 |
|
34832 | case ProtoBuf.TYPES["fixed32"]:
|
34833 | buffer.writeUint32(value);
|
34834 | break;
|
34835 |
|
34836 |
|
34837 | case ProtoBuf.TYPES["sfixed32"]:
|
34838 | buffer.writeInt32(value);
|
34839 | break;
|
34840 |
|
34841 |
|
34842 | case ProtoBuf.TYPES["int64"]:
|
34843 | case ProtoBuf.TYPES["uint64"]:
|
34844 | buffer.writeVarint64(value);
|
34845 | break;
|
34846 |
|
34847 |
|
34848 | case ProtoBuf.TYPES["sint64"]:
|
34849 | buffer.writeVarint64ZigZag(value);
|
34850 | break;
|
34851 |
|
34852 |
|
34853 | case ProtoBuf.TYPES["fixed64"]:
|
34854 | buffer.writeUint64(value);
|
34855 | break;
|
34856 |
|
34857 |
|
34858 | case ProtoBuf.TYPES["sfixed64"]:
|
34859 | buffer.writeInt64(value);
|
34860 | break;
|
34861 |
|
34862 |
|
34863 | case ProtoBuf.TYPES["bool"]:
|
34864 | if (typeof value === 'string')
|
34865 | buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);
|
34866 | else
|
34867 | buffer.writeVarint32(value ? 1 : 0);
|
34868 | break;
|
34869 |
|
34870 |
|
34871 | case ProtoBuf.TYPES["enum"]:
|
34872 | buffer.writeVarint32(value);
|
34873 | break;
|
34874 |
|
34875 |
|
34876 | case ProtoBuf.TYPES["float"]:
|
34877 | buffer.writeFloat32(value);
|
34878 | break;
|
34879 |
|
34880 |
|
34881 | case ProtoBuf.TYPES["double"]:
|
34882 | buffer.writeFloat64(value);
|
34883 | break;
|
34884 |
|
34885 |
|
34886 | case ProtoBuf.TYPES["string"]:
|
34887 | buffer.writeVString(value);
|
34888 | break;
|
34889 |
|
34890 |
|
34891 | case ProtoBuf.TYPES["bytes"]:
|
34892 | if (value.remaining() < 0)
|
34893 | throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");
|
34894 | var prevOffset = value.offset;
|
34895 | buffer.writeVarint32(value.remaining());
|
34896 | buffer.append(value);
|
34897 | value.offset = prevOffset;
|
34898 | break;
|
34899 |
|
34900 |
|
34901 | case ProtoBuf.TYPES["message"]:
|
34902 | var bb = new ByteBuffer().LE();
|
34903 | this.resolvedType.encode(value, bb);
|
34904 | buffer.writeVarint32(bb.offset);
|
34905 | buffer.append(bb.flip());
|
34906 | break;
|
34907 |
|
34908 |
|
34909 | case ProtoBuf.TYPES["group"]:
|
34910 | this.resolvedType.encode(value, buffer);
|
34911 | buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);
|
34912 | break;
|
34913 |
|
34914 | default:
|
34915 |
|
34916 | throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");
|
34917 | }
|
34918 | return buffer;
|
34919 | };
|
34920 |
|
34921 | |
34922 |
|
34923 |
|
34924 |
|
34925 |
|
34926 |
|
34927 |
|
34928 |
|
34929 |
|
34930 | ElementPrototype.decode = function(buffer, wireType, id) {
|
34931 | if (wireType != this.type.wireType)
|
34932 | throw Error("Unexpected wire type for element");
|
34933 |
|
34934 | var value, nBytes;
|
34935 | switch (this.type) {
|
34936 |
|
34937 | case ProtoBuf.TYPES["int32"]:
|
34938 | return buffer.readVarint32() | 0;
|
34939 |
|
34940 |
|
34941 | case ProtoBuf.TYPES["uint32"]:
|
34942 | return buffer.readVarint32() >>> 0;
|
34943 |
|
34944 |
|
34945 | case ProtoBuf.TYPES["sint32"]:
|
34946 | return buffer.readVarint32ZigZag() | 0;
|
34947 |
|
34948 |
|
34949 | case ProtoBuf.TYPES["fixed32"]:
|
34950 | return buffer.readUint32() >>> 0;
|
34951 |
|
34952 | case ProtoBuf.TYPES["sfixed32"]:
|
34953 | return buffer.readInt32() | 0;
|
34954 |
|
34955 |
|
34956 | case ProtoBuf.TYPES["int64"]:
|
34957 | return buffer.readVarint64();
|
34958 |
|
34959 |
|
34960 | case ProtoBuf.TYPES["uint64"]:
|
34961 | return buffer.readVarint64().toUnsigned();
|
34962 |
|
34963 |
|
34964 | case ProtoBuf.TYPES["sint64"]:
|
34965 | return buffer.readVarint64ZigZag();
|
34966 |
|
34967 |
|
34968 | case ProtoBuf.TYPES["fixed64"]:
|
34969 | return buffer.readUint64();
|
34970 |
|
34971 |
|
34972 | case ProtoBuf.TYPES["sfixed64"]:
|
34973 | return buffer.readInt64();
|
34974 |
|
34975 |
|
34976 | case ProtoBuf.TYPES["bool"]:
|
34977 | return !!buffer.readVarint32();
|
34978 |
|
34979 |
|
34980 | case ProtoBuf.TYPES["enum"]:
|
34981 |
|
34982 | return buffer.readVarint32();
|
34983 |
|
34984 |
|
34985 | case ProtoBuf.TYPES["float"]:
|
34986 | return buffer.readFloat();
|
34987 |
|
34988 |
|
34989 | case ProtoBuf.TYPES["double"]:
|
34990 | return buffer.readDouble();
|
34991 |
|
34992 |
|
34993 | case ProtoBuf.TYPES["string"]:
|
34994 | return buffer.readVString();
|
34995 |
|
34996 |
|
34997 | case ProtoBuf.TYPES["bytes"]: {
|
34998 | nBytes = buffer.readVarint32();
|
34999 | if (buffer.remaining() < nBytes)
|
35000 | throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());
|
35001 | value = buffer.clone();
|
35002 | value.limit = value.offset+nBytes;
|
35003 | buffer.offset += nBytes;
|
35004 | return value;
|
35005 | }
|
35006 |
|
35007 |
|
35008 | case ProtoBuf.TYPES["message"]: {
|
35009 | nBytes = buffer.readVarint32();
|
35010 | return this.resolvedType.decode(buffer, nBytes);
|
35011 | }
|
35012 |
|
35013 |
|
35014 | case ProtoBuf.TYPES["group"]:
|
35015 | return this.resolvedType.decode(buffer, -1, id);
|
35016 | }
|
35017 |
|
35018 |
|
35019 | throw Error("[INTERNAL] Illegal decode type");
|
35020 | };
|
35021 |
|
35022 | |
35023 |
|
35024 |
|
35025 |
|
35026 |
|
35027 |
|
35028 |
|
35029 |
|
35030 | ElementPrototype.valueFromString = function(str) {
|
35031 | if (!this.isMapKey) {
|
35032 | throw Error("valueFromString() called on non-map-key element");
|
35033 | }
|
35034 |
|
35035 | switch (this.type) {
|
35036 | case ProtoBuf.TYPES["int32"]:
|
35037 | case ProtoBuf.TYPES["sint32"]:
|
35038 | case ProtoBuf.TYPES["sfixed32"]:
|
35039 | case ProtoBuf.TYPES["uint32"]:
|
35040 | case ProtoBuf.TYPES["fixed32"]:
|
35041 | return this.verifyValue(parseInt(str));
|
35042 |
|
35043 | case ProtoBuf.TYPES["int64"]:
|
35044 | case ProtoBuf.TYPES["sint64"]:
|
35045 | case ProtoBuf.TYPES["sfixed64"]:
|
35046 | case ProtoBuf.TYPES["uint64"]:
|
35047 | case ProtoBuf.TYPES["fixed64"]:
|
35048 |
|
35049 | return this.verifyValue(str);
|
35050 |
|
35051 | case ProtoBuf.TYPES["bool"]:
|
35052 | return str === "true";
|
35053 |
|
35054 | case ProtoBuf.TYPES["string"]:
|
35055 | return this.verifyValue(str);
|
35056 |
|
35057 | case ProtoBuf.TYPES["bytes"]:
|
35058 | return ByteBuffer.fromBinary(str);
|
35059 | }
|
35060 | };
|
35061 |
|
35062 | |
35063 |
|
35064 |
|
35065 |
|
35066 |
|
35067 |
|
35068 |
|
35069 |
|
35070 |
|
35071 |
|
35072 |
|
35073 |
|
35074 |
|
35075 |
|
35076 |
|
35077 | ElementPrototype.valueToString = function(value) {
|
35078 | if (!this.isMapKey) {
|
35079 | throw Error("valueToString() called on non-map-key element");
|
35080 | }
|
35081 |
|
35082 | if (this.type === ProtoBuf.TYPES["bytes"]) {
|
35083 | return value.toString("binary");
|
35084 | } else {
|
35085 | return value.toString();
|
35086 | }
|
35087 | };
|
35088 |
|
35089 | |
35090 |
|
35091 |
|
35092 |
|
35093 | Reflect.Element = Element;
|
35094 |
|
35095 | |
35096 |
|
35097 |
|
35098 |
|
35099 |
|
35100 |
|
35101 |
|
35102 |
|
35103 |
|
35104 |
|
35105 |
|
35106 |
|
35107 | var Message = function(builder, parent, name, options, isGroup, syntax) {
|
35108 | Namespace.call(this, builder, parent, name, options, syntax);
|
35109 |
|
35110 | |
35111 |
|
35112 |
|
35113 | this.className = "Message";
|
35114 |
|
35115 | |
35116 |
|
35117 |
|
35118 |
|
35119 |
|
35120 | this.extensions = undefined;
|
35121 |
|
35122 | |
35123 |
|
35124 |
|
35125 |
|
35126 |
|
35127 | this.clazz = null;
|
35128 |
|
35129 | |
35130 |
|
35131 |
|
35132 |
|
35133 |
|
35134 | this.isGroup = !!isGroup;
|
35135 |
|
35136 |
|
35137 |
|
35138 | |
35139 |
|
35140 |
|
35141 |
|
35142 |
|
35143 | this._fields = null;
|
35144 |
|
35145 | |
35146 |
|
35147 |
|
35148 |
|
35149 |
|
35150 | this._fieldsById = null;
|
35151 |
|
35152 | |
35153 |
|
35154 |
|
35155 |
|
35156 |
|
35157 | this._fieldsByName = null;
|
35158 | };
|
35159 |
|
35160 | |
35161 |
|
35162 |
|
35163 |
|
35164 | var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);
|
35165 |
|
35166 | |
35167 |
|
35168 |
|
35169 |
|
35170 |
|
35171 |
|
35172 |
|
35173 |
|
35174 | MessagePrototype.build = function(rebuild) {
|
35175 | if (this.clazz && !rebuild)
|
35176 | return this.clazz;
|
35177 |
|
35178 |
|
35179 | var clazz = (function(ProtoBuf, T) {
|
35180 |
|
35181 | var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),
|
35182 | oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);
|
35183 |
|
35184 | |
35185 |
|
35186 |
|
35187 |
|
35188 |
|
35189 |
|
35190 |
|
35191 |
|
35192 |
|
35193 | var Message = function(values, var_args) {
|
35194 | ProtoBuf.Builder.Message.call(this);
|
35195 |
|
35196 |
|
35197 | for (var i=0, k=oneofs.length; i<k; ++i)
|
35198 | this[oneofs[i].name] = null;
|
35199 |
|
35200 | for (i=0, k=fields.length; i<k; ++i) {
|
35201 | var field = fields[i];
|
35202 | this[field.name] =
|
35203 | field.repeated ? [] :
|
35204 | (field.map ? new ProtoBuf.Map(field) : null);
|
35205 | if ((field.required || T.syntax === 'proto3') &&
|
35206 | field.defaultValue !== null)
|
35207 | this[field.name] = field.defaultValue;
|
35208 | }
|
35209 |
|
35210 | if (arguments.length > 0) {
|
35211 | var value;
|
35212 |
|
35213 | if (arguments.length === 1 && values !== null && typeof values === 'object' &&
|
35214 | (typeof values.encode !== 'function' || values instanceof Message) &&
|
35215 | !Array.isArray(values) &&
|
35216 | !(values instanceof ProtoBuf.Map) &&
|
35217 | !ByteBuffer.isByteBuffer(values) &&
|
35218 | !(values instanceof ArrayBuffer) &&
|
35219 | !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) {
|
35220 | this.$set(values);
|
35221 | } else // Set field values from arguments, in declaration order
|
35222 | for (i=0, k=arguments.length; i<k; ++i)
|
35223 | if (typeof (value = arguments[i]) !== 'undefined')
|
35224 | this.$set(fields[i].name, value); // May throw
|
35225 | }
|
35226 | };
|
35227 |
|
35228 | /**
|
35229 | * @alias ProtoBuf.Builder.Message.prototype
|
35230 | * @inner
|
35231 | */
|
35232 | var MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype);
|
35233 |
|
35234 | /**
|
35235 | * Adds a value to a repeated field.
|
35236 | * @name ProtoBuf.Builder.Message#add
|
35237 | * @function
|
35238 | * @param {string} key Field name
|
35239 | * @param {*} value Value to add
|
35240 | * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)
|
35241 | * @returns {!ProtoBuf.Builder.Message} this
|
35242 | * @throws {Error} If the value cannot be added
|
35243 | * @expose
|
35244 | */
|
35245 | MessagePrototype.add = function(key, value, noAssert) {
|
35246 | var field = T._fieldsByName[key];
|
35247 | if (!noAssert) {
|
35248 | if (!field)
|
35249 | throw Error(this+"#"+key+" is undefined");
|
35250 | if (!(field instanceof ProtoBuf.Reflect.Message.Field))
|
35251 | throw Error(this+"#"+key+" is not a field: "+field.toString(true));
|
35252 | if (!field.repeated)
|
35253 | throw Error(this+"#"+key+" is not a repeated field");
|
35254 | value = field.verifyValue(value, true);
|
35255 | }
|
35256 | if (this[key] === null)
|
35257 | this[key] = [];
|
35258 | this[key].push(value);
|
35259 | return this;
|
35260 | };
|
35261 |
|
35262 | |
35263 |
|
35264 |
|
35265 |
|
35266 |
|
35267 |
|
35268 |
|
35269 |
|
35270 |
|
35271 |
|
35272 |
|
35273 | MessagePrototype.$add = MessagePrototype.add;
|
35274 |
|
35275 | |
35276 |
|
35277 |
|
35278 |
|
35279 |
|
35280 |
|
35281 |
|
35282 |
|
35283 |
|
35284 |
|
35285 |
|
35286 | MessagePrototype.set = function(keyOrObj, value, noAssert) {
|
35287 | if (keyOrObj && typeof keyOrObj === 'object') {
|
35288 | noAssert = value;
|
35289 | for (var ikey in keyOrObj) {
|
35290 |
|
35291 | if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined)
|
35292 | this.$set(ikey, value, noAssert);
|
35293 | }
|
35294 | return this;
|
35295 | }
|
35296 | var field = T._fieldsByName[keyOrObj];
|
35297 | if (!noAssert) {
|
35298 | if (!field)
|
35299 | throw Error(this+"#"+keyOrObj+" is not a field: undefined");
|
35300 | if (!(field instanceof ProtoBuf.Reflect.Message.Field))
|
35301 | throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true));
|
35302 | this[field.name] = (value = field.verifyValue(value));
|
35303 | } else
|
35304 | this[keyOrObj] = value;
|
35305 | if (field && field.oneof) {
|
35306 | var currentField = this[field.oneof.name];
|
35307 | if (value !== null) {
|
35308 | if (currentField !== null && currentField !== field.name)
|
35309 | this[currentField] = null;
|
35310 | this[field.oneof.name] = field.name;
|
35311 | } else if (currentField === keyOrObj)
|
35312 | this[field.oneof.name] = null;
|
35313 | }
|
35314 | return this;
|
35315 | };
|
35316 |
|
35317 | |
35318 |
|
35319 |
|
35320 |
|
35321 |
|
35322 |
|
35323 |
|
35324 |
|
35325 |
|
35326 |
|
35327 | MessagePrototype.$set = MessagePrototype.set;
|
35328 |
|
35329 | /**
|
35330 | * Gets a field's value.
|
35331 | * @name ProtoBuf.Builder.Message#get
|
35332 | * @function
|
35333 | * @param {string} key Key
|
35334 | * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`
|
35335 | * @return {*} Value
|
35336 | * @throws {Error} If there is no such field
|
35337 | * @expose
|
35338 | */
|
35339 | MessagePrototype.get = function(key, noAssert) {
|
35340 | if (noAssert)
|
35341 | return this[key];
|
35342 | var field = T._fieldsByName[key];
|
35343 | if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))
|
35344 | throw Error(this+"#"+key+" is not a field: undefined");
|
35345 | if (!(field instanceof ProtoBuf.Reflect.Message.Field))
|
35346 | throw Error(this+"#"+key+" is not a field: "+field.toString(true));
|
35347 | return this[field.name];
|
35348 | };
|
35349 |
|
35350 | |
35351 |
|
35352 |
|
35353 |
|
35354 |
|
35355 |
|
35356 |
|
35357 |
|
35358 |
|
35359 | MessagePrototype.$get = MessagePrototype.get;
|
35360 |
|
35361 | // Getters and setters
|
35362 |
|
35363 | for (var i=0; i<fields.length; i++) {
|
35364 | var field = fields[i];
|
35365 |
|
35366 | if (field instanceof ProtoBuf.Reflect.Message.ExtensionField)
|
35367 | continue;
|
35368 |
|
35369 | if (T.builder.options['populateAccessors'])
|
35370 | (function(field) {
|
35371 |
|
35372 | var Name = field.originalName.replace(/(_[a-zA-Z])/g, function(match) {
|
35373 | return match.toUpperCase().replace('_','');
|
35374 | });
|
35375 | Name = Name.substring(0,1).toUpperCase() + Name.substring(1);
|
35376 |
|
35377 |
|
35378 | var name = field.originalName.replace(/([A-Z])/g, function(match) {
|
35379 | return "_"+match;
|
35380 | });
|
35381 |
|
35382 | |
35383 |
|
35384 |
|
35385 |
|
35386 |
|
35387 |
|
35388 |
|
35389 |
|
35390 | var setter = function(value, noAssert) {
|
35391 | this[field.name] = noAssert ? value : field.verifyValue(value);
|
35392 | return this;
|
35393 | };
|
35394 |
|
35395 | |
35396 |
|
35397 |
|
35398 |
|
35399 |
|
35400 |
|
35401 | var getter = function() {
|
35402 | return this[field.name];
|
35403 | };
|
35404 |
|
35405 | if (T.getChild("set"+Name) === null)
|
35406 | |
35407 |
|
35408 |
|
35409 |
|
35410 |
|
35411 |
|
35412 |
|
35413 |
|
35414 |
|
35415 |
|
35416 |
|
35417 | MessagePrototype["set"+Name] = setter;
|
35418 |
|
35419 | if (T.getChild("set_"+name) === null)
|
35420 | |
35421 |
|
35422 |
|
35423 |
|
35424 |
|
35425 |
|
35426 |
|
35427 |
|
35428 |
|
35429 |
|
35430 |
|
35431 | MessagePrototype["set_"+name] = setter;
|
35432 |
|
35433 | if (T.getChild("get"+Name) === null)
|
35434 | |
35435 |
|
35436 |
|
35437 |
|
35438 |
|
35439 |
|
35440 |
|
35441 |
|
35442 | MessagePrototype["get"+Name] = getter;
|
35443 |
|
35444 | if (T.getChild("get_"+name) === null)
|
35445 | |
35446 |
|
35447 |
|
35448 |
|
35449 |
|
35450 |
|
35451 |
|
35452 |
|
35453 | MessagePrototype["get_"+name] = getter;
|
35454 |
|
35455 | })(field);
|
35456 | }
|
35457 |
|
35458 |
|
35459 |
|
35460 | |
35461 |
|
35462 |
|
35463 |
|
35464 |
|
35465 |
|
35466 |
|
35467 |
|
35468 |
|
35469 |
|
35470 |
|
35471 |
|
35472 |
|
35473 |
|
35474 | MessagePrototype.encode = function(buffer, noVerify) {
|
35475 | if (typeof buffer === 'boolean')
|
35476 | noVerify = buffer,
|
35477 | buffer = undefined;
|
35478 | var isNew = false;
|
35479 | if (!buffer)
|
35480 | buffer = new ByteBuffer(),
|
35481 | isNew = true;
|
35482 | var le = buffer.littleEndian;
|
35483 | try {
|
35484 | T.encode(this, buffer.LE(), noVerify);
|
35485 | return (isNew ? buffer.flip() : buffer).LE(le);
|
35486 | } catch (e) {
|
35487 | buffer.LE(le);
|
35488 | throw(e);
|
35489 | }
|
35490 | };
|
35491 |
|
35492 | |
35493 |
|
35494 |
|
35495 |
|
35496 |
|
35497 |
|
35498 |
|
35499 |
|
35500 | Message.encode = function(data, buffer, noVerify) {
|
35501 | return new Message(data).encode(buffer, noVerify);
|
35502 | };
|
35503 |
|
35504 | |
35505 |
|
35506 |
|
35507 |
|
35508 |
|
35509 |
|
35510 |
|
35511 |
|
35512 | MessagePrototype.calculate = function() {
|
35513 | return T.calculate(this);
|
35514 | };
|
35515 |
|
35516 | |
35517 |
|
35518 |
|
35519 |
|
35520 |
|
35521 |
|
35522 |
|
35523 |
|
35524 |
|
35525 |
|
35526 |
|
35527 | MessagePrototype.encodeDelimited = function(buffer, noVerify) {
|
35528 | var isNew = false;
|
35529 | if (!buffer)
|
35530 | buffer = new ByteBuffer(),
|
35531 | isNew = true;
|
35532 | var enc = new ByteBuffer().LE();
|
35533 | T.encode(this, enc, noVerify).flip();
|
35534 | buffer.writeVarint32(enc.remaining());
|
35535 | buffer.append(enc);
|
35536 | return isNew ? buffer.flip() : buffer;
|
35537 | };
|
35538 |
|
35539 | |
35540 |
|
35541 |
|
35542 |
|
35543 |
|
35544 |
|
35545 |
|
35546 |
|
35547 |
|
35548 | MessagePrototype.encodeAB = function() {
|
35549 | try {
|
35550 | return this.encode().toArrayBuffer();
|
35551 | } catch (e) {
|
35552 | if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer();
|
35553 | throw(e);
|
35554 | }
|
35555 | };
|
35556 |
|
35557 | |
35558 |
|
35559 |
|
35560 |
|
35561 |
|
35562 |
|
35563 |
|
35564 |
|
35565 |
|
35566 | MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;
|
35567 |
|
35568 | |
35569 |
|
35570 |
|
35571 |
|
35572 |
|
35573 |
|
35574 |
|
35575 |
|
35576 |
|
35577 | MessagePrototype.encodeNB = function() {
|
35578 | try {
|
35579 | return this.encode().toBuffer();
|
35580 | } catch (e) {
|
35581 | if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer();
|
35582 | throw(e);
|
35583 | }
|
35584 | };
|
35585 |
|
35586 | |
35587 |
|
35588 |
|
35589 |
|
35590 |
|
35591 |
|
35592 |
|
35593 |
|
35594 |
|
35595 | MessagePrototype.toBuffer = MessagePrototype.encodeNB;
|
35596 |
|
35597 | |
35598 |
|
35599 |
|
35600 |
|
35601 |
|
35602 |
|
35603 |
|
35604 |
|
35605 |
|
35606 | MessagePrototype.encode64 = function() {
|
35607 | try {
|
35608 | return this.encode().toBase64();
|
35609 | } catch (e) {
|
35610 | if (e["encoded"]) e["encoded"] = e["encoded"].toBase64();
|
35611 | throw(e);
|
35612 | }
|
35613 | };
|
35614 |
|
35615 | |
35616 |
|
35617 |
|
35618 |
|
35619 |
|
35620 |
|
35621 |
|
35622 |
|
35623 |
|
35624 | MessagePrototype.toBase64 = MessagePrototype.encode64;
|
35625 |
|
35626 | |
35627 |
|
35628 |
|
35629 |
|
35630 |
|
35631 |
|
35632 |
|
35633 |
|
35634 |
|
35635 | MessagePrototype.encodeHex = function() {
|
35636 | try {
|
35637 | return this.encode().toHex();
|
35638 | } catch (e) {
|
35639 | if (e["encoded"]) e["encoded"] = e["encoded"].toHex();
|
35640 | throw(e);
|
35641 | }
|
35642 | };
|
35643 |
|
35644 | |
35645 |
|
35646 |
|
35647 |
|
35648 |
|
35649 |
|
35650 |
|
35651 |
|
35652 |
|
35653 | MessagePrototype.toHex = MessagePrototype.encodeHex;
|
35654 |
|
35655 | |
35656 |
|
35657 |
|
35658 |
|
35659 |
|
35660 |
|
35661 |
|
35662 |
|
35663 |
|
35664 | function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {
|
35665 | if (obj === null || typeof obj !== 'object') {
|
35666 |
|
35667 | if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) {
|
35668 | var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);
|
35669 | if (name !== null)
|
35670 | return name;
|
35671 | }
|
35672 |
|
35673 | return obj;
|
35674 | }
|
35675 |
|
35676 | if (ByteBuffer.isByteBuffer(obj))
|
35677 | return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();
|
35678 |
|
35679 | if (ProtoBuf.Long.isLong(obj))
|
35680 | return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);
|
35681 | var clone;
|
35682 |
|
35683 | if (Array.isArray(obj)) {
|
35684 | clone = [];
|
35685 | obj.forEach(function(v, k) {
|
35686 | clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);
|
35687 | });
|
35688 | return clone;
|
35689 | }
|
35690 | clone = {};
|
35691 |
|
35692 | if (obj instanceof ProtoBuf.Map) {
|
35693 | var it = obj.entries();
|
35694 | for (var e = it.next(); !e.done; e = it.next())
|
35695 | clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);
|
35696 | return clone;
|
35697 | }
|
35698 |
|
35699 | var type = obj.$type,
|
35700 | field = undefined;
|
35701 | for (var i in obj)
|
35702 | if (obj.hasOwnProperty(i)) {
|
35703 | if (type && (field = type.getChild(i)))
|
35704 | clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);
|
35705 | else
|
35706 | clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);
|
35707 | }
|
35708 | return clone;
|
35709 | }
|
35710 |
|
35711 | |
35712 |
|
35713 |
|
35714 |
|
35715 |
|
35716 |
|
35717 |
|
35718 | MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {
|
35719 | return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);
|
35720 | };
|
35721 |
|
35722 | |
35723 |
|
35724 |
|
35725 |
|
35726 |
|
35727 | MessagePrototype.encodeJSON = function() {
|
35728 | return JSON.stringify(
|
35729 | cloneRaw(this,
|
35730 | true,
|
35731 | true,
|
35732 | this.$type
|
35733 | )
|
35734 | );
|
35735 | };
|
35736 |
|
35737 | |
35738 |
|
35739 |
|
35740 |
|
35741 |
|
35742 |
|
35743 |
|
35744 |
|
35745 |
|
35746 |
|
35747 |
|
35748 |
|
35749 |
|
35750 |
|
35751 | Message.decode = function(buffer, length, enc) {
|
35752 | if (typeof length === 'string')
|
35753 | enc = length,
|
35754 | length = -1;
|
35755 | if (typeof buffer === 'string')
|
35756 | buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");
|
35757 | else if (!ByteBuffer.isByteBuffer(buffer))
|
35758 | buffer = ByteBuffer.wrap(buffer);
|
35759 | var le = buffer.littleEndian;
|
35760 | try {
|
35761 | var msg = T.decode(buffer.LE(), length);
|
35762 | buffer.LE(le);
|
35763 | return msg;
|
35764 | } catch (e) {
|
35765 | buffer.LE(le);
|
35766 | throw(e);
|
35767 | }
|
35768 | };
|
35769 |
|
35770 | |
35771 |
|
35772 |
|
35773 |
|
35774 |
|
35775 |
|
35776 |
|
35777 |
|
35778 |
|
35779 |
|
35780 |
|
35781 | Message.decodeDelimited = function(buffer, enc) {
|
35782 | if (typeof buffer === 'string')
|
35783 | buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");
|
35784 | else if (!ByteBuffer.isByteBuffer(buffer))
|
35785 | buffer = ByteBuffer.wrap(buffer);
|
35786 | if (buffer.remaining() < 1)
|
35787 | return null;
|
35788 | var off = buffer.offset,
|
35789 | len = buffer.readVarint32();
|
35790 | if (buffer.remaining() < len) {
|
35791 | buffer.offset = off;
|
35792 | return null;
|
35793 | }
|
35794 | try {
|
35795 | var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());
|
35796 | buffer.offset += len;
|
35797 | return msg;
|
35798 | } catch (err) {
|
35799 | buffer.offset += len;
|
35800 | throw err;
|
35801 | }
|
35802 | };
|
35803 |
|
35804 | |
35805 |
|
35806 |
|
35807 |
|
35808 |
|
35809 |
|
35810 |
|
35811 |
|
35812 |
|
35813 |
|
35814 | Message.decode64 = function(str) {
|
35815 | return Message.decode(str, "base64");
|
35816 | };
|
35817 |
|
35818 | |
35819 |
|
35820 |
|
35821 |
|
35822 |
|
35823 |
|
35824 |
|
35825 |
|
35826 |
|
35827 |
|
35828 | Message.decodeHex = function(str) {
|
35829 | return Message.decode(str, "hex");
|
35830 | };
|
35831 |
|
35832 | |
35833 |
|
35834 |
|
35835 |
|
35836 |
|
35837 |
|
35838 |
|
35839 |
|
35840 |
|
35841 |
|
35842 | Message.decodeJSON = function(str) {
|
35843 | return new Message(JSON.parse(str));
|
35844 | };
|
35845 |
|
35846 |
|
35847 |
|
35848 | |
35849 |
|
35850 |
|
35851 |
|
35852 |
|
35853 |
|
35854 |
|
35855 | MessagePrototype.toString = function() {
|
35856 | return T.toString();
|
35857 | };
|
35858 |
|
35859 |
|
35860 |
|
35861 | |
35862 |
|
35863 |
|
35864 |
|
35865 |
|
35866 |
|
35867 | var $optionsS;
|
35868 |
|
35869 | |
35870 |
|
35871 |
|
35872 |
|
35873 |
|
35874 |
|
35875 | var $options;
|
35876 |
|
35877 | |
35878 |
|
35879 |
|
35880 |
|
35881 |
|
35882 |
|
35883 | var $typeS;
|
35884 |
|
35885 | |
35886 |
|
35887 |
|
35888 |
|
35889 |
|
35890 |
|
35891 | var $type;
|
35892 |
|
35893 | if (Object.defineProperty)
|
35894 | Object.defineProperty(Message, '$options', { "value": T.buildOpt() }),
|
35895 | Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }),
|
35896 | Object.defineProperty(Message, "$type", { "value": T }),
|
35897 | Object.defineProperty(MessagePrototype, "$type", { "value": T });
|
35898 |
|
35899 | return Message;
|
35900 |
|
35901 | })(ProtoBuf, this);
|
35902 |
|
35903 |
|
35904 | this._fields = [];
|
35905 | this._fieldsById = {};
|
35906 | this._fieldsByName = {};
|
35907 | this._oneofsByName = {};
|
35908 | for (var i=0, k=this.children.length, child; i<k; i++) {
|
35909 | child = this.children[i];
|
35910 | if (child instanceof Enum || child instanceof Message || child instanceof Service) {
|
35911 | if (clazz.hasOwnProperty(child.name))
|
35912 | throw Error("Illegal reflect child of "+this.toString(true)+": "+child.toString(true)+" cannot override static property '"+child.name+"'");
|
35913 | clazz[child.name] = child.build();
|
35914 | } else if (child instanceof Message.Field)
|
35915 | child.build(),
|
35916 | this._fields.push(child),
|
35917 | this._fieldsById[child.id] = child,
|
35918 | this._fieldsByName[child.name] = child;
|
35919 | else if (child instanceof Message.OneOf) {
|
35920 | this._oneofsByName[child.name] = child;
|
35921 | }
|
35922 | else if (!(child instanceof Message.OneOf) && !(child instanceof Extension))
|
35923 | throw Error("Illegal reflect child of "+this.toString(true)+": "+this.children[i].toString(true));
|
35924 | }
|
35925 |
|
35926 | return this.clazz = clazz;
|
35927 | };
|
35928 |
|
35929 | |
35930 |
|
35931 |
|
35932 |
|
35933 |
|
35934 |
|
35935 |
|
35936 |
|
35937 |
|
35938 | MessagePrototype.encode = function(message, buffer, noVerify) {
|
35939 | var fieldMissing = null,
|
35940 | field;
|
35941 | for (var i=0, k=this._fields.length, val; i<k; ++i) {
|
35942 | field = this._fields[i];
|
35943 | val = message[field.name];
|
35944 | if (field.required && val === null) {
|
35945 | if (fieldMissing === null)
|
35946 | fieldMissing = field;
|
35947 | } else
|
35948 | field.encode(noVerify ? val : field.verifyValue(val), buffer, message);
|
35949 | }
|
35950 | if (fieldMissing !== null) {
|
35951 | var err = Error("Missing at least one required field for "+this.toString(true)+": "+fieldMissing);
|
35952 | err["encoded"] = buffer;
|
35953 | throw(err);
|
35954 | }
|
35955 | return buffer;
|
35956 | };
|
35957 |
|
35958 | |
35959 |
|
35960 |
|
35961 |
|
35962 |
|
35963 |
|
35964 |
|
35965 | MessagePrototype.calculate = function(message) {
|
35966 | for (var n=0, i=0, k=this._fields.length, field, val; i<k; ++i) {
|
35967 | field = this._fields[i];
|
35968 | val = message[field.name];
|
35969 | if (field.required && val === null)
|
35970 | throw Error("Missing at least one required field for "+this.toString(true)+": "+field);
|
35971 | else
|
35972 | n += field.calculate(val, message);
|
35973 | }
|
35974 | return n;
|
35975 | };
|
35976 |
|
35977 | |
35978 |
|
35979 |
|
35980 |
|
35981 |
|
35982 |
|
35983 |
|
35984 |
|
35985 | function skipTillGroupEnd(expectedId, buf) {
|
35986 | var tag = buf.readVarint32(),
|
35987 | wireType = tag & 0x07,
|
35988 | id = tag >>> 3;
|
35989 | switch (wireType) {
|
35990 | case ProtoBuf.WIRE_TYPES.VARINT:
|
35991 | do tag = buf.readUint8();
|
35992 | while ((tag & 0x80) === 0x80);
|
35993 | break;
|
35994 | case ProtoBuf.WIRE_TYPES.BITS64:
|
35995 | buf.offset += 8;
|
35996 | break;
|
35997 | case ProtoBuf.WIRE_TYPES.LDELIM:
|
35998 | tag = buf.readVarint32();
|
35999 | buf.offset += tag;
|
36000 | break;
|
36001 | case ProtoBuf.WIRE_TYPES.STARTGROUP:
|
36002 | skipTillGroupEnd(id, buf);
|
36003 | break;
|
36004 | case ProtoBuf.WIRE_TYPES.ENDGROUP:
|
36005 | if (id === expectedId)
|
36006 | return false;
|
36007 | else
|
36008 | throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)");
|
36009 | case ProtoBuf.WIRE_TYPES.BITS32:
|
36010 | buf.offset += 4;
|
36011 | break;
|
36012 | default:
|
36013 | throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType);
|
36014 | }
|
36015 | return true;
|
36016 | }
|
36017 |
|
36018 | |
36019 |
|
36020 |
|
36021 |
|
36022 |
|
36023 |
|
36024 |
|
36025 |
|
36026 |
|
36027 | MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {
|
36028 | if (typeof length !== 'number')
|
36029 | length = -1;
|
36030 | var start = buffer.offset,
|
36031 | msg = new (this.clazz)(),
|
36032 | tag, wireType, id, field;
|
36033 | while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) {
|
36034 | tag = buffer.readVarint32();
|
36035 | wireType = tag & 0x07;
|
36036 | id = tag >>> 3;
|
36037 | if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {
|
36038 | if (id !== expectedGroupEndId)
|
36039 | throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")");
|
36040 | break;
|
36041 | }
|
36042 | if (!(field = this._fieldsById[id])) {
|
36043 |
|
36044 | switch (wireType) {
|
36045 | case ProtoBuf.WIRE_TYPES.VARINT:
|
36046 | buffer.readVarint32();
|
36047 | break;
|
36048 | case ProtoBuf.WIRE_TYPES.BITS32:
|
36049 | buffer.offset += 4;
|
36050 | break;
|
36051 | case ProtoBuf.WIRE_TYPES.BITS64:
|
36052 | buffer.offset += 8;
|
36053 | break;
|
36054 | case ProtoBuf.WIRE_TYPES.LDELIM:
|
36055 | var len = buffer.readVarint32();
|
36056 | buffer.offset += len;
|
36057 | break;
|
36058 | case ProtoBuf.WIRE_TYPES.STARTGROUP:
|
36059 | while (skipTillGroupEnd(id, buffer)) {}
|
36060 | break;
|
36061 | default:
|
36062 | throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType);
|
36063 | }
|
36064 | continue;
|
36065 | }
|
36066 | if (field.repeated && !field.options["packed"]) {
|
36067 | msg[field.name].push(field.decode(wireType, buffer));
|
36068 | } else if (field.map) {
|
36069 | var keyval = field.decode(wireType, buffer);
|
36070 | msg[field.name].set(keyval[0], keyval[1]);
|
36071 | } else {
|
36072 | msg[field.name] = field.decode(wireType, buffer);
|
36073 | if (field.oneof) {
|
36074 | var currentField = msg[field.oneof.name];
|
36075 | if (currentField !== null && currentField !== field.name)
|
36076 | msg[currentField] = null;
|
36077 | msg[field.oneof.name] = field.name;
|
36078 | }
|
36079 | }
|
36080 | }
|
36081 |
|
36082 |
|
36083 | for (var i=0, k=this._fields.length; i<k; ++i) {
|
36084 | field = this._fields[i];
|
36085 | if (msg[field.name] === null) {
|
36086 | if (this.syntax === "proto3") {
|
36087 | msg[field.name] = field.defaultValue;
|
36088 | } else if (field.required) {
|
36089 | var err = Error("Missing at least one required field for " + this.toString(true) + ": " + field.name);
|
36090 | err["decoded"] = msg;
|
36091 | throw(err);
|
36092 | } else if (ProtoBuf.populateDefaults && field.defaultValue !== null)
|
36093 | msg[field.name] = field.defaultValue;
|
36094 | }
|
36095 | }
|
36096 | return msg;
|
36097 | };
|
36098 |
|
36099 | |
36100 |
|
36101 |
|
36102 |
|
36103 | Reflect.Message = Message;
|
36104 |
|
36105 | |
36106 |
|
36107 |
|
36108 |
|
36109 |
|
36110 |
|
36111 |
|
36112 |
|
36113 |
|
36114 |
|
36115 |
|
36116 |
|
36117 |
|
36118 |
|
36119 |
|
36120 |
|
36121 | var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {
|
36122 | T.call(this, builder, message, name);
|
36123 |
|
36124 | |
36125 |
|
36126 |
|
36127 | this.className = "Message.Field";
|
36128 |
|
36129 | |
36130 |
|
36131 |
|
36132 |
|
36133 |
|
36134 | this.required = rule === "required";
|
36135 |
|
36136 | |
36137 |
|
36138 |
|
36139 |
|
36140 |
|
36141 | this.repeated = rule === "repeated";
|
36142 |
|
36143 | |
36144 |
|
36145 |
|
36146 |
|
36147 |
|
36148 | this.map = rule === "map";
|
36149 |
|
36150 | |
36151 |
|
36152 |
|
36153 |
|
36154 |
|
36155 |
|
36156 | this.keyType = keytype || null;
|
36157 |
|
36158 | |
36159 |
|
36160 |
|
36161 |
|
36162 |
|
36163 |
|
36164 | this.type = type;
|
36165 |
|
36166 | |
36167 |
|
36168 |
|
36169 |
|
36170 |
|
36171 | this.resolvedType = null;
|
36172 |
|
36173 | |
36174 |
|
36175 |
|
36176 |
|
36177 |
|
36178 | this.id = id;
|
36179 |
|
36180 | |
36181 |
|
36182 |
|
36183 |
|
36184 |
|
36185 |
|
36186 | this.options = options || {};
|
36187 |
|
36188 | |
36189 |
|
36190 |
|
36191 |
|
36192 |
|
36193 | this.defaultValue = null;
|
36194 |
|
36195 | |
36196 |
|
36197 |
|
36198 |
|
36199 |
|
36200 | this.oneof = oneof || null;
|
36201 |
|
36202 | |
36203 |
|
36204 |
|
36205 |
|
36206 |
|
36207 | this.syntax = syntax || 'proto2';
|
36208 |
|
36209 | |
36210 |
|
36211 |
|
36212 |
|
36213 |
|
36214 | this.originalName = this.name;
|
36215 |
|
36216 | |
36217 |
|
36218 |
|
36219 |
|
36220 |
|
36221 | this.element = null;
|
36222 |
|
36223 | |
36224 |
|
36225 |
|
36226 |
|
36227 |
|
36228 |
|
36229 | this.keyElement = null;
|
36230 |
|
36231 |
|
36232 | if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField))
|
36233 | this.name = ProtoBuf.Util.toCamelCase(this.name);
|
36234 | };
|
36235 |
|
36236 | |
36237 |
|
36238 |
|
36239 |
|
36240 | var FieldPrototype = Field.prototype = Object.create(T.prototype);
|
36241 |
|
36242 | |
36243 |
|
36244 |
|
36245 |
|
36246 |
|
36247 | FieldPrototype.build = function() {
|
36248 | this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);
|
36249 | if (this.map)
|
36250 | this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name);
|
36251 |
|
36252 |
|
36253 |
|
36254 | if (this.syntax === 'proto3' && !this.repeated && !this.map)
|
36255 | this.defaultValue = Element.defaultFieldValue(this.type);
|
36256 |
|
36257 |
|
36258 | else if (typeof this.options['default'] !== 'undefined')
|
36259 | this.defaultValue = this.verifyValue(this.options['default']);
|
36260 | };
|
36261 |
|
36262 | |
36263 |
|
36264 |
|
36265 |
|
36266 |
|
36267 |
|
36268 |
|
36269 |
|
36270 | FieldPrototype.verifyValue = function(value, skipRepeated) {
|
36271 | skipRepeated = skipRepeated || false;
|
36272 | var self = this;
|
36273 | function fail(val, msg) {
|
36274 | throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");
|
36275 | }
|
36276 | if (value === null) {
|
36277 | if (this.required)
|
36278 | fail(typeof value, "required");
|
36279 | if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES["message"])
|
36280 | fail(typeof value, "proto3 field without field presence cannot be null");
|
36281 | return null;
|
36282 | }
|
36283 | var i;
|
36284 | if (this.repeated && !skipRepeated) {
|
36285 | if (!Array.isArray(value))
|
36286 | value = [value];
|
36287 | var res = [];
|
36288 | for (i=0; i<value.length; i++)
|
36289 | res.push(this.element.verifyValue(value[i]));
|
36290 | return res;
|
36291 | }
|
36292 | if (this.map && !skipRepeated) {
|
36293 | if (!(value instanceof ProtoBuf.Map)) {
|
36294 |
|
36295 | if (!(value instanceof Object)) {
|
36296 | fail(typeof value,
|
36297 | "expected ProtoBuf.Map or raw object for map field");
|
36298 | }
|
36299 | return new ProtoBuf.Map(this, value);
|
36300 | } else {
|
36301 | return value;
|
36302 | }
|
36303 | }
|
36304 |
|
36305 | if (!this.repeated && Array.isArray(value))
|
36306 | fail(typeof value, "no array expected");
|
36307 |
|
36308 | return this.element.verifyValue(value);
|
36309 | };
|
36310 |
|
36311 | |
36312 |
|
36313 |
|
36314 |
|
36315 |
|
36316 |
|
36317 |
|
36318 | FieldPrototype.hasWirePresence = function(value, message) {
|
36319 | if (this.syntax !== 'proto3')
|
36320 | return (value !== null);
|
36321 | if (this.oneof && message[this.oneof.name] === this.name)
|
36322 | return true;
|
36323 | switch (this.type) {
|
36324 | case ProtoBuf.TYPES["int32"]:
|
36325 | case ProtoBuf.TYPES["sint32"]:
|
36326 | case ProtoBuf.TYPES["sfixed32"]:
|
36327 | case ProtoBuf.TYPES["uint32"]:
|
36328 | case ProtoBuf.TYPES["fixed32"]:
|
36329 | return value !== 0;
|
36330 |
|
36331 | case ProtoBuf.TYPES["int64"]:
|
36332 | case ProtoBuf.TYPES["sint64"]:
|
36333 | case ProtoBuf.TYPES["sfixed64"]:
|
36334 | case ProtoBuf.TYPES["uint64"]:
|
36335 | case ProtoBuf.TYPES["fixed64"]:
|
36336 | return value.low !== 0 || value.high !== 0;
|
36337 |
|
36338 | case ProtoBuf.TYPES["bool"]:
|
36339 | return value;
|
36340 |
|
36341 | case ProtoBuf.TYPES["float"]:
|
36342 | case ProtoBuf.TYPES["double"]:
|
36343 | return value !== 0.0;
|
36344 |
|
36345 | case ProtoBuf.TYPES["string"]:
|
36346 | return value.length > 0;
|
36347 |
|
36348 | case ProtoBuf.TYPES["bytes"]:
|
36349 | return value.remaining() > 0;
|
36350 |
|
36351 | case ProtoBuf.TYPES["enum"]:
|
36352 | return value !== 0;
|
36353 |
|
36354 | case ProtoBuf.TYPES["message"]:
|
36355 | return value !== null;
|
36356 | default:
|
36357 | return true;
|
36358 | }
|
36359 | };
|
36360 |
|
36361 | |
36362 |
|
36363 |
|
36364 |
|
36365 |
|
36366 |
|
36367 |
|
36368 |
|
36369 |
|
36370 | FieldPrototype.encode = function(value, buffer, message) {
|
36371 | if (this.type === null || typeof this.type !== 'object')
|
36372 | throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);
|
36373 | if (value === null || (this.repeated && value.length == 0))
|
36374 | return buffer;
|
36375 | try {
|
36376 | if (this.repeated) {
|
36377 | var i;
|
36378 |
|
36379 |
|
36380 | if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
|
36381 |
|
36382 |
|
36383 |
|
36384 | buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
36385 | buffer.ensureCapacity(buffer.offset += 1);
|
36386 | var start = buffer.offset;
|
36387 | for (i=0; i<value.length; i++)
|
36388 | this.element.encodeValue(this.id, value[i], buffer);
|
36389 | var len = buffer.offset-start,
|
36390 | varintLen = ByteBuffer.calculateVarint32(len);
|
36391 | if (varintLen > 1) {
|
36392 | var contents = buffer.slice(start, buffer.offset);
|
36393 | start += varintLen-1;
|
36394 | buffer.offset = start;
|
36395 | buffer.append(contents);
|
36396 | }
|
36397 | buffer.writeVarint32(len, start-varintLen);
|
36398 | } else {
|
36399 |
|
36400 |
|
36401 | for (i=0; i<value.length; i++)
|
36402 | buffer.writeVarint32((this.id << 3) | this.type.wireType),
|
36403 | this.element.encodeValue(this.id, value[i], buffer);
|
36404 | }
|
36405 | } else if (this.map) {
|
36406 |
|
36407 | value.forEach(function(val, key, m) {
|
36408 |
|
36409 | var length =
|
36410 | ByteBuffer.calculateVarint32((1 << 3) | this.keyType.wireType) +
|
36411 | this.keyElement.calculateLength(1, key) +
|
36412 | ByteBuffer.calculateVarint32((2 << 3) | this.type.wireType) +
|
36413 | this.element.calculateLength(2, val);
|
36414 |
|
36415 |
|
36416 | buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
36417 | buffer.writeVarint32(length);
|
36418 |
|
36419 |
|
36420 | buffer.writeVarint32((1 << 3) | this.keyType.wireType);
|
36421 | this.keyElement.encodeValue(1, key, buffer);
|
36422 | buffer.writeVarint32((2 << 3) | this.type.wireType);
|
36423 | this.element.encodeValue(2, val, buffer);
|
36424 | }, this);
|
36425 | } else {
|
36426 | if (this.hasWirePresence(value, message)) {
|
36427 | buffer.writeVarint32((this.id << 3) | this.type.wireType);
|
36428 | this.element.encodeValue(this.id, value, buffer);
|
36429 | }
|
36430 | }
|
36431 | } catch (e) {
|
36432 | throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");
|
36433 | }
|
36434 | return buffer;
|
36435 | };
|
36436 |
|
36437 | |
36438 |
|
36439 |
|
36440 |
|
36441 |
|
36442 |
|
36443 |
|
36444 | FieldPrototype.calculate = function(value, message) {
|
36445 | value = this.verifyValue(value);
|
36446 | if (this.type === null || typeof this.type !== 'object')
|
36447 | throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);
|
36448 | if (value === null || (this.repeated && value.length == 0))
|
36449 | return 0;
|
36450 | var n = 0;
|
36451 | try {
|
36452 | if (this.repeated) {
|
36453 | var i, ni;
|
36454 | if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
|
36455 | n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
36456 | ni = 0;
|
36457 | for (i=0; i<value.length; i++)
|
36458 | ni += this.element.calculateLength(this.id, value[i]);
|
36459 | n += ByteBuffer.calculateVarint32(ni);
|
36460 | n += ni;
|
36461 | } else {
|
36462 | for (i=0; i<value.length; i++)
|
36463 | n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType),
|
36464 | n += this.element.calculateLength(this.id, value[i]);
|
36465 | }
|
36466 | } else if (this.map) {
|
36467 |
|
36468 | value.forEach(function(val, key, m) {
|
36469 |
|
36470 | var length =
|
36471 | ByteBuffer.calculateVarint32((1 << 3) | this.keyType.wireType) +
|
36472 | this.keyElement.calculateLength(1, key) +
|
36473 | ByteBuffer.calculateVarint32((2 << 3) | this.type.wireType) +
|
36474 | this.element.calculateLength(2, val);
|
36475 |
|
36476 | n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
36477 | n += ByteBuffer.calculateVarint32(length);
|
36478 | n += length;
|
36479 | }, this);
|
36480 | } else {
|
36481 | if (this.hasWirePresence(value, message)) {
|
36482 | n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType);
|
36483 | n += this.element.calculateLength(this.id, value);
|
36484 | }
|
36485 | }
|
36486 | } catch (e) {
|
36487 | throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");
|
36488 | }
|
36489 | return n;
|
36490 | };
|
36491 |
|
36492 | |
36493 |
|
36494 |
|
36495 |
|
36496 |
|
36497 |
|
36498 |
|
36499 |
|
36500 |
|
36501 |
|
36502 | FieldPrototype.decode = function(wireType, buffer, skipRepeated) {
|
36503 | var value, nBytes;
|
36504 |
|
36505 |
|
36506 |
|
36507 | var wireTypeOK =
|
36508 | (!this.map && wireType == this.type.wireType) ||
|
36509 | (!skipRepeated && this.repeated && this.options["packed"] &&
|
36510 | wireType == ProtoBuf.WIRE_TYPES.LDELIM) ||
|
36511 | (this.map && wireType == ProtoBuf.WIRE_TYPES.LDELIM);
|
36512 | if (!wireTypeOK)
|
36513 | throw Error("Illegal wire type for field "+this.toString(true)+": "+wireType+" ("+this.type.wireType+" expected)");
|
36514 |
|
36515 |
|
36516 | if (wireType == ProtoBuf.WIRE_TYPES.LDELIM && this.repeated && this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
|
36517 | if (!skipRepeated) {
|
36518 | nBytes = buffer.readVarint32();
|
36519 | nBytes = buffer.offset + nBytes;
|
36520 | var values = [];
|
36521 | while (buffer.offset < nBytes)
|
36522 | values.push(this.decode(this.type.wireType, buffer, true));
|
36523 | return values;
|
36524 | }
|
36525 |
|
36526 | }
|
36527 |
|
36528 |
|
36529 | if (this.map) {
|
36530 |
|
36531 | var key = Element.defaultFieldValue(this.keyType);
|
36532 | value = Element.defaultFieldValue(this.type);
|
36533 |
|
36534 |
|
36535 | nBytes = buffer.readVarint32();
|
36536 | if (buffer.remaining() < nBytes)
|
36537 | throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());
|
36538 |
|
36539 |
|
36540 | var msgbuf = buffer.clone();
|
36541 | msgbuf.limit = msgbuf.offset + nBytes;
|
36542 | buffer.offset += nBytes;
|
36543 |
|
36544 | while (msgbuf.remaining() > 0) {
|
36545 | var tag = msgbuf.readVarint32();
|
36546 | wireType = tag & 0x07;
|
36547 | var id = tag >>> 3;
|
36548 | if (id === 1) {
|
36549 | key = this.keyElement.decode(msgbuf, wireType, id);
|
36550 | } else if (id === 2) {
|
36551 | value = this.element.decode(msgbuf, wireType, id);
|
36552 | } else {
|
36553 | throw Error("Unexpected tag in map field key/value submessage");
|
36554 | }
|
36555 | }
|
36556 |
|
36557 | return [key, value];
|
36558 | }
|
36559 |
|
36560 |
|
36561 | return this.element.decode(buffer, wireType, this.id);
|
36562 | };
|
36563 |
|
36564 | |
36565 |
|
36566 |
|
36567 |
|
36568 | Reflect.Message.Field = Field;
|
36569 |
|
36570 | |
36571 |
|
36572 |
|
36573 |
|
36574 |
|
36575 |
|
36576 |
|
36577 |
|
36578 |
|
36579 |
|
36580 |
|
36581 |
|
36582 |
|
36583 | var ExtensionField = function(builder, message, rule, type, name, id, options) {
|
36584 | Field.call(this, builder, message, rule, null, type, name, id, options);
|
36585 |
|
36586 | |
36587 |
|
36588 |
|
36589 |
|
36590 |
|
36591 | this.extension;
|
36592 | };
|
36593 |
|
36594 |
|
36595 | ExtensionField.prototype = Object.create(Field.prototype);
|
36596 |
|
36597 | |
36598 |
|
36599 |
|
36600 |
|
36601 | Reflect.Message.ExtensionField = ExtensionField;
|
36602 |
|
36603 | |
36604 |
|
36605 |
|
36606 |
|
36607 |
|
36608 |
|
36609 |
|
36610 |
|
36611 |
|
36612 | var OneOf = function(builder, message, name) {
|
36613 | T.call(this, builder, message, name);
|
36614 |
|
36615 | |
36616 |
|
36617 |
|
36618 |
|
36619 |
|
36620 | this.fields = [];
|
36621 | };
|
36622 |
|
36623 | |
36624 |
|
36625 |
|
36626 |
|
36627 | Reflect.Message.OneOf = OneOf;
|
36628 |
|
36629 | |
36630 |
|
36631 |
|
36632 |
|
36633 |
|
36634 |
|
36635 |
|
36636 |
|
36637 |
|
36638 |
|
36639 |
|
36640 | var Enum = function(builder, parent, name, options, syntax) {
|
36641 | Namespace.call(this, builder, parent, name, options, syntax);
|
36642 |
|
36643 | |
36644 |
|
36645 |
|
36646 | this.className = "Enum";
|
36647 |
|
36648 | |
36649 |
|
36650 |
|
36651 |
|
36652 |
|
36653 | this.object = null;
|
36654 | };
|
36655 |
|
36656 | |
36657 |
|
36658 |
|
36659 |
|
36660 |
|
36661 |
|
36662 |
|
36663 | Enum.getName = function(enm, value) {
|
36664 | var keys = Object.keys(enm);
|
36665 | for (var i=0, key; i<keys.length; ++i)
|
36666 | if (enm[key = keys[i]] === value)
|
36667 | return key;
|
36668 | return null;
|
36669 | };
|
36670 |
|
36671 | |
36672 |
|
36673 |
|
36674 |
|
36675 | var EnumPrototype = Enum.prototype = Object.create(Namespace.prototype);
|
36676 |
|
36677 | |
36678 |
|
36679 |
|
36680 |
|
36681 |
|
36682 |
|
36683 | EnumPrototype.build = function(rebuild) {
|
36684 | if (this.object && !rebuild)
|
36685 | return this.object;
|
36686 | var enm = new ProtoBuf.Builder.Enum(),
|
36687 | values = this.getChildren(Enum.Value);
|
36688 | for (var i=0, k=values.length; i<k; ++i)
|
36689 | enm[values[i]['name']] = values[i]['id'];
|
36690 | if (Object.defineProperty)
|
36691 | Object.defineProperty(enm, '$options', {
|
36692 | "value": this.buildOpt(),
|
36693 | "enumerable": false
|
36694 | });
|
36695 | return this.object = enm;
|
36696 | };
|
36697 |
|
36698 | |
36699 |
|
36700 |
|
36701 |
|
36702 | Reflect.Enum = Enum;
|
36703 |
|
36704 | |
36705 |
|
36706 |
|
36707 |
|
36708 |
|
36709 |
|
36710 |
|
36711 |
|
36712 |
|
36713 |
|
36714 | var Value = function(builder, enm, name, id) {
|
36715 | T.call(this, builder, enm, name);
|
36716 |
|
36717 | |
36718 |
|
36719 |
|
36720 | this.className = "Enum.Value";
|
36721 |
|
36722 | |
36723 |
|
36724 |
|
36725 |
|
36726 |
|
36727 | this.id = id;
|
36728 | };
|
36729 |
|
36730 |
|
36731 | Value.prototype = Object.create(T.prototype);
|
36732 |
|
36733 | |
36734 |
|
36735 |
|
36736 |
|
36737 | Reflect.Enum.Value = Value;
|
36738 |
|
36739 | |
36740 |
|
36741 |
|
36742 |
|
36743 |
|
36744 |
|
36745 |
|
36746 |
|
36747 |
|
36748 | var Extension = function(builder, parent, name, field) {
|
36749 | T.call(this, builder, parent, name);
|
36750 |
|
36751 | |
36752 |
|
36753 |
|
36754 |
|
36755 |
|
36756 | this.field = field;
|
36757 | };
|
36758 |
|
36759 |
|
36760 | Extension.prototype = Object.create(T.prototype);
|
36761 |
|
36762 | |
36763 |
|
36764 |
|
36765 |
|
36766 | Reflect.Extension = Extension;
|
36767 |
|
36768 | |
36769 |
|
36770 |
|
36771 |
|
36772 |
|
36773 |
|
36774 |
|
36775 |
|
36776 |
|
36777 |
|
36778 | var Service = function(builder, root, name, options) {
|
36779 | Namespace.call(this, builder, root, name, options);
|
36780 |
|
36781 | |
36782 |
|
36783 |
|
36784 | this.className = "Service";
|
36785 |
|
36786 | |
36787 |
|
36788 |
|
36789 |
|
36790 | this.clazz = null;
|
36791 | };
|
36792 |
|
36793 | |
36794 |
|
36795 |
|
36796 |
|
36797 | var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);
|
36798 |
|
36799 | |
36800 |
|
36801 |
|
36802 |
|
36803 |
|
36804 |
|
36805 |
|
36806 |
|
36807 | ServicePrototype.build = function(rebuild) {
|
36808 | if (this.clazz && !rebuild)
|
36809 | return this.clazz;
|
36810 |
|
36811 |
|
36812 | return this.clazz = (function(ProtoBuf, T) {
|
36813 |
|
36814 | |
36815 |
|
36816 |
|
36817 |
|
36818 |
|
36819 |
|
36820 |
|
36821 |
|
36822 | var Service = function(rpcImpl) {
|
36823 | ProtoBuf.Builder.Service.call(this);
|
36824 |
|
36825 | |
36826 |
|
36827 |
|
36828 |
|
36829 |
|
36830 |
|
36831 | this.rpcImpl = rpcImpl || function(name, msg, callback) {
|
36832 |
|
36833 |
|
36834 |
|
36835 | setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0);
|
36836 | };
|
36837 | };
|
36838 |
|
36839 | |
36840 |
|
36841 |
|
36842 |
|
36843 | var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);
|
36844 |
|
36845 | |
36846 |
|
36847 |
|
36848 |
|
36849 |
|
36850 |
|
36851 |
|
36852 |
|
36853 |
|
36854 |
|
36855 |
|
36856 | |
36857 |
|
36858 |
|
36859 |
|
36860 |
|
36861 |
|
36862 |
|
36863 |
|
36864 |
|
36865 |
|
36866 | var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);
|
36867 | for (var i=0; i<rpc.length; i++) {
|
36868 | (function(method) {
|
36869 |
|
36870 |
|
36871 | ServicePrototype[method.name] = function(req, callback) {
|
36872 | try {
|
36873 | try {
|
36874 |
|
36875 | req = method.resolvedRequestType.clazz.decode(ByteBuffer.wrap(req));
|
36876 | } catch (err) {
|
36877 | if (!(err instanceof TypeError))
|
36878 | throw err;
|
36879 | }
|
36880 | if (req === null || typeof req !== 'object')
|
36881 | throw Error("Illegal arguments");
|
36882 | if (!(req instanceof method.resolvedRequestType.clazz))
|
36883 | req = new method.resolvedRequestType.clazz(req);
|
36884 | this.rpcImpl(method.fqn(), req, function(err, res) {
|
36885 | if (err) {
|
36886 | callback(err);
|
36887 | return;
|
36888 | }
|
36889 |
|
36890 | if (res === null)
|
36891 | res = ''
|
36892 | try { res = method.resolvedResponseType.clazz.decode(res); } catch (notABuffer) {}
|
36893 | if (!res || !(res instanceof method.resolvedResponseType.clazz)) {
|
36894 | callback(Error("Illegal response type received in service method "+ T.name+"#"+method.name));
|
36895 | return;
|
36896 | }
|
36897 | callback(null, res);
|
36898 | });
|
36899 | } catch (err) {
|
36900 | setTimeout(callback.bind(this, err), 0);
|
36901 | }
|
36902 | };
|
36903 |
|
36904 |
|
36905 | Service[method.name] = function(rpcImpl, req, callback) {
|
36906 | new Service(rpcImpl)[method.name](req, callback);
|
36907 | };
|
36908 |
|
36909 | if (Object.defineProperty)
|
36910 | Object.defineProperty(Service[method.name], "$options", { "value": method.buildOpt() }),
|
36911 | Object.defineProperty(ServicePrototype[method.name], "$options", { "value": Service[method.name]["$options"] });
|
36912 | })(rpc[i]);
|
36913 | }
|
36914 |
|
36915 |
|
36916 |
|
36917 | |
36918 |
|
36919 |
|
36920 |
|
36921 |
|
36922 |
|
36923 | var $optionsS;
|
36924 |
|
36925 | |
36926 |
|
36927 |
|
36928 |
|
36929 |
|
36930 |
|
36931 | var $options;
|
36932 |
|
36933 | |
36934 |
|
36935 |
|
36936 |
|
36937 |
|
36938 |
|
36939 | var $typeS;
|
36940 |
|
36941 | |
36942 |
|
36943 |
|
36944 |
|
36945 |
|
36946 |
|
36947 | var $type;
|
36948 |
|
36949 | if (Object.defineProperty)
|
36950 | Object.defineProperty(Service, "$options", { "value": T.buildOpt() }),
|
36951 | Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }),
|
36952 | Object.defineProperty(Service, "$type", { "value": T }),
|
36953 | Object.defineProperty(ServicePrototype, "$type", { "value": T });
|
36954 |
|
36955 | return Service;
|
36956 |
|
36957 | })(ProtoBuf, this);
|
36958 | };
|
36959 |
|
36960 | |
36961 |
|
36962 |
|
36963 |
|
36964 | Reflect.Service = Service;
|
36965 |
|
36966 | |
36967 |
|
36968 |
|
36969 |
|
36970 |
|
36971 |
|
36972 |
|
36973 |
|
36974 |
|
36975 |
|
36976 | var Method = function(builder, svc, name, options) {
|
36977 | T.call(this, builder, svc, name);
|
36978 |
|
36979 | |
36980 |
|
36981 |
|
36982 | this.className = "Service.Method";
|
36983 |
|
36984 | |
36985 |
|
36986 |
|
36987 |
|
36988 |
|
36989 | this.options = options || {};
|
36990 | };
|
36991 |
|
36992 | |
36993 |
|
36994 |
|
36995 |
|
36996 | var MethodPrototype = Method.prototype = Object.create(T.prototype);
|
36997 |
|
36998 | |
36999 |
|
37000 |
|
37001 |
|
37002 |
|
37003 |
|
37004 | MethodPrototype.buildOpt = NamespacePrototype.buildOpt;
|
37005 |
|
37006 | |
37007 |
|
37008 |
|
37009 |
|
37010 | Reflect.Service.Method = Method;
|
37011 |
|
37012 | |
37013 |
|
37014 |
|
37015 |
|
37016 |
|
37017 |
|
37018 |
|
37019 |
|
37020 |
|
37021 |
|
37022 |
|
37023 |
|
37024 |
|
37025 |
|
37026 | var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {
|
37027 | Method.call(this, builder, svc, name, options);
|
37028 |
|
37029 | |
37030 |
|
37031 |
|
37032 | this.className = "Service.RPCMethod";
|
37033 |
|
37034 | |
37035 |
|
37036 |
|
37037 |
|
37038 |
|
37039 | this.requestName = request;
|
37040 |
|
37041 | |
37042 |
|
37043 |
|
37044 |
|
37045 |
|
37046 | this.responseName = response;
|
37047 |
|
37048 | |
37049 |
|
37050 |
|
37051 |
|
37052 |
|
37053 | this.requestStream = request_stream;
|
37054 |
|
37055 | |
37056 |
|
37057 |
|
37058 |
|
37059 |
|
37060 | this.responseStream = response_stream;
|
37061 |
|
37062 | |
37063 |
|
37064 |
|
37065 |
|
37066 |
|
37067 | this.resolvedRequestType = null;
|
37068 |
|
37069 | |
37070 |
|
37071 |
|
37072 |
|
37073 |
|
37074 | this.resolvedResponseType = null;
|
37075 | };
|
37076 |
|
37077 |
|
37078 | RPCMethod.prototype = Object.create(Method.prototype);
|
37079 |
|
37080 | |
37081 |
|
37082 |
|
37083 |
|
37084 | Reflect.Service.RPCMethod = RPCMethod;
|
37085 |
|
37086 | return Reflect;
|
37087 |
|
37088 | })(ProtoBuf);
|
37089 |
|
37090 | |
37091 |
|
37092 |
|
37093 |
|
37094 | ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {
|
37095 | "use strict";
|
37096 |
|
37097 | |
37098 |
|
37099 |
|
37100 |
|
37101 |
|
37102 |
|
37103 |
|
37104 | var Builder = function(options) {
|
37105 |
|
37106 | |
37107 |
|
37108 |
|
37109 |
|
37110 |
|
37111 | this.ns = new Reflect.Namespace(this, null, "");
|
37112 |
|
37113 | |
37114 |
|
37115 |
|
37116 |
|
37117 |
|
37118 | this.ptr = this.ns;
|
37119 |
|
37120 | |
37121 |
|
37122 |
|
37123 |
|
37124 |
|
37125 | this.resolved = false;
|
37126 |
|
37127 | |
37128 |
|
37129 |
|
37130 |
|
37131 |
|
37132 | this.result = null;
|
37133 |
|
37134 | |
37135 |
|
37136 |
|
37137 |
|
37138 |
|
37139 | this.files = {};
|
37140 |
|
37141 | |
37142 |
|
37143 |
|
37144 |
|
37145 |
|
37146 | this.importRoot = null;
|
37147 |
|
37148 | |
37149 |
|
37150 |
|
37151 |
|
37152 |
|
37153 | this.options = options || {};
|
37154 | };
|
37155 |
|
37156 | |
37157 |
|
37158 |
|
37159 |
|
37160 | var BuilderPrototype = Builder.prototype;
|
37161 |
|
37162 |
|
37163 |
|
37164 | |
37165 |
|
37166 |
|
37167 |
|
37168 |
|
37169 |
|
37170 | Builder.isMessage = function(def) {
|
37171 |
|
37172 | if (typeof def["name"] !== 'string')
|
37173 | return false;
|
37174 |
|
37175 | if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined')
|
37176 | return false;
|
37177 | return true;
|
37178 | };
|
37179 |
|
37180 | |
37181 |
|
37182 |
|
37183 |
|
37184 |
|
37185 |
|
37186 | Builder.isMessageField = function(def) {
|
37187 |
|
37188 | if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined')
|
37189 | return false;
|
37190 | return true;
|
37191 | };
|
37192 |
|
37193 | |
37194 |
|
37195 |
|
37196 |
|
37197 |
|
37198 |
|
37199 | Builder.isEnum = function(def) {
|
37200 |
|
37201 | if (typeof def["name"] !== 'string')
|
37202 | return false;
|
37203 |
|
37204 | if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0)
|
37205 | return false;
|
37206 | return true;
|
37207 | };
|
37208 |
|
37209 | |
37210 |
|
37211 |
|
37212 |
|
37213 |
|
37214 |
|
37215 | Builder.isService = function(def) {
|
37216 |
|
37217 | if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"])
|
37218 | return false;
|
37219 | return true;
|
37220 | };
|
37221 |
|
37222 | |
37223 |
|
37224 |
|
37225 |
|
37226 |
|
37227 |
|
37228 | Builder.isExtend = function(def) {
|
37229 |
|
37230 | if (typeof def["ref"] !== 'string')
|
37231 | return false;
|
37232 | return true;
|
37233 | };
|
37234 |
|
37235 |
|
37236 |
|
37237 | |
37238 |
|
37239 |
|
37240 |
|
37241 |
|
37242 | BuilderPrototype.reset = function() {
|
37243 | this.ptr = this.ns;
|
37244 | return this;
|
37245 | };
|
37246 |
|
37247 | |
37248 |
|
37249 |
|
37250 |
|
37251 |
|
37252 |
|
37253 | BuilderPrototype.define = function(namespace) {
|
37254 | if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))
|
37255 | throw Error("illegal namespace: "+namespace);
|
37256 | namespace.split(".").forEach(function(part) {
|
37257 | var ns = this.ptr.getChild(part);
|
37258 | if (ns === null)
|
37259 | this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));
|
37260 | this.ptr = ns;
|
37261 | }, this);
|
37262 | return this;
|
37263 | };
|
37264 |
|
37265 | |
37266 |
|
37267 |
|
37268 |
|
37269 |
|
37270 |
|
37271 |
|
37272 | BuilderPrototype.create = function(defs) {
|
37273 | if (!defs)
|
37274 | return this;
|
37275 | if (!Array.isArray(defs))
|
37276 | defs = [defs];
|
37277 | else {
|
37278 | if (defs.length === 0)
|
37279 | return this;
|
37280 | defs = defs.slice();
|
37281 | }
|
37282 |
|
37283 |
|
37284 | var stack = [defs];
|
37285 | while (stack.length > 0) {
|
37286 | defs = stack.pop();
|
37287 |
|
37288 | if (!Array.isArray(defs))
|
37289 | throw Error("not a valid namespace: "+JSON.stringify(defs));
|
37290 |
|
37291 | while (defs.length > 0) {
|
37292 | var def = defs.shift();
|
37293 |
|
37294 | if (Builder.isMessage(def)) {
|
37295 | var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]);
|
37296 |
|
37297 |
|
37298 | var oneofs = {};
|
37299 | if (def["oneofs"])
|
37300 | Object.keys(def["oneofs"]).forEach(function(name) {
|
37301 | obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));
|
37302 | }, this);
|
37303 |
|
37304 |
|
37305 | if (def["fields"])
|
37306 | def["fields"].forEach(function(fld) {
|
37307 | if (obj.getChild(fld["id"]|0) !== null)
|
37308 | throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']);
|
37309 | if (fld["options"] && typeof fld["options"] !== 'object')
|
37310 | throw Error("illegal field options in "+obj.name+"#"+fld["name"]);
|
37311 | var oneof = null;
|
37312 | if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]]))
|
37313 | throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]);
|
37314 | fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]);
|
37315 | if (oneof)
|
37316 | oneof.fields.push(fld);
|
37317 | obj.addChild(fld);
|
37318 | }, this);
|
37319 |
|
37320 |
|
37321 | var subObj = [];
|
37322 | if (def["enums"])
|
37323 | def["enums"].forEach(function(enm) {
|
37324 | subObj.push(enm);
|
37325 | });
|
37326 | if (def["messages"])
|
37327 | def["messages"].forEach(function(msg) {
|
37328 | subObj.push(msg);
|
37329 | });
|
37330 | if (def["services"])
|
37331 | def["services"].forEach(function(svc) {
|
37332 | subObj.push(svc);
|
37333 | });
|
37334 |
|
37335 |
|
37336 | if (def["extensions"]) {
|
37337 | if (typeof def["extensions"][0] === 'number')
|
37338 | obj.extensions = [ def["extensions"] ];
|
37339 | else
|
37340 | obj.extensions = def["extensions"];
|
37341 | }
|
37342 |
|
37343 |
|
37344 | this.ptr.addChild(obj);
|
37345 | if (subObj.length > 0) {
|
37346 | stack.push(defs);
|
37347 | defs = subObj;
|
37348 | subObj = null;
|
37349 | this.ptr = obj;
|
37350 | obj = null;
|
37351 | continue;
|
37352 | }
|
37353 | subObj = null;
|
37354 |
|
37355 | } else if (Builder.isEnum(def)) {
|
37356 |
|
37357 | obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]);
|
37358 | def["values"].forEach(function(val) {
|
37359 | obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"]));
|
37360 | }, this);
|
37361 | this.ptr.addChild(obj);
|
37362 |
|
37363 | } else if (Builder.isService(def)) {
|
37364 |
|
37365 | obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]);
|
37366 | Object.keys(def["rpc"]).forEach(function(name) {
|
37367 | var mtd = def["rpc"][name];
|
37368 | obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"]));
|
37369 | }, this);
|
37370 | this.ptr.addChild(obj);
|
37371 |
|
37372 | } else if (Builder.isExtend(def)) {
|
37373 |
|
37374 | obj = this.ptr.resolve(def["ref"], true);
|
37375 | if (obj) {
|
37376 | def["fields"].forEach(function(fld) {
|
37377 | if (obj.getChild(fld['id']|0) !== null)
|
37378 | throw Error("duplicate extended field id in "+obj.name+": "+fld['id']);
|
37379 |
|
37380 | if (obj.extensions) {
|
37381 | var valid = false;
|
37382 | obj.extensions.forEach(function(range) {
|
37383 | if (fld["id"] >= range[0] && fld["id"] <= range[1])
|
37384 | valid = true;
|
37385 | });
|
37386 | if (!valid)
|
37387 | throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)");
|
37388 | }
|
37389 |
|
37390 | var name = fld["name"];
|
37391 | if (this.options['convertFieldsToCamelCase'])
|
37392 | name = ProtoBuf.Util.toCamelCase(name);
|
37393 |
|
37394 | var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]);
|
37395 |
|
37396 |
|
37397 |
|
37398 | var ext = new Reflect.Extension(this, this.ptr, fld["name"], field);
|
37399 | field.extension = ext;
|
37400 | this.ptr.addChild(ext);
|
37401 | obj.addChild(field);
|
37402 | }, this);
|
37403 |
|
37404 | } else if (!/\.?google\.protobuf\./.test(def["ref"]))
|
37405 | throw Error("extended message "+def["ref"]+" is not defined");
|
37406 |
|
37407 | } else
|
37408 | throw Error("not a valid definition: "+JSON.stringify(def));
|
37409 |
|
37410 | def = null;
|
37411 | obj = null;
|
37412 | }
|
37413 |
|
37414 | defs = null;
|
37415 | this.ptr = this.ptr.parent;
|
37416 | }
|
37417 | this.resolved = false;
|
37418 | this.result = null;
|
37419 | return this;
|
37420 | };
|
37421 |
|
37422 | |
37423 |
|
37424 |
|
37425 |
|
37426 |
|
37427 | function propagateSyntax(parent) {
|
37428 | if (parent['messages']) {
|
37429 | parent['messages'].forEach(function(child) {
|
37430 | child["syntax"] = parent["syntax"];
|
37431 | propagateSyntax(child);
|
37432 | });
|
37433 | }
|
37434 | if (parent['enums']) {
|
37435 | parent['enums'].forEach(function(child) {
|
37436 | child["syntax"] = parent["syntax"];
|
37437 | });
|
37438 | }
|
37439 | }
|
37440 |
|
37441 | |
37442 |
|
37443 |
|
37444 |
|
37445 |
|
37446 |
|
37447 |
|
37448 |
|
37449 | BuilderPrototype["import"] = function(json, filename) {
|
37450 | var delim = '/';
|
37451 |
|
37452 |
|
37453 |
|
37454 | if (typeof filename === 'string') {
|
37455 |
|
37456 | if (ProtoBuf.Util.IS_NODE)
|
37457 | filename = __webpack_require__(118)['resolve'](filename);
|
37458 | if (this.files[filename] === true)
|
37459 | return this.reset();
|
37460 | this.files[filename] = true;
|
37461 |
|
37462 | } else if (typeof filename === 'object') {
|
37463 |
|
37464 | var root = filename.root;
|
37465 | if (ProtoBuf.Util.IS_NODE)
|
37466 | root = __webpack_require__(118)['resolve'](root);
|
37467 | if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0)
|
37468 | delim = '\\';
|
37469 | var fname;
|
37470 | if (ProtoBuf.Util.IS_NODE)
|
37471 | fname = __webpack_require__(118)['join'](root, filename.file);
|
37472 | else
|
37473 | fname = root + delim + filename.file;
|
37474 | if (this.files[fname] === true)
|
37475 | return this.reset();
|
37476 | this.files[fname] = true;
|
37477 | }
|
37478 |
|
37479 |
|
37480 |
|
37481 | if (json['imports'] && json['imports'].length > 0) {
|
37482 | var importRoot,
|
37483 | resetRoot = false;
|
37484 |
|
37485 | if (typeof filename === 'object') {
|
37486 |
|
37487 | this.importRoot = filename["root"]; resetRoot = true;
|
37488 | importRoot = this.importRoot;
|
37489 | filename = filename["file"];
|
37490 | if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0)
|
37491 | delim = '\\';
|
37492 |
|
37493 | } else if (typeof filename === 'string') {
|
37494 |
|
37495 | if (this.importRoot)
|
37496 | importRoot = this.importRoot;
|
37497 | else {
|
37498 | if (filename.indexOf("/") >= 0) {
|
37499 | importRoot = filename.replace(/\/[^\/]*$/, "");
|
37500 | if ( importRoot === "")
|
37501 | importRoot = "/";
|
37502 | } else if (filename.indexOf("\\") >= 0) {
|
37503 | importRoot = filename.replace(/\\[^\\]*$/, "");
|
37504 | delim = '\\';
|
37505 | } else
|
37506 | importRoot = ".";
|
37507 | }
|
37508 |
|
37509 | } else
|
37510 | importRoot = null;
|
37511 |
|
37512 | for (var i=0; i<json['imports'].length; i++) {
|
37513 | if (typeof json['imports'][i] === 'string') {
|
37514 | if (!importRoot)
|
37515 | throw Error("cannot determine import root");
|
37516 | var importFilename = json['imports'][i];
|
37517 | if (importFilename === "google/protobuf/descriptor.proto")
|
37518 | continue;
|
37519 | if (ProtoBuf.Util.IS_NODE)
|
37520 | importFilename = __webpack_require__(118)['join'](importRoot, importFilename);
|
37521 | else
|
37522 | importFilename = importRoot + delim + importFilename;
|
37523 | if (this.files[importFilename] === true)
|
37524 | continue;
|
37525 | if (/\.proto$/i.test(importFilename) && !ProtoBuf.DotProto)
|
37526 | importFilename = importFilename.replace(/\.proto$/, ".json");
|
37527 | var contents = ProtoBuf.Util.fetch(importFilename);
|
37528 | if (contents === null)
|
37529 | throw Error("failed to import '"+importFilename+"' in '"+filename+"': file not found");
|
37530 | if (/\.json$/i.test(importFilename))
|
37531 | this["import"](JSON.parse(contents+""), importFilename);
|
37532 | else
|
37533 | this["import"](ProtoBuf.DotProto.Parser.parse(contents), importFilename);
|
37534 | } else
|
37535 | if (!filename)
|
37536 | this["import"](json['imports'][i]);
|
37537 | else if (/\.(\w+)$/.test(filename))
|
37538 | this["import"](json['imports'][i], filename.replace(/^(.+)\.(\w+)$/, function($0, $1, $2) { return $1+"_import"+i+"."+$2; }));
|
37539 | else
|
37540 | this["import"](json['imports'][i], filename+"_import"+i);
|
37541 | }
|
37542 | if (resetRoot)
|
37543 | this.importRoot = null;
|
37544 | }
|
37545 |
|
37546 |
|
37547 |
|
37548 | if (json['package'])
|
37549 | this.define(json['package']);
|
37550 | if (json['syntax'])
|
37551 | propagateSyntax(json);
|
37552 | var base = this.ptr;
|
37553 | if (json['options'])
|
37554 | Object.keys(json['options']).forEach(function(key) {
|
37555 | base.options[key] = json['options'][key];
|
37556 | });
|
37557 | if (json['messages'])
|
37558 | this.create(json['messages']),
|
37559 | this.ptr = base;
|
37560 | if (json['enums'])
|
37561 | this.create(json['enums']),
|
37562 | this.ptr = base;
|
37563 | if (json['services'])
|
37564 | this.create(json['services']),
|
37565 | this.ptr = base;
|
37566 | if (json['extends'])
|
37567 | this.create(json['extends']);
|
37568 |
|
37569 | return this.reset();
|
37570 | };
|
37571 |
|
37572 | |
37573 |
|
37574 |
|
37575 |
|
37576 |
|
37577 |
|
37578 | BuilderPrototype.resolveAll = function() {
|
37579 |
|
37580 | var res;
|
37581 | if (this.ptr == null || typeof this.ptr.type === 'object')
|
37582 | return this;
|
37583 |
|
37584 | if (this.ptr instanceof Reflect.Namespace) {
|
37585 |
|
37586 | this.ptr.children.forEach(function(child) {
|
37587 | this.ptr = child;
|
37588 | this.resolveAll();
|
37589 | }, this);
|
37590 |
|
37591 | } else if (this.ptr instanceof Reflect.Message.Field) {
|
37592 |
|
37593 | if (!Lang.TYPE.test(this.ptr.type)) {
|
37594 | if (!Lang.TYPEREF.test(this.ptr.type))
|
37595 | throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
|
37596 | res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, true);
|
37597 | if (!res)
|
37598 | throw Error("unresolvable type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
|
37599 | this.ptr.resolvedType = res;
|
37600 | if (res instanceof Reflect.Enum) {
|
37601 | this.ptr.type = ProtoBuf.TYPES["enum"];
|
37602 | if (this.ptr.syntax === 'proto3' && res.syntax !== 'proto3')
|
37603 | throw Error("proto3 message cannot reference proto2 enum");
|
37604 | }
|
37605 | else if (res instanceof Reflect.Message)
|
37606 | this.ptr.type = res.isGroup ? ProtoBuf.TYPES["group"] : ProtoBuf.TYPES["message"];
|
37607 | else
|
37608 | throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
|
37609 | } else
|
37610 | this.ptr.type = ProtoBuf.TYPES[this.ptr.type];
|
37611 |
|
37612 |
|
37613 |
|
37614 | if (this.ptr.map) {
|
37615 | if (!Lang.TYPE.test(this.ptr.keyType))
|
37616 | throw Error("illegal key type for map field in "+this.ptr.toString(true)+": "+this.ptr.keyType);
|
37617 | this.ptr.keyType = ProtoBuf.TYPES[this.ptr.keyType];
|
37618 | }
|
37619 |
|
37620 |
|
37621 |
|
37622 | if (
|
37623 | this.ptr.syntax === 'proto3' &&
|
37624 | this.ptr.repeated && this.ptr.options.packed === undefined &&
|
37625 | ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) !== -1
|
37626 | ) {
|
37627 | this.ptr.options.packed = true;
|
37628 | }
|
37629 |
|
37630 | } else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) {
|
37631 |
|
37632 | if (this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod) {
|
37633 | res = this.ptr.parent.resolve(this.ptr.requestName, true);
|
37634 | if (!res || !(res instanceof ProtoBuf.Reflect.Message))
|
37635 | throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.requestName);
|
37636 | this.ptr.resolvedRequestType = res;
|
37637 | res = this.ptr.parent.resolve(this.ptr.responseName, true);
|
37638 | if (!res || !(res instanceof ProtoBuf.Reflect.Message))
|
37639 | throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.responseName);
|
37640 | this.ptr.resolvedResponseType = res;
|
37641 | } else
|
37642 | throw Error("illegal service type in "+this.ptr.toString(true));
|
37643 |
|
37644 | } else if (
|
37645 | !(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf) &&
|
37646 | !(this.ptr instanceof ProtoBuf.Reflect.Extension) &&
|
37647 | !(this.ptr instanceof ProtoBuf.Reflect.Enum.Value)
|
37648 | )
|
37649 | throw Error("illegal object in namespace: "+typeof(this.ptr)+": "+this.ptr);
|
37650 |
|
37651 | return this.reset();
|
37652 | };
|
37653 |
|
37654 | |
37655 |
|
37656 |
|
37657 |
|
37658 |
|
37659 |
|
37660 |
|
37661 |
|
37662 | BuilderPrototype.build = function(path) {
|
37663 | this.reset();
|
37664 | if (!this.resolved)
|
37665 | this.resolveAll(),
|
37666 | this.resolved = true,
|
37667 | this.result = null;
|
37668 | if (this.result === null)
|
37669 | this.result = this.ns.build();
|
37670 | if (!path)
|
37671 | return this.result;
|
37672 | var part = typeof path === 'string' ? path.split(".") : path,
|
37673 | ptr = this.result;
|
37674 | for (var i=0; i<part.length; i++)
|
37675 | if (ptr[part[i]])
|
37676 | ptr = ptr[part[i]];
|
37677 | else {
|
37678 | ptr = null;
|
37679 | break;
|
37680 | }
|
37681 | return ptr;
|
37682 | };
|
37683 |
|
37684 | |
37685 |
|
37686 |
|
37687 |
|
37688 |
|
37689 |
|
37690 | BuilderPrototype.lookup = function(path, excludeNonNamespace) {
|
37691 | return path ? this.ns.resolve(path, excludeNonNamespace) : this.ns;
|
37692 | };
|
37693 |
|
37694 | |
37695 |
|
37696 |
|
37697 |
|
37698 |
|
37699 | BuilderPrototype.toString = function() {
|
37700 | return "Builder";
|
37701 | };
|
37702 |
|
37703 |
|
37704 |
|
37705 |
|
37706 | |
37707 |
|
37708 |
|
37709 | Builder.Message = function() {};
|
37710 |
|
37711 | |
37712 |
|
37713 |
|
37714 | Builder.Enum = function() {};
|
37715 |
|
37716 | |
37717 |
|
37718 |
|
37719 | Builder.Service = function() {};
|
37720 |
|
37721 | return Builder;
|
37722 |
|
37723 | })(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect);
|
37724 |
|
37725 | |
37726 |
|
37727 |
|
37728 |
|
37729 | ProtoBuf.Map = (function(ProtoBuf, Reflect) {
|
37730 | "use strict";
|
37731 |
|
37732 | |
37733 |
|
37734 |
|
37735 |
|
37736 |
|
37737 |
|
37738 |
|
37739 |
|
37740 |
|
37741 |
|
37742 |
|
37743 | var Map = function(field, contents) {
|
37744 | if (!field.map)
|
37745 | throw Error("field is not a map");
|
37746 |
|
37747 | |
37748 |
|
37749 |
|
37750 |
|
37751 | this.field = field;
|
37752 |
|
37753 | |
37754 |
|
37755 |
|
37756 |
|
37757 | this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);
|
37758 |
|
37759 | |
37760 |
|
37761 |
|
37762 |
|
37763 | this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);
|
37764 |
|
37765 | |
37766 |
|
37767 |
|
37768 |
|
37769 |
|
37770 |
|
37771 |
|
37772 |
|
37773 |
|
37774 |
|
37775 |
|
37776 |
|
37777 |
|
37778 |
|
37779 | this.map = {};
|
37780 |
|
37781 | |
37782 |
|
37783 |
|
37784 | Object.defineProperty(this, "size", {
|
37785 | get: function() { return Object.keys(this.map).length; }
|
37786 | });
|
37787 |
|
37788 |
|
37789 | if (contents) {
|
37790 | var keys = Object.keys(contents);
|
37791 | for (var i = 0; i < keys.length; i++) {
|
37792 | var key = this.keyElem.valueFromString(keys[i]);
|
37793 | var val = this.valueElem.verifyValue(contents[keys[i]]);
|
37794 | this.map[this.keyElem.valueToString(key)] =
|
37795 | { key: key, value: val };
|
37796 | }
|
37797 | }
|
37798 | };
|
37799 |
|
37800 | var MapPrototype = Map.prototype;
|
37801 |
|
37802 | |
37803 |
|
37804 |
|
37805 |
|
37806 |
|
37807 |
|
37808 | function arrayIterator(arr) {
|
37809 | var idx = 0;
|
37810 | return {
|
37811 | next: function() {
|
37812 | if (idx < arr.length)
|
37813 | return { done: false, value: arr[idx++] };
|
37814 | return { done: true };
|
37815 | }
|
37816 | }
|
37817 | }
|
37818 |
|
37819 | |
37820 |
|
37821 |
|
37822 | MapPrototype.clear = function() {
|
37823 | this.map = {};
|
37824 | };
|
37825 |
|
37826 | |
37827 |
|
37828 |
|
37829 |
|
37830 | MapPrototype["delete"] = function(key) {
|
37831 | var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
|
37832 | var hadKey = keyValue in this.map;
|
37833 | delete this.map[keyValue];
|
37834 | return hadKey;
|
37835 | };
|
37836 |
|
37837 | |
37838 |
|
37839 |
|
37840 |
|
37841 | MapPrototype.entries = function() {
|
37842 | var entries = [];
|
37843 | var strKeys = Object.keys(this.map);
|
37844 | for (var i = 0, entry; i < strKeys.length; i++)
|
37845 | entries.push([(entry=this.map[strKeys[i]]).key, entry.value]);
|
37846 | return arrayIterator(entries);
|
37847 | };
|
37848 |
|
37849 | |
37850 |
|
37851 |
|
37852 |
|
37853 | MapPrototype.keys = function() {
|
37854 | var keys = [];
|
37855 | var strKeys = Object.keys(this.map);
|
37856 | for (var i = 0; i < strKeys.length; i++)
|
37857 | keys.push(this.map[strKeys[i]].key);
|
37858 | return arrayIterator(keys);
|
37859 | };
|
37860 |
|
37861 | |
37862 |
|
37863 |
|
37864 |
|
37865 | MapPrototype.values = function() {
|
37866 | var values = [];
|
37867 | var strKeys = Object.keys(this.map);
|
37868 | for (var i = 0; i < strKeys.length; i++)
|
37869 | values.push(this.map[strKeys[i]].value);
|
37870 | return arrayIterator(values);
|
37871 | };
|
37872 |
|
37873 | |
37874 |
|
37875 |
|
37876 |
|
37877 |
|
37878 | MapPrototype.forEach = function(cb, thisArg) {
|
37879 | var strKeys = Object.keys(this.map);
|
37880 | for (var i = 0, entry; i < strKeys.length; i++)
|
37881 | cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this);
|
37882 | };
|
37883 |
|
37884 | |
37885 |
|
37886 |
|
37887 |
|
37888 |
|
37889 |
|
37890 | MapPrototype.set = function(key, value) {
|
37891 | var keyValue = this.keyElem.verifyValue(key);
|
37892 | var valValue = this.valueElem.verifyValue(value);
|
37893 | this.map[this.keyElem.valueToString(keyValue)] =
|
37894 | { key: keyValue, value: valValue };
|
37895 | return this;
|
37896 | };
|
37897 |
|
37898 | |
37899 |
|
37900 |
|
37901 |
|
37902 |
|
37903 | MapPrototype.get = function(key) {
|
37904 | var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
|
37905 | if (!(keyValue in this.map))
|
37906 | return undefined;
|
37907 | return this.map[keyValue].value;
|
37908 | };
|
37909 |
|
37910 | |
37911 |
|
37912 |
|
37913 |
|
37914 |
|
37915 | MapPrototype.has = function(key) {
|
37916 | var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
|
37917 | return (keyValue in this.map);
|
37918 | };
|
37919 |
|
37920 | return Map;
|
37921 | })(ProtoBuf, ProtoBuf.Reflect);
|
37922 |
|
37923 |
|
37924 | |
37925 |
|
37926 |
|
37927 |
|
37928 |
|
37929 |
|
37930 | ProtoBuf.newBuilder = function(options) {
|
37931 | options = options || {};
|
37932 | if (typeof options['convertFieldsToCamelCase'] === 'undefined')
|
37933 | options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;
|
37934 | if (typeof options['populateAccessors'] === 'undefined')
|
37935 | options['populateAccessors'] = ProtoBuf.populateAccessors;
|
37936 | return new ProtoBuf.Builder(options);
|
37937 | };
|
37938 |
|
37939 | |
37940 |
|
37941 |
|
37942 |
|
37943 |
|
37944 |
|
37945 |
|
37946 |
|
37947 |
|
37948 | ProtoBuf.loadJson = function(json, builder, filename) {
|
37949 | if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string'))
|
37950 | filename = builder,
|
37951 | builder = null;
|
37952 | if (!builder || typeof builder !== 'object')
|
37953 | builder = ProtoBuf.newBuilder();
|
37954 | if (typeof json === 'string')
|
37955 | json = JSON.parse(json);
|
37956 | builder["import"](json, filename);
|
37957 | builder.resolveAll();
|
37958 | return builder;
|
37959 | };
|
37960 |
|
37961 | |
37962 |
|
37963 |
|
37964 |
|
37965 |
|
37966 |
|
37967 |
|
37968 |
|
37969 |
|
37970 |
|
37971 |
|
37972 |
|
37973 | ProtoBuf.loadJsonFile = function(filename, callback, builder) {
|
37974 | if (callback && typeof callback === 'object')
|
37975 | builder = callback,
|
37976 | callback = null;
|
37977 | else if (!callback || typeof callback !== 'function')
|
37978 | callback = null;
|
37979 | if (callback)
|
37980 | return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {
|
37981 | if (contents === null) {
|
37982 | callback(Error("Failed to fetch file"));
|
37983 | return;
|
37984 | }
|
37985 | try {
|
37986 | callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));
|
37987 | } catch (e) {
|
37988 | callback(e);
|
37989 | }
|
37990 | });
|
37991 | var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);
|
37992 | return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);
|
37993 | };
|
37994 |
|
37995 | return ProtoBuf;
|
37996 | });
|
37997 |
|
37998 |
|
37999 | }),
|
38000 |
|
38001 | (function(module, exports, __webpack_require__) {
|
38002 |
|
38003 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
38004 |
|
38005 |
|
38006 |
|
38007 |
|
38008 |
|
38009 |
|
38010 |
|
38011 |
|
38012 |
|
38013 |
|
38014 |
|
38015 |
|
38016 |
|
38017 |
|
38018 |
|
38019 |
|
38020 |
|
38021 |
|
38022 |
|
38023 |
|
38024 |
|
38025 | (function(global, factory) {
|
38026 |
|
38027 | if (true)
|
38028 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(656)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
38029 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
38030 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
38031 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
38032 | else if (typeof require === 'function' && typeof module === "object" && module && module["exports"])
|
38033 | module['exports'] = (function() {
|
38034 | var Long; try { Long = require("long"); } catch (e) {}
|
38035 | return factory(Long);
|
38036 | })();
|
38037 | else
|
38038 | (global["dcodeIO"] = global["dcodeIO"] || {})["ByteBuffer"] = factory(global["dcodeIO"]["Long"]);
|
38039 |
|
38040 | })(this, function(Long) {
|
38041 | "use strict";
|
38042 |
|
38043 | |
38044 |
|
38045 |
|
38046 |
|
38047 |
|
38048 |
|
38049 |
|
38050 |
|
38051 |
|
38052 |
|
38053 |
|
38054 |
|
38055 | var ByteBuffer = function(capacity, littleEndian, noAssert) {
|
38056 | if (typeof capacity === 'undefined')
|
38057 | capacity = ByteBuffer.DEFAULT_CAPACITY;
|
38058 | if (typeof littleEndian === 'undefined')
|
38059 | littleEndian = ByteBuffer.DEFAULT_ENDIAN;
|
38060 | if (typeof noAssert === 'undefined')
|
38061 | noAssert = ByteBuffer.DEFAULT_NOASSERT;
|
38062 | if (!noAssert) {
|
38063 | capacity = capacity | 0;
|
38064 | if (capacity < 0)
|
38065 | throw RangeError("Illegal capacity");
|
38066 | littleEndian = !!littleEndian;
|
38067 | noAssert = !!noAssert;
|
38068 | }
|
38069 |
|
38070 | |
38071 |
|
38072 |
|
38073 |
|
38074 |
|
38075 | this.buffer = capacity === 0 ? EMPTY_BUFFER : new ArrayBuffer(capacity);
|
38076 |
|
38077 | |
38078 |
|
38079 |
|
38080 |
|
38081 |
|
38082 | this.view = capacity === 0 ? null : new Uint8Array(this.buffer);
|
38083 |
|
38084 | |
38085 |
|
38086 |
|
38087 |
|
38088 |
|
38089 |
|
38090 |
|
38091 | this.offset = 0;
|
38092 |
|
38093 | |
38094 |
|
38095 |
|
38096 |
|
38097 |
|
38098 |
|
38099 |
|
38100 | this.markedOffset = -1;
|
38101 |
|
38102 | |
38103 |
|
38104 |
|
38105 |
|
38106 |
|
38107 |
|
38108 |
|
38109 | this.limit = capacity;
|
38110 |
|
38111 | |
38112 |
|
38113 |
|
38114 |
|
38115 |
|
38116 | this.littleEndian = littleEndian;
|
38117 |
|
38118 | |
38119 |
|
38120 |
|
38121 |
|
38122 |
|
38123 | this.noAssert = noAssert;
|
38124 | };
|
38125 |
|
38126 | |
38127 |
|
38128 |
|
38129 |
|
38130 |
|
38131 |
|
38132 | ByteBuffer.VERSION = "5.0.1";
|
38133 |
|
38134 | |
38135 |
|
38136 |
|
38137 |
|
38138 |
|
38139 |
|
38140 | ByteBuffer.LITTLE_ENDIAN = true;
|
38141 |
|
38142 | |
38143 |
|
38144 |
|
38145 |
|
38146 |
|
38147 |
|
38148 | ByteBuffer.BIG_ENDIAN = false;
|
38149 |
|
38150 | |
38151 |
|
38152 |
|
38153 |
|
38154 |
|
38155 | ByteBuffer.DEFAULT_CAPACITY = 16;
|
38156 |
|
38157 | |
38158 |
|
38159 |
|
38160 |
|
38161 |
|
38162 | ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN;
|
38163 |
|
38164 | |
38165 |
|
38166 |
|
38167 |
|
38168 |
|
38169 | ByteBuffer.DEFAULT_NOASSERT = false;
|
38170 |
|
38171 | |
38172 |
|
38173 |
|
38174 |
|
38175 |
|
38176 |
|
38177 |
|
38178 |
|
38179 | ByteBuffer.Long = Long || null;
|
38180 |
|
38181 | |
38182 |
|
38183 |
|
38184 |
|
38185 | var ByteBufferPrototype = ByteBuffer.prototype;
|
38186 |
|
38187 | |
38188 |
|
38189 |
|
38190 |
|
38191 |
|
38192 |
|
38193 |
|
38194 | ByteBufferPrototype.__isByteBuffer__;
|
38195 |
|
38196 | Object.defineProperty(ByteBufferPrototype, "__isByteBuffer__", {
|
38197 | value: true,
|
38198 | enumerable: false,
|
38199 | configurable: false
|
38200 | });
|
38201 |
|
38202 |
|
38203 |
|
38204 | |
38205 |
|
38206 |
|
38207 |
|
38208 | var EMPTY_BUFFER = new ArrayBuffer(0);
|
38209 |
|
38210 | |
38211 |
|
38212 |
|
38213 |
|
38214 |
|
38215 | var stringFromCharCode = String.fromCharCode;
|
38216 |
|
38217 | |
38218 |
|
38219 |
|
38220 |
|
38221 |
|
38222 |
|
38223 |
|
38224 |
|
38225 | function stringSource(s) {
|
38226 | var i=0; return function() {
|
38227 | return i < s.length ? s.charCodeAt(i++) : null;
|
38228 | };
|
38229 | }
|
38230 |
|
38231 | |
38232 |
|
38233 |
|
38234 |
|
38235 |
|
38236 |
|
38237 | function stringDestination() {
|
38238 | var cs = [], ps = []; return function() {
|
38239 | if (arguments.length === 0)
|
38240 | return ps.join('')+stringFromCharCode.apply(String, cs);
|
38241 | if (cs.length + arguments.length > 1024)
|
38242 | ps.push(stringFromCharCode.apply(String, cs)),
|
38243 | cs.length = 0;
|
38244 | Array.prototype.push.apply(cs, arguments);
|
38245 | };
|
38246 | }
|
38247 |
|
38248 | |
38249 |
|
38250 |
|
38251 |
|
38252 |
|
38253 | ByteBuffer.accessor = function() {
|
38254 | return Uint8Array;
|
38255 | };
|
38256 | |
38257 |
|
38258 |
|
38259 |
|
38260 |
|
38261 |
|
38262 |
|
38263 |
|
38264 |
|
38265 |
|
38266 | ByteBuffer.allocate = function(capacity, littleEndian, noAssert) {
|
38267 | return new ByteBuffer(capacity, littleEndian, noAssert);
|
38268 | };
|
38269 |
|
38270 | |
38271 |
|
38272 |
|
38273 |
|
38274 |
|
38275 |
|
38276 |
|
38277 |
|
38278 |
|
38279 |
|
38280 |
|
38281 |
|
38282 | ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) {
|
38283 | if (typeof encoding === 'boolean' || typeof encoding !== 'string') {
|
38284 | noAssert = littleEndian;
|
38285 | littleEndian = encoding;
|
38286 | encoding = undefined;
|
38287 | }
|
38288 | var capacity = 0;
|
38289 | for (var i=0, k=buffers.length, length; i<k; ++i) {
|
38290 | if (!ByteBuffer.isByteBuffer(buffers[i]))
|
38291 | buffers[i] = ByteBuffer.wrap(buffers[i], encoding);
|
38292 | length = buffers[i].limit - buffers[i].offset;
|
38293 | if (length > 0) capacity += length;
|
38294 | }
|
38295 | if (capacity === 0)
|
38296 | return new ByteBuffer(0, littleEndian, noAssert);
|
38297 | var bb = new ByteBuffer(capacity, littleEndian, noAssert),
|
38298 | bi;
|
38299 | i=0; while (i<k) {
|
38300 | bi = buffers[i++];
|
38301 | length = bi.limit - bi.offset;
|
38302 | if (length <= 0) continue;
|
38303 | bb.view.set(bi.view.subarray(bi.offset, bi.limit), bb.offset);
|
38304 | bb.offset += length;
|
38305 | }
|
38306 | bb.limit = bb.offset;
|
38307 | bb.offset = 0;
|
38308 | return bb;
|
38309 | };
|
38310 |
|
38311 | |
38312 |
|
38313 |
|
38314 |
|
38315 |
|
38316 |
|
38317 | ByteBuffer.isByteBuffer = function(bb) {
|
38318 | return (bb && bb["__isByteBuffer__"]) === true;
|
38319 | };
|
38320 | |
38321 |
|
38322 |
|
38323 |
|
38324 |
|
38325 | ByteBuffer.type = function() {
|
38326 | return ArrayBuffer;
|
38327 | };
|
38328 | |
38329 |
|
38330 |
|
38331 |
|
38332 |
|
38333 |
|
38334 |
|
38335 |
|
38336 |
|
38337 |
|
38338 |
|
38339 |
|
38340 |
|
38341 | ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) {
|
38342 | if (typeof encoding !== 'string') {
|
38343 | noAssert = littleEndian;
|
38344 | littleEndian = encoding;
|
38345 | encoding = undefined;
|
38346 | }
|
38347 | if (typeof buffer === 'string') {
|
38348 | if (typeof encoding === 'undefined')
|
38349 | encoding = "utf8";
|
38350 | switch (encoding) {
|
38351 | case "base64":
|
38352 | return ByteBuffer.fromBase64(buffer, littleEndian);
|
38353 | case "hex":
|
38354 | return ByteBuffer.fromHex(buffer, littleEndian);
|
38355 | case "binary":
|
38356 | return ByteBuffer.fromBinary(buffer, littleEndian);
|
38357 | case "utf8":
|
38358 | return ByteBuffer.fromUTF8(buffer, littleEndian);
|
38359 | case "debug":
|
38360 | return ByteBuffer.fromDebug(buffer, littleEndian);
|
38361 | default:
|
38362 | throw Error("Unsupported encoding: "+encoding);
|
38363 | }
|
38364 | }
|
38365 | if (buffer === null || typeof buffer !== 'object')
|
38366 | throw TypeError("Illegal buffer");
|
38367 | var bb;
|
38368 | if (ByteBuffer.isByteBuffer(buffer)) {
|
38369 | bb = ByteBufferPrototype.clone.call(buffer);
|
38370 | bb.markedOffset = -1;
|
38371 | return bb;
|
38372 | }
|
38373 | if (buffer instanceof Uint8Array) {
|
38374 | bb = new ByteBuffer(0, littleEndian, noAssert);
|
38375 | if (buffer.length > 0) {
|
38376 | bb.buffer = buffer.buffer;
|
38377 | bb.offset = buffer.byteOffset;
|
38378 | bb.limit = buffer.byteOffset + buffer.byteLength;
|
38379 | bb.view = new Uint8Array(buffer.buffer);
|
38380 | }
|
38381 | } else if (buffer instanceof ArrayBuffer) {
|
38382 | bb = new ByteBuffer(0, littleEndian, noAssert);
|
38383 | if (buffer.byteLength > 0) {
|
38384 | bb.buffer = buffer;
|
38385 | bb.offset = 0;
|
38386 | bb.limit = buffer.byteLength;
|
38387 | bb.view = buffer.byteLength > 0 ? new Uint8Array(buffer) : null;
|
38388 | }
|
38389 | } else if (Object.prototype.toString.call(buffer) === "[object Array]") {
|
38390 | bb = new ByteBuffer(buffer.length, littleEndian, noAssert);
|
38391 | bb.limit = buffer.length;
|
38392 | for (var i=0; i<buffer.length; ++i)
|
38393 | bb.view[i] = buffer[i];
|
38394 | } else
|
38395 | throw TypeError("Illegal buffer");
|
38396 | return bb;
|
38397 | };
|
38398 |
|
38399 | |
38400 |
|
38401 |
|
38402 |
|
38403 |
|
38404 |
|
38405 |
|
38406 | ByteBufferPrototype.writeBitSet = function(value, offset) {
|
38407 | var relative = typeof offset === 'undefined';
|
38408 | if (relative) offset = this.offset;
|
38409 | if (!this.noAssert) {
|
38410 | if (!(value instanceof Array))
|
38411 | throw TypeError("Illegal BitSet: Not an array");
|
38412 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38413 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38414 | offset >>>= 0;
|
38415 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38416 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38417 | }
|
38418 |
|
38419 | var start = offset,
|
38420 | bits = value.length,
|
38421 | bytes = (bits >> 3),
|
38422 | bit = 0,
|
38423 | k;
|
38424 |
|
38425 | offset += this.writeVarint32(bits,offset);
|
38426 |
|
38427 | while(bytes--) {
|
38428 | k = (!!value[bit++] & 1) |
|
38429 | ((!!value[bit++] & 1) << 1) |
|
38430 | ((!!value[bit++] & 1) << 2) |
|
38431 | ((!!value[bit++] & 1) << 3) |
|
38432 | ((!!value[bit++] & 1) << 4) |
|
38433 | ((!!value[bit++] & 1) << 5) |
|
38434 | ((!!value[bit++] & 1) << 6) |
|
38435 | ((!!value[bit++] & 1) << 7);
|
38436 | this.writeByte(k,offset++);
|
38437 | }
|
38438 |
|
38439 | if(bit < bits) {
|
38440 | var m = 0; k = 0;
|
38441 | while(bit < bits) k = k | ((!!value[bit++] & 1) << (m++));
|
38442 | this.writeByte(k,offset++);
|
38443 | }
|
38444 |
|
38445 | if (relative) {
|
38446 | this.offset = offset;
|
38447 | return this;
|
38448 | }
|
38449 | return offset - start;
|
38450 | }
|
38451 |
|
38452 | |
38453 |
|
38454 |
|
38455 |
|
38456 |
|
38457 |
|
38458 | ByteBufferPrototype.readBitSet = function(offset) {
|
38459 | var relative = typeof offset === 'undefined';
|
38460 | if (relative) offset = this.offset;
|
38461 |
|
38462 | var ret = this.readVarint32(offset),
|
38463 | bits = ret.value,
|
38464 | bytes = (bits >> 3),
|
38465 | bit = 0,
|
38466 | value = [],
|
38467 | k;
|
38468 |
|
38469 | offset += ret.length;
|
38470 |
|
38471 | while(bytes--) {
|
38472 | k = this.readByte(offset++);
|
38473 | value[bit++] = !!(k & 0x01);
|
38474 | value[bit++] = !!(k & 0x02);
|
38475 | value[bit++] = !!(k & 0x04);
|
38476 | value[bit++] = !!(k & 0x08);
|
38477 | value[bit++] = !!(k & 0x10);
|
38478 | value[bit++] = !!(k & 0x20);
|
38479 | value[bit++] = !!(k & 0x40);
|
38480 | value[bit++] = !!(k & 0x80);
|
38481 | }
|
38482 |
|
38483 | if(bit < bits) {
|
38484 | var m = 0;
|
38485 | k = this.readByte(offset++);
|
38486 | while(bit < bits) value[bit++] = !!((k >> (m++)) & 1);
|
38487 | }
|
38488 |
|
38489 | if (relative) {
|
38490 | this.offset = offset;
|
38491 | }
|
38492 | return value;
|
38493 | }
|
38494 | |
38495 |
|
38496 |
|
38497 |
|
38498 |
|
38499 |
|
38500 |
|
38501 | ByteBufferPrototype.readBytes = function(length, offset) {
|
38502 | var relative = typeof offset === 'undefined';
|
38503 | if (relative) offset = this.offset;
|
38504 | if (!this.noAssert) {
|
38505 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38506 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38507 | offset >>>= 0;
|
38508 | if (offset < 0 || offset + length > this.buffer.byteLength)
|
38509 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength);
|
38510 | }
|
38511 | var slice = this.slice(offset, offset + length);
|
38512 | if (relative) this.offset += length;
|
38513 | return slice;
|
38514 | };
|
38515 |
|
38516 | |
38517 |
|
38518 |
|
38519 |
|
38520 |
|
38521 |
|
38522 |
|
38523 |
|
38524 |
|
38525 |
|
38526 |
|
38527 | ByteBufferPrototype.writeBytes = ByteBufferPrototype.append;
|
38528 |
|
38529 |
|
38530 |
|
38531 | |
38532 |
|
38533 |
|
38534 |
|
38535 |
|
38536 |
|
38537 |
|
38538 | ByteBufferPrototype.writeInt8 = function(value, offset) {
|
38539 | var relative = typeof offset === 'undefined';
|
38540 | if (relative) offset = this.offset;
|
38541 | if (!this.noAssert) {
|
38542 | if (typeof value !== 'number' || value % 1 !== 0)
|
38543 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38544 | value |= 0;
|
38545 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38546 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38547 | offset >>>= 0;
|
38548 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38549 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38550 | }
|
38551 | offset += 1;
|
38552 | var capacity0 = this.buffer.byteLength;
|
38553 | if (offset > capacity0)
|
38554 | this.resize((capacity0 *= 2) > offset ? capacity0 : offset);
|
38555 | offset -= 1;
|
38556 | this.view[offset] = value;
|
38557 | if (relative) this.offset += 1;
|
38558 | return this;
|
38559 | };
|
38560 |
|
38561 | |
38562 |
|
38563 |
|
38564 |
|
38565 |
|
38566 |
|
38567 |
|
38568 |
|
38569 | ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8;
|
38570 |
|
38571 | |
38572 |
|
38573 |
|
38574 |
|
38575 |
|
38576 |
|
38577 | ByteBufferPrototype.readInt8 = function(offset) {
|
38578 | var relative = typeof offset === 'undefined';
|
38579 | if (relative) offset = this.offset;
|
38580 | if (!this.noAssert) {
|
38581 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38582 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38583 | offset >>>= 0;
|
38584 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
38585 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
38586 | }
|
38587 | var value = this.view[offset];
|
38588 | if ((value & 0x80) === 0x80) value = -(0xFF - value + 1);
|
38589 | if (relative) this.offset += 1;
|
38590 | return value;
|
38591 | };
|
38592 |
|
38593 | |
38594 |
|
38595 |
|
38596 |
|
38597 |
|
38598 |
|
38599 |
|
38600 | ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8;
|
38601 |
|
38602 | |
38603 |
|
38604 |
|
38605 |
|
38606 |
|
38607 |
|
38608 |
|
38609 | ByteBufferPrototype.writeUint8 = function(value, offset) {
|
38610 | var relative = typeof offset === 'undefined';
|
38611 | if (relative) offset = this.offset;
|
38612 | if (!this.noAssert) {
|
38613 | if (typeof value !== 'number' || value % 1 !== 0)
|
38614 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38615 | value >>>= 0;
|
38616 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38617 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38618 | offset >>>= 0;
|
38619 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38620 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38621 | }
|
38622 | offset += 1;
|
38623 | var capacity1 = this.buffer.byteLength;
|
38624 | if (offset > capacity1)
|
38625 | this.resize((capacity1 *= 2) > offset ? capacity1 : offset);
|
38626 | offset -= 1;
|
38627 | this.view[offset] = value;
|
38628 | if (relative) this.offset += 1;
|
38629 | return this;
|
38630 | };
|
38631 |
|
38632 | |
38633 |
|
38634 |
|
38635 |
|
38636 |
|
38637 |
|
38638 |
|
38639 |
|
38640 | ByteBufferPrototype.writeUInt8 = ByteBufferPrototype.writeUint8;
|
38641 |
|
38642 | |
38643 |
|
38644 |
|
38645 |
|
38646 |
|
38647 |
|
38648 | ByteBufferPrototype.readUint8 = function(offset) {
|
38649 | var relative = typeof offset === 'undefined';
|
38650 | if (relative) offset = this.offset;
|
38651 | if (!this.noAssert) {
|
38652 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38653 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38654 | offset >>>= 0;
|
38655 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
38656 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
38657 | }
|
38658 | var value = this.view[offset];
|
38659 | if (relative) this.offset += 1;
|
38660 | return value;
|
38661 | };
|
38662 |
|
38663 | |
38664 |
|
38665 |
|
38666 |
|
38667 |
|
38668 |
|
38669 |
|
38670 | ByteBufferPrototype.readUInt8 = ByteBufferPrototype.readUint8;
|
38671 |
|
38672 |
|
38673 |
|
38674 | |
38675 |
|
38676 |
|
38677 |
|
38678 |
|
38679 |
|
38680 |
|
38681 |
|
38682 | ByteBufferPrototype.writeInt16 = function(value, offset) {
|
38683 | var relative = typeof offset === 'undefined';
|
38684 | if (relative) offset = this.offset;
|
38685 | if (!this.noAssert) {
|
38686 | if (typeof value !== 'number' || value % 1 !== 0)
|
38687 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38688 | value |= 0;
|
38689 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38690 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38691 | offset >>>= 0;
|
38692 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38693 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38694 | }
|
38695 | offset += 2;
|
38696 | var capacity2 = this.buffer.byteLength;
|
38697 | if (offset > capacity2)
|
38698 | this.resize((capacity2 *= 2) > offset ? capacity2 : offset);
|
38699 | offset -= 2;
|
38700 | if (this.littleEndian) {
|
38701 | this.view[offset+1] = (value & 0xFF00) >>> 8;
|
38702 | this.view[offset ] = value & 0x00FF;
|
38703 | } else {
|
38704 | this.view[offset] = (value & 0xFF00) >>> 8;
|
38705 | this.view[offset+1] = value & 0x00FF;
|
38706 | }
|
38707 | if (relative) this.offset += 2;
|
38708 | return this;
|
38709 | };
|
38710 |
|
38711 | |
38712 |
|
38713 |
|
38714 |
|
38715 |
|
38716 |
|
38717 |
|
38718 |
|
38719 |
|
38720 | ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16;
|
38721 |
|
38722 | |
38723 |
|
38724 |
|
38725 |
|
38726 |
|
38727 |
|
38728 |
|
38729 |
|
38730 | ByteBufferPrototype.readInt16 = function(offset) {
|
38731 | var relative = typeof offset === 'undefined';
|
38732 | if (relative) offset = this.offset;
|
38733 | if (!this.noAssert) {
|
38734 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38735 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38736 | offset >>>= 0;
|
38737 | if (offset < 0 || offset + 2 > this.buffer.byteLength)
|
38738 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength);
|
38739 | }
|
38740 | var value = 0;
|
38741 | if (this.littleEndian) {
|
38742 | value = this.view[offset ];
|
38743 | value |= this.view[offset+1] << 8;
|
38744 | } else {
|
38745 | value = this.view[offset ] << 8;
|
38746 | value |= this.view[offset+1];
|
38747 | }
|
38748 | if ((value & 0x8000) === 0x8000) value = -(0xFFFF - value + 1);
|
38749 | if (relative) this.offset += 2;
|
38750 | return value;
|
38751 | };
|
38752 |
|
38753 | |
38754 |
|
38755 |
|
38756 |
|
38757 |
|
38758 |
|
38759 |
|
38760 |
|
38761 |
|
38762 | ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16;
|
38763 |
|
38764 | |
38765 |
|
38766 |
|
38767 |
|
38768 |
|
38769 |
|
38770 |
|
38771 |
|
38772 | ByteBufferPrototype.writeUint16 = function(value, offset) {
|
38773 | var relative = typeof offset === 'undefined';
|
38774 | if (relative) offset = this.offset;
|
38775 | if (!this.noAssert) {
|
38776 | if (typeof value !== 'number' || value % 1 !== 0)
|
38777 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38778 | value >>>= 0;
|
38779 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38780 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38781 | offset >>>= 0;
|
38782 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38783 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38784 | }
|
38785 | offset += 2;
|
38786 | var capacity3 = this.buffer.byteLength;
|
38787 | if (offset > capacity3)
|
38788 | this.resize((capacity3 *= 2) > offset ? capacity3 : offset);
|
38789 | offset -= 2;
|
38790 | if (this.littleEndian) {
|
38791 | this.view[offset+1] = (value & 0xFF00) >>> 8;
|
38792 | this.view[offset ] = value & 0x00FF;
|
38793 | } else {
|
38794 | this.view[offset] = (value & 0xFF00) >>> 8;
|
38795 | this.view[offset+1] = value & 0x00FF;
|
38796 | }
|
38797 | if (relative) this.offset += 2;
|
38798 | return this;
|
38799 | };
|
38800 |
|
38801 | |
38802 |
|
38803 |
|
38804 |
|
38805 |
|
38806 |
|
38807 |
|
38808 |
|
38809 |
|
38810 | ByteBufferPrototype.writeUInt16 = ByteBufferPrototype.writeUint16;
|
38811 |
|
38812 | |
38813 |
|
38814 |
|
38815 |
|
38816 |
|
38817 |
|
38818 |
|
38819 |
|
38820 | ByteBufferPrototype.readUint16 = function(offset) {
|
38821 | var relative = typeof offset === 'undefined';
|
38822 | if (relative) offset = this.offset;
|
38823 | if (!this.noAssert) {
|
38824 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38825 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38826 | offset >>>= 0;
|
38827 | if (offset < 0 || offset + 2 > this.buffer.byteLength)
|
38828 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength);
|
38829 | }
|
38830 | var value = 0;
|
38831 | if (this.littleEndian) {
|
38832 | value = this.view[offset ];
|
38833 | value |= this.view[offset+1] << 8;
|
38834 | } else {
|
38835 | value = this.view[offset ] << 8;
|
38836 | value |= this.view[offset+1];
|
38837 | }
|
38838 | if (relative) this.offset += 2;
|
38839 | return value;
|
38840 | };
|
38841 |
|
38842 | |
38843 |
|
38844 |
|
38845 |
|
38846 |
|
38847 |
|
38848 |
|
38849 |
|
38850 |
|
38851 | ByteBufferPrototype.readUInt16 = ByteBufferPrototype.readUint16;
|
38852 |
|
38853 |
|
38854 |
|
38855 | |
38856 |
|
38857 |
|
38858 |
|
38859 |
|
38860 |
|
38861 | ByteBufferPrototype.writeInt32 = function(value, offset) {
|
38862 | var relative = typeof offset === 'undefined';
|
38863 | if (relative) offset = this.offset;
|
38864 | if (!this.noAssert) {
|
38865 | if (typeof value !== 'number' || value % 1 !== 0)
|
38866 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38867 | value |= 0;
|
38868 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38869 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38870 | offset >>>= 0;
|
38871 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38872 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38873 | }
|
38874 | offset += 4;
|
38875 | var capacity4 = this.buffer.byteLength;
|
38876 | if (offset > capacity4)
|
38877 | this.resize((capacity4 *= 2) > offset ? capacity4 : offset);
|
38878 | offset -= 4;
|
38879 | if (this.littleEndian) {
|
38880 | this.view[offset+3] = (value >>> 24) & 0xFF;
|
38881 | this.view[offset+2] = (value >>> 16) & 0xFF;
|
38882 | this.view[offset+1] = (value >>> 8) & 0xFF;
|
38883 | this.view[offset ] = value & 0xFF;
|
38884 | } else {
|
38885 | this.view[offset ] = (value >>> 24) & 0xFF;
|
38886 | this.view[offset+1] = (value >>> 16) & 0xFF;
|
38887 | this.view[offset+2] = (value >>> 8) & 0xFF;
|
38888 | this.view[offset+3] = value & 0xFF;
|
38889 | }
|
38890 | if (relative) this.offset += 4;
|
38891 | return this;
|
38892 | };
|
38893 |
|
38894 | |
38895 |
|
38896 |
|
38897 |
|
38898 |
|
38899 |
|
38900 | ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32;
|
38901 |
|
38902 | |
38903 |
|
38904 |
|
38905 |
|
38906 |
|
38907 |
|
38908 | ByteBufferPrototype.readInt32 = function(offset) {
|
38909 | var relative = typeof offset === 'undefined';
|
38910 | if (relative) offset = this.offset;
|
38911 | if (!this.noAssert) {
|
38912 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38913 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38914 | offset >>>= 0;
|
38915 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
38916 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
38917 | }
|
38918 | var value = 0;
|
38919 | if (this.littleEndian) {
|
38920 | value = this.view[offset+2] << 16;
|
38921 | value |= this.view[offset+1] << 8;
|
38922 | value |= this.view[offset ];
|
38923 | value += this.view[offset+3] << 24 >>> 0;
|
38924 | } else {
|
38925 | value = this.view[offset+1] << 16;
|
38926 | value |= this.view[offset+2] << 8;
|
38927 | value |= this.view[offset+3];
|
38928 | value += this.view[offset ] << 24 >>> 0;
|
38929 | }
|
38930 | value |= 0;
|
38931 | if (relative) this.offset += 4;
|
38932 | return value;
|
38933 | };
|
38934 |
|
38935 | |
38936 |
|
38937 |
|
38938 |
|
38939 |
|
38940 |
|
38941 | ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32;
|
38942 |
|
38943 | |
38944 |
|
38945 |
|
38946 |
|
38947 |
|
38948 |
|
38949 | ByteBufferPrototype.writeUint32 = function(value, offset) {
|
38950 | var relative = typeof offset === 'undefined';
|
38951 | if (relative) offset = this.offset;
|
38952 | if (!this.noAssert) {
|
38953 | if (typeof value !== 'number' || value % 1 !== 0)
|
38954 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38955 | value >>>= 0;
|
38956 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38957 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38958 | offset >>>= 0;
|
38959 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38960 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38961 | }
|
38962 | offset += 4;
|
38963 | var capacity5 = this.buffer.byteLength;
|
38964 | if (offset > capacity5)
|
38965 | this.resize((capacity5 *= 2) > offset ? capacity5 : offset);
|
38966 | offset -= 4;
|
38967 | if (this.littleEndian) {
|
38968 | this.view[offset+3] = (value >>> 24) & 0xFF;
|
38969 | this.view[offset+2] = (value >>> 16) & 0xFF;
|
38970 | this.view[offset+1] = (value >>> 8) & 0xFF;
|
38971 | this.view[offset ] = value & 0xFF;
|
38972 | } else {
|
38973 | this.view[offset ] = (value >>> 24) & 0xFF;
|
38974 | this.view[offset+1] = (value >>> 16) & 0xFF;
|
38975 | this.view[offset+2] = (value >>> 8) & 0xFF;
|
38976 | this.view[offset+3] = value & 0xFF;
|
38977 | }
|
38978 | if (relative) this.offset += 4;
|
38979 | return this;
|
38980 | };
|
38981 |
|
38982 | |
38983 |
|
38984 |
|
38985 |
|
38986 |
|
38987 |
|
38988 |
|
38989 | ByteBufferPrototype.writeUInt32 = ByteBufferPrototype.writeUint32;
|
38990 |
|
38991 | |
38992 |
|
38993 |
|
38994 |
|
38995 |
|
38996 |
|
38997 | ByteBufferPrototype.readUint32 = function(offset) {
|
38998 | var relative = typeof offset === 'undefined';
|
38999 | if (relative) offset = this.offset;
|
39000 | if (!this.noAssert) {
|
39001 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39002 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39003 | offset >>>= 0;
|
39004 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
39005 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
39006 | }
|
39007 | var value = 0;
|
39008 | if (this.littleEndian) {
|
39009 | value = this.view[offset+2] << 16;
|
39010 | value |= this.view[offset+1] << 8;
|
39011 | value |= this.view[offset ];
|
39012 | value += this.view[offset+3] << 24 >>> 0;
|
39013 | } else {
|
39014 | value = this.view[offset+1] << 16;
|
39015 | value |= this.view[offset+2] << 8;
|
39016 | value |= this.view[offset+3];
|
39017 | value += this.view[offset ] << 24 >>> 0;
|
39018 | }
|
39019 | if (relative) this.offset += 4;
|
39020 | return value;
|
39021 | };
|
39022 |
|
39023 | |
39024 |
|
39025 |
|
39026 |
|
39027 |
|
39028 |
|
39029 |
|
39030 | ByteBufferPrototype.readUInt32 = ByteBufferPrototype.readUint32;
|
39031 |
|
39032 |
|
39033 |
|
39034 | if (Long) {
|
39035 |
|
39036 | |
39037 |
|
39038 |
|
39039 |
|
39040 |
|
39041 |
|
39042 |
|
39043 | ByteBufferPrototype.writeInt64 = function(value, offset) {
|
39044 | var relative = typeof offset === 'undefined';
|
39045 | if (relative) offset = this.offset;
|
39046 | if (!this.noAssert) {
|
39047 | if (typeof value === 'number')
|
39048 | value = Long.fromNumber(value);
|
39049 | else if (typeof value === 'string')
|
39050 | value = Long.fromString(value);
|
39051 | else if (!(value && value instanceof Long))
|
39052 | throw TypeError("Illegal value: "+value+" (not an integer or Long)");
|
39053 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39054 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39055 | offset >>>= 0;
|
39056 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39057 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39058 | }
|
39059 | if (typeof value === 'number')
|
39060 | value = Long.fromNumber(value);
|
39061 | else if (typeof value === 'string')
|
39062 | value = Long.fromString(value);
|
39063 | offset += 8;
|
39064 | var capacity6 = this.buffer.byteLength;
|
39065 | if (offset > capacity6)
|
39066 | this.resize((capacity6 *= 2) > offset ? capacity6 : offset);
|
39067 | offset -= 8;
|
39068 | var lo = value.low,
|
39069 | hi = value.high;
|
39070 | if (this.littleEndian) {
|
39071 | this.view[offset+3] = (lo >>> 24) & 0xFF;
|
39072 | this.view[offset+2] = (lo >>> 16) & 0xFF;
|
39073 | this.view[offset+1] = (lo >>> 8) & 0xFF;
|
39074 | this.view[offset ] = lo & 0xFF;
|
39075 | offset += 4;
|
39076 | this.view[offset+3] = (hi >>> 24) & 0xFF;
|
39077 | this.view[offset+2] = (hi >>> 16) & 0xFF;
|
39078 | this.view[offset+1] = (hi >>> 8) & 0xFF;
|
39079 | this.view[offset ] = hi & 0xFF;
|
39080 | } else {
|
39081 | this.view[offset ] = (hi >>> 24) & 0xFF;
|
39082 | this.view[offset+1] = (hi >>> 16) & 0xFF;
|
39083 | this.view[offset+2] = (hi >>> 8) & 0xFF;
|
39084 | this.view[offset+3] = hi & 0xFF;
|
39085 | offset += 4;
|
39086 | this.view[offset ] = (lo >>> 24) & 0xFF;
|
39087 | this.view[offset+1] = (lo >>> 16) & 0xFF;
|
39088 | this.view[offset+2] = (lo >>> 8) & 0xFF;
|
39089 | this.view[offset+3] = lo & 0xFF;
|
39090 | }
|
39091 | if (relative) this.offset += 8;
|
39092 | return this;
|
39093 | };
|
39094 |
|
39095 | |
39096 |
|
39097 |
|
39098 |
|
39099 |
|
39100 |
|
39101 |
|
39102 | ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64;
|
39103 |
|
39104 | |
39105 |
|
39106 |
|
39107 |
|
39108 |
|
39109 |
|
39110 | ByteBufferPrototype.readInt64 = function(offset) {
|
39111 | var relative = typeof offset === 'undefined';
|
39112 | if (relative) offset = this.offset;
|
39113 | if (!this.noAssert) {
|
39114 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39115 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39116 | offset >>>= 0;
|
39117 | if (offset < 0 || offset + 8 > this.buffer.byteLength)
|
39118 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
|
39119 | }
|
39120 | var lo = 0,
|
39121 | hi = 0;
|
39122 | if (this.littleEndian) {
|
39123 | lo = this.view[offset+2] << 16;
|
39124 | lo |= this.view[offset+1] << 8;
|
39125 | lo |= this.view[offset ];
|
39126 | lo += this.view[offset+3] << 24 >>> 0;
|
39127 | offset += 4;
|
39128 | hi = this.view[offset+2] << 16;
|
39129 | hi |= this.view[offset+1] << 8;
|
39130 | hi |= this.view[offset ];
|
39131 | hi += this.view[offset+3] << 24 >>> 0;
|
39132 | } else {
|
39133 | hi = this.view[offset+1] << 16;
|
39134 | hi |= this.view[offset+2] << 8;
|
39135 | hi |= this.view[offset+3];
|
39136 | hi += this.view[offset ] << 24 >>> 0;
|
39137 | offset += 4;
|
39138 | lo = this.view[offset+1] << 16;
|
39139 | lo |= this.view[offset+2] << 8;
|
39140 | lo |= this.view[offset+3];
|
39141 | lo += this.view[offset ] << 24 >>> 0;
|
39142 | }
|
39143 | var value = new Long(lo, hi, false);
|
39144 | if (relative) this.offset += 8;
|
39145 | return value;
|
39146 | };
|
39147 |
|
39148 | |
39149 |
|
39150 |
|
39151 |
|
39152 |
|
39153 |
|
39154 | ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64;
|
39155 |
|
39156 | |
39157 |
|
39158 |
|
39159 |
|
39160 |
|
39161 |
|
39162 |
|
39163 | ByteBufferPrototype.writeUint64 = function(value, offset) {
|
39164 | var relative = typeof offset === 'undefined';
|
39165 | if (relative) offset = this.offset;
|
39166 | if (!this.noAssert) {
|
39167 | if (typeof value === 'number')
|
39168 | value = Long.fromNumber(value);
|
39169 | else if (typeof value === 'string')
|
39170 | value = Long.fromString(value);
|
39171 | else if (!(value && value instanceof Long))
|
39172 | throw TypeError("Illegal value: "+value+" (not an integer or Long)");
|
39173 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39174 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39175 | offset >>>= 0;
|
39176 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39177 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39178 | }
|
39179 | if (typeof value === 'number')
|
39180 | value = Long.fromNumber(value);
|
39181 | else if (typeof value === 'string')
|
39182 | value = Long.fromString(value);
|
39183 | offset += 8;
|
39184 | var capacity7 = this.buffer.byteLength;
|
39185 | if (offset > capacity7)
|
39186 | this.resize((capacity7 *= 2) > offset ? capacity7 : offset);
|
39187 | offset -= 8;
|
39188 | var lo = value.low,
|
39189 | hi = value.high;
|
39190 | if (this.littleEndian) {
|
39191 | this.view[offset+3] = (lo >>> 24) & 0xFF;
|
39192 | this.view[offset+2] = (lo >>> 16) & 0xFF;
|
39193 | this.view[offset+1] = (lo >>> 8) & 0xFF;
|
39194 | this.view[offset ] = lo & 0xFF;
|
39195 | offset += 4;
|
39196 | this.view[offset+3] = (hi >>> 24) & 0xFF;
|
39197 | this.view[offset+2] = (hi >>> 16) & 0xFF;
|
39198 | this.view[offset+1] = (hi >>> 8) & 0xFF;
|
39199 | this.view[offset ] = hi & 0xFF;
|
39200 | } else {
|
39201 | this.view[offset ] = (hi >>> 24) & 0xFF;
|
39202 | this.view[offset+1] = (hi >>> 16) & 0xFF;
|
39203 | this.view[offset+2] = (hi >>> 8) & 0xFF;
|
39204 | this.view[offset+3] = hi & 0xFF;
|
39205 | offset += 4;
|
39206 | this.view[offset ] = (lo >>> 24) & 0xFF;
|
39207 | this.view[offset+1] = (lo >>> 16) & 0xFF;
|
39208 | this.view[offset+2] = (lo >>> 8) & 0xFF;
|
39209 | this.view[offset+3] = lo & 0xFF;
|
39210 | }
|
39211 | if (relative) this.offset += 8;
|
39212 | return this;
|
39213 | };
|
39214 |
|
39215 | |
39216 |
|
39217 |
|
39218 |
|
39219 |
|
39220 |
|
39221 |
|
39222 |
|
39223 | ByteBufferPrototype.writeUInt64 = ByteBufferPrototype.writeUint64;
|
39224 |
|
39225 | |
39226 |
|
39227 |
|
39228 |
|
39229 |
|
39230 |
|
39231 | ByteBufferPrototype.readUint64 = function(offset) {
|
39232 | var relative = typeof offset === 'undefined';
|
39233 | if (relative) offset = this.offset;
|
39234 | if (!this.noAssert) {
|
39235 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39236 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39237 | offset >>>= 0;
|
39238 | if (offset < 0 || offset + 8 > this.buffer.byteLength)
|
39239 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
|
39240 | }
|
39241 | var lo = 0,
|
39242 | hi = 0;
|
39243 | if (this.littleEndian) {
|
39244 | lo = this.view[offset+2] << 16;
|
39245 | lo |= this.view[offset+1] << 8;
|
39246 | lo |= this.view[offset ];
|
39247 | lo += this.view[offset+3] << 24 >>> 0;
|
39248 | offset += 4;
|
39249 | hi = this.view[offset+2] << 16;
|
39250 | hi |= this.view[offset+1] << 8;
|
39251 | hi |= this.view[offset ];
|
39252 | hi += this.view[offset+3] << 24 >>> 0;
|
39253 | } else {
|
39254 | hi = this.view[offset+1] << 16;
|
39255 | hi |= this.view[offset+2] << 8;
|
39256 | hi |= this.view[offset+3];
|
39257 | hi += this.view[offset ] << 24 >>> 0;
|
39258 | offset += 4;
|
39259 | lo = this.view[offset+1] << 16;
|
39260 | lo |= this.view[offset+2] << 8;
|
39261 | lo |= this.view[offset+3];
|
39262 | lo += this.view[offset ] << 24 >>> 0;
|
39263 | }
|
39264 | var value = new Long(lo, hi, true);
|
39265 | if (relative) this.offset += 8;
|
39266 | return value;
|
39267 | };
|
39268 |
|
39269 | |
39270 |
|
39271 |
|
39272 |
|
39273 |
|
39274 |
|
39275 |
|
39276 | ByteBufferPrototype.readUInt64 = ByteBufferPrototype.readUint64;
|
39277 |
|
39278 | }
|
39279 |
|
39280 |
|
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 | function ieee754_read(buffer, offset, isLE, mLen, nBytes) {
|
39320 | var e, m,
|
39321 | eLen = nBytes * 8 - mLen - 1,
|
39322 | eMax = (1 << eLen) - 1,
|
39323 | eBias = eMax >> 1,
|
39324 | nBits = -7,
|
39325 | i = isLE ? (nBytes - 1) : 0,
|
39326 | d = isLE ? -1 : 1,
|
39327 | s = buffer[offset + i];
|
39328 |
|
39329 | i += d;
|
39330 |
|
39331 | e = s & ((1 << (-nBits)) - 1);
|
39332 | s >>= (-nBits);
|
39333 | nBits += eLen;
|
39334 | for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
|
39335 |
|
39336 | m = e & ((1 << (-nBits)) - 1);
|
39337 | e >>= (-nBits);
|
39338 | nBits += mLen;
|
39339 | for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
|
39340 |
|
39341 | if (e === 0) {
|
39342 | e = 1 - eBias;
|
39343 | } else if (e === eMax) {
|
39344 | return m ? NaN : ((s ? -1 : 1) * Infinity);
|
39345 | } else {
|
39346 | m = m + Math.pow(2, mLen);
|
39347 | e = e - eBias;
|
39348 | }
|
39349 | return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
|
39350 | }
|
39351 |
|
39352 | |
39353 |
|
39354 |
|
39355 |
|
39356 |
|
39357 |
|
39358 |
|
39359 |
|
39360 |
|
39361 |
|
39362 | function ieee754_write(buffer, value, offset, isLE, mLen, nBytes) {
|
39363 | var e, m, c,
|
39364 | eLen = nBytes * 8 - mLen - 1,
|
39365 | eMax = (1 << eLen) - 1,
|
39366 | eBias = eMax >> 1,
|
39367 | rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),
|
39368 | i = isLE ? 0 : (nBytes - 1),
|
39369 | d = isLE ? 1 : -1,
|
39370 | s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
|
39371 |
|
39372 | value = Math.abs(value);
|
39373 |
|
39374 | if (isNaN(value) || value === Infinity) {
|
39375 | m = isNaN(value) ? 1 : 0;
|
39376 | e = eMax;
|
39377 | } else {
|
39378 | e = Math.floor(Math.log(value) / Math.LN2);
|
39379 | if (value * (c = Math.pow(2, -e)) < 1) {
|
39380 | e--;
|
39381 | c *= 2;
|
39382 | }
|
39383 | if (e + eBias >= 1) {
|
39384 | value += rt / c;
|
39385 | } else {
|
39386 | value += rt * Math.pow(2, 1 - eBias);
|
39387 | }
|
39388 | if (value * c >= 2) {
|
39389 | e++;
|
39390 | c /= 2;
|
39391 | }
|
39392 |
|
39393 | if (e + eBias >= eMax) {
|
39394 | m = 0;
|
39395 | e = eMax;
|
39396 | } else if (e + eBias >= 1) {
|
39397 | m = (value * c - 1) * Math.pow(2, mLen);
|
39398 | e = e + eBias;
|
39399 | } else {
|
39400 | m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
|
39401 | e = 0;
|
39402 | }
|
39403 | }
|
39404 |
|
39405 | for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
|
39406 |
|
39407 | e = (e << mLen) | m;
|
39408 | eLen += mLen;
|
39409 | for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
|
39410 |
|
39411 | buffer[offset + i - d] |= s * 128;
|
39412 | }
|
39413 |
|
39414 | |
39415 |
|
39416 |
|
39417 |
|
39418 |
|
39419 |
|
39420 |
|
39421 | ByteBufferPrototype.writeFloat32 = function(value, offset) {
|
39422 | var relative = typeof offset === 'undefined';
|
39423 | if (relative) offset = this.offset;
|
39424 | if (!this.noAssert) {
|
39425 | if (typeof value !== 'number')
|
39426 | throw TypeError("Illegal value: "+value+" (not a number)");
|
39427 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39428 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39429 | offset >>>= 0;
|
39430 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39431 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39432 | }
|
39433 | offset += 4;
|
39434 | var capacity8 = this.buffer.byteLength;
|
39435 | if (offset > capacity8)
|
39436 | this.resize((capacity8 *= 2) > offset ? capacity8 : offset);
|
39437 | offset -= 4;
|
39438 | ieee754_write(this.view, value, offset, this.littleEndian, 23, 4);
|
39439 | if (relative) this.offset += 4;
|
39440 | return this;
|
39441 | };
|
39442 |
|
39443 | |
39444 |
|
39445 |
|
39446 |
|
39447 |
|
39448 |
|
39449 |
|
39450 |
|
39451 | ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32;
|
39452 |
|
39453 | |
39454 |
|
39455 |
|
39456 |
|
39457 |
|
39458 |
|
39459 | ByteBufferPrototype.readFloat32 = function(offset) {
|
39460 | var relative = typeof offset === 'undefined';
|
39461 | if (relative) offset = this.offset;
|
39462 | if (!this.noAssert) {
|
39463 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39464 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39465 | offset >>>= 0;
|
39466 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
39467 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
39468 | }
|
39469 | var value = ieee754_read(this.view, offset, this.littleEndian, 23, 4);
|
39470 | if (relative) this.offset += 4;
|
39471 | return value;
|
39472 | };
|
39473 |
|
39474 | |
39475 |
|
39476 |
|
39477 |
|
39478 |
|
39479 |
|
39480 |
|
39481 | ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32;
|
39482 |
|
39483 |
|
39484 |
|
39485 | |
39486 |
|
39487 |
|
39488 |
|
39489 |
|
39490 |
|
39491 |
|
39492 | ByteBufferPrototype.writeFloat64 = function(value, offset) {
|
39493 | var relative = typeof offset === 'undefined';
|
39494 | if (relative) offset = this.offset;
|
39495 | if (!this.noAssert) {
|
39496 | if (typeof value !== 'number')
|
39497 | throw TypeError("Illegal value: "+value+" (not a number)");
|
39498 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39499 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39500 | offset >>>= 0;
|
39501 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39502 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39503 | }
|
39504 | offset += 8;
|
39505 | var capacity9 = this.buffer.byteLength;
|
39506 | if (offset > capacity9)
|
39507 | this.resize((capacity9 *= 2) > offset ? capacity9 : offset);
|
39508 | offset -= 8;
|
39509 | ieee754_write(this.view, value, offset, this.littleEndian, 52, 8);
|
39510 | if (relative) this.offset += 8;
|
39511 | return this;
|
39512 | };
|
39513 |
|
39514 | |
39515 |
|
39516 |
|
39517 |
|
39518 |
|
39519 |
|
39520 |
|
39521 |
|
39522 | ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64;
|
39523 |
|
39524 | |
39525 |
|
39526 |
|
39527 |
|
39528 |
|
39529 |
|
39530 | ByteBufferPrototype.readFloat64 = function(offset) {
|
39531 | var relative = typeof offset === 'undefined';
|
39532 | if (relative) offset = this.offset;
|
39533 | if (!this.noAssert) {
|
39534 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39535 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39536 | offset >>>= 0;
|
39537 | if (offset < 0 || offset + 8 > this.buffer.byteLength)
|
39538 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
|
39539 | }
|
39540 | var value = ieee754_read(this.view, offset, this.littleEndian, 52, 8);
|
39541 | if (relative) this.offset += 8;
|
39542 | return value;
|
39543 | };
|
39544 |
|
39545 | |
39546 |
|
39547 |
|
39548 |
|
39549 |
|
39550 |
|
39551 |
|
39552 | ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64;
|
39553 |
|
39554 |
|
39555 |
|
39556 |
|
39557 | |
39558 |
|
39559 |
|
39560 |
|
39561 |
|
39562 |
|
39563 | ByteBuffer.MAX_VARINT32_BYTES = 5;
|
39564 |
|
39565 | |
39566 |
|
39567 |
|
39568 |
|
39569 |
|
39570 |
|
39571 | ByteBuffer.calculateVarint32 = function(value) {
|
39572 |
|
39573 | value = value >>> 0;
|
39574 | if (value < 1 << 7 ) return 1;
|
39575 | else if (value < 1 << 14) return 2;
|
39576 | else if (value < 1 << 21) return 3;
|
39577 | else if (value < 1 << 28) return 4;
|
39578 | else return 5;
|
39579 | };
|
39580 |
|
39581 | |
39582 |
|
39583 |
|
39584 |
|
39585 |
|
39586 |
|
39587 | ByteBuffer.zigZagEncode32 = function(n) {
|
39588 | return (((n |= 0) << 1) ^ (n >> 31)) >>> 0;
|
39589 | };
|
39590 |
|
39591 | |
39592 |
|
39593 |
|
39594 |
|
39595 |
|
39596 |
|
39597 | ByteBuffer.zigZagDecode32 = function(n) {
|
39598 | return ((n >>> 1) ^ -(n & 1)) | 0;
|
39599 | };
|
39600 |
|
39601 | |
39602 |
|
39603 |
|
39604 |
|
39605 |
|
39606 |
|
39607 |
|
39608 |
|
39609 | ByteBufferPrototype.writeVarint32 = function(value, offset) {
|
39610 | var relative = typeof offset === 'undefined';
|
39611 | if (relative) offset = this.offset;
|
39612 | if (!this.noAssert) {
|
39613 | if (typeof value !== 'number' || value % 1 !== 0)
|
39614 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
39615 | value |= 0;
|
39616 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39617 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39618 | offset >>>= 0;
|
39619 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39620 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39621 | }
|
39622 | var size = ByteBuffer.calculateVarint32(value),
|
39623 | b;
|
39624 | offset += size;
|
39625 | var capacity10 = this.buffer.byteLength;
|
39626 | if (offset > capacity10)
|
39627 | this.resize((capacity10 *= 2) > offset ? capacity10 : offset);
|
39628 | offset -= size;
|
39629 | value >>>= 0;
|
39630 | while (value >= 0x80) {
|
39631 | b = (value & 0x7f) | 0x80;
|
39632 | this.view[offset++] = b;
|
39633 | value >>>= 7;
|
39634 | }
|
39635 | this.view[offset++] = value;
|
39636 | if (relative) {
|
39637 | this.offset = offset;
|
39638 | return this;
|
39639 | }
|
39640 | return size;
|
39641 | };
|
39642 |
|
39643 | |
39644 |
|
39645 |
|
39646 |
|
39647 |
|
39648 |
|
39649 |
|
39650 |
|
39651 | ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) {
|
39652 | return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset);
|
39653 | };
|
39654 |
|
39655 | |
39656 |
|
39657 |
|
39658 |
|
39659 |
|
39660 |
|
39661 |
|
39662 |
|
39663 |
|
39664 |
|
39665 | ByteBufferPrototype.readVarint32 = function(offset) {
|
39666 | var relative = typeof offset === 'undefined';
|
39667 | if (relative) offset = this.offset;
|
39668 | if (!this.noAssert) {
|
39669 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39670 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39671 | offset >>>= 0;
|
39672 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
39673 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
39674 | }
|
39675 | var c = 0,
|
39676 | value = 0 >>> 0,
|
39677 | b;
|
39678 | do {
|
39679 | if (!this.noAssert && offset > this.limit) {
|
39680 | var err = Error("Truncated");
|
39681 | err['truncated'] = true;
|
39682 | throw err;
|
39683 | }
|
39684 | b = this.view[offset++];
|
39685 | if (c < 5)
|
39686 | value |= (b & 0x7f) << (7*c);
|
39687 | ++c;
|
39688 | } while ((b & 0x80) !== 0);
|
39689 | value |= 0;
|
39690 | if (relative) {
|
39691 | this.offset = offset;
|
39692 | return value;
|
39693 | }
|
39694 | return {
|
39695 | "value": value,
|
39696 | "length": c
|
39697 | };
|
39698 | };
|
39699 |
|
39700 | |
39701 |
|
39702 |
|
39703 |
|
39704 |
|
39705 |
|
39706 |
|
39707 |
|
39708 |
|
39709 | ByteBufferPrototype.readVarint32ZigZag = function(offset) {
|
39710 | var val = this.readVarint32(offset);
|
39711 | if (typeof val === 'object')
|
39712 | val["value"] = ByteBuffer.zigZagDecode32(val["value"]);
|
39713 | else
|
39714 | val = ByteBuffer.zigZagDecode32(val);
|
39715 | return val;
|
39716 | };
|
39717 |
|
39718 |
|
39719 |
|
39720 | if (Long) {
|
39721 |
|
39722 | |
39723 |
|
39724 |
|
39725 |
|
39726 |
|
39727 |
|
39728 | ByteBuffer.MAX_VARINT64_BYTES = 10;
|
39729 |
|
39730 | |
39731 |
|
39732 |
|
39733 |
|
39734 |
|
39735 |
|
39736 | ByteBuffer.calculateVarint64 = function(value) {
|
39737 | if (typeof value === 'number')
|
39738 | value = Long.fromNumber(value);
|
39739 | else if (typeof value === 'string')
|
39740 | value = Long.fromString(value);
|
39741 |
|
39742 | var part0 = value.toInt() >>> 0,
|
39743 | part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
|
39744 | part2 = value.shiftRightUnsigned(56).toInt() >>> 0;
|
39745 | if (part2 == 0) {
|
39746 | if (part1 == 0) {
|
39747 | if (part0 < 1 << 14)
|
39748 | return part0 < 1 << 7 ? 1 : 2;
|
39749 | else
|
39750 | return part0 < 1 << 21 ? 3 : 4;
|
39751 | } else {
|
39752 | if (part1 < 1 << 14)
|
39753 | return part1 < 1 << 7 ? 5 : 6;
|
39754 | else
|
39755 | return part1 < 1 << 21 ? 7 : 8;
|
39756 | }
|
39757 | } else
|
39758 | return part2 < 1 << 7 ? 9 : 10;
|
39759 | };
|
39760 |
|
39761 | |
39762 |
|
39763 |
|
39764 |
|
39765 |
|
39766 |
|
39767 | ByteBuffer.zigZagEncode64 = function(value) {
|
39768 | if (typeof value === 'number')
|
39769 | value = Long.fromNumber(value, false);
|
39770 | else if (typeof value === 'string')
|
39771 | value = Long.fromString(value, false);
|
39772 | else if (value.unsigned !== false) value = value.toSigned();
|
39773 |
|
39774 | return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();
|
39775 | };
|
39776 |
|
39777 | |
39778 |
|
39779 |
|
39780 |
|
39781 |
|
39782 |
|
39783 | ByteBuffer.zigZagDecode64 = function(value) {
|
39784 | if (typeof value === 'number')
|
39785 | value = Long.fromNumber(value, false);
|
39786 | else if (typeof value === 'string')
|
39787 | value = Long.fromString(value, false);
|
39788 | else if (value.unsigned !== false) value = value.toSigned();
|
39789 |
|
39790 | return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();
|
39791 | };
|
39792 |
|
39793 | |
39794 |
|
39795 |
|
39796 |
|
39797 |
|
39798 |
|
39799 |
|
39800 |
|
39801 | ByteBufferPrototype.writeVarint64 = function(value, offset) {
|
39802 | var relative = typeof offset === 'undefined';
|
39803 | if (relative) offset = this.offset;
|
39804 | if (!this.noAssert) {
|
39805 | if (typeof value === 'number')
|
39806 | value = Long.fromNumber(value);
|
39807 | else if (typeof value === 'string')
|
39808 | value = Long.fromString(value);
|
39809 | else if (!(value && value instanceof Long))
|
39810 | throw TypeError("Illegal value: "+value+" (not an integer or Long)");
|
39811 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39812 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39813 | offset >>>= 0;
|
39814 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39815 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39816 | }
|
39817 | if (typeof value === 'number')
|
39818 | value = Long.fromNumber(value, false);
|
39819 | else if (typeof value === 'string')
|
39820 | value = Long.fromString(value, false);
|
39821 | else if (value.unsigned !== false) value = value.toSigned();
|
39822 | var size = ByteBuffer.calculateVarint64(value),
|
39823 | part0 = value.toInt() >>> 0,
|
39824 | part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
|
39825 | part2 = value.shiftRightUnsigned(56).toInt() >>> 0;
|
39826 | offset += size;
|
39827 | var capacity11 = this.buffer.byteLength;
|
39828 | if (offset > capacity11)
|
39829 | this.resize((capacity11 *= 2) > offset ? capacity11 : offset);
|
39830 | offset -= size;
|
39831 | switch (size) {
|
39832 | case 10: this.view[offset+9] = (part2 >>> 7) & 0x01;
|
39833 | case 9 : this.view[offset+8] = size !== 9 ? (part2 ) | 0x80 : (part2 ) & 0x7F;
|
39834 | case 8 : this.view[offset+7] = size !== 8 ? (part1 >>> 21) | 0x80 : (part1 >>> 21) & 0x7F;
|
39835 | case 7 : this.view[offset+6] = size !== 7 ? (part1 >>> 14) | 0x80 : (part1 >>> 14) & 0x7F;
|
39836 | case 6 : this.view[offset+5] = size !== 6 ? (part1 >>> 7) | 0x80 : (part1 >>> 7) & 0x7F;
|
39837 | case 5 : this.view[offset+4] = size !== 5 ? (part1 ) | 0x80 : (part1 ) & 0x7F;
|
39838 | case 4 : this.view[offset+3] = size !== 4 ? (part0 >>> 21) | 0x80 : (part0 >>> 21) & 0x7F;
|
39839 | case 3 : this.view[offset+2] = size !== 3 ? (part0 >>> 14) | 0x80 : (part0 >>> 14) & 0x7F;
|
39840 | case 2 : this.view[offset+1] = size !== 2 ? (part0 >>> 7) | 0x80 : (part0 >>> 7) & 0x7F;
|
39841 | case 1 : this.view[offset ] = size !== 1 ? (part0 ) | 0x80 : (part0 ) & 0x7F;
|
39842 | }
|
39843 | if (relative) {
|
39844 | this.offset += size;
|
39845 | return this;
|
39846 | } else {
|
39847 | return size;
|
39848 | }
|
39849 | };
|
39850 |
|
39851 | |
39852 |
|
39853 |
|
39854 |
|
39855 |
|
39856 |
|
39857 |
|
39858 |
|
39859 | ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) {
|
39860 | return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset);
|
39861 | };
|
39862 |
|
39863 | |
39864 |
|
39865 |
|
39866 |
|
39867 |
|
39868 |
|
39869 |
|
39870 |
|
39871 |
|
39872 | ByteBufferPrototype.readVarint64 = function(offset) {
|
39873 | var relative = typeof offset === 'undefined';
|
39874 | if (relative) offset = this.offset;
|
39875 | if (!this.noAssert) {
|
39876 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39877 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39878 | offset >>>= 0;
|
39879 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
39880 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
39881 | }
|
39882 |
|
39883 | var start = offset,
|
39884 | part0 = 0,
|
39885 | part1 = 0,
|
39886 | part2 = 0,
|
39887 | b = 0;
|
39888 | b = this.view[offset++]; part0 = (b & 0x7F) ; if ( b & 0x80 ) {
|
39889 | b = this.view[offset++]; part0 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39890 | b = this.view[offset++]; part0 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39891 | b = this.view[offset++]; part0 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39892 | b = this.view[offset++]; part1 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39893 | b = this.view[offset++]; part1 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39894 | b = this.view[offset++]; part1 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39895 | b = this.view[offset++]; part1 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39896 | b = this.view[offset++]; part2 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39897 | b = this.view[offset++]; part2 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
39898 | throw Error("Buffer overrun"); }}}}}}}}}}
|
39899 | var value = Long.fromBits(part0 | (part1 << 28), (part1 >>> 4) | (part2) << 24, false);
|
39900 | if (relative) {
|
39901 | this.offset = offset;
|
39902 | return value;
|
39903 | } else {
|
39904 | return {
|
39905 | 'value': value,
|
39906 | 'length': offset-start
|
39907 | };
|
39908 | }
|
39909 | };
|
39910 |
|
39911 | |
39912 |
|
39913 |
|
39914 |
|
39915 |
|
39916 |
|
39917 |
|
39918 |
|
39919 |
|
39920 | ByteBufferPrototype.readVarint64ZigZag = function(offset) {
|
39921 | var val = this.readVarint64(offset);
|
39922 | if (val && val['value'] instanceof Long)
|
39923 | val["value"] = ByteBuffer.zigZagDecode64(val["value"]);
|
39924 | else
|
39925 | val = ByteBuffer.zigZagDecode64(val);
|
39926 | return val;
|
39927 | };
|
39928 |
|
39929 | }
|
39930 |
|
39931 |
|
39932 |
|
39933 |
|
39934 | |
39935 |
|
39936 |
|
39937 |
|
39938 |
|
39939 |
|
39940 |
|
39941 |
|
39942 |
|
39943 | ByteBufferPrototype.writeCString = function(str, offset) {
|
39944 | var relative = typeof offset === 'undefined';
|
39945 | if (relative) offset = this.offset;
|
39946 | var i,
|
39947 | k = str.length;
|
39948 | if (!this.noAssert) {
|
39949 | if (typeof str !== 'string')
|
39950 | throw TypeError("Illegal str: Not a string");
|
39951 | for (i=0; i<k; ++i) {
|
39952 | if (str.charCodeAt(i) === 0)
|
39953 | throw RangeError("Illegal str: Contains NULL-characters");
|
39954 | }
|
39955 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39956 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39957 | offset >>>= 0;
|
39958 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
39959 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
39960 | }
|
39961 |
|
39962 | k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
|
39963 | offset += k+1;
|
39964 | var capacity12 = this.buffer.byteLength;
|
39965 | if (offset > capacity12)
|
39966 | this.resize((capacity12 *= 2) > offset ? capacity12 : offset);
|
39967 | offset -= k+1;
|
39968 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
39969 | this.view[offset++] = b;
|
39970 | }.bind(this));
|
39971 | this.view[offset++] = 0;
|
39972 | if (relative) {
|
39973 | this.offset = offset;
|
39974 | return this;
|
39975 | }
|
39976 | return k;
|
39977 | };
|
39978 |
|
39979 | |
39980 |
|
39981 |
|
39982 |
|
39983 |
|
39984 |
|
39985 |
|
39986 |
|
39987 |
|
39988 | ByteBufferPrototype.readCString = function(offset) {
|
39989 | var relative = typeof offset === 'undefined';
|
39990 | if (relative) offset = this.offset;
|
39991 | if (!this.noAssert) {
|
39992 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39993 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
39994 | offset >>>= 0;
|
39995 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
39996 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
39997 | }
|
39998 | var start = offset,
|
39999 | temp;
|
40000 |
|
40001 | var sd, b = -1;
|
40002 | utfx.decodeUTF8toUTF16(function() {
|
40003 | if (b === 0) return null;
|
40004 | if (offset >= this.limit)
|
40005 | throw RangeError("Illegal range: Truncated data, "+offset+" < "+this.limit);
|
40006 | b = this.view[offset++];
|
40007 | return b === 0 ? null : b;
|
40008 | }.bind(this), sd = stringDestination(), true);
|
40009 | if (relative) {
|
40010 | this.offset = offset;
|
40011 | return sd();
|
40012 | } else {
|
40013 | return {
|
40014 | "string": sd(),
|
40015 | "length": offset - start
|
40016 | };
|
40017 | }
|
40018 | };
|
40019 |
|
40020 |
|
40021 |
|
40022 | |
40023 |
|
40024 |
|
40025 |
|
40026 |
|
40027 |
|
40028 |
|
40029 |
|
40030 |
|
40031 | ByteBufferPrototype.writeIString = function(str, offset) {
|
40032 | var relative = typeof offset === 'undefined';
|
40033 | if (relative) offset = this.offset;
|
40034 | if (!this.noAssert) {
|
40035 | if (typeof str !== 'string')
|
40036 | throw TypeError("Illegal str: Not a string");
|
40037 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40038 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40039 | offset >>>= 0;
|
40040 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40041 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40042 | }
|
40043 | var start = offset,
|
40044 | k;
|
40045 | k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];
|
40046 | offset += 4+k;
|
40047 | var capacity13 = this.buffer.byteLength;
|
40048 | if (offset > capacity13)
|
40049 | this.resize((capacity13 *= 2) > offset ? capacity13 : offset);
|
40050 | offset -= 4+k;
|
40051 | if (this.littleEndian) {
|
40052 | this.view[offset+3] = (k >>> 24) & 0xFF;
|
40053 | this.view[offset+2] = (k >>> 16) & 0xFF;
|
40054 | this.view[offset+1] = (k >>> 8) & 0xFF;
|
40055 | this.view[offset ] = k & 0xFF;
|
40056 | } else {
|
40057 | this.view[offset ] = (k >>> 24) & 0xFF;
|
40058 | this.view[offset+1] = (k >>> 16) & 0xFF;
|
40059 | this.view[offset+2] = (k >>> 8) & 0xFF;
|
40060 | this.view[offset+3] = k & 0xFF;
|
40061 | }
|
40062 | offset += 4;
|
40063 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
40064 | this.view[offset++] = b;
|
40065 | }.bind(this));
|
40066 | if (offset !== start + 4 + k)
|
40067 | throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+4+k));
|
40068 | if (relative) {
|
40069 | this.offset = offset;
|
40070 | return this;
|
40071 | }
|
40072 | return offset - start;
|
40073 | };
|
40074 |
|
40075 | |
40076 |
|
40077 |
|
40078 |
|
40079 |
|
40080 |
|
40081 |
|
40082 |
|
40083 |
|
40084 | ByteBufferPrototype.readIString = function(offset) {
|
40085 | var relative = typeof offset === 'undefined';
|
40086 | if (relative) offset = this.offset;
|
40087 | if (!this.noAssert) {
|
40088 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40089 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40090 | offset >>>= 0;
|
40091 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
40092 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
40093 | }
|
40094 | var start = offset;
|
40095 | var len = this.readUint32(offset);
|
40096 | var str = this.readUTF8String(len, ByteBuffer.METRICS_BYTES, offset += 4);
|
40097 | offset += str['length'];
|
40098 | if (relative) {
|
40099 | this.offset = offset;
|
40100 | return str['string'];
|
40101 | } else {
|
40102 | return {
|
40103 | 'string': str['string'],
|
40104 | 'length': offset - start
|
40105 | };
|
40106 | }
|
40107 | };
|
40108 |
|
40109 |
|
40110 |
|
40111 | |
40112 |
|
40113 |
|
40114 |
|
40115 |
|
40116 |
|
40117 | ByteBuffer.METRICS_CHARS = 'c';
|
40118 |
|
40119 | |
40120 |
|
40121 |
|
40122 |
|
40123 |
|
40124 |
|
40125 | ByteBuffer.METRICS_BYTES = 'b';
|
40126 |
|
40127 | |
40128 |
|
40129 |
|
40130 |
|
40131 |
|
40132 |
|
40133 |
|
40134 | ByteBufferPrototype.writeUTF8String = function(str, offset) {
|
40135 | var relative = typeof offset === 'undefined';
|
40136 | if (relative) offset = this.offset;
|
40137 | if (!this.noAssert) {
|
40138 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40139 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40140 | offset >>>= 0;
|
40141 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40142 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40143 | }
|
40144 | var k;
|
40145 | var start = offset;
|
40146 | k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
|
40147 | offset += k;
|
40148 | var capacity14 = this.buffer.byteLength;
|
40149 | if (offset > capacity14)
|
40150 | this.resize((capacity14 *= 2) > offset ? capacity14 : offset);
|
40151 | offset -= k;
|
40152 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
40153 | this.view[offset++] = b;
|
40154 | }.bind(this));
|
40155 | if (relative) {
|
40156 | this.offset = offset;
|
40157 | return this;
|
40158 | }
|
40159 | return offset - start;
|
40160 | };
|
40161 |
|
40162 | |
40163 |
|
40164 |
|
40165 |
|
40166 |
|
40167 |
|
40168 |
|
40169 |
|
40170 | ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String;
|
40171 |
|
40172 | |
40173 |
|
40174 |
|
40175 |
|
40176 |
|
40177 |
|
40178 |
|
40179 | ByteBuffer.calculateUTF8Chars = function(str) {
|
40180 | return utfx.calculateUTF16asUTF8(stringSource(str))[0];
|
40181 | };
|
40182 |
|
40183 | |
40184 |
|
40185 |
|
40186 |
|
40187 |
|
40188 |
|
40189 | ByteBuffer.calculateUTF8Bytes = function(str) {
|
40190 | return utfx.calculateUTF16asUTF8(stringSource(str))[1];
|
40191 | };
|
40192 |
|
40193 | |
40194 |
|
40195 |
|
40196 |
|
40197 |
|
40198 |
|
40199 |
|
40200 | ByteBuffer.calculateString = ByteBuffer.calculateUTF8Bytes;
|
40201 |
|
40202 | |
40203 |
|
40204 |
|
40205 |
|
40206 |
|
40207 |
|
40208 |
|
40209 |
|
40210 |
|
40211 |
|
40212 |
|
40213 | ByteBufferPrototype.readUTF8String = function(length, metrics, offset) {
|
40214 | if (typeof metrics === 'number') {
|
40215 | offset = metrics;
|
40216 | metrics = undefined;
|
40217 | }
|
40218 | var relative = typeof offset === 'undefined';
|
40219 | if (relative) offset = this.offset;
|
40220 | if (typeof metrics === 'undefined') metrics = ByteBuffer.METRICS_CHARS;
|
40221 | if (!this.noAssert) {
|
40222 | if (typeof length !== 'number' || length % 1 !== 0)
|
40223 | throw TypeError("Illegal length: "+length+" (not an integer)");
|
40224 | length |= 0;
|
40225 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40226 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40227 | offset >>>= 0;
|
40228 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40229 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40230 | }
|
40231 | var i = 0,
|
40232 | start = offset,
|
40233 | sd;
|
40234 | if (metrics === ByteBuffer.METRICS_CHARS) {
|
40235 | sd = stringDestination();
|
40236 | utfx.decodeUTF8(function() {
|
40237 | return i < length && offset < this.limit ? this.view[offset++] : null;
|
40238 | }.bind(this), function(cp) {
|
40239 | ++i; utfx.UTF8toUTF16(cp, sd);
|
40240 | });
|
40241 | if (i !== length)
|
40242 | throw RangeError("Illegal range: Truncated data, "+i+" == "+length);
|
40243 | if (relative) {
|
40244 | this.offset = offset;
|
40245 | return sd();
|
40246 | } else {
|
40247 | return {
|
40248 | "string": sd(),
|
40249 | "length": offset - start
|
40250 | };
|
40251 | }
|
40252 | } else if (metrics === ByteBuffer.METRICS_BYTES) {
|
40253 | if (!this.noAssert) {
|
40254 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40255 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40256 | offset >>>= 0;
|
40257 | if (offset < 0 || offset + length > this.buffer.byteLength)
|
40258 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength);
|
40259 | }
|
40260 | var k = offset + length;
|
40261 | utfx.decodeUTF8toUTF16(function() {
|
40262 | return offset < k ? this.view[offset++] : null;
|
40263 | }.bind(this), sd = stringDestination(), this.noAssert);
|
40264 | if (offset !== k)
|
40265 | throw RangeError("Illegal range: Truncated data, "+offset+" == "+k);
|
40266 | if (relative) {
|
40267 | this.offset = offset;
|
40268 | return sd();
|
40269 | } else {
|
40270 | return {
|
40271 | 'string': sd(),
|
40272 | 'length': offset - start
|
40273 | };
|
40274 | }
|
40275 | } else
|
40276 | throw TypeError("Unsupported metrics: "+metrics);
|
40277 | };
|
40278 |
|
40279 | |
40280 |
|
40281 |
|
40282 |
|
40283 |
|
40284 |
|
40285 |
|
40286 |
|
40287 |
|
40288 |
|
40289 |
|
40290 |
|
40291 | ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String;
|
40292 |
|
40293 |
|
40294 |
|
40295 | |
40296 |
|
40297 |
|
40298 |
|
40299 |
|
40300 |
|
40301 |
|
40302 |
|
40303 |
|
40304 | ByteBufferPrototype.writeVString = function(str, offset) {
|
40305 | var relative = typeof offset === 'undefined';
|
40306 | if (relative) offset = this.offset;
|
40307 | if (!this.noAssert) {
|
40308 | if (typeof str !== 'string')
|
40309 | throw TypeError("Illegal str: Not a string");
|
40310 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40311 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40312 | offset >>>= 0;
|
40313 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40314 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40315 | }
|
40316 | var start = offset,
|
40317 | k, l;
|
40318 | k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];
|
40319 | l = ByteBuffer.calculateVarint32(k);
|
40320 | offset += l+k;
|
40321 | var capacity15 = this.buffer.byteLength;
|
40322 | if (offset > capacity15)
|
40323 | this.resize((capacity15 *= 2) > offset ? capacity15 : offset);
|
40324 | offset -= l+k;
|
40325 | offset += this.writeVarint32(k, offset);
|
40326 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
40327 | this.view[offset++] = b;
|
40328 | }.bind(this));
|
40329 | if (offset !== start+k+l)
|
40330 | throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+k+l));
|
40331 | if (relative) {
|
40332 | this.offset = offset;
|
40333 | return this;
|
40334 | }
|
40335 | return offset - start;
|
40336 | };
|
40337 |
|
40338 | |
40339 |
|
40340 |
|
40341 |
|
40342 |
|
40343 |
|
40344 |
|
40345 |
|
40346 |
|
40347 | ByteBufferPrototype.readVString = function(offset) {
|
40348 | var relative = typeof offset === 'undefined';
|
40349 | if (relative) offset = this.offset;
|
40350 | if (!this.noAssert) {
|
40351 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40352 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40353 | offset >>>= 0;
|
40354 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
40355 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
40356 | }
|
40357 | var start = offset;
|
40358 | var len = this.readVarint32(offset);
|
40359 | var str = this.readUTF8String(len['value'], ByteBuffer.METRICS_BYTES, offset += len['length']);
|
40360 | offset += str['length'];
|
40361 | if (relative) {
|
40362 | this.offset = offset;
|
40363 | return str['string'];
|
40364 | } else {
|
40365 | return {
|
40366 | 'string': str['string'],
|
40367 | 'length': offset - start
|
40368 | };
|
40369 | }
|
40370 | };
|
40371 |
|
40372 |
|
40373 | |
40374 |
|
40375 |
|
40376 |
|
40377 |
|
40378 |
|
40379 |
|
40380 |
|
40381 |
|
40382 |
|
40383 |
|
40384 |
|
40385 |
|
40386 | ByteBufferPrototype.append = function(source, encoding, offset) {
|
40387 | if (typeof encoding === 'number' || typeof encoding !== 'string') {
|
40388 | offset = encoding;
|
40389 | encoding = undefined;
|
40390 | }
|
40391 | var relative = typeof offset === 'undefined';
|
40392 | if (relative) offset = this.offset;
|
40393 | if (!this.noAssert) {
|
40394 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40395 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40396 | offset >>>= 0;
|
40397 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40398 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40399 | }
|
40400 | if (!(source instanceof ByteBuffer))
|
40401 | source = ByteBuffer.wrap(source, encoding);
|
40402 | var length = source.limit - source.offset;
|
40403 | if (length <= 0) return this;
|
40404 | offset += length;
|
40405 | var capacity16 = this.buffer.byteLength;
|
40406 | if (offset > capacity16)
|
40407 | this.resize((capacity16 *= 2) > offset ? capacity16 : offset);
|
40408 | offset -= length;
|
40409 | this.view.set(source.view.subarray(source.offset, source.limit), offset);
|
40410 | source.offset += length;
|
40411 | if (relative) this.offset += length;
|
40412 | return this;
|
40413 | };
|
40414 |
|
40415 | |
40416 |
|
40417 |
|
40418 |
|
40419 |
|
40420 |
|
40421 |
|
40422 |
|
40423 |
|
40424 |
|
40425 | ByteBufferPrototype.appendTo = function(target, offset) {
|
40426 | target.append(this, offset);
|
40427 | return this;
|
40428 | };
|
40429 |
|
40430 | |
40431 |
|
40432 |
|
40433 |
|
40434 |
|
40435 |
|
40436 |
|
40437 | ByteBufferPrototype.assert = function(assert) {
|
40438 | this.noAssert = !assert;
|
40439 | return this;
|
40440 | };
|
40441 |
|
40442 | |
40443 |
|
40444 |
|
40445 |
|
40446 |
|
40447 | ByteBufferPrototype.capacity = function() {
|
40448 | return this.buffer.byteLength;
|
40449 | };
|
40450 | |
40451 |
|
40452 |
|
40453 |
|
40454 |
|
40455 |
|
40456 | ByteBufferPrototype.clear = function() {
|
40457 | this.offset = 0;
|
40458 | this.limit = this.buffer.byteLength;
|
40459 | this.markedOffset = -1;
|
40460 | return this;
|
40461 | };
|
40462 |
|
40463 | |
40464 |
|
40465 |
|
40466 |
|
40467 |
|
40468 |
|
40469 |
|
40470 | ByteBufferPrototype.clone = function(copy) {
|
40471 | var bb = new ByteBuffer(0, this.littleEndian, this.noAssert);
|
40472 | if (copy) {
|
40473 | bb.buffer = new ArrayBuffer(this.buffer.byteLength);
|
40474 | bb.view = new Uint8Array(bb.buffer);
|
40475 | } else {
|
40476 | bb.buffer = this.buffer;
|
40477 | bb.view = this.view;
|
40478 | }
|
40479 | bb.offset = this.offset;
|
40480 | bb.markedOffset = this.markedOffset;
|
40481 | bb.limit = this.limit;
|
40482 | return bb;
|
40483 | };
|
40484 |
|
40485 | |
40486 |
|
40487 |
|
40488 |
|
40489 |
|
40490 |
|
40491 |
|
40492 |
|
40493 |
|
40494 | ByteBufferPrototype.compact = function(begin, end) {
|
40495 | if (typeof begin === 'undefined') begin = this.offset;
|
40496 | if (typeof end === 'undefined') end = this.limit;
|
40497 | if (!this.noAssert) {
|
40498 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
40499 | throw TypeError("Illegal begin: Not an integer");
|
40500 | begin >>>= 0;
|
40501 | if (typeof end !== 'number' || end % 1 !== 0)
|
40502 | throw TypeError("Illegal end: Not an integer");
|
40503 | end >>>= 0;
|
40504 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
40505 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
40506 | }
|
40507 | if (begin === 0 && end === this.buffer.byteLength)
|
40508 | return this;
|
40509 | var len = end - begin;
|
40510 | if (len === 0) {
|
40511 | this.buffer = EMPTY_BUFFER;
|
40512 | this.view = null;
|
40513 | if (this.markedOffset >= 0) this.markedOffset -= begin;
|
40514 | this.offset = 0;
|
40515 | this.limit = 0;
|
40516 | return this;
|
40517 | }
|
40518 | var buffer = new ArrayBuffer(len);
|
40519 | var view = new Uint8Array(buffer);
|
40520 | view.set(this.view.subarray(begin, end));
|
40521 | this.buffer = buffer;
|
40522 | this.view = view;
|
40523 | if (this.markedOffset >= 0) this.markedOffset -= begin;
|
40524 | this.offset = 0;
|
40525 | this.limit = len;
|
40526 | return this;
|
40527 | };
|
40528 |
|
40529 | |
40530 |
|
40531 |
|
40532 |
|
40533 |
|
40534 |
|
40535 |
|
40536 |
|
40537 | ByteBufferPrototype.copy = function(begin, end) {
|
40538 | if (typeof begin === 'undefined') begin = this.offset;
|
40539 | if (typeof end === 'undefined') end = this.limit;
|
40540 | if (!this.noAssert) {
|
40541 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
40542 | throw TypeError("Illegal begin: Not an integer");
|
40543 | begin >>>= 0;
|
40544 | if (typeof end !== 'number' || end % 1 !== 0)
|
40545 | throw TypeError("Illegal end: Not an integer");
|
40546 | end >>>= 0;
|
40547 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
40548 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
40549 | }
|
40550 | if (begin === end)
|
40551 | return new ByteBuffer(0, this.littleEndian, this.noAssert);
|
40552 | var capacity = end - begin,
|
40553 | bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert);
|
40554 | bb.offset = 0;
|
40555 | bb.limit = capacity;
|
40556 | if (bb.markedOffset >= 0) bb.markedOffset -= begin;
|
40557 | this.copyTo(bb, 0, begin, end);
|
40558 | return bb;
|
40559 | };
|
40560 |
|
40561 | |
40562 |
|
40563 |
|
40564 |
|
40565 |
|
40566 |
|
40567 |
|
40568 |
|
40569 |
|
40570 |
|
40571 |
|
40572 |
|
40573 | ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) {
|
40574 | var relative,
|
40575 | targetRelative;
|
40576 | if (!this.noAssert) {
|
40577 | if (!ByteBuffer.isByteBuffer(target))
|
40578 | throw TypeError("Illegal target: Not a ByteBuffer");
|
40579 | }
|
40580 | targetOffset = (targetRelative = typeof targetOffset === 'undefined') ? target.offset : targetOffset | 0;
|
40581 | sourceOffset = (relative = typeof sourceOffset === 'undefined') ? this.offset : sourceOffset | 0;
|
40582 | sourceLimit = typeof sourceLimit === 'undefined' ? this.limit : sourceLimit | 0;
|
40583 |
|
40584 | if (targetOffset < 0 || targetOffset > target.buffer.byteLength)
|
40585 | throw RangeError("Illegal target range: 0 <= "+targetOffset+" <= "+target.buffer.byteLength);
|
40586 | if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength)
|
40587 | throw RangeError("Illegal source range: 0 <= "+sourceOffset+" <= "+this.buffer.byteLength);
|
40588 |
|
40589 | var len = sourceLimit - sourceOffset;
|
40590 | if (len === 0)
|
40591 | return target;
|
40592 |
|
40593 | target.ensureCapacity(targetOffset + len);
|
40594 |
|
40595 | target.view.set(this.view.subarray(sourceOffset, sourceLimit), targetOffset);
|
40596 |
|
40597 | if (relative) this.offset += len;
|
40598 | if (targetRelative) target.offset += len;
|
40599 |
|
40600 | return this;
|
40601 | };
|
40602 |
|
40603 | |
40604 |
|
40605 |
|
40606 |
|
40607 |
|
40608 |
|
40609 |
|
40610 |
|
40611 | ByteBufferPrototype.ensureCapacity = function(capacity) {
|
40612 | var current = this.buffer.byteLength;
|
40613 | if (current < capacity)
|
40614 | return this.resize((current *= 2) > capacity ? current : capacity);
|
40615 | return this;
|
40616 | };
|
40617 |
|
40618 | |
40619 |
|
40620 |
|
40621 |
|
40622 |
|
40623 |
|
40624 |
|
40625 |
|
40626 |
|
40627 |
|
40628 |
|
40629 | ByteBufferPrototype.fill = function(value, begin, end) {
|
40630 | var relative = typeof begin === 'undefined';
|
40631 | if (relative) begin = this.offset;
|
40632 | if (typeof value === 'string' && value.length > 0)
|
40633 | value = value.charCodeAt(0);
|
40634 | if (typeof begin === 'undefined') begin = this.offset;
|
40635 | if (typeof end === 'undefined') end = this.limit;
|
40636 | if (!this.noAssert) {
|
40637 | if (typeof value !== 'number' || value % 1 !== 0)
|
40638 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
40639 | value |= 0;
|
40640 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
40641 | throw TypeError("Illegal begin: Not an integer");
|
40642 | begin >>>= 0;
|
40643 | if (typeof end !== 'number' || end % 1 !== 0)
|
40644 | throw TypeError("Illegal end: Not an integer");
|
40645 | end >>>= 0;
|
40646 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
40647 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
40648 | }
|
40649 | if (begin >= end)
|
40650 | return this;
|
40651 | while (begin < end) this.view[begin++] = value;
|
40652 | if (relative) this.offset = begin;
|
40653 | return this;
|
40654 | };
|
40655 |
|
40656 | |
40657 |
|
40658 |
|
40659 |
|
40660 |
|
40661 |
|
40662 | ByteBufferPrototype.flip = function() {
|
40663 | this.limit = this.offset;
|
40664 | this.offset = 0;
|
40665 | return this;
|
40666 | };
|
40667 | |
40668 |
|
40669 |
|
40670 |
|
40671 |
|
40672 |
|
40673 |
|
40674 |
|
40675 |
|
40676 | ByteBufferPrototype.mark = function(offset) {
|
40677 | offset = typeof offset === 'undefined' ? this.offset : offset;
|
40678 | if (!this.noAssert) {
|
40679 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40680 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40681 | offset >>>= 0;
|
40682 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40683 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40684 | }
|
40685 | this.markedOffset = offset;
|
40686 | return this;
|
40687 | };
|
40688 | |
40689 |
|
40690 |
|
40691 |
|
40692 |
|
40693 |
|
40694 | ByteBufferPrototype.order = function(littleEndian) {
|
40695 | if (!this.noAssert) {
|
40696 | if (typeof littleEndian !== 'boolean')
|
40697 | throw TypeError("Illegal littleEndian: Not a boolean");
|
40698 | }
|
40699 | this.littleEndian = !!littleEndian;
|
40700 | return this;
|
40701 | };
|
40702 |
|
40703 | |
40704 |
|
40705 |
|
40706 |
|
40707 |
|
40708 |
|
40709 | ByteBufferPrototype.LE = function(littleEndian) {
|
40710 | this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : true;
|
40711 | return this;
|
40712 | };
|
40713 |
|
40714 | |
40715 |
|
40716 |
|
40717 |
|
40718 |
|
40719 |
|
40720 | ByteBufferPrototype.BE = function(bigEndian) {
|
40721 | this.littleEndian = typeof bigEndian !== 'undefined' ? !bigEndian : false;
|
40722 | return this;
|
40723 | };
|
40724 | |
40725 |
|
40726 |
|
40727 |
|
40728 |
|
40729 |
|
40730 |
|
40731 |
|
40732 |
|
40733 |
|
40734 |
|
40735 |
|
40736 |
|
40737 |
|
40738 | ByteBufferPrototype.prepend = function(source, encoding, offset) {
|
40739 | if (typeof encoding === 'number' || typeof encoding !== 'string') {
|
40740 | offset = encoding;
|
40741 | encoding = undefined;
|
40742 | }
|
40743 | var relative = typeof offset === 'undefined';
|
40744 | if (relative) offset = this.offset;
|
40745 | if (!this.noAssert) {
|
40746 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40747 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
40748 | offset >>>= 0;
|
40749 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
40750 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
40751 | }
|
40752 | if (!(source instanceof ByteBuffer))
|
40753 | source = ByteBuffer.wrap(source, encoding);
|
40754 | var len = source.limit - source.offset;
|
40755 | if (len <= 0) return this;
|
40756 | var diff = len - offset;
|
40757 | if (diff > 0) {
|
40758 | var buffer = new ArrayBuffer(this.buffer.byteLength + diff);
|
40759 | var view = new Uint8Array(buffer);
|
40760 | view.set(this.view.subarray(offset, this.buffer.byteLength), len);
|
40761 | this.buffer = buffer;
|
40762 | this.view = view;
|
40763 | this.offset += diff;
|
40764 | if (this.markedOffset >= 0) this.markedOffset += diff;
|
40765 | this.limit += diff;
|
40766 | offset += diff;
|
40767 | } else {
|
40768 | var arrayView = new Uint8Array(this.buffer);
|
40769 | }
|
40770 | this.view.set(source.view.subarray(source.offset, source.limit), offset - len);
|
40771 |
|
40772 | source.offset = source.limit;
|
40773 | if (relative)
|
40774 | this.offset -= len;
|
40775 | return this;
|
40776 | };
|
40777 |
|
40778 | |
40779 |
|
40780 |
|
40781 |
|
40782 |
|
40783 |
|
40784 |
|
40785 |
|
40786 |
|
40787 |
|
40788 |
|
40789 | ByteBufferPrototype.prependTo = function(target, offset) {
|
40790 | target.prepend(this, offset);
|
40791 | return this;
|
40792 | };
|
40793 | |
40794 |
|
40795 |
|
40796 |
|
40797 |
|
40798 | ByteBufferPrototype.printDebug = function(out) {
|
40799 | if (typeof out !== 'function') out = console.log.bind(console);
|
40800 | out(
|
40801 | this.toString()+"\n"+
|
40802 | "-------------------------------------------------------------------\n"+
|
40803 | this.toDebug( true)
|
40804 | );
|
40805 | };
|
40806 |
|
40807 | |
40808 |
|
40809 |
|
40810 |
|
40811 |
|
40812 |
|
40813 | ByteBufferPrototype.remaining = function() {
|
40814 | return this.limit - this.offset;
|
40815 | };
|
40816 | |
40817 |
|
40818 |
|
40819 |
|
40820 |
|
40821 |
|
40822 |
|
40823 |
|
40824 | ByteBufferPrototype.reset = function() {
|
40825 | if (this.markedOffset >= 0) {
|
40826 | this.offset = this.markedOffset;
|
40827 | this.markedOffset = -1;
|
40828 | } else {
|
40829 | this.offset = 0;
|
40830 | }
|
40831 | return this;
|
40832 | };
|
40833 | |
40834 |
|
40835 |
|
40836 |
|
40837 |
|
40838 |
|
40839 |
|
40840 |
|
40841 |
|
40842 | ByteBufferPrototype.resize = function(capacity) {
|
40843 | if (!this.noAssert) {
|
40844 | if (typeof capacity !== 'number' || capacity % 1 !== 0)
|
40845 | throw TypeError("Illegal capacity: "+capacity+" (not an integer)");
|
40846 | capacity |= 0;
|
40847 | if (capacity < 0)
|
40848 | throw RangeError("Illegal capacity: 0 <= "+capacity);
|
40849 | }
|
40850 | if (this.buffer.byteLength < capacity) {
|
40851 | var buffer = new ArrayBuffer(capacity);
|
40852 | var view = new Uint8Array(buffer);
|
40853 | view.set(this.view);
|
40854 | this.buffer = buffer;
|
40855 | this.view = view;
|
40856 | }
|
40857 | return this;
|
40858 | };
|
40859 | |
40860 |
|
40861 |
|
40862 |
|
40863 |
|
40864 |
|
40865 |
|
40866 | ByteBufferPrototype.reverse = function(begin, end) {
|
40867 | if (typeof begin === 'undefined') begin = this.offset;
|
40868 | if (typeof end === 'undefined') end = this.limit;
|
40869 | if (!this.noAssert) {
|
40870 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
40871 | throw TypeError("Illegal begin: Not an integer");
|
40872 | begin >>>= 0;
|
40873 | if (typeof end !== 'number' || end % 1 !== 0)
|
40874 | throw TypeError("Illegal end: Not an integer");
|
40875 | end >>>= 0;
|
40876 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
40877 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
40878 | }
|
40879 | if (begin === end)
|
40880 | return this;
|
40881 | Array.prototype.reverse.call(this.view.subarray(begin, end));
|
40882 | return this;
|
40883 | };
|
40884 | |
40885 |
|
40886 |
|
40887 |
|
40888 |
|
40889 |
|
40890 | ByteBufferPrototype.skip = function(length) {
|
40891 | if (!this.noAssert) {
|
40892 | if (typeof length !== 'number' || length % 1 !== 0)
|
40893 | throw TypeError("Illegal length: "+length+" (not an integer)");
|
40894 | length |= 0;
|
40895 | }
|
40896 | var offset = this.offset + length;
|
40897 | if (!this.noAssert) {
|
40898 | if (offset < 0 || offset > this.buffer.byteLength)
|
40899 | throw RangeError("Illegal length: 0 <= "+this.offset+" + "+length+" <= "+this.buffer.byteLength);
|
40900 | }
|
40901 | this.offset = offset;
|
40902 | return this;
|
40903 | };
|
40904 |
|
40905 | |
40906 |
|
40907 |
|
40908 |
|
40909 |
|
40910 |
|
40911 |
|
40912 | ByteBufferPrototype.slice = function(begin, end) {
|
40913 | if (typeof begin === 'undefined') begin = this.offset;
|
40914 | if (typeof end === 'undefined') end = this.limit;
|
40915 | if (!this.noAssert) {
|
40916 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
40917 | throw TypeError("Illegal begin: Not an integer");
|
40918 | begin >>>= 0;
|
40919 | if (typeof end !== 'number' || end % 1 !== 0)
|
40920 | throw TypeError("Illegal end: Not an integer");
|
40921 | end >>>= 0;
|
40922 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
40923 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
40924 | }
|
40925 | var bb = this.clone();
|
40926 | bb.offset = begin;
|
40927 | bb.limit = end;
|
40928 | return bb;
|
40929 | };
|
40930 | |
40931 |
|
40932 |
|
40933 |
|
40934 |
|
40935 |
|
40936 |
|
40937 |
|
40938 | ByteBufferPrototype.toBuffer = function(forceCopy) {
|
40939 | var offset = this.offset,
|
40940 | limit = this.limit;
|
40941 | if (!this.noAssert) {
|
40942 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
40943 | throw TypeError("Illegal offset: Not an integer");
|
40944 | offset >>>= 0;
|
40945 | if (typeof limit !== 'number' || limit % 1 !== 0)
|
40946 | throw TypeError("Illegal limit: Not an integer");
|
40947 | limit >>>= 0;
|
40948 | if (offset < 0 || offset > limit || limit > this.buffer.byteLength)
|
40949 | throw RangeError("Illegal range: 0 <= "+offset+" <= "+limit+" <= "+this.buffer.byteLength);
|
40950 | }
|
40951 |
|
40952 |
|
40953 | if (!forceCopy && offset === 0 && limit === this.buffer.byteLength)
|
40954 | return this.buffer;
|
40955 | if (offset === limit)
|
40956 | return EMPTY_BUFFER;
|
40957 | var buffer = new ArrayBuffer(limit - offset);
|
40958 | new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0);
|
40959 | return buffer;
|
40960 | };
|
40961 |
|
40962 | |
40963 |
|
40964 |
|
40965 |
|
40966 |
|
40967 |
|
40968 |
|
40969 |
|
40970 |
|
40971 | ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer;
|
40972 |
|
40973 | |
40974 |
|
40975 |
|
40976 |
|
40977 |
|
40978 |
|
40979 |
|
40980 |
|
40981 |
|
40982 |
|
40983 |
|
40984 | ByteBufferPrototype.toString = function(encoding, begin, end) {
|
40985 | if (typeof encoding === 'undefined')
|
40986 | return "ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";
|
40987 | if (typeof encoding === 'number')
|
40988 | encoding = "utf8",
|
40989 | begin = encoding,
|
40990 | end = begin;
|
40991 | switch (encoding) {
|
40992 | case "utf8":
|
40993 | return this.toUTF8(begin, end);
|
40994 | case "base64":
|
40995 | return this.toBase64(begin, end);
|
40996 | case "hex":
|
40997 | return this.toHex(begin, end);
|
40998 | case "binary":
|
40999 | return this.toBinary(begin, end);
|
41000 | case "debug":
|
41001 | return this.toDebug();
|
41002 | case "columns":
|
41003 | return this.toColumns();
|
41004 | default:
|
41005 | throw Error("Unsupported encoding: "+encoding);
|
41006 | }
|
41007 | };
|
41008 |
|
41009 |
|
41010 |
|
41011 | |
41012 |
|
41013 |
|
41014 |
|
41015 |
|
41016 | var lxiv = function() {
|
41017 | "use strict";
|
41018 |
|
41019 | |
41020 |
|
41021 |
|
41022 |
|
41023 |
|
41024 | var lxiv = {};
|
41025 |
|
41026 | |
41027 |
|
41028 |
|
41029 |
|
41030 |
|
41031 | var aout = [
|
41032 | 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
|
41033 | 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,
|
41034 | 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
|
41035 | 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47
|
41036 | ];
|
41037 |
|
41038 | |
41039 |
|
41040 |
|
41041 |
|
41042 |
|
41043 | var ain = [];
|
41044 | for (var i=0, k=aout.length; i<k; ++i)
|
41045 | ain[aout[i]] = i;
|
41046 |
|
41047 | |
41048 |
|
41049 |
|
41050 |
|
41051 |
|
41052 |
|
41053 |
|
41054 | lxiv.encode = function(src, dst) {
|
41055 | var b, t;
|
41056 | while ((b = src()) !== null) {
|
41057 | dst(aout[(b>>2)&0x3f]);
|
41058 | t = (b&0x3)<<4;
|
41059 | if ((b = src()) !== null) {
|
41060 | t |= (b>>4)&0xf;
|
41061 | dst(aout[(t|((b>>4)&0xf))&0x3f]);
|
41062 | t = (b&0xf)<<2;
|
41063 | if ((b = src()) !== null)
|
41064 | dst(aout[(t|((b>>6)&0x3))&0x3f]),
|
41065 | dst(aout[b&0x3f]);
|
41066 | else
|
41067 | dst(aout[t&0x3f]),
|
41068 | dst(61);
|
41069 | } else
|
41070 | dst(aout[t&0x3f]),
|
41071 | dst(61),
|
41072 | dst(61);
|
41073 | }
|
41074 | };
|
41075 |
|
41076 | |
41077 |
|
41078 |
|
41079 |
|
41080 |
|
41081 |
|
41082 |
|
41083 | lxiv.decode = function(src, dst) {
|
41084 | var c, t1, t2;
|
41085 | function fail(c) {
|
41086 | throw Error("Illegal character code: "+c);
|
41087 | }
|
41088 | while ((c = src()) !== null) {
|
41089 | t1 = ain[c];
|
41090 | if (typeof t1 === 'undefined') fail(c);
|
41091 | if ((c = src()) !== null) {
|
41092 | t2 = ain[c];
|
41093 | if (typeof t2 === 'undefined') fail(c);
|
41094 | dst((t1<<2)>>>0|(t2&0x30)>>4);
|
41095 | if ((c = src()) !== null) {
|
41096 | t1 = ain[c];
|
41097 | if (typeof t1 === 'undefined')
|
41098 | if (c === 61) break; else fail(c);
|
41099 | dst(((t2&0xf)<<4)>>>0|(t1&0x3c)>>2);
|
41100 | if ((c = src()) !== null) {
|
41101 | t2 = ain[c];
|
41102 | if (typeof t2 === 'undefined')
|
41103 | if (c === 61) break; else fail(c);
|
41104 | dst(((t1&0x3)<<6)>>>0|t2);
|
41105 | }
|
41106 | }
|
41107 | }
|
41108 | }
|
41109 | };
|
41110 |
|
41111 | |
41112 |
|
41113 |
|
41114 |
|
41115 |
|
41116 | lxiv.test = function(str) {
|
41117 | return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str);
|
41118 | };
|
41119 |
|
41120 | return lxiv;
|
41121 | }();
|
41122 |
|
41123 |
|
41124 |
|
41125 | |
41126 |
|
41127 |
|
41128 |
|
41129 |
|
41130 |
|
41131 |
|
41132 |
|
41133 | ByteBufferPrototype.toBase64 = function(begin, end) {
|
41134 | if (typeof begin === 'undefined')
|
41135 | begin = this.offset;
|
41136 | if (typeof end === 'undefined')
|
41137 | end = this.limit;
|
41138 | begin = begin | 0; end = end | 0;
|
41139 | if (begin < 0 || end > this.capacity || begin > end)
|
41140 | throw RangeError("begin, end");
|
41141 | var sd; lxiv.encode(function() {
|
41142 | return begin < end ? this.view[begin++] : null;
|
41143 | }.bind(this), sd = stringDestination());
|
41144 | return sd();
|
41145 | };
|
41146 |
|
41147 | |
41148 |
|
41149 |
|
41150 |
|
41151 |
|
41152 |
|
41153 |
|
41154 |
|
41155 | ByteBuffer.fromBase64 = function(str, littleEndian) {
|
41156 | if (typeof str !== 'string')
|
41157 | throw TypeError("str");
|
41158 | var bb = new ByteBuffer(str.length/4*3, littleEndian),
|
41159 | i = 0;
|
41160 | lxiv.decode(stringSource(str), function(b) {
|
41161 | bb.view[i++] = b;
|
41162 | });
|
41163 | bb.limit = i;
|
41164 | return bb;
|
41165 | };
|
41166 |
|
41167 | |
41168 |
|
41169 |
|
41170 |
|
41171 |
|
41172 |
|
41173 |
|
41174 | ByteBuffer.btoa = function(str) {
|
41175 | return ByteBuffer.fromBinary(str).toBase64();
|
41176 | };
|
41177 |
|
41178 | |
41179 |
|
41180 |
|
41181 |
|
41182 |
|
41183 |
|
41184 |
|
41185 | ByteBuffer.atob = function(b64) {
|
41186 | return ByteBuffer.fromBase64(b64).toBinary();
|
41187 | };
|
41188 |
|
41189 |
|
41190 |
|
41191 | |
41192 |
|
41193 |
|
41194 |
|
41195 |
|
41196 |
|
41197 |
|
41198 |
|
41199 | ByteBufferPrototype.toBinary = function(begin, end) {
|
41200 | if (typeof begin === 'undefined')
|
41201 | begin = this.offset;
|
41202 | if (typeof end === 'undefined')
|
41203 | end = this.limit;
|
41204 | begin |= 0; end |= 0;
|
41205 | if (begin < 0 || end > this.capacity() || begin > end)
|
41206 | throw RangeError("begin, end");
|
41207 | if (begin === end)
|
41208 | return "";
|
41209 | var chars = [],
|
41210 | parts = [];
|
41211 | while (begin < end) {
|
41212 | chars.push(this.view[begin++]);
|
41213 | if (chars.length >= 1024)
|
41214 | parts.push(String.fromCharCode.apply(String, chars)),
|
41215 | chars = [];
|
41216 | }
|
41217 | return parts.join('') + String.fromCharCode.apply(String, chars);
|
41218 | };
|
41219 |
|
41220 | |
41221 |
|
41222 |
|
41223 |
|
41224 |
|
41225 |
|
41226 |
|
41227 |
|
41228 | ByteBuffer.fromBinary = function(str, littleEndian) {
|
41229 | if (typeof str !== 'string')
|
41230 | throw TypeError("str");
|
41231 | var i = 0,
|
41232 | k = str.length,
|
41233 | charCode,
|
41234 | bb = new ByteBuffer(k, littleEndian);
|
41235 | while (i<k) {
|
41236 | charCode = str.charCodeAt(i);
|
41237 | if (charCode > 0xff)
|
41238 | throw RangeError("illegal char code: "+charCode);
|
41239 | bb.view[i++] = charCode;
|
41240 | }
|
41241 | bb.limit = k;
|
41242 | return bb;
|
41243 | };
|
41244 |
|
41245 |
|
41246 |
|
41247 | |
41248 |
|
41249 |
|
41250 |
|
41251 |
|
41252 |
|
41253 |
|
41254 |
|
41255 |
|
41256 |
|
41257 |
|
41258 |
|
41259 |
|
41260 |
|
41261 |
|
41262 |
|
41263 |
|
41264 | ByteBufferPrototype.toDebug = function(columns) {
|
41265 | var i = -1,
|
41266 | k = this.buffer.byteLength,
|
41267 | b,
|
41268 | hex = "",
|
41269 | asc = "",
|
41270 | out = "";
|
41271 | while (i<k) {
|
41272 | if (i !== -1) {
|
41273 | b = this.view[i];
|
41274 | if (b < 0x10) hex += "0"+b.toString(16).toUpperCase();
|
41275 | else hex += b.toString(16).toUpperCase();
|
41276 | if (columns)
|
41277 | asc += b > 32 && b < 127 ? String.fromCharCode(b) : '.';
|
41278 | }
|
41279 | ++i;
|
41280 | if (columns) {
|
41281 | if (i > 0 && i % 16 === 0 && i !== k) {
|
41282 | while (hex.length < 3*16+3) hex += " ";
|
41283 | out += hex+asc+"\n";
|
41284 | hex = asc = "";
|
41285 | }
|
41286 | }
|
41287 | if (i === this.offset && i === this.limit)
|
41288 | hex += i === this.markedOffset ? "!" : "|";
|
41289 | else if (i === this.offset)
|
41290 | hex += i === this.markedOffset ? "[" : "<";
|
41291 | else if (i === this.limit)
|
41292 | hex += i === this.markedOffset ? "]" : ">";
|
41293 | else
|
41294 | hex += i === this.markedOffset ? "'" : (columns || (i !== 0 && i !== k) ? " " : "");
|
41295 | }
|
41296 | if (columns && hex !== " ") {
|
41297 | while (hex.length < 3*16+3)
|
41298 | hex += " ";
|
41299 | out += hex + asc + "\n";
|
41300 | }
|
41301 | return columns ? out : hex;
|
41302 | };
|
41303 |
|
41304 | |
41305 |
|
41306 |
|
41307 |
|
41308 |
|
41309 |
|
41310 |
|
41311 |
|
41312 |
|
41313 |
|
41314 |
|
41315 | ByteBuffer.fromDebug = function(str, littleEndian, noAssert) {
|
41316 | var k = str.length,
|
41317 | bb = new ByteBuffer(((k+1)/3)|0, littleEndian, noAssert);
|
41318 | var i = 0, j = 0, ch, b,
|
41319 | rs = false,
|
41320 | ho = false, hm = false, hl = false,
|
41321 | fail = false;
|
41322 | while (i<k) {
|
41323 | switch (ch = str.charAt(i++)) {
|
41324 | case '!':
|
41325 | if (!noAssert) {
|
41326 | if (ho || hm || hl) {
|
41327 | fail = true;
|
41328 | break;
|
41329 | }
|
41330 | ho = hm = hl = true;
|
41331 | }
|
41332 | bb.offset = bb.markedOffset = bb.limit = j;
|
41333 | rs = false;
|
41334 | break;
|
41335 | case '|':
|
41336 | if (!noAssert) {
|
41337 | if (ho || hl) {
|
41338 | fail = true;
|
41339 | break;
|
41340 | }
|
41341 | ho = hl = true;
|
41342 | }
|
41343 | bb.offset = bb.limit = j;
|
41344 | rs = false;
|
41345 | break;
|
41346 | case '[':
|
41347 | if (!noAssert) {
|
41348 | if (ho || hm) {
|
41349 | fail = true;
|
41350 | break;
|
41351 | }
|
41352 | ho = hm = true;
|
41353 | }
|
41354 | bb.offset = bb.markedOffset = j;
|
41355 | rs = false;
|
41356 | break;
|
41357 | case '<':
|
41358 | if (!noAssert) {
|
41359 | if (ho) {
|
41360 | fail = true;
|
41361 | break;
|
41362 | }
|
41363 | ho = true;
|
41364 | }
|
41365 | bb.offset = j;
|
41366 | rs = false;
|
41367 | break;
|
41368 | case ']':
|
41369 | if (!noAssert) {
|
41370 | if (hl || hm) {
|
41371 | fail = true;
|
41372 | break;
|
41373 | }
|
41374 | hl = hm = true;
|
41375 | }
|
41376 | bb.limit = bb.markedOffset = j;
|
41377 | rs = false;
|
41378 | break;
|
41379 | case '>':
|
41380 | if (!noAssert) {
|
41381 | if (hl) {
|
41382 | fail = true;
|
41383 | break;
|
41384 | }
|
41385 | hl = true;
|
41386 | }
|
41387 | bb.limit = j;
|
41388 | rs = false;
|
41389 | break;
|
41390 | case "'":
|
41391 | if (!noAssert) {
|
41392 | if (hm) {
|
41393 | fail = true;
|
41394 | break;
|
41395 | }
|
41396 | hm = true;
|
41397 | }
|
41398 | bb.markedOffset = j;
|
41399 | rs = false;
|
41400 | break;
|
41401 | case ' ':
|
41402 | rs = false;
|
41403 | break;
|
41404 | default:
|
41405 | if (!noAssert) {
|
41406 | if (rs) {
|
41407 | fail = true;
|
41408 | break;
|
41409 | }
|
41410 | }
|
41411 | b = parseInt(ch+str.charAt(i++), 16);
|
41412 | if (!noAssert) {
|
41413 | if (isNaN(b) || b < 0 || b > 255)
|
41414 | throw TypeError("Illegal str: Not a debug encoded string");
|
41415 | }
|
41416 | bb.view[j++] = b;
|
41417 | rs = true;
|
41418 | }
|
41419 | if (fail)
|
41420 | throw TypeError("Illegal str: Invalid symbol at "+i);
|
41421 | }
|
41422 | if (!noAssert) {
|
41423 | if (!ho || !hl)
|
41424 | throw TypeError("Illegal str: Missing offset or limit");
|
41425 | if (j<bb.buffer.byteLength)
|
41426 | throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+j+" < "+k);
|
41427 | }
|
41428 | return bb;
|
41429 | };
|
41430 |
|
41431 |
|
41432 |
|
41433 | |
41434 |
|
41435 |
|
41436 |
|
41437 |
|
41438 |
|
41439 |
|
41440 | ByteBufferPrototype.toHex = function(begin, end) {
|
41441 | begin = typeof begin === 'undefined' ? this.offset : begin;
|
41442 | end = typeof end === 'undefined' ? this.limit : end;
|
41443 | if (!this.noAssert) {
|
41444 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
41445 | throw TypeError("Illegal begin: Not an integer");
|
41446 | begin >>>= 0;
|
41447 | if (typeof end !== 'number' || end % 1 !== 0)
|
41448 | throw TypeError("Illegal end: Not an integer");
|
41449 | end >>>= 0;
|
41450 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
41451 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
41452 | }
|
41453 | var out = new Array(end - begin),
|
41454 | b;
|
41455 | while (begin < end) {
|
41456 | b = this.view[begin++];
|
41457 | if (b < 0x10)
|
41458 | out.push("0", b.toString(16));
|
41459 | else out.push(b.toString(16));
|
41460 | }
|
41461 | return out.join('');
|
41462 | };
|
41463 |
|
41464 | |
41465 |
|
41466 |
|
41467 |
|
41468 |
|
41469 |
|
41470 |
|
41471 |
|
41472 |
|
41473 |
|
41474 | ByteBuffer.fromHex = function(str, littleEndian, noAssert) {
|
41475 | if (!noAssert) {
|
41476 | if (typeof str !== 'string')
|
41477 | throw TypeError("Illegal str: Not a string");
|
41478 | if (str.length % 2 !== 0)
|
41479 | throw TypeError("Illegal str: Length not a multiple of 2");
|
41480 | }
|
41481 | var k = str.length,
|
41482 | bb = new ByteBuffer((k / 2) | 0, littleEndian),
|
41483 | b;
|
41484 | for (var i=0, j=0; i<k; i+=2) {
|
41485 | b = parseInt(str.substring(i, i+2), 16);
|
41486 | if (!noAssert)
|
41487 | if (!isFinite(b) || b < 0 || b > 255)
|
41488 | throw TypeError("Illegal str: Contains non-hex characters");
|
41489 | bb.view[j++] = b;
|
41490 | }
|
41491 | bb.limit = j;
|
41492 | return bb;
|
41493 | };
|
41494 |
|
41495 |
|
41496 |
|
41497 | |
41498 |
|
41499 |
|
41500 |
|
41501 |
|
41502 | var utfx = function() {
|
41503 | "use strict";
|
41504 |
|
41505 | |
41506 |
|
41507 |
|
41508 |
|
41509 |
|
41510 | var utfx = {};
|
41511 |
|
41512 | |
41513 |
|
41514 |
|
41515 |
|
41516 |
|
41517 | utfx.MAX_CODEPOINT = 0x10FFFF;
|
41518 |
|
41519 | |
41520 |
|
41521 |
|
41522 |
|
41523 |
|
41524 |
|
41525 | utfx.encodeUTF8 = function(src, dst) {
|
41526 | var cp = null;
|
41527 | if (typeof src === 'number')
|
41528 | cp = src,
|
41529 | src = function() { return null; };
|
41530 | while (cp !== null || (cp = src()) !== null) {
|
41531 | if (cp < 0x80)
|
41532 | dst(cp&0x7F);
|
41533 | else if (cp < 0x800)
|
41534 | dst(((cp>>6)&0x1F)|0xC0),
|
41535 | dst((cp&0x3F)|0x80);
|
41536 | else if (cp < 0x10000)
|
41537 | dst(((cp>>12)&0x0F)|0xE0),
|
41538 | dst(((cp>>6)&0x3F)|0x80),
|
41539 | dst((cp&0x3F)|0x80);
|
41540 | else
|
41541 | dst(((cp>>18)&0x07)|0xF0),
|
41542 | dst(((cp>>12)&0x3F)|0x80),
|
41543 | dst(((cp>>6)&0x3F)|0x80),
|
41544 | dst((cp&0x3F)|0x80);
|
41545 | cp = null;
|
41546 | }
|
41547 | };
|
41548 |
|
41549 | |
41550 |
|
41551 |
|
41552 |
|
41553 |
|
41554 |
|
41555 |
|
41556 |
|
41557 |
|
41558 | utfx.decodeUTF8 = function(src, dst) {
|
41559 | var a, b, c, d, fail = function(b) {
|
41560 | b = b.slice(0, b.indexOf(null));
|
41561 | var err = Error(b.toString());
|
41562 | err.name = "TruncatedError";
|
41563 | err['bytes'] = b;
|
41564 | throw err;
|
41565 | };
|
41566 | while ((a = src()) !== null) {
|
41567 | if ((a&0x80) === 0)
|
41568 | dst(a);
|
41569 | else if ((a&0xE0) === 0xC0)
|
41570 | ((b = src()) === null) && fail([a, b]),
|
41571 | dst(((a&0x1F)<<6) | (b&0x3F));
|
41572 | else if ((a&0xF0) === 0xE0)
|
41573 | ((b=src()) === null || (c=src()) === null) && fail([a, b, c]),
|
41574 | dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F));
|
41575 | else if ((a&0xF8) === 0xF0)
|
41576 | ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]),
|
41577 | dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F));
|
41578 | else throw RangeError("Illegal starting byte: "+a);
|
41579 | }
|
41580 | };
|
41581 |
|
41582 | |
41583 |
|
41584 |
|
41585 |
|
41586 |
|
41587 |
|
41588 |
|
41589 | utfx.UTF16toUTF8 = function(src, dst) {
|
41590 | var c1, c2 = null;
|
41591 | while (true) {
|
41592 | if ((c1 = c2 !== null ? c2 : src()) === null)
|
41593 | break;
|
41594 | if (c1 >= 0xD800 && c1 <= 0xDFFF) {
|
41595 | if ((c2 = src()) !== null) {
|
41596 | if (c2 >= 0xDC00 && c2 <= 0xDFFF) {
|
41597 | dst((c1-0xD800)*0x400+c2-0xDC00+0x10000);
|
41598 | c2 = null; continue;
|
41599 | }
|
41600 | }
|
41601 | }
|
41602 | dst(c1);
|
41603 | }
|
41604 | if (c2 !== null) dst(c2);
|
41605 | };
|
41606 |
|
41607 | |
41608 |
|
41609 |
|
41610 |
|
41611 |
|
41612 |
|
41613 |
|
41614 | utfx.UTF8toUTF16 = function(src, dst) {
|
41615 | var cp = null;
|
41616 | if (typeof src === 'number')
|
41617 | cp = src, src = function() { return null; };
|
41618 | while (cp !== null || (cp = src()) !== null) {
|
41619 | if (cp <= 0xFFFF)
|
41620 | dst(cp);
|
41621 | else
|
41622 | cp -= 0x10000,
|
41623 | dst((cp>>10)+0xD800),
|
41624 | dst((cp%0x400)+0xDC00);
|
41625 | cp = null;
|
41626 | }
|
41627 | };
|
41628 |
|
41629 | |
41630 |
|
41631 |
|
41632 |
|
41633 |
|
41634 |
|
41635 | utfx.encodeUTF16toUTF8 = function(src, dst) {
|
41636 | utfx.UTF16toUTF8(src, function(cp) {
|
41637 | utfx.encodeUTF8(cp, dst);
|
41638 | });
|
41639 | };
|
41640 |
|
41641 | |
41642 |
|
41643 |
|
41644 |
|
41645 |
|
41646 |
|
41647 |
|
41648 |
|
41649 | utfx.decodeUTF8toUTF16 = function(src, dst) {
|
41650 | utfx.decodeUTF8(src, function(cp) {
|
41651 | utfx.UTF8toUTF16(cp, dst);
|
41652 | });
|
41653 | };
|
41654 |
|
41655 | |
41656 |
|
41657 |
|
41658 |
|
41659 |
|
41660 | utfx.calculateCodePoint = function(cp) {
|
41661 | return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
|
41662 | };
|
41663 |
|
41664 | |
41665 |
|
41666 |
|
41667 |
|
41668 |
|
41669 |
|
41670 | utfx.calculateUTF8 = function(src) {
|
41671 | var cp, l=0;
|
41672 | while ((cp = src()) !== null)
|
41673 | l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
|
41674 | return l;
|
41675 | };
|
41676 |
|
41677 | |
41678 |
|
41679 |
|
41680 |
|
41681 |
|
41682 |
|
41683 | utfx.calculateUTF16asUTF8 = function(src) {
|
41684 | var n=0, l=0;
|
41685 | utfx.UTF16toUTF8(src, function(cp) {
|
41686 | ++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
|
41687 | });
|
41688 | return [n,l];
|
41689 | };
|
41690 |
|
41691 | return utfx;
|
41692 | }();
|
41693 |
|
41694 |
|
41695 |
|
41696 | |
41697 |
|
41698 |
|
41699 |
|
41700 |
|
41701 |
|
41702 |
|
41703 | ByteBufferPrototype.toUTF8 = function(begin, end) {
|
41704 | if (typeof begin === 'undefined') begin = this.offset;
|
41705 | if (typeof end === 'undefined') end = this.limit;
|
41706 | if (!this.noAssert) {
|
41707 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
41708 | throw TypeError("Illegal begin: Not an integer");
|
41709 | begin >>>= 0;
|
41710 | if (typeof end !== 'number' || end % 1 !== 0)
|
41711 | throw TypeError("Illegal end: Not an integer");
|
41712 | end >>>= 0;
|
41713 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
41714 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
41715 | }
|
41716 | var sd; try {
|
41717 | utfx.decodeUTF8toUTF16(function() {
|
41718 | return begin < end ? this.view[begin++] : null;
|
41719 | }.bind(this), sd = stringDestination());
|
41720 | } catch (e) {
|
41721 | if (begin !== end)
|
41722 | throw RangeError("Illegal range: Truncated data, "+begin+" != "+end);
|
41723 | }
|
41724 | return sd();
|
41725 | };
|
41726 |
|
41727 | |
41728 |
|
41729 |
|
41730 |
|
41731 |
|
41732 |
|
41733 |
|
41734 |
|
41735 |
|
41736 |
|
41737 | ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) {
|
41738 | if (!noAssert)
|
41739 | if (typeof str !== 'string')
|
41740 | throw TypeError("Illegal str: Not a string");
|
41741 | var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert),
|
41742 | i = 0;
|
41743 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
41744 | bb.view[i++] = b;
|
41745 | });
|
41746 | bb.limit = i;
|
41747 | return bb;
|
41748 | };
|
41749 |
|
41750 | return ByteBuffer;
|
41751 | });
|
41752 |
|
41753 |
|
41754 | }),
|
41755 |
|
41756 | (function(module, exports, __webpack_require__) {
|
41757 |
|
41758 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
41759 |
|
41760 |
|
41761 |
|
41762 |
|
41763 |
|
41764 |
|
41765 |
|
41766 |
|
41767 |
|
41768 |
|
41769 |
|
41770 |
|
41771 |
|
41772 |
|
41773 |
|
41774 |
|
41775 |
|
41776 |
|
41777 |
|
41778 |
|
41779 |
|
41780 | (function(global, factory) {
|
41781 |
|
41782 | if (true)
|
41783 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
41784 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
41785 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
41786 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
41787 | else if (typeof require === 'function' && typeof module === "object" && module && module["exports"])
|
41788 | module["exports"] = factory();
|
41789 | else
|
41790 | (global["dcodeIO"] = global["dcodeIO"] || {})["Long"] = factory();
|
41791 |
|
41792 | })(this, function() {
|
41793 | "use strict";
|
41794 |
|
41795 | |
41796 |
|
41797 |
|
41798 |
|
41799 |
|
41800 |
|
41801 |
|
41802 |
|
41803 |
|
41804 |
|
41805 | function Long(low, high, unsigned) {
|
41806 |
|
41807 | |
41808 |
|
41809 |
|
41810 |
|
41811 | this.low = low | 0;
|
41812 |
|
41813 | |
41814 |
|
41815 |
|
41816 |
|
41817 | this.high = high | 0;
|
41818 |
|
41819 | |
41820 |
|
41821 |
|
41822 |
|
41823 | this.unsigned = !!unsigned;
|
41824 | }
|
41825 |
|
41826 |
|
41827 |
|
41828 |
|
41829 |
|
41830 |
|
41831 |
|
41832 |
|
41833 |
|
41834 |
|
41835 |
|
41836 |
|
41837 |
|
41838 |
|
41839 |
|
41840 |
|
41841 |
|
41842 |
|
41843 | |
41844 |
|
41845 |
|
41846 |
|
41847 |
|
41848 |
|
41849 | Long.prototype.__isLong__;
|
41850 |
|
41851 | Object.defineProperty(Long.prototype, "__isLong__", {
|
41852 | value: true,
|
41853 | enumerable: false,
|
41854 | configurable: false
|
41855 | });
|
41856 |
|
41857 | |
41858 |
|
41859 |
|
41860 |
|
41861 |
|
41862 |
|
41863 | function isLong(obj) {
|
41864 | return (obj && obj["__isLong__"]) === true;
|
41865 | }
|
41866 |
|
41867 | |
41868 |
|
41869 |
|
41870 |
|
41871 |
|
41872 |
|
41873 | Long.isLong = isLong;
|
41874 |
|
41875 | |
41876 |
|
41877 |
|
41878 |
|
41879 |
|
41880 | var INT_CACHE = {};
|
41881 |
|
41882 | |
41883 |
|
41884 |
|
41885 |
|
41886 |
|
41887 | var UINT_CACHE = {};
|
41888 |
|
41889 | |
41890 |
|
41891 |
|
41892 |
|
41893 |
|
41894 |
|
41895 | function fromInt(value, unsigned) {
|
41896 | var obj, cachedObj, cache;
|
41897 | if (unsigned) {
|
41898 | value >>>= 0;
|
41899 | if (cache = (0 <= value && value < 256)) {
|
41900 | cachedObj = UINT_CACHE[value];
|
41901 | if (cachedObj)
|
41902 | return cachedObj;
|
41903 | }
|
41904 | obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);
|
41905 | if (cache)
|
41906 | UINT_CACHE[value] = obj;
|
41907 | return obj;
|
41908 | } else {
|
41909 | value |= 0;
|
41910 | if (cache = (-128 <= value && value < 128)) {
|
41911 | cachedObj = INT_CACHE[value];
|
41912 | if (cachedObj)
|
41913 | return cachedObj;
|
41914 | }
|
41915 | obj = fromBits(value, value < 0 ? -1 : 0, false);
|
41916 | if (cache)
|
41917 | INT_CACHE[value] = obj;
|
41918 | return obj;
|
41919 | }
|
41920 | }
|
41921 |
|
41922 | |
41923 |
|
41924 |
|
41925 |
|
41926 |
|
41927 |
|
41928 |
|
41929 | Long.fromInt = fromInt;
|
41930 |
|
41931 | |
41932 |
|
41933 |
|
41934 |
|
41935 |
|
41936 |
|
41937 | function fromNumber(value, unsigned) {
|
41938 | if (isNaN(value) || !isFinite(value))
|
41939 | return unsigned ? UZERO : ZERO;
|
41940 | if (unsigned) {
|
41941 | if (value < 0)
|
41942 | return UZERO;
|
41943 | if (value >= TWO_PWR_64_DBL)
|
41944 | return MAX_UNSIGNED_VALUE;
|
41945 | } else {
|
41946 | if (value <= -TWO_PWR_63_DBL)
|
41947 | return MIN_VALUE;
|
41948 | if (value + 1 >= TWO_PWR_63_DBL)
|
41949 | return MAX_VALUE;
|
41950 | }
|
41951 | if (value < 0)
|
41952 | return fromNumber(-value, unsigned).neg();
|
41953 | return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);
|
41954 | }
|
41955 |
|
41956 | |
41957 |
|
41958 |
|
41959 |
|
41960 |
|
41961 |
|
41962 |
|
41963 | Long.fromNumber = fromNumber;
|
41964 |
|
41965 | |
41966 |
|
41967 |
|
41968 |
|
41969 |
|
41970 |
|
41971 |
|
41972 | function fromBits(lowBits, highBits, unsigned) {
|
41973 | return new Long(lowBits, highBits, unsigned);
|
41974 | }
|
41975 |
|
41976 | |
41977 |
|
41978 |
|
41979 |
|
41980 |
|
41981 |
|
41982 |
|
41983 |
|
41984 |
|
41985 | Long.fromBits = fromBits;
|
41986 |
|
41987 | |
41988 |
|
41989 |
|
41990 |
|
41991 |
|
41992 |
|
41993 |
|
41994 | var pow_dbl = Math.pow;
|
41995 |
|
41996 | |
41997 |
|
41998 |
|
41999 |
|
42000 |
|
42001 |
|
42002 |
|
42003 | function fromString(str, unsigned, radix) {
|
42004 | if (str.length === 0)
|
42005 | throw Error('empty string');
|
42006 | if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
|
42007 | return ZERO;
|
42008 | if (typeof unsigned === 'number') {
|
42009 |
|
42010 | radix = unsigned,
|
42011 | unsigned = false;
|
42012 | } else {
|
42013 | unsigned = !! unsigned;
|
42014 | }
|
42015 | radix = radix || 10;
|
42016 | if (radix < 2 || 36 < radix)
|
42017 | throw RangeError('radix');
|
42018 |
|
42019 | var p;
|
42020 | if ((p = str.indexOf('-')) > 0)
|
42021 | throw Error('interior hyphen');
|
42022 | else if (p === 0) {
|
42023 | return fromString(str.substring(1), unsigned, radix).neg();
|
42024 | }
|
42025 |
|
42026 |
|
42027 |
|
42028 | var radixToPower = fromNumber(pow_dbl(radix, 8));
|
42029 |
|
42030 | var result = ZERO;
|
42031 | for (var i = 0; i < str.length; i += 8) {
|
42032 | var size = Math.min(8, str.length - i),
|
42033 | value = parseInt(str.substring(i, i + size), radix);
|
42034 | if (size < 8) {
|
42035 | var power = fromNumber(pow_dbl(radix, size));
|
42036 | result = result.mul(power).add(fromNumber(value));
|
42037 | } else {
|
42038 | result = result.mul(radixToPower);
|
42039 | result = result.add(fromNumber(value));
|
42040 | }
|
42041 | }
|
42042 | result.unsigned = unsigned;
|
42043 | return result;
|
42044 | }
|
42045 |
|
42046 | |
42047 |
|
42048 |
|
42049 |
|
42050 |
|
42051 |
|
42052 |
|
42053 |
|
42054 | Long.fromString = fromString;
|
42055 |
|
42056 | |
42057 |
|
42058 |
|
42059 |
|
42060 |
|
42061 |
|
42062 | function fromValue(val) {
|
42063 | if (val instanceof Long)
|
42064 | return val;
|
42065 | if (typeof val === 'number')
|
42066 | return fromNumber(val);
|
42067 | if (typeof val === 'string')
|
42068 | return fromString(val);
|
42069 |
|
42070 | return fromBits(val.low, val.high, val.unsigned);
|
42071 | }
|
42072 |
|
42073 | |
42074 |
|
42075 |
|
42076 |
|
42077 |
|
42078 |
|
42079 | Long.fromValue = fromValue;
|
42080 |
|
42081 |
|
42082 |
|
42083 |
|
42084 | |
42085 |
|
42086 |
|
42087 |
|
42088 |
|
42089 | var TWO_PWR_16_DBL = 1 << 16;
|
42090 |
|
42091 | |
42092 |
|
42093 |
|
42094 |
|
42095 |
|
42096 | var TWO_PWR_24_DBL = 1 << 24;
|
42097 |
|
42098 | |
42099 |
|
42100 |
|
42101 |
|
42102 |
|
42103 | var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
|
42104 |
|
42105 | |
42106 |
|
42107 |
|
42108 |
|
42109 |
|
42110 | var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;
|
42111 |
|
42112 | |
42113 |
|
42114 |
|
42115 |
|
42116 |
|
42117 | var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;
|
42118 |
|
42119 | |
42120 |
|
42121 |
|
42122 |
|
42123 |
|
42124 | var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);
|
42125 |
|
42126 | |
42127 |
|
42128 |
|
42129 |
|
42130 | var ZERO = fromInt(0);
|
42131 |
|
42132 | |
42133 |
|
42134 |
|
42135 |
|
42136 | Long.ZERO = ZERO;
|
42137 |
|
42138 | |
42139 |
|
42140 |
|
42141 |
|
42142 | var UZERO = fromInt(0, true);
|
42143 |
|
42144 | |
42145 |
|
42146 |
|
42147 |
|
42148 | Long.UZERO = UZERO;
|
42149 |
|
42150 | |
42151 |
|
42152 |
|
42153 |
|
42154 | var ONE = fromInt(1);
|
42155 |
|
42156 | |
42157 |
|
42158 |
|
42159 |
|
42160 | Long.ONE = ONE;
|
42161 |
|
42162 | |
42163 |
|
42164 |
|
42165 |
|
42166 | var UONE = fromInt(1, true);
|
42167 |
|
42168 | |
42169 |
|
42170 |
|
42171 |
|
42172 | Long.UONE = UONE;
|
42173 |
|
42174 | |
42175 |
|
42176 |
|
42177 |
|
42178 | var NEG_ONE = fromInt(-1);
|
42179 |
|
42180 | |
42181 |
|
42182 |
|
42183 |
|
42184 | Long.NEG_ONE = NEG_ONE;
|
42185 |
|
42186 | |
42187 |
|
42188 |
|
42189 |
|
42190 | var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);
|
42191 |
|
42192 | |
42193 |
|
42194 |
|
42195 |
|
42196 | Long.MAX_VALUE = MAX_VALUE;
|
42197 |
|
42198 | |
42199 |
|
42200 |
|
42201 |
|
42202 | var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);
|
42203 |
|
42204 | |
42205 |
|
42206 |
|
42207 |
|
42208 | Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;
|
42209 |
|
42210 | |
42211 |
|
42212 |
|
42213 |
|
42214 | var MIN_VALUE = fromBits(0, 0x80000000|0, false);
|
42215 |
|
42216 | |
42217 |
|
42218 |
|
42219 |
|
42220 | Long.MIN_VALUE = MIN_VALUE;
|
42221 |
|
42222 | |
42223 |
|
42224 |
|
42225 |
|
42226 | var LongPrototype = Long.prototype;
|
42227 |
|
42228 | |
42229 |
|
42230 |
|
42231 |
|
42232 | LongPrototype.toInt = function toInt() {
|
42233 | return this.unsigned ? this.low >>> 0 : this.low;
|
42234 | };
|
42235 |
|
42236 | |
42237 |
|
42238 |
|
42239 |
|
42240 | LongPrototype.toNumber = function toNumber() {
|
42241 | if (this.unsigned)
|
42242 | return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);
|
42243 | return this.high * TWO_PWR_32_DBL + (this.low >>> 0);
|
42244 | };
|
42245 |
|
42246 | |
42247 |
|
42248 |
|
42249 |
|
42250 |
|
42251 |
|
42252 |
|
42253 | LongPrototype.toString = function toString(radix) {
|
42254 | radix = radix || 10;
|
42255 | if (radix < 2 || 36 < radix)
|
42256 | throw RangeError('radix');
|
42257 | if (this.isZero())
|
42258 | return '0';
|
42259 | if (this.isNegative()) {
|
42260 | if (this.eq(MIN_VALUE)) {
|
42261 |
|
42262 |
|
42263 | var radixLong = fromNumber(radix),
|
42264 | div = this.div(radixLong),
|
42265 | rem1 = div.mul(radixLong).sub(this);
|
42266 | return div.toString(radix) + rem1.toInt().toString(radix);
|
42267 | } else
|
42268 | return '-' + this.neg().toString(radix);
|
42269 | }
|
42270 |
|
42271 |
|
42272 |
|
42273 | var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),
|
42274 | rem = this;
|
42275 | var result = '';
|
42276 | while (true) {
|
42277 | var remDiv = rem.div(radixToPower),
|
42278 | intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,
|
42279 | digits = intval.toString(radix);
|
42280 | rem = remDiv;
|
42281 | if (rem.isZero())
|
42282 | return digits + result;
|
42283 | else {
|
42284 | while (digits.length < 6)
|
42285 | digits = '0' + digits;
|
42286 | result = '' + digits + result;
|
42287 | }
|
42288 | }
|
42289 | };
|
42290 |
|
42291 | |
42292 |
|
42293 |
|
42294 |
|
42295 | LongPrototype.getHighBits = function getHighBits() {
|
42296 | return this.high;
|
42297 | };
|
42298 |
|
42299 | |
42300 |
|
42301 |
|
42302 |
|
42303 | LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {
|
42304 | return this.high >>> 0;
|
42305 | };
|
42306 |
|
42307 | |
42308 |
|
42309 |
|
42310 |
|
42311 | LongPrototype.getLowBits = function getLowBits() {
|
42312 | return this.low;
|
42313 | };
|
42314 |
|
42315 | |
42316 |
|
42317 |
|
42318 |
|
42319 | LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {
|
42320 | return this.low >>> 0;
|
42321 | };
|
42322 |
|
42323 | |
42324 |
|
42325 |
|
42326 |
|
42327 | LongPrototype.getNumBitsAbs = function getNumBitsAbs() {
|
42328 | if (this.isNegative())
|
42329 | return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();
|
42330 | var val = this.high != 0 ? this.high : this.low;
|
42331 | for (var bit = 31; bit > 0; bit--)
|
42332 | if ((val & (1 << bit)) != 0)
|
42333 | break;
|
42334 | return this.high != 0 ? bit + 33 : bit + 1;
|
42335 | };
|
42336 |
|
42337 | |
42338 |
|
42339 |
|
42340 |
|
42341 | LongPrototype.isZero = function isZero() {
|
42342 | return this.high === 0 && this.low === 0;
|
42343 | };
|
42344 |
|
42345 | |
42346 |
|
42347 |
|
42348 |
|
42349 | LongPrototype.isNegative = function isNegative() {
|
42350 | return !this.unsigned && this.high < 0;
|
42351 | };
|
42352 |
|
42353 | |
42354 |
|
42355 |
|
42356 |
|
42357 | LongPrototype.isPositive = function isPositive() {
|
42358 | return this.unsigned || this.high >= 0;
|
42359 | };
|
42360 |
|
42361 | |
42362 |
|
42363 |
|
42364 |
|
42365 | LongPrototype.isOdd = function isOdd() {
|
42366 | return (this.low & 1) === 1;
|
42367 | };
|
42368 |
|
42369 | |
42370 |
|
42371 |
|
42372 |
|
42373 | LongPrototype.isEven = function isEven() {
|
42374 | return (this.low & 1) === 0;
|
42375 | };
|
42376 |
|
42377 | |
42378 |
|
42379 |
|
42380 |
|
42381 |
|
42382 | LongPrototype.equals = function equals(other) {
|
42383 | if (!isLong(other))
|
42384 | other = fromValue(other);
|
42385 | if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)
|
42386 | return false;
|
42387 | return this.high === other.high && this.low === other.low;
|
42388 | };
|
42389 |
|
42390 | |
42391 |
|
42392 |
|
42393 |
|
42394 |
|
42395 |
|
42396 | LongPrototype.eq = LongPrototype.equals;
|
42397 |
|
42398 | |
42399 |
|
42400 |
|
42401 |
|
42402 |
|
42403 | LongPrototype.notEquals = function notEquals(other) {
|
42404 | return !this.eq( other);
|
42405 | };
|
42406 |
|
42407 | |
42408 |
|
42409 |
|
42410 |
|
42411 |
|
42412 |
|
42413 | LongPrototype.neq = LongPrototype.notEquals;
|
42414 |
|
42415 | |
42416 |
|
42417 |
|
42418 |
|
42419 |
|
42420 | LongPrototype.lessThan = function lessThan(other) {
|
42421 | return this.comp( other) < 0;
|
42422 | };
|
42423 |
|
42424 | |
42425 |
|
42426 |
|
42427 |
|
42428 |
|
42429 |
|
42430 | LongPrototype.lt = LongPrototype.lessThan;
|
42431 |
|
42432 | |
42433 |
|
42434 |
|
42435 |
|
42436 |
|
42437 | LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {
|
42438 | return this.comp( other) <= 0;
|
42439 | };
|
42440 |
|
42441 | |
42442 |
|
42443 |
|
42444 |
|
42445 |
|
42446 |
|
42447 | LongPrototype.lte = LongPrototype.lessThanOrEqual;
|
42448 |
|
42449 | |
42450 |
|
42451 |
|
42452 |
|
42453 |
|
42454 | LongPrototype.greaterThan = function greaterThan(other) {
|
42455 | return this.comp( other) > 0;
|
42456 | };
|
42457 |
|
42458 | |
42459 |
|
42460 |
|
42461 |
|
42462 |
|
42463 |
|
42464 | LongPrototype.gt = LongPrototype.greaterThan;
|
42465 |
|
42466 | |
42467 |
|
42468 |
|
42469 |
|
42470 |
|
42471 | LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {
|
42472 | return this.comp( other) >= 0;
|
42473 | };
|
42474 |
|
42475 | |
42476 |
|
42477 |
|
42478 |
|
42479 |
|
42480 |
|
42481 | LongPrototype.gte = LongPrototype.greaterThanOrEqual;
|
42482 |
|
42483 | |
42484 |
|
42485 |
|
42486 |
|
42487 |
|
42488 |
|
42489 | LongPrototype.compare = function compare(other) {
|
42490 | if (!isLong(other))
|
42491 | other = fromValue(other);
|
42492 | if (this.eq(other))
|
42493 | return 0;
|
42494 | var thisNeg = this.isNegative(),
|
42495 | otherNeg = other.isNegative();
|
42496 | if (thisNeg && !otherNeg)
|
42497 | return -1;
|
42498 | if (!thisNeg && otherNeg)
|
42499 | return 1;
|
42500 |
|
42501 | if (!this.unsigned)
|
42502 | return this.sub(other).isNegative() ? -1 : 1;
|
42503 |
|
42504 | return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;
|
42505 | };
|
42506 |
|
42507 | |
42508 |
|
42509 |
|
42510 |
|
42511 |
|
42512 |
|
42513 |
|
42514 | LongPrototype.comp = LongPrototype.compare;
|
42515 |
|
42516 | |
42517 |
|
42518 |
|
42519 |
|
42520 | LongPrototype.negate = function negate() {
|
42521 | if (!this.unsigned && this.eq(MIN_VALUE))
|
42522 | return MIN_VALUE;
|
42523 | return this.not().add(ONE);
|
42524 | };
|
42525 |
|
42526 | |
42527 |
|
42528 |
|
42529 |
|
42530 |
|
42531 | LongPrototype.neg = LongPrototype.negate;
|
42532 |
|
42533 | |
42534 |
|
42535 |
|
42536 |
|
42537 |
|
42538 | LongPrototype.add = function add(addend) {
|
42539 | if (!isLong(addend))
|
42540 | addend = fromValue(addend);
|
42541 |
|
42542 |
|
42543 |
|
42544 | var a48 = this.high >>> 16;
|
42545 | var a32 = this.high & 0xFFFF;
|
42546 | var a16 = this.low >>> 16;
|
42547 | var a00 = this.low & 0xFFFF;
|
42548 |
|
42549 | var b48 = addend.high >>> 16;
|
42550 | var b32 = addend.high & 0xFFFF;
|
42551 | var b16 = addend.low >>> 16;
|
42552 | var b00 = addend.low & 0xFFFF;
|
42553 |
|
42554 | var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
|
42555 | c00 += a00 + b00;
|
42556 | c16 += c00 >>> 16;
|
42557 | c00 &= 0xFFFF;
|
42558 | c16 += a16 + b16;
|
42559 | c32 += c16 >>> 16;
|
42560 | c16 &= 0xFFFF;
|
42561 | c32 += a32 + b32;
|
42562 | c48 += c32 >>> 16;
|
42563 | c32 &= 0xFFFF;
|
42564 | c48 += a48 + b48;
|
42565 | c48 &= 0xFFFF;
|
42566 | return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
|
42567 | };
|
42568 |
|
42569 | |
42570 |
|
42571 |
|
42572 |
|
42573 |
|
42574 | LongPrototype.subtract = function subtract(subtrahend) {
|
42575 | if (!isLong(subtrahend))
|
42576 | subtrahend = fromValue(subtrahend);
|
42577 | return this.add(subtrahend.neg());
|
42578 | };
|
42579 |
|
42580 | |
42581 |
|
42582 |
|
42583 |
|
42584 |
|
42585 |
|
42586 | LongPrototype.sub = LongPrototype.subtract;
|
42587 |
|
42588 | |
42589 |
|
42590 |
|
42591 |
|
42592 |
|
42593 | LongPrototype.multiply = function multiply(multiplier) {
|
42594 | if (this.isZero())
|
42595 | return ZERO;
|
42596 | if (!isLong(multiplier))
|
42597 | multiplier = fromValue(multiplier);
|
42598 | if (multiplier.isZero())
|
42599 | return ZERO;
|
42600 | if (this.eq(MIN_VALUE))
|
42601 | return multiplier.isOdd() ? MIN_VALUE : ZERO;
|
42602 | if (multiplier.eq(MIN_VALUE))
|
42603 | return this.isOdd() ? MIN_VALUE : ZERO;
|
42604 |
|
42605 | if (this.isNegative()) {
|
42606 | if (multiplier.isNegative())
|
42607 | return this.neg().mul(multiplier.neg());
|
42608 | else
|
42609 | return this.neg().mul(multiplier).neg();
|
42610 | } else if (multiplier.isNegative())
|
42611 | return this.mul(multiplier.neg()).neg();
|
42612 |
|
42613 |
|
42614 | if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))
|
42615 | return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
|
42616 |
|
42617 |
|
42618 |
|
42619 |
|
42620 | var a48 = this.high >>> 16;
|
42621 | var a32 = this.high & 0xFFFF;
|
42622 | var a16 = this.low >>> 16;
|
42623 | var a00 = this.low & 0xFFFF;
|
42624 |
|
42625 | var b48 = multiplier.high >>> 16;
|
42626 | var b32 = multiplier.high & 0xFFFF;
|
42627 | var b16 = multiplier.low >>> 16;
|
42628 | var b00 = multiplier.low & 0xFFFF;
|
42629 |
|
42630 | var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
|
42631 | c00 += a00 * b00;
|
42632 | c16 += c00 >>> 16;
|
42633 | c00 &= 0xFFFF;
|
42634 | c16 += a16 * b00;
|
42635 | c32 += c16 >>> 16;
|
42636 | c16 &= 0xFFFF;
|
42637 | c16 += a00 * b16;
|
42638 | c32 += c16 >>> 16;
|
42639 | c16 &= 0xFFFF;
|
42640 | c32 += a32 * b00;
|
42641 | c48 += c32 >>> 16;
|
42642 | c32 &= 0xFFFF;
|
42643 | c32 += a16 * b16;
|
42644 | c48 += c32 >>> 16;
|
42645 | c32 &= 0xFFFF;
|
42646 | c32 += a00 * b32;
|
42647 | c48 += c32 >>> 16;
|
42648 | c32 &= 0xFFFF;
|
42649 | c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
|
42650 | c48 &= 0xFFFF;
|
42651 | return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
|
42652 | };
|
42653 |
|
42654 | |
42655 |
|
42656 |
|
42657 |
|
42658 |
|
42659 |
|
42660 | LongPrototype.mul = LongPrototype.multiply;
|
42661 |
|
42662 | |
42663 |
|
42664 |
|
42665 |
|
42666 |
|
42667 |
|
42668 | LongPrototype.divide = function divide(divisor) {
|
42669 | if (!isLong(divisor))
|
42670 | divisor = fromValue(divisor);
|
42671 | if (divisor.isZero())
|
42672 | throw Error('division by zero');
|
42673 | if (this.isZero())
|
42674 | return this.unsigned ? UZERO : ZERO;
|
42675 | var approx, rem, res;
|
42676 | if (!this.unsigned) {
|
42677 |
|
42678 |
|
42679 | if (this.eq(MIN_VALUE)) {
|
42680 | if (divisor.eq(ONE) || divisor.eq(NEG_ONE))
|
42681 | return MIN_VALUE;
|
42682 | else if (divisor.eq(MIN_VALUE))
|
42683 | return ONE;
|
42684 | else {
|
42685 |
|
42686 | var halfThis = this.shr(1);
|
42687 | approx = halfThis.div(divisor).shl(1);
|
42688 | if (approx.eq(ZERO)) {
|
42689 | return divisor.isNegative() ? ONE : NEG_ONE;
|
42690 | } else {
|
42691 | rem = this.sub(divisor.mul(approx));
|
42692 | res = approx.add(rem.div(divisor));
|
42693 | return res;
|
42694 | }
|
42695 | }
|
42696 | } else if (divisor.eq(MIN_VALUE))
|
42697 | return this.unsigned ? UZERO : ZERO;
|
42698 | if (this.isNegative()) {
|
42699 | if (divisor.isNegative())
|
42700 | return this.neg().div(divisor.neg());
|
42701 | return this.neg().div(divisor).neg();
|
42702 | } else if (divisor.isNegative())
|
42703 | return this.div(divisor.neg()).neg();
|
42704 | res = ZERO;
|
42705 | } else {
|
42706 |
|
42707 |
|
42708 | if (!divisor.unsigned)
|
42709 | divisor = divisor.toUnsigned();
|
42710 | if (divisor.gt(this))
|
42711 | return UZERO;
|
42712 | if (divisor.gt(this.shru(1)))
|
42713 | return UONE;
|
42714 | res = UZERO;
|
42715 | }
|
42716 |
|
42717 |
|
42718 |
|
42719 |
|
42720 |
|
42721 |
|
42722 | rem = this;
|
42723 | while (rem.gte(divisor)) {
|
42724 |
|
42725 |
|
42726 | approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));
|
42727 |
|
42728 |
|
42729 |
|
42730 | var log2 = Math.ceil(Math.log(approx) / Math.LN2),
|
42731 | delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),
|
42732 |
|
42733 |
|
42734 |
|
42735 | approxRes = fromNumber(approx),
|
42736 | approxRem = approxRes.mul(divisor);
|
42737 | while (approxRem.isNegative() || approxRem.gt(rem)) {
|
42738 | approx -= delta;
|
42739 | approxRes = fromNumber(approx, this.unsigned);
|
42740 | approxRem = approxRes.mul(divisor);
|
42741 | }
|
42742 |
|
42743 |
|
42744 |
|
42745 | if (approxRes.isZero())
|
42746 | approxRes = ONE;
|
42747 |
|
42748 | res = res.add(approxRes);
|
42749 | rem = rem.sub(approxRem);
|
42750 | }
|
42751 | return res;
|
42752 | };
|
42753 |
|
42754 | |
42755 |
|
42756 |
|
42757 |
|
42758 |
|
42759 |
|
42760 | LongPrototype.div = LongPrototype.divide;
|
42761 |
|
42762 | |
42763 |
|
42764 |
|
42765 |
|
42766 |
|
42767 | LongPrototype.modulo = function modulo(divisor) {
|
42768 | if (!isLong(divisor))
|
42769 | divisor = fromValue(divisor);
|
42770 | return this.sub(this.div(divisor).mul(divisor));
|
42771 | };
|
42772 |
|
42773 | |
42774 |
|
42775 |
|
42776 |
|
42777 |
|
42778 |
|
42779 | LongPrototype.mod = LongPrototype.modulo;
|
42780 |
|
42781 | |
42782 |
|
42783 |
|
42784 |
|
42785 | LongPrototype.not = function not() {
|
42786 | return fromBits(~this.low, ~this.high, this.unsigned);
|
42787 | };
|
42788 |
|
42789 | |
42790 |
|
42791 |
|
42792 |
|
42793 |
|
42794 | LongPrototype.and = function and(other) {
|
42795 | if (!isLong(other))
|
42796 | other = fromValue(other);
|
42797 | return fromBits(this.low & other.low, this.high & other.high, this.unsigned);
|
42798 | };
|
42799 |
|
42800 | |
42801 |
|
42802 |
|
42803 |
|
42804 |
|
42805 | LongPrototype.or = function or(other) {
|
42806 | if (!isLong(other))
|
42807 | other = fromValue(other);
|
42808 | return fromBits(this.low | other.low, this.high | other.high, this.unsigned);
|
42809 | };
|
42810 |
|
42811 | |
42812 |
|
42813 |
|
42814 |
|
42815 |
|
42816 | LongPrototype.xor = function xor(other) {
|
42817 | if (!isLong(other))
|
42818 | other = fromValue(other);
|
42819 | return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
|
42820 | };
|
42821 |
|
42822 | |
42823 |
|
42824 |
|
42825 |
|
42826 |
|
42827 | LongPrototype.shiftLeft = function shiftLeft(numBits) {
|
42828 | if (isLong(numBits))
|
42829 | numBits = numBits.toInt();
|
42830 | if ((numBits &= 63) === 0)
|
42831 | return this;
|
42832 | else if (numBits < 32)
|
42833 | return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);
|
42834 | else
|
42835 | return fromBits(0, this.low << (numBits - 32), this.unsigned);
|
42836 | };
|
42837 |
|
42838 | |
42839 |
|
42840 |
|
42841 |
|
42842 |
|
42843 |
|
42844 | LongPrototype.shl = LongPrototype.shiftLeft;
|
42845 |
|
42846 | |
42847 |
|
42848 |
|
42849 |
|
42850 |
|
42851 | LongPrototype.shiftRight = function shiftRight(numBits) {
|
42852 | if (isLong(numBits))
|
42853 | numBits = numBits.toInt();
|
42854 | if ((numBits &= 63) === 0)
|
42855 | return this;
|
42856 | else if (numBits < 32)
|
42857 | return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);
|
42858 | else
|
42859 | return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);
|
42860 | };
|
42861 |
|
42862 | |
42863 |
|
42864 |
|
42865 |
|
42866 |
|
42867 |
|
42868 | LongPrototype.shr = LongPrototype.shiftRight;
|
42869 |
|
42870 | |
42871 |
|
42872 |
|
42873 |
|
42874 |
|
42875 | LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {
|
42876 | if (isLong(numBits))
|
42877 | numBits = numBits.toInt();
|
42878 | numBits &= 63;
|
42879 | if (numBits === 0)
|
42880 | return this;
|
42881 | else {
|
42882 | var high = this.high;
|
42883 | if (numBits < 32) {
|
42884 | var low = this.low;
|
42885 | return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);
|
42886 | } else if (numBits === 32)
|
42887 | return fromBits(high, 0, this.unsigned);
|
42888 | else
|
42889 | return fromBits(high >>> (numBits - 32), 0, this.unsigned);
|
42890 | }
|
42891 | };
|
42892 |
|
42893 | |
42894 |
|
42895 |
|
42896 |
|
42897 |
|
42898 |
|
42899 | LongPrototype.shru = LongPrototype.shiftRightUnsigned;
|
42900 |
|
42901 | |
42902 |
|
42903 |
|
42904 |
|
42905 | LongPrototype.toSigned = function toSigned() {
|
42906 | if (!this.unsigned)
|
42907 | return this;
|
42908 | return fromBits(this.low, this.high, false);
|
42909 | };
|
42910 |
|
42911 | |
42912 |
|
42913 |
|
42914 |
|
42915 | LongPrototype.toUnsigned = function toUnsigned() {
|
42916 | if (this.unsigned)
|
42917 | return this;
|
42918 | return fromBits(this.low, this.high, true);
|
42919 | };
|
42920 |
|
42921 | |
42922 |
|
42923 |
|
42924 |
|
42925 |
|
42926 | LongPrototype.toBytes = function(le) {
|
42927 | return le ? this.toBytesLE() : this.toBytesBE();
|
42928 | }
|
42929 |
|
42930 | |
42931 |
|
42932 |
|
42933 |
|
42934 | LongPrototype.toBytesLE = function() {
|
42935 | var hi = this.high,
|
42936 | lo = this.low;
|
42937 | return [
|
42938 | lo & 0xff,
|
42939 | (lo >>> 8) & 0xff,
|
42940 | (lo >>> 16) & 0xff,
|
42941 | (lo >>> 24) & 0xff,
|
42942 | hi & 0xff,
|
42943 | (hi >>> 8) & 0xff,
|
42944 | (hi >>> 16) & 0xff,
|
42945 | (hi >>> 24) & 0xff
|
42946 | ];
|
42947 | }
|
42948 |
|
42949 | |
42950 |
|
42951 |
|
42952 |
|
42953 | LongPrototype.toBytesBE = function() {
|
42954 | var hi = this.high,
|
42955 | lo = this.low;
|
42956 | return [
|
42957 | (hi >>> 24) & 0xff,
|
42958 | (hi >>> 16) & 0xff,
|
42959 | (hi >>> 8) & 0xff,
|
42960 | hi & 0xff,
|
42961 | (lo >>> 24) & 0xff,
|
42962 | (lo >>> 16) & 0xff,
|
42963 | (lo >>> 8) & 0xff,
|
42964 | lo & 0xff
|
42965 | ];
|
42966 | }
|
42967 |
|
42968 | return Long;
|
42969 | });
|
42970 |
|
42971 |
|
42972 | }),
|
42973 |
|
42974 | (function(module, exports) {
|
42975 |
|
42976 |
|
42977 |
|
42978 | }),
|
42979 |
|
42980 | (function(module, exports, __webpack_require__) {
|
42981 |
|
42982 | "use strict";
|
42983 |
|
42984 |
|
42985 | var _interopRequireDefault = __webpack_require__(1);
|
42986 |
|
42987 | var _slice = _interopRequireDefault(__webpack_require__(34));
|
42988 |
|
42989 | var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(267));
|
42990 |
|
42991 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
42992 |
|
42993 | var has = Object.prototype.hasOwnProperty,
|
42994 | prefix = '~';
|
42995 |
|
42996 |
|
42997 |
|
42998 |
|
42999 |
|
43000 |
|
43001 |
|
43002 |
|
43003 | function Events() {}
|
43004 |
|
43005 |
|
43006 |
|
43007 |
|
43008 |
|
43009 |
|
43010 |
|
43011 |
|
43012 | if (Object.create) {
|
43013 | Events.prototype = Object.create(null);
|
43014 |
|
43015 |
|
43016 |
|
43017 |
|
43018 | if (!new Events().__proto__) prefix = false;
|
43019 | }
|
43020 |
|
43021 |
|
43022 |
|
43023 |
|
43024 |
|
43025 |
|
43026 |
|
43027 |
|
43028 |
|
43029 |
|
43030 |
|
43031 | function EE(fn, context, once) {
|
43032 | this.fn = fn;
|
43033 | this.context = context;
|
43034 | this.once = once || false;
|
43035 | }
|
43036 |
|
43037 |
|
43038 |
|
43039 |
|
43040 |
|
43041 |
|
43042 |
|
43043 |
|
43044 |
|
43045 |
|
43046 |
|
43047 |
|
43048 |
|
43049 | function addListener(emitter, event, fn, context, once) {
|
43050 | if (typeof fn !== 'function') {
|
43051 | throw new TypeError('The listener must be a function');
|
43052 | }
|
43053 |
|
43054 | var listener = new EE(fn, context || emitter, once),
|
43055 | evt = prefix ? prefix + event : event;
|
43056 | 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];
|
43057 | return emitter;
|
43058 | }
|
43059 |
|
43060 |
|
43061 |
|
43062 |
|
43063 |
|
43064 |
|
43065 |
|
43066 |
|
43067 |
|
43068 | function clearEvent(emitter, evt) {
|
43069 | if (--emitter._eventsCount === 0) emitter._events = new Events();else delete emitter._events[evt];
|
43070 | }
|
43071 |
|
43072 |
|
43073 |
|
43074 |
|
43075 |
|
43076 |
|
43077 |
|
43078 |
|
43079 |
|
43080 | function EventEmitter() {
|
43081 | this._events = new Events();
|
43082 | this._eventsCount = 0;
|
43083 | }
|
43084 |
|
43085 |
|
43086 |
|
43087 |
|
43088 |
|
43089 |
|
43090 |
|
43091 |
|
43092 |
|
43093 | EventEmitter.prototype.eventNames = function eventNames() {
|
43094 | var names = [],
|
43095 | events,
|
43096 | name;
|
43097 | if (this._eventsCount === 0) return names;
|
43098 |
|
43099 | for (name in events = this._events) {
|
43100 | if (has.call(events, name)) names.push(prefix ? (0, _slice.default)(name).call(name, 1) : name);
|
43101 | }
|
43102 |
|
43103 | if (_getOwnPropertySymbols.default) {
|
43104 | return (0, _concat.default)(names).call(names, (0, _getOwnPropertySymbols.default)(events));
|
43105 | }
|
43106 |
|
43107 | return names;
|
43108 | };
|
43109 |
|
43110 |
|
43111 |
|
43112 |
|
43113 |
|
43114 |
|
43115 |
|
43116 |
|
43117 |
|
43118 | EventEmitter.prototype.listeners = function listeners(event) {
|
43119 | var evt = prefix ? prefix + event : event,
|
43120 | handlers = this._events[evt];
|
43121 | if (!handlers) return [];
|
43122 | if (handlers.fn) return [handlers.fn];
|
43123 |
|
43124 | for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
|
43125 | ee[i] = handlers[i].fn;
|
43126 | }
|
43127 |
|
43128 | return ee;
|
43129 | };
|
43130 |
|
43131 |
|
43132 |
|
43133 |
|
43134 |
|
43135 |
|
43136 |
|
43137 |
|
43138 |
|
43139 | EventEmitter.prototype.listenerCount = function listenerCount(event) {
|
43140 | var evt = prefix ? prefix + event : event,
|
43141 | listeners = this._events[evt];
|
43142 | if (!listeners) return 0;
|
43143 | if (listeners.fn) return 1;
|
43144 | return listeners.length;
|
43145 | };
|
43146 |
|
43147 |
|
43148 |
|
43149 |
|
43150 |
|
43151 |
|
43152 |
|
43153 |
|
43154 |
|
43155 | EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
43156 | var evt = prefix ? prefix + event : event;
|
43157 | if (!this._events[evt]) return false;
|
43158 | var listeners = this._events[evt],
|
43159 | len = arguments.length,
|
43160 | args,
|
43161 | i;
|
43162 |
|
43163 | if (listeners.fn) {
|
43164 | if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
43165 |
|
43166 | switch (len) {
|
43167 | case 1:
|
43168 | return listeners.fn.call(listeners.context), true;
|
43169 |
|
43170 | case 2:
|
43171 | return listeners.fn.call(listeners.context, a1), true;
|
43172 |
|
43173 | case 3:
|
43174 | return listeners.fn.call(listeners.context, a1, a2), true;
|
43175 |
|
43176 | case 4:
|
43177 | return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
43178 |
|
43179 | case 5:
|
43180 | return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
43181 |
|
43182 | case 6:
|
43183 | return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
43184 | }
|
43185 |
|
43186 | for (i = 1, args = new Array(len - 1); i < len; i++) {
|
43187 | args[i - 1] = arguments[i];
|
43188 | }
|
43189 |
|
43190 | listeners.fn.apply(listeners.context, args);
|
43191 | } else {
|
43192 | var length = listeners.length,
|
43193 | j;
|
43194 |
|
43195 | for (i = 0; i < length; i++) {
|
43196 | if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
43197 |
|
43198 | switch (len) {
|
43199 | case 1:
|
43200 | listeners[i].fn.call(listeners[i].context);
|
43201 | break;
|
43202 |
|
43203 | case 2:
|
43204 | listeners[i].fn.call(listeners[i].context, a1);
|
43205 | break;
|
43206 |
|
43207 | case 3:
|
43208 | listeners[i].fn.call(listeners[i].context, a1, a2);
|
43209 | break;
|
43210 |
|
43211 | case 4:
|
43212 | listeners[i].fn.call(listeners[i].context, a1, a2, a3);
|
43213 | break;
|
43214 |
|
43215 | default:
|
43216 | if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
|
43217 | args[j - 1] = arguments[j];
|
43218 | }
|
43219 | listeners[i].fn.apply(listeners[i].context, args);
|
43220 | }
|
43221 | }
|
43222 | }
|
43223 |
|
43224 | return true;
|
43225 | };
|
43226 |
|
43227 |
|
43228 |
|
43229 |
|
43230 |
|
43231 |
|
43232 |
|
43233 |
|
43234 |
|
43235 |
|
43236 |
|
43237 | EventEmitter.prototype.on = function on(event, fn, context) {
|
43238 | return addListener(this, event, fn, context, false);
|
43239 | };
|
43240 |
|
43241 |
|
43242 |
|
43243 |
|
43244 |
|
43245 |
|
43246 |
|
43247 |
|
43248 |
|
43249 |
|
43250 |
|
43251 | EventEmitter.prototype.once = function once(event, fn, context) {
|
43252 | return addListener(this, event, fn, context, true);
|
43253 | };
|
43254 |
|
43255 |
|
43256 |
|
43257 |
|
43258 |
|
43259 |
|
43260 |
|
43261 |
|
43262 |
|
43263 |
|
43264 |
|
43265 |
|
43266 | EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
43267 | var evt = prefix ? prefix + event : event;
|
43268 | if (!this._events[evt]) return this;
|
43269 |
|
43270 | if (!fn) {
|
43271 | clearEvent(this, evt);
|
43272 | return this;
|
43273 | }
|
43274 |
|
43275 | var listeners = this._events[evt];
|
43276 |
|
43277 | if (listeners.fn) {
|
43278 | if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
|
43279 | clearEvent(this, evt);
|
43280 | }
|
43281 | } else {
|
43282 | for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
43283 | if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
|
43284 | events.push(listeners[i]);
|
43285 | }
|
43286 | }
|
43287 |
|
43288 |
|
43289 |
|
43290 |
|
43291 | if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else clearEvent(this, evt);
|
43292 | }
|
43293 |
|
43294 | return this;
|
43295 | };
|
43296 |
|
43297 |
|
43298 |
|
43299 |
|
43300 |
|
43301 |
|
43302 |
|
43303 |
|
43304 |
|
43305 | EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
43306 | var evt;
|
43307 |
|
43308 | if (event) {
|
43309 | evt = prefix ? prefix + event : event;
|
43310 | if (this._events[evt]) clearEvent(this, evt);
|
43311 | } else {
|
43312 | this._events = new Events();
|
43313 | this._eventsCount = 0;
|
43314 | }
|
43315 |
|
43316 | return this;
|
43317 | };
|
43318 |
|
43319 |
|
43320 |
|
43321 |
|
43322 | EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
43323 | EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
43324 |
|
43325 |
|
43326 |
|
43327 | EventEmitter.prefixed = prefix;
|
43328 |
|
43329 |
|
43330 |
|
43331 | EventEmitter.EventEmitter = EventEmitter;
|
43332 |
|
43333 |
|
43334 |
|
43335 | if (true) {
|
43336 | module.exports = EventEmitter;
|
43337 | }
|
43338 |
|
43339 | }),
|
43340 |
|
43341 | (function(module, exports) {
|
43342 |
|
43343 | function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
43344 | try {
|
43345 | var info = gen[key](arg);
|
43346 | var value = info.value;
|
43347 | } catch (error) {
|
43348 | reject(error);
|
43349 | return;
|
43350 | }
|
43351 | if (info.done) {
|
43352 | resolve(value);
|
43353 | } else {
|
43354 | Promise.resolve(value).then(_next, _throw);
|
43355 | }
|
43356 | }
|
43357 | function _asyncToGenerator(fn) {
|
43358 | return function () {
|
43359 | var self = this,
|
43360 | args = arguments;
|
43361 | return new Promise(function (resolve, reject) {
|
43362 | var gen = fn.apply(self, args);
|
43363 | function _next(value) {
|
43364 | asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
43365 | }
|
43366 | function _throw(err) {
|
43367 | asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
43368 | }
|
43369 | _next(undefined);
|
43370 | });
|
43371 | };
|
43372 | }
|
43373 | module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43374 |
|
43375 | }),
|
43376 |
|
43377 | (function(module, exports, __webpack_require__) {
|
43378 |
|
43379 | var arrayWithoutHoles = __webpack_require__(661);
|
43380 | var iterableToArray = __webpack_require__(271);
|
43381 | var unsupportedIterableToArray = __webpack_require__(272);
|
43382 | var nonIterableSpread = __webpack_require__(662);
|
43383 | function _toConsumableArray(arr) {
|
43384 | return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
|
43385 | }
|
43386 | module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43387 |
|
43388 | }),
|
43389 |
|
43390 | (function(module, exports, __webpack_require__) {
|
43391 |
|
43392 | var arrayLikeToArray = __webpack_require__(270);
|
43393 | function _arrayWithoutHoles(arr) {
|
43394 | if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
43395 | }
|
43396 | module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43397 |
|
43398 | }),
|
43399 |
|
43400 | (function(module, exports) {
|
43401 |
|
43402 | function _nonIterableSpread() {
|
43403 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
43404 | }
|
43405 | module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43406 |
|
43407 | }),
|
43408 |
|
43409 | (function(module, exports, __webpack_require__) {
|
43410 |
|
43411 | var toPropertyKey = __webpack_require__(273);
|
43412 | function _defineProperty(obj, key, value) {
|
43413 | key = toPropertyKey(key);
|
43414 | if (key in obj) {
|
43415 | Object.defineProperty(obj, key, {
|
43416 | value: value,
|
43417 | enumerable: true,
|
43418 | configurable: true,
|
43419 | writable: true
|
43420 | });
|
43421 | } else {
|
43422 | obj[key] = value;
|
43423 | }
|
43424 | return obj;
|
43425 | }
|
43426 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43427 |
|
43428 | }),
|
43429 |
|
43430 | (function(module, exports, __webpack_require__) {
|
43431 |
|
43432 | var _typeof = __webpack_require__(119)["default"];
|
43433 | function _toPrimitive(input, hint) {
|
43434 | if (_typeof(input) !== "object" || input === null) return input;
|
43435 | var prim = input[Symbol.toPrimitive];
|
43436 | if (prim !== undefined) {
|
43437 | var res = prim.call(input, hint || "default");
|
43438 | if (_typeof(res) !== "object") return res;
|
43439 | throw new TypeError("@@toPrimitive must return a primitive value.");
|
43440 | }
|
43441 | return (hint === "string" ? String : Number)(input);
|
43442 | }
|
43443 | module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43444 |
|
43445 | }),
|
43446 |
|
43447 | (function(module, exports, __webpack_require__) {
|
43448 |
|
43449 | var objectWithoutPropertiesLoose = __webpack_require__(666);
|
43450 | function _objectWithoutProperties(source, excluded) {
|
43451 | if (source == null) return {};
|
43452 | var target = objectWithoutPropertiesLoose(source, excluded);
|
43453 | var key, i;
|
43454 | if (Object.getOwnPropertySymbols) {
|
43455 | var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
43456 | for (i = 0; i < sourceSymbolKeys.length; i++) {
|
43457 | key = sourceSymbolKeys[i];
|
43458 | if (excluded.indexOf(key) >= 0) continue;
|
43459 | if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
43460 | target[key] = source[key];
|
43461 | }
|
43462 | }
|
43463 | return target;
|
43464 | }
|
43465 | module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43466 |
|
43467 | }),
|
43468 |
|
43469 | (function(module, exports) {
|
43470 |
|
43471 | function _objectWithoutPropertiesLoose(source, excluded) {
|
43472 | if (source == null) return {};
|
43473 | var target = {};
|
43474 | var sourceKeys = Object.keys(source);
|
43475 | var key, i;
|
43476 | for (i = 0; i < sourceKeys.length; i++) {
|
43477 | key = sourceKeys[i];
|
43478 | if (excluded.indexOf(key) >= 0) continue;
|
43479 | target[key] = source[key];
|
43480 | }
|
43481 | return target;
|
43482 | }
|
43483 | module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43484 |
|
43485 | }),
|
43486 |
|
43487 | (function(module, exports) {
|
43488 |
|
43489 | function _assertThisInitialized(self) {
|
43490 | if (self === void 0) {
|
43491 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
43492 | }
|
43493 | return self;
|
43494 | }
|
43495 | module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43496 |
|
43497 | }),
|
43498 |
|
43499 | (function(module, exports, __webpack_require__) {
|
43500 |
|
43501 | var setPrototypeOf = __webpack_require__(669);
|
43502 | function _inheritsLoose(subClass, superClass) {
|
43503 | subClass.prototype = Object.create(superClass.prototype);
|
43504 | subClass.prototype.constructor = subClass;
|
43505 | setPrototypeOf(subClass, superClass);
|
43506 | }
|
43507 | module.exports = _inheritsLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43508 |
|
43509 | }),
|
43510 |
|
43511 | (function(module, exports) {
|
43512 |
|
43513 | function _setPrototypeOf(o, p) {
|
43514 | module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
43515 | o.__proto__ = p;
|
43516 | return o;
|
43517 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43518 | return _setPrototypeOf(o, p);
|
43519 | }
|
43520 | module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43521 |
|
43522 | }),
|
43523 |
|
43524 | (function(module, exports, __webpack_require__) {
|
43525 |
|
43526 |
|
43527 |
|
43528 | var runtime = __webpack_require__(671)();
|
43529 | module.exports = runtime;
|
43530 |
|
43531 |
|
43532 | try {
|
43533 | regeneratorRuntime = runtime;
|
43534 | } catch (accidentalStrictMode) {
|
43535 | if (typeof globalThis === "object") {
|
43536 | globalThis.regeneratorRuntime = runtime;
|
43537 | } else {
|
43538 | Function("r", "regeneratorRuntime = r")(runtime);
|
43539 | }
|
43540 | }
|
43541 |
|
43542 |
|
43543 | }),
|
43544 |
|
43545 | (function(module, exports, __webpack_require__) {
|
43546 |
|
43547 | var _typeof = __webpack_require__(119)["default"];
|
43548 | function _regeneratorRuntime() {
|
43549 | "use strict";
|
43550 | module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
43551 | return e;
|
43552 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43553 | var t,
|
43554 | e = {},
|
43555 | r = Object.prototype,
|
43556 | n = r.hasOwnProperty,
|
43557 | o = Object.defineProperty || function (t, e, r) {
|
43558 | t[e] = r.value;
|
43559 | },
|
43560 | i = "function" == typeof Symbol ? Symbol : {},
|
43561 | a = i.iterator || "@@iterator",
|
43562 | c = i.asyncIterator || "@@asyncIterator",
|
43563 | u = i.toStringTag || "@@toStringTag";
|
43564 | function define(t, e, r) {
|
43565 | return Object.defineProperty(t, e, {
|
43566 | value: r,
|
43567 | enumerable: !0,
|
43568 | configurable: !0,
|
43569 | writable: !0
|
43570 | }), t[e];
|
43571 | }
|
43572 | try {
|
43573 | define({}, "");
|
43574 | } catch (t) {
|
43575 | define = function define(t, e, r) {
|
43576 | return t[e] = r;
|
43577 | };
|
43578 | }
|
43579 | function wrap(t, e, r, n) {
|
43580 | var i = e && e.prototype instanceof Generator ? e : Generator,
|
43581 | a = Object.create(i.prototype),
|
43582 | c = new Context(n || []);
|
43583 | return o(a, "_invoke", {
|
43584 | value: makeInvokeMethod(t, r, c)
|
43585 | }), a;
|
43586 | }
|
43587 | function tryCatch(t, e, r) {
|
43588 | try {
|
43589 | return {
|
43590 | type: "normal",
|
43591 | arg: t.call(e, r)
|
43592 | };
|
43593 | } catch (t) {
|
43594 | return {
|
43595 | type: "throw",
|
43596 | arg: t
|
43597 | };
|
43598 | }
|
43599 | }
|
43600 | e.wrap = wrap;
|
43601 | var h = "suspendedStart",
|
43602 | l = "suspendedYield",
|
43603 | f = "executing",
|
43604 | s = "completed",
|
43605 | y = {};
|
43606 | function Generator() {}
|
43607 | function GeneratorFunction() {}
|
43608 | function GeneratorFunctionPrototype() {}
|
43609 | var p = {};
|
43610 | define(p, a, function () {
|
43611 | return this;
|
43612 | });
|
43613 | var d = Object.getPrototypeOf,
|
43614 | v = d && d(d(values([])));
|
43615 | v && v !== r && n.call(v, a) && (p = v);
|
43616 | var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
43617 | function defineIteratorMethods(t) {
|
43618 | ["next", "throw", "return"].forEach(function (e) {
|
43619 | define(t, e, function (t) {
|
43620 | return this._invoke(e, t);
|
43621 | });
|
43622 | });
|
43623 | }
|
43624 | function AsyncIterator(t, e) {
|
43625 | function invoke(r, o, i, a) {
|
43626 | var c = tryCatch(t[r], t, o);
|
43627 | if ("throw" !== c.type) {
|
43628 | var u = c.arg,
|
43629 | h = u.value;
|
43630 | return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
43631 | invoke("next", t, i, a);
|
43632 | }, function (t) {
|
43633 | invoke("throw", t, i, a);
|
43634 | }) : e.resolve(h).then(function (t) {
|
43635 | u.value = t, i(u);
|
43636 | }, function (t) {
|
43637 | return invoke("throw", t, i, a);
|
43638 | });
|
43639 | }
|
43640 | a(c.arg);
|
43641 | }
|
43642 | var r;
|
43643 | o(this, "_invoke", {
|
43644 | value: function value(t, n) {
|
43645 | function callInvokeWithMethodAndArg() {
|
43646 | return new e(function (e, r) {
|
43647 | invoke(t, n, e, r);
|
43648 | });
|
43649 | }
|
43650 | return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
43651 | }
|
43652 | });
|
43653 | }
|
43654 | function makeInvokeMethod(e, r, n) {
|
43655 | var o = h;
|
43656 | return function (i, a) {
|
43657 | if (o === f) throw new Error("Generator is already running");
|
43658 | if (o === s) {
|
43659 | if ("throw" === i) throw a;
|
43660 | return {
|
43661 | value: t,
|
43662 | done: !0
|
43663 | };
|
43664 | }
|
43665 | for (n.method = i, n.arg = a;;) {
|
43666 | var c = n.delegate;
|
43667 | if (c) {
|
43668 | var u = maybeInvokeDelegate(c, n);
|
43669 | if (u) {
|
43670 | if (u === y) continue;
|
43671 | return u;
|
43672 | }
|
43673 | }
|
43674 | if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
43675 | if (o === h) throw o = s, n.arg;
|
43676 | n.dispatchException(n.arg);
|
43677 | } else "return" === n.method && n.abrupt("return", n.arg);
|
43678 | o = f;
|
43679 | var p = tryCatch(e, r, n);
|
43680 | if ("normal" === p.type) {
|
43681 | if (o = n.done ? s : l, p.arg === y) continue;
|
43682 | return {
|
43683 | value: p.arg,
|
43684 | done: n.done
|
43685 | };
|
43686 | }
|
43687 | "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
43688 | }
|
43689 | };
|
43690 | }
|
43691 | function maybeInvokeDelegate(e, r) {
|
43692 | var n = r.method,
|
43693 | o = e.iterator[n];
|
43694 | if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
43695 | var i = tryCatch(o, e.iterator, r.arg);
|
43696 | if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
43697 | var a = i.arg;
|
43698 | return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
43699 | }
|
43700 | function pushTryEntry(t) {
|
43701 | var e = {
|
43702 | tryLoc: t[0]
|
43703 | };
|
43704 | 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
43705 | }
|
43706 | function resetTryEntry(t) {
|
43707 | var e = t.completion || {};
|
43708 | e.type = "normal", delete e.arg, t.completion = e;
|
43709 | }
|
43710 | function Context(t) {
|
43711 | this.tryEntries = [{
|
43712 | tryLoc: "root"
|
43713 | }], t.forEach(pushTryEntry, this), this.reset(!0);
|
43714 | }
|
43715 | function values(e) {
|
43716 | if (e || "" === e) {
|
43717 | var r = e[a];
|
43718 | if (r) return r.call(e);
|
43719 | if ("function" == typeof e.next) return e;
|
43720 | if (!isNaN(e.length)) {
|
43721 | var o = -1,
|
43722 | i = function next() {
|
43723 | for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
43724 | return next.value = t, next.done = !0, next;
|
43725 | };
|
43726 | return i.next = i;
|
43727 | }
|
43728 | }
|
43729 | throw new TypeError(_typeof(e) + " is not iterable");
|
43730 | }
|
43731 | return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
43732 | value: GeneratorFunctionPrototype,
|
43733 | configurable: !0
|
43734 | }), o(GeneratorFunctionPrototype, "constructor", {
|
43735 | value: GeneratorFunction,
|
43736 | configurable: !0
|
43737 | }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
43738 | var e = "function" == typeof t && t.constructor;
|
43739 | return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
43740 | }, e.mark = function (t) {
|
43741 | return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
43742 | }, e.awrap = function (t) {
|
43743 | return {
|
43744 | __await: t
|
43745 | };
|
43746 | }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
43747 | return this;
|
43748 | }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
43749 | void 0 === i && (i = Promise);
|
43750 | var a = new AsyncIterator(wrap(t, r, n, o), i);
|
43751 | return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
43752 | return t.done ? t.value : a.next();
|
43753 | });
|
43754 | }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
43755 | return this;
|
43756 | }), define(g, "toString", function () {
|
43757 | return "[object Generator]";
|
43758 | }), e.keys = function (t) {
|
43759 | var e = Object(t),
|
43760 | r = [];
|
43761 | for (var n in e) r.push(n);
|
43762 | return r.reverse(), function next() {
|
43763 | for (; r.length;) {
|
43764 | var t = r.pop();
|
43765 | if (t in e) return next.value = t, next.done = !1, next;
|
43766 | }
|
43767 | return next.done = !0, next;
|
43768 | };
|
43769 | }, e.values = values, Context.prototype = {
|
43770 | constructor: Context,
|
43771 | reset: function reset(e) {
|
43772 | if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
43773 | },
|
43774 | stop: function stop() {
|
43775 | this.done = !0;
|
43776 | var t = this.tryEntries[0].completion;
|
43777 | if ("throw" === t.type) throw t.arg;
|
43778 | return this.rval;
|
43779 | },
|
43780 | dispatchException: function dispatchException(e) {
|
43781 | if (this.done) throw e;
|
43782 | var r = this;
|
43783 | function handle(n, o) {
|
43784 | return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
43785 | }
|
43786 | for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
43787 | var i = this.tryEntries[o],
|
43788 | a = i.completion;
|
43789 | if ("root" === i.tryLoc) return handle("end");
|
43790 | if (i.tryLoc <= this.prev) {
|
43791 | var c = n.call(i, "catchLoc"),
|
43792 | u = n.call(i, "finallyLoc");
|
43793 | if (c && u) {
|
43794 | if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
43795 | if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
43796 | } else if (c) {
|
43797 | if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
43798 | } else {
|
43799 | if (!u) throw new Error("try statement without catch or finally");
|
43800 | if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
43801 | }
|
43802 | }
|
43803 | }
|
43804 | },
|
43805 | abrupt: function abrupt(t, e) {
|
43806 | for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
43807 | var o = this.tryEntries[r];
|
43808 | if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
43809 | var i = o;
|
43810 | break;
|
43811 | }
|
43812 | }
|
43813 | i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
43814 | var a = i ? i.completion : {};
|
43815 | return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
43816 | },
|
43817 | complete: function complete(t, e) {
|
43818 | if ("throw" === t.type) throw t.arg;
|
43819 | return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
43820 | },
|
43821 | finish: function finish(t) {
|
43822 | for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
43823 | var r = this.tryEntries[e];
|
43824 | if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
43825 | }
|
43826 | },
|
43827 | "catch": function _catch(t) {
|
43828 | for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
43829 | var r = this.tryEntries[e];
|
43830 | if (r.tryLoc === t) {
|
43831 | var n = r.completion;
|
43832 | if ("throw" === n.type) {
|
43833 | var o = n.arg;
|
43834 | resetTryEntry(r);
|
43835 | }
|
43836 | return o;
|
43837 | }
|
43838 | }
|
43839 | throw new Error("illegal catch attempt");
|
43840 | },
|
43841 | delegateYield: function delegateYield(e, r, n) {
|
43842 | return this.delegate = {
|
43843 | iterator: values(e),
|
43844 | resultName: r,
|
43845 | nextLoc: n
|
43846 | }, "next" === this.method && (this.arg = t), y;
|
43847 | }
|
43848 | }, e;
|
43849 | }
|
43850 | module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
43851 |
|
43852 | }),
|
43853 |
|
43854 | (function(module, exports, __webpack_require__) {
|
43855 |
|
43856 | var arrayShuffle = __webpack_require__(673),
|
43857 | baseShuffle = __webpack_require__(676),
|
43858 | isArray = __webpack_require__(279);
|
43859 |
|
43860 |
|
43861 |
|
43862 |
|
43863 |
|
43864 |
|
43865 |
|
43866 |
|
43867 |
|
43868 |
|
43869 |
|
43870 |
|
43871 |
|
43872 |
|
43873 |
|
43874 |
|
43875 | function shuffle(collection) {
|
43876 | var func = isArray(collection) ? arrayShuffle : baseShuffle;
|
43877 | return func(collection);
|
43878 | }
|
43879 |
|
43880 | module.exports = shuffle;
|
43881 |
|
43882 |
|
43883 | }),
|
43884 |
|
43885 | (function(module, exports, __webpack_require__) {
|
43886 |
|
43887 | var copyArray = __webpack_require__(674),
|
43888 | shuffleSelf = __webpack_require__(274);
|
43889 |
|
43890 |
|
43891 |
|
43892 |
|
43893 |
|
43894 |
|
43895 |
|
43896 |
|
43897 | function arrayShuffle(array) {
|
43898 | return shuffleSelf(copyArray(array));
|
43899 | }
|
43900 |
|
43901 | module.exports = arrayShuffle;
|
43902 |
|
43903 |
|
43904 | }),
|
43905 |
|
43906 | (function(module, exports) {
|
43907 |
|
43908 |
|
43909 |
|
43910 |
|
43911 |
|
43912 |
|
43913 |
|
43914 |
|
43915 |
|
43916 | function copyArray(source, array) {
|
43917 | var index = -1,
|
43918 | length = source.length;
|
43919 |
|
43920 | array || (array = Array(length));
|
43921 | while (++index < length) {
|
43922 | array[index] = source[index];
|
43923 | }
|
43924 | return array;
|
43925 | }
|
43926 |
|
43927 | module.exports = copyArray;
|
43928 |
|
43929 |
|
43930 | }),
|
43931 |
|
43932 | (function(module, exports) {
|
43933 |
|
43934 |
|
43935 | var nativeFloor = Math.floor,
|
43936 | nativeRandom = Math.random;
|
43937 |
|
43938 |
|
43939 |
|
43940 |
|
43941 |
|
43942 |
|
43943 |
|
43944 |
|
43945 |
|
43946 |
|
43947 | function baseRandom(lower, upper) {
|
43948 | return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
|
43949 | }
|
43950 |
|
43951 | module.exports = baseRandom;
|
43952 |
|
43953 |
|
43954 | }),
|
43955 |
|
43956 | (function(module, exports, __webpack_require__) {
|
43957 |
|
43958 | var shuffleSelf = __webpack_require__(274),
|
43959 | values = __webpack_require__(275);
|
43960 |
|
43961 |
|
43962 |
|
43963 |
|
43964 |
|
43965 |
|
43966 |
|
43967 |
|
43968 | function baseShuffle(collection) {
|
43969 | return shuffleSelf(values(collection));
|
43970 | }
|
43971 |
|
43972 | module.exports = baseShuffle;
|
43973 |
|
43974 |
|
43975 | }),
|
43976 |
|
43977 | (function(module, exports, __webpack_require__) {
|
43978 |
|
43979 | var arrayMap = __webpack_require__(678);
|
43980 |
|
43981 |
|
43982 |
|
43983 |
|
43984 |
|
43985 |
|
43986 |
|
43987 |
|
43988 |
|
43989 |
|
43990 |
|
43991 | function baseValues(object, props) {
|
43992 | return arrayMap(props, function(key) {
|
43993 | return object[key];
|
43994 | });
|
43995 | }
|
43996 |
|
43997 | module.exports = baseValues;
|
43998 |
|
43999 |
|
44000 | }),
|
44001 |
|
44002 | (function(module, exports) {
|
44003 |
|
44004 |
|
44005 |
|
44006 |
|
44007 |
|
44008 |
|
44009 |
|
44010 |
|
44011 |
|
44012 |
|
44013 | function arrayMap(array, iteratee) {
|
44014 | var index = -1,
|
44015 | length = array == null ? 0 : array.length,
|
44016 | result = Array(length);
|
44017 |
|
44018 | while (++index < length) {
|
44019 | result[index] = iteratee(array[index], index, array);
|
44020 | }
|
44021 | return result;
|
44022 | }
|
44023 |
|
44024 | module.exports = arrayMap;
|
44025 |
|
44026 |
|
44027 | }),
|
44028 |
|
44029 | (function(module, exports, __webpack_require__) {
|
44030 |
|
44031 | var arrayLikeKeys = __webpack_require__(680),
|
44032 | baseKeys = __webpack_require__(693),
|
44033 | isArrayLike = __webpack_require__(696);
|
44034 |
|
44035 |
|
44036 |
|
44037 |
|
44038 |
|
44039 |
|
44040 |
|
44041 |
|
44042 |
|
44043 |
|
44044 |
|
44045 |
|
44046 |
|
44047 |
|
44048 |
|
44049 |
|
44050 |
|
44051 |
|
44052 |
|
44053 |
|
44054 |
|
44055 |
|
44056 |
|
44057 |
|
44058 |
|
44059 |
|
44060 |
|
44061 |
|
44062 |
|
44063 | function keys(object) {
|
44064 | return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
44065 | }
|
44066 |
|
44067 | module.exports = keys;
|
44068 |
|
44069 |
|
44070 | }),
|
44071 |
|
44072 | (function(module, exports, __webpack_require__) {
|
44073 |
|
44074 | var baseTimes = __webpack_require__(681),
|
44075 | isArguments = __webpack_require__(682),
|
44076 | isArray = __webpack_require__(279),
|
44077 | isBuffer = __webpack_require__(686),
|
44078 | isIndex = __webpack_require__(688),
|
44079 | isTypedArray = __webpack_require__(689);
|
44080 |
|
44081 |
|
44082 | var objectProto = Object.prototype;
|
44083 |
|
44084 |
|
44085 | var hasOwnProperty = objectProto.hasOwnProperty;
|
44086 |
|
44087 |
|
44088 |
|
44089 |
|
44090 |
|
44091 |
|
44092 |
|
44093 |
|
44094 |
|
44095 | function arrayLikeKeys(value, inherited) {
|
44096 | var isArr = isArray(value),
|
44097 | isArg = !isArr && isArguments(value),
|
44098 | isBuff = !isArr && !isArg && isBuffer(value),
|
44099 | isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
44100 | skipIndexes = isArr || isArg || isBuff || isType,
|
44101 | result = skipIndexes ? baseTimes(value.length, String) : [],
|
44102 | length = result.length;
|
44103 |
|
44104 | for (var key in value) {
|
44105 | if ((inherited || hasOwnProperty.call(value, key)) &&
|
44106 | !(skipIndexes && (
|
44107 |
|
44108 | key == 'length' ||
|
44109 |
|
44110 | (isBuff && (key == 'offset' || key == 'parent')) ||
|
44111 |
|
44112 | (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
44113 |
|
44114 | isIndex(key, length)
|
44115 | ))) {
|
44116 | result.push(key);
|
44117 | }
|
44118 | }
|
44119 | return result;
|
44120 | }
|
44121 |
|
44122 | module.exports = arrayLikeKeys;
|
44123 |
|
44124 |
|
44125 | }),
|
44126 |
|
44127 | (function(module, exports) {
|
44128 |
|
44129 |
|
44130 |
|
44131 |
|
44132 |
|
44133 |
|
44134 |
|
44135 |
|
44136 |
|
44137 |
|
44138 | function baseTimes(n, iteratee) {
|
44139 | var index = -1,
|
44140 | result = Array(n);
|
44141 |
|
44142 | while (++index < n) {
|
44143 | result[index] = iteratee(index);
|
44144 | }
|
44145 | return result;
|
44146 | }
|
44147 |
|
44148 | module.exports = baseTimes;
|
44149 |
|
44150 |
|
44151 | }),
|
44152 |
|
44153 | (function(module, exports, __webpack_require__) {
|
44154 |
|
44155 | var baseIsArguments = __webpack_require__(683),
|
44156 | isObjectLike = __webpack_require__(121);
|
44157 |
|
44158 |
|
44159 | var objectProto = Object.prototype;
|
44160 |
|
44161 |
|
44162 | var hasOwnProperty = objectProto.hasOwnProperty;
|
44163 |
|
44164 |
|
44165 | var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
44166 |
|
44167 |
|
44168 |
|
44169 |
|
44170 |
|
44171 |
|
44172 |
|
44173 |
|
44174 |
|
44175 |
|
44176 |
|
44177 |
|
44178 |
|
44179 |
|
44180 |
|
44181 |
|
44182 |
|
44183 |
|
44184 |
|
44185 | var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
44186 | return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
44187 | !propertyIsEnumerable.call(value, 'callee');
|
44188 | };
|
44189 |
|
44190 | module.exports = isArguments;
|
44191 |
|
44192 |
|
44193 | }),
|
44194 |
|
44195 | (function(module, exports, __webpack_require__) {
|
44196 |
|
44197 | var baseGetTag = __webpack_require__(120),
|
44198 | isObjectLike = __webpack_require__(121);
|
44199 |
|
44200 |
|
44201 | var argsTag = '[object Arguments]';
|
44202 |
|
44203 |
|
44204 |
|
44205 |
|
44206 |
|
44207 |
|
44208 |
|
44209 |
|
44210 | function baseIsArguments(value) {
|
44211 | return isObjectLike(value) && baseGetTag(value) == argsTag;
|
44212 | }
|
44213 |
|
44214 | module.exports = baseIsArguments;
|
44215 |
|
44216 |
|
44217 | }),
|
44218 |
|
44219 | (function(module, exports, __webpack_require__) {
|
44220 |
|
44221 | var Symbol = __webpack_require__(276);
|
44222 |
|
44223 |
|
44224 | var objectProto = Object.prototype;
|
44225 |
|
44226 |
|
44227 | var hasOwnProperty = objectProto.hasOwnProperty;
|
44228 |
|
44229 |
|
44230 |
|
44231 |
|
44232 |
|
44233 |
|
44234 | var nativeObjectToString = objectProto.toString;
|
44235 |
|
44236 |
|
44237 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
44238 |
|
44239 |
|
44240 |
|
44241 |
|
44242 |
|
44243 |
|
44244 |
|
44245 |
|
44246 | function getRawTag(value) {
|
44247 | var isOwn = hasOwnProperty.call(value, symToStringTag),
|
44248 | tag = value[symToStringTag];
|
44249 |
|
44250 | try {
|
44251 | value[symToStringTag] = undefined;
|
44252 | var unmasked = true;
|
44253 | } catch (e) {}
|
44254 |
|
44255 | var result = nativeObjectToString.call(value);
|
44256 | if (unmasked) {
|
44257 | if (isOwn) {
|
44258 | value[symToStringTag] = tag;
|
44259 | } else {
|
44260 | delete value[symToStringTag];
|
44261 | }
|
44262 | }
|
44263 | return result;
|
44264 | }
|
44265 |
|
44266 | module.exports = getRawTag;
|
44267 |
|
44268 |
|
44269 | }),
|
44270 |
|
44271 | (function(module, exports) {
|
44272 |
|
44273 |
|
44274 | var objectProto = Object.prototype;
|
44275 |
|
44276 |
|
44277 |
|
44278 |
|
44279 |
|
44280 |
|
44281 | var nativeObjectToString = objectProto.toString;
|
44282 |
|
44283 |
|
44284 |
|
44285 |
|
44286 |
|
44287 |
|
44288 |
|
44289 |
|
44290 | function objectToString(value) {
|
44291 | return nativeObjectToString.call(value);
|
44292 | }
|
44293 |
|
44294 | module.exports = objectToString;
|
44295 |
|
44296 |
|
44297 | }),
|
44298 |
|
44299 | (function(module, exports, __webpack_require__) {
|
44300 |
|
44301 | (function(module) {var root = __webpack_require__(277),
|
44302 | stubFalse = __webpack_require__(687);
|
44303 |
|
44304 |
|
44305 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
44306 |
|
44307 |
|
44308 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
44309 |
|
44310 |
|
44311 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
44312 |
|
44313 |
|
44314 | var Buffer = moduleExports ? root.Buffer : undefined;
|
44315 |
|
44316 |
|
44317 | var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
44318 |
|
44319 |
|
44320 |
|
44321 |
|
44322 |
|
44323 |
|
44324 |
|
44325 |
|
44326 |
|
44327 |
|
44328 |
|
44329 |
|
44330 |
|
44331 |
|
44332 |
|
44333 |
|
44334 |
|
44335 |
|
44336 | var isBuffer = nativeIsBuffer || stubFalse;
|
44337 |
|
44338 | module.exports = isBuffer;
|
44339 |
|
44340 | }.call(exports, __webpack_require__(280)(module)))
|
44341 |
|
44342 | }),
|
44343 |
|
44344 | (function(module, exports) {
|
44345 |
|
44346 |
|
44347 |
|
44348 |
|
44349 |
|
44350 |
|
44351 |
|
44352 |
|
44353 |
|
44354 |
|
44355 |
|
44356 |
|
44357 |
|
44358 |
|
44359 | function stubFalse() {
|
44360 | return false;
|
44361 | }
|
44362 |
|
44363 | module.exports = stubFalse;
|
44364 |
|
44365 |
|
44366 | }),
|
44367 |
|
44368 | (function(module, exports) {
|
44369 |
|
44370 |
|
44371 | var MAX_SAFE_INTEGER = 9007199254740991;
|
44372 |
|
44373 |
|
44374 | var reIsUint = /^(?:0|[1-9]\d*)$/;
|
44375 |
|
44376 |
|
44377 |
|
44378 |
|
44379 |
|
44380 |
|
44381 |
|
44382 |
|
44383 |
|
44384 | function isIndex(value, length) {
|
44385 | var type = typeof value;
|
44386 | length = length == null ? MAX_SAFE_INTEGER : length;
|
44387 |
|
44388 | return !!length &&
|
44389 | (type == 'number' ||
|
44390 | (type != 'symbol' && reIsUint.test(value))) &&
|
44391 | (value > -1 && value % 1 == 0 && value < length);
|
44392 | }
|
44393 |
|
44394 | module.exports = isIndex;
|
44395 |
|
44396 |
|
44397 | }),
|
44398 |
|
44399 | (function(module, exports, __webpack_require__) {
|
44400 |
|
44401 | var baseIsTypedArray = __webpack_require__(690),
|
44402 | baseUnary = __webpack_require__(691),
|
44403 | nodeUtil = __webpack_require__(692);
|
44404 |
|
44405 |
|
44406 | var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
44407 |
|
44408 |
|
44409 |
|
44410 |
|
44411 |
|
44412 |
|
44413 |
|
44414 |
|
44415 |
|
44416 |
|
44417 |
|
44418 |
|
44419 |
|
44420 |
|
44421 |
|
44422 |
|
44423 |
|
44424 |
|
44425 | var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
44426 |
|
44427 | module.exports = isTypedArray;
|
44428 |
|
44429 |
|
44430 | }),
|
44431 |
|
44432 | (function(module, exports, __webpack_require__) {
|
44433 |
|
44434 | var baseGetTag = __webpack_require__(120),
|
44435 | isLength = __webpack_require__(281),
|
44436 | isObjectLike = __webpack_require__(121);
|
44437 |
|
44438 |
|
44439 | var argsTag = '[object Arguments]',
|
44440 | arrayTag = '[object Array]',
|
44441 | boolTag = '[object Boolean]',
|
44442 | dateTag = '[object Date]',
|
44443 | errorTag = '[object Error]',
|
44444 | funcTag = '[object Function]',
|
44445 | mapTag = '[object Map]',
|
44446 | numberTag = '[object Number]',
|
44447 | objectTag = '[object Object]',
|
44448 | regexpTag = '[object RegExp]',
|
44449 | setTag = '[object Set]',
|
44450 | stringTag = '[object String]',
|
44451 | weakMapTag = '[object WeakMap]';
|
44452 |
|
44453 | var arrayBufferTag = '[object ArrayBuffer]',
|
44454 | dataViewTag = '[object DataView]',
|
44455 | float32Tag = '[object Float32Array]',
|
44456 | float64Tag = '[object Float64Array]',
|
44457 | int8Tag = '[object Int8Array]',
|
44458 | int16Tag = '[object Int16Array]',
|
44459 | int32Tag = '[object Int32Array]',
|
44460 | uint8Tag = '[object Uint8Array]',
|
44461 | uint8ClampedTag = '[object Uint8ClampedArray]',
|
44462 | uint16Tag = '[object Uint16Array]',
|
44463 | uint32Tag = '[object Uint32Array]';
|
44464 |
|
44465 |
|
44466 | var typedArrayTags = {};
|
44467 | typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
44468 | typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
44469 | typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
44470 | typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
44471 | typedArrayTags[uint32Tag] = true;
|
44472 | typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
44473 | typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
44474 | typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
44475 | typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
44476 | typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
44477 | typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
44478 | typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
44479 | typedArrayTags[weakMapTag] = false;
|
44480 |
|
44481 |
|
44482 |
|
44483 |
|
44484 |
|
44485 |
|
44486 |
|
44487 |
|
44488 | function baseIsTypedArray(value) {
|
44489 | return isObjectLike(value) &&
|
44490 | isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
44491 | }
|
44492 |
|
44493 | module.exports = baseIsTypedArray;
|
44494 |
|
44495 |
|
44496 | }),
|
44497 |
|
44498 | (function(module, exports) {
|
44499 |
|
44500 |
|
44501 |
|
44502 |
|
44503 |
|
44504 |
|
44505 |
|
44506 |
|
44507 | function baseUnary(func) {
|
44508 | return function(value) {
|
44509 | return func(value);
|
44510 | };
|
44511 | }
|
44512 |
|
44513 | module.exports = baseUnary;
|
44514 |
|
44515 |
|
44516 | }),
|
44517 |
|
44518 | (function(module, exports, __webpack_require__) {
|
44519 |
|
44520 | (function(module) {var freeGlobal = __webpack_require__(278);
|
44521 |
|
44522 |
|
44523 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
44524 |
|
44525 |
|
44526 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
44527 |
|
44528 |
|
44529 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
44530 |
|
44531 |
|
44532 | var freeProcess = moduleExports && freeGlobal.process;
|
44533 |
|
44534 |
|
44535 | var nodeUtil = (function() {
|
44536 | try {
|
44537 |
|
44538 | var types = freeModule && freeModule.require && freeModule.require('util').types;
|
44539 |
|
44540 | if (types) {
|
44541 | return types;
|
44542 | }
|
44543 |
|
44544 |
|
44545 | return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
44546 | } catch (e) {}
|
44547 | }());
|
44548 |
|
44549 | module.exports = nodeUtil;
|
44550 |
|
44551 | }.call(exports, __webpack_require__(280)(module)))
|
44552 |
|
44553 | }),
|
44554 |
|
44555 | (function(module, exports, __webpack_require__) {
|
44556 |
|
44557 | var isPrototype = __webpack_require__(694),
|
44558 | nativeKeys = __webpack_require__(695);
|
44559 |
|
44560 |
|
44561 | var objectProto = Object.prototype;
|
44562 |
|
44563 |
|
44564 | var hasOwnProperty = objectProto.hasOwnProperty;
|
44565 |
|
44566 |
|
44567 |
|
44568 |
|
44569 |
|
44570 |
|
44571 |
|
44572 |
|
44573 | function baseKeys(object) {
|
44574 | if (!isPrototype(object)) {
|
44575 | return nativeKeys(object);
|
44576 | }
|
44577 | var result = [];
|
44578 | for (var key in Object(object)) {
|
44579 | if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
44580 | result.push(key);
|
44581 | }
|
44582 | }
|
44583 | return result;
|
44584 | }
|
44585 |
|
44586 | module.exports = baseKeys;
|
44587 |
|
44588 |
|
44589 | }),
|
44590 |
|
44591 | (function(module, exports) {
|
44592 |
|
44593 |
|
44594 | var objectProto = Object.prototype;
|
44595 |
|
44596 |
|
44597 |
|
44598 |
|
44599 |
|
44600 |
|
44601 |
|
44602 |
|
44603 | function isPrototype(value) {
|
44604 | var Ctor = value && value.constructor,
|
44605 | proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
44606 |
|
44607 | return value === proto;
|
44608 | }
|
44609 |
|
44610 | module.exports = isPrototype;
|
44611 |
|
44612 |
|
44613 | }),
|
44614 |
|
44615 | (function(module, exports, __webpack_require__) {
|
44616 |
|
44617 | var overArg = __webpack_require__(282);
|
44618 |
|
44619 |
|
44620 | var nativeKeys = overArg(Object.keys, Object);
|
44621 |
|
44622 | module.exports = nativeKeys;
|
44623 |
|
44624 |
|
44625 | }),
|
44626 |
|
44627 | (function(module, exports, __webpack_require__) {
|
44628 |
|
44629 | var isFunction = __webpack_require__(697),
|
44630 | isLength = __webpack_require__(281);
|
44631 |
|
44632 |
|
44633 |
|
44634 |
|
44635 |
|
44636 |
|
44637 |
|
44638 |
|
44639 |
|
44640 |
|
44641 |
|
44642 |
|
44643 |
|
44644 |
|
44645 |
|
44646 |
|
44647 |
|
44648 |
|
44649 |
|
44650 |
|
44651 |
|
44652 |
|
44653 |
|
44654 |
|
44655 |
|
44656 |
|
44657 | function isArrayLike(value) {
|
44658 | return value != null && isLength(value.length) && !isFunction(value);
|
44659 | }
|
44660 |
|
44661 | module.exports = isArrayLike;
|
44662 |
|
44663 |
|
44664 | }),
|
44665 |
|
44666 | (function(module, exports, __webpack_require__) {
|
44667 |
|
44668 | var baseGetTag = __webpack_require__(120),
|
44669 | isObject = __webpack_require__(698);
|
44670 |
|
44671 |
|
44672 | var asyncTag = '[object AsyncFunction]',
|
44673 | funcTag = '[object Function]',
|
44674 | genTag = '[object GeneratorFunction]',
|
44675 | proxyTag = '[object Proxy]';
|
44676 |
|
44677 |
|
44678 |
|
44679 |
|
44680 |
|
44681 |
|
44682 |
|
44683 |
|
44684 |
|
44685 |
|
44686 |
|
44687 |
|
44688 |
|
44689 |
|
44690 |
|
44691 |
|
44692 |
|
44693 |
|
44694 | function isFunction(value) {
|
44695 | if (!isObject(value)) {
|
44696 | return false;
|
44697 | }
|
44698 |
|
44699 |
|
44700 | var tag = baseGetTag(value);
|
44701 | return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
44702 | }
|
44703 |
|
44704 | module.exports = isFunction;
|
44705 |
|
44706 |
|
44707 | }),
|
44708 |
|
44709 | (function(module, exports) {
|
44710 |
|
44711 |
|
44712 |
|
44713 |
|
44714 |
|
44715 |
|
44716 |
|
44717 |
|
44718 |
|
44719 |
|
44720 |
|
44721 |
|
44722 |
|
44723 |
|
44724 |
|
44725 |
|
44726 |
|
44727 |
|
44728 |
|
44729 |
|
44730 |
|
44731 |
|
44732 |
|
44733 |
|
44734 |
|
44735 |
|
44736 | function isObject(value) {
|
44737 | var type = typeof value;
|
44738 | return value != null && (type == 'object' || type == 'function');
|
44739 | }
|
44740 |
|
44741 | module.exports = isObject;
|
44742 |
|
44743 |
|
44744 | }),
|
44745 |
|
44746 | (function(module, exports, __webpack_require__) {
|
44747 |
|
44748 | var arrayWithHoles = __webpack_require__(700);
|
44749 | var iterableToArray = __webpack_require__(271);
|
44750 | var unsupportedIterableToArray = __webpack_require__(272);
|
44751 | var nonIterableRest = __webpack_require__(701);
|
44752 | function _toArray(arr) {
|
44753 | return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();
|
44754 | }
|
44755 | module.exports = _toArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
44756 |
|
44757 | }),
|
44758 |
|
44759 | (function(module, exports) {
|
44760 |
|
44761 | function _arrayWithHoles(arr) {
|
44762 | if (Array.isArray(arr)) return arr;
|
44763 | }
|
44764 | module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
44765 |
|
44766 | }),
|
44767 |
|
44768 | (function(module, exports) {
|
44769 |
|
44770 | function _nonIterableRest() {
|
44771 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
44772 | }
|
44773 | module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
44774 |
|
44775 | }),
|
44776 |
|
44777 | (function(module, exports, __webpack_require__) {
|
44778 |
|
44779 | var toPropertyKey = __webpack_require__(273);
|
44780 | function _defineProperties(target, props) {
|
44781 | for (var i = 0; i < props.length; i++) {
|
44782 | var descriptor = props[i];
|
44783 | descriptor.enumerable = descriptor.enumerable || false;
|
44784 | descriptor.configurable = true;
|
44785 | if ("value" in descriptor) descriptor.writable = true;
|
44786 | Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
44787 | }
|
44788 | }
|
44789 | function _createClass(Constructor, protoProps, staticProps) {
|
44790 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
44791 | if (staticProps) _defineProperties(Constructor, staticProps);
|
44792 | Object.defineProperty(Constructor, "prototype", {
|
44793 | writable: false
|
44794 | });
|
44795 | return Constructor;
|
44796 | }
|
44797 | module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
44798 |
|
44799 | }),
|
44800 |
|
44801 | (function(module, exports) {
|
44802 |
|
44803 | function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
|
44804 | var desc = {};
|
44805 | Object.keys(descriptor).forEach(function (key) {
|
44806 | desc[key] = descriptor[key];
|
44807 | });
|
44808 | desc.enumerable = !!desc.enumerable;
|
44809 | desc.configurable = !!desc.configurable;
|
44810 | if ('value' in desc || desc.initializer) {
|
44811 | desc.writable = true;
|
44812 | }
|
44813 | desc = decorators.slice().reverse().reduce(function (desc, decorator) {
|
44814 | return decorator(target, property, desc) || desc;
|
44815 | }, desc);
|
44816 | if (context && desc.initializer !== void 0) {
|
44817 | desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
44818 | desc.initializer = undefined;
|
44819 | }
|
44820 | if (desc.initializer === void 0) {
|
44821 | Object.defineProperty(target, property, desc);
|
44822 | desc = null;
|
44823 | }
|
44824 | return desc;
|
44825 | }
|
44826 | module.exports = _applyDecoratedDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
44827 |
|
44828 | }),
|
44829 |
|
44830 | (function(module, exports, __webpack_require__) {
|
44831 |
|
44832 |
|
44833 |
|
44834 |
|
44835 |
|
44836 |
|
44837 |
|
44838 |
|
44839 |
|
44840 |
|
44841 | (function () {
|
44842 |
|
44843 | var StateMachine = {
|
44844 |
|
44845 |
|
44846 |
|
44847 | VERSION: "2.4.0",
|
44848 |
|
44849 |
|
44850 |
|
44851 | Result: {
|
44852 | SUCCEEDED: 1,
|
44853 | NOTRANSITION: 2,
|
44854 | CANCELLED: 3,
|
44855 | PENDING: 4
|
44856 | },
|
44857 |
|
44858 | Error: {
|
44859 | INVALID_TRANSITION: 100,
|
44860 | PENDING_TRANSITION: 200,
|
44861 | INVALID_CALLBACK: 300
|
44862 | },
|
44863 |
|
44864 | WILDCARD: '*',
|
44865 | ASYNC: 'async',
|
44866 |
|
44867 |
|
44868 |
|
44869 | create: function(cfg, target) {
|
44870 |
|
44871 | var initial = (typeof cfg.initial == 'string') ? { state: cfg.initial } : cfg.initial;
|
44872 | var terminal = cfg.terminal || cfg['final'];
|
44873 | var fsm = target || cfg.target || {};
|
44874 | var events = cfg.events || [];
|
44875 | var callbacks = cfg.callbacks || {};
|
44876 | var map = {};
|
44877 | var transitions = {};
|
44878 |
|
44879 | var add = function(e) {
|
44880 | var from = Array.isArray(e.from) ? e.from : (e.from ? [e.from] : [StateMachine.WILDCARD]);
|
44881 | map[e.name] = map[e.name] || {};
|
44882 | for (var n = 0 ; n < from.length ; n++) {
|
44883 | transitions[from[n]] = transitions[from[n]] || [];
|
44884 | transitions[from[n]].push(e.name);
|
44885 |
|
44886 | map[e.name][from[n]] = e.to || from[n];
|
44887 | }
|
44888 | if (e.to)
|
44889 | transitions[e.to] = transitions[e.to] || [];
|
44890 | };
|
44891 |
|
44892 | if (initial) {
|
44893 | initial.event = initial.event || 'startup';
|
44894 | add({ name: initial.event, from: 'none', to: initial.state });
|
44895 | }
|
44896 |
|
44897 | for(var n = 0 ; n < events.length ; n++)
|
44898 | add(events[n]);
|
44899 |
|
44900 | for(var name in map) {
|
44901 | if (map.hasOwnProperty(name))
|
44902 | fsm[name] = StateMachine.buildEvent(name, map[name]);
|
44903 | }
|
44904 |
|
44905 | for(var name in callbacks) {
|
44906 | if (callbacks.hasOwnProperty(name))
|
44907 | fsm[name] = callbacks[name]
|
44908 | }
|
44909 |
|
44910 | fsm.current = 'none';
|
44911 | fsm.is = function(state) { return Array.isArray(state) ? (state.indexOf(this.current) >= 0) : (this.current === state); };
|
44912 | fsm.can = function(event) { return !this.transition && (map[event] !== undefined) && (map[event].hasOwnProperty(this.current) || map[event].hasOwnProperty(StateMachine.WILDCARD)); }
|
44913 | fsm.cannot = function(event) { return !this.can(event); };
|
44914 | fsm.transitions = function() { return (transitions[this.current] || []).concat(transitions[StateMachine.WILDCARD] || []); };
|
44915 | fsm.isFinished = function() { return this.is(terminal); };
|
44916 | fsm.error = cfg.error || function(name, from, to, args, error, msg, e) { throw e || msg; };
|
44917 | fsm.states = function() { return Object.keys(transitions).sort() };
|
44918 |
|
44919 | if (initial && !initial.defer)
|
44920 | fsm[initial.event]();
|
44921 |
|
44922 | return fsm;
|
44923 |
|
44924 | },
|
44925 |
|
44926 |
|
44927 |
|
44928 | doCallback: function(fsm, func, name, from, to, args) {
|
44929 | if (func) {
|
44930 | try {
|
44931 | return func.apply(fsm, [name, from, to].concat(args));
|
44932 | }
|
44933 | catch(e) {
|
44934 | return fsm.error(name, from, to, args, StateMachine.Error.INVALID_CALLBACK, "an exception occurred in a caller-provided callback function", e);
|
44935 | }
|
44936 | }
|
44937 | },
|
44938 |
|
44939 | beforeAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbeforeevent'], name, from, to, args); },
|
44940 | afterAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafterevent'] || fsm['onevent'], name, from, to, args); },
|
44941 | leaveAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleavestate'], name, from, to, args); },
|
44942 | enterAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenterstate'] || fsm['onstate'], name, from, to, args); },
|
44943 | changeState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onchangestate'], name, from, to, args); },
|
44944 |
|
44945 | beforeThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbefore' + name], name, from, to, args); },
|
44946 | afterThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafter' + name] || fsm['on' + name], name, from, to, args); },
|
44947 | leaveThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleave' + from], name, from, to, args); },
|
44948 | enterThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenter' + to] || fsm['on' + to], name, from, to, args); },
|
44949 |
|
44950 | beforeEvent: function(fsm, name, from, to, args) {
|
44951 | if ((false === StateMachine.beforeThisEvent(fsm, name, from, to, args)) ||
|
44952 | (false === StateMachine.beforeAnyEvent( fsm, name, from, to, args)))
|
44953 | return false;
|
44954 | },
|
44955 |
|
44956 | afterEvent: function(fsm, name, from, to, args) {
|
44957 | StateMachine.afterThisEvent(fsm, name, from, to, args);
|
44958 | StateMachine.afterAnyEvent( fsm, name, from, to, args);
|
44959 | },
|
44960 |
|
44961 | leaveState: function(fsm, name, from, to, args) {
|
44962 | var specific = StateMachine.leaveThisState(fsm, name, from, to, args),
|
44963 | general = StateMachine.leaveAnyState( fsm, name, from, to, args);
|
44964 | if ((false === specific) || (false === general))
|
44965 | return false;
|
44966 | else if ((StateMachine.ASYNC === specific) || (StateMachine.ASYNC === general))
|
44967 | return StateMachine.ASYNC;
|
44968 | },
|
44969 |
|
44970 | enterState: function(fsm, name, from, to, args) {
|
44971 | StateMachine.enterThisState(fsm, name, from, to, args);
|
44972 | StateMachine.enterAnyState( fsm, name, from, to, args);
|
44973 | },
|
44974 |
|
44975 |
|
44976 |
|
44977 | buildEvent: function(name, map) {
|
44978 | return function() {
|
44979 |
|
44980 | var from = this.current;
|
44981 | var to = map[from] || (map[StateMachine.WILDCARD] != StateMachine.WILDCARD ? map[StateMachine.WILDCARD] : from) || from;
|
44982 | var args = Array.prototype.slice.call(arguments);
|
44983 |
|
44984 | if (this.transition)
|
44985 | return this.error(name, from, to, args, StateMachine.Error.PENDING_TRANSITION, "event " + name + " inappropriate because previous transition did not complete");
|
44986 |
|
44987 | if (this.cannot(name))
|
44988 | return this.error(name, from, to, args, StateMachine.Error.INVALID_TRANSITION, "event " + name + " inappropriate in current state " + this.current);
|
44989 |
|
44990 | if (false === StateMachine.beforeEvent(this, name, from, to, args))
|
44991 | return StateMachine.Result.CANCELLED;
|
44992 |
|
44993 | if (from === to) {
|
44994 | StateMachine.afterEvent(this, name, from, to, args);
|
44995 | return StateMachine.Result.NOTRANSITION;
|
44996 | }
|
44997 |
|
44998 |
|
44999 | var fsm = this;
|
45000 | this.transition = function() {
|
45001 | fsm.transition = null;
|
45002 | fsm.current = to;
|
45003 | StateMachine.enterState( fsm, name, from, to, args);
|
45004 | StateMachine.changeState(fsm, name, from, to, args);
|
45005 | StateMachine.afterEvent( fsm, name, from, to, args);
|
45006 | return StateMachine.Result.SUCCEEDED;
|
45007 | };
|
45008 | this.transition.cancel = function() {
|
45009 | fsm.transition = null;
|
45010 | StateMachine.afterEvent(fsm, name, from, to, args);
|
45011 | }
|
45012 |
|
45013 | var leave = StateMachine.leaveState(this, name, from, to, args);
|
45014 | if (false === leave) {
|
45015 | this.transition = null;
|
45016 | return StateMachine.Result.CANCELLED;
|
45017 | }
|
45018 | else if (StateMachine.ASYNC === leave) {
|
45019 | return StateMachine.Result.PENDING;
|
45020 | }
|
45021 | else {
|
45022 | if (this.transition)
|
45023 | return this.transition();
|
45024 | }
|
45025 |
|
45026 | };
|
45027 | }
|
45028 |
|
45029 | };
|
45030 |
|
45031 |
|
45032 |
|
45033 |
|
45034 |
|
45035 |
|
45036 | if (true) {
|
45037 | if (typeof module !== 'undefined' && module.exports) {
|
45038 | exports = module.exports = StateMachine;
|
45039 | }
|
45040 | exports.StateMachine = StateMachine;
|
45041 | }
|
45042 |
|
45043 |
|
45044 |
|
45045 | else if (typeof define === 'function' && define.amd) {
|
45046 | define(function(require) { return StateMachine; });
|
45047 | }
|
45048 |
|
45049 |
|
45050 |
|
45051 | else if (typeof window !== 'undefined') {
|
45052 | window.StateMachine = StateMachine;
|
45053 | }
|
45054 |
|
45055 |
|
45056 |
|
45057 | else if (typeof self !== 'undefined') {
|
45058 | self.StateMachine = StateMachine;
|
45059 | }
|
45060 |
|
45061 | }());
|
45062 |
|
45063 |
|
45064 | }),
|
45065 |
|
45066 | (function(module, exports, __webpack_require__) {
|
45067 |
|
45068 | var baseGetTag = __webpack_require__(120),
|
45069 | getPrototype = __webpack_require__(706),
|
45070 | isObjectLike = __webpack_require__(121);
|
45071 |
|
45072 |
|
45073 | var objectTag = '[object Object]';
|
45074 |
|
45075 |
|
45076 | var funcProto = Function.prototype,
|
45077 | objectProto = Object.prototype;
|
45078 |
|
45079 |
|
45080 | var funcToString = funcProto.toString;
|
45081 |
|
45082 |
|
45083 | var hasOwnProperty = objectProto.hasOwnProperty;
|
45084 |
|
45085 |
|
45086 | var objectCtorString = funcToString.call(Object);
|
45087 |
|
45088 |
|
45089 |
|
45090 |
|
45091 |
|
45092 |
|
45093 |
|
45094 |
|
45095 |
|
45096 |
|
45097 |
|
45098 |
|
45099 |
|
45100 |
|
45101 |
|
45102 |
|
45103 |
|
45104 |
|
45105 |
|
45106 |
|
45107 |
|
45108 |
|
45109 |
|
45110 |
|
45111 |
|
45112 |
|
45113 |
|
45114 |
|
45115 |
|
45116 | function isPlainObject(value) {
|
45117 | if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
45118 | return false;
|
45119 | }
|
45120 | var proto = getPrototype(value);
|
45121 | if (proto === null) {
|
45122 | return true;
|
45123 | }
|
45124 | var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
45125 | return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
45126 | funcToString.call(Ctor) == objectCtorString;
|
45127 | }
|
45128 |
|
45129 | module.exports = isPlainObject;
|
45130 |
|
45131 |
|
45132 | }),
|
45133 |
|
45134 | (function(module, exports, __webpack_require__) {
|
45135 |
|
45136 | var overArg = __webpack_require__(282);
|
45137 |
|
45138 |
|
45139 | var getPrototype = overArg(Object.getPrototypeOf, Object);
|
45140 |
|
45141 | module.exports = getPrototype;
|
45142 |
|
45143 |
|
45144 | }),
|
45145 |
|
45146 | (function(module, exports, __webpack_require__) {
|
45147 |
|
45148 | "use strict";
|
45149 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
|
45150 |
|
45151 | var _interopRequireDefault = __webpack_require__(1);
|
45152 |
|
45153 | var _isIterable2 = _interopRequireDefault(__webpack_require__(263));
|
45154 |
|
45155 | var _from = _interopRequireDefault(__webpack_require__(153));
|
45156 |
|
45157 | var _set = _interopRequireDefault(__webpack_require__(269));
|
45158 |
|
45159 | var _concat = _interopRequireDefault(__webpack_require__(19));
|
45160 |
|
45161 | var _assign = _interopRequireDefault(__webpack_require__(266));
|
45162 |
|
45163 | var _map = _interopRequireDefault(__webpack_require__(37));
|
45164 |
|
45165 | var _defineProperty = _interopRequireDefault(__webpack_require__(94));
|
45166 |
|
45167 | var _typeof2 = _interopRequireDefault(__webpack_require__(95));
|
45168 |
|
45169 | (function (global, factory) {
|
45170 | ( false ? "undefined" : (0, _typeof2.default)(exports)) === 'object' && typeof module !== 'undefined' ? factory(exports, __webpack_require__(156)) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(156)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
45171 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
45172 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
45173 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (global = global || self, factory(global.AV = global.AV || {}, global.AV));
|
45174 | })(void 0, function (exports, core) {
|
45175 | 'use strict';
|
45176 |
|
45177 | function _inheritsLoose(subClass, superClass) {
|
45178 | subClass.prototype = Object.create(superClass.prototype);
|
45179 | subClass.prototype.constructor = subClass;
|
45180 | subClass.__proto__ = superClass;
|
45181 | }
|
45182 |
|
45183 | function _toConsumableArray(arr) {
|
45184 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
45185 | }
|
45186 |
|
45187 | function _arrayWithoutHoles(arr) {
|
45188 | if (Array.isArray(arr)) {
|
45189 | for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
|
45190 | arr2[i] = arr[i];
|
45191 | }
|
45192 |
|
45193 | return arr2;
|
45194 | }
|
45195 | }
|
45196 |
|
45197 | function _iterableToArray(iter) {
|
45198 | if ((0, _isIterable2.default)(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return (0, _from.default)(iter);
|
45199 | }
|
45200 |
|
45201 | function _nonIterableSpread() {
|
45202 | throw new TypeError("Invalid attempt to spread non-iterable instance");
|
45203 | }
|
45204 |
|
45205 |
|
45206 |
|
45207 | if (!core.Protocals) {
|
45208 | throw new Error('LeanCloud Realtime SDK not installed');
|
45209 | }
|
45210 |
|
45211 | var CommandType = core.Protocals.CommandType,
|
45212 | GenericCommand = core.Protocals.GenericCommand,
|
45213 | AckCommand = core.Protocals.AckCommand;
|
45214 |
|
45215 | var warn = function warn(error) {
|
45216 | return console.warn(error.message);
|
45217 | };
|
45218 |
|
45219 | var LiveQueryClient = function (_EventEmitter) {
|
45220 | _inheritsLoose(LiveQueryClient, _EventEmitter);
|
45221 |
|
45222 | function LiveQueryClient(appId, subscriptionId, connection) {
|
45223 | var _this;
|
45224 |
|
45225 | _this = _EventEmitter.call(this) || this;
|
45226 | _this._appId = appId;
|
45227 | _this.id = subscriptionId;
|
45228 | _this._connection = connection;
|
45229 | _this._eventemitter = new core.EventEmitter();
|
45230 | _this._querys = new _set.default();
|
45231 | return _this;
|
45232 | }
|
45233 |
|
45234 | var _proto = LiveQueryClient.prototype;
|
45235 |
|
45236 | _proto._send = function _send(cmd) {
|
45237 | var _context;
|
45238 |
|
45239 | var _this$_connection;
|
45240 |
|
45241 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
45242 | args[_key - 1] = arguments[_key];
|
45243 | }
|
45244 |
|
45245 | return (_this$_connection = this._connection).send.apply(_this$_connection, (0, _concat.default)(_context = [(0, _assign.default)(cmd, {
|
45246 | appId: this._appId,
|
45247 | installationId: this.id,
|
45248 | service: 1
|
45249 | })]).call(_context, args));
|
45250 | };
|
45251 |
|
45252 | _proto._open = function _open() {
|
45253 | return this._send(new GenericCommand({
|
45254 | cmd: CommandType.login
|
45255 | }));
|
45256 | };
|
45257 |
|
45258 | _proto.close = function close() {
|
45259 | var _ee = this._eventemitter;
|
45260 |
|
45261 | _ee.emit('beforeclose');
|
45262 |
|
45263 | return this._send(new GenericCommand({
|
45264 | cmd: CommandType.logout
|
45265 | })).then(function () {
|
45266 | return _ee.emit('close');
|
45267 | });
|
45268 | };
|
45269 |
|
45270 | _proto.register = function register(liveQuery) {
|
45271 | this._querys.add(liveQuery);
|
45272 | };
|
45273 |
|
45274 | _proto.deregister = function deregister(liveQuery) {
|
45275 | var _this2 = this;
|
45276 |
|
45277 | this._querys.delete(liveQuery);
|
45278 |
|
45279 | setTimeout(function () {
|
45280 | if (!_this2._querys.size) _this2.close().catch(warn);
|
45281 | }, 0);
|
45282 | };
|
45283 |
|
45284 | _proto._dispatchCommand = function _dispatchCommand(command) {
|
45285 | if (command.cmd !== CommandType.data) {
|
45286 | this.emit('unhandledmessage', command);
|
45287 | return core.Promise.resolve();
|
45288 | }
|
45289 |
|
45290 | return this._dispatchDataCommand(command);
|
45291 | };
|
45292 |
|
45293 | _proto._dispatchDataCommand = function _dispatchDataCommand(_ref) {
|
45294 | var _ref$dataMessage = _ref.dataMessage,
|
45295 | ids = _ref$dataMessage.ids,
|
45296 | msg = _ref$dataMessage.msg;
|
45297 | this.emit('message', (0, _map.default)(msg).call(msg, function (_ref2) {
|
45298 | var data = _ref2.data;
|
45299 | return JSON.parse(data);
|
45300 | }));
|
45301 |
|
45302 | var command = new GenericCommand({
|
45303 | cmd: CommandType.ack,
|
45304 | ackMessage: new AckCommand({
|
45305 | ids: ids
|
45306 | })
|
45307 | });
|
45308 | return this._send(command, false).catch(warn);
|
45309 | };
|
45310 |
|
45311 | return LiveQueryClient;
|
45312 | }(core.EventEmitter);
|
45313 |
|
45314 | var finalize = function finalize(callback) {
|
45315 | return [
|
45316 | function (value) {
|
45317 | return callback(), value;
|
45318 | }, function (error) {
|
45319 | callback();
|
45320 | throw error;
|
45321 | }];
|
45322 | };
|
45323 |
|
45324 | var onRealtimeCreate = function onRealtimeCreate(realtime) {
|
45325 |
|
45326 | realtime._liveQueryClients = {};
|
45327 |
|
45328 | realtime.createLiveQueryClient = function (subscriptionId) {
|
45329 | var _realtime$_open$then;
|
45330 |
|
45331 | if (realtime._liveQueryClients[subscriptionId] !== undefined) {
|
45332 | return core.Promise.resolve(realtime._liveQueryClients[subscriptionId]);
|
45333 | }
|
45334 |
|
45335 | var promise = (_realtime$_open$then = realtime._open().then(function (connection) {
|
45336 | var client = new LiveQueryClient(realtime._options.appId, subscriptionId, connection);
|
45337 | connection.on('reconnect', function () {
|
45338 | return client._open().then(function () {
|
45339 | return client.emit('reconnect');
|
45340 | }, function (error) {
|
45341 | return client.emit('reconnecterror', error);
|
45342 | });
|
45343 | });
|
45344 |
|
45345 | client._eventemitter.on('beforeclose', function () {
|
45346 | delete realtime._liveQueryClients[client.id];
|
45347 | }, realtime);
|
45348 |
|
45349 | client._eventemitter.on('close', function () {
|
45350 | realtime._deregister(client);
|
45351 | }, realtime);
|
45352 |
|
45353 | return client._open().then(function () {
|
45354 | realtime._liveQueryClients[client.id] = client;
|
45355 |
|
45356 | realtime._register(client);
|
45357 |
|
45358 | return client;
|
45359 | });
|
45360 | })).then.apply(_realtime$_open$then, _toConsumableArray(finalize(function () {
|
45361 | if (realtime._deregisterPending) realtime._deregisterPending(promise);
|
45362 | })));
|
45363 |
|
45364 | realtime._liveQueryClients[subscriptionId] = promise;
|
45365 | if (realtime._registerPending) realtime._registerPending(promise);
|
45366 | return promise;
|
45367 | };
|
45368 |
|
45369 |
|
45370 | };
|
45371 |
|
45372 | var beforeCommandDispatch = function beforeCommandDispatch(command, realtime) {
|
45373 | var isLiveQueryCommand = command.installationId && command.service === 1;
|
45374 | if (!isLiveQueryCommand) return true;
|
45375 | var targetClient = realtime._liveQueryClients[command.installationId];
|
45376 |
|
45377 | if (targetClient) {
|
45378 | targetClient._dispatchCommand(command).catch(function (error) {
|
45379 | return console.warn(error);
|
45380 | });
|
45381 | } else {
|
45382 | console.warn('Unexpected message received without any live client match: %O', command);
|
45383 | }
|
45384 |
|
45385 | return false;
|
45386 | };
|
45387 |
|
45388 |
|
45389 | var LiveQueryPlugin = {
|
45390 | name: 'leancloud-realtime-plugin-live-query',
|
45391 | onRealtimeCreate: onRealtimeCreate,
|
45392 | beforeCommandDispatch: beforeCommandDispatch
|
45393 | };
|
45394 | exports.LiveQueryPlugin = LiveQueryPlugin;
|
45395 | (0, _defineProperty.default)(exports, '__esModule', {
|
45396 | value: true
|
45397 | });
|
45398 | });
|
45399 |
|
45400 | })
|
45401 | ]);
|
45402 | });
|
45403 |
|
\ | No newline at end of file |