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)
8 for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
11 return /******/ (function(modules) { // webpackBootstrap
12 /******/ // The module cache
13 /******/ var installedModules = {};
15 /******/ // The require function
16 /******/ function __webpack_require__(moduleId) {
18 /******/ // Check if module is in cache
19 /******/ if(installedModules[moduleId])
20 /******/ return installedModules[moduleId].exports;
22 /******/ // Create a new module (and put it into the cache)
23 /******/ var module = installedModules[moduleId] = {
25 /******/ id: moduleId,
26 /******/ loaded: false
29 /******/ // Execute the module function
30 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
32 /******/ // Flag the module as loaded
33 /******/ module.loaded = true;
35 /******/ // Return the exports of the module
36 /******/ return module.exports;
40 /******/ // expose the modules object (__webpack_modules__)
41 /******/ __webpack_require__.m = modules;
43 /******/ // expose the module cache
44 /******/ __webpack_require__.c = installedModules;
46 /******/ // __webpack_public_path__
47 /******/ __webpack_require__.p = "/";
49 /******/ // Load entry module and return exports
50 /******/ return __webpack_require__(0);
52 /************************************************************************/
55 /***/ function(module, exports, __webpack_require__) {
57 __webpack_require__(1);
58 module.exports = __webpack_require__(298);
63 /***/ function(module, exports, __webpack_require__) {
65 /* WEBPACK VAR INJECTION */(function(global) {"use strict";
67 __webpack_require__(2);
69 __webpack_require__(293);
71 __webpack_require__(295);
73 if (global._babelPolyfill) {
74 throw new Error("only one instance of babel-polyfill is allowed");
76 global._babelPolyfill = true;
78 var DEFINE_PROPERTY = "defineProperty";
79 function define(O, key, value) {
80 O[key] || Object[DEFINE_PROPERTY](O, key, {
87 define(String.prototype, "padLeft", "".padStart);
88 define(String.prototype, "padRight", "".padEnd);
90 "pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {
91 [][key] && define(Array, key, Function.call.bind([][key]));
93 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
97 /***/ function(module, exports, __webpack_require__) {
99 __webpack_require__(3);
100 __webpack_require__(52);
101 __webpack_require__(53);
102 __webpack_require__(54);
103 __webpack_require__(55);
104 __webpack_require__(57);
105 __webpack_require__(60);
106 __webpack_require__(61);
107 __webpack_require__(62);
108 __webpack_require__(63);
109 __webpack_require__(64);
110 __webpack_require__(65);
111 __webpack_require__(66);
112 __webpack_require__(67);
113 __webpack_require__(68);
114 __webpack_require__(70);
115 __webpack_require__(72);
116 __webpack_require__(74);
117 __webpack_require__(76);
118 __webpack_require__(79);
119 __webpack_require__(80);
120 __webpack_require__(81);
121 __webpack_require__(85);
122 __webpack_require__(87);
123 __webpack_require__(89);
124 __webpack_require__(92);
125 __webpack_require__(93);
126 __webpack_require__(94);
127 __webpack_require__(95);
128 __webpack_require__(97);
129 __webpack_require__(98);
130 __webpack_require__(99);
131 __webpack_require__(100);
132 __webpack_require__(101);
133 __webpack_require__(102);
134 __webpack_require__(103);
135 __webpack_require__(105);
136 __webpack_require__(106);
137 __webpack_require__(107);
138 __webpack_require__(109);
139 __webpack_require__(110);
140 __webpack_require__(111);
141 __webpack_require__(113);
142 __webpack_require__(114);
143 __webpack_require__(115);
144 __webpack_require__(116);
145 __webpack_require__(117);
146 __webpack_require__(118);
147 __webpack_require__(119);
148 __webpack_require__(120);
149 __webpack_require__(121);
150 __webpack_require__(122);
151 __webpack_require__(123);
152 __webpack_require__(124);
153 __webpack_require__(125);
154 __webpack_require__(126);
155 __webpack_require__(131);
156 __webpack_require__(132);
157 __webpack_require__(136);
158 __webpack_require__(137);
159 __webpack_require__(138);
160 __webpack_require__(139);
161 __webpack_require__(141);
162 __webpack_require__(142);
163 __webpack_require__(143);
164 __webpack_require__(144);
165 __webpack_require__(145);
166 __webpack_require__(146);
167 __webpack_require__(147);
168 __webpack_require__(148);
169 __webpack_require__(149);
170 __webpack_require__(150);
171 __webpack_require__(151);
172 __webpack_require__(152);
173 __webpack_require__(153);
174 __webpack_require__(154);
175 __webpack_require__(155);
176 __webpack_require__(156);
177 __webpack_require__(157);
178 __webpack_require__(159);
179 __webpack_require__(160);
180 __webpack_require__(166);
181 __webpack_require__(167);
182 __webpack_require__(169);
183 __webpack_require__(170);
184 __webpack_require__(171);
185 __webpack_require__(175);
186 __webpack_require__(176);
187 __webpack_require__(177);
188 __webpack_require__(178);
189 __webpack_require__(179);
190 __webpack_require__(181);
191 __webpack_require__(182);
192 __webpack_require__(183);
193 __webpack_require__(184);
194 __webpack_require__(187);
195 __webpack_require__(189);
196 __webpack_require__(190);
197 __webpack_require__(191);
198 __webpack_require__(193);
199 __webpack_require__(195);
200 __webpack_require__(197);
201 __webpack_require__(198);
202 __webpack_require__(199);
203 __webpack_require__(201);
204 __webpack_require__(202);
205 __webpack_require__(203);
206 __webpack_require__(204);
207 __webpack_require__(211);
208 __webpack_require__(214);
209 __webpack_require__(215);
210 __webpack_require__(217);
211 __webpack_require__(218);
212 __webpack_require__(221);
213 __webpack_require__(222);
214 __webpack_require__(224);
215 __webpack_require__(225);
216 __webpack_require__(226);
217 __webpack_require__(227);
218 __webpack_require__(228);
219 __webpack_require__(229);
220 __webpack_require__(230);
221 __webpack_require__(231);
222 __webpack_require__(232);
223 __webpack_require__(233);
224 __webpack_require__(234);
225 __webpack_require__(235);
226 __webpack_require__(236);
227 __webpack_require__(237);
228 __webpack_require__(238);
229 __webpack_require__(239);
230 __webpack_require__(240);
231 __webpack_require__(241);
232 __webpack_require__(242);
233 __webpack_require__(244);
234 __webpack_require__(245);
235 __webpack_require__(246);
236 __webpack_require__(247);
237 __webpack_require__(248);
238 __webpack_require__(249);
239 __webpack_require__(251);
240 __webpack_require__(252);
241 __webpack_require__(253);
242 __webpack_require__(254);
243 __webpack_require__(255);
244 __webpack_require__(256);
245 __webpack_require__(257);
246 __webpack_require__(258);
247 __webpack_require__(260);
248 __webpack_require__(261);
249 __webpack_require__(263);
250 __webpack_require__(264);
251 __webpack_require__(265);
252 __webpack_require__(266);
253 __webpack_require__(269);
254 __webpack_require__(270);
255 __webpack_require__(271);
256 __webpack_require__(272);
257 __webpack_require__(273);
258 __webpack_require__(274);
259 __webpack_require__(275);
260 __webpack_require__(276);
261 __webpack_require__(278);
262 __webpack_require__(279);
263 __webpack_require__(280);
264 __webpack_require__(281);
265 __webpack_require__(282);
266 __webpack_require__(283);
267 __webpack_require__(284);
268 __webpack_require__(285);
269 __webpack_require__(286);
270 __webpack_require__(287);
271 __webpack_require__(288);
272 __webpack_require__(291);
273 __webpack_require__(292);
274 module.exports = __webpack_require__(9);
278 /***/ function(module, exports, __webpack_require__) {
281 // ECMAScript 6 symbols shim
282 var global = __webpack_require__(4)
283 , has = __webpack_require__(5)
284 , DESCRIPTORS = __webpack_require__(6)
285 , $export = __webpack_require__(8)
286 , redefine = __webpack_require__(18)
287 , META = __webpack_require__(22).KEY
288 , $fails = __webpack_require__(7)
289 , shared = __webpack_require__(23)
290 , setToStringTag = __webpack_require__(24)
291 , uid = __webpack_require__(19)
292 , wks = __webpack_require__(25)
293 , wksExt = __webpack_require__(26)
294 , wksDefine = __webpack_require__(27)
295 , keyOf = __webpack_require__(29)
296 , enumKeys = __webpack_require__(42)
297 , isArray = __webpack_require__(45)
298 , anObject = __webpack_require__(12)
299 , toIObject = __webpack_require__(32)
300 , toPrimitive = __webpack_require__(16)
301 , createDesc = __webpack_require__(17)
302 , _create = __webpack_require__(46)
303 , gOPNExt = __webpack_require__(49)
304 , $GOPD = __webpack_require__(51)
305 , $DP = __webpack_require__(11)
306 , $keys = __webpack_require__(30)
310 , $Symbol = global.Symbol
311 , $JSON = global.JSON
312 , _stringify = $JSON && $JSON.stringify
313 , PROTOTYPE = 'prototype'
314 , HIDDEN = wks('_hidden')
315 , TO_PRIMITIVE = wks('toPrimitive')
316 , isEnum = {}.propertyIsEnumerable
317 , SymbolRegistry = shared('symbol-registry')
318 , AllSymbols = shared('symbols')
319 , OPSymbols = shared('op-symbols')
320 , ObjectProto = Object[PROTOTYPE]
321 , USE_NATIVE = typeof $Symbol == 'function'
322 , QObject = global.QObject;
323 // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
324 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
326 // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
327 var setSymbolDesc = DESCRIPTORS && $fails(function(){
328 return _create(dP({}, 'a', {
329 get: function(){ return dP(this, 'a', {value: 7}).a; }
331 }) ? function(it, key, D){
332 var protoDesc = gOPD(ObjectProto, key);
333 if(protoDesc)delete ObjectProto[key];
335 if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);
338 var wrap = function(tag){
339 var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
344 var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){
345 return typeof it == 'symbol';
347 return it instanceof $Symbol;
350 var $defineProperty = function defineProperty(it, key, D){
351 if(it === ObjectProto)$defineProperty(OPSymbols, key, D);
353 key = toPrimitive(key, true);
355 if(has(AllSymbols, key)){
357 if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));
358 it[HIDDEN][key] = true;
360 if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;
361 D = _create(D, {enumerable: createDesc(0, false)});
362 } return setSymbolDesc(it, key, D);
363 } return dP(it, key, D);
365 var $defineProperties = function defineProperties(it, P){
367 var keys = enumKeys(P = toIObject(P))
371 while(l > i)$defineProperty(it, key = keys[i++], P[key]);
374 var $create = function create(it, P){
375 return P === undefined ? _create(it) : $defineProperties(_create(it), P);
377 var $propertyIsEnumerable = function propertyIsEnumerable(key){
378 var E = isEnum.call(this, key = toPrimitive(key, true));
379 if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;
380 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
382 var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){
384 key = toPrimitive(key, true);
385 if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;
386 var D = gOPD(it, key);
387 if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;
390 var $getOwnPropertyNames = function getOwnPropertyNames(it){
391 var names = gOPN(toIObject(it))
395 while(names.length > i){
396 if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);
399 var $getOwnPropertySymbols = function getOwnPropertySymbols(it){
400 var IS_OP = it === ObjectProto
401 , names = gOPN(IS_OP ? OPSymbols : toIObject(it))
405 while(names.length > i){
406 if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);
410 // 19.4.1.1 Symbol([description])
412 $Symbol = function Symbol(){
413 if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');
414 var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
415 var $set = function(value){
416 if(this === ObjectProto)$set.call(OPSymbols, value);
417 if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
418 setSymbolDesc(this, tag, createDesc(1, value));
420 if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});
423 redefine($Symbol[PROTOTYPE], 'toString', function toString(){
427 $GOPD.f = $getOwnPropertyDescriptor;
428 $DP.f = $defineProperty;
429 __webpack_require__(50).f = gOPNExt.f = $getOwnPropertyNames;
430 __webpack_require__(44).f = $propertyIsEnumerable;
431 __webpack_require__(43).f = $getOwnPropertySymbols;
433 if(DESCRIPTORS && !__webpack_require__(28)){
434 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
437 wksExt.f = function(name){
438 return wrap(wks(name));
442 $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});
445 // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
446 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
447 ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);
449 for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);
451 $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
452 // 19.4.2.1 Symbol.for(key)
453 'for': function(key){
454 return has(SymbolRegistry, key += '')
455 ? SymbolRegistry[key]
456 : SymbolRegistry[key] = $Symbol(key);
458 // 19.4.2.5 Symbol.keyFor(sym)
459 keyFor: function keyFor(key){
460 if(isSymbol(key))return keyOf(SymbolRegistry, key);
461 throw TypeError(key + ' is not a symbol!');
463 useSetter: function(){ setter = true; },
464 useSimple: function(){ setter = false; }
467 $export($export.S + $export.F * !USE_NATIVE, 'Object', {
468 // 19.1.2.2 Object.create(O [, Properties])
470 // 19.1.2.4 Object.defineProperty(O, P, Attributes)
471 defineProperty: $defineProperty,
472 // 19.1.2.3 Object.defineProperties(O, Properties)
473 defineProperties: $defineProperties,
474 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
475 getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
476 // 19.1.2.7 Object.getOwnPropertyNames(O)
477 getOwnPropertyNames: $getOwnPropertyNames,
478 // 19.1.2.8 Object.getOwnPropertySymbols(O)
479 getOwnPropertySymbols: $getOwnPropertySymbols
482 // 24.3.2 JSON.stringify(value [, replacer [, space]])
483 $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){
485 // MS Edge converts symbol values to JSON as {}
486 // WebKit converts symbol values to JSON as null
487 // V8 throws on boxed symbols
488 return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
490 stringify: function stringify(it){
491 if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined
494 , replacer, $replacer;
495 while(arguments.length > i)args.push(arguments[i++]);
497 if(typeof replacer == 'function')$replacer = replacer;
498 if($replacer || !isArray(replacer))replacer = function(key, value){
499 if($replacer)value = $replacer.call(this, key, value);
500 if(!isSymbol(value))return value;
503 return _stringify.apply($JSON, args);
507 // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
508 $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(10)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
509 // 19.4.3.5 Symbol.prototype[@@toStringTag]
510 setToStringTag($Symbol, 'Symbol');
511 // 20.2.1.9 Math[@@toStringTag]
512 setToStringTag(Math, 'Math', true);
513 // 24.3.3 JSON[@@toStringTag]
514 setToStringTag(global.JSON, 'JSON', true);
518 /***/ function(module, exports) {
520 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
521 var global = module.exports = typeof window != 'undefined' && window.Math == Math
522 ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
523 if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
527 /***/ function(module, exports) {
529 var hasOwnProperty = {}.hasOwnProperty;
530 module.exports = function(it, key){
531 return hasOwnProperty.call(it, key);
536 /***/ function(module, exports, __webpack_require__) {
538 // Thank's IE8 for his funny defineProperty
539 module.exports = !__webpack_require__(7)(function(){
540 return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
545 /***/ function(module, exports) {
547 module.exports = function(exec){
557 /***/ function(module, exports, __webpack_require__) {
559 var global = __webpack_require__(4)
560 , core = __webpack_require__(9)
561 , hide = __webpack_require__(10)
562 , redefine = __webpack_require__(18)
563 , ctx = __webpack_require__(20)
564 , PROTOTYPE = 'prototype';
566 var $export = function(type, name, source){
567 var IS_FORCED = type & $export.F
568 , IS_GLOBAL = type & $export.G
569 , IS_STATIC = type & $export.S
570 , IS_PROTO = type & $export.P
571 , IS_BIND = type & $export.B
572 , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]
573 , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
574 , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})
575 , key, own, out, exp;
576 if(IS_GLOBAL)source = name;
578 // contains in native
579 own = !IS_FORCED && target && target[key] !== undefined;
580 // export native or passed
581 out = (own ? target : source)[key];
582 // bind timers to global for call from export context
583 exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
585 if(target)redefine(target, key, out, type & $export.U);
587 if(exports[key] != out)hide(exports, key, exp);
588 if(IS_PROTO && expProto[key] != out)expProto[key] = out;
593 $export.F = 1; // forced
594 $export.G = 2; // global
595 $export.S = 4; // static
596 $export.P = 8; // proto
597 $export.B = 16; // bind
598 $export.W = 32; // wrap
599 $export.U = 64; // safe
600 $export.R = 128; // real proto method for `library`
601 module.exports = $export;
605 /***/ function(module, exports) {
607 var core = module.exports = {version: '2.4.0'};
608 if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
612 /***/ function(module, exports, __webpack_require__) {
614 var dP = __webpack_require__(11)
615 , createDesc = __webpack_require__(17);
616 module.exports = __webpack_require__(6) ? function(object, key, value){
617 return dP.f(object, key, createDesc(1, value));
618 } : function(object, key, value){
625 /***/ function(module, exports, __webpack_require__) {
627 var anObject = __webpack_require__(12)
628 , IE8_DOM_DEFINE = __webpack_require__(14)
629 , toPrimitive = __webpack_require__(16)
630 , dP = Object.defineProperty;
632 exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes){
634 P = toPrimitive(P, true);
635 anObject(Attributes);
636 if(IE8_DOM_DEFINE)try {
637 return dP(O, P, Attributes);
638 } catch(e){ /* empty */ }
639 if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
640 if('value' in Attributes)O[P] = Attributes.value;
646 /***/ function(module, exports, __webpack_require__) {
648 var isObject = __webpack_require__(13);
649 module.exports = function(it){
650 if(!isObject(it))throw TypeError(it + ' is not an object!');
656 /***/ function(module, exports) {
658 module.exports = function(it){
659 return typeof it === 'object' ? it !== null : typeof it === 'function';
664 /***/ function(module, exports, __webpack_require__) {
666 module.exports = !__webpack_require__(6) && !__webpack_require__(7)(function(){
667 return Object.defineProperty(__webpack_require__(15)('div'), 'a', {get: function(){ return 7; }}).a != 7;
672 /***/ function(module, exports, __webpack_require__) {
674 var isObject = __webpack_require__(13)
675 , document = __webpack_require__(4).document
676 // in old IE typeof document.createElement is 'object'
677 , is = isObject(document) && isObject(document.createElement);
678 module.exports = function(it){
679 return is ? document.createElement(it) : {};
684 /***/ function(module, exports, __webpack_require__) {
686 // 7.1.1 ToPrimitive(input [, PreferredType])
687 var isObject = __webpack_require__(13);
688 // instead of the ES6 spec version, we didn't implement @@toPrimitive case
689 // and the second argument - flag - preferred type is a string
690 module.exports = function(it, S){
691 if(!isObject(it))return it;
693 if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
694 if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
695 if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
696 throw TypeError("Can't convert object to primitive value");
701 /***/ function(module, exports) {
703 module.exports = function(bitmap, value){
705 enumerable : !(bitmap & 1),
706 configurable: !(bitmap & 2),
707 writable : !(bitmap & 4),
714 /***/ function(module, exports, __webpack_require__) {
716 var global = __webpack_require__(4)
717 , hide = __webpack_require__(10)
718 , has = __webpack_require__(5)
719 , SRC = __webpack_require__(19)('src')
720 , TO_STRING = 'toString'
721 , $toString = Function[TO_STRING]
722 , TPL = ('' + $toString).split(TO_STRING);
724 __webpack_require__(9).inspectSource = function(it){
725 return $toString.call(it);
728 (module.exports = function(O, key, val, safe){
729 var isFunction = typeof val == 'function';
730 if(isFunction)has(val, 'name') || hide(val, 'name', key);
731 if(O[key] === val)return;
732 if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
740 if(O[key])O[key] = val;
741 else hide(O, key, val);
744 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
745 })(Function.prototype, TO_STRING, function toString(){
746 return typeof this == 'function' && this[SRC] || $toString.call(this);
751 /***/ function(module, exports) {
754 , px = Math.random();
755 module.exports = function(key){
756 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
761 /***/ function(module, exports, __webpack_require__) {
763 // optional / simple context binding
764 var aFunction = __webpack_require__(21);
765 module.exports = function(fn, that, length){
767 if(that === undefined)return fn;
769 case 1: return function(a){
770 return fn.call(that, a);
772 case 2: return function(a, b){
773 return fn.call(that, a, b);
775 case 3: return function(a, b, c){
776 return fn.call(that, a, b, c);
779 return function(/* ...args */){
780 return fn.apply(that, arguments);
786 /***/ function(module, exports) {
788 module.exports = function(it){
789 if(typeof it != 'function')throw TypeError(it + ' is not a function!');
795 /***/ function(module, exports, __webpack_require__) {
797 var META = __webpack_require__(19)('meta')
798 , isObject = __webpack_require__(13)
799 , has = __webpack_require__(5)
800 , setDesc = __webpack_require__(11).f
802 var isExtensible = Object.isExtensible || function(){
805 var FREEZE = !__webpack_require__(7)(function(){
806 return isExtensible(Object.preventExtensions({}));
808 var setMeta = function(it){
809 setDesc(it, META, {value: {
810 i: 'O' + ++id, // object ID
811 w: {} // weak collections IDs
814 var fastKey = function(it, create){
815 // return primitive with prefix
816 if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
818 // can't set metadata to uncaught frozen object
819 if(!isExtensible(it))return 'F';
820 // not necessary to add metadata
821 if(!create)return 'E';
822 // add missing metadata
827 var getWeak = function(it, create){
829 // can't set metadata to uncaught frozen object
830 if(!isExtensible(it))return true;
831 // not necessary to add metadata
832 if(!create)return false;
833 // add missing metadata
835 // return hash weak collections IDs
838 // add metadata on freeze-family methods calling
839 var onFreeze = function(it){
840 if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);
843 var meta = module.exports = {
853 /***/ function(module, exports, __webpack_require__) {
855 var global = __webpack_require__(4)
856 , SHARED = '__core-js_shared__'
857 , store = global[SHARED] || (global[SHARED] = {});
858 module.exports = function(key){
859 return store[key] || (store[key] = {});
864 /***/ function(module, exports, __webpack_require__) {
866 var def = __webpack_require__(11).f
867 , has = __webpack_require__(5)
868 , TAG = __webpack_require__(25)('toStringTag');
870 module.exports = function(it, tag, stat){
871 if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
876 /***/ function(module, exports, __webpack_require__) {
878 var store = __webpack_require__(23)('wks')
879 , uid = __webpack_require__(19)
880 , Symbol = __webpack_require__(4).Symbol
881 , USE_SYMBOL = typeof Symbol == 'function';
883 var $exports = module.exports = function(name){
884 return store[name] || (store[name] =
885 USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
888 $exports.store = store;
892 /***/ function(module, exports, __webpack_require__) {
894 exports.f = __webpack_require__(25);
898 /***/ function(module, exports, __webpack_require__) {
900 var global = __webpack_require__(4)
901 , core = __webpack_require__(9)
902 , LIBRARY = __webpack_require__(28)
903 , wksExt = __webpack_require__(26)
904 , defineProperty = __webpack_require__(11).f;
905 module.exports = function(name){
906 var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
907 if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});
912 /***/ function(module, exports) {
914 module.exports = false;
918 /***/ function(module, exports, __webpack_require__) {
920 var getKeys = __webpack_require__(30)
921 , toIObject = __webpack_require__(32);
922 module.exports = function(object, el){
923 var O = toIObject(object)
925 , length = keys.length
928 while(length > index)if(O[key = keys[index++]] === el)return key;
933 /***/ function(module, exports, __webpack_require__) {
935 // 19.1.2.14 / 15.2.3.14 Object.keys(O)
936 var $keys = __webpack_require__(31)
937 , enumBugKeys = __webpack_require__(41);
939 module.exports = Object.keys || function keys(O){
940 return $keys(O, enumBugKeys);
945 /***/ function(module, exports, __webpack_require__) {
947 var has = __webpack_require__(5)
948 , toIObject = __webpack_require__(32)
949 , arrayIndexOf = __webpack_require__(36)(false)
950 , IE_PROTO = __webpack_require__(40)('IE_PROTO');
952 module.exports = function(object, names){
953 var O = toIObject(object)
957 for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
958 // Don't enum bug & hidden keys
959 while(names.length > i)if(has(O, key = names[i++])){
960 ~arrayIndexOf(result, key) || result.push(key);
967 /***/ function(module, exports, __webpack_require__) {
969 // to indexed object, toObject with fallback for non-array-like ES3 strings
970 var IObject = __webpack_require__(33)
971 , defined = __webpack_require__(35);
972 module.exports = function(it){
973 return IObject(defined(it));
978 /***/ function(module, exports, __webpack_require__) {
980 // fallback for non-array-like ES3 and non-enumerable old V8 strings
981 var cof = __webpack_require__(34);
982 module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
983 return cof(it) == 'String' ? it.split('') : Object(it);
988 /***/ function(module, exports) {
990 var toString = {}.toString;
992 module.exports = function(it){
993 return toString.call(it).slice(8, -1);
998 /***/ function(module, exports) {
1000 // 7.2.1 RequireObjectCoercible(argument)
1001 module.exports = function(it){
1002 if(it == undefined)throw TypeError("Can't call method on " + it);
1008 /***/ function(module, exports, __webpack_require__) {
1010 // false -> Array#indexOf
1011 // true -> Array#includes
1012 var toIObject = __webpack_require__(32)
1013 , toLength = __webpack_require__(37)
1014 , toIndex = __webpack_require__(39);
1015 module.exports = function(IS_INCLUDES){
1016 return function($this, el, fromIndex){
1017 var O = toIObject($this)
1018 , length = toLength(O.length)
1019 , index = toIndex(fromIndex, length)
1021 // Array#includes uses SameValueZero equality algorithm
1022 if(IS_INCLUDES && el != el)while(length > index){
1024 if(value != value)return true;
1025 // Array#toIndex ignores holes, Array#includes - not
1026 } else for(;length > index; index++)if(IS_INCLUDES || index in O){
1027 if(O[index] === el)return IS_INCLUDES || index || 0;
1028 } return !IS_INCLUDES && -1;
1034 /***/ function(module, exports, __webpack_require__) {
1037 var toInteger = __webpack_require__(38)
1039 module.exports = function(it){
1040 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
1045 /***/ function(module, exports) {
1048 var ceil = Math.ceil
1049 , floor = Math.floor;
1050 module.exports = function(it){
1051 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
1056 /***/ function(module, exports, __webpack_require__) {
1058 var toInteger = __webpack_require__(38)
1061 module.exports = function(index, length){
1062 index = toInteger(index);
1063 return index < 0 ? max(index + length, 0) : min(index, length);
1068 /***/ function(module, exports, __webpack_require__) {
1070 var shared = __webpack_require__(23)('keys')
1071 , uid = __webpack_require__(19);
1072 module.exports = function(key){
1073 return shared[key] || (shared[key] = uid(key));
1078 /***/ function(module, exports) {
1080 // IE 8- don't enum bug keys
1082 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
1087 /***/ function(module, exports, __webpack_require__) {
1089 // all enumerable object keys, includes symbols
1090 var getKeys = __webpack_require__(30)
1091 , gOPS = __webpack_require__(43)
1092 , pIE = __webpack_require__(44);
1093 module.exports = function(it){
1094 var result = getKeys(it)
1095 , getSymbols = gOPS.f;
1097 var symbols = getSymbols(it)
1101 while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);
1107 /***/ function(module, exports) {
1109 exports.f = Object.getOwnPropertySymbols;
1113 /***/ function(module, exports) {
1115 exports.f = {}.propertyIsEnumerable;
1119 /***/ function(module, exports, __webpack_require__) {
1121 // 7.2.2 IsArray(argument)
1122 var cof = __webpack_require__(34);
1123 module.exports = Array.isArray || function isArray(arg){
1124 return cof(arg) == 'Array';
1129 /***/ function(module, exports, __webpack_require__) {
1131 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
1132 var anObject = __webpack_require__(12)
1133 , dPs = __webpack_require__(47)
1134 , enumBugKeys = __webpack_require__(41)
1135 , IE_PROTO = __webpack_require__(40)('IE_PROTO')
1136 , Empty = function(){ /* empty */ }
1137 , PROTOTYPE = 'prototype';
1139 // Create object with fake `null` prototype: use iframe Object with cleared prototype
1140 var createDict = function(){
1141 // Thrash, waste and sodomy: IE GC bug
1142 var iframe = __webpack_require__(15)('iframe')
1143 , i = enumBugKeys.length
1147 iframe.style.display = 'none';
1148 __webpack_require__(48).appendChild(iframe);
1149 iframe.src = 'javascript:'; // eslint-disable-line no-script-url
1150 // createDict = iframe.contentWindow.Object;
1151 // html.removeChild(iframe);
1152 iframeDocument = iframe.contentWindow.document;
1153 iframeDocument.open();
1154 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
1155 iframeDocument.close();
1156 createDict = iframeDocument.F;
1157 while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
1158 return createDict();
1161 module.exports = Object.create || function create(O, Properties){
1164 Empty[PROTOTYPE] = anObject(O);
1166 Empty[PROTOTYPE] = null;
1167 // add "__proto__" for Object.getPrototypeOf polyfill
1168 result[IE_PROTO] = O;
1169 } else result = createDict();
1170 return Properties === undefined ? result : dPs(result, Properties);
1176 /***/ function(module, exports, __webpack_require__) {
1178 var dP = __webpack_require__(11)
1179 , anObject = __webpack_require__(12)
1180 , getKeys = __webpack_require__(30);
1182 module.exports = __webpack_require__(6) ? Object.defineProperties : function defineProperties(O, Properties){
1184 var keys = getKeys(Properties)
1185 , length = keys.length
1188 while(length > i)dP.f(O, P = keys[i++], Properties[P]);
1194 /***/ function(module, exports, __webpack_require__) {
1196 module.exports = __webpack_require__(4).document && document.documentElement;
1200 /***/ function(module, exports, __webpack_require__) {
1202 // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
1203 var toIObject = __webpack_require__(32)
1204 , gOPN = __webpack_require__(50).f
1205 , toString = {}.toString;
1207 var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
1208 ? Object.getOwnPropertyNames(window) : [];
1210 var getWindowNames = function(it){
1214 return windowNames.slice();
1218 module.exports.f = function getOwnPropertyNames(it){
1219 return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
1225 /***/ function(module, exports, __webpack_require__) {
1227 // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
1228 var $keys = __webpack_require__(31)
1229 , hiddenKeys = __webpack_require__(41).concat('length', 'prototype');
1231 exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){
1232 return $keys(O, hiddenKeys);
1237 /***/ function(module, exports, __webpack_require__) {
1239 var pIE = __webpack_require__(44)
1240 , createDesc = __webpack_require__(17)
1241 , toIObject = __webpack_require__(32)
1242 , toPrimitive = __webpack_require__(16)
1243 , has = __webpack_require__(5)
1244 , IE8_DOM_DEFINE = __webpack_require__(14)
1245 , gOPD = Object.getOwnPropertyDescriptor;
1247 exports.f = __webpack_require__(6) ? gOPD : function getOwnPropertyDescriptor(O, P){
1249 P = toPrimitive(P, true);
1250 if(IE8_DOM_DEFINE)try {
1252 } catch(e){ /* empty */ }
1253 if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);
1258 /***/ function(module, exports, __webpack_require__) {
1260 var $export = __webpack_require__(8)
1261 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
1262 $export($export.S, 'Object', {create: __webpack_require__(46)});
1266 /***/ function(module, exports, __webpack_require__) {
1268 var $export = __webpack_require__(8);
1269 // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
1270 $export($export.S + $export.F * !__webpack_require__(6), 'Object', {defineProperty: __webpack_require__(11).f});
1274 /***/ function(module, exports, __webpack_require__) {
1276 var $export = __webpack_require__(8);
1277 // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
1278 $export($export.S + $export.F * !__webpack_require__(6), 'Object', {defineProperties: __webpack_require__(47)});
1282 /***/ function(module, exports, __webpack_require__) {
1284 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
1285 var toIObject = __webpack_require__(32)
1286 , $getOwnPropertyDescriptor = __webpack_require__(51).f;
1288 __webpack_require__(56)('getOwnPropertyDescriptor', function(){
1289 return function getOwnPropertyDescriptor(it, key){
1290 return $getOwnPropertyDescriptor(toIObject(it), key);
1296 /***/ function(module, exports, __webpack_require__) {
1298 // most Object methods by ES6 should accept primitives
1299 var $export = __webpack_require__(8)
1300 , core = __webpack_require__(9)
1301 , fails = __webpack_require__(7);
1302 module.exports = function(KEY, exec){
1303 var fn = (core.Object || {})[KEY] || Object[KEY]
1305 exp[KEY] = exec(fn);
1306 $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
1311 /***/ function(module, exports, __webpack_require__) {
1313 // 19.1.2.9 Object.getPrototypeOf(O)
1314 var toObject = __webpack_require__(58)
1315 , $getPrototypeOf = __webpack_require__(59);
1317 __webpack_require__(56)('getPrototypeOf', function(){
1318 return function getPrototypeOf(it){
1319 return $getPrototypeOf(toObject(it));
1325 /***/ function(module, exports, __webpack_require__) {
1327 // 7.1.13 ToObject(argument)
1328 var defined = __webpack_require__(35);
1329 module.exports = function(it){
1330 return Object(defined(it));
1335 /***/ function(module, exports, __webpack_require__) {
1337 // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
1338 var has = __webpack_require__(5)
1339 , toObject = __webpack_require__(58)
1340 , IE_PROTO = __webpack_require__(40)('IE_PROTO')
1341 , ObjectProto = Object.prototype;
1343 module.exports = Object.getPrototypeOf || function(O){
1345 if(has(O, IE_PROTO))return O[IE_PROTO];
1346 if(typeof O.constructor == 'function' && O instanceof O.constructor){
1347 return O.constructor.prototype;
1348 } return O instanceof Object ? ObjectProto : null;
1353 /***/ function(module, exports, __webpack_require__) {
1355 // 19.1.2.14 Object.keys(O)
1356 var toObject = __webpack_require__(58)
1357 , $keys = __webpack_require__(30);
1359 __webpack_require__(56)('keys', function(){
1360 return function keys(it){
1361 return $keys(toObject(it));
1367 /***/ function(module, exports, __webpack_require__) {
1369 // 19.1.2.7 Object.getOwnPropertyNames(O)
1370 __webpack_require__(56)('getOwnPropertyNames', function(){
1371 return __webpack_require__(49).f;
1376 /***/ function(module, exports, __webpack_require__) {
1378 // 19.1.2.5 Object.freeze(O)
1379 var isObject = __webpack_require__(13)
1380 , meta = __webpack_require__(22).onFreeze;
1382 __webpack_require__(56)('freeze', function($freeze){
1383 return function freeze(it){
1384 return $freeze && isObject(it) ? $freeze(meta(it)) : it;
1390 /***/ function(module, exports, __webpack_require__) {
1392 // 19.1.2.17 Object.seal(O)
1393 var isObject = __webpack_require__(13)
1394 , meta = __webpack_require__(22).onFreeze;
1396 __webpack_require__(56)('seal', function($seal){
1397 return function seal(it){
1398 return $seal && isObject(it) ? $seal(meta(it)) : it;
1404 /***/ function(module, exports, __webpack_require__) {
1406 // 19.1.2.15 Object.preventExtensions(O)
1407 var isObject = __webpack_require__(13)
1408 , meta = __webpack_require__(22).onFreeze;
1410 __webpack_require__(56)('preventExtensions', function($preventExtensions){
1411 return function preventExtensions(it){
1412 return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
1418 /***/ function(module, exports, __webpack_require__) {
1420 // 19.1.2.12 Object.isFrozen(O)
1421 var isObject = __webpack_require__(13);
1423 __webpack_require__(56)('isFrozen', function($isFrozen){
1424 return function isFrozen(it){
1425 return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
1431 /***/ function(module, exports, __webpack_require__) {
1433 // 19.1.2.13 Object.isSealed(O)
1434 var isObject = __webpack_require__(13);
1436 __webpack_require__(56)('isSealed', function($isSealed){
1437 return function isSealed(it){
1438 return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
1444 /***/ function(module, exports, __webpack_require__) {
1446 // 19.1.2.11 Object.isExtensible(O)
1447 var isObject = __webpack_require__(13);
1449 __webpack_require__(56)('isExtensible', function($isExtensible){
1450 return function isExtensible(it){
1451 return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
1457 /***/ function(module, exports, __webpack_require__) {
1459 // 19.1.3.1 Object.assign(target, source)
1460 var $export = __webpack_require__(8);
1462 $export($export.S + $export.F, 'Object', {assign: __webpack_require__(69)});
1466 /***/ function(module, exports, __webpack_require__) {
1469 // 19.1.2.1 Object.assign(target, source, ...)
1470 var getKeys = __webpack_require__(30)
1471 , gOPS = __webpack_require__(43)
1472 , pIE = __webpack_require__(44)
1473 , toObject = __webpack_require__(58)
1474 , IObject = __webpack_require__(33)
1475 , $assign = Object.assign;
1477 // should work with symbols and should have deterministic property order (V8 bug)
1478 module.exports = !$assign || __webpack_require__(7)(function(){
1482 , K = 'abcdefghijklmnopqrst';
1484 K.split('').forEach(function(k){ B[k] = k; });
1485 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
1486 }) ? function assign(target, source){ // eslint-disable-line no-unused-vars
1487 var T = toObject(target)
1488 , aLen = arguments.length
1490 , getSymbols = gOPS.f
1492 while(aLen > index){
1493 var S = IObject(arguments[index++])
1494 , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
1495 , length = keys.length
1498 while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
1504 /***/ function(module, exports, __webpack_require__) {
1506 // 19.1.3.10 Object.is(value1, value2)
1507 var $export = __webpack_require__(8);
1508 $export($export.S, 'Object', {is: __webpack_require__(71)});
1512 /***/ function(module, exports) {
1514 // 7.2.9 SameValue(x, y)
1515 module.exports = Object.is || function is(x, y){
1516 return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
1521 /***/ function(module, exports, __webpack_require__) {
1523 // 19.1.3.19 Object.setPrototypeOf(O, proto)
1524 var $export = __webpack_require__(8);
1525 $export($export.S, 'Object', {setPrototypeOf: __webpack_require__(73).set});
1529 /***/ function(module, exports, __webpack_require__) {
1531 // Works with __proto__ only. Old v8 can't work with null proto objects.
1532 /* eslint-disable no-proto */
1533 var isObject = __webpack_require__(13)
1534 , anObject = __webpack_require__(12);
1535 var check = function(O, proto){
1537 if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!");
1540 set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
1541 function(test, buggy, set){
1543 set = __webpack_require__(20)(Function.call, __webpack_require__(51).f(Object.prototype, '__proto__').set, 2);
1545 buggy = !(test instanceof Array);
1546 } catch(e){ buggy = true; }
1547 return function setPrototypeOf(O, proto){
1549 if(buggy)O.__proto__ = proto;
1553 }({}, false) : undefined),
1559 /***/ function(module, exports, __webpack_require__) {
1562 // 19.1.3.6 Object.prototype.toString()
1563 var classof = __webpack_require__(75)
1565 test[__webpack_require__(25)('toStringTag')] = 'z';
1566 if(test + '' != '[object z]'){
1567 __webpack_require__(18)(Object.prototype, 'toString', function toString(){
1568 return '[object ' + classof(this) + ']';
1574 /***/ function(module, exports, __webpack_require__) {
1576 // getting tag from 19.1.3.6 Object.prototype.toString()
1577 var cof = __webpack_require__(34)
1578 , TAG = __webpack_require__(25)('toStringTag')
1580 , ARG = cof(function(){ return arguments; }()) == 'Arguments';
1582 // fallback for IE11 Script Access Denied error
1583 var tryGet = function(it, key){
1586 } catch(e){ /* empty */ }
1589 module.exports = function(it){
1591 return it === undefined ? 'Undefined' : it === null ? 'Null'
1592 // @@toStringTag case
1593 : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
1596 // ES3 arguments fallback
1597 : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
1602 /***/ function(module, exports, __webpack_require__) {
1604 // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
1605 var $export = __webpack_require__(8);
1607 $export($export.P, 'Function', {bind: __webpack_require__(77)});
1611 /***/ function(module, exports, __webpack_require__) {
1614 var aFunction = __webpack_require__(21)
1615 , isObject = __webpack_require__(13)
1616 , invoke = __webpack_require__(78)
1617 , arraySlice = [].slice
1620 var construct = function(F, len, args){
1621 if(!(len in factories)){
1622 for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']';
1623 factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
1624 } return factories[len](F, args);
1627 module.exports = Function.bind || function bind(that /*, args... */){
1628 var fn = aFunction(this)
1629 , partArgs = arraySlice.call(arguments, 1);
1630 var bound = function(/* args... */){
1631 var args = partArgs.concat(arraySlice.call(arguments));
1632 return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
1634 if(isObject(fn.prototype))bound.prototype = fn.prototype;
1640 /***/ function(module, exports) {
1642 // fast apply, http://jsperf.lnkit.com/fast-apply/5
1643 module.exports = function(fn, args, that){
1644 var un = that === undefined;
1645 switch(args.length){
1646 case 0: return un ? fn()
1648 case 1: return un ? fn(args[0])
1649 : fn.call(that, args[0]);
1650 case 2: return un ? fn(args[0], args[1])
1651 : fn.call(that, args[0], args[1]);
1652 case 3: return un ? fn(args[0], args[1], args[2])
1653 : fn.call(that, args[0], args[1], args[2]);
1654 case 4: return un ? fn(args[0], args[1], args[2], args[3])
1655 : fn.call(that, args[0], args[1], args[2], args[3]);
1656 } return fn.apply(that, args);
1661 /***/ function(module, exports, __webpack_require__) {
1663 var dP = __webpack_require__(11).f
1664 , createDesc = __webpack_require__(17)
1665 , has = __webpack_require__(5)
1666 , FProto = Function.prototype
1667 , nameRE = /^\s*function ([^ (]*)/
1670 var isExtensible = Object.isExtensible || function(){
1675 NAME in FProto || __webpack_require__(6) && dP(FProto, NAME, {
1680 , name = ('' + that).match(nameRE)[1];
1681 has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name));
1691 /***/ function(module, exports, __webpack_require__) {
1694 var isObject = __webpack_require__(13)
1695 , getPrototypeOf = __webpack_require__(59)
1696 , HAS_INSTANCE = __webpack_require__(25)('hasInstance')
1697 , FunctionProto = Function.prototype;
1698 // 19.2.3.6 Function.prototype[@@hasInstance](V)
1699 if(!(HAS_INSTANCE in FunctionProto))__webpack_require__(11).f(FunctionProto, HAS_INSTANCE, {value: function(O){
1700 if(typeof this != 'function' || !isObject(O))return false;
1701 if(!isObject(this.prototype))return O instanceof this;
1702 // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
1703 while(O = getPrototypeOf(O))if(this.prototype === O)return true;
1709 /***/ function(module, exports, __webpack_require__) {
1711 var $export = __webpack_require__(8)
1712 , $parseInt = __webpack_require__(82);
1713 // 18.2.5 parseInt(string, radix)
1714 $export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt});
1718 /***/ function(module, exports, __webpack_require__) {
1720 var $parseInt = __webpack_require__(4).parseInt
1721 , $trim = __webpack_require__(83).trim
1722 , ws = __webpack_require__(84)
1723 , hex = /^[\-+]?0[xX]/;
1725 module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){
1726 var string = $trim(String(str), 3);
1727 return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
1732 /***/ function(module, exports, __webpack_require__) {
1734 var $export = __webpack_require__(8)
1735 , defined = __webpack_require__(35)
1736 , fails = __webpack_require__(7)
1737 , spaces = __webpack_require__(84)
1738 , space = '[' + spaces + ']'
1739 , non = '\u200b\u0085'
1740 , ltrim = RegExp('^' + space + space + '*')
1741 , rtrim = RegExp(space + space + '*$');
1743 var exporter = function(KEY, exec, ALIAS){
1745 var FORCE = fails(function(){
1746 return !!spaces[KEY]() || non[KEY]() != non;
1748 var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
1749 if(ALIAS)exp[ALIAS] = fn;
1750 $export($export.P + $export.F * FORCE, 'String', exp);
1753 // 1 -> String#trimLeft
1754 // 2 -> String#trimRight
1756 var trim = exporter.trim = function(string, TYPE){
1757 string = String(defined(string));
1758 if(TYPE & 1)string = string.replace(ltrim, '');
1759 if(TYPE & 2)string = string.replace(rtrim, '');
1763 module.exports = exporter;
1767 /***/ function(module, exports) {
1769 module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
1770 '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1774 /***/ function(module, exports, __webpack_require__) {
1776 var $export = __webpack_require__(8)
1777 , $parseFloat = __webpack_require__(86);
1778 // 18.2.4 parseFloat(string)
1779 $export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat});
1783 /***/ function(module, exports, __webpack_require__) {
1785 var $parseFloat = __webpack_require__(4).parseFloat
1786 , $trim = __webpack_require__(83).trim;
1788 module.exports = 1 / $parseFloat(__webpack_require__(84) + '-0') !== -Infinity ? function parseFloat(str){
1789 var string = $trim(String(str), 3)
1790 , result = $parseFloat(string);
1791 return result === 0 && string.charAt(0) == '-' ? -0 : result;
1796 /***/ function(module, exports, __webpack_require__) {
1799 var global = __webpack_require__(4)
1800 , has = __webpack_require__(5)
1801 , cof = __webpack_require__(34)
1802 , inheritIfRequired = __webpack_require__(88)
1803 , toPrimitive = __webpack_require__(16)
1804 , fails = __webpack_require__(7)
1805 , gOPN = __webpack_require__(50).f
1806 , gOPD = __webpack_require__(51).f
1807 , dP = __webpack_require__(11).f
1808 , $trim = __webpack_require__(83).trim
1810 , $Number = global[NUMBER]
1812 , proto = $Number.prototype
1813 // Opera ~12 has broken Object#toString
1814 , BROKEN_COF = cof(__webpack_require__(46)(proto)) == NUMBER
1815 , TRIM = 'trim' in String.prototype;
1817 // 7.1.3 ToNumber(argument)
1818 var toNumber = function(argument){
1819 var it = toPrimitive(argument, false);
1820 if(typeof it == 'string' && it.length > 2){
1821 it = TRIM ? it.trim() : $trim(it, 3);
1822 var first = it.charCodeAt(0)
1823 , third, radix, maxCode;
1824 if(first === 43 || first === 45){
1825 third = it.charCodeAt(2);
1826 if(third === 88 || third === 120)return NaN; // Number('+0x1') should be NaN, old V8 fix
1827 } else if(first === 48){
1828 switch(it.charCodeAt(1)){
1829 case 66 : case 98 : radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
1830 case 79 : case 111 : radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
1831 default : return +it;
1833 for(var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++){
1834 code = digits.charCodeAt(i);
1835 // parseInt parses a string to a first unavailable symbol
1836 // but ToNumber should return NaN if a string contains unavailable symbols
1837 if(code < 48 || code > maxCode)return NaN;
1838 } return parseInt(digits, radix);
1843 if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){
1844 $Number = function Number(value){
1845 var it = arguments.length < 1 ? 0 : value
1847 return that instanceof $Number
1848 // check on 1..constructor(foo) case
1849 && (BROKEN_COF ? fails(function(){ proto.valueOf.call(that); }) : cof(that) != NUMBER)
1850 ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
1852 for(var keys = __webpack_require__(6) ? gOPN(Base) : (
1854 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
1855 // ES6 (in case, if modules with ES6 Number statics required before):
1856 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
1857 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
1858 ).split(','), j = 0, key; keys.length > j; j++){
1859 if(has(Base, key = keys[j]) && !has($Number, key)){
1860 dP($Number, key, gOPD(Base, key));
1863 $Number.prototype = proto;
1864 proto.constructor = $Number;
1865 __webpack_require__(18)(global, NUMBER, $Number);
1870 /***/ function(module, exports, __webpack_require__) {
1872 var isObject = __webpack_require__(13)
1873 , setPrototypeOf = __webpack_require__(73).set;
1874 module.exports = function(that, target, C){
1875 var P, S = target.constructor;
1876 if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){
1877 setPrototypeOf(that, P);
1883 /***/ function(module, exports, __webpack_require__) {
1886 var $export = __webpack_require__(8)
1887 , toInteger = __webpack_require__(38)
1888 , aNumberValue = __webpack_require__(90)
1889 , repeat = __webpack_require__(91)
1890 , $toFixed = 1..toFixed
1891 , floor = Math.floor
1892 , data = [0, 0, 0, 0, 0, 0]
1893 , ERROR = 'Number.toFixed: incorrect invocation!'
1896 var multiply = function(n, c){
1902 c2 = floor(c2 / 1e7);
1905 var divide = function(n){
1910 data[i] = floor(c / n);
1914 var numToString = function(){
1918 if(s !== '' || i === 0 || data[i] !== 0){
1919 var t = String(data[i]);
1920 s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
1924 var pow = function(x, n, acc){
1925 return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
1927 var log = function(x){
1940 $export($export.P + $export.F * (!!$toFixed && (
1941 0.00008.toFixed(3) !== '0.000' ||
1942 0.9.toFixed(0) !== '1' ||
1943 1.255.toFixed(2) !== '1.25' ||
1944 1000000000000000128..toFixed(0) !== '1000000000000000128'
1945 ) || !__webpack_require__(7)(function(){
1946 // V8 ~ Android 4.3-
1949 toFixed: function toFixed(fractionDigits){
1950 var x = aNumberValue(this, ERROR)
1951 , f = toInteger(fractionDigits)
1955 if(f < 0 || f > 20)throw RangeError(ERROR);
1956 if(x != x)return 'NaN';
1957 if(x <= -1e21 || x >= 1e21)return String(x);
1963 e = log(x * pow(2, 69, 1)) - 69;
1964 z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
1965 z *= 0x10000000000000;
1974 multiply(pow(10, j, 1), 0);
1986 multiply(1 << -e, 0);
1987 m = numToString() + repeat.call(ZERO, f);
1992 m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
2001 /***/ function(module, exports, __webpack_require__) {
2003 var cof = __webpack_require__(34);
2004 module.exports = function(it, msg){
2005 if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg);
2011 /***/ function(module, exports, __webpack_require__) {
2014 var toInteger = __webpack_require__(38)
2015 , defined = __webpack_require__(35);
2017 module.exports = function repeat(count){
2018 var str = String(defined(this))
2020 , n = toInteger(count);
2021 if(n < 0 || n == Infinity)throw RangeError("Count can't be negative");
2022 for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;
2028 /***/ function(module, exports, __webpack_require__) {
2031 var $export = __webpack_require__(8)
2032 , $fails = __webpack_require__(7)
2033 , aNumberValue = __webpack_require__(90)
2034 , $toPrecision = 1..toPrecision;
2036 $export($export.P + $export.F * ($fails(function(){
2038 return $toPrecision.call(1, undefined) !== '1';
2039 }) || !$fails(function(){
2040 // V8 ~ Android 4.3-
2041 $toPrecision.call({});
2043 toPrecision: function toPrecision(precision){
2044 var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
2045 return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
2051 /***/ function(module, exports, __webpack_require__) {
2053 // 20.1.2.1 Number.EPSILON
2054 var $export = __webpack_require__(8);
2056 $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)});
2060 /***/ function(module, exports, __webpack_require__) {
2062 // 20.1.2.2 Number.isFinite(number)
2063 var $export = __webpack_require__(8)
2064 , _isFinite = __webpack_require__(4).isFinite;
2066 $export($export.S, 'Number', {
2067 isFinite: function isFinite(it){
2068 return typeof it == 'number' && _isFinite(it);
2074 /***/ function(module, exports, __webpack_require__) {
2076 // 20.1.2.3 Number.isInteger(number)
2077 var $export = __webpack_require__(8);
2079 $export($export.S, 'Number', {isInteger: __webpack_require__(96)});
2083 /***/ function(module, exports, __webpack_require__) {
2085 // 20.1.2.3 Number.isInteger(number)
2086 var isObject = __webpack_require__(13)
2087 , floor = Math.floor;
2088 module.exports = function isInteger(it){
2089 return !isObject(it) && isFinite(it) && floor(it) === it;
2094 /***/ function(module, exports, __webpack_require__) {
2096 // 20.1.2.4 Number.isNaN(number)
2097 var $export = __webpack_require__(8);
2099 $export($export.S, 'Number', {
2100 isNaN: function isNaN(number){
2101 return number != number;
2107 /***/ function(module, exports, __webpack_require__) {
2109 // 20.1.2.5 Number.isSafeInteger(number)
2110 var $export = __webpack_require__(8)
2111 , isInteger = __webpack_require__(96)
2114 $export($export.S, 'Number', {
2115 isSafeInteger: function isSafeInteger(number){
2116 return isInteger(number) && abs(number) <= 0x1fffffffffffff;
2122 /***/ function(module, exports, __webpack_require__) {
2124 // 20.1.2.6 Number.MAX_SAFE_INTEGER
2125 var $export = __webpack_require__(8);
2127 $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff});
2131 /***/ function(module, exports, __webpack_require__) {
2133 // 20.1.2.10 Number.MIN_SAFE_INTEGER
2134 var $export = __webpack_require__(8);
2136 $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff});
2140 /***/ function(module, exports, __webpack_require__) {
2142 var $export = __webpack_require__(8)
2143 , $parseFloat = __webpack_require__(86);
2144 // 20.1.2.12 Number.parseFloat(string)
2145 $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat});
2149 /***/ function(module, exports, __webpack_require__) {
2151 var $export = __webpack_require__(8)
2152 , $parseInt = __webpack_require__(82);
2153 // 20.1.2.13 Number.parseInt(string, radix)
2154 $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt});
2158 /***/ function(module, exports, __webpack_require__) {
2160 // 20.2.2.3 Math.acosh(x)
2161 var $export = __webpack_require__(8)
2162 , log1p = __webpack_require__(104)
2164 , $acosh = Math.acosh;
2166 $export($export.S + $export.F * !($acosh
2167 // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
2168 && Math.floor($acosh(Number.MAX_VALUE)) == 710
2169 // Tor Browser bug: Math.acosh(Infinity) -> NaN
2170 && $acosh(Infinity) == Infinity
2172 acosh: function acosh(x){
2173 return (x = +x) < 1 ? NaN : x > 94906265.62425156
2174 ? Math.log(x) + Math.LN2
2175 : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
2181 /***/ function(module, exports) {
2183 // 20.2.2.20 Math.log1p(x)
2184 module.exports = Math.log1p || function log1p(x){
2185 return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
2190 /***/ function(module, exports, __webpack_require__) {
2192 // 20.2.2.5 Math.asinh(x)
2193 var $export = __webpack_require__(8)
2194 , $asinh = Math.asinh;
2197 return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
2200 // Tor Browser bug: Math.asinh(0) -> -0
2201 $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh});
2205 /***/ function(module, exports, __webpack_require__) {
2207 // 20.2.2.7 Math.atanh(x)
2208 var $export = __webpack_require__(8)
2209 , $atanh = Math.atanh;
2211 // Tor Browser bug: Math.atanh(-0) -> 0
2212 $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
2213 atanh: function atanh(x){
2214 return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
2220 /***/ function(module, exports, __webpack_require__) {
2222 // 20.2.2.9 Math.cbrt(x)
2223 var $export = __webpack_require__(8)
2224 , sign = __webpack_require__(108);
2226 $export($export.S, 'Math', {
2227 cbrt: function cbrt(x){
2228 return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
2234 /***/ function(module, exports) {
2236 // 20.2.2.28 Math.sign(x)
2237 module.exports = Math.sign || function sign(x){
2238 return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
2243 /***/ function(module, exports, __webpack_require__) {
2245 // 20.2.2.11 Math.clz32(x)
2246 var $export = __webpack_require__(8);
2248 $export($export.S, 'Math', {
2249 clz32: function clz32(x){
2250 return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
2256 /***/ function(module, exports, __webpack_require__) {
2258 // 20.2.2.12 Math.cosh(x)
2259 var $export = __webpack_require__(8)
2262 $export($export.S, 'Math', {
2263 cosh: function cosh(x){
2264 return (exp(x = +x) + exp(-x)) / 2;
2270 /***/ function(module, exports, __webpack_require__) {
2272 // 20.2.2.14 Math.expm1(x)
2273 var $export = __webpack_require__(8)
2274 , $expm1 = __webpack_require__(112);
2276 $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1});
2280 /***/ function(module, exports) {
2282 // 20.2.2.14 Math.expm1(x)
2283 var $expm1 = Math.expm1;
2284 module.exports = (!$expm1
2286 || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
2288 || $expm1(-2e-17) != -2e-17
2289 ) ? function expm1(x){
2290 return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
2295 /***/ function(module, exports, __webpack_require__) {
2297 // 20.2.2.16 Math.fround(x)
2298 var $export = __webpack_require__(8)
2299 , sign = __webpack_require__(108)
2301 , EPSILON = pow(2, -52)
2302 , EPSILON32 = pow(2, -23)
2303 , MAX32 = pow(2, 127) * (2 - EPSILON32)
2304 , MIN32 = pow(2, -126);
2306 var roundTiesToEven = function(n){
2307 return n + 1 / EPSILON - 1 / EPSILON;
2311 $export($export.S, 'Math', {
2312 fround: function fround(x){
2313 var $abs = Math.abs(x)
2316 if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
2317 a = (1 + EPSILON32 / EPSILON) * $abs;
2318 result = a - (a - $abs);
2319 if(result > MAX32 || result != result)return $sign * Infinity;
2320 return $sign * result;
2326 /***/ function(module, exports, __webpack_require__) {
2328 // 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
2329 var $export = __webpack_require__(8)
2332 $export($export.S, 'Math', {
2333 hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars
2336 , aLen = arguments.length
2340 arg = abs(arguments[i++]);
2343 sum = sum * div * div + 1;
2350 return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
2356 /***/ function(module, exports, __webpack_require__) {
2358 // 20.2.2.18 Math.imul(x, y)
2359 var $export = __webpack_require__(8)
2360 , $imul = Math.imul;
2362 // some WebKit versions fails with big numbers, some has wrong arity
2363 $export($export.S + $export.F * __webpack_require__(7)(function(){
2364 return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
2366 imul: function imul(x, y){
2372 return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
2378 /***/ function(module, exports, __webpack_require__) {
2380 // 20.2.2.21 Math.log10(x)
2381 var $export = __webpack_require__(8);
2383 $export($export.S, 'Math', {
2384 log10: function log10(x){
2385 return Math.log(x) / Math.LN10;
2391 /***/ function(module, exports, __webpack_require__) {
2393 // 20.2.2.20 Math.log1p(x)
2394 var $export = __webpack_require__(8);
2396 $export($export.S, 'Math', {log1p: __webpack_require__(104)});
2400 /***/ function(module, exports, __webpack_require__) {
2402 // 20.2.2.22 Math.log2(x)
2403 var $export = __webpack_require__(8);
2405 $export($export.S, 'Math', {
2406 log2: function log2(x){
2407 return Math.log(x) / Math.LN2;
2413 /***/ function(module, exports, __webpack_require__) {
2415 // 20.2.2.28 Math.sign(x)
2416 var $export = __webpack_require__(8);
2418 $export($export.S, 'Math', {sign: __webpack_require__(108)});
2422 /***/ function(module, exports, __webpack_require__) {
2424 // 20.2.2.30 Math.sinh(x)
2425 var $export = __webpack_require__(8)
2426 , expm1 = __webpack_require__(112)
2429 // V8 near Chromium 38 has a problem with very small numbers
2430 $export($export.S + $export.F * __webpack_require__(7)(function(){
2431 return !Math.sinh(-2e-17) != -2e-17;
2433 sinh: function sinh(x){
2434 return Math.abs(x = +x) < 1
2435 ? (expm1(x) - expm1(-x)) / 2
2436 : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
2442 /***/ function(module, exports, __webpack_require__) {
2444 // 20.2.2.33 Math.tanh(x)
2445 var $export = __webpack_require__(8)
2446 , expm1 = __webpack_require__(112)
2449 $export($export.S, 'Math', {
2450 tanh: function tanh(x){
2451 var a = expm1(x = +x)
2453 return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
2459 /***/ function(module, exports, __webpack_require__) {
2461 // 20.2.2.34 Math.trunc(x)
2462 var $export = __webpack_require__(8);
2464 $export($export.S, 'Math', {
2465 trunc: function trunc(it){
2466 return (it > 0 ? Math.floor : Math.ceil)(it);
2472 /***/ function(module, exports, __webpack_require__) {
2474 var $export = __webpack_require__(8)
2475 , toIndex = __webpack_require__(39)
2476 , fromCharCode = String.fromCharCode
2477 , $fromCodePoint = String.fromCodePoint;
2479 // length should be 1, old FF problem
2480 $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
2481 // 21.1.2.2 String.fromCodePoint(...codePoints)
2482 fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars
2484 , aLen = arguments.length
2488 code = +arguments[i++];
2489 if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');
2490 res.push(code < 0x10000
2491 ? fromCharCode(code)
2492 : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
2494 } return res.join('');
2500 /***/ function(module, exports, __webpack_require__) {
2502 var $export = __webpack_require__(8)
2503 , toIObject = __webpack_require__(32)
2504 , toLength = __webpack_require__(37);
2506 $export($export.S, 'String', {
2507 // 21.1.2.4 String.raw(callSite, ...substitutions)
2508 raw: function raw(callSite){
2509 var tpl = toIObject(callSite.raw)
2510 , len = toLength(tpl.length)
2511 , aLen = arguments.length
2515 res.push(String(tpl[i++]));
2516 if(i < aLen)res.push(String(arguments[i]));
2517 } return res.join('');
2523 /***/ function(module, exports, __webpack_require__) {
2526 // 21.1.3.25 String.prototype.trim()
2527 __webpack_require__(83)('trim', function($trim){
2528 return function trim(){
2529 return $trim(this, 3);
2535 /***/ function(module, exports, __webpack_require__) {
2538 var $at = __webpack_require__(127)(true);
2540 // 21.1.3.27 String.prototype[@@iterator]()
2541 __webpack_require__(128)(String, 'String', function(iterated){
2542 this._t = String(iterated); // target
2543 this._i = 0; // next index
2544 // 21.1.5.2.1 %StringIteratorPrototype%.next()
2549 if(index >= O.length)return {value: undefined, done: true};
2550 point = $at(O, index);
2551 this._i += point.length;
2552 return {value: point, done: false};
2557 /***/ function(module, exports, __webpack_require__) {
2559 var toInteger = __webpack_require__(38)
2560 , defined = __webpack_require__(35);
2561 // true -> String#at
2562 // false -> String#codePointAt
2563 module.exports = function(TO_STRING){
2564 return function(that, pos){
2565 var s = String(defined(that))
2566 , i = toInteger(pos)
2569 if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
2570 a = s.charCodeAt(i);
2571 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
2572 ? TO_STRING ? s.charAt(i) : a
2573 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
2579 /***/ function(module, exports, __webpack_require__) {
2582 var LIBRARY = __webpack_require__(28)
2583 , $export = __webpack_require__(8)
2584 , redefine = __webpack_require__(18)
2585 , hide = __webpack_require__(10)
2586 , has = __webpack_require__(5)
2587 , Iterators = __webpack_require__(129)
2588 , $iterCreate = __webpack_require__(130)
2589 , setToStringTag = __webpack_require__(24)
2590 , getPrototypeOf = __webpack_require__(59)
2591 , ITERATOR = __webpack_require__(25)('iterator')
2592 , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
2593 , FF_ITERATOR = '@@iterator'
2595 , VALUES = 'values';
2597 var returnThis = function(){ return this; };
2599 module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
2600 $iterCreate(Constructor, NAME, next);
2601 var getMethod = function(kind){
2602 if(!BUGGY && kind in proto)return proto[kind];
2604 case KEYS: return function keys(){ return new Constructor(this, kind); };
2605 case VALUES: return function values(){ return new Constructor(this, kind); };
2606 } return function entries(){ return new Constructor(this, kind); };
2608 var TAG = NAME + ' Iterator'
2609 , DEF_VALUES = DEFAULT == VALUES
2610 , VALUES_BUG = false
2611 , proto = Base.prototype
2612 , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
2613 , $default = $native || getMethod(DEFAULT)
2614 , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
2615 , $anyNative = NAME == 'Array' ? proto.entries || $native : $native
2616 , methods, key, IteratorPrototype;
2619 IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
2620 if(IteratorPrototype !== Object.prototype){
2621 // Set @@toStringTag to native iterators
2622 setToStringTag(IteratorPrototype, TAG, true);
2623 // fix for some old engines
2624 if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
2627 // fix Array#{values, @@iterator}.name in V8 / FF
2628 if(DEF_VALUES && $native && $native.name !== VALUES){
2630 $default = function values(){ return $native.call(this); };
2633 if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
2634 hide(proto, ITERATOR, $default);
2637 Iterators[NAME] = $default;
2638 Iterators[TAG] = returnThis;
2641 values: DEF_VALUES ? $default : getMethod(VALUES),
2642 keys: IS_SET ? $default : getMethod(KEYS),
2645 if(FORCED)for(key in methods){
2646 if(!(key in proto))redefine(proto, key, methods[key]);
2647 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
2654 /***/ function(module, exports) {
2656 module.exports = {};
2660 /***/ function(module, exports, __webpack_require__) {
2663 var create = __webpack_require__(46)
2664 , descriptor = __webpack_require__(17)
2665 , setToStringTag = __webpack_require__(24)
2666 , IteratorPrototype = {};
2668 // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
2669 __webpack_require__(10)(IteratorPrototype, __webpack_require__(25)('iterator'), function(){ return this; });
2671 module.exports = function(Constructor, NAME, next){
2672 Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
2673 setToStringTag(Constructor, NAME + ' Iterator');
2678 /***/ function(module, exports, __webpack_require__) {
2681 var $export = __webpack_require__(8)
2682 , $at = __webpack_require__(127)(false);
2683 $export($export.P, 'String', {
2684 // 21.1.3.3 String.prototype.codePointAt(pos)
2685 codePointAt: function codePointAt(pos){
2686 return $at(this, pos);
2692 /***/ function(module, exports, __webpack_require__) {
2694 // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
2696 var $export = __webpack_require__(8)
2697 , toLength = __webpack_require__(37)
2698 , context = __webpack_require__(133)
2699 , ENDS_WITH = 'endsWith'
2700 , $endsWith = ''[ENDS_WITH];
2702 $export($export.P + $export.F * __webpack_require__(135)(ENDS_WITH), 'String', {
2703 endsWith: function endsWith(searchString /*, endPosition = @length */){
2704 var that = context(this, searchString, ENDS_WITH)
2705 , endPosition = arguments.length > 1 ? arguments[1] : undefined
2706 , len = toLength(that.length)
2707 , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len)
2708 , search = String(searchString);
2710 ? $endsWith.call(that, search, end)
2711 : that.slice(end - search.length, end) === search;
2717 /***/ function(module, exports, __webpack_require__) {
2719 // helper for String#{startsWith, endsWith, includes}
2720 var isRegExp = __webpack_require__(134)
2721 , defined = __webpack_require__(35);
2723 module.exports = function(that, searchString, NAME){
2724 if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!");
2725 return String(defined(that));
2730 /***/ function(module, exports, __webpack_require__) {
2732 // 7.2.8 IsRegExp(argument)
2733 var isObject = __webpack_require__(13)
2734 , cof = __webpack_require__(34)
2735 , MATCH = __webpack_require__(25)('match');
2736 module.exports = function(it){
2738 return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
2743 /***/ function(module, exports, __webpack_require__) {
2745 var MATCH = __webpack_require__(25)('match');
2746 module.exports = function(KEY){
2753 return !'/./'[KEY](re);
2754 } catch(f){ /* empty */ }
2760 /***/ function(module, exports, __webpack_require__) {
2762 // 21.1.3.7 String.prototype.includes(searchString, position = 0)
2764 var $export = __webpack_require__(8)
2765 , context = __webpack_require__(133)
2766 , INCLUDES = 'includes';
2768 $export($export.P + $export.F * __webpack_require__(135)(INCLUDES), 'String', {
2769 includes: function includes(searchString /*, position = 0 */){
2770 return !!~context(this, searchString, INCLUDES)
2771 .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
2777 /***/ function(module, exports, __webpack_require__) {
2779 var $export = __webpack_require__(8);
2781 $export($export.P, 'String', {
2782 // 21.1.3.13 String.prototype.repeat(count)
2783 repeat: __webpack_require__(91)
2788 /***/ function(module, exports, __webpack_require__) {
2790 // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
2792 var $export = __webpack_require__(8)
2793 , toLength = __webpack_require__(37)
2794 , context = __webpack_require__(133)
2795 , STARTS_WITH = 'startsWith'
2796 , $startsWith = ''[STARTS_WITH];
2798 $export($export.P + $export.F * __webpack_require__(135)(STARTS_WITH), 'String', {
2799 startsWith: function startsWith(searchString /*, position = 0 */){
2800 var that = context(this, searchString, STARTS_WITH)
2801 , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length))
2802 , search = String(searchString);
2804 ? $startsWith.call(that, search, index)
2805 : that.slice(index, index + search.length) === search;
2811 /***/ function(module, exports, __webpack_require__) {
2814 // B.2.3.2 String.prototype.anchor(name)
2815 __webpack_require__(140)('anchor', function(createHTML){
2816 return function anchor(name){
2817 return createHTML(this, 'a', 'name', name);
2823 /***/ function(module, exports, __webpack_require__) {
2825 var $export = __webpack_require__(8)
2826 , fails = __webpack_require__(7)
2827 , defined = __webpack_require__(35)
2829 // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
2830 var createHTML = function(string, tag, attribute, value) {
2831 var S = String(defined(string))
2833 if(attribute !== '')p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"';
2834 return p1 + '>' + S + '</' + tag + '>';
2836 module.exports = function(NAME, exec){
2838 O[NAME] = exec(createHTML);
2839 $export($export.P + $export.F * fails(function(){
2840 var test = ''[NAME]('"');
2841 return test !== test.toLowerCase() || test.split('"').length > 3;
2847 /***/ function(module, exports, __webpack_require__) {
2850 // B.2.3.3 String.prototype.big()
2851 __webpack_require__(140)('big', function(createHTML){
2852 return function big(){
2853 return createHTML(this, 'big', '', '');
2859 /***/ function(module, exports, __webpack_require__) {
2862 // B.2.3.4 String.prototype.blink()
2863 __webpack_require__(140)('blink', function(createHTML){
2864 return function blink(){
2865 return createHTML(this, 'blink', '', '');
2871 /***/ function(module, exports, __webpack_require__) {
2874 // B.2.3.5 String.prototype.bold()
2875 __webpack_require__(140)('bold', function(createHTML){
2876 return function bold(){
2877 return createHTML(this, 'b', '', '');
2883 /***/ function(module, exports, __webpack_require__) {
2886 // B.2.3.6 String.prototype.fixed()
2887 __webpack_require__(140)('fixed', function(createHTML){
2888 return function fixed(){
2889 return createHTML(this, 'tt', '', '');
2895 /***/ function(module, exports, __webpack_require__) {
2898 // B.2.3.7 String.prototype.fontcolor(color)
2899 __webpack_require__(140)('fontcolor', function(createHTML){
2900 return function fontcolor(color){
2901 return createHTML(this, 'font', 'color', color);
2907 /***/ function(module, exports, __webpack_require__) {
2910 // B.2.3.8 String.prototype.fontsize(size)
2911 __webpack_require__(140)('fontsize', function(createHTML){
2912 return function fontsize(size){
2913 return createHTML(this, 'font', 'size', size);
2919 /***/ function(module, exports, __webpack_require__) {
2922 // B.2.3.9 String.prototype.italics()
2923 __webpack_require__(140)('italics', function(createHTML){
2924 return function italics(){
2925 return createHTML(this, 'i', '', '');
2931 /***/ function(module, exports, __webpack_require__) {
2934 // B.2.3.10 String.prototype.link(url)
2935 __webpack_require__(140)('link', function(createHTML){
2936 return function link(url){
2937 return createHTML(this, 'a', 'href', url);
2943 /***/ function(module, exports, __webpack_require__) {
2946 // B.2.3.11 String.prototype.small()
2947 __webpack_require__(140)('small', function(createHTML){
2948 return function small(){
2949 return createHTML(this, 'small', '', '');
2955 /***/ function(module, exports, __webpack_require__) {
2958 // B.2.3.12 String.prototype.strike()
2959 __webpack_require__(140)('strike', function(createHTML){
2960 return function strike(){
2961 return createHTML(this, 'strike', '', '');
2967 /***/ function(module, exports, __webpack_require__) {
2970 // B.2.3.13 String.prototype.sub()
2971 __webpack_require__(140)('sub', function(createHTML){
2972 return function sub(){
2973 return createHTML(this, 'sub', '', '');
2979 /***/ function(module, exports, __webpack_require__) {
2982 // B.2.3.14 String.prototype.sup()
2983 __webpack_require__(140)('sup', function(createHTML){
2984 return function sup(){
2985 return createHTML(this, 'sup', '', '');
2991 /***/ function(module, exports, __webpack_require__) {
2993 // 20.3.3.1 / 15.9.4.4 Date.now()
2994 var $export = __webpack_require__(8);
2996 $export($export.S, 'Date', {now: function(){ return new Date().getTime(); }});
3000 /***/ function(module, exports, __webpack_require__) {
3003 var $export = __webpack_require__(8)
3004 , toObject = __webpack_require__(58)
3005 , toPrimitive = __webpack_require__(16);
3007 $export($export.P + $export.F * __webpack_require__(7)(function(){
3008 return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
3010 toJSON: function toJSON(key){
3011 var O = toObject(this)
3012 , pv = toPrimitive(O);
3013 return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
3019 /***/ function(module, exports, __webpack_require__) {
3022 // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
3023 var $export = __webpack_require__(8)
3024 , fails = __webpack_require__(7)
3025 , getTime = Date.prototype.getTime;
3027 var lz = function(num){
3028 return num > 9 ? num : '0' + num;
3031 // PhantomJS / old WebKit has a broken implementations
3032 $export($export.P + $export.F * (fails(function(){
3033 return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z';
3034 }) || !fails(function(){
3035 new Date(NaN).toISOString();
3037 toISOString: function toISOString(){
3038 if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value');
3040 , y = d.getUTCFullYear()
3041 , m = d.getUTCMilliseconds()
3042 , s = y < 0 ? '-' : y > 9999 ? '+' : '';
3043 return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
3044 '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
3045 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
3046 ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
3052 /***/ function(module, exports, __webpack_require__) {
3054 var DateProto = Date.prototype
3055 , INVALID_DATE = 'Invalid Date'
3056 , TO_STRING = 'toString'
3057 , $toString = DateProto[TO_STRING]
3058 , getTime = DateProto.getTime;
3059 if(new Date(NaN) + '' != INVALID_DATE){
3060 __webpack_require__(18)(DateProto, TO_STRING, function toString(){
3061 var value = getTime.call(this);
3062 return value === value ? $toString.call(this) : INVALID_DATE;
3068 /***/ function(module, exports, __webpack_require__) {
3070 var TO_PRIMITIVE = __webpack_require__(25)('toPrimitive')
3071 , proto = Date.prototype;
3073 if(!(TO_PRIMITIVE in proto))__webpack_require__(10)(proto, TO_PRIMITIVE, __webpack_require__(158));
3077 /***/ function(module, exports, __webpack_require__) {
3080 var anObject = __webpack_require__(12)
3081 , toPrimitive = __webpack_require__(16)
3082 , NUMBER = 'number';
3084 module.exports = function(hint){
3085 if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint');
3086 return toPrimitive(anObject(this), hint != NUMBER);
3091 /***/ function(module, exports, __webpack_require__) {
3093 // 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
3094 var $export = __webpack_require__(8);
3096 $export($export.S, 'Array', {isArray: __webpack_require__(45)});
3100 /***/ function(module, exports, __webpack_require__) {
3103 var ctx = __webpack_require__(20)
3104 , $export = __webpack_require__(8)
3105 , toObject = __webpack_require__(58)
3106 , call = __webpack_require__(161)
3107 , isArrayIter = __webpack_require__(162)
3108 , toLength = __webpack_require__(37)
3109 , createProperty = __webpack_require__(163)
3110 , getIterFn = __webpack_require__(164);
3112 $export($export.S + $export.F * !__webpack_require__(165)(function(iter){ Array.from(iter); }), 'Array', {
3113 // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
3114 from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
3115 var O = toObject(arrayLike)
3116 , C = typeof this == 'function' ? this : Array
3117 , aLen = arguments.length
3118 , mapfn = aLen > 1 ? arguments[1] : undefined
3119 , mapping = mapfn !== undefined
3121 , iterFn = getIterFn(O)
3122 , length, result, step, iterator;
3123 if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
3124 // if object isn't iterable or it's array with default iterator - use simple case
3125 if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){
3126 for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){
3127 createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
3130 length = toLength(O.length);
3131 for(result = new C(length); length > index; index++){
3132 createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
3135 result.length = index;
3143 /***/ function(module, exports, __webpack_require__) {
3145 // call something on iterator step with safe closing on error
3146 var anObject = __webpack_require__(12);
3147 module.exports = function(iterator, fn, value, entries){
3149 return entries ? fn(anObject(value)[0], value[1]) : fn(value);
3150 // 7.4.6 IteratorClose(iterator, completion)
3152 var ret = iterator['return'];
3153 if(ret !== undefined)anObject(ret.call(iterator));
3160 /***/ function(module, exports, __webpack_require__) {
3162 // check on default Array iterator
3163 var Iterators = __webpack_require__(129)
3164 , ITERATOR = __webpack_require__(25)('iterator')
3165 , ArrayProto = Array.prototype;
3167 module.exports = function(it){
3168 return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
3173 /***/ function(module, exports, __webpack_require__) {
3176 var $defineProperty = __webpack_require__(11)
3177 , createDesc = __webpack_require__(17);
3179 module.exports = function(object, index, value){
3180 if(index in object)$defineProperty.f(object, index, createDesc(0, value));
3181 else object[index] = value;
3186 /***/ function(module, exports, __webpack_require__) {
3188 var classof = __webpack_require__(75)
3189 , ITERATOR = __webpack_require__(25)('iterator')
3190 , Iterators = __webpack_require__(129);
3191 module.exports = __webpack_require__(9).getIteratorMethod = function(it){
3192 if(it != undefined)return it[ITERATOR]
3194 || Iterators[classof(it)];
3199 /***/ function(module, exports, __webpack_require__) {
3201 var ITERATOR = __webpack_require__(25)('iterator')
3202 , SAFE_CLOSING = false;
3205 var riter = [7][ITERATOR]();
3206 riter['return'] = function(){ SAFE_CLOSING = true; };
3207 Array.from(riter, function(){ throw 2; });
3208 } catch(e){ /* empty */ }
3210 module.exports = function(exec, skipClosing){
3211 if(!skipClosing && !SAFE_CLOSING)return false;
3215 , iter = arr[ITERATOR]();
3216 iter.next = function(){ return {done: safe = true}; };
3217 arr[ITERATOR] = function(){ return iter; };
3219 } catch(e){ /* empty */ }
3225 /***/ function(module, exports, __webpack_require__) {
3228 var $export = __webpack_require__(8)
3229 , createProperty = __webpack_require__(163);
3231 // WebKit Array.of isn't generic
3232 $export($export.S + $export.F * __webpack_require__(7)(function(){
3234 return !(Array.of.call(F) instanceof F);
3236 // 22.1.2.3 Array.of( ...items)
3237 of: function of(/* ...args */){
3239 , aLen = arguments.length
3240 , result = new (typeof this == 'function' ? this : Array)(aLen);
3241 while(aLen > index)createProperty(result, index, arguments[index++]);
3242 result.length = aLen;
3249 /***/ function(module, exports, __webpack_require__) {
3252 // 22.1.3.13 Array.prototype.join(separator)
3253 var $export = __webpack_require__(8)
3254 , toIObject = __webpack_require__(32)
3255 , arrayJoin = [].join;
3257 // fallback for not array-like strings
3258 $export($export.P + $export.F * (__webpack_require__(33) != Object || !__webpack_require__(168)(arrayJoin)), 'Array', {
3259 join: function join(separator){
3260 return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
3266 /***/ function(module, exports, __webpack_require__) {
3268 var fails = __webpack_require__(7);
3270 module.exports = function(method, arg){
3271 return !!method && fails(function(){
3272 arg ? method.call(null, function(){}, 1) : method.call(null);
3278 /***/ function(module, exports, __webpack_require__) {
3281 var $export = __webpack_require__(8)
3282 , html = __webpack_require__(48)
3283 , cof = __webpack_require__(34)
3284 , toIndex = __webpack_require__(39)
3285 , toLength = __webpack_require__(37)
3286 , arraySlice = [].slice;
3288 // fallback for not array-like ES3 strings and DOM objects
3289 $export($export.P + $export.F * __webpack_require__(7)(function(){
3290 if(html)arraySlice.call(html);
3292 slice: function slice(begin, end){
3293 var len = toLength(this.length)
3294 , klass = cof(this);
3295 end = end === undefined ? len : end;
3296 if(klass == 'Array')return arraySlice.call(this, begin, end);
3297 var start = toIndex(begin, len)
3298 , upTo = toIndex(end, len)
3299 , size = toLength(upTo - start)
3300 , cloned = Array(size)
3302 for(; i < size; i++)cloned[i] = klass == 'String'
3303 ? this.charAt(start + i)
3311 /***/ function(module, exports, __webpack_require__) {
3314 var $export = __webpack_require__(8)
3315 , aFunction = __webpack_require__(21)
3316 , toObject = __webpack_require__(58)
3317 , fails = __webpack_require__(7)
3321 $export($export.P + $export.F * (fails(function(){
3323 test.sort(undefined);
3324 }) || !fails(function(){
3328 }) || !__webpack_require__(168)($sort)), 'Array', {
3329 // 22.1.3.25 Array.prototype.sort(comparefn)
3330 sort: function sort(comparefn){
3331 return comparefn === undefined
3332 ? $sort.call(toObject(this))
3333 : $sort.call(toObject(this), aFunction(comparefn));
3339 /***/ function(module, exports, __webpack_require__) {
3342 var $export = __webpack_require__(8)
3343 , $forEach = __webpack_require__(172)(0)
3344 , STRICT = __webpack_require__(168)([].forEach, true);
3346 $export($export.P + $export.F * !STRICT, 'Array', {
3347 // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
3348 forEach: function forEach(callbackfn /* , thisArg */){
3349 return $forEach(this, callbackfn, arguments[1]);
3355 /***/ function(module, exports, __webpack_require__) {
3357 // 0 -> Array#forEach
3359 // 2 -> Array#filter
3363 // 6 -> Array#findIndex
3364 var ctx = __webpack_require__(20)
3365 , IObject = __webpack_require__(33)
3366 , toObject = __webpack_require__(58)
3367 , toLength = __webpack_require__(37)
3368 , asc = __webpack_require__(173);
3369 module.exports = function(TYPE, $create){
3370 var IS_MAP = TYPE == 1
3371 , IS_FILTER = TYPE == 2
3372 , IS_SOME = TYPE == 3
3373 , IS_EVERY = TYPE == 4
3374 , IS_FIND_INDEX = TYPE == 6
3375 , NO_HOLES = TYPE == 5 || IS_FIND_INDEX
3376 , create = $create || asc;
3377 return function($this, callbackfn, that){
3378 var O = toObject($this)
3380 , f = ctx(callbackfn, that, 3)
3381 , length = toLength(self.length)
3383 , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined
3385 for(;length > index; index++)if(NO_HOLES || index in self){
3387 res = f(val, index, O);
3389 if(IS_MAP)result[index] = res; // map
3390 else if(res)switch(TYPE){
3391 case 3: return true; // some
3392 case 5: return val; // find
3393 case 6: return index; // findIndex
3394 case 2: result.push(val); // filter
3395 } else if(IS_EVERY)return false; // every
3398 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
3404 /***/ function(module, exports, __webpack_require__) {
3406 // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
3407 var speciesConstructor = __webpack_require__(174);
3409 module.exports = function(original, length){
3410 return new (speciesConstructor(original))(length);
3415 /***/ function(module, exports, __webpack_require__) {
3417 var isObject = __webpack_require__(13)
3418 , isArray = __webpack_require__(45)
3419 , SPECIES = __webpack_require__(25)('species');
3421 module.exports = function(original){
3423 if(isArray(original)){
3424 C = original.constructor;
3425 // cross-realm fallback
3426 if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;
3429 if(C === null)C = undefined;
3431 } return C === undefined ? Array : C;
3436 /***/ function(module, exports, __webpack_require__) {
3439 var $export = __webpack_require__(8)
3440 , $map = __webpack_require__(172)(1);
3442 $export($export.P + $export.F * !__webpack_require__(168)([].map, true), 'Array', {
3443 // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
3444 map: function map(callbackfn /* , thisArg */){
3445 return $map(this, callbackfn, arguments[1]);
3451 /***/ function(module, exports, __webpack_require__) {
3454 var $export = __webpack_require__(8)
3455 , $filter = __webpack_require__(172)(2);
3457 $export($export.P + $export.F * !__webpack_require__(168)([].filter, true), 'Array', {
3458 // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
3459 filter: function filter(callbackfn /* , thisArg */){
3460 return $filter(this, callbackfn, arguments[1]);
3466 /***/ function(module, exports, __webpack_require__) {
3469 var $export = __webpack_require__(8)
3470 , $some = __webpack_require__(172)(3);
3472 $export($export.P + $export.F * !__webpack_require__(168)([].some, true), 'Array', {
3473 // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
3474 some: function some(callbackfn /* , thisArg */){
3475 return $some(this, callbackfn, arguments[1]);
3481 /***/ function(module, exports, __webpack_require__) {
3484 var $export = __webpack_require__(8)
3485 , $every = __webpack_require__(172)(4);
3487 $export($export.P + $export.F * !__webpack_require__(168)([].every, true), 'Array', {
3488 // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
3489 every: function every(callbackfn /* , thisArg */){
3490 return $every(this, callbackfn, arguments[1]);
3496 /***/ function(module, exports, __webpack_require__) {
3499 var $export = __webpack_require__(8)
3500 , $reduce = __webpack_require__(180);
3502 $export($export.P + $export.F * !__webpack_require__(168)([].reduce, true), 'Array', {
3503 // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
3504 reduce: function reduce(callbackfn /* , initialValue */){
3505 return $reduce(this, callbackfn, arguments.length, arguments[1], false);
3511 /***/ function(module, exports, __webpack_require__) {
3513 var aFunction = __webpack_require__(21)
3514 , toObject = __webpack_require__(58)
3515 , IObject = __webpack_require__(33)
3516 , toLength = __webpack_require__(37);
3518 module.exports = function(that, callbackfn, aLen, memo, isRight){
3519 aFunction(callbackfn);
3520 var O = toObject(that)
3522 , length = toLength(O.length)
3523 , index = isRight ? length - 1 : 0
3524 , i = isRight ? -1 : 1;
3525 if(aLen < 2)for(;;){
3532 if(isRight ? index < 0 : length <= index){
3533 throw TypeError('Reduce of empty array with no initial value');
3536 for(;isRight ? index >= 0 : length > index; index += i)if(index in self){
3537 memo = callbackfn(memo, self[index], index, O);
3544 /***/ function(module, exports, __webpack_require__) {
3547 var $export = __webpack_require__(8)
3548 , $reduce = __webpack_require__(180);
3550 $export($export.P + $export.F * !__webpack_require__(168)([].reduceRight, true), 'Array', {
3551 // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
3552 reduceRight: function reduceRight(callbackfn /* , initialValue */){
3553 return $reduce(this, callbackfn, arguments.length, arguments[1], true);
3559 /***/ function(module, exports, __webpack_require__) {
3562 var $export = __webpack_require__(8)
3563 , $indexOf = __webpack_require__(36)(false)
3564 , $native = [].indexOf
3565 , NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
3567 $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(168)($native)), 'Array', {
3568 // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
3569 indexOf: function indexOf(searchElement /*, fromIndex = 0 */){
3570 return NEGATIVE_ZERO
3572 ? $native.apply(this, arguments) || 0
3573 : $indexOf(this, searchElement, arguments[1]);
3579 /***/ function(module, exports, __webpack_require__) {
3582 var $export = __webpack_require__(8)
3583 , toIObject = __webpack_require__(32)
3584 , toInteger = __webpack_require__(38)
3585 , toLength = __webpack_require__(37)
3586 , $native = [].lastIndexOf
3587 , NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
3589 $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(168)($native)), 'Array', {
3590 // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
3591 lastIndexOf: function lastIndexOf(searchElement /*, fromIndex = @[*-1] */){
3593 if(NEGATIVE_ZERO)return $native.apply(this, arguments) || 0;
3594 var O = toIObject(this)
3595 , length = toLength(O.length)
3596 , index = length - 1;
3597 if(arguments.length > 1)index = Math.min(index, toInteger(arguments[1]));
3598 if(index < 0)index = length + index;
3599 for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index || 0;
3606 /***/ function(module, exports, __webpack_require__) {
3608 // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
3609 var $export = __webpack_require__(8);
3611 $export($export.P, 'Array', {copyWithin: __webpack_require__(185)});
3613 __webpack_require__(186)('copyWithin');
3617 /***/ function(module, exports, __webpack_require__) {
3619 // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
3621 var toObject = __webpack_require__(58)
3622 , toIndex = __webpack_require__(39)
3623 , toLength = __webpack_require__(37);
3625 module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){
3626 var O = toObject(this)
3627 , len = toLength(O.length)
3628 , to = toIndex(target, len)
3629 , from = toIndex(start, len)
3630 , end = arguments.length > 2 ? arguments[2] : undefined
3631 , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to)
3633 if(from < to && to < from + count){
3639 if(from in O)O[to] = O[from];
3648 /***/ function(module, exports, __webpack_require__) {
3650 // 22.1.3.31 Array.prototype[@@unscopables]
3651 var UNSCOPABLES = __webpack_require__(25)('unscopables')
3652 , ArrayProto = Array.prototype;
3653 if(ArrayProto[UNSCOPABLES] == undefined)__webpack_require__(10)(ArrayProto, UNSCOPABLES, {});
3654 module.exports = function(key){
3655 ArrayProto[UNSCOPABLES][key] = true;
3660 /***/ function(module, exports, __webpack_require__) {
3662 // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
3663 var $export = __webpack_require__(8);
3665 $export($export.P, 'Array', {fill: __webpack_require__(188)});
3667 __webpack_require__(186)('fill');
3671 /***/ function(module, exports, __webpack_require__) {
3673 // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
3675 var toObject = __webpack_require__(58)
3676 , toIndex = __webpack_require__(39)
3677 , toLength = __webpack_require__(37);
3678 module.exports = function fill(value /*, start = 0, end = @length */){
3679 var O = toObject(this)
3680 , length = toLength(O.length)
3681 , aLen = arguments.length
3682 , index = toIndex(aLen > 1 ? arguments[1] : undefined, length)
3683 , end = aLen > 2 ? arguments[2] : undefined
3684 , endPos = end === undefined ? length : toIndex(end, length);
3685 while(endPos > index)O[index++] = value;
3691 /***/ function(module, exports, __webpack_require__) {
3694 // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
3695 var $export = __webpack_require__(8)
3696 , $find = __webpack_require__(172)(5)
3699 // Shouldn't skip holes
3700 if(KEY in [])Array(1)[KEY](function(){ forced = false; });
3701 $export($export.P + $export.F * forced, 'Array', {
3702 find: function find(callbackfn/*, that = undefined */){
3703 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3706 __webpack_require__(186)(KEY);
3710 /***/ function(module, exports, __webpack_require__) {
3713 // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
3714 var $export = __webpack_require__(8)
3715 , $find = __webpack_require__(172)(6)
3718 // Shouldn't skip holes
3719 if(KEY in [])Array(1)[KEY](function(){ forced = false; });
3720 $export($export.P + $export.F * forced, 'Array', {
3721 findIndex: function findIndex(callbackfn/*, that = undefined */){
3722 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3725 __webpack_require__(186)(KEY);
3729 /***/ function(module, exports, __webpack_require__) {
3731 __webpack_require__(192)('Array');
3735 /***/ function(module, exports, __webpack_require__) {
3738 var global = __webpack_require__(4)
3739 , dP = __webpack_require__(11)
3740 , DESCRIPTORS = __webpack_require__(6)
3741 , SPECIES = __webpack_require__(25)('species');
3743 module.exports = function(KEY){
3744 var C = global[KEY];
3745 if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {
3747 get: function(){ return this; }
3753 /***/ function(module, exports, __webpack_require__) {
3756 var addToUnscopables = __webpack_require__(186)
3757 , step = __webpack_require__(194)
3758 , Iterators = __webpack_require__(129)
3759 , toIObject = __webpack_require__(32);
3761 // 22.1.3.4 Array.prototype.entries()
3762 // 22.1.3.13 Array.prototype.keys()
3763 // 22.1.3.29 Array.prototype.values()
3764 // 22.1.3.30 Array.prototype[@@iterator]()
3765 module.exports = __webpack_require__(128)(Array, 'Array', function(iterated, kind){
3766 this._t = toIObject(iterated); // target
3767 this._i = 0; // next index
3768 this._k = kind; // kind
3769 // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
3773 , index = this._i++;
3774 if(!O || index >= O.length){
3775 this._t = undefined;
3778 if(kind == 'keys' )return step(0, index);
3779 if(kind == 'values')return step(0, O[index]);
3780 return step(0, [index, O[index]]);
3783 // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
3784 Iterators.Arguments = Iterators.Array;
3786 addToUnscopables('keys');
3787 addToUnscopables('values');
3788 addToUnscopables('entries');
3792 /***/ function(module, exports) {
3794 module.exports = function(done, value){
3795 return {value: value, done: !!done};
3800 /***/ function(module, exports, __webpack_require__) {
3802 var global = __webpack_require__(4)
3803 , inheritIfRequired = __webpack_require__(88)
3804 , dP = __webpack_require__(11).f
3805 , gOPN = __webpack_require__(50).f
3806 , isRegExp = __webpack_require__(134)
3807 , $flags = __webpack_require__(196)
3808 , $RegExp = global.RegExp
3810 , proto = $RegExp.prototype
3813 // "new" creates a new object, old webkit buggy here
3814 , CORRECT_NEW = new $RegExp(re1) !== re1;
3816 if(__webpack_require__(6) && (!CORRECT_NEW || __webpack_require__(7)(function(){
3817 re2[__webpack_require__(25)('match')] = false;
3818 // RegExp constructor can alter flags and IsRegExp works correct with @@match
3819 return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
3821 $RegExp = function RegExp(p, f){
3822 var tiRE = this instanceof $RegExp
3823 , piRE = isRegExp(p)
3824 , fiU = f === undefined;
3825 return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
3826 : inheritIfRequired(CORRECT_NEW
3827 ? new Base(piRE && !fiU ? p.source : p, f)
3828 : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
3829 , tiRE ? this : proto, $RegExp);
3831 var proxy = function(key){
3832 key in $RegExp || dP($RegExp, key, {
3834 get: function(){ return Base[key]; },
3835 set: function(it){ Base[key] = it; }
3838 for(var keys = gOPN(Base), i = 0; keys.length > i; )proxy(keys[i++]);
3839 proto.constructor = $RegExp;
3840 $RegExp.prototype = proto;
3841 __webpack_require__(18)(global, 'RegExp', $RegExp);
3844 __webpack_require__(192)('RegExp');
3848 /***/ function(module, exports, __webpack_require__) {
3851 // 21.2.5.3 get RegExp.prototype.flags
3852 var anObject = __webpack_require__(12);
3853 module.exports = function(){
3854 var that = anObject(this)
3856 if(that.global) result += 'g';
3857 if(that.ignoreCase) result += 'i';
3858 if(that.multiline) result += 'm';
3859 if(that.unicode) result += 'u';
3860 if(that.sticky) result += 'y';
3866 /***/ function(module, exports, __webpack_require__) {
3869 __webpack_require__(198);
3870 var anObject = __webpack_require__(12)
3871 , $flags = __webpack_require__(196)
3872 , DESCRIPTORS = __webpack_require__(6)
3873 , TO_STRING = 'toString'
3874 , $toString = /./[TO_STRING];
3876 var define = function(fn){
3877 __webpack_require__(18)(RegExp.prototype, TO_STRING, fn, true);
3880 // 21.2.5.14 RegExp.prototype.toString()
3881 if(__webpack_require__(7)(function(){ return $toString.call({source: 'a', flags: 'b'}) != '/a/b'; })){
3882 define(function toString(){
3883 var R = anObject(this);
3884 return '/'.concat(R.source, '/',
3885 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
3887 // FF44- RegExp#toString has a wrong name
3888 } else if($toString.name != TO_STRING){
3889 define(function toString(){
3890 return $toString.call(this);
3896 /***/ function(module, exports, __webpack_require__) {
3898 // 21.2.5.3 get RegExp.prototype.flags()
3899 if(__webpack_require__(6) && /./g.flags != 'g')__webpack_require__(11).f(RegExp.prototype, 'flags', {
3901 get: __webpack_require__(196)
3906 /***/ function(module, exports, __webpack_require__) {
3909 __webpack_require__(200)('match', 1, function(defined, MATCH, $match){
3910 // 21.1.3.11 String.prototype.match(regexp)
3911 return [function match(regexp){
3913 var O = defined(this)
3914 , fn = regexp == undefined ? undefined : regexp[MATCH];
3915 return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
3921 /***/ function(module, exports, __webpack_require__) {
3924 var hide = __webpack_require__(10)
3925 , redefine = __webpack_require__(18)
3926 , fails = __webpack_require__(7)
3927 , defined = __webpack_require__(35)
3928 , wks = __webpack_require__(25);
3930 module.exports = function(KEY, length, exec){
3931 var SYMBOL = wks(KEY)
3932 , fns = exec(defined, SYMBOL, ''[KEY])
3935 if(fails(function(){
3937 O[SYMBOL] = function(){ return 7; };
3938 return ''[KEY](O) != 7;
3940 redefine(String.prototype, KEY, strfn);
3941 hide(RegExp.prototype, SYMBOL, length == 2
3942 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
3943 // 21.2.5.11 RegExp.prototype[@@split](string, limit)
3944 ? function(string, arg){ return rxfn.call(string, this, arg); }
3945 // 21.2.5.6 RegExp.prototype[@@match](string)
3946 // 21.2.5.9 RegExp.prototype[@@search](string)
3947 : function(string){ return rxfn.call(string, this); }
3954 /***/ function(module, exports, __webpack_require__) {
3957 __webpack_require__(200)('replace', 2, function(defined, REPLACE, $replace){
3958 // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)
3959 return [function replace(searchValue, replaceValue){
3961 var O = defined(this)
3962 , fn = searchValue == undefined ? undefined : searchValue[REPLACE];
3963 return fn !== undefined
3964 ? fn.call(searchValue, O, replaceValue)
3965 : $replace.call(String(O), searchValue, replaceValue);
3971 /***/ function(module, exports, __webpack_require__) {
3974 __webpack_require__(200)('search', 1, function(defined, SEARCH, $search){
3975 // 21.1.3.15 String.prototype.search(regexp)
3976 return [function search(regexp){
3978 var O = defined(this)
3979 , fn = regexp == undefined ? undefined : regexp[SEARCH];
3980 return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
3986 /***/ function(module, exports, __webpack_require__) {
3989 __webpack_require__(200)('split', 2, function(defined, SPLIT, $split){
3991 var isRegExp = __webpack_require__(134)
3996 , LAST_INDEX = 'lastIndex';
3998 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
3999 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
4000 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
4001 '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
4002 '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
4003 ''[$SPLIT](/.?/)[LENGTH]
4005 var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group
4006 // based on es5-shim implementation, need to rework it
4007 $split = function(separator, limit){
4008 var string = String(this);
4009 if(separator === undefined && limit === 0)return [];
4010 // If `separator` is not a regex, use native split
4011 if(!isRegExp(separator))return _split.call(string, separator, limit);
4013 var flags = (separator.ignoreCase ? 'i' : '') +
4014 (separator.multiline ? 'm' : '') +
4015 (separator.unicode ? 'u' : '') +
4016 (separator.sticky ? 'y' : '');
4017 var lastLastIndex = 0;
4018 var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
4019 // Make `global` and avoid `lastIndex` issues by working with a copy
4020 var separatorCopy = new RegExp(separator.source, flags + 'g');
4021 var separator2, match, lastIndex, lastLength, i;
4022 // Doesn't need flags gy, but they don't hurt
4023 if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
4024 while(match = separatorCopy.exec(string)){
4025 // `separatorCopy.lastIndex` is not reliable cross-browser
4026 lastIndex = match.index + match[0][LENGTH];
4027 if(lastIndex > lastLastIndex){
4028 output.push(string.slice(lastLastIndex, match.index));
4029 // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG
4030 if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){
4031 for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined;
4033 if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1));
4034 lastLength = match[0][LENGTH];
4035 lastLastIndex = lastIndex;
4036 if(output[LENGTH] >= splitLimit)break;
4038 if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
4040 if(lastLastIndex === string[LENGTH]){
4041 if(lastLength || !separatorCopy.test(''))output.push('');
4042 } else output.push(string.slice(lastLastIndex));
4043 return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
4046 } else if('0'[$SPLIT](undefined, 0)[LENGTH]){
4047 $split = function(separator, limit){
4048 return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);
4051 // 21.1.3.17 String.prototype.split(separator, limit)
4052 return [function split(separator, limit){
4053 var O = defined(this)
4054 , fn = separator == undefined ? undefined : separator[SPLIT];
4055 return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);
4061 /***/ function(module, exports, __webpack_require__) {
4064 var LIBRARY = __webpack_require__(28)
4065 , global = __webpack_require__(4)
4066 , ctx = __webpack_require__(20)
4067 , classof = __webpack_require__(75)
4068 , $export = __webpack_require__(8)
4069 , isObject = __webpack_require__(13)
4070 , aFunction = __webpack_require__(21)
4071 , anInstance = __webpack_require__(205)
4072 , forOf = __webpack_require__(206)
4073 , speciesConstructor = __webpack_require__(207)
4074 , task = __webpack_require__(208).set
4075 , microtask = __webpack_require__(209)()
4076 , PROMISE = 'Promise'
4077 , TypeError = global.TypeError
4078 , process = global.process
4079 , $Promise = global[PROMISE]
4080 , process = global.process
4081 , isNode = classof(process) == 'process'
4082 , empty = function(){ /* empty */ }
4083 , Internal, GenericPromiseCapability, Wrapper;
4085 var USE_NATIVE = !!function(){
4087 // correct subclassing with @@species support
4088 var promise = $Promise.resolve(1)
4089 , FakePromise = (promise.constructor = {})[__webpack_require__(25)('species')] = function(exec){ exec(empty, empty); };
4090 // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
4091 return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
4092 } catch(e){ /* empty */ }
4096 var sameConstructor = function(a, b){
4097 // with library wrapper special case
4098 return a === b || a === $Promise && b === Wrapper;
4100 var isThenable = function(it){
4102 return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
4104 var newPromiseCapability = function(C){
4105 return sameConstructor($Promise, C)
4106 ? new PromiseCapability(C)
4107 : new GenericPromiseCapability(C);
4109 var PromiseCapability = GenericPromiseCapability = function(C){
4110 var resolve, reject;
4111 this.promise = new C(function($$resolve, $$reject){
4112 if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');
4113 resolve = $$resolve;
4116 this.resolve = aFunction(resolve);
4117 this.reject = aFunction(reject);
4119 var perform = function(exec){
4126 var notify = function(promise, isReject){
4127 if(promise._n)return;
4129 var chain = promise._c;
4130 microtask(function(){
4131 var value = promise._v
4132 , ok = promise._s == 1
4134 var run = function(reaction){
4135 var handler = ok ? reaction.ok : reaction.fail
4136 , resolve = reaction.resolve
4137 , reject = reaction.reject
4138 , domain = reaction.domain
4143 if(promise._h == 2)onHandleUnhandled(promise);
4146 if(handler === true)result = value;
4148 if(domain)domain.enter();
4149 result = handler(value);
4150 if(domain)domain.exit();
4152 if(result === reaction.promise){
4153 reject(TypeError('Promise-chain cycle'));
4154 } else if(then = isThenable(result)){
4155 then.call(result, resolve, reject);
4156 } else resolve(result);
4157 } else reject(value);
4162 while(chain.length > i)run(chain[i++]); // variable length - can't use forEach
4165 if(isReject && !promise._h)onUnhandled(promise);
4168 var onUnhandled = function(promise){
4169 task.call(global, function(){
4170 var value = promise._v
4171 , abrupt, handler, console;
4172 if(isUnhandled(promise)){
4173 abrupt = perform(function(){
4175 process.emit('unhandledRejection', value, promise);
4176 } else if(handler = global.onunhandledrejection){
4177 handler({promise: promise, reason: value});
4178 } else if((console = global.console) && console.error){
4179 console.error('Unhandled promise rejection', value);
4182 // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
4183 promise._h = isNode || isUnhandled(promise) ? 2 : 1;
4184 } promise._a = undefined;
4185 if(abrupt)throw abrupt.error;
4188 var isUnhandled = function(promise){
4189 if(promise._h == 1)return false;
4190 var chain = promise._a || promise._c
4193 while(chain.length > i){
4194 reaction = chain[i++];
4195 if(reaction.fail || !isUnhandled(reaction.promise))return false;
4198 var onHandleUnhandled = function(promise){
4199 task.call(global, function(){
4202 process.emit('rejectionHandled', promise);
4203 } else if(handler = global.onrejectionhandled){
4204 handler({promise: promise, reason: promise._v});
4208 var $reject = function(value){
4210 if(promise._d)return;
4212 promise = promise._w || promise; // unwrap
4215 if(!promise._a)promise._a = promise._c.slice();
4216 notify(promise, true);
4218 var $resolve = function(value){
4221 if(promise._d)return;
4223 promise = promise._w || promise; // unwrap
4225 if(promise === value)throw TypeError("Promise can't be resolved itself");
4226 if(then = isThenable(value)){
4227 microtask(function(){
4228 var wrapper = {_w: promise, _d: false}; // wrap
4230 then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
4232 $reject.call(wrapper, e);
4238 notify(promise, false);
4241 $reject.call({_w: promise, _d: false}, e); // wrap
4245 // constructor polyfill
4247 // 25.4.3.1 Promise(executor)
4248 $Promise = function Promise(executor){
4249 anInstance(this, $Promise, PROMISE, '_h');
4250 aFunction(executor);
4251 Internal.call(this);
4253 executor(ctx($resolve, this, 1), ctx($reject, this, 1));
4255 $reject.call(this, err);
4258 Internal = function Promise(executor){
4259 this._c = []; // <- awaiting reactions
4260 this._a = undefined; // <- checked in isUnhandled reactions
4261 this._s = 0; // <- state
4262 this._d = false; // <- done
4263 this._v = undefined; // <- value
4264 this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
4265 this._n = false; // <- notify
4267 Internal.prototype = __webpack_require__(210)($Promise.prototype, {
4268 // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
4269 then: function then(onFulfilled, onRejected){
4270 var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
4271 reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
4272 reaction.fail = typeof onRejected == 'function' && onRejected;
4273 reaction.domain = isNode ? process.domain : undefined;
4274 this._c.push(reaction);
4275 if(this._a)this._a.push(reaction);
4276 if(this._s)notify(this, false);
4277 return reaction.promise;
4279 // 25.4.5.1 Promise.prototype.catch(onRejected)
4280 'catch': function(onRejected){
4281 return this.then(undefined, onRejected);
4284 PromiseCapability = function(){
4285 var promise = new Internal;
4286 this.promise = promise;
4287 this.resolve = ctx($resolve, promise, 1);
4288 this.reject = ctx($reject, promise, 1);
4292 $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});
4293 __webpack_require__(24)($Promise, PROMISE);
4294 __webpack_require__(192)(PROMISE);
4295 Wrapper = __webpack_require__(9)[PROMISE];
4298 $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
4299 // 25.4.4.5 Promise.reject(r)
4300 reject: function reject(r){
4301 var capability = newPromiseCapability(this)
4302 , $$reject = capability.reject;
4304 return capability.promise;
4307 $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
4308 // 25.4.4.6 Promise.resolve(x)
4309 resolve: function resolve(x){
4310 // instanceof instead of internal slot check because we should fix it without replacement native Promise core
4311 if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;
4312 var capability = newPromiseCapability(this)
4313 , $$resolve = capability.resolve;
4315 return capability.promise;
4318 $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(165)(function(iter){
4319 $Promise.all(iter)['catch'](empty);
4321 // 25.4.4.1 Promise.all(iterable)
4322 all: function all(iterable){
4324 , capability = newPromiseCapability(C)
4325 , resolve = capability.resolve
4326 , reject = capability.reject;
4327 var abrupt = perform(function(){
4331 forOf(iterable, false, function(promise){
4332 var $index = index++
4333 , alreadyCalled = false;
4334 values.push(undefined);
4336 C.resolve(promise).then(function(value){
4337 if(alreadyCalled)return;
4338 alreadyCalled = true;
4339 values[$index] = value;
4340 --remaining || resolve(values);
4343 --remaining || resolve(values);
4345 if(abrupt)reject(abrupt.error);
4346 return capability.promise;
4348 // 25.4.4.4 Promise.race(iterable)
4349 race: function race(iterable){
4351 , capability = newPromiseCapability(C)
4352 , reject = capability.reject;
4353 var abrupt = perform(function(){
4354 forOf(iterable, false, function(promise){
4355 C.resolve(promise).then(capability.resolve, reject);
4358 if(abrupt)reject(abrupt.error);
4359 return capability.promise;
4365 /***/ function(module, exports) {
4367 module.exports = function(it, Constructor, name, forbiddenField){
4368 if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){
4369 throw TypeError(name + ': incorrect invocation!');
4375 /***/ function(module, exports, __webpack_require__) {
4377 var ctx = __webpack_require__(20)
4378 , call = __webpack_require__(161)
4379 , isArrayIter = __webpack_require__(162)
4380 , anObject = __webpack_require__(12)
4381 , toLength = __webpack_require__(37)
4382 , getIterFn = __webpack_require__(164)
4385 var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){
4386 var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)
4387 , f = ctx(fn, that, entries ? 2 : 1)
4389 , length, step, iterator, result;
4390 if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
4391 // fast case for arrays with default iterator
4392 if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
4393 result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
4394 if(result === BREAK || result === RETURN)return result;
4395 } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
4396 result = call(iterator, f, step.value, entries);
4397 if(result === BREAK || result === RETURN)return result;
4400 exports.BREAK = BREAK;
4401 exports.RETURN = RETURN;
4405 /***/ function(module, exports, __webpack_require__) {
4407 // 7.3.20 SpeciesConstructor(O, defaultConstructor)
4408 var anObject = __webpack_require__(12)
4409 , aFunction = __webpack_require__(21)
4410 , SPECIES = __webpack_require__(25)('species');
4411 module.exports = function(O, D){
4412 var C = anObject(O).constructor, S;
4413 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
4418 /***/ function(module, exports, __webpack_require__) {
4420 var ctx = __webpack_require__(20)
4421 , invoke = __webpack_require__(78)
4422 , html = __webpack_require__(48)
4423 , cel = __webpack_require__(15)
4424 , global = __webpack_require__(4)
4425 , process = global.process
4426 , setTask = global.setImmediate
4427 , clearTask = global.clearImmediate
4428 , MessageChannel = global.MessageChannel
4431 , ONREADYSTATECHANGE = 'onreadystatechange'
4432 , defer, channel, port;
4433 var run = function(){
4435 if(queue.hasOwnProperty(id)){
4441 var listener = function(event){
4442 run.call(event.data);
4444 // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
4445 if(!setTask || !clearTask){
4446 setTask = function setImmediate(fn){
4447 var args = [], i = 1;
4448 while(arguments.length > i)args.push(arguments[i++]);
4449 queue[++counter] = function(){
4450 invoke(typeof fn == 'function' ? fn : Function(fn), args);
4455 clearTask = function clearImmediate(id){
4459 if(__webpack_require__(34)(process) == 'process'){
4460 defer = function(id){
4461 process.nextTick(ctx(run, id, 1));
4463 // Browsers with MessageChannel, includes WebWorkers
4464 } else if(MessageChannel){
4465 channel = new MessageChannel;
4466 port = channel.port2;
4467 channel.port1.onmessage = listener;
4468 defer = ctx(port.postMessage, port, 1);
4469 // Browsers with postMessage, skip WebWorkers
4470 // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
4471 } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){
4472 defer = function(id){
4473 global.postMessage(id + '', '*');
4475 global.addEventListener('message', listener, false);
4477 } else if(ONREADYSTATECHANGE in cel('script')){
4478 defer = function(id){
4479 html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){
4480 html.removeChild(this);
4484 // Rest old browsers
4486 defer = function(id){
4487 setTimeout(ctx(run, id, 1), 0);
4498 /***/ function(module, exports, __webpack_require__) {
4500 var global = __webpack_require__(4)
4501 , macrotask = __webpack_require__(208).set
4502 , Observer = global.MutationObserver || global.WebKitMutationObserver
4503 , process = global.process
4504 , Promise = global.Promise
4505 , isNode = __webpack_require__(34)(process) == 'process';
4507 module.exports = function(){
4508 var head, last, notify;
4510 var flush = function(){
4512 if(isNode && (parent = process.domain))parent.exit();
4520 else last = undefined;
4524 if(parent)parent.enter();
4529 notify = function(){
4530 process.nextTick(flush);
4532 // browsers with MutationObserver
4533 } else if(Observer){
4535 , node = document.createTextNode('');
4536 new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new
4537 notify = function(){
4538 node.data = toggle = !toggle;
4540 // environments with maybe non-completely correct, but existent Promise
4541 } else if(Promise && Promise.resolve){
4542 var promise = Promise.resolve();
4543 notify = function(){
4544 promise.then(flush);
4546 // for other environments - macrotask based on:
4549 // - window.postMessag
4550 // - onreadystatechange
4553 notify = function(){
4554 // strange IE + webpack dev server bug - use .call(global)
4555 macrotask.call(global, flush);
4559 return function(fn){
4560 var task = {fn: fn, next: undefined};
4561 if(last)last.next = task;
4571 /***/ function(module, exports, __webpack_require__) {
4573 var redefine = __webpack_require__(18);
4574 module.exports = function(target, src, safe){
4575 for(var key in src)redefine(target, key, src[key], safe);
4581 /***/ function(module, exports, __webpack_require__) {
4584 var strong = __webpack_require__(212);
4587 module.exports = __webpack_require__(213)('Map', function(get){
4588 return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
4590 // 23.1.3.6 Map.prototype.get(key)
4591 get: function get(key){
4592 var entry = strong.getEntry(this, key);
4593 return entry && entry.v;
4595 // 23.1.3.9 Map.prototype.set(key, value)
4596 set: function set(key, value){
4597 return strong.def(this, key === 0 ? 0 : key, value);
4603 /***/ function(module, exports, __webpack_require__) {
4606 var dP = __webpack_require__(11).f
4607 , create = __webpack_require__(46)
4608 , redefineAll = __webpack_require__(210)
4609 , ctx = __webpack_require__(20)
4610 , anInstance = __webpack_require__(205)
4611 , defined = __webpack_require__(35)
4612 , forOf = __webpack_require__(206)
4613 , $iterDefine = __webpack_require__(128)
4614 , step = __webpack_require__(194)
4615 , setSpecies = __webpack_require__(192)
4616 , DESCRIPTORS = __webpack_require__(6)
4617 , fastKey = __webpack_require__(22).fastKey
4618 , SIZE = DESCRIPTORS ? '_s' : 'size';
4620 var getEntry = function(that, key){
4622 var index = fastKey(key), entry;
4623 if(index !== 'F')return that._i[index];
4624 // frozen object case
4625 for(entry = that._f; entry; entry = entry.n){
4626 if(entry.k == key)return entry;
4631 getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
4632 var C = wrapper(function(that, iterable){
4633 anInstance(that, C, NAME, '_i');
4634 that._i = create(null); // index
4635 that._f = undefined; // first entry
4636 that._l = undefined; // last entry
4637 that[SIZE] = 0; // size
4638 if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
4640 redefineAll(C.prototype, {
4641 // 23.1.3.1 Map.prototype.clear()
4642 // 23.2.3.2 Set.prototype.clear()
4643 clear: function clear(){
4644 for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){
4646 if(entry.p)entry.p = entry.p.n = undefined;
4647 delete data[entry.i];
4649 that._f = that._l = undefined;
4652 // 23.1.3.3 Map.prototype.delete(key)
4653 // 23.2.3.4 Set.prototype.delete(value)
4654 'delete': function(key){
4656 , entry = getEntry(that, key);
4660 delete that._i[entry.i];
4662 if(prev)prev.n = next;
4663 if(next)next.p = prev;
4664 if(that._f == entry)that._f = next;
4665 if(that._l == entry)that._l = prev;
4669 // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
4670 // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
4671 forEach: function forEach(callbackfn /*, that = undefined */){
4672 anInstance(this, C, 'forEach');
4673 var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3)
4675 while(entry = entry ? entry.n : this._f){
4676 f(entry.v, entry.k, this);
4677 // revert to the last existing entry
4678 while(entry && entry.r)entry = entry.p;
4681 // 23.1.3.7 Map.prototype.has(key)
4682 // 23.2.3.7 Set.prototype.has(value)
4683 has: function has(key){
4684 return !!getEntry(this, key);
4687 if(DESCRIPTORS)dP(C.prototype, 'size', {
4689 return defined(this[SIZE]);
4694 def: function(that, key, value){
4695 var entry = getEntry(that, key)
4697 // change existing entry
4703 i: index = fastKey(key, true), // <- index
4705 v: value, // <- value
4706 p: prev = that._l, // <- previous entry
4707 n: undefined, // <- next entry
4708 r: false // <- removed
4710 if(!that._f)that._f = entry;
4711 if(prev)prev.n = entry;
4714 if(index !== 'F')that._i[index] = entry;
4718 setStrong: function(C, NAME, IS_MAP){
4719 // add .keys, .values, .entries, [@@iterator]
4720 // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
4721 $iterDefine(C, NAME, function(iterated, kind){
4722 this._t = iterated; // target
4723 this._k = kind; // kind
4724 this._l = undefined; // previous
4729 // revert to the last existing entry
4730 while(entry && entry.r)entry = entry.p;
4732 if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){
4733 // or finish the iteration
4734 that._t = undefined;
4737 // return step by kind
4738 if(kind == 'keys' )return step(0, entry.k);
4739 if(kind == 'values')return step(0, entry.v);
4740 return step(0, [entry.k, entry.v]);
4741 }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);
4743 // add [@@species], 23.1.2.2, 23.2.2.2
4750 /***/ function(module, exports, __webpack_require__) {
4753 var global = __webpack_require__(4)
4754 , $export = __webpack_require__(8)
4755 , redefine = __webpack_require__(18)
4756 , redefineAll = __webpack_require__(210)
4757 , meta = __webpack_require__(22)
4758 , forOf = __webpack_require__(206)
4759 , anInstance = __webpack_require__(205)
4760 , isObject = __webpack_require__(13)
4761 , fails = __webpack_require__(7)
4762 , $iterDetect = __webpack_require__(165)
4763 , setToStringTag = __webpack_require__(24)
4764 , inheritIfRequired = __webpack_require__(88);
4766 module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){
4767 var Base = global[NAME]
4769 , ADDER = IS_MAP ? 'set' : 'add'
4770 , proto = C && C.prototype
4772 var fixMethod = function(KEY){
4773 var fn = proto[KEY];
4774 redefine(proto, KEY,
4775 KEY == 'delete' ? function(a){
4776 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
4777 } : KEY == 'has' ? function has(a){
4778 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
4779 } : KEY == 'get' ? function get(a){
4780 return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
4781 } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; }
4782 : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; }
4785 if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){
4786 new C().entries().next();
4788 // create collection constructor
4789 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
4790 redefineAll(C.prototype, methods);
4793 var instance = new C
4794 // early implementations not supports chaining
4795 , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance
4796 // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
4797 , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); })
4798 // most early implementations doesn't supports iterables, most modern - not close it correctly
4799 , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new
4800 // for early implementations -0 and +0 not the same
4801 , BUGGY_ZERO = !IS_WEAK && fails(function(){
4802 // V8 ~ Chromium 42- fails only with 5+ elements
4803 var $instance = new C()
4805 while(index--)$instance[ADDER](index, index);
4806 return !$instance.has(-0);
4808 if(!ACCEPT_ITERABLES){
4809 C = wrapper(function(target, iterable){
4810 anInstance(target, C, NAME);
4811 var that = inheritIfRequired(new Base, target, C);
4812 if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
4815 C.prototype = proto;
4816 proto.constructor = C;
4818 if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){
4819 fixMethod('delete');
4821 IS_MAP && fixMethod('get');
4823 if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER);
4824 // weak collections should not contains .clear method
4825 if(IS_WEAK && proto.clear)delete proto.clear;
4828 setToStringTag(C, NAME);
4831 $export($export.G + $export.W + $export.F * (C != Base), O);
4833 if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);
4840 /***/ function(module, exports, __webpack_require__) {
4843 var strong = __webpack_require__(212);
4846 module.exports = __webpack_require__(213)('Set', function(get){
4847 return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
4849 // 23.2.3.1 Set.prototype.add(value)
4850 add: function add(value){
4851 return strong.def(this, value = value === 0 ? 0 : value, value);
4857 /***/ function(module, exports, __webpack_require__) {
4860 var each = __webpack_require__(172)(0)
4861 , redefine = __webpack_require__(18)
4862 , meta = __webpack_require__(22)
4863 , assign = __webpack_require__(69)
4864 , weak = __webpack_require__(216)
4865 , isObject = __webpack_require__(13)
4866 , getWeak = meta.getWeak
4867 , isExtensible = Object.isExtensible
4868 , uncaughtFrozenStore = weak.ufstore
4872 var wrapper = function(get){
4873 return function WeakMap(){
4874 return get(this, arguments.length > 0 ? arguments[0] : undefined);
4879 // 23.3.3.3 WeakMap.prototype.get(key)
4880 get: function get(key){
4882 var data = getWeak(key);
4883 if(data === true)return uncaughtFrozenStore(this).get(key);
4884 return data ? data[this._i] : undefined;
4887 // 23.3.3.5 WeakMap.prototype.set(key, value)
4888 set: function set(key, value){
4889 return weak.def(this, key, value);
4893 // 23.3 WeakMap Objects
4894 var $WeakMap = module.exports = __webpack_require__(213)('WeakMap', wrapper, methods, weak, true, true);
4896 // IE11 WeakMap frozen keys fix
4897 if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){
4898 InternalMap = weak.getConstructor(wrapper);
4899 assign(InternalMap.prototype, methods);
4901 each(['delete', 'has', 'get', 'set'], function(key){
4902 var proto = $WeakMap.prototype
4903 , method = proto[key];
4904 redefine(proto, key, function(a, b){
4905 // store frozen objects on internal weakmap shim
4906 if(isObject(a) && !isExtensible(a)){
4907 if(!this._f)this._f = new InternalMap;
4908 var result = this._f[key](a, b);
4909 return key == 'set' ? this : result;
4910 // store all the rest on native weakmap
4911 } return method.call(this, a, b);
4918 /***/ function(module, exports, __webpack_require__) {
4921 var redefineAll = __webpack_require__(210)
4922 , getWeak = __webpack_require__(22).getWeak
4923 , anObject = __webpack_require__(12)
4924 , isObject = __webpack_require__(13)
4925 , anInstance = __webpack_require__(205)
4926 , forOf = __webpack_require__(206)
4927 , createArrayMethod = __webpack_require__(172)
4928 , $has = __webpack_require__(5)
4929 , arrayFind = createArrayMethod(5)
4930 , arrayFindIndex = createArrayMethod(6)
4933 // fallback for uncaught frozen keys
4934 var uncaughtFrozenStore = function(that){
4935 return that._l || (that._l = new UncaughtFrozenStore);
4937 var UncaughtFrozenStore = function(){
4940 var findUncaughtFrozen = function(store, key){
4941 return arrayFind(store.a, function(it){
4942 return it[0] === key;
4945 UncaughtFrozenStore.prototype = {
4947 var entry = findUncaughtFrozen(this, key);
4948 if(entry)return entry[1];
4951 return !!findUncaughtFrozen(this, key);
4953 set: function(key, value){
4954 var entry = findUncaughtFrozen(this, key);
4955 if(entry)entry[1] = value;
4956 else this.a.push([key, value]);
4958 'delete': function(key){
4959 var index = arrayFindIndex(this.a, function(it){
4960 return it[0] === key;
4962 if(~index)this.a.splice(index, 1);
4968 getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
4969 var C = wrapper(function(that, iterable){
4970 anInstance(that, C, NAME, '_i');
4971 that._i = id++; // collection id
4972 that._l = undefined; // leak store for uncaught frozen objects
4973 if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
4975 redefineAll(C.prototype, {
4976 // 23.3.3.2 WeakMap.prototype.delete(key)
4977 // 23.4.3.3 WeakSet.prototype.delete(value)
4978 'delete': function(key){
4979 if(!isObject(key))return false;
4980 var data = getWeak(key);
4981 if(data === true)return uncaughtFrozenStore(this)['delete'](key);
4982 return data && $has(data, this._i) && delete data[this._i];
4984 // 23.3.3.4 WeakMap.prototype.has(key)
4985 // 23.4.3.4 WeakSet.prototype.has(value)
4986 has: function has(key){
4987 if(!isObject(key))return false;
4988 var data = getWeak(key);
4989 if(data === true)return uncaughtFrozenStore(this).has(key);
4990 return data && $has(data, this._i);
4995 def: function(that, key, value){
4996 var data = getWeak(anObject(key), true);
4997 if(data === true)uncaughtFrozenStore(that).set(key, value);
4998 else data[that._i] = value;
5001 ufstore: uncaughtFrozenStore
5006 /***/ function(module, exports, __webpack_require__) {
5009 var weak = __webpack_require__(216);
5011 // 23.4 WeakSet Objects
5012 __webpack_require__(213)('WeakSet', function(get){
5013 return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
5015 // 23.4.3.1 WeakSet.prototype.add(value)
5016 add: function add(value){
5017 return weak.def(this, value, true);
5019 }, weak, false, true);
5023 /***/ function(module, exports, __webpack_require__) {
5026 var $export = __webpack_require__(8)
5027 , $typed = __webpack_require__(219)
5028 , buffer = __webpack_require__(220)
5029 , anObject = __webpack_require__(12)
5030 , toIndex = __webpack_require__(39)
5031 , toLength = __webpack_require__(37)
5032 , isObject = __webpack_require__(13)
5033 , ArrayBuffer = __webpack_require__(4).ArrayBuffer
5034 , speciesConstructor = __webpack_require__(207)
5035 , $ArrayBuffer = buffer.ArrayBuffer
5036 , $DataView = buffer.DataView
5037 , $isView = $typed.ABV && ArrayBuffer.isView
5038 , $slice = $ArrayBuffer.prototype.slice
5039 , VIEW = $typed.VIEW
5040 , ARRAY_BUFFER = 'ArrayBuffer';
5042 $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), {ArrayBuffer: $ArrayBuffer});
5044 $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
5045 // 24.1.3.1 ArrayBuffer.isView(arg)
5046 isView: function isView(it){
5047 return $isView && $isView(it) || isObject(it) && VIEW in it;
5051 $export($export.P + $export.U + $export.F * __webpack_require__(7)(function(){
5052 return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
5054 // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
5055 slice: function slice(start, end){
5056 if($slice !== undefined && end === undefined)return $slice.call(anObject(this), start); // FF fix
5057 var len = anObject(this).byteLength
5058 , first = toIndex(start, len)
5059 , final = toIndex(end === undefined ? len : end, len)
5060 , result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first))
5061 , viewS = new $DataView(this)
5062 , viewT = new $DataView(result)
5064 while(first < final){
5065 viewT.setUint8(index++, viewS.getUint8(first++));
5070 __webpack_require__(192)(ARRAY_BUFFER);
5074 /***/ function(module, exports, __webpack_require__) {
5076 var global = __webpack_require__(4)
5077 , hide = __webpack_require__(10)
5078 , uid = __webpack_require__(19)
5079 , TYPED = uid('typed_array')
5080 , VIEW = uid('view')
5081 , ABV = !!(global.ArrayBuffer && global.DataView)
5083 , i = 0, l = 9, Typed;
5085 var TypedArrayConstructors = (
5086 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
5090 if(Typed = global[TypedArrayConstructors[i++]]){
5091 hide(Typed.prototype, TYPED, true);
5092 hide(Typed.prototype, VIEW, true);
5093 } else CONSTR = false;
5105 /***/ function(module, exports, __webpack_require__) {
5108 var global = __webpack_require__(4)
5109 , DESCRIPTORS = __webpack_require__(6)
5110 , LIBRARY = __webpack_require__(28)
5111 , $typed = __webpack_require__(219)
5112 , hide = __webpack_require__(10)
5113 , redefineAll = __webpack_require__(210)
5114 , fails = __webpack_require__(7)
5115 , anInstance = __webpack_require__(205)
5116 , toInteger = __webpack_require__(38)
5117 , toLength = __webpack_require__(37)
5118 , gOPN = __webpack_require__(50).f
5119 , dP = __webpack_require__(11).f
5120 , arrayFill = __webpack_require__(188)
5121 , setToStringTag = __webpack_require__(24)
5122 , ARRAY_BUFFER = 'ArrayBuffer'
5123 , DATA_VIEW = 'DataView'
5124 , PROTOTYPE = 'prototype'
5125 , WRONG_LENGTH = 'Wrong length!'
5126 , WRONG_INDEX = 'Wrong index!'
5127 , $ArrayBuffer = global[ARRAY_BUFFER]
5128 , $DataView = global[DATA_VIEW]
5129 , Math = global.Math
5130 , RangeError = global.RangeError
5131 , Infinity = global.Infinity
5132 , BaseBuffer = $ArrayBuffer
5135 , floor = Math.floor
5139 , BYTE_LENGTH = 'byteLength'
5140 , BYTE_OFFSET = 'byteOffset'
5141 , $BUFFER = DESCRIPTORS ? '_b' : BUFFER
5142 , $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH
5143 , $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
5145 // IEEE754 conversions based on https://github.com/feross/ieee754
5146 var packIEEE754 = function(value, mLen, nBytes){
5147 var buffer = Array(nBytes)
5148 , eLen = nBytes * 8 - mLen - 1
5149 , eMax = (1 << eLen) - 1
5151 , rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0
5153 , s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0
5156 if(value != value || value === Infinity){
5157 m = value != value ? 1 : 0;
5160 e = floor(log(value) / LN2);
5161 if(value * (c = pow(2, -e)) < 1){
5168 value += rt * pow(2, 1 - eBias);
5174 if(e + eBias >= eMax){
5177 } else if(e + eBias >= 1){
5178 m = (value * c - 1) * pow(2, mLen);
5181 m = value * pow(2, eBias - 1) * pow(2, mLen);
5185 for(; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
5188 for(; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
5189 buffer[--i] |= s * 128;
5192 var unpackIEEE754 = function(buffer, mLen, nBytes){
5193 var eLen = nBytes * 8 - mLen - 1
5194 , eMax = (1 << eLen) - 1
5202 for(; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
5203 m = e & (1 << -nBits) - 1;
5206 for(; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
5209 } else if(e === eMax){
5210 return m ? NaN : s ? -Infinity : Infinity;
5212 m = m + pow(2, mLen);
5214 } return (s ? -1 : 1) * m * pow(2, e - mLen);
5217 var unpackI32 = function(bytes){
5218 return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
5220 var packI8 = function(it){
5223 var packI16 = function(it){
5224 return [it & 0xff, it >> 8 & 0xff];
5226 var packI32 = function(it){
5227 return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
5229 var packF64 = function(it){
5230 return packIEEE754(it, 52, 8);
5232 var packF32 = function(it){
5233 return packIEEE754(it, 23, 4);
5236 var addGetter = function(C, key, internal){
5237 dP(C[PROTOTYPE], key, {get: function(){ return this[internal]; }});
5240 var get = function(view, bytes, index, isLittleEndian){
5241 var numIndex = +index
5242 , intIndex = toInteger(numIndex);
5243 if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX);
5244 var store = view[$BUFFER]._b
5245 , start = intIndex + view[$OFFSET]
5246 , pack = store.slice(start, start + bytes);
5247 return isLittleEndian ? pack : pack.reverse();
5249 var set = function(view, bytes, index, conversion, value, isLittleEndian){
5250 var numIndex = +index
5251 , intIndex = toInteger(numIndex);
5252 if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX);
5253 var store = view[$BUFFER]._b
5254 , start = intIndex + view[$OFFSET]
5255 , pack = conversion(+value);
5256 for(var i = 0; i < bytes; i++)store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
5259 var validateArrayBufferArguments = function(that, length){
5260 anInstance(that, $ArrayBuffer, ARRAY_BUFFER);
5261 var numberLength = +length
5262 , byteLength = toLength(numberLength);
5263 if(numberLength != byteLength)throw RangeError(WRONG_LENGTH);
5268 $ArrayBuffer = function ArrayBuffer(length){
5269 var byteLength = validateArrayBufferArguments(this, length);
5270 this._b = arrayFill.call(Array(byteLength), 0);
5271 this[$LENGTH] = byteLength;
5274 $DataView = function DataView(buffer, byteOffset, byteLength){
5275 anInstance(this, $DataView, DATA_VIEW);
5276 anInstance(buffer, $ArrayBuffer, DATA_VIEW);
5277 var bufferLength = buffer[$LENGTH]
5278 , offset = toInteger(byteOffset);
5279 if(offset < 0 || offset > bufferLength)throw RangeError('Wrong offset!');
5280 byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
5281 if(offset + byteLength > bufferLength)throw RangeError(WRONG_LENGTH);
5282 this[$BUFFER] = buffer;
5283 this[$OFFSET] = offset;
5284 this[$LENGTH] = byteLength;
5288 addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
5289 addGetter($DataView, BUFFER, '_b');
5290 addGetter($DataView, BYTE_LENGTH, '_l');
5291 addGetter($DataView, BYTE_OFFSET, '_o');
5294 redefineAll($DataView[PROTOTYPE], {
5295 getInt8: function getInt8(byteOffset){
5296 return get(this, 1, byteOffset)[0] << 24 >> 24;
5298 getUint8: function getUint8(byteOffset){
5299 return get(this, 1, byteOffset)[0];
5301 getInt16: function getInt16(byteOffset /*, littleEndian */){
5302 var bytes = get(this, 2, byteOffset, arguments[1]);
5303 return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
5305 getUint16: function getUint16(byteOffset /*, littleEndian */){
5306 var bytes = get(this, 2, byteOffset, arguments[1]);
5307 return bytes[1] << 8 | bytes[0];
5309 getInt32: function getInt32(byteOffset /*, littleEndian */){
5310 return unpackI32(get(this, 4, byteOffset, arguments[1]));
5312 getUint32: function getUint32(byteOffset /*, littleEndian */){
5313 return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
5315 getFloat32: function getFloat32(byteOffset /*, littleEndian */){
5316 return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
5318 getFloat64: function getFloat64(byteOffset /*, littleEndian */){
5319 return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
5321 setInt8: function setInt8(byteOffset, value){
5322 set(this, 1, byteOffset, packI8, value);
5324 setUint8: function setUint8(byteOffset, value){
5325 set(this, 1, byteOffset, packI8, value);
5327 setInt16: function setInt16(byteOffset, value /*, littleEndian */){
5328 set(this, 2, byteOffset, packI16, value, arguments[2]);
5330 setUint16: function setUint16(byteOffset, value /*, littleEndian */){
5331 set(this, 2, byteOffset, packI16, value, arguments[2]);
5333 setInt32: function setInt32(byteOffset, value /*, littleEndian */){
5334 set(this, 4, byteOffset, packI32, value, arguments[2]);
5336 setUint32: function setUint32(byteOffset, value /*, littleEndian */){
5337 set(this, 4, byteOffset, packI32, value, arguments[2]);
5339 setFloat32: function setFloat32(byteOffset, value /*, littleEndian */){
5340 set(this, 4, byteOffset, packF32, value, arguments[2]);
5342 setFloat64: function setFloat64(byteOffset, value /*, littleEndian */){
5343 set(this, 8, byteOffset, packF64, value, arguments[2]);
5347 if(!fails(function(){
5348 new $ArrayBuffer; // eslint-disable-line no-new
5349 }) || !fails(function(){
5350 new $ArrayBuffer(.5); // eslint-disable-line no-new
5352 $ArrayBuffer = function ArrayBuffer(length){
5353 return new BaseBuffer(validateArrayBufferArguments(this, length));
5355 var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
5356 for(var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j; ){
5357 if(!((key = keys[j++]) in $ArrayBuffer))hide($ArrayBuffer, key, BaseBuffer[key]);
5359 if(!LIBRARY)ArrayBufferProto.constructor = $ArrayBuffer;
5361 // iOS Safari 7.x bug
5362 var view = new $DataView(new $ArrayBuffer(2))
5363 , $setInt8 = $DataView[PROTOTYPE].setInt8;
5364 view.setInt8(0, 2147483648);
5365 view.setInt8(1, 2147483649);
5366 if(view.getInt8(0) || !view.getInt8(1))redefineAll($DataView[PROTOTYPE], {
5367 setInt8: function setInt8(byteOffset, value){
5368 $setInt8.call(this, byteOffset, value << 24 >> 24);
5370 setUint8: function setUint8(byteOffset, value){
5371 $setInt8.call(this, byteOffset, value << 24 >> 24);
5375 setToStringTag($ArrayBuffer, ARRAY_BUFFER);
5376 setToStringTag($DataView, DATA_VIEW);
5377 hide($DataView[PROTOTYPE], $typed.VIEW, true);
5378 exports[ARRAY_BUFFER] = $ArrayBuffer;
5379 exports[DATA_VIEW] = $DataView;
5383 /***/ function(module, exports, __webpack_require__) {
5385 var $export = __webpack_require__(8);
5386 $export($export.G + $export.W + $export.F * !__webpack_require__(219).ABV, {
5387 DataView: __webpack_require__(220).DataView
5392 /***/ function(module, exports, __webpack_require__) {
5394 __webpack_require__(223)('Int8', 1, function(init){
5395 return function Int8Array(data, byteOffset, length){
5396 return init(this, data, byteOffset, length);
5402 /***/ function(module, exports, __webpack_require__) {
5405 if(__webpack_require__(6)){
5406 var LIBRARY = __webpack_require__(28)
5407 , global = __webpack_require__(4)
5408 , fails = __webpack_require__(7)
5409 , $export = __webpack_require__(8)
5410 , $typed = __webpack_require__(219)
5411 , $buffer = __webpack_require__(220)
5412 , ctx = __webpack_require__(20)
5413 , anInstance = __webpack_require__(205)
5414 , propertyDesc = __webpack_require__(17)
5415 , hide = __webpack_require__(10)
5416 , redefineAll = __webpack_require__(210)
5417 , toInteger = __webpack_require__(38)
5418 , toLength = __webpack_require__(37)
5419 , toIndex = __webpack_require__(39)
5420 , toPrimitive = __webpack_require__(16)
5421 , has = __webpack_require__(5)
5422 , same = __webpack_require__(71)
5423 , classof = __webpack_require__(75)
5424 , isObject = __webpack_require__(13)
5425 , toObject = __webpack_require__(58)
5426 , isArrayIter = __webpack_require__(162)
5427 , create = __webpack_require__(46)
5428 , getPrototypeOf = __webpack_require__(59)
5429 , gOPN = __webpack_require__(50).f
5430 , getIterFn = __webpack_require__(164)
5431 , uid = __webpack_require__(19)
5432 , wks = __webpack_require__(25)
5433 , createArrayMethod = __webpack_require__(172)
5434 , createArrayIncludes = __webpack_require__(36)
5435 , speciesConstructor = __webpack_require__(207)
5436 , ArrayIterators = __webpack_require__(193)
5437 , Iterators = __webpack_require__(129)
5438 , $iterDetect = __webpack_require__(165)
5439 , setSpecies = __webpack_require__(192)
5440 , arrayFill = __webpack_require__(188)
5441 , arrayCopyWithin = __webpack_require__(185)
5442 , $DP = __webpack_require__(11)
5443 , $GOPD = __webpack_require__(51)
5446 , RangeError = global.RangeError
5447 , TypeError = global.TypeError
5448 , Uint8Array = global.Uint8Array
5449 , ARRAY_BUFFER = 'ArrayBuffer'
5450 , SHARED_BUFFER = 'Shared' + ARRAY_BUFFER
5451 , BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'
5452 , PROTOTYPE = 'prototype'
5453 , ArrayProto = Array[PROTOTYPE]
5454 , $ArrayBuffer = $buffer.ArrayBuffer
5455 , $DataView = $buffer.DataView
5456 , arrayForEach = createArrayMethod(0)
5457 , arrayFilter = createArrayMethod(2)
5458 , arraySome = createArrayMethod(3)
5459 , arrayEvery = createArrayMethod(4)
5460 , arrayFind = createArrayMethod(5)
5461 , arrayFindIndex = createArrayMethod(6)
5462 , arrayIncludes = createArrayIncludes(true)
5463 , arrayIndexOf = createArrayIncludes(false)
5464 , arrayValues = ArrayIterators.values
5465 , arrayKeys = ArrayIterators.keys
5466 , arrayEntries = ArrayIterators.entries
5467 , arrayLastIndexOf = ArrayProto.lastIndexOf
5468 , arrayReduce = ArrayProto.reduce
5469 , arrayReduceRight = ArrayProto.reduceRight
5470 , arrayJoin = ArrayProto.join
5471 , arraySort = ArrayProto.sort
5472 , arraySlice = ArrayProto.slice
5473 , arrayToString = ArrayProto.toString
5474 , arrayToLocaleString = ArrayProto.toLocaleString
5475 , ITERATOR = wks('iterator')
5476 , TAG = wks('toStringTag')
5477 , TYPED_CONSTRUCTOR = uid('typed_constructor')
5478 , DEF_CONSTRUCTOR = uid('def_constructor')
5479 , ALL_CONSTRUCTORS = $typed.CONSTR
5480 , TYPED_ARRAY = $typed.TYPED
5481 , VIEW = $typed.VIEW
5482 , WRONG_LENGTH = 'Wrong length!';
5484 var $map = createArrayMethod(1, function(O, length){
5485 return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
5488 var LITTLE_ENDIAN = fails(function(){
5489 return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
5492 var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function(){
5493 new Uint8Array(1).set({});
5496 var strictToLength = function(it, SAME){
5497 if(it === undefined)throw TypeError(WRONG_LENGTH);
5499 , length = toLength(it);
5500 if(SAME && !same(number, length))throw RangeError(WRONG_LENGTH);
5504 var toOffset = function(it, BYTES){
5505 var offset = toInteger(it);
5506 if(offset < 0 || offset % BYTES)throw RangeError('Wrong offset!');
5510 var validate = function(it){
5511 if(isObject(it) && TYPED_ARRAY in it)return it;
5512 throw TypeError(it + ' is not a typed array!');
5515 var allocate = function(C, length){
5516 if(!(isObject(C) && TYPED_CONSTRUCTOR in C)){
5517 throw TypeError('It is not a typed array constructor!');
5518 } return new C(length);
5521 var speciesFromList = function(O, list){
5522 return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
5525 var fromList = function(C, list){
5527 , length = list.length
5528 , result = allocate(C, length);
5529 while(length > index)result[index] = list[index++];
5533 var addGetter = function(it, key, internal){
5534 dP(it, key, {get: function(){ return this._d[internal]; }});
5537 var $from = function from(source /*, mapfn, thisArg */){
5538 var O = toObject(source)
5539 , aLen = arguments.length
5540 , mapfn = aLen > 1 ? arguments[1] : undefined
5541 , mapping = mapfn !== undefined
5542 , iterFn = getIterFn(O)
5543 , i, length, values, result, step, iterator;
5544 if(iterFn != undefined && !isArrayIter(iterFn)){
5545 for(iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++){
5546 values.push(step.value);
5549 if(mapping && aLen > 2)mapfn = ctx(mapfn, arguments[2], 2);
5550 for(i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++){
5551 result[i] = mapping ? mapfn(O[i], i) : O[i];
5556 var $of = function of(/*...items*/){
5558 , length = arguments.length
5559 , result = allocate(this, length);
5560 while(length > index)result[index] = arguments[index++];
5564 // iOS Safari 6.x fails here
5565 var TO_LOCALE_BUG = !!Uint8Array && fails(function(){ arrayToLocaleString.call(new Uint8Array(1)); });
5567 var $toLocaleString = function toLocaleString(){
5568 return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
5572 copyWithin: function copyWithin(target, start /*, end */){
5573 return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
5575 every: function every(callbackfn /*, thisArg */){
5576 return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
5578 fill: function fill(value /*, start, end */){ // eslint-disable-line no-unused-vars
5579 return arrayFill.apply(validate(this), arguments);
5581 filter: function filter(callbackfn /*, thisArg */){
5582 return speciesFromList(this, arrayFilter(validate(this), callbackfn,
5583 arguments.length > 1 ? arguments[1] : undefined));
5585 find: function find(predicate /*, thisArg */){
5586 return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
5588 findIndex: function findIndex(predicate /*, thisArg */){
5589 return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
5591 forEach: function forEach(callbackfn /*, thisArg */){
5592 arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
5594 indexOf: function indexOf(searchElement /*, fromIndex */){
5595 return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
5597 includes: function includes(searchElement /*, fromIndex */){
5598 return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
5600 join: function join(separator){ // eslint-disable-line no-unused-vars
5601 return arrayJoin.apply(validate(this), arguments);
5603 lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */){ // eslint-disable-line no-unused-vars
5604 return arrayLastIndexOf.apply(validate(this), arguments);
5606 map: function map(mapfn /*, thisArg */){
5607 return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
5609 reduce: function reduce(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars
5610 return arrayReduce.apply(validate(this), arguments);
5612 reduceRight: function reduceRight(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars
5613 return arrayReduceRight.apply(validate(this), arguments);
5615 reverse: function reverse(){
5617 , length = validate(that).length
5618 , middle = Math.floor(length / 2)
5621 while(index < middle){
5622 value = that[index];
5623 that[index++] = that[--length];
5624 that[length] = value;
5627 some: function some(callbackfn /*, thisArg */){
5628 return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
5630 sort: function sort(comparefn){
5631 return arraySort.call(validate(this), comparefn);
5633 subarray: function subarray(begin, end){
5634 var O = validate(this)
5636 , $begin = toIndex(begin, length);
5637 return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
5639 O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
5640 toLength((end === undefined ? length : toIndex(end, length)) - $begin)
5645 var $slice = function slice(start, end){
5646 return speciesFromList(this, arraySlice.call(validate(this), start, end));
5649 var $set = function set(arrayLike /*, offset */){
5651 var offset = toOffset(arguments[1], 1)
5652 , length = this.length
5653 , src = toObject(arrayLike)
5654 , len = toLength(src.length)
5656 if(len + offset > length)throw RangeError(WRONG_LENGTH);
5657 while(index < len)this[offset + index] = src[index++];
5661 entries: function entries(){
5662 return arrayEntries.call(validate(this));
5664 keys: function keys(){
5665 return arrayKeys.call(validate(this));
5667 values: function values(){
5668 return arrayValues.call(validate(this));
5672 var isTAIndex = function(target, key){
5673 return isObject(target)
5674 && target[TYPED_ARRAY]
5675 && typeof key != 'symbol'
5677 && String(+key) == String(key);
5679 var $getDesc = function getOwnPropertyDescriptor(target, key){
5680 return isTAIndex(target, key = toPrimitive(key, true))
5681 ? propertyDesc(2, target[key])
5682 : gOPD(target, key);
5684 var $setDesc = function defineProperty(target, key, desc){
5685 if(isTAIndex(target, key = toPrimitive(key, true))
5687 && has(desc, 'value')
5688 && !has(desc, 'get')
5689 && !has(desc, 'set')
5690 // TODO: add validation descriptor w/o calling accessors
5691 && !desc.configurable
5692 && (!has(desc, 'writable') || desc.writable)
5693 && (!has(desc, 'enumerable') || desc.enumerable)
5695 target[key] = desc.value;
5697 } else return dP(target, key, desc);
5700 if(!ALL_CONSTRUCTORS){
5705 $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
5706 getOwnPropertyDescriptor: $getDesc,
5707 defineProperty: $setDesc
5710 if(fails(function(){ arrayToString.call({}); })){
5711 arrayToString = arrayToLocaleString = function toString(){
5712 return arrayJoin.call(this);
5716 var $TypedArrayPrototype$ = redefineAll({}, proto);
5717 redefineAll($TypedArrayPrototype$, $iterators);
5718 hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
5719 redefineAll($TypedArrayPrototype$, {
5722 constructor: function(){ /* noop */ },
5723 toString: arrayToString,
5724 toLocaleString: $toLocaleString
5726 addGetter($TypedArrayPrototype$, 'buffer', 'b');
5727 addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
5728 addGetter($TypedArrayPrototype$, 'byteLength', 'l');
5729 addGetter($TypedArrayPrototype$, 'length', 'e');
5730 dP($TypedArrayPrototype$, TAG, {
5731 get: function(){ return this[TYPED_ARRAY]; }
5734 module.exports = function(KEY, BYTES, wrapper, CLAMPED){
5735 CLAMPED = !!CLAMPED;
5736 var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'
5737 , ISNT_UINT8 = NAME != 'Uint8Array'
5738 , GETTER = 'get' + KEY
5739 , SETTER = 'set' + KEY
5740 , TypedArray = global[NAME]
5741 , Base = TypedArray || {}
5742 , TAC = TypedArray && getPrototypeOf(TypedArray)
5743 , FORCED = !TypedArray || !$typed.ABV
5745 , TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
5746 var getter = function(that, index){
5748 return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
5750 var setter = function(that, index, value){
5752 if(CLAMPED)value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
5753 data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
5755 var addElement = function(that, index){
5758 return getter(this, index);
5760 set: function(value){
5761 return setter(this, index, value);
5767 TypedArray = wrapper(function(that, data, $offset, $length){
5768 anInstance(that, TypedArray, NAME, '_d');
5771 , buffer, byteLength, length, klass;
5772 if(!isObject(data)){
5773 length = strictToLength(data, true)
5774 byteLength = length * BYTES;
5775 buffer = new $ArrayBuffer(byteLength);
5776 } else if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){
5778 offset = toOffset($offset, BYTES);
5779 var $len = data.byteLength;
5780 if($length === undefined){
5781 if($len % BYTES)throw RangeError(WRONG_LENGTH);
5782 byteLength = $len - offset;
5783 if(byteLength < 0)throw RangeError(WRONG_LENGTH);
5785 byteLength = toLength($length) * BYTES;
5786 if(byteLength + offset > $len)throw RangeError(WRONG_LENGTH);
5788 length = byteLength / BYTES;
5789 } else if(TYPED_ARRAY in data){
5790 return fromList(TypedArray, data);
5792 return $from.call(TypedArray, data);
5799 v: new $DataView(buffer)
5801 while(index < length)addElement(that, index++);
5803 TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
5804 hide(TypedArrayPrototype, 'constructor', TypedArray);
5805 } else if(!$iterDetect(function(iter){
5806 // V8 works with iterators, but fails in many other cases
5807 // https://code.google.com/p/v8/issues/detail?id=4552
5808 new TypedArray(null); // eslint-disable-line no-new
5809 new TypedArray(iter); // eslint-disable-line no-new
5811 TypedArray = wrapper(function(that, data, $offset, $length){
5812 anInstance(that, TypedArray, NAME);
5814 // `ws` module bug, temporarily remove validation length for Uint8Array
5815 // https://github.com/websockets/ws/pull/645
5816 if(!isObject(data))return new Base(strictToLength(data, ISNT_UINT8));
5817 if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){
5818 return $length !== undefined
5819 ? new Base(data, toOffset($offset, BYTES), $length)
5820 : $offset !== undefined
5821 ? new Base(data, toOffset($offset, BYTES))
5824 if(TYPED_ARRAY in data)return fromList(TypedArray, data);
5825 return $from.call(TypedArray, data);
5827 arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function(key){
5828 if(!(key in TypedArray))hide(TypedArray, key, Base[key]);
5830 TypedArray[PROTOTYPE] = TypedArrayPrototype;
5831 if(!LIBRARY)TypedArrayPrototype.constructor = TypedArray;
5833 var $nativeIterator = TypedArrayPrototype[ITERATOR]
5834 , CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined)
5835 , $iterator = $iterators.values;
5836 hide(TypedArray, TYPED_CONSTRUCTOR, true);
5837 hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
5838 hide(TypedArrayPrototype, VIEW, true);
5839 hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
5841 if(CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)){
5842 dP(TypedArrayPrototype, TAG, {
5843 get: function(){ return NAME; }
5847 O[NAME] = TypedArray;
5849 $export($export.G + $export.W + $export.F * (TypedArray != Base), O);
5851 $export($export.S, NAME, {
5852 BYTES_PER_ELEMENT: BYTES,
5857 if(!(BYTES_PER_ELEMENT in TypedArrayPrototype))hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
5859 $export($export.P, NAME, proto);
5863 $export($export.P + $export.F * FORCED_SET, NAME, {set: $set});
5865 $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
5867 $export($export.P + $export.F * (TypedArrayPrototype.toString != arrayToString), NAME, {toString: arrayToString});
5869 $export($export.P + $export.F * fails(function(){
5870 new TypedArray(1).slice();
5871 }), NAME, {slice: $slice});
5873 $export($export.P + $export.F * (fails(function(){
5874 return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString()
5875 }) || !fails(function(){
5876 TypedArrayPrototype.toLocaleString.call([1, 2]);
5877 })), NAME, {toLocaleString: $toLocaleString});
5879 Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
5880 if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator);
5882 } else module.exports = function(){ /* empty */ };
5886 /***/ function(module, exports, __webpack_require__) {
5888 __webpack_require__(223)('Uint8', 1, function(init){
5889 return function Uint8Array(data, byteOffset, length){
5890 return init(this, data, byteOffset, length);
5896 /***/ function(module, exports, __webpack_require__) {
5898 __webpack_require__(223)('Uint8', 1, function(init){
5899 return function Uint8ClampedArray(data, byteOffset, length){
5900 return init(this, data, byteOffset, length);
5906 /***/ function(module, exports, __webpack_require__) {
5908 __webpack_require__(223)('Int16', 2, function(init){
5909 return function Int16Array(data, byteOffset, length){
5910 return init(this, data, byteOffset, length);
5916 /***/ function(module, exports, __webpack_require__) {
5918 __webpack_require__(223)('Uint16', 2, function(init){
5919 return function Uint16Array(data, byteOffset, length){
5920 return init(this, data, byteOffset, length);
5926 /***/ function(module, exports, __webpack_require__) {
5928 __webpack_require__(223)('Int32', 4, function(init){
5929 return function Int32Array(data, byteOffset, length){
5930 return init(this, data, byteOffset, length);
5936 /***/ function(module, exports, __webpack_require__) {
5938 __webpack_require__(223)('Uint32', 4, function(init){
5939 return function Uint32Array(data, byteOffset, length){
5940 return init(this, data, byteOffset, length);
5946 /***/ function(module, exports, __webpack_require__) {
5948 __webpack_require__(223)('Float32', 4, function(init){
5949 return function Float32Array(data, byteOffset, length){
5950 return init(this, data, byteOffset, length);
5956 /***/ function(module, exports, __webpack_require__) {
5958 __webpack_require__(223)('Float64', 8, function(init){
5959 return function Float64Array(data, byteOffset, length){
5960 return init(this, data, byteOffset, length);
5966 /***/ function(module, exports, __webpack_require__) {
5968 // 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
5969 var $export = __webpack_require__(8)
5970 , aFunction = __webpack_require__(21)
5971 , anObject = __webpack_require__(12)
5972 , rApply = (__webpack_require__(4).Reflect || {}).apply
5973 , fApply = Function.apply;
5974 // MS Edge argumentsList argument is optional
5975 $export($export.S + $export.F * !__webpack_require__(7)(function(){
5976 rApply(function(){});
5978 apply: function apply(target, thisArgument, argumentsList){
5979 var T = aFunction(target)
5980 , L = anObject(argumentsList);
5981 return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
5987 /***/ function(module, exports, __webpack_require__) {
5989 // 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
5990 var $export = __webpack_require__(8)
5991 , create = __webpack_require__(46)
5992 , aFunction = __webpack_require__(21)
5993 , anObject = __webpack_require__(12)
5994 , isObject = __webpack_require__(13)
5995 , fails = __webpack_require__(7)
5996 , bind = __webpack_require__(77)
5997 , rConstruct = (__webpack_require__(4).Reflect || {}).construct;
5999 // MS Edge supports only 2 arguments and argumentsList argument is optional
6000 // FF Nightly sets third argument as `new.target`, but does not create `this` from it
6001 var NEW_TARGET_BUG = fails(function(){
6003 return !(rConstruct(function(){}, [], F) instanceof F);
6005 var ARGS_BUG = !fails(function(){
6006 rConstruct(function(){});
6009 $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
6010 construct: function construct(Target, args /*, newTarget*/){
6013 var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
6014 if(ARGS_BUG && !NEW_TARGET_BUG)return rConstruct(Target, args, newTarget);
6015 if(Target == newTarget){
6016 // w/o altered newTarget, optimization for 0-4 arguments
6017 switch(args.length){
6018 case 0: return new Target;
6019 case 1: return new Target(args[0]);
6020 case 2: return new Target(args[0], args[1]);
6021 case 3: return new Target(args[0], args[1], args[2]);
6022 case 4: return new Target(args[0], args[1], args[2], args[3]);
6024 // w/o altered newTarget, lot of arguments case
6026 $args.push.apply($args, args);
6027 return new (bind.apply(Target, $args));
6029 // with altered newTarget, not support built-in constructors
6030 var proto = newTarget.prototype
6031 , instance = create(isObject(proto) ? proto : Object.prototype)
6032 , result = Function.apply.call(Target, instance, args);
6033 return isObject(result) ? result : instance;
6039 /***/ function(module, exports, __webpack_require__) {
6041 // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
6042 var dP = __webpack_require__(11)
6043 , $export = __webpack_require__(8)
6044 , anObject = __webpack_require__(12)
6045 , toPrimitive = __webpack_require__(16);
6047 // MS Edge has broken Reflect.defineProperty - throwing instead of returning false
6048 $export($export.S + $export.F * __webpack_require__(7)(function(){
6049 Reflect.defineProperty(dP.f({}, 1, {value: 1}), 1, {value: 2});
6051 defineProperty: function defineProperty(target, propertyKey, attributes){
6053 propertyKey = toPrimitive(propertyKey, true);
6054 anObject(attributes);
6056 dP.f(target, propertyKey, attributes);
6066 /***/ function(module, exports, __webpack_require__) {
6068 // 26.1.4 Reflect.deleteProperty(target, propertyKey)
6069 var $export = __webpack_require__(8)
6070 , gOPD = __webpack_require__(51).f
6071 , anObject = __webpack_require__(12);
6073 $export($export.S, 'Reflect', {
6074 deleteProperty: function deleteProperty(target, propertyKey){
6075 var desc = gOPD(anObject(target), propertyKey);
6076 return desc && !desc.configurable ? false : delete target[propertyKey];
6082 /***/ function(module, exports, __webpack_require__) {
6085 // 26.1.5 Reflect.enumerate(target)
6086 var $export = __webpack_require__(8)
6087 , anObject = __webpack_require__(12);
6088 var Enumerate = function(iterated){
6089 this._t = anObject(iterated); // target
6090 this._i = 0; // next index
6091 var keys = this._k = [] // keys
6093 for(key in iterated)keys.push(key);
6095 __webpack_require__(130)(Enumerate, 'Object', function(){
6100 if(that._i >= keys.length)return {value: undefined, done: true};
6101 } while(!((key = keys[that._i++]) in that._t));
6102 return {value: key, done: false};
6105 $export($export.S, 'Reflect', {
6106 enumerate: function enumerate(target){
6107 return new Enumerate(target);
6113 /***/ function(module, exports, __webpack_require__) {
6115 // 26.1.6 Reflect.get(target, propertyKey [, receiver])
6116 var gOPD = __webpack_require__(51)
6117 , getPrototypeOf = __webpack_require__(59)
6118 , has = __webpack_require__(5)
6119 , $export = __webpack_require__(8)
6120 , isObject = __webpack_require__(13)
6121 , anObject = __webpack_require__(12);
6123 function get(target, propertyKey/*, receiver*/){
6124 var receiver = arguments.length < 3 ? target : arguments[2]
6126 if(anObject(target) === receiver)return target[propertyKey];
6127 if(desc = gOPD.f(target, propertyKey))return has(desc, 'value')
6129 : desc.get !== undefined
6130 ? desc.get.call(receiver)
6132 if(isObject(proto = getPrototypeOf(target)))return get(proto, propertyKey, receiver);
6135 $export($export.S, 'Reflect', {get: get});
6139 /***/ function(module, exports, __webpack_require__) {
6141 // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
6142 var gOPD = __webpack_require__(51)
6143 , $export = __webpack_require__(8)
6144 , anObject = __webpack_require__(12);
6146 $export($export.S, 'Reflect', {
6147 getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){
6148 return gOPD.f(anObject(target), propertyKey);
6154 /***/ function(module, exports, __webpack_require__) {
6156 // 26.1.8 Reflect.getPrototypeOf(target)
6157 var $export = __webpack_require__(8)
6158 , getProto = __webpack_require__(59)
6159 , anObject = __webpack_require__(12);
6161 $export($export.S, 'Reflect', {
6162 getPrototypeOf: function getPrototypeOf(target){
6163 return getProto(anObject(target));
6169 /***/ function(module, exports, __webpack_require__) {
6171 // 26.1.9 Reflect.has(target, propertyKey)
6172 var $export = __webpack_require__(8);
6174 $export($export.S, 'Reflect', {
6175 has: function has(target, propertyKey){
6176 return propertyKey in target;
6182 /***/ function(module, exports, __webpack_require__) {
6184 // 26.1.10 Reflect.isExtensible(target)
6185 var $export = __webpack_require__(8)
6186 , anObject = __webpack_require__(12)
6187 , $isExtensible = Object.isExtensible;
6189 $export($export.S, 'Reflect', {
6190 isExtensible: function isExtensible(target){
6192 return $isExtensible ? $isExtensible(target) : true;
6198 /***/ function(module, exports, __webpack_require__) {
6200 // 26.1.11 Reflect.ownKeys(target)
6201 var $export = __webpack_require__(8);
6203 $export($export.S, 'Reflect', {ownKeys: __webpack_require__(243)});
6207 /***/ function(module, exports, __webpack_require__) {
6209 // all object keys, includes non-enumerable and symbols
6210 var gOPN = __webpack_require__(50)
6211 , gOPS = __webpack_require__(43)
6212 , anObject = __webpack_require__(12)
6213 , Reflect = __webpack_require__(4).Reflect;
6214 module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){
6215 var keys = gOPN.f(anObject(it))
6216 , getSymbols = gOPS.f;
6217 return getSymbols ? keys.concat(getSymbols(it)) : keys;
6222 /***/ function(module, exports, __webpack_require__) {
6224 // 26.1.12 Reflect.preventExtensions(target)
6225 var $export = __webpack_require__(8)
6226 , anObject = __webpack_require__(12)
6227 , $preventExtensions = Object.preventExtensions;
6229 $export($export.S, 'Reflect', {
6230 preventExtensions: function preventExtensions(target){
6233 if($preventExtensions)$preventExtensions(target);
6243 /***/ function(module, exports, __webpack_require__) {
6245 // 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
6246 var dP = __webpack_require__(11)
6247 , gOPD = __webpack_require__(51)
6248 , getPrototypeOf = __webpack_require__(59)
6249 , has = __webpack_require__(5)
6250 , $export = __webpack_require__(8)
6251 , createDesc = __webpack_require__(17)
6252 , anObject = __webpack_require__(12)
6253 , isObject = __webpack_require__(13);
6255 function set(target, propertyKey, V/*, receiver*/){
6256 var receiver = arguments.length < 4 ? target : arguments[3]
6257 , ownDesc = gOPD.f(anObject(target), propertyKey)
6258 , existingDescriptor, proto;
6260 if(isObject(proto = getPrototypeOf(target))){
6261 return set(proto, propertyKey, V, receiver);
6263 ownDesc = createDesc(0);
6265 if(has(ownDesc, 'value')){
6266 if(ownDesc.writable === false || !isObject(receiver))return false;
6267 existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0);
6268 existingDescriptor.value = V;
6269 dP.f(receiver, propertyKey, existingDescriptor);
6272 return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
6275 $export($export.S, 'Reflect', {set: set});
6279 /***/ function(module, exports, __webpack_require__) {
6281 // 26.1.14 Reflect.setPrototypeOf(target, proto)
6282 var $export = __webpack_require__(8)
6283 , setProto = __webpack_require__(73);
6285 if(setProto)$export($export.S, 'Reflect', {
6286 setPrototypeOf: function setPrototypeOf(target, proto){
6287 setProto.check(target, proto);
6289 setProto.set(target, proto);
6299 /***/ function(module, exports, __webpack_require__) {
6302 // https://github.com/tc39/Array.prototype.includes
6303 var $export = __webpack_require__(8)
6304 , $includes = __webpack_require__(36)(true);
6306 $export($export.P, 'Array', {
6307 includes: function includes(el /*, fromIndex = 0 */){
6308 return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
6312 __webpack_require__(186)('includes');
6316 /***/ function(module, exports, __webpack_require__) {
6319 // https://github.com/mathiasbynens/String.prototype.at
6320 var $export = __webpack_require__(8)
6321 , $at = __webpack_require__(127)(true);
6323 $export($export.P, 'String', {
6324 at: function at(pos){
6325 return $at(this, pos);
6331 /***/ function(module, exports, __webpack_require__) {
6334 // https://github.com/tc39/proposal-string-pad-start-end
6335 var $export = __webpack_require__(8)
6336 , $pad = __webpack_require__(250);
6338 $export($export.P, 'String', {
6339 padStart: function padStart(maxLength /*, fillString = ' ' */){
6340 return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
6346 /***/ function(module, exports, __webpack_require__) {
6348 // https://github.com/tc39/proposal-string-pad-start-end
6349 var toLength = __webpack_require__(37)
6350 , repeat = __webpack_require__(91)
6351 , defined = __webpack_require__(35);
6353 module.exports = function(that, maxLength, fillString, left){
6354 var S = String(defined(that))
6355 , stringLength = S.length
6356 , fillStr = fillString === undefined ? ' ' : String(fillString)
6357 , intMaxLength = toLength(maxLength);
6358 if(intMaxLength <= stringLength || fillStr == '')return S;
6359 var fillLen = intMaxLength - stringLength
6360 , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
6361 if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);
6362 return left ? stringFiller + S : S + stringFiller;
6368 /***/ function(module, exports, __webpack_require__) {
6371 // https://github.com/tc39/proposal-string-pad-start-end
6372 var $export = __webpack_require__(8)
6373 , $pad = __webpack_require__(250);
6375 $export($export.P, 'String', {
6376 padEnd: function padEnd(maxLength /*, fillString = ' ' */){
6377 return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
6383 /***/ function(module, exports, __webpack_require__) {
6386 // https://github.com/sebmarkbage/ecmascript-string-left-right-trim
6387 __webpack_require__(83)('trimLeft', function($trim){
6388 return function trimLeft(){
6389 return $trim(this, 1);
6395 /***/ function(module, exports, __webpack_require__) {
6398 // https://github.com/sebmarkbage/ecmascript-string-left-right-trim
6399 __webpack_require__(83)('trimRight', function($trim){
6400 return function trimRight(){
6401 return $trim(this, 2);
6407 /***/ function(module, exports, __webpack_require__) {
6410 // https://tc39.github.io/String.prototype.matchAll/
6411 var $export = __webpack_require__(8)
6412 , defined = __webpack_require__(35)
6413 , toLength = __webpack_require__(37)
6414 , isRegExp = __webpack_require__(134)
6415 , getFlags = __webpack_require__(196)
6416 , RegExpProto = RegExp.prototype;
6418 var $RegExpStringIterator = function(regexp, string){
6423 __webpack_require__(130)($RegExpStringIterator, 'RegExp String', function next(){
6424 var match = this._r.exec(this._s);
6425 return {value: match, done: match === null};
6428 $export($export.P, 'String', {
6429 matchAll: function matchAll(regexp){
6431 if(!isRegExp(regexp))throw TypeError(regexp + ' is not a regexp!');
6432 var S = String(this)
6433 , flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp)
6434 , rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
6435 rx.lastIndex = toLength(regexp.lastIndex);
6436 return new $RegExpStringIterator(rx, S);
6442 /***/ function(module, exports, __webpack_require__) {
6444 __webpack_require__(27)('asyncIterator');
6448 /***/ function(module, exports, __webpack_require__) {
6450 __webpack_require__(27)('observable');
6454 /***/ function(module, exports, __webpack_require__) {
6456 // https://github.com/tc39/proposal-object-getownpropertydescriptors
6457 var $export = __webpack_require__(8)
6458 , ownKeys = __webpack_require__(243)
6459 , toIObject = __webpack_require__(32)
6460 , gOPD = __webpack_require__(51)
6461 , createProperty = __webpack_require__(163);
6463 $export($export.S, 'Object', {
6464 getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){
6465 var O = toIObject(object)
6471 while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key));
6478 /***/ function(module, exports, __webpack_require__) {
6480 // https://github.com/tc39/proposal-object-values-entries
6481 var $export = __webpack_require__(8)
6482 , $values = __webpack_require__(259)(false);
6484 $export($export.S, 'Object', {
6485 values: function values(it){
6492 /***/ function(module, exports, __webpack_require__) {
6494 var getKeys = __webpack_require__(30)
6495 , toIObject = __webpack_require__(32)
6496 , isEnum = __webpack_require__(44).f;
6497 module.exports = function(isEntries){
6498 return function(it){
6499 var O = toIObject(it)
6501 , length = keys.length
6505 while(length > i)if(isEnum.call(O, key = keys[i++])){
6506 result.push(isEntries ? [key, O[key]] : O[key]);
6513 /***/ function(module, exports, __webpack_require__) {
6515 // https://github.com/tc39/proposal-object-values-entries
6516 var $export = __webpack_require__(8)
6517 , $entries = __webpack_require__(259)(true);
6519 $export($export.S, 'Object', {
6520 entries: function entries(it){
6521 return $entries(it);
6527 /***/ function(module, exports, __webpack_require__) {
6530 var $export = __webpack_require__(8)
6531 , toObject = __webpack_require__(58)
6532 , aFunction = __webpack_require__(21)
6533 , $defineProperty = __webpack_require__(11);
6535 // B.2.2.2 Object.prototype.__defineGetter__(P, getter)
6536 __webpack_require__(6) && $export($export.P + __webpack_require__(262), 'Object', {
6537 __defineGetter__: function __defineGetter__(P, getter){
6538 $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true});
6544 /***/ function(module, exports, __webpack_require__) {
6546 // Forced replacement prototype accessors methods
6547 module.exports = __webpack_require__(28)|| !__webpack_require__(7)(function(){
6548 var K = Math.random();
6549 // In FF throws only define methods
6550 __defineSetter__.call(null, K, function(){ /* empty */});
6551 delete __webpack_require__(4)[K];
6556 /***/ function(module, exports, __webpack_require__) {
6559 var $export = __webpack_require__(8)
6560 , toObject = __webpack_require__(58)
6561 , aFunction = __webpack_require__(21)
6562 , $defineProperty = __webpack_require__(11);
6564 // B.2.2.3 Object.prototype.__defineSetter__(P, setter)
6565 __webpack_require__(6) && $export($export.P + __webpack_require__(262), 'Object', {
6566 __defineSetter__: function __defineSetter__(P, setter){
6567 $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true});
6573 /***/ function(module, exports, __webpack_require__) {
6576 var $export = __webpack_require__(8)
6577 , toObject = __webpack_require__(58)
6578 , toPrimitive = __webpack_require__(16)
6579 , getPrototypeOf = __webpack_require__(59)
6580 , getOwnPropertyDescriptor = __webpack_require__(51).f;
6582 // B.2.2.4 Object.prototype.__lookupGetter__(P)
6583 __webpack_require__(6) && $export($export.P + __webpack_require__(262), 'Object', {
6584 __lookupGetter__: function __lookupGetter__(P){
6585 var O = toObject(this)
6586 , K = toPrimitive(P, true)
6589 if(D = getOwnPropertyDescriptor(O, K))return D.get;
6590 } while(O = getPrototypeOf(O));
6596 /***/ function(module, exports, __webpack_require__) {
6599 var $export = __webpack_require__(8)
6600 , toObject = __webpack_require__(58)
6601 , toPrimitive = __webpack_require__(16)
6602 , getPrototypeOf = __webpack_require__(59)
6603 , getOwnPropertyDescriptor = __webpack_require__(51).f;
6605 // B.2.2.5 Object.prototype.__lookupSetter__(P)
6606 __webpack_require__(6) && $export($export.P + __webpack_require__(262), 'Object', {
6607 __lookupSetter__: function __lookupSetter__(P){
6608 var O = toObject(this)
6609 , K = toPrimitive(P, true)
6612 if(D = getOwnPropertyDescriptor(O, K))return D.set;
6613 } while(O = getPrototypeOf(O));
6619 /***/ function(module, exports, __webpack_require__) {
6621 // https://github.com/DavidBruant/Map-Set.prototype.toJSON
6622 var $export = __webpack_require__(8);
6624 $export($export.P + $export.R, 'Map', {toJSON: __webpack_require__(267)('Map')});
6628 /***/ function(module, exports, __webpack_require__) {
6630 // https://github.com/DavidBruant/Map-Set.prototype.toJSON
6631 var classof = __webpack_require__(75)
6632 , from = __webpack_require__(268);
6633 module.exports = function(NAME){
6634 return function toJSON(){
6635 if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic");
6642 /***/ function(module, exports, __webpack_require__) {
6644 var forOf = __webpack_require__(206);
6646 module.exports = function(iter, ITERATOR){
6648 forOf(iter, false, result.push, result, ITERATOR);
6655 /***/ function(module, exports, __webpack_require__) {
6657 // https://github.com/DavidBruant/Map-Set.prototype.toJSON
6658 var $export = __webpack_require__(8);
6660 $export($export.P + $export.R, 'Set', {toJSON: __webpack_require__(267)('Set')});
6664 /***/ function(module, exports, __webpack_require__) {
6666 // https://github.com/ljharb/proposal-global
6667 var $export = __webpack_require__(8);
6669 $export($export.S, 'System', {global: __webpack_require__(4)});
6673 /***/ function(module, exports, __webpack_require__) {
6675 // https://github.com/ljharb/proposal-is-error
6676 var $export = __webpack_require__(8)
6677 , cof = __webpack_require__(34);
6679 $export($export.S, 'Error', {
6680 isError: function isError(it){
6681 return cof(it) === 'Error';
6687 /***/ function(module, exports, __webpack_require__) {
6689 // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
6690 var $export = __webpack_require__(8);
6692 $export($export.S, 'Math', {
6693 iaddh: function iaddh(x0, x1, y0, y1){
6697 return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;
6703 /***/ function(module, exports, __webpack_require__) {
6705 // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
6706 var $export = __webpack_require__(8);
6708 $export($export.S, 'Math', {
6709 isubh: function isubh(x0, x1, y0, y1){
6713 return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;
6719 /***/ function(module, exports, __webpack_require__) {
6721 // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
6722 var $export = __webpack_require__(8);
6724 $export($export.S, 'Math', {
6725 imulh: function imulh(u, v){
6733 , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
6734 return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
6740 /***/ function(module, exports, __webpack_require__) {
6742 // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
6743 var $export = __webpack_require__(8);
6745 $export($export.S, 'Math', {
6746 umulh: function umulh(u, v){
6754 , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
6755 return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);
6761 /***/ function(module, exports, __webpack_require__) {
6763 var metadata = __webpack_require__(277)
6764 , anObject = __webpack_require__(12)
6765 , toMetaKey = metadata.key
6766 , ordinaryDefineOwnMetadata = metadata.set;
6768 metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){
6769 ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
6774 /***/ function(module, exports, __webpack_require__) {
6776 var Map = __webpack_require__(211)
6777 , $export = __webpack_require__(8)
6778 , shared = __webpack_require__(23)('metadata')
6779 , store = shared.store || (shared.store = new (__webpack_require__(215)));
6781 var getOrCreateMetadataMap = function(target, targetKey, create){
6782 var targetMetadata = store.get(target);
6783 if(!targetMetadata){
6784 if(!create)return undefined;
6785 store.set(target, targetMetadata = new Map);
6787 var keyMetadata = targetMetadata.get(targetKey);
6789 if(!create)return undefined;
6790 targetMetadata.set(targetKey, keyMetadata = new Map);
6791 } return keyMetadata;
6793 var ordinaryHasOwnMetadata = function(MetadataKey, O, P){
6794 var metadataMap = getOrCreateMetadataMap(O, P, false);
6795 return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
6797 var ordinaryGetOwnMetadata = function(MetadataKey, O, P){
6798 var metadataMap = getOrCreateMetadataMap(O, P, false);
6799 return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
6801 var ordinaryDefineOwnMetadata = function(MetadataKey, MetadataValue, O, P){
6802 getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
6804 var ordinaryOwnMetadataKeys = function(target, targetKey){
6805 var metadataMap = getOrCreateMetadataMap(target, targetKey, false)
6807 if(metadataMap)metadataMap.forEach(function(_, key){ keys.push(key); });
6810 var toMetaKey = function(it){
6811 return it === undefined || typeof it == 'symbol' ? it : String(it);
6813 var exp = function(O){
6814 $export($export.S, 'Reflect', O);
6819 map: getOrCreateMetadataMap,
6820 has: ordinaryHasOwnMetadata,
6821 get: ordinaryGetOwnMetadata,
6822 set: ordinaryDefineOwnMetadata,
6823 keys: ordinaryOwnMetadataKeys,
6830 /***/ function(module, exports, __webpack_require__) {
6832 var metadata = __webpack_require__(277)
6833 , anObject = __webpack_require__(12)
6834 , toMetaKey = metadata.key
6835 , getOrCreateMetadataMap = metadata.map
6836 , store = metadata.store;
6838 metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, targetKey */){
6839 var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2])
6840 , metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
6841 if(metadataMap === undefined || !metadataMap['delete'](metadataKey))return false;
6842 if(metadataMap.size)return true;
6843 var targetMetadata = store.get(target);
6844 targetMetadata['delete'](targetKey);
6845 return !!targetMetadata.size || store['delete'](target);
6850 /***/ function(module, exports, __webpack_require__) {
6852 var metadata = __webpack_require__(277)
6853 , anObject = __webpack_require__(12)
6854 , getPrototypeOf = __webpack_require__(59)
6855 , ordinaryHasOwnMetadata = metadata.has
6856 , ordinaryGetOwnMetadata = metadata.get
6857 , toMetaKey = metadata.key;
6859 var ordinaryGetMetadata = function(MetadataKey, O, P){
6860 var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
6861 if(hasOwn)return ordinaryGetOwnMetadata(MetadataKey, O, P);
6862 var parent = getPrototypeOf(O);
6863 return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
6866 metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){
6867 return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
6872 /***/ function(module, exports, __webpack_require__) {
6874 var Set = __webpack_require__(214)
6875 , from = __webpack_require__(268)
6876 , metadata = __webpack_require__(277)
6877 , anObject = __webpack_require__(12)
6878 , getPrototypeOf = __webpack_require__(59)
6879 , ordinaryOwnMetadataKeys = metadata.keys
6880 , toMetaKey = metadata.key;
6882 var ordinaryMetadataKeys = function(O, P){
6883 var oKeys = ordinaryOwnMetadataKeys(O, P)
6884 , parent = getPrototypeOf(O);
6885 if(parent === null)return oKeys;
6886 var pKeys = ordinaryMetadataKeys(parent, P);
6887 return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
6890 metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){
6891 return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
6896 /***/ function(module, exports, __webpack_require__) {
6898 var metadata = __webpack_require__(277)
6899 , anObject = __webpack_require__(12)
6900 , ordinaryGetOwnMetadata = metadata.get
6901 , toMetaKey = metadata.key;
6903 metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, targetKey */){
6904 return ordinaryGetOwnMetadata(metadataKey, anObject(target)
6905 , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
6910 /***/ function(module, exports, __webpack_require__) {
6912 var metadata = __webpack_require__(277)
6913 , anObject = __webpack_require__(12)
6914 , ordinaryOwnMetadataKeys = metadata.keys
6915 , toMetaKey = metadata.key;
6917 metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){
6918 return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
6923 /***/ function(module, exports, __webpack_require__) {
6925 var metadata = __webpack_require__(277)
6926 , anObject = __webpack_require__(12)
6927 , getPrototypeOf = __webpack_require__(59)
6928 , ordinaryHasOwnMetadata = metadata.has
6929 , toMetaKey = metadata.key;
6931 var ordinaryHasMetadata = function(MetadataKey, O, P){
6932 var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
6933 if(hasOwn)return true;
6934 var parent = getPrototypeOf(O);
6935 return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
6938 metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){
6939 return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
6944 /***/ function(module, exports, __webpack_require__) {
6946 var metadata = __webpack_require__(277)
6947 , anObject = __webpack_require__(12)
6948 , ordinaryHasOwnMetadata = metadata.has
6949 , toMetaKey = metadata.key;
6951 metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, targetKey */){
6952 return ordinaryHasOwnMetadata(metadataKey, anObject(target)
6953 , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
6958 /***/ function(module, exports, __webpack_require__) {
6960 var metadata = __webpack_require__(277)
6961 , anObject = __webpack_require__(12)
6962 , aFunction = __webpack_require__(21)
6963 , toMetaKey = metadata.key
6964 , ordinaryDefineOwnMetadata = metadata.set;
6966 metadata.exp({metadata: function metadata(metadataKey, metadataValue){
6967 return function decorator(target, targetKey){
6968 ordinaryDefineOwnMetadata(
6969 metadataKey, metadataValue,
6970 (targetKey !== undefined ? anObject : aFunction)(target),
6971 toMetaKey(targetKey)
6978 /***/ function(module, exports, __webpack_require__) {
6980 // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
6981 var $export = __webpack_require__(8)
6982 , microtask = __webpack_require__(209)()
6983 , process = __webpack_require__(4).process
6984 , isNode = __webpack_require__(34)(process) == 'process';
6986 $export($export.G, {
6987 asap: function asap(fn){
6988 var domain = isNode && process.domain;
6989 microtask(domain ? domain.bind(fn) : fn);
6995 /***/ function(module, exports, __webpack_require__) {
6998 // https://github.com/zenparsing/es-observable
6999 var $export = __webpack_require__(8)
7000 , global = __webpack_require__(4)
7001 , core = __webpack_require__(9)
7002 , microtask = __webpack_require__(209)()
7003 , OBSERVABLE = __webpack_require__(25)('observable')
7004 , aFunction = __webpack_require__(21)
7005 , anObject = __webpack_require__(12)
7006 , anInstance = __webpack_require__(205)
7007 , redefineAll = __webpack_require__(210)
7008 , hide = __webpack_require__(10)
7009 , forOf = __webpack_require__(206)
7010 , RETURN = forOf.RETURN;
7012 var getMethod = function(fn){
7013 return fn == null ? undefined : aFunction(fn);
7016 var cleanupSubscription = function(subscription){
7017 var cleanup = subscription._c;
7019 subscription._c = undefined;
7024 var subscriptionClosed = function(subscription){
7025 return subscription._o === undefined;
7028 var closeSubscription = function(subscription){
7029 if(!subscriptionClosed(subscription)){
7030 subscription._o = undefined;
7031 cleanupSubscription(subscription);
7035 var Subscription = function(observer, subscriber){
7037 this._c = undefined;
7039 observer = new SubscriptionObserver(this);
7041 var cleanup = subscriber(observer)
7042 , subscription = cleanup;
7043 if(cleanup != null){
7044 if(typeof cleanup.unsubscribe === 'function')cleanup = function(){ subscription.unsubscribe(); };
7045 else aFunction(cleanup);
7051 } if(subscriptionClosed(this))cleanupSubscription(this);
7054 Subscription.prototype = redefineAll({}, {
7055 unsubscribe: function unsubscribe(){ closeSubscription(this); }
7058 var SubscriptionObserver = function(subscription){
7059 this._s = subscription;
7062 SubscriptionObserver.prototype = redefineAll({}, {
7063 next: function next(value){
7064 var subscription = this._s;
7065 if(!subscriptionClosed(subscription)){
7066 var observer = subscription._o;
7068 var m = getMethod(observer.next);
7069 if(m)return m.call(observer, value);
7072 closeSubscription(subscription);
7079 error: function error(value){
7080 var subscription = this._s;
7081 if(subscriptionClosed(subscription))throw value;
7082 var observer = subscription._o;
7083 subscription._o = undefined;
7085 var m = getMethod(observer.error);
7087 value = m.call(observer, value);
7090 cleanupSubscription(subscription);
7094 } cleanupSubscription(subscription);
7097 complete: function complete(value){
7098 var subscription = this._s;
7099 if(!subscriptionClosed(subscription)){
7100 var observer = subscription._o;
7101 subscription._o = undefined;
7103 var m = getMethod(observer.complete);
7104 value = m ? m.call(observer, value) : undefined;
7107 cleanupSubscription(subscription);
7111 } cleanupSubscription(subscription);
7117 var $Observable = function Observable(subscriber){
7118 anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);
7121 redefineAll($Observable.prototype, {
7122 subscribe: function subscribe(observer){
7123 return new Subscription(observer, this._f);
7125 forEach: function forEach(fn){
7127 return new (core.Promise || global.Promise)(function(resolve, reject){
7129 var subscription = that.subscribe({
7130 next : function(value){
7135 subscription.unsubscribe();
7145 redefineAll($Observable, {
7146 from: function from(x){
7147 var C = typeof this === 'function' ? this : $Observable;
7148 var method = getMethod(anObject(x)[OBSERVABLE]);
7150 var observable = anObject(method.call(x));
7151 return observable.constructor === C ? observable : new C(function(observer){
7152 return observable.subscribe(observer);
7155 return new C(function(observer){
7157 microtask(function(){
7160 if(forOf(x, false, function(it){
7162 if(done)return RETURN;
7163 }) === RETURN)return;
7168 } observer.complete();
7171 return function(){ done = true; };
7175 for(var i = 0, l = arguments.length, items = Array(l); i < l;)items[i] = arguments[i++];
7176 return new (typeof this === 'function' ? this : $Observable)(function(observer){
7178 microtask(function(){
7180 for(var i = 0; i < items.length; ++i){
7181 observer.next(items[i]);
7183 } observer.complete();
7186 return function(){ done = true; };
7191 hide($Observable.prototype, OBSERVABLE, function(){ return this; });
7193 $export($export.G, {Observable: $Observable});
7195 __webpack_require__(192)('Observable');
7199 /***/ function(module, exports, __webpack_require__) {
7201 // ie9- setTimeout & setInterval additional parameters fix
7202 var global = __webpack_require__(4)
7203 , $export = __webpack_require__(8)
7204 , invoke = __webpack_require__(78)
7205 , partial = __webpack_require__(289)
7206 , navigator = global.navigator
7207 , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check
7208 var wrap = function(set){
7209 return MSIE ? function(fn, time /*, ...args */){
7212 [].slice.call(arguments, 2),
7213 typeof fn == 'function' ? fn : Function(fn)
7217 $export($export.G + $export.B + $export.F * MSIE, {
7218 setTimeout: wrap(global.setTimeout),
7219 setInterval: wrap(global.setInterval)
7224 /***/ function(module, exports, __webpack_require__) {
7227 var path = __webpack_require__(290)
7228 , invoke = __webpack_require__(78)
7229 , aFunction = __webpack_require__(21);
7230 module.exports = function(/* ...pargs */){
7231 var fn = aFunction(this)
7232 , length = arguments.length
7233 , pargs = Array(length)
7237 while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true;
7238 return function(/* ...args */){
7240 , aLen = arguments.length
7241 , j = 0, k = 0, args;
7242 if(!holder && !aLen)return invoke(fn, pargs, that);
7243 args = pargs.slice();
7244 if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++];
7245 while(aLen > k)args.push(arguments[k++]);
7246 return invoke(fn, args, that);
7252 /***/ function(module, exports, __webpack_require__) {
7254 module.exports = __webpack_require__(4);
7258 /***/ function(module, exports, __webpack_require__) {
7260 var $export = __webpack_require__(8)
7261 , $task = __webpack_require__(208);
7262 $export($export.G + $export.B, {
7263 setImmediate: $task.set,
7264 clearImmediate: $task.clear
7269 /***/ function(module, exports, __webpack_require__) {
7271 var $iterators = __webpack_require__(193)
7272 , redefine = __webpack_require__(18)
7273 , global = __webpack_require__(4)
7274 , hide = __webpack_require__(10)
7275 , Iterators = __webpack_require__(129)
7276 , wks = __webpack_require__(25)
7277 , ITERATOR = wks('iterator')
7278 , TO_STRING_TAG = wks('toStringTag')
7279 , ArrayValues = Iterators.Array;
7281 for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
7282 var NAME = collections[i]
7283 , Collection = global[NAME]
7284 , proto = Collection && Collection.prototype
7287 if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues);
7288 if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
7289 Iterators[NAME] = ArrayValues;
7290 for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true);
7296 /***/ function(module, exports, __webpack_require__) {
7298 /* WEBPACK VAR INJECTION */(function(global, process) {/**
7299 * Copyright (c) 2014, Facebook, Inc.
7300 * All rights reserved.
7302 * This source code is licensed under the BSD-style license found in the
7303 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
7304 * additional grant of patent rights can be found in the PATENTS file in
7305 * the same directory.
7308 !(function(global) {
7311 var hasOwn = Object.prototype.hasOwnProperty;
7312 var undefined; // More compressible than void 0.
7313 var $Symbol = typeof Symbol === "function" ? Symbol : {};
7314 var iteratorSymbol = $Symbol.iterator || "@@iterator";
7315 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
7317 var inModule = typeof module === "object";
7318 var runtime = global.regeneratorRuntime;
7321 // If regeneratorRuntime is defined globally and we're in a module,
7322 // make the exports object identical to regeneratorRuntime.
7323 module.exports = runtime;
7325 // Don't bother evaluating the rest of this file if the runtime was
7326 // already defined globally.
7330 // Define the runtime globally (as expected by generated code) as either
7331 // module.exports (if we're in a module) or a new, empty object.
7332 runtime = global.regeneratorRuntime = inModule ? module.exports : {};
7334 function wrap(innerFn, outerFn, self, tryLocsList) {
7335 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
7336 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
7337 var generator = Object.create(protoGenerator.prototype);
7338 var context = new Context(tryLocsList || []);
7340 // The ._invoke method unifies the implementations of the .next,
7341 // .throw, and .return methods.
7342 generator._invoke = makeInvokeMethod(innerFn, self, context);
7346 runtime.wrap = wrap;
7348 // Try/catch helper to minimize deoptimizations. Returns a completion
7349 // record like context.tryEntries[i].completion. This interface could
7350 // have been (and was previously) designed to take a closure to be
7351 // invoked without arguments, but in all the cases we care about we
7352 // already have an existing method we want to call, so there's no need
7353 // to create a new function object. We can even get away with assuming
7354 // the method takes exactly one argument, since that happens to be true
7355 // in every case, so we don't have to touch the arguments object. The
7356 // only additional allocation required is the completion record, which
7357 // has a stable shape and so hopefully should be cheap to allocate.
7358 function tryCatch(fn, obj, arg) {
7360 return { type: "normal", arg: fn.call(obj, arg) };
7362 return { type: "throw", arg: err };
7366 var GenStateSuspendedStart = "suspendedStart";
7367 var GenStateSuspendedYield = "suspendedYield";
7368 var GenStateExecuting = "executing";
7369 var GenStateCompleted = "completed";
7371 // Returning this object from the innerFn has the same effect as
7372 // breaking out of the dispatch switch statement.
7373 var ContinueSentinel = {};
7375 // Dummy constructor functions that we use as the .constructor and
7376 // .constructor.prototype properties for functions that return Generator
7377 // objects. For full spec compliance, you may wish to configure your
7378 // minifier not to mangle the names of these two functions.
7379 function Generator() {}
7380 function GeneratorFunction() {}
7381 function GeneratorFunctionPrototype() {}
7383 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype;
7384 GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
7385 GeneratorFunctionPrototype.constructor = GeneratorFunction;
7386 GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction";
7388 // Helper for defining the .next, .throw, and .return methods of the
7389 // Iterator interface in terms of a single ._invoke method.
7390 function defineIteratorMethods(prototype) {
7391 ["next", "throw", "return"].forEach(function(method) {
7392 prototype[method] = function(arg) {
7393 return this._invoke(method, arg);
7398 runtime.isGeneratorFunction = function(genFun) {
7399 var ctor = typeof genFun === "function" && genFun.constructor;
7401 ? ctor === GeneratorFunction ||
7402 // For the native GeneratorFunction constructor, the best we can
7403 // do is to check its .name property.
7404 (ctor.displayName || ctor.name) === "GeneratorFunction"
7408 runtime.mark = function(genFun) {
7409 if (Object.setPrototypeOf) {
7410 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
7412 genFun.__proto__ = GeneratorFunctionPrototype;
7413 if (!(toStringTagSymbol in genFun)) {
7414 genFun[toStringTagSymbol] = "GeneratorFunction";
7417 genFun.prototype = Object.create(Gp);
7421 // Within the body of any async function, `await x` is transformed to
7422 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
7423 // `value instanceof AwaitArgument` to determine if the yielded value is
7424 // meant to be awaited. Some may consider the name of this method too
7425 // cutesy, but they are curmudgeons.
7426 runtime.awrap = function(arg) {
7427 return new AwaitArgument(arg);
7430 function AwaitArgument(arg) {
7434 function AsyncIterator(generator) {
7435 function invoke(method, arg, resolve, reject) {
7436 var record = tryCatch(generator[method], generator, arg);
7437 if (record.type === "throw") {
7440 var result = record.arg;
7441 var value = result.value;
7442 if (value instanceof AwaitArgument) {
7443 return Promise.resolve(value.arg).then(function(value) {
7444 invoke("next", value, resolve, reject);
7446 invoke("throw", err, resolve, reject);
7450 return Promise.resolve(value).then(function(unwrapped) {
7451 // When a yielded Promise is resolved, its final value becomes
7452 // the .value of the Promise<{value,done}> result for the
7453 // current iteration. If the Promise is rejected, however, the
7454 // result for this iteration will be rejected with the same
7455 // reason. Note that rejections of yielded Promises are not
7456 // thrown back into the generator function, as is the case
7457 // when an awaited Promise is rejected. This difference in
7458 // behavior between yield and await is important, because it
7459 // allows the consumer to decide what to do with the yielded
7460 // rejection (swallow it and continue, manually .throw it back
7461 // into the generator, abandon iteration, whatever). With
7462 // await, by contrast, there is no opportunity to examine the
7463 // rejection reason outside the generator function, so the
7464 // only option is to throw it from the await expression, and
7465 // let the generator function handle the exception.
7466 result.value = unwrapped;
7472 if (typeof process === "object" && process.domain) {
7473 invoke = process.domain.bind(invoke);
7476 var previousPromise;
7478 function enqueue(method, arg) {
7479 function callInvokeWithMethodAndArg() {
7480 return new Promise(function(resolve, reject) {
7481 invoke(method, arg, resolve, reject);
7485 return previousPromise =
7486 // If enqueue has been called before, then we want to wait until
7487 // all previous Promises have been resolved before calling invoke,
7488 // so that results are always delivered in the correct order. If
7489 // enqueue has not been called before, then it is important to
7490 // call invoke immediately, without waiting on a callback to fire,
7491 // so that the async generator function has the opportunity to do
7492 // any necessary setup in a predictable way. This predictability
7493 // is why the Promise constructor synchronously invokes its
7494 // executor callback, and why async functions synchronously
7495 // execute code before the first await. Since we implement simple
7496 // async functions in terms of async generators, it is especially
7497 // important to get this right, even though it requires care.
7498 previousPromise ? previousPromise.then(
7499 callInvokeWithMethodAndArg,
7500 // Avoid propagating failures to Promises returned by later
7501 // invocations of the iterator.
7502 callInvokeWithMethodAndArg
7503 ) : callInvokeWithMethodAndArg();
7506 // Define the unified helper method that is used to implement .next,
7507 // .throw, and .return (see defineIteratorMethods).
7508 this._invoke = enqueue;
7511 defineIteratorMethods(AsyncIterator.prototype);
7513 // Note that simple async functions are implemented on top of
7514 // AsyncIterator objects; they just return a Promise for the value of
7515 // the final result produced by the iterator.
7516 runtime.async = function(innerFn, outerFn, self, tryLocsList) {
7517 var iter = new AsyncIterator(
7518 wrap(innerFn, outerFn, self, tryLocsList)
7521 return runtime.isGeneratorFunction(outerFn)
7522 ? iter // If outerFn is a generator, return the full iterator.
7523 : iter.next().then(function(result) {
7524 return result.done ? result.value : iter.next();
7528 function makeInvokeMethod(innerFn, self, context) {
7529 var state = GenStateSuspendedStart;
7531 return function invoke(method, arg) {
7532 if (state === GenStateExecuting) {
7533 throw new Error("Generator is already running");
7536 if (state === GenStateCompleted) {
7537 if (method === "throw") {
7541 // Be forgiving, per 25.3.3.3.3 of the spec:
7542 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
7543 return doneResult();
7547 var delegate = context.delegate;
7549 if (method === "return" ||
7550 (method === "throw" && delegate.iterator[method] === undefined)) {
7551 // A return or throw (when the delegate iterator has no throw
7552 // method) always terminates the yield* loop.
7553 context.delegate = null;
7555 // If the delegate iterator has a return method, give it a
7556 // chance to clean up.
7557 var returnMethod = delegate.iterator["return"];
7559 var record = tryCatch(returnMethod, delegate.iterator, arg);
7560 if (record.type === "throw") {
7561 // If the return method threw an exception, let that
7562 // exception prevail over the original return or throw.
7569 if (method === "return") {
7570 // Continue with the outer return, now that the delegate
7571 // iterator has been terminated.
7576 var record = tryCatch(
7577 delegate.iterator[method],
7582 if (record.type === "throw") {
7583 context.delegate = null;
7585 // Like returning generator.throw(uncaught), but without the
7586 // overhead of an extra function call.
7592 // Delegate generator ran and handled its own exceptions so
7593 // regardless of what the method was, we continue as if it is
7594 // "next" with an undefined arg.
7598 var info = record.arg;
7600 context[delegate.resultName] = info.value;
7601 context.next = delegate.nextLoc;
7603 state = GenStateSuspendedYield;
7607 context.delegate = null;
7610 if (method === "next") {
7611 // Setting context._sent for legacy support of Babel's
7612 // function.sent implementation.
7613 context.sent = context._sent = arg;
7615 } else if (method === "throw") {
7616 if (state === GenStateSuspendedStart) {
7617 state = GenStateCompleted;
7621 if (context.dispatchException(arg)) {
7622 // If the dispatched exception was caught by a catch block,
7623 // then let that catch block handle the exception normally.
7628 } else if (method === "return") {
7629 context.abrupt("return", arg);
7632 state = GenStateExecuting;
7634 var record = tryCatch(innerFn, self, context);
7635 if (record.type === "normal") {
7636 // If an exception is thrown from innerFn, we leave state ===
7637 // GenStateExecuting and loop back for another invocation.
7638 state = context.done
7640 : GenStateSuspendedYield;
7647 if (record.arg === ContinueSentinel) {
7648 if (context.delegate && method === "next") {
7649 // Deliberately forget the last sent value so that we don't
7650 // accidentally pass it on to the delegate.
7657 } else if (record.type === "throw") {
7658 state = GenStateCompleted;
7659 // Dispatch the exception by looping back around to the
7660 // context.dispatchException(arg) call above.
7668 // Define Generator.prototype.{next,throw,return} in terms of the
7669 // unified ._invoke helper method.
7670 defineIteratorMethods(Gp);
7672 Gp[iteratorSymbol] = function() {
7676 Gp[toStringTagSymbol] = "Generator";
7678 Gp.toString = function() {
7679 return "[object Generator]";
7682 function pushTryEntry(locs) {
7683 var entry = { tryLoc: locs[0] };
7686 entry.catchLoc = locs[1];
7690 entry.finallyLoc = locs[2];
7691 entry.afterLoc = locs[3];
7694 this.tryEntries.push(entry);
7697 function resetTryEntry(entry) {
7698 var record = entry.completion || {};
7699 record.type = "normal";
7701 entry.completion = record;
7704 function Context(tryLocsList) {
7705 // The root entry object (effectively a try statement without a catch
7706 // or a finally block) gives us a place to store values thrown from
7707 // locations where there is no enclosing try statement.
7708 this.tryEntries = [{ tryLoc: "root" }];
7709 tryLocsList.forEach(pushTryEntry, this);
7713 runtime.keys = function(object) {
7715 for (var key in object) {
7720 // Rather than returning an object with a next method, we keep
7721 // things simple and return the next function itself.
7722 return function next() {
7723 while (keys.length) {
7724 var key = keys.pop();
7725 if (key in object) {
7732 // To avoid creating an additional object, we just hang the .value
7733 // and .done properties off the next function object itself. This
7734 // also ensures that the minifier will not anonymize the function.
7740 function values(iterable) {
7742 var iteratorMethod = iterable[iteratorSymbol];
7743 if (iteratorMethod) {
7744 return iteratorMethod.call(iterable);
7747 if (typeof iterable.next === "function") {
7751 if (!isNaN(iterable.length)) {
7752 var i = -1, next = function next() {
7753 while (++i < iterable.length) {
7754 if (hasOwn.call(iterable, i)) {
7755 next.value = iterable[i];
7761 next.value = undefined;
7767 return next.next = next;
7771 // Return an iterator with no values.
7772 return { next: doneResult };
7774 runtime.values = values;
7776 function doneResult() {
7777 return { value: undefined, done: true };
7780 Context.prototype = {
7781 constructor: Context,
7783 reset: function(skipTempReset) {
7786 // Resetting context._sent for legacy support of Babel's
7787 // function.sent implementation.
7788 this.sent = this._sent = undefined;
7790 this.delegate = null;
7792 this.tryEntries.forEach(resetTryEntry);
7794 if (!skipTempReset) {
7795 for (var name in this) {
7796 // Not sure about the optimal order of these conditions:
7797 if (name.charAt(0) === "t" &&
7798 hasOwn.call(this, name) &&
7799 !isNaN(+name.slice(1))) {
7800 this[name] = undefined;
7809 var rootEntry = this.tryEntries[0];
7810 var rootRecord = rootEntry.completion;
7811 if (rootRecord.type === "throw") {
7812 throw rootRecord.arg;
7818 dispatchException: function(exception) {
7824 function handle(loc, caught) {
7825 record.type = "throw";
7826 record.arg = exception;
7831 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
7832 var entry = this.tryEntries[i];
7833 var record = entry.completion;
7835 if (entry.tryLoc === "root") {
7836 // Exception thrown outside of any try block that could handle
7837 // it, so set the completion value of the entire function to
7838 // throw the exception.
7839 return handle("end");
7842 if (entry.tryLoc <= this.prev) {
7843 var hasCatch = hasOwn.call(entry, "catchLoc");
7844 var hasFinally = hasOwn.call(entry, "finallyLoc");
7846 if (hasCatch && hasFinally) {
7847 if (this.prev < entry.catchLoc) {
7848 return handle(entry.catchLoc, true);
7849 } else if (this.prev < entry.finallyLoc) {
7850 return handle(entry.finallyLoc);
7853 } else if (hasCatch) {
7854 if (this.prev < entry.catchLoc) {
7855 return handle(entry.catchLoc, true);
7858 } else if (hasFinally) {
7859 if (this.prev < entry.finallyLoc) {
7860 return handle(entry.finallyLoc);
7864 throw new Error("try statement without catch or finally");
7870 abrupt: function(type, arg) {
7871 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
7872 var entry = this.tryEntries[i];
7873 if (entry.tryLoc <= this.prev &&
7874 hasOwn.call(entry, "finallyLoc") &&
7875 this.prev < entry.finallyLoc) {
7876 var finallyEntry = entry;
7882 (type === "break" ||
7883 type === "continue") &&
7884 finallyEntry.tryLoc <= arg &&
7885 arg <= finallyEntry.finallyLoc) {
7886 // Ignore the finally entry if control is not jumping to a
7887 // location outside the try/catch block.
7888 finallyEntry = null;
7891 var record = finallyEntry ? finallyEntry.completion : {};
7896 this.next = finallyEntry.finallyLoc;
7898 this.complete(record);
7901 return ContinueSentinel;
7904 complete: function(record, afterLoc) {
7905 if (record.type === "throw") {
7909 if (record.type === "break" ||
7910 record.type === "continue") {
7911 this.next = record.arg;
7912 } else if (record.type === "return") {
7913 this.rval = record.arg;
7915 } else if (record.type === "normal" && afterLoc) {
7916 this.next = afterLoc;
7920 finish: function(finallyLoc) {
7921 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
7922 var entry = this.tryEntries[i];
7923 if (entry.finallyLoc === finallyLoc) {
7924 this.complete(entry.completion, entry.afterLoc);
7925 resetTryEntry(entry);
7926 return ContinueSentinel;
7931 "catch": function(tryLoc) {
7932 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
7933 var entry = this.tryEntries[i];
7934 if (entry.tryLoc === tryLoc) {
7935 var record = entry.completion;
7936 if (record.type === "throw") {
7937 var thrown = record.arg;
7938 resetTryEntry(entry);
7944 // The context.catch method must only be called with a location
7945 // argument that corresponds to a known catch block.
7946 throw new Error("illegal catch attempt");
7949 delegateYield: function(iterable, resultName, nextLoc) {
7951 iterator: values(iterable),
7952 resultName: resultName,
7956 return ContinueSentinel;
7960 // Among the various tricks for obtaining a reference to the global
7961 // object, this seems to be the most reliable technique that does not
7962 // use indirect eval (which violates Content Security Policy).
7963 typeof global === "object" ? global :
7964 typeof window === "object" ? window :
7965 typeof self === "object" ? self : this
7968 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(294)))
7972 /***/ function(module, exports) {
7974 // shim for using process in browser
7975 var process = module.exports = {};
7977 // cached from whatever global is present so that test runners that stub it
7978 // don't break things. But we need to wrap it in a try catch in case it is
7979 // wrapped in strict mode code which doesn't define any globals. It's inside a
7980 // function because try/catches deoptimize in certain engines.
7982 var cachedSetTimeout;
7983 var cachedClearTimeout;
7985 function defaultSetTimout() {
7986 throw new Error('setTimeout has not been defined');
7988 function defaultClearTimeout () {
7989 throw new Error('clearTimeout has not been defined');
7993 if (typeof setTimeout === 'function') {
7994 cachedSetTimeout = setTimeout;
7996 cachedSetTimeout = defaultSetTimout;
7999 cachedSetTimeout = defaultSetTimout;
8002 if (typeof clearTimeout === 'function') {
8003 cachedClearTimeout = clearTimeout;
8005 cachedClearTimeout = defaultClearTimeout;
8008 cachedClearTimeout = defaultClearTimeout;
8011 function runTimeout(fun) {
8012 if (cachedSetTimeout === setTimeout) {
8013 //normal enviroments in sane situations
8014 return setTimeout(fun, 0);
8016 // if setTimeout wasn't available but was latter defined
8017 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
8018 cachedSetTimeout = setTimeout;
8019 return setTimeout(fun, 0);
8022 // when when somebody has screwed with setTimeout but no I.E. maddness
8023 return cachedSetTimeout(fun, 0);
8026 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
8027 return cachedSetTimeout.call(null, fun, 0);
8029 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
8030 return cachedSetTimeout.call(this, fun, 0);
8036 function runClearTimeout(marker) {
8037 if (cachedClearTimeout === clearTimeout) {
8038 //normal enviroments in sane situations
8039 return clearTimeout(marker);
8041 // if clearTimeout wasn't available but was latter defined
8042 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
8043 cachedClearTimeout = clearTimeout;
8044 return clearTimeout(marker);
8047 // when when somebody has screwed with setTimeout but no I.E. maddness
8048 return cachedClearTimeout(marker);
8051 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
8052 return cachedClearTimeout.call(null, marker);
8054 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
8055 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
8056 return cachedClearTimeout.call(this, marker);
8064 var draining = false;
8066 var queueIndex = -1;
8068 function cleanUpNextTick() {
8069 if (!draining || !currentQueue) {
8073 if (currentQueue.length) {
8074 queue = currentQueue.concat(queue);
8083 function drainQueue() {
8087 var timeout = runTimeout(cleanUpNextTick);
8090 var len = queue.length;
8092 currentQueue = queue;
8094 while (++queueIndex < len) {
8096 currentQueue[queueIndex].run();
8102 currentQueue = null;
8104 runClearTimeout(timeout);
8107 process.nextTick = function (fun) {
8108 var args = new Array(arguments.length - 1);
8109 if (arguments.length > 1) {
8110 for (var i = 1; i < arguments.length; i++) {
8111 args[i - 1] = arguments[i];
8114 queue.push(new Item(fun, args));
8115 if (queue.length === 1 && !draining) {
8116 runTimeout(drainQueue);
8120 // v8 likes predictible objects
8121 function Item(fun, array) {
8125 Item.prototype.run = function () {
8126 this.fun.apply(null, this.array);
8128 process.title = 'browser';
8129 process.browser = true;
8132 process.version = ''; // empty string to avoid regexp issues
8133 process.versions = {};
8138 process.addListener = noop;
8139 process.once = noop;
8141 process.removeListener = noop;
8142 process.removeAllListeners = noop;
8143 process.emit = noop;
8145 process.binding = function (name) {
8146 throw new Error('process.binding is not supported');
8149 process.cwd = function () { return '/' };
8150 process.chdir = function (dir) {
8151 throw new Error('process.chdir is not supported');
8153 process.umask = function() { return 0; };
8158 /***/ function(module, exports, __webpack_require__) {
8160 __webpack_require__(296);
8161 module.exports = __webpack_require__(9).RegExp.escape;
8165 /***/ function(module, exports, __webpack_require__) {
8167 // https://github.com/benjamingr/RexExp.escape
8168 var $export = __webpack_require__(8)
8169 , $re = __webpack_require__(297)(/[\\^$*+?.()|[\]{}]/g, '\\$&');
8171 $export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }});
8176 /***/ function(module, exports) {
8178 module.exports = function(regExp, replace){
8179 var replacer = replace === Object(replace) ? function(part){
8180 return replace[part];
8182 return function(it){
8183 return String(it).replace(regExp, replacer);
8189 /***/ function(module, exports, __webpack_require__) {
8191 var BSON = __webpack_require__(299),
8192 Binary = __webpack_require__(318),
8193 Code = __webpack_require__(313),
8194 DBRef = __webpack_require__(317),
8195 Decimal128 = __webpack_require__(314),
8196 Double = __webpack_require__(307),
8197 Int32 = __webpack_require__(312),
8198 Long = __webpack_require__(306),
8199 Map = __webpack_require__(305),
8200 MaxKey = __webpack_require__(316),
8201 MinKey = __webpack_require__(315),
8202 ObjectId = __webpack_require__(309),
8203 BSONRegExp = __webpack_require__(310),
8204 Symbol = __webpack_require__(311),
8205 Timestamp = __webpack_require__(308);
8208 BSON.BSON_INT32_MAX = 0x7FFFFFFF;
8209 BSON.BSON_INT32_MIN = -0x80000000;
8211 BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
8212 BSON.BSON_INT64_MIN = -Math.pow(2, 63);
8214 // JS MAX PRECISE VALUES
8215 BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
8216 BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
8218 // Add BSON types to function creation
8219 BSON.Binary = Binary;
8222 BSON.Decimal128 = Decimal128;
8223 BSON.Double = Double;
8227 BSON.MaxKey = MaxKey;
8228 BSON.MinKey = MinKey;
8229 BSON.ObjectId = ObjectId;
8230 BSON.ObjectID = ObjectId;
8231 BSON.BSONRegExp = BSONRegExp;
8232 BSON.Symbol = Symbol;
8233 BSON.Timestamp = Timestamp;
8236 module.exports = BSON;
8240 /***/ function(module, exports, __webpack_require__) {
8242 /* WEBPACK VAR INJECTION */(function(Buffer) {"use strict";
8244 var writeIEEE754 = __webpack_require__(304).writeIEEE754,
8245 readIEEE754 = __webpack_require__(304).readIEEE754,
8246 Map = __webpack_require__(305),
8247 Long = __webpack_require__(306),
8248 Double = __webpack_require__(307),
8249 Timestamp = __webpack_require__(308),
8250 ObjectID = __webpack_require__(309),
8251 BSONRegExp = __webpack_require__(310),
8252 Symbol = __webpack_require__(311),
8253 Int32 = __webpack_require__(312),
8254 Code = __webpack_require__(313),
8255 Decimal128 = __webpack_require__(314),
8256 MinKey = __webpack_require__(315),
8257 MaxKey = __webpack_require__(316),
8258 DBRef = __webpack_require__(317),
8259 Binary = __webpack_require__(318);
8261 // Parts of the parser
8262 var deserialize = __webpack_require__(319),
8263 serializer = __webpack_require__(323),
8264 calculateObjectSize = __webpack_require__(324);
8271 var MAXSIZE = 1024 * 1024 * 17;
8272 // Max Document Buffer size
8273 var buffer = new Buffer(MAXSIZE);
8275 var BSON = function () {};
8278 * Serialize a Javascript object.
8280 * @param {Object} object the Javascript object to serialize.
8281 * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
8282 * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
8283 * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
8284 * @return {Buffer} returns the Buffer object containing the serialized object.
8287 BSON.prototype.serialize = function serialize(object, options) {
8288 options = options || {};
8289 // Unpack the options
8290 var checkKeys = typeof options.checkKeys == 'boolean' ? options.checkKeys : false;
8291 var serializeFunctions = typeof options.serializeFunctions == 'boolean' ? options.serializeFunctions : false;
8292 var ignoreUndefined = typeof options.ignoreUndefined == 'boolean' ? options.ignoreUndefined : true;
8294 // console.log("===================================== serialize")
8295 // console.log("checkKeys = " + checkKeys)
8296 // console.log("serializeFunctions = " + serializeFunctions)
8297 // console.log("ignoreUndefined = " + ignoreUndefined)
8299 // Attempt to serialize
8300 var serializationIndex = serializer(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []);
8301 // Create the final buffer
8302 var finishedBuffer = new Buffer(serializationIndex);
8303 // Copy into the finished buffer
8304 buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length);
8305 // Return the buffer
8306 return finishedBuffer;
8310 * Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.
8312 * @param {Object} object the Javascript object to serialize.
8313 * @param {Buffer} buffer the Buffer you pre-allocated to store the serialized BSON object.
8314 * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
8315 * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
8316 * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
8317 * @param {Number} [options.index] the index in the buffer where we wish to start serializing into.
8318 * @return {Number} returns the index pointing to the last written byte in the buffer.
8321 BSON.prototype.serializeWithBufferAndIndex = function (object, finalBuffer, options) {
8322 options = options || {};
8323 // Unpack the options
8324 var checkKeys = typeof options.checkKeys == 'boolean' ? options.checkKeys : false;
8325 var serializeFunctions = typeof options.serializeFunctions == 'boolean' ? options.serializeFunctions : false;
8326 var ignoreUndefined = typeof options.ignoreUndefined == 'boolean' ? options.ignoreUndefined : true;
8327 var startIndex = typeof options.index == 'number' ? options.index : 0;
8329 // console.log("===================================== serializeWithBufferAndIndex")
8330 // console.log("checkKeys = " + checkKeys)
8331 // console.log("serializeFunctions = " + serializeFunctions)
8332 // console.log("ignoreUndefined = " + ignoreUndefined)
8333 // console.log("startIndex = " + startIndex)
8335 // Attempt to serialize
8336 var serializationIndex = serializer(buffer, object, checkKeys, startIndex || 0, 0, serializeFunctions, ignoreUndefined);
8337 buffer.copy(finalBuffer, startIndex, 0, serializationIndex);
8340 return serializationIndex - 1;
8344 * Deserialize data as BSON.
8347 * - **evalFunctions** {Boolean, default:false}, evaluate functions in the BSON document scoped to the object deserialized.
8348 * - **cacheFunctions** {Boolean, default:false}, cache evaluated functions for reuse.
8349 * - **cacheFunctionsCrc32** {Boolean, default:false}, use a crc32 code for caching, otherwise use the string of the function.
8350 * - **promoteLongs** {Boolean, default:true}, when deserializing a Long will fit it into a Number if it's smaller than 53 bits
8352 * @param {Buffer} buffer the buffer containing the serialized set of BSON documents.
8353 * @param {Object} [options] additional options used for the deserialization.
8354 * @param {Boolean} [isArray] ignore used for recursive parsing.
8355 * @return {Object} returns the deserialized Javascript Object.
8358 BSON.prototype.deserialize = function (data, options) {
8359 return deserialize(data, options);
8363 * Calculate the bson size for a passed in Javascript object.
8365 * @param {Object} object the Javascript object to calculate the BSON byte size for.
8366 * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
8367 * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
8368 * @return {Number} returns the number of bytes the BSON object will take up.
8371 BSON.prototype.calculateObjectSize = function (object, options) {
8372 options = options || {};
8374 var serializeFunctions = typeof options.serializeFunctions == 'boolean' ? options.serializeFunctions : false;
8375 var ignoreUndefined = typeof options.ignoreUndefined == 'boolean' ? options.ignoreUndefined : true;
8377 return calculateObjectSize(object, serializeFunctions, ignoreUndefined);
8381 * Deserialize stream data as BSON documents.
8384 * - **evalFunctions** {Boolean, default:false}, evaluate functions in the BSON document scoped to the object deserialized.
8385 * - **cacheFunctions** {Boolean, default:false}, cache evaluated functions for reuse.
8386 * - **cacheFunctionsCrc32** {Boolean, default:false}, use a crc32 code for caching, otherwise use the string of the function.
8387 * - **promoteLongs** {Boolean, default:true}, when deserializing a Long will fit it into a Number if it's smaller than 53 bits
8389 * @param {Buffer} data the buffer containing the serialized set of BSON documents.
8390 * @param {Number} startIndex the start index in the data Buffer where the deserialization is to start.
8391 * @param {Number} numberOfDocuments number of documents to deserialize.
8392 * @param {Array} documents an array where to store the deserialized documents.
8393 * @param {Number} docStartIndex the index in the documents array from where to start inserting documents.
8394 * @param {Object} [options] additional options used for the deserialization.
8395 * @return {Number} returns the next index in the buffer after deserialization **x** numbers of documents.
8398 BSON.prototype.deserializeStream = function (data, startIndex, numberOfDocuments, documents, docStartIndex, options) {
8399 // if(numberOfDocuments !== documents.length) throw new Error("Number of expected results back is less than the number of documents");
8400 options = options != null ? options : {};
8401 var index = startIndex;
8402 // Loop over all documents
8403 for (var i = 0; i < numberOfDocuments; i++) {
8404 // Find size of the document
8405 var size = data[index] | data[index + 1] << 8 | data[index + 2] << 16 | data[index + 3] << 24;
8406 // Update options with index
8407 options['index'] = index;
8408 // Parse the document at this point
8409 documents[docStartIndex + i] = this.deserialize(data, options);
8410 // Adjust index by the document size
8411 index = index + size;
8414 // Return object containing end index of parsing and list of documents
8423 BSON.BSON_INT32_MAX = 0x7FFFFFFF;
8424 BSON.BSON_INT32_MIN = -0x80000000;
8426 BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
8427 BSON.BSON_INT64_MIN = -Math.pow(2, 63);
8429 // JS MAX PRECISE VALUES
8430 BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
8431 BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
8433 // Internal long versions
8434 var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
8435 var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
8440 * @classconstant BSON_DATA_NUMBER
8442 BSON.BSON_DATA_NUMBER = 1;
8446 * @classconstant BSON_DATA_STRING
8448 BSON.BSON_DATA_STRING = 2;
8452 * @classconstant BSON_DATA_OBJECT
8454 BSON.BSON_DATA_OBJECT = 3;
8458 * @classconstant BSON_DATA_ARRAY
8460 BSON.BSON_DATA_ARRAY = 4;
8464 * @classconstant BSON_DATA_BINARY
8466 BSON.BSON_DATA_BINARY = 5;
8468 * ObjectID BSON Type
8470 * @classconstant BSON_DATA_OID
8472 BSON.BSON_DATA_OID = 7;
8476 * @classconstant BSON_DATA_BOOLEAN
8478 BSON.BSON_DATA_BOOLEAN = 8;
8482 * @classconstant BSON_DATA_DATE
8484 BSON.BSON_DATA_DATE = 9;
8488 * @classconstant BSON_DATA_NULL
8490 BSON.BSON_DATA_NULL = 10;
8494 * @classconstant BSON_DATA_REGEXP
8496 BSON.BSON_DATA_REGEXP = 11;
8500 * @classconstant BSON_DATA_CODE
8502 BSON.BSON_DATA_CODE = 13;
8506 * @classconstant BSON_DATA_SYMBOL
8508 BSON.BSON_DATA_SYMBOL = 14;
8510 * Code with Scope BSON Type
8512 * @classconstant BSON_DATA_CODE_W_SCOPE
8514 BSON.BSON_DATA_CODE_W_SCOPE = 15;
8516 * 32 bit Integer BSON Type
8518 * @classconstant BSON_DATA_INT
8520 BSON.BSON_DATA_INT = 16;
8522 * Timestamp BSON Type
8524 * @classconstant BSON_DATA_TIMESTAMP
8526 BSON.BSON_DATA_TIMESTAMP = 17;
8530 * @classconstant BSON_DATA_LONG
8532 BSON.BSON_DATA_LONG = 18;
8536 * @classconstant BSON_DATA_MIN_KEY
8538 BSON.BSON_DATA_MIN_KEY = 0xff;
8542 * @classconstant BSON_DATA_MAX_KEY
8544 BSON.BSON_DATA_MAX_KEY = 0x7f;
8547 * Binary Default Type
8549 * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
8551 BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
8553 * Binary Function Type
8555 * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
8557 BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
8559 * Binary Byte Array Type
8561 * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
8563 BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
8567 * @classconstant BSON_BINARY_SUBTYPE_UUID
8569 BSON.BSON_BINARY_SUBTYPE_UUID = 3;
8573 * @classconstant BSON_BINARY_SUBTYPE_MD5
8575 BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
8577 * Binary User Defined Type
8579 * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
8581 BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
8584 module.exports = BSON;
8585 module.exports.Code = Code;
8586 module.exports.Map = Map;
8587 module.exports.Symbol = Symbol;
8588 module.exports.BSON = BSON;
8589 module.exports.DBRef = DBRef;
8590 module.exports.Binary = Binary;
8591 module.exports.ObjectID = ObjectID;
8592 module.exports.Long = Long;
8593 module.exports.Timestamp = Timestamp;
8594 module.exports.Double = Double;
8595 module.exports.Int32 = Int32;
8596 module.exports.MinKey = MinKey;
8597 module.exports.MaxKey = MaxKey;
8598 module.exports.BSONRegExp = BSONRegExp;
8599 module.exports.Decimal128 = Decimal128;
8600 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(300).Buffer))
8604 /***/ function(module, exports, __webpack_require__) {
8606 /* WEBPACK VAR INJECTION */(function(Buffer, global) {/*!
8607 * The buffer module from node.js, for the browser.
8609 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
8612 /* eslint-disable no-proto */
8616 var base64 = __webpack_require__(301)
8617 var ieee754 = __webpack_require__(302)
8618 var isArray = __webpack_require__(303)
8620 exports.Buffer = Buffer
8621 exports.SlowBuffer = SlowBuffer
8622 exports.INSPECT_MAX_BYTES = 50
8625 * If `Buffer.TYPED_ARRAY_SUPPORT`:
8626 * === true Use Uint8Array implementation (fastest)
8627 * === false Use Object implementation (most compatible, even IE6)
8629 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
8630 * Opera 11.6+, iOS 4.2+.
8632 * Due to various browser bugs, sometimes the Object implementation will be used even
8633 * when the browser supports typed arrays.
8637 * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
8638 * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
8640 * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
8642 * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
8643 * incorrect length in some situations.
8645 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
8646 * get the Object implementation, which is slower but behaves correctly.
8648 Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
8649 ? global.TYPED_ARRAY_SUPPORT
8650 : typedArraySupport()
8653 * Export kMaxLength after typed array support is determined.
8655 exports.kMaxLength = kMaxLength()
8657 function typedArraySupport () {
8659 var arr = new Uint8Array(1)
8660 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
8661 return arr.foo() === 42 && // typed array instances can be augmented
8662 typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
8663 arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
8669 function kMaxLength () {
8670 return Buffer.TYPED_ARRAY_SUPPORT
8675 function createBuffer (that, length) {
8676 if (kMaxLength() < length) {
8677 throw new RangeError('Invalid typed array length')
8679 if (Buffer.TYPED_ARRAY_SUPPORT) {
8680 // Return an augmented `Uint8Array` instance, for best performance
8681 that = new Uint8Array(length)
8682 that.__proto__ = Buffer.prototype
8684 // Fallback: Return an object instance of the Buffer class
8685 if (that === null) {
8686 that = new Buffer(length)
8688 that.length = length
8695 * The Buffer constructor returns instances of `Uint8Array` that have their
8696 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
8697 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
8698 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
8699 * returns a single octet.
8701 * The `Uint8Array` prototype remains unmodified.
8704 function Buffer (arg, encodingOrOffset, length) {
8705 if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
8706 return new Buffer(arg, encodingOrOffset, length)
8710 if (typeof arg === 'number') {
8711 if (typeof encodingOrOffset === 'string') {
8713 'If encoding is specified then the first argument must be a string'
8716 return allocUnsafe(this, arg)
8718 return from(this, arg, encodingOrOffset, length)
8721 Buffer.poolSize = 8192 // not used by this implementation
8723 // TODO: Legacy, not needed anymore. Remove in next major version.
8724 Buffer._augment = function (arr) {
8725 arr.__proto__ = Buffer.prototype
8729 function from (that, value, encodingOrOffset, length) {
8730 if (typeof value === 'number') {
8731 throw new TypeError('"value" argument must not be a number')
8734 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
8735 return fromArrayBuffer(that, value, encodingOrOffset, length)
8738 if (typeof value === 'string') {
8739 return fromString(that, value, encodingOrOffset)
8742 return fromObject(that, value)
8746 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
8747 * if value is a number.
8748 * Buffer.from(str[, encoding])
8749 * Buffer.from(array)
8750 * Buffer.from(buffer)
8751 * Buffer.from(arrayBuffer[, byteOffset[, length]])
8753 Buffer.from = function (value, encodingOrOffset, length) {
8754 return from(null, value, encodingOrOffset, length)
8757 if (Buffer.TYPED_ARRAY_SUPPORT) {
8758 Buffer.prototype.__proto__ = Uint8Array.prototype
8759 Buffer.__proto__ = Uint8Array
8760 if (typeof Symbol !== 'undefined' && Symbol.species &&
8761 Buffer[Symbol.species] === Buffer) {
8762 // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
8763 Object.defineProperty(Buffer, Symbol.species, {
8770 function assertSize (size) {
8771 if (typeof size !== 'number') {
8772 throw new TypeError('"size" argument must be a number')
8773 } else if (size < 0) {
8774 throw new RangeError('"size" argument must not be negative')
8778 function alloc (that, size, fill, encoding) {
8781 return createBuffer(that, size)
8783 if (fill !== undefined) {
8784 // Only pay attention to encoding if it's a string. This
8785 // prevents accidentally sending in a number that would
8786 // be interpretted as a start offset.
8787 return typeof encoding === 'string'
8788 ? createBuffer(that, size).fill(fill, encoding)
8789 : createBuffer(that, size).fill(fill)
8791 return createBuffer(that, size)
8795 * Creates a new filled Buffer instance.
8796 * alloc(size[, fill[, encoding]])
8798 Buffer.alloc = function (size, fill, encoding) {
8799 return alloc(null, size, fill, encoding)
8802 function allocUnsafe (that, size) {
8804 that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
8805 if (!Buffer.TYPED_ARRAY_SUPPORT) {
8806 for (var i = 0; i < size; ++i) {
8814 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
8816 Buffer.allocUnsafe = function (size) {
8817 return allocUnsafe(null, size)
8820 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
8822 Buffer.allocUnsafeSlow = function (size) {
8823 return allocUnsafe(null, size)
8826 function fromString (that, string, encoding) {
8827 if (typeof encoding !== 'string' || encoding === '') {
8831 if (!Buffer.isEncoding(encoding)) {
8832 throw new TypeError('"encoding" must be a valid string encoding')
8835 var length = byteLength(string, encoding) | 0
8836 that = createBuffer(that, length)
8838 var actual = that.write(string, encoding)
8840 if (actual !== length) {
8841 // Writing a hex string, for example, that contains invalid characters will
8842 // cause everything after the first invalid character to be ignored. (e.g.
8843 // 'abxxcd' will be treated as 'ab')
8844 that = that.slice(0, actual)
8850 function fromArrayLike (that, array) {
8851 var length = array.length < 0 ? 0 : checked(array.length) | 0
8852 that = createBuffer(that, length)
8853 for (var i = 0; i < length; i += 1) {
8854 that[i] = array[i] & 255
8859 function fromArrayBuffer (that, array, byteOffset, length) {
8860 array.byteLength // this throws if `array` is not a valid ArrayBuffer
8862 if (byteOffset < 0 || array.byteLength < byteOffset) {
8863 throw new RangeError('\'offset\' is out of bounds')
8866 if (array.byteLength < byteOffset + (length || 0)) {
8867 throw new RangeError('\'length\' is out of bounds')
8870 if (byteOffset === undefined && length === undefined) {
8871 array = new Uint8Array(array)
8872 } else if (length === undefined) {
8873 array = new Uint8Array(array, byteOffset)
8875 array = new Uint8Array(array, byteOffset, length)
8878 if (Buffer.TYPED_ARRAY_SUPPORT) {
8879 // Return an augmented `Uint8Array` instance, for best performance
8881 that.__proto__ = Buffer.prototype
8883 // Fallback: Return an object instance of the Buffer class
8884 that = fromArrayLike(that, array)
8889 function fromObject (that, obj) {
8890 if (Buffer.isBuffer(obj)) {
8891 var len = checked(obj.length) | 0
8892 that = createBuffer(that, len)
8894 if (that.length === 0) {
8898 obj.copy(that, 0, 0, len)
8903 if ((typeof ArrayBuffer !== 'undefined' &&
8904 obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
8905 if (typeof obj.length !== 'number' || isnan(obj.length)) {
8906 return createBuffer(that, 0)
8908 return fromArrayLike(that, obj)
8911 if (obj.type === 'Buffer' && isArray(obj.data)) {
8912 return fromArrayLike(that, obj.data)
8916 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
8919 function checked (length) {
8920 // Note: cannot use `length < kMaxLength()` here because that fails when
8921 // length is NaN (which is otherwise coerced to zero.)
8922 if (length >= kMaxLength()) {
8923 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
8924 'size: 0x' + kMaxLength().toString(16) + ' bytes')
8929 function SlowBuffer (length) {
8930 if (+length != length) { // eslint-disable-line eqeqeq
8933 return Buffer.alloc(+length)
8936 Buffer.isBuffer = function isBuffer (b) {
8937 return !!(b != null && b._isBuffer)
8940 Buffer.compare = function compare (a, b) {
8941 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
8942 throw new TypeError('Arguments must be Buffers')
8945 if (a === b) return 0
8950 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
8951 if (a[i] !== b[i]) {
8958 if (x < y) return -1
8963 Buffer.isEncoding = function isEncoding (encoding) {
8964 switch (String(encoding).toLowerCase()) {
8982 Buffer.concat = function concat (list, length) {
8983 if (!isArray(list)) {
8984 throw new TypeError('"list" argument must be an Array of Buffers')
8987 if (list.length === 0) {
8988 return Buffer.alloc(0)
8992 if (length === undefined) {
8994 for (i = 0; i < list.length; ++i) {
8995 length += list[i].length
8999 var buffer = Buffer.allocUnsafe(length)
9001 for (i = 0; i < list.length; ++i) {
9003 if (!Buffer.isBuffer(buf)) {
9004 throw new TypeError('"list" argument must be an Array of Buffers')
9006 buf.copy(buffer, pos)
9012 function byteLength (string, encoding) {
9013 if (Buffer.isBuffer(string)) {
9014 return string.length
9016 if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
9017 (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
9018 return string.byteLength
9020 if (typeof string !== 'string') {
9021 string = '' + string
9024 var len = string.length
9025 if (len === 0) return 0
9027 // Use a for loop to avoid recursion
9028 var loweredCase = false
9038 return utf8ToBytes(string).length
9047 return base64ToBytes(string).length
9049 if (loweredCase) return utf8ToBytes(string).length // assume utf8
9050 encoding = ('' + encoding).toLowerCase()
9055 Buffer.byteLength = byteLength
9057 function slowToString (encoding, start, end) {
9058 var loweredCase = false
9060 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
9061 // property of a typed array.
9063 // This behaves neither like String nor Uint8Array in that we set start/end
9064 // to their upper/lower bounds if the value passed is out of range.
9065 // undefined is handled specially as per ECMA-262 6th Edition,
9066 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
9067 if (start === undefined || start < 0) {
9070 // Return early if start > this.length. Done here to prevent potential uint32
9071 // coercion fail below.
9072 if (start > this.length) {
9076 if (end === undefined || end > this.length) {
9084 // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
9092 if (!encoding) encoding = 'utf8'
9097 return hexSlice(this, start, end)
9101 return utf8Slice(this, start, end)
9104 return asciiSlice(this, start, end)
9108 return latin1Slice(this, start, end)
9111 return base64Slice(this, start, end)
9117 return utf16leSlice(this, start, end)
9120 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
9121 encoding = (encoding + '').toLowerCase()
9127 // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
9128 // Buffer instances.
9129 Buffer.prototype._isBuffer = true
9131 function swap (b, n, m) {
9137 Buffer.prototype.swap16 = function swap16 () {
9138 var len = this.length
9139 if (len % 2 !== 0) {
9140 throw new RangeError('Buffer size must be a multiple of 16-bits')
9142 for (var i = 0; i < len; i += 2) {
9143 swap(this, i, i + 1)
9148 Buffer.prototype.swap32 = function swap32 () {
9149 var len = this.length
9150 if (len % 4 !== 0) {
9151 throw new RangeError('Buffer size must be a multiple of 32-bits')
9153 for (var i = 0; i < len; i += 4) {
9154 swap(this, i, i + 3)
9155 swap(this, i + 1, i + 2)
9160 Buffer.prototype.swap64 = function swap64 () {
9161 var len = this.length
9162 if (len % 8 !== 0) {
9163 throw new RangeError('Buffer size must be a multiple of 64-bits')
9165 for (var i = 0; i < len; i += 8) {
9166 swap(this, i, i + 7)
9167 swap(this, i + 1, i + 6)
9168 swap(this, i + 2, i + 5)
9169 swap(this, i + 3, i + 4)
9174 Buffer.prototype.toString = function toString () {
9175 var length = this.length | 0
9176 if (length === 0) return ''
9177 if (arguments.length === 0) return utf8Slice(this, 0, length)
9178 return slowToString.apply(this, arguments)
9181 Buffer.prototype.equals = function equals (b) {
9182 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
9183 if (this === b) return true
9184 return Buffer.compare(this, b) === 0
9187 Buffer.prototype.inspect = function inspect () {
9189 var max = exports.INSPECT_MAX_BYTES
9190 if (this.length > 0) {
9191 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
9192 if (this.length > max) str += ' ... '
9194 return '<Buffer ' + str + '>'
9197 Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
9198 if (!Buffer.isBuffer(target)) {
9199 throw new TypeError('Argument must be a Buffer')
9202 if (start === undefined) {
9205 if (end === undefined) {
9206 end = target ? target.length : 0
9208 if (thisStart === undefined) {
9211 if (thisEnd === undefined) {
9212 thisEnd = this.length
9215 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
9216 throw new RangeError('out of range index')
9219 if (thisStart >= thisEnd && start >= end) {
9222 if (thisStart >= thisEnd) {
9234 if (this === target) return 0
9236 var x = thisEnd - thisStart
9238 var len = Math.min(x, y)
9240 var thisCopy = this.slice(thisStart, thisEnd)
9241 var targetCopy = target.slice(start, end)
9243 for (var i = 0; i < len; ++i) {
9244 if (thisCopy[i] !== targetCopy[i]) {
9251 if (x < y) return -1
9256 // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
9257 // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
9260 // - buffer - a Buffer to search
9261 // - val - a string, Buffer, or number
9262 // - byteOffset - an index into `buffer`; will be clamped to an int32
9263 // - encoding - an optional encoding, relevant is val is a string
9264 // - dir - true for indexOf, false for lastIndexOf
9265 function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
9266 // Empty buffer means no match
9267 if (buffer.length === 0) return -1
9269 // Normalize byteOffset
9270 if (typeof byteOffset === 'string') {
9271 encoding = byteOffset
9273 } else if (byteOffset > 0x7fffffff) {
9274 byteOffset = 0x7fffffff
9275 } else if (byteOffset < -0x80000000) {
9276 byteOffset = -0x80000000
9278 byteOffset = +byteOffset // Coerce to Number.
9279 if (isNaN(byteOffset)) {
9280 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
9281 byteOffset = dir ? 0 : (buffer.length - 1)
9284 // Normalize byteOffset: negative offsets start from the end of the buffer
9285 if (byteOffset < 0) byteOffset = buffer.length + byteOffset
9286 if (byteOffset >= buffer.length) {
9288 else byteOffset = buffer.length - 1
9289 } else if (byteOffset < 0) {
9290 if (dir) byteOffset = 0
9295 if (typeof val === 'string') {
9296 val = Buffer.from(val, encoding)
9299 // Finally, search either indexOf (if dir is true) or lastIndexOf
9300 if (Buffer.isBuffer(val)) {
9301 // Special case: looking for empty string/buffer always fails
9302 if (val.length === 0) {
9305 return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
9306 } else if (typeof val === 'number') {
9307 val = val & 0xFF // Search for a byte value [0-255]
9308 if (Buffer.TYPED_ARRAY_SUPPORT &&
9309 typeof Uint8Array.prototype.indexOf === 'function') {
9311 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
9313 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
9316 return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
9319 throw new TypeError('val must be string, number or Buffer')
9322 function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
9324 var arrLength = arr.length
9325 var valLength = val.length
9327 if (encoding !== undefined) {
9328 encoding = String(encoding).toLowerCase()
9329 if (encoding === 'ucs2' || encoding === 'ucs-2' ||
9330 encoding === 'utf16le' || encoding === 'utf-16le') {
9331 if (arr.length < 2 || val.length < 2) {
9341 function read (buf, i) {
9342 if (indexSize === 1) {
9345 return buf.readUInt16BE(i * indexSize)
9352 for (i = byteOffset; i < arrLength; i++) {
9353 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
9354 if (foundIndex === -1) foundIndex = i
9355 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
9357 if (foundIndex !== -1) i -= i - foundIndex
9362 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
9363 for (i = byteOffset; i >= 0; i--) {
9365 for (var j = 0; j < valLength; j++) {
9366 if (read(arr, i + j) !== read(val, j)) {
9378 Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
9379 return this.indexOf(val, byteOffset, encoding) !== -1
9382 Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
9383 return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
9386 Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
9387 return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
9390 function hexWrite (buf, string, offset, length) {
9391 offset = Number(offset) || 0
9392 var remaining = buf.length - offset
9396 length = Number(length)
9397 if (length > remaining) {
9402 // must be an even number of digits
9403 var strLen = string.length
9404 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
9406 if (length > strLen / 2) {
9409 for (var i = 0; i < length; ++i) {
9410 var parsed = parseInt(string.substr(i * 2, 2), 16)
9411 if (isNaN(parsed)) return i
9412 buf[offset + i] = parsed
9417 function utf8Write (buf, string, offset, length) {
9418 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
9421 function asciiWrite (buf, string, offset, length) {
9422 return blitBuffer(asciiToBytes(string), buf, offset, length)
9425 function latin1Write (buf, string, offset, length) {
9426 return asciiWrite(buf, string, offset, length)
9429 function base64Write (buf, string, offset, length) {
9430 return blitBuffer(base64ToBytes(string), buf, offset, length)
9433 function ucs2Write (buf, string, offset, length) {
9434 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
9437 Buffer.prototype.write = function write (string, offset, length, encoding) {
9438 // Buffer#write(string)
9439 if (offset === undefined) {
9441 length = this.length
9443 // Buffer#write(string, encoding)
9444 } else if (length === undefined && typeof offset === 'string') {
9446 length = this.length
9448 // Buffer#write(string, offset[, length][, encoding])
9449 } else if (isFinite(offset)) {
9451 if (isFinite(length)) {
9453 if (encoding === undefined) encoding = 'utf8'
9458 // legacy write(string, encoding, offset, length) - remove in v0.13
9461 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
9465 var remaining = this.length - offset
9466 if (length === undefined || length > remaining) length = remaining
9468 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
9469 throw new RangeError('Attempt to write outside buffer bounds')
9472 if (!encoding) encoding = 'utf8'
9474 var loweredCase = false
9478 return hexWrite(this, string, offset, length)
9482 return utf8Write(this, string, offset, length)
9485 return asciiWrite(this, string, offset, length)
9489 return latin1Write(this, string, offset, length)
9492 // Warning: maxLength not taken into account in base64Write
9493 return base64Write(this, string, offset, length)
9499 return ucs2Write(this, string, offset, length)
9502 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
9503 encoding = ('' + encoding).toLowerCase()
9509 Buffer.prototype.toJSON = function toJSON () {
9512 data: Array.prototype.slice.call(this._arr || this, 0)
9516 function base64Slice (buf, start, end) {
9517 if (start === 0 && end === buf.length) {
9518 return base64.fromByteArray(buf)
9520 return base64.fromByteArray(buf.slice(start, end))
9524 function utf8Slice (buf, start, end) {
9525 end = Math.min(buf.length, end)
9530 var firstByte = buf[i]
9531 var codePoint = null
9532 var bytesPerSequence = (firstByte > 0xEF) ? 4
9533 : (firstByte > 0xDF) ? 3
9534 : (firstByte > 0xBF) ? 2
9537 if (i + bytesPerSequence <= end) {
9538 var secondByte, thirdByte, fourthByte, tempCodePoint
9540 switch (bytesPerSequence) {
9542 if (firstByte < 0x80) {
9543 codePoint = firstByte
9547 secondByte = buf[i + 1]
9548 if ((secondByte & 0xC0) === 0x80) {
9549 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
9550 if (tempCodePoint > 0x7F) {
9551 codePoint = tempCodePoint
9556 secondByte = buf[i + 1]
9557 thirdByte = buf[i + 2]
9558 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
9559 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
9560 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
9561 codePoint = tempCodePoint
9566 secondByte = buf[i + 1]
9567 thirdByte = buf[i + 2]
9568 fourthByte = buf[i + 3]
9569 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
9570 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
9571 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
9572 codePoint = tempCodePoint
9578 if (codePoint === null) {
9579 // we did not generate a valid codePoint so insert a
9580 // replacement char (U+FFFD) and advance only 1 byte
9582 bytesPerSequence = 1
9583 } else if (codePoint > 0xFFFF) {
9584 // encode to utf16 (surrogate pair dance)
9585 codePoint -= 0x10000
9586 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
9587 codePoint = 0xDC00 | codePoint & 0x3FF
9591 i += bytesPerSequence
9594 return decodeCodePointsArray(res)
9597 // Based on http://stackoverflow.com/a/22747272/680742, the browser with
9598 // the lowest limit is Chrome, with 0x10000 args.
9599 // We go 1 magnitude less, for safety
9600 var MAX_ARGUMENTS_LENGTH = 0x1000
9602 function decodeCodePointsArray (codePoints) {
9603 var len = codePoints.length
9604 if (len <= MAX_ARGUMENTS_LENGTH) {
9605 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
9608 // Decode in chunks to avoid "call stack size exceeded".
9612 res += String.fromCharCode.apply(
9614 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
9620 function asciiSlice (buf, start, end) {
9622 end = Math.min(buf.length, end)
9624 for (var i = start; i < end; ++i) {
9625 ret += String.fromCharCode(buf[i] & 0x7F)
9630 function latin1Slice (buf, start, end) {
9632 end = Math.min(buf.length, end)
9634 for (var i = start; i < end; ++i) {
9635 ret += String.fromCharCode(buf[i])
9640 function hexSlice (buf, start, end) {
9641 var len = buf.length
9643 if (!start || start < 0) start = 0
9644 if (!end || end < 0 || end > len) end = len
9647 for (var i = start; i < end; ++i) {
9648 out += toHex(buf[i])
9653 function utf16leSlice (buf, start, end) {
9654 var bytes = buf.slice(start, end)
9656 for (var i = 0; i < bytes.length; i += 2) {
9657 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
9662 Buffer.prototype.slice = function slice (start, end) {
9663 var len = this.length
9665 end = end === undefined ? len : ~~end
9669 if (start < 0) start = 0
9670 } else if (start > len) {
9676 if (end < 0) end = 0
9677 } else if (end > len) {
9681 if (end < start) end = start
9684 if (Buffer.TYPED_ARRAY_SUPPORT) {
9685 newBuf = this.subarray(start, end)
9686 newBuf.__proto__ = Buffer.prototype
9688 var sliceLen = end - start
9689 newBuf = new Buffer(sliceLen, undefined)
9690 for (var i = 0; i < sliceLen; ++i) {
9691 newBuf[i] = this[i + start]
9699 * Need to make sure that buffer isn't trying to write out of bounds.
9701 function checkOffset (offset, ext, length) {
9702 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
9703 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
9706 Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
9708 byteLength = byteLength | 0
9709 if (!noAssert) checkOffset(offset, byteLength, this.length)
9711 var val = this[offset]
9714 while (++i < byteLength && (mul *= 0x100)) {
9715 val += this[offset + i] * mul
9721 Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
9723 byteLength = byteLength | 0
9725 checkOffset(offset, byteLength, this.length)
9728 var val = this[offset + --byteLength]
9730 while (byteLength > 0 && (mul *= 0x100)) {
9731 val += this[offset + --byteLength] * mul
9737 Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
9738 if (!noAssert) checkOffset(offset, 1, this.length)
9742 Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
9743 if (!noAssert) checkOffset(offset, 2, this.length)
9744 return this[offset] | (this[offset + 1] << 8)
9747 Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
9748 if (!noAssert) checkOffset(offset, 2, this.length)
9749 return (this[offset] << 8) | this[offset + 1]
9752 Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
9753 if (!noAssert) checkOffset(offset, 4, this.length)
9755 return ((this[offset]) |
9756 (this[offset + 1] << 8) |
9757 (this[offset + 2] << 16)) +
9758 (this[offset + 3] * 0x1000000)
9761 Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
9762 if (!noAssert) checkOffset(offset, 4, this.length)
9764 return (this[offset] * 0x1000000) +
9765 ((this[offset + 1] << 16) |
9766 (this[offset + 2] << 8) |
9770 Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
9772 byteLength = byteLength | 0
9773 if (!noAssert) checkOffset(offset, byteLength, this.length)
9775 var val = this[offset]
9778 while (++i < byteLength && (mul *= 0x100)) {
9779 val += this[offset + i] * mul
9783 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
9788 Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
9790 byteLength = byteLength | 0
9791 if (!noAssert) checkOffset(offset, byteLength, this.length)
9795 var val = this[offset + --i]
9796 while (i > 0 && (mul *= 0x100)) {
9797 val += this[offset + --i] * mul
9801 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
9806 Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
9807 if (!noAssert) checkOffset(offset, 1, this.length)
9808 if (!(this[offset] & 0x80)) return (this[offset])
9809 return ((0xff - this[offset] + 1) * -1)
9812 Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
9813 if (!noAssert) checkOffset(offset, 2, this.length)
9814 var val = this[offset] | (this[offset + 1] << 8)
9815 return (val & 0x8000) ? val | 0xFFFF0000 : val
9818 Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
9819 if (!noAssert) checkOffset(offset, 2, this.length)
9820 var val = this[offset + 1] | (this[offset] << 8)
9821 return (val & 0x8000) ? val | 0xFFFF0000 : val
9824 Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
9825 if (!noAssert) checkOffset(offset, 4, this.length)
9827 return (this[offset]) |
9828 (this[offset + 1] << 8) |
9829 (this[offset + 2] << 16) |
9830 (this[offset + 3] << 24)
9833 Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
9834 if (!noAssert) checkOffset(offset, 4, this.length)
9836 return (this[offset] << 24) |
9837 (this[offset + 1] << 16) |
9838 (this[offset + 2] << 8) |
9842 Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
9843 if (!noAssert) checkOffset(offset, 4, this.length)
9844 return ieee754.read(this, offset, true, 23, 4)
9847 Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
9848 if (!noAssert) checkOffset(offset, 4, this.length)
9849 return ieee754.read(this, offset, false, 23, 4)
9852 Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
9853 if (!noAssert) checkOffset(offset, 8, this.length)
9854 return ieee754.read(this, offset, true, 52, 8)
9857 Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
9858 if (!noAssert) checkOffset(offset, 8, this.length)
9859 return ieee754.read(this, offset, false, 52, 8)
9862 function checkInt (buf, value, offset, ext, max, min) {
9863 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
9864 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
9865 if (offset + ext > buf.length) throw new RangeError('Index out of range')
9868 Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
9871 byteLength = byteLength | 0
9873 var maxBytes = Math.pow(2, 8 * byteLength) - 1
9874 checkInt(this, value, offset, byteLength, maxBytes, 0)
9879 this[offset] = value & 0xFF
9880 while (++i < byteLength && (mul *= 0x100)) {
9881 this[offset + i] = (value / mul) & 0xFF
9884 return offset + byteLength
9887 Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
9890 byteLength = byteLength | 0
9892 var maxBytes = Math.pow(2, 8 * byteLength) - 1
9893 checkInt(this, value, offset, byteLength, maxBytes, 0)
9896 var i = byteLength - 1
9898 this[offset + i] = value & 0xFF
9899 while (--i >= 0 && (mul *= 0x100)) {
9900 this[offset + i] = (value / mul) & 0xFF
9903 return offset + byteLength
9906 Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
9909 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
9910 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
9911 this[offset] = (value & 0xff)
9915 function objectWriteUInt16 (buf, value, offset, littleEndian) {
9916 if (value < 0) value = 0xffff + value + 1
9917 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
9918 buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
9919 (littleEndian ? i : 1 - i) * 8
9923 Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
9926 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
9927 if (Buffer.TYPED_ARRAY_SUPPORT) {
9928 this[offset] = (value & 0xff)
9929 this[offset + 1] = (value >>> 8)
9931 objectWriteUInt16(this, value, offset, true)
9936 Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
9939 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
9940 if (Buffer.TYPED_ARRAY_SUPPORT) {
9941 this[offset] = (value >>> 8)
9942 this[offset + 1] = (value & 0xff)
9944 objectWriteUInt16(this, value, offset, false)
9949 function objectWriteUInt32 (buf, value, offset, littleEndian) {
9950 if (value < 0) value = 0xffffffff + value + 1
9951 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
9952 buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
9956 Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
9959 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
9960 if (Buffer.TYPED_ARRAY_SUPPORT) {
9961 this[offset + 3] = (value >>> 24)
9962 this[offset + 2] = (value >>> 16)
9963 this[offset + 1] = (value >>> 8)
9964 this[offset] = (value & 0xff)
9966 objectWriteUInt32(this, value, offset, true)
9971 Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
9974 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
9975 if (Buffer.TYPED_ARRAY_SUPPORT) {
9976 this[offset] = (value >>> 24)
9977 this[offset + 1] = (value >>> 16)
9978 this[offset + 2] = (value >>> 8)
9979 this[offset + 3] = (value & 0xff)
9981 objectWriteUInt32(this, value, offset, false)
9986 Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
9990 var limit = Math.pow(2, 8 * byteLength - 1)
9992 checkInt(this, value, offset, byteLength, limit - 1, -limit)
9998 this[offset] = value & 0xFF
9999 while (++i < byteLength && (mul *= 0x100)) {
10000 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
10003 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
10006 return offset + byteLength
10009 Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
10011 offset = offset | 0
10013 var limit = Math.pow(2, 8 * byteLength - 1)
10015 checkInt(this, value, offset, byteLength, limit - 1, -limit)
10018 var i = byteLength - 1
10021 this[offset + i] = value & 0xFF
10022 while (--i >= 0 && (mul *= 0x100)) {
10023 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
10026 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
10029 return offset + byteLength
10032 Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
10034 offset = offset | 0
10035 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
10036 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
10037 if (value < 0) value = 0xff + value + 1
10038 this[offset] = (value & 0xff)
10042 Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
10044 offset = offset | 0
10045 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
10046 if (Buffer.TYPED_ARRAY_SUPPORT) {
10047 this[offset] = (value & 0xff)
10048 this[offset + 1] = (value >>> 8)
10050 objectWriteUInt16(this, value, offset, true)
10055 Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
10057 offset = offset | 0
10058 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
10059 if (Buffer.TYPED_ARRAY_SUPPORT) {
10060 this[offset] = (value >>> 8)
10061 this[offset + 1] = (value & 0xff)
10063 objectWriteUInt16(this, value, offset, false)
10068 Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
10070 offset = offset | 0
10071 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
10072 if (Buffer.TYPED_ARRAY_SUPPORT) {
10073 this[offset] = (value & 0xff)
10074 this[offset + 1] = (value >>> 8)
10075 this[offset + 2] = (value >>> 16)
10076 this[offset + 3] = (value >>> 24)
10078 objectWriteUInt32(this, value, offset, true)
10083 Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
10085 offset = offset | 0
10086 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
10087 if (value < 0) value = 0xffffffff + value + 1
10088 if (Buffer.TYPED_ARRAY_SUPPORT) {
10089 this[offset] = (value >>> 24)
10090 this[offset + 1] = (value >>> 16)
10091 this[offset + 2] = (value >>> 8)
10092 this[offset + 3] = (value & 0xff)
10094 objectWriteUInt32(this, value, offset, false)
10099 function checkIEEE754 (buf, value, offset, ext, max, min) {
10100 if (offset + ext > buf.length) throw new RangeError('Index out of range')
10101 if (offset < 0) throw new RangeError('Index out of range')
10104 function writeFloat (buf, value, offset, littleEndian, noAssert) {
10106 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
10108 ieee754.write(buf, value, offset, littleEndian, 23, 4)
10112 Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
10113 return writeFloat(this, value, offset, true, noAssert)
10116 Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
10117 return writeFloat(this, value, offset, false, noAssert)
10120 function writeDouble (buf, value, offset, littleEndian, noAssert) {
10122 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
10124 ieee754.write(buf, value, offset, littleEndian, 52, 8)
10128 Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
10129 return writeDouble(this, value, offset, true, noAssert)
10132 Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
10133 return writeDouble(this, value, offset, false, noAssert)
10136 // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
10137 Buffer.prototype.copy = function copy (target, targetStart, start, end) {
10138 if (!start) start = 0
10139 if (!end && end !== 0) end = this.length
10140 if (targetStart >= target.length) targetStart = target.length
10141 if (!targetStart) targetStart = 0
10142 if (end > 0 && end < start) end = start
10144 // Copy 0 bytes; we're done
10145 if (end === start) return 0
10146 if (target.length === 0 || this.length === 0) return 0
10148 // Fatal error conditions
10149 if (targetStart < 0) {
10150 throw new RangeError('targetStart out of bounds')
10152 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
10153 if (end < 0) throw new RangeError('sourceEnd out of bounds')
10156 if (end > this.length) end = this.length
10157 if (target.length - targetStart < end - start) {
10158 end = target.length - targetStart + start
10161 var len = end - start
10164 if (this === target && start < targetStart && targetStart < end) {
10165 // descending copy from end
10166 for (i = len - 1; i >= 0; --i) {
10167 target[i + targetStart] = this[i + start]
10169 } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
10170 // ascending copy from start
10171 for (i = 0; i < len; ++i) {
10172 target[i + targetStart] = this[i + start]
10175 Uint8Array.prototype.set.call(
10177 this.subarray(start, start + len),
10186 // buffer.fill(number[, offset[, end]])
10187 // buffer.fill(buffer[, offset[, end]])
10188 // buffer.fill(string[, offset[, end]][, encoding])
10189 Buffer.prototype.fill = function fill (val, start, end, encoding) {
10190 // Handle string cases:
10191 if (typeof val === 'string') {
10192 if (typeof start === 'string') {
10196 } else if (typeof end === 'string') {
10200 if (val.length === 1) {
10201 var code = val.charCodeAt(0)
10206 if (encoding !== undefined && typeof encoding !== 'string') {
10207 throw new TypeError('encoding must be a string')
10209 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
10210 throw new TypeError('Unknown encoding: ' + encoding)
10212 } else if (typeof val === 'number') {
10216 // Invalid ranges are not set to a default, so can range check early.
10217 if (start < 0 || this.length < start || this.length < end) {
10218 throw new RangeError('Out of range index')
10221 if (end <= start) {
10225 start = start >>> 0
10226 end = end === undefined ? this.length : end >>> 0
10231 if (typeof val === 'number') {
10232 for (i = start; i < end; ++i) {
10236 var bytes = Buffer.isBuffer(val)
10238 : utf8ToBytes(new Buffer(val, encoding).toString())
10239 var len = bytes.length
10240 for (i = 0; i < end - start; ++i) {
10241 this[i + start] = bytes[i % len]
10248 // HELPER FUNCTIONS
10249 // ================
10251 var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
10253 function base64clean (str) {
10254 // Node strips out invalid characters like \n and \t from the string, base64-js does not
10255 str = stringtrim(str).replace(INVALID_BASE64_RE, '')
10256 // Node converts strings with length < 2 to ''
10257 if (str.length < 2) return ''
10258 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
10259 while (str.length % 4 !== 0) {
10265 function stringtrim (str) {
10266 if (str.trim) return str.trim()
10267 return str.replace(/^\s+|\s+$/g, '')
10270 function toHex (n) {
10271 if (n < 16) return '0' + n.toString(16)
10272 return n.toString(16)
10275 function utf8ToBytes (string, units) {
10276 units = units || Infinity
10278 var length = string.length
10279 var leadSurrogate = null
10282 for (var i = 0; i < length; ++i) {
10283 codePoint = string.charCodeAt(i)
10285 // is surrogate component
10286 if (codePoint > 0xD7FF && codePoint < 0xE000) {
10287 // last char was a lead
10288 if (!leadSurrogate) {
10290 if (codePoint > 0xDBFF) {
10291 // unexpected trail
10292 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
10294 } else if (i + 1 === length) {
10296 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
10301 leadSurrogate = codePoint
10306 // 2 leads in a row
10307 if (codePoint < 0xDC00) {
10308 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
10309 leadSurrogate = codePoint
10313 // valid surrogate pair
10314 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
10315 } else if (leadSurrogate) {
10316 // valid bmp char, but last char was a lead
10317 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
10320 leadSurrogate = null
10323 if (codePoint < 0x80) {
10324 if ((units -= 1) < 0) break
10325 bytes.push(codePoint)
10326 } else if (codePoint < 0x800) {
10327 if ((units -= 2) < 0) break
10329 codePoint >> 0x6 | 0xC0,
10330 codePoint & 0x3F | 0x80
10332 } else if (codePoint < 0x10000) {
10333 if ((units -= 3) < 0) break
10335 codePoint >> 0xC | 0xE0,
10336 codePoint >> 0x6 & 0x3F | 0x80,
10337 codePoint & 0x3F | 0x80
10339 } else if (codePoint < 0x110000) {
10340 if ((units -= 4) < 0) break
10342 codePoint >> 0x12 | 0xF0,
10343 codePoint >> 0xC & 0x3F | 0x80,
10344 codePoint >> 0x6 & 0x3F | 0x80,
10345 codePoint & 0x3F | 0x80
10348 throw new Error('Invalid code point')
10355 function asciiToBytes (str) {
10357 for (var i = 0; i < str.length; ++i) {
10358 // Node's code seems to be doing this and not & 0x7F..
10359 byteArray.push(str.charCodeAt(i) & 0xFF)
10364 function utf16leToBytes (str, units) {
10367 for (var i = 0; i < str.length; ++i) {
10368 if ((units -= 2) < 0) break
10370 c = str.charCodeAt(i)
10380 function base64ToBytes (str) {
10381 return base64.toByteArray(base64clean(str))
10384 function blitBuffer (src, dst, offset, length) {
10385 for (var i = 0; i < length; ++i) {
10386 if ((i + offset >= dst.length) || (i >= src.length)) break
10387 dst[i + offset] = src[i]
10392 function isnan (val) {
10393 return val !== val // eslint-disable-line no-self-compare
10396 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(300).Buffer, (function() { return this; }())))
10400 /***/ function(module, exports) {
10404 exports.byteLength = byteLength
10405 exports.toByteArray = toByteArray
10406 exports.fromByteArray = fromByteArray
10410 var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
10412 var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
10413 for (var i = 0, len = code.length; i < len; ++i) {
10414 lookup[i] = code[i]
10415 revLookup[code.charCodeAt(i)] = i
10418 revLookup['-'.charCodeAt(0)] = 62
10419 revLookup['_'.charCodeAt(0)] = 63
10421 function placeHoldersCount (b64) {
10422 var len = b64.length
10424 throw new Error('Invalid string. Length must be a multiple of 4')
10427 // the number of equal signs (place holders)
10428 // if there are two placeholders, than the two characters before it
10429 // represent one byte
10430 // if there is only one, then the three characters before it represent 2 bytes
10431 // this is just a cheap hack to not do indexOf twice
10432 return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
10435 function byteLength (b64) {
10436 // base64 is 4/3 + up to two characters of the original data
10437 return b64.length * 3 / 4 - placeHoldersCount(b64)
10440 function toByteArray (b64) {
10441 var i, j, l, tmp, placeHolders, arr
10442 var len = b64.length
10443 placeHolders = placeHoldersCount(b64)
10445 arr = new Arr(len * 3 / 4 - placeHolders)
10447 // if there are placeholders, only get up to the last complete 4 chars
10448 l = placeHolders > 0 ? len - 4 : len
10452 for (i = 0, j = 0; i < l; i += 4, j += 3) {
10453 tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
10454 arr[L++] = (tmp >> 16) & 0xFF
10455 arr[L++] = (tmp >> 8) & 0xFF
10456 arr[L++] = tmp & 0xFF
10459 if (placeHolders === 2) {
10460 tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
10461 arr[L++] = tmp & 0xFF
10462 } else if (placeHolders === 1) {
10463 tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
10464 arr[L++] = (tmp >> 8) & 0xFF
10465 arr[L++] = tmp & 0xFF
10471 function tripletToBase64 (num) {
10472 return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
10475 function encodeChunk (uint8, start, end) {
10478 for (var i = start; i < end; i += 3) {
10479 tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
10480 output.push(tripletToBase64(tmp))
10482 return output.join('')
10485 function fromByteArray (uint8) {
10487 var len = uint8.length
10488 var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
10491 var maxChunkLength = 16383 // must be multiple of 3
10493 // go through the array every three bytes, we'll deal with trailing stuff later
10494 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
10495 parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
10498 // pad the end with zeros, but make sure to not forget the extra bytes
10499 if (extraBytes === 1) {
10500 tmp = uint8[len - 1]
10501 output += lookup[tmp >> 2]
10502 output += lookup[(tmp << 4) & 0x3F]
10504 } else if (extraBytes === 2) {
10505 tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
10506 output += lookup[tmp >> 10]
10507 output += lookup[(tmp >> 4) & 0x3F]
10508 output += lookup[(tmp << 2) & 0x3F]
10514 return parts.join('')
10520 /***/ function(module, exports) {
10522 exports.read = function (buffer, offset, isLE, mLen, nBytes) {
10524 var eLen = nBytes * 8 - mLen - 1
10525 var eMax = (1 << eLen) - 1
10526 var eBias = eMax >> 1
10528 var i = isLE ? (nBytes - 1) : 0
10529 var d = isLE ? -1 : 1
10530 var s = buffer[offset + i]
10534 e = s & ((1 << (-nBits)) - 1)
10537 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
10539 m = e & ((1 << (-nBits)) - 1)
10542 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
10546 } else if (e === eMax) {
10547 return m ? NaN : ((s ? -1 : 1) * Infinity)
10549 m = m + Math.pow(2, mLen)
10552 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
10555 exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
10557 var eLen = nBytes * 8 - mLen - 1
10558 var eMax = (1 << eLen) - 1
10559 var eBias = eMax >> 1
10560 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
10561 var i = isLE ? 0 : (nBytes - 1)
10562 var d = isLE ? 1 : -1
10563 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
10565 value = Math.abs(value)
10567 if (isNaN(value) || value === Infinity) {
10568 m = isNaN(value) ? 1 : 0
10571 e = Math.floor(Math.log(value) / Math.LN2)
10572 if (value * (c = Math.pow(2, -e)) < 1) {
10576 if (e + eBias >= 1) {
10579 value += rt * Math.pow(2, 1 - eBias)
10581 if (value * c >= 2) {
10586 if (e + eBias >= eMax) {
10589 } else if (e + eBias >= 1) {
10590 m = (value * c - 1) * Math.pow(2, mLen)
10593 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
10598 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
10600 e = (e << mLen) | m
10602 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
10604 buffer[offset + i - d] |= s * 128
10610 /***/ function(module, exports) {
10612 var toString = {}.toString;
10614 module.exports = Array.isArray || function (arr) {
10615 return toString.call(arr) == '[object Array]';
10621 /***/ function(module, exports) {
10623 // Copyright (c) 2008, Fair Oaks Labs, Inc.
10624 // All rights reserved.
10626 // Redistribution and use in source and binary forms, with or without
10627 // modification, are permitted provided that the following conditions are met:
10629 // * Redistributions of source code must retain the above copyright notice,
10630 // this list of conditions and the following disclaimer.
10632 // * Redistributions in binary form must reproduce the above copyright notice,
10633 // this list of conditions and the following disclaimer in the documentation
10634 // and/or other materials provided with the distribution.
10636 // * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors
10637 // may be used to endorse or promote products derived from this software
10638 // without specific prior written permission.
10640 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
10641 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
10642 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
10643 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
10644 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
10645 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
10646 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
10647 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
10648 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
10649 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
10650 // POSSIBILITY OF SUCH DAMAGE.
10653 // Modifications to writeIEEE754 to support negative zeroes made by Brian White
10655 var readIEEE754 = function (buffer, offset, endian, mLen, nBytes) {
10658 bBE = endian === 'big',
10659 eLen = nBytes * 8 - mLen - 1,
10660 eMax = (1 << eLen) - 1,
10663 i = bBE ? 0 : nBytes - 1,
10665 s = buffer[offset + i];
10669 e = s & (1 << -nBits) - 1;
10672 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
10674 m = e & (1 << -nBits) - 1;
10677 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
10681 } else if (e === eMax) {
10682 return m ? NaN : (s ? -1 : 1) * Infinity;
10684 m = m + Math.pow(2, mLen);
10687 return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
10690 var writeIEEE754 = function (buffer, value, offset, endian, mLen, nBytes) {
10694 bBE = endian === 'big',
10695 eLen = nBytes * 8 - mLen - 1,
10696 eMax = (1 << eLen) - 1,
10698 rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
10699 i = bBE ? nBytes - 1 : 0,
10701 s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
10703 value = Math.abs(value);
10705 if (isNaN(value) || value === Infinity) {
10706 m = isNaN(value) ? 1 : 0;
10709 e = Math.floor(Math.log(value) / Math.LN2);
10710 if (value * (c = Math.pow(2, -e)) < 1) {
10714 if (e + eBias >= 1) {
10717 value += rt * Math.pow(2, 1 - eBias);
10719 if (value * c >= 2) {
10724 if (e + eBias >= eMax) {
10727 } else if (e + eBias >= 1) {
10728 m = (value * c - 1) * Math.pow(2, mLen);
10731 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
10736 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);
10740 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);
10742 buffer[offset + i - d] |= s * 128;
10745 exports.readIEEE754 = readIEEE754;
10746 exports.writeIEEE754 = writeIEEE754;
10750 /***/ function(module, exports) {
10752 /* WEBPACK VAR INJECTION */(function(global) {"use strict";
10754 // We have an ES6 Map available, return the native instance
10756 if (typeof global.Map !== 'undefined') {
10757 module.exports = global.Map;
10758 module.exports.Map = global.Map;
10760 // We will return a polyfill
10761 var Map = function (array) {
10765 for (var i = 0; i < array.length; i++) {
10766 if (array[i] == null) continue; // skip null and undefined
10767 var entry = array[i];
10768 var key = entry[0];
10769 var value = entry[1];
10770 // Add the key to the list of keys in order
10771 this._keys.push(key);
10772 // Add the key and value to the values dictionary with a point
10773 // to the location in the ordered keys list
10774 this._values[key] = { v: value, i: this._keys.length - 1 };
10778 Map.prototype.clear = function () {
10783 Map.prototype.delete = function (key) {
10784 var value = this._values[key];
10785 if (value == null) return false;
10787 delete this._values[key];
10788 // Remove the key from the ordered keys list
10789 this._keys.splice(value.i, 1);
10793 Map.prototype.entries = function () {
10798 next: function () {
10799 var key = self._keys[index++];
10801 value: key !== undefined ? [key, self._values[key].v] : undefined,
10802 done: key !== undefined ? false : true
10808 Map.prototype.forEach = function (callback, self) {
10809 self = self || this;
10811 for (var i = 0; i < this._keys.length; i++) {
10812 var key = this._keys[i];
10813 // Call the forEach callback
10814 callback.call(self, this._values[key].v, key, self);
10818 Map.prototype.get = function (key) {
10819 return this._values[key] ? this._values[key].v : undefined;
10822 Map.prototype.has = function (key) {
10823 return this._values[key] != null;
10826 Map.prototype.keys = function (key) {
10831 next: function () {
10832 var key = self._keys[index++];
10834 value: key !== undefined ? key : undefined,
10835 done: key !== undefined ? false : true
10841 Map.prototype.set = function (key, value) {
10842 if (this._values[key]) {
10843 this._values[key].v = value;
10847 // Add the key to the list of keys in order
10848 this._keys.push(key);
10849 // Add the key and value to the values dictionary with a point
10850 // to the location in the ordered keys list
10851 this._values[key] = { v: value, i: this._keys.length - 1 };
10855 Map.prototype.values = function (key, value) {
10860 next: function () {
10861 var key = self._keys[index++];
10863 value: key !== undefined ? self._values[key].v : undefined,
10864 done: key !== undefined ? false : true
10871 Object.defineProperty(Map.prototype, 'size', {
10874 return this._keys.length;
10878 module.exports = Map;
10879 module.exports.Map = Map;
10881 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
10885 /***/ function(module, exports) {
10887 // Licensed under the Apache License, Version 2.0 (the "License");
10888 // you may not use this file except in compliance with the License.
10889 // You may obtain a copy of the License at
10891 // http://www.apache.org/licenses/LICENSE-2.0
10893 // Unless required by applicable law or agreed to in writing, software
10894 // distributed under the License is distributed on an "AS IS" BASIS,
10895 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10896 // See the License for the specific language governing permissions and
10897 // limitations under the License.
10899 // Copyright 2009 Google Inc. All Rights Reserved
10902 * Defines a Long class for representing a 64-bit two's-complement
10903 * integer value, which faithfully simulates the behavior of a Java "Long". This
10904 * implementation is derived from LongLib in GWT.
10906 * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
10907 * values as *signed* integers. See the from* functions below for more
10908 * convenient ways of constructing Longs.
10910 * The internal representation of a Long is the two given signed, 32-bit values.
10911 * We use 32-bit pieces because these are the size of integers on which
10912 * Javascript performs bit-operations. For operations like addition and
10913 * multiplication, we split each number into 16-bit pieces, which can easily be
10914 * multiplied within Javascript's floating-point representation without overflow
10915 * or change in sign.
10917 * In the algorithms below, we frequently reduce the negative case to the
10918 * positive case by negating the input(s) and then post-processing the result.
10919 * Note that we must ALWAYS check specially whether those values are MIN_VALUE
10920 * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
10921 * a positive number, it overflows back into a negative). Not handling this
10922 * case would often result in infinite recursion.
10925 * @param {number} low the low (signed) 32 bits of the Long.
10926 * @param {number} high the high (signed) 32 bits of the Long.
10929 function Long(low, high) {
10930 if (!(this instanceof Long)) return new Long(low, high);
10932 this._bsontype = 'Long';
10937 this.low_ = low | 0; // force into 32 signed bits.
10943 this.high_ = high | 0; // force into 32 signed bits.
10947 * Return the int value.
10950 * @return {number} the value, assuming it is a 32-bit integer.
10952 Long.prototype.toInt = function () {
10957 * Return the Number value.
10960 * @return {number} the closest floating-point representation to this value.
10962 Long.prototype.toNumber = function () {
10963 return this.high_ * Long.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
10967 * Return the JSON value.
10970 * @return {string} the JSON representation.
10972 Long.prototype.toJSON = function () {
10973 return this.toString();
10977 * Return the String value.
10980 * @param {number} [opt_radix] the radix in which the text should be written.
10981 * @return {string} the textual representation of this value.
10983 Long.prototype.toString = function (opt_radix) {
10984 var radix = opt_radix || 10;
10985 if (radix < 2 || 36 < radix) {
10986 throw Error('radix out of range: ' + radix);
10989 if (this.isZero()) {
10993 if (this.isNegative()) {
10994 if (this.equals(Long.MIN_VALUE)) {
10995 // We need to change the Long value before it can be negated, so we remove
10996 // the bottom-most digit in this base and then recurse to do the rest.
10997 var radixLong = Long.fromNumber(radix);
10998 var div = this.div(radixLong);
10999 var rem = div.multiply(radixLong).subtract(this);
11000 return div.toString(radix) + rem.toInt().toString(radix);
11002 return '-' + this.negate().toString(radix);
11006 // Do several (6) digits each time through the loop, so as to
11007 // minimize the calls to the very expensive emulated div.
11008 var radixToPower = Long.fromNumber(Math.pow(radix, 6));
11013 var remDiv = rem.div(radixToPower);
11014 var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
11015 var digits = intval.toString(radix);
11018 if (rem.isZero()) {
11019 return digits + result;
11021 while (digits.length < 6) {
11022 digits = '0' + digits;
11024 result = '' + digits + result;
11030 * Return the high 32-bits value.
11033 * @return {number} the high 32-bits as a signed value.
11035 Long.prototype.getHighBits = function () {
11040 * Return the low 32-bits value.
11043 * @return {number} the low 32-bits as a signed value.
11045 Long.prototype.getLowBits = function () {
11050 * Return the low unsigned 32-bits value.
11053 * @return {number} the low 32-bits as an unsigned value.
11055 Long.prototype.getLowBitsUnsigned = function () {
11056 return this.low_ >= 0 ? this.low_ : Long.TWO_PWR_32_DBL_ + this.low_;
11060 * Returns the number of bits needed to represent the absolute value of this Long.
11063 * @return {number} Returns the number of bits needed to represent the absolute value of this Long.
11065 Long.prototype.getNumBitsAbs = function () {
11066 if (this.isNegative()) {
11067 if (this.equals(Long.MIN_VALUE)) {
11070 return this.negate().getNumBitsAbs();
11073 var val = this.high_ != 0 ? this.high_ : this.low_;
11074 for (var bit = 31; bit > 0; bit--) {
11075 if ((val & 1 << bit) != 0) {
11079 return this.high_ != 0 ? bit + 33 : bit + 1;
11084 * Return whether this value is zero.
11087 * @return {boolean} whether this value is zero.
11089 Long.prototype.isZero = function () {
11090 return this.high_ == 0 && this.low_ == 0;
11094 * Return whether this value is negative.
11097 * @return {boolean} whether this value is negative.
11099 Long.prototype.isNegative = function () {
11100 return this.high_ < 0;
11104 * Return whether this value is odd.
11107 * @return {boolean} whether this value is odd.
11109 Long.prototype.isOdd = function () {
11110 return (this.low_ & 1) == 1;
11114 * Return whether this Long equals the other
11117 * @param {Long} other Long to compare against.
11118 * @return {boolean} whether this Long equals the other
11120 Long.prototype.equals = function (other) {
11121 return this.high_ == other.high_ && this.low_ == other.low_;
11125 * Return whether this Long does not equal the other.
11128 * @param {Long} other Long to compare against.
11129 * @return {boolean} whether this Long does not equal the other.
11131 Long.prototype.notEquals = function (other) {
11132 return this.high_ != other.high_ || this.low_ != other.low_;
11136 * Return whether this Long is less than the other.
11139 * @param {Long} other Long to compare against.
11140 * @return {boolean} whether this Long is less than the other.
11142 Long.prototype.lessThan = function (other) {
11143 return this.compare(other) < 0;
11147 * Return whether this Long is less than or equal to the other.
11150 * @param {Long} other Long to compare against.
11151 * @return {boolean} whether this Long is less than or equal to the other.
11153 Long.prototype.lessThanOrEqual = function (other) {
11154 return this.compare(other) <= 0;
11158 * Return whether this Long is greater than the other.
11161 * @param {Long} other Long to compare against.
11162 * @return {boolean} whether this Long is greater than the other.
11164 Long.prototype.greaterThan = function (other) {
11165 return this.compare(other) > 0;
11169 * Return whether this Long is greater than or equal to the other.
11172 * @param {Long} other Long to compare against.
11173 * @return {boolean} whether this Long is greater than or equal to the other.
11175 Long.prototype.greaterThanOrEqual = function (other) {
11176 return this.compare(other) >= 0;
11180 * Compares this Long with the given one.
11183 * @param {Long} other Long to compare against.
11184 * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
11186 Long.prototype.compare = function (other) {
11187 if (this.equals(other)) {
11191 var thisNeg = this.isNegative();
11192 var otherNeg = other.isNegative();
11193 if (thisNeg && !otherNeg) {
11196 if (!thisNeg && otherNeg) {
11200 // at this point, the signs are the same, so subtraction will not overflow
11201 if (this.subtract(other).isNegative()) {
11209 * The negation of this value.
11212 * @return {Long} the negation of this value.
11214 Long.prototype.negate = function () {
11215 if (this.equals(Long.MIN_VALUE)) {
11216 return Long.MIN_VALUE;
11218 return this.not().add(Long.ONE);
11223 * Returns the sum of this and the given Long.
11226 * @param {Long} other Long to add to this one.
11227 * @return {Long} the sum of this and the given Long.
11229 Long.prototype.add = function (other) {
11230 // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
11232 var a48 = this.high_ >>> 16;
11233 var a32 = this.high_ & 0xFFFF;
11234 var a16 = this.low_ >>> 16;
11235 var a00 = this.low_ & 0xFFFF;
11237 var b48 = other.high_ >>> 16;
11238 var b32 = other.high_ & 0xFFFF;
11239 var b16 = other.low_ >>> 16;
11240 var b00 = other.low_ & 0xFFFF;
11257 return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
11261 * Returns the difference of this and the given Long.
11264 * @param {Long} other Long to subtract from this.
11265 * @return {Long} the difference of this and the given Long.
11267 Long.prototype.subtract = function (other) {
11268 return this.add(other.negate());
11272 * Returns the product of this and the given Long.
11275 * @param {Long} other Long to multiply with this.
11276 * @return {Long} the product of this and the other.
11278 Long.prototype.multiply = function (other) {
11279 if (this.isZero()) {
11281 } else if (other.isZero()) {
11285 if (this.equals(Long.MIN_VALUE)) {
11286 return other.isOdd() ? Long.MIN_VALUE : Long.ZERO;
11287 } else if (other.equals(Long.MIN_VALUE)) {
11288 return this.isOdd() ? Long.MIN_VALUE : Long.ZERO;
11291 if (this.isNegative()) {
11292 if (other.isNegative()) {
11293 return this.negate().multiply(other.negate());
11295 return this.negate().multiply(other).negate();
11297 } else if (other.isNegative()) {
11298 return this.multiply(other.negate()).negate();
11301 // If both Longs are small, use float multiplication
11302 if (this.lessThan(Long.TWO_PWR_24_) && other.lessThan(Long.TWO_PWR_24_)) {
11303 return Long.fromNumber(this.toNumber() * other.toNumber());
11306 // Divide each Long into 4 chunks of 16 bits, and then add up 4x4 products.
11307 // We can skip products that would overflow.
11309 var a48 = this.high_ >>> 16;
11310 var a32 = this.high_ & 0xFFFF;
11311 var a16 = this.low_ >>> 16;
11312 var a00 = this.low_ & 0xFFFF;
11314 var b48 = other.high_ >>> 16;
11315 var b32 = other.high_ & 0xFFFF;
11316 var b16 = other.low_ >>> 16;
11317 var b00 = other.low_ & 0xFFFF;
11341 c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
11343 return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
11347 * Returns this Long divided by the given one.
11350 * @param {Long} other Long by which to divide.
11351 * @return {Long} this Long divided by the given one.
11353 Long.prototype.div = function (other) {
11354 if (other.isZero()) {
11355 throw Error('division by zero');
11356 } else if (this.isZero()) {
11360 if (this.equals(Long.MIN_VALUE)) {
11361 if (other.equals(Long.ONE) || other.equals(Long.NEG_ONE)) {
11362 return Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
11363 } else if (other.equals(Long.MIN_VALUE)) {
11366 // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
11367 var halfThis = this.shiftRight(1);
11368 var approx = halfThis.div(other).shiftLeft(1);
11369 if (approx.equals(Long.ZERO)) {
11370 return other.isNegative() ? Long.ONE : Long.NEG_ONE;
11372 var rem = this.subtract(other.multiply(approx));
11373 var result = approx.add(rem.div(other));
11377 } else if (other.equals(Long.MIN_VALUE)) {
11381 if (this.isNegative()) {
11382 if (other.isNegative()) {
11383 return this.negate().div(other.negate());
11385 return this.negate().div(other).negate();
11387 } else if (other.isNegative()) {
11388 return this.div(other.negate()).negate();
11391 // Repeat the following until the remainder is less than other: find a
11392 // floating-point that approximates remainder / other *from below*, add this
11393 // into the result, and subtract it from the remainder. It is critical that
11394 // the approximate value is less than or equal to the real value so that the
11395 // remainder never becomes negative.
11396 var res = Long.ZERO;
11398 while (rem.greaterThanOrEqual(other)) {
11399 // Approximate the result of division. This may be a little greater or
11400 // smaller than the actual value.
11401 var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
11403 // We will tweak the approximate result by changing it in the 48-th digit or
11404 // the smallest non-fractional digit, whichever is larger.
11405 var log2 = Math.ceil(Math.log(approx) / Math.LN2);
11406 var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
11408 // Decrease the approximation until it is smaller than the remainder. Note
11409 // that if it is too large, the product overflows and is negative.
11410 var approxRes = Long.fromNumber(approx);
11411 var approxRem = approxRes.multiply(other);
11412 while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
11414 approxRes = Long.fromNumber(approx);
11415 approxRem = approxRes.multiply(other);
11418 // We know the answer can't be zero... and actually, zero would cause
11419 // infinite recursion since we would make no progress.
11420 if (approxRes.isZero()) {
11421 approxRes = Long.ONE;
11424 res = res.add(approxRes);
11425 rem = rem.subtract(approxRem);
11431 * Returns this Long modulo the given one.
11434 * @param {Long} other Long by which to mod.
11435 * @return {Long} this Long modulo the given one.
11437 Long.prototype.modulo = function (other) {
11438 return this.subtract(this.div(other).multiply(other));
11442 * The bitwise-NOT of this value.
11445 * @return {Long} the bitwise-NOT of this value.
11447 Long.prototype.not = function () {
11448 return Long.fromBits(~this.low_, ~this.high_);
11452 * Returns the bitwise-AND of this Long and the given one.
11455 * @param {Long} other the Long with which to AND.
11456 * @return {Long} the bitwise-AND of this and the other.
11458 Long.prototype.and = function (other) {
11459 return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_);
11463 * Returns the bitwise-OR of this Long and the given one.
11466 * @param {Long} other the Long with which to OR.
11467 * @return {Long} the bitwise-OR of this and the other.
11469 Long.prototype.or = function (other) {
11470 return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_);
11474 * Returns the bitwise-XOR of this Long and the given one.
11477 * @param {Long} other the Long with which to XOR.
11478 * @return {Long} the bitwise-XOR of this and the other.
11480 Long.prototype.xor = function (other) {
11481 return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
11485 * Returns this Long with bits shifted to the left by the given amount.
11488 * @param {number} numBits the number of bits by which to shift.
11489 * @return {Long} this shifted to the left by the given amount.
11491 Long.prototype.shiftLeft = function (numBits) {
11493 if (numBits == 0) {
11496 var low = this.low_;
11497 if (numBits < 32) {
11498 var high = this.high_;
11499 return Long.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
11501 return Long.fromBits(0, low << numBits - 32);
11507 * Returns this Long with bits shifted to the right by the given amount.
11510 * @param {number} numBits the number of bits by which to shift.
11511 * @return {Long} this shifted to the right by the given amount.
11513 Long.prototype.shiftRight = function (numBits) {
11515 if (numBits == 0) {
11518 var high = this.high_;
11519 if (numBits < 32) {
11520 var low = this.low_;
11521 return Long.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
11523 return Long.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
11529 * Returns this Long with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
11532 * @param {number} numBits the number of bits by which to shift.
11533 * @return {Long} this shifted to the right by the given amount, with zeros placed into the new leading bits.
11535 Long.prototype.shiftRightUnsigned = function (numBits) {
11537 if (numBits == 0) {
11540 var high = this.high_;
11541 if (numBits < 32) {
11542 var low = this.low_;
11543 return Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
11544 } else if (numBits == 32) {
11545 return Long.fromBits(high, 0);
11547 return Long.fromBits(high >>> numBits - 32, 0);
11553 * Returns a Long representing the given (32-bit) integer value.
11556 * @param {number} value the 32-bit integer in question.
11557 * @return {Long} the corresponding Long value.
11559 Long.fromInt = function (value) {
11560 if (-128 <= value && value < 128) {
11561 var cachedObj = Long.INT_CACHE_[value];
11567 var obj = new Long(value | 0, value < 0 ? -1 : 0);
11568 if (-128 <= value && value < 128) {
11569 Long.INT_CACHE_[value] = obj;
11575 * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
11578 * @param {number} value the number in question.
11579 * @return {Long} the corresponding Long value.
11581 Long.fromNumber = function (value) {
11582 if (isNaN(value) || !isFinite(value)) {
11584 } else if (value <= -Long.TWO_PWR_63_DBL_) {
11585 return Long.MIN_VALUE;
11586 } else if (value + 1 >= Long.TWO_PWR_63_DBL_) {
11587 return Long.MAX_VALUE;
11588 } else if (value < 0) {
11589 return Long.fromNumber(-value).negate();
11591 return new Long(value % Long.TWO_PWR_32_DBL_ | 0, value / Long.TWO_PWR_32_DBL_ | 0);
11596 * Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
11599 * @param {number} lowBits the low 32-bits.
11600 * @param {number} highBits the high 32-bits.
11601 * @return {Long} the corresponding Long value.
11603 Long.fromBits = function (lowBits, highBits) {
11604 return new Long(lowBits, highBits);
11608 * Returns a Long representation of the given string, written using the given radix.
11611 * @param {string} str the textual representation of the Long.
11612 * @param {number} opt_radix the radix in which the text is written.
11613 * @return {Long} the corresponding Long value.
11615 Long.fromString = function (str, opt_radix) {
11616 if (str.length == 0) {
11617 throw Error('number format error: empty string');
11620 var radix = opt_radix || 10;
11621 if (radix < 2 || 36 < radix) {
11622 throw Error('radix out of range: ' + radix);
11625 if (str.charAt(0) == '-') {
11626 return Long.fromString(str.substring(1), radix).negate();
11627 } else if (str.indexOf('-') >= 0) {
11628 throw Error('number format error: interior "-" character: ' + str);
11631 // Do several (8) digits each time through the loop, so as to
11632 // minimize the calls to the very expensive emulated div.
11633 var radixToPower = Long.fromNumber(Math.pow(radix, 8));
11635 var result = Long.ZERO;
11636 for (var i = 0; i < str.length; i += 8) {
11637 var size = Math.min(8, str.length - i);
11638 var value = parseInt(str.substring(i, i + size), radix);
11640 var power = Long.fromNumber(Math.pow(radix, size));
11641 result = result.multiply(power).add(Long.fromNumber(value));
11643 result = result.multiply(radixToPower);
11644 result = result.add(Long.fromNumber(value));
11650 // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
11651 // from* methods on which they depend.
11655 * A cache of the Long representations of small integer values.
11659 Long.INT_CACHE_ = {};
11661 // NOTE: the compiler should inline these constant values below and then remove
11662 // these variables, so there should be no runtime penalty for these.
11665 * Number used repeated below in calculations. This must appear before the
11666 * first call to any from* function below.
11670 Long.TWO_PWR_16_DBL_ = 1 << 16;
11676 Long.TWO_PWR_24_DBL_ = 1 << 24;
11682 Long.TWO_PWR_32_DBL_ = Long.TWO_PWR_16_DBL_ * Long.TWO_PWR_16_DBL_;
11688 Long.TWO_PWR_31_DBL_ = Long.TWO_PWR_32_DBL_ / 2;
11694 Long.TWO_PWR_48_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_16_DBL_;
11700 Long.TWO_PWR_64_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_32_DBL_;
11706 Long.TWO_PWR_63_DBL_ = Long.TWO_PWR_64_DBL_ / 2;
11708 /** @type {Long} */
11709 Long.ZERO = Long.fromInt(0);
11711 /** @type {Long} */
11712 Long.ONE = Long.fromInt(1);
11714 /** @type {Long} */
11715 Long.NEG_ONE = Long.fromInt(-1);
11717 /** @type {Long} */
11718 Long.MAX_VALUE = Long.fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0);
11720 /** @type {Long} */
11721 Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0);
11727 Long.TWO_PWR_24_ = Long.fromInt(1 << 24);
11732 module.exports = Long;
11733 module.exports.Long = Long;
11737 /***/ function(module, exports) {
11740 * A class representation of the BSON Double type.
11743 * @param {number} value the number we want to represent as a double.
11746 function Double(value) {
11747 if (!(this instanceof Double)) return new Double(value);
11749 this._bsontype = 'Double';
11750 this.value = value;
11754 * Access the number value.
11757 * @return {number} returns the wrapped double number.
11759 Double.prototype.valueOf = function () {
11766 Double.prototype.toJSON = function () {
11770 module.exports = Double;
11771 module.exports.Double = Double;
11775 /***/ function(module, exports) {
11777 // Licensed under the Apache License, Version 2.0 (the "License");
11778 // you may not use this file except in compliance with the License.
11779 // You may obtain a copy of the License at
11781 // http://www.apache.org/licenses/LICENSE-2.0
11783 // Unless required by applicable law or agreed to in writing, software
11784 // distributed under the License is distributed on an "AS IS" BASIS,
11785 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11786 // See the License for the specific language governing permissions and
11787 // limitations under the License.
11789 // Copyright 2009 Google Inc. All Rights Reserved
11792 * This type is for INTERNAL use in MongoDB only and should not be used in applications.
11793 * The appropriate corresponding type is the JavaScript Date type.
11795 * Defines a Timestamp class for representing a 64-bit two's-complement
11796 * integer value, which faithfully simulates the behavior of a Java "Timestamp". This
11797 * implementation is derived from TimestampLib in GWT.
11799 * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
11800 * values as *signed* integers. See the from* functions below for more
11801 * convenient ways of constructing Timestamps.
11803 * The internal representation of a Timestamp is the two given signed, 32-bit values.
11804 * We use 32-bit pieces because these are the size of integers on which
11805 * Javascript performs bit-operations. For operations like addition and
11806 * multiplication, we split each number into 16-bit pieces, which can easily be
11807 * multiplied within Javascript's floating-point representation without overflow
11808 * or change in sign.
11810 * In the algorithms below, we frequently reduce the negative case to the
11811 * positive case by negating the input(s) and then post-processing the result.
11812 * Note that we must ALWAYS check specially whether those values are MIN_VALUE
11813 * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
11814 * a positive number, it overflows back into a negative). Not handling this
11815 * case would often result in infinite recursion.
11818 * @param {number} low the low (signed) 32 bits of the Timestamp.
11819 * @param {number} high the high (signed) 32 bits of the Timestamp.
11821 function Timestamp(low, high) {
11822 if (!(this instanceof Timestamp)) return new Timestamp(low, high);
11823 this._bsontype = 'Timestamp';
11828 this.low_ = low | 0; // force into 32 signed bits.
11834 this.high_ = high | 0; // force into 32 signed bits.
11838 * Return the int value.
11840 * @return {number} the value, assuming it is a 32-bit integer.
11842 Timestamp.prototype.toInt = function () {
11847 * Return the Number value.
11850 * @return {number} the closest floating-point representation to this value.
11852 Timestamp.prototype.toNumber = function () {
11853 return this.high_ * Timestamp.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
11857 * Return the JSON value.
11860 * @return {string} the JSON representation.
11862 Timestamp.prototype.toJSON = function () {
11863 return this.toString();
11867 * Return the String value.
11870 * @param {number} [opt_radix] the radix in which the text should be written.
11871 * @return {string} the textual representation of this value.
11873 Timestamp.prototype.toString = function (opt_radix) {
11874 var radix = opt_radix || 10;
11875 if (radix < 2 || 36 < radix) {
11876 throw Error('radix out of range: ' + radix);
11879 if (this.isZero()) {
11883 if (this.isNegative()) {
11884 if (this.equals(Timestamp.MIN_VALUE)) {
11885 // We need to change the Timestamp value before it can be negated, so we remove
11886 // the bottom-most digit in this base and then recurse to do the rest.
11887 var radixTimestamp = Timestamp.fromNumber(radix);
11888 var div = this.div(radixTimestamp);
11889 var rem = div.multiply(radixTimestamp).subtract(this);
11890 return div.toString(radix) + rem.toInt().toString(radix);
11892 return '-' + this.negate().toString(radix);
11896 // Do several (6) digits each time through the loop, so as to
11897 // minimize the calls to the very expensive emulated div.
11898 var radixToPower = Timestamp.fromNumber(Math.pow(radix, 6));
11903 var remDiv = rem.div(radixToPower);
11904 var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
11905 var digits = intval.toString(radix);
11908 if (rem.isZero()) {
11909 return digits + result;
11911 while (digits.length < 6) {
11912 digits = '0' + digits;
11914 result = '' + digits + result;
11920 * Return the high 32-bits value.
11923 * @return {number} the high 32-bits as a signed value.
11925 Timestamp.prototype.getHighBits = function () {
11930 * Return the low 32-bits value.
11933 * @return {number} the low 32-bits as a signed value.
11935 Timestamp.prototype.getLowBits = function () {
11940 * Return the low unsigned 32-bits value.
11943 * @return {number} the low 32-bits as an unsigned value.
11945 Timestamp.prototype.getLowBitsUnsigned = function () {
11946 return this.low_ >= 0 ? this.low_ : Timestamp.TWO_PWR_32_DBL_ + this.low_;
11950 * Returns the number of bits needed to represent the absolute value of this Timestamp.
11953 * @return {number} Returns the number of bits needed to represent the absolute value of this Timestamp.
11955 Timestamp.prototype.getNumBitsAbs = function () {
11956 if (this.isNegative()) {
11957 if (this.equals(Timestamp.MIN_VALUE)) {
11960 return this.negate().getNumBitsAbs();
11963 var val = this.high_ != 0 ? this.high_ : this.low_;
11964 for (var bit = 31; bit > 0; bit--) {
11965 if ((val & 1 << bit) != 0) {
11969 return this.high_ != 0 ? bit + 33 : bit + 1;
11974 * Return whether this value is zero.
11977 * @return {boolean} whether this value is zero.
11979 Timestamp.prototype.isZero = function () {
11980 return this.high_ == 0 && this.low_ == 0;
11984 * Return whether this value is negative.
11987 * @return {boolean} whether this value is negative.
11989 Timestamp.prototype.isNegative = function () {
11990 return this.high_ < 0;
11994 * Return whether this value is odd.
11997 * @return {boolean} whether this value is odd.
11999 Timestamp.prototype.isOdd = function () {
12000 return (this.low_ & 1) == 1;
12004 * Return whether this Timestamp equals the other
12007 * @param {Timestamp} other Timestamp to compare against.
12008 * @return {boolean} whether this Timestamp equals the other
12010 Timestamp.prototype.equals = function (other) {
12011 return this.high_ == other.high_ && this.low_ == other.low_;
12015 * Return whether this Timestamp does not equal the other.
12018 * @param {Timestamp} other Timestamp to compare against.
12019 * @return {boolean} whether this Timestamp does not equal the other.
12021 Timestamp.prototype.notEquals = function (other) {
12022 return this.high_ != other.high_ || this.low_ != other.low_;
12026 * Return whether this Timestamp is less than the other.
12029 * @param {Timestamp} other Timestamp to compare against.
12030 * @return {boolean} whether this Timestamp is less than the other.
12032 Timestamp.prototype.lessThan = function (other) {
12033 return this.compare(other) < 0;
12037 * Return whether this Timestamp is less than or equal to the other.
12040 * @param {Timestamp} other Timestamp to compare against.
12041 * @return {boolean} whether this Timestamp is less than or equal to the other.
12043 Timestamp.prototype.lessThanOrEqual = function (other) {
12044 return this.compare(other) <= 0;
12048 * Return whether this Timestamp is greater than the other.
12051 * @param {Timestamp} other Timestamp to compare against.
12052 * @return {boolean} whether this Timestamp is greater than the other.
12054 Timestamp.prototype.greaterThan = function (other) {
12055 return this.compare(other) > 0;
12059 * Return whether this Timestamp is greater than or equal to the other.
12062 * @param {Timestamp} other Timestamp to compare against.
12063 * @return {boolean} whether this Timestamp is greater than or equal to the other.
12065 Timestamp.prototype.greaterThanOrEqual = function (other) {
12066 return this.compare(other) >= 0;
12070 * Compares this Timestamp with the given one.
12073 * @param {Timestamp} other Timestamp to compare against.
12074 * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
12076 Timestamp.prototype.compare = function (other) {
12077 if (this.equals(other)) {
12081 var thisNeg = this.isNegative();
12082 var otherNeg = other.isNegative();
12083 if (thisNeg && !otherNeg) {
12086 if (!thisNeg && otherNeg) {
12090 // at this point, the signs are the same, so subtraction will not overflow
12091 if (this.subtract(other).isNegative()) {
12099 * The negation of this value.
12102 * @return {Timestamp} the negation of this value.
12104 Timestamp.prototype.negate = function () {
12105 if (this.equals(Timestamp.MIN_VALUE)) {
12106 return Timestamp.MIN_VALUE;
12108 return this.not().add(Timestamp.ONE);
12113 * Returns the sum of this and the given Timestamp.
12116 * @param {Timestamp} other Timestamp to add to this one.
12117 * @return {Timestamp} the sum of this and the given Timestamp.
12119 Timestamp.prototype.add = function (other) {
12120 // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
12122 var a48 = this.high_ >>> 16;
12123 var a32 = this.high_ & 0xFFFF;
12124 var a16 = this.low_ >>> 16;
12125 var a00 = this.low_ & 0xFFFF;
12127 var b48 = other.high_ >>> 16;
12128 var b32 = other.high_ & 0xFFFF;
12129 var b16 = other.low_ >>> 16;
12130 var b00 = other.low_ & 0xFFFF;
12147 return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
12151 * Returns the difference of this and the given Timestamp.
12154 * @param {Timestamp} other Timestamp to subtract from this.
12155 * @return {Timestamp} the difference of this and the given Timestamp.
12157 Timestamp.prototype.subtract = function (other) {
12158 return this.add(other.negate());
12162 * Returns the product of this and the given Timestamp.
12165 * @param {Timestamp} other Timestamp to multiply with this.
12166 * @return {Timestamp} the product of this and the other.
12168 Timestamp.prototype.multiply = function (other) {
12169 if (this.isZero()) {
12170 return Timestamp.ZERO;
12171 } else if (other.isZero()) {
12172 return Timestamp.ZERO;
12175 if (this.equals(Timestamp.MIN_VALUE)) {
12176 return other.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
12177 } else if (other.equals(Timestamp.MIN_VALUE)) {
12178 return this.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
12181 if (this.isNegative()) {
12182 if (other.isNegative()) {
12183 return this.negate().multiply(other.negate());
12185 return this.negate().multiply(other).negate();
12187 } else if (other.isNegative()) {
12188 return this.multiply(other.negate()).negate();
12191 // If both Timestamps are small, use float multiplication
12192 if (this.lessThan(Timestamp.TWO_PWR_24_) && other.lessThan(Timestamp.TWO_PWR_24_)) {
12193 return Timestamp.fromNumber(this.toNumber() * other.toNumber());
12196 // Divide each Timestamp into 4 chunks of 16 bits, and then add up 4x4 products.
12197 // We can skip products that would overflow.
12199 var a48 = this.high_ >>> 16;
12200 var a32 = this.high_ & 0xFFFF;
12201 var a16 = this.low_ >>> 16;
12202 var a00 = this.low_ & 0xFFFF;
12204 var b48 = other.high_ >>> 16;
12205 var b32 = other.high_ & 0xFFFF;
12206 var b16 = other.low_ >>> 16;
12207 var b00 = other.low_ & 0xFFFF;
12231 c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
12233 return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
12237 * Returns this Timestamp divided by the given one.
12240 * @param {Timestamp} other Timestamp by which to divide.
12241 * @return {Timestamp} this Timestamp divided by the given one.
12243 Timestamp.prototype.div = function (other) {
12244 if (other.isZero()) {
12245 throw Error('division by zero');
12246 } else if (this.isZero()) {
12247 return Timestamp.ZERO;
12250 if (this.equals(Timestamp.MIN_VALUE)) {
12251 if (other.equals(Timestamp.ONE) || other.equals(Timestamp.NEG_ONE)) {
12252 return Timestamp.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
12253 } else if (other.equals(Timestamp.MIN_VALUE)) {
12254 return Timestamp.ONE;
12256 // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
12257 var halfThis = this.shiftRight(1);
12258 var approx = halfThis.div(other).shiftLeft(1);
12259 if (approx.equals(Timestamp.ZERO)) {
12260 return other.isNegative() ? Timestamp.ONE : Timestamp.NEG_ONE;
12262 var rem = this.subtract(other.multiply(approx));
12263 var result = approx.add(rem.div(other));
12267 } else if (other.equals(Timestamp.MIN_VALUE)) {
12268 return Timestamp.ZERO;
12271 if (this.isNegative()) {
12272 if (other.isNegative()) {
12273 return this.negate().div(other.negate());
12275 return this.negate().div(other).negate();
12277 } else if (other.isNegative()) {
12278 return this.div(other.negate()).negate();
12281 // Repeat the following until the remainder is less than other: find a
12282 // floating-point that approximates remainder / other *from below*, add this
12283 // into the result, and subtract it from the remainder. It is critical that
12284 // the approximate value is less than or equal to the real value so that the
12285 // remainder never becomes negative.
12286 var res = Timestamp.ZERO;
12288 while (rem.greaterThanOrEqual(other)) {
12289 // Approximate the result of division. This may be a little greater or
12290 // smaller than the actual value.
12291 var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
12293 // We will tweak the approximate result by changing it in the 48-th digit or
12294 // the smallest non-fractional digit, whichever is larger.
12295 var log2 = Math.ceil(Math.log(approx) / Math.LN2);
12296 var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
12298 // Decrease the approximation until it is smaller than the remainder. Note
12299 // that if it is too large, the product overflows and is negative.
12300 var approxRes = Timestamp.fromNumber(approx);
12301 var approxRem = approxRes.multiply(other);
12302 while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
12304 approxRes = Timestamp.fromNumber(approx);
12305 approxRem = approxRes.multiply(other);
12308 // We know the answer can't be zero... and actually, zero would cause
12309 // infinite recursion since we would make no progress.
12310 if (approxRes.isZero()) {
12311 approxRes = Timestamp.ONE;
12314 res = res.add(approxRes);
12315 rem = rem.subtract(approxRem);
12321 * Returns this Timestamp modulo the given one.
12324 * @param {Timestamp} other Timestamp by which to mod.
12325 * @return {Timestamp} this Timestamp modulo the given one.
12327 Timestamp.prototype.modulo = function (other) {
12328 return this.subtract(this.div(other).multiply(other));
12332 * The bitwise-NOT of this value.
12335 * @return {Timestamp} the bitwise-NOT of this value.
12337 Timestamp.prototype.not = function () {
12338 return Timestamp.fromBits(~this.low_, ~this.high_);
12342 * Returns the bitwise-AND of this Timestamp and the given one.
12345 * @param {Timestamp} other the Timestamp with which to AND.
12346 * @return {Timestamp} the bitwise-AND of this and the other.
12348 Timestamp.prototype.and = function (other) {
12349 return Timestamp.fromBits(this.low_ & other.low_, this.high_ & other.high_);
12353 * Returns the bitwise-OR of this Timestamp and the given one.
12356 * @param {Timestamp} other the Timestamp with which to OR.
12357 * @return {Timestamp} the bitwise-OR of this and the other.
12359 Timestamp.prototype.or = function (other) {
12360 return Timestamp.fromBits(this.low_ | other.low_, this.high_ | other.high_);
12364 * Returns the bitwise-XOR of this Timestamp and the given one.
12367 * @param {Timestamp} other the Timestamp with which to XOR.
12368 * @return {Timestamp} the bitwise-XOR of this and the other.
12370 Timestamp.prototype.xor = function (other) {
12371 return Timestamp.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
12375 * Returns this Timestamp with bits shifted to the left by the given amount.
12378 * @param {number} numBits the number of bits by which to shift.
12379 * @return {Timestamp} this shifted to the left by the given amount.
12381 Timestamp.prototype.shiftLeft = function (numBits) {
12383 if (numBits == 0) {
12386 var low = this.low_;
12387 if (numBits < 32) {
12388 var high = this.high_;
12389 return Timestamp.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
12391 return Timestamp.fromBits(0, low << numBits - 32);
12397 * Returns this Timestamp with bits shifted to the right by the given amount.
12400 * @param {number} numBits the number of bits by which to shift.
12401 * @return {Timestamp} this shifted to the right by the given amount.
12403 Timestamp.prototype.shiftRight = function (numBits) {
12405 if (numBits == 0) {
12408 var high = this.high_;
12409 if (numBits < 32) {
12410 var low = this.low_;
12411 return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
12413 return Timestamp.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
12419 * Returns this Timestamp with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
12422 * @param {number} numBits the number of bits by which to shift.
12423 * @return {Timestamp} this shifted to the right by the given amount, with zeros placed into the new leading bits.
12425 Timestamp.prototype.shiftRightUnsigned = function (numBits) {
12427 if (numBits == 0) {
12430 var high = this.high_;
12431 if (numBits < 32) {
12432 var low = this.low_;
12433 return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
12434 } else if (numBits == 32) {
12435 return Timestamp.fromBits(high, 0);
12437 return Timestamp.fromBits(high >>> numBits - 32, 0);
12443 * Returns a Timestamp representing the given (32-bit) integer value.
12446 * @param {number} value the 32-bit integer in question.
12447 * @return {Timestamp} the corresponding Timestamp value.
12449 Timestamp.fromInt = function (value) {
12450 if (-128 <= value && value < 128) {
12451 var cachedObj = Timestamp.INT_CACHE_[value];
12457 var obj = new Timestamp(value | 0, value < 0 ? -1 : 0);
12458 if (-128 <= value && value < 128) {
12459 Timestamp.INT_CACHE_[value] = obj;
12465 * Returns a Timestamp representing the given value, provided that it is a finite number. Otherwise, zero is returned.
12468 * @param {number} value the number in question.
12469 * @return {Timestamp} the corresponding Timestamp value.
12471 Timestamp.fromNumber = function (value) {
12472 if (isNaN(value) || !isFinite(value)) {
12473 return Timestamp.ZERO;
12474 } else if (value <= -Timestamp.TWO_PWR_63_DBL_) {
12475 return Timestamp.MIN_VALUE;
12476 } else if (value + 1 >= Timestamp.TWO_PWR_63_DBL_) {
12477 return Timestamp.MAX_VALUE;
12478 } else if (value < 0) {
12479 return Timestamp.fromNumber(-value).negate();
12481 return new Timestamp(value % Timestamp.TWO_PWR_32_DBL_ | 0, value / Timestamp.TWO_PWR_32_DBL_ | 0);
12486 * Returns a Timestamp representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
12489 * @param {number} lowBits the low 32-bits.
12490 * @param {number} highBits the high 32-bits.
12491 * @return {Timestamp} the corresponding Timestamp value.
12493 Timestamp.fromBits = function (lowBits, highBits) {
12494 return new Timestamp(lowBits, highBits);
12498 * Returns a Timestamp representation of the given string, written using the given radix.
12501 * @param {string} str the textual representation of the Timestamp.
12502 * @param {number} opt_radix the radix in which the text is written.
12503 * @return {Timestamp} the corresponding Timestamp value.
12505 Timestamp.fromString = function (str, opt_radix) {
12506 if (str.length == 0) {
12507 throw Error('number format error: empty string');
12510 var radix = opt_radix || 10;
12511 if (radix < 2 || 36 < radix) {
12512 throw Error('radix out of range: ' + radix);
12515 if (str.charAt(0) == '-') {
12516 return Timestamp.fromString(str.substring(1), radix).negate();
12517 } else if (str.indexOf('-') >= 0) {
12518 throw Error('number format error: interior "-" character: ' + str);
12521 // Do several (8) digits each time through the loop, so as to
12522 // minimize the calls to the very expensive emulated div.
12523 var radixToPower = Timestamp.fromNumber(Math.pow(radix, 8));
12525 var result = Timestamp.ZERO;
12526 for (var i = 0; i < str.length; i += 8) {
12527 var size = Math.min(8, str.length - i);
12528 var value = parseInt(str.substring(i, i + size), radix);
12530 var power = Timestamp.fromNumber(Math.pow(radix, size));
12531 result = result.multiply(power).add(Timestamp.fromNumber(value));
12533 result = result.multiply(radixToPower);
12534 result = result.add(Timestamp.fromNumber(value));
12540 // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
12541 // from* methods on which they depend.
12545 * A cache of the Timestamp representations of small integer values.
12549 Timestamp.INT_CACHE_ = {};
12551 // NOTE: the compiler should inline these constant values below and then remove
12552 // these variables, so there should be no runtime penalty for these.
12555 * Number used repeated below in calculations. This must appear before the
12556 * first call to any from* function below.
12560 Timestamp.TWO_PWR_16_DBL_ = 1 << 16;
12566 Timestamp.TWO_PWR_24_DBL_ = 1 << 24;
12572 Timestamp.TWO_PWR_32_DBL_ = Timestamp.TWO_PWR_16_DBL_ * Timestamp.TWO_PWR_16_DBL_;
12578 Timestamp.TWO_PWR_31_DBL_ = Timestamp.TWO_PWR_32_DBL_ / 2;
12584 Timestamp.TWO_PWR_48_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_16_DBL_;
12590 Timestamp.TWO_PWR_64_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_32_DBL_;
12596 Timestamp.TWO_PWR_63_DBL_ = Timestamp.TWO_PWR_64_DBL_ / 2;
12598 /** @type {Timestamp} */
12599 Timestamp.ZERO = Timestamp.fromInt(0);
12601 /** @type {Timestamp} */
12602 Timestamp.ONE = Timestamp.fromInt(1);
12604 /** @type {Timestamp} */
12605 Timestamp.NEG_ONE = Timestamp.fromInt(-1);
12607 /** @type {Timestamp} */
12608 Timestamp.MAX_VALUE = Timestamp.fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0);
12610 /** @type {Timestamp} */
12611 Timestamp.MIN_VALUE = Timestamp.fromBits(0, 0x80000000 | 0);
12614 * @type {Timestamp}
12617 Timestamp.TWO_PWR_24_ = Timestamp.fromInt(1 << 24);
12622 module.exports = Timestamp;
12623 module.exports.Timestamp = Timestamp;
12627 /***/ function(module, exports, __webpack_require__) {
12629 /* WEBPACK VAR INJECTION */(function(process, Buffer) {/**
12632 * Create a random 3-byte value (i.e. unique for this
12633 * process). Other drivers use a md5 of the machine id here, but
12634 * that would mean an asyc call to gethostname, so we don't bother.
12637 var MACHINE_ID = parseInt(Math.random() * 0xFFFFFF, 10);
12639 // Regular expression that checks for hex value
12640 var checkForHexRegExp = new RegExp("^[0-9a-fA-F]{24}$");
12643 * Create a new ObjectID instance
12646 * @param {(string|number)} id Can be a 24 byte hex string, 12 byte binary string or a Number.
12647 * @property {number} generationTime The generation time of this ObjectId instance
12648 * @return {ObjectID} instance of ObjectID.
12650 var ObjectID = function ObjectID(id) {
12651 // Duck-typing to support ObjectId from different npm packages
12652 if (id instanceof ObjectID) return id;
12653 if (!(this instanceof ObjectID)) return new ObjectID(id);
12655 this._bsontype = 'ObjectID';
12658 var valid = ObjectID.isValid(id);
12660 // Throw an error if it's not a valid setup
12661 if (!valid && id != null) {
12662 throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");
12663 } else if (valid && typeof id == 'string' && id.length == 24) {
12664 return ObjectID.createFromHexString(id);
12665 } else if (id == null || typeof id == 'number') {
12666 // convert to 12 byte binary string
12667 this.id = this.generate(id);
12668 } else if (id != null && id.length === 12) {
12669 // assume 12 byte string
12671 } else if (id != null && id.toHexString) {
12672 // Duck-typing to support ObjectId from different npm packages
12675 throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");
12678 if (ObjectID.cacheHexString) this.__id = this.toHexString();
12681 // Allow usage of ObjectId as well as ObjectID
12682 var ObjectId = ObjectID;
12684 // Precomputed hex table enables speedy hex string conversion
12686 for (var i = 0; i < 256; i++) {
12687 hexTable[i] = (i <= 15 ? '0' : '') + i.toString(16);
12691 * Return the ObjectID id as a 24 byte hex string representation
12694 * @return {string} return the 24 byte hex string representation.
12696 ObjectID.prototype.toHexString = function () {
12697 if (ObjectID.cacheHexString && this.__id) return this.__id;
12699 var hexString = '';
12700 if (!this.id || !this.id.length) {
12701 throw new Error('invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [' + JSON.stringify(this.id) + ']');
12704 if (this.id instanceof _Buffer) {
12705 hexString = convertToHex(this.id);
12706 if (ObjectID.cacheHexString) this.__id = hexString;
12710 for (var i = 0; i < this.id.length; i++) {
12711 hexString += hexTable[this.id.charCodeAt(i)];
12714 if (ObjectID.cacheHexString) this.__id = hexString;
12719 * Update the ObjectID index used in generating new ObjectID's on the driver
12722 * @return {number} returns next index value.
12725 ObjectID.prototype.get_inc = function () {
12726 return ObjectID.index = (ObjectID.index + 1) % 0xFFFFFF;
12730 * Update the ObjectID index used in generating new ObjectID's on the driver
12733 * @return {number} returns next index value.
12736 ObjectID.prototype.getInc = function () {
12737 return this.get_inc();
12741 * Generate a 12 byte id buffer used in ObjectID's
12744 * @param {number} [time] optional parameter allowing to pass in a second based timestamp.
12745 * @return {Buffer} return the 12 byte id buffer string.
12747 ObjectID.prototype.generate = function (time) {
12748 if ('number' != typeof time) {
12749 time = ~~(Date.now() / 1000);
12753 var pid = (typeof process === 'undefined' ? Math.floor(Math.random() * 100000) : process.pid) % 0xFFFF;
12754 var inc = this.get_inc();
12756 var buffer = new Buffer(12);
12758 buffer[3] = time & 0xff;
12759 buffer[2] = time >> 8 & 0xff;
12760 buffer[1] = time >> 16 & 0xff;
12761 buffer[0] = time >> 24 & 0xff;
12763 buffer[6] = MACHINE_ID & 0xff;
12764 buffer[5] = MACHINE_ID >> 8 & 0xff;
12765 buffer[4] = MACHINE_ID >> 16 & 0xff;
12767 buffer[8] = pid & 0xff;
12768 buffer[7] = pid >> 8 & 0xff;
12770 buffer[11] = inc & 0xff;
12771 buffer[10] = inc >> 8 & 0xff;
12772 buffer[9] = inc >> 16 & 0xff;
12773 // Return the buffer
12778 * Converts the id into a 24 byte hex string for printing
12780 * @return {String} return the 24 byte hex string representation.
12783 ObjectID.prototype.toString = function () {
12784 return this.toHexString();
12788 * Converts to a string representation of this Id.
12790 * @return {String} return the 24 byte hex string representation.
12793 ObjectID.prototype.inspect = ObjectID.prototype.toString;
12796 * Converts to its JSON representation.
12798 * @return {String} return the 24 byte hex string representation.
12801 ObjectID.prototype.toJSON = function () {
12802 return this.toHexString();
12806 * Compares the equality of this ObjectID with `otherID`.
12809 * @param {object} otherID ObjectID instance to compare against.
12810 * @return {boolean} the result of comparing two ObjectID's
12812 ObjectID.prototype.equals = function equals(otherId) {
12815 if (otherId instanceof ObjectID) {
12816 return this.toString() == otherId.toString();
12817 } else if (typeof otherId == 'string' && ObjectID.isValid(otherId) && otherId.length == 12 && this.id instanceof _Buffer) {
12818 return otherId === this.id.toString('binary');
12819 } else if (typeof otherId == 'string' && ObjectID.isValid(otherId) && otherId.length == 24) {
12820 return otherId.toLowerCase() === this.toHexString();
12821 } else if (typeof otherId == 'string' && ObjectID.isValid(otherId) && otherId.length == 12) {
12822 return otherId === this.id;
12823 } else if (otherId != null && (otherId instanceof ObjectID || otherId.toHexString)) {
12824 return otherId.toHexString() === this.toHexString();
12831 * Returns the generation date (accurate up to the second) that this ID was generated.
12834 * @return {date} the generation date
12836 ObjectID.prototype.getTimestamp = function () {
12837 var timestamp = new Date();
12838 var time = this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
12839 timestamp.setTime(Math.floor(time) * 1000);
12846 ObjectID.index = ~~(Math.random() * 0xFFFFFF);
12851 ObjectID.createPk = function createPk() {
12852 return new ObjectID();
12856 * Creates an ObjectID from a second based number, with the rest of the ObjectID zeroed out. Used for comparisons or sorting the ObjectID.
12859 * @param {number} time an integer number representing a number of seconds.
12860 * @return {ObjectID} return the created ObjectID
12862 ObjectID.createFromTime = function createFromTime(time) {
12863 var buffer = new Buffer([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
12864 // Encode time into first 4 bytes
12865 buffer[3] = time & 0xff;
12866 buffer[2] = time >> 8 & 0xff;
12867 buffer[1] = time >> 16 & 0xff;
12868 buffer[0] = time >> 24 & 0xff;
12869 // Return the new objectId
12870 return new ObjectID(buffer);
12874 var encodeLookup = '0123456789abcdef'.split('');
12875 var decodeLookup = [];
12877 while (i < 10) decodeLookup[0x30 + i] = i++;
12878 while (i < 16) decodeLookup[0x41 - 10 + i] = decodeLookup[0x61 - 10 + i] = i++;
12880 var _Buffer = Buffer;
12881 var convertToHex = function (bytes) {
12882 return bytes.toString('hex');
12886 * Creates an ObjectID from a hex string representation of an ObjectID.
12889 * @param {string} hexString create a ObjectID from a passed in 24 byte hexstring.
12890 * @return {ObjectID} return the created ObjectID
12892 ObjectID.createFromHexString = function createFromHexString(string) {
12893 // Throw an error if it's not a valid setup
12894 if (typeof string === 'undefined' || string != null && string.length != 24) throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");
12896 var length = string.length;
12898 if (length > 12 * 2) {
12899 throw new Error('Id cannot be longer than 12 bytes');
12902 // Calculate lengths
12903 var sizeof = length >> 1;
12904 var array = new _Buffer(sizeof);
12908 while (i < length) {
12909 array[n++] = decodeLookup[string.charCodeAt(i++)] << 4 | decodeLookup[string.charCodeAt(i++)];
12912 return new ObjectID(array);
12916 * Checks if a value is a valid bson ObjectId
12919 * @return {boolean} return true if the value is a valid bson ObjectId, return false otherwise.
12921 ObjectID.isValid = function isValid(id) {
12922 if (id == null) return false;
12924 if (typeof id == 'number') {
12928 if (typeof id == 'string') {
12929 return id.length == 12 || id.length == 24 && checkForHexRegExp.test(id);
12932 if (id instanceof ObjectID) {
12936 if (id instanceof _Buffer) {
12940 // Duck-Typing detection of ObjectId like objects
12941 if (id.toHexString) {
12942 return id.id.length == 12 || id.id.length == 24 && checkForHexRegExp.test(id.id);
12951 Object.defineProperty(ObjectID.prototype, "generationTime", {
12954 return this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
12956 set: function (value) {
12957 // Encode time into first 4 bytes
12958 this.id[3] = value & 0xff;
12959 this.id[2] = value >> 8 & 0xff;
12960 this.id[1] = value >> 16 & 0xff;
12961 this.id[0] = value >> 24 & 0xff;
12968 module.exports = ObjectID;
12969 module.exports.ObjectID = ObjectID;
12970 module.exports.ObjectId = ObjectID;
12971 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(294), __webpack_require__(300).Buffer))
12975 /***/ function(module, exports) {
12978 * A class representation of the BSON RegExp type.
12981 * @return {BSONRegExp} A MinKey instance
12983 function BSONRegExp(pattern, options) {
12984 if (!(this instanceof BSONRegExp)) return new BSONRegExp();
12987 this._bsontype = 'BSONRegExp';
12988 this.pattern = pattern || '';
12989 this.options = options || '';
12991 // Validate options
12992 for (var i = 0; i < this.options.length; i++) {
12993 if (!(this.options[i] == 'i' || this.options[i] == 'm' || this.options[i] == 'x' || this.options[i] == 'l' || this.options[i] == 's' || this.options[i] == 'u')) {
12994 throw new Error('the regular expression options [' + this.options[i] + "] is not supported");
12999 module.exports = BSONRegExp;
13000 module.exports.BSONRegExp = BSONRegExp;
13004 /***/ function(module, exports) {
13007 * A class representation of the BSON Symbol type.
13011 * @param {string} value the string representing the symbol.
13014 function Symbol(value) {
13015 if (!(this instanceof Symbol)) return new Symbol(value);
13016 this._bsontype = 'Symbol';
13017 this.value = value;
13021 * Access the wrapped string value.
13024 * @return {String} returns the wrapped string.
13026 Symbol.prototype.valueOf = function () {
13033 Symbol.prototype.toString = function () {
13040 Symbol.prototype.inspect = function () {
13047 Symbol.prototype.toJSON = function () {
13051 module.exports = Symbol;
13052 module.exports.Symbol = Symbol;
13056 /***/ function(module, exports) {
13058 var Int32 = function (value) {
13059 if (!(this instanceof Int32)) return new Int32(value);
13061 this._bsontype = 'Int32';
13062 this.value = value;
13066 * Access the number value.
13069 * @return {number} returns the wrapped int32 number.
13071 Int32.prototype.valueOf = function () {
13078 Int32.prototype.toJSON = function () {
13082 module.exports = Int32;
13083 module.exports.Int32 = Int32;
13087 /***/ function(module, exports) {
13090 * A class representation of the BSON Code type.
13093 * @param {(string|function)} code a string or function.
13094 * @param {Object} [scope] an optional scope for the function.
13097 var Code = function Code(code, scope) {
13098 if (!(this instanceof Code)) return new Code(code, scope);
13099 this._bsontype = 'Code';
13101 this.scope = scope;
13107 Code.prototype.toJSON = function () {
13108 return { scope: this.scope, code: this.code };
13111 module.exports = Code;
13112 module.exports.Code = Code;
13116 /***/ function(module, exports, __webpack_require__) {
13118 /* WEBPACK VAR INJECTION */(function(Buffer) {"use strict";
13120 var Long = __webpack_require__(306);
13122 var PARSE_STRING_REGEXP = /^(\+|\-)?(\d+|(\d*\.\d*))?(E|e)?([\-\+])?(\d+)?$/;
13123 var PARSE_INF_REGEXP = /^(\+|\-)?(Infinity|inf)$/i;
13124 var PARSE_NAN_REGEXP = /^(\+|\-)?NaN$/i;
13126 var EXPONENT_MAX = 6111;
13127 var EXPONENT_MIN = -6176;
13128 var EXPONENT_BIAS = 6176;
13129 var MAX_DIGITS = 34;
13131 // Nan value bits as 32 bit values (due to lack of longs)
13132 var NAN_BUFFER = [0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
13133 // Infinity value bits 32 bit values (due to lack of longs)
13134 var INF_NEGATIVE_BUFFER = [0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
13135 var INF_POSITIVE_BUFFER = [0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
13137 var EXPONENT_REGEX = /^([\-\+])?(\d+)?$/;
13139 // Detect if the value is a digit
13140 var isDigit = function (value) {
13141 return !isNaN(parseInt(value, 10));
13144 // Divide two uint128 values
13145 var divideu128 = function (value) {
13146 var DIVISOR = Long.fromNumber(1000 * 1000 * 1000);
13147 var _rem = Long.fromNumber(0);
13150 if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) {
13151 return { quotient: value, rem: _rem };
13154 for (var i = 0; i <= 3; i++) {
13155 // Adjust remainder to match value of next dividend
13156 _rem = _rem.shiftLeft(32);
13157 // Add the divided to _rem
13158 _rem = _rem.add(new Long(value.parts[i], 0));
13159 value.parts[i] = _rem.div(DIVISOR).low_;
13160 _rem = _rem.modulo(DIVISOR);
13163 return { quotient: value, rem: _rem };
13166 // Multiply two Long values and return the 128 bit value
13167 var multiply64x2 = function (left, right) {
13168 if (!left && !right) {
13169 return { high: Long.fromNumber(0), low: Long.fromNumber(0) };
13172 var leftHigh = left.shiftRightUnsigned(32);
13173 var leftLow = new Long(left.getLowBits(), 0);
13174 var rightHigh = right.shiftRightUnsigned(32);
13175 var rightLow = new Long(right.getLowBits(), 0);
13177 var productHigh = leftHigh.multiply(rightHigh);
13178 var productMid = leftHigh.multiply(rightLow);
13179 var productMid2 = leftLow.multiply(rightHigh);
13180 var productLow = leftLow.multiply(rightLow);
13182 productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
13183 productMid = new Long(productMid.getLowBits(), 0).add(productMid2).add(productLow.shiftRightUnsigned(32));
13185 productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
13186 productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0));
13188 // Return the 128 bit result
13189 return { high: productHigh, low: productLow };
13192 var lessThan = function (left, right) {
13193 // Make values unsigned
13194 var uhleft = left.high_ >>> 0;
13195 var uhright = right.high_ >>> 0;
13197 // Compare high bits first
13198 if (uhleft < uhright) {
13200 } else if (uhleft == uhright) {
13201 var ulleft = left.low_ >>> 0;
13202 var ulright = right.low_ >>> 0;
13203 if (ulleft < ulright) return true;
13209 var longtoHex = function (value) {
13210 var buffer = new Buffer(8);
13212 // Encode the low 64 bits of the decimal
13214 buffer[index++] = value.low_ & 0xff;
13215 buffer[index++] = value.low_ >> 8 & 0xff;
13216 buffer[index++] = value.low_ >> 16 & 0xff;
13217 buffer[index++] = value.low_ >> 24 & 0xff;
13218 // Encode high bits
13219 buffer[index++] = value.high_ & 0xff;
13220 buffer[index++] = value.high_ >> 8 & 0xff;
13221 buffer[index++] = value.high_ >> 16 & 0xff;
13222 buffer[index++] = value.high_ >> 24 & 0xff;
13223 return buffer.reverse().toString('hex');
13226 var int32toHex = function (value) {
13227 var buffer = new Buffer(4);
13229 // Encode the low 64 bits of the decimal
13231 buffer[index++] = value & 0xff;
13232 buffer[index++] = value >> 8 & 0xff;
13233 buffer[index++] = value >> 16 & 0xff;
13234 buffer[index++] = value >> 24 & 0xff;
13235 return buffer.reverse().toString('hex');
13238 var Decimal128 = function (bytes) {
13239 this._bsontype = 'Decimal128';
13240 this.bytes = bytes;
13243 Decimal128.fromString = function (string) {
13244 // Parse state tracking
13245 var isNegative = false;
13246 var sawRadix = false;
13247 var foundNonZero = false;
13249 // Total number of significant digits (no leading or trailing zero)
13250 var significantDigits = 0;
13251 // Total number of significand digits read
13252 var nDigitsRead = 0;
13253 // Total number of digits (no leading zeros)
13255 // The number of the digits after radix
13256 var radixPosition = 0;
13257 // The index of the first non-zero in *str*
13258 var firstNonZero = 0;
13262 // The number of digits in digits
13263 var nDigitsStored = 0;
13264 // Insertion pointer for digits
13265 var digitsInsert = 0;
13266 // The index of the first non-zero digit
13267 var firstDigit = 0;
13268 // The index of the last digit
13273 // loop index over array
13275 // The high 17 digits of the significand
13276 var significandHigh = [0, 0];
13277 // The low 17 digits of the significand
13278 var significandLow = [0, 0];
13279 // The biased exponent
13280 var biasedExponent = 0;
13286 string = string.trim();
13289 var stringMatch = string.match(PARSE_STRING_REGEXP);
13290 var infMatch = string.match(PARSE_INF_REGEXP);
13291 var nanMatch = string.match(PARSE_NAN_REGEXP);
13293 // Validate the string
13294 if (!stringMatch && !infMatch && !nanMatch || string.length == 0) {
13295 throw new Error("" + string + " not a valid Decimal128 string");
13298 // Check if we have an illegal exponent format
13299 if (stringMatch && stringMatch[4] && stringMatch[2] === undefined) {
13300 throw new Error("" + string + " not a valid Decimal128 string");
13303 // Get the negative or positive sign
13304 if (string[index] == '+' || string[index] == '-') {
13305 isNegative = string[index++] == '-';
13308 // Check if user passed Infinity or NaN
13309 if (!isDigit(string[index]) && string[index] != '.') {
13310 if (string[index] == 'i' || string[index] == 'I') {
13311 return new Decimal128(new Buffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
13312 } else if (string[index] == 'N') {
13313 return new Decimal128(new Buffer(NAN_BUFFER));
13317 // Read all the digits
13318 while (isDigit(string[index]) || string[index] == '.') {
13319 if (string[index] == '.') {
13321 return new Decimal128(new Buffer(NAN_BUFFER));
13329 if (nDigitsStored < 34) {
13330 if (string[index] != '0' || foundNonZero) {
13331 if (!foundNonZero) {
13332 firstNonZero = nDigitsRead;
13335 foundNonZero = true;
13337 // Only store 34 digits
13338 digits[digitsInsert++] = parseInt(string[index], 10);
13339 nDigitsStored = nDigitsStored + 1;
13343 if (foundNonZero) {
13344 nDigits = nDigits + 1;
13348 radixPosition = radixPosition + 1;
13351 nDigitsRead = nDigitsRead + 1;
13355 if (sawRadix && !nDigitsRead) {
13356 throw new Error("" + string + " not a valid Decimal128 string");
13359 // Read exponent if exists
13360 if (string[index] == 'e' || string[index] == 'E') {
13361 // Read exponent digits
13362 var match = string.substr(++index).match(EXPONENT_REGEX);
13365 if (!match || !match[2]) {
13366 return new Decimal128(new Buffer(NAN_BUFFER));
13370 exponent = parseInt(match[0], 10);
13372 // Adjust the index
13373 index = index + match[0].length;
13376 // Return not a number
13377 if (string[index]) {
13378 return new Decimal128(new Buffer(NAN_BUFFER));
13381 // Done reading input
13382 // Find first non-zero digit in digits
13385 if (!nDigitsStored) {
13391 significantDigits = 0;
13393 lastDigit = nDigitsStored - 1;
13394 significantDigits = nDigits;
13396 if (exponent != 0 && significantDigits != 1) {
13397 while (string[firstNonZero + significantDigits - 1] == '0') {
13398 significantDigits = significantDigits - 1;
13403 // Normalization of exponent
13404 // Correct exponent based on radix position, and shift significand as needed
13405 // to represent user input
13407 // Overflow prevention
13408 if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) {
13409 exponent = EXPONENT_MIN;
13411 exponent = exponent - radixPosition;
13414 // Attempt to normalize the exponent
13415 while (exponent > EXPONENT_MAX) {
13416 // Shift exponent to significand and decrease
13417 lastDigit = lastDigit + 1;
13419 if (lastDigit - firstDigit > MAX_DIGITS) {
13420 // Check if we have a zero then just hard clamp, otherwise fail
13421 var digitsString = digits.join('');
13422 if (digitsString.match(/^0+$/)) {
13423 exponent = EXPONENT_MAX;
13426 return new Decimal128(new Buffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
13430 exponent = exponent - 1;
13433 while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) {
13434 // Shift last digit
13435 if (lastDigit == 0) {
13436 exponent = EXPONENT_MIN;
13437 significantDigits = 0;
13441 if (nDigitsStored < nDigits) {
13442 // adjust to match digits not stored
13443 nDigits = nDigits - 1;
13446 lastDigit = lastDigit - 1;
13449 if (exponent < EXPONENT_MAX) {
13450 exponent = exponent + 1;
13452 // Check if we have a zero then just hard clamp, otherwise fail
13453 var digitsString = digits.join('');
13454 if (digitsString.match(/^0+$/)) {
13455 exponent = EXPONENT_MAX;
13458 return new Decimal128(new Buffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
13464 // We've normalized the exponent, but might still need to round.
13465 if (lastDigit - firstDigit + 1 < significantDigits && string[significantDigits] != '0') {
13466 var endOfString = nDigitsRead;
13468 // If we have seen a radix point, 'string' is 1 longer than we have
13469 // documented with ndigits_read, so inc the position of the first nonzero
13470 // digit and the position that digits are read to.
13471 if (sawRadix && exponent == EXPONENT_MIN) {
13472 firstNonZero = firstNonZero + 1;
13473 endOfString = endOfString + 1;
13476 var roundDigit = parseInt(string[firstNonZero + lastDigit + 1], 10);
13479 if (roundDigit >= 5) {
13482 if (roundDigit == 5) {
13483 roundBit = digits[lastDigit] % 2 == 1;
13485 for (var i = firstNonZero + lastDigit + 2; i < endOfString; i++) {
13486 if (parseInt(string[i], 10)) {
13495 var dIdx = lastDigit;
13497 for (; dIdx >= 0; dIdx--) {
13498 if (++digits[dIdx] > 9) {
13501 // overflowed most significant digit
13503 if (exponent < EXPONENT_MAX) {
13504 exponent = exponent + 1;
13507 return new Decimal128(new Buffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
13517 // Encode significand
13518 // The high 17 digits of the significand
13519 significandHigh = Long.fromNumber(0);
13520 // The low 17 digits of the significand
13521 significandLow = Long.fromNumber(0);
13524 if (significantDigits == 0) {
13525 significandHigh = Long.fromNumber(0);
13526 significandLow = Long.fromNumber(0);
13527 } else if (lastDigit - firstDigit < 17) {
13528 var dIdx = firstDigit;
13529 significandLow = Long.fromNumber(digits[dIdx++]);
13530 significandHigh = new Long(0, 0);
13532 for (; dIdx <= lastDigit; dIdx++) {
13533 significandLow = significandLow.multiply(Long.fromNumber(10));
13534 significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
13537 var dIdx = firstDigit;
13538 significandHigh = Long.fromNumber(digits[dIdx++]);
13540 for (; dIdx <= lastDigit - 17; dIdx++) {
13541 significandHigh = significandHigh.multiply(Long.fromNumber(10));
13542 significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx]));
13545 significandLow = Long.fromNumber(digits[dIdx++]);
13547 for (; dIdx <= lastDigit; dIdx++) {
13548 significandLow = significandLow.multiply(Long.fromNumber(10));
13549 significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
13553 var significand = multiply64x2(significandHigh, Long.fromString("100000000000000000"));
13555 significand.low = significand.low.add(significandLow);
13557 if (lessThan(significand.low, significandLow)) {
13558 significand.high = significand.high.add(Long.fromNumber(1));
13562 var biasedExponent = exponent + EXPONENT_BIAS;
13563 var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) };
13565 // Encode combination, exponent, and significand.
13566 if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber)) {
13567 // Encode '11' into bits 1 to 3
13568 dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61));
13569 dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)));
13570 dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff)));
13572 dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49));
13573 dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff)));
13576 dec.low = significand.low;
13580 dec.high = dec.high.or(Long.fromString('9223372036854775808'));
13583 // Encode into a buffer
13584 var buffer = new Buffer(16);
13587 // Encode the low 64 bits of the decimal
13589 buffer[index++] = dec.low.low_ & 0xff;
13590 buffer[index++] = dec.low.low_ >> 8 & 0xff;
13591 buffer[index++] = dec.low.low_ >> 16 & 0xff;
13592 buffer[index++] = dec.low.low_ >> 24 & 0xff;
13593 // Encode high bits
13594 buffer[index++] = dec.low.high_ & 0xff;
13595 buffer[index++] = dec.low.high_ >> 8 & 0xff;
13596 buffer[index++] = dec.low.high_ >> 16 & 0xff;
13597 buffer[index++] = dec.low.high_ >> 24 & 0xff;
13599 // Encode the high 64 bits of the decimal
13601 buffer[index++] = dec.high.low_ & 0xff;
13602 buffer[index++] = dec.high.low_ >> 8 & 0xff;
13603 buffer[index++] = dec.high.low_ >> 16 & 0xff;
13604 buffer[index++] = dec.high.low_ >> 24 & 0xff;
13605 // Encode high bits
13606 buffer[index++] = dec.high.high_ & 0xff;
13607 buffer[index++] = dec.high.high_ >> 8 & 0xff;
13608 buffer[index++] = dec.high.high_ >> 16 & 0xff;
13609 buffer[index++] = dec.high.high_ >> 24 & 0xff;
13611 // Return the new Decimal128
13612 return new Decimal128(buffer);
13615 // Extract least significant 5 bits
13616 var COMBINATION_MASK = 0x1f;
13617 // Extract least significant 14 bits
13618 var EXPONENT_MASK = 0x3fff;
13619 // Value of combination field for Inf
13620 var COMBINATION_INFINITY = 30;
13621 // Value of combination field for NaN
13622 var COMBINATION_NAN = 31;
13623 // Value of combination field for NaN
13624 var COMBINATION_SNAN = 32;
13625 // decimal128 exponent bias
13626 var EXPONENT_BIAS = 6176;
13628 Decimal128.prototype.toString = function () {
13629 // Note: bits in this routine are referred to starting at 0,
13630 // from the sign bit, towards the coefficient.
13642 // decoded biased exponent (14 bits)
13643 var biased_exponent;
13644 // the number of significand digits
13645 var significand_digits = 0;
13646 // the base-10 digits in the significand
13647 var significand = new Array(36);
13648 for (var i = 0; i < significand.length; i++) significand[i] = 0;
13649 // read pointer into significand
13652 // unbiased exponent
13654 // the exponent if scientific notation is used
13655 var scientific_exponent;
13657 // true if the number is zero
13658 var is_zero = false;
13660 // the most signifcant significand bits (50-46)
13661 var significand_msb;
13662 // temporary storage for significand decoding
13663 var significand128 = { parts: new Array(4) };
13664 // indexing variables
13674 // Buffer reference
13675 var buffer = this.bytes;
13677 // Unpack the low 64bits into a long
13678 low = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
13679 midl = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
13681 // Unpack the high 64bits into a long
13682 midh = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
13683 high = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
13688 // Create the state of the decimal
13690 low: new Long(low, midl),
13691 high: new Long(midh, high) };
13693 if (dec.high.lessThan(Long.ZERO)) {
13697 // Decode combination field and exponent
13698 combination = high >> 26 & COMBINATION_MASK;
13700 if (combination >> 3 == 3) {
13701 // Check for 'special' values
13702 if (combination == COMBINATION_INFINITY) {
13703 return string.join('') + "Infinity";
13704 } else if (combination == COMBINATION_NAN) {
13707 biased_exponent = high >> 15 & EXPONENT_MASK;
13708 significand_msb = 0x08 + (high >> 14 & 0x01);
13711 significand_msb = high >> 14 & 0x07;
13712 biased_exponent = high >> 17 & EXPONENT_MASK;
13715 exponent = biased_exponent - EXPONENT_BIAS;
13717 // Create string of significand digits
13719 // Convert the 114-bit binary number represented by
13720 // (significand_high, significand_low) to at most 34 decimal
13721 // digits through modulo and division.
13722 significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
13723 significand128.parts[1] = midh;
13724 significand128.parts[2] = midl;
13725 significand128.parts[3] = low;
13727 if (significand128.parts[0] == 0 && significand128.parts[1] == 0 && significand128.parts[2] == 0 && significand128.parts[3] == 0) {
13730 for (var k = 3; k >= 0; k--) {
13731 var least_digits = 0;
13732 // Peform the divide
13733 var result = divideu128(significand128);
13734 significand128 = result.quotient;
13735 least_digits = result.rem.low_;
13737 // We now have the 9 least significant digits (in base 2).
13738 // Convert and output to string.
13739 if (!least_digits) continue;
13741 for (var j = 8; j >= 0; j--) {
13742 // significand[k * 9 + j] = Math.round(least_digits % 10);
13743 significand[k * 9 + j] = least_digits % 10;
13744 // least_digits = Math.round(least_digits / 10);
13745 least_digits = Math.floor(least_digits / 10);
13750 // Output format options:
13751 // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd
13752 // Regular - ddd.ddd
13755 significand_digits = 1;
13756 significand[index] = 0;
13758 significand_digits = 36;
13761 while (!significand[index]) {
13763 significand_digits = significand_digits - 1;
13768 scientific_exponent = significand_digits - 1 + exponent;
13770 // The scientific exponent checks are dictated by the string conversion
13771 // specification and are somewhat arbitrary cutoffs.
13773 // We must check exponent > 0, because if this is the case, the number
13774 // has trailing zeros. However, we *cannot* output these trailing zeros,
13775 // because doing so would change the precision of the value, and would
13776 // change stored data if the string converted number is round tripped.
13778 if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) {
13779 // Scientific format
13780 string.push(significand[index++]);
13781 significand_digits = significand_digits - 1;
13783 if (significand_digits) {
13787 for (var i = 0; i < significand_digits; i++) {
13788 string.push(significand[index++]);
13793 if (scientific_exponent > 0) {
13794 string.push('+' + scientific_exponent);
13796 string.push(scientific_exponent);
13799 // Regular format with no decimal place
13800 if (exponent >= 0) {
13801 for (var i = 0; i < significand_digits; i++) {
13802 string.push(significand[index++]);
13805 var radix_position = significand_digits + exponent;
13807 // non-zero digits before radix
13808 if (radix_position > 0) {
13809 for (var i = 0; i < radix_position; i++) {
13810 string.push(significand[index++]);
13817 // add leading zeros after radix
13818 while (radix_position++ < 0) {
13822 for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) {
13823 string.push(significand[index++]);
13828 return string.join('');
13831 Decimal128.prototype.toJSON = function () {
13832 return { "$numberDecimal": this.toString() };
13835 module.exports = Decimal128;
13836 module.exports.Decimal128 = Decimal128;
13837 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(300).Buffer))
13841 /***/ function(module, exports) {
13844 * A class representation of the BSON MinKey type.
13847 * @return {MinKey} A MinKey instance
13849 function MinKey() {
13850 if (!(this instanceof MinKey)) return new MinKey();
13852 this._bsontype = 'MinKey';
13855 module.exports = MinKey;
13856 module.exports.MinKey = MinKey;
13860 /***/ function(module, exports) {
13863 * A class representation of the BSON MaxKey type.
13866 * @return {MaxKey} A MaxKey instance
13868 function MaxKey() {
13869 if (!(this instanceof MaxKey)) return new MaxKey();
13871 this._bsontype = 'MaxKey';
13874 module.exports = MaxKey;
13875 module.exports.MaxKey = MaxKey;
13879 /***/ function(module, exports) {
13882 * A class representation of the BSON DBRef type.
13885 * @param {string} namespace the collection name.
13886 * @param {ObjectID} oid the reference ObjectID.
13887 * @param {string} [db] optional db name, if omitted the reference is local to the current db.
13890 function DBRef(namespace, oid, db) {
13891 if (!(this instanceof DBRef)) return new DBRef(namespace, oid, db);
13893 this._bsontype = 'DBRef';
13894 this.namespace = namespace;
13903 DBRef.prototype.toJSON = function () {
13905 '$ref': this.namespace,
13907 '$db': this.db == null ? '' : this.db
13911 module.exports = DBRef;
13912 module.exports.DBRef = DBRef;
13916 /***/ function(module, exports, __webpack_require__) {
13918 /* WEBPACK VAR INJECTION */(function(global) {/**
13919 * Module dependencies.
13923 // Test if we're in Node via presence of "global" not absence of "window"
13924 // to support hybrid environments like Electron
13925 if (typeof global !== 'undefined') {
13926 var Buffer = __webpack_require__(300).Buffer; // TODO just use global Buffer
13930 * A class representation of the BSON Binary type.
13933 * - **BSON.BSON_BINARY_SUBTYPE_DEFAULT**, default BSON type.
13934 * - **BSON.BSON_BINARY_SUBTYPE_FUNCTION**, BSON function type.
13935 * - **BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY**, BSON byte array type.
13936 * - **BSON.BSON_BINARY_SUBTYPE_UUID**, BSON uuid type.
13937 * - **BSON.BSON_BINARY_SUBTYPE_MD5**, BSON md5 type.
13938 * - **BSON.BSON_BINARY_SUBTYPE_USER_DEFINED**, BSON user defined type.
13941 * @param {Buffer} buffer a buffer object containing the binary data.
13942 * @param {Number} [subType] the option binary type.
13945 function Binary(buffer, subType) {
13946 if (!(this instanceof Binary)) return new Binary(buffer, subType);
13948 this._bsontype = 'Binary';
13950 if (buffer instanceof Number) {
13951 this.sub_type = buffer;
13954 this.sub_type = subType == null ? BSON_BINARY_SUBTYPE_DEFAULT : subType;
13958 if (buffer != null && !(buffer instanceof Number)) {
13959 // Only accept Buffer, Uint8Array or Arrays
13960 if (typeof buffer == 'string') {
13961 // Different ways of writing the length of the string for the different types
13962 if (typeof Buffer != 'undefined') {
13963 this.buffer = new Buffer(buffer);
13964 } else if (typeof Uint8Array != 'undefined' || Object.prototype.toString.call(buffer) == '[object Array]') {
13965 this.buffer = writeStringToArray(buffer);
13967 throw new Error("only String, Buffer, Uint8Array or Array accepted");
13970 this.buffer = buffer;
13972 this.position = buffer.length;
13974 if (typeof Buffer != 'undefined') {
13975 this.buffer = new Buffer(Binary.BUFFER_SIZE);
13976 } else if (typeof Uint8Array != 'undefined') {
13977 this.buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE));
13979 this.buffer = new Array(Binary.BUFFER_SIZE);
13981 // Set position to start of buffer
13987 * Updates this binary with byte_value.
13990 * @param {string} byte_value a single byte we wish to write.
13992 Binary.prototype.put = function put(byte_value) {
13993 // If it's a string and a has more than one character throw an error
13994 if (byte_value['length'] != null && typeof byte_value != 'number' && byte_value.length != 1) throw new Error("only accepts single character String, Uint8Array or Array");
13995 if (typeof byte_value != 'number' && byte_value < 0 || byte_value > 255) throw new Error("only accepts number in a valid unsigned byte range 0-255");
13997 // Decode the byte value once
13998 var decoded_byte = null;
13999 if (typeof byte_value == 'string') {
14000 decoded_byte = byte_value.charCodeAt(0);
14001 } else if (byte_value['length'] != null) {
14002 decoded_byte = byte_value[0];
14004 decoded_byte = byte_value;
14007 if (this.buffer.length > this.position) {
14008 this.buffer[this.position++] = decoded_byte;
14010 if (typeof Buffer != 'undefined' && Buffer.isBuffer(this.buffer)) {
14011 // Create additional overflow buffer
14012 var buffer = new Buffer(Binary.BUFFER_SIZE + this.buffer.length);
14013 // Combine the two buffers together
14014 this.buffer.copy(buffer, 0, 0, this.buffer.length);
14015 this.buffer = buffer;
14016 this.buffer[this.position++] = decoded_byte;
14019 // Create a new buffer (typed or normal array)
14020 if (Object.prototype.toString.call(this.buffer) == '[object Uint8Array]') {
14021 buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE + this.buffer.length));
14023 buffer = new Array(Binary.BUFFER_SIZE + this.buffer.length);
14026 // We need to copy all the content to the new array
14027 for (var i = 0; i < this.buffer.length; i++) {
14028 buffer[i] = this.buffer[i];
14031 // Reassign the buffer
14032 this.buffer = buffer;
14034 this.buffer[this.position++] = decoded_byte;
14040 * Writes a buffer or string to the binary.
14043 * @param {(Buffer|string)} string a string or buffer to be written to the Binary BSON object.
14044 * @param {number} offset specify the binary of where to write the content.
14047 Binary.prototype.write = function write(string, offset) {
14048 offset = typeof offset == 'number' ? offset : this.position;
14050 // If the buffer is to small let's extend the buffer
14051 if (this.buffer.length < offset + string.length) {
14053 // If we are in node.js
14054 if (typeof Buffer != 'undefined' && Buffer.isBuffer(this.buffer)) {
14055 buffer = new Buffer(this.buffer.length + string.length);
14056 this.buffer.copy(buffer, 0, 0, this.buffer.length);
14057 } else if (Object.prototype.toString.call(this.buffer) == '[object Uint8Array]') {
14058 // Create a new buffer
14059 buffer = new Uint8Array(new ArrayBuffer(this.buffer.length + string.length));
14060 // Copy the content
14061 for (var i = 0; i < this.position; i++) {
14062 buffer[i] = this.buffer[i];
14066 // Assign the new buffer
14067 this.buffer = buffer;
14070 if (typeof Buffer != 'undefined' && Buffer.isBuffer(string) && Buffer.isBuffer(this.buffer)) {
14071 string.copy(this.buffer, offset, 0, string.length);
14072 this.position = offset + string.length > this.position ? offset + string.length : this.position;
14073 // offset = string.length
14074 } else if (typeof Buffer != 'undefined' && typeof string == 'string' && Buffer.isBuffer(this.buffer)) {
14075 this.buffer.write(string, offset, 'binary');
14076 this.position = offset + string.length > this.position ? offset + string.length : this.position;
14077 // offset = string.length;
14078 } else if (Object.prototype.toString.call(string) == '[object Uint8Array]' || Object.prototype.toString.call(string) == '[object Array]' && typeof string != 'string') {
14079 for (var i = 0; i < string.length; i++) {
14080 this.buffer[offset++] = string[i];
14083 this.position = offset > this.position ? offset : this.position;
14084 } else if (typeof string == 'string') {
14085 for (var i = 0; i < string.length; i++) {
14086 this.buffer[offset++] = string.charCodeAt(i);
14089 this.position = offset > this.position ? offset : this.position;
14094 * Reads **length** bytes starting at **position**.
14097 * @param {number} position read from the given position in the Binary.
14098 * @param {number} length the number of bytes to read.
14101 Binary.prototype.read = function read(position, length) {
14102 length = length && length > 0 ? length : this.position;
14104 // Let's return the data based on the type we have
14105 if (this.buffer['slice']) {
14106 return this.buffer.slice(position, position + length);
14108 // Create a buffer to keep the result
14109 var buffer = typeof Uint8Array != 'undefined' ? new Uint8Array(new ArrayBuffer(length)) : new Array(length);
14110 for (var i = 0; i < length; i++) {
14111 buffer[i] = this.buffer[position++];
14114 // Return the buffer
14119 * Returns the value of this binary as a string.
14124 Binary.prototype.value = function value(asRaw) {
14125 asRaw = asRaw == null ? false : asRaw;
14127 // Optimize to serialize for the situation where the data == size of buffer
14128 if (asRaw && typeof Buffer != 'undefined' && Buffer.isBuffer(this.buffer) && this.buffer.length == this.position) return this.buffer;
14130 // If it's a node.js buffer object
14131 if (typeof Buffer != 'undefined' && Buffer.isBuffer(this.buffer)) {
14132 return asRaw ? this.buffer.slice(0, this.position) : this.buffer.toString('binary', 0, this.position);
14135 // we support the slice command use it
14136 if (this.buffer['slice'] != null) {
14137 return this.buffer.slice(0, this.position);
14139 // Create a new buffer to copy content to
14140 var newBuffer = Object.prototype.toString.call(this.buffer) == '[object Uint8Array]' ? new Uint8Array(new ArrayBuffer(this.position)) : new Array(this.position);
14142 for (var i = 0; i < this.position; i++) {
14143 newBuffer[i] = this.buffer[i];
14145 // Return the buffer
14149 return convertArraytoUtf8BinaryString(this.buffer, 0, this.position);
14158 * @return {number} the length of the binary.
14160 Binary.prototype.length = function length() {
14161 return this.position;
14167 Binary.prototype.toJSON = function () {
14168 return this.buffer != null ? this.buffer.toString('base64') : '';
14174 Binary.prototype.toString = function (format) {
14175 return this.buffer != null ? this.buffer.slice(0, this.position).toString(format) : '';
14179 * Binary default subtype
14182 var BSON_BINARY_SUBTYPE_DEFAULT = 0;
14187 var writeStringToArray = function (data) {
14189 var buffer = typeof Uint8Array != 'undefined' ? new Uint8Array(new ArrayBuffer(data.length)) : new Array(data.length);
14190 // Write the content to the buffer
14191 for (var i = 0; i < data.length; i++) {
14192 buffer[i] = data.charCodeAt(i);
14194 // Write the string to the buffer
14199 * Convert Array ot Uint8Array to Binary String
14203 var convertArraytoUtf8BinaryString = function (byteArray, startIndex, endIndex) {
14205 for (var i = startIndex; i < endIndex; i++) {
14206 result = result + String.fromCharCode(byteArray[i]);
14211 Binary.BUFFER_SIZE = 256;
14214 * Default BSON type
14216 * @classconstant SUBTYPE_DEFAULT
14218 Binary.SUBTYPE_DEFAULT = 0;
14220 * Function BSON type
14222 * @classconstant SUBTYPE_DEFAULT
14224 Binary.SUBTYPE_FUNCTION = 1;
14226 * Byte Array BSON type
14228 * @classconstant SUBTYPE_DEFAULT
14230 Binary.SUBTYPE_BYTE_ARRAY = 2;
14232 * OLD UUID BSON type
14234 * @classconstant SUBTYPE_DEFAULT
14236 Binary.SUBTYPE_UUID_OLD = 3;
14240 * @classconstant SUBTYPE_DEFAULT
14242 Binary.SUBTYPE_UUID = 4;
14246 * @classconstant SUBTYPE_DEFAULT
14248 Binary.SUBTYPE_MD5 = 5;
14252 * @classconstant SUBTYPE_DEFAULT
14254 Binary.SUBTYPE_USER_DEFINED = 128;
14259 module.exports = Binary;
14260 module.exports.Binary = Binary;
14261 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
14265 /***/ function(module, exports, __webpack_require__) {
14267 /* WEBPACK VAR INJECTION */(function(Buffer) {"use strict";
14269 var readIEEE754 = __webpack_require__(304).readIEEE754,
14270 f = __webpack_require__(320).format,
14271 Long = __webpack_require__(306).Long,
14272 Double = __webpack_require__(307).Double,
14273 Timestamp = __webpack_require__(308).Timestamp,
14274 ObjectID = __webpack_require__(309).ObjectID,
14275 Symbol = __webpack_require__(311).Symbol,
14276 Code = __webpack_require__(313).Code,
14277 MinKey = __webpack_require__(315).MinKey,
14278 MaxKey = __webpack_require__(316).MaxKey,
14279 Decimal128 = __webpack_require__(314),
14280 Int32 = __webpack_require__(312),
14281 DBRef = __webpack_require__(317).DBRef,
14282 BSONRegExp = __webpack_require__(310).BSONRegExp,
14283 Binary = __webpack_require__(318).Binary;
14285 var deserialize = function (buffer, options, isArray) {
14286 options = options == null ? {} : options;
14287 var index = options && options.index ? options.index : 0;
14288 // Read the document size
14289 var size = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
14291 // Ensure buffer is valid size
14292 if (size < 5 || buffer.length < size || size + index > buffer.length) {
14293 throw new Error("corrupt bson message");
14296 // Illegal end value
14297 if (buffer[index + size - 1] != 0) {
14298 throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");
14301 // Start deserializtion
14302 return deserializeObject(buffer, index, options, isArray);
14305 var deserializeObject = function (buffer, index, options, isArray) {
14306 var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions'];
14307 var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions'];
14308 var cacheFunctionsCrc32 = options['cacheFunctionsCrc32'] == null ? false : options['cacheFunctionsCrc32'];
14309 var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw'];
14311 // Return raw bson buffer instead of parsing it
14312 var raw = options['raw'] == null ? false : options['raw'];
14314 // Return BSONRegExp objects instead of native regular expressions
14315 var bsonRegExp = typeof options['bsonRegExp'] == 'boolean' ? options['bsonRegExp'] : false;
14317 // Controls the promotion of values vs wrapper classes
14318 var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers'];
14319 var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs'];
14320 var promoteValues = options['promoteValues'] == null ? true : options['promoteValues'];
14322 // Set the start index
14323 var startIndex = index;
14325 // Validate that we have at least 4 bytes of buffer
14326 if (buffer.length < 5) throw new Error("corrupt bson message < 5 bytes long");
14328 // Read the document size
14329 var size = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14331 // Ensure buffer is valid size
14332 if (size < 5 || size > buffer.length) throw new Error("corrupt bson message");
14334 // Create holding object
14335 var object = isArray ? [] : {};
14336 // Used for arrays to skip having to perform utf8 decoding
14337 var arrayIndex = 0;
14339 // While we have more left data left keep parsing
14342 var elementType = buffer[index++];
14343 // If we get a zero it's the last byte, exit
14344 if (elementType == 0) {
14348 // Get the start search index
14350 // Locate the end of the c string
14351 while (buffer[i] !== 0x00 && i < buffer.length) {
14355 // If are at the end of the buffer there is a problem with the document
14356 if (i >= buffer.length) throw new Error("Bad BSON Document: illegal CString");
14357 var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i);
14361 if (elementType == BSON.BSON_DATA_STRING) {
14362 var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14363 if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] != 0) throw new Error("bad string length in bson");
14364 object[name] = buffer.toString('utf8', index, index + stringSize - 1);
14365 index = index + stringSize;
14366 } else if (elementType == BSON.BSON_DATA_OID) {
14367 var oid = new Buffer(12);
14368 buffer.copy(oid, 0, index, index + 12);
14369 object[name] = new ObjectID(oid);
14370 index = index + 12;
14371 } else if (elementType == BSON.BSON_DATA_INT && promoteValues == false) {
14372 object[name] = new Int32(buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24);
14373 } else if (elementType == BSON.BSON_DATA_INT) {
14374 object[name] = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14375 } else if (elementType == BSON.BSON_DATA_NUMBER && promoteValues == false) {
14376 object[name] = new Double(buffer.readDoubleLE(index));
14378 } else if (elementType == BSON.BSON_DATA_NUMBER) {
14379 object[name] = buffer.readDoubleLE(index);
14381 } else if (elementType == BSON.BSON_DATA_DATE) {
14382 var lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14383 var highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14384 object[name] = new Date(new Long(lowBits, highBits).toNumber());
14385 } else if (elementType == BSON.BSON_DATA_BOOLEAN) {
14386 if (buffer[index] != 0 && buffer[index] != 1) throw new Error('illegal boolean type value');
14387 object[name] = buffer[index++] == 1;
14388 } else if (elementType == BSON.BSON_DATA_OBJECT) {
14389 var _index = index;
14390 var objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
14391 if (objectSize <= 0 || objectSize > buffer.length - index) throw new Error("bad embedded document length in bson");
14393 // We have a raw value
14395 object[name] = buffer.slice(index, index + objectSize);
14397 object[name] = deserializeObject(buffer, _index, options, false);
14400 index = index + objectSize;
14401 } else if (elementType == BSON.BSON_DATA_ARRAY) {
14402 var _index = index;
14403 var objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
14404 var arrayOptions = options;
14407 var stopIndex = index + objectSize;
14409 // All elements of array to be returned as raw bson
14410 if (fieldsAsRaw && fieldsAsRaw[name]) {
14412 for (var n in options) arrayOptions[n] = options[n];
14413 arrayOptions['raw'] = true;
14416 object[name] = deserializeObject(buffer, _index, arrayOptions, true);
14417 index = index + objectSize;
14419 if (buffer[index - 1] != 0) throw new Error('invalid array terminator byte');
14420 if (index != stopIndex) throw new Error('corrupted array bson');
14421 } else if (elementType == BSON.BSON_DATA_UNDEFINED) {
14422 object[name] = undefined;
14423 } else if (elementType == BSON.BSON_DATA_NULL) {
14424 object[name] = null;
14425 } else if (elementType == BSON.BSON_DATA_LONG) {
14426 // Unpack the low and high bits
14427 var lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14428 var highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14429 var long = new Long(lowBits, highBits);
14430 // Promote the long if possible
14431 if (promoteLongs && promoteValues == true) {
14432 object[name] = long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) ? long.toNumber() : long;
14434 object[name] = long;
14436 } else if (elementType == BSON.BSON_DATA_DECIMAL128) {
14437 // Buffer to contain the decimal bytes
14438 var bytes = new Buffer(16);
14439 // Copy the next 16 bytes into the bytes buffer
14440 buffer.copy(bytes, 0, index, index + 16);
14442 index = index + 16;
14443 // Assign the new Decimal128 value
14444 var decimal128 = new Decimal128(bytes);
14445 // If we have an alternative mapper use that
14446 object[name] = decimal128.toObject ? decimal128.toObject() : decimal128;
14447 } else if (elementType == BSON.BSON_DATA_BINARY) {
14448 var binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14449 var totalBinarySize = binarySize;
14450 var subType = buffer[index++];
14452 // Did we have a negative binary size, throw
14453 if (binarySize < 0) throw new Error('Negative binary type element size found');
14455 // Is the length longer than the document
14456 if (binarySize > buffer.length) throw new Error('Binary type size larger than document size');
14458 // Decode as raw Buffer object if options specifies it
14459 if (buffer['slice'] != null) {
14460 // If we have subtype 2 skip the 4 bytes for the size
14461 if (subType == Binary.SUBTYPE_BYTE_ARRAY) {
14462 binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14463 if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
14464 if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
14465 if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
14468 if (promoteBuffers && promoteValues) {
14469 object[name] = buffer.slice(index, index + binarySize);
14471 object[name] = new Binary(buffer.slice(index, index + binarySize), subType);
14474 var _buffer = typeof Uint8Array != 'undefined' ? new Uint8Array(new ArrayBuffer(binarySize)) : new Array(binarySize);
14475 // If we have subtype 2 skip the 4 bytes for the size
14476 if (subType == Binary.SUBTYPE_BYTE_ARRAY) {
14477 binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14478 if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
14479 if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
14480 if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
14484 for (var i = 0; i < binarySize; i++) {
14485 _buffer[i] = buffer[index + i];
14488 if (promoteBuffers && promoteValues) {
14489 object[name] = _buffer;
14491 object[name] = new Binary(_buffer, subType);
14495 // Update the index
14496 index = index + binarySize;
14497 } else if (elementType == BSON.BSON_DATA_REGEXP && bsonRegExp == false) {
14498 // Get the start search index
14500 // Locate the end of the c string
14501 while (buffer[i] !== 0x00 && i < buffer.length) {
14504 // If are at the end of the buffer there is a problem with the document
14505 if (i >= buffer.length) throw new Error("Bad BSON Document: illegal CString");
14506 // Return the C string
14507 var source = buffer.toString('utf8', index, i);
14508 // Create the regexp
14511 // Get the start search index
14513 // Locate the end of the c string
14514 while (buffer[i] !== 0x00 && i < buffer.length) {
14517 // If are at the end of the buffer there is a problem with the document
14518 if (i >= buffer.length) throw new Error("Bad BSON Document: illegal CString");
14519 // Return the C string
14520 var regExpOptions = buffer.toString('utf8', index, i);
14523 // For each option add the corresponding one for javascript
14524 var optionsArray = new Array(regExpOptions.length);
14527 for (var i = 0; i < regExpOptions.length; i++) {
14528 switch (regExpOptions[i]) {
14530 optionsArray[i] = 'm';
14533 optionsArray[i] = 'g';
14536 optionsArray[i] = 'i';
14541 object[name] = new RegExp(source, optionsArray.join(''));
14542 } else if (elementType == BSON.BSON_DATA_REGEXP && bsonRegExp == true) {
14543 // Get the start search index
14545 // Locate the end of the c string
14546 while (buffer[i] !== 0x00 && i < buffer.length) {
14549 // If are at the end of the buffer there is a problem with the document
14550 if (i >= buffer.length) throw new Error("Bad BSON Document: illegal CString");
14551 // Return the C string
14552 var source = buffer.toString('utf8', index, i);
14555 // Get the start search index
14557 // Locate the end of the c string
14558 while (buffer[i] !== 0x00 && i < buffer.length) {
14561 // If are at the end of the buffer there is a problem with the document
14562 if (i >= buffer.length) throw new Error("Bad BSON Document: illegal CString");
14563 // Return the C string
14564 var regExpOptions = buffer.toString('utf8', index, i);
14568 object[name] = new BSONRegExp(source, regExpOptions);
14569 } else if (elementType == BSON.BSON_DATA_SYMBOL) {
14570 var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14571 if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] != 0) throw new Error("bad string length in bson");
14572 object[name] = new Symbol(buffer.toString('utf8', index, index + stringSize - 1));
14573 index = index + stringSize;
14574 } else if (elementType == BSON.BSON_DATA_TIMESTAMP) {
14575 var lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14576 var highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14577 object[name] = new Timestamp(lowBits, highBits);
14578 } else if (elementType == BSON.BSON_DATA_MIN_KEY) {
14579 object[name] = new MinKey();
14580 } else if (elementType == BSON.BSON_DATA_MAX_KEY) {
14581 object[name] = new MaxKey();
14582 } else if (elementType == BSON.BSON_DATA_CODE) {
14583 var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14584 if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] != 0) throw new Error("bad string length in bson");
14585 var functionString = buffer.toString('utf8', index, index + stringSize - 1);
14587 // If we are evaluating the functions
14588 if (evalFunctions) {
14590 // If we have cache enabled let's look for the md5 of the function in the cache
14591 if (cacheFunctions) {
14592 var hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
14593 // Got to do this to avoid V8 deoptimizing the call due to finding eval
14594 object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
14596 object[name] = isolateEval(functionString);
14599 object[name] = new Code(functionString);
14602 // Update parse index position
14603 index = index + stringSize;
14604 } else if (elementType == BSON.BSON_DATA_CODE_W_SCOPE) {
14605 var totalSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14607 // Element cannot be shorter than totalSize + stringSize + documentSize + terminator
14608 if (totalSize < 4 + 4 + 4 + 1) {
14609 throw new Error("code_w_scope total size shorter minimum expected length");
14612 // Get the code string size
14613 var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14614 // Check if we have a valid string
14615 if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] != 0) throw new Error("bad string length in bson");
14617 // Javascript function
14618 var functionString = buffer.toString('utf8', index, index + stringSize - 1);
14619 // Update parse index position
14620 index = index + stringSize;
14621 // Parse the element
14622 var _index = index;
14623 // Decode the size of the object document
14624 var objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
14625 // Decode the scope object
14626 var scopeObject = deserializeObject(buffer, _index, options, false);
14627 // Adjust the index
14628 index = index + objectSize;
14630 // Check if field length is to short
14631 if (totalSize < 4 + 4 + objectSize + stringSize) {
14632 throw new Error('code_w_scope total size is to short, truncating scope');
14635 // Check if totalSize field is to long
14636 if (totalSize > 4 + 4 + objectSize + stringSize) {
14637 throw new Error('code_w_scope total size is to long, clips outer document');
14640 // If we are evaluating the functions
14641 if (evalFunctions) {
14642 // Contains the value we are going to set
14644 // If we have cache enabled let's look for the md5 of the function in the cache
14645 if (cacheFunctions) {
14646 var hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
14647 // Got to do this to avoid V8 deoptimizing the call due to finding eval
14648 object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
14650 object[name] = isolateEval(functionString);
14653 object[name].scope = scopeObject;
14655 object[name] = new Code(functionString, scopeObject);
14657 } else if (elementType == BSON.BSON_DATA_DBPOINTER) {
14658 // Get the code string size
14659 var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
14660 // Check if we have a valid string
14661 if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] != 0) throw new Error("bad string length in bson");
14663 var namespace = buffer.toString('utf8', index, index + stringSize - 1);
14664 // Update parse index position
14665 index = index + stringSize;
14668 var oidBuffer = new Buffer(12);
14669 buffer.copy(oidBuffer, 0, index, index + 12);
14670 var oid = new ObjectID(oidBuffer);
14672 // Update the index
14673 index = index + 12;
14675 // Split the namespace
14676 var parts = namespace.split('.');
14677 var db = parts.shift();
14678 var collection = parts.join('.');
14679 // Upgrade to DBRef type
14680 object[name] = new DBRef(collection, oid, db);
14682 throw new Error("Detected unknown BSON type " + elementType.toString(16) + " for fieldname \"" + name + "\", are you using the latest BSON parser");
14686 // Check if the deserialization was against a valid array/object
14687 if (size != index - startIndex) {
14688 if (isArray) throw new Error('corrupt array bson');
14689 throw new Error('corrupt object bson');
14692 // Check if we have a db ref object
14693 if (object['$id'] != null) object = new DBRef(object['$ref'], object['$id'], object['$db']);
14698 * Ensure eval is isolated.
14703 var isolateEvalWithHash = function (functionCache, hash, functionString, object) {
14704 // Contains the value we are going to set
14707 // Check for cache hit, eval if missing and return cached function
14708 if (functionCache[hash] == null) {
14709 eval("value = " + functionString);
14710 functionCache[hash] = value;
14713 return functionCache[hash].bind(object);
14717 * Ensure eval is isolated.
14722 var isolateEval = function (functionString) {
14723 // Contains the value we are going to set
14725 // Eval the function
14726 eval("value = " + functionString);
14733 * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
14738 var functionCache = BSON.functionCache = {};
14743 * @classconstant BSON_DATA_NUMBER
14745 BSON.BSON_DATA_NUMBER = 1;
14749 * @classconstant BSON_DATA_STRING
14751 BSON.BSON_DATA_STRING = 2;
14755 * @classconstant BSON_DATA_OBJECT
14757 BSON.BSON_DATA_OBJECT = 3;
14761 * @classconstant BSON_DATA_ARRAY
14763 BSON.BSON_DATA_ARRAY = 4;
14767 * @classconstant BSON_DATA_BINARY
14769 BSON.BSON_DATA_BINARY = 5;
14773 * @classconstant BSON_DATA_UNDEFINED
14775 BSON.BSON_DATA_UNDEFINED = 6;
14777 * ObjectID BSON Type
14779 * @classconstant BSON_DATA_OID
14781 BSON.BSON_DATA_OID = 7;
14783 * Boolean BSON Type
14785 * @classconstant BSON_DATA_BOOLEAN
14787 BSON.BSON_DATA_BOOLEAN = 8;
14791 * @classconstant BSON_DATA_DATE
14793 BSON.BSON_DATA_DATE = 9;
14797 * @classconstant BSON_DATA_NULL
14799 BSON.BSON_DATA_NULL = 10;
14803 * @classconstant BSON_DATA_REGEXP
14805 BSON.BSON_DATA_REGEXP = 11;
14809 * @classconstant BSON_DATA_DBPOINTER
14811 BSON.BSON_DATA_DBPOINTER = 12;
14815 * @classconstant BSON_DATA_CODE
14817 BSON.BSON_DATA_CODE = 13;
14821 * @classconstant BSON_DATA_SYMBOL
14823 BSON.BSON_DATA_SYMBOL = 14;
14825 * Code with Scope BSON Type
14827 * @classconstant BSON_DATA_CODE_W_SCOPE
14829 BSON.BSON_DATA_CODE_W_SCOPE = 15;
14831 * 32 bit Integer BSON Type
14833 * @classconstant BSON_DATA_INT
14835 BSON.BSON_DATA_INT = 16;
14837 * Timestamp BSON Type
14839 * @classconstant BSON_DATA_TIMESTAMP
14841 BSON.BSON_DATA_TIMESTAMP = 17;
14845 * @classconstant BSON_DATA_LONG
14847 BSON.BSON_DATA_LONG = 18;
14851 * @classconstant BSON_DATA_DECIMAL128
14853 BSON.BSON_DATA_DECIMAL128 = 19;
14857 * @classconstant BSON_DATA_MIN_KEY
14859 BSON.BSON_DATA_MIN_KEY = 0xff;
14863 * @classconstant BSON_DATA_MAX_KEY
14865 BSON.BSON_DATA_MAX_KEY = 0x7f;
14868 * Binary Default Type
14870 * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
14872 BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
14874 * Binary Function Type
14876 * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
14878 BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
14880 * Binary Byte Array Type
14882 * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
14884 BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
14888 * @classconstant BSON_BINARY_SUBTYPE_UUID
14890 BSON.BSON_BINARY_SUBTYPE_UUID = 3;
14894 * @classconstant BSON_BINARY_SUBTYPE_MD5
14896 BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
14898 * Binary User Defined Type
14900 * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
14902 BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
14905 BSON.BSON_INT32_MAX = 0x7FFFFFFF;
14906 BSON.BSON_INT32_MIN = -0x80000000;
14908 BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
14909 BSON.BSON_INT64_MIN = -Math.pow(2, 63);
14911 // JS MAX PRECISE VALUES
14912 BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
14913 BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
14915 // Internal long versions
14916 var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
14917 var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
14919 module.exports = deserialize;
14920 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(300).Buffer))
14924 /***/ function(module, exports, __webpack_require__) {
14926 /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
14928 // Permission is hereby granted, free of charge, to any person obtaining a
14929 // copy of this software and associated documentation files (the
14930 // "Software"), to deal in the Software without restriction, including
14931 // without limitation the rights to use, copy, modify, merge, publish,
14932 // distribute, sublicense, and/or sell copies of the Software, and to permit
14933 // persons to whom the Software is furnished to do so, subject to the
14934 // following conditions:
14936 // The above copyright notice and this permission notice shall be included
14937 // in all copies or substantial portions of the Software.
14939 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14940 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14941 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
14942 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
14943 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14944 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
14945 // USE OR OTHER DEALINGS IN THE SOFTWARE.
14947 var formatRegExp = /%[sdj%]/g;
14948 exports.format = function(f) {
14949 if (!isString(f)) {
14951 for (var i = 0; i < arguments.length; i++) {
14952 objects.push(inspect(arguments[i]));
14954 return objects.join(' ');
14958 var args = arguments;
14959 var len = args.length;
14960 var str = String(f).replace(formatRegExp, function(x) {
14961 if (x === '%%') return '%';
14962 if (i >= len) return x;
14964 case '%s': return String(args[i++]);
14965 case '%d': return Number(args[i++]);
14968 return JSON.stringify(args[i++]);
14970 return '[Circular]';
14976 for (var x = args[i]; i < len; x = args[++i]) {
14977 if (isNull(x) || !isObject(x)) {
14980 str += ' ' + inspect(x);
14987 // Mark that a method should not be used.
14988 // Returns a modified function which warns once by default.
14989 // If --no-deprecation is set, then it is a no-op.
14990 exports.deprecate = function(fn, msg) {
14991 // Allow for deprecating things in the process of starting up.
14992 if (isUndefined(global.process)) {
14993 return function() {
14994 return exports.deprecate(fn, msg).apply(this, arguments);
14998 if (process.noDeprecation === true) {
15002 var warned = false;
15003 function deprecated() {
15005 if (process.throwDeprecation) {
15006 throw new Error(msg);
15007 } else if (process.traceDeprecation) {
15008 console.trace(msg);
15010 console.error(msg);
15014 return fn.apply(this, arguments);
15023 exports.debuglog = function(set) {
15024 if (isUndefined(debugEnviron))
15025 debugEnviron = process.env.NODE_DEBUG || '';
15026 set = set.toUpperCase();
15027 if (!debugs[set]) {
15028 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
15029 var pid = process.pid;
15030 debugs[set] = function() {
15031 var msg = exports.format.apply(exports, arguments);
15032 console.error('%s %d: %s', set, pid, msg);
15035 debugs[set] = function() {};
15038 return debugs[set];
15043 * Echos the value of a value. Trys to print the value out
15044 * in the best way possible given the different types.
15046 * @param {Object} obj The object to print out.
15047 * @param {Object} opts Optional options object that alters the output.
15049 /* legacy: obj, showHidden, depth, colors*/
15050 function inspect(obj, opts) {
15054 stylize: stylizeNoColor
15057 if (arguments.length >= 3) ctx.depth = arguments[2];
15058 if (arguments.length >= 4) ctx.colors = arguments[3];
15059 if (isBoolean(opts)) {
15061 ctx.showHidden = opts;
15063 // got an "options" object
15064 exports._extend(ctx, opts);
15066 // set default options
15067 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
15068 if (isUndefined(ctx.depth)) ctx.depth = 2;
15069 if (isUndefined(ctx.colors)) ctx.colors = false;
15070 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
15071 if (ctx.colors) ctx.stylize = stylizeWithColor;
15072 return formatValue(ctx, obj, ctx.depth);
15074 exports.inspect = inspect;
15077 // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
15080 'italic' : [3, 23],
15081 'underline' : [4, 24],
15082 'inverse' : [7, 27],
15083 'white' : [37, 39],
15085 'black' : [30, 39],
15088 'green' : [32, 39],
15089 'magenta' : [35, 39],
15091 'yellow' : [33, 39]
15094 // Don't use 'blue' not visible on cmd.exe
15097 'number': 'yellow',
15098 'boolean': 'yellow',
15099 'undefined': 'grey',
15103 // "name": intentionally not styling
15108 function stylizeWithColor(str, styleType) {
15109 var style = inspect.styles[styleType];
15112 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
15113 '\u001b[' + inspect.colors[style][1] + 'm';
15120 function stylizeNoColor(str, styleType) {
15125 function arrayToHash(array) {
15128 array.forEach(function(val, idx) {
15136 function formatValue(ctx, value, recurseTimes) {
15137 // Provide a hook for user-specified inspect functions.
15138 // Check that value is an object with an inspect function on it
15139 if (ctx.customInspect &&
15141 isFunction(value.inspect) &&
15142 // Filter out the util module, it's inspect function is special
15143 value.inspect !== exports.inspect &&
15144 // Also filter out any prototype objects using the circular check.
15145 !(value.constructor && value.constructor.prototype === value)) {
15146 var ret = value.inspect(recurseTimes, ctx);
15147 if (!isString(ret)) {
15148 ret = formatValue(ctx, ret, recurseTimes);
15153 // Primitive types cannot have properties
15154 var primitive = formatPrimitive(ctx, value);
15159 // Look up the keys of the object.
15160 var keys = Object.keys(value);
15161 var visibleKeys = arrayToHash(keys);
15163 if (ctx.showHidden) {
15164 keys = Object.getOwnPropertyNames(value);
15167 // IE doesn't make error fields non-enumerable
15168 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
15170 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
15171 return formatError(value);
15174 // Some type of object without properties can be shortcutted.
15175 if (keys.length === 0) {
15176 if (isFunction(value)) {
15177 var name = value.name ? ': ' + value.name : '';
15178 return ctx.stylize('[Function' + name + ']', 'special');
15180 if (isRegExp(value)) {
15181 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
15183 if (isDate(value)) {
15184 return ctx.stylize(Date.prototype.toString.call(value), 'date');
15186 if (isError(value)) {
15187 return formatError(value);
15191 var base = '', array = false, braces = ['{', '}'];
15193 // Make Array say that they are Array
15194 if (isArray(value)) {
15196 braces = ['[', ']'];
15199 // Make functions say that they are functions
15200 if (isFunction(value)) {
15201 var n = value.name ? ': ' + value.name : '';
15202 base = ' [Function' + n + ']';
15205 // Make RegExps say that they are RegExps
15206 if (isRegExp(value)) {
15207 base = ' ' + RegExp.prototype.toString.call(value);
15210 // Make dates with properties first say the date
15211 if (isDate(value)) {
15212 base = ' ' + Date.prototype.toUTCString.call(value);
15215 // Make error with message first say the error
15216 if (isError(value)) {
15217 base = ' ' + formatError(value);
15220 if (keys.length === 0 && (!array || value.length == 0)) {
15221 return braces[0] + base + braces[1];
15224 if (recurseTimes < 0) {
15225 if (isRegExp(value)) {
15226 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
15228 return ctx.stylize('[Object]', 'special');
15232 ctx.seen.push(value);
15236 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
15238 output = keys.map(function(key) {
15239 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
15245 return reduceToSingleString(output, base, braces);
15249 function formatPrimitive(ctx, value) {
15250 if (isUndefined(value))
15251 return ctx.stylize('undefined', 'undefined');
15252 if (isString(value)) {
15253 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
15254 .replace(/'/g, "\\'")
15255 .replace(/\\"/g, '"') + '\'';
15256 return ctx.stylize(simple, 'string');
15258 if (isNumber(value))
15259 return ctx.stylize('' + value, 'number');
15260 if (isBoolean(value))
15261 return ctx.stylize('' + value, 'boolean');
15262 // For some reason typeof null is "object", so special case here.
15264 return ctx.stylize('null', 'null');
15268 function formatError(value) {
15269 return '[' + Error.prototype.toString.call(value) + ']';
15273 function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
15275 for (var i = 0, l = value.length; i < l; ++i) {
15276 if (hasOwnProperty(value, String(i))) {
15277 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
15283 keys.forEach(function(key) {
15284 if (!key.match(/^\d+$/)) {
15285 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
15293 function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
15294 var name, str, desc;
15295 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
15298 str = ctx.stylize('[Getter/Setter]', 'special');
15300 str = ctx.stylize('[Getter]', 'special');
15304 str = ctx.stylize('[Setter]', 'special');
15307 if (!hasOwnProperty(visibleKeys, key)) {
15308 name = '[' + key + ']';
15311 if (ctx.seen.indexOf(desc.value) < 0) {
15312 if (isNull(recurseTimes)) {
15313 str = formatValue(ctx, desc.value, null);
15315 str = formatValue(ctx, desc.value, recurseTimes - 1);
15317 if (str.indexOf('\n') > -1) {
15319 str = str.split('\n').map(function(line) {
15321 }).join('\n').substr(2);
15323 str = '\n' + str.split('\n').map(function(line) {
15329 str = ctx.stylize('[Circular]', 'special');
15332 if (isUndefined(name)) {
15333 if (array && key.match(/^\d+$/)) {
15336 name = JSON.stringify('' + key);
15337 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
15338 name = name.substr(1, name.length - 2);
15339 name = ctx.stylize(name, 'name');
15341 name = name.replace(/'/g, "\\'")
15342 .replace(/\\"/g, '"')
15343 .replace(/(^"|"$)/g, "'");
15344 name = ctx.stylize(name, 'string');
15348 return name + ': ' + str;
15352 function reduceToSingleString(output, base, braces) {
15353 var numLinesEst = 0;
15354 var length = output.reduce(function(prev, cur) {
15356 if (cur.indexOf('\n') >= 0) numLinesEst++;
15357 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
15362 (base === '' ? '' : base + '\n ') +
15364 output.join(',\n ') +
15369 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
15373 // NOTE: These type checking functions intentionally don't use `instanceof`
15374 // because it is fragile and can be easily faked with `Object.create()`.
15375 function isArray(ar) {
15376 return Array.isArray(ar);
15378 exports.isArray = isArray;
15380 function isBoolean(arg) {
15381 return typeof arg === 'boolean';
15383 exports.isBoolean = isBoolean;
15385 function isNull(arg) {
15386 return arg === null;
15388 exports.isNull = isNull;
15390 function isNullOrUndefined(arg) {
15391 return arg == null;
15393 exports.isNullOrUndefined = isNullOrUndefined;
15395 function isNumber(arg) {
15396 return typeof arg === 'number';
15398 exports.isNumber = isNumber;
15400 function isString(arg) {
15401 return typeof arg === 'string';
15403 exports.isString = isString;
15405 function isSymbol(arg) {
15406 return typeof arg === 'symbol';
15408 exports.isSymbol = isSymbol;
15410 function isUndefined(arg) {
15411 return arg === void 0;
15413 exports.isUndefined = isUndefined;
15415 function isRegExp(re) {
15416 return isObject(re) && objectToString(re) === '[object RegExp]';
15418 exports.isRegExp = isRegExp;
15420 function isObject(arg) {
15421 return typeof arg === 'object' && arg !== null;
15423 exports.isObject = isObject;
15425 function isDate(d) {
15426 return isObject(d) && objectToString(d) === '[object Date]';
15428 exports.isDate = isDate;
15430 function isError(e) {
15431 return isObject(e) &&
15432 (objectToString(e) === '[object Error]' || e instanceof Error);
15434 exports.isError = isError;
15436 function isFunction(arg) {
15437 return typeof arg === 'function';
15439 exports.isFunction = isFunction;
15441 function isPrimitive(arg) {
15442 return arg === null ||
15443 typeof arg === 'boolean' ||
15444 typeof arg === 'number' ||
15445 typeof arg === 'string' ||
15446 typeof arg === 'symbol' || // ES6 symbol
15447 typeof arg === 'undefined';
15449 exports.isPrimitive = isPrimitive;
15451 exports.isBuffer = __webpack_require__(321);
15453 function objectToString(o) {
15454 return Object.prototype.toString.call(o);
15459 return n < 10 ? '0' + n.toString(10) : n.toString(10);
15463 var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
15464 'Oct', 'Nov', 'Dec'];
15467 function timestamp() {
15468 var d = new Date();
15469 var time = [pad(d.getHours()),
15470 pad(d.getMinutes()),
15471 pad(d.getSeconds())].join(':');
15472 return [d.getDate(), months[d.getMonth()], time].join(' ');
15476 // log is just a thin wrapper to console.log that prepends a timestamp
15477 exports.log = function() {
15478 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
15483 * Inherit the prototype methods from one constructor into another.
15485 * The Function.prototype.inherits from lang.js rewritten as a standalone
15486 * function (not on Function.prototype). NOTE: If this file is to be loaded
15487 * during bootstrapping this function needs to be rewritten using some native
15488 * functions as prototype setup using normal JavaScript does not work as
15489 * expected during bootstrapping (see mirror.js in r114903).
15491 * @param {function} ctor Constructor function which needs to inherit the
15493 * @param {function} superCtor Constructor function to inherit prototype from.
15495 exports.inherits = __webpack_require__(322);
15497 exports._extend = function(origin, add) {
15498 // Don't do anything if add isn't an object
15499 if (!add || !isObject(add)) return origin;
15501 var keys = Object.keys(add);
15502 var i = keys.length;
15504 origin[keys[i]] = add[keys[i]];
15509 function hasOwnProperty(obj, prop) {
15510 return Object.prototype.hasOwnProperty.call(obj, prop);
15513 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(294)))
15517 /***/ function(module, exports) {
15519 module.exports = function isBuffer(arg) {
15520 return arg && typeof arg === 'object'
15521 && typeof arg.copy === 'function'
15522 && typeof arg.fill === 'function'
15523 && typeof arg.readUInt8 === 'function';
15528 /***/ function(module, exports) {
15530 if (typeof Object.create === 'function') {
15531 // implementation from standard node.js 'util' module
15532 module.exports = function inherits(ctor, superCtor) {
15533 ctor.super_ = superCtor
15534 ctor.prototype = Object.create(superCtor.prototype, {
15544 // old school shim for old browsers
15545 module.exports = function inherits(ctor, superCtor) {
15546 ctor.super_ = superCtor
15547 var TempCtor = function () {}
15548 TempCtor.prototype = superCtor.prototype
15549 ctor.prototype = new TempCtor()
15550 ctor.prototype.constructor = ctor
15557 /***/ function(module, exports, __webpack_require__) {
15559 /* WEBPACK VAR INJECTION */(function(Buffer) {"use strict";
15561 var writeIEEE754 = __webpack_require__(304).writeIEEE754,
15562 readIEEE754 = __webpack_require__(304).readIEEE754,
15563 Long = __webpack_require__(306).Long,
15564 Map = __webpack_require__(305),
15565 Double = __webpack_require__(307).Double,
15566 Timestamp = __webpack_require__(308).Timestamp,
15567 ObjectID = __webpack_require__(309).ObjectID,
15568 Symbol = __webpack_require__(311).Symbol,
15569 Code = __webpack_require__(313).Code,
15570 BSONRegExp = __webpack_require__(310).BSONRegExp,
15571 Int32 = __webpack_require__(312).Int32,
15572 MinKey = __webpack_require__(315).MinKey,
15573 MaxKey = __webpack_require__(316).MaxKey,
15574 Decimal128 = __webpack_require__(314),
15575 DBRef = __webpack_require__(317).DBRef,
15576 Binary = __webpack_require__(318).Binary;
15579 var _Buffer = Uint8Array;
15581 var _Buffer = Buffer;
15584 var regexp = /\x00/;
15586 // To ensure that 0.4 of node works correctly
15587 var isDate = function isDate(d) {
15588 return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
15591 var isRegExp = function isRegExp(d) {
15592 return Object.prototype.toString.call(d) === '[object RegExp]';
15595 var serializeString = function (buffer, key, value, index, isArray) {
15596 // Encode String type
15597 buffer[index++] = BSON.BSON_DATA_STRING;
15598 // Number of written bytes
15599 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15601 index = index + numberOfWrittenBytes + 1;
15602 buffer[index - 1] = 0;
15603 // Write the string
15604 var size = buffer.write(value, index + 4, 'utf8');
15605 // Write the size of the string to buffer
15606 buffer[index + 3] = size + 1 >> 24 & 0xff;
15607 buffer[index + 2] = size + 1 >> 16 & 0xff;
15608 buffer[index + 1] = size + 1 >> 8 & 0xff;
15609 buffer[index] = size + 1 & 0xff;
15611 index = index + 4 + size;
15613 buffer[index++] = 0;
15617 var serializeNumber = function (buffer, key, value, index, isArray) {
15618 // We have an integer value
15619 if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
15620 // If the value fits in 32 bits encode as int, if it fits in a double
15621 // encode it as a double, otherwise long
15622 if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
15623 // Set int type 32 bits or less
15624 buffer[index++] = BSON.BSON_DATA_INT;
15625 // Number of written bytes
15626 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15628 index = index + numberOfWrittenBytes;
15629 buffer[index++] = 0;
15630 // Write the int value
15631 buffer[index++] = value & 0xff;
15632 buffer[index++] = value >> 8 & 0xff;
15633 buffer[index++] = value >> 16 & 0xff;
15634 buffer[index++] = value >> 24 & 0xff;
15635 } else if (value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
15636 // Encode as double
15637 buffer[index++] = BSON.BSON_DATA_NUMBER;
15638 // Number of written bytes
15639 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15641 index = index + numberOfWrittenBytes;
15642 buffer[index++] = 0;
15644 writeIEEE754(buffer, value, index, 'little', 52, 8);
15649 buffer[index++] = BSON.BSON_DATA_LONG;
15650 // Number of written bytes
15651 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15653 index = index + numberOfWrittenBytes;
15654 buffer[index++] = 0;
15655 var longVal = Long.fromNumber(value);
15656 var lowBits = longVal.getLowBits();
15657 var highBits = longVal.getHighBits();
15659 buffer[index++] = lowBits & 0xff;
15660 buffer[index++] = lowBits >> 8 & 0xff;
15661 buffer[index++] = lowBits >> 16 & 0xff;
15662 buffer[index++] = lowBits >> 24 & 0xff;
15663 // Encode high bits
15664 buffer[index++] = highBits & 0xff;
15665 buffer[index++] = highBits >> 8 & 0xff;
15666 buffer[index++] = highBits >> 16 & 0xff;
15667 buffer[index++] = highBits >> 24 & 0xff;
15670 // Encode as double
15671 buffer[index++] = BSON.BSON_DATA_NUMBER;
15672 // Number of written bytes
15673 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15675 index = index + numberOfWrittenBytes;
15676 buffer[index++] = 0;
15678 writeIEEE754(buffer, value, index, 'little', 52, 8);
15686 var serializeUndefined = function (buffer, key, value, index, isArray) {
15688 buffer[index++] = BSON.BSON_DATA_UNDEFINED;
15689 // Number of written bytes
15690 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15692 index = index + numberOfWrittenBytes;
15693 buffer[index++] = 0;
15697 var serializeNull = function (buffer, key, value, index, isArray) {
15699 buffer[index++] = BSON.BSON_DATA_NULL;
15700 // Number of written bytes
15701 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15703 index = index + numberOfWrittenBytes;
15704 buffer[index++] = 0;
15708 var serializeBoolean = function (buffer, key, value, index, isArray) {
15710 buffer[index++] = BSON.BSON_DATA_BOOLEAN;
15711 // Number of written bytes
15712 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15714 index = index + numberOfWrittenBytes;
15715 buffer[index++] = 0;
15716 // Encode the boolean value
15717 buffer[index++] = value ? 1 : 0;
15721 var serializeDate = function (buffer, key, value, index, isArray) {
15723 buffer[index++] = BSON.BSON_DATA_DATE;
15724 // Number of written bytes
15725 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15727 index = index + numberOfWrittenBytes;
15728 buffer[index++] = 0;
15731 var dateInMilis = Long.fromNumber(value.getTime());
15732 var lowBits = dateInMilis.getLowBits();
15733 var highBits = dateInMilis.getHighBits();
15735 buffer[index++] = lowBits & 0xff;
15736 buffer[index++] = lowBits >> 8 & 0xff;
15737 buffer[index++] = lowBits >> 16 & 0xff;
15738 buffer[index++] = lowBits >> 24 & 0xff;
15739 // Encode high bits
15740 buffer[index++] = highBits & 0xff;
15741 buffer[index++] = highBits >> 8 & 0xff;
15742 buffer[index++] = highBits >> 16 & 0xff;
15743 buffer[index++] = highBits >> 24 & 0xff;
15747 var serializeRegExp = function (buffer, key, value, index, isArray) {
15749 buffer[index++] = BSON.BSON_DATA_REGEXP;
15750 // Number of written bytes
15751 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15753 index = index + numberOfWrittenBytes;
15754 buffer[index++] = 0;
15755 if (value.source && value.source.match(regexp) != null) {
15756 throw Error("value " + value.source + " must not contain null bytes");
15758 // Adjust the index
15759 index = index + buffer.write(value.source, index, 'utf8');
15761 buffer[index++] = 0x00;
15762 // Write the parameters
15763 if (value.global) buffer[index++] = 0x73; // s
15764 if (value.ignoreCase) buffer[index++] = 0x69; // i
15765 if (value.multiline) buffer[index++] = 0x6d; // m
15767 buffer[index++] = 0x00;
15771 var serializeBSONRegExp = function (buffer, key, value, index, isArray) {
15773 buffer[index++] = BSON.BSON_DATA_REGEXP;
15774 // Number of written bytes
15775 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15777 index = index + numberOfWrittenBytes;
15778 buffer[index++] = 0;
15780 // Check the pattern for 0 bytes
15781 if (value.pattern.match(regexp) != null) {
15782 // The BSON spec doesn't allow keys with null bytes because keys are
15783 // null-terminated.
15784 throw Error("pattern " + value.pattern + " must not contain null bytes");
15787 // Adjust the index
15788 index = index + buffer.write(value.pattern, index, 'utf8');
15790 buffer[index++] = 0x00;
15791 // Write the options
15792 index = index + buffer.write(value.options.split('').sort().join(''), index, 'utf8');
15794 buffer[index++] = 0x00;
15798 var serializeMinMax = function (buffer, key, value, index, isArray) {
15799 // Write the type of either min or max key
15800 if (value === null) {
15801 buffer[index++] = BSON.BSON_DATA_NULL;
15802 } else if (value instanceof MinKey) {
15803 buffer[index++] = BSON.BSON_DATA_MIN_KEY;
15805 buffer[index++] = BSON.BSON_DATA_MAX_KEY;
15808 // Number of written bytes
15809 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15811 index = index + numberOfWrittenBytes;
15812 buffer[index++] = 0;
15816 var serializeObjectId = function (buffer, key, value, index, isArray) {
15818 buffer[index++] = BSON.BSON_DATA_OID;
15819 // Number of written bytes
15820 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15823 index = index + numberOfWrittenBytes;
15824 buffer[index++] = 0;
15826 // Write the objectId into the shared buffer
15827 if (typeof value.id == 'string') {
15828 buffer.write(value.id, index, 'binary');
15829 } else if (value.id && value.id.copy) {
15830 value.id.copy(buffer, index, 0, 12);
15832 throw new Error('object [' + JSON.stringify(value) + "] is not a valid ObjectId");
15839 var serializeBuffer = function (buffer, key, value, index, isArray) {
15841 buffer[index++] = BSON.BSON_DATA_BINARY;
15842 // Number of written bytes
15843 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15845 index = index + numberOfWrittenBytes;
15846 buffer[index++] = 0;
15847 // Get size of the buffer (current write point)
15848 var size = value.length;
15849 // Write the size of the string to buffer
15850 buffer[index++] = size & 0xff;
15851 buffer[index++] = size >> 8 & 0xff;
15852 buffer[index++] = size >> 16 & 0xff;
15853 buffer[index++] = size >> 24 & 0xff;
15854 // Write the default subtype
15855 buffer[index++] = BSON.BSON_BINARY_SUBTYPE_DEFAULT;
15856 // Copy the content form the binary field to the buffer
15857 value.copy(buffer, index, 0, size);
15858 // Adjust the index
15859 index = index + size;
15863 var serializeObject = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) {
15864 for (var i = 0; i < path.length; i++) {
15865 if (path[i] === value) throw new Error('cyclic dependency detected');
15868 // Push value to stack
15871 buffer[index++] = Array.isArray(value) ? BSON.BSON_DATA_ARRAY : BSON.BSON_DATA_OBJECT;
15872 // Number of written bytes
15873 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15875 index = index + numberOfWrittenBytes;
15876 buffer[index++] = 0;
15877 var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path);
15881 var size = endIndex - index;
15885 var serializeDecimal128 = function (buffer, key, value, index, isArray) {
15886 buffer[index++] = BSON.BSON_DATA_DECIMAL128;
15887 // Number of written bytes
15888 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15890 index = index + numberOfWrittenBytes;
15891 buffer[index++] = 0;
15892 // Write the data from the value
15893 value.bytes.copy(buffer, index, 0, 16);
15897 var serializeLong = function (buffer, key, value, index, isArray) {
15899 buffer[index++] = value._bsontype == 'Long' ? BSON.BSON_DATA_LONG : BSON.BSON_DATA_TIMESTAMP;
15900 // Number of written bytes
15901 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15903 index = index + numberOfWrittenBytes;
15904 buffer[index++] = 0;
15906 var lowBits = value.getLowBits();
15907 var highBits = value.getHighBits();
15909 buffer[index++] = lowBits & 0xff;
15910 buffer[index++] = lowBits >> 8 & 0xff;
15911 buffer[index++] = lowBits >> 16 & 0xff;
15912 buffer[index++] = lowBits >> 24 & 0xff;
15913 // Encode high bits
15914 buffer[index++] = highBits & 0xff;
15915 buffer[index++] = highBits >> 8 & 0xff;
15916 buffer[index++] = highBits >> 16 & 0xff;
15917 buffer[index++] = highBits >> 24 & 0xff;
15921 var serializeInt32 = function (buffer, key, value, index, isArray) {
15922 // Set int type 32 bits or less
15923 buffer[index++] = BSON.BSON_DATA_INT;
15924 // Number of written bytes
15925 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15927 index = index + numberOfWrittenBytes;
15928 buffer[index++] = 0;
15929 // Write the int value
15930 buffer[index++] = value & 0xff;
15931 buffer[index++] = value >> 8 & 0xff;
15932 buffer[index++] = value >> 16 & 0xff;
15933 buffer[index++] = value >> 24 & 0xff;
15937 var serializeDouble = function (buffer, key, value, index, isArray) {
15938 // Encode as double
15939 buffer[index++] = BSON.BSON_DATA_NUMBER;
15940 // Number of written bytes
15941 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15943 index = index + numberOfWrittenBytes;
15944 buffer[index++] = 0;
15946 writeIEEE754(buffer, value, index, 'little', 52, 8);
15952 var serializeFunction = function (buffer, key, value, index, checkKeys, depth, isArray) {
15953 buffer[index++] = BSON.BSON_DATA_CODE;
15954 // Number of written bytes
15955 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15957 index = index + numberOfWrittenBytes;
15958 buffer[index++] = 0;
15960 var functionString = value.toString();
15961 // Write the string
15962 var size = buffer.write(functionString, index + 4, 'utf8') + 1;
15963 // Write the size of the string to buffer
15964 buffer[index] = size & 0xff;
15965 buffer[index + 1] = size >> 8 & 0xff;
15966 buffer[index + 2] = size >> 16 & 0xff;
15967 buffer[index + 3] = size >> 24 & 0xff;
15969 index = index + 4 + size - 1;
15971 buffer[index++] = 0;
15975 var serializeCode = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) {
15976 if (value.scope && typeof value.scope == 'object') {
15978 buffer[index++] = BSON.BSON_DATA_CODE_W_SCOPE;
15979 // Number of written bytes
15980 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
15982 index = index + numberOfWrittenBytes;
15983 buffer[index++] = 0;
15986 var startIndex = index;
15988 // Serialize the function
15989 // Get the function string
15990 var functionString = typeof value.code == 'string' ? value.code : value.code.toString();
15991 // Index adjustment
15993 // Write string into buffer
15994 var codeSize = buffer.write(functionString, index + 4, 'utf8') + 1;
15995 // Write the size of the string to buffer
15996 buffer[index] = codeSize & 0xff;
15997 buffer[index + 1] = codeSize >> 8 & 0xff;
15998 buffer[index + 2] = codeSize >> 16 & 0xff;
15999 buffer[index + 3] = codeSize >> 24 & 0xff;
16001 buffer[index + 4 + codeSize - 1] = 0;
16003 index = index + codeSize + 4;
16006 // Serialize the scope value
16007 var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined);
16008 index = endIndex - 1;
16011 var totalSize = endIndex - startIndex;
16013 // Write the total size of the object
16014 buffer[startIndex++] = totalSize & 0xff;
16015 buffer[startIndex++] = totalSize >> 8 & 0xff;
16016 buffer[startIndex++] = totalSize >> 16 & 0xff;
16017 buffer[startIndex++] = totalSize >> 24 & 0xff;
16018 // Write trailing zero
16019 buffer[index++] = 0;
16021 buffer[index++] = BSON.BSON_DATA_CODE;
16022 // Number of written bytes
16023 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
16025 index = index + numberOfWrittenBytes;
16026 buffer[index++] = 0;
16028 var functionString = value.code.toString();
16029 // Write the string
16030 var size = buffer.write(functionString, index + 4, 'utf8') + 1;
16031 // Write the size of the string to buffer
16032 buffer[index] = size & 0xff;
16033 buffer[index + 1] = size >> 8 & 0xff;
16034 buffer[index + 2] = size >> 16 & 0xff;
16035 buffer[index + 3] = size >> 24 & 0xff;
16037 index = index + 4 + size - 1;
16039 buffer[index++] = 0;
16045 var serializeBinary = function (buffer, key, value, index, isArray) {
16047 buffer[index++] = BSON.BSON_DATA_BINARY;
16048 // Number of written bytes
16049 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
16051 index = index + numberOfWrittenBytes;
16052 buffer[index++] = 0;
16053 // Extract the buffer
16054 var data = value.value(true);
16056 var size = value.position;
16057 // Add the deprecated 02 type 4 bytes of size to total
16058 if (value.sub_type == Binary.SUBTYPE_BYTE_ARRAY) size = size + 4;
16059 // Write the size of the string to buffer
16060 buffer[index++] = size & 0xff;
16061 buffer[index++] = size >> 8 & 0xff;
16062 buffer[index++] = size >> 16 & 0xff;
16063 buffer[index++] = size >> 24 & 0xff;
16064 // Write the subtype to the buffer
16065 buffer[index++] = value.sub_type;
16067 // If we have binary type 2 the 4 first bytes are the size
16068 if (value.sub_type == Binary.SUBTYPE_BYTE_ARRAY) {
16070 buffer[index++] = size & 0xff;
16071 buffer[index++] = size >> 8 & 0xff;
16072 buffer[index++] = size >> 16 & 0xff;
16073 buffer[index++] = size >> 24 & 0xff;
16076 // Write the data to the object
16077 data.copy(buffer, index, 0, value.position);
16078 // Adjust the index
16079 index = index + value.position;
16083 var serializeSymbol = function (buffer, key, value, index, isArray) {
16085 buffer[index++] = BSON.BSON_DATA_SYMBOL;
16086 // Number of written bytes
16087 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
16089 index = index + numberOfWrittenBytes;
16090 buffer[index++] = 0;
16091 // Write the string
16092 var size = buffer.write(value.value, index + 4, 'utf8') + 1;
16093 // Write the size of the string to buffer
16094 buffer[index] = size & 0xff;
16095 buffer[index + 1] = size >> 8 & 0xff;
16096 buffer[index + 2] = size >> 16 & 0xff;
16097 buffer[index + 3] = size >> 24 & 0xff;
16099 index = index + 4 + size - 1;
16101 buffer[index++] = 0x00;
16105 var serializeDBRef = function (buffer, key, value, index, depth, serializeFunctions, isArray) {
16107 buffer[index++] = BSON.BSON_DATA_OBJECT;
16108 // Number of written bytes
16109 var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
16112 index = index + numberOfWrittenBytes;
16113 buffer[index++] = 0;
16115 var startIndex = index;
16118 // Serialize object
16119 if (null != value.db) {
16120 endIndex = serializeInto(buffer, {
16121 '$ref': value.namespace,
16124 }, false, index, depth + 1, serializeFunctions);
16126 endIndex = serializeInto(buffer, {
16127 '$ref': value.namespace,
16129 }, false, index, depth + 1, serializeFunctions);
16132 // Calculate object size
16133 var size = endIndex - startIndex;
16135 buffer[startIndex++] = size & 0xff;
16136 buffer[startIndex++] = size >> 8 & 0xff;
16137 buffer[startIndex++] = size >> 16 & 0xff;
16138 buffer[startIndex++] = size >> 24 & 0xff;
16143 var serializeInto = function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) {
16144 startingIndex = startingIndex || 0;
16147 // Push the object to the path
16150 // Start place to serialize into
16151 var index = startingIndex + 4;
16154 // Special case isArray
16155 if (Array.isArray(object)) {
16157 for (var i = 0; i < object.length; i++) {
16159 var value = object[i];
16161 // Is there an override value
16162 if (value && value.toBSON) {
16163 if (typeof value.toBSON != 'function') throw new Error("toBSON is not a function");
16164 value = value.toBSON();
16167 var type = typeof value;
16168 if (type == 'string') {
16169 index = serializeString(buffer, key, value, index, true);
16170 } else if (type == 'number') {
16171 index = serializeNumber(buffer, key, value, index, true);
16172 } else if (type == 'boolean') {
16173 index = serializeBoolean(buffer, key, value, index, true);
16174 } else if (value instanceof Date || isDate(value)) {
16175 index = serializeDate(buffer, key, value, index, true);
16176 } else if (value === undefined) {
16177 index = serializeNull(buffer, key, value, index, true);
16178 } else if (value === null) {
16179 index = serializeNull(buffer, key, value, index, true);
16180 } else if (value['_bsontype'] == 'ObjectID') {
16181 index = serializeObjectId(buffer, key, value, index, true);
16182 } else if (Buffer.isBuffer(value)) {
16183 index = serializeBuffer(buffer, key, value, index, true);
16184 } else if (value instanceof RegExp || isRegExp(value)) {
16185 index = serializeRegExp(buffer, key, value, index, true);
16186 } else if (type == 'object' && value['_bsontype'] == null) {
16187 index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path);
16188 } else if (type == 'object' && value['_bsontype'] == 'Decimal128') {
16189 index = serializeDecimal128(buffer, key, value, index, true);
16190 } else if (value['_bsontype'] == 'Long' || value['_bsontype'] == 'Timestamp') {
16191 index = serializeLong(buffer, key, value, index, true);
16192 } else if (value['_bsontype'] == 'Double') {
16193 index = serializeDouble(buffer, key, value, index, true);
16194 } else if (typeof value == 'function' && serializeFunctions) {
16195 index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions, true);
16196 } else if (value['_bsontype'] == 'Code') {
16197 index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true);
16198 } else if (value['_bsontype'] == 'Binary') {
16199 index = serializeBinary(buffer, key, value, index, true);
16200 } else if (value['_bsontype'] == 'Symbol') {
16201 index = serializeSymbol(buffer, key, value, index, true);
16202 } else if (value['_bsontype'] == 'DBRef') {
16203 index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true);
16204 } else if (value['_bsontype'] == 'BSONRegExp') {
16205 index = serializeBSONRegExp(buffer, key, value, index, true);
16206 } else if (value['_bsontype'] == 'Int32') {
16207 index = serializeInt32(buffer, key, value, index, true);
16208 } else if (value['_bsontype'] == 'MinKey' || value['_bsontype'] == 'MaxKey') {
16209 index = serializeMinMax(buffer, key, value, index, true);
16212 } else if (object instanceof Map) {
16213 var iterator = object.entries();
16217 // Unpack the next entry
16218 var entry = iterator.next();
16220 // Are we done, then skip and terminate
16221 if (done) continue;
16223 // Get the entry values
16224 var key = entry.value[0];
16225 var value = entry.value[1];
16227 // Check the type of the value
16228 var type = typeof value;
16230 // Check the key and throw error if it's illegal
16231 if (key != '$db' && key != '$ref' && key != '$id') {
16232 if (key.match(regexp) != null) {
16233 // The BSON spec doesn't allow keys with null bytes because keys are
16234 // null-terminated.
16235 throw Error("key " + key + " must not contain null bytes");
16239 if ('$' == key[0]) {
16240 throw Error("key " + key + " must not start with '$'");
16241 } else if (!!~key.indexOf('.')) {
16242 throw Error("key " + key + " must not contain '.'");
16247 if (type == 'string') {
16248 index = serializeString(buffer, key, value, index);
16249 } else if (type == 'number') {
16250 index = serializeNumber(buffer, key, value, index);
16251 } else if (type == 'boolean') {
16252 index = serializeBoolean(buffer, key, value, index);
16253 } else if (value instanceof Date || isDate(value)) {
16254 index = serializeDate(buffer, key, value, index);
16255 } else if (value === undefined && ignoreUndefined == true) {} else if (value === undefined) {
16256 index = serializeUndefined(buffer, key, value, index);
16257 } else if (value === null) {
16258 index = serializeNull(buffer, key, value, index);
16259 } else if (value['_bsontype'] == 'ObjectID') {
16260 index = serializeObjectId(buffer, key, value, index);
16261 } else if (Buffer.isBuffer(value)) {
16262 index = serializeBuffer(buffer, key, value, index);
16263 } else if (value instanceof RegExp || isRegExp(value)) {
16264 index = serializeRegExp(buffer, key, value, index);
16265 } else if (type == 'object' && value['_bsontype'] == null) {
16266 index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
16267 } else if (type == 'object' && value['_bsontype'] == 'Decimal128') {
16268 index = serializeDecimal128(buffer, key, value, index);
16269 } else if (value['_bsontype'] == 'Long' || value['_bsontype'] == 'Timestamp') {
16270 index = serializeLong(buffer, key, value, index);
16271 } else if (value['_bsontype'] == 'Double') {
16272 index = serializeDouble(buffer, key, value, index);
16273 } else if (value['_bsontype'] == 'Code') {
16274 index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
16275 } else if (typeof value == 'function' && serializeFunctions) {
16276 index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
16277 } else if (value['_bsontype'] == 'Binary') {
16278 index = serializeBinary(buffer, key, value, index);
16279 } else if (value['_bsontype'] == 'Symbol') {
16280 index = serializeSymbol(buffer, key, value, index);
16281 } else if (value['_bsontype'] == 'DBRef') {
16282 index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
16283 } else if (value['_bsontype'] == 'BSONRegExp') {
16284 index = serializeBSONRegExp(buffer, key, value, index);
16285 } else if (value['_bsontype'] == 'Int32') {
16286 index = serializeInt32(buffer, key, value, index);
16287 } else if (value['_bsontype'] == 'MinKey' || value['_bsontype'] == 'MaxKey') {
16288 index = serializeMinMax(buffer, key, value, index);
16292 // Did we provide a custom serialization method
16293 if (object.toBSON) {
16294 if (typeof object.toBSON != 'function') throw new Error("toBSON is not a function");
16295 object = object.toBSON();
16296 if (object != null && typeof object != 'object') throw new Error("toBSON function did not return an object");
16299 // Iterate over all the keys
16300 for (var key in object) {
16301 var value = object[key];
16302 // Is there an override value
16303 if (value && value.toBSON) {
16304 if (typeof value.toBSON != 'function') throw new Error("toBSON is not a function");
16305 value = value.toBSON();
16308 // Check the type of the value
16309 var type = typeof value;
16311 // Check the key and throw error if it's illegal
16312 if (key != '$db' && key != '$ref' && key != '$id') {
16313 if (key.match(regexp) != null) {
16314 // The BSON spec doesn't allow keys with null bytes because keys are
16315 // null-terminated.
16316 throw Error("key " + key + " must not contain null bytes");
16320 if ('$' == key[0]) {
16321 throw Error("key " + key + " must not start with '$'");
16322 } else if (!!~key.indexOf('.')) {
16323 throw Error("key " + key + " must not contain '.'");
16328 if (type == 'string') {
16329 index = serializeString(buffer, key, value, index);
16330 } else if (type == 'number') {
16331 index = serializeNumber(buffer, key, value, index);
16332 } else if (type == 'boolean') {
16333 index = serializeBoolean(buffer, key, value, index);
16334 } else if (value instanceof Date || isDate(value)) {
16335 index = serializeDate(buffer, key, value, index);
16336 } else if (value === undefined && ignoreUndefined == true) {} else if (value === undefined) {
16337 index = serializeUndefined(buffer, key, value, index);
16338 } else if (value === null) {
16339 index = serializeNull(buffer, key, value, index);
16340 } else if (value['_bsontype'] == 'ObjectID') {
16341 index = serializeObjectId(buffer, key, value, index);
16342 } else if (Buffer.isBuffer(value)) {
16343 index = serializeBuffer(buffer, key, value, index);
16344 } else if (value instanceof RegExp || isRegExp(value)) {
16345 index = serializeRegExp(buffer, key, value, index);
16346 } else if (type == 'object' && value['_bsontype'] == null) {
16347 index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
16348 } else if (type == 'object' && value['_bsontype'] == 'Decimal128') {
16349 index = serializeDecimal128(buffer, key, value, index);
16350 } else if (value['_bsontype'] == 'Long' || value['_bsontype'] == 'Timestamp') {
16351 index = serializeLong(buffer, key, value, index);
16352 } else if (value['_bsontype'] == 'Double') {
16353 index = serializeDouble(buffer, key, value, index);
16354 } else if (value['_bsontype'] == 'Code') {
16355 index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
16356 } else if (typeof value == 'function' && serializeFunctions) {
16357 index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
16358 } else if (value['_bsontype'] == 'Binary') {
16359 index = serializeBinary(buffer, key, value, index);
16360 } else if (value['_bsontype'] == 'Symbol') {
16361 index = serializeSymbol(buffer, key, value, index);
16362 } else if (value['_bsontype'] == 'DBRef') {
16363 index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
16364 } else if (value['_bsontype'] == 'BSONRegExp') {
16365 index = serializeBSONRegExp(buffer, key, value, index);
16366 } else if (value['_bsontype'] == 'Int32') {
16367 index = serializeInt32(buffer, key, value, index);
16368 } else if (value['_bsontype'] == 'MinKey' || value['_bsontype'] == 'MaxKey') {
16369 index = serializeMinMax(buffer, key, value, index);
16377 // Final padding byte for object
16378 buffer[index++] = 0x00;
16381 var size = index - startingIndex;
16382 // Write the size of the object
16383 buffer[startingIndex++] = size & 0xff;
16384 buffer[startingIndex++] = size >> 8 & 0xff;
16385 buffer[startingIndex++] = size >> 16 & 0xff;
16386 buffer[startingIndex++] = size >> 24 & 0xff;
16393 * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
16398 var functionCache = BSON.functionCache = {};
16403 * @classconstant BSON_DATA_NUMBER
16405 BSON.BSON_DATA_NUMBER = 1;
16409 * @classconstant BSON_DATA_STRING
16411 BSON.BSON_DATA_STRING = 2;
16415 * @classconstant BSON_DATA_OBJECT
16417 BSON.BSON_DATA_OBJECT = 3;
16421 * @classconstant BSON_DATA_ARRAY
16423 BSON.BSON_DATA_ARRAY = 4;
16427 * @classconstant BSON_DATA_BINARY
16429 BSON.BSON_DATA_BINARY = 5;
16431 * ObjectID BSON Type, deprecated
16433 * @classconstant BSON_DATA_UNDEFINED
16435 BSON.BSON_DATA_UNDEFINED = 6;
16437 * ObjectID BSON Type
16439 * @classconstant BSON_DATA_OID
16441 BSON.BSON_DATA_OID = 7;
16443 * Boolean BSON Type
16445 * @classconstant BSON_DATA_BOOLEAN
16447 BSON.BSON_DATA_BOOLEAN = 8;
16451 * @classconstant BSON_DATA_DATE
16453 BSON.BSON_DATA_DATE = 9;
16457 * @classconstant BSON_DATA_NULL
16459 BSON.BSON_DATA_NULL = 10;
16463 * @classconstant BSON_DATA_REGEXP
16465 BSON.BSON_DATA_REGEXP = 11;
16469 * @classconstant BSON_DATA_CODE
16471 BSON.BSON_DATA_CODE = 13;
16475 * @classconstant BSON_DATA_SYMBOL
16477 BSON.BSON_DATA_SYMBOL = 14;
16479 * Code with Scope BSON Type
16481 * @classconstant BSON_DATA_CODE_W_SCOPE
16483 BSON.BSON_DATA_CODE_W_SCOPE = 15;
16485 * 32 bit Integer BSON Type
16487 * @classconstant BSON_DATA_INT
16489 BSON.BSON_DATA_INT = 16;
16491 * Timestamp BSON Type
16493 * @classconstant BSON_DATA_TIMESTAMP
16495 BSON.BSON_DATA_TIMESTAMP = 17;
16499 * @classconstant BSON_DATA_LONG
16501 BSON.BSON_DATA_LONG = 18;
16505 * @classconstant BSON_DATA_DECIMAL128
16507 BSON.BSON_DATA_DECIMAL128 = 19;
16511 * @classconstant BSON_DATA_MIN_KEY
16513 BSON.BSON_DATA_MIN_KEY = 0xff;
16517 * @classconstant BSON_DATA_MAX_KEY
16519 BSON.BSON_DATA_MAX_KEY = 0x7f;
16521 * Binary Default Type
16523 * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
16525 BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
16527 * Binary Function Type
16529 * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
16531 BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
16533 * Binary Byte Array Type
16535 * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
16537 BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
16541 * @classconstant BSON_BINARY_SUBTYPE_UUID
16543 BSON.BSON_BINARY_SUBTYPE_UUID = 3;
16547 * @classconstant BSON_BINARY_SUBTYPE_MD5
16549 BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
16551 * Binary User Defined Type
16553 * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
16555 BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
16558 BSON.BSON_INT32_MAX = 0x7FFFFFFF;
16559 BSON.BSON_INT32_MIN = -0x80000000;
16561 BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
16562 BSON.BSON_INT64_MIN = -Math.pow(2, 63);
16564 // JS MAX PRECISE VALUES
16565 BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
16566 BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
16568 // Internal long versions
16569 var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
16570 var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
16572 module.exports = serializeInto;
16573 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(300).Buffer))
16577 /***/ function(module, exports, __webpack_require__) {
16579 /* WEBPACK VAR INJECTION */(function(Buffer) {"use strict";
16581 var writeIEEE754 = __webpack_require__(304).writeIEEE754,
16582 readIEEE754 = __webpack_require__(304).readIEEE754,
16583 Long = __webpack_require__(306).Long,
16584 Double = __webpack_require__(307).Double,
16585 Timestamp = __webpack_require__(308).Timestamp,
16586 ObjectID = __webpack_require__(309).ObjectID,
16587 Symbol = __webpack_require__(311).Symbol,
16588 BSONRegExp = __webpack_require__(310).BSONRegExp,
16589 Code = __webpack_require__(313).Code,
16590 Decimal128 = __webpack_require__(314),
16591 MinKey = __webpack_require__(315).MinKey,
16592 MaxKey = __webpack_require__(316).MaxKey,
16593 DBRef = __webpack_require__(317).DBRef,
16594 Binary = __webpack_require__(318).Binary;
16596 // To ensure that 0.4 of node works correctly
16597 var isDate = function isDate(d) {
16598 return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
16601 var calculateObjectSize = function calculateObjectSize(object, serializeFunctions, ignoreUndefined) {
16602 var totalLength = 4 + 1;
16604 if (Array.isArray(object)) {
16605 for (var i = 0; i < object.length; i++) {
16606 totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined);
16609 // If we have toBSON defined, override the current object
16610 if (object.toBSON) {
16611 object = object.toBSON();
16615 for (var key in object) {
16616 totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined);
16620 return totalLength;
16627 function calculateElement(name, value, serializeFunctions, isArray, ignoreUndefined) {
16628 // If we have toBSON defined, override the current object
16629 if (value && value.toBSON) {
16630 value = value.toBSON();
16633 switch (typeof value) {
16635 return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1;
16637 if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
16638 if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
16640 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1);
16642 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
16646 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
16649 if (isArray || !ignoreUndefined) return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
16652 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1);
16654 if (value == null || value instanceof MinKey || value instanceof MaxKey || value['_bsontype'] == 'MinKey' || value['_bsontype'] == 'MaxKey') {
16655 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
16656 } else if (value instanceof ObjectID || value['_bsontype'] == 'ObjectID') {
16657 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1);
16658 } else if (value instanceof Date || isDate(value)) {
16659 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
16660 } else if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
16661 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.length;
16662 } else if (value instanceof Long || value instanceof Double || value instanceof Timestamp || value['_bsontype'] == 'Long' || value['_bsontype'] == 'Double' || value['_bsontype'] == 'Timestamp') {
16663 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
16664 } else if (value instanceof Decimal128 || value['_bsontype'] == 'Decimal128') {
16665 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1);
16666 } else if (value instanceof Code || value['_bsontype'] == 'Code') {
16667 // Calculate size depending on the availability of a scope
16668 if (value.scope != null && Object.keys(value.scope).length > 0) {
16669 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
16671 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1;
16673 } else if (value instanceof Binary || value['_bsontype'] == 'Binary') {
16674 // Check what kind of subtype we have
16675 if (value.sub_type == Binary.SUBTYPE_BYTE_ARRAY) {
16676 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1 + 4);
16678 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1);
16680 } else if (value instanceof Symbol || value['_bsontype'] == 'Symbol') {
16681 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + Buffer.byteLength(value.value, 'utf8') + 4 + 1 + 1;
16682 } else if (value instanceof DBRef || value['_bsontype'] == 'DBRef') {
16683 // Set up correct object for serialization
16684 var ordered_values = {
16685 '$ref': value.namespace,
16689 // Add db reference if it exists
16690 if (null != value.db) {
16691 ordered_values['$db'] = value.db;
16694 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined);
16695 } else if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]') {
16696 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
16697 } else if (value instanceof BSONRegExp || value['_bsontype'] == 'BSONRegExp') {
16698 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.pattern, 'utf8') + 1 + Buffer.byteLength(value.options, 'utf8') + 1;
16700 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + 1;
16703 // WTF for 0.4.X where typeof /someregexp/ === 'function'
16704 if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]' || String.call(value) == '[object RegExp]') {
16705 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
16707 if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) {
16708 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(value.toString(), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
16709 } else if (serializeFunctions) {
16710 return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(value.toString(), 'utf8') + 1;
16721 BSON.BSON_INT32_MAX = 0x7FFFFFFF;
16722 BSON.BSON_INT32_MIN = -0x80000000;
16724 // JS MAX PRECISE VALUES
16725 BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
16726 BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
16728 module.exports = calculateObjectSize;
16729 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(300).Buffer))