1 | (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
2 | (function (global){
|
3 | "use strict";
|
4 |
|
5 | _dereq_(295);
|
6 |
|
7 | _dereq_(296);
|
8 |
|
9 | _dereq_(2);
|
10 |
|
11 | if (global._babelPolyfill) {
|
12 | throw new Error("only one instance of babel-polyfill is allowed");
|
13 | }
|
14 | global._babelPolyfill = true;
|
15 |
|
16 | var DEFINE_PROPERTY = "defineProperty";
|
17 | function define(O, key, value) {
|
18 | O[key] || Object[DEFINE_PROPERTY](O, key, {
|
19 | writable: true,
|
20 | configurable: true,
|
21 | value: value
|
22 | });
|
23 | }
|
24 |
|
25 | define(String.prototype, "padLeft", "".padStart);
|
26 | define(String.prototype, "padRight", "".padEnd);
|
27 |
|
28 | "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) {
|
29 | [][key] && define(Array, key, Function.call.bind([][key]));
|
30 | });
|
31 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
32 | },{"2":2,"295":295,"296":296}],2:[function(_dereq_,module,exports){
|
33 | _dereq_(119);
|
34 | module.exports = _dereq_(23).RegExp.escape;
|
35 | },{"119":119,"23":23}],3:[function(_dereq_,module,exports){
|
36 | module.exports = function(it){
|
37 | if(typeof it != 'function')throw TypeError(it + ' is not a function!');
|
38 | return it;
|
39 | };
|
40 | },{}],4:[function(_dereq_,module,exports){
|
41 | var cof = _dereq_(18);
|
42 | module.exports = function(it, msg){
|
43 | if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg);
|
44 | return +it;
|
45 | };
|
46 | },{"18":18}],5:[function(_dereq_,module,exports){
|
47 |
|
48 | var UNSCOPABLES = _dereq_(117)('unscopables')
|
49 | , ArrayProto = Array.prototype;
|
50 | if(ArrayProto[UNSCOPABLES] == undefined)_dereq_(40)(ArrayProto, UNSCOPABLES, {});
|
51 | module.exports = function(key){
|
52 | ArrayProto[UNSCOPABLES][key] = true;
|
53 | };
|
54 | },{"117":117,"40":40}],6:[function(_dereq_,module,exports){
|
55 | module.exports = function(it, Constructor, name, forbiddenField){
|
56 | if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){
|
57 | throw TypeError(name + ': incorrect invocation!');
|
58 | } return it;
|
59 | };
|
60 | },{}],7:[function(_dereq_,module,exports){
|
61 | var isObject = _dereq_(49);
|
62 | module.exports = function(it){
|
63 | if(!isObject(it))throw TypeError(it + ' is not an object!');
|
64 | return it;
|
65 | };
|
66 | },{"49":49}],8:[function(_dereq_,module,exports){
|
67 |
|
68 | 'use strict';
|
69 | var toObject = _dereq_(109)
|
70 | , toIndex = _dereq_(105)
|
71 | , toLength = _dereq_(108);
|
72 |
|
73 | module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){
|
74 | var O = toObject(this)
|
75 | , len = toLength(O.length)
|
76 | , to = toIndex(target, len)
|
77 | , from = toIndex(start, len)
|
78 | , end = arguments.length > 2 ? arguments[2] : undefined
|
79 | , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to)
|
80 | , inc = 1;
|
81 | if(from < to && to < from + count){
|
82 | inc = -1;
|
83 | from += count - 1;
|
84 | to += count - 1;
|
85 | }
|
86 | while(count-- > 0){
|
87 | if(from in O)O[to] = O[from];
|
88 | else delete O[to];
|
89 | to += inc;
|
90 | from += inc;
|
91 | } return O;
|
92 | };
|
93 | },{"105":105,"108":108,"109":109}],9:[function(_dereq_,module,exports){
|
94 |
|
95 | 'use strict';
|
96 | var toObject = _dereq_(109)
|
97 | , toIndex = _dereq_(105)
|
98 | , toLength = _dereq_(108);
|
99 | module.exports = function fill(value /*, start = 0, end = @length */){
|
100 | var O = toObject(this)
|
101 | , length = toLength(O.length)
|
102 | , aLen = arguments.length
|
103 | , index = toIndex(aLen > 1 ? arguments[1] : undefined, length)
|
104 | , end = aLen > 2 ? arguments[2] : undefined
|
105 | , endPos = end === undefined ? length : toIndex(end, length);
|
106 | while(endPos > index)O[index++] = value;
|
107 | return O;
|
108 | };
|
109 | },{"105":105,"108":108,"109":109}],10:[function(_dereq_,module,exports){
|
110 | var forOf = _dereq_(37);
|
111 |
|
112 | module.exports = function(iter, ITERATOR){
|
113 | var result = [];
|
114 | forOf(iter, false, result.push, result, ITERATOR);
|
115 | return result;
|
116 | };
|
117 |
|
118 | },{"37":37}],11:[function(_dereq_,module,exports){
|
119 |
|
120 |
|
121 | var toIObject = _dereq_(107)
|
122 | , toLength = _dereq_(108)
|
123 | , toIndex = _dereq_(105);
|
124 | module.exports = function(IS_INCLUDES){
|
125 | return function($this, el, fromIndex){
|
126 | var O = toIObject($this)
|
127 | , length = toLength(O.length)
|
128 | , index = toIndex(fromIndex, length)
|
129 | , value;
|
130 |
|
131 | if(IS_INCLUDES && el != el)while(length > index){
|
132 | value = O[index++];
|
133 | if(value != value)return true;
|
134 |
|
135 | } else for(;length > index; index++)if(IS_INCLUDES || index in O){
|
136 | if(O[index] === el)return IS_INCLUDES || index || 0;
|
137 | } return !IS_INCLUDES && -1;
|
138 | };
|
139 | };
|
140 | },{"105":105,"107":107,"108":108}],12:[function(_dereq_,module,exports){
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 | var ctx = _dereq_(25)
|
149 | , IObject = _dereq_(45)
|
150 | , toObject = _dereq_(109)
|
151 | , toLength = _dereq_(108)
|
152 | , asc = _dereq_(15);
|
153 | module.exports = function(TYPE, $create){
|
154 | var IS_MAP = TYPE == 1
|
155 | , IS_FILTER = TYPE == 2
|
156 | , IS_SOME = TYPE == 3
|
157 | , IS_EVERY = TYPE == 4
|
158 | , IS_FIND_INDEX = TYPE == 6
|
159 | , NO_HOLES = TYPE == 5 || IS_FIND_INDEX
|
160 | , create = $create || asc;
|
161 | return function($this, callbackfn, that){
|
162 | var O = toObject($this)
|
163 | , self = IObject(O)
|
164 | , f = ctx(callbackfn, that, 3)
|
165 | , length = toLength(self.length)
|
166 | , index = 0
|
167 | , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined
|
168 | , val, res;
|
169 | for(;length > index; index++)if(NO_HOLES || index in self){
|
170 | val = self[index];
|
171 | res = f(val, index, O);
|
172 | if(TYPE){
|
173 | if(IS_MAP)result[index] = res;
|
174 | else if(res)switch(TYPE){
|
175 | case 3: return true;
|
176 | case 5: return val;
|
177 | case 6: return index;
|
178 | case 2: result.push(val);
|
179 | } else if(IS_EVERY)return false;
|
180 | }
|
181 | }
|
182 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
|
183 | };
|
184 | };
|
185 | },{"108":108,"109":109,"15":15,"25":25,"45":45}],13:[function(_dereq_,module,exports){
|
186 | var aFunction = _dereq_(3)
|
187 | , toObject = _dereq_(109)
|
188 | , IObject = _dereq_(45)
|
189 | , toLength = _dereq_(108);
|
190 |
|
191 | module.exports = function(that, callbackfn, aLen, memo, isRight){
|
192 | aFunction(callbackfn);
|
193 | var O = toObject(that)
|
194 | , self = IObject(O)
|
195 | , length = toLength(O.length)
|
196 | , index = isRight ? length - 1 : 0
|
197 | , i = isRight ? -1 : 1;
|
198 | if(aLen < 2)for(;;){
|
199 | if(index in self){
|
200 | memo = self[index];
|
201 | index += i;
|
202 | break;
|
203 | }
|
204 | index += i;
|
205 | if(isRight ? index < 0 : length <= index){
|
206 | throw TypeError('Reduce of empty array with no initial value');
|
207 | }
|
208 | }
|
209 | for(;isRight ? index >= 0 : length > index; index += i)if(index in self){
|
210 | memo = callbackfn(memo, self[index], index, O);
|
211 | }
|
212 | return memo;
|
213 | };
|
214 | },{"108":108,"109":109,"3":3,"45":45}],14:[function(_dereq_,module,exports){
|
215 | var isObject = _dereq_(49)
|
216 | , isArray = _dereq_(47)
|
217 | , SPECIES = _dereq_(117)('species');
|
218 |
|
219 | module.exports = function(original){
|
220 | var C;
|
221 | if(isArray(original)){
|
222 | C = original.constructor;
|
223 |
|
224 | if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;
|
225 | if(isObject(C)){
|
226 | C = C[SPECIES];
|
227 | if(C === null)C = undefined;
|
228 | }
|
229 | } return C === undefined ? Array : C;
|
230 | };
|
231 | },{"117":117,"47":47,"49":49}],15:[function(_dereq_,module,exports){
|
232 |
|
233 | var speciesConstructor = _dereq_(14);
|
234 |
|
235 | module.exports = function(original, length){
|
236 | return new (speciesConstructor(original))(length);
|
237 | };
|
238 | },{"14":14}],16:[function(_dereq_,module,exports){
|
239 | 'use strict';
|
240 | var aFunction = _dereq_(3)
|
241 | , isObject = _dereq_(49)
|
242 | , invoke = _dereq_(44)
|
243 | , arraySlice = [].slice
|
244 | , factories = {};
|
245 |
|
246 | var construct = function(F, len, args){
|
247 | if(!(len in factories)){
|
248 | for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']';
|
249 | factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
|
250 | } return factories[len](F, args);
|
251 | };
|
252 |
|
253 | module.exports = Function.bind || function bind(that /*, args... */){
|
254 | var fn = aFunction(this)
|
255 | , partArgs = arraySlice.call(arguments, 1);
|
256 | var bound = function(/* args... */){
|
257 | var args = partArgs.concat(arraySlice.call(arguments));
|
258 | return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
|
259 | };
|
260 | if(isObject(fn.prototype))bound.prototype = fn.prototype;
|
261 | return bound;
|
262 | };
|
263 | },{"3":3,"44":44,"49":49}],17:[function(_dereq_,module,exports){
|
264 |
|
265 | var cof = _dereq_(18)
|
266 | , TAG = _dereq_(117)('toStringTag')
|
267 |
|
268 | , ARG = cof(function(){ return arguments; }()) == 'Arguments';
|
269 |
|
270 |
|
271 | var tryGet = function(it, key){
|
272 | try {
|
273 | return it[key];
|
274 | } catch(e){ }
|
275 | };
|
276 |
|
277 | module.exports = function(it){
|
278 | var O, T, B;
|
279 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
280 |
|
281 | : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
|
282 |
|
283 | : ARG ? cof(O)
|
284 |
|
285 | : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
|
286 | };
|
287 | },{"117":117,"18":18}],18:[function(_dereq_,module,exports){
|
288 | var toString = {}.toString;
|
289 |
|
290 | module.exports = function(it){
|
291 | return toString.call(it).slice(8, -1);
|
292 | };
|
293 | },{}],19:[function(_dereq_,module,exports){
|
294 | 'use strict';
|
295 | var dP = _dereq_(67).f
|
296 | , create = _dereq_(66)
|
297 | , redefineAll = _dereq_(86)
|
298 | , ctx = _dereq_(25)
|
299 | , anInstance = _dereq_(6)
|
300 | , defined = _dereq_(27)
|
301 | , forOf = _dereq_(37)
|
302 | , $iterDefine = _dereq_(53)
|
303 | , step = _dereq_(55)
|
304 | , setSpecies = _dereq_(91)
|
305 | , DESCRIPTORS = _dereq_(28)
|
306 | , fastKey = _dereq_(62).fastKey
|
307 | , SIZE = DESCRIPTORS ? '_s' : 'size';
|
308 |
|
309 | var getEntry = function(that, key){
|
310 |
|
311 | var index = fastKey(key), entry;
|
312 | if(index !== 'F')return that._i[index];
|
313 |
|
314 | for(entry = that._f; entry; entry = entry.n){
|
315 | if(entry.k == key)return entry;
|
316 | }
|
317 | };
|
318 |
|
319 | module.exports = {
|
320 | getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
|
321 | var C = wrapper(function(that, iterable){
|
322 | anInstance(that, C, NAME, '_i');
|
323 | that._i = create(null);
|
324 | that._f = undefined;
|
325 | that._l = undefined;
|
326 | that[SIZE] = 0;
|
327 | if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
|
328 | });
|
329 | redefineAll(C.prototype, {
|
330 |
|
331 |
|
332 | clear: function clear(){
|
333 | for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){
|
334 | entry.r = true;
|
335 | if(entry.p)entry.p = entry.p.n = undefined;
|
336 | delete data[entry.i];
|
337 | }
|
338 | that._f = that._l = undefined;
|
339 | that[SIZE] = 0;
|
340 | },
|
341 |
|
342 |
|
343 | 'delete': function(key){
|
344 | var that = this
|
345 | , entry = getEntry(that, key);
|
346 | if(entry){
|
347 | var next = entry.n
|
348 | , prev = entry.p;
|
349 | delete that._i[entry.i];
|
350 | entry.r = true;
|
351 | if(prev)prev.n = next;
|
352 | if(next)next.p = prev;
|
353 | if(that._f == entry)that._f = next;
|
354 | if(that._l == entry)that._l = prev;
|
355 | that[SIZE]--;
|
356 | } return !!entry;
|
357 | },
|
358 |
|
359 |
|
360 | forEach: function forEach(callbackfn /*, that = undefined */){
|
361 | anInstance(this, C, 'forEach');
|
362 | var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3)
|
363 | , entry;
|
364 | while(entry = entry ? entry.n : this._f){
|
365 | f(entry.v, entry.k, this);
|
366 |
|
367 | while(entry && entry.r)entry = entry.p;
|
368 | }
|
369 | },
|
370 |
|
371 |
|
372 | has: function has(key){
|
373 | return !!getEntry(this, key);
|
374 | }
|
375 | });
|
376 | if(DESCRIPTORS)dP(C.prototype, 'size', {
|
377 | get: function(){
|
378 | return defined(this[SIZE]);
|
379 | }
|
380 | });
|
381 | return C;
|
382 | },
|
383 | def: function(that, key, value){
|
384 | var entry = getEntry(that, key)
|
385 | , prev, index;
|
386 |
|
387 | if(entry){
|
388 | entry.v = value;
|
389 |
|
390 | } else {
|
391 | that._l = entry = {
|
392 | i: index = fastKey(key, true),
|
393 | k: key,
|
394 | v: value,
|
395 | p: prev = that._l,
|
396 | n: undefined,
|
397 | r: false
|
398 | };
|
399 | if(!that._f)that._f = entry;
|
400 | if(prev)prev.n = entry;
|
401 | that[SIZE]++;
|
402 |
|
403 | if(index !== 'F')that._i[index] = entry;
|
404 | } return that;
|
405 | },
|
406 | getEntry: getEntry,
|
407 | setStrong: function(C, NAME, IS_MAP){
|
408 |
|
409 |
|
410 | $iterDefine(C, NAME, function(iterated, kind){
|
411 | this._t = iterated;
|
412 | this._k = kind;
|
413 | this._l = undefined;
|
414 | }, function(){
|
415 | var that = this
|
416 | , kind = that._k
|
417 | , entry = that._l;
|
418 |
|
419 | while(entry && entry.r)entry = entry.p;
|
420 |
|
421 | if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){
|
422 |
|
423 | that._t = undefined;
|
424 | return step(1);
|
425 | }
|
426 |
|
427 | if(kind == 'keys' )return step(0, entry.k);
|
428 | if(kind == 'values')return step(0, entry.v);
|
429 | return step(0, [entry.k, entry.v]);
|
430 | }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);
|
431 |
|
432 |
|
433 | setSpecies(NAME);
|
434 | }
|
435 | };
|
436 | },{"25":25,"27":27,"28":28,"37":37,"53":53,"55":55,"6":6,"62":62,"66":66,"67":67,"86":86,"91":91}],20:[function(_dereq_,module,exports){
|
437 |
|
438 | var classof = _dereq_(17)
|
439 | , from = _dereq_(10);
|
440 | module.exports = function(NAME){
|
441 | return function toJSON(){
|
442 | if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic");
|
443 | return from(this);
|
444 | };
|
445 | };
|
446 | },{"10":10,"17":17}],21:[function(_dereq_,module,exports){
|
447 | 'use strict';
|
448 | var redefineAll = _dereq_(86)
|
449 | , getWeak = _dereq_(62).getWeak
|
450 | , anObject = _dereq_(7)
|
451 | , isObject = _dereq_(49)
|
452 | , anInstance = _dereq_(6)
|
453 | , forOf = _dereq_(37)
|
454 | , createArrayMethod = _dereq_(12)
|
455 | , $has = _dereq_(39)
|
456 | , arrayFind = createArrayMethod(5)
|
457 | , arrayFindIndex = createArrayMethod(6)
|
458 | , id = 0;
|
459 |
|
460 |
|
461 | var uncaughtFrozenStore = function(that){
|
462 | return that._l || (that._l = new UncaughtFrozenStore);
|
463 | };
|
464 | var UncaughtFrozenStore = function(){
|
465 | this.a = [];
|
466 | };
|
467 | var findUncaughtFrozen = function(store, key){
|
468 | return arrayFind(store.a, function(it){
|
469 | return it[0] === key;
|
470 | });
|
471 | };
|
472 | UncaughtFrozenStore.prototype = {
|
473 | get: function(key){
|
474 | var entry = findUncaughtFrozen(this, key);
|
475 | if(entry)return entry[1];
|
476 | },
|
477 | has: function(key){
|
478 | return !!findUncaughtFrozen(this, key);
|
479 | },
|
480 | set: function(key, value){
|
481 | var entry = findUncaughtFrozen(this, key);
|
482 | if(entry)entry[1] = value;
|
483 | else this.a.push([key, value]);
|
484 | },
|
485 | 'delete': function(key){
|
486 | var index = arrayFindIndex(this.a, function(it){
|
487 | return it[0] === key;
|
488 | });
|
489 | if(~index)this.a.splice(index, 1);
|
490 | return !!~index;
|
491 | }
|
492 | };
|
493 |
|
494 | module.exports = {
|
495 | getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
|
496 | var C = wrapper(function(that, iterable){
|
497 | anInstance(that, C, NAME, '_i');
|
498 | that._i = id++;
|
499 | that._l = undefined;
|
500 | if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
|
501 | });
|
502 | redefineAll(C.prototype, {
|
503 |
|
504 |
|
505 | 'delete': function(key){
|
506 | if(!isObject(key))return false;
|
507 | var data = getWeak(key);
|
508 | if(data === true)return uncaughtFrozenStore(this)['delete'](key);
|
509 | return data && $has(data, this._i) && delete data[this._i];
|
510 | },
|
511 |
|
512 |
|
513 | has: function has(key){
|
514 | if(!isObject(key))return false;
|
515 | var data = getWeak(key);
|
516 | if(data === true)return uncaughtFrozenStore(this).has(key);
|
517 | return data && $has(data, this._i);
|
518 | }
|
519 | });
|
520 | return C;
|
521 | },
|
522 | def: function(that, key, value){
|
523 | var data = getWeak(anObject(key), true);
|
524 | if(data === true)uncaughtFrozenStore(that).set(key, value);
|
525 | else data[that._i] = value;
|
526 | return that;
|
527 | },
|
528 | ufstore: uncaughtFrozenStore
|
529 | };
|
530 | },{"12":12,"37":37,"39":39,"49":49,"6":6,"62":62,"7":7,"86":86}],22:[function(_dereq_,module,exports){
|
531 | 'use strict';
|
532 | var global = _dereq_(38)
|
533 | , $export = _dereq_(32)
|
534 | , redefine = _dereq_(87)
|
535 | , redefineAll = _dereq_(86)
|
536 | , meta = _dereq_(62)
|
537 | , forOf = _dereq_(37)
|
538 | , anInstance = _dereq_(6)
|
539 | , isObject = _dereq_(49)
|
540 | , fails = _dereq_(34)
|
541 | , $iterDetect = _dereq_(54)
|
542 | , setToStringTag = _dereq_(92)
|
543 | , inheritIfRequired = _dereq_(43);
|
544 |
|
545 | module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){
|
546 | var Base = global[NAME]
|
547 | , C = Base
|
548 | , ADDER = IS_MAP ? 'set' : 'add'
|
549 | , proto = C && C.prototype
|
550 | , O = {};
|
551 | var fixMethod = function(KEY){
|
552 | var fn = proto[KEY];
|
553 | redefine(proto, KEY,
|
554 | KEY == 'delete' ? function(a){
|
555 | return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
|
556 | } : KEY == 'has' ? function has(a){
|
557 | return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
|
558 | } : KEY == 'get' ? function get(a){
|
559 | return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
|
560 | } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; }
|
561 | : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; }
|
562 | );
|
563 | };
|
564 | if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){
|
565 | new C().entries().next();
|
566 | }))){
|
567 |
|
568 | C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
|
569 | redefineAll(C.prototype, methods);
|
570 | meta.NEED = true;
|
571 | } else {
|
572 | var instance = new C
|
573 |
|
574 | , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance
|
575 |
|
576 | , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); })
|
577 |
|
578 | , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); })
|
579 |
|
580 | , BUGGY_ZERO = !IS_WEAK && fails(function(){
|
581 |
|
582 | var $instance = new C()
|
583 | , index = 5;
|
584 | while(index--)$instance[ADDER](index, index);
|
585 | return !$instance.has(-0);
|
586 | });
|
587 | if(!ACCEPT_ITERABLES){
|
588 | C = wrapper(function(target, iterable){
|
589 | anInstance(target, C, NAME);
|
590 | var that = inheritIfRequired(new Base, target, C);
|
591 | if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
|
592 | return that;
|
593 | });
|
594 | C.prototype = proto;
|
595 | proto.constructor = C;
|
596 | }
|
597 | if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){
|
598 | fixMethod('delete');
|
599 | fixMethod('has');
|
600 | IS_MAP && fixMethod('get');
|
601 | }
|
602 | if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER);
|
603 |
|
604 | if(IS_WEAK && proto.clear)delete proto.clear;
|
605 | }
|
606 |
|
607 | setToStringTag(C, NAME);
|
608 |
|
609 | O[NAME] = C;
|
610 | $export($export.G + $export.W + $export.F * (C != Base), O);
|
611 |
|
612 | if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);
|
613 |
|
614 | return C;
|
615 | };
|
616 | },{"32":32,"34":34,"37":37,"38":38,"43":43,"49":49,"54":54,"6":6,"62":62,"86":86,"87":87,"92":92}],23:[function(_dereq_,module,exports){
|
617 | var core = module.exports = {version: '2.4.0'};
|
618 | if(typeof __e == 'number')__e = core;
|
619 | },{}],24:[function(_dereq_,module,exports){
|
620 | 'use strict';
|
621 | var $defineProperty = _dereq_(67)
|
622 | , createDesc = _dereq_(85);
|
623 |
|
624 | module.exports = function(object, index, value){
|
625 | if(index in object)$defineProperty.f(object, index, createDesc(0, value));
|
626 | else object[index] = value;
|
627 | };
|
628 | },{"67":67,"85":85}],25:[function(_dereq_,module,exports){
|
629 |
|
630 | var aFunction = _dereq_(3);
|
631 | module.exports = function(fn, that, length){
|
632 | aFunction(fn);
|
633 | if(that === undefined)return fn;
|
634 | switch(length){
|
635 | case 1: return function(a){
|
636 | return fn.call(that, a);
|
637 | };
|
638 | case 2: return function(a, b){
|
639 | return fn.call(that, a, b);
|
640 | };
|
641 | case 3: return function(a, b, c){
|
642 | return fn.call(that, a, b, c);
|
643 | };
|
644 | }
|
645 | return function(/* ...args */){
|
646 | return fn.apply(that, arguments);
|
647 | };
|
648 | };
|
649 | },{"3":3}],26:[function(_dereq_,module,exports){
|
650 | 'use strict';
|
651 | var anObject = _dereq_(7)
|
652 | , toPrimitive = _dereq_(110)
|
653 | , NUMBER = 'number';
|
654 |
|
655 | module.exports = function(hint){
|
656 | if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint');
|
657 | return toPrimitive(anObject(this), hint != NUMBER);
|
658 | };
|
659 | },{"110":110,"7":7}],27:[function(_dereq_,module,exports){
|
660 |
|
661 | module.exports = function(it){
|
662 | if(it == undefined)throw TypeError("Can't call method on " + it);
|
663 | return it;
|
664 | };
|
665 | },{}],28:[function(_dereq_,module,exports){
|
666 |
|
667 | module.exports = !_dereq_(34)(function(){
|
668 | return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
|
669 | });
|
670 | },{"34":34}],29:[function(_dereq_,module,exports){
|
671 | var isObject = _dereq_(49)
|
672 | , document = _dereq_(38).document
|
673 |
|
674 | , is = isObject(document) && isObject(document.createElement);
|
675 | module.exports = function(it){
|
676 | return is ? document.createElement(it) : {};
|
677 | };
|
678 | },{"38":38,"49":49}],30:[function(_dereq_,module,exports){
|
679 |
|
680 | module.exports = (
|
681 | 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
682 | ).split(',');
|
683 | },{}],31:[function(_dereq_,module,exports){
|
684 |
|
685 | var getKeys = _dereq_(76)
|
686 | , gOPS = _dereq_(73)
|
687 | , pIE = _dereq_(77);
|
688 | module.exports = function(it){
|
689 | var result = getKeys(it)
|
690 | , getSymbols = gOPS.f;
|
691 | if(getSymbols){
|
692 | var symbols = getSymbols(it)
|
693 | , isEnum = pIE.f
|
694 | , i = 0
|
695 | , key;
|
696 | while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);
|
697 | } return result;
|
698 | };
|
699 | },{"73":73,"76":76,"77":77}],32:[function(_dereq_,module,exports){
|
700 | var global = _dereq_(38)
|
701 | , core = _dereq_(23)
|
702 | , hide = _dereq_(40)
|
703 | , redefine = _dereq_(87)
|
704 | , ctx = _dereq_(25)
|
705 | , PROTOTYPE = 'prototype';
|
706 |
|
707 | var $export = function(type, name, source){
|
708 | var IS_FORCED = type & $export.F
|
709 | , IS_GLOBAL = type & $export.G
|
710 | , IS_STATIC = type & $export.S
|
711 | , IS_PROTO = type & $export.P
|
712 | , IS_BIND = type & $export.B
|
713 | , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]
|
714 | , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
|
715 | , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})
|
716 | , key, own, out, exp;
|
717 | if(IS_GLOBAL)source = name;
|
718 | for(key in source){
|
719 |
|
720 | own = !IS_FORCED && target && target[key] !== undefined;
|
721 |
|
722 | out = (own ? target : source)[key];
|
723 |
|
724 | exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
|
725 |
|
726 | if(target)redefine(target, key, out, type & $export.U);
|
727 |
|
728 | if(exports[key] != out)hide(exports, key, exp);
|
729 | if(IS_PROTO && expProto[key] != out)expProto[key] = out;
|
730 | }
|
731 | };
|
732 | global.core = core;
|
733 |
|
734 | $export.F = 1;
|
735 | $export.G = 2;
|
736 | $export.S = 4;
|
737 | $export.P = 8;
|
738 | $export.B = 16;
|
739 | $export.W = 32;
|
740 | $export.U = 64;
|
741 | $export.R = 128;
|
742 | module.exports = $export;
|
743 | },{"23":23,"25":25,"38":38,"40":40,"87":87}],33:[function(_dereq_,module,exports){
|
744 | var MATCH = _dereq_(117)('match');
|
745 | module.exports = function(KEY){
|
746 | var re = /./;
|
747 | try {
|
748 | '/./'[KEY](re);
|
749 | } catch(e){
|
750 | try {
|
751 | re[MATCH] = false;
|
752 | return !'/./'[KEY](re);
|
753 | } catch(f){ }
|
754 | } return true;
|
755 | };
|
756 | },{"117":117}],34:[function(_dereq_,module,exports){
|
757 | module.exports = function(exec){
|
758 | try {
|
759 | return !!exec();
|
760 | } catch(e){
|
761 | return true;
|
762 | }
|
763 | };
|
764 | },{}],35:[function(_dereq_,module,exports){
|
765 | 'use strict';
|
766 | var hide = _dereq_(40)
|
767 | , redefine = _dereq_(87)
|
768 | , fails = _dereq_(34)
|
769 | , defined = _dereq_(27)
|
770 | , wks = _dereq_(117);
|
771 |
|
772 | module.exports = function(KEY, length, exec){
|
773 | var SYMBOL = wks(KEY)
|
774 | , fns = exec(defined, SYMBOL, ''[KEY])
|
775 | , strfn = fns[0]
|
776 | , rxfn = fns[1];
|
777 | if(fails(function(){
|
778 | var O = {};
|
779 | O[SYMBOL] = function(){ return 7; };
|
780 | return ''[KEY](O) != 7;
|
781 | })){
|
782 | redefine(String.prototype, KEY, strfn);
|
783 | hide(RegExp.prototype, SYMBOL, length == 2
|
784 |
|
785 |
|
786 | ? function(string, arg){ return rxfn.call(string, this, arg); }
|
787 |
|
788 |
|
789 | : function(string){ return rxfn.call(string, this); }
|
790 | );
|
791 | }
|
792 | };
|
793 | },{"117":117,"27":27,"34":34,"40":40,"87":87}],36:[function(_dereq_,module,exports){
|
794 | 'use strict';
|
795 |
|
796 | var anObject = _dereq_(7);
|
797 | module.exports = function(){
|
798 | var that = anObject(this)
|
799 | , result = '';
|
800 | if(that.global) result += 'g';
|
801 | if(that.ignoreCase) result += 'i';
|
802 | if(that.multiline) result += 'm';
|
803 | if(that.unicode) result += 'u';
|
804 | if(that.sticky) result += 'y';
|
805 | return result;
|
806 | };
|
807 | },{"7":7}],37:[function(_dereq_,module,exports){
|
808 | var ctx = _dereq_(25)
|
809 | , call = _dereq_(51)
|
810 | , isArrayIter = _dereq_(46)
|
811 | , anObject = _dereq_(7)
|
812 | , toLength = _dereq_(108)
|
813 | , getIterFn = _dereq_(118)
|
814 | , BREAK = {}
|
815 | , RETURN = {};
|
816 | var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){
|
817 | var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)
|
818 | , f = ctx(fn, that, entries ? 2 : 1)
|
819 | , index = 0
|
820 | , length, step, iterator, result;
|
821 | if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
|
822 |
|
823 | if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
|
824 | result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
|
825 | if(result === BREAK || result === RETURN)return result;
|
826 | } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
|
827 | result = call(iterator, f, step.value, entries);
|
828 | if(result === BREAK || result === RETURN)return result;
|
829 | }
|
830 | };
|
831 | exports.BREAK = BREAK;
|
832 | exports.RETURN = RETURN;
|
833 | },{"108":108,"118":118,"25":25,"46":46,"51":51,"7":7}],38:[function(_dereq_,module,exports){
|
834 |
|
835 | var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
836 | ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
|
837 | if(typeof __g == 'number')__g = global;
|
838 | },{}],39:[function(_dereq_,module,exports){
|
839 | var hasOwnProperty = {}.hasOwnProperty;
|
840 | module.exports = function(it, key){
|
841 | return hasOwnProperty.call(it, key);
|
842 | };
|
843 | },{}],40:[function(_dereq_,module,exports){
|
844 | var dP = _dereq_(67)
|
845 | , createDesc = _dereq_(85);
|
846 | module.exports = _dereq_(28) ? function(object, key, value){
|
847 | return dP.f(object, key, createDesc(1, value));
|
848 | } : function(object, key, value){
|
849 | object[key] = value;
|
850 | return object;
|
851 | };
|
852 | },{"28":28,"67":67,"85":85}],41:[function(_dereq_,module,exports){
|
853 | module.exports = _dereq_(38).document && document.documentElement;
|
854 | },{"38":38}],42:[function(_dereq_,module,exports){
|
855 | module.exports = !_dereq_(28) && !_dereq_(34)(function(){
|
856 | return Object.defineProperty(_dereq_(29)('div'), 'a', {get: function(){ return 7; }}).a != 7;
|
857 | });
|
858 | },{"28":28,"29":29,"34":34}],43:[function(_dereq_,module,exports){
|
859 | var isObject = _dereq_(49)
|
860 | , setPrototypeOf = _dereq_(90).set;
|
861 | module.exports = function(that, target, C){
|
862 | var P, S = target.constructor;
|
863 | if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){
|
864 | setPrototypeOf(that, P);
|
865 | } return that;
|
866 | };
|
867 | },{"49":49,"90":90}],44:[function(_dereq_,module,exports){
|
868 |
|
869 | module.exports = function(fn, args, that){
|
870 | var un = that === undefined;
|
871 | switch(args.length){
|
872 | case 0: return un ? fn()
|
873 | : fn.call(that);
|
874 | case 1: return un ? fn(args[0])
|
875 | : fn.call(that, args[0]);
|
876 | case 2: return un ? fn(args[0], args[1])
|
877 | : fn.call(that, args[0], args[1]);
|
878 | case 3: return un ? fn(args[0], args[1], args[2])
|
879 | : fn.call(that, args[0], args[1], args[2]);
|
880 | case 4: return un ? fn(args[0], args[1], args[2], args[3])
|
881 | : fn.call(that, args[0], args[1], args[2], args[3]);
|
882 | } return fn.apply(that, args);
|
883 | };
|
884 | },{}],45:[function(_dereq_,module,exports){
|
885 |
|
886 | var cof = _dereq_(18);
|
887 | module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
|
888 | return cof(it) == 'String' ? it.split('') : Object(it);
|
889 | };
|
890 | },{"18":18}],46:[function(_dereq_,module,exports){
|
891 |
|
892 | var Iterators = _dereq_(56)
|
893 | , ITERATOR = _dereq_(117)('iterator')
|
894 | , ArrayProto = Array.prototype;
|
895 |
|
896 | module.exports = function(it){
|
897 | return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
|
898 | };
|
899 | },{"117":117,"56":56}],47:[function(_dereq_,module,exports){
|
900 |
|
901 | var cof = _dereq_(18);
|
902 | module.exports = Array.isArray || function isArray(arg){
|
903 | return cof(arg) == 'Array';
|
904 | };
|
905 | },{"18":18}],48:[function(_dereq_,module,exports){
|
906 |
|
907 | var isObject = _dereq_(49)
|
908 | , floor = Math.floor;
|
909 | module.exports = function isInteger(it){
|
910 | return !isObject(it) && isFinite(it) && floor(it) === it;
|
911 | };
|
912 | },{"49":49}],49:[function(_dereq_,module,exports){
|
913 | module.exports = function(it){
|
914 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
915 | };
|
916 | },{}],50:[function(_dereq_,module,exports){
|
917 |
|
918 | var isObject = _dereq_(49)
|
919 | , cof = _dereq_(18)
|
920 | , MATCH = _dereq_(117)('match');
|
921 | module.exports = function(it){
|
922 | var isRegExp;
|
923 | return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
|
924 | };
|
925 | },{"117":117,"18":18,"49":49}],51:[function(_dereq_,module,exports){
|
926 |
|
927 | var anObject = _dereq_(7);
|
928 | module.exports = function(iterator, fn, value, entries){
|
929 | try {
|
930 | return entries ? fn(anObject(value)[0], value[1]) : fn(value);
|
931 |
|
932 | } catch(e){
|
933 | var ret = iterator['return'];
|
934 | if(ret !== undefined)anObject(ret.call(iterator));
|
935 | throw e;
|
936 | }
|
937 | };
|
938 | },{"7":7}],52:[function(_dereq_,module,exports){
|
939 | 'use strict';
|
940 | var create = _dereq_(66)
|
941 | , descriptor = _dereq_(85)
|
942 | , setToStringTag = _dereq_(92)
|
943 | , IteratorPrototype = {};
|
944 |
|
945 |
|
946 | _dereq_(40)(IteratorPrototype, _dereq_(117)('iterator'), function(){ return this; });
|
947 |
|
948 | module.exports = function(Constructor, NAME, next){
|
949 | Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
|
950 | setToStringTag(Constructor, NAME + ' Iterator');
|
951 | };
|
952 | },{"117":117,"40":40,"66":66,"85":85,"92":92}],53:[function(_dereq_,module,exports){
|
953 | 'use strict';
|
954 | var LIBRARY = _dereq_(58)
|
955 | , $export = _dereq_(32)
|
956 | , redefine = _dereq_(87)
|
957 | , hide = _dereq_(40)
|
958 | , has = _dereq_(39)
|
959 | , Iterators = _dereq_(56)
|
960 | , $iterCreate = _dereq_(52)
|
961 | , setToStringTag = _dereq_(92)
|
962 | , getPrototypeOf = _dereq_(74)
|
963 | , ITERATOR = _dereq_(117)('iterator')
|
964 | , BUGGY = !([].keys && 'next' in [].keys())
|
965 | , FF_ITERATOR = '@@iterator'
|
966 | , KEYS = 'keys'
|
967 | , VALUES = 'values';
|
968 |
|
969 | var returnThis = function(){ return this; };
|
970 |
|
971 | module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
|
972 | $iterCreate(Constructor, NAME, next);
|
973 | var getMethod = function(kind){
|
974 | if(!BUGGY && kind in proto)return proto[kind];
|
975 | switch(kind){
|
976 | case KEYS: return function keys(){ return new Constructor(this, kind); };
|
977 | case VALUES: return function values(){ return new Constructor(this, kind); };
|
978 | } return function entries(){ return new Constructor(this, kind); };
|
979 | };
|
980 | var TAG = NAME + ' Iterator'
|
981 | , DEF_VALUES = DEFAULT == VALUES
|
982 | , VALUES_BUG = false
|
983 | , proto = Base.prototype
|
984 | , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
|
985 | , $default = $native || getMethod(DEFAULT)
|
986 | , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
|
987 | , $anyNative = NAME == 'Array' ? proto.entries || $native : $native
|
988 | , methods, key, IteratorPrototype;
|
989 |
|
990 | if($anyNative){
|
991 | IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
|
992 | if(IteratorPrototype !== Object.prototype){
|
993 |
|
994 | setToStringTag(IteratorPrototype, TAG, true);
|
995 |
|
996 | if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
|
997 | }
|
998 | }
|
999 |
|
1000 | if(DEF_VALUES && $native && $native.name !== VALUES){
|
1001 | VALUES_BUG = true;
|
1002 | $default = function values(){ return $native.call(this); };
|
1003 | }
|
1004 |
|
1005 | if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
|
1006 | hide(proto, ITERATOR, $default);
|
1007 | }
|
1008 |
|
1009 | Iterators[NAME] = $default;
|
1010 | Iterators[TAG] = returnThis;
|
1011 | if(DEFAULT){
|
1012 | methods = {
|
1013 | values: DEF_VALUES ? $default : getMethod(VALUES),
|
1014 | keys: IS_SET ? $default : getMethod(KEYS),
|
1015 | entries: $entries
|
1016 | };
|
1017 | if(FORCED)for(key in methods){
|
1018 | if(!(key in proto))redefine(proto, key, methods[key]);
|
1019 | } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
|
1020 | }
|
1021 | return methods;
|
1022 | };
|
1023 | },{"117":117,"32":32,"39":39,"40":40,"52":52,"56":56,"58":58,"74":74,"87":87,"92":92}],54:[function(_dereq_,module,exports){
|
1024 | var ITERATOR = _dereq_(117)('iterator')
|
1025 | , SAFE_CLOSING = false;
|
1026 |
|
1027 | try {
|
1028 | var riter = [7][ITERATOR]();
|
1029 | riter['return'] = function(){ SAFE_CLOSING = true; };
|
1030 | Array.from(riter, function(){ throw 2; });
|
1031 | } catch(e){ }
|
1032 |
|
1033 | module.exports = function(exec, skipClosing){
|
1034 | if(!skipClosing && !SAFE_CLOSING)return false;
|
1035 | var safe = false;
|
1036 | try {
|
1037 | var arr = [7]
|
1038 | , iter = arr[ITERATOR]();
|
1039 | iter.next = function(){ return {done: safe = true}; };
|
1040 | arr[ITERATOR] = function(){ return iter; };
|
1041 | exec(arr);
|
1042 | } catch(e){ }
|
1043 | return safe;
|
1044 | };
|
1045 | },{"117":117}],55:[function(_dereq_,module,exports){
|
1046 | module.exports = function(done, value){
|
1047 | return {value: value, done: !!done};
|
1048 | };
|
1049 | },{}],56:[function(_dereq_,module,exports){
|
1050 | module.exports = {};
|
1051 | },{}],57:[function(_dereq_,module,exports){
|
1052 | var getKeys = _dereq_(76)
|
1053 | , toIObject = _dereq_(107);
|
1054 | module.exports = function(object, el){
|
1055 | var O = toIObject(object)
|
1056 | , keys = getKeys(O)
|
1057 | , length = keys.length
|
1058 | , index = 0
|
1059 | , key;
|
1060 | while(length > index)if(O[key = keys[index++]] === el)return key;
|
1061 | };
|
1062 | },{"107":107,"76":76}],58:[function(_dereq_,module,exports){
|
1063 | module.exports = false;
|
1064 | },{}],59:[function(_dereq_,module,exports){
|
1065 |
|
1066 | var $expm1 = Math.expm1;
|
1067 | module.exports = (!$expm1
|
1068 |
|
1069 | || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
|
1070 |
|
1071 | || $expm1(-2e-17) != -2e-17
|
1072 | ) ? function expm1(x){
|
1073 | return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
|
1074 | } : $expm1;
|
1075 | },{}],60:[function(_dereq_,module,exports){
|
1076 |
|
1077 | module.exports = Math.log1p || function log1p(x){
|
1078 | return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
|
1079 | };
|
1080 | },{}],61:[function(_dereq_,module,exports){
|
1081 |
|
1082 | module.exports = Math.sign || function sign(x){
|
1083 | return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
|
1084 | };
|
1085 | },{}],62:[function(_dereq_,module,exports){
|
1086 | var META = _dereq_(114)('meta')
|
1087 | , isObject = _dereq_(49)
|
1088 | , has = _dereq_(39)
|
1089 | , setDesc = _dereq_(67).f
|
1090 | , id = 0;
|
1091 | var isExtensible = Object.isExtensible || function(){
|
1092 | return true;
|
1093 | };
|
1094 | var FREEZE = !_dereq_(34)(function(){
|
1095 | return isExtensible(Object.preventExtensions({}));
|
1096 | });
|
1097 | var setMeta = function(it){
|
1098 | setDesc(it, META, {value: {
|
1099 | i: 'O' + ++id,
|
1100 | w: {}
|
1101 | }});
|
1102 | };
|
1103 | var fastKey = function(it, create){
|
1104 |
|
1105 | if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
1106 | if(!has(it, META)){
|
1107 |
|
1108 | if(!isExtensible(it))return 'F';
|
1109 |
|
1110 | if(!create)return 'E';
|
1111 |
|
1112 | setMeta(it);
|
1113 |
|
1114 | } return it[META].i;
|
1115 | };
|
1116 | var getWeak = function(it, create){
|
1117 | if(!has(it, META)){
|
1118 |
|
1119 | if(!isExtensible(it))return true;
|
1120 |
|
1121 | if(!create)return false;
|
1122 |
|
1123 | setMeta(it);
|
1124 |
|
1125 | } return it[META].w;
|
1126 | };
|
1127 |
|
1128 | var onFreeze = function(it){
|
1129 | if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);
|
1130 | return it;
|
1131 | };
|
1132 | var meta = module.exports = {
|
1133 | KEY: META,
|
1134 | NEED: false,
|
1135 | fastKey: fastKey,
|
1136 | getWeak: getWeak,
|
1137 | onFreeze: onFreeze
|
1138 | };
|
1139 | },{"114":114,"34":34,"39":39,"49":49,"67":67}],63:[function(_dereq_,module,exports){
|
1140 | var Map = _dereq_(149)
|
1141 | , $export = _dereq_(32)
|
1142 | , shared = _dereq_(94)('metadata')
|
1143 | , store = shared.store || (shared.store = new (_dereq_(255)));
|
1144 |
|
1145 | var getOrCreateMetadataMap = function(target, targetKey, create){
|
1146 | var targetMetadata = store.get(target);
|
1147 | if(!targetMetadata){
|
1148 | if(!create)return undefined;
|
1149 | store.set(target, targetMetadata = new Map);
|
1150 | }
|
1151 | var keyMetadata = targetMetadata.get(targetKey);
|
1152 | if(!keyMetadata){
|
1153 | if(!create)return undefined;
|
1154 | targetMetadata.set(targetKey, keyMetadata = new Map);
|
1155 | } return keyMetadata;
|
1156 | };
|
1157 | var ordinaryHasOwnMetadata = function(MetadataKey, O, P){
|
1158 | var metadataMap = getOrCreateMetadataMap(O, P, false);
|
1159 | return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
|
1160 | };
|
1161 | var ordinaryGetOwnMetadata = function(MetadataKey, O, P){
|
1162 | var metadataMap = getOrCreateMetadataMap(O, P, false);
|
1163 | return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
|
1164 | };
|
1165 | var ordinaryDefineOwnMetadata = function(MetadataKey, MetadataValue, O, P){
|
1166 | getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
|
1167 | };
|
1168 | var ordinaryOwnMetadataKeys = function(target, targetKey){
|
1169 | var metadataMap = getOrCreateMetadataMap(target, targetKey, false)
|
1170 | , keys = [];
|
1171 | if(metadataMap)metadataMap.forEach(function(_, key){ keys.push(key); });
|
1172 | return keys;
|
1173 | };
|
1174 | var toMetaKey = function(it){
|
1175 | return it === undefined || typeof it == 'symbol' ? it : String(it);
|
1176 | };
|
1177 | var exp = function(O){
|
1178 | $export($export.S, 'Reflect', O);
|
1179 | };
|
1180 |
|
1181 | module.exports = {
|
1182 | store: store,
|
1183 | map: getOrCreateMetadataMap,
|
1184 | has: ordinaryHasOwnMetadata,
|
1185 | get: ordinaryGetOwnMetadata,
|
1186 | set: ordinaryDefineOwnMetadata,
|
1187 | keys: ordinaryOwnMetadataKeys,
|
1188 | key: toMetaKey,
|
1189 | exp: exp
|
1190 | };
|
1191 | },{"149":149,"255":255,"32":32,"94":94}],64:[function(_dereq_,module,exports){
|
1192 | var global = _dereq_(38)
|
1193 | , macrotask = _dereq_(104).set
|
1194 | , Observer = global.MutationObserver || global.WebKitMutationObserver
|
1195 | , process = global.process
|
1196 | , Promise = global.Promise
|
1197 | , isNode = _dereq_(18)(process) == 'process';
|
1198 |
|
1199 | module.exports = function(){
|
1200 | var head, last, notify;
|
1201 |
|
1202 | var flush = function(){
|
1203 | var parent, fn;
|
1204 | if(isNode && (parent = process.domain))parent.exit();
|
1205 | while(head){
|
1206 | fn = head.fn;
|
1207 | head = head.next;
|
1208 | try {
|
1209 | fn();
|
1210 | } catch(e){
|
1211 | if(head)notify();
|
1212 | else last = undefined;
|
1213 | throw e;
|
1214 | }
|
1215 | } last = undefined;
|
1216 | if(parent)parent.enter();
|
1217 | };
|
1218 |
|
1219 |
|
1220 | if(isNode){
|
1221 | notify = function(){
|
1222 | process.nextTick(flush);
|
1223 | };
|
1224 |
|
1225 | } else if(Observer){
|
1226 | var toggle = true
|
1227 | , node = document.createTextNode('');
|
1228 | new Observer(flush).observe(node, {characterData: true});
|
1229 | notify = function(){
|
1230 | node.data = toggle = !toggle;
|
1231 | };
|
1232 |
|
1233 | } else if(Promise && Promise.resolve){
|
1234 | var promise = Promise.resolve();
|
1235 | notify = function(){
|
1236 | promise.then(flush);
|
1237 | };
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 | } else {
|
1245 | notify = function(){
|
1246 |
|
1247 | macrotask.call(global, flush);
|
1248 | };
|
1249 | }
|
1250 |
|
1251 | return function(fn){
|
1252 | var task = {fn: fn, next: undefined};
|
1253 | if(last)last.next = task;
|
1254 | if(!head){
|
1255 | head = task;
|
1256 | notify();
|
1257 | } last = task;
|
1258 | };
|
1259 | };
|
1260 | },{"104":104,"18":18,"38":38}],65:[function(_dereq_,module,exports){
|
1261 | 'use strict';
|
1262 |
|
1263 | var getKeys = _dereq_(76)
|
1264 | , gOPS = _dereq_(73)
|
1265 | , pIE = _dereq_(77)
|
1266 | , toObject = _dereq_(109)
|
1267 | , IObject = _dereq_(45)
|
1268 | , $assign = Object.assign;
|
1269 |
|
1270 |
|
1271 | module.exports = !$assign || _dereq_(34)(function(){
|
1272 | var A = {}
|
1273 | , B = {}
|
1274 | , S = Symbol()
|
1275 | , K = 'abcdefghijklmnopqrst';
|
1276 | A[S] = 7;
|
1277 | K.split('').forEach(function(k){ B[k] = k; });
|
1278 | return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
|
1279 | }) ? function assign(target, source){
|
1280 | var T = toObject(target)
|
1281 | , aLen = arguments.length
|
1282 | , index = 1
|
1283 | , getSymbols = gOPS.f
|
1284 | , isEnum = pIE.f;
|
1285 | while(aLen > index){
|
1286 | var S = IObject(arguments[index++])
|
1287 | , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
|
1288 | , length = keys.length
|
1289 | , j = 0
|
1290 | , key;
|
1291 | while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
|
1292 | } return T;
|
1293 | } : $assign;
|
1294 | },{"109":109,"34":34,"45":45,"73":73,"76":76,"77":77}],66:[function(_dereq_,module,exports){
|
1295 |
|
1296 | var anObject = _dereq_(7)
|
1297 | , dPs = _dereq_(68)
|
1298 | , enumBugKeys = _dereq_(30)
|
1299 | , IE_PROTO = _dereq_(93)('IE_PROTO')
|
1300 | , Empty = function(){ }
|
1301 | , PROTOTYPE = 'prototype';
|
1302 |
|
1303 |
|
1304 | var createDict = function(){
|
1305 |
|
1306 | var iframe = _dereq_(29)('iframe')
|
1307 | , i = enumBugKeys.length
|
1308 | , lt = '<'
|
1309 | , gt = '>'
|
1310 | , iframeDocument;
|
1311 | iframe.style.display = 'none';
|
1312 | _dereq_(41).appendChild(iframe);
|
1313 | iframe.src = 'javascript:';
|
1314 |
|
1315 |
|
1316 | iframeDocument = iframe.contentWindow.document;
|
1317 | iframeDocument.open();
|
1318 | iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
1319 | iframeDocument.close();
|
1320 | createDict = iframeDocument.F;
|
1321 | while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
|
1322 | return createDict();
|
1323 | };
|
1324 |
|
1325 | module.exports = Object.create || function create(O, Properties){
|
1326 | var result;
|
1327 | if(O !== null){
|
1328 | Empty[PROTOTYPE] = anObject(O);
|
1329 | result = new Empty;
|
1330 | Empty[PROTOTYPE] = null;
|
1331 |
|
1332 | result[IE_PROTO] = O;
|
1333 | } else result = createDict();
|
1334 | return Properties === undefined ? result : dPs(result, Properties);
|
1335 | };
|
1336 |
|
1337 | },{"29":29,"30":30,"41":41,"68":68,"7":7,"93":93}],67:[function(_dereq_,module,exports){
|
1338 | var anObject = _dereq_(7)
|
1339 | , IE8_DOM_DEFINE = _dereq_(42)
|
1340 | , toPrimitive = _dereq_(110)
|
1341 | , dP = Object.defineProperty;
|
1342 |
|
1343 | exports.f = _dereq_(28) ? Object.defineProperty : function defineProperty(O, P, Attributes){
|
1344 | anObject(O);
|
1345 | P = toPrimitive(P, true);
|
1346 | anObject(Attributes);
|
1347 | if(IE8_DOM_DEFINE)try {
|
1348 | return dP(O, P, Attributes);
|
1349 | } catch(e){ }
|
1350 | if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
|
1351 | if('value' in Attributes)O[P] = Attributes.value;
|
1352 | return O;
|
1353 | };
|
1354 | },{"110":110,"28":28,"42":42,"7":7}],68:[function(_dereq_,module,exports){
|
1355 | var dP = _dereq_(67)
|
1356 | , anObject = _dereq_(7)
|
1357 | , getKeys = _dereq_(76);
|
1358 |
|
1359 | module.exports = _dereq_(28) ? Object.defineProperties : function defineProperties(O, Properties){
|
1360 | anObject(O);
|
1361 | var keys = getKeys(Properties)
|
1362 | , length = keys.length
|
1363 | , i = 0
|
1364 | , P;
|
1365 | while(length > i)dP.f(O, P = keys[i++], Properties[P]);
|
1366 | return O;
|
1367 | };
|
1368 | },{"28":28,"67":67,"7":7,"76":76}],69:[function(_dereq_,module,exports){
|
1369 |
|
1370 | module.exports = _dereq_(58)|| !_dereq_(34)(function(){
|
1371 | var K = Math.random();
|
1372 |
|
1373 | __defineSetter__.call(null, K, function(){ });
|
1374 | delete _dereq_(38)[K];
|
1375 | });
|
1376 | },{"34":34,"38":38,"58":58}],70:[function(_dereq_,module,exports){
|
1377 | var pIE = _dereq_(77)
|
1378 | , createDesc = _dereq_(85)
|
1379 | , toIObject = _dereq_(107)
|
1380 | , toPrimitive = _dereq_(110)
|
1381 | , has = _dereq_(39)
|
1382 | , IE8_DOM_DEFINE = _dereq_(42)
|
1383 | , gOPD = Object.getOwnPropertyDescriptor;
|
1384 |
|
1385 | exports.f = _dereq_(28) ? gOPD : function getOwnPropertyDescriptor(O, P){
|
1386 | O = toIObject(O);
|
1387 | P = toPrimitive(P, true);
|
1388 | if(IE8_DOM_DEFINE)try {
|
1389 | return gOPD(O, P);
|
1390 | } catch(e){ }
|
1391 | if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);
|
1392 | };
|
1393 | },{"107":107,"110":110,"28":28,"39":39,"42":42,"77":77,"85":85}],71:[function(_dereq_,module,exports){
|
1394 |
|
1395 | var toIObject = _dereq_(107)
|
1396 | , gOPN = _dereq_(72).f
|
1397 | , toString = {}.toString;
|
1398 |
|
1399 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
1400 | ? Object.getOwnPropertyNames(window) : [];
|
1401 |
|
1402 | var getWindowNames = function(it){
|
1403 | try {
|
1404 | return gOPN(it);
|
1405 | } catch(e){
|
1406 | return windowNames.slice();
|
1407 | }
|
1408 | };
|
1409 |
|
1410 | module.exports.f = function getOwnPropertyNames(it){
|
1411 | return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
|
1412 | };
|
1413 |
|
1414 | },{"107":107,"72":72}],72:[function(_dereq_,module,exports){
|
1415 |
|
1416 | var $keys = _dereq_(75)
|
1417 | , hiddenKeys = _dereq_(30).concat('length', 'prototype');
|
1418 |
|
1419 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){
|
1420 | return $keys(O, hiddenKeys);
|
1421 | };
|
1422 | },{"30":30,"75":75}],73:[function(_dereq_,module,exports){
|
1423 | exports.f = Object.getOwnPropertySymbols;
|
1424 | },{}],74:[function(_dereq_,module,exports){
|
1425 |
|
1426 | var has = _dereq_(39)
|
1427 | , toObject = _dereq_(109)
|
1428 | , IE_PROTO = _dereq_(93)('IE_PROTO')
|
1429 | , ObjectProto = Object.prototype;
|
1430 |
|
1431 | module.exports = Object.getPrototypeOf || function(O){
|
1432 | O = toObject(O);
|
1433 | if(has(O, IE_PROTO))return O[IE_PROTO];
|
1434 | if(typeof O.constructor == 'function' && O instanceof O.constructor){
|
1435 | return O.constructor.prototype;
|
1436 | } return O instanceof Object ? ObjectProto : null;
|
1437 | };
|
1438 | },{"109":109,"39":39,"93":93}],75:[function(_dereq_,module,exports){
|
1439 | var has = _dereq_(39)
|
1440 | , toIObject = _dereq_(107)
|
1441 | , arrayIndexOf = _dereq_(11)(false)
|
1442 | , IE_PROTO = _dereq_(93)('IE_PROTO');
|
1443 |
|
1444 | module.exports = function(object, names){
|
1445 | var O = toIObject(object)
|
1446 | , i = 0
|
1447 | , result = []
|
1448 | , key;
|
1449 | for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
|
1450 |
|
1451 | while(names.length > i)if(has(O, key = names[i++])){
|
1452 | ~arrayIndexOf(result, key) || result.push(key);
|
1453 | }
|
1454 | return result;
|
1455 | };
|
1456 | },{"107":107,"11":11,"39":39,"93":93}],76:[function(_dereq_,module,exports){
|
1457 |
|
1458 | var $keys = _dereq_(75)
|
1459 | , enumBugKeys = _dereq_(30);
|
1460 |
|
1461 | module.exports = Object.keys || function keys(O){
|
1462 | return $keys(O, enumBugKeys);
|
1463 | };
|
1464 | },{"30":30,"75":75}],77:[function(_dereq_,module,exports){
|
1465 | exports.f = {}.propertyIsEnumerable;
|
1466 | },{}],78:[function(_dereq_,module,exports){
|
1467 |
|
1468 | var $export = _dereq_(32)
|
1469 | , core = _dereq_(23)
|
1470 | , fails = _dereq_(34);
|
1471 | module.exports = function(KEY, exec){
|
1472 | var fn = (core.Object || {})[KEY] || Object[KEY]
|
1473 | , exp = {};
|
1474 | exp[KEY] = exec(fn);
|
1475 | $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
|
1476 | };
|
1477 | },{"23":23,"32":32,"34":34}],79:[function(_dereq_,module,exports){
|
1478 | var getKeys = _dereq_(76)
|
1479 | , toIObject = _dereq_(107)
|
1480 | , isEnum = _dereq_(77).f;
|
1481 | module.exports = function(isEntries){
|
1482 | return function(it){
|
1483 | var O = toIObject(it)
|
1484 | , keys = getKeys(O)
|
1485 | , length = keys.length
|
1486 | , i = 0
|
1487 | , result = []
|
1488 | , key;
|
1489 | while(length > i)if(isEnum.call(O, key = keys[i++])){
|
1490 | result.push(isEntries ? [key, O[key]] : O[key]);
|
1491 | } return result;
|
1492 | };
|
1493 | };
|
1494 | },{"107":107,"76":76,"77":77}],80:[function(_dereq_,module,exports){
|
1495 |
|
1496 | var gOPN = _dereq_(72)
|
1497 | , gOPS = _dereq_(73)
|
1498 | , anObject = _dereq_(7)
|
1499 | , Reflect = _dereq_(38).Reflect;
|
1500 | module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){
|
1501 | var keys = gOPN.f(anObject(it))
|
1502 | , getSymbols = gOPS.f;
|
1503 | return getSymbols ? keys.concat(getSymbols(it)) : keys;
|
1504 | };
|
1505 | },{"38":38,"7":7,"72":72,"73":73}],81:[function(_dereq_,module,exports){
|
1506 | var $parseFloat = _dereq_(38).parseFloat
|
1507 | , $trim = _dereq_(102).trim;
|
1508 |
|
1509 | module.exports = 1 / $parseFloat(_dereq_(103) + '-0') !== -Infinity ? function parseFloat(str){
|
1510 | var string = $trim(String(str), 3)
|
1511 | , result = $parseFloat(string);
|
1512 | return result === 0 && string.charAt(0) == '-' ? -0 : result;
|
1513 | } : $parseFloat;
|
1514 | },{"102":102,"103":103,"38":38}],82:[function(_dereq_,module,exports){
|
1515 | var $parseInt = _dereq_(38).parseInt
|
1516 | , $trim = _dereq_(102).trim
|
1517 | , ws = _dereq_(103)
|
1518 | , hex = /^[\-+]?0[xX]/;
|
1519 |
|
1520 | module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){
|
1521 | var string = $trim(String(str), 3);
|
1522 | return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
|
1523 | } : $parseInt;
|
1524 | },{"102":102,"103":103,"38":38}],83:[function(_dereq_,module,exports){
|
1525 | 'use strict';
|
1526 | var path = _dereq_(84)
|
1527 | , invoke = _dereq_(44)
|
1528 | , aFunction = _dereq_(3);
|
1529 | module.exports = function(/* ...pargs */){
|
1530 | var fn = aFunction(this)
|
1531 | , length = arguments.length
|
1532 | , pargs = Array(length)
|
1533 | , i = 0
|
1534 | , _ = path._
|
1535 | , holder = false;
|
1536 | while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true;
|
1537 | return function(/* ...args */){
|
1538 | var that = this
|
1539 | , aLen = arguments.length
|
1540 | , j = 0, k = 0, args;
|
1541 | if(!holder && !aLen)return invoke(fn, pargs, that);
|
1542 | args = pargs.slice();
|
1543 | if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++];
|
1544 | while(aLen > k)args.push(arguments[k++]);
|
1545 | return invoke(fn, args, that);
|
1546 | };
|
1547 | };
|
1548 | },{"3":3,"44":44,"84":84}],84:[function(_dereq_,module,exports){
|
1549 | module.exports = _dereq_(38);
|
1550 | },{"38":38}],85:[function(_dereq_,module,exports){
|
1551 | module.exports = function(bitmap, value){
|
1552 | return {
|
1553 | enumerable : !(bitmap & 1),
|
1554 | configurable: !(bitmap & 2),
|
1555 | writable : !(bitmap & 4),
|
1556 | value : value
|
1557 | };
|
1558 | };
|
1559 | },{}],86:[function(_dereq_,module,exports){
|
1560 | var redefine = _dereq_(87);
|
1561 | module.exports = function(target, src, safe){
|
1562 | for(var key in src)redefine(target, key, src[key], safe);
|
1563 | return target;
|
1564 | };
|
1565 | },{"87":87}],87:[function(_dereq_,module,exports){
|
1566 | var global = _dereq_(38)
|
1567 | , hide = _dereq_(40)
|
1568 | , has = _dereq_(39)
|
1569 | , SRC = _dereq_(114)('src')
|
1570 | , TO_STRING = 'toString'
|
1571 | , $toString = Function[TO_STRING]
|
1572 | , TPL = ('' + $toString).split(TO_STRING);
|
1573 |
|
1574 | _dereq_(23).inspectSource = function(it){
|
1575 | return $toString.call(it);
|
1576 | };
|
1577 |
|
1578 | (module.exports = function(O, key, val, safe){
|
1579 | var isFunction = typeof val == 'function';
|
1580 | if(isFunction)has(val, 'name') || hide(val, 'name', key);
|
1581 | if(O[key] === val)return;
|
1582 | if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
|
1583 | if(O === global){
|
1584 | O[key] = val;
|
1585 | } else {
|
1586 | if(!safe){
|
1587 | delete O[key];
|
1588 | hide(O, key, val);
|
1589 | } else {
|
1590 | if(O[key])O[key] = val;
|
1591 | else hide(O, key, val);
|
1592 | }
|
1593 | }
|
1594 |
|
1595 | })(Function.prototype, TO_STRING, function toString(){
|
1596 | return typeof this == 'function' && this[SRC] || $toString.call(this);
|
1597 | });
|
1598 | },{"114":114,"23":23,"38":38,"39":39,"40":40}],88:[function(_dereq_,module,exports){
|
1599 | module.exports = function(regExp, replace){
|
1600 | var replacer = replace === Object(replace) ? function(part){
|
1601 | return replace[part];
|
1602 | } : replace;
|
1603 | return function(it){
|
1604 | return String(it).replace(regExp, replacer);
|
1605 | };
|
1606 | };
|
1607 | },{}],89:[function(_dereq_,module,exports){
|
1608 |
|
1609 | module.exports = Object.is || function is(x, y){
|
1610 | return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
1611 | };
|
1612 | },{}],90:[function(_dereq_,module,exports){
|
1613 |
|
1614 |
|
1615 | var isObject = _dereq_(49)
|
1616 | , anObject = _dereq_(7);
|
1617 | var check = function(O, proto){
|
1618 | anObject(O);
|
1619 | if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!");
|
1620 | };
|
1621 | module.exports = {
|
1622 | set: Object.setPrototypeOf || ('__proto__' in {} ?
|
1623 | function(test, buggy, set){
|
1624 | try {
|
1625 | set = _dereq_(25)(Function.call, _dereq_(70).f(Object.prototype, '__proto__').set, 2);
|
1626 | set(test, []);
|
1627 | buggy = !(test instanceof Array);
|
1628 | } catch(e){ buggy = true; }
|
1629 | return function setPrototypeOf(O, proto){
|
1630 | check(O, proto);
|
1631 | if(buggy)O.__proto__ = proto;
|
1632 | else set(O, proto);
|
1633 | return O;
|
1634 | };
|
1635 | }({}, false) : undefined),
|
1636 | check: check
|
1637 | };
|
1638 | },{"25":25,"49":49,"7":7,"70":70}],91:[function(_dereq_,module,exports){
|
1639 | 'use strict';
|
1640 | var global = _dereq_(38)
|
1641 | , dP = _dereq_(67)
|
1642 | , DESCRIPTORS = _dereq_(28)
|
1643 | , SPECIES = _dereq_(117)('species');
|
1644 |
|
1645 | module.exports = function(KEY){
|
1646 | var C = global[KEY];
|
1647 | if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {
|
1648 | configurable: true,
|
1649 | get: function(){ return this; }
|
1650 | });
|
1651 | };
|
1652 | },{"117":117,"28":28,"38":38,"67":67}],92:[function(_dereq_,module,exports){
|
1653 | var def = _dereq_(67).f
|
1654 | , has = _dereq_(39)
|
1655 | , TAG = _dereq_(117)('toStringTag');
|
1656 |
|
1657 | module.exports = function(it, tag, stat){
|
1658 | if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
|
1659 | };
|
1660 | },{"117":117,"39":39,"67":67}],93:[function(_dereq_,module,exports){
|
1661 | var shared = _dereq_(94)('keys')
|
1662 | , uid = _dereq_(114);
|
1663 | module.exports = function(key){
|
1664 | return shared[key] || (shared[key] = uid(key));
|
1665 | };
|
1666 | },{"114":114,"94":94}],94:[function(_dereq_,module,exports){
|
1667 | var global = _dereq_(38)
|
1668 | , SHARED = '__core-js_shared__'
|
1669 | , store = global[SHARED] || (global[SHARED] = {});
|
1670 | module.exports = function(key){
|
1671 | return store[key] || (store[key] = {});
|
1672 | };
|
1673 | },{"38":38}],95:[function(_dereq_,module,exports){
|
1674 |
|
1675 | var anObject = _dereq_(7)
|
1676 | , aFunction = _dereq_(3)
|
1677 | , SPECIES = _dereq_(117)('species');
|
1678 | module.exports = function(O, D){
|
1679 | var C = anObject(O).constructor, S;
|
1680 | return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
|
1681 | };
|
1682 | },{"117":117,"3":3,"7":7}],96:[function(_dereq_,module,exports){
|
1683 | var fails = _dereq_(34);
|
1684 |
|
1685 | module.exports = function(method, arg){
|
1686 | return !!method && fails(function(){
|
1687 | arg ? method.call(null, function(){}, 1) : method.call(null);
|
1688 | });
|
1689 | };
|
1690 | },{"34":34}],97:[function(_dereq_,module,exports){
|
1691 | var toInteger = _dereq_(106)
|
1692 | , defined = _dereq_(27);
|
1693 |
|
1694 |
|
1695 | module.exports = function(TO_STRING){
|
1696 | return function(that, pos){
|
1697 | var s = String(defined(that))
|
1698 | , i = toInteger(pos)
|
1699 | , l = s.length
|
1700 | , a, b;
|
1701 | if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
|
1702 | a = s.charCodeAt(i);
|
1703 | return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
|
1704 | ? TO_STRING ? s.charAt(i) : a
|
1705 | : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
|
1706 | };
|
1707 | };
|
1708 | },{"106":106,"27":27}],98:[function(_dereq_,module,exports){
|
1709 |
|
1710 | var isRegExp = _dereq_(50)
|
1711 | , defined = _dereq_(27);
|
1712 |
|
1713 | module.exports = function(that, searchString, NAME){
|
1714 | if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!");
|
1715 | return String(defined(that));
|
1716 | };
|
1717 | },{"27":27,"50":50}],99:[function(_dereq_,module,exports){
|
1718 | var $export = _dereq_(32)
|
1719 | , fails = _dereq_(34)
|
1720 | , defined = _dereq_(27)
|
1721 | , quot = /"/g;
|
1722 |
|
1723 | var createHTML = function(string, tag, attribute, value) {
|
1724 | var S = String(defined(string))
|
1725 | , p1 = '<' + tag;
|
1726 | if(attribute !== '')p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"';
|
1727 | return p1 + '>' + S + '</' + tag + '>';
|
1728 | };
|
1729 | module.exports = function(NAME, exec){
|
1730 | var O = {};
|
1731 | O[NAME] = exec(createHTML);
|
1732 | $export($export.P + $export.F * fails(function(){
|
1733 | var test = ''[NAME]('"');
|
1734 | return test !== test.toLowerCase() || test.split('"').length > 3;
|
1735 | }), 'String', O);
|
1736 | };
|
1737 | },{"27":27,"32":32,"34":34}],100:[function(_dereq_,module,exports){
|
1738 |
|
1739 | var toLength = _dereq_(108)
|
1740 | , repeat = _dereq_(101)
|
1741 | , defined = _dereq_(27);
|
1742 |
|
1743 | module.exports = function(that, maxLength, fillString, left){
|
1744 | var S = String(defined(that))
|
1745 | , stringLength = S.length
|
1746 | , fillStr = fillString === undefined ? ' ' : String(fillString)
|
1747 | , intMaxLength = toLength(maxLength);
|
1748 | if(intMaxLength <= stringLength || fillStr == '')return S;
|
1749 | var fillLen = intMaxLength - stringLength
|
1750 | , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
|
1751 | if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);
|
1752 | return left ? stringFiller + S : S + stringFiller;
|
1753 | };
|
1754 |
|
1755 | },{"101":101,"108":108,"27":27}],101:[function(_dereq_,module,exports){
|
1756 | 'use strict';
|
1757 | var toInteger = _dereq_(106)
|
1758 | , defined = _dereq_(27);
|
1759 |
|
1760 | module.exports = function repeat(count){
|
1761 | var str = String(defined(this))
|
1762 | , res = ''
|
1763 | , n = toInteger(count);
|
1764 | if(n < 0 || n == Infinity)throw RangeError("Count can't be negative");
|
1765 | for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;
|
1766 | return res;
|
1767 | };
|
1768 | },{"106":106,"27":27}],102:[function(_dereq_,module,exports){
|
1769 | var $export = _dereq_(32)
|
1770 | , defined = _dereq_(27)
|
1771 | , fails = _dereq_(34)
|
1772 | , spaces = _dereq_(103)
|
1773 | , space = '[' + spaces + ']'
|
1774 | , non = '\u200b\u0085'
|
1775 | , ltrim = RegExp('^' + space + space + '*')
|
1776 | , rtrim = RegExp(space + space + '*$');
|
1777 |
|
1778 | var exporter = function(KEY, exec, ALIAS){
|
1779 | var exp = {};
|
1780 | var FORCE = fails(function(){
|
1781 | return !!spaces[KEY]() || non[KEY]() != non;
|
1782 | });
|
1783 | var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
|
1784 | if(ALIAS)exp[ALIAS] = fn;
|
1785 | $export($export.P + $export.F * FORCE, 'String', exp);
|
1786 | };
|
1787 |
|
1788 |
|
1789 |
|
1790 |
|
1791 | var trim = exporter.trim = function(string, TYPE){
|
1792 | string = String(defined(string));
|
1793 | if(TYPE & 1)string = string.replace(ltrim, '');
|
1794 | if(TYPE & 2)string = string.replace(rtrim, '');
|
1795 | return string;
|
1796 | };
|
1797 |
|
1798 | module.exports = exporter;
|
1799 | },{"103":103,"27":27,"32":32,"34":34}],103:[function(_dereq_,module,exports){
|
1800 | module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
|
1801 | '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
1802 | },{}],104:[function(_dereq_,module,exports){
|
1803 | var ctx = _dereq_(25)
|
1804 | , invoke = _dereq_(44)
|
1805 | , html = _dereq_(41)
|
1806 | , cel = _dereq_(29)
|
1807 | , global = _dereq_(38)
|
1808 | , process = global.process
|
1809 | , setTask = global.setImmediate
|
1810 | , clearTask = global.clearImmediate
|
1811 | , MessageChannel = global.MessageChannel
|
1812 | , counter = 0
|
1813 | , queue = {}
|
1814 | , ONREADYSTATECHANGE = 'onreadystatechange'
|
1815 | , defer, channel, port;
|
1816 | var run = function(){
|
1817 | var id = +this;
|
1818 | if(queue.hasOwnProperty(id)){
|
1819 | var fn = queue[id];
|
1820 | delete queue[id];
|
1821 | fn();
|
1822 | }
|
1823 | };
|
1824 | var listener = function(event){
|
1825 | run.call(event.data);
|
1826 | };
|
1827 |
|
1828 | if(!setTask || !clearTask){
|
1829 | setTask = function setImmediate(fn){
|
1830 | var args = [], i = 1;
|
1831 | while(arguments.length > i)args.push(arguments[i++]);
|
1832 | queue[++counter] = function(){
|
1833 | invoke(typeof fn == 'function' ? fn : Function(fn), args);
|
1834 | };
|
1835 | defer(counter);
|
1836 | return counter;
|
1837 | };
|
1838 | clearTask = function clearImmediate(id){
|
1839 | delete queue[id];
|
1840 | };
|
1841 |
|
1842 | if(_dereq_(18)(process) == 'process'){
|
1843 | defer = function(id){
|
1844 | process.nextTick(ctx(run, id, 1));
|
1845 | };
|
1846 |
|
1847 | } else if(MessageChannel){
|
1848 | channel = new MessageChannel;
|
1849 | port = channel.port2;
|
1850 | channel.port1.onmessage = listener;
|
1851 | defer = ctx(port.postMessage, port, 1);
|
1852 |
|
1853 |
|
1854 | } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){
|
1855 | defer = function(id){
|
1856 | global.postMessage(id + '', '*');
|
1857 | };
|
1858 | global.addEventListener('message', listener, false);
|
1859 |
|
1860 | } else if(ONREADYSTATECHANGE in cel('script')){
|
1861 | defer = function(id){
|
1862 | html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){
|
1863 | html.removeChild(this);
|
1864 | run.call(id);
|
1865 | };
|
1866 | };
|
1867 |
|
1868 | } else {
|
1869 | defer = function(id){
|
1870 | setTimeout(ctx(run, id, 1), 0);
|
1871 | };
|
1872 | }
|
1873 | }
|
1874 | module.exports = {
|
1875 | set: setTask,
|
1876 | clear: clearTask
|
1877 | };
|
1878 | },{"18":18,"25":25,"29":29,"38":38,"41":41,"44":44}],105:[function(_dereq_,module,exports){
|
1879 | var toInteger = _dereq_(106)
|
1880 | , max = Math.max
|
1881 | , min = Math.min;
|
1882 | module.exports = function(index, length){
|
1883 | index = toInteger(index);
|
1884 | return index < 0 ? max(index + length, 0) : min(index, length);
|
1885 | };
|
1886 | },{"106":106}],106:[function(_dereq_,module,exports){
|
1887 |
|
1888 | var ceil = Math.ceil
|
1889 | , floor = Math.floor;
|
1890 | module.exports = function(it){
|
1891 | return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
1892 | };
|
1893 | },{}],107:[function(_dereq_,module,exports){
|
1894 |
|
1895 | var IObject = _dereq_(45)
|
1896 | , defined = _dereq_(27);
|
1897 | module.exports = function(it){
|
1898 | return IObject(defined(it));
|
1899 | };
|
1900 | },{"27":27,"45":45}],108:[function(_dereq_,module,exports){
|
1901 |
|
1902 | var toInteger = _dereq_(106)
|
1903 | , min = Math.min;
|
1904 | module.exports = function(it){
|
1905 | return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0;
|
1906 | };
|
1907 | },{"106":106}],109:[function(_dereq_,module,exports){
|
1908 |
|
1909 | var defined = _dereq_(27);
|
1910 | module.exports = function(it){
|
1911 | return Object(defined(it));
|
1912 | };
|
1913 | },{"27":27}],110:[function(_dereq_,module,exports){
|
1914 |
|
1915 | var isObject = _dereq_(49);
|
1916 |
|
1917 |
|
1918 | module.exports = function(it, S){
|
1919 | if(!isObject(it))return it;
|
1920 | var fn, val;
|
1921 | if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
|
1922 | if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
|
1923 | if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
|
1924 | throw TypeError("Can't convert object to primitive value");
|
1925 | };
|
1926 | },{"49":49}],111:[function(_dereq_,module,exports){
|
1927 | 'use strict';
|
1928 | if(_dereq_(28)){
|
1929 | var LIBRARY = _dereq_(58)
|
1930 | , global = _dereq_(38)
|
1931 | , fails = _dereq_(34)
|
1932 | , $export = _dereq_(32)
|
1933 | , $typed = _dereq_(113)
|
1934 | , $buffer = _dereq_(112)
|
1935 | , ctx = _dereq_(25)
|
1936 | , anInstance = _dereq_(6)
|
1937 | , propertyDesc = _dereq_(85)
|
1938 | , hide = _dereq_(40)
|
1939 | , redefineAll = _dereq_(86)
|
1940 | , toInteger = _dereq_(106)
|
1941 | , toLength = _dereq_(108)
|
1942 | , toIndex = _dereq_(105)
|
1943 | , toPrimitive = _dereq_(110)
|
1944 | , has = _dereq_(39)
|
1945 | , same = _dereq_(89)
|
1946 | , classof = _dereq_(17)
|
1947 | , isObject = _dereq_(49)
|
1948 | , toObject = _dereq_(109)
|
1949 | , isArrayIter = _dereq_(46)
|
1950 | , create = _dereq_(66)
|
1951 | , getPrototypeOf = _dereq_(74)
|
1952 | , gOPN = _dereq_(72).f
|
1953 | , getIterFn = _dereq_(118)
|
1954 | , uid = _dereq_(114)
|
1955 | , wks = _dereq_(117)
|
1956 | , createArrayMethod = _dereq_(12)
|
1957 | , createArrayIncludes = _dereq_(11)
|
1958 | , speciesConstructor = _dereq_(95)
|
1959 | , ArrayIterators = _dereq_(130)
|
1960 | , Iterators = _dereq_(56)
|
1961 | , $iterDetect = _dereq_(54)
|
1962 | , setSpecies = _dereq_(91)
|
1963 | , arrayFill = _dereq_(9)
|
1964 | , arrayCopyWithin = _dereq_(8)
|
1965 | , $DP = _dereq_(67)
|
1966 | , $GOPD = _dereq_(70)
|
1967 | , dP = $DP.f
|
1968 | , gOPD = $GOPD.f
|
1969 | , RangeError = global.RangeError
|
1970 | , TypeError = global.TypeError
|
1971 | , Uint8Array = global.Uint8Array
|
1972 | , ARRAY_BUFFER = 'ArrayBuffer'
|
1973 | , SHARED_BUFFER = 'Shared' + ARRAY_BUFFER
|
1974 | , BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'
|
1975 | , PROTOTYPE = 'prototype'
|
1976 | , ArrayProto = Array[PROTOTYPE]
|
1977 | , $ArrayBuffer = $buffer.ArrayBuffer
|
1978 | , $DataView = $buffer.DataView
|
1979 | , arrayForEach = createArrayMethod(0)
|
1980 | , arrayFilter = createArrayMethod(2)
|
1981 | , arraySome = createArrayMethod(3)
|
1982 | , arrayEvery = createArrayMethod(4)
|
1983 | , arrayFind = createArrayMethod(5)
|
1984 | , arrayFindIndex = createArrayMethod(6)
|
1985 | , arrayIncludes = createArrayIncludes(true)
|
1986 | , arrayIndexOf = createArrayIncludes(false)
|
1987 | , arrayValues = ArrayIterators.values
|
1988 | , arrayKeys = ArrayIterators.keys
|
1989 | , arrayEntries = ArrayIterators.entries
|
1990 | , arrayLastIndexOf = ArrayProto.lastIndexOf
|
1991 | , arrayReduce = ArrayProto.reduce
|
1992 | , arrayReduceRight = ArrayProto.reduceRight
|
1993 | , arrayJoin = ArrayProto.join
|
1994 | , arraySort = ArrayProto.sort
|
1995 | , arraySlice = ArrayProto.slice
|
1996 | , arrayToString = ArrayProto.toString
|
1997 | , arrayToLocaleString = ArrayProto.toLocaleString
|
1998 | , ITERATOR = wks('iterator')
|
1999 | , TAG = wks('toStringTag')
|
2000 | , TYPED_CONSTRUCTOR = uid('typed_constructor')
|
2001 | , DEF_CONSTRUCTOR = uid('def_constructor')
|
2002 | , ALL_CONSTRUCTORS = $typed.CONSTR
|
2003 | , TYPED_ARRAY = $typed.TYPED
|
2004 | , VIEW = $typed.VIEW
|
2005 | , WRONG_LENGTH = 'Wrong length!';
|
2006 |
|
2007 | var $map = createArrayMethod(1, function(O, length){
|
2008 | return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
|
2009 | });
|
2010 |
|
2011 | var LITTLE_ENDIAN = fails(function(){
|
2012 | return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
|
2013 | });
|
2014 |
|
2015 | var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function(){
|
2016 | new Uint8Array(1).set({});
|
2017 | });
|
2018 |
|
2019 | var strictToLength = function(it, SAME){
|
2020 | if(it === undefined)throw TypeError(WRONG_LENGTH);
|
2021 | var number = +it
|
2022 | , length = toLength(it);
|
2023 | if(SAME && !same(number, length))throw RangeError(WRONG_LENGTH);
|
2024 | return length;
|
2025 | };
|
2026 |
|
2027 | var toOffset = function(it, BYTES){
|
2028 | var offset = toInteger(it);
|
2029 | if(offset < 0 || offset % BYTES)throw RangeError('Wrong offset!');
|
2030 | return offset;
|
2031 | };
|
2032 |
|
2033 | var validate = function(it){
|
2034 | if(isObject(it) && TYPED_ARRAY in it)return it;
|
2035 | throw TypeError(it + ' is not a typed array!');
|
2036 | };
|
2037 |
|
2038 | var allocate = function(C, length){
|
2039 | if(!(isObject(C) && TYPED_CONSTRUCTOR in C)){
|
2040 | throw TypeError('It is not a typed array constructor!');
|
2041 | } return new C(length);
|
2042 | };
|
2043 |
|
2044 | var speciesFromList = function(O, list){
|
2045 | return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
|
2046 | };
|
2047 |
|
2048 | var fromList = function(C, list){
|
2049 | var index = 0
|
2050 | , length = list.length
|
2051 | , result = allocate(C, length);
|
2052 | while(length > index)result[index] = list[index++];
|
2053 | return result;
|
2054 | };
|
2055 |
|
2056 | var addGetter = function(it, key, internal){
|
2057 | dP(it, key, {get: function(){ return this._d[internal]; }});
|
2058 | };
|
2059 |
|
2060 | var $from = function from(source /*, mapfn, thisArg */){
|
2061 | var O = toObject(source)
|
2062 | , aLen = arguments.length
|
2063 | , mapfn = aLen > 1 ? arguments[1] : undefined
|
2064 | , mapping = mapfn !== undefined
|
2065 | , iterFn = getIterFn(O)
|
2066 | , i, length, values, result, step, iterator;
|
2067 | if(iterFn != undefined && !isArrayIter(iterFn)){
|
2068 | for(iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++){
|
2069 | values.push(step.value);
|
2070 | } O = values;
|
2071 | }
|
2072 | if(mapping && aLen > 2)mapfn = ctx(mapfn, arguments[2], 2);
|
2073 | for(i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++){
|
2074 | result[i] = mapping ? mapfn(O[i], i) : O[i];
|
2075 | }
|
2076 | return result;
|
2077 | };
|
2078 |
|
2079 | var $of = function of(/*...items*/){
|
2080 | var index = 0
|
2081 | , length = arguments.length
|
2082 | , result = allocate(this, length);
|
2083 | while(length > index)result[index] = arguments[index++];
|
2084 | return result;
|
2085 | };
|
2086 |
|
2087 |
|
2088 | var TO_LOCALE_BUG = !!Uint8Array && fails(function(){ arrayToLocaleString.call(new Uint8Array(1)); });
|
2089 |
|
2090 | var $toLocaleString = function toLocaleString(){
|
2091 | return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
|
2092 | };
|
2093 |
|
2094 | var proto = {
|
2095 | copyWithin: function copyWithin(target, start /*, end */){
|
2096 | return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
|
2097 | },
|
2098 | every: function every(callbackfn /*, thisArg */){
|
2099 | return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2100 | },
|
2101 | fill: function fill(value /*, start, end */){
|
2102 | return arrayFill.apply(validate(this), arguments);
|
2103 | },
|
2104 | filter: function filter(callbackfn /*, thisArg */){
|
2105 | return speciesFromList(this, arrayFilter(validate(this), callbackfn,
|
2106 | arguments.length > 1 ? arguments[1] : undefined));
|
2107 | },
|
2108 | find: function find(predicate /*, thisArg */){
|
2109 | return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
|
2110 | },
|
2111 | findIndex: function findIndex(predicate /*, thisArg */){
|
2112 | return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
|
2113 | },
|
2114 | forEach: function forEach(callbackfn /*, thisArg */){
|
2115 | arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2116 | },
|
2117 | indexOf: function indexOf(searchElement /*, fromIndex */){
|
2118 | return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
2119 | },
|
2120 | includes: function includes(searchElement /*, fromIndex */){
|
2121 | return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
2122 | },
|
2123 | join: function join(separator){
|
2124 | return arrayJoin.apply(validate(this), arguments);
|
2125 | },
|
2126 | lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */){
|
2127 | return arrayLastIndexOf.apply(validate(this), arguments);
|
2128 | },
|
2129 | map: function map(mapfn /*, thisArg */){
|
2130 | return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
|
2131 | },
|
2132 | reduce: function reduce(callbackfn /*, initialValue */){
|
2133 | return arrayReduce.apply(validate(this), arguments);
|
2134 | },
|
2135 | reduceRight: function reduceRight(callbackfn /*, initialValue */){
|
2136 | return arrayReduceRight.apply(validate(this), arguments);
|
2137 | },
|
2138 | reverse: function reverse(){
|
2139 | var that = this
|
2140 | , length = validate(that).length
|
2141 | , middle = Math.floor(length / 2)
|
2142 | , index = 0
|
2143 | , value;
|
2144 | while(index < middle){
|
2145 | value = that[index];
|
2146 | that[index++] = that[--length];
|
2147 | that[length] = value;
|
2148 | } return that;
|
2149 | },
|
2150 | some: function some(callbackfn /*, thisArg */){
|
2151 | return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2152 | },
|
2153 | sort: function sort(comparefn){
|
2154 | return arraySort.call(validate(this), comparefn);
|
2155 | },
|
2156 | subarray: function subarray(begin, end){
|
2157 | var O = validate(this)
|
2158 | , length = O.length
|
2159 | , $begin = toIndex(begin, length);
|
2160 | return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
|
2161 | O.buffer,
|
2162 | O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
|
2163 | toLength((end === undefined ? length : toIndex(end, length)) - $begin)
|
2164 | );
|
2165 | }
|
2166 | };
|
2167 |
|
2168 | var $slice = function slice(start, end){
|
2169 | return speciesFromList(this, arraySlice.call(validate(this), start, end));
|
2170 | };
|
2171 |
|
2172 | var $set = function set(arrayLike /*, offset */){
|
2173 | validate(this);
|
2174 | var offset = toOffset(arguments[1], 1)
|
2175 | , length = this.length
|
2176 | , src = toObject(arrayLike)
|
2177 | , len = toLength(src.length)
|
2178 | , index = 0;
|
2179 | if(len + offset > length)throw RangeError(WRONG_LENGTH);
|
2180 | while(index < len)this[offset + index] = src[index++];
|
2181 | };
|
2182 |
|
2183 | var $iterators = {
|
2184 | entries: function entries(){
|
2185 | return arrayEntries.call(validate(this));
|
2186 | },
|
2187 | keys: function keys(){
|
2188 | return arrayKeys.call(validate(this));
|
2189 | },
|
2190 | values: function values(){
|
2191 | return arrayValues.call(validate(this));
|
2192 | }
|
2193 | };
|
2194 |
|
2195 | var isTAIndex = function(target, key){
|
2196 | return isObject(target)
|
2197 | && target[TYPED_ARRAY]
|
2198 | && typeof key != 'symbol'
|
2199 | && key in target
|
2200 | && String(+key) == String(key);
|
2201 | };
|
2202 | var $getDesc = function getOwnPropertyDescriptor(target, key){
|
2203 | return isTAIndex(target, key = toPrimitive(key, true))
|
2204 | ? propertyDesc(2, target[key])
|
2205 | : gOPD(target, key);
|
2206 | };
|
2207 | var $setDesc = function defineProperty(target, key, desc){
|
2208 | if(isTAIndex(target, key = toPrimitive(key, true))
|
2209 | && isObject(desc)
|
2210 | && has(desc, 'value')
|
2211 | && !has(desc, 'get')
|
2212 | && !has(desc, 'set')
|
2213 |
|
2214 | && !desc.configurable
|
2215 | && (!has(desc, 'writable') || desc.writable)
|
2216 | && (!has(desc, 'enumerable') || desc.enumerable)
|
2217 | ){
|
2218 | target[key] = desc.value;
|
2219 | return target;
|
2220 | } else return dP(target, key, desc);
|
2221 | };
|
2222 |
|
2223 | if(!ALL_CONSTRUCTORS){
|
2224 | $GOPD.f = $getDesc;
|
2225 | $DP.f = $setDesc;
|
2226 | }
|
2227 |
|
2228 | $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
|
2229 | getOwnPropertyDescriptor: $getDesc,
|
2230 | defineProperty: $setDesc
|
2231 | });
|
2232 |
|
2233 | if(fails(function(){ arrayToString.call({}); })){
|
2234 | arrayToString = arrayToLocaleString = function toString(){
|
2235 | return arrayJoin.call(this);
|
2236 | }
|
2237 | }
|
2238 |
|
2239 | var $TypedArrayPrototype$ = redefineAll({}, proto);
|
2240 | redefineAll($TypedArrayPrototype$, $iterators);
|
2241 | hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
|
2242 | redefineAll($TypedArrayPrototype$, {
|
2243 | slice: $slice,
|
2244 | set: $set,
|
2245 | constructor: function(){ },
|
2246 | toString: arrayToString,
|
2247 | toLocaleString: $toLocaleString
|
2248 | });
|
2249 | addGetter($TypedArrayPrototype$, 'buffer', 'b');
|
2250 | addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
|
2251 | addGetter($TypedArrayPrototype$, 'byteLength', 'l');
|
2252 | addGetter($TypedArrayPrototype$, 'length', 'e');
|
2253 | dP($TypedArrayPrototype$, TAG, {
|
2254 | get: function(){ return this[TYPED_ARRAY]; }
|
2255 | });
|
2256 |
|
2257 | module.exports = function(KEY, BYTES, wrapper, CLAMPED){
|
2258 | CLAMPED = !!CLAMPED;
|
2259 | var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'
|
2260 | , ISNT_UINT8 = NAME != 'Uint8Array'
|
2261 | , GETTER = 'get' + KEY
|
2262 | , SETTER = 'set' + KEY
|
2263 | , TypedArray = global[NAME]
|
2264 | , Base = TypedArray || {}
|
2265 | , TAC = TypedArray && getPrototypeOf(TypedArray)
|
2266 | , FORCED = !TypedArray || !$typed.ABV
|
2267 | , O = {}
|
2268 | , TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
|
2269 | var getter = function(that, index){
|
2270 | var data = that._d;
|
2271 | return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
|
2272 | };
|
2273 | var setter = function(that, index, value){
|
2274 | var data = that._d;
|
2275 | if(CLAMPED)value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
|
2276 | data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
|
2277 | };
|
2278 | var addElement = function(that, index){
|
2279 | dP(that, index, {
|
2280 | get: function(){
|
2281 | return getter(this, index);
|
2282 | },
|
2283 | set: function(value){
|
2284 | return setter(this, index, value);
|
2285 | },
|
2286 | enumerable: true
|
2287 | });
|
2288 | };
|
2289 | if(FORCED){
|
2290 | TypedArray = wrapper(function(that, data, $offset, $length){
|
2291 | anInstance(that, TypedArray, NAME, '_d');
|
2292 | var index = 0
|
2293 | , offset = 0
|
2294 | , buffer, byteLength, length, klass;
|
2295 | if(!isObject(data)){
|
2296 | length = strictToLength(data, true)
|
2297 | byteLength = length * BYTES;
|
2298 | buffer = new $ArrayBuffer(byteLength);
|
2299 | } else if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){
|
2300 | buffer = data;
|
2301 | offset = toOffset($offset, BYTES);
|
2302 | var $len = data.byteLength;
|
2303 | if($length === undefined){
|
2304 | if($len % BYTES)throw RangeError(WRONG_LENGTH);
|
2305 | byteLength = $len - offset;
|
2306 | if(byteLength < 0)throw RangeError(WRONG_LENGTH);
|
2307 | } else {
|
2308 | byteLength = toLength($length) * BYTES;
|
2309 | if(byteLength + offset > $len)throw RangeError(WRONG_LENGTH);
|
2310 | }
|
2311 | length = byteLength / BYTES;
|
2312 | } else if(TYPED_ARRAY in data){
|
2313 | return fromList(TypedArray, data);
|
2314 | } else {
|
2315 | return $from.call(TypedArray, data);
|
2316 | }
|
2317 | hide(that, '_d', {
|
2318 | b: buffer,
|
2319 | o: offset,
|
2320 | l: byteLength,
|
2321 | e: length,
|
2322 | v: new $DataView(buffer)
|
2323 | });
|
2324 | while(index < length)addElement(that, index++);
|
2325 | });
|
2326 | TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
|
2327 | hide(TypedArrayPrototype, 'constructor', TypedArray);
|
2328 | } else if(!$iterDetect(function(iter){
|
2329 |
|
2330 |
|
2331 | new TypedArray(null);
|
2332 | new TypedArray(iter);
|
2333 | }, true)){
|
2334 | TypedArray = wrapper(function(that, data, $offset, $length){
|
2335 | anInstance(that, TypedArray, NAME);
|
2336 | var klass;
|
2337 |
|
2338 |
|
2339 | if(!isObject(data))return new Base(strictToLength(data, ISNT_UINT8));
|
2340 | if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){
|
2341 | return $length !== undefined
|
2342 | ? new Base(data, toOffset($offset, BYTES), $length)
|
2343 | : $offset !== undefined
|
2344 | ? new Base(data, toOffset($offset, BYTES))
|
2345 | : new Base(data);
|
2346 | }
|
2347 | if(TYPED_ARRAY in data)return fromList(TypedArray, data);
|
2348 | return $from.call(TypedArray, data);
|
2349 | });
|
2350 | arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function(key){
|
2351 | if(!(key in TypedArray))hide(TypedArray, key, Base[key]);
|
2352 | });
|
2353 | TypedArray[PROTOTYPE] = TypedArrayPrototype;
|
2354 | if(!LIBRARY)TypedArrayPrototype.constructor = TypedArray;
|
2355 | }
|
2356 | var $nativeIterator = TypedArrayPrototype[ITERATOR]
|
2357 | , CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined)
|
2358 | , $iterator = $iterators.values;
|
2359 | hide(TypedArray, TYPED_CONSTRUCTOR, true);
|
2360 | hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
|
2361 | hide(TypedArrayPrototype, VIEW, true);
|
2362 | hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
|
2363 |
|
2364 | if(CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)){
|
2365 | dP(TypedArrayPrototype, TAG, {
|
2366 | get: function(){ return NAME; }
|
2367 | });
|
2368 | }
|
2369 |
|
2370 | O[NAME] = TypedArray;
|
2371 |
|
2372 | $export($export.G + $export.W + $export.F * (TypedArray != Base), O);
|
2373 |
|
2374 | $export($export.S, NAME, {
|
2375 | BYTES_PER_ELEMENT: BYTES,
|
2376 | from: $from,
|
2377 | of: $of
|
2378 | });
|
2379 |
|
2380 | if(!(BYTES_PER_ELEMENT in TypedArrayPrototype))hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
|
2381 |
|
2382 | $export($export.P, NAME, proto);
|
2383 |
|
2384 | setSpecies(NAME);
|
2385 |
|
2386 | $export($export.P + $export.F * FORCED_SET, NAME, {set: $set});
|
2387 |
|
2388 | $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
|
2389 |
|
2390 | $export($export.P + $export.F * (TypedArrayPrototype.toString != arrayToString), NAME, {toString: arrayToString});
|
2391 |
|
2392 | $export($export.P + $export.F * fails(function(){
|
2393 | new TypedArray(1).slice();
|
2394 | }), NAME, {slice: $slice});
|
2395 |
|
2396 | $export($export.P + $export.F * (fails(function(){
|
2397 | return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString()
|
2398 | }) || !fails(function(){
|
2399 | TypedArrayPrototype.toLocaleString.call([1, 2]);
|
2400 | })), NAME, {toLocaleString: $toLocaleString});
|
2401 |
|
2402 | Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
|
2403 | if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator);
|
2404 | };
|
2405 | } else module.exports = function(){ };
|
2406 | },{"105":105,"106":106,"108":108,"109":109,"11":11,"110":110,"112":112,"113":113,"114":114,"117":117,"118":118,"12":12,"130":130,"17":17,"25":25,"28":28,"32":32,"34":34,"38":38,"39":39,"40":40,"46":46,"49":49,"54":54,"56":56,"58":58,"6":6,"66":66,"67":67,"70":70,"72":72,"74":74,"8":8,"85":85,"86":86,"89":89,"9":9,"91":91,"95":95}],112:[function(_dereq_,module,exports){
|
2407 | 'use strict';
|
2408 | var global = _dereq_(38)
|
2409 | , DESCRIPTORS = _dereq_(28)
|
2410 | , LIBRARY = _dereq_(58)
|
2411 | , $typed = _dereq_(113)
|
2412 | , hide = _dereq_(40)
|
2413 | , redefineAll = _dereq_(86)
|
2414 | , fails = _dereq_(34)
|
2415 | , anInstance = _dereq_(6)
|
2416 | , toInteger = _dereq_(106)
|
2417 | , toLength = _dereq_(108)
|
2418 | , gOPN = _dereq_(72).f
|
2419 | , dP = _dereq_(67).f
|
2420 | , arrayFill = _dereq_(9)
|
2421 | , setToStringTag = _dereq_(92)
|
2422 | , ARRAY_BUFFER = 'ArrayBuffer'
|
2423 | , DATA_VIEW = 'DataView'
|
2424 | , PROTOTYPE = 'prototype'
|
2425 | , WRONG_LENGTH = 'Wrong length!'
|
2426 | , WRONG_INDEX = 'Wrong index!'
|
2427 | , $ArrayBuffer = global[ARRAY_BUFFER]
|
2428 | , $DataView = global[DATA_VIEW]
|
2429 | , Math = global.Math
|
2430 | , RangeError = global.RangeError
|
2431 | , Infinity = global.Infinity
|
2432 | , BaseBuffer = $ArrayBuffer
|
2433 | , abs = Math.abs
|
2434 | , pow = Math.pow
|
2435 | , floor = Math.floor
|
2436 | , log = Math.log
|
2437 | , LN2 = Math.LN2
|
2438 | , BUFFER = 'buffer'
|
2439 | , BYTE_LENGTH = 'byteLength'
|
2440 | , BYTE_OFFSET = 'byteOffset'
|
2441 | , $BUFFER = DESCRIPTORS ? '_b' : BUFFER
|
2442 | , $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH
|
2443 | , $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
|
2444 |
|
2445 |
|
2446 | var packIEEE754 = function(value, mLen, nBytes){
|
2447 | var buffer = Array(nBytes)
|
2448 | , eLen = nBytes * 8 - mLen - 1
|
2449 | , eMax = (1 << eLen) - 1
|
2450 | , eBias = eMax >> 1
|
2451 | , rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0
|
2452 | , i = 0
|
2453 | , s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0
|
2454 | , e, m, c;
|
2455 | value = abs(value)
|
2456 | if(value != value || value === Infinity){
|
2457 | m = value != value ? 1 : 0;
|
2458 | e = eMax;
|
2459 | } else {
|
2460 | e = floor(log(value) / LN2);
|
2461 | if(value * (c = pow(2, -e)) < 1){
|
2462 | e--;
|
2463 | c *= 2;
|
2464 | }
|
2465 | if(e + eBias >= 1){
|
2466 | value += rt / c;
|
2467 | } else {
|
2468 | value += rt * pow(2, 1 - eBias);
|
2469 | }
|
2470 | if(value * c >= 2){
|
2471 | e++;
|
2472 | c /= 2;
|
2473 | }
|
2474 | if(e + eBias >= eMax){
|
2475 | m = 0;
|
2476 | e = eMax;
|
2477 | } else if(e + eBias >= 1){
|
2478 | m = (value * c - 1) * pow(2, mLen);
|
2479 | e = e + eBias;
|
2480 | } else {
|
2481 | m = value * pow(2, eBias - 1) * pow(2, mLen);
|
2482 | e = 0;
|
2483 | }
|
2484 | }
|
2485 | for(; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
|
2486 | e = e << mLen | m;
|
2487 | eLen += mLen;
|
2488 | for(; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
|
2489 | buffer[--i] |= s * 128;
|
2490 | return buffer;
|
2491 | };
|
2492 | var unpackIEEE754 = function(buffer, mLen, nBytes){
|
2493 | var eLen = nBytes * 8 - mLen - 1
|
2494 | , eMax = (1 << eLen) - 1
|
2495 | , eBias = eMax >> 1
|
2496 | , nBits = eLen - 7
|
2497 | , i = nBytes - 1
|
2498 | , s = buffer[i--]
|
2499 | , e = s & 127
|
2500 | , m;
|
2501 | s >>= 7;
|
2502 | for(; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
|
2503 | m = e & (1 << -nBits) - 1;
|
2504 | e >>= -nBits;
|
2505 | nBits += mLen;
|
2506 | for(; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
|
2507 | if(e === 0){
|
2508 | e = 1 - eBias;
|
2509 | } else if(e === eMax){
|
2510 | return m ? NaN : s ? -Infinity : Infinity;
|
2511 | } else {
|
2512 | m = m + pow(2, mLen);
|
2513 | e = e - eBias;
|
2514 | } return (s ? -1 : 1) * m * pow(2, e - mLen);
|
2515 | };
|
2516 |
|
2517 | var unpackI32 = function(bytes){
|
2518 | return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
|
2519 | };
|
2520 | var packI8 = function(it){
|
2521 | return [it & 0xff];
|
2522 | };
|
2523 | var packI16 = function(it){
|
2524 | return [it & 0xff, it >> 8 & 0xff];
|
2525 | };
|
2526 | var packI32 = function(it){
|
2527 | return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
|
2528 | };
|
2529 | var packF64 = function(it){
|
2530 | return packIEEE754(it, 52, 8);
|
2531 | };
|
2532 | var packF32 = function(it){
|
2533 | return packIEEE754(it, 23, 4);
|
2534 | };
|
2535 |
|
2536 | var addGetter = function(C, key, internal){
|
2537 | dP(C[PROTOTYPE], key, {get: function(){ return this[internal]; }});
|
2538 | };
|
2539 |
|
2540 | var get = function(view, bytes, index, isLittleEndian){
|
2541 | var numIndex = +index
|
2542 | , intIndex = toInteger(numIndex);
|
2543 | if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX);
|
2544 | var store = view[$BUFFER]._b
|
2545 | , start = intIndex + view[$OFFSET]
|
2546 | , pack = store.slice(start, start + bytes);
|
2547 | return isLittleEndian ? pack : pack.reverse();
|
2548 | };
|
2549 | var set = function(view, bytes, index, conversion, value, isLittleEndian){
|
2550 | var numIndex = +index
|
2551 | , intIndex = toInteger(numIndex);
|
2552 | if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX);
|
2553 | var store = view[$BUFFER]._b
|
2554 | , start = intIndex + view[$OFFSET]
|
2555 | , pack = conversion(+value);
|
2556 | for(var i = 0; i < bytes; i++)store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
|
2557 | };
|
2558 |
|
2559 | var validateArrayBufferArguments = function(that, length){
|
2560 | anInstance(that, $ArrayBuffer, ARRAY_BUFFER);
|
2561 | var numberLength = +length
|
2562 | , byteLength = toLength(numberLength);
|
2563 | if(numberLength != byteLength)throw RangeError(WRONG_LENGTH);
|
2564 | return byteLength;
|
2565 | };
|
2566 |
|
2567 | if(!$typed.ABV){
|
2568 | $ArrayBuffer = function ArrayBuffer(length){
|
2569 | var byteLength = validateArrayBufferArguments(this, length);
|
2570 | this._b = arrayFill.call(Array(byteLength), 0);
|
2571 | this[$LENGTH] = byteLength;
|
2572 | };
|
2573 |
|
2574 | $DataView = function DataView(buffer, byteOffset, byteLength){
|
2575 | anInstance(this, $DataView, DATA_VIEW);
|
2576 | anInstance(buffer, $ArrayBuffer, DATA_VIEW);
|
2577 | var bufferLength = buffer[$LENGTH]
|
2578 | , offset = toInteger(byteOffset);
|
2579 | if(offset < 0 || offset > bufferLength)throw RangeError('Wrong offset!');
|
2580 | byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
|
2581 | if(offset + byteLength > bufferLength)throw RangeError(WRONG_LENGTH);
|
2582 | this[$BUFFER] = buffer;
|
2583 | this[$OFFSET] = offset;
|
2584 | this[$LENGTH] = byteLength;
|
2585 | };
|
2586 |
|
2587 | if(DESCRIPTORS){
|
2588 | addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
|
2589 | addGetter($DataView, BUFFER, '_b');
|
2590 | addGetter($DataView, BYTE_LENGTH, '_l');
|
2591 | addGetter($DataView, BYTE_OFFSET, '_o');
|
2592 | }
|
2593 |
|
2594 | redefineAll($DataView[PROTOTYPE], {
|
2595 | getInt8: function getInt8(byteOffset){
|
2596 | return get(this, 1, byteOffset)[0] << 24 >> 24;
|
2597 | },
|
2598 | getUint8: function getUint8(byteOffset){
|
2599 | return get(this, 1, byteOffset)[0];
|
2600 | },
|
2601 | getInt16: function getInt16(byteOffset /*, littleEndian */){
|
2602 | var bytes = get(this, 2, byteOffset, arguments[1]);
|
2603 | return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
|
2604 | },
|
2605 | getUint16: function getUint16(byteOffset /*, littleEndian */){
|
2606 | var bytes = get(this, 2, byteOffset, arguments[1]);
|
2607 | return bytes[1] << 8 | bytes[0];
|
2608 | },
|
2609 | getInt32: function getInt32(byteOffset /*, littleEndian */){
|
2610 | return unpackI32(get(this, 4, byteOffset, arguments[1]));
|
2611 | },
|
2612 | getUint32: function getUint32(byteOffset /*, littleEndian */){
|
2613 | return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
|
2614 | },
|
2615 | getFloat32: function getFloat32(byteOffset /*, littleEndian */){
|
2616 | return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
|
2617 | },
|
2618 | getFloat64: function getFloat64(byteOffset /*, littleEndian */){
|
2619 | return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
|
2620 | },
|
2621 | setInt8: function setInt8(byteOffset, value){
|
2622 | set(this, 1, byteOffset, packI8, value);
|
2623 | },
|
2624 | setUint8: function setUint8(byteOffset, value){
|
2625 | set(this, 1, byteOffset, packI8, value);
|
2626 | },
|
2627 | setInt16: function setInt16(byteOffset, value /*, littleEndian */){
|
2628 | set(this, 2, byteOffset, packI16, value, arguments[2]);
|
2629 | },
|
2630 | setUint16: function setUint16(byteOffset, value /*, littleEndian */){
|
2631 | set(this, 2, byteOffset, packI16, value, arguments[2]);
|
2632 | },
|
2633 | setInt32: function setInt32(byteOffset, value /*, littleEndian */){
|
2634 | set(this, 4, byteOffset, packI32, value, arguments[2]);
|
2635 | },
|
2636 | setUint32: function setUint32(byteOffset, value /*, littleEndian */){
|
2637 | set(this, 4, byteOffset, packI32, value, arguments[2]);
|
2638 | },
|
2639 | setFloat32: function setFloat32(byteOffset, value /*, littleEndian */){
|
2640 | set(this, 4, byteOffset, packF32, value, arguments[2]);
|
2641 | },
|
2642 | setFloat64: function setFloat64(byteOffset, value /*, littleEndian */){
|
2643 | set(this, 8, byteOffset, packF64, value, arguments[2]);
|
2644 | }
|
2645 | });
|
2646 | } else {
|
2647 | if(!fails(function(){
|
2648 | new $ArrayBuffer;
|
2649 | }) || !fails(function(){
|
2650 | new $ArrayBuffer(.5);
|
2651 | })){
|
2652 | $ArrayBuffer = function ArrayBuffer(length){
|
2653 | return new BaseBuffer(validateArrayBufferArguments(this, length));
|
2654 | };
|
2655 | var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
|
2656 | for(var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j; ){
|
2657 | if(!((key = keys[j++]) in $ArrayBuffer))hide($ArrayBuffer, key, BaseBuffer[key]);
|
2658 | };
|
2659 | if(!LIBRARY)ArrayBufferProto.constructor = $ArrayBuffer;
|
2660 | }
|
2661 |
|
2662 | var view = new $DataView(new $ArrayBuffer(2))
|
2663 | , $setInt8 = $DataView[PROTOTYPE].setInt8;
|
2664 | view.setInt8(0, 2147483648);
|
2665 | view.setInt8(1, 2147483649);
|
2666 | if(view.getInt8(0) || !view.getInt8(1))redefineAll($DataView[PROTOTYPE], {
|
2667 | setInt8: function setInt8(byteOffset, value){
|
2668 | $setInt8.call(this, byteOffset, value << 24 >> 24);
|
2669 | },
|
2670 | setUint8: function setUint8(byteOffset, value){
|
2671 | $setInt8.call(this, byteOffset, value << 24 >> 24);
|
2672 | }
|
2673 | }, true);
|
2674 | }
|
2675 | setToStringTag($ArrayBuffer, ARRAY_BUFFER);
|
2676 | setToStringTag($DataView, DATA_VIEW);
|
2677 | hide($DataView[PROTOTYPE], $typed.VIEW, true);
|
2678 | exports[ARRAY_BUFFER] = $ArrayBuffer;
|
2679 | exports[DATA_VIEW] = $DataView;
|
2680 | },{"106":106,"108":108,"113":113,"28":28,"34":34,"38":38,"40":40,"58":58,"6":6,"67":67,"72":72,"86":86,"9":9,"92":92}],113:[function(_dereq_,module,exports){
|
2681 | var global = _dereq_(38)
|
2682 | , hide = _dereq_(40)
|
2683 | , uid = _dereq_(114)
|
2684 | , TYPED = uid('typed_array')
|
2685 | , VIEW = uid('view')
|
2686 | , ABV = !!(global.ArrayBuffer && global.DataView)
|
2687 | , CONSTR = ABV
|
2688 | , i = 0, l = 9, Typed;
|
2689 |
|
2690 | var TypedArrayConstructors = (
|
2691 | 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
|
2692 | ).split(',');
|
2693 |
|
2694 | while(i < l){
|
2695 | if(Typed = global[TypedArrayConstructors[i++]]){
|
2696 | hide(Typed.prototype, TYPED, true);
|
2697 | hide(Typed.prototype, VIEW, true);
|
2698 | } else CONSTR = false;
|
2699 | }
|
2700 |
|
2701 | module.exports = {
|
2702 | ABV: ABV,
|
2703 | CONSTR: CONSTR,
|
2704 | TYPED: TYPED,
|
2705 | VIEW: VIEW
|
2706 | };
|
2707 | },{"114":114,"38":38,"40":40}],114:[function(_dereq_,module,exports){
|
2708 | var id = 0
|
2709 | , px = Math.random();
|
2710 | module.exports = function(key){
|
2711 | return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
2712 | };
|
2713 | },{}],115:[function(_dereq_,module,exports){
|
2714 | var global = _dereq_(38)
|
2715 | , core = _dereq_(23)
|
2716 | , LIBRARY = _dereq_(58)
|
2717 | , wksExt = _dereq_(116)
|
2718 | , defineProperty = _dereq_(67).f;
|
2719 | module.exports = function(name){
|
2720 | var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
|
2721 | if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});
|
2722 | };
|
2723 | },{"116":116,"23":23,"38":38,"58":58,"67":67}],116:[function(_dereq_,module,exports){
|
2724 | exports.f = _dereq_(117);
|
2725 | },{"117":117}],117:[function(_dereq_,module,exports){
|
2726 | var store = _dereq_(94)('wks')
|
2727 | , uid = _dereq_(114)
|
2728 | , Symbol = _dereq_(38).Symbol
|
2729 | , USE_SYMBOL = typeof Symbol == 'function';
|
2730 |
|
2731 | var $exports = module.exports = function(name){
|
2732 | return store[name] || (store[name] =
|
2733 | USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
|
2734 | };
|
2735 |
|
2736 | $exports.store = store;
|
2737 | },{"114":114,"38":38,"94":94}],118:[function(_dereq_,module,exports){
|
2738 | var classof = _dereq_(17)
|
2739 | , ITERATOR = _dereq_(117)('iterator')
|
2740 | , Iterators = _dereq_(56);
|
2741 | module.exports = _dereq_(23).getIteratorMethod = function(it){
|
2742 | if(it != undefined)return it[ITERATOR]
|
2743 | || it['@@iterator']
|
2744 | || Iterators[classof(it)];
|
2745 | };
|
2746 | },{"117":117,"17":17,"23":23,"56":56}],119:[function(_dereq_,module,exports){
|
2747 |
|
2748 | var $export = _dereq_(32)
|
2749 | , $re = _dereq_(88)(/[\\^$*+?.()|[\]{}]/g, '\\$&');
|
2750 |
|
2751 | $export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }});
|
2752 |
|
2753 | },{"32":32,"88":88}],120:[function(_dereq_,module,exports){
|
2754 |
|
2755 | var $export = _dereq_(32);
|
2756 |
|
2757 | $export($export.P, 'Array', {copyWithin: _dereq_(8)});
|
2758 |
|
2759 | _dereq_(5)('copyWithin');
|
2760 | },{"32":32,"5":5,"8":8}],121:[function(_dereq_,module,exports){
|
2761 | 'use strict';
|
2762 | var $export = _dereq_(32)
|
2763 | , $every = _dereq_(12)(4);
|
2764 |
|
2765 | $export($export.P + $export.F * !_dereq_(96)([].every, true), 'Array', {
|
2766 |
|
2767 | every: function every(callbackfn /* , thisArg */){
|
2768 | return $every(this, callbackfn, arguments[1]);
|
2769 | }
|
2770 | });
|
2771 | },{"12":12,"32":32,"96":96}],122:[function(_dereq_,module,exports){
|
2772 |
|
2773 | var $export = _dereq_(32);
|
2774 |
|
2775 | $export($export.P, 'Array', {fill: _dereq_(9)});
|
2776 |
|
2777 | _dereq_(5)('fill');
|
2778 | },{"32":32,"5":5,"9":9}],123:[function(_dereq_,module,exports){
|
2779 | 'use strict';
|
2780 | var $export = _dereq_(32)
|
2781 | , $filter = _dereq_(12)(2);
|
2782 |
|
2783 | $export($export.P + $export.F * !_dereq_(96)([].filter, true), 'Array', {
|
2784 |
|
2785 | filter: function filter(callbackfn /* , thisArg */){
|
2786 | return $filter(this, callbackfn, arguments[1]);
|
2787 | }
|
2788 | });
|
2789 | },{"12":12,"32":32,"96":96}],124:[function(_dereq_,module,exports){
|
2790 | 'use strict';
|
2791 |
|
2792 | var $export = _dereq_(32)
|
2793 | , $find = _dereq_(12)(6)
|
2794 | , KEY = 'findIndex'
|
2795 | , forced = true;
|
2796 |
|
2797 | if(KEY in [])Array(1)[KEY](function(){ forced = false; });
|
2798 | $export($export.P + $export.F * forced, 'Array', {
|
2799 | findIndex: function findIndex(callbackfn/*, that = undefined */){
|
2800 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2801 | }
|
2802 | });
|
2803 | _dereq_(5)(KEY);
|
2804 | },{"12":12,"32":32,"5":5}],125:[function(_dereq_,module,exports){
|
2805 | 'use strict';
|
2806 |
|
2807 | var $export = _dereq_(32)
|
2808 | , $find = _dereq_(12)(5)
|
2809 | , KEY = 'find'
|
2810 | , forced = true;
|
2811 |
|
2812 | if(KEY in [])Array(1)[KEY](function(){ forced = false; });
|
2813 | $export($export.P + $export.F * forced, 'Array', {
|
2814 | find: function find(callbackfn/*, that = undefined */){
|
2815 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2816 | }
|
2817 | });
|
2818 | _dereq_(5)(KEY);
|
2819 | },{"12":12,"32":32,"5":5}],126:[function(_dereq_,module,exports){
|
2820 | 'use strict';
|
2821 | var $export = _dereq_(32)
|
2822 | , $forEach = _dereq_(12)(0)
|
2823 | , STRICT = _dereq_(96)([].forEach, true);
|
2824 |
|
2825 | $export($export.P + $export.F * !STRICT, 'Array', {
|
2826 |
|
2827 | forEach: function forEach(callbackfn /* , thisArg */){
|
2828 | return $forEach(this, callbackfn, arguments[1]);
|
2829 | }
|
2830 | });
|
2831 | },{"12":12,"32":32,"96":96}],127:[function(_dereq_,module,exports){
|
2832 | 'use strict';
|
2833 | var ctx = _dereq_(25)
|
2834 | , $export = _dereq_(32)
|
2835 | , toObject = _dereq_(109)
|
2836 | , call = _dereq_(51)
|
2837 | , isArrayIter = _dereq_(46)
|
2838 | , toLength = _dereq_(108)
|
2839 | , createProperty = _dereq_(24)
|
2840 | , getIterFn = _dereq_(118);
|
2841 |
|
2842 | $export($export.S + $export.F * !_dereq_(54)(function(iter){ Array.from(iter); }), 'Array', {
|
2843 |
|
2844 | from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
|
2845 | var O = toObject(arrayLike)
|
2846 | , C = typeof this == 'function' ? this : Array
|
2847 | , aLen = arguments.length
|
2848 | , mapfn = aLen > 1 ? arguments[1] : undefined
|
2849 | , mapping = mapfn !== undefined
|
2850 | , index = 0
|
2851 | , iterFn = getIterFn(O)
|
2852 | , length, result, step, iterator;
|
2853 | if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
|
2854 |
|
2855 | if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){
|
2856 | for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){
|
2857 | createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
|
2858 | }
|
2859 | } else {
|
2860 | length = toLength(O.length);
|
2861 | for(result = new C(length); length > index; index++){
|
2862 | createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
|
2863 | }
|
2864 | }
|
2865 | result.length = index;
|
2866 | return result;
|
2867 | }
|
2868 | });
|
2869 |
|
2870 | },{"108":108,"109":109,"118":118,"24":24,"25":25,"32":32,"46":46,"51":51,"54":54}],128:[function(_dereq_,module,exports){
|
2871 | 'use strict';
|
2872 | var $export = _dereq_(32)
|
2873 | , $indexOf = _dereq_(11)(false)
|
2874 | , $native = [].indexOf
|
2875 | , NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
|
2876 |
|
2877 | $export($export.P + $export.F * (NEGATIVE_ZERO || !_dereq_(96)($native)), 'Array', {
|
2878 |
|
2879 | indexOf: function indexOf(searchElement /*, fromIndex = 0 */){
|
2880 | return NEGATIVE_ZERO
|
2881 |
|
2882 | ? $native.apply(this, arguments) || 0
|
2883 | : $indexOf(this, searchElement, arguments[1]);
|
2884 | }
|
2885 | });
|
2886 | },{"11":11,"32":32,"96":96}],129:[function(_dereq_,module,exports){
|
2887 |
|
2888 | var $export = _dereq_(32);
|
2889 |
|
2890 | $export($export.S, 'Array', {isArray: _dereq_(47)});
|
2891 | },{"32":32,"47":47}],130:[function(_dereq_,module,exports){
|
2892 | 'use strict';
|
2893 | var addToUnscopables = _dereq_(5)
|
2894 | , step = _dereq_(55)
|
2895 | , Iterators = _dereq_(56)
|
2896 | , toIObject = _dereq_(107);
|
2897 |
|
2898 |
|
2899 |
|
2900 |
|
2901 |
|
2902 | module.exports = _dereq_(53)(Array, 'Array', function(iterated, kind){
|
2903 | this._t = toIObject(iterated);
|
2904 | this._i = 0;
|
2905 | this._k = kind;
|
2906 |
|
2907 | }, function(){
|
2908 | var O = this._t
|
2909 | , kind = this._k
|
2910 | , index = this._i++;
|
2911 | if(!O || index >= O.length){
|
2912 | this._t = undefined;
|
2913 | return step(1);
|
2914 | }
|
2915 | if(kind == 'keys' )return step(0, index);
|
2916 | if(kind == 'values')return step(0, O[index]);
|
2917 | return step(0, [index, O[index]]);
|
2918 | }, 'values');
|
2919 |
|
2920 |
|
2921 | Iterators.Arguments = Iterators.Array;
|
2922 |
|
2923 | addToUnscopables('keys');
|
2924 | addToUnscopables('values');
|
2925 | addToUnscopables('entries');
|
2926 | },{"107":107,"5":5,"53":53,"55":55,"56":56}],131:[function(_dereq_,module,exports){
|
2927 | 'use strict';
|
2928 |
|
2929 | var $export = _dereq_(32)
|
2930 | , toIObject = _dereq_(107)
|
2931 | , arrayJoin = [].join;
|
2932 |
|
2933 |
|
2934 | $export($export.P + $export.F * (_dereq_(45) != Object || !_dereq_(96)(arrayJoin)), 'Array', {
|
2935 | join: function join(separator){
|
2936 | return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
|
2937 | }
|
2938 | });
|
2939 | },{"107":107,"32":32,"45":45,"96":96}],132:[function(_dereq_,module,exports){
|
2940 | 'use strict';
|
2941 | var $export = _dereq_(32)
|
2942 | , toIObject = _dereq_(107)
|
2943 | , toInteger = _dereq_(106)
|
2944 | , toLength = _dereq_(108)
|
2945 | , $native = [].lastIndexOf
|
2946 | , NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
|
2947 |
|
2948 | $export($export.P + $export.F * (NEGATIVE_ZERO || !_dereq_(96)($native)), 'Array', {
|
2949 |
|
2950 | lastIndexOf: function lastIndexOf(searchElement /*, fromIndex = @[*-1] */){
|
2951 |
|
2952 | if(NEGATIVE_ZERO)return $native.apply(this, arguments) || 0;
|
2953 | var O = toIObject(this)
|
2954 | , length = toLength(O.length)
|
2955 | , index = length - 1;
|
2956 | if(arguments.length > 1)index = Math.min(index, toInteger(arguments[1]));
|
2957 | if(index < 0)index = length + index;
|
2958 | for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index || 0;
|
2959 | return -1;
|
2960 | }
|
2961 | });
|
2962 | },{"106":106,"107":107,"108":108,"32":32,"96":96}],133:[function(_dereq_,module,exports){
|
2963 | 'use strict';
|
2964 | var $export = _dereq_(32)
|
2965 | , $map = _dereq_(12)(1);
|
2966 |
|
2967 | $export($export.P + $export.F * !_dereq_(96)([].map, true), 'Array', {
|
2968 |
|
2969 | map: function map(callbackfn /* , thisArg */){
|
2970 | return $map(this, callbackfn, arguments[1]);
|
2971 | }
|
2972 | });
|
2973 | },{"12":12,"32":32,"96":96}],134:[function(_dereq_,module,exports){
|
2974 | 'use strict';
|
2975 | var $export = _dereq_(32)
|
2976 | , createProperty = _dereq_(24);
|
2977 |
|
2978 |
|
2979 | $export($export.S + $export.F * _dereq_(34)(function(){
|
2980 | function F(){}
|
2981 | return !(Array.of.call(F) instanceof F);
|
2982 | }), 'Array', {
|
2983 |
|
2984 | of: function of(/* ...args */){
|
2985 | var index = 0
|
2986 | , aLen = arguments.length
|
2987 | , result = new (typeof this == 'function' ? this : Array)(aLen);
|
2988 | while(aLen > index)createProperty(result, index, arguments[index++]);
|
2989 | result.length = aLen;
|
2990 | return result;
|
2991 | }
|
2992 | });
|
2993 | },{"24":24,"32":32,"34":34}],135:[function(_dereq_,module,exports){
|
2994 | 'use strict';
|
2995 | var $export = _dereq_(32)
|
2996 | , $reduce = _dereq_(13);
|
2997 |
|
2998 | $export($export.P + $export.F * !_dereq_(96)([].reduceRight, true), 'Array', {
|
2999 |
|
3000 | reduceRight: function reduceRight(callbackfn /* , initialValue */){
|
3001 | return $reduce(this, callbackfn, arguments.length, arguments[1], true);
|
3002 | }
|
3003 | });
|
3004 | },{"13":13,"32":32,"96":96}],136:[function(_dereq_,module,exports){
|
3005 | 'use strict';
|
3006 | var $export = _dereq_(32)
|
3007 | , $reduce = _dereq_(13);
|
3008 |
|
3009 | $export($export.P + $export.F * !_dereq_(96)([].reduce, true), 'Array', {
|
3010 |
|
3011 | reduce: function reduce(callbackfn /* , initialValue */){
|
3012 | return $reduce(this, callbackfn, arguments.length, arguments[1], false);
|
3013 | }
|
3014 | });
|
3015 | },{"13":13,"32":32,"96":96}],137:[function(_dereq_,module,exports){
|
3016 | 'use strict';
|
3017 | var $export = _dereq_(32)
|
3018 | , html = _dereq_(41)
|
3019 | , cof = _dereq_(18)
|
3020 | , toIndex = _dereq_(105)
|
3021 | , toLength = _dereq_(108)
|
3022 | , arraySlice = [].slice;
|
3023 |
|
3024 |
|
3025 | $export($export.P + $export.F * _dereq_(34)(function(){
|
3026 | if(html)arraySlice.call(html);
|
3027 | }), 'Array', {
|
3028 | slice: function slice(begin, end){
|
3029 | var len = toLength(this.length)
|
3030 | , klass = cof(this);
|
3031 | end = end === undefined ? len : end;
|
3032 | if(klass == 'Array')return arraySlice.call(this, begin, end);
|
3033 | var start = toIndex(begin, len)
|
3034 | , upTo = toIndex(end, len)
|
3035 | , size = toLength(upTo - start)
|
3036 | , cloned = Array(size)
|
3037 | , i = 0;
|
3038 | for(; i < size; i++)cloned[i] = klass == 'String'
|
3039 | ? this.charAt(start + i)
|
3040 | : this[start + i];
|
3041 | return cloned;
|
3042 | }
|
3043 | });
|
3044 | },{"105":105,"108":108,"18":18,"32":32,"34":34,"41":41}],138:[function(_dereq_,module,exports){
|
3045 | 'use strict';
|
3046 | var $export = _dereq_(32)
|
3047 | , $some = _dereq_(12)(3);
|
3048 |
|
3049 | $export($export.P + $export.F * !_dereq_(96)([].some, true), 'Array', {
|
3050 |
|
3051 | some: function some(callbackfn /* , thisArg */){
|
3052 | return $some(this, callbackfn, arguments[1]);
|
3053 | }
|
3054 | });
|
3055 | },{"12":12,"32":32,"96":96}],139:[function(_dereq_,module,exports){
|
3056 | 'use strict';
|
3057 | var $export = _dereq_(32)
|
3058 | , aFunction = _dereq_(3)
|
3059 | , toObject = _dereq_(109)
|
3060 | , fails = _dereq_(34)
|
3061 | , $sort = [].sort
|
3062 | , test = [1, 2, 3];
|
3063 |
|
3064 | $export($export.P + $export.F * (fails(function(){
|
3065 |
|
3066 | test.sort(undefined);
|
3067 | }) || !fails(function(){
|
3068 |
|
3069 | test.sort(null);
|
3070 |
|
3071 | }) || !_dereq_(96)($sort)), 'Array', {
|
3072 |
|
3073 | sort: function sort(comparefn){
|
3074 | return comparefn === undefined
|
3075 | ? $sort.call(toObject(this))
|
3076 | : $sort.call(toObject(this), aFunction(comparefn));
|
3077 | }
|
3078 | });
|
3079 | },{"109":109,"3":3,"32":32,"34":34,"96":96}],140:[function(_dereq_,module,exports){
|
3080 | _dereq_(91)('Array');
|
3081 | },{"91":91}],141:[function(_dereq_,module,exports){
|
3082 |
|
3083 | var $export = _dereq_(32);
|
3084 |
|
3085 | $export($export.S, 'Date', {now: function(){ return new Date().getTime(); }});
|
3086 | },{"32":32}],142:[function(_dereq_,module,exports){
|
3087 | 'use strict';
|
3088 |
|
3089 | var $export = _dereq_(32)
|
3090 | , fails = _dereq_(34)
|
3091 | , getTime = Date.prototype.getTime;
|
3092 |
|
3093 | var lz = function(num){
|
3094 | return num > 9 ? num : '0' + num;
|
3095 | };
|
3096 |
|
3097 |
|
3098 | $export($export.P + $export.F * (fails(function(){
|
3099 | return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z';
|
3100 | }) || !fails(function(){
|
3101 | new Date(NaN).toISOString();
|
3102 | })), 'Date', {
|
3103 | toISOString: function toISOString(){
|
3104 | if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value');
|
3105 | var d = this
|
3106 | , y = d.getUTCFullYear()
|
3107 | , m = d.getUTCMilliseconds()
|
3108 | , s = y < 0 ? '-' : y > 9999 ? '+' : '';
|
3109 | return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
|
3110 | '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
|
3111 | 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
|
3112 | ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
|
3113 | }
|
3114 | });
|
3115 | },{"32":32,"34":34}],143:[function(_dereq_,module,exports){
|
3116 | 'use strict';
|
3117 | var $export = _dereq_(32)
|
3118 | , toObject = _dereq_(109)
|
3119 | , toPrimitive = _dereq_(110);
|
3120 |
|
3121 | $export($export.P + $export.F * _dereq_(34)(function(){
|
3122 | return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
|
3123 | }), 'Date', {
|
3124 | toJSON: function toJSON(key){
|
3125 | var O = toObject(this)
|
3126 | , pv = toPrimitive(O);
|
3127 | return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
|
3128 | }
|
3129 | });
|
3130 | },{"109":109,"110":110,"32":32,"34":34}],144:[function(_dereq_,module,exports){
|
3131 | var TO_PRIMITIVE = _dereq_(117)('toPrimitive')
|
3132 | , proto = Date.prototype;
|
3133 |
|
3134 | if(!(TO_PRIMITIVE in proto))_dereq_(40)(proto, TO_PRIMITIVE, _dereq_(26));
|
3135 | },{"117":117,"26":26,"40":40}],145:[function(_dereq_,module,exports){
|
3136 | var DateProto = Date.prototype
|
3137 | , INVALID_DATE = 'Invalid Date'
|
3138 | , TO_STRING = 'toString'
|
3139 | , $toString = DateProto[TO_STRING]
|
3140 | , getTime = DateProto.getTime;
|
3141 | if(new Date(NaN) + '' != INVALID_DATE){
|
3142 | _dereq_(87)(DateProto, TO_STRING, function toString(){
|
3143 | var value = getTime.call(this);
|
3144 | return value === value ? $toString.call(this) : INVALID_DATE;
|
3145 | });
|
3146 | }
|
3147 | },{"87":87}],146:[function(_dereq_,module,exports){
|
3148 |
|
3149 | var $export = _dereq_(32);
|
3150 |
|
3151 | $export($export.P, 'Function', {bind: _dereq_(16)});
|
3152 | },{"16":16,"32":32}],147:[function(_dereq_,module,exports){
|
3153 | 'use strict';
|
3154 | var isObject = _dereq_(49)
|
3155 | , getPrototypeOf = _dereq_(74)
|
3156 | , HAS_INSTANCE = _dereq_(117)('hasInstance')
|
3157 | , FunctionProto = Function.prototype;
|
3158 |
|
3159 | if(!(HAS_INSTANCE in FunctionProto))_dereq_(67).f(FunctionProto, HAS_INSTANCE, {value: function(O){
|
3160 | if(typeof this != 'function' || !isObject(O))return false;
|
3161 | if(!isObject(this.prototype))return O instanceof this;
|
3162 |
|
3163 | while(O = getPrototypeOf(O))if(this.prototype === O)return true;
|
3164 | return false;
|
3165 | }});
|
3166 | },{"117":117,"49":49,"67":67,"74":74}],148:[function(_dereq_,module,exports){
|
3167 | var dP = _dereq_(67).f
|
3168 | , createDesc = _dereq_(85)
|
3169 | , has = _dereq_(39)
|
3170 | , FProto = Function.prototype
|
3171 | , nameRE = /^\s*function ([^ (]*)/
|
3172 | , NAME = 'name';
|
3173 |
|
3174 | var isExtensible = Object.isExtensible || function(){
|
3175 | return true;
|
3176 | };
|
3177 |
|
3178 |
|
3179 | NAME in FProto || _dereq_(28) && dP(FProto, NAME, {
|
3180 | configurable: true,
|
3181 | get: function(){
|
3182 | try {
|
3183 | var that = this
|
3184 | , name = ('' + that).match(nameRE)[1];
|
3185 | has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name));
|
3186 | return name;
|
3187 | } catch(e){
|
3188 | return '';
|
3189 | }
|
3190 | }
|
3191 | });
|
3192 | },{"28":28,"39":39,"67":67,"85":85}],149:[function(_dereq_,module,exports){
|
3193 | 'use strict';
|
3194 | var strong = _dereq_(19);
|
3195 |
|
3196 |
|
3197 | module.exports = _dereq_(22)('Map', function(get){
|
3198 | return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
|
3199 | }, {
|
3200 |
|
3201 | get: function get(key){
|
3202 | var entry = strong.getEntry(this, key);
|
3203 | return entry && entry.v;
|
3204 | },
|
3205 |
|
3206 | set: function set(key, value){
|
3207 | return strong.def(this, key === 0 ? 0 : key, value);
|
3208 | }
|
3209 | }, strong, true);
|
3210 | },{"19":19,"22":22}],150:[function(_dereq_,module,exports){
|
3211 |
|
3212 | var $export = _dereq_(32)
|
3213 | , log1p = _dereq_(60)
|
3214 | , sqrt = Math.sqrt
|
3215 | , $acosh = Math.acosh;
|
3216 |
|
3217 | $export($export.S + $export.F * !($acosh
|
3218 |
|
3219 | && Math.floor($acosh(Number.MAX_VALUE)) == 710
|
3220 |
|
3221 | && $acosh(Infinity) == Infinity
|
3222 | ), 'Math', {
|
3223 | acosh: function acosh(x){
|
3224 | return (x = +x) < 1 ? NaN : x > 94906265.62425156
|
3225 | ? Math.log(x) + Math.LN2
|
3226 | : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
|
3227 | }
|
3228 | });
|
3229 | },{"32":32,"60":60}],151:[function(_dereq_,module,exports){
|
3230 |
|
3231 | var $export = _dereq_(32)
|
3232 | , $asinh = Math.asinh;
|
3233 |
|
3234 | function asinh(x){
|
3235 | return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
|
3236 | }
|
3237 |
|
3238 |
|
3239 | $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh});
|
3240 | },{"32":32}],152:[function(_dereq_,module,exports){
|
3241 |
|
3242 | var $export = _dereq_(32)
|
3243 | , $atanh = Math.atanh;
|
3244 |
|
3245 |
|
3246 | $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
|
3247 | atanh: function atanh(x){
|
3248 | return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
|
3249 | }
|
3250 | });
|
3251 | },{"32":32}],153:[function(_dereq_,module,exports){
|
3252 |
|
3253 | var $export = _dereq_(32)
|
3254 | , sign = _dereq_(61);
|
3255 |
|
3256 | $export($export.S, 'Math', {
|
3257 | cbrt: function cbrt(x){
|
3258 | return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
|
3259 | }
|
3260 | });
|
3261 | },{"32":32,"61":61}],154:[function(_dereq_,module,exports){
|
3262 |
|
3263 | var $export = _dereq_(32);
|
3264 |
|
3265 | $export($export.S, 'Math', {
|
3266 | clz32: function clz32(x){
|
3267 | return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
|
3268 | }
|
3269 | });
|
3270 | },{"32":32}],155:[function(_dereq_,module,exports){
|
3271 |
|
3272 | var $export = _dereq_(32)
|
3273 | , exp = Math.exp;
|
3274 |
|
3275 | $export($export.S, 'Math', {
|
3276 | cosh: function cosh(x){
|
3277 | return (exp(x = +x) + exp(-x)) / 2;
|
3278 | }
|
3279 | });
|
3280 | },{"32":32}],156:[function(_dereq_,module,exports){
|
3281 |
|
3282 | var $export = _dereq_(32)
|
3283 | , $expm1 = _dereq_(59);
|
3284 |
|
3285 | $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1});
|
3286 | },{"32":32,"59":59}],157:[function(_dereq_,module,exports){
|
3287 |
|
3288 | var $export = _dereq_(32)
|
3289 | , sign = _dereq_(61)
|
3290 | , pow = Math.pow
|
3291 | , EPSILON = pow(2, -52)
|
3292 | , EPSILON32 = pow(2, -23)
|
3293 | , MAX32 = pow(2, 127) * (2 - EPSILON32)
|
3294 | , MIN32 = pow(2, -126);
|
3295 |
|
3296 | var roundTiesToEven = function(n){
|
3297 | return n + 1 / EPSILON - 1 / EPSILON;
|
3298 | };
|
3299 |
|
3300 |
|
3301 | $export($export.S, 'Math', {
|
3302 | fround: function fround(x){
|
3303 | var $abs = Math.abs(x)
|
3304 | , $sign = sign(x)
|
3305 | , a, result;
|
3306 | if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
|
3307 | a = (1 + EPSILON32 / EPSILON) * $abs;
|
3308 | result = a - (a - $abs);
|
3309 | if(result > MAX32 || result != result)return $sign * Infinity;
|
3310 | return $sign * result;
|
3311 | }
|
3312 | });
|
3313 | },{"32":32,"61":61}],158:[function(_dereq_,module,exports){
|
3314 |
|
3315 | var $export = _dereq_(32)
|
3316 | , abs = Math.abs;
|
3317 |
|
3318 | $export($export.S, 'Math', {
|
3319 | hypot: function hypot(value1, value2){
|
3320 | var sum = 0
|
3321 | , i = 0
|
3322 | , aLen = arguments.length
|
3323 | , larg = 0
|
3324 | , arg, div;
|
3325 | while(i < aLen){
|
3326 | arg = abs(arguments[i++]);
|
3327 | if(larg < arg){
|
3328 | div = larg / arg;
|
3329 | sum = sum * div * div + 1;
|
3330 | larg = arg;
|
3331 | } else if(arg > 0){
|
3332 | div = arg / larg;
|
3333 | sum += div * div;
|
3334 | } else sum += arg;
|
3335 | }
|
3336 | return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
|
3337 | }
|
3338 | });
|
3339 | },{"32":32}],159:[function(_dereq_,module,exports){
|
3340 |
|
3341 | var $export = _dereq_(32)
|
3342 | , $imul = Math.imul;
|
3343 |
|
3344 |
|
3345 | $export($export.S + $export.F * _dereq_(34)(function(){
|
3346 | return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
|
3347 | }), 'Math', {
|
3348 | imul: function imul(x, y){
|
3349 | var UINT16 = 0xffff
|
3350 | , xn = +x
|
3351 | , yn = +y
|
3352 | , xl = UINT16 & xn
|
3353 | , yl = UINT16 & yn;
|
3354 | return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
|
3355 | }
|
3356 | });
|
3357 | },{"32":32,"34":34}],160:[function(_dereq_,module,exports){
|
3358 |
|
3359 | var $export = _dereq_(32);
|
3360 |
|
3361 | $export($export.S, 'Math', {
|
3362 | log10: function log10(x){
|
3363 | return Math.log(x) / Math.LN10;
|
3364 | }
|
3365 | });
|
3366 | },{"32":32}],161:[function(_dereq_,module,exports){
|
3367 |
|
3368 | var $export = _dereq_(32);
|
3369 |
|
3370 | $export($export.S, 'Math', {log1p: _dereq_(60)});
|
3371 | },{"32":32,"60":60}],162:[function(_dereq_,module,exports){
|
3372 |
|
3373 | var $export = _dereq_(32);
|
3374 |
|
3375 | $export($export.S, 'Math', {
|
3376 | log2: function log2(x){
|
3377 | return Math.log(x) / Math.LN2;
|
3378 | }
|
3379 | });
|
3380 | },{"32":32}],163:[function(_dereq_,module,exports){
|
3381 |
|
3382 | var $export = _dereq_(32);
|
3383 |
|
3384 | $export($export.S, 'Math', {sign: _dereq_(61)});
|
3385 | },{"32":32,"61":61}],164:[function(_dereq_,module,exports){
|
3386 |
|
3387 | var $export = _dereq_(32)
|
3388 | , expm1 = _dereq_(59)
|
3389 | , exp = Math.exp;
|
3390 |
|
3391 |
|
3392 | $export($export.S + $export.F * _dereq_(34)(function(){
|
3393 | return !Math.sinh(-2e-17) != -2e-17;
|
3394 | }), 'Math', {
|
3395 | sinh: function sinh(x){
|
3396 | return Math.abs(x = +x) < 1
|
3397 | ? (expm1(x) - expm1(-x)) / 2
|
3398 | : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
|
3399 | }
|
3400 | });
|
3401 | },{"32":32,"34":34,"59":59}],165:[function(_dereq_,module,exports){
|
3402 |
|
3403 | var $export = _dereq_(32)
|
3404 | , expm1 = _dereq_(59)
|
3405 | , exp = Math.exp;
|
3406 |
|
3407 | $export($export.S, 'Math', {
|
3408 | tanh: function tanh(x){
|
3409 | var a = expm1(x = +x)
|
3410 | , b = expm1(-x);
|
3411 | return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
|
3412 | }
|
3413 | });
|
3414 | },{"32":32,"59":59}],166:[function(_dereq_,module,exports){
|
3415 |
|
3416 | var $export = _dereq_(32);
|
3417 |
|
3418 | $export($export.S, 'Math', {
|
3419 | trunc: function trunc(it){
|
3420 | return (it > 0 ? Math.floor : Math.ceil)(it);
|
3421 | }
|
3422 | });
|
3423 | },{"32":32}],167:[function(_dereq_,module,exports){
|
3424 | 'use strict';
|
3425 | var global = _dereq_(38)
|
3426 | , has = _dereq_(39)
|
3427 | , cof = _dereq_(18)
|
3428 | , inheritIfRequired = _dereq_(43)
|
3429 | , toPrimitive = _dereq_(110)
|
3430 | , fails = _dereq_(34)
|
3431 | , gOPN = _dereq_(72).f
|
3432 | , gOPD = _dereq_(70).f
|
3433 | , dP = _dereq_(67).f
|
3434 | , $trim = _dereq_(102).trim
|
3435 | , NUMBER = 'Number'
|
3436 | , $Number = global[NUMBER]
|
3437 | , Base = $Number
|
3438 | , proto = $Number.prototype
|
3439 |
|
3440 | , BROKEN_COF = cof(_dereq_(66)(proto)) == NUMBER
|
3441 | , TRIM = 'trim' in String.prototype;
|
3442 |
|
3443 |
|
3444 | var toNumber = function(argument){
|
3445 | var it = toPrimitive(argument, false);
|
3446 | if(typeof it == 'string' && it.length > 2){
|
3447 | it = TRIM ? it.trim() : $trim(it, 3);
|
3448 | var first = it.charCodeAt(0)
|
3449 | , third, radix, maxCode;
|
3450 | if(first === 43 || first === 45){
|
3451 | third = it.charCodeAt(2);
|
3452 | if(third === 88 || third === 120)return NaN;
|
3453 | } else if(first === 48){
|
3454 | switch(it.charCodeAt(1)){
|
3455 | case 66 : case 98 : radix = 2; maxCode = 49; break;
|
3456 | case 79 : case 111 : radix = 8; maxCode = 55; break;
|
3457 | default : return +it;
|
3458 | }
|
3459 | for(var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++){
|
3460 | code = digits.charCodeAt(i);
|
3461 |
|
3462 |
|
3463 | if(code < 48 || code > maxCode)return NaN;
|
3464 | } return parseInt(digits, radix);
|
3465 | }
|
3466 | } return +it;
|
3467 | };
|
3468 |
|
3469 | if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){
|
3470 | $Number = function Number(value){
|
3471 | var it = arguments.length < 1 ? 0 : value
|
3472 | , that = this;
|
3473 | return that instanceof $Number
|
3474 |
|
3475 | && (BROKEN_COF ? fails(function(){ proto.valueOf.call(that); }) : cof(that) != NUMBER)
|
3476 | ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
|
3477 | };
|
3478 | for(var keys = _dereq_(28) ? gOPN(Base) : (
|
3479 |
|
3480 | 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
|
3481 |
|
3482 | 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
|
3483 | 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
|
3484 | ).split(','), j = 0, key; keys.length > j; j++){
|
3485 | if(has(Base, key = keys[j]) && !has($Number, key)){
|
3486 | dP($Number, key, gOPD(Base, key));
|
3487 | }
|
3488 | }
|
3489 | $Number.prototype = proto;
|
3490 | proto.constructor = $Number;
|
3491 | _dereq_(87)(global, NUMBER, $Number);
|
3492 | }
|
3493 | },{"102":102,"110":110,"18":18,"28":28,"34":34,"38":38,"39":39,"43":43,"66":66,"67":67,"70":70,"72":72,"87":87}],168:[function(_dereq_,module,exports){
|
3494 |
|
3495 | var $export = _dereq_(32);
|
3496 |
|
3497 | $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)});
|
3498 | },{"32":32}],169:[function(_dereq_,module,exports){
|
3499 |
|
3500 | var $export = _dereq_(32)
|
3501 | , _isFinite = _dereq_(38).isFinite;
|
3502 |
|
3503 | $export($export.S, 'Number', {
|
3504 | isFinite: function isFinite(it){
|
3505 | return typeof it == 'number' && _isFinite(it);
|
3506 | }
|
3507 | });
|
3508 | },{"32":32,"38":38}],170:[function(_dereq_,module,exports){
|
3509 |
|
3510 | var $export = _dereq_(32);
|
3511 |
|
3512 | $export($export.S, 'Number', {isInteger: _dereq_(48)});
|
3513 | },{"32":32,"48":48}],171:[function(_dereq_,module,exports){
|
3514 |
|
3515 | var $export = _dereq_(32);
|
3516 |
|
3517 | $export($export.S, 'Number', {
|
3518 | isNaN: function isNaN(number){
|
3519 | return number != number;
|
3520 | }
|
3521 | });
|
3522 | },{"32":32}],172:[function(_dereq_,module,exports){
|
3523 |
|
3524 | var $export = _dereq_(32)
|
3525 | , isInteger = _dereq_(48)
|
3526 | , abs = Math.abs;
|
3527 |
|
3528 | $export($export.S, 'Number', {
|
3529 | isSafeInteger: function isSafeInteger(number){
|
3530 | return isInteger(number) && abs(number) <= 0x1fffffffffffff;
|
3531 | }
|
3532 | });
|
3533 | },{"32":32,"48":48}],173:[function(_dereq_,module,exports){
|
3534 |
|
3535 | var $export = _dereq_(32);
|
3536 |
|
3537 | $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff});
|
3538 | },{"32":32}],174:[function(_dereq_,module,exports){
|
3539 |
|
3540 | var $export = _dereq_(32);
|
3541 |
|
3542 | $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff});
|
3543 | },{"32":32}],175:[function(_dereq_,module,exports){
|
3544 | var $export = _dereq_(32)
|
3545 | , $parseFloat = _dereq_(81);
|
3546 |
|
3547 | $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat});
|
3548 | },{"32":32,"81":81}],176:[function(_dereq_,module,exports){
|
3549 | var $export = _dereq_(32)
|
3550 | , $parseInt = _dereq_(82);
|
3551 |
|
3552 | $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt});
|
3553 | },{"32":32,"82":82}],177:[function(_dereq_,module,exports){
|
3554 | 'use strict';
|
3555 | var $export = _dereq_(32)
|
3556 | , toInteger = _dereq_(106)
|
3557 | , aNumberValue = _dereq_(4)
|
3558 | , repeat = _dereq_(101)
|
3559 | , $toFixed = 1..toFixed
|
3560 | , floor = Math.floor
|
3561 | , data = [0, 0, 0, 0, 0, 0]
|
3562 | , ERROR = 'Number.toFixed: incorrect invocation!'
|
3563 | , ZERO = '0';
|
3564 |
|
3565 | var multiply = function(n, c){
|
3566 | var i = -1
|
3567 | , c2 = c;
|
3568 | while(++i < 6){
|
3569 | c2 += n * data[i];
|
3570 | data[i] = c2 % 1e7;
|
3571 | c2 = floor(c2 / 1e7);
|
3572 | }
|
3573 | };
|
3574 | var divide = function(n){
|
3575 | var i = 6
|
3576 | , c = 0;
|
3577 | while(--i >= 0){
|
3578 | c += data[i];
|
3579 | data[i] = floor(c / n);
|
3580 | c = (c % n) * 1e7;
|
3581 | }
|
3582 | };
|
3583 | var numToString = function(){
|
3584 | var i = 6
|
3585 | , s = '';
|
3586 | while(--i >= 0){
|
3587 | if(s !== '' || i === 0 || data[i] !== 0){
|
3588 | var t = String(data[i]);
|
3589 | s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
|
3590 | }
|
3591 | } return s;
|
3592 | };
|
3593 | var pow = function(x, n, acc){
|
3594 | return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
|
3595 | };
|
3596 | var log = function(x){
|
3597 | var n = 0
|
3598 | , x2 = x;
|
3599 | while(x2 >= 4096){
|
3600 | n += 12;
|
3601 | x2 /= 4096;
|
3602 | }
|
3603 | while(x2 >= 2){
|
3604 | n += 1;
|
3605 | x2 /= 2;
|
3606 | } return n;
|
3607 | };
|
3608 |
|
3609 | $export($export.P + $export.F * (!!$toFixed && (
|
3610 | 0.00008.toFixed(3) !== '0.000' ||
|
3611 | 0.9.toFixed(0) !== '1' ||
|
3612 | 1.255.toFixed(2) !== '1.25' ||
|
3613 | 1000000000000000128..toFixed(0) !== '1000000000000000128'
|
3614 | ) || !_dereq_(34)(function(){
|
3615 |
|
3616 | $toFixed.call({});
|
3617 | })), 'Number', {
|
3618 | toFixed: function toFixed(fractionDigits){
|
3619 | var x = aNumberValue(this, ERROR)
|
3620 | , f = toInteger(fractionDigits)
|
3621 | , s = ''
|
3622 | , m = ZERO
|
3623 | , e, z, j, k;
|
3624 | if(f < 0 || f > 20)throw RangeError(ERROR);
|
3625 | if(x != x)return 'NaN';
|
3626 | if(x <= -1e21 || x >= 1e21)return String(x);
|
3627 | if(x < 0){
|
3628 | s = '-';
|
3629 | x = -x;
|
3630 | }
|
3631 | if(x > 1e-21){
|
3632 | e = log(x * pow(2, 69, 1)) - 69;
|
3633 | z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
|
3634 | z *= 0x10000000000000;
|
3635 | e = 52 - e;
|
3636 | if(e > 0){
|
3637 | multiply(0, z);
|
3638 | j = f;
|
3639 | while(j >= 7){
|
3640 | multiply(1e7, 0);
|
3641 | j -= 7;
|
3642 | }
|
3643 | multiply(pow(10, j, 1), 0);
|
3644 | j = e - 1;
|
3645 | while(j >= 23){
|
3646 | divide(1 << 23);
|
3647 | j -= 23;
|
3648 | }
|
3649 | divide(1 << j);
|
3650 | multiply(1, 1);
|
3651 | divide(2);
|
3652 | m = numToString();
|
3653 | } else {
|
3654 | multiply(0, z);
|
3655 | multiply(1 << -e, 0);
|
3656 | m = numToString() + repeat.call(ZERO, f);
|
3657 | }
|
3658 | }
|
3659 | if(f > 0){
|
3660 | k = m.length;
|
3661 | m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
|
3662 | } else {
|
3663 | m = s + m;
|
3664 | } return m;
|
3665 | }
|
3666 | });
|
3667 | },{"101":101,"106":106,"32":32,"34":34,"4":4}],178:[function(_dereq_,module,exports){
|
3668 | 'use strict';
|
3669 | var $export = _dereq_(32)
|
3670 | , $fails = _dereq_(34)
|
3671 | , aNumberValue = _dereq_(4)
|
3672 | , $toPrecision = 1..toPrecision;
|
3673 |
|
3674 | $export($export.P + $export.F * ($fails(function(){
|
3675 |
|
3676 | return $toPrecision.call(1, undefined) !== '1';
|
3677 | }) || !$fails(function(){
|
3678 |
|
3679 | $toPrecision.call({});
|
3680 | })), 'Number', {
|
3681 | toPrecision: function toPrecision(precision){
|
3682 | var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
|
3683 | return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
|
3684 | }
|
3685 | });
|
3686 | },{"32":32,"34":34,"4":4}],179:[function(_dereq_,module,exports){
|
3687 |
|
3688 | var $export = _dereq_(32);
|
3689 |
|
3690 | $export($export.S + $export.F, 'Object', {assign: _dereq_(65)});
|
3691 | },{"32":32,"65":65}],180:[function(_dereq_,module,exports){
|
3692 | var $export = _dereq_(32)
|
3693 |
|
3694 | $export($export.S, 'Object', {create: _dereq_(66)});
|
3695 | },{"32":32,"66":66}],181:[function(_dereq_,module,exports){
|
3696 | var $export = _dereq_(32);
|
3697 |
|
3698 | $export($export.S + $export.F * !_dereq_(28), 'Object', {defineProperties: _dereq_(68)});
|
3699 | },{"28":28,"32":32,"68":68}],182:[function(_dereq_,module,exports){
|
3700 | var $export = _dereq_(32);
|
3701 |
|
3702 | $export($export.S + $export.F * !_dereq_(28), 'Object', {defineProperty: _dereq_(67).f});
|
3703 | },{"28":28,"32":32,"67":67}],183:[function(_dereq_,module,exports){
|
3704 |
|
3705 | var isObject = _dereq_(49)
|
3706 | , meta = _dereq_(62).onFreeze;
|
3707 |
|
3708 | _dereq_(78)('freeze', function($freeze){
|
3709 | return function freeze(it){
|
3710 | return $freeze && isObject(it) ? $freeze(meta(it)) : it;
|
3711 | };
|
3712 | });
|
3713 | },{"49":49,"62":62,"78":78}],184:[function(_dereq_,module,exports){
|
3714 |
|
3715 | var toIObject = _dereq_(107)
|
3716 | , $getOwnPropertyDescriptor = _dereq_(70).f;
|
3717 |
|
3718 | _dereq_(78)('getOwnPropertyDescriptor', function(){
|
3719 | return function getOwnPropertyDescriptor(it, key){
|
3720 | return $getOwnPropertyDescriptor(toIObject(it), key);
|
3721 | };
|
3722 | });
|
3723 | },{"107":107,"70":70,"78":78}],185:[function(_dereq_,module,exports){
|
3724 |
|
3725 | _dereq_(78)('getOwnPropertyNames', function(){
|
3726 | return _dereq_(71).f;
|
3727 | });
|
3728 | },{"71":71,"78":78}],186:[function(_dereq_,module,exports){
|
3729 |
|
3730 | var toObject = _dereq_(109)
|
3731 | , $getPrototypeOf = _dereq_(74);
|
3732 |
|
3733 | _dereq_(78)('getPrototypeOf', function(){
|
3734 | return function getPrototypeOf(it){
|
3735 | return $getPrototypeOf(toObject(it));
|
3736 | };
|
3737 | });
|
3738 | },{"109":109,"74":74,"78":78}],187:[function(_dereq_,module,exports){
|
3739 |
|
3740 | var isObject = _dereq_(49);
|
3741 |
|
3742 | _dereq_(78)('isExtensible', function($isExtensible){
|
3743 | return function isExtensible(it){
|
3744 | return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
|
3745 | };
|
3746 | });
|
3747 | },{"49":49,"78":78}],188:[function(_dereq_,module,exports){
|
3748 |
|
3749 | var isObject = _dereq_(49);
|
3750 |
|
3751 | _dereq_(78)('isFrozen', function($isFrozen){
|
3752 | return function isFrozen(it){
|
3753 | return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
|
3754 | };
|
3755 | });
|
3756 | },{"49":49,"78":78}],189:[function(_dereq_,module,exports){
|
3757 |
|
3758 | var isObject = _dereq_(49);
|
3759 |
|
3760 | _dereq_(78)('isSealed', function($isSealed){
|
3761 | return function isSealed(it){
|
3762 | return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
|
3763 | };
|
3764 | });
|
3765 | },{"49":49,"78":78}],190:[function(_dereq_,module,exports){
|
3766 |
|
3767 | var $export = _dereq_(32);
|
3768 | $export($export.S, 'Object', {is: _dereq_(89)});
|
3769 | },{"32":32,"89":89}],191:[function(_dereq_,module,exports){
|
3770 |
|
3771 | var toObject = _dereq_(109)
|
3772 | , $keys = _dereq_(76);
|
3773 |
|
3774 | _dereq_(78)('keys', function(){
|
3775 | return function keys(it){
|
3776 | return $keys(toObject(it));
|
3777 | };
|
3778 | });
|
3779 | },{"109":109,"76":76,"78":78}],192:[function(_dereq_,module,exports){
|
3780 |
|
3781 | var isObject = _dereq_(49)
|
3782 | , meta = _dereq_(62).onFreeze;
|
3783 |
|
3784 | _dereq_(78)('preventExtensions', function($preventExtensions){
|
3785 | return function preventExtensions(it){
|
3786 | return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
|
3787 | };
|
3788 | });
|
3789 | },{"49":49,"62":62,"78":78}],193:[function(_dereq_,module,exports){
|
3790 |
|
3791 | var isObject = _dereq_(49)
|
3792 | , meta = _dereq_(62).onFreeze;
|
3793 |
|
3794 | _dereq_(78)('seal', function($seal){
|
3795 | return function seal(it){
|
3796 | return $seal && isObject(it) ? $seal(meta(it)) : it;
|
3797 | };
|
3798 | });
|
3799 | },{"49":49,"62":62,"78":78}],194:[function(_dereq_,module,exports){
|
3800 |
|
3801 | var $export = _dereq_(32);
|
3802 | $export($export.S, 'Object', {setPrototypeOf: _dereq_(90).set});
|
3803 | },{"32":32,"90":90}],195:[function(_dereq_,module,exports){
|
3804 | 'use strict';
|
3805 |
|
3806 | var classof = _dereq_(17)
|
3807 | , test = {};
|
3808 | test[_dereq_(117)('toStringTag')] = 'z';
|
3809 | if(test + '' != '[object z]'){
|
3810 | _dereq_(87)(Object.prototype, 'toString', function toString(){
|
3811 | return '[object ' + classof(this) + ']';
|
3812 | }, true);
|
3813 | }
|
3814 | },{"117":117,"17":17,"87":87}],196:[function(_dereq_,module,exports){
|
3815 | var $export = _dereq_(32)
|
3816 | , $parseFloat = _dereq_(81);
|
3817 |
|
3818 | $export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat});
|
3819 | },{"32":32,"81":81}],197:[function(_dereq_,module,exports){
|
3820 | var $export = _dereq_(32)
|
3821 | , $parseInt = _dereq_(82);
|
3822 |
|
3823 | $export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt});
|
3824 | },{"32":32,"82":82}],198:[function(_dereq_,module,exports){
|
3825 | 'use strict';
|
3826 | var LIBRARY = _dereq_(58)
|
3827 | , global = _dereq_(38)
|
3828 | , ctx = _dereq_(25)
|
3829 | , classof = _dereq_(17)
|
3830 | , $export = _dereq_(32)
|
3831 | , isObject = _dereq_(49)
|
3832 | , aFunction = _dereq_(3)
|
3833 | , anInstance = _dereq_(6)
|
3834 | , forOf = _dereq_(37)
|
3835 | , speciesConstructor = _dereq_(95)
|
3836 | , task = _dereq_(104).set
|
3837 | , microtask = _dereq_(64)()
|
3838 | , PROMISE = 'Promise'
|
3839 | , TypeError = global.TypeError
|
3840 | , process = global.process
|
3841 | , $Promise = global[PROMISE]
|
3842 | , process = global.process
|
3843 | , isNode = classof(process) == 'process'
|
3844 | , empty = function(){ }
|
3845 | , Internal, GenericPromiseCapability, Wrapper;
|
3846 |
|
3847 | var USE_NATIVE = !!function(){
|
3848 | try {
|
3849 |
|
3850 | var promise = $Promise.resolve(1)
|
3851 | , FakePromise = (promise.constructor = {})[_dereq_(117)('species')] = function(exec){ exec(empty, empty); };
|
3852 |
|
3853 | return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
|
3854 | } catch(e){ }
|
3855 | }();
|
3856 |
|
3857 |
|
3858 | var sameConstructor = function(a, b){
|
3859 |
|
3860 | return a === b || a === $Promise && b === Wrapper;
|
3861 | };
|
3862 | var isThenable = function(it){
|
3863 | var then;
|
3864 | return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
3865 | };
|
3866 | var newPromiseCapability = function(C){
|
3867 | return sameConstructor($Promise, C)
|
3868 | ? new PromiseCapability(C)
|
3869 | : new GenericPromiseCapability(C);
|
3870 | };
|
3871 | var PromiseCapability = GenericPromiseCapability = function(C){
|
3872 | var resolve, reject;
|
3873 | this.promise = new C(function($$resolve, $$reject){
|
3874 | if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');
|
3875 | resolve = $$resolve;
|
3876 | reject = $$reject;
|
3877 | });
|
3878 | this.resolve = aFunction(resolve);
|
3879 | this.reject = aFunction(reject);
|
3880 | };
|
3881 | var perform = function(exec){
|
3882 | try {
|
3883 | exec();
|
3884 | } catch(e){
|
3885 | return {error: e};
|
3886 | }
|
3887 | };
|
3888 | var notify = function(promise, isReject){
|
3889 | if(promise._n)return;
|
3890 | promise._n = true;
|
3891 | var chain = promise._c;
|
3892 | microtask(function(){
|
3893 | var value = promise._v
|
3894 | , ok = promise._s == 1
|
3895 | , i = 0;
|
3896 | var run = function(reaction){
|
3897 | var handler = ok ? reaction.ok : reaction.fail
|
3898 | , resolve = reaction.resolve
|
3899 | , reject = reaction.reject
|
3900 | , domain = reaction.domain
|
3901 | , result, then;
|
3902 | try {
|
3903 | if(handler){
|
3904 | if(!ok){
|
3905 | if(promise._h == 2)onHandleUnhandled(promise);
|
3906 | promise._h = 1;
|
3907 | }
|
3908 | if(handler === true)result = value;
|
3909 | else {
|
3910 | if(domain)domain.enter();
|
3911 | result = handler(value);
|
3912 | if(domain)domain.exit();
|
3913 | }
|
3914 | if(result === reaction.promise){
|
3915 | reject(TypeError('Promise-chain cycle'));
|
3916 | } else if(then = isThenable(result)){
|
3917 | then.call(result, resolve, reject);
|
3918 | } else resolve(result);
|
3919 | } else reject(value);
|
3920 | } catch(e){
|
3921 | reject(e);
|
3922 | }
|
3923 | };
|
3924 | while(chain.length > i)run(chain[i++]);
|
3925 | promise._c = [];
|
3926 | promise._n = false;
|
3927 | if(isReject && !promise._h)onUnhandled(promise);
|
3928 | });
|
3929 | };
|
3930 | var onUnhandled = function(promise){
|
3931 | task.call(global, function(){
|
3932 | var value = promise._v
|
3933 | , abrupt, handler, console;
|
3934 | if(isUnhandled(promise)){
|
3935 | abrupt = perform(function(){
|
3936 | if(isNode){
|
3937 | process.emit('unhandledRejection', value, promise);
|
3938 | } else if(handler = global.onunhandledrejection){
|
3939 | handler({promise: promise, reason: value});
|
3940 | } else if((console = global.console) && console.error){
|
3941 | console.error('Unhandled promise rejection', value);
|
3942 | }
|
3943 | });
|
3944 |
|
3945 | promise._h = isNode || isUnhandled(promise) ? 2 : 1;
|
3946 | } promise._a = undefined;
|
3947 | if(abrupt)throw abrupt.error;
|
3948 | });
|
3949 | };
|
3950 | var isUnhandled = function(promise){
|
3951 | if(promise._h == 1)return false;
|
3952 | var chain = promise._a || promise._c
|
3953 | , i = 0
|
3954 | , reaction;
|
3955 | while(chain.length > i){
|
3956 | reaction = chain[i++];
|
3957 | if(reaction.fail || !isUnhandled(reaction.promise))return false;
|
3958 | } return true;
|
3959 | };
|
3960 | var onHandleUnhandled = function(promise){
|
3961 | task.call(global, function(){
|
3962 | var handler;
|
3963 | if(isNode){
|
3964 | process.emit('rejectionHandled', promise);
|
3965 | } else if(handler = global.onrejectionhandled){
|
3966 | handler({promise: promise, reason: promise._v});
|
3967 | }
|
3968 | });
|
3969 | };
|
3970 | var $reject = function(value){
|
3971 | var promise = this;
|
3972 | if(promise._d)return;
|
3973 | promise._d = true;
|
3974 | promise = promise._w || promise;
|
3975 | promise._v = value;
|
3976 | promise._s = 2;
|
3977 | if(!promise._a)promise._a = promise._c.slice();
|
3978 | notify(promise, true);
|
3979 | };
|
3980 | var $resolve = function(value){
|
3981 | var promise = this
|
3982 | , then;
|
3983 | if(promise._d)return;
|
3984 | promise._d = true;
|
3985 | promise = promise._w || promise;
|
3986 | try {
|
3987 | if(promise === value)throw TypeError("Promise can't be resolved itself");
|
3988 | if(then = isThenable(value)){
|
3989 | microtask(function(){
|
3990 | var wrapper = {_w: promise, _d: false};
|
3991 | try {
|
3992 | then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
|
3993 | } catch(e){
|
3994 | $reject.call(wrapper, e);
|
3995 | }
|
3996 | });
|
3997 | } else {
|
3998 | promise._v = value;
|
3999 | promise._s = 1;
|
4000 | notify(promise, false);
|
4001 | }
|
4002 | } catch(e){
|
4003 | $reject.call({_w: promise, _d: false}, e);
|
4004 | }
|
4005 | };
|
4006 |
|
4007 |
|
4008 | if(!USE_NATIVE){
|
4009 |
|
4010 | $Promise = function Promise(executor){
|
4011 | anInstance(this, $Promise, PROMISE, '_h');
|
4012 | aFunction(executor);
|
4013 | Internal.call(this);
|
4014 | try {
|
4015 | executor(ctx($resolve, this, 1), ctx($reject, this, 1));
|
4016 | } catch(err){
|
4017 | $reject.call(this, err);
|
4018 | }
|
4019 | };
|
4020 | Internal = function Promise(executor){
|
4021 | this._c = [];
|
4022 | this._a = undefined;
|
4023 | this._s = 0;
|
4024 | this._d = false;
|
4025 | this._v = undefined;
|
4026 | this._h = 0;
|
4027 | this._n = false;
|
4028 | };
|
4029 | Internal.prototype = _dereq_(86)($Promise.prototype, {
|
4030 |
|
4031 | then: function then(onFulfilled, onRejected){
|
4032 | var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
|
4033 | reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
4034 | reaction.fail = typeof onRejected == 'function' && onRejected;
|
4035 | reaction.domain = isNode ? process.domain : undefined;
|
4036 | this._c.push(reaction);
|
4037 | if(this._a)this._a.push(reaction);
|
4038 | if(this._s)notify(this, false);
|
4039 | return reaction.promise;
|
4040 | },
|
4041 |
|
4042 | 'catch': function(onRejected){
|
4043 | return this.then(undefined, onRejected);
|
4044 | }
|
4045 | });
|
4046 | PromiseCapability = function(){
|
4047 | var promise = new Internal;
|
4048 | this.promise = promise;
|
4049 | this.resolve = ctx($resolve, promise, 1);
|
4050 | this.reject = ctx($reject, promise, 1);
|
4051 | };
|
4052 | }
|
4053 |
|
4054 | $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});
|
4055 | _dereq_(92)($Promise, PROMISE);
|
4056 | _dereq_(91)(PROMISE);
|
4057 | Wrapper = _dereq_(23)[PROMISE];
|
4058 |
|
4059 |
|
4060 | $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
|
4061 |
|
4062 | reject: function reject(r){
|
4063 | var capability = newPromiseCapability(this)
|
4064 | , $$reject = capability.reject;
|
4065 | $$reject(r);
|
4066 | return capability.promise;
|
4067 | }
|
4068 | });
|
4069 | $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
|
4070 |
|
4071 | resolve: function resolve(x){
|
4072 |
|
4073 | if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;
|
4074 | var capability = newPromiseCapability(this)
|
4075 | , $$resolve = capability.resolve;
|
4076 | $$resolve(x);
|
4077 | return capability.promise;
|
4078 | }
|
4079 | });
|
4080 | $export($export.S + $export.F * !(USE_NATIVE && _dereq_(54)(function(iter){
|
4081 | $Promise.all(iter)['catch'](empty);
|
4082 | })), PROMISE, {
|
4083 |
|
4084 | all: function all(iterable){
|
4085 | var C = this
|
4086 | , capability = newPromiseCapability(C)
|
4087 | , resolve = capability.resolve
|
4088 | , reject = capability.reject;
|
4089 | var abrupt = perform(function(){
|
4090 | var values = []
|
4091 | , index = 0
|
4092 | , remaining = 1;
|
4093 | forOf(iterable, false, function(promise){
|
4094 | var $index = index++
|
4095 | , alreadyCalled = false;
|
4096 | values.push(undefined);
|
4097 | remaining++;
|
4098 | C.resolve(promise).then(function(value){
|
4099 | if(alreadyCalled)return;
|
4100 | alreadyCalled = true;
|
4101 | values[$index] = value;
|
4102 | --remaining || resolve(values);
|
4103 | }, reject);
|
4104 | });
|
4105 | --remaining || resolve(values);
|
4106 | });
|
4107 | if(abrupt)reject(abrupt.error);
|
4108 | return capability.promise;
|
4109 | },
|
4110 |
|
4111 | race: function race(iterable){
|
4112 | var C = this
|
4113 | , capability = newPromiseCapability(C)
|
4114 | , reject = capability.reject;
|
4115 | var abrupt = perform(function(){
|
4116 | forOf(iterable, false, function(promise){
|
4117 | C.resolve(promise).then(capability.resolve, reject);
|
4118 | });
|
4119 | });
|
4120 | if(abrupt)reject(abrupt.error);
|
4121 | return capability.promise;
|
4122 | }
|
4123 | });
|
4124 | },{"104":104,"117":117,"17":17,"23":23,"25":25,"3":3,"32":32,"37":37,"38":38,"49":49,"54":54,"58":58,"6":6,"64":64,"86":86,"91":91,"92":92,"95":95}],199:[function(_dereq_,module,exports){
|
4125 |
|
4126 | var $export = _dereq_(32)
|
4127 | , aFunction = _dereq_(3)
|
4128 | , anObject = _dereq_(7)
|
4129 | , rApply = (_dereq_(38).Reflect || {}).apply
|
4130 | , fApply = Function.apply;
|
4131 |
|
4132 | $export($export.S + $export.F * !_dereq_(34)(function(){
|
4133 | rApply(function(){});
|
4134 | }), 'Reflect', {
|
4135 | apply: function apply(target, thisArgument, argumentsList){
|
4136 | var T = aFunction(target)
|
4137 | , L = anObject(argumentsList);
|
4138 | return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
|
4139 | }
|
4140 | });
|
4141 | },{"3":3,"32":32,"34":34,"38":38,"7":7}],200:[function(_dereq_,module,exports){
|
4142 |
|
4143 | var $export = _dereq_(32)
|
4144 | , create = _dereq_(66)
|
4145 | , aFunction = _dereq_(3)
|
4146 | , anObject = _dereq_(7)
|
4147 | , isObject = _dereq_(49)
|
4148 | , fails = _dereq_(34)
|
4149 | , bind = _dereq_(16)
|
4150 | , rConstruct = (_dereq_(38).Reflect || {}).construct;
|
4151 |
|
4152 |
|
4153 |
|
4154 | var NEW_TARGET_BUG = fails(function(){
|
4155 | function F(){}
|
4156 | return !(rConstruct(function(){}, [], F) instanceof F);
|
4157 | });
|
4158 | var ARGS_BUG = !fails(function(){
|
4159 | rConstruct(function(){});
|
4160 | });
|
4161 |
|
4162 | $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
|
4163 | construct: function construct(Target, args /*, newTarget*/){
|
4164 | aFunction(Target);
|
4165 | anObject(args);
|
4166 | var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
|
4167 | if(ARGS_BUG && !NEW_TARGET_BUG)return rConstruct(Target, args, newTarget);
|
4168 | if(Target == newTarget){
|
4169 |
|
4170 | switch(args.length){
|
4171 | case 0: return new Target;
|
4172 | case 1: return new Target(args[0]);
|
4173 | case 2: return new Target(args[0], args[1]);
|
4174 | case 3: return new Target(args[0], args[1], args[2]);
|
4175 | case 4: return new Target(args[0], args[1], args[2], args[3]);
|
4176 | }
|
4177 |
|
4178 | var $args = [null];
|
4179 | $args.push.apply($args, args);
|
4180 | return new (bind.apply(Target, $args));
|
4181 | }
|
4182 |
|
4183 | var proto = newTarget.prototype
|
4184 | , instance = create(isObject(proto) ? proto : Object.prototype)
|
4185 | , result = Function.apply.call(Target, instance, args);
|
4186 | return isObject(result) ? result : instance;
|
4187 | }
|
4188 | });
|
4189 | },{"16":16,"3":3,"32":32,"34":34,"38":38,"49":49,"66":66,"7":7}],201:[function(_dereq_,module,exports){
|
4190 |
|
4191 | var dP = _dereq_(67)
|
4192 | , $export = _dereq_(32)
|
4193 | , anObject = _dereq_(7)
|
4194 | , toPrimitive = _dereq_(110);
|
4195 |
|
4196 |
|
4197 | $export($export.S + $export.F * _dereq_(34)(function(){
|
4198 | Reflect.defineProperty(dP.f({}, 1, {value: 1}), 1, {value: 2});
|
4199 | }), 'Reflect', {
|
4200 | defineProperty: function defineProperty(target, propertyKey, attributes){
|
4201 | anObject(target);
|
4202 | propertyKey = toPrimitive(propertyKey, true);
|
4203 | anObject(attributes);
|
4204 | try {
|
4205 | dP.f(target, propertyKey, attributes);
|
4206 | return true;
|
4207 | } catch(e){
|
4208 | return false;
|
4209 | }
|
4210 | }
|
4211 | });
|
4212 | },{"110":110,"32":32,"34":34,"67":67,"7":7}],202:[function(_dereq_,module,exports){
|
4213 |
|
4214 | var $export = _dereq_(32)
|
4215 | , gOPD = _dereq_(70).f
|
4216 | , anObject = _dereq_(7);
|
4217 |
|
4218 | $export($export.S, 'Reflect', {
|
4219 | deleteProperty: function deleteProperty(target, propertyKey){
|
4220 | var desc = gOPD(anObject(target), propertyKey);
|
4221 | return desc && !desc.configurable ? false : delete target[propertyKey];
|
4222 | }
|
4223 | });
|
4224 | },{"32":32,"7":7,"70":70}],203:[function(_dereq_,module,exports){
|
4225 | 'use strict';
|
4226 |
|
4227 | var $export = _dereq_(32)
|
4228 | , anObject = _dereq_(7);
|
4229 | var Enumerate = function(iterated){
|
4230 | this._t = anObject(iterated);
|
4231 | this._i = 0;
|
4232 | var keys = this._k = []
|
4233 | , key;
|
4234 | for(key in iterated)keys.push(key);
|
4235 | };
|
4236 | _dereq_(52)(Enumerate, 'Object', function(){
|
4237 | var that = this
|
4238 | , keys = that._k
|
4239 | , key;
|
4240 | do {
|
4241 | if(that._i >= keys.length)return {value: undefined, done: true};
|
4242 | } while(!((key = keys[that._i++]) in that._t));
|
4243 | return {value: key, done: false};
|
4244 | });
|
4245 |
|
4246 | $export($export.S, 'Reflect', {
|
4247 | enumerate: function enumerate(target){
|
4248 | return new Enumerate(target);
|
4249 | }
|
4250 | });
|
4251 | },{"32":32,"52":52,"7":7}],204:[function(_dereq_,module,exports){
|
4252 |
|
4253 | var gOPD = _dereq_(70)
|
4254 | , $export = _dereq_(32)
|
4255 | , anObject = _dereq_(7);
|
4256 |
|
4257 | $export($export.S, 'Reflect', {
|
4258 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){
|
4259 | return gOPD.f(anObject(target), propertyKey);
|
4260 | }
|
4261 | });
|
4262 | },{"32":32,"7":7,"70":70}],205:[function(_dereq_,module,exports){
|
4263 |
|
4264 | var $export = _dereq_(32)
|
4265 | , getProto = _dereq_(74)
|
4266 | , anObject = _dereq_(7);
|
4267 |
|
4268 | $export($export.S, 'Reflect', {
|
4269 | getPrototypeOf: function getPrototypeOf(target){
|
4270 | return getProto(anObject(target));
|
4271 | }
|
4272 | });
|
4273 | },{"32":32,"7":7,"74":74}],206:[function(_dereq_,module,exports){
|
4274 |
|
4275 | var gOPD = _dereq_(70)
|
4276 | , getPrototypeOf = _dereq_(74)
|
4277 | , has = _dereq_(39)
|
4278 | , $export = _dereq_(32)
|
4279 | , isObject = _dereq_(49)
|
4280 | , anObject = _dereq_(7);
|
4281 |
|
4282 | function get(target, propertyKey/*, receiver*/){
|
4283 | var receiver = arguments.length < 3 ? target : arguments[2]
|
4284 | , desc, proto;
|
4285 | if(anObject(target) === receiver)return target[propertyKey];
|
4286 | if(desc = gOPD.f(target, propertyKey))return has(desc, 'value')
|
4287 | ? desc.value
|
4288 | : desc.get !== undefined
|
4289 | ? desc.get.call(receiver)
|
4290 | : undefined;
|
4291 | if(isObject(proto = getPrototypeOf(target)))return get(proto, propertyKey, receiver);
|
4292 | }
|
4293 |
|
4294 | $export($export.S, 'Reflect', {get: get});
|
4295 | },{"32":32,"39":39,"49":49,"7":7,"70":70,"74":74}],207:[function(_dereq_,module,exports){
|
4296 |
|
4297 | var $export = _dereq_(32);
|
4298 |
|
4299 | $export($export.S, 'Reflect', {
|
4300 | has: function has(target, propertyKey){
|
4301 | return propertyKey in target;
|
4302 | }
|
4303 | });
|
4304 | },{"32":32}],208:[function(_dereq_,module,exports){
|
4305 |
|
4306 | var $export = _dereq_(32)
|
4307 | , anObject = _dereq_(7)
|
4308 | , $isExtensible = Object.isExtensible;
|
4309 |
|
4310 | $export($export.S, 'Reflect', {
|
4311 | isExtensible: function isExtensible(target){
|
4312 | anObject(target);
|
4313 | return $isExtensible ? $isExtensible(target) : true;
|
4314 | }
|
4315 | });
|
4316 | },{"32":32,"7":7}],209:[function(_dereq_,module,exports){
|
4317 |
|
4318 | var $export = _dereq_(32);
|
4319 |
|
4320 | $export($export.S, 'Reflect', {ownKeys: _dereq_(80)});
|
4321 | },{"32":32,"80":80}],210:[function(_dereq_,module,exports){
|
4322 |
|
4323 | var $export = _dereq_(32)
|
4324 | , anObject = _dereq_(7)
|
4325 | , $preventExtensions = Object.preventExtensions;
|
4326 |
|
4327 | $export($export.S, 'Reflect', {
|
4328 | preventExtensions: function preventExtensions(target){
|
4329 | anObject(target);
|
4330 | try {
|
4331 | if($preventExtensions)$preventExtensions(target);
|
4332 | return true;
|
4333 | } catch(e){
|
4334 | return false;
|
4335 | }
|
4336 | }
|
4337 | });
|
4338 | },{"32":32,"7":7}],211:[function(_dereq_,module,exports){
|
4339 |
|
4340 | var $export = _dereq_(32)
|
4341 | , setProto = _dereq_(90);
|
4342 |
|
4343 | if(setProto)$export($export.S, 'Reflect', {
|
4344 | setPrototypeOf: function setPrototypeOf(target, proto){
|
4345 | setProto.check(target, proto);
|
4346 | try {
|
4347 | setProto.set(target, proto);
|
4348 | return true;
|
4349 | } catch(e){
|
4350 | return false;
|
4351 | }
|
4352 | }
|
4353 | });
|
4354 | },{"32":32,"90":90}],212:[function(_dereq_,module,exports){
|
4355 |
|
4356 | var dP = _dereq_(67)
|
4357 | , gOPD = _dereq_(70)
|
4358 | , getPrototypeOf = _dereq_(74)
|
4359 | , has = _dereq_(39)
|
4360 | , $export = _dereq_(32)
|
4361 | , createDesc = _dereq_(85)
|
4362 | , anObject = _dereq_(7)
|
4363 | , isObject = _dereq_(49);
|
4364 |
|
4365 | function set(target, propertyKey, V/*, receiver*/){
|
4366 | var receiver = arguments.length < 4 ? target : arguments[3]
|
4367 | , ownDesc = gOPD.f(anObject(target), propertyKey)
|
4368 | , existingDescriptor, proto;
|
4369 | if(!ownDesc){
|
4370 | if(isObject(proto = getPrototypeOf(target))){
|
4371 | return set(proto, propertyKey, V, receiver);
|
4372 | }
|
4373 | ownDesc = createDesc(0);
|
4374 | }
|
4375 | if(has(ownDesc, 'value')){
|
4376 | if(ownDesc.writable === false || !isObject(receiver))return false;
|
4377 | existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0);
|
4378 | existingDescriptor.value = V;
|
4379 | dP.f(receiver, propertyKey, existingDescriptor);
|
4380 | return true;
|
4381 | }
|
4382 | return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
|
4383 | }
|
4384 |
|
4385 | $export($export.S, 'Reflect', {set: set});
|
4386 | },{"32":32,"39":39,"49":49,"67":67,"7":7,"70":70,"74":74,"85":85}],213:[function(_dereq_,module,exports){
|
4387 | var global = _dereq_(38)
|
4388 | , inheritIfRequired = _dereq_(43)
|
4389 | , dP = _dereq_(67).f
|
4390 | , gOPN = _dereq_(72).f
|
4391 | , isRegExp = _dereq_(50)
|
4392 | , $flags = _dereq_(36)
|
4393 | , $RegExp = global.RegExp
|
4394 | , Base = $RegExp
|
4395 | , proto = $RegExp.prototype
|
4396 | , re1 = /a/g
|
4397 | , re2 = /a/g
|
4398 |
|
4399 | , CORRECT_NEW = new $RegExp(re1) !== re1;
|
4400 |
|
4401 | if(_dereq_(28) && (!CORRECT_NEW || _dereq_(34)(function(){
|
4402 | re2[_dereq_(117)('match')] = false;
|
4403 |
|
4404 | return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
|
4405 | }))){
|
4406 | $RegExp = function RegExp(p, f){
|
4407 | var tiRE = this instanceof $RegExp
|
4408 | , piRE = isRegExp(p)
|
4409 | , fiU = f === undefined;
|
4410 | return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
|
4411 | : inheritIfRequired(CORRECT_NEW
|
4412 | ? new Base(piRE && !fiU ? p.source : p, f)
|
4413 | : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
|
4414 | , tiRE ? this : proto, $RegExp);
|
4415 | };
|
4416 | var proxy = function(key){
|
4417 | key in $RegExp || dP($RegExp, key, {
|
4418 | configurable: true,
|
4419 | get: function(){ return Base[key]; },
|
4420 | set: function(it){ Base[key] = it; }
|
4421 | });
|
4422 | };
|
4423 | for(var keys = gOPN(Base), i = 0; keys.length > i; )proxy(keys[i++]);
|
4424 | proto.constructor = $RegExp;
|
4425 | $RegExp.prototype = proto;
|
4426 | _dereq_(87)(global, 'RegExp', $RegExp);
|
4427 | }
|
4428 |
|
4429 | _dereq_(91)('RegExp');
|
4430 | },{"117":117,"28":28,"34":34,"36":36,"38":38,"43":43,"50":50,"67":67,"72":72,"87":87,"91":91}],214:[function(_dereq_,module,exports){
|
4431 |
|
4432 | if(_dereq_(28) && /./g.flags != 'g')_dereq_(67).f(RegExp.prototype, 'flags', {
|
4433 | configurable: true,
|
4434 | get: _dereq_(36)
|
4435 | });
|
4436 | },{"28":28,"36":36,"67":67}],215:[function(_dereq_,module,exports){
|
4437 |
|
4438 | _dereq_(35)('match', 1, function(defined, MATCH, $match){
|
4439 |
|
4440 | return [function match(regexp){
|
4441 | 'use strict';
|
4442 | var O = defined(this)
|
4443 | , fn = regexp == undefined ? undefined : regexp[MATCH];
|
4444 | return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
|
4445 | }, $match];
|
4446 | });
|
4447 | },{"35":35}],216:[function(_dereq_,module,exports){
|
4448 |
|
4449 | _dereq_(35)('replace', 2, function(defined, REPLACE, $replace){
|
4450 |
|
4451 | return [function replace(searchValue, replaceValue){
|
4452 | 'use strict';
|
4453 | var O = defined(this)
|
4454 | , fn = searchValue == undefined ? undefined : searchValue[REPLACE];
|
4455 | return fn !== undefined
|
4456 | ? fn.call(searchValue, O, replaceValue)
|
4457 | : $replace.call(String(O), searchValue, replaceValue);
|
4458 | }, $replace];
|
4459 | });
|
4460 | },{"35":35}],217:[function(_dereq_,module,exports){
|
4461 |
|
4462 | _dereq_(35)('search', 1, function(defined, SEARCH, $search){
|
4463 |
|
4464 | return [function search(regexp){
|
4465 | 'use strict';
|
4466 | var O = defined(this)
|
4467 | , fn = regexp == undefined ? undefined : regexp[SEARCH];
|
4468 | return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
|
4469 | }, $search];
|
4470 | });
|
4471 | },{"35":35}],218:[function(_dereq_,module,exports){
|
4472 |
|
4473 | _dereq_(35)('split', 2, function(defined, SPLIT, $split){
|
4474 | 'use strict';
|
4475 | var isRegExp = _dereq_(50)
|
4476 | , _split = $split
|
4477 | , $push = [].push
|
4478 | , $SPLIT = 'split'
|
4479 | , LENGTH = 'length'
|
4480 | , LAST_INDEX = 'lastIndex';
|
4481 | if(
|
4482 | 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
|
4483 | 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
|
4484 | 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
|
4485 | '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
|
4486 | '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
|
4487 | ''[$SPLIT](/.?/)[LENGTH]
|
4488 | ){
|
4489 | var NPCG = /()??/.exec('')[1] === undefined;
|
4490 |
|
4491 | $split = function(separator, limit){
|
4492 | var string = String(this);
|
4493 | if(separator === undefined && limit === 0)return [];
|
4494 |
|
4495 | if(!isRegExp(separator))return _split.call(string, separator, limit);
|
4496 | var output = [];
|
4497 | var flags = (separator.ignoreCase ? 'i' : '') +
|
4498 | (separator.multiline ? 'm' : '') +
|
4499 | (separator.unicode ? 'u' : '') +
|
4500 | (separator.sticky ? 'y' : '');
|
4501 | var lastLastIndex = 0;
|
4502 | var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
|
4503 |
|
4504 | var separatorCopy = new RegExp(separator.source, flags + 'g');
|
4505 | var separator2, match, lastIndex, lastLength, i;
|
4506 |
|
4507 | if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
|
4508 | while(match = separatorCopy.exec(string)){
|
4509 |
|
4510 | lastIndex = match.index + match[0][LENGTH];
|
4511 | if(lastIndex > lastLastIndex){
|
4512 | output.push(string.slice(lastLastIndex, match.index));
|
4513 |
|
4514 | if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){
|
4515 | for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined;
|
4516 | });
|
4517 | if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1));
|
4518 | lastLength = match[0][LENGTH];
|
4519 | lastLastIndex = lastIndex;
|
4520 | if(output[LENGTH] >= splitLimit)break;
|
4521 | }
|
4522 | if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++;
|
4523 | }
|
4524 | if(lastLastIndex === string[LENGTH]){
|
4525 | if(lastLength || !separatorCopy.test(''))output.push('');
|
4526 | } else output.push(string.slice(lastLastIndex));
|
4527 | return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
|
4528 | };
|
4529 |
|
4530 | } else if('0'[$SPLIT](undefined, 0)[LENGTH]){
|
4531 | $split = function(separator, limit){
|
4532 | return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);
|
4533 | };
|
4534 | }
|
4535 |
|
4536 | return [function split(separator, limit){
|
4537 | var O = defined(this)
|
4538 | , fn = separator == undefined ? undefined : separator[SPLIT];
|
4539 | return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);
|
4540 | }, $split];
|
4541 | });
|
4542 | },{"35":35,"50":50}],219:[function(_dereq_,module,exports){
|
4543 | 'use strict';
|
4544 | _dereq_(214);
|
4545 | var anObject = _dereq_(7)
|
4546 | , $flags = _dereq_(36)
|
4547 | , DESCRIPTORS = _dereq_(28)
|
4548 | , TO_STRING = 'toString'
|
4549 | , $toString = /./[TO_STRING];
|
4550 |
|
4551 | var define = function(fn){
|
4552 | _dereq_(87)(RegExp.prototype, TO_STRING, fn, true);
|
4553 | };
|
4554 |
|
4555 |
|
4556 | if(_dereq_(34)(function(){ return $toString.call({source: 'a', flags: 'b'}) != '/a/b'; })){
|
4557 | define(function toString(){
|
4558 | var R = anObject(this);
|
4559 | return '/'.concat(R.source, '/',
|
4560 | 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
|
4561 | });
|
4562 |
|
4563 | } else if($toString.name != TO_STRING){
|
4564 | define(function toString(){
|
4565 | return $toString.call(this);
|
4566 | });
|
4567 | }
|
4568 | },{"214":214,"28":28,"34":34,"36":36,"7":7,"87":87}],220:[function(_dereq_,module,exports){
|
4569 | 'use strict';
|
4570 | var strong = _dereq_(19);
|
4571 |
|
4572 |
|
4573 | module.exports = _dereq_(22)('Set', function(get){
|
4574 | return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
|
4575 | }, {
|
4576 |
|
4577 | add: function add(value){
|
4578 | return strong.def(this, value = value === 0 ? 0 : value, value);
|
4579 | }
|
4580 | }, strong);
|
4581 | },{"19":19,"22":22}],221:[function(_dereq_,module,exports){
|
4582 | 'use strict';
|
4583 |
|
4584 | _dereq_(99)('anchor', function(createHTML){
|
4585 | return function anchor(name){
|
4586 | return createHTML(this, 'a', 'name', name);
|
4587 | }
|
4588 | });
|
4589 | },{"99":99}],222:[function(_dereq_,module,exports){
|
4590 | 'use strict';
|
4591 |
|
4592 | _dereq_(99)('big', function(createHTML){
|
4593 | return function big(){
|
4594 | return createHTML(this, 'big', '', '');
|
4595 | }
|
4596 | });
|
4597 | },{"99":99}],223:[function(_dereq_,module,exports){
|
4598 | 'use strict';
|
4599 |
|
4600 | _dereq_(99)('blink', function(createHTML){
|
4601 | return function blink(){
|
4602 | return createHTML(this, 'blink', '', '');
|
4603 | }
|
4604 | });
|
4605 | },{"99":99}],224:[function(_dereq_,module,exports){
|
4606 | 'use strict';
|
4607 |
|
4608 | _dereq_(99)('bold', function(createHTML){
|
4609 | return function bold(){
|
4610 | return createHTML(this, 'b', '', '');
|
4611 | }
|
4612 | });
|
4613 | },{"99":99}],225:[function(_dereq_,module,exports){
|
4614 | 'use strict';
|
4615 | var $export = _dereq_(32)
|
4616 | , $at = _dereq_(97)(false);
|
4617 | $export($export.P, 'String', {
|
4618 |
|
4619 | codePointAt: function codePointAt(pos){
|
4620 | return $at(this, pos);
|
4621 | }
|
4622 | });
|
4623 | },{"32":32,"97":97}],226:[function(_dereq_,module,exports){
|
4624 |
|
4625 | 'use strict';
|
4626 | var $export = _dereq_(32)
|
4627 | , toLength = _dereq_(108)
|
4628 | , context = _dereq_(98)
|
4629 | , ENDS_WITH = 'endsWith'
|
4630 | , $endsWith = ''[ENDS_WITH];
|
4631 |
|
4632 | $export($export.P + $export.F * _dereq_(33)(ENDS_WITH), 'String', {
|
4633 | endsWith: function endsWith(searchString /*, endPosition = @length */){
|
4634 | var that = context(this, searchString, ENDS_WITH)
|
4635 | , endPosition = arguments.length > 1 ? arguments[1] : undefined
|
4636 | , len = toLength(that.length)
|
4637 | , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len)
|
4638 | , search = String(searchString);
|
4639 | return $endsWith
|
4640 | ? $endsWith.call(that, search, end)
|
4641 | : that.slice(end - search.length, end) === search;
|
4642 | }
|
4643 | });
|
4644 | },{"108":108,"32":32,"33":33,"98":98}],227:[function(_dereq_,module,exports){
|
4645 | 'use strict';
|
4646 |
|
4647 | _dereq_(99)('fixed', function(createHTML){
|
4648 | return function fixed(){
|
4649 | return createHTML(this, 'tt', '', '');
|
4650 | }
|
4651 | });
|
4652 | },{"99":99}],228:[function(_dereq_,module,exports){
|
4653 | 'use strict';
|
4654 |
|
4655 | _dereq_(99)('fontcolor', function(createHTML){
|
4656 | return function fontcolor(color){
|
4657 | return createHTML(this, 'font', 'color', color);
|
4658 | }
|
4659 | });
|
4660 | },{"99":99}],229:[function(_dereq_,module,exports){
|
4661 | 'use strict';
|
4662 |
|
4663 | _dereq_(99)('fontsize', function(createHTML){
|
4664 | return function fontsize(size){
|
4665 | return createHTML(this, 'font', 'size', size);
|
4666 | }
|
4667 | });
|
4668 | },{"99":99}],230:[function(_dereq_,module,exports){
|
4669 | var $export = _dereq_(32)
|
4670 | , toIndex = _dereq_(105)
|
4671 | , fromCharCode = String.fromCharCode
|
4672 | , $fromCodePoint = String.fromCodePoint;
|
4673 |
|
4674 |
|
4675 | $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
|
4676 |
|
4677 | fromCodePoint: function fromCodePoint(x){
|
4678 | var res = []
|
4679 | , aLen = arguments.length
|
4680 | , i = 0
|
4681 | , code;
|
4682 | while(aLen > i){
|
4683 | code = +arguments[i++];
|
4684 | if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');
|
4685 | res.push(code < 0x10000
|
4686 | ? fromCharCode(code)
|
4687 | : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
|
4688 | );
|
4689 | } return res.join('');
|
4690 | }
|
4691 | });
|
4692 | },{"105":105,"32":32}],231:[function(_dereq_,module,exports){
|
4693 |
|
4694 | 'use strict';
|
4695 | var $export = _dereq_(32)
|
4696 | , context = _dereq_(98)
|
4697 | , INCLUDES = 'includes';
|
4698 |
|
4699 | $export($export.P + $export.F * _dereq_(33)(INCLUDES), 'String', {
|
4700 | includes: function includes(searchString /*, position = 0 */){
|
4701 | return !!~context(this, searchString, INCLUDES)
|
4702 | .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
|
4703 | }
|
4704 | });
|
4705 | },{"32":32,"33":33,"98":98}],232:[function(_dereq_,module,exports){
|
4706 | 'use strict';
|
4707 |
|
4708 | _dereq_(99)('italics', function(createHTML){
|
4709 | return function italics(){
|
4710 | return createHTML(this, 'i', '', '');
|
4711 | }
|
4712 | });
|
4713 | },{"99":99}],233:[function(_dereq_,module,exports){
|
4714 | 'use strict';
|
4715 | var $at = _dereq_(97)(true);
|
4716 |
|
4717 |
|
4718 | _dereq_(53)(String, 'String', function(iterated){
|
4719 | this._t = String(iterated);
|
4720 | this._i = 0;
|
4721 |
|
4722 | }, function(){
|
4723 | var O = this._t
|
4724 | , index = this._i
|
4725 | , point;
|
4726 | if(index >= O.length)return {value: undefined, done: true};
|
4727 | point = $at(O, index);
|
4728 | this._i += point.length;
|
4729 | return {value: point, done: false};
|
4730 | });
|
4731 | },{"53":53,"97":97}],234:[function(_dereq_,module,exports){
|
4732 | 'use strict';
|
4733 |
|
4734 | _dereq_(99)('link', function(createHTML){
|
4735 | return function link(url){
|
4736 | return createHTML(this, 'a', 'href', url);
|
4737 | }
|
4738 | });
|
4739 | },{"99":99}],235:[function(_dereq_,module,exports){
|
4740 | var $export = _dereq_(32)
|
4741 | , toIObject = _dereq_(107)
|
4742 | , toLength = _dereq_(108);
|
4743 |
|
4744 | $export($export.S, 'String', {
|
4745 |
|
4746 | raw: function raw(callSite){
|
4747 | var tpl = toIObject(callSite.raw)
|
4748 | , len = toLength(tpl.length)
|
4749 | , aLen = arguments.length
|
4750 | , res = []
|
4751 | , i = 0;
|
4752 | while(len > i){
|
4753 | res.push(String(tpl[i++]));
|
4754 | if(i < aLen)res.push(String(arguments[i]));
|
4755 | } return res.join('');
|
4756 | }
|
4757 | });
|
4758 | },{"107":107,"108":108,"32":32}],236:[function(_dereq_,module,exports){
|
4759 | var $export = _dereq_(32);
|
4760 |
|
4761 | $export($export.P, 'String', {
|
4762 |
|
4763 | repeat: _dereq_(101)
|
4764 | });
|
4765 | },{"101":101,"32":32}],237:[function(_dereq_,module,exports){
|
4766 | 'use strict';
|
4767 |
|
4768 | _dereq_(99)('small', function(createHTML){
|
4769 | return function small(){
|
4770 | return createHTML(this, 'small', '', '');
|
4771 | }
|
4772 | });
|
4773 | },{"99":99}],238:[function(_dereq_,module,exports){
|
4774 |
|
4775 | 'use strict';
|
4776 | var $export = _dereq_(32)
|
4777 | , toLength = _dereq_(108)
|
4778 | , context = _dereq_(98)
|
4779 | , STARTS_WITH = 'startsWith'
|
4780 | , $startsWith = ''[STARTS_WITH];
|
4781 |
|
4782 | $export($export.P + $export.F * _dereq_(33)(STARTS_WITH), 'String', {
|
4783 | startsWith: function startsWith(searchString /*, position = 0 */){
|
4784 | var that = context(this, searchString, STARTS_WITH)
|
4785 | , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length))
|
4786 | , search = String(searchString);
|
4787 | return $startsWith
|
4788 | ? $startsWith.call(that, search, index)
|
4789 | : that.slice(index, index + search.length) === search;
|
4790 | }
|
4791 | });
|
4792 | },{"108":108,"32":32,"33":33,"98":98}],239:[function(_dereq_,module,exports){
|
4793 | 'use strict';
|
4794 |
|
4795 | _dereq_(99)('strike', function(createHTML){
|
4796 | return function strike(){
|
4797 | return createHTML(this, 'strike', '', '');
|
4798 | }
|
4799 | });
|
4800 | },{"99":99}],240:[function(_dereq_,module,exports){
|
4801 | 'use strict';
|
4802 |
|
4803 | _dereq_(99)('sub', function(createHTML){
|
4804 | return function sub(){
|
4805 | return createHTML(this, 'sub', '', '');
|
4806 | }
|
4807 | });
|
4808 | },{"99":99}],241:[function(_dereq_,module,exports){
|
4809 | 'use strict';
|
4810 |
|
4811 | _dereq_(99)('sup', function(createHTML){
|
4812 | return function sup(){
|
4813 | return createHTML(this, 'sup', '', '');
|
4814 | }
|
4815 | });
|
4816 | },{"99":99}],242:[function(_dereq_,module,exports){
|
4817 | 'use strict';
|
4818 |
|
4819 | _dereq_(102)('trim', function($trim){
|
4820 | return function trim(){
|
4821 | return $trim(this, 3);
|
4822 | };
|
4823 | });
|
4824 | },{"102":102}],243:[function(_dereq_,module,exports){
|
4825 | 'use strict';
|
4826 |
|
4827 | var global = _dereq_(38)
|
4828 | , has = _dereq_(39)
|
4829 | , DESCRIPTORS = _dereq_(28)
|
4830 | , $export = _dereq_(32)
|
4831 | , redefine = _dereq_(87)
|
4832 | , META = _dereq_(62).KEY
|
4833 | , $fails = _dereq_(34)
|
4834 | , shared = _dereq_(94)
|
4835 | , setToStringTag = _dereq_(92)
|
4836 | , uid = _dereq_(114)
|
4837 | , wks = _dereq_(117)
|
4838 | , wksExt = _dereq_(116)
|
4839 | , wksDefine = _dereq_(115)
|
4840 | , keyOf = _dereq_(57)
|
4841 | , enumKeys = _dereq_(31)
|
4842 | , isArray = _dereq_(47)
|
4843 | , anObject = _dereq_(7)
|
4844 | , toIObject = _dereq_(107)
|
4845 | , toPrimitive = _dereq_(110)
|
4846 | , createDesc = _dereq_(85)
|
4847 | , _create = _dereq_(66)
|
4848 | , gOPNExt = _dereq_(71)
|
4849 | , $GOPD = _dereq_(70)
|
4850 | , $DP = _dereq_(67)
|
4851 | , $keys = _dereq_(76)
|
4852 | , gOPD = $GOPD.f
|
4853 | , dP = $DP.f
|
4854 | , gOPN = gOPNExt.f
|
4855 | , $Symbol = global.Symbol
|
4856 | , $JSON = global.JSON
|
4857 | , _stringify = $JSON && $JSON.stringify
|
4858 | , PROTOTYPE = 'prototype'
|
4859 | , HIDDEN = wks('_hidden')
|
4860 | , TO_PRIMITIVE = wks('toPrimitive')
|
4861 | , isEnum = {}.propertyIsEnumerable
|
4862 | , SymbolRegistry = shared('symbol-registry')
|
4863 | , AllSymbols = shared('symbols')
|
4864 | , OPSymbols = shared('op-symbols')
|
4865 | , ObjectProto = Object[PROTOTYPE]
|
4866 | , USE_NATIVE = typeof $Symbol == 'function'
|
4867 | , QObject = global.QObject;
|
4868 |
|
4869 | var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
4870 |
|
4871 |
|
4872 | var setSymbolDesc = DESCRIPTORS && $fails(function(){
|
4873 | return _create(dP({}, 'a', {
|
4874 | get: function(){ return dP(this, 'a', {value: 7}).a; }
|
4875 | })).a != 7;
|
4876 | }) ? function(it, key, D){
|
4877 | var protoDesc = gOPD(ObjectProto, key);
|
4878 | if(protoDesc)delete ObjectProto[key];
|
4879 | dP(it, key, D);
|
4880 | if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);
|
4881 | } : dP;
|
4882 |
|
4883 | var wrap = function(tag){
|
4884 | var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
|
4885 | sym._k = tag;
|
4886 | return sym;
|
4887 | };
|
4888 |
|
4889 | var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){
|
4890 | return typeof it == 'symbol';
|
4891 | } : function(it){
|
4892 | return it instanceof $Symbol;
|
4893 | };
|
4894 |
|
4895 | var $defineProperty = function defineProperty(it, key, D){
|
4896 | if(it === ObjectProto)$defineProperty(OPSymbols, key, D);
|
4897 | anObject(it);
|
4898 | key = toPrimitive(key, true);
|
4899 | anObject(D);
|
4900 | if(has(AllSymbols, key)){
|
4901 | if(!D.enumerable){
|
4902 | if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));
|
4903 | it[HIDDEN][key] = true;
|
4904 | } else {
|
4905 | if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;
|
4906 | D = _create(D, {enumerable: createDesc(0, false)});
|
4907 | } return setSymbolDesc(it, key, D);
|
4908 | } return dP(it, key, D);
|
4909 | };
|
4910 | var $defineProperties = function defineProperties(it, P){
|
4911 | anObject(it);
|
4912 | var keys = enumKeys(P = toIObject(P))
|
4913 | , i = 0
|
4914 | , l = keys.length
|
4915 | , key;
|
4916 | while(l > i)$defineProperty(it, key = keys[i++], P[key]);
|
4917 | return it;
|
4918 | };
|
4919 | var $create = function create(it, P){
|
4920 | return P === undefined ? _create(it) : $defineProperties(_create(it), P);
|
4921 | };
|
4922 | var $propertyIsEnumerable = function propertyIsEnumerable(key){
|
4923 | var E = isEnum.call(this, key = toPrimitive(key, true));
|
4924 | if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;
|
4925 | return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
|
4926 | };
|
4927 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){
|
4928 | it = toIObject(it);
|
4929 | key = toPrimitive(key, true);
|
4930 | if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;
|
4931 | var D = gOPD(it, key);
|
4932 | if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;
|
4933 | return D;
|
4934 | };
|
4935 | var $getOwnPropertyNames = function getOwnPropertyNames(it){
|
4936 | var names = gOPN(toIObject(it))
|
4937 | , result = []
|
4938 | , i = 0
|
4939 | , key;
|
4940 | while(names.length > i){
|
4941 | if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);
|
4942 | } return result;
|
4943 | };
|
4944 | var $getOwnPropertySymbols = function getOwnPropertySymbols(it){
|
4945 | var IS_OP = it === ObjectProto
|
4946 | , names = gOPN(IS_OP ? OPSymbols : toIObject(it))
|
4947 | , result = []
|
4948 | , i = 0
|
4949 | , key;
|
4950 | while(names.length > i){
|
4951 | if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);
|
4952 | } return result;
|
4953 | };
|
4954 |
|
4955 |
|
4956 | if(!USE_NATIVE){
|
4957 | $Symbol = function Symbol(){
|
4958 | if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');
|
4959 | var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
|
4960 | var $set = function(value){
|
4961 | if(this === ObjectProto)$set.call(OPSymbols, value);
|
4962 | if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
|
4963 | setSymbolDesc(this, tag, createDesc(1, value));
|
4964 | };
|
4965 | if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});
|
4966 | return wrap(tag);
|
4967 | };
|
4968 | redefine($Symbol[PROTOTYPE], 'toString', function toString(){
|
4969 | return this._k;
|
4970 | });
|
4971 |
|
4972 | $GOPD.f = $getOwnPropertyDescriptor;
|
4973 | $DP.f = $defineProperty;
|
4974 | _dereq_(72).f = gOPNExt.f = $getOwnPropertyNames;
|
4975 | _dereq_(77).f = $propertyIsEnumerable;
|
4976 | _dereq_(73).f = $getOwnPropertySymbols;
|
4977 |
|
4978 | if(DESCRIPTORS && !_dereq_(58)){
|
4979 | redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
|
4980 | }
|
4981 |
|
4982 | wksExt.f = function(name){
|
4983 | return wrap(wks(name));
|
4984 | }
|
4985 | }
|
4986 |
|
4987 | $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});
|
4988 |
|
4989 | for(var symbols = (
|
4990 |
|
4991 | 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
|
4992 | ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);
|
4993 |
|
4994 | for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);
|
4995 |
|
4996 | $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
|
4997 |
|
4998 | 'for': function(key){
|
4999 | return has(SymbolRegistry, key += '')
|
5000 | ? SymbolRegistry[key]
|
5001 | : SymbolRegistry[key] = $Symbol(key);
|
5002 | },
|
5003 |
|
5004 | keyFor: function keyFor(key){
|
5005 | if(isSymbol(key))return keyOf(SymbolRegistry, key);
|
5006 | throw TypeError(key + ' is not a symbol!');
|
5007 | },
|
5008 | useSetter: function(){ setter = true; },
|
5009 | useSimple: function(){ setter = false; }
|
5010 | });
|
5011 |
|
5012 | $export($export.S + $export.F * !USE_NATIVE, 'Object', {
|
5013 |
|
5014 | create: $create,
|
5015 |
|
5016 | defineProperty: $defineProperty,
|
5017 |
|
5018 | defineProperties: $defineProperties,
|
5019 |
|
5020 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
|
5021 |
|
5022 | getOwnPropertyNames: $getOwnPropertyNames,
|
5023 |
|
5024 | getOwnPropertySymbols: $getOwnPropertySymbols
|
5025 | });
|
5026 |
|
5027 |
|
5028 | $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){
|
5029 | var S = $Symbol();
|
5030 |
|
5031 |
|
5032 |
|
5033 | return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
|
5034 | })), 'JSON', {
|
5035 | stringify: function stringify(it){
|
5036 | if(it === undefined || isSymbol(it))return;
|
5037 | var args = [it]
|
5038 | , i = 1
|
5039 | , replacer, $replacer;
|
5040 | while(arguments.length > i)args.push(arguments[i++]);
|
5041 | replacer = args[1];
|
5042 | if(typeof replacer == 'function')$replacer = replacer;
|
5043 | if($replacer || !isArray(replacer))replacer = function(key, value){
|
5044 | if($replacer)value = $replacer.call(this, key, value);
|
5045 | if(!isSymbol(value))return value;
|
5046 | };
|
5047 | args[1] = replacer;
|
5048 | return _stringify.apply($JSON, args);
|
5049 | }
|
5050 | });
|
5051 |
|
5052 |
|
5053 | $Symbol[PROTOTYPE][TO_PRIMITIVE] || _dereq_(40)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
|
5054 |
|
5055 | setToStringTag($Symbol, 'Symbol');
|
5056 |
|
5057 | setToStringTag(Math, 'Math', true);
|
5058 |
|
5059 | setToStringTag(global.JSON, 'JSON', true);
|
5060 | },{"107":107,"110":110,"114":114,"115":115,"116":116,"117":117,"28":28,"31":31,"32":32,"34":34,"38":38,"39":39,"40":40,"47":47,"57":57,"58":58,"62":62,"66":66,"67":67,"7":7,"70":70,"71":71,"72":72,"73":73,"76":76,"77":77,"85":85,"87":87,"92":92,"94":94}],244:[function(_dereq_,module,exports){
|
5061 | 'use strict';
|
5062 | var $export = _dereq_(32)
|
5063 | , $typed = _dereq_(113)
|
5064 | , buffer = _dereq_(112)
|
5065 | , anObject = _dereq_(7)
|
5066 | , toIndex = _dereq_(105)
|
5067 | , toLength = _dereq_(108)
|
5068 | , isObject = _dereq_(49)
|
5069 | , ArrayBuffer = _dereq_(38).ArrayBuffer
|
5070 | , speciesConstructor = _dereq_(95)
|
5071 | , $ArrayBuffer = buffer.ArrayBuffer
|
5072 | , $DataView = buffer.DataView
|
5073 | , $isView = $typed.ABV && ArrayBuffer.isView
|
5074 | , $slice = $ArrayBuffer.prototype.slice
|
5075 | , VIEW = $typed.VIEW
|
5076 | , ARRAY_BUFFER = 'ArrayBuffer';
|
5077 |
|
5078 | $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), {ArrayBuffer: $ArrayBuffer});
|
5079 |
|
5080 | $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
|
5081 |
|
5082 | isView: function isView(it){
|
5083 | return $isView && $isView(it) || isObject(it) && VIEW in it;
|
5084 | }
|
5085 | });
|
5086 |
|
5087 | $export($export.P + $export.U + $export.F * _dereq_(34)(function(){
|
5088 | return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
|
5089 | }), ARRAY_BUFFER, {
|
5090 |
|
5091 | slice: function slice(start, end){
|
5092 | if($slice !== undefined && end === undefined)return $slice.call(anObject(this), start);
|
5093 | var len = anObject(this).byteLength
|
5094 | , first = toIndex(start, len)
|
5095 | , final = toIndex(end === undefined ? len : end, len)
|
5096 | , result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first))
|
5097 | , viewS = new $DataView(this)
|
5098 | , viewT = new $DataView(result)
|
5099 | , index = 0;
|
5100 | while(first < final){
|
5101 | viewT.setUint8(index++, viewS.getUint8(first++));
|
5102 | } return result;
|
5103 | }
|
5104 | });
|
5105 |
|
5106 | _dereq_(91)(ARRAY_BUFFER);
|
5107 | },{"105":105,"108":108,"112":112,"113":113,"32":32,"34":34,"38":38,"49":49,"7":7,"91":91,"95":95}],245:[function(_dereq_,module,exports){
|
5108 | var $export = _dereq_(32);
|
5109 | $export($export.G + $export.W + $export.F * !_dereq_(113).ABV, {
|
5110 | DataView: _dereq_(112).DataView
|
5111 | });
|
5112 | },{"112":112,"113":113,"32":32}],246:[function(_dereq_,module,exports){
|
5113 | _dereq_(111)('Float32', 4, function(init){
|
5114 | return function Float32Array(data, byteOffset, length){
|
5115 | return init(this, data, byteOffset, length);
|
5116 | };
|
5117 | });
|
5118 | },{"111":111}],247:[function(_dereq_,module,exports){
|
5119 | _dereq_(111)('Float64', 8, function(init){
|
5120 | return function Float64Array(data, byteOffset, length){
|
5121 | return init(this, data, byteOffset, length);
|
5122 | };
|
5123 | });
|
5124 | },{"111":111}],248:[function(_dereq_,module,exports){
|
5125 | _dereq_(111)('Int16', 2, function(init){
|
5126 | return function Int16Array(data, byteOffset, length){
|
5127 | return init(this, data, byteOffset, length);
|
5128 | };
|
5129 | });
|
5130 | },{"111":111}],249:[function(_dereq_,module,exports){
|
5131 | _dereq_(111)('Int32', 4, function(init){
|
5132 | return function Int32Array(data, byteOffset, length){
|
5133 | return init(this, data, byteOffset, length);
|
5134 | };
|
5135 | });
|
5136 | },{"111":111}],250:[function(_dereq_,module,exports){
|
5137 | _dereq_(111)('Int8', 1, function(init){
|
5138 | return function Int8Array(data, byteOffset, length){
|
5139 | return init(this, data, byteOffset, length);
|
5140 | };
|
5141 | });
|
5142 | },{"111":111}],251:[function(_dereq_,module,exports){
|
5143 | _dereq_(111)('Uint16', 2, function(init){
|
5144 | return function Uint16Array(data, byteOffset, length){
|
5145 | return init(this, data, byteOffset, length);
|
5146 | };
|
5147 | });
|
5148 | },{"111":111}],252:[function(_dereq_,module,exports){
|
5149 | _dereq_(111)('Uint32', 4, function(init){
|
5150 | return function Uint32Array(data, byteOffset, length){
|
5151 | return init(this, data, byteOffset, length);
|
5152 | };
|
5153 | });
|
5154 | },{"111":111}],253:[function(_dereq_,module,exports){
|
5155 | _dereq_(111)('Uint8', 1, function(init){
|
5156 | return function Uint8Array(data, byteOffset, length){
|
5157 | return init(this, data, byteOffset, length);
|
5158 | };
|
5159 | });
|
5160 | },{"111":111}],254:[function(_dereq_,module,exports){
|
5161 | _dereq_(111)('Uint8', 1, function(init){
|
5162 | return function Uint8ClampedArray(data, byteOffset, length){
|
5163 | return init(this, data, byteOffset, length);
|
5164 | };
|
5165 | }, true);
|
5166 | },{"111":111}],255:[function(_dereq_,module,exports){
|
5167 | 'use strict';
|
5168 | var each = _dereq_(12)(0)
|
5169 | , redefine = _dereq_(87)
|
5170 | , meta = _dereq_(62)
|
5171 | , assign = _dereq_(65)
|
5172 | , weak = _dereq_(21)
|
5173 | , isObject = _dereq_(49)
|
5174 | , getWeak = meta.getWeak
|
5175 | , isExtensible = Object.isExtensible
|
5176 | , uncaughtFrozenStore = weak.ufstore
|
5177 | , tmp = {}
|
5178 | , InternalMap;
|
5179 |
|
5180 | var wrapper = function(get){
|
5181 | return function WeakMap(){
|
5182 | return get(this, arguments.length > 0 ? arguments[0] : undefined);
|
5183 | };
|
5184 | };
|
5185 |
|
5186 | var methods = {
|
5187 |
|
5188 | get: function get(key){
|
5189 | if(isObject(key)){
|
5190 | var data = getWeak(key);
|
5191 | if(data === true)return uncaughtFrozenStore(this).get(key);
|
5192 | return data ? data[this._i] : undefined;
|
5193 | }
|
5194 | },
|
5195 |
|
5196 | set: function set(key, value){
|
5197 | return weak.def(this, key, value);
|
5198 | }
|
5199 | };
|
5200 |
|
5201 |
|
5202 | var $WeakMap = module.exports = _dereq_(22)('WeakMap', wrapper, methods, weak, true, true);
|
5203 |
|
5204 |
|
5205 | if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){
|
5206 | InternalMap = weak.getConstructor(wrapper);
|
5207 | assign(InternalMap.prototype, methods);
|
5208 | meta.NEED = true;
|
5209 | each(['delete', 'has', 'get', 'set'], function(key){
|
5210 | var proto = $WeakMap.prototype
|
5211 | , method = proto[key];
|
5212 | redefine(proto, key, function(a, b){
|
5213 |
|
5214 | if(isObject(a) && !isExtensible(a)){
|
5215 | if(!this._f)this._f = new InternalMap;
|
5216 | var result = this._f[key](a, b);
|
5217 | return key == 'set' ? this : result;
|
5218 |
|
5219 | } return method.call(this, a, b);
|
5220 | });
|
5221 | });
|
5222 | }
|
5223 | },{"12":12,"21":21,"22":22,"49":49,"62":62,"65":65,"87":87}],256:[function(_dereq_,module,exports){
|
5224 | 'use strict';
|
5225 | var weak = _dereq_(21);
|
5226 |
|
5227 |
|
5228 | _dereq_(22)('WeakSet', function(get){
|
5229 | return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
|
5230 | }, {
|
5231 |
|
5232 | add: function add(value){
|
5233 | return weak.def(this, value, true);
|
5234 | }
|
5235 | }, weak, false, true);
|
5236 | },{"21":21,"22":22}],257:[function(_dereq_,module,exports){
|
5237 | 'use strict';
|
5238 |
|
5239 | var $export = _dereq_(32)
|
5240 | , $includes = _dereq_(11)(true);
|
5241 |
|
5242 | $export($export.P, 'Array', {
|
5243 | includes: function includes(el /*, fromIndex = 0 */){
|
5244 | return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
5245 | }
|
5246 | });
|
5247 |
|
5248 | _dereq_(5)('includes');
|
5249 | },{"11":11,"32":32,"5":5}],258:[function(_dereq_,module,exports){
|
5250 |
|
5251 | var $export = _dereq_(32)
|
5252 | , microtask = _dereq_(64)()
|
5253 | , process = _dereq_(38).process
|
5254 | , isNode = _dereq_(18)(process) == 'process';
|
5255 |
|
5256 | $export($export.G, {
|
5257 | asap: function asap(fn){
|
5258 | var domain = isNode && process.domain;
|
5259 | microtask(domain ? domain.bind(fn) : fn);
|
5260 | }
|
5261 | });
|
5262 | },{"18":18,"32":32,"38":38,"64":64}],259:[function(_dereq_,module,exports){
|
5263 |
|
5264 | var $export = _dereq_(32)
|
5265 | , cof = _dereq_(18);
|
5266 |
|
5267 | $export($export.S, 'Error', {
|
5268 | isError: function isError(it){
|
5269 | return cof(it) === 'Error';
|
5270 | }
|
5271 | });
|
5272 | },{"18":18,"32":32}],260:[function(_dereq_,module,exports){
|
5273 |
|
5274 | var $export = _dereq_(32);
|
5275 |
|
5276 | $export($export.P + $export.R, 'Map', {toJSON: _dereq_(20)('Map')});
|
5277 | },{"20":20,"32":32}],261:[function(_dereq_,module,exports){
|
5278 |
|
5279 | var $export = _dereq_(32);
|
5280 |
|
5281 | $export($export.S, 'Math', {
|
5282 | iaddh: function iaddh(x0, x1, y0, y1){
|
5283 | var $x0 = x0 >>> 0
|
5284 | , $x1 = x1 >>> 0
|
5285 | , $y0 = y0 >>> 0;
|
5286 | return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;
|
5287 | }
|
5288 | });
|
5289 | },{"32":32}],262:[function(_dereq_,module,exports){
|
5290 |
|
5291 | var $export = _dereq_(32);
|
5292 |
|
5293 | $export($export.S, 'Math', {
|
5294 | imulh: function imulh(u, v){
|
5295 | var UINT16 = 0xffff
|
5296 | , $u = +u
|
5297 | , $v = +v
|
5298 | , u0 = $u & UINT16
|
5299 | , v0 = $v & UINT16
|
5300 | , u1 = $u >> 16
|
5301 | , v1 = $v >> 16
|
5302 | , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
|
5303 | return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
|
5304 | }
|
5305 | });
|
5306 | },{"32":32}],263:[function(_dereq_,module,exports){
|
5307 |
|
5308 | var $export = _dereq_(32);
|
5309 |
|
5310 | $export($export.S, 'Math', {
|
5311 | isubh: function isubh(x0, x1, y0, y1){
|
5312 | var $x0 = x0 >>> 0
|
5313 | , $x1 = x1 >>> 0
|
5314 | , $y0 = y0 >>> 0;
|
5315 | return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;
|
5316 | }
|
5317 | });
|
5318 | },{"32":32}],264:[function(_dereq_,module,exports){
|
5319 |
|
5320 | var $export = _dereq_(32);
|
5321 |
|
5322 | $export($export.S, 'Math', {
|
5323 | umulh: function umulh(u, v){
|
5324 | var UINT16 = 0xffff
|
5325 | , $u = +u
|
5326 | , $v = +v
|
5327 | , u0 = $u & UINT16
|
5328 | , v0 = $v & UINT16
|
5329 | , u1 = $u >>> 16
|
5330 | , v1 = $v >>> 16
|
5331 | , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
|
5332 | return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);
|
5333 | }
|
5334 | });
|
5335 | },{"32":32}],265:[function(_dereq_,module,exports){
|
5336 | 'use strict';
|
5337 | var $export = _dereq_(32)
|
5338 | , toObject = _dereq_(109)
|
5339 | , aFunction = _dereq_(3)
|
5340 | , $defineProperty = _dereq_(67);
|
5341 |
|
5342 |
|
5343 | _dereq_(28) && $export($export.P + _dereq_(69), 'Object', {
|
5344 | __defineGetter__: function __defineGetter__(P, getter){
|
5345 | $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true});
|
5346 | }
|
5347 | });
|
5348 | },{"109":109,"28":28,"3":3,"32":32,"67":67,"69":69}],266:[function(_dereq_,module,exports){
|
5349 | 'use strict';
|
5350 | var $export = _dereq_(32)
|
5351 | , toObject = _dereq_(109)
|
5352 | , aFunction = _dereq_(3)
|
5353 | , $defineProperty = _dereq_(67);
|
5354 |
|
5355 |
|
5356 | _dereq_(28) && $export($export.P + _dereq_(69), 'Object', {
|
5357 | __defineSetter__: function __defineSetter__(P, setter){
|
5358 | $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true});
|
5359 | }
|
5360 | });
|
5361 | },{"109":109,"28":28,"3":3,"32":32,"67":67,"69":69}],267:[function(_dereq_,module,exports){
|
5362 |
|
5363 | var $export = _dereq_(32)
|
5364 | , $entries = _dereq_(79)(true);
|
5365 |
|
5366 | $export($export.S, 'Object', {
|
5367 | entries: function entries(it){
|
5368 | return $entries(it);
|
5369 | }
|
5370 | });
|
5371 | },{"32":32,"79":79}],268:[function(_dereq_,module,exports){
|
5372 |
|
5373 | var $export = _dereq_(32)
|
5374 | , ownKeys = _dereq_(80)
|
5375 | , toIObject = _dereq_(107)
|
5376 | , gOPD = _dereq_(70)
|
5377 | , createProperty = _dereq_(24);
|
5378 |
|
5379 | $export($export.S, 'Object', {
|
5380 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){
|
5381 | var O = toIObject(object)
|
5382 | , getDesc = gOPD.f
|
5383 | , keys = ownKeys(O)
|
5384 | , result = {}
|
5385 | , i = 0
|
5386 | , key;
|
5387 | while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key));
|
5388 | return result;
|
5389 | }
|
5390 | });
|
5391 | },{"107":107,"24":24,"32":32,"70":70,"80":80}],269:[function(_dereq_,module,exports){
|
5392 | 'use strict';
|
5393 | var $export = _dereq_(32)
|
5394 | , toObject = _dereq_(109)
|
5395 | , toPrimitive = _dereq_(110)
|
5396 | , getPrototypeOf = _dereq_(74)
|
5397 | , getOwnPropertyDescriptor = _dereq_(70).f;
|
5398 |
|
5399 |
|
5400 | _dereq_(28) && $export($export.P + _dereq_(69), 'Object', {
|
5401 | __lookupGetter__: function __lookupGetter__(P){
|
5402 | var O = toObject(this)
|
5403 | , K = toPrimitive(P, true)
|
5404 | , D;
|
5405 | do {
|
5406 | if(D = getOwnPropertyDescriptor(O, K))return D.get;
|
5407 | } while(O = getPrototypeOf(O));
|
5408 | }
|
5409 | });
|
5410 | },{"109":109,"110":110,"28":28,"32":32,"69":69,"70":70,"74":74}],270:[function(_dereq_,module,exports){
|
5411 | 'use strict';
|
5412 | var $export = _dereq_(32)
|
5413 | , toObject = _dereq_(109)
|
5414 | , toPrimitive = _dereq_(110)
|
5415 | , getPrototypeOf = _dereq_(74)
|
5416 | , getOwnPropertyDescriptor = _dereq_(70).f;
|
5417 |
|
5418 |
|
5419 | _dereq_(28) && $export($export.P + _dereq_(69), 'Object', {
|
5420 | __lookupSetter__: function __lookupSetter__(P){
|
5421 | var O = toObject(this)
|
5422 | , K = toPrimitive(P, true)
|
5423 | , D;
|
5424 | do {
|
5425 | if(D = getOwnPropertyDescriptor(O, K))return D.set;
|
5426 | } while(O = getPrototypeOf(O));
|
5427 | }
|
5428 | });
|
5429 | },{"109":109,"110":110,"28":28,"32":32,"69":69,"70":70,"74":74}],271:[function(_dereq_,module,exports){
|
5430 |
|
5431 | var $export = _dereq_(32)
|
5432 | , $values = _dereq_(79)(false);
|
5433 |
|
5434 | $export($export.S, 'Object', {
|
5435 | values: function values(it){
|
5436 | return $values(it);
|
5437 | }
|
5438 | });
|
5439 | },{"32":32,"79":79}],272:[function(_dereq_,module,exports){
|
5440 | 'use strict';
|
5441 |
|
5442 | var $export = _dereq_(32)
|
5443 | , global = _dereq_(38)
|
5444 | , core = _dereq_(23)
|
5445 | , microtask = _dereq_(64)()
|
5446 | , OBSERVABLE = _dereq_(117)('observable')
|
5447 | , aFunction = _dereq_(3)
|
5448 | , anObject = _dereq_(7)
|
5449 | , anInstance = _dereq_(6)
|
5450 | , redefineAll = _dereq_(86)
|
5451 | , hide = _dereq_(40)
|
5452 | , forOf = _dereq_(37)
|
5453 | , RETURN = forOf.RETURN;
|
5454 |
|
5455 | var getMethod = function(fn){
|
5456 | return fn == null ? undefined : aFunction(fn);
|
5457 | };
|
5458 |
|
5459 | var cleanupSubscription = function(subscription){
|
5460 | var cleanup = subscription._c;
|
5461 | if(cleanup){
|
5462 | subscription._c = undefined;
|
5463 | cleanup();
|
5464 | }
|
5465 | };
|
5466 |
|
5467 | var subscriptionClosed = function(subscription){
|
5468 | return subscription._o === undefined;
|
5469 | };
|
5470 |
|
5471 | var closeSubscription = function(subscription){
|
5472 | if(!subscriptionClosed(subscription)){
|
5473 | subscription._o = undefined;
|
5474 | cleanupSubscription(subscription);
|
5475 | }
|
5476 | };
|
5477 |
|
5478 | var Subscription = function(observer, subscriber){
|
5479 | anObject(observer);
|
5480 | this._c = undefined;
|
5481 | this._o = observer;
|
5482 | observer = new SubscriptionObserver(this);
|
5483 | try {
|
5484 | var cleanup = subscriber(observer)
|
5485 | , subscription = cleanup;
|
5486 | if(cleanup != null){
|
5487 | if(typeof cleanup.unsubscribe === 'function')cleanup = function(){ subscription.unsubscribe(); };
|
5488 | else aFunction(cleanup);
|
5489 | this._c = cleanup;
|
5490 | }
|
5491 | } catch(e){
|
5492 | observer.error(e);
|
5493 | return;
|
5494 | } if(subscriptionClosed(this))cleanupSubscription(this);
|
5495 | };
|
5496 |
|
5497 | Subscription.prototype = redefineAll({}, {
|
5498 | unsubscribe: function unsubscribe(){ closeSubscription(this); }
|
5499 | });
|
5500 |
|
5501 | var SubscriptionObserver = function(subscription){
|
5502 | this._s = subscription;
|
5503 | };
|
5504 |
|
5505 | SubscriptionObserver.prototype = redefineAll({}, {
|
5506 | next: function next(value){
|
5507 | var subscription = this._s;
|
5508 | if(!subscriptionClosed(subscription)){
|
5509 | var observer = subscription._o;
|
5510 | try {
|
5511 | var m = getMethod(observer.next);
|
5512 | if(m)return m.call(observer, value);
|
5513 | } catch(e){
|
5514 | try {
|
5515 | closeSubscription(subscription);
|
5516 | } finally {
|
5517 | throw e;
|
5518 | }
|
5519 | }
|
5520 | }
|
5521 | },
|
5522 | error: function error(value){
|
5523 | var subscription = this._s;
|
5524 | if(subscriptionClosed(subscription))throw value;
|
5525 | var observer = subscription._o;
|
5526 | subscription._o = undefined;
|
5527 | try {
|
5528 | var m = getMethod(observer.error);
|
5529 | if(!m)throw value;
|
5530 | value = m.call(observer, value);
|
5531 | } catch(e){
|
5532 | try {
|
5533 | cleanupSubscription(subscription);
|
5534 | } finally {
|
5535 | throw e;
|
5536 | }
|
5537 | } cleanupSubscription(subscription);
|
5538 | return value;
|
5539 | },
|
5540 | complete: function complete(value){
|
5541 | var subscription = this._s;
|
5542 | if(!subscriptionClosed(subscription)){
|
5543 | var observer = subscription._o;
|
5544 | subscription._o = undefined;
|
5545 | try {
|
5546 | var m = getMethod(observer.complete);
|
5547 | value = m ? m.call(observer, value) : undefined;
|
5548 | } catch(e){
|
5549 | try {
|
5550 | cleanupSubscription(subscription);
|
5551 | } finally {
|
5552 | throw e;
|
5553 | }
|
5554 | } cleanupSubscription(subscription);
|
5555 | return value;
|
5556 | }
|
5557 | }
|
5558 | });
|
5559 |
|
5560 | var $Observable = function Observable(subscriber){
|
5561 | anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);
|
5562 | };
|
5563 |
|
5564 | redefineAll($Observable.prototype, {
|
5565 | subscribe: function subscribe(observer){
|
5566 | return new Subscription(observer, this._f);
|
5567 | },
|
5568 | forEach: function forEach(fn){
|
5569 | var that = this;
|
5570 | return new (core.Promise || global.Promise)(function(resolve, reject){
|
5571 | aFunction(fn);
|
5572 | var subscription = that.subscribe({
|
5573 | next : function(value){
|
5574 | try {
|
5575 | return fn(value);
|
5576 | } catch(e){
|
5577 | reject(e);
|
5578 | subscription.unsubscribe();
|
5579 | }
|
5580 | },
|
5581 | error: reject,
|
5582 | complete: resolve
|
5583 | });
|
5584 | });
|
5585 | }
|
5586 | });
|
5587 |
|
5588 | redefineAll($Observable, {
|
5589 | from: function from(x){
|
5590 | var C = typeof this === 'function' ? this : $Observable;
|
5591 | var method = getMethod(anObject(x)[OBSERVABLE]);
|
5592 | if(method){
|
5593 | var observable = anObject(method.call(x));
|
5594 | return observable.constructor === C ? observable : new C(function(observer){
|
5595 | return observable.subscribe(observer);
|
5596 | });
|
5597 | }
|
5598 | return new C(function(observer){
|
5599 | var done = false;
|
5600 | microtask(function(){
|
5601 | if(!done){
|
5602 | try {
|
5603 | if(forOf(x, false, function(it){
|
5604 | observer.next(it);
|
5605 | if(done)return RETURN;
|
5606 | }) === RETURN)return;
|
5607 | } catch(e){
|
5608 | if(done)throw e;
|
5609 | observer.error(e);
|
5610 | return;
|
5611 | } observer.complete();
|
5612 | }
|
5613 | });
|
5614 | return function(){ done = true; };
|
5615 | });
|
5616 | },
|
5617 | of: function of(){
|
5618 | for(var i = 0, l = arguments.length, items = Array(l); i < l;)items[i] = arguments[i++];
|
5619 | return new (typeof this === 'function' ? this : $Observable)(function(observer){
|
5620 | var done = false;
|
5621 | microtask(function(){
|
5622 | if(!done){
|
5623 | for(var i = 0; i < items.length; ++i){
|
5624 | observer.next(items[i]);
|
5625 | if(done)return;
|
5626 | } observer.complete();
|
5627 | }
|
5628 | });
|
5629 | return function(){ done = true; };
|
5630 | });
|
5631 | }
|
5632 | });
|
5633 |
|
5634 | hide($Observable.prototype, OBSERVABLE, function(){ return this; });
|
5635 |
|
5636 | $export($export.G, {Observable: $Observable});
|
5637 |
|
5638 | _dereq_(91)('Observable');
|
5639 | },{"117":117,"23":23,"3":3,"32":32,"37":37,"38":38,"40":40,"6":6,"64":64,"7":7,"86":86,"91":91}],273:[function(_dereq_,module,exports){
|
5640 | var metadata = _dereq_(63)
|
5641 | , anObject = _dereq_(7)
|
5642 | , toMetaKey = metadata.key
|
5643 | , ordinaryDefineOwnMetadata = metadata.set;
|
5644 |
|
5645 | metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){
|
5646 | ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
|
5647 | }});
|
5648 | },{"63":63,"7":7}],274:[function(_dereq_,module,exports){
|
5649 | var metadata = _dereq_(63)
|
5650 | , anObject = _dereq_(7)
|
5651 | , toMetaKey = metadata.key
|
5652 | , getOrCreateMetadataMap = metadata.map
|
5653 | , store = metadata.store;
|
5654 |
|
5655 | metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, targetKey */){
|
5656 | var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2])
|
5657 | , metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
|
5658 | if(metadataMap === undefined || !metadataMap['delete'](metadataKey))return false;
|
5659 | if(metadataMap.size)return true;
|
5660 | var targetMetadata = store.get(target);
|
5661 | targetMetadata['delete'](targetKey);
|
5662 | return !!targetMetadata.size || store['delete'](target);
|
5663 | }});
|
5664 | },{"63":63,"7":7}],275:[function(_dereq_,module,exports){
|
5665 | var Set = _dereq_(220)
|
5666 | , from = _dereq_(10)
|
5667 | , metadata = _dereq_(63)
|
5668 | , anObject = _dereq_(7)
|
5669 | , getPrototypeOf = _dereq_(74)
|
5670 | , ordinaryOwnMetadataKeys = metadata.keys
|
5671 | , toMetaKey = metadata.key;
|
5672 |
|
5673 | var ordinaryMetadataKeys = function(O, P){
|
5674 | var oKeys = ordinaryOwnMetadataKeys(O, P)
|
5675 | , parent = getPrototypeOf(O);
|
5676 | if(parent === null)return oKeys;
|
5677 | var pKeys = ordinaryMetadataKeys(parent, P);
|
5678 | return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
|
5679 | };
|
5680 |
|
5681 | metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){
|
5682 | return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
|
5683 | }});
|
5684 | },{"10":10,"220":220,"63":63,"7":7,"74":74}],276:[function(_dereq_,module,exports){
|
5685 | var metadata = _dereq_(63)
|
5686 | , anObject = _dereq_(7)
|
5687 | , getPrototypeOf = _dereq_(74)
|
5688 | , ordinaryHasOwnMetadata = metadata.has
|
5689 | , ordinaryGetOwnMetadata = metadata.get
|
5690 | , toMetaKey = metadata.key;
|
5691 |
|
5692 | var ordinaryGetMetadata = function(MetadataKey, O, P){
|
5693 | var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
|
5694 | if(hasOwn)return ordinaryGetOwnMetadata(MetadataKey, O, P);
|
5695 | var parent = getPrototypeOf(O);
|
5696 | return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
|
5697 | };
|
5698 |
|
5699 | metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){
|
5700 | return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
|
5701 | }});
|
5702 | },{"63":63,"7":7,"74":74}],277:[function(_dereq_,module,exports){
|
5703 | var metadata = _dereq_(63)
|
5704 | , anObject = _dereq_(7)
|
5705 | , ordinaryOwnMetadataKeys = metadata.keys
|
5706 | , toMetaKey = metadata.key;
|
5707 |
|
5708 | metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){
|
5709 | return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
|
5710 | }});
|
5711 | },{"63":63,"7":7}],278:[function(_dereq_,module,exports){
|
5712 | var metadata = _dereq_(63)
|
5713 | , anObject = _dereq_(7)
|
5714 | , ordinaryGetOwnMetadata = metadata.get
|
5715 | , toMetaKey = metadata.key;
|
5716 |
|
5717 | metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, targetKey */){
|
5718 | return ordinaryGetOwnMetadata(metadataKey, anObject(target)
|
5719 | , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
|
5720 | }});
|
5721 | },{"63":63,"7":7}],279:[function(_dereq_,module,exports){
|
5722 | var metadata = _dereq_(63)
|
5723 | , anObject = _dereq_(7)
|
5724 | , getPrototypeOf = _dereq_(74)
|
5725 | , ordinaryHasOwnMetadata = metadata.has
|
5726 | , toMetaKey = metadata.key;
|
5727 |
|
5728 | var ordinaryHasMetadata = function(MetadataKey, O, P){
|
5729 | var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
|
5730 | if(hasOwn)return true;
|
5731 | var parent = getPrototypeOf(O);
|
5732 | return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
|
5733 | };
|
5734 |
|
5735 | metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){
|
5736 | return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
|
5737 | }});
|
5738 | },{"63":63,"7":7,"74":74}],280:[function(_dereq_,module,exports){
|
5739 | var metadata = _dereq_(63)
|
5740 | , anObject = _dereq_(7)
|
5741 | , ordinaryHasOwnMetadata = metadata.has
|
5742 | , toMetaKey = metadata.key;
|
5743 |
|
5744 | metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, targetKey */){
|
5745 | return ordinaryHasOwnMetadata(metadataKey, anObject(target)
|
5746 | , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
|
5747 | }});
|
5748 | },{"63":63,"7":7}],281:[function(_dereq_,module,exports){
|
5749 | var metadata = _dereq_(63)
|
5750 | , anObject = _dereq_(7)
|
5751 | , aFunction = _dereq_(3)
|
5752 | , toMetaKey = metadata.key
|
5753 | , ordinaryDefineOwnMetadata = metadata.set;
|
5754 |
|
5755 | metadata.exp({metadata: function metadata(metadataKey, metadataValue){
|
5756 | return function decorator(target, targetKey){
|
5757 | ordinaryDefineOwnMetadata(
|
5758 | metadataKey, metadataValue,
|
5759 | (targetKey !== undefined ? anObject : aFunction)(target),
|
5760 | toMetaKey(targetKey)
|
5761 | );
|
5762 | };
|
5763 | }});
|
5764 | },{"3":3,"63":63,"7":7}],282:[function(_dereq_,module,exports){
|
5765 |
|
5766 | var $export = _dereq_(32);
|
5767 |
|
5768 | $export($export.P + $export.R, 'Set', {toJSON: _dereq_(20)('Set')});
|
5769 | },{"20":20,"32":32}],283:[function(_dereq_,module,exports){
|
5770 | 'use strict';
|
5771 |
|
5772 | var $export = _dereq_(32)
|
5773 | , $at = _dereq_(97)(true);
|
5774 |
|
5775 | $export($export.P, 'String', {
|
5776 | at: function at(pos){
|
5777 | return $at(this, pos);
|
5778 | }
|
5779 | });
|
5780 | },{"32":32,"97":97}],284:[function(_dereq_,module,exports){
|
5781 | 'use strict';
|
5782 |
|
5783 | var $export = _dereq_(32)
|
5784 | , defined = _dereq_(27)
|
5785 | , toLength = _dereq_(108)
|
5786 | , isRegExp = _dereq_(50)
|
5787 | , getFlags = _dereq_(36)
|
5788 | , RegExpProto = RegExp.prototype;
|
5789 |
|
5790 | var $RegExpStringIterator = function(regexp, string){
|
5791 | this._r = regexp;
|
5792 | this._s = string;
|
5793 | };
|
5794 |
|
5795 | _dereq_(52)($RegExpStringIterator, 'RegExp String', function next(){
|
5796 | var match = this._r.exec(this._s);
|
5797 | return {value: match, done: match === null};
|
5798 | });
|
5799 |
|
5800 | $export($export.P, 'String', {
|
5801 | matchAll: function matchAll(regexp){
|
5802 | defined(this);
|
5803 | if(!isRegExp(regexp))throw TypeError(regexp + ' is not a regexp!');
|
5804 | var S = String(this)
|
5805 | , flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp)
|
5806 | , rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
|
5807 | rx.lastIndex = toLength(regexp.lastIndex);
|
5808 | return new $RegExpStringIterator(rx, S);
|
5809 | }
|
5810 | });
|
5811 | },{"108":108,"27":27,"32":32,"36":36,"50":50,"52":52}],285:[function(_dereq_,module,exports){
|
5812 | 'use strict';
|
5813 |
|
5814 | var $export = _dereq_(32)
|
5815 | , $pad = _dereq_(100);
|
5816 |
|
5817 | $export($export.P, 'String', {
|
5818 | padEnd: function padEnd(maxLength /*, fillString = ' ' */){
|
5819 | return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
|
5820 | }
|
5821 | });
|
5822 | },{"100":100,"32":32}],286:[function(_dereq_,module,exports){
|
5823 | 'use strict';
|
5824 |
|
5825 | var $export = _dereq_(32)
|
5826 | , $pad = _dereq_(100);
|
5827 |
|
5828 | $export($export.P, 'String', {
|
5829 | padStart: function padStart(maxLength /*, fillString = ' ' */){
|
5830 | return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
|
5831 | }
|
5832 | });
|
5833 | },{"100":100,"32":32}],287:[function(_dereq_,module,exports){
|
5834 | 'use strict';
|
5835 |
|
5836 | _dereq_(102)('trimLeft', function($trim){
|
5837 | return function trimLeft(){
|
5838 | return $trim(this, 1);
|
5839 | };
|
5840 | }, 'trimStart');
|
5841 | },{"102":102}],288:[function(_dereq_,module,exports){
|
5842 | 'use strict';
|
5843 |
|
5844 | _dereq_(102)('trimRight', function($trim){
|
5845 | return function trimRight(){
|
5846 | return $trim(this, 2);
|
5847 | };
|
5848 | }, 'trimEnd');
|
5849 | },{"102":102}],289:[function(_dereq_,module,exports){
|
5850 | _dereq_(115)('asyncIterator');
|
5851 | },{"115":115}],290:[function(_dereq_,module,exports){
|
5852 | _dereq_(115)('observable');
|
5853 | },{"115":115}],291:[function(_dereq_,module,exports){
|
5854 |
|
5855 | var $export = _dereq_(32);
|
5856 |
|
5857 | $export($export.S, 'System', {global: _dereq_(38)});
|
5858 | },{"32":32,"38":38}],292:[function(_dereq_,module,exports){
|
5859 | var $iterators = _dereq_(130)
|
5860 | , redefine = _dereq_(87)
|
5861 | , global = _dereq_(38)
|
5862 | , hide = _dereq_(40)
|
5863 | , Iterators = _dereq_(56)
|
5864 | , wks = _dereq_(117)
|
5865 | , ITERATOR = wks('iterator')
|
5866 | , TO_STRING_TAG = wks('toStringTag')
|
5867 | , ArrayValues = Iterators.Array;
|
5868 |
|
5869 | for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
|
5870 | var NAME = collections[i]
|
5871 | , Collection = global[NAME]
|
5872 | , proto = Collection && Collection.prototype
|
5873 | , key;
|
5874 | if(proto){
|
5875 | if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues);
|
5876 | if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
|
5877 | Iterators[NAME] = ArrayValues;
|
5878 | for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true);
|
5879 | }
|
5880 | }
|
5881 | },{"117":117,"130":130,"38":38,"40":40,"56":56,"87":87}],293:[function(_dereq_,module,exports){
|
5882 | var $export = _dereq_(32)
|
5883 | , $task = _dereq_(104);
|
5884 | $export($export.G + $export.B, {
|
5885 | setImmediate: $task.set,
|
5886 | clearImmediate: $task.clear
|
5887 | });
|
5888 | },{"104":104,"32":32}],294:[function(_dereq_,module,exports){
|
5889 |
|
5890 | var global = _dereq_(38)
|
5891 | , $export = _dereq_(32)
|
5892 | , invoke = _dereq_(44)
|
5893 | , partial = _dereq_(83)
|
5894 | , navigator = global.navigator
|
5895 | , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent);
|
5896 | var wrap = function(set){
|
5897 | return MSIE ? function(fn, time /*, ...args */){
|
5898 | return set(invoke(
|
5899 | partial,
|
5900 | [].slice.call(arguments, 2),
|
5901 | typeof fn == 'function' ? fn : Function(fn)
|
5902 | ), time);
|
5903 | } : set;
|
5904 | };
|
5905 | $export($export.G + $export.B + $export.F * MSIE, {
|
5906 | setTimeout: wrap(global.setTimeout),
|
5907 | setInterval: wrap(global.setInterval)
|
5908 | });
|
5909 | },{"32":32,"38":38,"44":44,"83":83}],295:[function(_dereq_,module,exports){
|
5910 | _dereq_(243);
|
5911 | _dereq_(180);
|
5912 | _dereq_(182);
|
5913 | _dereq_(181);
|
5914 | _dereq_(184);
|
5915 | _dereq_(186);
|
5916 | _dereq_(191);
|
5917 | _dereq_(185);
|
5918 | _dereq_(183);
|
5919 | _dereq_(193);
|
5920 | _dereq_(192);
|
5921 | _dereq_(188);
|
5922 | _dereq_(189);
|
5923 | _dereq_(187);
|
5924 | _dereq_(179);
|
5925 | _dereq_(190);
|
5926 | _dereq_(194);
|
5927 | _dereq_(195);
|
5928 | _dereq_(146);
|
5929 | _dereq_(148);
|
5930 | _dereq_(147);
|
5931 | _dereq_(197);
|
5932 | _dereq_(196);
|
5933 | _dereq_(167);
|
5934 | _dereq_(177);
|
5935 | _dereq_(178);
|
5936 | _dereq_(168);
|
5937 | _dereq_(169);
|
5938 | _dereq_(170);
|
5939 | _dereq_(171);
|
5940 | _dereq_(172);
|
5941 | _dereq_(173);
|
5942 | _dereq_(174);
|
5943 | _dereq_(175);
|
5944 | _dereq_(176);
|
5945 | _dereq_(150);
|
5946 | _dereq_(151);
|
5947 | _dereq_(152);
|
5948 | _dereq_(153);
|
5949 | _dereq_(154);
|
5950 | _dereq_(155);
|
5951 | _dereq_(156);
|
5952 | _dereq_(157);
|
5953 | _dereq_(158);
|
5954 | _dereq_(159);
|
5955 | _dereq_(160);
|
5956 | _dereq_(161);
|
5957 | _dereq_(162);
|
5958 | _dereq_(163);
|
5959 | _dereq_(164);
|
5960 | _dereq_(165);
|
5961 | _dereq_(166);
|
5962 | _dereq_(230);
|
5963 | _dereq_(235);
|
5964 | _dereq_(242);
|
5965 | _dereq_(233);
|
5966 | _dereq_(225);
|
5967 | _dereq_(226);
|
5968 | _dereq_(231);
|
5969 | _dereq_(236);
|
5970 | _dereq_(238);
|
5971 | _dereq_(221);
|
5972 | _dereq_(222);
|
5973 | _dereq_(223);
|
5974 | _dereq_(224);
|
5975 | _dereq_(227);
|
5976 | _dereq_(228);
|
5977 | _dereq_(229);
|
5978 | _dereq_(232);
|
5979 | _dereq_(234);
|
5980 | _dereq_(237);
|
5981 | _dereq_(239);
|
5982 | _dereq_(240);
|
5983 | _dereq_(241);
|
5984 | _dereq_(141);
|
5985 | _dereq_(143);
|
5986 | _dereq_(142);
|
5987 | _dereq_(145);
|
5988 | _dereq_(144);
|
5989 | _dereq_(129);
|
5990 | _dereq_(127);
|
5991 | _dereq_(134);
|
5992 | _dereq_(131);
|
5993 | _dereq_(137);
|
5994 | _dereq_(139);
|
5995 | _dereq_(126);
|
5996 | _dereq_(133);
|
5997 | _dereq_(123);
|
5998 | _dereq_(138);
|
5999 | _dereq_(121);
|
6000 | _dereq_(136);
|
6001 | _dereq_(135);
|
6002 | _dereq_(128);
|
6003 | _dereq_(132);
|
6004 | _dereq_(120);
|
6005 | _dereq_(122);
|
6006 | _dereq_(125);
|
6007 | _dereq_(124);
|
6008 | _dereq_(140);
|
6009 | _dereq_(130);
|
6010 | _dereq_(213);
|
6011 | _dereq_(219);
|
6012 | _dereq_(214);
|
6013 | _dereq_(215);
|
6014 | _dereq_(216);
|
6015 | _dereq_(217);
|
6016 | _dereq_(218);
|
6017 | _dereq_(198);
|
6018 | _dereq_(149);
|
6019 | _dereq_(220);
|
6020 | _dereq_(255);
|
6021 | _dereq_(256);
|
6022 | _dereq_(244);
|
6023 | _dereq_(245);
|
6024 | _dereq_(250);
|
6025 | _dereq_(253);
|
6026 | _dereq_(254);
|
6027 | _dereq_(248);
|
6028 | _dereq_(251);
|
6029 | _dereq_(249);
|
6030 | _dereq_(252);
|
6031 | _dereq_(246);
|
6032 | _dereq_(247);
|
6033 | _dereq_(199);
|
6034 | _dereq_(200);
|
6035 | _dereq_(201);
|
6036 | _dereq_(202);
|
6037 | _dereq_(203);
|
6038 | _dereq_(206);
|
6039 | _dereq_(204);
|
6040 | _dereq_(205);
|
6041 | _dereq_(207);
|
6042 | _dereq_(208);
|
6043 | _dereq_(209);
|
6044 | _dereq_(210);
|
6045 | _dereq_(212);
|
6046 | _dereq_(211);
|
6047 | _dereq_(257);
|
6048 | _dereq_(283);
|
6049 | _dereq_(286);
|
6050 | _dereq_(285);
|
6051 | _dereq_(287);
|
6052 | _dereq_(288);
|
6053 | _dereq_(284);
|
6054 | _dereq_(289);
|
6055 | _dereq_(290);
|
6056 | _dereq_(268);
|
6057 | _dereq_(271);
|
6058 | _dereq_(267);
|
6059 | _dereq_(265);
|
6060 | _dereq_(266);
|
6061 | _dereq_(269);
|
6062 | _dereq_(270);
|
6063 | _dereq_(260);
|
6064 | _dereq_(282);
|
6065 | _dereq_(291);
|
6066 | _dereq_(259);
|
6067 | _dereq_(261);
|
6068 | _dereq_(263);
|
6069 | _dereq_(262);
|
6070 | _dereq_(264);
|
6071 | _dereq_(273);
|
6072 | _dereq_(274);
|
6073 | _dereq_(276);
|
6074 | _dereq_(275);
|
6075 | _dereq_(278);
|
6076 | _dereq_(277);
|
6077 | _dereq_(279);
|
6078 | _dereq_(280);
|
6079 | _dereq_(281);
|
6080 | _dereq_(258);
|
6081 | _dereq_(272);
|
6082 | _dereq_(294);
|
6083 | _dereq_(293);
|
6084 | _dereq_(292);
|
6085 | module.exports = _dereq_(23);
|
6086 | },{"120":120,"121":121,"122":122,"123":123,"124":124,"125":125,"126":126,"127":127,"128":128,"129":129,"130":130,"131":131,"132":132,"133":133,"134":134,"135":135,"136":136,"137":137,"138":138,"139":139,"140":140,"141":141,"142":142,"143":143,"144":144,"145":145,"146":146,"147":147,"148":148,"149":149,"150":150,"151":151,"152":152,"153":153,"154":154,"155":155,"156":156,"157":157,"158":158,"159":159,"160":160,"161":161,"162":162,"163":163,"164":164,"165":165,"166":166,"167":167,"168":168,"169":169,"170":170,"171":171,"172":172,"173":173,"174":174,"175":175,"176":176,"177":177,"178":178,"179":179,"180":180,"181":181,"182":182,"183":183,"184":184,"185":185,"186":186,"187":187,"188":188,"189":189,"190":190,"191":191,"192":192,"193":193,"194":194,"195":195,"196":196,"197":197,"198":198,"199":199,"200":200,"201":201,"202":202,"203":203,"204":204,"205":205,"206":206,"207":207,"208":208,"209":209,"210":210,"211":211,"212":212,"213":213,"214":214,"215":215,"216":216,"217":217,"218":218,"219":219,"220":220,"221":221,"222":222,"223":223,"224":224,"225":225,"226":226,"227":227,"228":228,"229":229,"23":23,"230":230,"231":231,"232":232,"233":233,"234":234,"235":235,"236":236,"237":237,"238":238,"239":239,"240":240,"241":241,"242":242,"243":243,"244":244,"245":245,"246":246,"247":247,"248":248,"249":249,"250":250,"251":251,"252":252,"253":253,"254":254,"255":255,"256":256,"257":257,"258":258,"259":259,"260":260,"261":261,"262":262,"263":263,"264":264,"265":265,"266":266,"267":267,"268":268,"269":269,"270":270,"271":271,"272":272,"273":273,"274":274,"275":275,"276":276,"277":277,"278":278,"279":279,"280":280,"281":281,"282":282,"283":283,"284":284,"285":285,"286":286,"287":287,"288":288,"289":289,"290":290,"291":291,"292":292,"293":293,"294":294}],296:[function(_dereq_,module,exports){
|
6087 | (function (global){
|
6088 |
|
6089 |
|
6090 |
|
6091 |
|
6092 |
|
6093 |
|
6094 |
|
6095 |
|
6096 |
|
6097 |
|
6098 | !(function(global) {
|
6099 | "use strict";
|
6100 |
|
6101 | var hasOwn = Object.prototype.hasOwnProperty;
|
6102 | var undefined;
|
6103 | var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
6104 | var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
6105 | var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
6106 |
|
6107 | var inModule = typeof module === "object";
|
6108 | var runtime = global.regeneratorRuntime;
|
6109 | if (runtime) {
|
6110 | if (inModule) {
|
6111 |
|
6112 |
|
6113 | module.exports = runtime;
|
6114 | }
|
6115 |
|
6116 |
|
6117 | return;
|
6118 | }
|
6119 |
|
6120 |
|
6121 |
|
6122 | runtime = global.regeneratorRuntime = inModule ? module.exports : {};
|
6123 |
|
6124 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
6125 |
|
6126 | var generator = Object.create((outerFn || Generator).prototype);
|
6127 | var context = new Context(tryLocsList || []);
|
6128 |
|
6129 |
|
6130 |
|
6131 | generator._invoke = makeInvokeMethod(innerFn, self, context);
|
6132 |
|
6133 | return generator;
|
6134 | }
|
6135 | runtime.wrap = wrap;
|
6136 |
|
6137 |
|
6138 |
|
6139 |
|
6140 |
|
6141 |
|
6142 |
|
6143 |
|
6144 |
|
6145 |
|
6146 |
|
6147 | function tryCatch(fn, obj, arg) {
|
6148 | try {
|
6149 | return { type: "normal", arg: fn.call(obj, arg) };
|
6150 | } catch (err) {
|
6151 | return { type: "throw", arg: err };
|
6152 | }
|
6153 | }
|
6154 |
|
6155 | var GenStateSuspendedStart = "suspendedStart";
|
6156 | var GenStateSuspendedYield = "suspendedYield";
|
6157 | var GenStateExecuting = "executing";
|
6158 | var GenStateCompleted = "completed";
|
6159 |
|
6160 |
|
6161 |
|
6162 | var ContinueSentinel = {};
|
6163 |
|
6164 |
|
6165 |
|
6166 |
|
6167 |
|
6168 | function Generator() {}
|
6169 | function GeneratorFunction() {}
|
6170 | function GeneratorFunctionPrototype() {}
|
6171 |
|
6172 | var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype;
|
6173 | GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
6174 | GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
6175 | GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction";
|
6176 |
|
6177 |
|
6178 |
|
6179 | function defineIteratorMethods(prototype) {
|
6180 | ["next", "throw", "return"].forEach(function(method) {
|
6181 | prototype[method] = function(arg) {
|
6182 | return this._invoke(method, arg);
|
6183 | };
|
6184 | });
|
6185 | }
|
6186 |
|
6187 | runtime.isGeneratorFunction = function(genFun) {
|
6188 | var ctor = typeof genFun === "function" && genFun.constructor;
|
6189 | return ctor
|
6190 | ? ctor === GeneratorFunction ||
|
6191 |
|
6192 |
|
6193 | (ctor.displayName || ctor.name) === "GeneratorFunction"
|
6194 | : false;
|
6195 | };
|
6196 |
|
6197 | runtime.mark = function(genFun) {
|
6198 | if (Object.setPrototypeOf) {
|
6199 | Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
6200 | } else {
|
6201 | genFun.__proto__ = GeneratorFunctionPrototype;
|
6202 | if (!(toStringTagSymbol in genFun)) {
|
6203 | genFun[toStringTagSymbol] = "GeneratorFunction";
|
6204 | }
|
6205 | }
|
6206 | genFun.prototype = Object.create(Gp);
|
6207 | return genFun;
|
6208 | };
|
6209 |
|
6210 |
|
6211 |
|
6212 |
|
6213 |
|
6214 |
|
6215 | runtime.awrap = function(arg) {
|
6216 | return new AwaitArgument(arg);
|
6217 | };
|
6218 |
|
6219 | function AwaitArgument(arg) {
|
6220 | this.arg = arg;
|
6221 | }
|
6222 |
|
6223 | function AsyncIterator(generator) {
|
6224 | function invoke(method, arg, resolve, reject) {
|
6225 | var record = tryCatch(generator[method], generator, arg);
|
6226 | if (record.type === "throw") {
|
6227 | reject(record.arg);
|
6228 | } else {
|
6229 | var result = record.arg;
|
6230 | var value = result.value;
|
6231 | if (value instanceof AwaitArgument) {
|
6232 | return Promise.resolve(value.arg).then(function(value) {
|
6233 | invoke("next", value, resolve, reject);
|
6234 | }, function(err) {
|
6235 | invoke("throw", err, resolve, reject);
|
6236 | });
|
6237 | }
|
6238 |
|
6239 | return Promise.resolve(value).then(function(unwrapped) {
|
6240 |
|
6241 |
|
6242 |
|
6243 |
|
6244 |
|
6245 |
|
6246 |
|
6247 |
|
6248 |
|
6249 |
|
6250 |
|
6251 |
|
6252 |
|
6253 |
|
6254 |
|
6255 | result.value = unwrapped;
|
6256 | resolve(result);
|
6257 | }, reject);
|
6258 | }
|
6259 | }
|
6260 |
|
6261 | if (typeof process === "object" && process.domain) {
|
6262 | invoke = process.domain.bind(invoke);
|
6263 | }
|
6264 |
|
6265 | var previousPromise;
|
6266 |
|
6267 | function enqueue(method, arg) {
|
6268 | function callInvokeWithMethodAndArg() {
|
6269 | return new Promise(function(resolve, reject) {
|
6270 | invoke(method, arg, resolve, reject);
|
6271 | });
|
6272 | }
|
6273 |
|
6274 | return previousPromise =
|
6275 |
|
6276 |
|
6277 |
|
6278 |
|
6279 |
|
6280 |
|
6281 |
|
6282 |
|
6283 |
|
6284 |
|
6285 |
|
6286 |
|
6287 | previousPromise ? previousPromise.then(
|
6288 | callInvokeWithMethodAndArg,
|
6289 |
|
6290 |
|
6291 | callInvokeWithMethodAndArg
|
6292 | ) : callInvokeWithMethodAndArg();
|
6293 | }
|
6294 |
|
6295 |
|
6296 |
|
6297 | this._invoke = enqueue;
|
6298 | }
|
6299 |
|
6300 | defineIteratorMethods(AsyncIterator.prototype);
|
6301 |
|
6302 |
|
6303 |
|
6304 |
|
6305 | runtime.async = function(innerFn, outerFn, self, tryLocsList) {
|
6306 | var iter = new AsyncIterator(
|
6307 | wrap(innerFn, outerFn, self, tryLocsList)
|
6308 | );
|
6309 |
|
6310 | return runtime.isGeneratorFunction(outerFn)
|
6311 | ? iter
|
6312 | : iter.next().then(function(result) {
|
6313 | return result.done ? result.value : iter.next();
|
6314 | });
|
6315 | };
|
6316 |
|
6317 | function makeInvokeMethod(innerFn, self, context) {
|
6318 | var state = GenStateSuspendedStart;
|
6319 |
|
6320 | return function invoke(method, arg) {
|
6321 | if (state === GenStateExecuting) {
|
6322 | throw new Error("Generator is already running");
|
6323 | }
|
6324 |
|
6325 | if (state === GenStateCompleted) {
|
6326 | if (method === "throw") {
|
6327 | throw arg;
|
6328 | }
|
6329 |
|
6330 |
|
6331 |
|
6332 | return doneResult();
|
6333 | }
|
6334 |
|
6335 | while (true) {
|
6336 | var delegate = context.delegate;
|
6337 | if (delegate) {
|
6338 | if (method === "return" ||
|
6339 | (method === "throw" && delegate.iterator[method] === undefined)) {
|
6340 |
|
6341 |
|
6342 | context.delegate = null;
|
6343 |
|
6344 |
|
6345 |
|
6346 | var returnMethod = delegate.iterator["return"];
|
6347 | if (returnMethod) {
|
6348 | var record = tryCatch(returnMethod, delegate.iterator, arg);
|
6349 | if (record.type === "throw") {
|
6350 |
|
6351 |
|
6352 | method = "throw";
|
6353 | arg = record.arg;
|
6354 | continue;
|
6355 | }
|
6356 | }
|
6357 |
|
6358 | if (method === "return") {
|
6359 |
|
6360 |
|
6361 | continue;
|
6362 | }
|
6363 | }
|
6364 |
|
6365 | var record = tryCatch(
|
6366 | delegate.iterator[method],
|
6367 | delegate.iterator,
|
6368 | arg
|
6369 | );
|
6370 |
|
6371 | if (record.type === "throw") {
|
6372 | context.delegate = null;
|
6373 |
|
6374 |
|
6375 |
|
6376 | method = "throw";
|
6377 | arg = record.arg;
|
6378 | continue;
|
6379 | }
|
6380 |
|
6381 |
|
6382 |
|
6383 |
|
6384 | method = "next";
|
6385 | arg = undefined;
|
6386 |
|
6387 | var info = record.arg;
|
6388 | if (info.done) {
|
6389 | context[delegate.resultName] = info.value;
|
6390 | context.next = delegate.nextLoc;
|
6391 | } else {
|
6392 | state = GenStateSuspendedYield;
|
6393 | return info;
|
6394 | }
|
6395 |
|
6396 | context.delegate = null;
|
6397 | }
|
6398 |
|
6399 | if (method === "next") {
|
6400 |
|
6401 |
|
6402 | context.sent = context._sent = arg;
|
6403 |
|
6404 | } else if (method === "throw") {
|
6405 | if (state === GenStateSuspendedStart) {
|
6406 | state = GenStateCompleted;
|
6407 | throw arg;
|
6408 | }
|
6409 |
|
6410 | if (context.dispatchException(arg)) {
|
6411 |
|
6412 |
|
6413 | method = "next";
|
6414 | arg = undefined;
|
6415 | }
|
6416 |
|
6417 | } else if (method === "return") {
|
6418 | context.abrupt("return", arg);
|
6419 | }
|
6420 |
|
6421 | state = GenStateExecuting;
|
6422 |
|
6423 | var record = tryCatch(innerFn, self, context);
|
6424 | if (record.type === "normal") {
|
6425 |
|
6426 |
|
6427 | state = context.done
|
6428 | ? GenStateCompleted
|
6429 | : GenStateSuspendedYield;
|
6430 |
|
6431 | var info = {
|
6432 | value: record.arg,
|
6433 | done: context.done
|
6434 | };
|
6435 |
|
6436 | if (record.arg === ContinueSentinel) {
|
6437 | if (context.delegate && method === "next") {
|
6438 |
|
6439 |
|
6440 | arg = undefined;
|
6441 | }
|
6442 | } else {
|
6443 | return info;
|
6444 | }
|
6445 |
|
6446 | } else if (record.type === "throw") {
|
6447 | state = GenStateCompleted;
|
6448 |
|
6449 |
|
6450 | method = "throw";
|
6451 | arg = record.arg;
|
6452 | }
|
6453 | }
|
6454 | };
|
6455 | }
|
6456 |
|
6457 |
|
6458 |
|
6459 | defineIteratorMethods(Gp);
|
6460 |
|
6461 | Gp[iteratorSymbol] = function() {
|
6462 | return this;
|
6463 | };
|
6464 |
|
6465 | Gp[toStringTagSymbol] = "Generator";
|
6466 |
|
6467 | Gp.toString = function() {
|
6468 | return "[object Generator]";
|
6469 | };
|
6470 |
|
6471 | function pushTryEntry(locs) {
|
6472 | var entry = { tryLoc: locs[0] };
|
6473 |
|
6474 | if (1 in locs) {
|
6475 | entry.catchLoc = locs[1];
|
6476 | }
|
6477 |
|
6478 | if (2 in locs) {
|
6479 | entry.finallyLoc = locs[2];
|
6480 | entry.afterLoc = locs[3];
|
6481 | }
|
6482 |
|
6483 | this.tryEntries.push(entry);
|
6484 | }
|
6485 |
|
6486 | function resetTryEntry(entry) {
|
6487 | var record = entry.completion || {};
|
6488 | record.type = "normal";
|
6489 | delete record.arg;
|
6490 | entry.completion = record;
|
6491 | }
|
6492 |
|
6493 | function Context(tryLocsList) {
|
6494 |
|
6495 |
|
6496 |
|
6497 | this.tryEntries = [{ tryLoc: "root" }];
|
6498 | tryLocsList.forEach(pushTryEntry, this);
|
6499 | this.reset(true);
|
6500 | }
|
6501 |
|
6502 | runtime.keys = function(object) {
|
6503 | var keys = [];
|
6504 | for (var key in object) {
|
6505 | keys.push(key);
|
6506 | }
|
6507 | keys.reverse();
|
6508 |
|
6509 |
|
6510 |
|
6511 | return function next() {
|
6512 | while (keys.length) {
|
6513 | var key = keys.pop();
|
6514 | if (key in object) {
|
6515 | next.value = key;
|
6516 | next.done = false;
|
6517 | return next;
|
6518 | }
|
6519 | }
|
6520 |
|
6521 |
|
6522 |
|
6523 |
|
6524 | next.done = true;
|
6525 | return next;
|
6526 | };
|
6527 | };
|
6528 |
|
6529 | function values(iterable) {
|
6530 | if (iterable) {
|
6531 | var iteratorMethod = iterable[iteratorSymbol];
|
6532 | if (iteratorMethod) {
|
6533 | return iteratorMethod.call(iterable);
|
6534 | }
|
6535 |
|
6536 | if (typeof iterable.next === "function") {
|
6537 | return iterable;
|
6538 | }
|
6539 |
|
6540 | if (!isNaN(iterable.length)) {
|
6541 | var i = -1, next = function next() {
|
6542 | while (++i < iterable.length) {
|
6543 | if (hasOwn.call(iterable, i)) {
|
6544 | next.value = iterable[i];
|
6545 | next.done = false;
|
6546 | return next;
|
6547 | }
|
6548 | }
|
6549 |
|
6550 | next.value = undefined;
|
6551 | next.done = true;
|
6552 |
|
6553 | return next;
|
6554 | };
|
6555 |
|
6556 | return next.next = next;
|
6557 | }
|
6558 | }
|
6559 |
|
6560 |
|
6561 | return { next: doneResult };
|
6562 | }
|
6563 | runtime.values = values;
|
6564 |
|
6565 | function doneResult() {
|
6566 | return { value: undefined, done: true };
|
6567 | }
|
6568 |
|
6569 | Context.prototype = {
|
6570 | constructor: Context,
|
6571 |
|
6572 | reset: function(skipTempReset) {
|
6573 | this.prev = 0;
|
6574 | this.next = 0;
|
6575 |
|
6576 |
|
6577 | this.sent = this._sent = undefined;
|
6578 | this.done = false;
|
6579 | this.delegate = null;
|
6580 |
|
6581 | this.tryEntries.forEach(resetTryEntry);
|
6582 |
|
6583 | if (!skipTempReset) {
|
6584 | for (var name in this) {
|
6585 |
|
6586 | if (name.charAt(0) === "t" &&
|
6587 | hasOwn.call(this, name) &&
|
6588 | !isNaN(+name.slice(1))) {
|
6589 | this[name] = undefined;
|
6590 | }
|
6591 | }
|
6592 | }
|
6593 | },
|
6594 |
|
6595 | stop: function() {
|
6596 | this.done = true;
|
6597 |
|
6598 | var rootEntry = this.tryEntries[0];
|
6599 | var rootRecord = rootEntry.completion;
|
6600 | if (rootRecord.type === "throw") {
|
6601 | throw rootRecord.arg;
|
6602 | }
|
6603 |
|
6604 | return this.rval;
|
6605 | },
|
6606 |
|
6607 | dispatchException: function(exception) {
|
6608 | if (this.done) {
|
6609 | throw exception;
|
6610 | }
|
6611 |
|
6612 | var context = this;
|
6613 | function handle(loc, caught) {
|
6614 | record.type = "throw";
|
6615 | record.arg = exception;
|
6616 | context.next = loc;
|
6617 | return !!caught;
|
6618 | }
|
6619 |
|
6620 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
6621 | var entry = this.tryEntries[i];
|
6622 | var record = entry.completion;
|
6623 |
|
6624 | if (entry.tryLoc === "root") {
|
6625 |
|
6626 |
|
6627 |
|
6628 | return handle("end");
|
6629 | }
|
6630 |
|
6631 | if (entry.tryLoc <= this.prev) {
|
6632 | var hasCatch = hasOwn.call(entry, "catchLoc");
|
6633 | var hasFinally = hasOwn.call(entry, "finallyLoc");
|
6634 |
|
6635 | if (hasCatch && hasFinally) {
|
6636 | if (this.prev < entry.catchLoc) {
|
6637 | return handle(entry.catchLoc, true);
|
6638 | } else if (this.prev < entry.finallyLoc) {
|
6639 | return handle(entry.finallyLoc);
|
6640 | }
|
6641 |
|
6642 | } else if (hasCatch) {
|
6643 | if (this.prev < entry.catchLoc) {
|
6644 | return handle(entry.catchLoc, true);
|
6645 | }
|
6646 |
|
6647 | } else if (hasFinally) {
|
6648 | if (this.prev < entry.finallyLoc) {
|
6649 | return handle(entry.finallyLoc);
|
6650 | }
|
6651 |
|
6652 | } else {
|
6653 | throw new Error("try statement without catch or finally");
|
6654 | }
|
6655 | }
|
6656 | }
|
6657 | },
|
6658 |
|
6659 | abrupt: function(type, arg) {
|
6660 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
6661 | var entry = this.tryEntries[i];
|
6662 | if (entry.tryLoc <= this.prev &&
|
6663 | hasOwn.call(entry, "finallyLoc") &&
|
6664 | this.prev < entry.finallyLoc) {
|
6665 | var finallyEntry = entry;
|
6666 | break;
|
6667 | }
|
6668 | }
|
6669 |
|
6670 | if (finallyEntry &&
|
6671 | (type === "break" ||
|
6672 | type === "continue") &&
|
6673 | finallyEntry.tryLoc <= arg &&
|
6674 | arg <= finallyEntry.finallyLoc) {
|
6675 |
|
6676 |
|
6677 | finallyEntry = null;
|
6678 | }
|
6679 |
|
6680 | var record = finallyEntry ? finallyEntry.completion : {};
|
6681 | record.type = type;
|
6682 | record.arg = arg;
|
6683 |
|
6684 | if (finallyEntry) {
|
6685 | this.next = finallyEntry.finallyLoc;
|
6686 | } else {
|
6687 | this.complete(record);
|
6688 | }
|
6689 |
|
6690 | return ContinueSentinel;
|
6691 | },
|
6692 |
|
6693 | complete: function(record, afterLoc) {
|
6694 | if (record.type === "throw") {
|
6695 | throw record.arg;
|
6696 | }
|
6697 |
|
6698 | if (record.type === "break" ||
|
6699 | record.type === "continue") {
|
6700 | this.next = record.arg;
|
6701 | } else if (record.type === "return") {
|
6702 | this.rval = record.arg;
|
6703 | this.next = "end";
|
6704 | } else if (record.type === "normal" && afterLoc) {
|
6705 | this.next = afterLoc;
|
6706 | }
|
6707 | },
|
6708 |
|
6709 | finish: function(finallyLoc) {
|
6710 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
6711 | var entry = this.tryEntries[i];
|
6712 | if (entry.finallyLoc === finallyLoc) {
|
6713 | this.complete(entry.completion, entry.afterLoc);
|
6714 | resetTryEntry(entry);
|
6715 | return ContinueSentinel;
|
6716 | }
|
6717 | }
|
6718 | },
|
6719 |
|
6720 | "catch": function(tryLoc) {
|
6721 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
6722 | var entry = this.tryEntries[i];
|
6723 | if (entry.tryLoc === tryLoc) {
|
6724 | var record = entry.completion;
|
6725 | if (record.type === "throw") {
|
6726 | var thrown = record.arg;
|
6727 | resetTryEntry(entry);
|
6728 | }
|
6729 | return thrown;
|
6730 | }
|
6731 | }
|
6732 |
|
6733 |
|
6734 |
|
6735 | throw new Error("illegal catch attempt");
|
6736 | },
|
6737 |
|
6738 | delegateYield: function(iterable, resultName, nextLoc) {
|
6739 | this.delegate = {
|
6740 | iterator: values(iterable),
|
6741 | resultName: resultName,
|
6742 | nextLoc: nextLoc
|
6743 | };
|
6744 |
|
6745 | return ContinueSentinel;
|
6746 | }
|
6747 | };
|
6748 | })(
|
6749 |
|
6750 |
|
6751 |
|
6752 | typeof global === "object" ? global :
|
6753 | typeof window === "object" ? window :
|
6754 | typeof self === "object" ? self : this
|
6755 | );
|
6756 |
|
6757 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
6758 | },{}]},{},[1]);
|
6759 | ;(function(global,factory){if(typeof define==="function"&&define.amd){define(["module","exports"],factory);}else if(typeof exports!=="undefined"){factory(module,exports);}else{var mod={exports:{}};factory(mod,mod.exports);global.scxml=mod.exports;}})(this,function(module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};(function(f){if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"&&typeof module!=="undefined"){module.exports=f();}else if(typeof define==="function"&&define.amd){define([],f);}else{var g;if(typeof window!=="undefined"){g=window;}else if(typeof global!=="undefined"){g=global;}else if(typeof self!=="undefined"){g=self;}else{g=this;}g.scxml=f();}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f;}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e);},l,l.exports,e,t,n,r);}return n[o].exports;}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++){s(r[o]);}return s;}({1:[function(require,module,exports){
|
6760 |
|
6761 |
|
6762 |
|
6763 |
|
6764 |
|
6765 |
|
6766 |
|
6767 |
|
6768 |
|
6769 |
|
6770 |
|
6771 |
|
6772 | "use strict";var extend=Object.assign||function(to,from){Object.keys(from).forEach(function(k){to[k]=from[k];});return to;};var STATE_TYPES={BASIC:0,COMPOSITE:1,PARALLEL:2,HISTORY:3,INITIAL:4,FINAL:5};var ioProcessorTypes={'scxml':{location:'http://www.w3.org/TR/scxml/#SCXMLEventProcessor'},'basichttp':{location:'http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor'},'dom':{location:'http://www.w3.org/TR/scxml/#DOMEventProcessor'},'publish':{location:'https://github.com/jbeard4/SCION#publish'}};function transitionWithTargets(t){return t.targets;}function transitionComparator(t1,t2){return t1.documentOrder-t2.documentOrder;}function initializeModel(rootState){var transitions=[],idToStateMap=new Map(),documentOrder=0;
|
6773 |
|
6774 | var idCount={};function generateId(type){if(idCount[type]===undefined)idCount[type]=0;var count=idCount[type]++;return'$generated-'+type+'-'+count;}function wrapInFakeRootState(state){return{$deserializeDatamodel:state.$deserializeDatamodel||function(){},$serializeDatamodel:state.$serializeDatamodel||function(){return null;},$idToStateMap:idToStateMap,
|
6775 | states:[{$type:'initial',transitions:[{target:state}]},state]};}var statesWithInitialAttributes=[];function transitionToString(sourceState){return sourceState+" -- "+(this.events?'('+this.events.join(',')+')':null)+(this.cond?'['+this.cond.name+']':'')+" --> "+(this.targets?this.targets.join(','):null);}function stateToString(){return this.id;}function traverse(ancestors,state){if(printTrace)state.toString=stateToString;
|
6776 | if(state.transitions)transitions.push.apply(transitions,state.transitions);
|
6777 | if(state.id){if(idToStateMap.has(state.id))throw new Error('Redefinition of state id '+state.id);idToStateMap.set(state.id,state);}
|
6778 |
|
6779 | state.$type=state.$type||'state';
|
6780 | state.ancestors=ancestors;state.depth=ancestors.length;state.parent=ancestors[0];state.documentOrder=documentOrder++;
|
6781 | state.transitions=state.transitions||[];for(var j=0,len=state.transitions.length;j<len;j++){var transition=state.transitions[j];transition.documentOrder=documentOrder++;transition.source=state;if(printTrace)transition.toString=transitionToString.bind(transition,state);};
|
6782 | if(state.states){var ancs=[state].concat(ancestors);for(var j=0,len=state.states.length;j<len;j++){traverse(ancs,state.states[j]);}}
|
6783 | switch(state.$type){case'parallel':state.typeEnum=STATE_TYPES.PARALLEL;break;case'initial':state.typeEnum=STATE_TYPES.INITIAL;break;case'history':state.typeEnum=STATE_TYPES.HISTORY;break;case'final':state.typeEnum=STATE_TYPES.FINAL;break;case'state':case'scxml':if(state.states&&state.states.length){state.typeEnum=STATE_TYPES.COMPOSITE;}else{state.typeEnum=STATE_TYPES.BASIC;}break;default:throw new Error('Unknown state type: '+state.$type);}
|
6784 | if(state.states){state.descendants=state.states.concat(state.states.map(function(s){return s.descendants;}).reduce(function(a,b){return a.concat(b);},[]));}else{state.descendants=[];}var initialChildren;if(state.typeEnum===STATE_TYPES.COMPOSITE){
|
6785 | if(typeof state.initial==='string'){statesWithInitialAttributes.push(state);}else{
|
6786 | initialChildren=state.states.filter(function(child){return child.$type==='initial';});state.initialRef=initialChildren.length?initialChildren[0]:state.states[0];checkInitialRef(state);}}
|
6787 | if(state.typeEnum===STATE_TYPES.COMPOSITE||state.typeEnum===STATE_TYPES.PARALLEL){var historyChildren=state.states.filter(function(s){return s.$type==='history';});state.historyRef=historyChildren[0];}
|
6788 | if(!state.id){state.id=generateId(state.$type);idToStateMap.set(state.id,state);}
|
6789 | if(state.onEntry&&!Array.isArray(state.onEntry)){state.onEntry=[state.onEntry];}if(state.onExit&&!Array.isArray(state.onExit)){state.onExit=[state.onExit];}}
|
6790 | function checkInitialRef(state){if(!state.initialRef)throw new Error('Unable to locate initial state for composite state: '+state.id);}function connectIntialAttributes(){for(var j=0,len=statesWithInitialAttributes.length;j<len;j++){var s=statesWithInitialAttributes[j];s.initialRef=idToStateMap.get(s.initial);checkInitialRef(s);}}var RX_WHITESPACE=/\s+/;function connectTransitionGraph(){
|
6791 | for(var i=0,len=transitions.length;i<len;i++){var t=transitions[i];if(t.onTransition&&!Array.isArray(t.onTransition)){t.onTransition=[t.onTransition];}
|
6792 | if(typeof t.event==='string'){t.events=t.event.trim().split(RX_WHITESPACE);}delete t.event;if(t.targets||typeof t.target==='undefined'){
|
6793 | continue;}if(typeof t.target==='string'){var target=idToStateMap.get(t.target);if(!target)throw new Error('Unable to find target state with id '+t.target);t.target=target;t.targets=[t.target];}else if(Array.isArray(t.target)){t.targets=t.target.map(function(target){if(typeof target==='string'){target=idToStateMap.get(target);if(!target)throw new Error('Unable to find target state with id '+t.target);return target;}else{return target;}});}else if(_typeof(t.target)==='object'){t.targets=[t.target];}else{throw new Error('Transition target has unknown type: '+t.target);}}
|
6794 | for(var i=0,len=transitions.length;i<len;i++){var t=transitions[i];if(t.targets)t.lcca=getLCCA(t.source,t.targets[0]);
|
6795 | t.scope=getScope(t);
|
6796 | }}function getScope(transition){
|
6797 |
|
6798 | var transitionIsReallyInternal=transition.type==='internal'&&transition.source.parent&&
|
6799 | transition.targets&&
|
6800 | transition.targets.every(function(target){return transition.source.descendants.indexOf(target)>-1;});if(!transition.targets){return transition.source;}else if(transitionIsReallyInternal){return transition.source;}else{return transition.lcca;}}function getLCCA(s1,s2){
|
6801 | var commonAncestors=[];for(var j=0,len=s1.ancestors.length;j<len;j++){var anc=s1.ancestors[j];
|
6802 | if(anc.typeEnum===STATE_TYPES.COMPOSITE&&anc.descendants.indexOf(s2)>-1){commonAncestors.push(anc);}};
|
6803 | if(!commonAncestors.length)throw new Error("Could not find LCA for states.");return commonAncestors[0];}
|
6804 |
|
6805 | var fakeRootState=wrapInFakeRootState(rootState);
|
6806 | traverse([],fakeRootState);connectTransitionGraph();connectIntialAttributes();return fakeRootState;}function EventEmitter(){this._listeners={};this._listeners['*']=[];}EventEmitter.prototype.on=function _on(type,listener){if(!Array.isArray(this._listeners[type])){this._listeners[type]=[];}if(this._listeners[type].indexOf(listener)===-1){this._listeners[type].push(listener);}return this;};EventEmitter.prototype.once=function _once(type,listener){var self=this;function __once(){for(var args=[],i=0;i<arguments.length;i+=1){args[i]=arguments[i];}self.off(type,__once);listener.apply(self,args);}__once.listener=listener;return this.on(type,__once);};EventEmitter.prototype.off=function _off(type,listener){if(!Array.isArray(this._listeners[type])){return this;}if(typeof listener==='undefined'){this._listeners[type]=[];return this;}var index=this._listeners[type].indexOf(listener);if(index===-1){for(var i=0;i<this._listeners[type].length;i+=1){if(this._listeners[type][i].listener===listener){index=i;break;}}}this._listeners[type].splice(index,1);return this;};EventEmitter.prototype.emit=function _emit(type){var args=Array.prototype.slice.call(arguments);var modifiedArgs=args.slice(1);var listeners=this._listeners[type];var j,len;if(Array.isArray(listeners)){for(j=0,len=listeners.length;j<len;j++){listeners[j].apply(this,modifiedArgs);}}
|
6807 | listeners=this._listeners['*'];for(j=0,len=listeners.length;j<len;j++){listeners[j].apply(this,args);}return this;};function ArraySet(l){l=l||[];this.o=new Set(l);}ArraySet.prototype={add:function add(x){this.o.add(x);},remove:function remove(x){return this.o["delete"](x);},union:function union(l){var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=l.o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var v=_step.value;this.o.add(v);}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]){_iterator["return"]();}}finally{if(_didIteratorError){throw _iteratorError;}}}return this;},difference:function difference(l){var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=l.o[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var v=_step2.value;this.o["delete"](v);}}catch(err){_didIteratorError2=true;_iteratorError2=err;}finally{try{if(!_iteratorNormalCompletion2&&_iterator2["return"]){_iterator2["return"]();}}finally{if(_didIteratorError2){throw _iteratorError2;}}}return this;},contains:function contains(x){return this.o.has(x);},iter:function iter(){return Array.from(this.o);},isEmpty:function isEmpty(){return!this.o.size;},size:function size(){return this.o.size;},equals:function equals(s2){if(this.o.size!==s2.size()){return false;}var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=undefined;try{for(var _iterator3=this.o[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var v=_step3.value;if(!s2.contains(v)){return false;}}}catch(err){_didIteratorError3=true;_iteratorError3=err;}finally{try{if(!_iteratorNormalCompletion3&&_iterator3["return"]){_iterator3["return"]();}}finally{if(_didIteratorError3){throw _iteratorError3;}}}return true;},toString:function toString(){return this.o.size===0?'<empty>':Array.from(this.o).join(',\n');}};var RX_TRAILING_WILDCARD=/\.\*$/;function isEventPrefixMatch(prefix,fullName){prefix=prefix.replace(RX_TRAILING_WILDCARD,'');if(prefix===fullName){return true;}if(prefix.length>fullName.length){return false;}if(fullName.charAt(prefix.length)!=='.'){return false;}return fullName.indexOf(prefix)===0;}function isTransitionMatch(t,eventName){return t.events.some(function(tEvent){return tEvent==='*'||isEventPrefixMatch(tEvent,eventName);});}function scxmlPrefixTransitionSelector(state,event,evaluator,selectEventlessTransitions){return state.transitions.filter(function(t){return(selectEventlessTransitions?!t.events:!t.events||event&&event.name&&isTransitionMatch(t,event.name))&&(!t.cond||evaluator(t.cond));});}function eventlessTransitionSelector(state){return state.transitions.filter(function(transition){return!transition.events||transition.events&&transition.events.length===0;});}
|
6808 | var query={getAncestors:function getAncestors(s,root){var ancestors,index,state;index=s.ancestors.indexOf(root);if(index>-1){return s.ancestors.slice(0,index);}else{return s.ancestors;}},getAncestorsOrSelf:function getAncestorsOrSelf(s,root){return[s].concat(this.getAncestors(s,root));},getDescendantsOrSelf:function getDescendantsOrSelf(s){return[s].concat(s.descendants);},isOrthogonalTo:function isOrthogonalTo(s1,s2){
|
6809 |
|
6810 | return!this.isAncestrallyRelatedTo(s1,s2)&&this.getLCA(s1,s2).typeEnum===STATE_TYPES.PARALLEL;},isAncestrallyRelatedTo:function isAncestrallyRelatedTo(s1,s2){
|
6811 | return this.getAncestorsOrSelf(s2).indexOf(s1)>-1||this.getAncestorsOrSelf(s1).indexOf(s2)>-1;},getLCA:function getLCA(s1,s2){var commonAncestors=this.getAncestors(s1).filter(function(a){return a.descendants.indexOf(s2)>-1;},this);return commonAncestors[0];}};
|
6812 | function getTransitionWithHigherSourceChildPriority(_args){var t1=_args[0],t2=_args[1];var r=getStateWithHigherSourceChildPriority(t1.source,t2.source);
|
6813 | if(t1.source.depth<t2.source.depth){return t2;}else if(t2.source.depth<t1.source.depth){return t1;}else{if(t1.documentOrder<t2.documentOrder){return t1;}else{return t2;}}}function getStateWithHigherSourceChildPriority(s1,s2){
|
6814 | if(s1.depth>s2.depth){return-1;}else if(s1.depth<s2.depth){return 1;}else{
|
6815 | if(s1.documentOrder<s2.documentOrder){return 1;}else if(s1.documentOrder>s2.documentOrder){return-1;}else{return 0;}}}function initializeModelGeneratorFn(modelFn,opts,interpreter){opts.x=opts.x||{};return modelFn.call(interpreter,opts.x,opts.sessionid,opts.ioprocessors,interpreter.isIn.bind(interpreter));}function deserializeSerializedConfiguration(serializedConfiguration,idToStateMap){return serializedConfiguration.map(function(id){var state=idToStateMap.get(id);if(!state)throw new Error('Error loading serialized configuration. Unable to locate state with id '+id);return state;});}function deserializeHistory(serializedHistory,idToStateMap){var o={};Object.keys(serializedHistory).forEach(function(sid){o[sid]=serializedHistory[sid].map(function(id){var state=idToStateMap.get(id);if(!state)throw new Error('Error loading serialized history. Unable to locate state with id '+id);return state;});});return o;}var printTrace=false;BaseInterpreter.EVENTS=['onEntry','onExit','onTransition','onError','onBigStepBegin','onBigStepSuspend','onBigStepResume','onSmallStepBegin','onSmallStepEnd','onBigStepEnd'];function BaseInterpreter(modelOrFnGenerator,opts){EventEmitter.call(this);this._scriptingContext=opts.interpreterScriptingContext||(opts.InterpreterScriptingContext?new opts.InterpreterScriptingContext(this):{});var model;if(typeof modelOrFnGenerator==='function'){model=initializeModelGeneratorFn(modelOrFnGenerator,opts,this);}else if(typeof modelOrFnGenerator==='string'){model=JSON.parse(modelOrFnGenerator);}else{model=modelOrFnGenerator;}this._model=initializeModel(model);
|
6816 | this.opts=opts||{};this.opts.console=opts.console||(typeof console==='undefined'?{log:function log(){}}:console);
|
6817 | this.opts.Set=this.opts.Set||ArraySet;this.opts.priorityComparisonFn=this.opts.priorityComparisonFn||getTransitionWithHigherSourceChildPriority;this.opts.transitionSelector=this.opts.transitionSelector||scxmlPrefixTransitionSelector;this._scriptingContext.log=this._scriptingContext.log||function log(){if(this.opts.console.log.apply){this.opts.console.log.apply(this.opts.console,arguments);}else{
|
6818 | this.opts.console.log(Array.prototype.slice.apply(arguments).join(','));}}.bind(this);
|
6819 | this._internalEventQueue=[];
|
6820 | if(opts.snapshot){this._configuration=new this.opts.Set(deserializeSerializedConfiguration(opts.snapshot[0],this._model.$idToStateMap));this._historyValue=deserializeHistory(opts.snapshot[1],this._model.$idToStateMap);this._isInFinalState=opts.snapshot[2];this._model.$deserializeDatamodel(opts.snapshot[3]);
|
6821 | }else{this._configuration=new this.opts.Set();this._historyValue={};this._isInFinalState=false;}
|
6822 | this._x={_sessionId:opts.sessionId||null,_name:model.name||opts.name||null,_ioprocessors:opts.ioprocessors||null};
|
6823 | BaseInterpreter.EVENTS.forEach(function(event){this.on(event,this._log.bind(this,event));},this);}BaseInterpreter.prototype=extend(beget(EventEmitter.prototype),{start:function start(){
|
6824 | this._log("performing initial big step");
|
6825 |
|
6826 |
|
6827 | this._configuration.add(this._model.initialRef);this._performBigStep();return this.getConfiguration();}, |
6828 |
|
6829 |
|
6830 |
|
6831 | startAsync:function startAsync(cb){if(typeof cb!=='function'){cb=nop;}this._log("performing initial big step");this._configuration.add(this._model.initialRef);this._performBigStepAsync(null,cb);},getConfiguration:function getConfiguration(){return this._configuration.iter().map(function(s){return s.id;});},getFullConfiguration:function getFullConfiguration(){return this._configuration.iter().map(function(s){return[s].concat(query.getAncestors(s));},this).reduce(function(a,b){return a.concat(b);},[]).
|
6832 | map(function(s){return s.id;}).reduce(function(a,b){return a.indexOf(b)>-1?a:a.concat(b);},[]);
|
6833 | },isIn:function isIn(stateName){return this.getFullConfiguration().indexOf(stateName)>-1;},isFinal:function isFinal(stateName){return this._isInFinalState;},_performBigStep:function _performBigStep(e){this.emit('onBigStepBegin');if(e)this._internalEventQueue.push(e);var keepGoing=true;while(keepGoing){var currentEvent=this._internalEventQueue.shift()||null;var selectedTransitions=this._selectTransitions(currentEvent,true);if(selectedTransitions.isEmpty()){selectedTransitions=this._selectTransitions(currentEvent,false);}this.emit('onSmallStepBegin',currentEvent);this._performSmallStep(currentEvent,selectedTransitions);this.emit('onSmallStepEnd',currentEvent);keepGoing=!selectedTransitions.isEmpty();}this._isInFinalState=this._configuration.iter().every(function(s){return s.typeEnum===STATE_TYPES.FINAL;});this.emit('onBigStepEnd');},_performBigStepAsync:function _performBigStepAsync(event,cb){if(event){this._internalEventQueue.push(event);}var self=this;function doBigStep(eventToEmit){var selectedTransitions;try{self.emit(eventToEmit);var currentEvent=self._internalEventQueue.shift()||null;var selectedTransitions=self._selectTransitions(currentEvent,true);if(selectedTransitions.isEmpty()){selectedTransitions=self._selectTransitions(currentEvent,false);}self.emit('onSmallStepBegin',currentEvent);self._performSmallStep(currentEvent,selectedTransitions);self.emit('onSmallStepEnd',currentEvent);}catch(err){cb(err);return;}if(!selectedTransitions.isEmpty()){
|
6834 |
|
6835 |
|
6836 | self.emit('onBigStepSuspend');setImmediate(doBigStep,'onBigStepResume');}else{self._isInFinalState=self._configuration.iter().every(function(s){return s.typeEnum===STATE_TYPES.FINAL;});self.emit('onBigStepEnd');cb(undefined,self.getConfiguration());}}doBigStep('onBigStepBegin');},_performSmallStep:function _performSmallStep(currentEvent,selectedTransitions){this._log("selecting transitions with currentEvent",JSON.stringify(currentEvent));this._log("selected transitions",selectedTransitions);if(!selectedTransitions.isEmpty()){this._log("sorted transitions",selectedTransitions);
|
6837 |
|
6838 | var selectedTransitionsWithTargets=new this.opts.Set(selectedTransitions.iter().filter(transitionWithTargets));var exitedTuple=this._getStatesExited(selectedTransitionsWithTargets),basicStatesExited=exitedTuple[0],statesExited=exitedTuple[1];var enteredTuple=this._getStatesEntered(selectedTransitionsWithTargets),basicStatesEntered=enteredTuple[0],statesEntered=enteredTuple[1];this._log("basicStatesExited ",basicStatesExited);this._log("basicStatesEntered ",basicStatesEntered);this._log("statesExited ",statesExited);this._log("statesEntered ",statesEntered);var eventsToAddToInnerQueue=new this.opts.Set();
|
6839 | this._log("executing state exit actions");for(var j=0,len=statesExited.length;j<len;j++){var stateExited=statesExited[j];this._log("exiting ",stateExited.id);
|
6840 | this.emit('onExit',stateExited.id);if(stateExited.onExit!==undefined){for(var exitIdx=0,exitLen=stateExited.onExit.length;exitIdx<exitLen;exitIdx++){this._evaluateAction(currentEvent,stateExited.onExit[exitIdx]);}}var f;if(stateExited.historyRef){if(stateExited.historyRef.isDeep){f=function f(s0){return s0.typeEnum===STATE_TYPES.BASIC&&stateExited.descendants.indexOf(s0)>-1;};}else{f=function f(s0){return s0.parent===stateExited;};}
|
6841 | this._historyValue[stateExited.historyRef.id]=statesExited.filter(f);}}
|
6842 |
|
6843 | var sortedTransitions=selectedTransitions.iter().sort(transitionComparator);this._log("executing transitition actions");for(var stxIdx=0,len=sortedTransitions.length;stxIdx<len;stxIdx++){var transition=sortedTransitions[stxIdx];var targetIds=transition.targets&&transition.targets.map(function(target){return target.id;});this.emit('onTransition',transition.source.id,targetIds,stxIdx);if(transition.onTransition!==undefined){for(var txIdx=0,txLen=transition.onTransition.length;txIdx<txLen;txIdx++){this._evaluateAction(currentEvent,transition.onTransition[txIdx]);}}}this._log("executing state enter actions");for(var enterIdx=0,enterLen=statesEntered.length;enterIdx<enterLen;enterIdx++){var stateEntered=statesEntered[enterIdx];this._log("entering",stateEntered.id);this.emit('onEntry',stateEntered.id);if(stateEntered.onEntry!==undefined){for(var entryIdx=0,entryLen=stateEntered.onEntry.length;entryIdx<entryLen;entryIdx++){this._evaluateAction(currentEvent,stateEntered.onEntry[entryIdx]);}}}this._log("updating configuration ");this._log("old configuration ",this._configuration);
|
6844 | this._configuration.difference(basicStatesExited);this._configuration.union(basicStatesEntered);this._log("new configuration ",this._configuration);
|
6845 | if(!eventsToAddToInnerQueue.isEmpty()){this._log("adding triggered events to inner queue ",eventsToAddToInnerQueue);this._internalEventQueue.push(eventsToAddToInnerQueue);}}
|
6846 | return selectedTransitions;},_evaluateAction:function _evaluateAction(currentEvent,actionRef){try{return actionRef.call(this._scriptingContext,currentEvent);
|
6847 | }catch(e){var err={tagname:actionRef.tagname,line:actionRef.line,column:actionRef.column,reason:e.message};this._internalEventQueue.push({"name":"error.execution",data:err});this.emit('onError',err);}},_getStatesExited:function _getStatesExited(transitions){var statesExited=new this.opts.Set();var basicStatesExited=new this.opts.Set();
|
6848 |
|
6849 |
|
6850 |
|
6851 | var transitionList=transitions.iter();for(var txIdx=0,txLen=transitionList.length;txIdx<txLen;txIdx++){var transition=transitionList[txIdx];var scope=transition.scope,desc=scope.descendants;
|
6852 |
|
6853 |
|
6854 | var configList=this._configuration.iter();for(var cfgIdx=0,cfgLen=configList.length;cfgIdx<cfgLen;cfgIdx++){var state=configList[cfgIdx];if(desc.indexOf(state)>-1){basicStatesExited.add(state);statesExited.add(state);var ancestors=query.getAncestors(state,scope);for(var ancIdx=0,ancLen=ancestors.length;ancIdx<ancLen;ancIdx++){statesExited.add(ancestors[ancIdx]);}}}}var sortedStatesExited=statesExited.iter().sort(getStateWithHigherSourceChildPriority);return[basicStatesExited,sortedStatesExited];},_getStatesEntered:function _getStatesEntered(transitions){var o={statesToEnter:new this.opts.Set(),basicStatesToEnter:new this.opts.Set(),statesProcessed:new this.opts.Set(),statesToProcess:[]};
|
6855 | var transitionList=transitions.iter();for(var txIdx=0,txLen=transitionList.length;txIdx<txLen;txIdx++){var transition=transitionList[txIdx];for(var targetIdx=0,targetLen=transition.targets.length;targetIdx<targetLen;targetIdx++){this._addStateAndAncestors(transition.targets[targetIdx],transition.scope,o);}}
|
6856 | var s;while(s=o.statesToProcess.pop()){this._addStateAndDescendants(s,o);}
|
6857 | var sortedStatesEntered=o.statesToEnter.iter().sort(function(s1,s2){return getStateWithHigherSourceChildPriority(s1,s2)*-1;});return[o.basicStatesToEnter,sortedStatesEntered];},_addStateAndAncestors:function _addStateAndAncestors(target,scope,o){
|
6858 | this._addStateAndDescendants(target,o);
|
6859 | var ancestors=query.getAncestors(target,scope);for(var ancIdx=0,ancLen=ancestors.length;ancIdx<ancLen;ancIdx++){var s=ancestors[ancIdx];if(s.typeEnum===STATE_TYPES.COMPOSITE){
|
6860 |
|
6861 | o.statesToEnter.add(s);o.statesProcessed.add(s);}else{
|
6862 | this._addStateAndDescendants(s,o);}}},_addStateAndDescendants:function _addStateAndDescendants(s,o){if(o.statesProcessed.contains(s))return;if(s.typeEnum===STATE_TYPES.HISTORY){if(s.id in this._historyValue){this._historyValue[s.id].forEach(function(stateFromHistory){this._addStateAndAncestors(stateFromHistory,s.parent,o);},this);}else{o.statesToEnter.add(s);o.basicStatesToEnter.add(s);}}else{o.statesToEnter.add(s);if(s.typeEnum===STATE_TYPES.PARALLEL){o.statesToProcess.push.apply(o.statesToProcess,s.states.filter(function(s){return s.typeEnum!==STATE_TYPES.HISTORY;}));}else if(s.typeEnum===STATE_TYPES.COMPOSITE){o.statesToProcess.push(s.initialRef);}else if(s.typeEnum===STATE_TYPES.INITIAL||s.typeEnum===STATE_TYPES.BASIC||s.typeEnum===STATE_TYPES.FINAL){o.basicStatesToEnter.add(s);}}o.statesProcessed.add(s);},_selectTransitions:function _selectTransitions(currentEvent,selectEventlessTransitions){if(this.opts.onlySelectFromBasicStates){var states=this._configuration.iter();}else{var statesAndParents=new this.opts.Set();
|
6863 |
|
6864 | var configList=this._configuration.iter();for(var idx=0,len=configList.length;idx<len;idx++){var basicState=configList[idx];statesAndParents.add(basicState);var ancestors=query.getAncestors(basicState);for(var ancIdx=0,ancLen=ancestors.length;ancIdx<ancLen;ancIdx++){statesAndParents.add(ancestors[ancIdx]);}}states=statesAndParents.iter();}var transitionSelector=this.opts.transitionSelector;var enabledTransitions=new this.opts.Set();var e=this._evaluateAction.bind(this,currentEvent);for(var stateIdx=0,stateLen=states.length;stateIdx<stateLen;stateIdx++){var transitions=transitionSelector(states[stateIdx],currentEvent,e,selectEventlessTransitions);for(var txIdx=0,len=transitions.length;txIdx<len;txIdx++){enabledTransitions.add(transitions[txIdx]);}}var priorityEnabledTransitions=this._selectPriorityEnabledTransitions(enabledTransitions);this._log("priorityEnabledTransitions",priorityEnabledTransitions);return priorityEnabledTransitions;},_selectPriorityEnabledTransitions:function _selectPriorityEnabledTransitions(enabledTransitions){var priorityEnabledTransitions=new this.opts.Set();var tuple=this._getInconsistentTransitions(enabledTransitions),consistentTransitions=tuple[0],inconsistentTransitionsPairs=tuple[1];priorityEnabledTransitions.union(consistentTransitions);this._log("enabledTransitions",enabledTransitions);this._log("consistentTransitions",consistentTransitions);this._log("inconsistentTransitionsPairs",inconsistentTransitionsPairs);this._log("priorityEnabledTransitions",priorityEnabledTransitions);while(!inconsistentTransitionsPairs.isEmpty()){enabledTransitions=new this.opts.Set(inconsistentTransitionsPairs.iter().map(function(t){return this.opts.priorityComparisonFn(t);},this));tuple=this._getInconsistentTransitions(enabledTransitions);consistentTransitions=tuple[0];inconsistentTransitionsPairs=tuple[1];priorityEnabledTransitions.union(consistentTransitions);this._log("enabledTransitions",enabledTransitions);this._log("consistentTransitions",consistentTransitions);this._log("inconsistentTransitionsPairs",inconsistentTransitionsPairs);this._log("priorityEnabledTransitions",priorityEnabledTransitions);}return priorityEnabledTransitions;},_getInconsistentTransitions:function _getInconsistentTransitions(transitions){var allInconsistentTransitions=new this.opts.Set();var inconsistentTransitionsPairs=new this.opts.Set();var transitionList=transitions.iter();this._log("transitions",transitions);for(var i=0;i<transitionList.length;i++){for(var j=i+1;j<transitionList.length;j++){var t1=transitionList[i];var t2=transitionList[j];if(this._conflicts(t1,t2)){allInconsistentTransitions.add(t1);allInconsistentTransitions.add(t2);inconsistentTransitionsPairs.add([t1,t2]);}}}var consistentTransitions=transitions.difference(allInconsistentTransitions);return[consistentTransitions,inconsistentTransitionsPairs];},_log:function _log(){if(printTrace){var args=Array.from(arguments);this.opts.console.log(args[0]+": "+args.slice(1).map(function(arg){return arg===null?'null':arg===undefined?'undefined':typeof arg==='string'?arg:arg.__proto__===Object.prototype?JSON.stringify(arg):arg.toString();}).join(', ')+"\n");}},_conflicts:function _conflicts(t1,t2){return!this._isArenaOrthogonal(t1,t2);},_isArenaOrthogonal:function _isArenaOrthogonal(t1,t2){this._log("transition scopes",t1.scope,t2.scope);var isOrthogonal=query.isOrthogonalTo(t1.scope,t2.scope);this._log("transition scopes are orthogonal?",isOrthogonal);return isOrthogonal;}, |
6865 |
|
6866 |
|
6867 |
|
6868 |
|
6869 |
|
6870 |
|
6871 |
|
6872 |
|
6873 |
|
6874 |
|
6875 |
|
6876 |
|
6877 |
|
6878 |
|
6879 |
|
6880 |
|
6881 |
|
6882 |
|
6883 | registerListener:function registerListener(listener){BaseInterpreter.EVENTS.forEach(function(event){if(listener[event])this.on(event,listener[event]);});},unregisterListener:function unregisterListener(listener){BaseInterpreter.EVENTS.forEach(function(event){if(listener[event])this.off(event,listener[event]);});},getAllTransitionEvents:function getAllTransitionEvents(){var events={};function getEvents(state){if(state.transitions){for(var txIdx=0,txLen=state.transitions.length;txIdx<txLen;txIdx++){events[state.transitions[txIdx].event]=true;}}if(state.states){for(var stateIdx=0,stateLen=state.states.length;stateIdx<stateLen;stateIdx++){getEvents(state.states[stateIdx]);}}}getEvents(this._model);return Object.keys(events);}, |
6884 |
|
6885 |
|
6886 |
|
6887 |
|
6888 |
|
6889 |
|
6890 |
|
6891 |
|
6892 |
|
6893 |
|
6894 |
|
6895 |
|
6896 |
|
6897 | getSnapshot:function getSnapshot(){if(this._isStepping)throw new Error('getSnapshot cannot be called while interpreter is executing a big-step');return[this.getConfiguration(),this._serializeHistory(),this._isInFinalState,this._model.$serializeDatamodel()];},_serializeHistory:function _serializeHistory(){var o={};Object.keys(this._historyValue).forEach(function(sid){o[sid]=this._historyValue[sid].map(function(state){return state.id;});},this);return o;}}); |
6898 |
|
6899 |
|
6900 | function Statechart(model,opts){opts=opts||{};opts.ioprocessors={};
|
6901 |
|
6902 | for(var processorType in ioProcessorTypes){opts.ioprocessors[processorType]=ioProcessorTypes[processorType];}opts.InterpreterScriptingContext=opts.InterpreterScriptingContext||InterpreterScriptingContext;this._isStepping=false;BaseInterpreter.call(this,model,opts);
|
6903 | }function beget(o){function F(){}F.prototype=o;return new F();} |
6904 |
|
6905 | function nop(){}
|
6906 |
|
6907 | Statechart.prototype=beget(BaseInterpreter.prototype);Statechart.prototype.gen=function(evtObjOrName,optionalData){var currentEvent;switch(typeof evtObjOrName==="undefined"?"undefined":_typeof(evtObjOrName)){case'string':currentEvent={name:evtObjOrName,data:optionalData};break;case'object':if(typeof evtObjOrName.name==='string'){currentEvent=evtObjOrName;}else{throw new Error('Event object must have "name" property of type string.');}break;default:throw new Error('First argument to gen must be a string or object.');}if(this._isStepping)throw new Error('Cannot call gen during a big-step');
|
6908 | this._isStepping=true;this._performBigStep(currentEvent);this._isStepping=false;return this.getConfiguration();}; |
6909 |
|
6910 |
|
6911 |
|
6912 |
|
6913 |
|
6914 |
|
6915 | Statechart.prototype.genAsync=function(currentEvent,cb){if((typeof currentEvent==="undefined"?"undefined":_typeof(currentEvent))!=='object'||!currentEvent||typeof currentEvent.name!=='string'){throw new Error('expected currentEvent to be an Object with a name');}if(this._isStepping){throw new Error('Cannot call gen during a big-step');}if(typeof cb!=='function'){cb=nop;}this._isStepping=true;var self=this;this._performBigStepAsync(currentEvent,function(err,config){self._isStepping=false;cb(err,config);});};function InterpreterScriptingContext(interpreter){this._interpreter=interpreter;this._timeoutMap={};}
|
6916 |
|
6917 |
|
6918 | var validateUriRegex=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;
|
6919 | InterpreterScriptingContext.prototype={raise:function raise(event){this._interpreter._internalEventQueue.push(event);},send:function send(event,options){
|
6920 | function validateSend(event,options,sendAction){if(event.target){var targetIsValidUri=validateUriRegex.test(event.target);if(!targetIsValidUri){return this.raise({name:"error.execution",data:'Target is not valid URI',sendid:options.sendid});}}var eventProcessorTypes=Object.keys(ioProcessorTypes).map(function(k){return ioProcessorTypes[k].location;});if(eventProcessorTypes.indexOf(event.type)===-1){return this.raise({name:"error.execution",data:'Unsupported event processor type',sendid:options.sendid});}sendAction.call(this,event,options);}function defaultSendAction(event,options){if(typeof setTimeout==='undefined')throw new Error('Default implementation of Statechart.prototype.send will not work unless setTimeout is defined globally.');var timeoutId=setTimeout(this._interpreter.gen.bind(this._interpreter,event),options.delay||0);if(options.sendid)this._timeoutMap[options.sendid]=timeoutId;}function publish(){this._interpreter.emit(event.name,event.data);}event.type=event.type||ioProcessorTypes.scxml.location;
|
6921 | var sendFn;if(event.type==='https://github.com/jbeard4/SCION#publish'){sendFn=publish;}else if(this._interpreter.opts.customSend){sendFn=this._interpreter.opts.customSend;}else{sendFn=defaultSendAction;}options=options||{};this._interpreter._log("sending event",event.name,"with content",event.data,"after delay",options.delay);validateSend.call(this,event,options,sendFn);},cancel:function cancel(sendid){if(this._interpreter.opts.customCancel){return this._interpreter.opts.customCancel.apply(this,[sendid]);}if(typeof clearTimeout==='undefined')throw new Error('Default implementation of Statechart.prototype.cancel will not work unless setTimeout is defined globally.');if(sendid in this._timeoutMap){this._interpreter._log("cancelling ",sendid," with timeout id ",this._timeoutMap[sendid]);clearTimeout(this._timeoutMap[sendid]);}}};module.exports={BaseInterpreter:BaseInterpreter,Statechart:Statechart,ArraySet:ArraySet,STATE_TYPES:STATE_TYPES,initializeModel:initializeModel,InterpreterScriptingContext:InterpreterScriptingContext,ioProcessorTypes:ioProcessorTypes};},{}],2:[function(require,module,exports){(function(process){var _marked=[genStates].map(regeneratorRuntime.mark); |
6922 |
|
6923 |
|
6924 |
|
6925 |
|
6926 |
|
6927 |
|
6928 | var to_js_identifier=require("text-to-js-identifier");
|
6929 |
|
6930 | var printTrace=false;function generateFnName(actionType,action){return'$'+actionType+'_l'+action.$line+'_c'+action.$column;}var FN_ARGS='(_event)';var SCRIPT_SRC_FN_PREFIX='script_src';var stripNsPrefixRe=/^(?:{(?:[^}]*)})?(.*)$/;function stripAttrNsPrefix(attrName){var m=attrName.match(stripNsPrefixRe);return m[1];}function generateFnDeclaration(fnName,fnBody,action){if(printTrace)console.log('generateFnDeclaration',fnName,fnBody);return'function '+fnName+FN_ARGS+'{\n'+fnBody+'\n'+'};\n'+fnName+'.tagname=\''+action.$type+'\';\n'+fnName+'.line='+action.$line+';\n'+fnName+'.column='+action.$column+';\n';}function generateFnCall(fnName){if(printTrace)console.log('generateFnCall',fnName);return fnName+'.apply(this, arguments)';}ModuleBuilder.prototype.generateActionFunction=function(action){if(printTrace)console.log('generateActionFunction',action);var fnName=generateFnName(action.$type,action);var fnBody=actionTags[action.$type]?actionTags[action.$type](action,this):actionTags['custom'](action,this);var fnDec=generateFnDeclaration(fnName,fnBody,action);this.fnDecAccumulator.push(fnDec);return fnName;};ModuleBuilder.prototype.generateExpressionFunction=function(expressionType,exprObj){if(printTrace)console.log('generateExpressionFunction',expressionType,exprObj);var fnName=generateFnName(expressionType,exprObj);var fnBody='return '+exprObj.expr+';';var fnDec=generateFnDeclaration(fnName,fnBody,exprObj);this.fnDecAccumulator.push(fnDec);return fnName;};ModuleBuilder.prototype.generateAttributeExpression=function(attrContainer,attrName){if(printTrace)console.log('generateAttributeExpression',attrContainer,attrName);return this.generateExpressionFunction(stripAttrNsPrefix(attrName),attrContainer[attrName]);};var REFERENCE_MARKER='__UNQUOTE__',REFERENCE_MARKER_RE=new RegExp('"'+REFERENCE_MARKER+'(.*)'+REFERENCE_MARKER+'"','g');
|
6931 |
|
6932 |
|
6933 |
|
6934 | function generateDatamodelDeclaration(datamodelAccumulator){if(!datamodelAccumulator.length){return undefined;}return'var '+datamodelAccumulator.map(function(data){return data.id;}).join(", ")+";";}var SERIALIZE_DATAMODEL_FN_NAME='$serializeDatamodel';function generateDatamodelSerializerFn(datamodelAccumulator){return'function '+SERIALIZE_DATAMODEL_FN_NAME+'(){\n'+' return {\n'+datamodelAccumulator.map(function(data){return' "'+data.id+'" : '+data.id;}).join(',\n')+'\n'+' };\n'+'}';}var DESERIALIZE_DATAMODEL_FN_NAME='$deserializeDatamodel',DESERIALIZE_DATAMODEL_FN_ARG='$serializedDatamodel';function generateDatamodelDeserializerFn(datamodelAccumulator){return'function '+DESERIALIZE_DATAMODEL_FN_NAME+'('+DESERIALIZE_DATAMODEL_FN_ARG+'){\n'+datamodelAccumulator.map(function(data){return' '+data.id+' = '+DESERIALIZE_DATAMODEL_FN_ARG+'["'+data.id+'"];';}).join('\n')+'\n'+' '+EARLY_BINDING_DATAMODEL_GUARD+' = true;\n'+
|
6935 | '}';}var EARLY_BINDING_DATAMODEL_FN_NAME='$initEarlyBindingDatamodel';var EARLY_BINDING_DATAMODEL_GUARD='$scion_early_binding_datamodel_has_fired';
|
6936 | function generateEarlyBindingDatamodelInitFn(builder){
|
6937 | return'var '+EARLY_BINDING_DATAMODEL_GUARD+' = false;\n'+(builder.datamodelAccumulator.length?'function '+EARLY_BINDING_DATAMODEL_FN_NAME+FN_ARGS+'{\n'+' if(!'+EARLY_BINDING_DATAMODEL_GUARD+'){\n'+
|
6938 | builder.datamodelAccumulator.filter(function(data){return data.expr;}).map(function(data){return' '+data.id+' = '+generateFnCall(builder.generateExpressionFunction('data',data.expr))+';\n';},builder).join('')+' '+EARLY_BINDING_DATAMODEL_GUARD+' = true; '+'\n'+' }\n'+'}':'');}function generateSmObjectLiteral(rootState){
|
6939 | return JSON.stringify(rootState,undefined,1).replace(REFERENCE_MARKER_RE,'$1');}function dumpFunctionDeclarations(fnDecAccumulator){
|
6940 | return fnDecAccumulator.join('\n');}function dumpHeader(strict){var d=new Date();var strictStr=strict?"'use strict';\n":"";return strictStr+'//Generated on '+d.toLocaleDateString()+' '+d.toLocaleTimeString()+' by the SCION SCXML compiler';}function generateFactoryFunctionWrapper(o,name,options){var parts=[o.sendString,o.sendIdLocationString,o.earlyBindingFnDeclaration,o.datamodelDeserializerFnDeclaration,o.datamodelSerializerFnDeclaration,o.actionFunctionDeclarations,'return '+o.objectLiteralString+';'];var program;if(options.debug){program=parts.join('\n\n').split('\n').map(function(line){return' '+line;}).join('\n');}else{program=parts.join('\n');}return'(function (_x,_sessionid,_ioprocessors,In){\n'+' var _name = \''+name+'\';'+
|
6941 | program+'})';}ModuleBuilder.prototype.generateModule=function(){var rootState=this.rootState;var options=this.options;
|
6942 | if(this.datamodelAccumulator.length){
|
6943 | rootState.onEntry=rootState.onEntry||[];
|
6944 | rootState.onEntry=[markAsReference(EARLY_BINDING_DATAMODEL_FN_NAME)].concat(rootState.onEntry);}
|
6945 | rootState[DESERIALIZE_DATAMODEL_FN_NAME]=markAsReference(DESERIALIZE_DATAMODEL_FN_NAME);rootState[SERIALIZE_DATAMODEL_FN_NAME]=markAsReference(SERIALIZE_DATAMODEL_FN_NAME);
|
6946 |
|
6947 | var o={headerString:dumpHeader(options.strict),sendString:this.documentHasSendAction?getDelayInMs.toString():'',sendIdLocationString:this.documentHasSendActionWithIdlocationAttribute?generateIdlocationGenerator(this.sendIdAccumulator):'',earlyBindingFnDeclaration:generateEarlyBindingDatamodelInitFn(this),datamodelDeserializerFnDeclaration:generateDatamodelDeserializerFn(this.datamodelAccumulator),datamodelSerializerFnDeclaration:generateDatamodelSerializerFn(this.datamodelAccumulator),actionFunctionDeclarations:dumpFunctionDeclarations(this.fnDecAccumulator)};delete rootState.rootScripts;
|
6948 | o.objectLiteralString=generateSmObjectLiteral(rootState);var s=o.headerString+'\n'+generateFactoryFunctionWrapper(o,rootState.name,options);return s;};function markAsReference(fnName){return REFERENCE_MARKER+fnName+REFERENCE_MARKER;}ModuleBuilder.prototype.replaceActions=function(actionContainer,actionPropertyName){if(actionContainer[actionPropertyName]){var actions=Array.isArray(actionContainer[actionPropertyName])?actionContainer[actionPropertyName]:[actionContainer[actionPropertyName]];actionContainer[actionPropertyName]=actions.map(this.generateActionFunction,this).map(markAsReference);if(actionContainer[actionPropertyName].length===1){actionContainer[actionPropertyName]=actionContainer[actionPropertyName][0];}}};ModuleBuilder.prototype.visitState=function(){var genValue=this.stateGen.next();if(genValue.done){this._finish();return;}var state=genValue.value;
|
6949 | if(state.datamodel){this.datamodelAccumulator.push.apply(this.datamodelAccumulator,state.datamodel);}if(state.onExit)this.replaceActions(state,'onExit');if(state.onEntry)this.replaceActions(state,'onEntry');if(state.transitions){for(var i=0,len=state.transitions.length;i<len;i++){var transition=state.transitions[i];this.replaceActions(transition,'onTransition');if(transition.cond){transition.cond=markAsReference(this.generateAttributeExpression(transition,'cond'));}}}
|
6950 | delete state.datamodel;setImmediate(function(self){self.visitState();},this);}; |
6951 |
|
6952 |
|
6953 |
|
6954 |
|
6955 |
|
6956 |
|
6957 |
|
6958 |
|
6959 | function SCJsonRawModule(name,datamodel,rootScripts,scxmlModule){this.name=name;this.datamodel=datamodel;this.rootScripts=rootScripts;this.module=scxmlModule;}function genStates(state){var j,len;return regeneratorRuntime.wrap(function genStates$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return state;case 2:if(!state.states){_context.next=9;break;}j=0,len=state.states.length;case 4:if(!(j<len)){_context.next=9;break;}return _context.delegateYield(genStates(state.states[j]),"t0",6);case 6:j++;_context.next=4;break;case 9:case"end":return _context.stop();}}},_marked[0],this);}function ModuleBuilder(docUrl,rootState,options){this.docUrl=docUrl;this.rootState=rootState;if(!rootState.rootScripts){rootState.rootScripts=[];}this.externalActionScripts=new Set();this.options=options;this.datamodelAccumulator=[];this.fnDecAccumulator=[];this.sendIdAccumulator=[];this.documentHasSendAction=false;this.documentHasSendActionWithIdlocationAttribute=false;this.resolve=undefined;this.reject=undefined;this.stateGen=genStates(this.rootState);}ModuleBuilder.prototype.build=function(){var self=this;return new Promise(function(resolve,reject){self.resolve=resolve;self.reject=reject;self.visitState();});};ModuleBuilder.prototype._finish=function(){
|
6960 | var rootScripts=this.rootState.rootScripts;var dataModel=generateDatamodelDeclaration(this.datamodelAccumulator);var scxmlModule=this.generateModule();var jsModule=new SCJsonRawModule(this.rootState.name,dataModel,rootScripts,scxmlModule);this.resolve(jsModule);};function startTraversal(docUrl,rootState,options){if(!options){options={};}var moduleBuilder=new ModuleBuilder(docUrl,rootState,options);return moduleBuilder.build();}ModuleBuilder.prototype.safelyAddVariableToDatamodelAccumulator=function(variableName,lineNum,colNum){if(!this.datamodelAccumulator.some(function(data){return data.id===variableName;})){
|
6961 | this.datamodelAccumulator.push({$line:lineNum,$col:colNum,id:variableName});}}; |
6962 |
|
6963 |
|
6964 |
|
6965 |
|
6966 | ModuleBuilder.prototype.handleExternalActionScript=function(action){
|
6967 | var fnName=to_js_identifier(action.src);
|
6968 | if(!this.externalActionScripts.has(action.src)){this.externalActionScripts.add(action.src);action.$wrap=function(body){return generateFnDeclaration(fnName,body,action);};this.rootState.rootScripts.push(action);}return generateFnCall(fnName);};function getVariableNameForShallowCopy(builder){
|
6969 | return'$scionArray_'+builder.datamodelAccumulator.length+1;}var actionTags={"script":function script(action,builder){if(action.src){return builder.handleExternalActionScript(action);}else{return action.content;}},"assign":function assign(action,builder){return action.location.expr+" = "+generateFnCall(builder.generateAttributeExpression(action,'expr'))+";";},"log":function log(action,builder){var params=[];if(action.label){params.push(JSON.stringify(action.label));}else if(action.labelexpr){
|
6970 | params.push(generateFnCall(builder.generateAttributeExpression(action,'labelexpr')));}else{
|
6971 |
|
6972 | params.push('null');}if(action.expr){params.push(generateFnCall(builder.generateAttributeExpression(action,'expr')));}return"this.log("+params.join(",")+");";},"if":function _if(action,builder){var s="";var ifCondExprName=builder.generateAttributeExpression(action,'cond');s+="if("+generateFnCall(ifCondExprName)+"){\n";var childNodes=action.actions;for(var i=0;i<childNodes.length;i++){var child=childNodes[i];if(child.$type==="elseif"||child.$type==="else"){break;}else{s+=' '+generateFnCall(builder.generateActionFunction(child))+';\n';}}
|
6973 | for(;i<childNodes.length;i++){child=childNodes[i];if(child.$type==="elseif"){s+="}else if("+generateFnCall(builder.generateAttributeExpression(child,'cond'))+"){\n";}else if(child.$type==="else"){s+="}";break;}else{s+=' '+generateFnCall(builder.generateActionFunction(child))+';\n';}}for(;i<childNodes.length;i++){child=childNodes[i];
|
6974 | if(child.$type==="else"){s+="else{\n";}else{s+=' '+generateFnCall(builder.generateActionFunction(child))+';\n';}}s+="}";return s;},"elseif":function elseif(){throw new Error("Encountered unexpected elseif tag.");},"else":function _else(){throw new Error("Encountered unexpected else tag.");},"raise":function raise(action){return"this.raise({ name:"+JSON.stringify(action.event)+", data : {}});";},"cancel":function cancel(action){return"this.cancel("+JSON.stringify(action.sendid)+");";},"send":function send(action,builder){builder.documentHasSendAction=true;
|
6975 | function processAttr(container,attr){if(attr==='id'){builder.sendIdAccumulator.push(container[attr]);}var exprName=attr+'expr';if(attr==='idlocation'){builder.documentHasSendActionWithIdlocationAttribute=true;var fakeExpr=JSON.parse(JSON.stringify(container));
|
6976 |
|
6977 | container[attr].expr=container[attr].expr+'='+generateFnCall(GENERATE_SENDID_FN_NAME);var fnName=builder.generateAttributeExpression(container,attr);return generateFnCall(fnName);}else if(container[exprName]){var fnName=builder.generateAttributeExpression(container,exprName);return generateFnCall(fnName);}else if(container[attr]){return JSON.stringify(container[attr]);}else{return null;}}function constructSendEventData(action){
|
6978 | if(action.content){return' '+JSON.stringify(action.content);
|
6979 | }else if(action.contentexpr){return generateFnCall(builder.generateAttributeExpression(action,'contentexpr'));}else{var props=[];
|
6980 | if(action.namelist){action.namelist.expr.trim().split(/ +/).forEach(function(name){props.push('"'+name+'"'+":"+name);
|
6981 | });}
|
6982 | if(action.params&&action.params.length){action.params.forEach(function(param){if(param.expr){props.push('"'+param.name+'"'+":"+generateFnCall(builder.generateAttributeExpression(param,'expr')));}else if(param.location){props.push('"'+param.name+'"'+":"+generateFnCall(builder.generateAttributeExpression(param,'location')));}});}return"{\n"+props.join(',\n')+"}\n";}}var target=processAttr(action,'target'),targetVariableName='_scionTargetRef',targetDeclaration='var '+targetVariableName+' = '+target+';\n';var event="{\n"+" target: "+targetVariableName+",\n"+" name: "+processAttr(action,'event')+",\n"+" type: "+processAttr(action,'type')+",\n"+" data: \n"+constructSendEventData(action)+",\n"+" origin: _sessionid\n"+"}";var sendId;if(action.id){sendId=processAttr(action,'id');}else if(action.idlocation){sendId=processAttr(action,'idlocation');}else{sendId='null';}var send=targetDeclaration+"if("+targetVariableName+" === '#_internal'){\n"+" this.raise(\n"+event+");\n"+"}else{\n"+" this.send(\n"+event+", \n"+" {\n"+" delay: getDelayInMs("+processAttr(action,'delay')+"),\n"+
|
6983 | " sendid: "+sendId+"\n"+" });\n"+"}";return send;},"foreach":function foreach(action,builder){
|
6984 | var index=action.index||"$i",item=action.item,arr=action.array.expr,foreachFnNames=action.actions?action.actions.map(builder.generateActionFunction,builder):[];[action.item,action.index,action.array.expr].forEach(function(variableNameToDeclare){if(variableNameToDeclare){builder.safelyAddVariableToDatamodelAccumulator(variableNameToDeclare,action.$line,action.$column);}});var shallowArrayName=getVariableNameForShallowCopy(builder);var forEachContents='var '+shallowArrayName+' = '+arr+';\n'+'if(Array.isArray('+shallowArrayName+')){\n'+' for('+index+' = 0; '+index+' < '+shallowArrayName+'.length;'+index+'++){\n'+' '+item+' = '+shallowArrayName+'['+index+'];\n'+foreachFnNames.map(function(fnName){return' '+generateFnCall(fnName)+';';}).join('\n')+'\n'+' }\n'+'} else{\n'+' for('+index+' in '+shallowArrayName+'){\n'+' if('+shallowArrayName+'.hasOwnProperty('+index+')){\n'+' '+item+' = '+shallowArrayName+'['+index+'];\n'+foreachFnNames.map(function(fnName){return' '+generateFnCall(fnName)+';';}).join('\n')+'\n'+' }\n'+' }\n'+'}';return forEachContents;},"custom":function custom(action){var customTagConfig={name:'Sandbox.action',data:action};return"postMessage("+JSON.stringify(customTagConfig,null,4)+");";}};function getDelayInMs(delayString){if(typeof delayString==='string'){if(delayString.slice(-2)==="ms"){return parseFloat(delayString.slice(0,-2));}else if(delayString.slice(-1)==="s"){return parseFloat(delayString.slice(0,-1))*1000;}else if(delayString.slice(-1)==="m"){return parseFloat(delayString.slice(0,-1))*1000*60;}else{return parseFloat(delayString);}}else if(typeof delayString==='number'){return delayString;}else{return 0;}}
|
6985 |
|
6986 | var GENERATE_SENDID_FN_NAME='$generateSendId';function generateIdlocationGenerator(sendIdAccumulator){return'var $sendIdCounter = 0;\n'+'var $sendIdAccumulator = '+JSON.stringify(sendIdAccumulator)+';\n'+'function '+GENERATE_SENDID_FN_NAME+'(){\n'+' var sendid;\n'+' do{\n'+' sendid = "$scion.sendid" + $sendIdCounter++;\n'+
|
6987 | ' } while($sendIdAccumulator.indexOf(sendid) > -1)\n'+' return sendid;\n'+'}';}module.exports=startTraversal;
|
6988 | if(require.main===module){
|
6989 | var usage='Usage: $0 [ FILE | - ]';var argv=require('optimist').usage(usage).argv;var input=argv._[0];if(!input){console.error(usage);process.exit(1);}else if(input==='-'){
|
6990 | process.stdin.setEncoding('utf8');process.stdin.resume();var jsonString='';process.stdin.on('data',function(s){jsonString+=s;});process.stdin.on('end',go);}else{var fs=require('fs');jsonString=fs.readFileSync(input,'utf8');go(input);}}function go(docUrl){if(!docUrl){docUrl='';}startTraversal(docUrl,JSON.parse(jsonString),{debug:true}).then(function resolved(jsModule){console.log(jsModule.module);},function rejected(err){console.error(err);});}}).call(this,require('_process'));},{"_process":31,"fs":15,"optimist":28,"text-to-js-identifier":54}],3:[function(require,module,exports){(function(process){
|
6991 |
|
6992 |
|
6993 | var sax=require("sax"),strict=true,
|
6994 | parser;function merge(o1,o2){Object.keys(o2).forEach(function(k){o1[k]=o2[k];});return o1;}function getNormalizedAttributeName(attr){return attr.uri?'{'+attr.uri+'}'+attr.local:attr.local;}function copyNsAttrObj(o){var r={};Object.keys(o).forEach(function(k){var attr=o[k];r[getNormalizedAttributeName(attr)]=attr.value;});return r;}function transform(xmlString){parser=sax.parser(strict,{trim:true,xmlns:true});var rootJson,currentJson,expressionAttributeCache,
|
6995 |
|
6996 |
|
6997 | jsonStack=[],allTransitions=[];
|
6998 | function createActionJson(node){var action=merge({$line:parser.line,$column:parser.column,$type:node.local},copyNsAttrObj(node.attributes));
|
6999 | var actionContainer;if(Array.isArray(currentJson)){
|
7000 | currentJson.push(action);}else if(currentJson.$type==='scxml'&&action.$type==='script'){
|
7001 | currentJson.rootScripts=currentJson.rootScripts||[];currentJson.rootScripts.push(action);}else{
|
7002 | currentJson.actions=currentJson.actions||[];currentJson.actions.push(action);}return currentJson=action;}function createDataJson(node){currentJson=merge({$line:parser.line,$column:parser.column,$type:'data'},copyNsAttrObj(node.attributes));return currentJson;}function createStateJson(node){var state=copyNsAttrObj(node.attributes);if(state.type){state.isDeep=state.type==='deep'?true:false;}
|
7003 | if(node.local!=='state'&&node.local!=='schema')state.$type=node.local;if(currentJson){if(!currentJson.states){currentJson.states=[];}currentJson.states.push(state);}return currentJson=state;}function createTransitionJson(node){var transition=copyNsAttrObj(node.attributes);
|
7004 | if(transition.target){
|
7005 | transition.target=transition.target.trim().split(/\s+/);if(transition.target.length===1){transition.target=transition.target[0];}}if(currentJson){if(!currentJson.transitions){currentJson.transitions=[];}currentJson.transitions.push(transition);}allTransitions.push(transition);return currentJson=transition;}function createExpression(value){return{$line:parser.line,$column:parser.column,expr:value};}var tagActions={"scxml":function scxml(node){return rootJson=createStateJson(node);},"initial":createStateJson,"history":createStateJson,"state":createStateJson,"parallel":createStateJson,"final":createStateJson,
|
7006 | "transition":createTransitionJson,"onentry":function onentry(node){currentJson=currentJson.onEntry=currentJson.onEntry||[];},"onexit":function onexit(node){currentJson=currentJson.onExit=currentJson.onExit||[];},
|
7007 | "foreach":createActionJson,"raise":createActionJson,"log":createActionJson,"assign":createActionJson,"validate":createActionJson,"script":createActionJson,"cancel":createActionJson,
|
7008 |
|
7009 | "send":createActionJson,
|
7010 | "param":function param(node){
|
7011 | currentJson.params=currentJson.params||[];var attr=copyNsAttrObj(node.attributes);currentJson.params.push(attr);currentJson=attr;},"content":function content(){if(expressionAttributeCache.expr){currentJson.contentexpr=merge({},expressionAttributeCache.expr);}},
|
7012 | "if":createActionJson,"elseif":createActionJson,"else":createActionJson,
|
7013 | "datamodel":function datamodel(node){
|
7014 | currentJson=currentJson.datamodel=[];},"data":function data(node){
|
7015 | currentJson.push(createDataJson(node));}
|
7016 |
|
7017 |
|
7018 |
|
7019 | };expressionAttributeCache={};
|
7020 | parser.onopentag=function(node){
|
7021 | if(tagActions[node.local]){tagActions[node.local](node);jsonStack.push(currentJson);
|
7022 |
|
7023 | merge(currentJson,expressionAttributeCache);expressionAttributeCache={};
|
7024 | }else{createActionJson(node);jsonStack.push(currentJson);merge(currentJson,expressionAttributeCache);expressionAttributeCache={};}};var EXPRESSION_ATTRS=['cond','array','location','namelist','idlocation'];parser.onclosetag=function(tag){
|
7025 | var localName=tag.split(':').pop();
|
7026 | jsonStack.pop();currentJson=jsonStack[jsonStack.length-1];
|
7027 |
|
7028 | };parser.onattribute=function(attr){
|
7029 |
|
7030 | if(attr.name.match(/^.*expr$/)||EXPRESSION_ATTRS.indexOf(attr.name)>-1){expressionAttributeCache[getNormalizedAttributeName(attr)]=createExpression(attr.value);}};parser.onerror=function(e){
|
7031 | throw e;};parser.ontext=function(t){
|
7032 | if(currentJson&¤tJson.$type){if(currentJson.$type==='script'){currentJson.content=t;
|
7033 | }else if(currentJson.$type==='send'){currentJson.content=t;}else if(currentJson.$type==='data'){currentJson.content={$line:currentJson.$line,$column:currentJson.$column,expr:t};}else{currentJson.content=t;}}};parser.oncdata=function(t){currentJson.content=t;};parser.onend=function(){
|
7034 | delete rootJson.xmlns;
|
7035 | delete rootJson.version;if(typeof rootJson.datamodel==='string')delete rootJson.datamodel;
|
7036 |
|
7037 | allTransitions.forEach(function(transition){transition.onTransition=transition.actions;delete transition.actions;});};parser.write(xmlString).close();return rootJson;}module.exports=transform;
|
7038 | if(require.main===module){
|
7039 |
|
7040 | console.log(JSON.stringify(transform(require('fs').readFileSync(process.argv[2],'utf8')),4,4));}}).call(this,require('_process'));},{"_process":31,"fs":15,"sax":47}],4:[function(require,module,exports){var platform=require('../../runtime/platform-bootstrap/node/platform');var fileUtils={read:function read(filePath,docUrl,context,cb){var result={error:null,content:''};if(docUrl){filePath=platform.url.resolve(docUrl,filePath);}platform.getResourceFromUrl(filePath,function(err,text,mimeType){if(err){result.error="Error downloading document \""+filePath+"\", "+(err.message||err);
|
7041 | }else{result.content=text;}cb(result);},context);}};module.exports=fileUtils;},{"../../runtime/platform-bootstrap/node/platform":10}],5:[function(require,module,exports){'use strict';var esprima=require('esprima');var fileUtils=require('./file-utils');var systemVariables=["_event","_sessionid","_name","_ioprocessors","_x"];var scJsonAnalyzer={analyze:function analyze(scJson,docUrl,context,done){var changes=[],syntaxErrors=[],asyncCount=0,waitingForAsync=false,reportCompileErrors=context.reportAllErrors===true;function processState(state){if(state.datamodel)processActions(state,'datamodel');if(state.onExit)processActions(state,'onExit');if(state.onEntry)processActions(state,'onEntry');if(state.transitions){processActions(state,'transitions',state);state.transitions.forEach(function(transition,i){if(transition.onTransition){processActions(transition,'onTransition');}});}if(state.rootScripts){processActions(state,'rootScripts');}if(state.states)state.states.forEach(function(substate,i){processState(substate);});}function processActions(actionContainer,name,state){if(Array.isArray(actionContainer[name])){Object.keys(actionContainer[name]).forEach(function(i){checkAction(actionContainer[name],i,actionContainer[name][i].$type||name,state);if(actionContainer[name][i].actions)processActions(actionContainer[name][i],'actions');});}else{checkAction(actionContainer,name,name,state);}}function checkAction(action,propertyName,$type,state){if(actionTags[$type]){var errors=actionTags[$type](action[propertyName],function(errors,override){if(override){handleError(action,propertyName,errors,$type,state,override);}else if(errors.length>0){handleError(action,propertyName,errors,$type,state);}asyncDone();});if(errors){if(errors.override){handleError(action,propertyName,errors.errors,$type,state,errors.override);}else if(errors.length>0){handleError(action,propertyName,errors,$type,state);}}}}var actionTags={'data':function data(node,done){
|
7042 |
|
7043 | if(node.src&&node.src.indexOf('file:')===0){asyncStarted();getFileContents(node.src.substring(5),function(error,content){if(error){done([error]);}else{delete node.src;node.expr={$column:node.$column,$line:node.$line,expr:normalizeWhitespace(content)};done(null,node);}});}else if(node.content){var errors=validateJavascriptAssignment(node.id,node.content);if(errors.length>0){node.content.expr=normalizeWhitespace(node.content.expr);}node.expr=node.content;delete node.content;return{override:node,errors:errors};}else{return validateJavascriptAssignment(node.id,node.expr);}},'assign':function assign(node){if(node.location&&node.expr){return validateJavascriptAssignment(node.location,node.expr);}return[];},'transitions':function transitions(node){if(node.cond){
|
7044 | var errors=validateJavascriptCondition(node.cond);if(errors.length){
|
7045 |
|
7046 | node.cond.expr='false';return{override:node,errors:errors};}}return[];},'if':function _if(node){return validateJavascriptCondition(node.cond);},'ifelse':function ifelse(node){return validateJavascriptCondition(node.cond);},'script':function script(node,done){if(node.src){
|
7047 |
|
7048 | }else if(node.content){return validateArbitraryJavascript(node.content);}},'log':function log(node){if(node.expr){return validateJavascriptExpression(node.expr,true);}return[];},'send':function send(node){if(node.$type){return validateJavascriptExpression(node.expr);}return[];},'foreach':function foreach(node){var errors=[];if(node.item){var results=validateJavascriptIdentifier(node.item);if(results&&results.length>0){errors=errors.concat(results);}}if(node.index){var results=validateJavascriptIdentifier(node.index);if(results&&results.length>0){errors=errors.concat(results);}}if(node.array){var results=validateJavascriptExpression(node.array);if(results&&results.length>0){errors=errors.concat(results);}}return errors;}};function validateJavascriptAssignment(leftHand,rightHand){var errors=[];var leftHandCheck=validateArbitraryJavascript(leftHand);var rightHandCheck=validateArbitraryJavascript(extractJavascript(leftHand)+' = '+extractJavascript(rightHand));if(leftHandCheck.length){errors.push(leftHandCheck);}else if(rightHandCheck.length){errors.push(rightHandCheck);}else if(systemVariables.indexOf(extractJavascript(leftHand))!==-1){errors.push('You can\'t change system variables: '+leftHand);}return errors;}function validateJavascriptCondition(condition){return validateArbitraryJavascript(condition);}function validateJavascriptExpression(js,allowLiteral){return validateArbitraryJavascript(js,allowLiteral);}function validateJavascriptIdentifier(js){js=extractJavascript(js);var errors=validateArbitraryJavascript(js);if(errors.length)return errors;var syntaxTree=esprima.parse(js,{});if(syntaxTree.body[0].expression.type!=='Identifier'){return['Illegal identifier: '+js];}}function validateArbitraryJavascript(js,allowLiteral){js=extractJavascript(js);if(allowLiteral){js='_lhs = '+js;}var errors=[];try{var syntaxTree=esprima.parse(js,{});traverseSyntaxTree(syntaxTree,errors);}catch(e){errors.push(e.message);}return errors;}var treeTypes={"AssignmentExpression":function AssignmentExpression(tree,errors){
|
7049 | if(tree.init&&tree.init.left&&systemVariables.indexOf(tree.init.left.name)!==-1){errors.push('You can\'t change system variables: '+tree.init.left.name);}
|
7050 | if(tree.expression&&tree.expression.left&&systemVariables.indexOf(tree.expression.left.name)!==-1){errors.push('You can\'t change system variables: '+tree.expression.left.name);}}};function traverseSyntaxTree(tree,errors){Object.keys(tree).forEach(function(i){if(tree[i]&&_typeof(tree[i])==='object'){if(tree[i].type&&treeTypes[tree[i].type]){treeTypes[tree[i].type](tree,errors);}
|
7051 | traverseSyntaxTree(tree[i],errors);}});}function getFileContents(filePath,done){
|
7052 | fileUtils.read(filePath,docUrl,context,function(fileContent){done(fileContent.error,fileContent.content);});}function handleError(node,property,errors,$type,state,override){if(reportCompileErrors&&errors&&errors.length){var n=node[property];syntaxErrors.push({tagname:n.$type,line:n.$line,column:n.$column,reason:errors.join('; ')});}var errorNode={$line:node[property].$line,$column:node[property].$column,$type:'raise',event:'error.execution',data:{message:errors?errors.join(', '):''}};changes.push({old:node,prop:property,$type:$type,new:override,state:state,error:errorNode});}function extractJavascript(attribute){
|
7053 | if((typeof attribute==="undefined"?"undefined":_typeof(attribute))==='object'){attribute=attribute.expr;}return attribute;}function normalizeWhitespace(str){return JSON.stringify(str.replace(/^\s+|\s+$|\s+(?=\s)/g,'').replace(/\s/g," "));}function commitChanges(scJson,errors){changes.forEach(function(change){if(change.$type==='data'&&!change.new){delete scJson.datamodel;scJson.onEntry=[change.new||change.error];}else if(change.$type==='script'&&!change.new&&scJson.rootScripts){delete scJson.rootScripts;scJson.onEntry=[change.error];}else if(change.$type==='transitions'){if(!change.state.onEntry)change.state.onEntry=[];change.state.onEntry.push(change.error);change.old[change.prop]=change.new;}else{change.old[change.prop]=change.new||change.error;}});}function asyncStarted(){asyncCount++;}function asyncDone(){asyncCount--;
|
7054 | if(waitingForAsync&&asyncCount===0){completeAnalysis();}}function completeAnalysis(){if(syntaxErrors.length){scJson=undefined;}else{commitChanges(scJson);}done({scJson:scJson,errors:syntaxErrors});}processState(scJson,'scJson');if(asyncCount===0){completeAnalysis();}else{
|
7055 | waitingForAsync=true;}}};module.exports=scJsonAnalyzer;},{"./file-utils":4,"esprima":20}],6:[function(require,module,exports){module.exports={scxmlToScjson:require('../compiler/scxml-to-scjson'),scjsonToModule:require('../compiler/scjson-to-module'),scJsonAnalyzer:require('../compiler/static-analysis/scjson-analyzer')};},{"../compiler/scjson-to-module":2,"../compiler/scxml-to-scjson":3,"../compiler/static-analysis/scjson-analyzer":5}],7:[function(require,module,exports){ |
7056 |
|
7057 |
|
7058 |
|
7059 |
|
7060 |
|
7061 |
|
7062 |
|
7063 |
|
7064 |
|
7065 |
|
7066 |
|
7067 |
|
7068 |
|
7069 | "use strict";var compilerInternals=require('./compiler-internals'),platform=require('./platform-bootstrap/node/platform'),fs=require('fs'),vm=require('vm'),assert=require('assert');var scxmlToScjson=compilerInternals.scxmlToScjson,scjsonToModule=compilerInternals.scjsonToModule,scJsonAnalyzer=compilerInternals.scJsonAnalyzer; |
7070 |
|
7071 |
|
7072 |
|
7073 |
|
7074 |
|
7075 |
|
7076 | function documentStringToModel(url,docString,cb,hostContext){if((typeof hostContext==="undefined"?"undefined":_typeof(hostContext))!=='object'||hostContext===null){hostContext={};}var scJson=scxmlToScjson(docString);scJsonAnalyzer.analyze(scJson,url,hostContext,function(result){if(result.errors.length){cb(result.errors);return;};createModule(url,result.scJson,hostContext,cb);});}function fetchScript(scriptInfo,hostContext){return new Promise(function(resolve,reject){platform.getScriptFromUrl(scriptInfo.src,function(err,compiledScript,mimeType){if(err){reject(err);}else{scriptInfo.compiled=compiledScript;resolve(scriptInfo);}},hostContext,{lineOffset:scriptInfo.$line,columnOffset:scriptInfo.$column,$wrap:scriptInfo.$wrap});});} |
7077 |
|
7078 |
|
7079 |
|
7080 |
|
7081 |
|
7082 | function compileModule(docUrl,rawModule,hostContext,cb){var promiseOffset=2;var rootScripts=rawModule.rootScripts;var scriptCount=rootScripts.length;var promises=new Array(scriptCount+promiseOffset);for(var i=0;i<scriptCount;i++){var curScript=rootScripts[i];if(curScript.src){curScript.src=platform.url.resolve(docUrl,curScript.src);
|
7083 | promises[i+promiseOffset]=Promise.resolve(curScript);}else{promises[i+promiseOffset]=new Promise(function(resolve,reject){try{var content=curScript.content;delete curScript.content;var compiledScript=platform.module.compileScript(content,{filename:docUrl,lineOffset:curScript.$line,columnOffset:curScript.$column});curScript.compiled=compiledScript;resolve(curScript);}catch(e){reject(e);}});}}promises[0]=new Promise(function(resolve,reject){try{var compiledModule=platform.module.compileScript(rawModule.module,{filename:docUrl});resolve(compiledModule);}catch(e){reject(e);}});promises[1]=new Promise(function(resolve,reject){if(!rawModule.datamodel){resolve(undefined);}else{try{var compiledDatamodel=platform.module.compileScript(rawModule.datamodel,{filename:docUrl});resolve(compiledDatamodel);}catch(e){reject(e);}}});Promise.all(promises).then(function compileSuccess(scripts){var compiledModule=scripts.shift();var datamodelDecl=scripts.shift();var model=new SCModel(rawModule.name,datamodelDecl,rootScripts,compiledModule);cb(null,model);},function compileError(err){cb(err);});}function SCModel(name,datamodel,rootScripts,scxmlModule){this.name=name;this.datamodel=datamodel;this.rootScripts=rootScripts;this.module=scxmlModule;} |
7084 |
|
7085 |
|
7086 |
|
7087 |
|
7088 |
|
7089 |
|
7090 | SCModel.prototype.prepare=function(cb,executionContext,hostContext){if(!executionContext){executionContext=platform.module.createExecutionContext();}if(!vm.isContext(executionContext)){executionContext=vm.createContext(executionContext);}if((typeof hostContext==="undefined"?"undefined":_typeof(hostContext))!=='object'||hostContext===null){hostContext={};}var scriptCount=this.rootScripts.length;var scriptPromises=new Array(scriptCount);for(var i=0;i<scriptCount;i++){var curScript=this.rootScripts[i];if(curScript.src){
|
7091 | scriptPromises[i]=fetchScript(curScript,hostContext);}else{assert(curScript.compiled);scriptPromises[i]=Promise.resolve(curScript);}}var self=this;Promise.all(scriptPromises).then(function resolved(scripts){try{if(self.datamodel){self.datamodel.runInContext(executionContext);}for(var _i2=0;_i2<scriptCount;_i2++){self.rootScripts[_i2].compiled.runInContext(executionContext);}var modelFn=self.module.runInContext(executionContext);cb(undefined,modelFn);}catch(e){cb(e);}},function rejected(err){cb(err);});};function createModule(url,scJson,hostContext,cb){if(platform.debug){console.log('scjson',JSON.stringify(scJson,undefined,2));if(!hostContext.hasOwnProperty('debug')){hostContext.debug=true;}}scjsonToModule(url,scJson,hostContext).then(function resolved(rawModule){if(platform.debug&&rawModule.name){fs.writeFileSync('/var/tmp/'+rawModule.name+'.scion',rawModule.module);}compileModule(url,rawModule,hostContext,cb);},function rejected(err){cb(err);});}module.exports=documentStringToModel;},{"./compiler-internals":6,"./platform-bootstrap/node/platform":10,"assert":12,"fs":15,"vm":61}],8:[function(require,module,exports){ |
7092 |
|
7093 |
|
7094 |
|
7095 |
|
7096 |
|
7097 |
|
7098 |
|
7099 |
|
7100 |
|
7101 |
|
7102 |
|
7103 |
|
7104 |
|
7105 | "use strict";var platform=require('./platform-bootstrap/node/platform'),documentStringToModel=require('./document-string-to-model'); |
7106 |
|
7107 |
|
7108 |
|
7109 |
|
7110 |
|
7111 |
|
7112 |
|
7113 |
|
7114 |
|
7115 |
|
7116 | function urlToModel(url,cb,context){platform.http.get(url,function(err,doc){if(err){cb(err,null);}else{documentStringToModel(url,doc,cb,context);}},context);} |
7117 |
|
7118 |
|
7119 |
|
7120 | function pathToModel(url,cb,context){context=context||{};context.isLoadedFromFile=true;
|
7121 | platform.fs.get(url,function(err,doc){if(err){cb(err,null);}else{documentStringToModel(url,doc,cb,context);}},context);} |
7122 |
|
7123 |
|
7124 |
|
7125 | function documentToModel(doc,cb,context){var s=platform.dom.serializeToString(doc);documentStringToModel(null,s,cb,context);}
|
7126 | module.exports={pathToModel:pathToModel,urlToModel:urlToModel,documentStringToModel:documentStringToModel,documentToModel:documentToModel,ext:{platform:platform,compilerInternals:require('./compiler-internals')
|
7127 | },scion:require('scion-core')};},{"./compiler-internals":6,"./document-string-to-model":7,"./platform-bootstrap/node/platform":10,"scion-core":1}],9:[function(require,module,exports){ |
7128 |
|
7129 |
|
7130 |
|
7131 |
|
7132 |
|
7133 |
|
7134 |
|
7135 |
|
7136 |
|
7137 |
|
7138 |
|
7139 |
|
7140 |
|
7141 | "use strict"; |
7142 |
|
7143 | var http=require('http'),urlM=require('url'),fs=require('fs');function httpGet(url,cb){var options=urlM.parse(url);http.get(options,function(res){var s="";res.on('data',function(d){s+=d;});res.on('end',function(){if(res.statusCode===200){cb(null,s);}else{cb(new Error('HTTP code '+res.statusCode+' : '+s));}});}).on('error',function(e){cb(e);});}function getResource(url,cb,context){var urlObj=urlM.parse(url);if(urlObj.protocol==='http:'||url.protocol==='https:'||typeof window!=='undefined'
|
7144 | ){httpGet(url,cb);}else if(!urlObj.protocol){
|
7145 | fs.readFile(url,'utf8',cb);}else{
|
7146 | cb(new Error("Unrecognized protocol"));}}module.exports={getResource:getResource,httpGet:httpGet};},{"fs":15,"http":49,"url":56}],10:[function(require,module,exports){(function(process){ |
7147 |
|
7148 |
|
7149 |
|
7150 |
|
7151 |
|
7152 |
|
7153 |
|
7154 |
|
7155 |
|
7156 |
|
7157 |
|
7158 |
|
7159 |
|
7160 | "use strict";var fs=require('fs'),_get=require('./get'),pathModule=require('path'),vm=require('vm'),url=require('./url'),Module=require('module');module.exports={
|
7161 | http:{get:function get(url,cb){_get.httpGet(url,cb);}},fs:{get:function get(path,cb,context){fs.readFile(path,'utf8',cb);}},getResourceFromUrl:_get.getResource,getScriptFromUrl:function getScriptFromUrl(url,cb,context,scriptInfo){_get.getResource(url,function(err,content){if(err){cb(err);return;}if(typeof scriptInfo.$wrap==='function'){content=scriptInfo.$wrap(content);}var options=Object.assign({filename:url},scriptInfo);try{var script=new vm.Script(content,options);cb(undefined,script);}catch(e){cb(e);}},context);},path:require('path'),
|
7162 | url:{resolve:url.resolve},module:{createLocalExecutionContext:function createLocalExecutionContext(docPath,sandbox){if(!sandbox){sandbox={console:console};sandbox.global=sandbox;}var ctx=vm.createContext(sandbox);ctx.__filename=docPath;ctx.__dirname=pathModule.dirname(ctx.__filename);
|
7163 | var _module=ctx.module=new Module(docPath);var _require=ctx.require=function(path){return Module._load(path,_module,true);};_module.filename=ctx.__filename;_require.paths=_module.paths=Module._nodeModulePaths(process.cwd());_require.resolve=function(request){return Module._resolveFilename(request,_module);};return ctx;}, |
7164 |
|
7165 |
|
7166 |
|
7167 |
|
7168 | createExecutionContext:function createExecutionContext(sandbox,hostContext){return vm.createContext(sandbox);}, |
7169 |
|
7170 |
|
7171 |
|
7172 |
|
7173 |
|
7174 |
|
7175 |
|
7176 |
|
7177 | compileScript:function compileScript(src,options){return new vm.Script(src,options);},eval:function _eval(s,fileName,context){context=context||{};fileName=fileName||'';
|
7178 |
|
7179 |
|
7180 | var sandbox={};sandbox.global=sandbox;var ctx=vm.createContext(sandbox);if(context.isLoadedFromFile){ctx.__filename=fileName;ctx.__dirname=pathModule.dirname(ctx.__filename);
|
7181 | var _module=ctx.module=new Module(fileName);var _require=ctx.require=function(path){return Module._load(path,_module,true);};_module.filename=ctx.__filename;_require.paths=_module.paths=Module._nodeModulePaths(process.cwd());_require.resolve=function(request){return Module._resolveFilename(request,_module);};}else{
|
7182 | ctx.require=context.require||
|
7183 | require.main&&
|
7184 | require.main.require&&require.main.require.bind(require.main)||require;
|
7185 | }
|
7186 | return vm.runInContext(s,ctx,fileName);}},dom:{serializeToString:function serializeToString(node){throw new Error('Platform method dom.serializeToString is not supported.');
|
7187 | }},log:console.log};}).call(this,require('_process'));},{"./get":9,"./url":11,"_process":31,"fs":15,"module":15,"path":29,"vm":61}],11:[function(require,module,exports){ |
7188 |
|
7189 |
|
7190 |
|
7191 |
|
7192 |
|
7193 |
|
7194 |
|
7195 |
|
7196 |
|
7197 |
|
7198 |
|
7199 |
|
7200 |
|
7201 | "use strict";var urlModule=require('url');module.exports={getPathFromUrl:function getPathFromUrl(url){var oUrl=urlModule.parse(url);return oUrl.pathname;},changeUrlPath:function changeUrlPath(url,newPath){var oUrl=urlModule.parse(url);oUrl.path=oUrl.pathname=newPath;return urlModule.format(oUrl);},resolve:function resolve(base,target){return urlModule.resolve(base,target);}};},{"url":56}],12:[function(require,module,exports){
|
7202 |
|
7203 |
|
7204 |
|
7205 |
|
7206 |
|
7207 |
|
7208 |
|
7209 |
|
7210 |
|
7211 |
|
7212 |
|
7213 |
|
7214 |
|
7215 |
|
7216 |
|
7217 |
|
7218 |
|
7219 |
|
7220 |
|
7221 |
|
7222 |
|
7223 |
|
7224 |
|
7225 |
|
7226 |
|
7227 | var util=require('util/');var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;
|
7228 |
|
7229 |
|
7230 | var assert=module.exports=ok;
|
7231 |
|
7232 |
|
7233 |
|
7234 | assert.AssertionError=function AssertionError(options){this.name='AssertionError';this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false;}else{this.message=getMessage(this);this.generatedMessage=true;}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction);}else{
|
7235 | var err=new Error();if(err.stack){var out=err.stack;
|
7236 | var fn_name=stackStartFunction.name;var idx=out.indexOf('\n'+fn_name);if(idx>=0){
|
7237 |
|
7238 | var next_line=out.indexOf('\n',idx+1);out=out.substring(next_line+1);}this.stack=out;}}};
|
7239 | util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return''+value;}if(util.isNumber(value)&&!isFinite(value)){return value.toString();}if(util.isFunction(value)||util.isRegExp(value)){return value.toString();}return value;}function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n);}else{return s;}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+' '+self.operator+' '+truncate(JSON.stringify(self.expected,replacer),128);}
|
7240 |
|
7241 |
|
7242 |
|
7243 |
|
7244 |
|
7245 |
|
7246 |
|
7247 |
|
7248 | function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction});}
|
7249 | assert.fail=fail;
|
7250 |
|
7251 |
|
7252 |
|
7253 |
|
7254 |
|
7255 | function ok(value,message){if(!value)fail(value,true,message,'==',assert.ok);}assert.ok=ok;
|
7256 |
|
7257 |
|
7258 | assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,'==',assert.equal);};
|
7259 |
|
7260 | assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,'!=',assert.notEqual);}};
|
7261 |
|
7262 | assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,'deepEqual',assert.deepEqual);}};function _deepEqual(actual,expected){
|
7263 | if(actual===expected){return true;}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false;}return true;
|
7264 |
|
7265 | }else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime();
|
7266 |
|
7267 |
|
7268 | }else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase;
|
7269 |
|
7270 | }else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected;
|
7271 |
|
7272 |
|
7273 |
|
7274 |
|
7275 |
|
7276 | }else{return objEquiv(actual,expected);}}function isArguments(object){return Object.prototype.toString.call(object)=='[object Arguments]';}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;
|
7277 | if(a.prototype!==b.prototype)return false;
|
7278 | if(util.isPrimitive(a)||util.isPrimitive(b)){return a===b;}var aIsArgs=isArguments(a),bIsArgs=isArguments(b);if(aIsArgs&&!bIsArgs||!aIsArgs&&bIsArgs)return false;if(aIsArgs){a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b);}var ka=objectKeys(a),kb=objectKeys(b),key,i;
|
7279 |
|
7280 | if(ka.length!=kb.length)return false;
|
7281 | ka.sort();kb.sort();
|
7282 | for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false;}
|
7283 |
|
7284 | for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false;}return true;}
|
7285 |
|
7286 | assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,'notDeepEqual',assert.notDeepEqual);}};
|
7287 |
|
7288 | assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,'===',assert.strictEqual);}};
|
7289 |
|
7290 | assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,'!==',assert.notStrictEqual);}};function expectedException(actual,expected){if(!actual||!expected){return false;}if(Object.prototype.toString.call(expected)=='[object RegExp]'){return expected.test(actual);}else if(actual instanceof expected){return true;}else if(expected.call({},actual)===true){return true;}return false;}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null;}try{block();}catch(e){actual=e;}message=(expected&&expected.name?' ('+expected.name+').':'.')+(message?' '+message:'.');if(shouldThrow&&!actual){fail(actual,expected,'Missing expected exception'+message);}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,'Got unwanted exception'+message);}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual;}}
|
7291 |
|
7292 | assert.throws=function(block,/*optional*/error,/*optional*/message){_throws.apply(this,[true].concat(pSlice.call(arguments)));};
|
7293 | assert.doesNotThrow=function(block,/*optional*/message){_throws.apply(this,[false].concat(pSlice.call(arguments)));};assert.ifError=function(err){if(err){throw err;}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key);}return keys;};},{"util/":60}],13:[function(require,module,exports){'use strict';exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=='undefined'?Uint8Array:Array;var code='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i;}revLookup['-'.charCodeAt(0)]=62;revLookup['_'.charCodeAt(0)]=63;function placeHoldersCount(b64){var len=b64.length;if(len%4>0){throw new Error('Invalid string. Length must be a multiple of 4');}
|
7294 |
|
7295 |
|
7296 |
|
7297 |
|
7298 | return b64[len-2]==='='?2:b64[len-1]==='='?1:0;}function byteLength(b64){
|
7299 | return b64.length*3/4-placeHoldersCount(b64);}function toByteArray(b64){var i,j,l,tmp,placeHolders,arr;var len=b64.length;placeHolders=placeHoldersCount(b64);arr=new Arr(len*3/4-placeHolders);
|
7300 | l=placeHolders>0?len-4:len;var L=0;for(i=0,j=0;i<l;i+=4,j+=3){tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)];arr[L++]=tmp>>16&0xFF;arr[L++]=tmp>>8&0xFF;arr[L++]=tmp&0xFF;}if(placeHolders===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[L++]=tmp&0xFF;}else if(placeHolders===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[L++]=tmp>>8&0xFF;arr[L++]=tmp&0xFF;}return arr;}function tripletToBase64(num){return lookup[num>>18&0x3F]+lookup[num>>12&0x3F]+lookup[num>>6&0x3F]+lookup[num&0x3F];}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;i<end;i+=3){tmp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output.push(tripletToBase64(tmp));}return output.join('');}function fromByteArray(uint8){var tmp;var len=uint8.length;var extraBytes=len%3;
|
7301 | var output='';var parts=[];var maxChunkLength=16383;
|
7302 |
|
7303 | for(var i=0,len2=len-extraBytes;i<len2;i+=maxChunkLength){parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength));}
|
7304 | if(extraBytes===1){tmp=uint8[len-1];output+=lookup[tmp>>2];output+=lookup[tmp<<4&0x3F];output+='==';}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];output+=lookup[tmp>>10];output+=lookup[tmp>>4&0x3F];output+=lookup[tmp<<2&0x3F];output+='=';}parts.push(output);return parts.join('');}},{}],14:[function(require,module,exports){},{}],15:[function(require,module,exports){arguments[4][14][0].apply(exports,arguments);},{"dup":14}],16:[function(require,module,exports){(function(global){'use strict';var buffer=require('buffer');var Buffer=buffer.Buffer;var SlowBuffer=buffer.SlowBuffer;var MAX_LEN=buffer.kMaxLength||2147483647;exports.alloc=function alloc(size,fill,encoding){if(typeof Buffer.alloc==='function'){return Buffer.alloc(size,fill,encoding);}if(typeof encoding==='number'){throw new TypeError('encoding must not be number');}if(typeof size!=='number'){throw new TypeError('size must be a number');}if(size>MAX_LEN){throw new RangeError('size is too large');}var enc=encoding;var _fill=fill;if(_fill===undefined){enc=undefined;_fill=0;}var buf=new Buffer(size);if(typeof _fill==='string'){var fillBuf=new Buffer(_fill,enc);var flen=fillBuf.length;var i=-1;while(++i<size){buf[i]=fillBuf[i%flen];}}else{buf.fill(_fill);}return buf;};exports.allocUnsafe=function allocUnsafe(size){if(typeof Buffer.allocUnsafe==='function'){return Buffer.allocUnsafe(size);}if(typeof size!=='number'){throw new TypeError('size must be a number');}if(size>MAX_LEN){throw new RangeError('size is too large');}return new Buffer(size);};exports.from=function from(value,encodingOrOffset,length){if(typeof Buffer.from==='function'&&(!global.Uint8Array||Uint8Array.from!==Buffer.from)){return Buffer.from(value,encodingOrOffset,length);}if(typeof value==='number'){throw new TypeError('"value" argument must not be a number');}if(typeof value==='string'){return new Buffer(value,encodingOrOffset);}if(typeof ArrayBuffer!=='undefined'&&value instanceof ArrayBuffer){var offset=encodingOrOffset;if(arguments.length===1){return new Buffer(value);}if(typeof offset==='undefined'){offset=0;}var len=length;if(typeof len==='undefined'){len=value.byteLength-offset;}if(offset>=value.byteLength){throw new RangeError('\'offset\' is out of bounds');}if(len>value.byteLength-offset){throw new RangeError('\'length\' is out of bounds');}return new Buffer(value.slice(offset,offset+len));}if(Buffer.isBuffer(value)){var out=new Buffer(value.length);value.copy(out,0,0,value.length);return out;}if(value){if(Array.isArray(value)||typeof ArrayBuffer!=='undefined'&&value.buffer instanceof ArrayBuffer||'length'in value){return new Buffer(value);}if(value.type==='Buffer'&&Array.isArray(value.data)){return new Buffer(value.data);}}throw new TypeError('First argument must be a string, Buffer, '+'ArrayBuffer, Array, or array-like object.');};exports.allocUnsafeSlow=function allocUnsafeSlow(size){if(typeof Buffer.allocUnsafeSlow==='function'){return Buffer.allocUnsafeSlow(size);}if(typeof size!=='number'){throw new TypeError('size must be a number');}if(size>=MAX_LEN){throw new RangeError('size is too large');}return new SlowBuffer(size);};}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"buffer":17}],17:[function(require,module,exports){(function(global){ |
7305 |
|
7306 |
|
7307 |
|
7308 |
|
7309 | 'use strict';var base64=require('base64-js');var ieee754=require('ieee754');var isArray=require('isarray');exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50; |
7310 |
|
7311 |
|
7312 |
|
7313 |
|
7314 |
|
7315 |
|
7316 |
|
7317 |
|
7318 |
|
7319 |
|
7320 |
|
7321 |
|
7322 |
|
7323 |
|
7324 |
|
7325 |
|
7326 |
|
7327 |
|
7328 |
|
7329 |
|
7330 |
|
7331 |
|
7332 | Buffer.TYPED_ARRAY_SUPPORT=global.TYPED_ARRAY_SUPPORT!==undefined?global.TYPED_ARRAY_SUPPORT:typedArraySupport(); |
7333 |
|
7334 | exports.kMaxLength=kMaxLength();function typedArraySupport(){try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function foo(){return 42;}};return arr.foo()===42&&
|
7335 | typeof arr.subarray==='function'&&
|
7336 | arr.subarray(1,1).byteLength===0;
|
7337 | }catch(e){return false;}}function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?0x7fffffff:0x3fffffff;}function createBuffer(that,length){if(kMaxLength()<length){throw new RangeError('Invalid typed array length');}if(Buffer.TYPED_ARRAY_SUPPORT){
|
7338 | that=new Uint8Array(length);that.__proto__=Buffer.prototype;}else{
|
7339 | if(that===null){that=new Buffer(length);}that.length=length;}return that;} |
7340 |
|
7341 |
|
7342 |
|
7343 |
|
7344 |
|
7345 |
|
7346 |
|
7347 | function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}
|
7348 | if(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}Buffer.poolSize=8192;
|
7349 |
|
7350 | Buffer._augment=function(arr){arr.__proto__=Buffer.prototype;return arr;};function from(that,value,encodingOrOffset,length){if(typeof value==='number'){throw new TypeError('"value" argument must not be a number');}if(typeof ArrayBuffer!=='undefined'&&value instanceof ArrayBuffer){return fromArrayBuffer(that,value,encodingOrOffset,length);}if(typeof value==='string'){return fromString(that,value,encodingOrOffset);}return fromObject(that,value);} |
7351 |
|
7352 |
|
7353 |
|
7354 |
|
7355 |
|
7356 |
|
7357 | Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length);};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;if(typeof Symbol!=='undefined'&&Symbol.species&&Buffer[Symbol.species]===Buffer){
|
7358 | Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true});}}function assertSize(size){if(typeof size!=='number'){throw new TypeError('"size" argument must be a number');}else if(size<0){throw new RangeError('"size" argument must not be negative');}}function alloc(that,size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(that,size);}if(fill!==undefined){
|
7359 |
|
7360 |
|
7361 | return typeof encoding==='string'?createBuffer(that,size).fill(fill,encoding):createBuffer(that,size).fill(fill);}return createBuffer(that,size);} |
7362 |
|
7363 |
|
7364 | Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding);};function allocUnsafe(that,size){assertSize(size);that=createBuffer(that,size<0?0:checked(size)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i<size;++i){that[i]=0;}}return that;} |
7365 |
|
7366 | Buffer.allocUnsafe=function(size){return allocUnsafe(null,size);}; |
7367 |
|
7368 | Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size);};function fromString(that,string,encoding){if(typeof encoding!=='string'||encoding===''){encoding='utf8';}if(!Buffer.isEncoding(encoding)){throw new TypeError('"encoding" must be a valid string encoding');}var length=byteLength(string,encoding)|0;that=createBuffer(that,length);var actual=that.write(string,encoding);if(actual!==length){
|
7369 |
|
7370 |
|
7371 | that=that.slice(0,actual);}return that;}function fromArrayLike(that,array){var length=array.length<0?0:checked(array.length)|0;that=createBuffer(that,length);for(var i=0;i<length;i+=1){that[i]=array[i]&255;}return that;}function fromArrayBuffer(that,array,byteOffset,length){array.byteLength;
|
7372 | if(byteOffset<0||array.byteLength<byteOffset){throw new RangeError('\'offset\' is out of bounds');}if(array.byteLength<byteOffset+(length||0)){throw new RangeError('\'length\' is out of bounds');}if(byteOffset===undefined&&length===undefined){array=new Uint8Array(array);}else if(length===undefined){array=new Uint8Array(array,byteOffset);}else{array=new Uint8Array(array,byteOffset,length);}if(Buffer.TYPED_ARRAY_SUPPORT){
|
7373 | that=array;that.__proto__=Buffer.prototype;}else{
|
7374 | that=fromArrayLike(that,array);}return that;}function fromObject(that,obj){if(Buffer.isBuffer(obj)){var len=checked(obj.length)|0;that=createBuffer(that,len);if(that.length===0){return that;}obj.copy(that,0,0,len);return that;}if(obj){if(typeof ArrayBuffer!=='undefined'&&obj.buffer instanceof ArrayBuffer||'length'in obj){if(typeof obj.length!=='number'||isnan(obj.length)){return createBuffer(that,0);}return fromArrayLike(that,obj);}if(obj.type==='Buffer'&&isArray(obj.data)){return fromArrayLike(that,obj.data);}}throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');}function checked(length){
|
7375 |
|
7376 | if(length>=kMaxLength()){throw new RangeError('Attempt to allocate Buffer larger than maximum '+'size: 0x'+kMaxLength().toString(16)+' bytes');}return length|0;}function SlowBuffer(length){if(+length!=length){
|
7377 | length=0;}return Buffer.alloc(+length);}Buffer.isBuffer=function isBuffer(b){return!!(b!=null&&b._isBuffer);};Buffer.compare=function compare(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('Arguments must be Buffers');}if(a===b)return 0;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len;++i){if(a[i]!==b[i]){x=a[i];y=b[i];break;}}if(x<y)return-1;if(y<x)return 1;return 0;};Buffer.isEncoding=function isEncoding(encoding){switch(String(encoding).toLowerCase()){case'hex':case'utf8':case'utf-8':case'ascii':case'latin1':case'binary':case'base64':case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return true;default:return false;}};Buffer.concat=function concat(list,length){if(!isArray(list)){throw new TypeError('"list" argument must be an Array of Buffers');}if(list.length===0){return Buffer.alloc(0);}var i;if(length===undefined){length=0;for(i=0;i<list.length;++i){length+=list[i].length;}}var buffer=Buffer.allocUnsafe(length);var pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers');}buf.copy(buffer,pos);pos+=buf.length;}return buffer;};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length;}if(typeof ArrayBuffer!=='undefined'&&typeof ArrayBuffer.isView==='function'&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer)){return string.byteLength;}if(typeof string!=='string'){string=''+string;}var len=string.length;if(len===0)return 0;
|
7378 | var loweredCase=false;for(;;){switch(encoding){case'ascii':case'latin1':case'binary':return len;case'utf8':case'utf-8':case undefined:return utf8ToBytes(string).length;case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return len*2;case'hex':return len>>>1;case'base64':return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;
|
7379 | encoding=(''+encoding).toLowerCase();loweredCase=true;}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;
|
7380 |
|
7381 |
|
7382 |
|
7383 |
|
7384 |
|
7385 | if(start===undefined||start<0){start=0;}
|
7386 |
|
7387 | if(start>this.length){return'';}if(end===undefined||end>this.length){end=this.length;}if(end<=0){return'';}
|
7388 | end>>>=0;start>>>=0;if(end<=start){return'';}if(!encoding)encoding='utf8';while(true){switch(encoding){case'hex':return hexSlice(this,start,end);case'utf8':case'utf-8':return utf8Slice(this,start,end);case'ascii':return asciiSlice(this,start,end);case'latin1':case'binary':return latin1Slice(this,start,end);case'base64':return base64Slice(this,start,end);case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError('Unknown encoding: '+encoding);encoding=(encoding+'').toLowerCase();loweredCase=true;}}}
|
7389 |
|
7390 | Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i;}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError('Buffer size must be a multiple of 16-bits');}for(var i=0;i<len;i+=2){swap(this,i,i+1);}return this;};Buffer.prototype.swap32=function swap32(){var len=this.length;if(len%4!==0){throw new RangeError('Buffer size must be a multiple of 32-bits');}for(var i=0;i<len;i+=4){swap(this,i,i+3);swap(this,i+1,i+2);}return this;};Buffer.prototype.swap64=function swap64(){var len=this.length;if(len%8!==0){throw new RangeError('Buffer size must be a multiple of 64-bits');}for(var i=0;i<len;i+=8){swap(this,i,i+7);swap(this,i+1,i+6);swap(this,i+2,i+5);swap(this,i+3,i+4);}return this;};Buffer.prototype.toString=function toString(){var length=this.length|0;if(length===0)return'';if(arguments.length===0)return utf8Slice(this,0,length);return slowToString.apply(this,arguments);};Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError('Argument must be a Buffer');if(this===b)return true;return Buffer.compare(this,b)===0;};Buffer.prototype.inspect=function inspect(){var str='';var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString('hex',0,max).match(/.{2}/g).join(' ');if(this.length>max)str+=' ... ';}return'<Buffer '+str+'>';};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target)){throw new TypeError('Argument must be a Buffer');}if(start===undefined){start=0;}if(end===undefined){end=target?target.length:0;}if(thisStart===undefined){thisStart=0;}if(thisEnd===undefined){thisEnd=this.length;}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError('out of range index');}if(thisStart>=thisEnd&&start>=end){return 0;}if(thisStart>=thisEnd){return-1;}if(start>=end){return 1;}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i<len;++i){if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i];y=targetCopy[i];break;}}if(x<y)return-1;if(y<x)return 1;return 0;};
|
7391 |
|
7392 |
|
7393 |
|
7394 |
|
7395 |
|
7396 |
|
7397 |
|
7398 |
|
7399 | function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){
|
7400 | if(buffer.length===0)return-1;
|
7401 | if(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;
|
7402 | if(isNaN(byteOffset)){
|
7403 | byteOffset=dir?0:buffer.length-1;}
|
7404 | if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}
|
7405 | if(typeof val==='string'){val=Buffer.from(val,encoding);}
|
7406 | if(Buffer.isBuffer(val)){
|
7407 | if(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;
|
7408 | if(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==='ucs2'||encoding==='ucs-2'||encoding==='utf16le'||encoding==='utf-16le'){if(arr.length<2||val.length<2){return-1;}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2;}}function read(buf,i){if(indexSize===1){return buf[i];}else{return buf.readUInt16BE(i*indexSize);}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++){if(read(arr,i)===read(val,foundIndex===-1?0:i-foundIndex)){if(foundIndex===-1)foundIndex=i;if(i-foundIndex+1===valLength)return foundIndex*indexSize;}else{if(foundIndex!==-1)i-=i-foundIndex;foundIndex=-1;}}}else{if(byteOffset+valLength>arrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;j<valLength;j++){if(read(arr,i+j)!==read(val,j)){found=false;break;}}if(found)return i;}}return-1;}Buffer.prototype.includes=function includes(val,byteOffset,encoding){return this.indexOf(val,byteOffset,encoding)!==-1;};Buffer.prototype.indexOf=function indexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,true);};Buffer.prototype.lastIndexOf=function lastIndexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,false);};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining;}else{length=Number(length);if(length>remaining){length=remaining;}}
|
7409 | var strLen=string.length;if(strLen%2!==0)throw new TypeError('Invalid hex string');if(length>strLen/2){length=strLen/2;}for(var i=0;i<length;++i){var parsed=parseInt(string.substr(i*2,2),16);if(isNaN(parsed))return i;buf[offset+i]=parsed;}return i;}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length);}function asciiWrite(buf,string,offset,length){return blitBuffer(asciiToBytes(string),buf,offset,length);}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length);}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length);}function ucs2Write(buf,string,offset,length){return blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length);}Buffer.prototype.write=function write(string,offset,length,encoding){
|
7410 | if(offset===undefined){encoding='utf8';length=this.length;offset=0;
|
7411 | }else if(length===undefined&&typeof offset==='string'){encoding=offset;length=this.length;offset=0;
|
7412 | }else if(isFinite(offset)){offset=offset|0;if(isFinite(length)){length=length|0;if(encoding===undefined)encoding='utf8';}else{encoding=length;length=undefined;}
|
7413 | }else{throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError('Attempt to write outside buffer bounds');}if(!encoding)encoding='utf8';var loweredCase=false;for(;;){switch(encoding){case'hex':return hexWrite(this,string,offset,length);case'utf8':case'utf-8':return utf8Write(this,string,offset,length);case'ascii':return asciiWrite(this,string,offset,length);case'latin1':case'binary':return latin1Write(this,string,offset,length);case'base64':
|
7414 | return base64Write(this,string,offset,length);case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError('Unknown encoding: '+encoding);encoding=(''+encoding).toLowerCase();loweredCase=true;}}};Buffer.prototype.toJSON=function toJSON(){return{type:'Buffer',data:Array.prototype.slice.call(this._arr||this,0)};};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf);}else{return base64.fromByteArray(buf.slice(start,end));}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i<end){var firstByte=buf[i];var codePoint=null;var bytesPerSequence=firstByte>0xEF?4:firstByte>0xDF?3:firstByte>0xBF?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<0x80){codePoint=firstByte;}break;case 2:secondByte=buf[i+1];if((secondByte&0xC0)===0x80){tempCodePoint=(firstByte&0x1F)<<0x6|secondByte&0x3F;if(tempCodePoint>0x7F){codePoint=tempCodePoint;}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&0xC0)===0x80&&(thirdByte&0xC0)===0x80){tempCodePoint=(firstByte&0xF)<<0xC|(secondByte&0x3F)<<0x6|thirdByte&0x3F;if(tempCodePoint>0x7FF&&(tempCodePoint<0xD800||tempCodePoint>0xDFFF)){codePoint=tempCodePoint;}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&0xC0)===0x80&&(thirdByte&0xC0)===0x80&&(fourthByte&0xC0)===0x80){tempCodePoint=(firstByte&0xF)<<0x12|(secondByte&0x3F)<<0xC|(thirdByte&0x3F)<<0x6|fourthByte&0x3F;if(tempCodePoint>0xFFFF&&tempCodePoint<0x110000){codePoint=tempCodePoint;}}}}if(codePoint===null){
|
7415 |
|
7416 | codePoint=0xFFFD;bytesPerSequence=1;}else if(codePoint>0xFFFF){
|
7417 | codePoint-=0x10000;res.push(codePoint>>>10&0x3FF|0xD800);codePoint=0xDC00|codePoint&0x3FF;}res.push(codePoint);i+=bytesPerSequence;}return decodeCodePointsArray(res);}
|
7418 |
|
7419 |
|
7420 | var MAX_ARGUMENTS_LENGTH=0x1000;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints);
|
7421 | }
|
7422 | var res='';var i=0;while(i<len){res+=String.fromCharCode.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH));}return res;}function asciiSlice(buf,start,end){var ret='';end=Math.min(buf.length,end);for(var i=start;i<end;++i){ret+=String.fromCharCode(buf[i]&0x7F);}return ret;}function latin1Slice(buf,start,end){var ret='';end=Math.min(buf.length,end);for(var i=start;i<end;++i){ret+=String.fromCharCode(buf[i]);}return ret;}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out='';for(var i=start;i<end;++i){out+=toHex(buf[i]);}return out;}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res='';for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256);}return res;}Buffer.prototype.slice=function slice(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0;}else if(start>len){start=len;}if(end<0){end+=len;if(end<0)end=0;}else if(end>len){end=len;}if(end<start)end=start;var newBuf;if(Buffer.TYPED_ARRAY_SUPPORT){newBuf=this.subarray(start,end);newBuf.__proto__=Buffer.prototype;}else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,undefined);for(var i=0;i<sliceLen;++i){newBuf[i]=this[i+start];}}return newBuf;}; |
7423 |
|
7424 | function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=0x100)){val+=this[offset+i]*mul;}return val;};Buffer.prototype.readUIntBE=function readUIntBE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert){checkOffset(offset,byteLength,this.length);}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=0x100)){val+=this[offset+--byteLength]*mul;}return val;};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset];};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8;};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1];};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*0x1000000;};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*0x1000000+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3]);};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=0x100)){val+=this[offset+i]*mul;}mul*=0x80;if(val>=mul)val-=Math.pow(2,8*byteLength);return val;};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=0x100)){val+=this[offset+--i]*mul;}mul*=0x80;if(val>=mul)val-=Math.pow(2,8*byteLength);return val;};Buffer.prototype.readInt8=function readInt8(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&0x80))return this[offset];return(0xff-this[offset]+1)*-1;};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&0x8000?val|0xFFFF0000:val;};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&0x8000?val|0xFFFF0000:val;};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24;};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3];};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4);};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4);};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8);};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8);};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||value<min)throw new RangeError('"value" argument is out of bounds');if(offset+ext>buf.length)throw new RangeError('Index out of range');}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;byteLength=byteLength|0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0);}var mul=1;var i=0;this[offset]=value&0xFF;while(++i<byteLength&&(mul*=0x100)){this[offset+i]=value/mul&0xFF;}return offset+byteLength;};Buffer.prototype.writeUIntBE=function writeUIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;byteLength=byteLength|0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0);}var i=byteLength-1;var mul=1;this[offset+i]=value&0xFF;while(--i>=0&&(mul*=0x100)){this[offset+i]=value/mul&0xFF;}return offset+byteLength;};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,1,0xff,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value&0xff;return offset+1;};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=0xffff+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i<j;++i){buf[offset+i]=(value&0xff<<8*(littleEndian?i:1-i))>>>(littleEndian?i:1-i)*8;}}Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,0xffff,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value&0xff;this[offset+1]=value>>>8;}else{objectWriteUInt16(this,value,offset,true);}return offset+2;};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,0xffff,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value&0xff;}else{objectWriteUInt16(this,value,offset,false);}return offset+2;};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=0xffffffff+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i<j;++i){buf[offset+i]=value>>>(littleEndian?i:3-i)*8&0xff;}}Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,0xffffffff,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&0xff;}else{objectWriteUInt32(this,value,offset,true);}return offset+4;};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,0xffffffff,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&0xff;}else{objectWriteUInt32(this,value,offset,false);}return offset+4;};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit);}var i=0;var mul=1;var sub=0;this[offset]=value&0xFF;while(++i<byteLength&&(mul*=0x100)){if(value<0&&sub===0&&this[offset+i-1]!==0){sub=1;}this[offset+i]=(value/mul>>0)-sub&0xFF;}return offset+byteLength;};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit);}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&0xFF;while(--i>=0&&(mul*=0x100)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1;}this[offset+i]=(value/mul>>0)-sub&0xFF;}return offset+byteLength;};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,1,0x7f,-0x80);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=0xff+value+1;this[offset]=value&0xff;return offset+1;};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,0x7fff,-0x8000);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value&0xff;this[offset+1]=value>>>8;}else{objectWriteUInt16(this,value,offset,true);}return offset+2;};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,0x7fff,-0x8000);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value&0xff;}else{objectWriteUInt16(this,value,offset,false);}return offset+2;};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,0x7fffffff,-0x80000000);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value&0xff;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;}else{objectWriteUInt32(this,value,offset,true);}return offset+4;};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,0x7fffffff,-0x80000000);if(value<0)value=0xffffffff+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&0xff;}else{objectWriteUInt32(this,value,offset,false);}return offset+4;};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError('Index out of range');if(offset<0)throw new RangeError('Index out of range');}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert){checkIEEE754(buf,value,offset,4,3.4028234663852886e+38,-3.4028234663852886e+38);}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4;}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert);};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert);};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert){checkIEEE754(buf,value,offset,8,1.7976931348623157E+308,-1.7976931348623157E+308);}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8;}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert);};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert);};
|
7425 | Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end<start)end=start;
|
7426 | if(end===start)return 0;if(target.length===0||this.length===0)return 0;
|
7427 | if(targetStart<0){throw new RangeError('targetStart out of bounds');}if(start<0||start>=this.length)throw new RangeError('sourceStart out of bounds');if(end<0)throw new RangeError('sourceEnd out of bounds');
|
7428 | if(end>this.length)end=this.length;if(target.length-targetStart<end-start){end=target.length-targetStart+start;}var len=end-start;var i;if(this===target&&start<targetStart&&targetStart<end){
|
7429 | for(i=len-1;i>=0;--i){target[i+targetStart]=this[i+start];}}else if(len<1000||!Buffer.TYPED_ARRAY_SUPPORT){
|
7430 | for(i=0;i<len;++i){target[i+targetStart]=this[i+start];}}else{Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart);}return len;};
|
7431 |
|
7432 |
|
7433 |
|
7434 | Buffer.prototype.fill=function fill(val,start,end,encoding){
|
7435 | if(typeof val==='string'){if(typeof start==='string'){encoding=start;start=0;end=this.length;}else if(typeof end==='string'){encoding=end;end=this.length;}if(val.length===1){var code=val.charCodeAt(0);if(code<256){val=code;}}if(encoding!==undefined&&typeof encoding!=='string'){throw new TypeError('encoding must be a string');}if(typeof encoding==='string'&&!Buffer.isEncoding(encoding)){throw new TypeError('Unknown encoding: '+encoding);}}else if(typeof val==='number'){val=val&255;}
|
7436 | if(start<0||this.length<start||this.length<end){throw new RangeError('Out of range index');}if(end<=start){return this;}start=start>>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==='number'){for(i=start;i<end;++i){this[i]=val;}}else{var bytes=Buffer.isBuffer(val)?val:utf8ToBytes(new Buffer(val,encoding).toString());var len=bytes.length;for(i=0;i<end-start;++i){this[i+start]=bytes[i%len];}}return this;};
|
7437 |
|
7438 | var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(str){
|
7439 | str=stringtrim(str).replace(INVALID_BASE64_RE,'');
|
7440 | if(str.length<2)return'';
|
7441 | while(str.length%4!==0){str=str+'=';}return str;}function stringtrim(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,'');}function toHex(n){if(n<16)return'0'+n.toString(16);return n.toString(16);}function utf8ToBytes(string,units){units=units||Infinity;var codePoint;var length=string.length;var leadSurrogate=null;var bytes=[];for(var i=0;i<length;++i){codePoint=string.charCodeAt(i);
|
7442 | if(codePoint>0xD7FF&&codePoint<0xE000){
|
7443 | if(!leadSurrogate){
|
7444 | if(codePoint>0xDBFF){
|
7445 | if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);continue;}else if(i+1===length){
|
7446 | if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);continue;}
|
7447 | leadSurrogate=codePoint;continue;}
|
7448 | if(codePoint<0xDC00){if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);leadSurrogate=codePoint;continue;}
|
7449 | codePoint=(leadSurrogate-0xD800<<10|codePoint-0xDC00)+0x10000;}else if(leadSurrogate){
|
7450 | if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);}leadSurrogate=null;
|
7451 | if(codePoint<0x80){if((units-=1)<0)break;bytes.push(codePoint);}else if(codePoint<0x800){if((units-=2)<0)break;bytes.push(codePoint>>0x6|0xC0,codePoint&0x3F|0x80);}else if(codePoint<0x10000){if((units-=3)<0)break;bytes.push(codePoint>>0xC|0xE0,codePoint>>0x6&0x3F|0x80,codePoint&0x3F|0x80);}else if(codePoint<0x110000){if((units-=4)<0)break;bytes.push(codePoint>>0x12|0xF0,codePoint>>0xC&0x3F|0x80,codePoint>>0x6&0x3F|0x80,codePoint&0x3F|0x80);}else{throw new Error('Invalid code point');}}return bytes;}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;++i){
|
7452 | byteArray.push(str.charCodeAt(i)&0xFF);}return byteArray;}function utf16leToBytes(str,units){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;++i){if((units-=2)<0)break;c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi);}return byteArray;}function base64ToBytes(str){return base64.toByteArray(base64clean(str));}function blitBuffer(src,dst,offset,length){for(var i=0;i<length;++i){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i];}return i;}function isnan(val){return val!==val;
|
7453 | }}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"base64-js":13,"ieee754":22,"isarray":26}],18:[function(require,module,exports){module.exports={"100":"Continue","101":"Switching Protocols","102":"Processing","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"};},{}],19:[function(require,module,exports){(function(Buffer){
|
7454 |
|
7455 |
|
7456 |
|
7457 |
|
7458 |
|
7459 |
|
7460 |
|
7461 |
|
7462 |
|
7463 |
|
7464 |
|
7465 |
|
7466 |
|
7467 |
|
7468 |
|
7469 |
|
7470 |
|
7471 |
|
7472 |
|
7473 |
|
7474 |
|
7475 | function isArray(arg){if(Array.isArray){return Array.isArray(arg);}return objectToString(arg)==='[object Array]';}exports.isArray=isArray;function isBoolean(arg){return typeof arg==='boolean';}exports.isBoolean=isBoolean;function isNull(arg){return arg===null;}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null;}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==='number';}exports.isNumber=isNumber;function isString(arg){return typeof arg==='string';}exports.isString=isString;function isSymbol(arg){return(typeof arg==="undefined"?"undefined":_typeof(arg))==='symbol';}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0;}exports.isUndefined=isUndefined;function isRegExp(re){return objectToString(re)==='[object RegExp]';}exports.isRegExp=isRegExp;function isObject(arg){return(typeof arg==="undefined"?"undefined":_typeof(arg))==='object'&&arg!==null;}exports.isObject=isObject;function isDate(d){return objectToString(d)==='[object Date]';}exports.isDate=isDate;function isError(e){return objectToString(e)==='[object Error]'||e instanceof Error;}exports.isError=isError;function isFunction(arg){return typeof arg==='function';}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==='boolean'||typeof arg==='number'||typeof arg==='string'||(typeof arg==="undefined"?"undefined":_typeof(arg))==='symbol'||
|
7476 | typeof arg==='undefined';}exports.isPrimitive=isPrimitive;exports.isBuffer=Buffer.isBuffer;function objectToString(o){return Object.prototype.toString.call(o);}}).call(this,{"isBuffer":require("../../is-buffer/index.js")});},{"../../is-buffer/index.js":25}],20:[function(require,module,exports){ |
7477 |
|
7478 |
|
7479 |
|
7480 |
|
7481 |
|
7482 |
|
7483 |
|
7484 |
|
7485 |
|
7486 |
|
7487 |
|
7488 |
|
7489 |
|
7490 |
|
7491 |
|
7492 |
|
7493 |
|
7494 |
|
7495 |
|
7496 |
|
7497 |
|
7498 | (function(root,factory){'use strict';
|
7499 |
|
7500 | if(typeof define==='function'&&define.amd){define(['exports'],factory);}else if(typeof exports!=='undefined'){factory(exports);}else{factory(root.esprima={});}})(this,function(exports){'use strict';var Token,TokenName,FnExprTokens,Syntax,PlaceHolders,Messages,Regex,source,strict,index,lineNumber,lineStart,hasLineTerminator,lastIndex,lastLineNumber,lastLineStart,startIndex,startLineNumber,startLineStart,scanning,length,lookahead,state,extra,isBindingElement,isAssignmentTarget,firstCoverInitializedNameError;Token={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9,Template:10};TokenName={};TokenName[Token.BooleanLiteral]='Boolean';TokenName[Token.EOF]='<end>';TokenName[Token.Identifier]='Identifier';TokenName[Token.Keyword]='Keyword';TokenName[Token.NullLiteral]='Null';TokenName[Token.NumericLiteral]='Numeric';TokenName[Token.Punctuator]='Punctuator';TokenName[Token.StringLiteral]='String';TokenName[Token.RegularExpression]='RegularExpression';TokenName[Token.Template]='Template';
|
7501 | FnExprTokens=['(','{','[','in','typeof','instanceof','new','return','case','delete','throw','void',
|
7502 | '=','+=','-=','*=','/=','%=','<<=','>>=','>>>=','&=','|=','^=',',',
|
7503 | '+','-','*','/','%','++','--','<<','>>','>>>','&','|','^','!','~','&&','||','?',':','===','==','>=','<=','<','>','!=','!=='];Syntax={AssignmentExpression:'AssignmentExpression',AssignmentPattern:'AssignmentPattern',ArrayExpression:'ArrayExpression',ArrayPattern:'ArrayPattern',ArrowFunctionExpression:'ArrowFunctionExpression',BlockStatement:'BlockStatement',BinaryExpression:'BinaryExpression',BreakStatement:'BreakStatement',CallExpression:'CallExpression',CatchClause:'CatchClause',ClassBody:'ClassBody',ClassDeclaration:'ClassDeclaration',ClassExpression:'ClassExpression',ConditionalExpression:'ConditionalExpression',ContinueStatement:'ContinueStatement',DoWhileStatement:'DoWhileStatement',DebuggerStatement:'DebuggerStatement',EmptyStatement:'EmptyStatement',ExportAllDeclaration:'ExportAllDeclaration',ExportDefaultDeclaration:'ExportDefaultDeclaration',ExportNamedDeclaration:'ExportNamedDeclaration',ExportSpecifier:'ExportSpecifier',ExpressionStatement:'ExpressionStatement',ForStatement:'ForStatement',ForOfStatement:'ForOfStatement',ForInStatement:'ForInStatement',FunctionDeclaration:'FunctionDeclaration',FunctionExpression:'FunctionExpression',Identifier:'Identifier',IfStatement:'IfStatement',ImportDeclaration:'ImportDeclaration',ImportDefaultSpecifier:'ImportDefaultSpecifier',ImportNamespaceSpecifier:'ImportNamespaceSpecifier',ImportSpecifier:'ImportSpecifier',Literal:'Literal',LabeledStatement:'LabeledStatement',LogicalExpression:'LogicalExpression',MemberExpression:'MemberExpression',MetaProperty:'MetaProperty',MethodDefinition:'MethodDefinition',NewExpression:'NewExpression',ObjectExpression:'ObjectExpression',ObjectPattern:'ObjectPattern',Program:'Program',Property:'Property',RestElement:'RestElement',ReturnStatement:'ReturnStatement',SequenceExpression:'SequenceExpression',SpreadElement:'SpreadElement',Super:'Super',SwitchCase:'SwitchCase',SwitchStatement:'SwitchStatement',TaggedTemplateExpression:'TaggedTemplateExpression',TemplateElement:'TemplateElement',TemplateLiteral:'TemplateLiteral',ThisExpression:'ThisExpression',ThrowStatement:'ThrowStatement',TryStatement:'TryStatement',UnaryExpression:'UnaryExpression',UpdateExpression:'UpdateExpression',VariableDeclaration:'VariableDeclaration',VariableDeclarator:'VariableDeclarator',WhileStatement:'WhileStatement',WithStatement:'WithStatement',YieldExpression:'YieldExpression'};PlaceHolders={ArrowParameterPlaceHolder:'ArrowParameterPlaceHolder'};
|
7504 | Messages={UnexpectedToken:'Unexpected token %0',UnexpectedNumber:'Unexpected number',UnexpectedString:'Unexpected string',UnexpectedIdentifier:'Unexpected identifier',UnexpectedReserved:'Unexpected reserved word',UnexpectedTemplate:'Unexpected quasi %0',UnexpectedEOS:'Unexpected end of input',NewlineAfterThrow:'Illegal newline after throw',InvalidRegExp:'Invalid regular expression',UnterminatedRegExp:'Invalid regular expression: missing /',InvalidLHSInAssignment:'Invalid left-hand side in assignment',InvalidLHSInForIn:'Invalid left-hand side in for-in',InvalidLHSInForLoop:'Invalid left-hand side in for-loop',MultipleDefaultsInSwitch:'More than one default clause in switch statement',NoCatchOrFinally:'Missing catch or finally after try',UnknownLabel:'Undefined label \'%0\'',Redeclaration:'%0 \'%1\' has already been declared',IllegalContinue:'Illegal continue statement',IllegalBreak:'Illegal break statement',IllegalReturn:'Illegal return statement',StrictModeWith:'Strict mode code may not include a with statement',StrictCatchVariable:'Catch variable may not be eval or arguments in strict mode',StrictVarName:'Variable name may not be eval or arguments in strict mode',StrictParamName:'Parameter name eval or arguments is not allowed in strict mode',StrictParamDupe:'Strict mode function may not have duplicate parameter names',StrictFunctionName:'Function name may not be eval or arguments in strict mode',StrictOctalLiteral:'Octal literals are not allowed in strict mode.',StrictDelete:'Delete of an unqualified identifier in strict mode.',StrictLHSAssignment:'Assignment to eval or arguments is not allowed in strict mode',StrictLHSPostfix:'Postfix increment/decrement may not have eval or arguments operand in strict mode',StrictLHSPrefix:'Prefix increment/decrement may not have eval or arguments operand in strict mode',StrictReservedWord:'Use of future reserved word in strict mode',TemplateOctalLiteral:'Octal literals are not allowed in template strings.',ParameterAfterRestParameter:'Rest parameter must be last formal parameter',DefaultRestParameter:'Unexpected token =',ObjectPatternAsRestParameter:'Unexpected token {',DuplicateProtoProperty:'Duplicate __proto__ fields are not allowed in object literals',ConstructorSpecialMethod:'Class constructor may not be an accessor',DuplicateConstructor:'A class may only have one constructor',StaticPrototype:'Classes may not have static property named prototype',MissingFromClause:'Unexpected token',NoAsAfterImportNamespace:'Unexpected token',InvalidModuleSpecifier:'Unexpected token',IllegalImportDeclaration:'Unexpected token',IllegalExportDeclaration:'Unexpected token',DuplicateBinding:'Duplicate binding %0'};
|
7505 | Regex={
|
7506 | NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,
|
7507 | NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};
|
7508 |
|
7509 |
|
7510 |
|
7511 | function assert(condition,message){if(!condition){throw new Error('ASSERT: '+message);}}function isDecimalDigit(ch){return ch>=0x30&&ch<=0x39;
|
7512 | }function isHexDigit(ch){return'0123456789abcdefABCDEF'.indexOf(ch)>=0;}function isOctalDigit(ch){return'01234567'.indexOf(ch)>=0;}function octalToDecimal(ch){
|
7513 | var octal=ch!=='0',code='01234567'.indexOf(ch);if(index<length&&isOctalDigit(source[index])){octal=true;code=code*8+'01234567'.indexOf(source[index++]);
|
7514 |
|
7515 | if('0123'.indexOf(ch)>=0&&index<length&&isOctalDigit(source[index])){code=code*8+'01234567'.indexOf(source[index++]);}}return{code:code,octal:octal};}
|
7516 | function isWhiteSpace(ch){return ch===0x20||ch===0x09||ch===0x0B||ch===0x0C||ch===0xA0||ch>=0x1680&&[0x1680,0x180E,0x2000,0x2001,0x2002,0x2003,0x2004,0x2005,0x2006,0x2007,0x2008,0x2009,0x200A,0x202F,0x205F,0x3000,0xFEFF].indexOf(ch)>=0;}
|
7517 | function isLineTerminator(ch){return ch===0x0A||ch===0x0D||ch===0x2028||ch===0x2029;}
|
7518 | function fromCodePoint(cp){return cp<0x10000?String.fromCharCode(cp):String.fromCharCode(0xD800+(cp-0x10000>>10))+String.fromCharCode(0xDC00+(cp-0x10000&1023));}function isIdentifierStart(ch){return ch===0x24||ch===0x5F||
|
7519 | ch>=0x41&&ch<=0x5A||
|
7520 | ch>=0x61&&ch<=0x7A||
|
7521 | ch===0x5C||
|
7522 | ch>=0x80&&Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));}function isIdentifierPart(ch){return ch===0x24||ch===0x5F||
|
7523 | ch>=0x41&&ch<=0x5A||
|
7524 | ch>=0x61&&ch<=0x7A||
|
7525 | ch>=0x30&&ch<=0x39||
|
7526 | ch===0x5C||
|
7527 | ch>=0x80&&Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));}
|
7528 | function isFutureReservedWord(id){switch(id){case'enum':case'export':case'import':case'super':return true;default:return false;}}function isStrictModeReservedWord(id){switch(id){case'implements':case'interface':case'package':case'private':case'protected':case'public':case'static':case'yield':case'let':return true;default:return false;}}function isRestrictedWord(id){return id==='eval'||id==='arguments';}
|
7529 | function isKeyword(id){switch(id.length){case 2:return id==='if'||id==='in'||id==='do';case 3:return id==='var'||id==='for'||id==='new'||id==='try'||id==='let';case 4:return id==='this'||id==='else'||id==='case'||id==='void'||id==='with'||id==='enum';case 5:return id==='while'||id==='break'||id==='catch'||id==='throw'||id==='const'||id==='yield'||id==='class'||id==='super';case 6:return id==='return'||id==='typeof'||id==='delete'||id==='switch'||id==='export'||id==='import';case 7:return id==='default'||id==='finally'||id==='extends';case 8:return id==='function'||id==='continue'||id==='debugger';case 10:return id==='instanceof';default:return false;}}
|
7530 | function addComment(type,value,start,end,loc){var comment;assert(typeof start==='number','Comment must have valid position');state.lastCommentStart=start;comment={type:type,value:value};if(extra.range){comment.range=[start,end];}if(extra.loc){comment.loc=loc;}extra.comments.push(comment);if(extra.attachComment){extra.leadingComments.push(comment);extra.trailingComments.push(comment);}if(extra.tokenize){comment.type=comment.type+'Comment';if(extra.delegate){comment=extra.delegate(comment);}extra.tokens.push(comment);}}function skipSingleLineComment(offset){var start,loc,ch,comment;start=index-offset;loc={start:{line:lineNumber,column:index-lineStart-offset}};while(index<length){ch=source.charCodeAt(index);++index;if(isLineTerminator(ch)){hasLineTerminator=true;if(extra.comments){comment=source.slice(start+offset,index-1);loc.end={line:lineNumber,column:index-lineStart-1};addComment('Line',comment,start,index-1,loc);}if(ch===13&&source.charCodeAt(index)===10){++index;}++lineNumber;lineStart=index;return;}}if(extra.comments){comment=source.slice(start+offset,index);loc.end={line:lineNumber,column:index-lineStart};addComment('Line',comment,start,index,loc);}}function skipMultiLineComment(){var start,loc,ch,comment;if(extra.comments){start=index-2;loc={start:{line:lineNumber,column:index-lineStart-2}};}while(index<length){ch=source.charCodeAt(index);if(isLineTerminator(ch)){if(ch===0x0D&&source.charCodeAt(index+1)===0x0A){++index;}hasLineTerminator=true;++lineNumber;++index;lineStart=index;}else if(ch===0x2A){
|
7531 | if(source.charCodeAt(index+1)===0x2F){++index;++index;if(extra.comments){comment=source.slice(start+2,index-2);loc.end={line:lineNumber,column:index-lineStart};addComment('Block',comment,start,index,loc);}return;}++index;}else{++index;}}
|
7532 | if(extra.comments){loc.end={line:lineNumber,column:index-lineStart};comment=source.slice(start+2,index);addComment('Block',comment,start,index,loc);}tolerateUnexpectedToken();}function skipComment(){var ch,start;hasLineTerminator=false;start=index===0;while(index<length){ch=source.charCodeAt(index);if(isWhiteSpace(ch)){++index;}else if(isLineTerminator(ch)){hasLineTerminator=true;++index;if(ch===0x0D&&source.charCodeAt(index)===0x0A){++index;}++lineNumber;lineStart=index;start=true;}else if(ch===0x2F){
|
7533 | ch=source.charCodeAt(index+1);if(ch===0x2F){++index;++index;skipSingleLineComment(2);start=true;}else if(ch===0x2A){
|
7534 | ++index;++index;skipMultiLineComment();}else{break;}}else if(start&&ch===0x2D){
|
7535 |
|
7536 | if(source.charCodeAt(index+1)===0x2D&&source.charCodeAt(index+2)===0x3E){
|
7537 | index+=3;skipSingleLineComment(3);}else{break;}}else if(ch===0x3C){
|
7538 | if(source.slice(index+1,index+4)==='!--'){++index;
|
7539 | ++index;
|
7540 | ++index;
|
7541 | ++index;
|
7542 | skipSingleLineComment(4);}else{break;}}else{break;}}}function scanHexEscape(prefix){var i,len,ch,code=0;len=prefix==='u'?4:2;for(i=0;i<len;++i){if(index<length&&isHexDigit(source[index])){ch=source[index++];code=code*16+'0123456789abcdef'.indexOf(ch.toLowerCase());}else{return'';}}return String.fromCharCode(code);}function scanUnicodeCodePointEscape(){var ch,code;ch=source[index];code=0;
|
7543 | if(ch==='}'){throwUnexpectedToken();}while(index<length){ch=source[index++];if(!isHexDigit(ch)){break;}code=code*16+'0123456789abcdef'.indexOf(ch.toLowerCase());}if(code>0x10FFFF||ch!=='}'){throwUnexpectedToken();}return fromCodePoint(code);}function codePointAt(i){var cp,first,second;cp=source.charCodeAt(i);if(cp>=0xD800&&cp<=0xDBFF){second=source.charCodeAt(i+1);if(second>=0xDC00&&second<=0xDFFF){first=cp;cp=(first-0xD800)*0x400+second-0xDC00+0x10000;}}return cp;}function getComplexIdentifier(){var cp,ch,id;cp=codePointAt(index);id=fromCodePoint(cp);index+=id.length;
|
7544 | if(cp===0x5C){if(source.charCodeAt(index)!==0x75){throwUnexpectedToken();}++index;if(source[index]==='{'){++index;ch=scanUnicodeCodePointEscape();}else{ch=scanHexEscape('u');cp=ch.charCodeAt(0);if(!ch||ch==='\\'||!isIdentifierStart(cp)){throwUnexpectedToken();}}id=ch;}while(index<length){cp=codePointAt(index);if(!isIdentifierPart(cp)){break;}ch=fromCodePoint(cp);id+=ch;index+=ch.length;
|
7545 | if(cp===0x5C){id=id.substr(0,id.length-1);if(source.charCodeAt(index)!==0x75){throwUnexpectedToken();}++index;if(source[index]==='{'){++index;ch=scanUnicodeCodePointEscape();}else{ch=scanHexEscape('u');cp=ch.charCodeAt(0);if(!ch||ch==='\\'||!isIdentifierPart(cp)){throwUnexpectedToken();}}id+=ch;}}return id;}function getIdentifier(){var start,ch;start=index++;while(index<length){ch=source.charCodeAt(index);if(ch===0x5C){
|
7546 | index=start;return getComplexIdentifier();}else if(ch>=0xD800&&ch<0xDFFF){
|
7547 | index=start;return getComplexIdentifier();}if(isIdentifierPart(ch)){++index;}else{break;}}return source.slice(start,index);}function scanIdentifier(){var start,id,type;start=index;
|
7548 | id=source.charCodeAt(index)===0x5C?getComplexIdentifier():getIdentifier();
|
7549 |
|
7550 | if(id.length===1){type=Token.Identifier;}else if(isKeyword(id)){type=Token.Keyword;}else if(id==='null'){type=Token.NullLiteral;}else if(id==='true'||id==='false'){type=Token.BooleanLiteral;}else{type=Token.Identifier;}return{type:type,value:id,lineNumber:lineNumber,lineStart:lineStart,start:start,end:index};}
|
7551 | function scanPunctuator(){var token,str;token={type:Token.Punctuator,value:'',lineNumber:lineNumber,lineStart:lineStart,start:index,end:index};
|
7552 | str=source[index];switch(str){case'(':if(extra.tokenize){extra.openParenToken=extra.tokenValues.length;}++index;break;case'{':if(extra.tokenize){extra.openCurlyToken=extra.tokenValues.length;}state.curlyStack.push('{');++index;break;case'.':++index;if(source[index]==='.'&&source[index+1]==='.'){
|
7553 | index+=2;str='...';}break;case'}':++index;state.curlyStack.pop();break;case')':case';':case',':case'[':case']':case':':case'?':case'~':++index;break;default:
|
7554 | str=source.substr(index,4);if(str==='>>>='){index+=4;}else{
|
7555 | str=str.substr(0,3);if(str==='==='||str==='!=='||str==='>>>'||str==='<<='||str==='>>='){index+=3;}else{
|
7556 | str=str.substr(0,2);if(str==='&&'||str==='||'||str==='=='||str==='!='||str==='+='||str==='-='||str==='*='||str==='/='||str==='++'||str==='--'||str==='<<'||str==='>>'||str==='&='||str==='|='||str==='^='||str==='%='||str==='<='||str==='>='||str==='=>'){index+=2;}else{
|
7557 | str=source[index];if('<>=!+-*%&|^/'.indexOf(str)>=0){++index;}}}}}if(index===token.start){throwUnexpectedToken();}token.end=index;token.value=str;return token;}
|
7558 | function scanHexLiteral(start){var number='';while(index<length){if(!isHexDigit(source[index])){break;}number+=source[index++];}if(number.length===0){throwUnexpectedToken();}if(isIdentifierStart(source.charCodeAt(index))){throwUnexpectedToken();}return{type:Token.NumericLiteral,value:parseInt('0x'+number,16),lineNumber:lineNumber,lineStart:lineStart,start:start,end:index};}function scanBinaryLiteral(start){var ch,number;number='';while(index<length){ch=source[index];if(ch!=='0'&&ch!=='1'){break;}number+=source[index++];}if(number.length===0){
|
7559 | throwUnexpectedToken();}if(index<length){ch=source.charCodeAt(index);if(isIdentifierStart(ch)||isDecimalDigit(ch)){throwUnexpectedToken();}}return{type:Token.NumericLiteral,value:parseInt(number,2),lineNumber:lineNumber,lineStart:lineStart,start:start,end:index};}function scanOctalLiteral(prefix,start){var number,octal;if(isOctalDigit(prefix)){octal=true;number='0'+source[index++];}else{octal=false;++index;number='';}while(index<length){if(!isOctalDigit(source[index])){break;}number+=source[index++];}if(!octal&&number.length===0){
|
7560 | throwUnexpectedToken();}if(isIdentifierStart(source.charCodeAt(index))||isDecimalDigit(source.charCodeAt(index))){throwUnexpectedToken();}return{type:Token.NumericLiteral,value:parseInt(number,8),octal:octal,lineNumber:lineNumber,lineStart:lineStart,start:start,end:index};}function isImplicitOctalLiteral(){var i,ch;
|
7561 |
|
7562 | for(i=index+1;i<length;++i){ch=source[i];if(ch==='8'||ch==='9'){return false;}if(!isOctalDigit(ch)){return true;}}return true;}function scanNumericLiteral(){var number,start,ch;ch=source[index];assert(isDecimalDigit(ch.charCodeAt(0))||ch==='.','Numeric literal must start with a decimal digit or a decimal point');start=index;number='';if(ch!=='.'){number=source[index++];ch=source[index];
|
7563 |
|
7564 |
|
7565 |
|
7566 | if(number==='0'){if(ch==='x'||ch==='X'){++index;return scanHexLiteral(start);}if(ch==='b'||ch==='B'){++index;return scanBinaryLiteral(start);}if(ch==='o'||ch==='O'){return scanOctalLiteral(ch,start);}if(isOctalDigit(ch)){if(isImplicitOctalLiteral()){return scanOctalLiteral(ch,start);}}}while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++];}ch=source[index];}if(ch==='.'){number+=source[index++];while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++];}ch=source[index];}if(ch==='e'||ch==='E'){number+=source[index++];ch=source[index];if(ch==='+'||ch==='-'){number+=source[index++];}if(isDecimalDigit(source.charCodeAt(index))){while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++];}}else{throwUnexpectedToken();}}if(isIdentifierStart(source.charCodeAt(index))){throwUnexpectedToken();}return{type:Token.NumericLiteral,value:parseFloat(number),lineNumber:lineNumber,lineStart:lineStart,start:start,end:index};}
|
7567 | function scanStringLiteral(){var str='',quote,start,ch,unescaped,octToDec,octal=false;quote=source[index];assert(quote==='\''||quote==='"','String literal must starts with a quote');start=index;++index;while(index<length){ch=source[index++];if(ch===quote){quote='';break;}else if(ch==='\\'){ch=source[index++];if(!ch||!isLineTerminator(ch.charCodeAt(0))){switch(ch){case'u':case'x':if(source[index]==='{'){++index;str+=scanUnicodeCodePointEscape();}else{unescaped=scanHexEscape(ch);if(!unescaped){throw throwUnexpectedToken();}str+=unescaped;}break;case'n':str+='\n';break;case'r':str+='\r';break;case't':str+='\t';break;case'b':str+='\b';break;case'f':str+='\f';break;case'v':str+='\x0B';break;case'8':case'9':str+=ch;tolerateUnexpectedToken();break;default:if(isOctalDigit(ch)){octToDec=octalToDecimal(ch);octal=octToDec.octal||octal;str+=String.fromCharCode(octToDec.code);}else{str+=ch;}break;}}else{++lineNumber;if(ch==='\r'&&source[index]==='\n'){++index;}lineStart=index;}}else if(isLineTerminator(ch.charCodeAt(0))){break;}else{str+=ch;}}if(quote!==''){index=start;throwUnexpectedToken();}return{type:Token.StringLiteral,value:str,octal:octal,lineNumber:startLineNumber,lineStart:startLineStart,start:start,end:index};}
|
7568 | function scanTemplate(){var cooked='',ch,start,rawOffset,terminated,head,tail,restore,unescaped;terminated=false;tail=false;start=index;head=source[index]==='`';rawOffset=2;++index;while(index<length){ch=source[index++];if(ch==='`'){rawOffset=1;tail=true;terminated=true;break;}else if(ch==='$'){if(source[index]==='{'){state.curlyStack.push('${');++index;terminated=true;break;}cooked+=ch;}else if(ch==='\\'){ch=source[index++];if(!isLineTerminator(ch.charCodeAt(0))){switch(ch){case'n':cooked+='\n';break;case'r':cooked+='\r';break;case't':cooked+='\t';break;case'u':case'x':if(source[index]==='{'){++index;cooked+=scanUnicodeCodePointEscape();}else{restore=index;unescaped=scanHexEscape(ch);if(unescaped){cooked+=unescaped;}else{index=restore;cooked+=ch;}}break;case'b':cooked+='\b';break;case'f':cooked+='\f';break;case'v':cooked+='\v';break;default:if(ch==='0'){if(isDecimalDigit(source.charCodeAt(index))){
|
7569 | throwError(Messages.TemplateOctalLiteral);}cooked+='\0';}else if(isOctalDigit(ch)){
|
7570 | throwError(Messages.TemplateOctalLiteral);}else{cooked+=ch;}break;}}else{++lineNumber;if(ch==='\r'&&source[index]==='\n'){++index;}lineStart=index;}}else if(isLineTerminator(ch.charCodeAt(0))){++lineNumber;if(ch==='\r'&&source[index]==='\n'){++index;}lineStart=index;cooked+='\n';}else{cooked+=ch;}}if(!terminated){throwUnexpectedToken();}if(!head){state.curlyStack.pop();}return{type:Token.Template,value:{cooked:cooked,raw:source.slice(start+1,index-rawOffset)},head:head,tail:tail,lineNumber:lineNumber,lineStart:lineStart,start:start,end:index};}
|
7571 | function testRegExp(pattern,flags){
|
7572 |
|
7573 |
|
7574 |
|
7575 |
|
7576 |
|
7577 | var astralSubstitute="\uFFFF",tmp=pattern;if(flags.indexOf('u')>=0){tmp=tmp
|
7578 |
|
7579 |
|
7580 |
|
7581 | .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function($0,$1,$2){var codePoint=parseInt($1||$2,16);if(codePoint>0x10FFFF){throwUnexpectedToken(null,Messages.InvalidRegExp);}if(codePoint<=0xFFFF){return String.fromCharCode(codePoint);}return astralSubstitute;})
|
7582 |
|
7583 |
|
7584 | .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,astralSubstitute);}
|
7585 | try{RegExp(tmp);}catch(e){throwUnexpectedToken(null,Messages.InvalidRegExp);}
|
7586 |
|
7587 |
|
7588 | try{return new RegExp(pattern,flags);}catch(exception){return null;}}function scanRegExpBody(){var ch,str,classMarker,terminated,body;ch=source[index];assert(ch==='/','Regular expression literal must start with a slash');str=source[index++];classMarker=false;terminated=false;while(index<length){ch=source[index++];str+=ch;if(ch==='\\'){ch=source[index++];
|
7589 | if(isLineTerminator(ch.charCodeAt(0))){throwUnexpectedToken(null,Messages.UnterminatedRegExp);}str+=ch;}else if(isLineTerminator(ch.charCodeAt(0))){throwUnexpectedToken(null,Messages.UnterminatedRegExp);}else if(classMarker){if(ch===']'){classMarker=false;}}else{if(ch==='/'){terminated=true;break;}else if(ch==='['){classMarker=true;}}}if(!terminated){throwUnexpectedToken(null,Messages.UnterminatedRegExp);}
|
7590 | body=str.substr(1,str.length-2);return{value:body,literal:str};}function scanRegExpFlags(){var ch,str,flags,restore;str='';flags='';while(index<length){ch=source[index];if(!isIdentifierPart(ch.charCodeAt(0))){break;}++index;if(ch==='\\'&&index<length){ch=source[index];if(ch==='u'){++index;restore=index;ch=scanHexEscape('u');if(ch){flags+=ch;for(str+="\\u";restore<index;++restore){str+=source[restore];}}else{index=restore;flags+='u';str+="\\u";}tolerateUnexpectedToken();}else{str+='\\';tolerateUnexpectedToken();}}else{flags+=ch;str+=ch;}}return{value:flags,literal:str};}function scanRegExp(){var start,body,flags,value;scanning=true;lookahead=null;skipComment();start=index;body=scanRegExpBody();flags=scanRegExpFlags();value=testRegExp(body.value,flags.value);scanning=false;if(extra.tokenize){return{type:Token.RegularExpression,value:value,regex:{pattern:body.value,flags:flags.value},lineNumber:lineNumber,lineStart:lineStart,start:start,end:index};}return{literal:body.literal+flags.literal,value:value,regex:{pattern:body.value,flags:flags.value},start:start,end:index};}function collectRegex(){var pos,loc,regex,token;skipComment();pos=index;loc={start:{line:lineNumber,column:index-lineStart}};regex=scanRegExp();loc.end={line:lineNumber,column:index-lineStart};if(!extra.tokenize){
|
7591 | if(extra.tokens.length>0){token=extra.tokens[extra.tokens.length-1];if(token.range[0]===pos&&token.type==='Punctuator'){if(token.value==='/'||token.value==='/='){extra.tokens.pop();}}}extra.tokens.push({type:'RegularExpression',value:regex.literal,regex:regex.regex,range:[pos,index],loc:loc});}return regex;}function isIdentifierName(token){return token.type===Token.Identifier||token.type===Token.Keyword||token.type===Token.BooleanLiteral||token.type===Token.NullLiteral;}
|
7592 |
|
7593 | function advanceSlash(){var regex,previous,check;function testKeyword(value){return value&&value.length>1&&value[0]>='a'&&value[0]<='z';}previous=extra.tokenValues[extra.tokens.length-1];regex=previous!==null;switch(previous){case'this':case']':regex=false;break;case')':check=extra.tokenValues[extra.openParenToken-1];regex=check==='if'||check==='while'||check==='for'||check==='with';break;case'}':
|
7594 |
|
7595 | regex=false;if(testKeyword(extra.tokenValues[extra.openCurlyToken-3])){
|
7596 | check=extra.tokenValues[extra.openCurlyToken-4];regex=check?FnExprTokens.indexOf(check)<0:false;}else if(testKeyword(extra.tokenValues[extra.openCurlyToken-4])){
|
7597 | check=extra.tokenValues[extra.openCurlyToken-5];regex=check?FnExprTokens.indexOf(check)<0:true;}}return regex?collectRegex():scanPunctuator();}function advance(){var cp,token;if(index>=length){return{type:Token.EOF,lineNumber:lineNumber,lineStart:lineStart,start:index,end:index};}cp=source.charCodeAt(index);if(isIdentifierStart(cp)){token=scanIdentifier();if(strict&&isStrictModeReservedWord(token.value)){token.type=Token.Keyword;}return token;}
|
7598 | if(cp===0x28||cp===0x29||cp===0x3B){return scanPunctuator();}
|
7599 | if(cp===0x27||cp===0x22){return scanStringLiteral();}
|
7600 |
|
7601 | if(cp===0x2E){if(isDecimalDigit(source.charCodeAt(index+1))){return scanNumericLiteral();}return scanPunctuator();}if(isDecimalDigit(cp)){return scanNumericLiteral();}
|
7602 | if(extra.tokenize&&cp===0x2F){return advanceSlash();}
|
7603 |
|
7604 | if(cp===0x60||cp===0x7D&&state.curlyStack[state.curlyStack.length-1]==='${'){return scanTemplate();}
|
7605 | if(cp>=0xD800&&cp<0xDFFF){cp=codePointAt(index);if(isIdentifierStart(cp)){return scanIdentifier();}}return scanPunctuator();}function collectToken(){var loc,token,value,entry;loc={start:{line:lineNumber,column:index-lineStart}};token=advance();loc.end={line:lineNumber,column:index-lineStart};if(token.type!==Token.EOF){value=source.slice(token.start,token.end);entry={type:TokenName[token.type],value:value,range:[token.start,token.end],loc:loc};if(token.regex){entry.regex={pattern:token.regex.pattern,flags:token.regex.flags};}if(extra.tokenValues){extra.tokenValues.push(entry.type==='Punctuator'||entry.type==='Keyword'?entry.value:null);}if(extra.tokenize){if(!extra.range){delete entry.range;}if(!extra.loc){delete entry.loc;}if(extra.delegate){entry=extra.delegate(entry);}}extra.tokens.push(entry);}return token;}function lex(){var token;scanning=true;lastIndex=index;lastLineNumber=lineNumber;lastLineStart=lineStart;skipComment();token=lookahead;startIndex=index;startLineNumber=lineNumber;startLineStart=lineStart;lookahead=typeof extra.tokens!=='undefined'?collectToken():advance();scanning=false;return token;}function peek(){scanning=true;skipComment();lastIndex=index;lastLineNumber=lineNumber;lastLineStart=lineStart;startIndex=index;startLineNumber=lineNumber;startLineStart=lineStart;lookahead=typeof extra.tokens!=='undefined'?collectToken():advance();scanning=false;}function Position(){this.line=startLineNumber;this.column=startIndex-startLineStart;}function SourceLocation(){this.start=new Position();this.end=null;}function WrappingSourceLocation(startToken){this.start={line:startToken.lineNumber,column:startToken.start-startToken.lineStart};this.end=null;}function Node(){if(extra.range){this.range=[startIndex,0];}if(extra.loc){this.loc=new SourceLocation();}}function WrappingNode(startToken){if(extra.range){this.range=[startToken.start,0];}if(extra.loc){this.loc=new WrappingSourceLocation(startToken);}}WrappingNode.prototype=Node.prototype={processComment:function processComment(){var lastChild,innerComments,leadingComments,trailingComments,bottomRight=extra.bottomRightStack,i,comment,last=bottomRight[bottomRight.length-1];if(this.type===Syntax.Program){if(this.body.length>0){return;}} |
7606 |
|
7607 |
|
7608 | if(this.type===Syntax.BlockStatement&&this.body.length===0){innerComments=[];for(i=extra.leadingComments.length-1;i>=0;--i){comment=extra.leadingComments[i];if(this.range[1]>=comment.range[1]){innerComments.unshift(comment);extra.leadingComments.splice(i,1);extra.trailingComments.splice(i,1);}}if(innerComments.length){this.innerComments=innerComments;
|
7609 | return;}}if(extra.trailingComments.length>0){trailingComments=[];for(i=extra.trailingComments.length-1;i>=0;--i){comment=extra.trailingComments[i];if(comment.range[0]>=this.range[1]){trailingComments.unshift(comment);extra.trailingComments.splice(i,1);}}extra.trailingComments=[];}else{if(last&&last.trailingComments&&last.trailingComments[0].range[0]>=this.range[1]){trailingComments=last.trailingComments;delete last.trailingComments;}}
|
7610 | while(last&&last.range[0]>=this.range[0]){lastChild=bottomRight.pop();last=bottomRight[bottomRight.length-1];}if(lastChild){if(lastChild.leadingComments){leadingComments=[];for(i=lastChild.leadingComments.length-1;i>=0;--i){comment=lastChild.leadingComments[i];if(comment.range[1]<=this.range[0]){leadingComments.unshift(comment);lastChild.leadingComments.splice(i,1);}}if(!lastChild.leadingComments.length){lastChild.leadingComments=undefined;}}}else if(extra.leadingComments.length>0){leadingComments=[];for(i=extra.leadingComments.length-1;i>=0;--i){comment=extra.leadingComments[i];if(comment.range[1]<=this.range[0]){leadingComments.unshift(comment);extra.leadingComments.splice(i,1);}}}if(leadingComments&&leadingComments.length>0){this.leadingComments=leadingComments;}if(trailingComments&&trailingComments.length>0){this.trailingComments=trailingComments;}bottomRight.push(this);},finish:function finish(){if(extra.range){this.range[1]=lastIndex;}if(extra.loc){this.loc.end={line:lastLineNumber,column:lastIndex-lastLineStart};if(extra.source){this.loc.source=extra.source;}}if(extra.attachComment){this.processComment();}},finishArrayExpression:function finishArrayExpression(elements){this.type=Syntax.ArrayExpression;this.elements=elements;this.finish();return this;},finishArrayPattern:function finishArrayPattern(elements){this.type=Syntax.ArrayPattern;this.elements=elements;this.finish();return this;},finishArrowFunctionExpression:function finishArrowFunctionExpression(params,defaults,body,expression){this.type=Syntax.ArrowFunctionExpression;this.id=null;this.params=params;this.defaults=defaults;this.body=body;this.generator=false;this.expression=expression;this.finish();return this;},finishAssignmentExpression:function finishAssignmentExpression(operator,left,right){this.type=Syntax.AssignmentExpression;this.operator=operator;this.left=left;this.right=right;this.finish();return this;},finishAssignmentPattern:function finishAssignmentPattern(left,right){this.type=Syntax.AssignmentPattern;this.left=left;this.right=right;this.finish();return this;},finishBinaryExpression:function finishBinaryExpression(operator,left,right){this.type=operator==='||'||operator==='&&'?Syntax.LogicalExpression:Syntax.BinaryExpression;this.operator=operator;this.left=left;this.right=right;this.finish();return this;},finishBlockStatement:function finishBlockStatement(body){this.type=Syntax.BlockStatement;this.body=body;this.finish();return this;},finishBreakStatement:function finishBreakStatement(label){this.type=Syntax.BreakStatement;this.label=label;this.finish();return this;},finishCallExpression:function finishCallExpression(callee,args){this.type=Syntax.CallExpression;this.callee=callee;this.arguments=args;this.finish();return this;},finishCatchClause:function finishCatchClause(param,body){this.type=Syntax.CatchClause;this.param=param;this.body=body;this.finish();return this;},finishClassBody:function finishClassBody(body){this.type=Syntax.ClassBody;this.body=body;this.finish();return this;},finishClassDeclaration:function finishClassDeclaration(id,superClass,body){this.type=Syntax.ClassDeclaration;this.id=id;this.superClass=superClass;this.body=body;this.finish();return this;},finishClassExpression:function finishClassExpression(id,superClass,body){this.type=Syntax.ClassExpression;this.id=id;this.superClass=superClass;this.body=body;this.finish();return this;},finishConditionalExpression:function finishConditionalExpression(test,consequent,alternate){this.type=Syntax.ConditionalExpression;this.test=test;this.consequent=consequent;this.alternate=alternate;this.finish();return this;},finishContinueStatement:function finishContinueStatement(label){this.type=Syntax.ContinueStatement;this.label=label;this.finish();return this;},finishDebuggerStatement:function finishDebuggerStatement(){this.type=Syntax.DebuggerStatement;this.finish();return this;},finishDoWhileStatement:function finishDoWhileStatement(body,test){this.type=Syntax.DoWhileStatement;this.body=body;this.test=test;this.finish();return this;},finishEmptyStatement:function finishEmptyStatement(){this.type=Syntax.EmptyStatement;this.finish();return this;},finishExpressionStatement:function finishExpressionStatement(expression){this.type=Syntax.ExpressionStatement;this.expression=expression;this.finish();return this;},finishForStatement:function finishForStatement(init,test,update,body){this.type=Syntax.ForStatement;this.init=init;this.test=test;this.update=update;this.body=body;this.finish();return this;},finishForOfStatement:function finishForOfStatement(left,right,body){this.type=Syntax.ForOfStatement;this.left=left;this.right=right;this.body=body;this.finish();return this;},finishForInStatement:function finishForInStatement(left,right,body){this.type=Syntax.ForInStatement;this.left=left;this.right=right;this.body=body;this.each=false;this.finish();return this;},finishFunctionDeclaration:function finishFunctionDeclaration(id,params,defaults,body,generator){this.type=Syntax.FunctionDeclaration;this.id=id;this.params=params;this.defaults=defaults;this.body=body;this.generator=generator;this.expression=false;this.finish();return this;},finishFunctionExpression:function finishFunctionExpression(id,params,defaults,body,generator){this.type=Syntax.FunctionExpression;this.id=id;this.params=params;this.defaults=defaults;this.body=body;this.generator=generator;this.expression=false;this.finish();return this;},finishIdentifier:function finishIdentifier(name){this.type=Syntax.Identifier;this.name=name;this.finish();return this;},finishIfStatement:function finishIfStatement(test,consequent,alternate){this.type=Syntax.IfStatement;this.test=test;this.consequent=consequent;this.alternate=alternate;this.finish();return this;},finishLabeledStatement:function finishLabeledStatement(label,body){this.type=Syntax.LabeledStatement;this.label=label;this.body=body;this.finish();return this;},finishLiteral:function finishLiteral(token){this.type=Syntax.Literal;this.value=token.value;this.raw=source.slice(token.start,token.end);if(token.regex){this.regex=token.regex;}this.finish();return this;},finishMemberExpression:function finishMemberExpression(accessor,object,property){this.type=Syntax.MemberExpression;this.computed=accessor==='[';this.object=object;this.property=property;this.finish();return this;},finishMetaProperty:function finishMetaProperty(meta,property){this.type=Syntax.MetaProperty;this.meta=meta;this.property=property;this.finish();return this;},finishNewExpression:function finishNewExpression(callee,args){this.type=Syntax.NewExpression;this.callee=callee;this.arguments=args;this.finish();return this;},finishObjectExpression:function finishObjectExpression(properties){this.type=Syntax.ObjectExpression;this.properties=properties;this.finish();return this;},finishObjectPattern:function finishObjectPattern(properties){this.type=Syntax.ObjectPattern;this.properties=properties;this.finish();return this;},finishPostfixExpression:function finishPostfixExpression(operator,argument){this.type=Syntax.UpdateExpression;this.operator=operator;this.argument=argument;this.prefix=false;this.finish();return this;},finishProgram:function finishProgram(body,sourceType){this.type=Syntax.Program;this.body=body;this.sourceType=sourceType;this.finish();return this;},finishProperty:function finishProperty(kind,key,computed,value,method,shorthand){this.type=Syntax.Property;this.key=key;this.computed=computed;this.value=value;this.kind=kind;this.method=method;this.shorthand=shorthand;this.finish();return this;},finishRestElement:function finishRestElement(argument){this.type=Syntax.RestElement;this.argument=argument;this.finish();return this;},finishReturnStatement:function finishReturnStatement(argument){this.type=Syntax.ReturnStatement;this.argument=argument;this.finish();return this;},finishSequenceExpression:function finishSequenceExpression(expressions){this.type=Syntax.SequenceExpression;this.expressions=expressions;this.finish();return this;},finishSpreadElement:function finishSpreadElement(argument){this.type=Syntax.SpreadElement;this.argument=argument;this.finish();return this;},finishSwitchCase:function finishSwitchCase(test,consequent){this.type=Syntax.SwitchCase;this.test=test;this.consequent=consequent;this.finish();return this;},finishSuper:function finishSuper(){this.type=Syntax.Super;this.finish();return this;},finishSwitchStatement:function finishSwitchStatement(discriminant,cases){this.type=Syntax.SwitchStatement;this.discriminant=discriminant;this.cases=cases;this.finish();return this;},finishTaggedTemplateExpression:function finishTaggedTemplateExpression(tag,quasi){this.type=Syntax.TaggedTemplateExpression;this.tag=tag;this.quasi=quasi;this.finish();return this;},finishTemplateElement:function finishTemplateElement(value,tail){this.type=Syntax.TemplateElement;this.value=value;this.tail=tail;this.finish();return this;},finishTemplateLiteral:function finishTemplateLiteral(quasis,expressions){this.type=Syntax.TemplateLiteral;this.quasis=quasis;this.expressions=expressions;this.finish();return this;},finishThisExpression:function finishThisExpression(){this.type=Syntax.ThisExpression;this.finish();return this;},finishThrowStatement:function finishThrowStatement(argument){this.type=Syntax.ThrowStatement;this.argument=argument;this.finish();return this;},finishTryStatement:function finishTryStatement(block,handler,finalizer){this.type=Syntax.TryStatement;this.block=block;this.guardedHandlers=[];this.handlers=handler?[handler]:[];this.handler=handler;this.finalizer=finalizer;this.finish();return this;},finishUnaryExpression:function finishUnaryExpression(operator,argument){this.type=operator==='++'||operator==='--'?Syntax.UpdateExpression:Syntax.UnaryExpression;this.operator=operator;this.argument=argument;this.prefix=true;this.finish();return this;},finishVariableDeclaration:function finishVariableDeclaration(declarations){this.type=Syntax.VariableDeclaration;this.declarations=declarations;this.kind='var';this.finish();return this;},finishLexicalDeclaration:function finishLexicalDeclaration(declarations,kind){this.type=Syntax.VariableDeclaration;this.declarations=declarations;this.kind=kind;this.finish();return this;},finishVariableDeclarator:function finishVariableDeclarator(id,init){this.type=Syntax.VariableDeclarator;this.id=id;this.init=init;this.finish();return this;},finishWhileStatement:function finishWhileStatement(test,body){this.type=Syntax.WhileStatement;this.test=test;this.body=body;this.finish();return this;},finishWithStatement:function finishWithStatement(object,body){this.type=Syntax.WithStatement;this.object=object;this.body=body;this.finish();return this;},finishExportSpecifier:function finishExportSpecifier(local,exported){this.type=Syntax.ExportSpecifier;this.exported=exported||local;this.local=local;this.finish();return this;},finishImportDefaultSpecifier:function finishImportDefaultSpecifier(local){this.type=Syntax.ImportDefaultSpecifier;this.local=local;this.finish();return this;},finishImportNamespaceSpecifier:function finishImportNamespaceSpecifier(local){this.type=Syntax.ImportNamespaceSpecifier;this.local=local;this.finish();return this;},finishExportNamedDeclaration:function finishExportNamedDeclaration(declaration,specifiers,src){this.type=Syntax.ExportNamedDeclaration;this.declaration=declaration;this.specifiers=specifiers;this.source=src;this.finish();return this;},finishExportDefaultDeclaration:function finishExportDefaultDeclaration(declaration){this.type=Syntax.ExportDefaultDeclaration;this.declaration=declaration;this.finish();return this;},finishExportAllDeclaration:function finishExportAllDeclaration(src){this.type=Syntax.ExportAllDeclaration;this.source=src;this.finish();return this;},finishImportSpecifier:function finishImportSpecifier(local,imported){this.type=Syntax.ImportSpecifier;this.local=local||imported;this.imported=imported;this.finish();return this;},finishImportDeclaration:function finishImportDeclaration(specifiers,src){this.type=Syntax.ImportDeclaration;this.specifiers=specifiers;this.source=src;this.finish();return this;},finishYieldExpression:function finishYieldExpression(argument,delegate){this.type=Syntax.YieldExpression;this.argument=argument;this.delegate=delegate;this.finish();return this;}};function recordError(error){var e,existing;for(e=0;e<extra.errors.length;e++){existing=extra.errors[e];
|
7611 | if(existing.index===error.index&&existing.message===error.message){return;}}extra.errors.push(error);}function constructError(msg,column){var error=new Error(msg);try{throw error;}catch(base){if(Object.create&&Object.defineProperty){error=Object.create(base);Object.defineProperty(error,'column',{value:column});}}finally{return error;}}function createError(line,pos,description){var msg,column,error;msg='Line '+line+': '+description;column=pos-(scanning?lineStart:lastLineStart)+1;error=constructError(msg,column);error.lineNumber=line;error.description=description;error.index=pos;return error;}
|
7612 | function throwError(messageFormat){var args,msg;args=Array.prototype.slice.call(arguments,1);msg=messageFormat.replace(/%(\d)/g,function(whole,idx){assert(idx<args.length,'Message reference must be in range');return args[idx];});throw createError(lastLineNumber,lastIndex,msg);}function tolerateError(messageFormat){var args,msg,error;args=Array.prototype.slice.call(arguments,1);msg=messageFormat.replace(/%(\d)/g,function(whole,idx){assert(idx<args.length,'Message reference must be in range');return args[idx];});error=createError(lineNumber,lastIndex,msg);if(extra.errors){recordError(error);}else{throw error;}}
|
7613 | function unexpectedTokenError(token,message){var value,msg=message||Messages.UnexpectedToken;if(token){if(!message){msg=token.type===Token.EOF?Messages.UnexpectedEOS:token.type===Token.Identifier?Messages.UnexpectedIdentifier:token.type===Token.NumericLiteral?Messages.UnexpectedNumber:token.type===Token.StringLiteral?Messages.UnexpectedString:token.type===Token.Template?Messages.UnexpectedTemplate:Messages.UnexpectedToken;if(token.type===Token.Keyword){if(isFutureReservedWord(token.value)){msg=Messages.UnexpectedReserved;}else if(strict&&isStrictModeReservedWord(token.value)){msg=Messages.StrictReservedWord;}}}value=token.type===Token.Template?token.value.raw:token.value;}else{value='ILLEGAL';}msg=msg.replace('%0',value);return token&&typeof token.lineNumber==='number'?createError(token.lineNumber,token.start,msg):createError(scanning?lineNumber:lastLineNumber,scanning?index:lastIndex,msg);}function throwUnexpectedToken(token,message){throw unexpectedTokenError(token,message);}function tolerateUnexpectedToken(token,message){var error=unexpectedTokenError(token,message);if(extra.errors){recordError(error);}else{throw error;}}
|
7614 |
|
7615 | function expect(value){var token=lex();if(token.type!==Token.Punctuator||token.value!==value){throwUnexpectedToken(token);}} |
7616 |
|
7617 |
|
7618 |
|
7619 |
|
7620 | function expectCommaSeparator(){var token;if(extra.errors){token=lookahead;if(token.type===Token.Punctuator&&token.value===','){lex();}else if(token.type===Token.Punctuator&&token.value===';'){lex();tolerateUnexpectedToken(token);}else{tolerateUnexpectedToken(token,Messages.UnexpectedToken);}}else{expect(',');}}
|
7621 |
|
7622 | function expectKeyword(keyword){var token=lex();if(token.type!==Token.Keyword||token.value!==keyword){throwUnexpectedToken(token);}}
|
7623 | function match(value){return lookahead.type===Token.Punctuator&&lookahead.value===value;}
|
7624 | function matchKeyword(keyword){return lookahead.type===Token.Keyword&&lookahead.value===keyword;}
|
7625 |
|
7626 | function matchContextualKeyword(keyword){return lookahead.type===Token.Identifier&&lookahead.value===keyword;}
|
7627 | function matchAssign(){var op;if(lookahead.type!==Token.Punctuator){return false;}op=lookahead.value;return op==='='||op==='*='||op==='/='||op==='%='||op==='+='||op==='-='||op==='<<='||op==='>>='||op==='>>>='||op==='&='||op==='^='||op==='|=';}function consumeSemicolon(){
|
7628 | if(source.charCodeAt(startIndex)===0x3B||match(';')){lex();return;}if(hasLineTerminator){return;}
|
7629 | lastIndex=startIndex;lastLineNumber=startLineNumber;lastLineStart=startLineStart;if(lookahead.type!==Token.EOF&&!match('}')){throwUnexpectedToken(lookahead);}}
|
7630 |
|
7631 |
|
7632 |
|
7633 |
|
7634 |
|
7635 |
|
7636 |
|
7637 |
|
7638 |
|
7639 |
|
7640 |
|
7641 |
|
7642 |
|
7643 |
|
7644 |
|
7645 |
|
7646 |
|
7647 |
|
7648 |
|
7649 |
|
7650 |
|
7651 |
|
7652 |
|
7653 |
|
7654 |
|
7655 |
|
7656 |
|
7657 |
|
7658 |
|
7659 |
|
7660 | function isolateCoverGrammar(parser){var oldIsBindingElement=isBindingElement,oldIsAssignmentTarget=isAssignmentTarget,oldFirstCoverInitializedNameError=firstCoverInitializedNameError,result;isBindingElement=true;isAssignmentTarget=true;firstCoverInitializedNameError=null;result=parser();if(firstCoverInitializedNameError!==null){throwUnexpectedToken(firstCoverInitializedNameError);}isBindingElement=oldIsBindingElement;isAssignmentTarget=oldIsAssignmentTarget;firstCoverInitializedNameError=oldFirstCoverInitializedNameError;return result;}function inheritCoverGrammar(parser){var oldIsBindingElement=isBindingElement,oldIsAssignmentTarget=isAssignmentTarget,oldFirstCoverInitializedNameError=firstCoverInitializedNameError,result;isBindingElement=true;isAssignmentTarget=true;firstCoverInitializedNameError=null;result=parser();isBindingElement=isBindingElement&&oldIsBindingElement;isAssignmentTarget=isAssignmentTarget&&oldIsAssignmentTarget;firstCoverInitializedNameError=oldFirstCoverInitializedNameError||firstCoverInitializedNameError;return result;}
|
7661 | function parseArrayPattern(params,kind){var node=new Node(),elements=[],rest,restNode;expect('[');while(!match(']')){if(match(',')){lex();elements.push(null);}else{if(match('...')){restNode=new Node();lex();params.push(lookahead);rest=parseVariableIdentifier(kind);elements.push(restNode.finishRestElement(rest));break;}else{elements.push(parsePatternWithDefault(params,kind));}if(!match(']')){expect(',');}}}expect(']');return node.finishArrayPattern(elements);}function parsePropertyPattern(params,kind){var node=new Node(),key,keyToken,computed=match('['),init;if(lookahead.type===Token.Identifier){keyToken=lookahead;key=parseVariableIdentifier();if(match('=')){params.push(keyToken);lex();init=parseAssignmentExpression();return node.finishProperty('init',key,false,new WrappingNode(keyToken).finishAssignmentPattern(key,init),false,true);}else if(!match(':')){params.push(keyToken);return node.finishProperty('init',key,false,key,false,true);}}else{key=parseObjectPropertyKey();}expect(':');init=parsePatternWithDefault(params,kind);return node.finishProperty('init',key,computed,init,false,false);}function parseObjectPattern(params,kind){var node=new Node(),properties=[];expect('{');while(!match('}')){properties.push(parsePropertyPattern(params,kind));if(!match('}')){expect(',');}}lex();return node.finishObjectPattern(properties);}function parsePattern(params,kind){if(match('[')){return parseArrayPattern(params,kind);}else if(match('{')){return parseObjectPattern(params,kind);}else if(matchKeyword('let')){if(kind==='const'||kind==='let'){tolerateUnexpectedToken(lookahead,Messages.UnexpectedToken);}}params.push(lookahead);return parseVariableIdentifier(kind);}function parsePatternWithDefault(params,kind){var startToken=lookahead,pattern,previousAllowYield,right;pattern=parsePattern(params,kind);if(match('=')){lex();previousAllowYield=state.allowYield;state.allowYield=true;right=isolateCoverGrammar(parseAssignmentExpression);state.allowYield=previousAllowYield;pattern=new WrappingNode(startToken).finishAssignmentPattern(pattern,right);}return pattern;}
|
7662 | function parseArrayInitializer(){var elements=[],node=new Node(),restSpread;expect('[');while(!match(']')){if(match(',')){lex();elements.push(null);}else if(match('...')){restSpread=new Node();lex();restSpread.finishSpreadElement(inheritCoverGrammar(parseAssignmentExpression));if(!match(']')){isAssignmentTarget=isBindingElement=false;expect(',');}elements.push(restSpread);}else{elements.push(inheritCoverGrammar(parseAssignmentExpression));if(!match(']')){expect(',');}}}lex();return node.finishArrayExpression(elements);}
|
7663 | function parsePropertyFunction(node,paramInfo,isGenerator){var previousStrict,body;isAssignmentTarget=isBindingElement=false;previousStrict=strict;body=isolateCoverGrammar(parseFunctionSourceElements);if(strict&¶mInfo.firstRestricted){tolerateUnexpectedToken(paramInfo.firstRestricted,paramInfo.message);}if(strict&¶mInfo.stricted){tolerateUnexpectedToken(paramInfo.stricted,paramInfo.message);}strict=previousStrict;return node.finishFunctionExpression(null,paramInfo.params,paramInfo.defaults,body,isGenerator);}function parsePropertyMethodFunction(){var params,method,node=new Node(),previousAllowYield=state.allowYield;state.allowYield=false;params=parseParams();state.allowYield=previousAllowYield;state.allowYield=false;method=parsePropertyFunction(node,params,false);state.allowYield=previousAllowYield;return method;}function parseObjectPropertyKey(){var token,node=new Node(),expr;token=lex();
|
7664 |
|
7665 | switch(token.type){case Token.StringLiteral:case Token.NumericLiteral:if(strict&&token.octal){tolerateUnexpectedToken(token,Messages.StrictOctalLiteral);}return node.finishLiteral(token);case Token.Identifier:case Token.BooleanLiteral:case Token.NullLiteral:case Token.Keyword:return node.finishIdentifier(token.value);case Token.Punctuator:if(token.value==='['){expr=isolateCoverGrammar(parseAssignmentExpression);expect(']');return expr;}break;}throwUnexpectedToken(token);}function lookaheadPropertyName(){switch(lookahead.type){case Token.Identifier:case Token.StringLiteral:case Token.BooleanLiteral:case Token.NullLiteral:case Token.NumericLiteral:case Token.Keyword:return true;case Token.Punctuator:return lookahead.value==='[';}return false;}
|
7666 |
|
7667 |
|
7668 |
|
7669 |
|
7670 |
|
7671 | function tryParseMethodDefinition(token,key,computed,node){var value,options,methodNode,params,previousAllowYield=state.allowYield;if(token.type===Token.Identifier){
|
7672 | if(token.value==='get'&&lookaheadPropertyName()){computed=match('[');key=parseObjectPropertyKey();methodNode=new Node();expect('(');expect(')');state.allowYield=false;value=parsePropertyFunction(methodNode,{params:[],defaults:[],stricted:null,firstRestricted:null,message:null},false);state.allowYield=previousAllowYield;return node.finishProperty('get',key,computed,value,false,false);}else if(token.value==='set'&&lookaheadPropertyName()){computed=match('[');key=parseObjectPropertyKey();methodNode=new Node();expect('(');options={params:[],defaultCount:0,defaults:[],firstRestricted:null,paramSet:{}};if(match(')')){tolerateUnexpectedToken(lookahead);}else{state.allowYield=false;parseParam(options);state.allowYield=previousAllowYield;if(options.defaultCount===0){options.defaults=[];}}expect(')');state.allowYield=false;value=parsePropertyFunction(methodNode,options,false);state.allowYield=previousAllowYield;return node.finishProperty('set',key,computed,value,false,false);}}else if(token.type===Token.Punctuator&&token.value==='*'&&lookaheadPropertyName()){computed=match('[');key=parseObjectPropertyKey();methodNode=new Node();state.allowYield=true;params=parseParams();state.allowYield=previousAllowYield;state.allowYield=false;value=parsePropertyFunction(methodNode,params,true);state.allowYield=previousAllowYield;return node.finishProperty('init',key,computed,value,true,false);}if(key&&match('(')){value=parsePropertyMethodFunction();return node.finishProperty('init',key,computed,value,true,false);}
|
7673 | return null;}function parseObjectProperty(hasProto){var token=lookahead,node=new Node(),computed,key,maybeMethod,proto,value;computed=match('[');if(match('*')){lex();}else{key=parseObjectPropertyKey();}maybeMethod=tryParseMethodDefinition(token,key,computed,node);if(maybeMethod){return maybeMethod;}if(!key){throwUnexpectedToken(lookahead);}
|
7674 | if(!computed){proto=key.type===Syntax.Identifier&&key.name==='__proto__'||key.type===Syntax.Literal&&key.value==='__proto__';if(hasProto.value&&proto){tolerateError(Messages.DuplicateProtoProperty);}hasProto.value|=proto;}if(match(':')){lex();value=inheritCoverGrammar(parseAssignmentExpression);return node.finishProperty('init',key,computed,value,false,false);}if(token.type===Token.Identifier){if(match('=')){firstCoverInitializedNameError=lookahead;lex();value=isolateCoverGrammar(parseAssignmentExpression);return node.finishProperty('init',key,computed,new WrappingNode(token).finishAssignmentPattern(key,value),false,true);}return node.finishProperty('init',key,computed,key,false,true);}throwUnexpectedToken(lookahead);}function parseObjectInitializer(){var properties=[],hasProto={value:false},node=new Node();expect('{');while(!match('}')){properties.push(parseObjectProperty(hasProto));if(!match('}')){expectCommaSeparator();}}expect('}');return node.finishObjectExpression(properties);}function reinterpretExpressionAsPattern(expr){var i;switch(expr.type){case Syntax.Identifier:case Syntax.MemberExpression:case Syntax.RestElement:case Syntax.AssignmentPattern:break;case Syntax.SpreadElement:expr.type=Syntax.RestElement;reinterpretExpressionAsPattern(expr.argument);break;case Syntax.ArrayExpression:expr.type=Syntax.ArrayPattern;for(i=0;i<expr.elements.length;i++){if(expr.elements[i]!==null){reinterpretExpressionAsPattern(expr.elements[i]);}}break;case Syntax.ObjectExpression:expr.type=Syntax.ObjectPattern;for(i=0;i<expr.properties.length;i++){reinterpretExpressionAsPattern(expr.properties[i].value);}break;case Syntax.AssignmentExpression:expr.type=Syntax.AssignmentPattern;reinterpretExpressionAsPattern(expr.left);break;default:
|
7675 | break;}}
|
7676 | function parseTemplateElement(option){var node,token;if(lookahead.type!==Token.Template||option.head&&!lookahead.head){throwUnexpectedToken();}node=new Node();token=lex();return node.finishTemplateElement({raw:token.value.raw,cooked:token.value.cooked},token.tail);}function parseTemplateLiteral(){var quasi,quasis,expressions,node=new Node();quasi=parseTemplateElement({head:true});quasis=[quasi];expressions=[];while(!quasi.tail){expressions.push(parseExpression());quasi=parseTemplateElement({head:false});quasis.push(quasi);}return node.finishTemplateLiteral(quasis,expressions);}
|
7677 | function parseGroupExpression(){var expr,expressions,startToken,i,params=[];expect('(');if(match(')')){lex();if(!match('=>')){expect('=>');}return{type:PlaceHolders.ArrowParameterPlaceHolder,params:[],rawParams:[]};}startToken=lookahead;if(match('...')){expr=parseRestElement(params);expect(')');if(!match('=>')){expect('=>');}return{type:PlaceHolders.ArrowParameterPlaceHolder,params:[expr]};}isBindingElement=true;expr=inheritCoverGrammar(parseAssignmentExpression);if(match(',')){isAssignmentTarget=false;expressions=[expr];while(startIndex<length){if(!match(',')){break;}lex();if(match('...')){if(!isBindingElement){throwUnexpectedToken(lookahead);}expressions.push(parseRestElement(params));expect(')');if(!match('=>')){expect('=>');}isBindingElement=false;for(i=0;i<expressions.length;i++){reinterpretExpressionAsPattern(expressions[i]);}return{type:PlaceHolders.ArrowParameterPlaceHolder,params:expressions};}expressions.push(inheritCoverGrammar(parseAssignmentExpression));}expr=new WrappingNode(startToken).finishSequenceExpression(expressions);}expect(')');if(match('=>')){if(expr.type===Syntax.Identifier&&expr.name==='yield'){return{type:PlaceHolders.ArrowParameterPlaceHolder,params:[expr]};}if(!isBindingElement){throwUnexpectedToken(lookahead);}if(expr.type===Syntax.SequenceExpression){for(i=0;i<expr.expressions.length;i++){reinterpretExpressionAsPattern(expr.expressions[i]);}}else{reinterpretExpressionAsPattern(expr);}expr={type:PlaceHolders.ArrowParameterPlaceHolder,params:expr.type===Syntax.SequenceExpression?expr.expressions:[expr]};}isBindingElement=false;return expr;}
|
7678 | function parsePrimaryExpression(){var type,token,expr,node;if(match('(')){isBindingElement=false;return inheritCoverGrammar(parseGroupExpression);}if(match('[')){return inheritCoverGrammar(parseArrayInitializer);}if(match('{')){return inheritCoverGrammar(parseObjectInitializer);}type=lookahead.type;node=new Node();if(type===Token.Identifier){if(state.sourceType==='module'&&lookahead.value==='await'){tolerateUnexpectedToken(lookahead);}expr=node.finishIdentifier(lex().value);}else if(type===Token.StringLiteral||type===Token.NumericLiteral){isAssignmentTarget=isBindingElement=false;if(strict&&lookahead.octal){tolerateUnexpectedToken(lookahead,Messages.StrictOctalLiteral);}expr=node.finishLiteral(lex());}else if(type===Token.Keyword){if(!strict&&state.allowYield&&matchKeyword('yield')){return parseNonComputedProperty();}if(!strict&&matchKeyword('let')){return node.finishIdentifier(lex().value);}isAssignmentTarget=isBindingElement=false;if(matchKeyword('function')){return parseFunctionExpression();}if(matchKeyword('this')){lex();return node.finishThisExpression();}if(matchKeyword('class')){return parseClassExpression();}throwUnexpectedToken(lex());}else if(type===Token.BooleanLiteral){isAssignmentTarget=isBindingElement=false;token=lex();token.value=token.value==='true';expr=node.finishLiteral(token);}else if(type===Token.NullLiteral){isAssignmentTarget=isBindingElement=false;token=lex();token.value=null;expr=node.finishLiteral(token);}else if(match('/')||match('/=')){isAssignmentTarget=isBindingElement=false;index=startIndex;if(typeof extra.tokens!=='undefined'){token=collectRegex();}else{token=scanRegExp();}lex();expr=node.finishLiteral(token);}else if(type===Token.Template){expr=parseTemplateLiteral();}else{throwUnexpectedToken(lex());}return expr;}
|
7679 | function parseArguments(){var args=[],expr;expect('(');if(!match(')')){while(startIndex<length){if(match('...')){expr=new Node();lex();expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression));}else{expr=isolateCoverGrammar(parseAssignmentExpression);}args.push(expr);if(match(')')){break;}expectCommaSeparator();}}expect(')');return args;}function parseNonComputedProperty(){var token,node=new Node();token=lex();if(!isIdentifierName(token)){throwUnexpectedToken(token);}return node.finishIdentifier(token.value);}function parseNonComputedMember(){expect('.');return parseNonComputedProperty();}function parseComputedMember(){var expr;expect('[');expr=isolateCoverGrammar(parseExpression);expect(']');return expr;}
|
7680 | function parseNewExpression(){var callee,args,node=new Node();expectKeyword('new');if(match('.')){lex();if(lookahead.type===Token.Identifier&&lookahead.value==='target'){if(state.inFunctionBody){lex();return node.finishMetaProperty('new','target');}}throwUnexpectedToken(lookahead);}callee=isolateCoverGrammar(parseLeftHandSideExpression);args=match('(')?parseArguments():[];isAssignmentTarget=isBindingElement=false;return node.finishNewExpression(callee,args);}
|
7681 | function parseLeftHandSideExpressionAllowCall(){var quasi,expr,args,property,startToken,previousAllowIn=state.allowIn;startToken=lookahead;state.allowIn=true;if(matchKeyword('super')&&state.inFunctionBody){expr=new Node();lex();expr=expr.finishSuper();if(!match('(')&&!match('.')&&!match('[')){throwUnexpectedToken(lookahead);}}else{expr=inheritCoverGrammar(matchKeyword('new')?parseNewExpression:parsePrimaryExpression);}for(;;){if(match('.')){isBindingElement=false;isAssignmentTarget=true;property=parseNonComputedMember();expr=new WrappingNode(startToken).finishMemberExpression('.',expr,property);}else if(match('(')){isBindingElement=false;isAssignmentTarget=false;args=parseArguments();expr=new WrappingNode(startToken).finishCallExpression(expr,args);}else if(match('[')){isBindingElement=false;isAssignmentTarget=true;property=parseComputedMember();expr=new WrappingNode(startToken).finishMemberExpression('[',expr,property);}else if(lookahead.type===Token.Template&&lookahead.head){quasi=parseTemplateLiteral();expr=new WrappingNode(startToken).finishTaggedTemplateExpression(expr,quasi);}else{break;}}state.allowIn=previousAllowIn;return expr;}
|
7682 | function parseLeftHandSideExpression(){var quasi,expr,property,startToken;assert(state.allowIn,'callee of new expression always allow in keyword.');startToken=lookahead;if(matchKeyword('super')&&state.inFunctionBody){expr=new Node();lex();expr=expr.finishSuper();if(!match('[')&&!match('.')){throwUnexpectedToken(lookahead);}}else{expr=inheritCoverGrammar(matchKeyword('new')?parseNewExpression:parsePrimaryExpression);}for(;;){if(match('[')){isBindingElement=false;isAssignmentTarget=true;property=parseComputedMember();expr=new WrappingNode(startToken).finishMemberExpression('[',expr,property);}else if(match('.')){isBindingElement=false;isAssignmentTarget=true;property=parseNonComputedMember();expr=new WrappingNode(startToken).finishMemberExpression('.',expr,property);}else if(lookahead.type===Token.Template&&lookahead.head){quasi=parseTemplateLiteral();expr=new WrappingNode(startToken).finishTaggedTemplateExpression(expr,quasi);}else{break;}}return expr;}
|
7683 | function parsePostfixExpression(){var expr,token,startToken=lookahead;expr=inheritCoverGrammar(parseLeftHandSideExpressionAllowCall);if(!hasLineTerminator&&lookahead.type===Token.Punctuator){if(match('++')||match('--')){
|
7684 | if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){tolerateError(Messages.StrictLHSPostfix);}if(!isAssignmentTarget){tolerateError(Messages.InvalidLHSInAssignment);}isAssignmentTarget=isBindingElement=false;token=lex();expr=new WrappingNode(startToken).finishPostfixExpression(token.value,expr);}}return expr;}
|
7685 | function parseUnaryExpression(){var token,expr,startToken;if(lookahead.type!==Token.Punctuator&&lookahead.type!==Token.Keyword){expr=parsePostfixExpression();}else if(match('++')||match('--')){startToken=lookahead;token=lex();expr=inheritCoverGrammar(parseUnaryExpression);
|
7686 | if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){tolerateError(Messages.StrictLHSPrefix);}if(!isAssignmentTarget){tolerateError(Messages.InvalidLHSInAssignment);}expr=new WrappingNode(startToken).finishUnaryExpression(token.value,expr);isAssignmentTarget=isBindingElement=false;}else if(match('+')||match('-')||match('~')||match('!')){startToken=lookahead;token=lex();expr=inheritCoverGrammar(parseUnaryExpression);expr=new WrappingNode(startToken).finishUnaryExpression(token.value,expr);isAssignmentTarget=isBindingElement=false;}else if(matchKeyword('delete')||matchKeyword('void')||matchKeyword('typeof')){startToken=lookahead;token=lex();expr=inheritCoverGrammar(parseUnaryExpression);expr=new WrappingNode(startToken).finishUnaryExpression(token.value,expr);if(strict&&expr.operator==='delete'&&expr.argument.type===Syntax.Identifier){tolerateError(Messages.StrictDelete);}isAssignmentTarget=isBindingElement=false;}else{expr=parsePostfixExpression();}return expr;}function binaryPrecedence(token,allowIn){var prec=0;if(token.type!==Token.Punctuator&&token.type!==Token.Keyword){return 0;}switch(token.value){case'||':prec=1;break;case'&&':prec=2;break;case'|':prec=3;break;case'^':prec=4;break;case'&':prec=5;break;case'==':case'!=':case'===':case'!==':prec=6;break;case'<':case'>':case'<=':case'>=':case'instanceof':prec=7;break;case'in':prec=allowIn?7:0;break;case'<<':case'>>':case'>>>':prec=8;break;case'+':case'-':prec=9;break;case'*':case'/':case'%':prec=11;break;default:break;}return prec;}
|
7687 |
|
7688 |
|
7689 |
|
7690 |
|
7691 |
|
7692 |
|
7693 | function parseBinaryExpression(){var marker,markers,expr,token,prec,stack,right,operator,left,i;marker=lookahead;left=inheritCoverGrammar(parseUnaryExpression);token=lookahead;prec=binaryPrecedence(token,state.allowIn);if(prec===0){return left;}isAssignmentTarget=isBindingElement=false;token.prec=prec;lex();markers=[marker,lookahead];right=isolateCoverGrammar(parseUnaryExpression);stack=[left,token,right];while((prec=binaryPrecedence(lookahead,state.allowIn))>0){
|
7694 | while(stack.length>2&&prec<=stack[stack.length-2].prec){right=stack.pop();operator=stack.pop().value;left=stack.pop();markers.pop();expr=new WrappingNode(markers[markers.length-1]).finishBinaryExpression(operator,left,right);stack.push(expr);}
|
7695 | token=lex();token.prec=prec;stack.push(token);markers.push(lookahead);expr=isolateCoverGrammar(parseUnaryExpression);stack.push(expr);}
|
7696 | i=stack.length-1;expr=stack[i];markers.pop();while(i>1){expr=new WrappingNode(markers.pop()).finishBinaryExpression(stack[i-1].value,stack[i-2],expr);i-=2;}return expr;}
|
7697 | function parseConditionalExpression(){var expr,previousAllowIn,consequent,alternate,startToken;startToken=lookahead;expr=inheritCoverGrammar(parseBinaryExpression);if(match('?')){lex();previousAllowIn=state.allowIn;state.allowIn=true;consequent=isolateCoverGrammar(parseAssignmentExpression);state.allowIn=previousAllowIn;expect(':');alternate=isolateCoverGrammar(parseAssignmentExpression);expr=new WrappingNode(startToken).finishConditionalExpression(expr,consequent,alternate);isAssignmentTarget=isBindingElement=false;}return expr;}
|
7698 | function parseConciseBody(){if(match('{')){return parseFunctionSourceElements();}return isolateCoverGrammar(parseAssignmentExpression);}function checkPatternParam(options,param){var i;switch(param.type){case Syntax.Identifier:validateParam(options,param,param.name);break;case Syntax.RestElement:checkPatternParam(options,param.argument);break;case Syntax.AssignmentPattern:checkPatternParam(options,param.left);break;case Syntax.ArrayPattern:for(i=0;i<param.elements.length;i++){if(param.elements[i]!==null){checkPatternParam(options,param.elements[i]);}}break;case Syntax.YieldExpression:break;default:assert(param.type===Syntax.ObjectPattern,'Invalid type');for(i=0;i<param.properties.length;i++){checkPatternParam(options,param.properties[i].value);}break;}}function reinterpretAsCoverFormalsList(expr){var i,len,param,params,defaults,defaultCount,options,token;defaults=[];defaultCount=0;params=[expr];switch(expr.type){case Syntax.Identifier:break;case PlaceHolders.ArrowParameterPlaceHolder:params=expr.params;break;default:return null;}options={paramSet:{}};for(i=0,len=params.length;i<len;i+=1){param=params[i];switch(param.type){case Syntax.AssignmentPattern:params[i]=param.left;if(param.right.type===Syntax.YieldExpression){if(param.right.argument){throwUnexpectedToken(lookahead);}param.right.type=Syntax.Identifier;param.right.name='yield';delete param.right.argument;delete param.right.delegate;}defaults.push(param.right);++defaultCount;checkPatternParam(options,param.left);break;default:checkPatternParam(options,param);params[i]=param;defaults.push(null);break;}}if(strict||!state.allowYield){for(i=0,len=params.length;i<len;i+=1){param=params[i];if(param.type===Syntax.YieldExpression){throwUnexpectedToken(lookahead);}}}if(options.message===Messages.StrictParamDupe){token=strict?options.stricted:options.firstRestricted;throwUnexpectedToken(token,options.message);}if(defaultCount===0){defaults=[];}return{params:params,defaults:defaults,stricted:options.stricted,firstRestricted:options.firstRestricted,message:options.message};}function parseArrowFunctionExpression(options,node){var previousStrict,previousAllowYield,body;if(hasLineTerminator){tolerateUnexpectedToken(lookahead);}expect('=>');previousStrict=strict;previousAllowYield=state.allowYield;state.allowYield=true;body=parseConciseBody();if(strict&&options.firstRestricted){throwUnexpectedToken(options.firstRestricted,options.message);}if(strict&&options.stricted){tolerateUnexpectedToken(options.stricted,options.message);}strict=previousStrict;state.allowYield=previousAllowYield;return node.finishArrowFunctionExpression(options.params,options.defaults,body,body.type!==Syntax.BlockStatement);}
|
7699 | function parseYieldExpression(){var argument,expr,delegate,previousAllowYield;argument=null;expr=new Node();delegate=false;expectKeyword('yield');if(!hasLineTerminator){previousAllowYield=state.allowYield;state.allowYield=false;delegate=match('*');if(delegate){lex();argument=parseAssignmentExpression();}else{if(!match(';')&&!match('}')&&!match(')')&&lookahead.type!==Token.EOF){argument=parseAssignmentExpression();}}state.allowYield=previousAllowYield;}return expr.finishYieldExpression(argument,delegate);}
|
7700 | function parseAssignmentExpression(){var token,expr,right,list,startToken;startToken=lookahead;token=lookahead;if(!state.allowYield&&matchKeyword('yield')){return parseYieldExpression();}expr=parseConditionalExpression();if(expr.type===PlaceHolders.ArrowParameterPlaceHolder||match('=>')){isAssignmentTarget=isBindingElement=false;list=reinterpretAsCoverFormalsList(expr);if(list){firstCoverInitializedNameError=null;return parseArrowFunctionExpression(list,new WrappingNode(startToken));}return expr;}if(matchAssign()){if(!isAssignmentTarget){tolerateError(Messages.InvalidLHSInAssignment);}
|
7701 | if(strict&&expr.type===Syntax.Identifier){if(isRestrictedWord(expr.name)){tolerateUnexpectedToken(token,Messages.StrictLHSAssignment);}if(isStrictModeReservedWord(expr.name)){tolerateUnexpectedToken(token,Messages.StrictReservedWord);}}if(!match('=')){isAssignmentTarget=isBindingElement=false;}else{reinterpretExpressionAsPattern(expr);}token=lex();right=isolateCoverGrammar(parseAssignmentExpression);expr=new WrappingNode(startToken).finishAssignmentExpression(token.value,expr,right);firstCoverInitializedNameError=null;}return expr;}
|
7702 | function parseExpression(){var expr,startToken=lookahead,expressions;expr=isolateCoverGrammar(parseAssignmentExpression);if(match(',')){expressions=[expr];while(startIndex<length){if(!match(',')){break;}lex();expressions.push(isolateCoverGrammar(parseAssignmentExpression));}expr=new WrappingNode(startToken).finishSequenceExpression(expressions);}return expr;}
|
7703 | function parseStatementListItem(){if(lookahead.type===Token.Keyword){switch(lookahead.value){case'export':if(state.sourceType!=='module'){tolerateUnexpectedToken(lookahead,Messages.IllegalExportDeclaration);}return parseExportDeclaration();case'import':if(state.sourceType!=='module'){tolerateUnexpectedToken(lookahead,Messages.IllegalImportDeclaration);}return parseImportDeclaration();case'const':return parseLexicalDeclaration({inFor:false});case'function':return parseFunctionDeclaration(new Node());case'class':return parseClassDeclaration();}}if(matchKeyword('let')&&isLexicalDeclaration()){return parseLexicalDeclaration({inFor:false});}return parseStatement();}function parseStatementList(){var list=[];while(startIndex<length){if(match('}')){break;}list.push(parseStatementListItem());}return list;}function parseBlock(){var block,node=new Node();expect('{');block=parseStatementList();expect('}');return node.finishBlockStatement(block);}
|
7704 | function parseVariableIdentifier(kind){var token,node=new Node();token=lex();if(token.type===Token.Keyword&&token.value==='yield'){if(strict){tolerateUnexpectedToken(token,Messages.StrictReservedWord);}if(!state.allowYield){throwUnexpectedToken(token);}}else if(token.type!==Token.Identifier){if(strict&&token.type===Token.Keyword&&isStrictModeReservedWord(token.value)){tolerateUnexpectedToken(token,Messages.StrictReservedWord);}else{if(strict||token.value!=='let'||kind!=='var'){throwUnexpectedToken(token);}}}else if(state.sourceType==='module'&&token.type===Token.Identifier&&token.value==='await'){tolerateUnexpectedToken(token);}return node.finishIdentifier(token.value);}function parseVariableDeclaration(options){var init=null,id,node=new Node(),params=[];id=parsePattern(params,'var');
|
7705 | if(strict&&isRestrictedWord(id.name)){tolerateError(Messages.StrictVarName);}if(match('=')){lex();init=isolateCoverGrammar(parseAssignmentExpression);}else if(id.type!==Syntax.Identifier&&!options.inFor){expect('=');}return node.finishVariableDeclarator(id,init);}function parseVariableDeclarationList(options){var opt,list;opt={inFor:options.inFor};list=[parseVariableDeclaration(opt)];while(match(',')){lex();list.push(parseVariableDeclaration(opt));}return list;}function parseVariableStatement(node){var declarations;expectKeyword('var');declarations=parseVariableDeclarationList({inFor:false});consumeSemicolon();return node.finishVariableDeclaration(declarations);}
|
7706 | function parseLexicalBinding(kind,options){var init=null,id,node=new Node(),params=[];id=parsePattern(params,kind);
|
7707 | if(strict&&id.type===Syntax.Identifier&&isRestrictedWord(id.name)){tolerateError(Messages.StrictVarName);}if(kind==='const'){if(!matchKeyword('in')&&!matchContextualKeyword('of')){expect('=');init=isolateCoverGrammar(parseAssignmentExpression);}}else if(!options.inFor&&id.type!==Syntax.Identifier||match('=')){expect('=');init=isolateCoverGrammar(parseAssignmentExpression);}return node.finishVariableDeclarator(id,init);}function parseBindingList(kind,options){var list=[parseLexicalBinding(kind,options)];while(match(',')){lex();list.push(parseLexicalBinding(kind,options));}return list;}function tokenizerState(){return{index:index,lineNumber:lineNumber,lineStart:lineStart,hasLineTerminator:hasLineTerminator,lastIndex:lastIndex,lastLineNumber:lastLineNumber,lastLineStart:lastLineStart,startIndex:startIndex,startLineNumber:startLineNumber,startLineStart:startLineStart,lookahead:lookahead,tokenCount:extra.tokens?extra.tokens.length:0};}function resetTokenizerState(ts){index=ts.index;lineNumber=ts.lineNumber;lineStart=ts.lineStart;hasLineTerminator=ts.hasLineTerminator;lastIndex=ts.lastIndex;lastLineNumber=ts.lastLineNumber;lastLineStart=ts.lastLineStart;startIndex=ts.startIndex;startLineNumber=ts.startLineNumber;startLineStart=ts.startLineStart;lookahead=ts.lookahead;if(extra.tokens){extra.tokens.splice(ts.tokenCount,extra.tokens.length);}}function isLexicalDeclaration(){var lexical,ts;ts=tokenizerState();lex();lexical=lookahead.type===Token.Identifier||match('[')||match('{')||matchKeyword('let')||matchKeyword('yield');resetTokenizerState(ts);return lexical;}function parseLexicalDeclaration(options){var kind,declarations,node=new Node();kind=lex().value;assert(kind==='let'||kind==='const','Lexical declaration must be either let or const');declarations=parseBindingList(kind,options);consumeSemicolon();return node.finishLexicalDeclaration(declarations,kind);}function parseRestElement(params){var param,node=new Node();lex();if(match('{')){throwError(Messages.ObjectPatternAsRestParameter);}params.push(lookahead);param=parseVariableIdentifier();if(match('=')){throwError(Messages.DefaultRestParameter);}if(!match(')')){throwError(Messages.ParameterAfterRestParameter);}return node.finishRestElement(param);}
|
7708 | function parseEmptyStatement(node){expect(';');return node.finishEmptyStatement();}
|
7709 | function parseExpressionStatement(node){var expr=parseExpression();consumeSemicolon();return node.finishExpressionStatement(expr);}
|
7710 | function parseIfStatement(node){var test,consequent,alternate;expectKeyword('if');expect('(');test=parseExpression();expect(')');consequent=parseStatement();if(matchKeyword('else')){lex();alternate=parseStatement();}else{alternate=null;}return node.finishIfStatement(test,consequent,alternate);}
|
7711 | function parseDoWhileStatement(node){var body,test,oldInIteration;expectKeyword('do');oldInIteration=state.inIteration;state.inIteration=true;body=parseStatement();state.inIteration=oldInIteration;expectKeyword('while');expect('(');test=parseExpression();expect(')');if(match(';')){lex();}return node.finishDoWhileStatement(body,test);}function parseWhileStatement(node){var test,body,oldInIteration;expectKeyword('while');expect('(');test=parseExpression();expect(')');oldInIteration=state.inIteration;state.inIteration=true;body=parseStatement();state.inIteration=oldInIteration;return node.finishWhileStatement(test,body);}function parseForStatement(node){var init,forIn,initSeq,initStartToken,test,update,left,right,kind,declarations,body,oldInIteration,previousAllowIn=state.allowIn;init=test=update=null;forIn=true;expectKeyword('for');expect('(');if(match(';')){lex();}else{if(matchKeyword('var')){init=new Node();lex();state.allowIn=false;declarations=parseVariableDeclarationList({inFor:true});state.allowIn=previousAllowIn;if(declarations.length===1&&matchKeyword('in')){init=init.finishVariableDeclaration(declarations);lex();left=init;right=parseExpression();init=null;}else if(declarations.length===1&&declarations[0].init===null&&matchContextualKeyword('of')){init=init.finishVariableDeclaration(declarations);lex();left=init;right=parseAssignmentExpression();init=null;forIn=false;}else{init=init.finishVariableDeclaration(declarations);expect(';');}}else if(matchKeyword('const')||matchKeyword('let')){init=new Node();kind=lex().value;if(!strict&&lookahead.value==='in'){init=init.finishIdentifier(kind);lex();left=init;right=parseExpression();init=null;}else{state.allowIn=false;declarations=parseBindingList(kind,{inFor:true});state.allowIn=previousAllowIn;if(declarations.length===1&&declarations[0].init===null&&matchKeyword('in')){init=init.finishLexicalDeclaration(declarations,kind);lex();left=init;right=parseExpression();init=null;}else if(declarations.length===1&&declarations[0].init===null&&matchContextualKeyword('of')){init=init.finishLexicalDeclaration(declarations,kind);lex();left=init;right=parseAssignmentExpression();init=null;forIn=false;}else{consumeSemicolon();init=init.finishLexicalDeclaration(declarations,kind);}}}else{initStartToken=lookahead;state.allowIn=false;init=inheritCoverGrammar(parseAssignmentExpression);state.allowIn=previousAllowIn;if(matchKeyword('in')){if(!isAssignmentTarget){tolerateError(Messages.InvalidLHSInForIn);}lex();reinterpretExpressionAsPattern(init);left=init;right=parseExpression();init=null;}else if(matchContextualKeyword('of')){if(!isAssignmentTarget){tolerateError(Messages.InvalidLHSInForLoop);}lex();reinterpretExpressionAsPattern(init);left=init;right=parseAssignmentExpression();init=null;forIn=false;}else{if(match(',')){initSeq=[init];while(match(',')){lex();initSeq.push(isolateCoverGrammar(parseAssignmentExpression));}init=new WrappingNode(initStartToken).finishSequenceExpression(initSeq);}expect(';');}}}if(typeof left==='undefined'){if(!match(';')){test=parseExpression();}expect(';');if(!match(')')){update=parseExpression();}}expect(')');oldInIteration=state.inIteration;state.inIteration=true;body=isolateCoverGrammar(parseStatement);state.inIteration=oldInIteration;return typeof left==='undefined'?node.finishForStatement(init,test,update,body):forIn?node.finishForInStatement(left,right,body):node.finishForOfStatement(left,right,body);}
|
7712 | function parseContinueStatement(node){var label=null,key;expectKeyword('continue');
|
7713 | if(source.charCodeAt(startIndex)===0x3B){lex();if(!state.inIteration){throwError(Messages.IllegalContinue);}return node.finishContinueStatement(null);}if(hasLineTerminator){if(!state.inIteration){throwError(Messages.IllegalContinue);}return node.finishContinueStatement(null);}if(lookahead.type===Token.Identifier){label=parseVariableIdentifier();key='$'+label.name;if(!Object.prototype.hasOwnProperty.call(state.labelSet,key)){throwError(Messages.UnknownLabel,label.name);}}consumeSemicolon();if(label===null&&!state.inIteration){throwError(Messages.IllegalContinue);}return node.finishContinueStatement(label);}
|
7714 | function parseBreakStatement(node){var label=null,key;expectKeyword('break');
|
7715 | if(source.charCodeAt(lastIndex)===0x3B){lex();if(!(state.inIteration||state.inSwitch)){throwError(Messages.IllegalBreak);}return node.finishBreakStatement(null);}if(hasLineTerminator){if(!(state.inIteration||state.inSwitch)){throwError(Messages.IllegalBreak);}}else if(lookahead.type===Token.Identifier){label=parseVariableIdentifier();key='$'+label.name;if(!Object.prototype.hasOwnProperty.call(state.labelSet,key)){throwError(Messages.UnknownLabel,label.name);}}consumeSemicolon();if(label===null&&!(state.inIteration||state.inSwitch)){throwError(Messages.IllegalBreak);}return node.finishBreakStatement(label);}
|
7716 | function parseReturnStatement(node){var argument=null;expectKeyword('return');if(!state.inFunctionBody){tolerateError(Messages.IllegalReturn);}
|
7717 | if(source.charCodeAt(lastIndex)===0x20){if(isIdentifierStart(source.charCodeAt(lastIndex+1))){argument=parseExpression();consumeSemicolon();return node.finishReturnStatement(argument);}}if(hasLineTerminator){
|
7718 | return node.finishReturnStatement(null);}if(!match(';')){if(!match('}')&&lookahead.type!==Token.EOF){argument=parseExpression();}}consumeSemicolon();return node.finishReturnStatement(argument);}
|
7719 | function parseWithStatement(node){var object,body;if(strict){tolerateError(Messages.StrictModeWith);}expectKeyword('with');expect('(');object=parseExpression();expect(')');body=parseStatement();return node.finishWithStatement(object,body);}
|
7720 | function parseSwitchCase(){var test,consequent=[],statement,node=new Node();if(matchKeyword('default')){lex();test=null;}else{expectKeyword('case');test=parseExpression();}expect(':');while(startIndex<length){if(match('}')||matchKeyword('default')||matchKeyword('case')){break;}statement=parseStatementListItem();consequent.push(statement);}return node.finishSwitchCase(test,consequent);}function parseSwitchStatement(node){var discriminant,cases,clause,oldInSwitch,defaultFound;expectKeyword('switch');expect('(');discriminant=parseExpression();expect(')');expect('{');cases=[];if(match('}')){lex();return node.finishSwitchStatement(discriminant,cases);}oldInSwitch=state.inSwitch;state.inSwitch=true;defaultFound=false;while(startIndex<length){if(match('}')){break;}clause=parseSwitchCase();if(clause.test===null){if(defaultFound){throwError(Messages.MultipleDefaultsInSwitch);}defaultFound=true;}cases.push(clause);}state.inSwitch=oldInSwitch;expect('}');return node.finishSwitchStatement(discriminant,cases);}
|
7721 | function parseThrowStatement(node){var argument;expectKeyword('throw');if(hasLineTerminator){throwError(Messages.NewlineAfterThrow);}argument=parseExpression();consumeSemicolon();return node.finishThrowStatement(argument);}
|
7722 | function parseCatchClause(){var param,params=[],paramMap={},key,i,body,node=new Node();expectKeyword('catch');expect('(');if(match(')')){throwUnexpectedToken(lookahead);}param=parsePattern(params);for(i=0;i<params.length;i++){key='$'+params[i].value;if(Object.prototype.hasOwnProperty.call(paramMap,key)){tolerateError(Messages.DuplicateBinding,params[i].value);}paramMap[key]=true;}
|
7723 | if(strict&&isRestrictedWord(param.name)){tolerateError(Messages.StrictCatchVariable);}expect(')');body=parseBlock();return node.finishCatchClause(param,body);}function parseTryStatement(node){var block,handler=null,finalizer=null;expectKeyword('try');block=parseBlock();if(matchKeyword('catch')){handler=parseCatchClause();}if(matchKeyword('finally')){lex();finalizer=parseBlock();}if(!handler&&!finalizer){throwError(Messages.NoCatchOrFinally);}return node.finishTryStatement(block,handler,finalizer);}
|
7724 | function parseDebuggerStatement(node){expectKeyword('debugger');consumeSemicolon();return node.finishDebuggerStatement();}
|
7725 | function parseStatement(){var type=lookahead.type,expr,labeledBody,key,node;if(type===Token.EOF){throwUnexpectedToken(lookahead);}if(type===Token.Punctuator&&lookahead.value==='{'){return parseBlock();}isAssignmentTarget=isBindingElement=true;node=new Node();if(type===Token.Punctuator){switch(lookahead.value){case';':return parseEmptyStatement(node);case'(':return parseExpressionStatement(node);default:break;}}else if(type===Token.Keyword){switch(lookahead.value){case'break':return parseBreakStatement(node);case'continue':return parseContinueStatement(node);case'debugger':return parseDebuggerStatement(node);case'do':return parseDoWhileStatement(node);case'for':return parseForStatement(node);case'function':return parseFunctionDeclaration(node);case'if':return parseIfStatement(node);case'return':return parseReturnStatement(node);case'switch':return parseSwitchStatement(node);case'throw':return parseThrowStatement(node);case'try':return parseTryStatement(node);case'var':return parseVariableStatement(node);case'while':return parseWhileStatement(node);case'with':return parseWithStatement(node);default:break;}}expr=parseExpression();
|
7726 | if(expr.type===Syntax.Identifier&&match(':')){lex();key='$'+expr.name;if(Object.prototype.hasOwnProperty.call(state.labelSet,key)){throwError(Messages.Redeclaration,'Label',expr.name);}state.labelSet[key]=true;labeledBody=parseStatement();delete state.labelSet[key];return node.finishLabeledStatement(expr,labeledBody);}consumeSemicolon();return node.finishExpressionStatement(expr);}
|
7727 | function parseFunctionSourceElements(){var statement,body=[],token,directive,firstRestricted,oldLabelSet,oldInIteration,oldInSwitch,oldInFunctionBody,node=new Node();expect('{');while(startIndex<length){if(lookahead.type!==Token.StringLiteral){break;}token=lookahead;statement=parseStatementListItem();body.push(statement);if(statement.expression.type!==Syntax.Literal){
|
7728 | break;}directive=source.slice(token.start+1,token.end-1);if(directive==='use strict'){strict=true;if(firstRestricted){tolerateUnexpectedToken(firstRestricted,Messages.StrictOctalLiteral);}}else{if(!firstRestricted&&token.octal){firstRestricted=token;}}}oldLabelSet=state.labelSet;oldInIteration=state.inIteration;oldInSwitch=state.inSwitch;oldInFunctionBody=state.inFunctionBody;state.labelSet={};state.inIteration=false;state.inSwitch=false;state.inFunctionBody=true;while(startIndex<length){if(match('}')){break;}body.push(parseStatementListItem());}expect('}');state.labelSet=oldLabelSet;state.inIteration=oldInIteration;state.inSwitch=oldInSwitch;state.inFunctionBody=oldInFunctionBody;return node.finishBlockStatement(body);}function validateParam(options,param,name){var key='$'+name;if(strict){if(isRestrictedWord(name)){options.stricted=param;options.message=Messages.StrictParamName;}if(Object.prototype.hasOwnProperty.call(options.paramSet,key)){options.stricted=param;options.message=Messages.StrictParamDupe;}}else if(!options.firstRestricted){if(isRestrictedWord(name)){options.firstRestricted=param;options.message=Messages.StrictParamName;}else if(isStrictModeReservedWord(name)){options.firstRestricted=param;options.message=Messages.StrictReservedWord;}else if(Object.prototype.hasOwnProperty.call(options.paramSet,key)){options.stricted=param;options.message=Messages.StrictParamDupe;}}options.paramSet[key]=true;}function parseParam(options){var token,param,params=[],i,def;token=lookahead;if(token.value==='...'){param=parseRestElement(params);validateParam(options,param.argument,param.argument.name);options.params.push(param);options.defaults.push(null);return false;}param=parsePatternWithDefault(params);for(i=0;i<params.length;i++){validateParam(options,params[i],params[i].value);}if(param.type===Syntax.AssignmentPattern){def=param.right;param=param.left;++options.defaultCount;}options.params.push(param);options.defaults.push(def);return!match(')');}function parseParams(firstRestricted){var options;options={params:[],defaultCount:0,defaults:[],firstRestricted:firstRestricted};expect('(');if(!match(')')){options.paramSet={};while(startIndex<length){if(!parseParam(options)){break;}expect(',');}}expect(')');if(options.defaultCount===0){options.defaults=[];}return{params:options.params,defaults:options.defaults,stricted:options.stricted,firstRestricted:options.firstRestricted,message:options.message};}function parseFunctionDeclaration(node,identifierIsOptional){var id=null,params=[],defaults=[],body,token,stricted,tmp,firstRestricted,message,previousStrict,isGenerator,previousAllowYield;previousAllowYield=state.allowYield;expectKeyword('function');isGenerator=match('*');if(isGenerator){lex();}if(!identifierIsOptional||!match('(')){token=lookahead;id=parseVariableIdentifier();if(strict){if(isRestrictedWord(token.value)){tolerateUnexpectedToken(token,Messages.StrictFunctionName);}}else{if(isRestrictedWord(token.value)){firstRestricted=token;message=Messages.StrictFunctionName;}else if(isStrictModeReservedWord(token.value)){firstRestricted=token;message=Messages.StrictReservedWord;}}}state.allowYield=!isGenerator;tmp=parseParams(firstRestricted);params=tmp.params;defaults=tmp.defaults;stricted=tmp.stricted;firstRestricted=tmp.firstRestricted;if(tmp.message){message=tmp.message;}previousStrict=strict;body=parseFunctionSourceElements();if(strict&&firstRestricted){throwUnexpectedToken(firstRestricted,message);}if(strict&&stricted){tolerateUnexpectedToken(stricted,message);}strict=previousStrict;state.allowYield=previousAllowYield;return node.finishFunctionDeclaration(id,params,defaults,body,isGenerator);}function parseFunctionExpression(){var token,id=null,stricted,firstRestricted,message,tmp,params=[],defaults=[],body,previousStrict,node=new Node(),isGenerator,previousAllowYield;previousAllowYield=state.allowYield;expectKeyword('function');isGenerator=match('*');if(isGenerator){lex();}state.allowYield=!isGenerator;if(!match('(')){token=lookahead;id=!strict&&!isGenerator&&matchKeyword('yield')?parseNonComputedProperty():parseVariableIdentifier();if(strict){if(isRestrictedWord(token.value)){tolerateUnexpectedToken(token,Messages.StrictFunctionName);}}else{if(isRestrictedWord(token.value)){firstRestricted=token;message=Messages.StrictFunctionName;}else if(isStrictModeReservedWord(token.value)){firstRestricted=token;message=Messages.StrictReservedWord;}}}tmp=parseParams(firstRestricted);params=tmp.params;defaults=tmp.defaults;stricted=tmp.stricted;firstRestricted=tmp.firstRestricted;if(tmp.message){message=tmp.message;}previousStrict=strict;body=parseFunctionSourceElements();if(strict&&firstRestricted){throwUnexpectedToken(firstRestricted,message);}if(strict&&stricted){tolerateUnexpectedToken(stricted,message);}strict=previousStrict;state.allowYield=previousAllowYield;return node.finishFunctionExpression(id,params,defaults,body,isGenerator);}
|
7729 | function parseClassBody(){var classBody,token,isStatic,hasConstructor=false,body,method,computed,key;classBody=new Node();expect('{');body=[];while(!match('}')){if(match(';')){lex();}else{method=new Node();token=lookahead;isStatic=false;computed=match('[');if(match('*')){lex();}else{key=parseObjectPropertyKey();if(key.name==='static'&&(lookaheadPropertyName()||match('*'))){token=lookahead;isStatic=true;computed=match('[');if(match('*')){lex();}else{key=parseObjectPropertyKey();}}}method=tryParseMethodDefinition(token,key,computed,method);if(method){method['static']=isStatic;
|
7730 | if(method.kind==='init'){method.kind='method';}if(!isStatic){if(!method.computed&&(method.key.name||method.key.value.toString())==='constructor'){if(method.kind!=='method'||!method.method||method.value.generator){throwUnexpectedToken(token,Messages.ConstructorSpecialMethod);}if(hasConstructor){throwUnexpectedToken(token,Messages.DuplicateConstructor);}else{hasConstructor=true;}method.kind='constructor';}}else{if(!method.computed&&(method.key.name||method.key.value.toString())==='prototype'){throwUnexpectedToken(token,Messages.StaticPrototype);}}method.type=Syntax.MethodDefinition;delete method.method;delete method.shorthand;body.push(method);}else{throwUnexpectedToken(lookahead);}}}lex();return classBody.finishClassBody(body);}function parseClassDeclaration(identifierIsOptional){var id=null,superClass=null,classNode=new Node(),classBody,previousStrict=strict;strict=true;expectKeyword('class');if(!identifierIsOptional||lookahead.type===Token.Identifier){id=parseVariableIdentifier();}if(matchKeyword('extends')){lex();superClass=isolateCoverGrammar(parseLeftHandSideExpressionAllowCall);}classBody=parseClassBody();strict=previousStrict;return classNode.finishClassDeclaration(id,superClass,classBody);}function parseClassExpression(){var id=null,superClass=null,classNode=new Node(),classBody,previousStrict=strict;strict=true;expectKeyword('class');if(lookahead.type===Token.Identifier){id=parseVariableIdentifier();}if(matchKeyword('extends')){lex();superClass=isolateCoverGrammar(parseLeftHandSideExpressionAllowCall);}classBody=parseClassBody();strict=previousStrict;return classNode.finishClassExpression(id,superClass,classBody);}
|
7731 | function parseModuleSpecifier(){var node=new Node();if(lookahead.type!==Token.StringLiteral){throwError(Messages.InvalidModuleSpecifier);}return node.finishLiteral(lex());}
|
7732 | function parseExportSpecifier(){var exported,local,node=new Node(),def;if(matchKeyword('default')){
|
7733 | def=new Node();lex();local=def.finishIdentifier('default');}else{local=parseVariableIdentifier();}if(matchContextualKeyword('as')){lex();exported=parseNonComputedProperty();}return node.finishExportSpecifier(local,exported);}function parseExportNamedDeclaration(node){var declaration=null,isExportFromIdentifier,src=null,specifiers=[];
|
7734 | if(lookahead.type===Token.Keyword){
|
7735 |
|
7736 | switch(lookahead.value){case'let':case'const':declaration=parseLexicalDeclaration({inFor:false});return node.finishExportNamedDeclaration(declaration,specifiers,null);case'var':case'class':case'function':declaration=parseStatementListItem();return node.finishExportNamedDeclaration(declaration,specifiers,null);}}expect('{');while(!match('}')){isExportFromIdentifier=isExportFromIdentifier||matchKeyword('default');specifiers.push(parseExportSpecifier());if(!match('}')){expect(',');if(match('}')){break;}}}expect('}');if(matchContextualKeyword('from')){
|
7737 |
|
7738 |
|
7739 | lex();src=parseModuleSpecifier();consumeSemicolon();}else if(isExportFromIdentifier){
|
7740 |
|
7741 | throwError(lookahead.value?Messages.UnexpectedToken:Messages.MissingFromClause,lookahead.value);}else{
|
7742 |
|
7743 | consumeSemicolon();}return node.finishExportNamedDeclaration(declaration,specifiers,src);}function parseExportDefaultDeclaration(node){var declaration=null,expression=null;
|
7744 |
|
7745 | expectKeyword('default');if(matchKeyword('function')){
|
7746 |
|
7747 |
|
7748 | declaration=parseFunctionDeclaration(new Node(),true);return node.finishExportDefaultDeclaration(declaration);}if(matchKeyword('class')){declaration=parseClassDeclaration(true);return node.finishExportDefaultDeclaration(declaration);}if(matchContextualKeyword('from')){throwError(Messages.UnexpectedToken,lookahead.value);}
|
7749 |
|
7750 |
|
7751 |
|
7752 | if(match('{')){expression=parseObjectInitializer();}else if(match('[')){expression=parseArrayInitializer();}else{expression=parseAssignmentExpression();}consumeSemicolon();return node.finishExportDefaultDeclaration(expression);}function parseExportAllDeclaration(node){var src;
|
7753 |
|
7754 | expect('*');if(!matchContextualKeyword('from')){throwError(lookahead.value?Messages.UnexpectedToken:Messages.MissingFromClause,lookahead.value);}lex();src=parseModuleSpecifier();consumeSemicolon();return node.finishExportAllDeclaration(src);}function parseExportDeclaration(){var node=new Node();if(state.inFunctionBody){throwError(Messages.IllegalExportDeclaration);}expectKeyword('export');if(matchKeyword('default')){return parseExportDefaultDeclaration(node);}if(match('*')){return parseExportAllDeclaration(node);}return parseExportNamedDeclaration(node);}
|
7755 | function parseImportSpecifier(){
|
7756 | var local,imported,node=new Node();imported=parseNonComputedProperty();if(matchContextualKeyword('as')){lex();local=parseVariableIdentifier();}return node.finishImportSpecifier(local,imported);}function parseNamedImports(){var specifiers=[];
|
7757 | expect('{');while(!match('}')){specifiers.push(parseImportSpecifier());if(!match('}')){expect(',');if(match('}')){break;}}}expect('}');return specifiers;}function parseImportDefaultSpecifier(){
|
7758 | var local,node=new Node();local=parseNonComputedProperty();return node.finishImportDefaultSpecifier(local);}function parseImportNamespaceSpecifier(){
|
7759 | var local,node=new Node();expect('*');if(!matchContextualKeyword('as')){throwError(Messages.NoAsAfterImportNamespace);}lex();local=parseNonComputedProperty();return node.finishImportNamespaceSpecifier(local);}function parseImportDeclaration(){var specifiers=[],src,node=new Node();if(state.inFunctionBody){throwError(Messages.IllegalImportDeclaration);}expectKeyword('import');if(lookahead.type===Token.StringLiteral){
|
7760 | src=parseModuleSpecifier();}else{if(match('{')){
|
7761 | specifiers=specifiers.concat(parseNamedImports());}else if(match('*')){
|
7762 | specifiers.push(parseImportNamespaceSpecifier());}else if(isIdentifierName(lookahead)&&!matchKeyword('default')){
|
7763 | specifiers.push(parseImportDefaultSpecifier());if(match(',')){lex();if(match('*')){
|
7764 | specifiers.push(parseImportNamespaceSpecifier());}else if(match('{')){
|
7765 | specifiers=specifiers.concat(parseNamedImports());}else{throwUnexpectedToken(lookahead);}}}else{throwUnexpectedToken(lex());}if(!matchContextualKeyword('from')){throwError(lookahead.value?Messages.UnexpectedToken:Messages.MissingFromClause,lookahead.value);}lex();src=parseModuleSpecifier();}consumeSemicolon();return node.finishImportDeclaration(specifiers,src);}
|
7766 | function parseScriptBody(){var statement,body=[],token,directive,firstRestricted;while(startIndex<length){token=lookahead;if(token.type!==Token.StringLiteral){break;}statement=parseStatementListItem();body.push(statement);if(statement.expression.type!==Syntax.Literal){
|
7767 | break;}directive=source.slice(token.start+1,token.end-1);if(directive==='use strict'){strict=true;if(firstRestricted){tolerateUnexpectedToken(firstRestricted,Messages.StrictOctalLiteral);}}else{if(!firstRestricted&&token.octal){firstRestricted=token;}}}while(startIndex<length){statement=parseStatementListItem();if(typeof statement==='undefined'){break;}body.push(statement);}return body;}function parseProgram(){var body,node;peek();node=new Node();body=parseScriptBody();return node.finishProgram(body,state.sourceType);}function filterTokenLocation(){var i,entry,token,tokens=[];for(i=0;i<extra.tokens.length;++i){entry=extra.tokens[i];token={type:entry.type,value:entry.value};if(entry.regex){token.regex={pattern:entry.regex.pattern,flags:entry.regex.flags};}if(extra.range){token.range=entry.range;}if(extra.loc){token.loc=entry.loc;}tokens.push(token);}extra.tokens=tokens;}function tokenize(code,options,delegate){var toString,tokens;toString=String;if(typeof code!=='string'&&!(code instanceof String)){code=toString(code);}source=code;index=0;lineNumber=source.length>0?1:0;lineStart=0;startIndex=index;startLineNumber=lineNumber;startLineStart=lineStart;length=source.length;lookahead=null;state={allowIn:true,allowYield:true,labelSet:{},inFunctionBody:false,inIteration:false,inSwitch:false,lastCommentStart:-1,curlyStack:[]};extra={};
|
7768 | options=options||{};
|
7769 | options.tokens=true;extra.tokens=[];extra.tokenValues=[];extra.tokenize=true;extra.delegate=delegate;
|
7770 | extra.openParenToken=-1;extra.openCurlyToken=-1;extra.range=typeof options.range==='boolean'&&options.range;extra.loc=typeof options.loc==='boolean'&&options.loc;if(typeof options.comment==='boolean'&&options.comment){extra.comments=[];}if(typeof options.tolerant==='boolean'&&options.tolerant){extra.errors=[];}try{peek();if(lookahead.type===Token.EOF){return extra.tokens;}lex();while(lookahead.type!==Token.EOF){try{lex();}catch(lexError){if(extra.errors){recordError(lexError);
|
7771 |
|
7772 | break;}else{throw lexError;}}}tokens=extra.tokens;if(typeof extra.errors!=='undefined'){tokens.errors=extra.errors;}}catch(e){throw e;}finally{extra={};}return tokens;}function parse(code,options){var program,toString;toString=String;if(typeof code!=='string'&&!(code instanceof String)){code=toString(code);}source=code;index=0;lineNumber=source.length>0?1:0;lineStart=0;startIndex=index;startLineNumber=lineNumber;startLineStart=lineStart;length=source.length;lookahead=null;state={allowIn:true,allowYield:true,labelSet:{},inFunctionBody:false,inIteration:false,inSwitch:false,lastCommentStart:-1,curlyStack:[],sourceType:'script'};strict=false;extra={};if(typeof options!=='undefined'){extra.range=typeof options.range==='boolean'&&options.range;extra.loc=typeof options.loc==='boolean'&&options.loc;extra.attachComment=typeof options.attachComment==='boolean'&&options.attachComment;if(extra.loc&&options.source!==null&&options.source!==undefined){extra.source=toString(options.source);}if(typeof options.tokens==='boolean'&&options.tokens){extra.tokens=[];}if(typeof options.comment==='boolean'&&options.comment){extra.comments=[];}if(typeof options.tolerant==='boolean'&&options.tolerant){extra.errors=[];}if(extra.attachComment){extra.range=true;extra.comments=[];extra.bottomRightStack=[];extra.trailingComments=[];extra.leadingComments=[];}if(options.sourceType==='module'){
|
7773 | state.sourceType=options.sourceType;strict=true;}}try{program=parseProgram();if(typeof extra.comments!=='undefined'){program.comments=extra.comments;}if(typeof extra.tokens!=='undefined'){filterTokenLocation();program.tokens=extra.tokens;}if(typeof extra.errors!=='undefined'){program.errors=extra.errors;}}catch(e){throw e;}finally{extra={};}return program;}
|
7774 | exports.version='2.7.2';exports.tokenize=tokenize;exports.parse=parse;
|
7775 | exports.Syntax=function(){var name,types={};if(typeof Object.create==='function'){types=Object.create(null);}for(name in Syntax){if(Syntax.hasOwnProperty(name)){types[name]=Syntax[name];}}if(typeof Object.freeze==='function'){Object.freeze(types);}return types;}();});},{}],21:[function(require,module,exports){
|
7776 |
|
7777 |
|
7778 |
|
7779 |
|
7780 |
|
7781 |
|
7782 |
|
7783 |
|
7784 |
|
7785 |
|
7786 |
|
7787 |
|
7788 |
|
7789 |
|
7790 |
|
7791 |
|
7792 |
|
7793 |
|
7794 |
|
7795 | function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined;}module.exports=EventEmitter;
|
7796 | EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;
|
7797 |
|
7798 | EventEmitter.defaultMaxListeners=10;
|
7799 |
|
7800 | EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError('n must be a positive number');this._maxListeners=n;return this;};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};
|
7801 | if(type==='error'){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er;
|
7802 | }else{
|
7803 | var err=new Error('Uncaught, unspecified "error" event. ('+er+')');err.context=er;throw err;}}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){
|
7804 | case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;
|
7805 | default:args=Array.prototype.slice.call(arguments,1);handler.apply(this,args);}}else if(isObject(handler)){args=Array.prototype.slice.call(arguments,1);listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++){listeners[i].apply(this,args);}}return true;};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError('listener must be a function');if(!this._events)this._events={};
|
7806 |
|
7807 | if(this._events.newListener)this.emit('newListener',type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])
|
7808 | this._events[type]=listener;else if(isObject(this._events[type]))
|
7809 | this._events[type].push(listener);else
|
7810 | this._events[type]=[this._events[type],listener];
|
7811 | if(isObject(this._events[type])&&!this._events[type].warned){if(!isUndefined(this._maxListeners)){m=this._maxListeners;}else{m=EventEmitter.defaultMaxListeners;}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error('(node) warning: possible EventEmitter memory '+'leak detected. %d listeners added. '+'Use emitter.setMaxListeners() to increase limit.',this._events[type].length);if(typeof console.trace==='function'){
|
7812 | console.trace();}}}return this;};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError('listener must be a function');var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments);}}g.listener=listener;this.on(type,g);return this;};
|
7813 | EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError('listener must be a function');if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit('removeListener',type,listener);}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break;}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type];}else{list.splice(position,1);}if(this._events.removeListener)this.emit('removeListener',type,listener);}return this;};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;
|
7814 | if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this;}
|
7815 | if(arguments.length===0){for(key in this._events){if(key==='removeListener')continue;this.removeAllListeners(key);}this.removeAllListeners('removeListener');this._events={};return this;}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners);}else if(listeners){
|
7816 | while(listeners.length){this.removeListener(type,listeners[listeners.length-1]);}}delete this._events[type];return this;};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret;};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length;}return 0;};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type);};function isFunction(arg){return typeof arg==='function';}function isNumber(arg){return typeof arg==='number';}function isObject(arg){return(typeof arg==="undefined"?"undefined":_typeof(arg))==='object'&&arg!==null;}function isUndefined(arg){return arg===void 0;}},{}],22:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias;}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity;}else{m=m+Math.pow(2,mLen);e=e-eBias;}return(s?-1:1)*m*Math.pow(2,e-mLen);};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax;}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2;}if(e+eBias>=1){value+=rt/c;}else{value+=rt*Math.pow(2,1-eBias);}if(value*c>=2){e++;c/=2;}if(e+eBias>=eMax){m=0;e=eMax;}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias;}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0;}}for(;mLen>=8;buffer[offset+i]=m&0xff,i+=d,m/=256,mLen-=8){}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&0xff,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128;};},{}],23:[function(require,module,exports){var indexOf=[].indexOf;module.exports=function(arr,obj){if(indexOf)return arr.indexOf(obj);for(var i=0;i<arr.length;++i){if(arr[i]===obj)return i;}return-1;};},{}],24:[function(require,module,exports){if(typeof Object.create==='function'){
|
7817 | module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}});};}else{
|
7818 | module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function TempCtor(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor();ctor.prototype.constructor=ctor;};}},{}],25:[function(require,module,exports){ |
7819 |
|
7820 |
|
7821 |
|
7822 |
|
7823 |
|
7824 |
|
7825 | module.exports=function(obj){return obj!=null&&(isBuffer(obj)||isSlowBuffer(obj)||!!obj._isBuffer);};function isBuffer(obj){return!!obj.constructor&&typeof obj.constructor.isBuffer==='function'&&obj.constructor.isBuffer(obj);}
|
7826 | function isSlowBuffer(obj){return typeof obj.readFloatLE==='function'&&typeof obj.slice==='function'&&isBuffer(obj.slice(0,0));}},{}],26:[function(require,module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return toString.call(arr)=='[object Array]';};},{}],27:[function(require,module,exports){module.exports=function(args,opts){if(!opts)opts={};var flags={bools:{},strings:{},unknownFn:null};if(typeof opts['unknown']==='function'){flags.unknownFn=opts['unknown'];}if(typeof opts['boolean']==='boolean'&&opts['boolean']){flags.allBools=true;}else{[].concat(opts['boolean']).filter(Boolean).forEach(function(key){flags.bools[key]=true;});}var aliases={};Object.keys(opts.alias||{}).forEach(function(key){aliases[key]=[].concat(opts.alias[key]);aliases[key].forEach(function(x){aliases[x]=[key].concat(aliases[key].filter(function(y){return x!==y;}));});});[].concat(opts.string).filter(Boolean).forEach(function(key){flags.strings[key]=true;if(aliases[key]){flags.strings[aliases[key]]=true;}});var defaults=opts['default']||{};var argv={_:[]};Object.keys(flags.bools).forEach(function(key){setArg(key,defaults[key]===undefined?false:defaults[key]);});var notFlags=[];if(args.indexOf('--')!==-1){notFlags=args.slice(args.indexOf('--')+1);args=args.slice(0,args.indexOf('--'));}function argDefined(key,arg){return flags.allBools&&/^--[^=]+$/.test(arg)||flags.strings[key]||flags.bools[key]||aliases[key];}function setArg(key,val,arg){if(arg&&flags.unknownFn&&!argDefined(key,arg)){if(flags.unknownFn(arg)===false)return;}var value=!flags.strings[key]&&isNumber(val)?Number(val):val;setKey(argv,key.split('.'),value);(aliases[key]||[]).forEach(function(x){setKey(argv,x.split('.'),value);});}function setKey(obj,keys,value){var o=obj;keys.slice(0,-1).forEach(function(key){if(o[key]===undefined)o[key]={};o=o[key];});var key=keys[keys.length-1];if(o[key]===undefined||flags.bools[key]||typeof o[key]==='boolean'){o[key]=value;}else if(Array.isArray(o[key])){o[key].push(value);}else{o[key]=[o[key],value];}}function aliasIsBoolean(key){return aliases[key].some(function(x){return flags.bools[x];});}for(var i=0;i<args.length;i++){var arg=args[i];if(/^--.+=/.test(arg)){
|
7827 |
|
7828 |
|
7829 | var m=arg.match(/^--([^=]+)=([\s\S]*)$/);var key=m[1];var value=m[2];if(flags.bools[key]){value=value!=='false';}setArg(key,value,arg);}else if(/^--no-.+/.test(arg)){var key=arg.match(/^--no-(.+)/)[1];setArg(key,false,arg);}else if(/^--.+/.test(arg)){var key=arg.match(/^--(.+)/)[1];var next=args[i+1];if(next!==undefined&&!/^-/.test(next)&&!flags.bools[key]&&!flags.allBools&&(aliases[key]?!aliasIsBoolean(key):true)){setArg(key,next,arg);i++;}else if(/^(true|false)$/.test(next)){setArg(key,next==='true',arg);i++;}else{setArg(key,flags.strings[key]?'':true,arg);}}else if(/^-[^-]+/.test(arg)){var letters=arg.slice(1,-1).split('');var broken=false;for(var j=0;j<letters.length;j++){var next=arg.slice(j+2);if(next==='-'){setArg(letters[j],next,arg);continue;}if(/[A-Za-z]/.test(letters[j])&&/=/.test(next)){setArg(letters[j],next.split('=')[1],arg);broken=true;break;}if(/[A-Za-z]/.test(letters[j])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(next)){setArg(letters[j],next,arg);broken=true;break;}if(letters[j+1]&&letters[j+1].match(/\W/)){setArg(letters[j],arg.slice(j+2),arg);broken=true;break;}else{setArg(letters[j],flags.strings[letters[j]]?'':true,arg);}}var key=arg.slice(-1)[0];if(!broken&&key!=='-'){if(args[i+1]&&!/^(-|--)[^-]/.test(args[i+1])&&!flags.bools[key]&&(aliases[key]?!aliasIsBoolean(key):true)){setArg(key,args[i+1],arg);i++;}else if(args[i+1]&&/true|false/.test(args[i+1])){setArg(key,args[i+1]==='true',arg);i++;}else{setArg(key,flags.strings[key]?'':true,arg);}}}else{if(!flags.unknownFn||flags.unknownFn(arg)!==false){argv._.push(flags.strings['_']||!isNumber(arg)?arg:Number(arg));}if(opts.stopEarly){argv._.push.apply(argv._,args.slice(i+1));break;}}}Object.keys(defaults).forEach(function(key){if(!hasKey(argv,key.split('.'))){setKey(argv,key.split('.'),defaults[key]);(aliases[key]||[]).forEach(function(x){setKey(argv,x.split('.'),defaults[key]);});}});if(opts['--']){argv['--']=new Array();notFlags.forEach(function(key){argv['--'].push(key);});}else{notFlags.forEach(function(key){argv._.push(key);});}return argv;};function hasKey(obj,keys){var o=obj;keys.slice(0,-1).forEach(function(key){o=o[key]||{};});var key=keys[keys.length-1];return key in o;}function isNumber(x){if(typeof x==='number')return true;if(/^0x[0-9a-f]+$/i.test(x))return true;return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);}},{}],28:[function(require,module,exports){(function(process){var path=require('path');var minimist=require('minimist');var wordwrap=require('wordwrap'); |
7830 |
|
7831 |
|
7832 |
|
7833 |
|
7834 |
|
7835 | var inst=Argv(process.argv.slice(2));Object.keys(inst).forEach(function(key){Argv[key]=typeof inst[key]=='function'?inst[key].bind(inst):inst[key];});var exports=module.exports=Argv;function Argv(processArgs,cwd){var self={};if(!cwd)cwd=process.cwd();self.$0=process.argv.slice(0,2).map(function(x){var b=rebase(cwd,x);return x.match(/^\//)&&b.length<x.length?b:x;}).join(' ');if(process.env._!=undefined&&process.argv[1]==process.env._){self.$0=process.env._.replace(path.dirname(process.execPath)+'/','');}var options={boolean:[],string:[],alias:{},default:[]};self.boolean=function(bools){options.boolean.push.apply(options.boolean,[].concat(bools));return self;};self.string=function(strings){options.string.push.apply(options.string,[].concat(strings));return self;};self.default=function(key,value){if((typeof key==="undefined"?"undefined":_typeof(key))==='object'){Object.keys(key).forEach(function(k){self.default(k,key[k]);});}else{options.default[key]=value;}return self;};self.alias=function(x,y){if((typeof x==="undefined"?"undefined":_typeof(x))==='object'){Object.keys(x).forEach(function(key){self.alias(key,x[key]);});}else{options.alias[x]=(options.alias[x]||[]).concat(y);}return self;};var demanded={};self.demand=function(keys){if(typeof keys=='number'){if(!demanded._)demanded._=0;demanded._+=keys;}else if(Array.isArray(keys)){keys.forEach(function(key){self.demand(key);});}else{demanded[keys]=true;}return self;};var usage;self.usage=function(msg,opts){if(!opts&&(typeof msg==="undefined"?"undefined":_typeof(msg))==='object'){opts=msg;msg=null;}usage=msg;if(opts)self.options(opts);return self;};function fail(msg){self.showHelp();if(msg)console.error(msg);process.exit(1);}var checks=[];self.check=function(f){checks.push(f);return self;};var descriptions={};self.describe=function(key,desc){if((typeof key==="undefined"?"undefined":_typeof(key))==='object'){Object.keys(key).forEach(function(k){self.describe(k,key[k]);});}else{descriptions[key]=desc;}return self;};self.parse=function(args){return parseArgs(args);};self.option=self.options=function(key,opt){if((typeof key==="undefined"?"undefined":_typeof(key))==='object'){Object.keys(key).forEach(function(k){self.options(k,key[k]);});}else{if(opt.alias)self.alias(key,opt.alias);if(opt.demand)self.demand(key);if(typeof opt.default!=='undefined'){self.default(key,opt.default);}if(opt.boolean||opt.type==='boolean'){self.boolean(key);}if(opt.string||opt.type==='string'){self.string(key);}var desc=opt.describe||opt.description||opt.desc;if(desc){self.describe(key,desc);}}return self;};var wrap=null;self.wrap=function(cols){wrap=cols;return self;};self.showHelp=function(fn){if(!fn)fn=console.error;fn(self.help());};self.help=function(){var keys=Object.keys(Object.keys(descriptions).concat(Object.keys(demanded)).concat(Object.keys(options.default)).reduce(function(acc,key){if(key!=='_')acc[key]=true;return acc;},{}));var help=keys.length?['Options:']:[];if(usage){help.unshift(usage.replace(/\$0/g,self.$0),'');}var switches=keys.reduce(function(acc,key){acc[key]=[key].concat(options.alias[key]||[]).map(function(sw){return(sw.length>1?'--':'-')+sw;}).join(', ');return acc;},{});var switchlen=longest(Object.keys(switches).map(function(s){return switches[s]||'';}));var desclen=longest(Object.keys(descriptions).map(function(d){return descriptions[d]||'';}));keys.forEach(function(key){var kswitch=switches[key];var desc=descriptions[key]||'';if(wrap){desc=wordwrap(switchlen+4,wrap)(desc).slice(switchlen+4);}var spadding=new Array(Math.max(switchlen-kswitch.length+3,0)).join(' ');var dpadding=new Array(Math.max(desclen-desc.length+1,0)).join(' ');var type=null;if(options.boolean[key])type='[boolean]';if(options.string[key])type='[string]';if(!wrap&&dpadding.length>0){desc+=dpadding;}var prelude=' '+kswitch+spadding;var extra=[type,demanded[key]?'[required]':null,options.default[key]!==undefined?'[default: '+JSON.stringify(options.default[key])+']':null].filter(Boolean).join(' ');var body=[desc,extra].filter(Boolean).join(' ');if(wrap){var dlines=desc.split('\n');var dlen=dlines.slice(-1)[0].length+(dlines.length===1?prelude.length:0);body=desc+(dlen+extra.length>wrap-2?'\n'+new Array(wrap-extra.length+1).join(' ')+extra:new Array(wrap-extra.length-dlen+1).join(' ')+extra);}help.push(prelude+body);});help.push('');return help.join('\n');};Object.defineProperty(self,'argv',{get:function get(){return parseArgs(processArgs);},enumerable:true});function parseArgs(args){var argv=minimist(args,options);argv.$0=self.$0;if(demanded._&&argv._.length<demanded._){fail('Not enough non-option arguments: got '+argv._.length+', need at least '+demanded._);}var missing=[];Object.keys(demanded).forEach(function(key){if(!argv[key])missing.push(key);});if(missing.length){fail('Missing required arguments: '+missing.join(', '));}checks.forEach(function(f){try{if(f(argv)===false){fail('Argument check failed: '+f.toString());}}catch(err){fail(err);}});return argv;}function longest(xs){return Math.max.apply(null,xs.map(function(x){return x.length;}));}return self;};
|
7836 |
|
7837 | exports.rebase=rebase;function rebase(base,dir){var ds=path.normalize(dir).split('/').slice(1);var bs=path.normalize(base).split('/').slice(1);for(var i=0;ds[i]&&ds[i]==bs[i];i++){}ds.splice(0,i);bs.splice(0,i);var p=path.normalize(bs.map(function(){return'..';}).concat(ds).join('/')).replace(/\/$/,'').replace(/^$/,'.');return p.match(/^[.\/]/)?p:'./'+p;};}).call(this,require('_process'));},{"_process":31,"minimist":27,"path":29,"wordwrap":62}],29:[function(require,module,exports){(function(process){
|
7838 |
|
7839 |
|
7840 |
|
7841 |
|
7842 |
|
7843 |
|
7844 |
|
7845 |
|
7846 |
|
7847 |
|
7848 |
|
7849 |
|
7850 |
|
7851 |
|
7852 |
|
7853 |
|
7854 |
|
7855 |
|
7856 |
|
7857 |
|
7858 |
|
7859 |
|
7860 |
|
7861 | function normalizeArray(parts,allowAboveRoot){
|
7862 | var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}
|
7863 | if(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}
|
7864 |
|
7865 | var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function splitPath(filename){return splitPathRe.exec(filename).slice(1);};
|
7866 |
|
7867 | exports.resolve=function(){var resolvedPath='',resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();
|
7868 | if(typeof path!=='string'){throw new TypeError('Arguments to path.resolve must be strings');}else if(!path){continue;}resolvedPath=path+'/'+resolvedPath;resolvedAbsolute=path.charAt(0)==='/';}
|
7869 |
|
7870 |
|
7871 | resolvedPath=normalizeArray(filter(resolvedPath.split('/'),function(p){return!!p;}),!resolvedAbsolute).join('/');return(resolvedAbsolute?'/':'')+resolvedPath||'.';};
|
7872 |
|
7873 | exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==='/';
|
7874 | path=normalizeArray(filter(path.split('/'),function(p){return!!p;}),!isAbsolute).join('/');if(!path&&!isAbsolute){path='.';}if(path&&trailingSlash){path+='/';}return(isAbsolute?'/':'')+path;};
|
7875 | exports.isAbsolute=function(path){return path.charAt(0)==='/';};
|
7876 | exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=='string'){throw new TypeError('Arguments to path.join must be strings');}return p;}).join('/'));};
|
7877 |
|
7878 | exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=='')break;}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=='')break;}if(start>end)return[];return arr.slice(start,end-start+1);}var fromParts=trim(from.split('/'));var toParts=trim(to.split('/'));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break;}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push('..');}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join('/');};exports.sep='/';exports.delimiter=':';exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){
|
7879 | return'.';}if(dir){
|
7880 | dir=dir.substr(0,dir.length-1);}return root+dir;};exports.basename=function(path,ext){var f=splitPath(path)[2];
|
7881 | if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length);}return f;};exports.extname=function(path){return splitPath(path)[3];};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i]);}return res;}
|
7882 | var substr='ab'.substr(-1)==='b'?function(str,start,len){return str.substr(start,len);}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len);};}).call(this,require('_process'));},{"_process":31}],30:[function(require,module,exports){(function(process){'use strict';if(!process.version||process.version.indexOf('v0.')===0||process.version.indexOf('v1.')===0&&process.version.indexOf('v1.8.')!==0){module.exports=nextTick;}else{module.exports=process.nextTick;}function nextTick(fn,arg1,arg2,arg3){if(typeof fn!=='function'){throw new TypeError('"callback" argument must be a function');}var len=arguments.length;var args,i;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function afterTickOne(){fn.call(null,arg1);});case 3:return process.nextTick(function afterTickTwo(){fn.call(null,arg1,arg2);});case 4:return process.nextTick(function afterTickThree(){fn.call(null,arg1,arg2,arg3);});default:args=new Array(len-1);i=0;while(i<args.length){args[i++]=arguments[i];}return process.nextTick(function afterTick(){fn.apply(null,args);});}}}).call(this,require('_process'));},{"_process":31}],31:[function(require,module,exports){
|
7883 | var process=module.exports={};
|
7884 |
|
7885 |
|
7886 |
|
7887 | var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error('setTimeout has not been defined');}function defaultClearTimeout(){throw new Error('clearTimeout has not been defined');}(function(){try{if(typeof setTimeout==='function'){cachedSetTimeout=setTimeout;}else{cachedSetTimeout=defaultSetTimout;}}catch(e){cachedSetTimeout=defaultSetTimout;}try{if(typeof clearTimeout==='function'){cachedClearTimeout=clearTimeout;}else{cachedClearTimeout=defaultClearTimeout;}}catch(e){cachedClearTimeout=defaultClearTimeout;}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){
|
7888 | return setTimeout(fun,0);}
|
7889 | if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0);}try{
|
7890 | return cachedSetTimeout(fun,0);}catch(e){try{
|
7891 | return cachedSetTimeout.call(null,fun,0);}catch(e){
|
7892 | return cachedSetTimeout.call(this,fun,0);}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){
|
7893 | return clearTimeout(marker);}
|
7894 | if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker);}try{
|
7895 | return cachedClearTimeout(marker);}catch(e){try{
|
7896 | return cachedClearTimeout.call(null,marker);}catch(e){
|
7897 |
|
7898 | return cachedClearTimeout.call(this,marker);}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return;}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue);}else{queueIndex=-1;}if(queue.length){drainQueue();}}function drainQueue(){if(draining){return;}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run();}}queueIndex=-1;len=queue.length;}currentQueue=null;draining=false;runClearTimeout(timeout);}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i];}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue);}};
|
7899 | function Item(fun,array){this.fun=fun;this.array=array;}Item.prototype.run=function(){this.fun.apply(null,this.array);};process.title='browser';process.browser=true;process.env={};process.argv=[];process.version='';
|
7900 | process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error('process.binding is not supported');};process.cwd=function(){return'/';};process.chdir=function(dir){throw new Error('process.chdir is not supported');};process.umask=function(){return 0;};},{}],32:[function(require,module,exports){(function(global){;(function(root){var freeExports=(typeof exports==="undefined"?"undefined":_typeof(exports))=='object'&&exports&&!exports.nodeType&&exports;var freeModule=(typeof module==="undefined"?"undefined":_typeof(module))=='object'&&module&&!module.nodeType&&module;var freeGlobal=(typeof global==="undefined"?"undefined":_typeof(global))=='object'&&global;if(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal){root=freeGlobal;} |
7901 |
|
7902 |
|
7903 |
|
7904 | var punycode,maxInt=2147483647,
|
7905 | base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,
|
7906 | delimiter='-',
|
7907 | regexPunycode=/^xn--/,regexNonASCII=/[^\x20-\x7E]/,
|
7908 | regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,
|
7909 | errors={'overflow':'Overflow: input needs wider integers to process','not-basic':'Illegal input >= 0x80 (not a basic code point)','invalid-input':'Invalid input'},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode,key; |
7910 |
|
7911 |
|
7912 |
|
7913 |
|
7914 | function error(type){throw new RangeError(errors[type]);} |
7915 |
|
7916 |
|
7917 |
|
7918 |
|
7919 |
|
7920 |
|
7921 | function map(array,fn){var length=array.length;var result=[];while(length--){result[length]=fn(array[length]);}return result;} |
7922 |
|
7923 |
|
7924 |
|
7925 |
|
7926 |
|
7927 |
|
7928 |
|
7929 |
|
7930 | function mapDomain(string,fn){var parts=string.split('@');var result='';if(parts.length>1){
|
7931 |
|
7932 | result=parts[0]+'@';string=parts[1];}
|
7933 | string=string.replace(regexSeparators,'\x2E');var labels=string.split('.');var encoded=map(labels,fn).join('.');return result+encoded;} |
7934 |
|
7935 |
|
7936 |
|
7937 |
|
7938 |
|
7939 |
|
7940 |
|
7941 |
|
7942 |
|
7943 |
|
7944 |
|
7945 | function ucs2decode(string){var output=[],counter=0,length=string.length,value,extra;while(counter<length){value=string.charCodeAt(counter++);if(value>=0xD800&&value<=0xDBFF&&counter<length){
|
7946 | extra=string.charCodeAt(counter++);if((extra&0xFC00)==0xDC00){
|
7947 | output.push(((value&0x3FF)<<10)+(extra&0x3FF)+0x10000);}else{
|
7948 |
|
7949 | output.push(value);counter--;}}else{output.push(value);}}return output;} |
7950 |
|
7951 |
|
7952 |
|
7953 |
|
7954 |
|
7955 |
|
7956 | function ucs2encode(array){return map(array,function(value){var output='';if(value>0xFFFF){value-=0x10000;output+=stringFromCharCode(value>>>10&0x3FF|0xD800);value=0xDC00|value&0x3FF;}output+=stringFromCharCode(value);return output;}).join('');} |
7957 |
|
7958 |
|
7959 |
|
7960 |
|
7961 |
|
7962 |
|
7963 |
|
7964 | function basicToDigit(codePoint){if(codePoint-48<10){return codePoint-22;}if(codePoint-65<26){return codePoint-65;}if(codePoint-97<26){return codePoint-97;}return base;} |
7965 |
|
7966 |
|
7967 |
|
7968 |
|
7969 |
|
7970 |
|
7971 |
|
7972 |
|
7973 |
|
7974 | function digitToBasic(digit,flag){
|
7975 |
|
7976 | return digit+22+75*(digit<26)-((flag!=0)<<5);} |
7977 |
|
7978 |
|
7979 |
|
7980 | function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));} |
7981 |
|
7982 |
|
7983 |
|
7984 |
|
7985 |
|
7986 | function decode(input){
|
7987 | var output=[],inputLength=input.length,out,i=0,n=initialN,bias=initialBias,basic,j,index,oldi,w,k,digit,t,baseMinusT;
|
7988 |
|
7989 |
|
7990 | basic=input.lastIndexOf(delimiter);if(basic<0){basic=0;}for(j=0;j<basic;++j){
|
7991 | if(input.charCodeAt(j)>=0x80){error('not-basic');}output.push(input.charCodeAt(j));}
|
7992 |
|
7993 | for(index=basic>0?basic+1:0;index<inputLength;){
|
7994 |
|
7995 |
|
7996 |
|
7997 |
|
7998 | for(oldi=i,w=1,k=base;;k+=base){if(index>=inputLength){error('invalid-input');}digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error('overflow');}i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digit<t){break;}baseMinusT=base-t;if(w>floor(maxInt/baseMinusT)){error('overflow');}w*=baseMinusT;}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);
|
7999 |
|
8000 | if(floor(i/out)>maxInt-n){error('overflow');}n+=floor(i/out);i%=out;
|
8001 | output.splice(i++,0,n);}return ucs2encode(output);} |
8002 |
|
8003 |
|
8004 |
|
8005 |
|
8006 |
|
8007 | function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,output=[],inputLength,handledCPCountPlusOne,baseMinusT,qMinusT;
|
8008 | input=ucs2decode(input);
|
8009 | inputLength=input.length;
|
8010 | n=initialN;delta=0;bias=initialBias;
|
8011 | for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<0x80){output.push(stringFromCharCode(currentValue));}}handledCPCount=basicLength=output.length;
|
8012 |
|
8013 |
|
8014 | if(basicLength){output.push(delimiter);}
|
8015 | while(handledCPCount<inputLength){
|
8016 |
|
8017 | for(m=maxInt,j=0;j<inputLength;++j){currentValue=input[j];if(currentValue>=n&¤tValue<m){m=currentValue;}}
|
8018 |
|
8019 | handledCPCountPlusOne=handledCPCount+1;if(m-n>floor((maxInt-delta)/handledCPCountPlusOne)){error('overflow');}delta+=(m-n)*handledCPCountPlusOne;n=m;for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<n&&++delta>maxInt){error('overflow');}if(currentValue==n){
|
8020 | for(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q<t){break;}qMinusT=q-t;baseMinusT=base-t;output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0)));q=floor(qMinusT/baseMinusT);}output.push(stringFromCharCode(digitToBasic(q,0)));bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength);delta=0;++handledCPCount;}}++delta;++n;}return output.join('');} |
8021 |
|
8022 |
|
8023 |
|
8024 |
|
8025 |
|
8026 |
|
8027 |
|
8028 |
|
8029 |
|
8030 | function toUnicode(input){return mapDomain(input,function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string;});} |
8031 |
|
8032 |
|
8033 |
|
8034 |
|
8035 |
|
8036 |
|
8037 |
|
8038 |
|
8039 |
|
8040 | function toASCII(input){return mapDomain(input,function(string){return regexNonASCII.test(string)?'xn--'+encode(string):string;});}punycode={ |
8041 |
|
8042 |
|
8043 |
|
8044 | 'version':'1.4.1', |
8045 |
|
8046 |
|
8047 |
|
8048 |
|
8049 |
|
8050 | 'ucs2':{'decode':ucs2decode,'encode':ucs2encode},'decode':decode,'encode':encode,'toASCII':toASCII,'toUnicode':toUnicode};
|
8051 |
|
8052 | if(typeof define=='function'&&_typeof(define.amd)=='object'&&define.amd){define('punycode',function(){return punycode;});}else if(freeExports&&freeModule){if(module.exports==freeExports){
|
8053 | freeModule.exports=punycode;}else{
|
8054 | for(key in punycode){punycode.hasOwnProperty(key)&&(freeExports[key]=punycode[key]);}}}else{
|
8055 | root.punycode=punycode;}})(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],33:[function(require,module,exports){
|
8056 |
|
8057 |
|
8058 |
|
8059 |
|
8060 |
|
8061 |
|
8062 |
|
8063 |
|
8064 |
|
8065 |
|
8066 |
|
8067 |
|
8068 |
|
8069 |
|
8070 |
|
8071 |
|
8072 |
|
8073 |
|
8074 |
|
8075 | 'use strict';
|
8076 |
|
8077 |
|
8078 | function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}module.exports=function(qs,sep,eq,options){sep=sep||'&';eq=eq||'=';var obj={};if(typeof qs!=='string'||qs.length===0){return obj;}var regexp=/\+/g;qs=qs.split(sep);var maxKeys=1000;if(options&&typeof options.maxKeys==='number'){maxKeys=options.maxKeys;}var len=qs.length;
|
8079 | if(maxKeys>0&&len>maxKeys){len=maxKeys;}for(var i=0;i<len;++i){var x=qs[i].replace(regexp,'%20'),idx=x.indexOf(eq),kstr,vstr,k,v;if(idx>=0){kstr=x.substr(0,idx);vstr=x.substr(idx+1);}else{kstr=x;vstr='';}k=decodeURIComponent(kstr);v=decodeURIComponent(vstr);if(!hasOwnProperty(obj,k)){obj[k]=v;}else if(isArray(obj[k])){obj[k].push(v);}else{obj[k]=[obj[k],v];}}return obj;};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==='[object Array]';};},{}],34:[function(require,module,exports){
|
8080 |
|
8081 |
|
8082 |
|
8083 |
|
8084 |
|
8085 |
|
8086 |
|
8087 |
|
8088 |
|
8089 |
|
8090 |
|
8091 |
|
8092 |
|
8093 |
|
8094 |
|
8095 |
|
8096 |
|
8097 |
|
8098 |
|
8099 | 'use strict';var stringifyPrimitive=function stringifyPrimitive(v){switch(typeof v==="undefined"?"undefined":_typeof(v)){case'string':return v;case'boolean':return v?'true':'false';case'number':return isFinite(v)?v:'';default:return'';}};module.exports=function(obj,sep,eq,name){sep=sep||'&';eq=eq||'=';if(obj===null){obj=undefined;}if((typeof obj==="undefined"?"undefined":_typeof(obj))==='object'){return map(objectKeys(obj),function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;if(isArray(obj[k])){return map(obj[k],function(v){return ks+encodeURIComponent(stringifyPrimitive(v));}).join(sep);}else{return ks+encodeURIComponent(stringifyPrimitive(obj[k]));}}).join(sep);}if(!name)return'';return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj));};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==='[object Array]';};function map(xs,f){if(xs.map)return xs.map(f);var res=[];for(var i=0;i<xs.length;i++){res.push(f(xs[i],i));}return res;}var objectKeys=Object.keys||function(obj){var res=[];for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))res.push(key);}return res;};},{}],35:[function(require,module,exports){'use strict';exports.decode=exports.parse=require('./decode');exports.encode=exports.stringify=require('./encode');},{"./decode":33,"./encode":34}],36:[function(require,module,exports){module.exports=require("./lib/_stream_duplex.js");},{"./lib/_stream_duplex.js":37}],37:[function(require,module,exports){
|
8100 |
|
8101 |
|
8102 |
|
8103 | 'use strict';var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){keys.push(key);}return keys;};module.exports=Duplex;var processNextTick=require('process-nextick-args');var util=require('core-util-is');util.inherits=require('inherits');var Readable=require('./_stream_readable');var Writable=require('./_stream_writable');util.inherits(Duplex,Readable);var keys=objectKeys(Writable.prototype);for(var v=0;v<keys.length;v++){var method=keys[v];if(!Duplex.prototype[method])Duplex.prototype[method]=Writable.prototype[method];}function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options);Writable.call(this,options);if(options&&options.readable===false)this.readable=false;if(options&&options.writable===false)this.writable=false;this.allowHalfOpen=true;if(options&&options.allowHalfOpen===false)this.allowHalfOpen=false;this.once('end',onend);}
|
8104 | function onend(){
|
8105 |
|
8106 | if(this.allowHalfOpen||this._writableState.ended)return;
|
8107 |
|
8108 | processNextTick(onEndNT,this);}function onEndNT(self){self.end();}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i);}}},{"./_stream_readable":39,"./_stream_writable":41,"core-util-is":19,"inherits":24,"process-nextick-args":30}],38:[function(require,module,exports){
|
8109 |
|
8110 |
|
8111 | 'use strict';module.exports=PassThrough;var Transform=require('./_stream_transform');var util=require('core-util-is');util.inherits=require('inherits');util.inherits(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options);}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk);};},{"./_stream_transform":40,"core-util-is":19,"inherits":24}],39:[function(require,module,exports){(function(process){'use strict';module.exports=Readable;var processNextTick=require('process-nextick-args');var isArray=require('isarray');Readable.ReadableState=ReadableState;var EE=require('events').EventEmitter;var EElistenerCount=function EElistenerCount(emitter,type){return emitter.listeners(type).length;};var Stream;(function(){try{Stream=require('st'+'ream');}catch(_){}finally{if(!Stream)Stream=require('events').EventEmitter;}})();var Buffer=require('buffer').Buffer;var bufferShim=require('buffer-shims');var util=require('core-util-is');util.inherits=require('inherits');var debugUtil=require('util');var debug=void 0;if(debugUtil&&debugUtil.debuglog){debug=debugUtil.debuglog('stream');}else{debug=function debug(){};}var BufferList=require('./internal/streams/BufferList');var StringDecoder;util.inherits(Readable,Stream);function prependListener(emitter,event,fn){if(typeof emitter.prependListener==='function'){return emitter.prependListener(event,fn);}else{
|
8112 |
|
8113 |
|
8114 |
|
8115 | if(!emitter._events||!emitter._events[event])emitter.on(event,fn);else if(isArray(emitter._events[event]))emitter._events[event].unshift(fn);else emitter._events[event]=[fn,emitter._events[event]];}}var Duplex;function ReadableState(options,stream){Duplex=Duplex||require('./_stream_duplex');options=options||{};
|
8116 |
|
8117 | this.objectMode=!!options.objectMode;if(stream instanceof Duplex)this.objectMode=this.objectMode||!!options.readableObjectMode;
|
8118 |
|
8119 | var hwm=options.highWaterMark;var defaultHwm=this.objectMode?16:16*1024;this.highWaterMark=hwm||hwm===0?hwm:defaultHwm;
|
8120 | this.highWaterMark=~~this.highWaterMark;
|
8121 |
|
8122 |
|
8123 | this.buffer=new BufferList();this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;
|
8124 |
|
8125 |
|
8126 |
|
8127 | this.sync=true;
|
8128 |
|
8129 | this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;
|
8130 |
|
8131 |
|
8132 | this.defaultEncoding=options.defaultEncoding||'utf8';
|
8133 |
|
8134 | this.ranOut=false;
|
8135 | this.awaitDrain=0;
|
8136 | this.readingMore=false;this.decoder=null;this.encoding=null;if(options.encoding){if(!StringDecoder)StringDecoder=require('string_decoder/').StringDecoder;this.decoder=new StringDecoder(options.encoding);this.encoding=options.encoding;}}var Duplex;function Readable(options){Duplex=Duplex||require('./_stream_duplex');if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this);
|
8137 | this.readable=true;if(options&&typeof options.read==='function')this._read=options.read;Stream.call(this);}
|
8138 |
|
8139 |
|
8140 |
|
8141 | Readable.prototype.push=function(chunk,encoding){var state=this._readableState;if(!state.objectMode&&typeof chunk==='string'){encoding=encoding||state.defaultEncoding;if(encoding!==state.encoding){chunk=bufferShim.from(chunk,encoding);encoding='';}}return readableAddChunk(this,state,chunk,encoding,false);};
|
8142 | Readable.prototype.unshift=function(chunk){var state=this._readableState;return readableAddChunk(this,state,chunk,'',true);};Readable.prototype.isPaused=function(){return this._readableState.flowing===false;};function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er){stream.emit('error',er);}else if(chunk===null){state.reading=false;onEofChunk(stream,state);}else if(state.objectMode||chunk&&chunk.length>0){if(state.ended&&!addToFront){var e=new Error('stream.push() after EOF');stream.emit('error',e);}else if(state.endEmitted&&addToFront){var _e=new Error('stream.unshift() after end event');stream.emit('error',_e);}else{var skipAdd;if(state.decoder&&!addToFront&&!encoding){chunk=state.decoder.write(chunk);skipAdd=!state.objectMode&&chunk.length===0;}if(!addToFront)state.reading=false;
|
8143 |
|
8144 | if(!skipAdd){
|
8145 | if(state.flowing&&state.length===0&&!state.sync){stream.emit('data',chunk);stream.read(0);}else{
|
8146 | state.length+=state.objectMode?1:chunk.length;if(addToFront)state.buffer.unshift(chunk);else state.buffer.push(chunk);if(state.needReadable)emitReadable(stream);}}maybeReadMore(stream,state);}}else if(!addToFront){state.reading=false;}return needMoreData(state);}
|
8147 |
|
8148 |
|
8149 |
|
8150 |
|
8151 |
|
8152 |
|
8153 | function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}
|
8154 | Readable.prototype.setEncoding=function(enc){if(!StringDecoder)StringDecoder=require('string_decoder/').StringDecoder;this._readableState.decoder=new StringDecoder(enc);this._readableState.encoding=enc;return this;};
|
8155 | var MAX_HWM=0x800000;function computeNewHighWaterMark(n){if(n>=MAX_HWM){n=MAX_HWM;}else{
|
8156 |
|
8157 | n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++;}return n;}
|
8158 |
|
8159 | function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){
|
8160 | if(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}
|
8161 | if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;
|
8162 | if(!state.ended){state.needReadable=true;return 0;}return state.length;}
|
8163 | Readable.prototype.read=function(n){debug('read',n);n=parseInt(n,10);var state=this._readableState;var nOrig=n;if(n!==0)state.emittedReadable=false;
|
8164 |
|
8165 |
|
8166 | if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){debug('read: emitReadable',state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);else emitReadable(this);return null;}n=howMuchToRead(n,state);
|
8167 | if(n===0&&state.ended){if(state.length===0)endReadable(this);return null;}
|
8168 |
|
8169 |
|
8170 |
|
8171 |
|
8172 |
|
8173 |
|
8174 |
|
8175 |
|
8176 |
|
8177 |
|
8178 |
|
8179 |
|
8180 |
|
8181 |
|
8182 |
|
8183 |
|
8184 |
|
8185 |
|
8186 |
|
8187 |
|
8188 |
|
8189 | var doRead=state.needReadable;debug('need readable',doRead);
|
8190 | if(state.length===0||state.length-n<state.highWaterMark){doRead=true;debug('length less than watermark',doRead);}
|
8191 |
|
8192 | if(state.ended||state.reading){doRead=false;debug('reading or ended',doRead);}else if(doRead){debug('do read');state.reading=true;state.sync=true;
|
8193 | if(state.length===0)state.needReadable=true;
|
8194 | this._read(state.highWaterMark);state.sync=false;
|
8195 |
|
8196 | if(!state.reading)n=howMuchToRead(nOrig,state);}var ret;if(n>0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0;}else{state.length-=n;}if(state.length===0){
|
8197 |
|
8198 | if(!state.ended)state.needReadable=true;
|
8199 | if(nOrig!==n&&state.ended)endReadable(this);}if(ret!==null)this.emit('data',ret);return ret;};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&typeof chunk!=='string'&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError('Invalid non-string/buffer chunk');}return er;}function onEofChunk(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length;}}state.ended=true;
|
8200 | emitReadable(stream);}
|
8201 |
|
8202 |
|
8203 | function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug('emitReadable',state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream);}}function emitReadable_(stream){debug('emit readable');stream.emit('readable');flow(stream);}
|
8204 |
|
8205 |
|
8206 |
|
8207 |
|
8208 |
|
8209 | function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark){debug('maybeReadMore read 0');stream.read(0);if(len===state.length)
|
8210 | break;else len=state.length;}state.readingMore=false;}
|
8211 |
|
8212 |
|
8213 |
|
8214 | Readable.prototype._read=function(n){this.emit('error',new Error('not implemented'));};Readable.prototype.pipe=function(dest,pipeOpts){var src=this;var state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break;}state.pipesCount+=1;debug('pipe count=%d opts=%j',state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==false)&&dest!==process.stdout&&dest!==process.stderr;var endFn=doEnd?onend:cleanup;if(state.endEmitted)processNextTick(endFn);else src.once('end',endFn);dest.on('unpipe',onunpipe);function onunpipe(readable){debug('onunpipe');if(readable===src){cleanup();}}function onend(){debug('onend');dest.end();}
|
8215 |
|
8216 |
|
8217 |
|
8218 | var ondrain=pipeOnDrain(src);dest.on('drain',ondrain);var cleanedUp=false;function cleanup(){debug('cleanup');
|
8219 | dest.removeListener('close',onclose);dest.removeListener('finish',onfinish);dest.removeListener('drain',ondrain);dest.removeListener('error',onerror);dest.removeListener('unpipe',onunpipe);src.removeListener('end',onend);src.removeListener('end',cleanup);src.removeListener('data',ondata);cleanedUp=true;
|
8220 |
|
8221 |
|
8222 |
|
8223 |
|
8224 | if(state.awaitDrain&&(!dest._writableState||dest._writableState.needDrain))ondrain();}
|
8225 |
|
8226 |
|
8227 |
|
8228 | var increasedAwaitDrain=false;src.on('data',ondata);function ondata(chunk){debug('ondata');increasedAwaitDrain=false;var ret=dest.write(chunk);if(false===ret&&!increasedAwaitDrain){
|
8229 |
|
8230 |
|
8231 |
|
8232 | if((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp){debug('false write response, pause',src._readableState.awaitDrain);src._readableState.awaitDrain++;increasedAwaitDrain=true;}src.pause();}}
|
8233 |
|
8234 | function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}
|
8235 | prependListener(dest,'error',onerror);
|
8236 | function onclose(){dest.removeListener('finish',onfinish);unpipe();}dest.once('close',onclose);function onfinish(){debug('onfinish');dest.removeListener('close',onclose);unpipe();}dest.once('finish',onfinish);function unpipe(){debug('unpipe');src.unpipe(dest);}
|
8237 | dest.emit('pipe',src);
|
8238 | if(!state.flowing){debug('pipe resume');src.resume();}return dest;};function pipeOnDrain(src){return function(){var state=src._readableState;debug('pipeOnDrain',state.awaitDrain);if(state.awaitDrain)state.awaitDrain--;if(state.awaitDrain===0&&EElistenerCount(src,'data')){state.flowing=true;flow(src);}};}Readable.prototype.unpipe=function(dest){var state=this._readableState;
|
8239 | if(state.pipesCount===0)return this;
|
8240 | if(state.pipesCount===1){
|
8241 | if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;
|
8242 | state.pipes=null;state.pipesCount=0;state.flowing=false;if(dest)dest.emit('unpipe',this);return this;}
|
8243 | if(!dest){
|
8244 | var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;state.flowing=false;for(var _i=0;_i<len;_i++){dests[_i].emit('unpipe',this);}return this;}
|
8245 | var i=indexOf(state.pipes,dest);if(i===-1)return this;state.pipes.splice(i,1);state.pipesCount-=1;if(state.pipesCount===1)state.pipes=state.pipes[0];dest.emit('unpipe',this);return this;};
|
8246 |
|
8247 | Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if(ev==='data'){
|
8248 | if(this._readableState.flowing!==false)this.resume();}else if(ev==='readable'){var state=this._readableState;if(!state.endEmitted&&!state.readableListening){state.readableListening=state.needReadable=true;state.emittedReadable=false;if(!state.reading){processNextTick(nReadingNextTick,this);}else if(state.length){emitReadable(this,state);}}}return res;};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(self){debug('readable nexttick read 0');self.read(0);}
|
8249 |
|
8250 | Readable.prototype.resume=function(){var state=this._readableState;if(!state.flowing){debug('resume');state.flowing=true;resume(this,state);}return this;};function resume(stream,state){if(!state.resumeScheduled){state.resumeScheduled=true;processNextTick(resume_,stream,state);}}function resume_(stream,state){if(!state.reading){debug('resume read 0');stream.read(0);}state.resumeScheduled=false;state.awaitDrain=0;stream.emit('resume');flow(stream);if(state.flowing&&!state.reading)stream.read(0);}Readable.prototype.pause=function(){debug('call pause flowing=%j',this._readableState.flowing);if(false!==this._readableState.flowing){debug('pause');this._readableState.flowing=false;this.emit('pause');}return this;};function flow(stream){var state=stream._readableState;debug('flow',state.flowing);while(state.flowing&&stream.read()!==null){}}
|
8251 |
|
8252 |
|
8253 | Readable.prototype.wrap=function(stream){var state=this._readableState;var paused=false;var self=this;stream.on('end',function(){debug('wrapped end');if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length)self.push(chunk);}self.push(null);});stream.on('data',function(chunk){debug('wrapped data');if(state.decoder)chunk=state.decoder.write(chunk);
|
8254 | if(state.objectMode&&(chunk===null||chunk===undefined))return;else if(!state.objectMode&&(!chunk||!chunk.length))return;var ret=self.push(chunk);if(!ret){paused=true;stream.pause();}});
|
8255 |
|
8256 | for(var i in stream){if(this[i]===undefined&&typeof stream[i]==='function'){this[i]=function(method){return function(){return stream[method].apply(stream,arguments);};}(i);}}
|
8257 | var events=['error','close','destroy','pause','resume'];forEach(events,function(ev){stream.on(ev,self.emit.bind(self,ev));});
|
8258 |
|
8259 | self._read=function(n){debug('wrapped _read',n);if(paused){paused=false;stream.resume();}};return self;};
|
8260 | Readable._fromList=fromList;
|
8261 |
|
8262 |
|
8263 |
|
8264 | function fromList(n,state){
|
8265 | if(state.length===0)return null;var ret;if(state.objectMode)ret=state.buffer.shift();else if(!n||n>=state.length){
|
8266 | if(state.decoder)ret=state.buffer.join('');else if(state.buffer.length===1)ret=state.buffer.head.data;else ret=state.buffer.concat(state.length);state.buffer.clear();}else{
|
8267 | ret=fromListPartial(n,state.buffer,state.decoder);}return ret;}
|
8268 |
|
8269 |
|
8270 | function fromListPartial(n,list,hasStrings){var ret;if(n<list.head.data.length){
|
8271 | ret=list.head.data.slice(0,n);list.head.data=list.head.data.slice(n);}else if(n===list.head.data.length){
|
8272 | ret=list.shift();}else{
|
8273 | ret=hasStrings?copyFromBufferString(n,list):copyFromBuffer(n,list);}return ret;}
|
8274 |
|
8275 |
|
8276 |
|
8277 | function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list.head=p;p.data=str.slice(nb);}break;}++c;}list.length-=c;return ret;}
|
8278 |
|
8279 |
|
8280 | function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n);var p=list.head;var c=1;p.data.copy(ret);n-=p.data.length;while(p=p.next){var buf=p.data;var nb=n>buf.length?buf.length:n;buf.copy(ret,ret.length-n,0,nb);n-=nb;if(n===0){if(nb===buf.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list.head=p;p.data=buf.slice(nb);}break;}++c;}list.length-=c;return ret;}function endReadable(stream){var state=stream._readableState;
|
8281 |
|
8282 | if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!state.endEmitted){state.ended=true;processNextTick(endReadableNT,state,stream);}}function endReadableNT(state,stream){
|
8283 | if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit('end');}}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i);}}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i;}return-1;}}).call(this,require('_process'));},{"./_stream_duplex":37,"./internal/streams/BufferList":42,"_process":31,"buffer":17,"buffer-shims":16,"core-util-is":19,"events":21,"inherits":24,"isarray":26,"process-nextick-args":30,"string_decoder/":53,"util":14}],40:[function(require,module,exports){
|
8284 |
|
8285 |
|
8286 |
|
8287 |
|
8288 |
|
8289 |
|
8290 |
|
8291 |
|
8292 |
|
8293 |
|
8294 |
|
8295 |
|
8296 |
|
8297 |
|
8298 |
|
8299 |
|
8300 |
|
8301 |
|
8302 |
|
8303 |
|
8304 |
|
8305 |
|
8306 |
|
8307 |
|
8308 |
|
8309 |
|
8310 |
|
8311 |
|
8312 |
|
8313 |
|
8314 |
|
8315 |
|
8316 |
|
8317 |
|
8318 |
|
8319 |
|
8320 |
|
8321 |
|
8322 |
|
8323 |
|
8324 | 'use strict';module.exports=Transform;var Duplex=require('./_stream_duplex');var util=require('core-util-is');util.inherits=require('inherits');util.inherits(Transform,Duplex);function TransformState(stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data);};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null;this.writeencoding=null;}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=false;var cb=ts.writecb;if(!cb)return stream.emit('error',new Error('no writecb in Transform class'));ts.writechunk=null;ts.writecb=null;if(data!==null&&data!==undefined)stream.push(data);cb(er);var rs=stream._readableState;rs.reading=false;if(rs.needReadable||rs.length<rs.highWaterMark){stream._read(rs.highWaterMark);}}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options);this._transformState=new TransformState(this);
|
8325 | var stream=this;
|
8326 | this._readableState.needReadable=true;
|
8327 |
|
8328 |
|
8329 | this._readableState.sync=false;if(options){if(typeof options.transform==='function')this._transform=options.transform;if(typeof options.flush==='function')this._flush=options.flush;}this.once('prefinish',function(){if(typeof this._flush==='function')this._flush(function(er){done(stream,er);});else done(stream);});}Transform.prototype.push=function(chunk,encoding){this._transformState.needTransform=false;return Duplex.prototype.push.call(this,chunk,encoding);};
|
8330 |
|
8331 |
|
8332 |
|
8333 |
|
8334 |
|
8335 |
|
8336 |
|
8337 |
|
8338 |
|
8339 | Transform.prototype._transform=function(chunk,encoding,cb){throw new Error('Not implemented');};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;ts.writecb=cb;ts.writechunk=chunk;ts.writeencoding=encoding;if(!ts.transforming){var rs=this._readableState;if(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)this._read(rs.highWaterMark);}};
|
8340 |
|
8341 |
|
8342 | Transform.prototype._read=function(n){var ts=this._transformState;if(ts.writechunk!==null&&ts.writecb&&!ts.transforming){ts.transforming=true;this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform);}else{
|
8343 |
|
8344 | ts.needTransform=true;}};function done(stream,er){if(er)return stream.emit('error',er);
|
8345 |
|
8346 | var ws=stream._writableState;var ts=stream._transformState;if(ws.length)throw new Error('Calling transform done when ws.length != 0');if(ts.transforming)throw new Error('Calling transform done when still transforming');return stream.push(null);}},{"./_stream_duplex":37,"core-util-is":19,"inherits":24}],41:[function(require,module,exports){(function(process){
|
8347 |
|
8348 |
|
8349 | 'use strict';module.exports=Writable;var processNextTick=require('process-nextick-args');var asyncWrite=!process.browser&&['v0.10','v0.9.'].indexOf(process.version.slice(0,5))>-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=require('core-util-is');util.inherits=require('inherits');var internalUtil={deprecate:require('util-deprecate')};var Stream;(function(){try{Stream=require('st'+'ream');}catch(_){}finally{if(!Stream)Stream=require('events').EventEmitter;}})();var Buffer=require('buffer').Buffer;var bufferShim=require('buffer-shims');util.inherits(Writable,Stream);function nop(){}function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb;this.next=null;}var Duplex;function WritableState(options,stream){Duplex=Duplex||require('./_stream_duplex');options=options||{};
|
8350 |
|
8351 | this.objectMode=!!options.objectMode;if(stream instanceof Duplex)this.objectMode=this.objectMode||!!options.writableObjectMode;
|
8352 |
|
8353 |
|
8354 | var hwm=options.highWaterMark;var defaultHwm=this.objectMode?16:16*1024;this.highWaterMark=hwm||hwm===0?hwm:defaultHwm;
|
8355 | this.highWaterMark=~~this.highWaterMark;this.needDrain=false;
|
8356 | this.ending=false;
|
8357 | this.ended=false;
|
8358 | this.finished=false;
|
8359 |
|
8360 |
|
8361 | var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;
|
8362 |
|
8363 |
|
8364 | this.defaultEncoding=options.defaultEncoding||'utf8';
|
8365 |
|
8366 |
|
8367 | this.length=0;
|
8368 | this.writing=false;
|
8369 | this.corked=0;
|
8370 |
|
8371 |
|
8372 |
|
8373 | this.sync=true;
|
8374 |
|
8375 |
|
8376 | this.bufferProcessing=false;
|
8377 | this.onwrite=function(er){onwrite(stream,er);};
|
8378 | this.writecb=null;
|
8379 | this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;
|
8380 |
|
8381 | this.pendingcb=0;
|
8382 |
|
8383 | this.prefinished=false;
|
8384 | this.errorEmitted=false;
|
8385 | this.bufferedRequestCount=0;
|
8386 |
|
8387 | this.corkedRequestsFree=new CorkedRequest(this);}WritableState.prototype.getBuffer=function writableStateGetBuffer(){var current=this.bufferedRequest;var out=[];while(current){out.push(current);current=current.next;}return out;};(function(){try{Object.defineProperty(WritableState.prototype,'buffer',{get:internalUtil.deprecate(function(){return this.getBuffer();},'_writableState.buffer is deprecated. Use _writableState.getBuffer '+'instead.')});}catch(_){}})();var Duplex;function Writable(options){Duplex=Duplex||require('./_stream_duplex');
|
8388 |
|
8389 | if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);
|
8390 | this.writable=true;if(options){if(typeof options.write==='function')this._write=options.write;if(typeof options.writev==='function')this._writev=options.writev;}Stream.call(this);}
|
8391 | Writable.prototype.pipe=function(){this.emit('error',new Error('Cannot pipe, not readable'));};function writeAfterEnd(stream,cb){var er=new Error('write after end');
|
8392 | stream.emit('error',er);processNextTick(cb,er);}
|
8393 |
|
8394 |
|
8395 |
|
8396 |
|
8397 | function validChunk(stream,state,chunk,cb){var valid=true;var er=false;
|
8398 |
|
8399 |
|
8400 | if(chunk===null){er=new TypeError('May not write null values to stream');}else if(!Buffer.isBuffer(chunk)&&typeof chunk!=='string'&&chunk!==undefined&&!state.objectMode){er=new TypeError('Invalid non-string/buffer chunk');}if(er){stream.emit('error',er);processNextTick(cb,er);valid=false;}return valid;}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==='function'){cb=encoding;encoding=null;}if(Buffer.isBuffer(chunk))encoding='buffer';else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=='function')cb=nop;if(state.ended)writeAfterEnd(this,cb);else if(validChunk(this,state,chunk,cb)){state.pendingcb++;ret=writeOrBuffer(this,state,chunk,encoding,cb);}return ret;};Writable.prototype.cork=function(){var state=this._writableState;state.corked++;};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state);}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){
|
8401 | if(typeof encoding==='string')encoding=encoding.toLowerCase();if(!(['hex','utf8','utf-8','ascii','binary','base64','ucs2','ucs-2','utf16le','utf-16le','raw'].indexOf((encoding+'').toLowerCase())>-1))throw new TypeError('Unknown encoding: '+encoding);this._writableState.defaultEncoding=encoding;return this;};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==='string'){chunk=bufferShim.from(chunk,encoding);}return chunk;}
|
8402 |
|
8403 |
|
8404 | function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding='buffer';var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;
|
8405 | if(!ret)state.needDrain=true;if(state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest=new WriteReq(chunk,encoding,cb);if(last){last.next=state.lastBufferedRequest;}else{state.bufferedRequest=state.lastBufferedRequest;}state.bufferedRequestCount+=1;}else{doWrite(stream,state,false,len,chunk,encoding,cb);}return ret;}function doWrite(stream,state,writev,len,chunk,encoding,cb){state.writelen=len;state.writecb=cb;state.writing=true;state.sync=true;if(writev)stream._writev(chunk,state.onwrite);else stream._write(chunk,encoding,state.onwrite);state.sync=false;}function onwriteError(stream,state,sync,er,cb){--state.pendingcb;if(sync)processNextTick(cb,er);else cb(er);stream._writableState.errorEmitted=true;stream.emit('error',er);}function onwriteStateUpdate(state){state.writing=false;state.writecb=null;state.length-=state.writelen;state.writelen=0;}function onwrite(stream,er){var state=stream._writableState;var sync=state.sync;var cb=state.writecb;onwriteStateUpdate(state);if(er)onwriteError(stream,state,sync,er,cb);else{
|
8406 | var finished=needFinish(state);if(!finished&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest){clearBuffer(stream,state);}if(sync){asyncWrite(afterWrite,stream,state,finished,cb);}else{afterWrite(stream,state,finished,cb);}}}function afterWrite(stream,state,finished,cb){if(!finished)onwriteDrain(stream,state);state.pendingcb--;cb();finishMaybe(stream,state);}
|
8407 |
|
8408 |
|
8409 | function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}
|
8410 | function clearBuffer(stream,state){state.bufferProcessing=true;var entry=state.bufferedRequest;if(stream._writev&&entry&&entry.next){
|
8411 | var l=state.bufferedRequestCount;var buffer=new Array(l);var holder=state.corkedRequestsFree;holder.entry=entry;var count=0;while(entry){buffer[count]=entry;entry=entry.next;count+=1;}doWrite(stream,state,true,state.length,buffer,'',holder.finish);
|
8412 |
|
8413 | state.pendingcb++;state.lastBufferedRequest=null;if(holder.next){state.corkedRequestsFree=holder.next;holder.next=null;}else{state.corkedRequestsFree=new CorkedRequest(state);}}else{
|
8414 | while(entry){var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,false,len,chunk,encoding,cb);entry=entry.next;
|
8415 |
|
8416 |
|
8417 |
|
8418 | if(state.writing){break;}}if(entry===null)state.lastBufferedRequest=null;}state.bufferedRequestCount=0;state.bufferedRequest=entry;state.bufferProcessing=false;}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error('not implemented'));};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;if(typeof chunk==='function'){cb=chunk;chunk=null;encoding=null;}else if(typeof encoding==='function'){cb=encoding;encoding=null;}if(chunk!==null&&chunk!==undefined)this.write(chunk,encoding);
|
8419 | if(state.corked){state.corked=1;this.uncork();}
|
8420 | if(!state.ending&&!state.finished)endWritable(this,state,cb);};function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing;}function prefinish(stream,state){if(!state.prefinished){state.prefinished=true;stream.emit('prefinish');}}function finishMaybe(stream,state){var need=needFinish(state);if(need){if(state.pendingcb===0){prefinish(stream,state);state.finished=true;stream.emit('finish');}else{prefinish(stream,state);}}return need;}function endWritable(stream,state,cb){state.ending=true;finishMaybe(stream,state);if(cb){if(state.finished)processNextTick(cb);else stream.once('finish',cb);}state.ended=true;stream.writable=false;}
|
8421 |
|
8422 | function CorkedRequest(state){var _this=this;this.next=null;this.entry=null;this.finish=function(err){var entry=_this.entry;_this.entry=null;while(entry){var cb=entry.callback;state.pendingcb--;cb(err);entry=entry.next;}if(state.corkedRequestsFree){state.corkedRequestsFree.next=_this;}else{state.corkedRequestsFree=_this;}};}}).call(this,require('_process'));},{"./_stream_duplex":37,"_process":31,"buffer":17,"buffer-shims":16,"core-util-is":19,"events":21,"inherits":24,"process-nextick-args":30,"util-deprecate":58}],42:[function(require,module,exports){'use strict';var Buffer=require('buffer').Buffer;var bufferShim=require('buffer-shims');module.exports=BufferList;function BufferList(){this.head=null;this.tail=null;this.length=0;}BufferList.prototype.push=function(v){var entry={data:v,next:null};if(this.length>0)this.tail.next=entry;else this.head=entry;this.tail=entry;++this.length;};BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};if(this.length===0)this.tail=entry;this.head=entry;++this.length;};BufferList.prototype.shift=function(){if(this.length===0)return;var ret=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return ret;};BufferList.prototype.clear=function(){this.head=this.tail=null;this.length=0;};BufferList.prototype.join=function(s){if(this.length===0)return'';var p=this.head;var ret=''+p.data;while(p=p.next){ret+=s+p.data;}return ret;};BufferList.prototype.concat=function(n){if(this.length===0)return bufferShim.alloc(0);if(this.length===1)return this.head.data;var ret=bufferShim.allocUnsafe(n>>>0);var p=this.head;var i=0;while(p){p.data.copy(ret,i);i+=p.data.length;p=p.next;}return ret;};},{"buffer":17,"buffer-shims":16}],43:[function(require,module,exports){module.exports=require("./lib/_stream_passthrough.js");},{"./lib/_stream_passthrough.js":38}],44:[function(require,module,exports){(function(process){var Stream=function(){try{return require('st'+'ream');
|
8423 | }catch(_){}}();exports=module.exports=require('./lib/_stream_readable.js');exports.Stream=Stream||exports;exports.Readable=exports;exports.Writable=require('./lib/_stream_writable.js');exports.Duplex=require('./lib/_stream_duplex.js');exports.Transform=require('./lib/_stream_transform.js');exports.PassThrough=require('./lib/_stream_passthrough.js');if(!process.browser&&process.env.READABLE_STREAM==='disable'&&Stream){module.exports=Stream;}}).call(this,require('_process'));},{"./lib/_stream_duplex.js":37,"./lib/_stream_passthrough.js":38,"./lib/_stream_readable.js":39,"./lib/_stream_transform.js":40,"./lib/_stream_writable.js":41,"_process":31}],45:[function(require,module,exports){module.exports=require("./lib/_stream_transform.js");},{"./lib/_stream_transform.js":40}],46:[function(require,module,exports){module.exports=require("./lib/_stream_writable.js");},{"./lib/_stream_writable.js":41}],47:[function(require,module,exports){(function(Buffer){;(function(sax){
|
8424 | sax.parser=function(strict,opt){return new SAXParser(strict,opt);};sax.SAXParser=SAXParser;sax.SAXStream=SAXStream;sax.createStream=createStream;
|
8425 |
|
8426 |
|
8427 |
|
8428 |
|
8429 |
|
8430 |
|
8431 |
|
8432 |
|
8433 | sax.MAX_BUFFER_LENGTH=64*1024;var buffers=['comment','sgmlDecl','textNode','tagName','doctype','procInstName','procInstBody','entity','attribName','attribValue','cdata','script'];sax.EVENTS=['text','processinginstruction','sgmldeclaration','doctype','comment','opentagstart','attribute','opentag','closetag','opencdata','cdata','closecdata','error','end','ready','script','opennamespace','closenamespace'];function SAXParser(strict,opt){if(!(this instanceof SAXParser)){return new SAXParser(strict,opt);}var parser=this;clearBuffers(parser);parser.q=parser.c='';parser.bufferCheckPosition=sax.MAX_BUFFER_LENGTH;parser.opt=opt||{};parser.opt.lowercase=parser.opt.lowercase||parser.opt.lowercasetags;parser.looseCase=parser.opt.lowercase?'toLowerCase':'toUpperCase';parser.tags=[];parser.closed=parser.closedRoot=parser.sawRoot=false;parser.tag=parser.error=null;parser.strict=!!strict;parser.noscript=!!(strict||parser.opt.noscript);parser.state=S.BEGIN;parser.strictEntities=parser.opt.strictEntities;parser.ENTITIES=parser.strictEntities?Object.create(sax.XML_ENTITIES):Object.create(sax.ENTITIES);parser.attribList=[];
|
8434 |
|
8435 |
|
8436 | if(parser.opt.xmlns){parser.ns=Object.create(rootNS);}
|
8437 | parser.trackPosition=parser.opt.position!==false;if(parser.trackPosition){parser.position=parser.line=parser.column=0;}emit(parser,'onready');}if(!Object.create){Object.create=function(o){function F(){}F.prototype=o;var newf=new F();return newf;};}if(!Object.keys){Object.keys=function(o){var a=[];for(var i in o){if(o.hasOwnProperty(i))a.push(i);}return a;};}function checkBufferLength(parser){var maxAllowed=Math.max(sax.MAX_BUFFER_LENGTH,10);var maxActual=0;for(var i=0,l=buffers.length;i<l;i++){var len=parser[buffers[i]].length;if(len>maxAllowed){
|
8438 |
|
8439 |
|
8440 |
|
8441 | switch(buffers[i]){case'textNode':closeText(parser);break;case'cdata':emitNode(parser,'oncdata',parser.cdata);parser.cdata='';break;case'script':emitNode(parser,'onscript',parser.script);parser.script='';break;default:error(parser,'Max buffer length exceeded: '+buffers[i]);}}maxActual=Math.max(maxActual,len);}
|
8442 | var m=sax.MAX_BUFFER_LENGTH-maxActual;parser.bufferCheckPosition=m+parser.position;}function clearBuffers(parser){for(var i=0,l=buffers.length;i<l;i++){parser[buffers[i]]='';}}function flushBuffers(parser){closeText(parser);if(parser.cdata!==''){emitNode(parser,'oncdata',parser.cdata);parser.cdata='';}if(parser.script!==''){emitNode(parser,'onscript',parser.script);parser.script='';}}SAXParser.prototype={end:function end(){_end(this);},write:write,resume:function resume(){this.error=null;return this;},close:function close(){return this.write(null);},flush:function flush(){flushBuffers(this);}};var Stream;try{Stream=require('stream').Stream;}catch(ex){Stream=function Stream(){};}var streamWraps=sax.EVENTS.filter(function(ev){return ev!=='error'&&ev!=='end';});function createStream(strict,opt){return new SAXStream(strict,opt);}function SAXStream(strict,opt){if(!(this instanceof SAXStream)){return new SAXStream(strict,opt);}Stream.apply(this);this._parser=new SAXParser(strict,opt);this.writable=true;this.readable=true;var me=this;this._parser.onend=function(){me.emit('end');};this._parser.onerror=function(er){me.emit('error',er);
|
8443 |
|
8444 | me._parser.error=null;};this._decoder=null;streamWraps.forEach(function(ev){Object.defineProperty(me,'on'+ev,{get:function get(){return me._parser['on'+ev];},set:function set(h){if(!h){me.removeAllListeners(ev);me._parser['on'+ev]=h;return h;}me.on(ev,h);},enumerable:true,configurable:false});});}SAXStream.prototype=Object.create(Stream.prototype,{constructor:{value:SAXStream}});SAXStream.prototype.write=function(data){if(typeof Buffer==='function'&&typeof Buffer.isBuffer==='function'&&Buffer.isBuffer(data)){if(!this._decoder){var SD=require('string_decoder').StringDecoder;this._decoder=new SD('utf8');}data=this._decoder.write(data);}this._parser.write(data.toString());this.emit('data',data);return true;};SAXStream.prototype.end=function(chunk){if(chunk&&chunk.length){this.write(chunk);}this._parser.end();return true;};SAXStream.prototype.on=function(ev,handler){var me=this;if(!me._parser['on'+ev]&&streamWraps.indexOf(ev)!==-1){me._parser['on'+ev]=function(){var args=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);args.splice(0,0,ev);me.emit.apply(me,args);};}return Stream.prototype.on.call(me,ev,handler);};
|
8445 | var whitespace='\r\n\t ';
|
8446 |
|
8447 | var number='0124356789';var letter='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
8448 | var quote='\'"';var attribEnd=whitespace+'>';var CDATA='[CDATA[';var DOCTYPE='DOCTYPE';var XML_NAMESPACE='http://www.w3.org/XML/1998/namespace';var XMLNS_NAMESPACE='http://www.w3.org/2000/xmlns/';var rootNS={xml:XML_NAMESPACE,xmlns:XMLNS_NAMESPACE};
|
8449 | whitespace=charClass(whitespace);number=charClass(number);letter=charClass(letter);
|
8450 |
|
8451 |
|
8452 |
|
8453 |
|
8454 |
|
8455 | var nameStart=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var nameBody=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;var entityStart=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var entityBody=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;quote=charClass(quote);attribEnd=charClass(attribEnd);function charClass(str){return str.split('').reduce(function(s,c){s[c]=true;return s;},{});}function isRegExp(c){return Object.prototype.toString.call(c)==='[object RegExp]';}function is(charclass,c){return isRegExp(charclass)?!!c.match(charclass):charclass[c];}function not(charclass,c){return!is(charclass,c);}var S=0;sax.STATE={BEGIN:S++,
|
8456 | BEGIN_WHITESPACE:S++,
|
8457 | TEXT:S++,
|
8458 | TEXT_ENTITY:S++,
|
8459 | OPEN_WAKA:S++,
|
8460 | SGML_DECL:S++,
|
8461 | SGML_DECL_QUOTED:S++,
|
8462 | DOCTYPE:S++,
|
8463 | DOCTYPE_QUOTED:S++,
|
8464 | DOCTYPE_DTD:S++,
|
8465 | DOCTYPE_DTD_QUOTED:S++,
|
8466 | COMMENT_STARTING:S++,
|
8467 | COMMENT:S++,
|
8468 | COMMENT_ENDING:S++,
|
8469 | COMMENT_ENDED:S++,
|
8470 | CDATA:S++,
|
8471 | CDATA_ENDING:S++,
|
8472 | CDATA_ENDING_2:S++,
|
8473 | PROC_INST:S++,
|
8474 | PROC_INST_BODY:S++,
|
8475 | PROC_INST_ENDING:S++,
|
8476 | OPEN_TAG:S++,
|
8477 | OPEN_TAG_SLASH:S++,
|
8478 | ATTRIB:S++,
|
8479 | ATTRIB_NAME:S++,
|
8480 | ATTRIB_NAME_SAW_WHITE:S++,
|
8481 | ATTRIB_VALUE:S++,
|
8482 | ATTRIB_VALUE_QUOTED:S++,
|
8483 | ATTRIB_VALUE_CLOSED:S++,
|
8484 | ATTRIB_VALUE_UNQUOTED:S++,
|
8485 | ATTRIB_VALUE_ENTITY_Q:S++,
|
8486 | ATTRIB_VALUE_ENTITY_U:S++,
|
8487 | CLOSE_TAG:S++,
|
8488 | CLOSE_TAG_SAW_WHITE:S++,
|
8489 | SCRIPT:S++,
|
8490 | SCRIPT_ENDING:S++
|
8491 | };sax.XML_ENTITIES={'amp':'&','gt':'>','lt':'<','quot':'"','apos':"'"};sax.ENTITIES={'amp':'&','gt':'>','lt':'<','quot':'"','apos':"'",'AElig':198,'Aacute':193,'Acirc':194,'Agrave':192,'Aring':197,'Atilde':195,'Auml':196,'Ccedil':199,'ETH':208,'Eacute':201,'Ecirc':202,'Egrave':200,'Euml':203,'Iacute':205,'Icirc':206,'Igrave':204,'Iuml':207,'Ntilde':209,'Oacute':211,'Ocirc':212,'Ograve':210,'Oslash':216,'Otilde':213,'Ouml':214,'THORN':222,'Uacute':218,'Ucirc':219,'Ugrave':217,'Uuml':220,'Yacute':221,'aacute':225,'acirc':226,'aelig':230,'agrave':224,'aring':229,'atilde':227,'auml':228,'ccedil':231,'eacute':233,'ecirc':234,'egrave':232,'eth':240,'euml':235,'iacute':237,'icirc':238,'igrave':236,'iuml':239,'ntilde':241,'oacute':243,'ocirc':244,'ograve':242,'oslash':248,'otilde':245,'ouml':246,'szlig':223,'thorn':254,'uacute':250,'ucirc':251,'ugrave':249,'uuml':252,'yacute':253,'yuml':255,'copy':169,'reg':174,'nbsp':160,'iexcl':161,'cent':162,'pound':163,'curren':164,'yen':165,'brvbar':166,'sect':167,'uml':168,'ordf':170,'laquo':171,'not':172,'shy':173,'macr':175,'deg':176,'plusmn':177,'sup1':185,'sup2':178,'sup3':179,'acute':180,'micro':181,'para':182,'middot':183,'cedil':184,'ordm':186,'raquo':187,'frac14':188,'frac12':189,'frac34':190,'iquest':191,'times':215,'divide':247,'OElig':338,'oelig':339,'Scaron':352,'scaron':353,'Yuml':376,'fnof':402,'circ':710,'tilde':732,'Alpha':913,'Beta':914,'Gamma':915,'Delta':916,'Epsilon':917,'Zeta':918,'Eta':919,'Theta':920,'Iota':921,'Kappa':922,'Lambda':923,'Mu':924,'Nu':925,'Xi':926,'Omicron':927,'Pi':928,'Rho':929,'Sigma':931,'Tau':932,'Upsilon':933,'Phi':934,'Chi':935,'Psi':936,'Omega':937,'alpha':945,'beta':946,'gamma':947,'delta':948,'epsilon':949,'zeta':950,'eta':951,'theta':952,'iota':953,'kappa':954,'lambda':955,'mu':956,'nu':957,'xi':958,'omicron':959,'pi':960,'rho':961,'sigmaf':962,'sigma':963,'tau':964,'upsilon':965,'phi':966,'chi':967,'psi':968,'omega':969,'thetasym':977,'upsih':978,'piv':982,'ensp':8194,'emsp':8195,'thinsp':8201,'zwnj':8204,'zwj':8205,'lrm':8206,'rlm':8207,'ndash':8211,'mdash':8212,'lsquo':8216,'rsquo':8217,'sbquo':8218,'ldquo':8220,'rdquo':8221,'bdquo':8222,'dagger':8224,'Dagger':8225,'bull':8226,'hellip':8230,'permil':8240,'prime':8242,'Prime':8243,'lsaquo':8249,'rsaquo':8250,'oline':8254,'frasl':8260,'euro':8364,'image':8465,'weierp':8472,'real':8476,'trade':8482,'alefsym':8501,'larr':8592,'uarr':8593,'rarr':8594,'darr':8595,'harr':8596,'crarr':8629,'lArr':8656,'uArr':8657,'rArr':8658,'dArr':8659,'hArr':8660,'forall':8704,'part':8706,'exist':8707,'empty':8709,'nabla':8711,'isin':8712,'notin':8713,'ni':8715,'prod':8719,'sum':8721,'minus':8722,'lowast':8727,'radic':8730,'prop':8733,'infin':8734,'ang':8736,'and':8743,'or':8744,'cap':8745,'cup':8746,'int':8747,'there4':8756,'sim':8764,'cong':8773,'asymp':8776,'ne':8800,'equiv':8801,'le':8804,'ge':8805,'sub':8834,'sup':8835,'nsub':8836,'sube':8838,'supe':8839,'oplus':8853,'otimes':8855,'perp':8869,'sdot':8901,'lceil':8968,'rceil':8969,'lfloor':8970,'rfloor':8971,'lang':9001,'rang':9002,'loz':9674,'spades':9824,'clubs':9827,'hearts':9829,'diams':9830};Object.keys(sax.ENTITIES).forEach(function(key){var e=sax.ENTITIES[key];var s=typeof e==='number'?String.fromCharCode(e):e;sax.ENTITIES[key]=s;});for(var s in sax.STATE){sax.STATE[sax.STATE[s]]=s;}
|
8492 | S=sax.STATE;function emit(parser,event,data){parser[event]&&parser[event](data);}function emitNode(parser,nodeType,data){if(parser.textNode)closeText(parser);emit(parser,nodeType,data);}function closeText(parser){parser.textNode=textopts(parser.opt,parser.textNode);if(parser.textNode)emit(parser,'ontext',parser.textNode);parser.textNode='';}function textopts(opt,text){if(opt.trim)text=text.trim();if(opt.normalize)text=text.replace(/\s+/g,' ');return text;}function error(parser,er){closeText(parser);if(parser.trackPosition){er+='\nLine: '+parser.line+'\nColumn: '+parser.column+'\nChar: '+parser.c;}er=new Error(er);parser.error=er;emit(parser,'onerror',er);return parser;}function _end(parser){if(parser.sawRoot&&!parser.closedRoot)strictFail(parser,'Unclosed root tag');if(parser.state!==S.BEGIN&&parser.state!==S.BEGIN_WHITESPACE&&parser.state!==S.TEXT){error(parser,'Unexpected end');}closeText(parser);parser.c='';parser.closed=true;emit(parser,'onend');SAXParser.call(parser,parser.strict,parser.opt);return parser;}function strictFail(parser,message){if((typeof parser==="undefined"?"undefined":_typeof(parser))!=='object'||!(parser instanceof SAXParser)){throw new Error('bad call to strictFail');}if(parser.strict){error(parser,message);}}function newTag(parser){if(!parser.strict)parser.tagName=parser.tagName[parser.looseCase]();var parent=parser.tags[parser.tags.length-1]||parser;var tag=parser.tag={name:parser.tagName,attributes:{}};
|
8493 | if(parser.opt.xmlns){tag.ns=parent.ns;}parser.attribList.length=0;emitNode(parser,'onopentagstart',tag);}function qname(name,attribute){var i=name.indexOf(':');var qualName=i<0?['',name]:name.split(':');var prefix=qualName[0];var local=qualName[1];
|
8494 | if(attribute&&name==='xmlns'){prefix='xmlns';local='';}return{prefix:prefix,local:local};}function attrib(parser){if(!parser.strict){parser.attribName=parser.attribName[parser.looseCase]();}if(parser.attribList.indexOf(parser.attribName)!==-1||parser.tag.attributes.hasOwnProperty(parser.attribName)){parser.attribName=parser.attribValue='';return;}if(parser.opt.xmlns){var qn=qname(parser.attribName,true);var prefix=qn.prefix;var local=qn.local;if(prefix==='xmlns'){
|
8495 | if(local==='xml'&&parser.attribValue!==XML_NAMESPACE){strictFail(parser,'xml: prefix must be bound to '+XML_NAMESPACE+'\n'+'Actual: '+parser.attribValue);}else if(local==='xmlns'&&parser.attribValue!==XMLNS_NAMESPACE){strictFail(parser,'xmlns: prefix must be bound to '+XMLNS_NAMESPACE+'\n'+'Actual: '+parser.attribValue);}else{var tag=parser.tag;var parent=parser.tags[parser.tags.length-1]||parser;if(tag.ns===parent.ns){tag.ns=Object.create(parent.ns);}tag.ns[local]=parser.attribValue;}}
|
8496 |
|
8497 |
|
8498 | parser.attribList.push([parser.attribName,parser.attribValue]);}else{
|
8499 | parser.tag.attributes[parser.attribName]=parser.attribValue;emitNode(parser,'onattribute',{name:parser.attribName,value:parser.attribValue});}parser.attribName=parser.attribValue='';}function openTag(parser,selfClosing){if(parser.opt.xmlns){
|
8500 | var tag=parser.tag;
|
8501 | var qn=qname(parser.tagName);tag.prefix=qn.prefix;tag.local=qn.local;tag.uri=tag.ns[qn.prefix]||'';if(tag.prefix&&!tag.uri){strictFail(parser,'Unbound namespace prefix: '+JSON.stringify(parser.tagName));tag.uri=qn.prefix;}var parent=parser.tags[parser.tags.length-1]||parser;if(tag.ns&&parent.ns!==tag.ns){Object.keys(tag.ns).forEach(function(p){emitNode(parser,'onopennamespace',{prefix:p,uri:tag.ns[p]});});}
|
8502 |
|
8503 |
|
8504 | for(var i=0,l=parser.attribList.length;i<l;i++){var nv=parser.attribList[i];var name=nv[0];var value=nv[1];var qualName=qname(name,true);var prefix=qualName.prefix;var local=qualName.local;var uri=prefix===''?'':tag.ns[prefix]||'';var a={name:name,value:value,prefix:prefix,local:local,uri:uri};
|
8505 |
|
8506 | if(prefix&&prefix!=='xmlns'&&!uri){strictFail(parser,'Unbound namespace prefix: '+JSON.stringify(prefix));a.uri=prefix;}parser.tag.attributes[name]=a;emitNode(parser,'onattribute',a);}parser.attribList.length=0;}parser.tag.isSelfClosing=!!selfClosing;
|
8507 | parser.sawRoot=true;parser.tags.push(parser.tag);emitNode(parser,'onopentag',parser.tag);if(!selfClosing){
|
8508 | if(!parser.noscript&&parser.tagName.toLowerCase()==='script'){parser.state=S.SCRIPT;}else{parser.state=S.TEXT;}parser.tag=null;parser.tagName='';}parser.attribName=parser.attribValue='';parser.attribList.length=0;}function closeTag(parser){if(!parser.tagName){strictFail(parser,'Weird empty close tag.');parser.textNode+='</>';parser.state=S.TEXT;return;}if(parser.script){if(parser.tagName!=='script'){parser.script+='</'+parser.tagName+'>';parser.tagName='';parser.state=S.SCRIPT;return;}emitNode(parser,'onscript',parser.script);parser.script='';}
|
8509 |
|
8510 | var t=parser.tags.length;var tagName=parser.tagName;if(!parser.strict){tagName=tagName[parser.looseCase]();}var closeTo=tagName;while(t--){var close=parser.tags[t];if(close.name!==closeTo){
|
8511 | strictFail(parser,'Unexpected close tag');}else{break;}}
|
8512 | if(t<0){strictFail(parser,'Unmatched closing tag: '+parser.tagName);parser.textNode+='</'+parser.tagName+'>';parser.state=S.TEXT;return;}parser.tagName=tagName;var s=parser.tags.length;while(s-->t){var tag=parser.tag=parser.tags.pop();parser.tagName=parser.tag.name;emitNode(parser,'onclosetag',parser.tagName);var x={};for(var i in tag.ns){x[i]=tag.ns[i];}var parent=parser.tags[parser.tags.length-1]||parser;if(parser.opt.xmlns&&tag.ns!==parent.ns){
|
8513 | Object.keys(tag.ns).forEach(function(p){var n=tag.ns[p];emitNode(parser,'onclosenamespace',{prefix:p,uri:n});});}}if(t===0)parser.closedRoot=true;parser.tagName=parser.attribValue=parser.attribName='';parser.attribList.length=0;parser.state=S.TEXT;}function parseEntity(parser){var entity=parser.entity;var entityLC=entity.toLowerCase();var num;var numStr='';if(parser.ENTITIES[entity]){return parser.ENTITIES[entity];}if(parser.ENTITIES[entityLC]){return parser.ENTITIES[entityLC];}entity=entityLC;if(entity.charAt(0)==='#'){if(entity.charAt(1)==='x'){entity=entity.slice(2);num=parseInt(entity,16);numStr=num.toString(16);}else{entity=entity.slice(1);num=parseInt(entity,10);numStr=num.toString(10);}}entity=entity.replace(/^0+/,'');if(numStr.toLowerCase()!==entity){strictFail(parser,'Invalid character entity');return'&'+parser.entity+';';}return String.fromCodePoint(num);}function beginWhiteSpace(parser,c){if(c==='<'){parser.state=S.OPEN_WAKA;parser.startTagPosition=parser.position;}else if(not(whitespace,c)){
|
8514 |
|
8515 | strictFail(parser,'Non-whitespace before first tag.');parser.textNode=c;parser.state=S.TEXT;}}function charAt(chunk,i){var result='';if(i<chunk.length){result=chunk.charAt(i);}return result;}function write(chunk){var parser=this;if(this.error){throw this.error;}if(parser.closed){return error(parser,'Cannot write after close. Assign an onready handler.');}if(chunk===null){return _end(parser);}if((typeof chunk==="undefined"?"undefined":_typeof(chunk))==='object'){chunk=chunk.toString();}var i=0;var c='';while(true){c=charAt(chunk,i++);parser.c=c;if(!c){break;}if(parser.trackPosition){parser.position++;if(c==='\n'){parser.line++;parser.column=0;}else{parser.column++;}}switch(parser.state){case S.BEGIN:parser.state=S.BEGIN_WHITESPACE;if(c==="\uFEFF"){continue;}beginWhiteSpace(parser,c);continue;case S.BEGIN_WHITESPACE:beginWhiteSpace(parser,c);continue;case S.TEXT:if(parser.sawRoot&&!parser.closedRoot){var starti=i-1;while(c&&c!=='<'&&c!=='&'){c=charAt(chunk,i++);if(c&&parser.trackPosition){parser.position++;if(c==='\n'){parser.line++;parser.column=0;}else{parser.column++;}}}parser.textNode+=chunk.substring(starti,i-1);}if(c==='<'&&!(parser.sawRoot&&parser.closedRoot&&!parser.strict)){parser.state=S.OPEN_WAKA;parser.startTagPosition=parser.position;}else{if(not(whitespace,c)&&(!parser.sawRoot||parser.closedRoot)){strictFail(parser,'Text data outside of root node.');}if(c==='&'){parser.state=S.TEXT_ENTITY;}else{parser.textNode+=c;}}continue;case S.SCRIPT:
|
8516 | if(c==='<'){parser.state=S.SCRIPT_ENDING;}else{parser.script+=c;}continue;case S.SCRIPT_ENDING:if(c==='/'){parser.state=S.CLOSE_TAG;}else{parser.script+='<'+c;parser.state=S.SCRIPT;}continue;case S.OPEN_WAKA:
|
8517 | if(c==='!'){parser.state=S.SGML_DECL;parser.sgmlDecl='';}else if(is(whitespace,c)){
|
8518 | }else if(is(nameStart,c)){parser.state=S.OPEN_TAG;parser.tagName=c;}else if(c==='/'){parser.state=S.CLOSE_TAG;parser.tagName='';}else if(c==='?'){parser.state=S.PROC_INST;parser.procInstName=parser.procInstBody='';}else{strictFail(parser,'Unencoded <');
|
8519 | if(parser.startTagPosition+1<parser.position){var pad=parser.position-parser.startTagPosition;c=new Array(pad).join(' ')+c;}parser.textNode+='<'+c;parser.state=S.TEXT;}continue;case S.SGML_DECL:if((parser.sgmlDecl+c).toUpperCase()===CDATA){emitNode(parser,'onopencdata');parser.state=S.CDATA;parser.sgmlDecl='';parser.cdata='';}else if(parser.sgmlDecl+c==='--'){parser.state=S.COMMENT;parser.comment='';parser.sgmlDecl='';}else if((parser.sgmlDecl+c).toUpperCase()===DOCTYPE){parser.state=S.DOCTYPE;if(parser.doctype||parser.sawRoot){strictFail(parser,'Inappropriately located doctype declaration');}parser.doctype='';parser.sgmlDecl='';}else if(c==='>'){emitNode(parser,'onsgmldeclaration',parser.sgmlDecl);parser.sgmlDecl='';parser.state=S.TEXT;}else if(is(quote,c)){parser.state=S.SGML_DECL_QUOTED;parser.sgmlDecl+=c;}else{parser.sgmlDecl+=c;}continue;case S.SGML_DECL_QUOTED:if(c===parser.q){parser.state=S.SGML_DECL;parser.q='';}parser.sgmlDecl+=c;continue;case S.DOCTYPE:if(c==='>'){parser.state=S.TEXT;emitNode(parser,'ondoctype',parser.doctype);parser.doctype=true;
|
8520 | }else{parser.doctype+=c;if(c==='['){parser.state=S.DOCTYPE_DTD;}else if(is(quote,c)){parser.state=S.DOCTYPE_QUOTED;parser.q=c;}}continue;case S.DOCTYPE_QUOTED:parser.doctype+=c;if(c===parser.q){parser.q='';parser.state=S.DOCTYPE;}continue;case S.DOCTYPE_DTD:parser.doctype+=c;if(c===']'){parser.state=S.DOCTYPE;}else if(is(quote,c)){parser.state=S.DOCTYPE_DTD_QUOTED;parser.q=c;}continue;case S.DOCTYPE_DTD_QUOTED:parser.doctype+=c;if(c===parser.q){parser.state=S.DOCTYPE_DTD;parser.q='';}continue;case S.COMMENT:if(c==='-'){parser.state=S.COMMENT_ENDING;}else{parser.comment+=c;}continue;case S.COMMENT_ENDING:if(c==='-'){parser.state=S.COMMENT_ENDED;parser.comment=textopts(parser.opt,parser.comment);if(parser.comment){emitNode(parser,'oncomment',parser.comment);}parser.comment='';}else{parser.comment+='-'+c;parser.state=S.COMMENT;}continue;case S.COMMENT_ENDED:if(c!=='>'){strictFail(parser,'Malformed comment');
|
8521 |
|
8522 | parser.comment+='--'+c;parser.state=S.COMMENT;}else{parser.state=S.TEXT;}continue;case S.CDATA:if(c===']'){parser.state=S.CDATA_ENDING;}else{parser.cdata+=c;}continue;case S.CDATA_ENDING:if(c===']'){parser.state=S.CDATA_ENDING_2;}else{parser.cdata+=']'+c;parser.state=S.CDATA;}continue;case S.CDATA_ENDING_2:if(c==='>'){if(parser.cdata){emitNode(parser,'oncdata',parser.cdata);}emitNode(parser,'onclosecdata');parser.cdata='';parser.state=S.TEXT;}else if(c===']'){parser.cdata+=']';}else{parser.cdata+=']]'+c;parser.state=S.CDATA;}continue;case S.PROC_INST:if(c==='?'){parser.state=S.PROC_INST_ENDING;}else if(is(whitespace,c)){parser.state=S.PROC_INST_BODY;}else{parser.procInstName+=c;}continue;case S.PROC_INST_BODY:if(!parser.procInstBody&&is(whitespace,c)){continue;}else if(c==='?'){parser.state=S.PROC_INST_ENDING;}else{parser.procInstBody+=c;}continue;case S.PROC_INST_ENDING:if(c==='>'){emitNode(parser,'onprocessinginstruction',{name:parser.procInstName,body:parser.procInstBody});parser.procInstName=parser.procInstBody='';parser.state=S.TEXT;}else{parser.procInstBody+='?'+c;parser.state=S.PROC_INST_BODY;}continue;case S.OPEN_TAG:if(is(nameBody,c)){parser.tagName+=c;}else{newTag(parser);if(c==='>'){openTag(parser);}else if(c==='/'){parser.state=S.OPEN_TAG_SLASH;}else{if(not(whitespace,c)){strictFail(parser,'Invalid character in tag name');}parser.state=S.ATTRIB;}}continue;case S.OPEN_TAG_SLASH:if(c==='>'){openTag(parser,true);closeTag(parser);}else{strictFail(parser,'Forward-slash in opening tag not followed by >');parser.state=S.ATTRIB;}continue;case S.ATTRIB:
|
8523 | if(is(whitespace,c)){continue;}else if(c==='>'){openTag(parser);}else if(c==='/'){parser.state=S.OPEN_TAG_SLASH;}else if(is(nameStart,c)){parser.attribName=c;parser.attribValue='';parser.state=S.ATTRIB_NAME;}else{strictFail(parser,'Invalid attribute name');}continue;case S.ATTRIB_NAME:if(c==='='){parser.state=S.ATTRIB_VALUE;}else if(c==='>'){strictFail(parser,'Attribute without value');parser.attribValue=parser.attribName;attrib(parser);openTag(parser);}else if(is(whitespace,c)){parser.state=S.ATTRIB_NAME_SAW_WHITE;}else if(is(nameBody,c)){parser.attribName+=c;}else{strictFail(parser,'Invalid attribute name');}continue;case S.ATTRIB_NAME_SAW_WHITE:if(c==='='){parser.state=S.ATTRIB_VALUE;}else if(is(whitespace,c)){continue;}else{strictFail(parser,'Attribute without value');parser.tag.attributes[parser.attribName]='';parser.attribValue='';emitNode(parser,'onattribute',{name:parser.attribName,value:''});parser.attribName='';if(c==='>'){openTag(parser);}else if(is(nameStart,c)){parser.attribName=c;parser.state=S.ATTRIB_NAME;}else{strictFail(parser,'Invalid attribute name');parser.state=S.ATTRIB;}}continue;case S.ATTRIB_VALUE:if(is(whitespace,c)){continue;}else if(is(quote,c)){parser.q=c;parser.state=S.ATTRIB_VALUE_QUOTED;}else{strictFail(parser,'Unquoted attribute value');parser.state=S.ATTRIB_VALUE_UNQUOTED;parser.attribValue=c;}continue;case S.ATTRIB_VALUE_QUOTED:if(c!==parser.q){if(c==='&'){parser.state=S.ATTRIB_VALUE_ENTITY_Q;}else{parser.attribValue+=c;}continue;}attrib(parser);parser.q='';parser.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:if(is(whitespace,c)){parser.state=S.ATTRIB;}else if(c==='>'){openTag(parser);}else if(c==='/'){parser.state=S.OPEN_TAG_SLASH;}else if(is(nameStart,c)){strictFail(parser,'No whitespace between attributes');parser.attribName=c;parser.attribValue='';parser.state=S.ATTRIB_NAME;}else{strictFail(parser,'Invalid attribute name');}continue;case S.ATTRIB_VALUE_UNQUOTED:if(not(attribEnd,c)){if(c==='&'){parser.state=S.ATTRIB_VALUE_ENTITY_U;}else{parser.attribValue+=c;}continue;}attrib(parser);if(c==='>'){openTag(parser);}else{parser.state=S.ATTRIB;}continue;case S.CLOSE_TAG:if(!parser.tagName){if(is(whitespace,c)){continue;}else if(not(nameStart,c)){if(parser.script){parser.script+='</'+c;parser.state=S.SCRIPT;}else{strictFail(parser,'Invalid tagname in closing tag.');}}else{parser.tagName=c;}}else if(c==='>'){closeTag(parser);}else if(is(nameBody,c)){parser.tagName+=c;}else if(parser.script){parser.script+='</'+parser.tagName;parser.tagName='';parser.state=S.SCRIPT;}else{if(not(whitespace,c)){strictFail(parser,'Invalid tagname in closing tag');}parser.state=S.CLOSE_TAG_SAW_WHITE;}continue;case S.CLOSE_TAG_SAW_WHITE:if(is(whitespace,c)){continue;}if(c==='>'){closeTag(parser);}else{strictFail(parser,'Invalid characters in closing tag');}continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var returnState;var buffer;switch(parser.state){case S.TEXT_ENTITY:returnState=S.TEXT;buffer='textNode';break;case S.ATTRIB_VALUE_ENTITY_Q:returnState=S.ATTRIB_VALUE_QUOTED;buffer='attribValue';break;case S.ATTRIB_VALUE_ENTITY_U:returnState=S.ATTRIB_VALUE_UNQUOTED;buffer='attribValue';break;}if(c===';'){parser[buffer]+=parseEntity(parser);parser.entity='';parser.state=returnState;}else if(is(parser.entity.length?entityBody:entityStart,c)){parser.entity+=c;}else{strictFail(parser,'Invalid character in entity name');parser[buffer]+='&'+parser.entity+c;parser.entity='';parser.state=returnState;}continue;default:throw new Error(parser,'Unknown state: '+parser.state);}}
|
8524 | if(parser.position>=parser.bufferCheckPosition){checkBufferLength(parser);}return parser;}if(!String.fromCodePoint){(function(){var stringFromCharCode=String.fromCharCode;var floor=Math.floor;var fromCodePoint=function fromCodePoint(){var MAX_SIZE=0x4000;var codeUnits=[];var highSurrogate;var lowSurrogate;var index=-1;var length=arguments.length;if(!length){return'';}var result='';while(++index<length){var codePoint=Number(arguments[index]);if(!isFinite(codePoint)||
|
8525 | codePoint<0||
|
8526 | codePoint>0x10FFFF||
|
8527 | floor(codePoint)!==codePoint
|
8528 | ){throw RangeError('Invalid code point: '+codePoint);}if(codePoint<=0xFFFF){
|
8529 | codeUnits.push(codePoint);}else{
|
8530 |
|
8531 | codePoint-=0x10000;highSurrogate=(codePoint>>10)+0xD800;lowSurrogate=codePoint%0x400+0xDC00;codeUnits.push(highSurrogate,lowSurrogate);}if(index+1===length||codeUnits.length>MAX_SIZE){result+=stringFromCharCode.apply(null,codeUnits);codeUnits.length=0;}}return result;};if(Object.defineProperty){Object.defineProperty(String,'fromCodePoint',{value:fromCodePoint,configurable:true,writable:true});}else{String.fromCodePoint=fromCodePoint;}})();}})(typeof exports==='undefined'?this.sax={}:exports);}).call(this,require("buffer").Buffer);},{"buffer":17,"stream":48,"string_decoder":53}],48:[function(require,module,exports){
|
8532 |
|
8533 |
|
8534 |
|
8535 |
|
8536 |
|
8537 |
|
8538 |
|
8539 |
|
8540 |
|
8541 |
|
8542 |
|
8543 |
|
8544 |
|
8545 |
|
8546 |
|
8547 |
|
8548 |
|
8549 |
|
8550 |
|
8551 | module.exports=Stream;var EE=require('events').EventEmitter;var inherits=require('inherits');inherits(Stream,EE);Stream.Readable=require('readable-stream/readable.js');Stream.Writable=require('readable-stream/writable.js');Stream.Duplex=require('readable-stream/duplex.js');Stream.Transform=require('readable-stream/transform.js');Stream.PassThrough=require('readable-stream/passthrough.js');
|
8552 | Stream.Stream=Stream;
|
8553 |
|
8554 | function Stream(){EE.call(this);}Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){if(dest.writable){if(false===dest.write(chunk)&&source.pause){source.pause();}}}source.on('data',ondata);function ondrain(){if(source.readable&&source.resume){source.resume();}}dest.on('drain',ondrain);
|
8555 |
|
8556 | if(!dest._isStdio&&(!options||options.end!==false)){source.on('end',onend);source.on('close',onclose);}var didOnEnd=false;function onend(){if(didOnEnd)return;didOnEnd=true;dest.end();}function onclose(){if(didOnEnd)return;didOnEnd=true;if(typeof dest.destroy==='function')dest.destroy();}
|
8557 | function onerror(er){cleanup();if(EE.listenerCount(this,'error')===0){throw er;
|
8558 | }}source.on('error',onerror);dest.on('error',onerror);
|
8559 | function cleanup(){source.removeListener('data',ondata);dest.removeListener('drain',ondrain);source.removeListener('end',onend);source.removeListener('close',onclose);source.removeListener('error',onerror);dest.removeListener('error',onerror);source.removeListener('end',cleanup);source.removeListener('close',cleanup);dest.removeListener('close',cleanup);}source.on('end',cleanup);source.on('close',cleanup);dest.on('close',cleanup);dest.emit('pipe',source);
|
8560 | return dest;};},{"events":21,"inherits":24,"readable-stream/duplex.js":36,"readable-stream/passthrough.js":43,"readable-stream/readable.js":44,"readable-stream/transform.js":45,"readable-stream/writable.js":46}],49:[function(require,module,exports){(function(global){var ClientRequest=require('./lib/request');var extend=require('xtend');var statusCodes=require('builtin-status-codes');var url=require('url');var http=exports;http.request=function(opts,cb){if(typeof opts==='string')opts=url.parse(opts);else opts=extend(opts);
|
8561 |
|
8562 |
|
8563 | var defaultProtocol=global.location.protocol.search(/^https?:$/)===-1?'http:':'';var protocol=opts.protocol||defaultProtocol;var host=opts.hostname||opts.host;var port=opts.port;var path=opts.path||'/';
|
8564 | if(host&&host.indexOf(':')!==-1)host='['+host+']';
|
8565 | opts.url=(host?protocol+'//'+host:'')+(port?':'+port:'')+path;opts.method=(opts.method||'GET').toUpperCase();opts.headers=opts.headers||{};
|
8566 | var req=new ClientRequest(opts);if(cb)req.on('response',cb);return req;};http.get=function get(opts,cb){var req=http.request(opts,cb);req.end();return req;};http.Agent=function(){};http.Agent.defaultMaxSockets=4;http.STATUS_CODES=statusCodes;http.METHODS=['CHECKOUT','CONNECT','COPY','DELETE','GET','HEAD','LOCK','M-SEARCH','MERGE','MKACTIVITY','MKCOL','MOVE','NOTIFY','OPTIONS','PATCH','POST','PROPFIND','PROPPATCH','PURGE','PUT','REPORT','SEARCH','SUBSCRIBE','TRACE','UNLOCK','UNSUBSCRIBE'];}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./lib/request":51,"builtin-status-codes":18,"url":56,"xtend":63}],50:[function(require,module,exports){(function(global){exports.fetch=isFunction(global.fetch)&&isFunction(global.ReadableStream);exports.blobConstructor=false;try{new Blob([new ArrayBuffer(1)]);exports.blobConstructor=true;}catch(e){}var xhr=new global.XMLHttpRequest();
|
8567 |
|
8568 | xhr.open('GET',global.location.host?'/':'https://example.com');function checkTypeSupport(type){try{xhr.responseType=type;return xhr.responseType===type;}catch(e){}return false;}
|
8569 |
|
8570 | var haveArrayBuffer=typeof global.ArrayBuffer!=='undefined';var haveSlice=haveArrayBuffer&&isFunction(global.ArrayBuffer.prototype.slice);exports.arraybuffer=haveArrayBuffer&&checkTypeSupport('arraybuffer');
|
8571 |
|
8572 | exports.msstream=!exports.fetch&&haveSlice&&checkTypeSupport('ms-stream');exports.mozchunkedarraybuffer=!exports.fetch&&haveArrayBuffer&&checkTypeSupport('moz-chunked-arraybuffer');exports.overrideMimeType=isFunction(xhr.overrideMimeType);exports.vbArray=isFunction(global.VBArray);function isFunction(value){return typeof value==='function';}xhr=null;
|
8573 | }).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],51:[function(require,module,exports){(function(process,global,Buffer){var capability=require('./capability');var inherits=require('inherits');var response=require('./response');var stream=require('readable-stream');var toArrayBuffer=require('to-arraybuffer');var IncomingMessage=response.IncomingMessage;var rStates=response.readyStates;function decideMode(preferBinary,useFetch){if(capability.fetch&&useFetch){return'fetch';}else if(capability.mozchunkedarraybuffer){return'moz-chunked-arraybuffer';}else if(capability.msstream){return'ms-stream';}else if(capability.arraybuffer&&preferBinary){return'arraybuffer';}else if(capability.vbArray&&preferBinary){return'text:vbarray';}else{return'text';}}var ClientRequest=module.exports=function(opts){var self=this;stream.Writable.call(self);self._opts=opts;self._body=[];self._headers={};if(opts.auth)self.setHeader('Authorization','Basic '+new Buffer(opts.auth).toString('base64'));Object.keys(opts.headers).forEach(function(name){self.setHeader(name,opts.headers[name]);});var preferBinary;var useFetch=true;if(opts.mode==='disable-fetch'){
|
8574 | useFetch=false;preferBinary=true;}else if(opts.mode==='prefer-streaming'){
|
8575 |
|
8576 | preferBinary=false;}else if(opts.mode==='allow-wrong-content-type'){
|
8577 | preferBinary=!capability.overrideMimeType;}else if(!opts.mode||opts.mode==='default'||opts.mode==='prefer-fast'){
|
8578 | preferBinary=true;}else{throw new Error('Invalid value for opts.mode');}self._mode=decideMode(preferBinary,useFetch);self.on('finish',function(){self._onFinish();});};inherits(ClientRequest,stream.Writable);ClientRequest.prototype.setHeader=function(name,value){var self=this;var lowerName=name.toLowerCase();
|
8579 |
|
8580 |
|
8581 | if(unsafeHeaders.indexOf(lowerName)!==-1)return;self._headers[lowerName]={name:name,value:value};};ClientRequest.prototype.getHeader=function(name){var self=this;return self._headers[name.toLowerCase()].value;};ClientRequest.prototype.removeHeader=function(name){var self=this;delete self._headers[name.toLowerCase()];};ClientRequest.prototype._onFinish=function(){var self=this;if(self._destroyed)return;var opts=self._opts;var headersObj=self._headers;var body;if(opts.method==='POST'||opts.method==='PUT'||opts.method==='PATCH'){if(capability.blobConstructor){body=new global.Blob(self._body.map(function(buffer){return toArrayBuffer(buffer);}),{type:(headersObj['content-type']||{}).value||''});}else{
|
8582 | body=Buffer.concat(self._body).toString();}}if(self._mode==='fetch'){var headers=Object.keys(headersObj).map(function(name){return[headersObj[name].name,headersObj[name].value];});global.fetch(self._opts.url,{method:self._opts.method,headers:headers,body:body,mode:'cors',credentials:opts.withCredentials?'include':'same-origin'}).then(function(response){self._fetchResponse=response;self._connect();},function(reason){self.emit('error',reason);});}else{var xhr=self._xhr=new global.XMLHttpRequest();try{xhr.open(self._opts.method,self._opts.url,true);}catch(err){process.nextTick(function(){self.emit('error',err);});return;}
|
8583 | if('responseType'in xhr)xhr.responseType=self._mode.split(':')[0];if('withCredentials'in xhr)xhr.withCredentials=!!opts.withCredentials;if(self._mode==='text'&&'overrideMimeType'in xhr)xhr.overrideMimeType('text/plain; charset=x-user-defined');Object.keys(headersObj).forEach(function(name){xhr.setRequestHeader(headersObj[name].name,headersObj[name].value);});self._response=null;xhr.onreadystatechange=function(){switch(xhr.readyState){case rStates.LOADING:case rStates.DONE:self._onXHRProgress();break;}};
|
8584 |
|
8585 | if(self._mode==='moz-chunked-arraybuffer'){xhr.onprogress=function(){self._onXHRProgress();};}xhr.onerror=function(){if(self._destroyed)return;self.emit('error',new Error('XHR error'));};try{xhr.send(body);}catch(err){process.nextTick(function(){self.emit('error',err);});return;}}}; |
8586 |
|
8587 |
|
8588 |
|
8589 | function statusValid(xhr){try{var status=xhr.status;return status!==null&&status!==0;}catch(e){return false;}}ClientRequest.prototype._onXHRProgress=function(){var self=this;if(!statusValid(self._xhr)||self._destroyed)return;if(!self._response)self._connect();self._response._onXHRProgress();};ClientRequest.prototype._connect=function(){var self=this;if(self._destroyed)return;self._response=new IncomingMessage(self._xhr,self._fetchResponse,self._mode);self.emit('response',self._response);};ClientRequest.prototype._write=function(chunk,encoding,cb){var self=this;self._body.push(chunk);cb();};ClientRequest.prototype.abort=ClientRequest.prototype.destroy=function(){var self=this;self._destroyed=true;if(self._response)self._response._destroyed=true;if(self._xhr)self._xhr.abort();
|
8590 |
|
8591 | };ClientRequest.prototype.end=function(data,encoding,cb){var self=this;if(typeof data==='function'){cb=data;data=undefined;}stream.Writable.prototype.end.call(self,data,encoding,cb);};ClientRequest.prototype.flushHeaders=function(){};ClientRequest.prototype.setTimeout=function(){};ClientRequest.prototype.setNoDelay=function(){};ClientRequest.prototype.setSocketKeepAlive=function(){};
|
8592 | var unsafeHeaders=['accept-charset','accept-encoding','access-control-request-headers','access-control-request-method','connection','content-length','cookie','cookie2','date','dnt','expect','host','keep-alive','origin','referer','te','trailer','transfer-encoding','upgrade','user-agent','via'];}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":50,"./response":52,"_process":31,"buffer":17,"inherits":24,"readable-stream":44,"to-arraybuffer":55}],52:[function(require,module,exports){(function(process,global,Buffer){var capability=require('./capability');var inherits=require('inherits');var stream=require('readable-stream');var rStates=exports.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};var IncomingMessage=exports.IncomingMessage=function(xhr,response,mode){var self=this;stream.Readable.call(self);self._mode=mode;self.headers={};self.rawHeaders=[];self.trailers={};self.rawTrailers=[];
|
8593 | self.on('end',function(){
|
8594 | process.nextTick(function(){self.emit('close');});});if(mode==='fetch'){var header,_i,_it;var reader;(function(){var read=function read(){reader.read().then(function(result){if(self._destroyed)return;if(result.done){self.push(null);return;}self.push(new Buffer(result.value));read();});};self._fetchResponse=response;self.url=response.url;self.statusCode=response.status;self.statusMessage=response.statusText;
|
8595 |
|
8596 | for(_it=response.headers[Symbol.iterator]();header=(_i=_it.next()).value,!_i.done;){self.headers[header[0].toLowerCase()]=header[1];self.rawHeaders.push(header[0],header[1]);}
|
8597 | reader=response.body.getReader();read();})();}else{self._xhr=xhr;self._pos=0;self.url=xhr.responseURL;self.statusCode=xhr.status;self.statusMessage=xhr.statusText;var headers=xhr.getAllResponseHeaders().split(/\r?\n/);headers.forEach(function(header){var matches=header.match(/^([^:]+):\s*(.*)/);if(matches){var key=matches[1].toLowerCase();if(key==='set-cookie'){if(self.headers[key]===undefined){self.headers[key]=[];}self.headers[key].push(matches[2]);}else if(self.headers[key]!==undefined){self.headers[key]+=', '+matches[2];}else{self.headers[key]=matches[2];}self.rawHeaders.push(matches[1],matches[2]);}});self._charset='x-user-defined';if(!capability.overrideMimeType){var mimeType=self.rawHeaders['mime-type'];if(mimeType){var charsetMatch=mimeType.match(/;\s*charset=([^;])(;|$)/);if(charsetMatch){self._charset=charsetMatch[1].toLowerCase();}}if(!self._charset)self._charset='utf-8';
|
8598 | }}};inherits(IncomingMessage,stream.Readable);IncomingMessage.prototype._read=function(){};IncomingMessage.prototype._onXHRProgress=function(){var self=this;var xhr=self._xhr;var response=null;switch(self._mode){case'text:vbarray':
|
8599 | if(xhr.readyState!==rStates.DONE)break;try{
|
8600 | response=new global.VBArray(xhr.responseBody).toArray();}catch(e){}if(response!==null){self.push(new Buffer(response));break;}
|
8601 | case'text':try{
|
8602 | response=xhr.responseText;}catch(e){self._mode='text:vbarray';break;}if(response.length>self._pos){var newData=response.substr(self._pos);if(self._charset==='x-user-defined'){var buffer=new Buffer(newData.length);for(var i=0;i<newData.length;i++){buffer[i]=newData.charCodeAt(i)&0xff;}self.push(buffer);}else{self.push(newData,self._charset);}self._pos=response.length;}break;case'arraybuffer':if(xhr.readyState!==rStates.DONE||!xhr.response)break;response=xhr.response;self.push(new Buffer(new Uint8Array(response)));break;case'moz-chunked-arraybuffer':
|
8603 | response=xhr.response;if(xhr.readyState!==rStates.LOADING||!response)break;self.push(new Buffer(new Uint8Array(response)));break;case'ms-stream':response=xhr.response;if(xhr.readyState!==rStates.LOADING)break;var reader=new global.MSStreamReader();reader.onprogress=function(){if(reader.result.byteLength>self._pos){self.push(new Buffer(new Uint8Array(reader.result.slice(self._pos))));self._pos=reader.result.byteLength;}};reader.onload=function(){self.push(null);};
|
8604 | reader.readAsArrayBuffer(response);break;}
|
8605 | if(self._xhr.readyState===rStates.DONE&&self._mode!=='ms-stream'){self.push(null);}};}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":50,"_process":31,"buffer":17,"inherits":24,"readable-stream":44}],53:[function(require,module,exports){
|
8606 |
|
8607 |
|
8608 |
|
8609 |
|
8610 |
|
8611 |
|
8612 |
|
8613 |
|
8614 |
|
8615 |
|
8616 |
|
8617 |
|
8618 |
|
8619 |
|
8620 |
|
8621 |
|
8622 |
|
8623 |
|
8624 |
|
8625 | var Buffer=require('buffer').Buffer;var isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){case'hex':case'utf8':case'utf-8':case'ascii':case'binary':case'base64':case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':case'raw':return true;default:return false;}};function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding)){throw new Error('Unknown encoding: '+encoding);}}
|
8626 |
|
8627 |
|
8628 |
|
8629 |
|
8630 |
|
8631 |
|
8632 |
|
8633 | var StringDecoder=exports.StringDecoder=function(encoding){this.encoding=(encoding||'utf8').toLowerCase().replace(/[-_]/,'');assertEncoding(encoding);switch(this.encoding){case'utf8':
|
8634 | this.surrogateSize=3;break;case'ucs2':case'utf16le':
|
8635 | this.surrogateSize=2;this.detectIncompleteChar=utf16DetectIncompleteChar;break;case'base64':
|
8636 | this.surrogateSize=3;this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return;}
|
8637 |
|
8638 | this.charBuffer=new Buffer(6);
|
8639 | this.charReceived=0;
|
8640 | this.charLength=0;};
|
8641 |
|
8642 |
|
8643 |
|
8644 |
|
8645 |
|
8646 |
|
8647 |
|
8648 |
|
8649 | StringDecoder.prototype.write=function(buffer){var charStr='';
|
8650 | while(this.charLength){
|
8651 | var available=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;
|
8652 | buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived<this.charLength){
|
8653 | return'';}
|
8654 | buffer=buffer.slice(available,buffer.length);
|
8655 | charStr=this.charBuffer.slice(0,this.charLength).toString(this.encoding);
|
8656 | var charCode=charStr.charCodeAt(charStr.length-1);if(charCode>=0xD800&&charCode<=0xDBFF){this.charLength+=this.surrogateSize;charStr='';continue;}this.charReceived=this.charLength=0;
|
8657 | if(buffer.length===0){return charStr;}break;}
|
8658 | this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){
|
8659 | buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived;}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);
|
8660 | if(charCode>=0xD800&&charCode<=0xDBFF){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end);}
|
8661 | return charStr;};
|
8662 |
|
8663 |
|
8664 |
|
8665 | StringDecoder.prototype.detectIncompleteChar=function(buffer){
|
8666 | var i=buffer.length>=3?3:buffer.length;
|
8667 |
|
8668 | for(;i>0;i--){var c=buffer[buffer.length-i];
|
8669 |
|
8670 | if(i==1&&c>>5==0x06){this.charLength=2;break;}
|
8671 | if(i<=2&&c>>4==0x0E){this.charLength=3;break;}
|
8672 | if(i<=3&&c>>3==0x1E){this.charLength=4;break;}}this.charReceived=i;};StringDecoder.prototype.end=function(buffer){var res='';if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc);}return res;};function passThroughWrite(buffer){return buffer.toString(this.encoding);}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0;}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0;}},{"buffer":17}],54:[function(require,module,exports){(function(){var JS_ILLEGAL_IDENTIFIER_CHARS,JS_KEYWORDS,WRAPPER_PREFIX,WRAPPER_REGEX,WRAPPER_SUFFIX,char_wrapper,to_js_identifier,wrapper;JS_KEYWORDS=["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","switch","super","this","throw","true","try","typeof","undefined","var","void","while","with","yield"];JS_ILLEGAL_IDENTIFIER_CHARS={"~":"tilde","`":"backtick","!":"exclamationmark","@":"at","#":"pound","%":"percent","^":"carat","&":"amperstand","*":"asterisk","(":"leftparen",")":"rightparen","-":"dash","+":"plus","=":"equals","{":"leftcurly","}":"rightcurly","[":"leftsquare","]":"rightsquare","|":"pipe","\\":"backslash","\"":"doublequote","'":"singlequote",":":"colon",";":"semicolon","<":"leftangle",">":"rightangle",",":"comma",".":"period","?":"questionmark","/":"forwardslash"," ":"space","\t":"tab","\n":"newline","\r":"carriagereturn"};WRAPPER_PREFIX="_$";WRAPPER_SUFFIX="_";WRAPPER_REGEX=/_\$[^_]+_/g;wrapper=function wrapper(text){return""+WRAPPER_PREFIX+text+WRAPPER_SUFFIX;};char_wrapper=function char_wrapper(char){var txt,_ref;txt=(_ref=JS_ILLEGAL_IDENTIFIER_CHARS[char])!=null?_ref:"ASCII_"+char.charCodeAt(0);return wrapper(txt);};to_js_identifier=function to_js_identifier(text){if(JS_KEYWORDS.indexOf(text)>=0)return wrapper(text);if(text.length===0)return wrapper("null");return text.replace(WRAPPER_REGEX,wrapper).replace(/^\d/,char_wrapper).replace(/[^\w\$]/g,char_wrapper);};if((typeof module!=="undefined"&&module!==null?module.exports:void 0)!=null){module.exports=to_js_identifier;}else if(typeof ender!=="undefined"&&ender!==null){ender.ender({to_js_identifier:to_js_identifier});}else{this.to_js_identifier=to_js_identifier;}}).call(this);},{}],55:[function(require,module,exports){var Buffer=require('buffer').Buffer;module.exports=function(buf){
|
8673 | if(buf instanceof Uint8Array){
|
8674 | if(buf.byteOffset===0&&buf.byteLength===buf.buffer.byteLength){return buf.buffer;}else if(typeof buf.buffer.slice==='function'){
|
8675 | return buf.buffer.slice(buf.byteOffset,buf.byteOffset+buf.byteLength);}}if(Buffer.isBuffer(buf)){
|
8676 |
|
8677 | var arrayCopy=new Uint8Array(buf.length);var len=buf.length;for(var i=0;i<len;i++){arrayCopy[i]=buf[i];}return arrayCopy.buffer;}else{throw new Error('Argument must be a Buffer');}};},{"buffer":17}],56:[function(require,module,exports){
|
8678 |
|
8679 |
|
8680 |
|
8681 |
|
8682 |
|
8683 |
|
8684 |
|
8685 |
|
8686 |
|
8687 |
|
8688 |
|
8689 |
|
8690 |
|
8691 |
|
8692 |
|
8693 |
|
8694 |
|
8695 |
|
8696 |
|
8697 | 'use strict';var punycode=require('punycode');var util=require('./util');exports.parse=urlParse;exports.resolve=urlResolve;exports.resolveObject=urlResolveObject;exports.format=urlFormat;exports.Url=Url;function Url(){this.protocol=null;this.slashes=null;this.auth=null;this.host=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.query=null;this.pathname=null;this.path=null;this.href=null;}
|
8698 |
|
8699 |
|
8700 | var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,
|
8701 | simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
|
8702 |
|
8703 | delims=['<','>','"','`',' ','\r','\n','\t'],
|
8704 | unwise=['{','}','|','\\','^','`'].concat(delims),
|
8705 | autoEscape=['\''].concat(unwise),
|
8706 |
|
8707 |
|
8708 |
|
8709 | nonHostChars=['%','/','?',';','#'].concat(autoEscape),hostEndingChars=['/','?','#'],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,
|
8710 | unsafeProtocol={'javascript':true,'javascript:':true},
|
8711 | hostlessProtocol={'javascript':true,'javascript:':true},
|
8712 | slashedProtocol={'http':true,'https':true,'ftp':true,'gopher':true,'file':true,'http:':true,'https:':true,'ftp:':true,'gopher:':true,'file:':true},querystring=require('querystring');function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&util.isObject(url)&&url instanceof Url)return url;var u=new Url();u.parse(url,parseQueryString,slashesDenoteHost);return u;}Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url)){throw new TypeError("Parameter 'url' must be a string, not "+(typeof url==="undefined"?"undefined":_typeof(url)));}
|
8713 |
|
8714 |
|
8715 | var queryIndex=url.indexOf('?'),splitter=queryIndex!==-1&&queryIndex<url.indexOf('#')?'?':'#',uSplit=url.split(splitter),slashRegex=/\\/g;uSplit[0]=uSplit[0].replace(slashRegex,'/');url=uSplit.join(splitter);var rest=url;
|
8716 |
|
8717 | rest=rest.trim();if(!slashesDenoteHost&&url.split('#').length===1){
|
8718 | var simplePath=simplePathPattern.exec(rest);if(simplePath){this.path=rest;this.href=rest;this.pathname=simplePath[1];if(simplePath[2]){this.search=simplePath[2];if(parseQueryString){this.query=querystring.parse(this.search.substr(1));}else{this.query=this.search.substr(1);}}else if(parseQueryString){this.search='';this.query={};}return this;}}var proto=protocolPattern.exec(rest);if(proto){proto=proto[0];var lowerProto=proto.toLowerCase();this.protocol=lowerProto;rest=rest.substr(proto.length);}
|
8719 |
|
8720 |
|
8721 |
|
8722 | if(slashesDenoteHost||proto||rest.match(/^\/\/[^@\/]+@[^@\/]+/)){var slashes=rest.substr(0,2)==='//';if(slashes&&!(proto&&hostlessProtocol[proto])){rest=rest.substr(2);this.slashes=true;}}if(!hostlessProtocol[proto]&&(slashes||proto&&!slashedProtocol[proto])){
|
8723 |
|
8724 |
|
8725 |
|
8726 |
|
8727 |
|
8728 |
|
8729 |
|
8730 |
|
8731 |
|
8732 |
|
8733 |
|
8734 |
|
8735 |
|
8736 | var hostEnd=-1;for(var i=0;i<hostEndingChars.length;i++){var hec=rest.indexOf(hostEndingChars[i]);if(hec!==-1&&(hostEnd===-1||hec<hostEnd))hostEnd=hec;}
|
8737 |
|
8738 | var auth,atSign;if(hostEnd===-1){
|
8739 | atSign=rest.lastIndexOf('@');}else{
|
8740 |
|
8741 | atSign=rest.lastIndexOf('@',hostEnd);}
|
8742 |
|
8743 | if(atSign!==-1){auth=rest.slice(0,atSign);rest=rest.slice(atSign+1);this.auth=decodeURIComponent(auth);}
|
8744 | hostEnd=-1;for(var i=0;i<nonHostChars.length;i++){var hec=rest.indexOf(nonHostChars[i]);if(hec!==-1&&(hostEnd===-1||hec<hostEnd))hostEnd=hec;}
|
8745 | if(hostEnd===-1)hostEnd=rest.length;this.host=rest.slice(0,hostEnd);rest=rest.slice(hostEnd);
|
8746 | this.parseHost();
|
8747 |
|
8748 | this.hostname=this.hostname||'';
|
8749 |
|
8750 | var ipv6Hostname=this.hostname[0]==='['&&this.hostname[this.hostname.length-1]===']';
|
8751 | if(!ipv6Hostname){var hostparts=this.hostname.split(/\./);for(var i=0,l=hostparts.length;i<l;i++){var part=hostparts[i];if(!part)continue;if(!part.match(hostnamePartPattern)){var newpart='';for(var j=0,k=part.length;j<k;j++){if(part.charCodeAt(j)>127){
|
8752 |
|
8753 |
|
8754 | newpart+='x';}else{newpart+=part[j];}}
|
8755 | if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i);var notHost=hostparts.slice(i+1);var bit=part.match(hostnamePartStart);if(bit){validParts.push(bit[1]);notHost.unshift(bit[2]);}if(notHost.length){rest='/'+notHost.join('.')+rest;}this.hostname=validParts.join('.');break;}}}}if(this.hostname.length>hostnameMaxLen){this.hostname='';}else{
|
8756 | this.hostname=this.hostname.toLowerCase();}if(!ipv6Hostname){
|
8757 |
|
8758 |
|
8759 |
|
8760 | this.hostname=punycode.toASCII(this.hostname);}var p=this.port?':'+this.port:'';var h=this.hostname||'';this.host=h+p;this.href+=this.host;
|
8761 |
|
8762 | if(ipv6Hostname){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(rest[0]!=='/'){rest='/'+rest;}}}
|
8763 |
|
8764 | if(!unsafeProtocol[lowerProto]){
|
8765 |
|
8766 |
|
8767 | for(var i=0,l=autoEscape.length;i<l;i++){var ae=autoEscape[i];if(rest.indexOf(ae)===-1)continue;var esc=encodeURIComponent(ae);if(esc===ae){esc=escape(ae);}rest=rest.split(ae).join(esc);}}
|
8768 | var hash=rest.indexOf('#');if(hash!==-1){
|
8769 | this.hash=rest.substr(hash);rest=rest.slice(0,hash);}var qm=rest.indexOf('?');if(qm!==-1){this.search=rest.substr(qm);this.query=rest.substr(qm+1);if(parseQueryString){this.query=querystring.parse(this.query);}rest=rest.slice(0,qm);}else if(parseQueryString){
|
8770 | this.search='';this.query={};}if(rest)this.pathname=rest;if(slashedProtocol[lowerProto]&&this.hostname&&!this.pathname){this.pathname='/';}
|
8771 | if(this.pathname||this.search){var p=this.pathname||'';var s=this.search||'';this.path=p+s;}
|
8772 | this.href=this.format();return this;};
|
8773 | function urlFormat(obj){
|
8774 |
|
8775 |
|
8776 |
|
8777 | if(util.isString(obj))obj=urlParse(obj);if(!(obj instanceof Url))return Url.prototype.format.call(obj);return obj.format();}Url.prototype.format=function(){var auth=this.auth||'';if(auth){auth=encodeURIComponent(auth);auth=auth.replace(/%3A/i,':');auth+='@';}var protocol=this.protocol||'',pathname=this.pathname||'',hash=this.hash||'',host=false,query='';if(this.host){host=auth+this.host;}else if(this.hostname){host=auth+(this.hostname.indexOf(':')===-1?this.hostname:'['+this.hostname+']');if(this.port){host+=':'+this.port;}}if(this.query&&util.isObject(this.query)&&Object.keys(this.query).length){query=querystring.stringify(this.query);}var search=this.search||query&&'?'+query||'';if(protocol&&protocol.substr(-1)!==':')protocol+=':';
|
8778 |
|
8779 | if(this.slashes||(!protocol||slashedProtocol[protocol])&&host!==false){host='//'+(host||'');if(pathname&&pathname.charAt(0)!=='/')pathname='/'+pathname;}else if(!host){host='';}if(hash&&hash.charAt(0)!=='#')hash='#'+hash;if(search&&search.charAt(0)!=='?')search='?'+search;pathname=pathname.replace(/[?#]/g,function(match){return encodeURIComponent(match);});search=search.replace('#','%23');return protocol+host+pathname+search+hash;};function urlResolve(source,relative){return urlParse(source,false,true).resolve(relative);}Url.prototype.resolve=function(relative){return this.resolveObject(urlParse(relative,false,true)).format();};function urlResolveObject(source,relative){if(!source)return relative;return urlParse(source,false,true).resolveObject(relative);}Url.prototype.resolveObject=function(relative){if(util.isString(relative)){var rel=new Url();rel.parse(relative,false,true);relative=rel;}var result=new Url();var tkeys=Object.keys(this);for(var tk=0;tk<tkeys.length;tk++){var tkey=tkeys[tk];result[tkey]=this[tkey];}
|
8780 |
|
8781 | result.hash=relative.hash;
|
8782 | if(relative.href===''){result.href=result.format();return result;}
|
8783 | if(relative.slashes&&!relative.protocol){
|
8784 | var rkeys=Object.keys(relative);for(var rk=0;rk<rkeys.length;rk++){var rkey=rkeys[rk];if(rkey!=='protocol')result[rkey]=relative[rkey];}
|
8785 | if(slashedProtocol[result.protocol]&&result.hostname&&!result.pathname){result.path=result.pathname='/';}result.href=result.format();return result;}if(relative.protocol&&relative.protocol!==result.protocol){
|
8786 |
|
8787 |
|
8788 |
|
8789 |
|
8790 |
|
8791 |
|
8792 |
|
8793 | if(!slashedProtocol[relative.protocol]){var keys=Object.keys(relative);for(var v=0;v<keys.length;v++){var k=keys[v];result[k]=relative[k];}result.href=result.format();return result;}result.protocol=relative.protocol;if(!relative.host&&!hostlessProtocol[relative.protocol]){var relPath=(relative.pathname||'').split('/');while(relPath.length&&!(relative.host=relPath.shift())){}if(!relative.host)relative.host='';if(!relative.hostname)relative.hostname='';if(relPath[0]!=='')relPath.unshift('');if(relPath.length<2)relPath.unshift('');result.pathname=relPath.join('/');}else{result.pathname=relative.pathname;}result.search=relative.search;result.query=relative.query;result.host=relative.host||'';result.auth=relative.auth;result.hostname=relative.hostname||relative.host;result.port=relative.port;
|
8794 | if(result.pathname||result.search){var p=result.pathname||'';var s=result.search||'';result.path=p+s;}result.slashes=result.slashes||relative.slashes;result.href=result.format();return result;}var isSourceAbs=result.pathname&&result.pathname.charAt(0)==='/',isRelAbs=relative.host||relative.pathname&&relative.pathname.charAt(0)==='/',mustEndAbs=isRelAbs||isSourceAbs||result.host&&relative.pathname,removeAllDots=mustEndAbs,srcPath=result.pathname&&result.pathname.split('/')||[],relPath=relative.pathname&&relative.pathname.split('/')||[],psychotic=result.protocol&&!slashedProtocol[result.protocol];
|
8795 |
|
8796 |
|
8797 |
|
8798 |
|
8799 | if(psychotic){result.hostname='';result.port=null;if(result.host){if(srcPath[0]==='')srcPath[0]=result.host;else srcPath.unshift(result.host);}result.host='';if(relative.protocol){relative.hostname=null;relative.port=null;if(relative.host){if(relPath[0]==='')relPath[0]=relative.host;else relPath.unshift(relative.host);}relative.host=null;}mustEndAbs=mustEndAbs&&(relPath[0]===''||srcPath[0]==='');}if(isRelAbs){
|
8800 | result.host=relative.host||relative.host===''?relative.host:result.host;result.hostname=relative.hostname||relative.hostname===''?relative.hostname:result.hostname;result.search=relative.search;result.query=relative.query;srcPath=relPath;
|
8801 | }else if(relPath.length){
|
8802 |
|
8803 | if(!srcPath)srcPath=[];srcPath.pop();srcPath=srcPath.concat(relPath);result.search=relative.search;result.query=relative.query;}else if(!util.isNullOrUndefined(relative.search)){
|
8804 |
|
8805 |
|
8806 | if(psychotic){result.hostname=result.host=srcPath.shift();
|
8807 |
|
8808 |
|
8809 | var authInHost=result.host&&result.host.indexOf('@')>0?result.host.split('@'):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift();}}result.search=relative.search;result.query=relative.query;
|
8810 | if(!util.isNull(result.pathname)||!util.isNull(result.search)){result.path=(result.pathname?result.pathname:'')+(result.search?result.search:'');}result.href=result.format();return result;}if(!srcPath.length){
|
8811 |
|
8812 | result.pathname=null;
|
8813 | if(result.search){result.path='/'+result.search;}else{result.path=null;}result.href=result.format();return result;}
|
8814 |
|
8815 |
|
8816 | var last=srcPath.slice(-1)[0];var hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&(last==='.'||last==='..')||last==='';
|
8817 |
|
8818 | var up=0;for(var i=srcPath.length;i>=0;i--){last=srcPath[i];if(last==='.'){srcPath.splice(i,1);}else if(last==='..'){srcPath.splice(i,1);up++;}else if(up){srcPath.splice(i,1);up--;}}
|
8819 | if(!mustEndAbs&&!removeAllDots){for(;up--;up){srcPath.unshift('..');}}if(mustEndAbs&&srcPath[0]!==''&&(!srcPath[0]||srcPath[0].charAt(0)!=='/')){srcPath.unshift('');}if(hasTrailingSlash&&srcPath.join('/').substr(-1)!=='/'){srcPath.push('');}var isAbsolute=srcPath[0]===''||srcPath[0]&&srcPath[0].charAt(0)==='/';
|
8820 | if(psychotic){result.hostname=result.host=isAbsolute?'':srcPath.length?srcPath.shift():'';
|
8821 |
|
8822 |
|
8823 | var authInHost=result.host&&result.host.indexOf('@')>0?result.host.split('@'):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift();}}mustEndAbs=mustEndAbs||result.host&&srcPath.length;if(mustEndAbs&&!isAbsolute){srcPath.unshift('');}if(!srcPath.length){result.pathname=null;result.path=null;}else{result.pathname=srcPath.join('/');}
|
8824 | if(!util.isNull(result.pathname)||!util.isNull(result.search)){result.path=(result.pathname?result.pathname:'')+(result.search?result.search:'');}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result;};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==':'){this.port=port.substr(1);}host=host.substr(0,host.length-port.length);}if(host)this.hostname=host;};},{"./util":57,"punycode":32,"querystring":35}],57:[function(require,module,exports){'use strict';module.exports={isString:function isString(arg){return typeof arg==='string';},isObject:function isObject(arg){return(typeof arg==="undefined"?"undefined":_typeof(arg))==='object'&&arg!==null;},isNull:function isNull(arg){return arg===null;},isNullOrUndefined:function isNullOrUndefined(arg){return arg==null;}};},{}],58:[function(require,module,exports){(function(global){ |
8825 |
|
8826 | module.exports=deprecate; |
8827 |
|
8828 |
|
8829 |
|
8830 |
|
8831 |
|
8832 |
|
8833 |
|
8834 |
|
8835 |
|
8836 |
|
8837 |
|
8838 |
|
8839 |
|
8840 |
|
8841 |
|
8842 | function deprecate(fn,msg){if(config('noDeprecation')){return fn;}var warned=false;function deprecated(){if(!warned){if(config('throwDeprecation')){throw new Error(msg);}else if(config('traceDeprecation')){console.trace(msg);}else{console.warn(msg);}warned=true;}return fn.apply(this,arguments);}return deprecated;} |
8843 |
|
8844 |
|
8845 |
|
8846 |
|
8847 |
|
8848 | function config(name){
|
8849 | try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==='true';}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],59:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&(typeof arg==="undefined"?"undefined":_typeof(arg))==='object'&&typeof arg.copy==='function'&&typeof arg.fill==='function'&&typeof arg.readUInt8==='function';};},{}],60:[function(require,module,exports){(function(process,global){
|
8850 |
|
8851 |
|
8852 |
|
8853 |
|
8854 |
|
8855 |
|
8856 |
|
8857 |
|
8858 |
|
8859 |
|
8860 |
|
8861 |
|
8862 |
|
8863 |
|
8864 |
|
8865 |
|
8866 |
|
8867 |
|
8868 |
|
8869 | var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]));}return objects.join(' ');}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==='%%')return'%';if(i>=len)return x;switch(x){case'%s':return String(args[i++]);case'%d':return Number(args[i++]);case'%j':try{return JSON.stringify(args[i++]);}catch(_){return'[Circular]';}default:return x;}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=' '+x;}else{str+=' '+inspect(x);}}return str;};
|
8870 |
|
8871 |
|
8872 | exports.deprecate=function(fn,msg){
|
8873 | if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments);};}if(process.noDeprecation===true){return fn;}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg);}else if(process.traceDeprecation){console.trace(msg);}else{console.error(msg);}warned=true;}return fn.apply(this,arguments);}return deprecated;};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||'';set=set.toUpperCase();if(!debugs[set]){if(new RegExp('\\b'+set+'\\b','i').test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error('%s %d: %s',set,pid,msg);};}else{debugs[set]=function(){};}}return debugs[set];};/**
|
8874 | * Echos the value of a value. Trys to print the value out
|
8875 | * in the best way possible given the different types.
|
8876 | *
|
8877 | * @param {Object} obj The object to print out.
|
8878 | * @param {Object} opts Optional options object that alters the output.
|
8879 | *
|
8880 | var ctx={seen:[],stylize:stylizeNoColor};
|
8881 | if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){
|
8882 | ctx.showHidden=opts;}else if(opts){
|
8883 | exports._extend(ctx,opts);}
|
8884 | if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth);}exports.inspect=inspect;
|
8885 | inspect.colors={'bold':[1,22],'italic':[3,23],'underline':[4,24],'inverse':[7,27],'white':[37,39],'grey':[90,39],'black':[30,39],'blue':[34,39],'cyan':[36,39],'green':[32,39],'magenta':[35,39],'red':[31,39],'yellow':[33,39]};
|
8886 | inspect.styles={'special':'cyan','number':'yellow','boolean':'yellow','undefined':'grey','null':'bold','string':'green','date':'magenta',
|
8887 | 'regexp':'red'};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"\x1B["+inspect.colors[style][0]+'m'+str+"\x1B["+inspect.colors[style][1]+'m';}else{return str;}}function stylizeNoColor(str,styleType){return str;}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true;});return hash;}function formatValue(ctx,value,recurseTimes){
|
8888 |
|
8889 | if(ctx.customInspect&&value&&isFunction(value.inspect)&&
|
8890 | value.inspect!==exports.inspect&&
|
8891 | !(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes);}return ret;}
|
8892 | var primitive=formatPrimitive(ctx,value);if(primitive){return primitive;}
|
8893 | var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value);}
|
8894 |
|
8895 | if(isError(value)&&(keys.indexOf('message')>=0||keys.indexOf('description')>=0)){return formatError(value);}
|
8896 | if(keys.length===0){if(isFunction(value)){var name=value.name?': '+value.name:'';return ctx.stylize('[Function'+name+']','special');}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),'date');}if(isError(value)){return formatError(value);}}var base='',array=false,braces=['{','}'];
|
8897 | if(isArray(value)){array=true;braces=['[',']'];}
|
8898 | if(isFunction(value)){var n=value.name?': '+value.name:'';base=' [Function'+n+']';}
|
8899 | if(isRegExp(value)){base=' '+RegExp.prototype.toString.call(value);}
|
8900 | if(isDate(value)){base=' '+Date.prototype.toUTCString.call(value);}
|
8901 | if(isError(value)){base=' '+formatError(value);}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1];}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');}else{return ctx.stylize('[Object]','special');}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys);}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array);});}ctx.seen.pop();return reduceToSingleString(output,base,braces);}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize('undefined','undefined');if(isString(value)){var simple='\''+JSON.stringify(value).replace(/^"|"$/g,'').replace(/'/g,"\\'").replace(/\\"/g,'"')+'\'';return ctx.stylize(simple,'string');}if(isNumber(value))return ctx.stylize(''+value,'number');if(isBoolean(value))return ctx.stylize(''+value,'boolean');
|
8902 | if(isNull(value))return ctx.stylize('null','null');}function formatError(value){return'['+Error.prototype.toString.call(value)+']';}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true));}else{output.push('');}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true));}});return output;}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize('[Getter/Setter]','special');}else{str=ctx.stylize('[Getter]','special');}}else{if(desc.set){str=ctx.stylize('[Setter]','special');}}if(!hasOwnProperty(visibleKeys,key)){name='['+key+']';}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null);}else{str=formatValue(ctx,desc.value,recurseTimes-1);}if(str.indexOf('\n')>-1){if(array){str=str.split('\n').map(function(line){return' '+line;}).join('\n').substr(2);}else{str='\n'+str.split('\n').map(function(line){return' '+line;}).join('\n');}}}else{str=ctx.stylize('[Circular]','special');}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str;}name=JSON.stringify(''+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,'name');}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,'string');}}return name+': '+str;}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf('\n')>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,'').length+1;},0);if(length>60){return braces[0]+(base===''?'':base+'\n ')+' '+output.join(',\n ')+' '+braces[1];}return braces[0]+base+' '+output.join(', ')+' '+braces[1];}
|
8903 |
|
8904 | function isArray(ar){return Array.isArray(ar);}exports.isArray=isArray;function isBoolean(arg){return typeof arg==='boolean';}exports.isBoolean=isBoolean;function isNull(arg){return arg===null;}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null;}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==='number';}exports.isNumber=isNumber;function isString(arg){return typeof arg==='string';}exports.isString=isString;function isSymbol(arg){return(typeof arg==="undefined"?"undefined":_typeof(arg))==='symbol';}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0;}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==='[object RegExp]';}exports.isRegExp=isRegExp;function isObject(arg){return(typeof arg==="undefined"?"undefined":_typeof(arg))==='object'&&arg!==null;}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==='[object Date]';}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==='[object Error]'||e instanceof Error);}exports.isError=isError;function isFunction(arg){return typeof arg==='function';}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==='boolean'||typeof arg==='number'||typeof arg==='string'||(typeof arg==="undefined"?"undefined":_typeof(arg))==='symbol'||
|
8905 | typeof arg==='undefined';}exports.isPrimitive=isPrimitive;exports.isBuffer=require('./support/isBuffer');function objectToString(o){return Object.prototype.toString.call(o);}function pad(n){return n<10?'0'+n.toString(10):n.toString(10);}var months=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
|
8906 | function timestamp(){var d=new Date();var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(':');return[d.getDate(),months[d.getMonth()],time].join(' ');}
|
8907 | exports.log=function(){console.log('%s - %s',timestamp(),exports.format.apply(exports,arguments));}; |
8908 |
|
8909 |
|
8910 |
|
8911 |
|
8912 |
|
8913 |
|
8914 |
|
8915 |
|
8916 |
|
8917 |
|
8918 |
|
8919 | exports.inherits=require('inherits');exports._extend=function(origin,add){
|
8920 | if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]];}return origin;};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./support/isBuffer":59,"_process":31,"inherits":24}],61:[function(require,module,exports){var indexOf=require('indexof');var Object_keys=function Object_keys(obj){if(Object.keys)return Object.keys(obj);else{var res=[];for(var key in obj){res.push(key);}return res;}};var forEach=function forEach(xs,fn){if(xs.forEach)return xs.forEach(fn);else for(var i=0;i<xs.length;i++){fn(xs[i],i,xs);}};var defineProp=function(){try{Object.defineProperty({},'_',{});return function(obj,name,value){Object.defineProperty(obj,name,{writable:true,enumerable:false,configurable:true,value:value});};}catch(e){return function(obj,name,value){obj[name]=value;};}}();var globals=['Array','Boolean','Date','Error','EvalError','Function','JSON','Math','NaN','Number','Object','RangeError','ReferenceError','RegExp','String','SyntaxError','TypeError','URIError','decodeURI','decodeURIComponent','encodeURI','encodeURIComponent','escape','eval','isFinite','isNaN','parseFloat','parseInt','undefined','unescape'];function Context(){var iframe=document.createElement('iframe');if(!iframe.style)iframe.style={};iframe.style.display='none';document.body.appendChild(iframe);Object.defineProperty(this,"_iframe",{enumerable:false,writable:true});this._iframe=iframe;}Context.prototype={};var Script=exports.Script=function NodeScript(code){if(!(this instanceof Script))return new Script(code);this.code=code;};Script.prototype.runInContext=function(context){if(!(context instanceof Context)){throw new TypeError("needs a 'context' argument.");}var win=context._iframe.contentWindow;var wEval=win.eval,wExecScript=win.execScript;if(!wEval&&wExecScript){
|
8921 | wExecScript.call(win,'null');wEval=win.eval;}forEach(Object_keys(context),function(key){win[key]=context[key];});forEach(globals,function(key){if(context[key]){win[key]=context[key];}});var winKeys=Object_keys(win);var res=wEval.call(win,this.code);forEach(Object_keys(win),function(key){
|
8922 |
|
8923 |
|
8924 | if(key in context||indexOf(winKeys,key)===-1){context[key]=win[key];}});forEach(globals,function(key){if(!(key in context)){defineProp(context,key,win[key]);}});return res;};Script.prototype.runInThisContext=function(){return eval(this.code);
|
8925 | };Script.prototype.runInNewContext=function(context){var ctx=Script.createContext(context);var res=this.runInContext(ctx);forEach(Object_keys(ctx),function(key){context[key]=ctx[key];});return res;};forEach(Object_keys(Script.prototype),function(name){exports[name]=Script[name]=function(code){var s=Script(code);return s[name].apply(s,[].slice.call(arguments,1));};});exports.createScript=function(code){return exports.Script(code);};exports.createContext=Script.createContext=function(context){var copy=new Context();if((typeof context==="undefined"?"undefined":_typeof(context))==='object'){forEach(Object_keys(context),function(key){copy[key]=context[key];copy._iframe.contentWindow[key]=context[key];});}return copy;};exports.isContext=function(sandbox){return sandbox instanceof Context;};},{"indexof":23}],62:[function(require,module,exports){var wordwrap=module.exports=function(start,stop,params){if((typeof start==="undefined"?"undefined":_typeof(start))==='object'){params=start;start=params.start;stop=params.stop;}if((typeof stop==="undefined"?"undefined":_typeof(stop))==='object'){params=stop;start=start||params.start;stop=undefined;}if(!stop){stop=start;start=0;}if(!params)params={};var mode=params.mode||'soft';var re=mode==='hard'?/\b/:/(\S+\s+)/;return function(text){var chunks=text.toString().split(re).reduce(function(acc,x){if(mode==='hard'){for(var i=0;i<x.length;i+=stop-start){acc.push(x.slice(i,i+stop-start));}}else acc.push(x);return acc;},[]);return chunks.reduce(function(lines,rawChunk){if(rawChunk==='')return lines;var chunk=rawChunk.replace(/\t/g,' ');var i=lines.length-1;if(lines[i].length+chunk.length>stop){lines[i]=lines[i].replace(/\s+$/,'');chunk.split(/\n/).forEach(function(c){lines.push(new Array(start+1).join(' ')+c.replace(/^\s+/,''));});}else if(chunk.match(/\n/)){var xs=chunk.split(/\n/);lines[i]+=xs.shift();xs.forEach(function(c){lines.push(new Array(start+1).join(' ')+c.replace(/^\s+/,''));});}else{lines[i]+=chunk;}return lines;},[new Array(start+1).join(' ')]).join('\n');};};wordwrap.soft=wordwrap;wordwrap.hard=function(start,stop){return wordwrap(start,stop,{mode:'hard'});};},{}],63:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}]},{},[8])(8);});});
|
8926 |
|