UNPKG

451 kBJavaScriptView Raw
1/******/ (function(modules) { // webpackBootstrap
2/******/ // The module cache
3/******/ var installedModules = {};
4/******/
5/******/ // The require function
6/******/ function __webpack_require__(moduleId) {
7/******/
8/******/ // Check if module is in cache
9/******/ if(installedModules[moduleId]) {
10/******/ return installedModules[moduleId].exports;
11/******/ }
12/******/ // Create a new module (and put it into the cache)
13/******/ var module = installedModules[moduleId] = {
14/******/ i: moduleId,
15/******/ l: false,
16/******/ exports: {}
17/******/ };
18/******/
19/******/ // Execute the module function
20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ // Flag the module as loaded
23/******/ module.l = true;
24/******/
25/******/ // Return the exports of the module
26/******/ return module.exports;
27/******/ }
28/******/
29/******/
30/******/ // expose the modules object (__webpack_modules__)
31/******/ __webpack_require__.m = modules;
32/******/
33/******/ // expose the module cache
34/******/ __webpack_require__.c = installedModules;
35/******/
36/******/ // define getter function for harmony exports
37/******/ __webpack_require__.d = function(exports, name, getter) {
38/******/ if(!__webpack_require__.o(exports, name)) {
39/******/ Object.defineProperty(exports, name, {
40/******/ configurable: false,
41/******/ enumerable: true,
42/******/ get: getter
43/******/ });
44/******/ }
45/******/ };
46/******/
47/******/ // getDefaultExport function for compatibility with non-harmony modules
48/******/ __webpack_require__.n = function(module) {
49/******/ var getter = module && module.__esModule ?
50/******/ function getDefault() { return module['default']; } :
51/******/ function getModuleExports() { return module; };
52/******/ __webpack_require__.d(getter, 'a', getter);
53/******/ return getter;
54/******/ };
55/******/
56/******/ // Object.prototype.hasOwnProperty.call
57/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58/******/
59/******/ // __webpack_public_path__
60/******/ __webpack_require__.p = "";
61/******/
62/******/ // Load entry module and return exports
63/******/ return __webpack_require__(__webpack_require__.s = 46);
64/******/ })
65/************************************************************************/
66/******/ ([
67/* 0 */
68/***/ (function(module, exports, __webpack_require__) {
69
70"use strict";
71
72
73// Generated by CoffeeScript 1.12.7
74(function () {
75 var XMLCData,
76 XMLComment,
77 XMLDeclaration,
78 XMLDocType,
79 XMLElement,
80 XMLNode,
81 XMLProcessingInstruction,
82 XMLRaw,
83 XMLText,
84 isEmpty,
85 isFunction,
86 isObject,
87 ref,
88 hasProp = {}.hasOwnProperty;
89
90 ref = __webpack_require__(3), isObject = ref.isObject, isFunction = ref.isFunction, isEmpty = ref.isEmpty;
91
92 XMLElement = null;
93
94 XMLCData = null;
95
96 XMLComment = null;
97
98 XMLDeclaration = null;
99
100 XMLDocType = null;
101
102 XMLRaw = null;
103
104 XMLText = null;
105
106 XMLProcessingInstruction = null;
107
108 module.exports = XMLNode = function () {
109 function XMLNode(parent) {
110 this.parent = parent;
111 if (this.parent) {
112 this.options = this.parent.options;
113 this.stringify = this.parent.stringify;
114 }
115 this.children = [];
116 if (!XMLElement) {
117 XMLElement = __webpack_require__(12);
118 XMLCData = __webpack_require__(13);
119 XMLComment = __webpack_require__(14);
120 XMLDeclaration = __webpack_require__(15);
121 XMLDocType = __webpack_require__(16);
122 XMLRaw = __webpack_require__(21);
123 XMLText = __webpack_require__(22);
124 XMLProcessingInstruction = __webpack_require__(23);
125 }
126 }
127
128 XMLNode.prototype.element = function (name, attributes, text) {
129 var childNode, item, j, k, key, lastChild, len, len1, ref1, val;
130 lastChild = null;
131 if (attributes == null) {
132 attributes = {};
133 }
134 attributes = attributes.valueOf();
135 if (!isObject(attributes)) {
136 ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
137 }
138 if (name != null) {
139 name = name.valueOf();
140 }
141 if (Array.isArray(name)) {
142 for (j = 0, len = name.length; j < len; j++) {
143 item = name[j];
144 lastChild = this.element(item);
145 }
146 } else if (isFunction(name)) {
147 lastChild = this.element(name.apply());
148 } else if (isObject(name)) {
149 for (key in name) {
150 if (!hasProp.call(name, key)) continue;
151 val = name[key];
152 if (isFunction(val)) {
153 val = val.apply();
154 }
155 if (isObject(val) && isEmpty(val)) {
156 val = null;
157 }
158 if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
159 lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
160 } else if (!this.options.separateArrayItems && Array.isArray(val)) {
161 for (k = 0, len1 = val.length; k < len1; k++) {
162 item = val[k];
163 childNode = {};
164 childNode[key] = item;
165 lastChild = this.element(childNode);
166 }
167 } else if (isObject(val)) {
168 lastChild = this.element(key);
169 lastChild.element(val);
170 } else {
171 lastChild = this.element(key, val);
172 }
173 }
174 } else {
175 if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
176 lastChild = this.text(text);
177 } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
178 lastChild = this.cdata(text);
179 } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
180 lastChild = this.comment(text);
181 } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
182 lastChild = this.raw(text);
183 } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
184 lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
185 } else {
186 lastChild = this.node(name, attributes, text);
187 }
188 }
189 if (lastChild == null) {
190 throw new Error("Could not create any elements with: " + name);
191 }
192 return lastChild;
193 };
194
195 XMLNode.prototype.insertBefore = function (name, attributes, text) {
196 var child, i, removed;
197 if (this.isRoot) {
198 throw new Error("Cannot insert elements at root level");
199 }
200 i = this.parent.children.indexOf(this);
201 removed = this.parent.children.splice(i);
202 child = this.parent.element(name, attributes, text);
203 Array.prototype.push.apply(this.parent.children, removed);
204 return child;
205 };
206
207 XMLNode.prototype.insertAfter = function (name, attributes, text) {
208 var child, i, removed;
209 if (this.isRoot) {
210 throw new Error("Cannot insert elements at root level");
211 }
212 i = this.parent.children.indexOf(this);
213 removed = this.parent.children.splice(i + 1);
214 child = this.parent.element(name, attributes, text);
215 Array.prototype.push.apply(this.parent.children, removed);
216 return child;
217 };
218
219 XMLNode.prototype.remove = function () {
220 var i, ref1;
221 if (this.isRoot) {
222 throw new Error("Cannot remove the root element");
223 }
224 i = this.parent.children.indexOf(this);
225 [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref1 = [])), ref1;
226 return this.parent;
227 };
228
229 XMLNode.prototype.node = function (name, attributes, text) {
230 var child, ref1;
231 if (name != null) {
232 name = name.valueOf();
233 }
234 attributes || (attributes = {});
235 attributes = attributes.valueOf();
236 if (!isObject(attributes)) {
237 ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
238 }
239 child = new XMLElement(this, name, attributes);
240 if (text != null) {
241 child.text(text);
242 }
243 this.children.push(child);
244 return child;
245 };
246
247 XMLNode.prototype.text = function (value) {
248 var child;
249 child = new XMLText(this, value);
250 this.children.push(child);
251 return this;
252 };
253
254 XMLNode.prototype.cdata = function (value) {
255 var child;
256 child = new XMLCData(this, value);
257 this.children.push(child);
258 return this;
259 };
260
261 XMLNode.prototype.comment = function (value) {
262 var child;
263 child = new XMLComment(this, value);
264 this.children.push(child);
265 return this;
266 };
267
268 XMLNode.prototype.commentBefore = function (value) {
269 var child, i, removed;
270 i = this.parent.children.indexOf(this);
271 removed = this.parent.children.splice(i);
272 child = this.parent.comment(value);
273 Array.prototype.push.apply(this.parent.children, removed);
274 return this;
275 };
276
277 XMLNode.prototype.commentAfter = function (value) {
278 var child, i, removed;
279 i = this.parent.children.indexOf(this);
280 removed = this.parent.children.splice(i + 1);
281 child = this.parent.comment(value);
282 Array.prototype.push.apply(this.parent.children, removed);
283 return this;
284 };
285
286 XMLNode.prototype.raw = function (value) {
287 var child;
288 child = new XMLRaw(this, value);
289 this.children.push(child);
290 return this;
291 };
292
293 XMLNode.prototype.instruction = function (target, value) {
294 var insTarget, insValue, instruction, j, len;
295 if (target != null) {
296 target = target.valueOf();
297 }
298 if (value != null) {
299 value = value.valueOf();
300 }
301 if (Array.isArray(target)) {
302 for (j = 0, len = target.length; j < len; j++) {
303 insTarget = target[j];
304 this.instruction(insTarget);
305 }
306 } else if (isObject(target)) {
307 for (insTarget in target) {
308 if (!hasProp.call(target, insTarget)) continue;
309 insValue = target[insTarget];
310 this.instruction(insTarget, insValue);
311 }
312 } else {
313 if (isFunction(value)) {
314 value = value.apply();
315 }
316 instruction = new XMLProcessingInstruction(this, target, value);
317 this.children.push(instruction);
318 }
319 return this;
320 };
321
322 XMLNode.prototype.instructionBefore = function (target, value) {
323 var child, i, removed;
324 i = this.parent.children.indexOf(this);
325 removed = this.parent.children.splice(i);
326 child = this.parent.instruction(target, value);
327 Array.prototype.push.apply(this.parent.children, removed);
328 return this;
329 };
330
331 XMLNode.prototype.instructionAfter = function (target, value) {
332 var child, i, removed;
333 i = this.parent.children.indexOf(this);
334 removed = this.parent.children.splice(i + 1);
335 child = this.parent.instruction(target, value);
336 Array.prototype.push.apply(this.parent.children, removed);
337 return this;
338 };
339
340 XMLNode.prototype.declaration = function (version, encoding, standalone) {
341 var doc, xmldec;
342 doc = this.document();
343 xmldec = new XMLDeclaration(doc, version, encoding, standalone);
344 if (doc.children[0] instanceof XMLDeclaration) {
345 doc.children[0] = xmldec;
346 } else {
347 doc.children.unshift(xmldec);
348 }
349 return doc.root() || doc;
350 };
351
352 XMLNode.prototype.doctype = function (pubID, sysID) {
353 var child, doc, doctype, i, j, k, len, len1, ref1, ref2;
354 doc = this.document();
355 doctype = new XMLDocType(doc, pubID, sysID);
356 ref1 = doc.children;
357 for (i = j = 0, len = ref1.length; j < len; i = ++j) {
358 child = ref1[i];
359 if (child instanceof XMLDocType) {
360 doc.children[i] = doctype;
361 return doctype;
362 }
363 }
364 ref2 = doc.children;
365 for (i = k = 0, len1 = ref2.length; k < len1; i = ++k) {
366 child = ref2[i];
367 if (child.isRoot) {
368 doc.children.splice(i, 0, doctype);
369 return doctype;
370 }
371 }
372 doc.children.push(doctype);
373 return doctype;
374 };
375
376 XMLNode.prototype.up = function () {
377 if (this.isRoot) {
378 throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
379 }
380 return this.parent;
381 };
382
383 XMLNode.prototype.root = function () {
384 var node;
385 node = this;
386 while (node) {
387 if (node.isDocument) {
388 return node.rootObject;
389 } else if (node.isRoot) {
390 return node;
391 } else {
392 node = node.parent;
393 }
394 }
395 };
396
397 XMLNode.prototype.document = function () {
398 var node;
399 node = this;
400 while (node) {
401 if (node.isDocument) {
402 return node;
403 } else {
404 node = node.parent;
405 }
406 }
407 };
408
409 XMLNode.prototype.end = function (options) {
410 return this.document().end(options);
411 };
412
413 XMLNode.prototype.prev = function () {
414 var i;
415 i = this.parent.children.indexOf(this);
416 if (i < 1) {
417 throw new Error("Already at the first node");
418 }
419 return this.parent.children[i - 1];
420 };
421
422 XMLNode.prototype.next = function () {
423 var i;
424 i = this.parent.children.indexOf(this);
425 if (i === -1 || i === this.parent.children.length - 1) {
426 throw new Error("Already at the last node");
427 }
428 return this.parent.children[i + 1];
429 };
430
431 XMLNode.prototype.importDocument = function (doc) {
432 var clonedRoot;
433 clonedRoot = doc.root().clone();
434 clonedRoot.parent = this;
435 clonedRoot.isRoot = false;
436 this.children.push(clonedRoot);
437 return this;
438 };
439
440 XMLNode.prototype.ele = function (name, attributes, text) {
441 return this.element(name, attributes, text);
442 };
443
444 XMLNode.prototype.nod = function (name, attributes, text) {
445 return this.node(name, attributes, text);
446 };
447
448 XMLNode.prototype.txt = function (value) {
449 return this.text(value);
450 };
451
452 XMLNode.prototype.dat = function (value) {
453 return this.cdata(value);
454 };
455
456 XMLNode.prototype.com = function (value) {
457 return this.comment(value);
458 };
459
460 XMLNode.prototype.ins = function (target, value) {
461 return this.instruction(target, value);
462 };
463
464 XMLNode.prototype.doc = function () {
465 return this.document();
466 };
467
468 XMLNode.prototype.dec = function (version, encoding, standalone) {
469 return this.declaration(version, encoding, standalone);
470 };
471
472 XMLNode.prototype.dtd = function (pubID, sysID) {
473 return this.doctype(pubID, sysID);
474 };
475
476 XMLNode.prototype.e = function (name, attributes, text) {
477 return this.element(name, attributes, text);
478 };
479
480 XMLNode.prototype.n = function (name, attributes, text) {
481 return this.node(name, attributes, text);
482 };
483
484 XMLNode.prototype.t = function (value) {
485 return this.text(value);
486 };
487
488 XMLNode.prototype.d = function (value) {
489 return this.cdata(value);
490 };
491
492 XMLNode.prototype.c = function (value) {
493 return this.comment(value);
494 };
495
496 XMLNode.prototype.r = function (value) {
497 return this.raw(value);
498 };
499
500 XMLNode.prototype.i = function (target, value) {
501 return this.instruction(target, value);
502 };
503
504 XMLNode.prototype.u = function () {
505 return this.up();
506 };
507
508 XMLNode.prototype.importXMLBuilder = function (doc) {
509 return this.importDocument(doc);
510 };
511
512 return XMLNode;
513 }();
514}).call(undefined);
515
516/***/ }),
517/* 1 */
518/***/ (function(module, exports, __webpack_require__) {
519
520"use strict";
521
522
523var _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; };
524
525var g;
526
527// This works in non-strict mode
528g = function () {
529 return this;
530}();
531
532try {
533 // This works if eval is allowed (see CSP)
534 g = g || Function("return this")() || (1, eval)("this");
535} catch (e) {
536 // This works if the window reference is available
537 if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
538}
539
540// g can still be undefined, but nothing to do about it...
541// We return undefined, instead of nothing here, so it's
542// easier to handle this case. if(!global) { ...}
543
544module.exports = g;
545
546/***/ }),
547/* 2 */
548/***/ (function(module, exports, __webpack_require__) {
549
550"use strict";
551
552
553if (typeof Object.create === 'function') {
554 // implementation from standard node.js 'util' module
555 module.exports = function inherits(ctor, superCtor) {
556 ctor.super_ = superCtor;
557 ctor.prototype = Object.create(superCtor.prototype, {
558 constructor: {
559 value: ctor,
560 enumerable: false,
561 writable: true,
562 configurable: true
563 }
564 });
565 };
566} else {
567 // old school shim for old browsers
568 module.exports = function inherits(ctor, superCtor) {
569 ctor.super_ = superCtor;
570 var TempCtor = function TempCtor() {};
571 TempCtor.prototype = superCtor.prototype;
572 ctor.prototype = new TempCtor();
573 ctor.prototype.constructor = ctor;
574 };
575}
576
577/***/ }),
578/* 3 */
579/***/ (function(module, exports, __webpack_require__) {
580
581"use strict";
582
583
584var _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; };
585
586// Generated by CoffeeScript 1.12.7
587(function () {
588 var assign,
589 isArray,
590 isEmpty,
591 isFunction,
592 isObject,
593 isPlainObject,
594 slice = [].slice,
595 hasProp = {}.hasOwnProperty;
596
597 assign = function assign() {
598 var i, key, len, source, sources, target;
599 target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [];
600 if (isFunction(Object.assign)) {
601 Object.assign.apply(null, arguments);
602 } else {
603 for (i = 0, len = sources.length; i < len; i++) {
604 source = sources[i];
605 if (source != null) {
606 for (key in source) {
607 if (!hasProp.call(source, key)) continue;
608 target[key] = source[key];
609 }
610 }
611 }
612 }
613 return target;
614 };
615
616 isFunction = function isFunction(val) {
617 return !!val && Object.prototype.toString.call(val) === '[object Function]';
618 };
619
620 isObject = function isObject(val) {
621 var ref;
622 return !!val && ((ref = typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'function' || ref === 'object');
623 };
624
625 isArray = function isArray(val) {
626 if (isFunction(Array.isArray)) {
627 return Array.isArray(val);
628 } else {
629 return Object.prototype.toString.call(val) === '[object Array]';
630 }
631 };
632
633 isEmpty = function isEmpty(val) {
634 var key;
635 if (isArray(val)) {
636 return !val.length;
637 } else {
638 for (key in val) {
639 if (!hasProp.call(val, key)) continue;
640 return false;
641 }
642 return true;
643 }
644 };
645
646 isPlainObject = function isPlainObject(val) {
647 var ctor, proto;
648 return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && typeof ctor === 'function' && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object);
649 };
650
651 module.exports.assign = assign;
652
653 module.exports.isFunction = isFunction;
654
655 module.exports.isObject = isObject;
656
657 module.exports.isArray = isArray;
658
659 module.exports.isEmpty = isEmpty;
660
661 module.exports.isPlainObject = isPlainObject;
662}).call(undefined);
663
664/***/ }),
665/* 4 */
666/***/ (function(module, exports, __webpack_require__) {
667
668"use strict";
669// Copyright Joyent, Inc. and other Node contributors.
670//
671// Permission is hereby granted, free of charge, to any person obtaining a
672// copy of this software and associated documentation files (the
673// "Software"), to deal in the Software without restriction, including
674// without limitation the rights to use, copy, modify, merge, publish,
675// distribute, sublicense, and/or sell copies of the Software, and to permit
676// persons to whom the Software is furnished to do so, subject to the
677// following conditions:
678//
679// The above copyright notice and this permission notice shall be included
680// in all copies or substantial portions of the Software.
681//
682// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
683// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
684// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
685// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
686// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
687// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
688// USE OR OTHER DEALINGS IN THE SOFTWARE.
689
690// a duplex stream is just a stream that is both readable and writable.
691// Since JS doesn't have multiple prototypal inheritance, this class
692// prototypally inherits from Readable, and then parasitically from
693// Writable.
694
695
696
697/*<replacement>*/
698
699var pna = __webpack_require__(9);
700/*</replacement>*/
701
702/*<replacement>*/
703var objectKeys = Object.keys || function (obj) {
704 var keys = [];
705 for (var key in obj) {
706 keys.push(key);
707 }return keys;
708};
709/*</replacement>*/
710
711module.exports = Duplex;
712
713/*<replacement>*/
714var util = __webpack_require__(8);
715util.inherits = __webpack_require__(2);
716/*</replacement>*/
717
718var Readable = __webpack_require__(33);
719var Writable = __webpack_require__(24);
720
721util.inherits(Duplex, Readable);
722
723{
724 // avoid scope creep, the keys array can then be collected
725 var keys = objectKeys(Writable.prototype);
726 for (var v = 0; v < keys.length; v++) {
727 var method = keys[v];
728 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
729 }
730}
731
732function Duplex(options) {
733 if (!(this instanceof Duplex)) return new Duplex(options);
734
735 Readable.call(this, options);
736 Writable.call(this, options);
737
738 if (options && options.readable === false) this.readable = false;
739
740 if (options && options.writable === false) this.writable = false;
741
742 this.allowHalfOpen = true;
743 if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
744
745 this.once('end', onend);
746}
747
748Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
749 // making it explicit this property is not enumerable
750 // because otherwise some prototype manipulation in
751 // userland will fail
752 enumerable: false,
753 get: function get() {
754 return this._writableState.highWaterMark;
755 }
756});
757
758// the no-half-open enforcer
759function onend() {
760 // if we allow half-open state, or if the writable side ended,
761 // then we're ok.
762 if (this.allowHalfOpen || this._writableState.ended) return;
763
764 // no more data can be written.
765 // But allow more writes to happen in this tick.
766 pna.nextTick(onEndNT, this);
767}
768
769function onEndNT(self) {
770 self.end();
771}
772
773Object.defineProperty(Duplex.prototype, 'destroyed', {
774 get: function get() {
775 if (this._readableState === undefined || this._writableState === undefined) {
776 return false;
777 }
778 return this._readableState.destroyed && this._writableState.destroyed;
779 },
780 set: function set(value) {
781 // we ignore the value if the stream
782 // has not been initialized yet
783 if (this._readableState === undefined || this._writableState === undefined) {
784 return;
785 }
786
787 // backward compatibility, the user is explicitly
788 // managing destroyed
789 this._readableState.destroyed = value;
790 this._writableState.destroyed = value;
791 }
792});
793
794Duplex.prototype._destroy = function (err, cb) {
795 this.push(null);
796 this.end();
797
798 pna.nextTick(cb, err);
799};
800
801/***/ }),
802/* 5 */
803/***/ (function(module, exports, __webpack_require__) {
804
805"use strict";
806/* WEBPACK VAR INJECTION */(function(global) {/*!
807 * The buffer module from node.js, for the browser.
808 *
809 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
810 * @license MIT
811 */
812/* eslint-disable no-proto */
813
814
815
816var base64 = __webpack_require__(50);
817var ieee754 = __webpack_require__(51);
818var isArray = __webpack_require__(30);
819
820exports.Buffer = Buffer;
821exports.SlowBuffer = SlowBuffer;
822exports.INSPECT_MAX_BYTES = 50;
823
824/**
825 * If `Buffer.TYPED_ARRAY_SUPPORT`:
826 * === true Use Uint8Array implementation (fastest)
827 * === false Use Object implementation (most compatible, even IE6)
828 *
829 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
830 * Opera 11.6+, iOS 4.2+.
831 *
832 * Due to various browser bugs, sometimes the Object implementation will be used even
833 * when the browser supports typed arrays.
834 *
835 * Note:
836 *
837 * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
838 * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
839 *
840 * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
841 *
842 * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
843 * incorrect length in some situations.
844
845 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
846 * get the Object implementation, which is slower but behaves correctly.
847 */
848Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport();
849
850/*
851 * Export kMaxLength after typed array support is determined.
852 */
853exports.kMaxLength = kMaxLength();
854
855function typedArraySupport() {
856 try {
857 var arr = new Uint8Array(1);
858 arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function foo() {
859 return 42;
860 } };
861 return arr.foo() === 42 && // typed array instances can be augmented
862 typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
863 arr.subarray(1, 1).byteLength === 0; // ie10 has broken `subarray`
864 } catch (e) {
865 return false;
866 }
867}
868
869function kMaxLength() {
870 return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;
871}
872
873function createBuffer(that, length) {
874 if (kMaxLength() < length) {
875 throw new RangeError('Invalid typed array length');
876 }
877 if (Buffer.TYPED_ARRAY_SUPPORT) {
878 // Return an augmented `Uint8Array` instance, for best performance
879 that = new Uint8Array(length);
880 that.__proto__ = Buffer.prototype;
881 } else {
882 // Fallback: Return an object instance of the Buffer class
883 if (that === null) {
884 that = new Buffer(length);
885 }
886 that.length = length;
887 }
888
889 return that;
890}
891
892/**
893 * The Buffer constructor returns instances of `Uint8Array` that have their
894 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
895 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
896 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
897 * returns a single octet.
898 *
899 * The `Uint8Array` prototype remains unmodified.
900 */
901
902function Buffer(arg, encodingOrOffset, length) {
903 if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
904 return new Buffer(arg, encodingOrOffset, length);
905 }
906
907 // Common case.
908 if (typeof arg === 'number') {
909 if (typeof encodingOrOffset === 'string') {
910 throw new Error('If encoding is specified then the first argument must be a string');
911 }
912 return allocUnsafe(this, arg);
913 }
914 return from(this, arg, encodingOrOffset, length);
915}
916
917Buffer.poolSize = 8192; // not used by this implementation
918
919// TODO: Legacy, not needed anymore. Remove in next major version.
920Buffer._augment = function (arr) {
921 arr.__proto__ = Buffer.prototype;
922 return arr;
923};
924
925function from(that, value, encodingOrOffset, length) {
926 if (typeof value === 'number') {
927 throw new TypeError('"value" argument must not be a number');
928 }
929
930 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
931 return fromArrayBuffer(that, value, encodingOrOffset, length);
932 }
933
934 if (typeof value === 'string') {
935 return fromString(that, value, encodingOrOffset);
936 }
937
938 return fromObject(that, value);
939}
940
941/**
942 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
943 * if value is a number.
944 * Buffer.from(str[, encoding])
945 * Buffer.from(array)
946 * Buffer.from(buffer)
947 * Buffer.from(arrayBuffer[, byteOffset[, length]])
948 **/
949Buffer.from = function (value, encodingOrOffset, length) {
950 return from(null, value, encodingOrOffset, length);
951};
952
953if (Buffer.TYPED_ARRAY_SUPPORT) {
954 Buffer.prototype.__proto__ = Uint8Array.prototype;
955 Buffer.__proto__ = Uint8Array;
956 if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) {
957 // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
958 Object.defineProperty(Buffer, Symbol.species, {
959 value: null,
960 configurable: true
961 });
962 }
963}
964
965function assertSize(size) {
966 if (typeof size !== 'number') {
967 throw new TypeError('"size" argument must be a number');
968 } else if (size < 0) {
969 throw new RangeError('"size" argument must not be negative');
970 }
971}
972
973function alloc(that, size, fill, encoding) {
974 assertSize(size);
975 if (size <= 0) {
976 return createBuffer(that, size);
977 }
978 if (fill !== undefined) {
979 // Only pay attention to encoding if it's a string. This
980 // prevents accidentally sending in a number that would
981 // be interpretted as a start offset.
982 return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);
983 }
984 return createBuffer(that, size);
985}
986
987/**
988 * Creates a new filled Buffer instance.
989 * alloc(size[, fill[, encoding]])
990 **/
991Buffer.alloc = function (size, fill, encoding) {
992 return alloc(null, size, fill, encoding);
993};
994
995function allocUnsafe(that, size) {
996 assertSize(size);
997 that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
998 if (!Buffer.TYPED_ARRAY_SUPPORT) {
999 for (var i = 0; i < size; ++i) {
1000 that[i] = 0;
1001 }
1002 }
1003 return that;
1004}
1005
1006/**
1007 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
1008 * */
1009Buffer.allocUnsafe = function (size) {
1010 return allocUnsafe(null, size);
1011};
1012/**
1013 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
1014 */
1015Buffer.allocUnsafeSlow = function (size) {
1016 return allocUnsafe(null, size);
1017};
1018
1019function fromString(that, string, encoding) {
1020 if (typeof encoding !== 'string' || encoding === '') {
1021 encoding = 'utf8';
1022 }
1023
1024 if (!Buffer.isEncoding(encoding)) {
1025 throw new TypeError('"encoding" must be a valid string encoding');
1026 }
1027
1028 var length = byteLength(string, encoding) | 0;
1029 that = createBuffer(that, length);
1030
1031 var actual = that.write(string, encoding);
1032
1033 if (actual !== length) {
1034 // Writing a hex string, for example, that contains invalid characters will
1035 // cause everything after the first invalid character to be ignored. (e.g.
1036 // 'abxxcd' will be treated as 'ab')
1037 that = that.slice(0, actual);
1038 }
1039
1040 return that;
1041}
1042
1043function fromArrayLike(that, array) {
1044 var length = array.length < 0 ? 0 : checked(array.length) | 0;
1045 that = createBuffer(that, length);
1046 for (var i = 0; i < length; i += 1) {
1047 that[i] = array[i] & 255;
1048 }
1049 return that;
1050}
1051
1052function fromArrayBuffer(that, array, byteOffset, length) {
1053 array.byteLength; // this throws if `array` is not a valid ArrayBuffer
1054
1055 if (byteOffset < 0 || array.byteLength < byteOffset) {
1056 throw new RangeError('\'offset\' is out of bounds');
1057 }
1058
1059 if (array.byteLength < byteOffset + (length || 0)) {
1060 throw new RangeError('\'length\' is out of bounds');
1061 }
1062
1063 if (byteOffset === undefined && length === undefined) {
1064 array = new Uint8Array(array);
1065 } else if (length === undefined) {
1066 array = new Uint8Array(array, byteOffset);
1067 } else {
1068 array = new Uint8Array(array, byteOffset, length);
1069 }
1070
1071 if (Buffer.TYPED_ARRAY_SUPPORT) {
1072 // Return an augmented `Uint8Array` instance, for best performance
1073 that = array;
1074 that.__proto__ = Buffer.prototype;
1075 } else {
1076 // Fallback: Return an object instance of the Buffer class
1077 that = fromArrayLike(that, array);
1078 }
1079 return that;
1080}
1081
1082function fromObject(that, obj) {
1083 if (Buffer.isBuffer(obj)) {
1084 var len = checked(obj.length) | 0;
1085 that = createBuffer(that, len);
1086
1087 if (that.length === 0) {
1088 return that;
1089 }
1090
1091 obj.copy(that, 0, 0, len);
1092 return that;
1093 }
1094
1095 if (obj) {
1096 if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) {
1097 if (typeof obj.length !== 'number' || isnan(obj.length)) {
1098 return createBuffer(that, 0);
1099 }
1100 return fromArrayLike(that, obj);
1101 }
1102
1103 if (obj.type === 'Buffer' && isArray(obj.data)) {
1104 return fromArrayLike(that, obj.data);
1105 }
1106 }
1107
1108 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');
1109}
1110
1111function checked(length) {
1112 // Note: cannot use `length < kMaxLength()` here because that fails when
1113 // length is NaN (which is otherwise coerced to zero.)
1114 if (length >= kMaxLength()) {
1115 throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes');
1116 }
1117 return length | 0;
1118}
1119
1120function SlowBuffer(length) {
1121 if (+length != length) {
1122 // eslint-disable-line eqeqeq
1123 length = 0;
1124 }
1125 return Buffer.alloc(+length);
1126}
1127
1128Buffer.isBuffer = function isBuffer(b) {
1129 return !!(b != null && b._isBuffer);
1130};
1131
1132Buffer.compare = function compare(a, b) {
1133 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
1134 throw new TypeError('Arguments must be Buffers');
1135 }
1136
1137 if (a === b) return 0;
1138
1139 var x = a.length;
1140 var y = b.length;
1141
1142 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
1143 if (a[i] !== b[i]) {
1144 x = a[i];
1145 y = b[i];
1146 break;
1147 }
1148 }
1149
1150 if (x < y) return -1;
1151 if (y < x) return 1;
1152 return 0;
1153};
1154
1155Buffer.isEncoding = function isEncoding(encoding) {
1156 switch (String(encoding).toLowerCase()) {
1157 case 'hex':
1158 case 'utf8':
1159 case 'utf-8':
1160 case 'ascii':
1161 case 'latin1':
1162 case 'binary':
1163 case 'base64':
1164 case 'ucs2':
1165 case 'ucs-2':
1166 case 'utf16le':
1167 case 'utf-16le':
1168 return true;
1169 default:
1170 return false;
1171 }
1172};
1173
1174Buffer.concat = function concat(list, length) {
1175 if (!isArray(list)) {
1176 throw new TypeError('"list" argument must be an Array of Buffers');
1177 }
1178
1179 if (list.length === 0) {
1180 return Buffer.alloc(0);
1181 }
1182
1183 var i;
1184 if (length === undefined) {
1185 length = 0;
1186 for (i = 0; i < list.length; ++i) {
1187 length += list[i].length;
1188 }
1189 }
1190
1191 var buffer = Buffer.allocUnsafe(length);
1192 var pos = 0;
1193 for (i = 0; i < list.length; ++i) {
1194 var buf = list[i];
1195 if (!Buffer.isBuffer(buf)) {
1196 throw new TypeError('"list" argument must be an Array of Buffers');
1197 }
1198 buf.copy(buffer, pos);
1199 pos += buf.length;
1200 }
1201 return buffer;
1202};
1203
1204function byteLength(string, encoding) {
1205 if (Buffer.isBuffer(string)) {
1206 return string.length;
1207 }
1208 if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
1209 return string.byteLength;
1210 }
1211 if (typeof string !== 'string') {
1212 string = '' + string;
1213 }
1214
1215 var len = string.length;
1216 if (len === 0) return 0;
1217
1218 // Use a for loop to avoid recursion
1219 var loweredCase = false;
1220 for (;;) {
1221 switch (encoding) {
1222 case 'ascii':
1223 case 'latin1':
1224 case 'binary':
1225 return len;
1226 case 'utf8':
1227 case 'utf-8':
1228 case undefined:
1229 return utf8ToBytes(string).length;
1230 case 'ucs2':
1231 case 'ucs-2':
1232 case 'utf16le':
1233 case 'utf-16le':
1234 return len * 2;
1235 case 'hex':
1236 return len >>> 1;
1237 case 'base64':
1238 return base64ToBytes(string).length;
1239 default:
1240 if (loweredCase) return utf8ToBytes(string).length; // assume utf8
1241 encoding = ('' + encoding).toLowerCase();
1242 loweredCase = true;
1243 }
1244 }
1245}
1246Buffer.byteLength = byteLength;
1247
1248function slowToString(encoding, start, end) {
1249 var loweredCase = false;
1250
1251 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
1252 // property of a typed array.
1253
1254 // This behaves neither like String nor Uint8Array in that we set start/end
1255 // to their upper/lower bounds if the value passed is out of range.
1256 // undefined is handled specially as per ECMA-262 6th Edition,
1257 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
1258 if (start === undefined || start < 0) {
1259 start = 0;
1260 }
1261 // Return early if start > this.length. Done here to prevent potential uint32
1262 // coercion fail below.
1263 if (start > this.length) {
1264 return '';
1265 }
1266
1267 if (end === undefined || end > this.length) {
1268 end = this.length;
1269 }
1270
1271 if (end <= 0) {
1272 return '';
1273 }
1274
1275 // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
1276 end >>>= 0;
1277 start >>>= 0;
1278
1279 if (end <= start) {
1280 return '';
1281 }
1282
1283 if (!encoding) encoding = 'utf8';
1284
1285 while (true) {
1286 switch (encoding) {
1287 case 'hex':
1288 return hexSlice(this, start, end);
1289
1290 case 'utf8':
1291 case 'utf-8':
1292 return utf8Slice(this, start, end);
1293
1294 case 'ascii':
1295 return asciiSlice(this, start, end);
1296
1297 case 'latin1':
1298 case 'binary':
1299 return latin1Slice(this, start, end);
1300
1301 case 'base64':
1302 return base64Slice(this, start, end);
1303
1304 case 'ucs2':
1305 case 'ucs-2':
1306 case 'utf16le':
1307 case 'utf-16le':
1308 return utf16leSlice(this, start, end);
1309
1310 default:
1311 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
1312 encoding = (encoding + '').toLowerCase();
1313 loweredCase = true;
1314 }
1315 }
1316}
1317
1318// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
1319// Buffer instances.
1320Buffer.prototype._isBuffer = true;
1321
1322function swap(b, n, m) {
1323 var i = b[n];
1324 b[n] = b[m];
1325 b[m] = i;
1326}
1327
1328Buffer.prototype.swap16 = function swap16() {
1329 var len = this.length;
1330 if (len % 2 !== 0) {
1331 throw new RangeError('Buffer size must be a multiple of 16-bits');
1332 }
1333 for (var i = 0; i < len; i += 2) {
1334 swap(this, i, i + 1);
1335 }
1336 return this;
1337};
1338
1339Buffer.prototype.swap32 = function swap32() {
1340 var len = this.length;
1341 if (len % 4 !== 0) {
1342 throw new RangeError('Buffer size must be a multiple of 32-bits');
1343 }
1344 for (var i = 0; i < len; i += 4) {
1345 swap(this, i, i + 3);
1346 swap(this, i + 1, i + 2);
1347 }
1348 return this;
1349};
1350
1351Buffer.prototype.swap64 = function swap64() {
1352 var len = this.length;
1353 if (len % 8 !== 0) {
1354 throw new RangeError('Buffer size must be a multiple of 64-bits');
1355 }
1356 for (var i = 0; i < len; i += 8) {
1357 swap(this, i, i + 7);
1358 swap(this, i + 1, i + 6);
1359 swap(this, i + 2, i + 5);
1360 swap(this, i + 3, i + 4);
1361 }
1362 return this;
1363};
1364
1365Buffer.prototype.toString = function toString() {
1366 var length = this.length | 0;
1367 if (length === 0) return '';
1368 if (arguments.length === 0) return utf8Slice(this, 0, length);
1369 return slowToString.apply(this, arguments);
1370};
1371
1372Buffer.prototype.equals = function equals(b) {
1373 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer');
1374 if (this === b) return true;
1375 return Buffer.compare(this, b) === 0;
1376};
1377
1378Buffer.prototype.inspect = function inspect() {
1379 var str = '';
1380 var max = exports.INSPECT_MAX_BYTES;
1381 if (this.length > 0) {
1382 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
1383 if (this.length > max) str += ' ... ';
1384 }
1385 return '<Buffer ' + str + '>';
1386};
1387
1388Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
1389 if (!Buffer.isBuffer(target)) {
1390 throw new TypeError('Argument must be a Buffer');
1391 }
1392
1393 if (start === undefined) {
1394 start = 0;
1395 }
1396 if (end === undefined) {
1397 end = target ? target.length : 0;
1398 }
1399 if (thisStart === undefined) {
1400 thisStart = 0;
1401 }
1402 if (thisEnd === undefined) {
1403 thisEnd = this.length;
1404 }
1405
1406 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
1407 throw new RangeError('out of range index');
1408 }
1409
1410 if (thisStart >= thisEnd && start >= end) {
1411 return 0;
1412 }
1413 if (thisStart >= thisEnd) {
1414 return -1;
1415 }
1416 if (start >= end) {
1417 return 1;
1418 }
1419
1420 start >>>= 0;
1421 end >>>= 0;
1422 thisStart >>>= 0;
1423 thisEnd >>>= 0;
1424
1425 if (this === target) return 0;
1426
1427 var x = thisEnd - thisStart;
1428 var y = end - start;
1429 var len = Math.min(x, y);
1430
1431 var thisCopy = this.slice(thisStart, thisEnd);
1432 var targetCopy = target.slice(start, end);
1433
1434 for (var i = 0; i < len; ++i) {
1435 if (thisCopy[i] !== targetCopy[i]) {
1436 x = thisCopy[i];
1437 y = targetCopy[i];
1438 break;
1439 }
1440 }
1441
1442 if (x < y) return -1;
1443 if (y < x) return 1;
1444 return 0;
1445};
1446
1447// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
1448// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
1449//
1450// Arguments:
1451// - buffer - a Buffer to search
1452// - val - a string, Buffer, or number
1453// - byteOffset - an index into `buffer`; will be clamped to an int32
1454// - encoding - an optional encoding, relevant is val is a string
1455// - dir - true for indexOf, false for lastIndexOf
1456function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
1457 // Empty buffer means no match
1458 if (buffer.length === 0) return -1;
1459
1460 // Normalize byteOffset
1461 if (typeof byteOffset === 'string') {
1462 encoding = byteOffset;
1463 byteOffset = 0;
1464 } else if (byteOffset > 0x7fffffff) {
1465 byteOffset = 0x7fffffff;
1466 } else if (byteOffset < -0x80000000) {
1467 byteOffset = -0x80000000;
1468 }
1469 byteOffset = +byteOffset; // Coerce to Number.
1470 if (isNaN(byteOffset)) {
1471 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
1472 byteOffset = dir ? 0 : buffer.length - 1;
1473 }
1474
1475 // Normalize byteOffset: negative offsets start from the end of the buffer
1476 if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
1477 if (byteOffset >= buffer.length) {
1478 if (dir) return -1;else byteOffset = buffer.length - 1;
1479 } else if (byteOffset < 0) {
1480 if (dir) byteOffset = 0;else return -1;
1481 }
1482
1483 // Normalize val
1484 if (typeof val === 'string') {
1485 val = Buffer.from(val, encoding);
1486 }
1487
1488 // Finally, search either indexOf (if dir is true) or lastIndexOf
1489 if (Buffer.isBuffer(val)) {
1490 // Special case: looking for empty string/buffer always fails
1491 if (val.length === 0) {
1492 return -1;
1493 }
1494 return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
1495 } else if (typeof val === 'number') {
1496 val = val & 0xFF; // Search for a byte value [0-255]
1497 if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {
1498 if (dir) {
1499 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
1500 } else {
1501 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
1502 }
1503 }
1504 return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
1505 }
1506
1507 throw new TypeError('val must be string, number or Buffer');
1508}
1509
1510function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
1511 var indexSize = 1;
1512 var arrLength = arr.length;
1513 var valLength = val.length;
1514
1515 if (encoding !== undefined) {
1516 encoding = String(encoding).toLowerCase();
1517 if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {
1518 if (arr.length < 2 || val.length < 2) {
1519 return -1;
1520 }
1521 indexSize = 2;
1522 arrLength /= 2;
1523 valLength /= 2;
1524 byteOffset /= 2;
1525 }
1526 }
1527
1528 function read(buf, i) {
1529 if (indexSize === 1) {
1530 return buf[i];
1531 } else {
1532 return buf.readUInt16BE(i * indexSize);
1533 }
1534 }
1535
1536 var i;
1537 if (dir) {
1538 var foundIndex = -1;
1539 for (i = byteOffset; i < arrLength; i++) {
1540 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
1541 if (foundIndex === -1) foundIndex = i;
1542 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
1543 } else {
1544 if (foundIndex !== -1) i -= i - foundIndex;
1545 foundIndex = -1;
1546 }
1547 }
1548 } else {
1549 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
1550 for (i = byteOffset; i >= 0; i--) {
1551 var found = true;
1552 for (var j = 0; j < valLength; j++) {
1553 if (read(arr, i + j) !== read(val, j)) {
1554 found = false;
1555 break;
1556 }
1557 }
1558 if (found) return i;
1559 }
1560 }
1561
1562 return -1;
1563}
1564
1565Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
1566 return this.indexOf(val, byteOffset, encoding) !== -1;
1567};
1568
1569Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
1570 return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
1571};
1572
1573Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
1574 return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
1575};
1576
1577function hexWrite(buf, string, offset, length) {
1578 offset = Number(offset) || 0;
1579 var remaining = buf.length - offset;
1580 if (!length) {
1581 length = remaining;
1582 } else {
1583 length = Number(length);
1584 if (length > remaining) {
1585 length = remaining;
1586 }
1587 }
1588
1589 // must be an even number of digits
1590 var strLen = string.length;
1591 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string');
1592
1593 if (length > strLen / 2) {
1594 length = strLen / 2;
1595 }
1596 for (var i = 0; i < length; ++i) {
1597 var parsed = parseInt(string.substr(i * 2, 2), 16);
1598 if (isNaN(parsed)) return i;
1599 buf[offset + i] = parsed;
1600 }
1601 return i;
1602}
1603
1604function utf8Write(buf, string, offset, length) {
1605 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
1606}
1607
1608function asciiWrite(buf, string, offset, length) {
1609 return blitBuffer(asciiToBytes(string), buf, offset, length);
1610}
1611
1612function latin1Write(buf, string, offset, length) {
1613 return asciiWrite(buf, string, offset, length);
1614}
1615
1616function base64Write(buf, string, offset, length) {
1617 return blitBuffer(base64ToBytes(string), buf, offset, length);
1618}
1619
1620function ucs2Write(buf, string, offset, length) {
1621 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
1622}
1623
1624Buffer.prototype.write = function write(string, offset, length, encoding) {
1625 // Buffer#write(string)
1626 if (offset === undefined) {
1627 encoding = 'utf8';
1628 length = this.length;
1629 offset = 0;
1630 // Buffer#write(string, encoding)
1631 } else if (length === undefined && typeof offset === 'string') {
1632 encoding = offset;
1633 length = this.length;
1634 offset = 0;
1635 // Buffer#write(string, offset[, length][, encoding])
1636 } else if (isFinite(offset)) {
1637 offset = offset | 0;
1638 if (isFinite(length)) {
1639 length = length | 0;
1640 if (encoding === undefined) encoding = 'utf8';
1641 } else {
1642 encoding = length;
1643 length = undefined;
1644 }
1645 // legacy write(string, encoding, offset, length) - remove in v0.13
1646 } else {
1647 throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');
1648 }
1649
1650 var remaining = this.length - offset;
1651 if (length === undefined || length > remaining) length = remaining;
1652
1653 if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
1654 throw new RangeError('Attempt to write outside buffer bounds');
1655 }
1656
1657 if (!encoding) encoding = 'utf8';
1658
1659 var loweredCase = false;
1660 for (;;) {
1661 switch (encoding) {
1662 case 'hex':
1663 return hexWrite(this, string, offset, length);
1664
1665 case 'utf8':
1666 case 'utf-8':
1667 return utf8Write(this, string, offset, length);
1668
1669 case 'ascii':
1670 return asciiWrite(this, string, offset, length);
1671
1672 case 'latin1':
1673 case 'binary':
1674 return latin1Write(this, string, offset, length);
1675
1676 case 'base64':
1677 // Warning: maxLength not taken into account in base64Write
1678 return base64Write(this, string, offset, length);
1679
1680 case 'ucs2':
1681 case 'ucs-2':
1682 case 'utf16le':
1683 case 'utf-16le':
1684 return ucs2Write(this, string, offset, length);
1685
1686 default:
1687 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
1688 encoding = ('' + encoding).toLowerCase();
1689 loweredCase = true;
1690 }
1691 }
1692};
1693
1694Buffer.prototype.toJSON = function toJSON() {
1695 return {
1696 type: 'Buffer',
1697 data: Array.prototype.slice.call(this._arr || this, 0)
1698 };
1699};
1700
1701function base64Slice(buf, start, end) {
1702 if (start === 0 && end === buf.length) {
1703 return base64.fromByteArray(buf);
1704 } else {
1705 return base64.fromByteArray(buf.slice(start, end));
1706 }
1707}
1708
1709function utf8Slice(buf, start, end) {
1710 end = Math.min(buf.length, end);
1711 var res = [];
1712
1713 var i = start;
1714 while (i < end) {
1715 var firstByte = buf[i];
1716 var codePoint = null;
1717 var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;
1718
1719 if (i + bytesPerSequence <= end) {
1720 var secondByte, thirdByte, fourthByte, tempCodePoint;
1721
1722 switch (bytesPerSequence) {
1723 case 1:
1724 if (firstByte < 0x80) {
1725 codePoint = firstByte;
1726 }
1727 break;
1728 case 2:
1729 secondByte = buf[i + 1];
1730 if ((secondByte & 0xC0) === 0x80) {
1731 tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;
1732 if (tempCodePoint > 0x7F) {
1733 codePoint = tempCodePoint;
1734 }
1735 }
1736 break;
1737 case 3:
1738 secondByte = buf[i + 1];
1739 thirdByte = buf[i + 2];
1740 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
1741 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;
1742 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
1743 codePoint = tempCodePoint;
1744 }
1745 }
1746 break;
1747 case 4:
1748 secondByte = buf[i + 1];
1749 thirdByte = buf[i + 2];
1750 fourthByte = buf[i + 3];
1751 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
1752 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;
1753 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
1754 codePoint = tempCodePoint;
1755 }
1756 }
1757 }
1758 }
1759
1760 if (codePoint === null) {
1761 // we did not generate a valid codePoint so insert a
1762 // replacement char (U+FFFD) and advance only 1 byte
1763 codePoint = 0xFFFD;
1764 bytesPerSequence = 1;
1765 } else if (codePoint > 0xFFFF) {
1766 // encode to utf16 (surrogate pair dance)
1767 codePoint -= 0x10000;
1768 res.push(codePoint >>> 10 & 0x3FF | 0xD800);
1769 codePoint = 0xDC00 | codePoint & 0x3FF;
1770 }
1771
1772 res.push(codePoint);
1773 i += bytesPerSequence;
1774 }
1775
1776 return decodeCodePointsArray(res);
1777}
1778
1779// Based on http://stackoverflow.com/a/22747272/680742, the browser with
1780// the lowest limit is Chrome, with 0x10000 args.
1781// We go 1 magnitude less, for safety
1782var MAX_ARGUMENTS_LENGTH = 0x1000;
1783
1784function decodeCodePointsArray(codePoints) {
1785 var len = codePoints.length;
1786 if (len <= MAX_ARGUMENTS_LENGTH) {
1787 return String.fromCharCode.apply(String, codePoints); // avoid extra slice()
1788 }
1789
1790 // Decode in chunks to avoid "call stack size exceeded".
1791 var res = '';
1792 var i = 0;
1793 while (i < len) {
1794 res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
1795 }
1796 return res;
1797}
1798
1799function asciiSlice(buf, start, end) {
1800 var ret = '';
1801 end = Math.min(buf.length, end);
1802
1803 for (var i = start; i < end; ++i) {
1804 ret += String.fromCharCode(buf[i] & 0x7F);
1805 }
1806 return ret;
1807}
1808
1809function latin1Slice(buf, start, end) {
1810 var ret = '';
1811 end = Math.min(buf.length, end);
1812
1813 for (var i = start; i < end; ++i) {
1814 ret += String.fromCharCode(buf[i]);
1815 }
1816 return ret;
1817}
1818
1819function hexSlice(buf, start, end) {
1820 var len = buf.length;
1821
1822 if (!start || start < 0) start = 0;
1823 if (!end || end < 0 || end > len) end = len;
1824
1825 var out = '';
1826 for (var i = start; i < end; ++i) {
1827 out += toHex(buf[i]);
1828 }
1829 return out;
1830}
1831
1832function utf16leSlice(buf, start, end) {
1833 var bytes = buf.slice(start, end);
1834 var res = '';
1835 for (var i = 0; i < bytes.length; i += 2) {
1836 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
1837 }
1838 return res;
1839}
1840
1841Buffer.prototype.slice = function slice(start, end) {
1842 var len = this.length;
1843 start = ~~start;
1844 end = end === undefined ? len : ~~end;
1845
1846 if (start < 0) {
1847 start += len;
1848 if (start < 0) start = 0;
1849 } else if (start > len) {
1850 start = len;
1851 }
1852
1853 if (end < 0) {
1854 end += len;
1855 if (end < 0) end = 0;
1856 } else if (end > len) {
1857 end = len;
1858 }
1859
1860 if (end < start) end = start;
1861
1862 var newBuf;
1863 if (Buffer.TYPED_ARRAY_SUPPORT) {
1864 newBuf = this.subarray(start, end);
1865 newBuf.__proto__ = Buffer.prototype;
1866 } else {
1867 var sliceLen = end - start;
1868 newBuf = new Buffer(sliceLen, undefined);
1869 for (var i = 0; i < sliceLen; ++i) {
1870 newBuf[i] = this[i + start];
1871 }
1872 }
1873
1874 return newBuf;
1875};
1876
1877/*
1878 * Need to make sure that buffer isn't trying to write out of bounds.
1879 */
1880function checkOffset(offset, ext, length) {
1881 if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');
1882 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');
1883}
1884
1885Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
1886 offset = offset | 0;
1887 byteLength = byteLength | 0;
1888 if (!noAssert) checkOffset(offset, byteLength, this.length);
1889
1890 var val = this[offset];
1891 var mul = 1;
1892 var i = 0;
1893 while (++i < byteLength && (mul *= 0x100)) {
1894 val += this[offset + i] * mul;
1895 }
1896
1897 return val;
1898};
1899
1900Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
1901 offset = offset | 0;
1902 byteLength = byteLength | 0;
1903 if (!noAssert) {
1904 checkOffset(offset, byteLength, this.length);
1905 }
1906
1907 var val = this[offset + --byteLength];
1908 var mul = 1;
1909 while (byteLength > 0 && (mul *= 0x100)) {
1910 val += this[offset + --byteLength] * mul;
1911 }
1912
1913 return val;
1914};
1915
1916Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
1917 if (!noAssert) checkOffset(offset, 1, this.length);
1918 return this[offset];
1919};
1920
1921Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
1922 if (!noAssert) checkOffset(offset, 2, this.length);
1923 return this[offset] | this[offset + 1] << 8;
1924};
1925
1926Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
1927 if (!noAssert) checkOffset(offset, 2, this.length);
1928 return this[offset] << 8 | this[offset + 1];
1929};
1930
1931Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
1932 if (!noAssert) checkOffset(offset, 4, this.length);
1933
1934 return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;
1935};
1936
1937Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
1938 if (!noAssert) checkOffset(offset, 4, this.length);
1939
1940 return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
1941};
1942
1943Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
1944 offset = offset | 0;
1945 byteLength = byteLength | 0;
1946 if (!noAssert) checkOffset(offset, byteLength, this.length);
1947
1948 var val = this[offset];
1949 var mul = 1;
1950 var i = 0;
1951 while (++i < byteLength && (mul *= 0x100)) {
1952 val += this[offset + i] * mul;
1953 }
1954 mul *= 0x80;
1955
1956 if (val >= mul) val -= Math.pow(2, 8 * byteLength);
1957
1958 return val;
1959};
1960
1961Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
1962 offset = offset | 0;
1963 byteLength = byteLength | 0;
1964 if (!noAssert) checkOffset(offset, byteLength, this.length);
1965
1966 var i = byteLength;
1967 var mul = 1;
1968 var val = this[offset + --i];
1969 while (i > 0 && (mul *= 0x100)) {
1970 val += this[offset + --i] * mul;
1971 }
1972 mul *= 0x80;
1973
1974 if (val >= mul) val -= Math.pow(2, 8 * byteLength);
1975
1976 return val;
1977};
1978
1979Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
1980 if (!noAssert) checkOffset(offset, 1, this.length);
1981 if (!(this[offset] & 0x80)) return this[offset];
1982 return (0xff - this[offset] + 1) * -1;
1983};
1984
1985Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
1986 if (!noAssert) checkOffset(offset, 2, this.length);
1987 var val = this[offset] | this[offset + 1] << 8;
1988 return val & 0x8000 ? val | 0xFFFF0000 : val;
1989};
1990
1991Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
1992 if (!noAssert) checkOffset(offset, 2, this.length);
1993 var val = this[offset + 1] | this[offset] << 8;
1994 return val & 0x8000 ? val | 0xFFFF0000 : val;
1995};
1996
1997Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
1998 if (!noAssert) checkOffset(offset, 4, this.length);
1999
2000 return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
2001};
2002
2003Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
2004 if (!noAssert) checkOffset(offset, 4, this.length);
2005
2006 return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
2007};
2008
2009Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
2010 if (!noAssert) checkOffset(offset, 4, this.length);
2011 return ieee754.read(this, offset, true, 23, 4);
2012};
2013
2014Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
2015 if (!noAssert) checkOffset(offset, 4, this.length);
2016 return ieee754.read(this, offset, false, 23, 4);
2017};
2018
2019Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
2020 if (!noAssert) checkOffset(offset, 8, this.length);
2021 return ieee754.read(this, offset, true, 52, 8);
2022};
2023
2024Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
2025 if (!noAssert) checkOffset(offset, 8, this.length);
2026 return ieee754.read(this, offset, false, 52, 8);
2027};
2028
2029function checkInt(buf, value, offset, ext, max, min) {
2030 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
2031 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
2032 if (offset + ext > buf.length) throw new RangeError('Index out of range');
2033}
2034
2035Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
2036 value = +value;
2037 offset = offset | 0;
2038 byteLength = byteLength | 0;
2039 if (!noAssert) {
2040 var maxBytes = Math.pow(2, 8 * byteLength) - 1;
2041 checkInt(this, value, offset, byteLength, maxBytes, 0);
2042 }
2043
2044 var mul = 1;
2045 var i = 0;
2046 this[offset] = value & 0xFF;
2047 while (++i < byteLength && (mul *= 0x100)) {
2048 this[offset + i] = value / mul & 0xFF;
2049 }
2050
2051 return offset + byteLength;
2052};
2053
2054Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
2055 value = +value;
2056 offset = offset | 0;
2057 byteLength = byteLength | 0;
2058 if (!noAssert) {
2059 var maxBytes = Math.pow(2, 8 * byteLength) - 1;
2060 checkInt(this, value, offset, byteLength, maxBytes, 0);
2061 }
2062
2063 var i = byteLength - 1;
2064 var mul = 1;
2065 this[offset + i] = value & 0xFF;
2066 while (--i >= 0 && (mul *= 0x100)) {
2067 this[offset + i] = value / mul & 0xFF;
2068 }
2069
2070 return offset + byteLength;
2071};
2072
2073Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
2074 value = +value;
2075 offset = offset | 0;
2076 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
2077 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
2078 this[offset] = value & 0xff;
2079 return offset + 1;
2080};
2081
2082function objectWriteUInt16(buf, value, offset, littleEndian) {
2083 if (value < 0) value = 0xffff + value + 1;
2084 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
2085 buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;
2086 }
2087}
2088
2089Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
2090 value = +value;
2091 offset = offset | 0;
2092 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
2093 if (Buffer.TYPED_ARRAY_SUPPORT) {
2094 this[offset] = value & 0xff;
2095 this[offset + 1] = value >>> 8;
2096 } else {
2097 objectWriteUInt16(this, value, offset, true);
2098 }
2099 return offset + 2;
2100};
2101
2102Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
2103 value = +value;
2104 offset = offset | 0;
2105 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
2106 if (Buffer.TYPED_ARRAY_SUPPORT) {
2107 this[offset] = value >>> 8;
2108 this[offset + 1] = value & 0xff;
2109 } else {
2110 objectWriteUInt16(this, value, offset, false);
2111 }
2112 return offset + 2;
2113};
2114
2115function objectWriteUInt32(buf, value, offset, littleEndian) {
2116 if (value < 0) value = 0xffffffff + value + 1;
2117 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
2118 buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff;
2119 }
2120}
2121
2122Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
2123 value = +value;
2124 offset = offset | 0;
2125 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
2126 if (Buffer.TYPED_ARRAY_SUPPORT) {
2127 this[offset + 3] = value >>> 24;
2128 this[offset + 2] = value >>> 16;
2129 this[offset + 1] = value >>> 8;
2130 this[offset] = value & 0xff;
2131 } else {
2132 objectWriteUInt32(this, value, offset, true);
2133 }
2134 return offset + 4;
2135};
2136
2137Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
2138 value = +value;
2139 offset = offset | 0;
2140 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
2141 if (Buffer.TYPED_ARRAY_SUPPORT) {
2142 this[offset] = value >>> 24;
2143 this[offset + 1] = value >>> 16;
2144 this[offset + 2] = value >>> 8;
2145 this[offset + 3] = value & 0xff;
2146 } else {
2147 objectWriteUInt32(this, value, offset, false);
2148 }
2149 return offset + 4;
2150};
2151
2152Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
2153 value = +value;
2154 offset = offset | 0;
2155 if (!noAssert) {
2156 var limit = Math.pow(2, 8 * byteLength - 1);
2157
2158 checkInt(this, value, offset, byteLength, limit - 1, -limit);
2159 }
2160
2161 var i = 0;
2162 var mul = 1;
2163 var sub = 0;
2164 this[offset] = value & 0xFF;
2165 while (++i < byteLength && (mul *= 0x100)) {
2166 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
2167 sub = 1;
2168 }
2169 this[offset + i] = (value / mul >> 0) - sub & 0xFF;
2170 }
2171
2172 return offset + byteLength;
2173};
2174
2175Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
2176 value = +value;
2177 offset = offset | 0;
2178 if (!noAssert) {
2179 var limit = Math.pow(2, 8 * byteLength - 1);
2180
2181 checkInt(this, value, offset, byteLength, limit - 1, -limit);
2182 }
2183
2184 var i = byteLength - 1;
2185 var mul = 1;
2186 var sub = 0;
2187 this[offset + i] = value & 0xFF;
2188 while (--i >= 0 && (mul *= 0x100)) {
2189 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
2190 sub = 1;
2191 }
2192 this[offset + i] = (value / mul >> 0) - sub & 0xFF;
2193 }
2194
2195 return offset + byteLength;
2196};
2197
2198Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
2199 value = +value;
2200 offset = offset | 0;
2201 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
2202 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
2203 if (value < 0) value = 0xff + value + 1;
2204 this[offset] = value & 0xff;
2205 return offset + 1;
2206};
2207
2208Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
2209 value = +value;
2210 offset = offset | 0;
2211 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
2212 if (Buffer.TYPED_ARRAY_SUPPORT) {
2213 this[offset] = value & 0xff;
2214 this[offset + 1] = value >>> 8;
2215 } else {
2216 objectWriteUInt16(this, value, offset, true);
2217 }
2218 return offset + 2;
2219};
2220
2221Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
2222 value = +value;
2223 offset = offset | 0;
2224 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
2225 if (Buffer.TYPED_ARRAY_SUPPORT) {
2226 this[offset] = value >>> 8;
2227 this[offset + 1] = value & 0xff;
2228 } else {
2229 objectWriteUInt16(this, value, offset, false);
2230 }
2231 return offset + 2;
2232};
2233
2234Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
2235 value = +value;
2236 offset = offset | 0;
2237 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
2238 if (Buffer.TYPED_ARRAY_SUPPORT) {
2239 this[offset] = value & 0xff;
2240 this[offset + 1] = value >>> 8;
2241 this[offset + 2] = value >>> 16;
2242 this[offset + 3] = value >>> 24;
2243 } else {
2244 objectWriteUInt32(this, value, offset, true);
2245 }
2246 return offset + 4;
2247};
2248
2249Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
2250 value = +value;
2251 offset = offset | 0;
2252 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
2253 if (value < 0) value = 0xffffffff + value + 1;
2254 if (Buffer.TYPED_ARRAY_SUPPORT) {
2255 this[offset] = value >>> 24;
2256 this[offset + 1] = value >>> 16;
2257 this[offset + 2] = value >>> 8;
2258 this[offset + 3] = value & 0xff;
2259 } else {
2260 objectWriteUInt32(this, value, offset, false);
2261 }
2262 return offset + 4;
2263};
2264
2265function checkIEEE754(buf, value, offset, ext, max, min) {
2266 if (offset + ext > buf.length) throw new RangeError('Index out of range');
2267 if (offset < 0) throw new RangeError('Index out of range');
2268}
2269
2270function writeFloat(buf, value, offset, littleEndian, noAssert) {
2271 if (!noAssert) {
2272 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38);
2273 }
2274 ieee754.write(buf, value, offset, littleEndian, 23, 4);
2275 return offset + 4;
2276}
2277
2278Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
2279 return writeFloat(this, value, offset, true, noAssert);
2280};
2281
2282Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
2283 return writeFloat(this, value, offset, false, noAssert);
2284};
2285
2286function writeDouble(buf, value, offset, littleEndian, noAssert) {
2287 if (!noAssert) {
2288 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308);
2289 }
2290 ieee754.write(buf, value, offset, littleEndian, 52, 8);
2291 return offset + 8;
2292}
2293
2294Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
2295 return writeDouble(this, value, offset, true, noAssert);
2296};
2297
2298Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
2299 return writeDouble(this, value, offset, false, noAssert);
2300};
2301
2302// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
2303Buffer.prototype.copy = function copy(target, targetStart, start, end) {
2304 if (!start) start = 0;
2305 if (!end && end !== 0) end = this.length;
2306 if (targetStart >= target.length) targetStart = target.length;
2307 if (!targetStart) targetStart = 0;
2308 if (end > 0 && end < start) end = start;
2309
2310 // Copy 0 bytes; we're done
2311 if (end === start) return 0;
2312 if (target.length === 0 || this.length === 0) return 0;
2313
2314 // Fatal error conditions
2315 if (targetStart < 0) {
2316 throw new RangeError('targetStart out of bounds');
2317 }
2318 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds');
2319 if (end < 0) throw new RangeError('sourceEnd out of bounds');
2320
2321 // Are we oob?
2322 if (end > this.length) end = this.length;
2323 if (target.length - targetStart < end - start) {
2324 end = target.length - targetStart + start;
2325 }
2326
2327 var len = end - start;
2328 var i;
2329
2330 if (this === target && start < targetStart && targetStart < end) {
2331 // descending copy from end
2332 for (i = len - 1; i >= 0; --i) {
2333 target[i + targetStart] = this[i + start];
2334 }
2335 } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
2336 // ascending copy from start
2337 for (i = 0; i < len; ++i) {
2338 target[i + targetStart] = this[i + start];
2339 }
2340 } else {
2341 Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);
2342 }
2343
2344 return len;
2345};
2346
2347// Usage:
2348// buffer.fill(number[, offset[, end]])
2349// buffer.fill(buffer[, offset[, end]])
2350// buffer.fill(string[, offset[, end]][, encoding])
2351Buffer.prototype.fill = function fill(val, start, end, encoding) {
2352 // Handle string cases:
2353 if (typeof val === 'string') {
2354 if (typeof start === 'string') {
2355 encoding = start;
2356 start = 0;
2357 end = this.length;
2358 } else if (typeof end === 'string') {
2359 encoding = end;
2360 end = this.length;
2361 }
2362 if (val.length === 1) {
2363 var code = val.charCodeAt(0);
2364 if (code < 256) {
2365 val = code;
2366 }
2367 }
2368 if (encoding !== undefined && typeof encoding !== 'string') {
2369 throw new TypeError('encoding must be a string');
2370 }
2371 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
2372 throw new TypeError('Unknown encoding: ' + encoding);
2373 }
2374 } else if (typeof val === 'number') {
2375 val = val & 255;
2376 }
2377
2378 // Invalid ranges are not set to a default, so can range check early.
2379 if (start < 0 || this.length < start || this.length < end) {
2380 throw new RangeError('Out of range index');
2381 }
2382
2383 if (end <= start) {
2384 return this;
2385 }
2386
2387 start = start >>> 0;
2388 end = end === undefined ? this.length : end >>> 0;
2389
2390 if (!val) val = 0;
2391
2392 var i;
2393 if (typeof val === 'number') {
2394 for (i = start; i < end; ++i) {
2395 this[i] = val;
2396 }
2397 } else {
2398 var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString());
2399 var len = bytes.length;
2400 for (i = 0; i < end - start; ++i) {
2401 this[i + start] = bytes[i % len];
2402 }
2403 }
2404
2405 return this;
2406};
2407
2408// HELPER FUNCTIONS
2409// ================
2410
2411var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
2412
2413function base64clean(str) {
2414 // Node strips out invalid characters like \n and \t from the string, base64-js does not
2415 str = stringtrim(str).replace(INVALID_BASE64_RE, '');
2416 // Node converts strings with length < 2 to ''
2417 if (str.length < 2) return '';
2418 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
2419 while (str.length % 4 !== 0) {
2420 str = str + '=';
2421 }
2422 return str;
2423}
2424
2425function stringtrim(str) {
2426 if (str.trim) return str.trim();
2427 return str.replace(/^\s+|\s+$/g, '');
2428}
2429
2430function toHex(n) {
2431 if (n < 16) return '0' + n.toString(16);
2432 return n.toString(16);
2433}
2434
2435function utf8ToBytes(string, units) {
2436 units = units || Infinity;
2437 var codePoint;
2438 var length = string.length;
2439 var leadSurrogate = null;
2440 var bytes = [];
2441
2442 for (var i = 0; i < length; ++i) {
2443 codePoint = string.charCodeAt(i);
2444
2445 // is surrogate component
2446 if (codePoint > 0xD7FF && codePoint < 0xE000) {
2447 // last char was a lead
2448 if (!leadSurrogate) {
2449 // no lead yet
2450 if (codePoint > 0xDBFF) {
2451 // unexpected trail
2452 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
2453 continue;
2454 } else if (i + 1 === length) {
2455 // unpaired lead
2456 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
2457 continue;
2458 }
2459
2460 // valid lead
2461 leadSurrogate = codePoint;
2462
2463 continue;
2464 }
2465
2466 // 2 leads in a row
2467 if (codePoint < 0xDC00) {
2468 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
2469 leadSurrogate = codePoint;
2470 continue;
2471 }
2472
2473 // valid surrogate pair
2474 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
2475 } else if (leadSurrogate) {
2476 // valid bmp char, but last char was a lead
2477 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
2478 }
2479
2480 leadSurrogate = null;
2481
2482 // encode utf8
2483 if (codePoint < 0x80) {
2484 if ((units -= 1) < 0) break;
2485 bytes.push(codePoint);
2486 } else if (codePoint < 0x800) {
2487 if ((units -= 2) < 0) break;
2488 bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);
2489 } else if (codePoint < 0x10000) {
2490 if ((units -= 3) < 0) break;
2491 bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
2492 } else if (codePoint < 0x110000) {
2493 if ((units -= 4) < 0) break;
2494 bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
2495 } else {
2496 throw new Error('Invalid code point');
2497 }
2498 }
2499
2500 return bytes;
2501}
2502
2503function asciiToBytes(str) {
2504 var byteArray = [];
2505 for (var i = 0; i < str.length; ++i) {
2506 // Node's code seems to be doing this and not & 0x7F..
2507 byteArray.push(str.charCodeAt(i) & 0xFF);
2508 }
2509 return byteArray;
2510}
2511
2512function utf16leToBytes(str, units) {
2513 var c, hi, lo;
2514 var byteArray = [];
2515 for (var i = 0; i < str.length; ++i) {
2516 if ((units -= 2) < 0) break;
2517
2518 c = str.charCodeAt(i);
2519 hi = c >> 8;
2520 lo = c % 256;
2521 byteArray.push(lo);
2522 byteArray.push(hi);
2523 }
2524
2525 return byteArray;
2526}
2527
2528function base64ToBytes(str) {
2529 return base64.toByteArray(base64clean(str));
2530}
2531
2532function blitBuffer(src, dst, offset, length) {
2533 for (var i = 0; i < length; ++i) {
2534 if (i + offset >= dst.length || i >= src.length) break;
2535 dst[i + offset] = src[i];
2536 }
2537 return i;
2538}
2539
2540function isnan(val) {
2541 return val !== val; // eslint-disable-line no-self-compare
2542}
2543/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
2544
2545/***/ }),
2546/* 6 */
2547/***/ (function(module, exports, __webpack_require__) {
2548
2549"use strict";
2550
2551
2552// shim for using process in browser
2553var process = module.exports = {};
2554
2555// cached from whatever global is present so that test runners that stub it
2556// don't break things. But we need to wrap it in a try catch in case it is
2557// wrapped in strict mode code which doesn't define any globals. It's inside a
2558// function because try/catches deoptimize in certain engines.
2559
2560var cachedSetTimeout;
2561var cachedClearTimeout;
2562
2563function defaultSetTimout() {
2564 throw new Error('setTimeout has not been defined');
2565}
2566function defaultClearTimeout() {
2567 throw new Error('clearTimeout has not been defined');
2568}
2569(function () {
2570 try {
2571 if (typeof setTimeout === 'function') {
2572 cachedSetTimeout = setTimeout;
2573 } else {
2574 cachedSetTimeout = defaultSetTimout;
2575 }
2576 } catch (e) {
2577 cachedSetTimeout = defaultSetTimout;
2578 }
2579 try {
2580 if (typeof clearTimeout === 'function') {
2581 cachedClearTimeout = clearTimeout;
2582 } else {
2583 cachedClearTimeout = defaultClearTimeout;
2584 }
2585 } catch (e) {
2586 cachedClearTimeout = defaultClearTimeout;
2587 }
2588})();
2589function runTimeout(fun) {
2590 if (cachedSetTimeout === setTimeout) {
2591 //normal enviroments in sane situations
2592 return setTimeout(fun, 0);
2593 }
2594 // if setTimeout wasn't available but was latter defined
2595 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
2596 cachedSetTimeout = setTimeout;
2597 return setTimeout(fun, 0);
2598 }
2599 try {
2600 // when when somebody has screwed with setTimeout but no I.E. maddness
2601 return cachedSetTimeout(fun, 0);
2602 } catch (e) {
2603 try {
2604 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
2605 return cachedSetTimeout.call(null, fun, 0);
2606 } catch (e) {
2607 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
2608 return cachedSetTimeout.call(this, fun, 0);
2609 }
2610 }
2611}
2612function runClearTimeout(marker) {
2613 if (cachedClearTimeout === clearTimeout) {
2614 //normal enviroments in sane situations
2615 return clearTimeout(marker);
2616 }
2617 // if clearTimeout wasn't available but was latter defined
2618 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
2619 cachedClearTimeout = clearTimeout;
2620 return clearTimeout(marker);
2621 }
2622 try {
2623 // when when somebody has screwed with setTimeout but no I.E. maddness
2624 return cachedClearTimeout(marker);
2625 } catch (e) {
2626 try {
2627 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
2628 return cachedClearTimeout.call(null, marker);
2629 } catch (e) {
2630 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
2631 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
2632 return cachedClearTimeout.call(this, marker);
2633 }
2634 }
2635}
2636var queue = [];
2637var draining = false;
2638var currentQueue;
2639var queueIndex = -1;
2640
2641function cleanUpNextTick() {
2642 if (!draining || !currentQueue) {
2643 return;
2644 }
2645 draining = false;
2646 if (currentQueue.length) {
2647 queue = currentQueue.concat(queue);
2648 } else {
2649 queueIndex = -1;
2650 }
2651 if (queue.length) {
2652 drainQueue();
2653 }
2654}
2655
2656function drainQueue() {
2657 if (draining) {
2658 return;
2659 }
2660 var timeout = runTimeout(cleanUpNextTick);
2661 draining = true;
2662
2663 var len = queue.length;
2664 while (len) {
2665 currentQueue = queue;
2666 queue = [];
2667 while (++queueIndex < len) {
2668 if (currentQueue) {
2669 currentQueue[queueIndex].run();
2670 }
2671 }
2672 queueIndex = -1;
2673 len = queue.length;
2674 }
2675 currentQueue = null;
2676 draining = false;
2677 runClearTimeout(timeout);
2678}
2679
2680process.nextTick = function (fun) {
2681 var args = new Array(arguments.length - 1);
2682 if (arguments.length > 1) {
2683 for (var i = 1; i < arguments.length; i++) {
2684 args[i - 1] = arguments[i];
2685 }
2686 }
2687 queue.push(new Item(fun, args));
2688 if (queue.length === 1 && !draining) {
2689 runTimeout(drainQueue);
2690 }
2691};
2692
2693// v8 likes predictible objects
2694function Item(fun, array) {
2695 this.fun = fun;
2696 this.array = array;
2697}
2698Item.prototype.run = function () {
2699 this.fun.apply(null, this.array);
2700};
2701process.title = 'browser';
2702process.browser = true;
2703process.env = {};
2704process.argv = [];
2705process.version = ''; // empty string to avoid regexp issues
2706process.versions = {};
2707
2708function noop() {}
2709
2710process.on = noop;
2711process.addListener = noop;
2712process.once = noop;
2713process.off = noop;
2714process.removeListener = noop;
2715process.removeAllListeners = noop;
2716process.emit = noop;
2717process.prependListener = noop;
2718process.prependOnceListener = noop;
2719
2720process.listeners = function (name) {
2721 return [];
2722};
2723
2724process.binding = function (name) {
2725 throw new Error('process.binding is not supported');
2726};
2727
2728process.cwd = function () {
2729 return '/';
2730};
2731process.chdir = function (dir) {
2732 throw new Error('process.chdir is not supported');
2733};
2734process.umask = function () {
2735 return 0;
2736};
2737
2738/***/ }),
2739/* 7 */
2740/***/ (function(module, exports, __webpack_require__) {
2741
2742"use strict";
2743
2744
2745exports = module.exports = __webpack_require__(33);
2746exports.Stream = exports;
2747exports.Readable = exports;
2748exports.Writable = __webpack_require__(24);
2749exports.Duplex = __webpack_require__(4);
2750exports.Transform = __webpack_require__(37);
2751exports.PassThrough = __webpack_require__(57);
2752
2753/***/ }),
2754/* 8 */
2755/***/ (function(module, exports, __webpack_require__) {
2756
2757"use strict";
2758/* WEBPACK VAR INJECTION */(function(Buffer) {
2759
2760var _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; };
2761
2762// Copyright Joyent, Inc. and other Node contributors.
2763//
2764// Permission is hereby granted, free of charge, to any person obtaining a
2765// copy of this software and associated documentation files (the
2766// "Software"), to deal in the Software without restriction, including
2767// without limitation the rights to use, copy, modify, merge, publish,
2768// distribute, sublicense, and/or sell copies of the Software, and to permit
2769// persons to whom the Software is furnished to do so, subject to the
2770// following conditions:
2771//
2772// The above copyright notice and this permission notice shall be included
2773// in all copies or substantial portions of the Software.
2774//
2775// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2776// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2777// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2778// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2779// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2780// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2781// USE OR OTHER DEALINGS IN THE SOFTWARE.
2782
2783// NOTE: These type checking functions intentionally don't use `instanceof`
2784// because it is fragile and can be easily faked with `Object.create()`.
2785
2786function isArray(arg) {
2787 if (Array.isArray) {
2788 return Array.isArray(arg);
2789 }
2790 return objectToString(arg) === '[object Array]';
2791}
2792exports.isArray = isArray;
2793
2794function isBoolean(arg) {
2795 return typeof arg === 'boolean';
2796}
2797exports.isBoolean = isBoolean;
2798
2799function isNull(arg) {
2800 return arg === null;
2801}
2802exports.isNull = isNull;
2803
2804function isNullOrUndefined(arg) {
2805 return arg == null;
2806}
2807exports.isNullOrUndefined = isNullOrUndefined;
2808
2809function isNumber(arg) {
2810 return typeof arg === 'number';
2811}
2812exports.isNumber = isNumber;
2813
2814function isString(arg) {
2815 return typeof arg === 'string';
2816}
2817exports.isString = isString;
2818
2819function isSymbol(arg) {
2820 return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'symbol';
2821}
2822exports.isSymbol = isSymbol;
2823
2824function isUndefined(arg) {
2825 return arg === void 0;
2826}
2827exports.isUndefined = isUndefined;
2828
2829function isRegExp(re) {
2830 return objectToString(re) === '[object RegExp]';
2831}
2832exports.isRegExp = isRegExp;
2833
2834function isObject(arg) {
2835 return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && arg !== null;
2836}
2837exports.isObject = isObject;
2838
2839function isDate(d) {
2840 return objectToString(d) === '[object Date]';
2841}
2842exports.isDate = isDate;
2843
2844function isError(e) {
2845 return objectToString(e) === '[object Error]' || e instanceof Error;
2846}
2847exports.isError = isError;
2848
2849function isFunction(arg) {
2850 return typeof arg === 'function';
2851}
2852exports.isFunction = isFunction;
2853
2854function isPrimitive(arg) {
2855 return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'symbol' || // ES6 symbol
2856 typeof arg === 'undefined';
2857}
2858exports.isPrimitive = isPrimitive;
2859
2860exports.isBuffer = Buffer.isBuffer;
2861
2862function objectToString(o) {
2863 return Object.prototype.toString.call(o);
2864}
2865/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5).Buffer))
2866
2867/***/ }),
2868/* 9 */
2869/***/ (function(module, exports, __webpack_require__) {
2870
2871"use strict";
2872/* WEBPACK VAR INJECTION */(function(process) {
2873
2874if (!process.version || process.version.indexOf('v0.') === 0 || process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
2875 module.exports = { nextTick: nextTick };
2876} else {
2877 module.exports = process;
2878}
2879
2880function nextTick(fn, arg1, arg2, arg3) {
2881 if (typeof fn !== 'function') {
2882 throw new TypeError('"callback" argument must be a function');
2883 }
2884 var len = arguments.length;
2885 var args, i;
2886 switch (len) {
2887 case 0:
2888 case 1:
2889 return process.nextTick(fn);
2890 case 2:
2891 return process.nextTick(function afterTickOne() {
2892 fn.call(null, arg1);
2893 });
2894 case 3:
2895 return process.nextTick(function afterTickTwo() {
2896 fn.call(null, arg1, arg2);
2897 });
2898 case 4:
2899 return process.nextTick(function afterTickThree() {
2900 fn.call(null, arg1, arg2, arg3);
2901 });
2902 default:
2903 args = new Array(len - 1);
2904 i = 0;
2905 while (i < args.length) {
2906 args[i++] = arguments[i];
2907 }
2908 return process.nextTick(function afterTick() {
2909 fn.apply(null, args);
2910 });
2911 }
2912}
2913/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
2914
2915/***/ }),
2916/* 10 */
2917/***/ (function(module, exports, __webpack_require__) {
2918
2919"use strict";
2920
2921
2922var _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; };
2923
2924// Copyright Joyent, Inc. and other Node contributors.
2925//
2926// Permission is hereby granted, free of charge, to any person obtaining a
2927// copy of this software and associated documentation files (the
2928// "Software"), to deal in the Software without restriction, including
2929// without limitation the rights to use, copy, modify, merge, publish,
2930// distribute, sublicense, and/or sell copies of the Software, and to permit
2931// persons to whom the Software is furnished to do so, subject to the
2932// following conditions:
2933//
2934// The above copyright notice and this permission notice shall be included
2935// in all copies or substantial portions of the Software.
2936//
2937// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2938// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2939// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2940// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2941// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2942// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2943// USE OR OTHER DEALINGS IN THE SOFTWARE.
2944
2945function EventEmitter() {
2946 this._events = this._events || {};
2947 this._maxListeners = this._maxListeners || undefined;
2948}
2949module.exports = EventEmitter;
2950
2951// Backwards-compat with node 0.10.x
2952EventEmitter.EventEmitter = EventEmitter;
2953
2954EventEmitter.prototype._events = undefined;
2955EventEmitter.prototype._maxListeners = undefined;
2956
2957// By default EventEmitters will print a warning if more than 10 listeners are
2958// added to it. This is a useful default which helps finding memory leaks.
2959EventEmitter.defaultMaxListeners = 10;
2960
2961// Obviously not all Emitters should be limited to 10. This function allows
2962// that to be increased. Set to zero for unlimited.
2963EventEmitter.prototype.setMaxListeners = function (n) {
2964 if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number');
2965 this._maxListeners = n;
2966 return this;
2967};
2968
2969EventEmitter.prototype.emit = function (type) {
2970 var er, handler, len, args, i, listeners;
2971
2972 if (!this._events) this._events = {};
2973
2974 // If there is no 'error' event listener then throw.
2975 if (type === 'error') {
2976 if (!this._events.error || isObject(this._events.error) && !this._events.error.length) {
2977 er = arguments[1];
2978 if (er instanceof Error) {
2979 throw er; // Unhandled 'error' event
2980 } else {
2981 // At least give some kind of context to the user
2982 var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
2983 err.context = er;
2984 throw err;
2985 }
2986 }
2987 }
2988
2989 handler = this._events[type];
2990
2991 if (isUndefined(handler)) return false;
2992
2993 if (isFunction(handler)) {
2994 switch (arguments.length) {
2995 // fast cases
2996 case 1:
2997 handler.call(this);
2998 break;
2999 case 2:
3000 handler.call(this, arguments[1]);
3001 break;
3002 case 3:
3003 handler.call(this, arguments[1], arguments[2]);
3004 break;
3005 // slower
3006 default:
3007 args = Array.prototype.slice.call(arguments, 1);
3008 handler.apply(this, args);
3009 }
3010 } else if (isObject(handler)) {
3011 args = Array.prototype.slice.call(arguments, 1);
3012 listeners = handler.slice();
3013 len = listeners.length;
3014 for (i = 0; i < len; i++) {
3015 listeners[i].apply(this, args);
3016 }
3017 }
3018
3019 return true;
3020};
3021
3022EventEmitter.prototype.addListener = function (type, listener) {
3023 var m;
3024
3025 if (!isFunction(listener)) throw TypeError('listener must be a function');
3026
3027 if (!this._events) this._events = {};
3028
3029 // To avoid recursion in the case that type === "newListener"! Before
3030 // adding it to the listeners, first emit "newListener".
3031 if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener);
3032
3033 if (!this._events[type])
3034 // Optimize the case of one listener. Don't need the extra array object.
3035 this._events[type] = listener;else if (isObject(this._events[type]))
3036 // If we've already got an array, just append.
3037 this._events[type].push(listener);else
3038 // Adding the second element, need to change to array.
3039 this._events[type] = [this._events[type], listener];
3040
3041 // Check for listener leak
3042 if (isObject(this._events[type]) && !this._events[type].warned) {
3043 if (!isUndefined(this._maxListeners)) {
3044 m = this._maxListeners;
3045 } else {
3046 m = EventEmitter.defaultMaxListeners;
3047 }
3048
3049 if (m && m > 0 && this._events[type].length > m) {
3050 this._events[type].warned = true;
3051 console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length);
3052 if (typeof console.trace === 'function') {
3053 // not supported in IE 10
3054 console.trace();
3055 }
3056 }
3057 }
3058
3059 return this;
3060};
3061
3062EventEmitter.prototype.on = EventEmitter.prototype.addListener;
3063
3064EventEmitter.prototype.once = function (type, listener) {
3065 if (!isFunction(listener)) throw TypeError('listener must be a function');
3066
3067 var fired = false;
3068
3069 function g() {
3070 this.removeListener(type, g);
3071
3072 if (!fired) {
3073 fired = true;
3074 listener.apply(this, arguments);
3075 }
3076 }
3077
3078 g.listener = listener;
3079 this.on(type, g);
3080
3081 return this;
3082};
3083
3084// emits a 'removeListener' event iff the listener was removed
3085EventEmitter.prototype.removeListener = function (type, listener) {
3086 var list, position, length, i;
3087
3088 if (!isFunction(listener)) throw TypeError('listener must be a function');
3089
3090 if (!this._events || !this._events[type]) return this;
3091
3092 list = this._events[type];
3093 length = list.length;
3094 position = -1;
3095
3096 if (list === listener || isFunction(list.listener) && list.listener === listener) {
3097 delete this._events[type];
3098 if (this._events.removeListener) this.emit('removeListener', type, listener);
3099 } else if (isObject(list)) {
3100 for (i = length; i-- > 0;) {
3101 if (list[i] === listener || list[i].listener && list[i].listener === listener) {
3102 position = i;
3103 break;
3104 }
3105 }
3106
3107 if (position < 0) return this;
3108
3109 if (list.length === 1) {
3110 list.length = 0;
3111 delete this._events[type];
3112 } else {
3113 list.splice(position, 1);
3114 }
3115
3116 if (this._events.removeListener) this.emit('removeListener', type, listener);
3117 }
3118
3119 return this;
3120};
3121
3122EventEmitter.prototype.removeAllListeners = function (type) {
3123 var key, listeners;
3124
3125 if (!this._events) return this;
3126
3127 // not listening for removeListener, no need to emit
3128 if (!this._events.removeListener) {
3129 if (arguments.length === 0) this._events = {};else if (this._events[type]) delete this._events[type];
3130 return this;
3131 }
3132
3133 // emit removeListener for all listeners on all events
3134 if (arguments.length === 0) {
3135 for (key in this._events) {
3136 if (key === 'removeListener') continue;
3137 this.removeAllListeners(key);
3138 }
3139 this.removeAllListeners('removeListener');
3140 this._events = {};
3141 return this;
3142 }
3143
3144 listeners = this._events[type];
3145
3146 if (isFunction(listeners)) {
3147 this.removeListener(type, listeners);
3148 } else if (listeners) {
3149 // LIFO order
3150 while (listeners.length) {
3151 this.removeListener(type, listeners[listeners.length - 1]);
3152 }
3153 }
3154 delete this._events[type];
3155
3156 return this;
3157};
3158
3159EventEmitter.prototype.listeners = function (type) {
3160 var ret;
3161 if (!this._events || !this._events[type]) ret = [];else if (isFunction(this._events[type])) ret = [this._events[type]];else ret = this._events[type].slice();
3162 return ret;
3163};
3164
3165EventEmitter.prototype.listenerCount = function (type) {
3166 if (this._events) {
3167 var evlistener = this._events[type];
3168
3169 if (isFunction(evlistener)) return 1;else if (evlistener) return evlistener.length;
3170 }
3171 return 0;
3172};
3173
3174EventEmitter.listenerCount = function (emitter, type) {
3175 return emitter.listenerCount(type);
3176};
3177
3178function isFunction(arg) {
3179 return typeof arg === 'function';
3180}
3181
3182function isNumber(arg) {
3183 return typeof arg === 'number';
3184}
3185
3186function isObject(arg) {
3187 return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && arg !== null;
3188}
3189
3190function isUndefined(arg) {
3191 return arg === void 0;
3192}
3193
3194/***/ }),
3195/* 11 */
3196/***/ (function(module, exports, __webpack_require__) {
3197
3198"use strict";
3199
3200
3201/* eslint-disable node/no-deprecated-api */
3202var buffer = __webpack_require__(5);
3203var Buffer = buffer.Buffer;
3204
3205// alternative to using Object.keys for old browsers
3206function copyProps(src, dst) {
3207 for (var key in src) {
3208 dst[key] = src[key];
3209 }
3210}
3211if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
3212 module.exports = buffer;
3213} else {
3214 // Copy properties from require('buffer')
3215 copyProps(buffer, exports);
3216 exports.Buffer = SafeBuffer;
3217}
3218
3219function SafeBuffer(arg, encodingOrOffset, length) {
3220 return Buffer(arg, encodingOrOffset, length);
3221}
3222
3223// Copy static methods from Buffer
3224copyProps(Buffer, SafeBuffer);
3225
3226SafeBuffer.from = function (arg, encodingOrOffset, length) {
3227 if (typeof arg === 'number') {
3228 throw new TypeError('Argument must not be a number');
3229 }
3230 return Buffer(arg, encodingOrOffset, length);
3231};
3232
3233SafeBuffer.alloc = function (size, fill, encoding) {
3234 if (typeof size !== 'number') {
3235 throw new TypeError('Argument must be a number');
3236 }
3237 var buf = Buffer(size);
3238 if (fill !== undefined) {
3239 if (typeof encoding === 'string') {
3240 buf.fill(fill, encoding);
3241 } else {
3242 buf.fill(fill);
3243 }
3244 } else {
3245 buf.fill(0);
3246 }
3247 return buf;
3248};
3249
3250SafeBuffer.allocUnsafe = function (size) {
3251 if (typeof size !== 'number') {
3252 throw new TypeError('Argument must be a number');
3253 }
3254 return Buffer(size);
3255};
3256
3257SafeBuffer.allocUnsafeSlow = function (size) {
3258 if (typeof size !== 'number') {
3259 throw new TypeError('Argument must be a number');
3260 }
3261 return buffer.SlowBuffer(size);
3262};
3263
3264/***/ }),
3265/* 12 */
3266/***/ (function(module, exports, __webpack_require__) {
3267
3268"use strict";
3269
3270
3271// Generated by CoffeeScript 1.12.7
3272(function () {
3273 var XMLAttribute,
3274 XMLElement,
3275 XMLNode,
3276 isFunction,
3277 isObject,
3278 ref,
3279 extend = function extend(child, parent) {
3280 for (var key in parent) {
3281 if (hasProp.call(parent, key)) child[key] = parent[key];
3282 }function ctor() {
3283 this.constructor = child;
3284 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3285 },
3286 hasProp = {}.hasOwnProperty;
3287
3288 ref = __webpack_require__(3), isObject = ref.isObject, isFunction = ref.isFunction;
3289
3290 XMLNode = __webpack_require__(0);
3291
3292 XMLAttribute = __webpack_require__(40);
3293
3294 module.exports = XMLElement = function (superClass) {
3295 extend(XMLElement, superClass);
3296
3297 function XMLElement(parent, name, attributes) {
3298 XMLElement.__super__.constructor.call(this, parent);
3299 if (name == null) {
3300 throw new Error("Missing element name");
3301 }
3302 this.name = this.stringify.eleName(name);
3303 this.attributes = {};
3304 if (attributes != null) {
3305 this.attribute(attributes);
3306 }
3307 if (parent.isDocument) {
3308 this.isRoot = true;
3309 this.documentObject = parent;
3310 parent.rootObject = this;
3311 }
3312 }
3313
3314 XMLElement.prototype.clone = function () {
3315 var att, attName, clonedSelf, ref1;
3316 clonedSelf = Object.create(this);
3317 if (clonedSelf.isRoot) {
3318 clonedSelf.documentObject = null;
3319 }
3320 clonedSelf.attributes = {};
3321 ref1 = this.attributes;
3322 for (attName in ref1) {
3323 if (!hasProp.call(ref1, attName)) continue;
3324 att = ref1[attName];
3325 clonedSelf.attributes[attName] = att.clone();
3326 }
3327 clonedSelf.children = [];
3328 this.children.forEach(function (child) {
3329 var clonedChild;
3330 clonedChild = child.clone();
3331 clonedChild.parent = clonedSelf;
3332 return clonedSelf.children.push(clonedChild);
3333 });
3334 return clonedSelf;
3335 };
3336
3337 XMLElement.prototype.attribute = function (name, value) {
3338 var attName, attValue;
3339 if (name != null) {
3340 name = name.valueOf();
3341 }
3342 if (isObject(name)) {
3343 for (attName in name) {
3344 if (!hasProp.call(name, attName)) continue;
3345 attValue = name[attName];
3346 this.attribute(attName, attValue);
3347 }
3348 } else {
3349 if (isFunction(value)) {
3350 value = value.apply();
3351 }
3352 if (!this.options.skipNullAttributes || value != null) {
3353 this.attributes[name] = new XMLAttribute(this, name, value);
3354 }
3355 }
3356 return this;
3357 };
3358
3359 XMLElement.prototype.removeAttribute = function (name) {
3360 var attName, i, len;
3361 if (name == null) {
3362 throw new Error("Missing attribute name");
3363 }
3364 name = name.valueOf();
3365 if (Array.isArray(name)) {
3366 for (i = 0, len = name.length; i < len; i++) {
3367 attName = name[i];
3368 delete this.attributes[attName];
3369 }
3370 } else {
3371 delete this.attributes[name];
3372 }
3373 return this;
3374 };
3375
3376 XMLElement.prototype.toString = function (options) {
3377 return this.options.writer.set(options).element(this);
3378 };
3379
3380 XMLElement.prototype.att = function (name, value) {
3381 return this.attribute(name, value);
3382 };
3383
3384 XMLElement.prototype.a = function (name, value) {
3385 return this.attribute(name, value);
3386 };
3387
3388 return XMLElement;
3389 }(XMLNode);
3390}).call(undefined);
3391
3392/***/ }),
3393/* 13 */
3394/***/ (function(module, exports, __webpack_require__) {
3395
3396"use strict";
3397
3398
3399// Generated by CoffeeScript 1.12.7
3400(function () {
3401 var XMLCData,
3402 XMLNode,
3403 extend = function extend(child, parent) {
3404 for (var key in parent) {
3405 if (hasProp.call(parent, key)) child[key] = parent[key];
3406 }function ctor() {
3407 this.constructor = child;
3408 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3409 },
3410 hasProp = {}.hasOwnProperty;
3411
3412 XMLNode = __webpack_require__(0);
3413
3414 module.exports = XMLCData = function (superClass) {
3415 extend(XMLCData, superClass);
3416
3417 function XMLCData(parent, text) {
3418 XMLCData.__super__.constructor.call(this, parent);
3419 if (text == null) {
3420 throw new Error("Missing CDATA text");
3421 }
3422 this.text = this.stringify.cdata(text);
3423 }
3424
3425 XMLCData.prototype.clone = function () {
3426 return Object.create(this);
3427 };
3428
3429 XMLCData.prototype.toString = function (options) {
3430 return this.options.writer.set(options).cdata(this);
3431 };
3432
3433 return XMLCData;
3434 }(XMLNode);
3435}).call(undefined);
3436
3437/***/ }),
3438/* 14 */
3439/***/ (function(module, exports, __webpack_require__) {
3440
3441"use strict";
3442
3443
3444// Generated by CoffeeScript 1.12.7
3445(function () {
3446 var XMLComment,
3447 XMLNode,
3448 extend = function extend(child, parent) {
3449 for (var key in parent) {
3450 if (hasProp.call(parent, key)) child[key] = parent[key];
3451 }function ctor() {
3452 this.constructor = child;
3453 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3454 },
3455 hasProp = {}.hasOwnProperty;
3456
3457 XMLNode = __webpack_require__(0);
3458
3459 module.exports = XMLComment = function (superClass) {
3460 extend(XMLComment, superClass);
3461
3462 function XMLComment(parent, text) {
3463 XMLComment.__super__.constructor.call(this, parent);
3464 if (text == null) {
3465 throw new Error("Missing comment text");
3466 }
3467 this.text = this.stringify.comment(text);
3468 }
3469
3470 XMLComment.prototype.clone = function () {
3471 return Object.create(this);
3472 };
3473
3474 XMLComment.prototype.toString = function (options) {
3475 return this.options.writer.set(options).comment(this);
3476 };
3477
3478 return XMLComment;
3479 }(XMLNode);
3480}).call(undefined);
3481
3482/***/ }),
3483/* 15 */
3484/***/ (function(module, exports, __webpack_require__) {
3485
3486"use strict";
3487
3488
3489// Generated by CoffeeScript 1.12.7
3490(function () {
3491 var XMLDeclaration,
3492 XMLNode,
3493 isObject,
3494 extend = function extend(child, parent) {
3495 for (var key in parent) {
3496 if (hasProp.call(parent, key)) child[key] = parent[key];
3497 }function ctor() {
3498 this.constructor = child;
3499 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3500 },
3501 hasProp = {}.hasOwnProperty;
3502
3503 isObject = __webpack_require__(3).isObject;
3504
3505 XMLNode = __webpack_require__(0);
3506
3507 module.exports = XMLDeclaration = function (superClass) {
3508 extend(XMLDeclaration, superClass);
3509
3510 function XMLDeclaration(parent, version, encoding, standalone) {
3511 var ref;
3512 XMLDeclaration.__super__.constructor.call(this, parent);
3513 if (isObject(version)) {
3514 ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
3515 }
3516 if (!version) {
3517 version = '1.0';
3518 }
3519 this.version = this.stringify.xmlVersion(version);
3520 if (encoding != null) {
3521 this.encoding = this.stringify.xmlEncoding(encoding);
3522 }
3523 if (standalone != null) {
3524 this.standalone = this.stringify.xmlStandalone(standalone);
3525 }
3526 }
3527
3528 XMLDeclaration.prototype.toString = function (options) {
3529 return this.options.writer.set(options).declaration(this);
3530 };
3531
3532 return XMLDeclaration;
3533 }(XMLNode);
3534}).call(undefined);
3535
3536/***/ }),
3537/* 16 */
3538/***/ (function(module, exports, __webpack_require__) {
3539
3540"use strict";
3541
3542
3543// Generated by CoffeeScript 1.12.7
3544(function () {
3545 var XMLDTDAttList,
3546 XMLDTDElement,
3547 XMLDTDEntity,
3548 XMLDTDNotation,
3549 XMLDocType,
3550 XMLNode,
3551 isObject,
3552 extend = function extend(child, parent) {
3553 for (var key in parent) {
3554 if (hasProp.call(parent, key)) child[key] = parent[key];
3555 }function ctor() {
3556 this.constructor = child;
3557 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3558 },
3559 hasProp = {}.hasOwnProperty;
3560
3561 isObject = __webpack_require__(3).isObject;
3562
3563 XMLNode = __webpack_require__(0);
3564
3565 XMLDTDAttList = __webpack_require__(17);
3566
3567 XMLDTDEntity = __webpack_require__(18);
3568
3569 XMLDTDElement = __webpack_require__(19);
3570
3571 XMLDTDNotation = __webpack_require__(20);
3572
3573 module.exports = XMLDocType = function (superClass) {
3574 extend(XMLDocType, superClass);
3575
3576 function XMLDocType(parent, pubID, sysID) {
3577 var ref, ref1;
3578 XMLDocType.__super__.constructor.call(this, parent);
3579 this.documentObject = parent;
3580 if (isObject(pubID)) {
3581 ref = pubID, pubID = ref.pubID, sysID = ref.sysID;
3582 }
3583 if (sysID == null) {
3584 ref1 = [pubID, sysID], sysID = ref1[0], pubID = ref1[1];
3585 }
3586 if (pubID != null) {
3587 this.pubID = this.stringify.dtdPubID(pubID);
3588 }
3589 if (sysID != null) {
3590 this.sysID = this.stringify.dtdSysID(sysID);
3591 }
3592 }
3593
3594 XMLDocType.prototype.element = function (name, value) {
3595 var child;
3596 child = new XMLDTDElement(this, name, value);
3597 this.children.push(child);
3598 return this;
3599 };
3600
3601 XMLDocType.prototype.attList = function (elementName, attributeName, attributeType, defaultValueType, defaultValue) {
3602 var child;
3603 child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
3604 this.children.push(child);
3605 return this;
3606 };
3607
3608 XMLDocType.prototype.entity = function (name, value) {
3609 var child;
3610 child = new XMLDTDEntity(this, false, name, value);
3611 this.children.push(child);
3612 return this;
3613 };
3614
3615 XMLDocType.prototype.pEntity = function (name, value) {
3616 var child;
3617 child = new XMLDTDEntity(this, true, name, value);
3618 this.children.push(child);
3619 return this;
3620 };
3621
3622 XMLDocType.prototype.notation = function (name, value) {
3623 var child;
3624 child = new XMLDTDNotation(this, name, value);
3625 this.children.push(child);
3626 return this;
3627 };
3628
3629 XMLDocType.prototype.toString = function (options) {
3630 return this.options.writer.set(options).docType(this);
3631 };
3632
3633 XMLDocType.prototype.ele = function (name, value) {
3634 return this.element(name, value);
3635 };
3636
3637 XMLDocType.prototype.att = function (elementName, attributeName, attributeType, defaultValueType, defaultValue) {
3638 return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
3639 };
3640
3641 XMLDocType.prototype.ent = function (name, value) {
3642 return this.entity(name, value);
3643 };
3644
3645 XMLDocType.prototype.pent = function (name, value) {
3646 return this.pEntity(name, value);
3647 };
3648
3649 XMLDocType.prototype.not = function (name, value) {
3650 return this.notation(name, value);
3651 };
3652
3653 XMLDocType.prototype.up = function () {
3654 return this.root() || this.documentObject;
3655 };
3656
3657 return XMLDocType;
3658 }(XMLNode);
3659}).call(undefined);
3660
3661/***/ }),
3662/* 17 */
3663/***/ (function(module, exports, __webpack_require__) {
3664
3665"use strict";
3666
3667
3668// Generated by CoffeeScript 1.12.7
3669(function () {
3670 var XMLDTDAttList,
3671 XMLNode,
3672 extend = function extend(child, parent) {
3673 for (var key in parent) {
3674 if (hasProp.call(parent, key)) child[key] = parent[key];
3675 }function ctor() {
3676 this.constructor = child;
3677 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3678 },
3679 hasProp = {}.hasOwnProperty;
3680
3681 XMLNode = __webpack_require__(0);
3682
3683 module.exports = XMLDTDAttList = function (superClass) {
3684 extend(XMLDTDAttList, superClass);
3685
3686 function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
3687 XMLDTDAttList.__super__.constructor.call(this, parent);
3688 if (elementName == null) {
3689 throw new Error("Missing DTD element name");
3690 }
3691 if (attributeName == null) {
3692 throw new Error("Missing DTD attribute name");
3693 }
3694 if (!attributeType) {
3695 throw new Error("Missing DTD attribute type");
3696 }
3697 if (!defaultValueType) {
3698 throw new Error("Missing DTD attribute default");
3699 }
3700 if (defaultValueType.indexOf('#') !== 0) {
3701 defaultValueType = '#' + defaultValueType;
3702 }
3703 if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
3704 throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");
3705 }
3706 if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
3707 throw new Error("Default value only applies to #FIXED or #DEFAULT");
3708 }
3709 this.elementName = this.stringify.eleName(elementName);
3710 this.attributeName = this.stringify.attName(attributeName);
3711 this.attributeType = this.stringify.dtdAttType(attributeType);
3712 this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
3713 this.defaultValueType = defaultValueType;
3714 }
3715
3716 XMLDTDAttList.prototype.toString = function (options) {
3717 return this.options.writer.set(options).dtdAttList(this);
3718 };
3719
3720 return XMLDTDAttList;
3721 }(XMLNode);
3722}).call(undefined);
3723
3724/***/ }),
3725/* 18 */
3726/***/ (function(module, exports, __webpack_require__) {
3727
3728"use strict";
3729
3730
3731// Generated by CoffeeScript 1.12.7
3732(function () {
3733 var XMLDTDEntity,
3734 XMLNode,
3735 isObject,
3736 extend = function extend(child, parent) {
3737 for (var key in parent) {
3738 if (hasProp.call(parent, key)) child[key] = parent[key];
3739 }function ctor() {
3740 this.constructor = child;
3741 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3742 },
3743 hasProp = {}.hasOwnProperty;
3744
3745 isObject = __webpack_require__(3).isObject;
3746
3747 XMLNode = __webpack_require__(0);
3748
3749 module.exports = XMLDTDEntity = function (superClass) {
3750 extend(XMLDTDEntity, superClass);
3751
3752 function XMLDTDEntity(parent, pe, name, value) {
3753 XMLDTDEntity.__super__.constructor.call(this, parent);
3754 if (name == null) {
3755 throw new Error("Missing entity name");
3756 }
3757 if (value == null) {
3758 throw new Error("Missing entity value");
3759 }
3760 this.pe = !!pe;
3761 this.name = this.stringify.eleName(name);
3762 if (!isObject(value)) {
3763 this.value = this.stringify.dtdEntityValue(value);
3764 } else {
3765 if (!value.pubID && !value.sysID) {
3766 throw new Error("Public and/or system identifiers are required for an external entity");
3767 }
3768 if (value.pubID && !value.sysID) {
3769 throw new Error("System identifier is required for a public external entity");
3770 }
3771 if (value.pubID != null) {
3772 this.pubID = this.stringify.dtdPubID(value.pubID);
3773 }
3774 if (value.sysID != null) {
3775 this.sysID = this.stringify.dtdSysID(value.sysID);
3776 }
3777 if (value.nData != null) {
3778 this.nData = this.stringify.dtdNData(value.nData);
3779 }
3780 if (this.pe && this.nData) {
3781 throw new Error("Notation declaration is not allowed in a parameter entity");
3782 }
3783 }
3784 }
3785
3786 XMLDTDEntity.prototype.toString = function (options) {
3787 return this.options.writer.set(options).dtdEntity(this);
3788 };
3789
3790 return XMLDTDEntity;
3791 }(XMLNode);
3792}).call(undefined);
3793
3794/***/ }),
3795/* 19 */
3796/***/ (function(module, exports, __webpack_require__) {
3797
3798"use strict";
3799
3800
3801// Generated by CoffeeScript 1.12.7
3802(function () {
3803 var XMLDTDElement,
3804 XMLNode,
3805 extend = function extend(child, parent) {
3806 for (var key in parent) {
3807 if (hasProp.call(parent, key)) child[key] = parent[key];
3808 }function ctor() {
3809 this.constructor = child;
3810 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3811 },
3812 hasProp = {}.hasOwnProperty;
3813
3814 XMLNode = __webpack_require__(0);
3815
3816 module.exports = XMLDTDElement = function (superClass) {
3817 extend(XMLDTDElement, superClass);
3818
3819 function XMLDTDElement(parent, name, value) {
3820 XMLDTDElement.__super__.constructor.call(this, parent);
3821 if (name == null) {
3822 throw new Error("Missing DTD element name");
3823 }
3824 if (!value) {
3825 value = '(#PCDATA)';
3826 }
3827 if (Array.isArray(value)) {
3828 value = '(' + value.join(',') + ')';
3829 }
3830 this.name = this.stringify.eleName(name);
3831 this.value = this.stringify.dtdElementValue(value);
3832 }
3833
3834 XMLDTDElement.prototype.toString = function (options) {
3835 return this.options.writer.set(options).dtdElement(this);
3836 };
3837
3838 return XMLDTDElement;
3839 }(XMLNode);
3840}).call(undefined);
3841
3842/***/ }),
3843/* 20 */
3844/***/ (function(module, exports, __webpack_require__) {
3845
3846"use strict";
3847
3848
3849// Generated by CoffeeScript 1.12.7
3850(function () {
3851 var XMLDTDNotation,
3852 XMLNode,
3853 extend = function extend(child, parent) {
3854 for (var key in parent) {
3855 if (hasProp.call(parent, key)) child[key] = parent[key];
3856 }function ctor() {
3857 this.constructor = child;
3858 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3859 },
3860 hasProp = {}.hasOwnProperty;
3861
3862 XMLNode = __webpack_require__(0);
3863
3864 module.exports = XMLDTDNotation = function (superClass) {
3865 extend(XMLDTDNotation, superClass);
3866
3867 function XMLDTDNotation(parent, name, value) {
3868 XMLDTDNotation.__super__.constructor.call(this, parent);
3869 if (name == null) {
3870 throw new Error("Missing notation name");
3871 }
3872 if (!value.pubID && !value.sysID) {
3873 throw new Error("Public or system identifiers are required for an external entity");
3874 }
3875 this.name = this.stringify.eleName(name);
3876 if (value.pubID != null) {
3877 this.pubID = this.stringify.dtdPubID(value.pubID);
3878 }
3879 if (value.sysID != null) {
3880 this.sysID = this.stringify.dtdSysID(value.sysID);
3881 }
3882 }
3883
3884 XMLDTDNotation.prototype.toString = function (options) {
3885 return this.options.writer.set(options).dtdNotation(this);
3886 };
3887
3888 return XMLDTDNotation;
3889 }(XMLNode);
3890}).call(undefined);
3891
3892/***/ }),
3893/* 21 */
3894/***/ (function(module, exports, __webpack_require__) {
3895
3896"use strict";
3897
3898
3899// Generated by CoffeeScript 1.12.7
3900(function () {
3901 var XMLNode,
3902 XMLRaw,
3903 extend = function extend(child, parent) {
3904 for (var key in parent) {
3905 if (hasProp.call(parent, key)) child[key] = parent[key];
3906 }function ctor() {
3907 this.constructor = child;
3908 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3909 },
3910 hasProp = {}.hasOwnProperty;
3911
3912 XMLNode = __webpack_require__(0);
3913
3914 module.exports = XMLRaw = function (superClass) {
3915 extend(XMLRaw, superClass);
3916
3917 function XMLRaw(parent, text) {
3918 XMLRaw.__super__.constructor.call(this, parent);
3919 if (text == null) {
3920 throw new Error("Missing raw text");
3921 }
3922 this.value = this.stringify.raw(text);
3923 }
3924
3925 XMLRaw.prototype.clone = function () {
3926 return Object.create(this);
3927 };
3928
3929 XMLRaw.prototype.toString = function (options) {
3930 return this.options.writer.set(options).raw(this);
3931 };
3932
3933 return XMLRaw;
3934 }(XMLNode);
3935}).call(undefined);
3936
3937/***/ }),
3938/* 22 */
3939/***/ (function(module, exports, __webpack_require__) {
3940
3941"use strict";
3942
3943
3944// Generated by CoffeeScript 1.12.7
3945(function () {
3946 var XMLNode,
3947 XMLText,
3948 extend = function extend(child, parent) {
3949 for (var key in parent) {
3950 if (hasProp.call(parent, key)) child[key] = parent[key];
3951 }function ctor() {
3952 this.constructor = child;
3953 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3954 },
3955 hasProp = {}.hasOwnProperty;
3956
3957 XMLNode = __webpack_require__(0);
3958
3959 module.exports = XMLText = function (superClass) {
3960 extend(XMLText, superClass);
3961
3962 function XMLText(parent, text) {
3963 XMLText.__super__.constructor.call(this, parent);
3964 if (text == null) {
3965 throw new Error("Missing element text");
3966 }
3967 this.value = this.stringify.eleText(text);
3968 }
3969
3970 XMLText.prototype.clone = function () {
3971 return Object.create(this);
3972 };
3973
3974 XMLText.prototype.toString = function (options) {
3975 return this.options.writer.set(options).text(this);
3976 };
3977
3978 return XMLText;
3979 }(XMLNode);
3980}).call(undefined);
3981
3982/***/ }),
3983/* 23 */
3984/***/ (function(module, exports, __webpack_require__) {
3985
3986"use strict";
3987
3988
3989// Generated by CoffeeScript 1.12.7
3990(function () {
3991 var XMLNode,
3992 XMLProcessingInstruction,
3993 extend = function extend(child, parent) {
3994 for (var key in parent) {
3995 if (hasProp.call(parent, key)) child[key] = parent[key];
3996 }function ctor() {
3997 this.constructor = child;
3998 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
3999 },
4000 hasProp = {}.hasOwnProperty;
4001
4002 XMLNode = __webpack_require__(0);
4003
4004 module.exports = XMLProcessingInstruction = function (superClass) {
4005 extend(XMLProcessingInstruction, superClass);
4006
4007 function XMLProcessingInstruction(parent, target, value) {
4008 XMLProcessingInstruction.__super__.constructor.call(this, parent);
4009 if (target == null) {
4010 throw new Error("Missing instruction target");
4011 }
4012 this.target = this.stringify.insTarget(target);
4013 if (value) {
4014 this.value = this.stringify.insValue(value);
4015 }
4016 }
4017
4018 XMLProcessingInstruction.prototype.clone = function () {
4019 return Object.create(this);
4020 };
4021
4022 XMLProcessingInstruction.prototype.toString = function (options) {
4023 return this.options.writer.set(options).processingInstruction(this);
4024 };
4025
4026 return XMLProcessingInstruction;
4027 }(XMLNode);
4028}).call(undefined);
4029
4030/***/ }),
4031/* 24 */
4032/***/ (function(module, exports, __webpack_require__) {
4033
4034"use strict";
4035/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors.
4036//
4037// Permission is hereby granted, free of charge, to any person obtaining a
4038// copy of this software and associated documentation files (the
4039// "Software"), to deal in the Software without restriction, including
4040// without limitation the rights to use, copy, modify, merge, publish,
4041// distribute, sublicense, and/or sell copies of the Software, and to permit
4042// persons to whom the Software is furnished to do so, subject to the
4043// following conditions:
4044//
4045// The above copyright notice and this permission notice shall be included
4046// in all copies or substantial portions of the Software.
4047//
4048// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
4049// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4050// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
4051// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
4052// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
4053// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
4054// USE OR OTHER DEALINGS IN THE SOFTWARE.
4055
4056// A bit simpler than readable streams.
4057// Implement an async ._write(chunk, encoding, cb), and it'll handle all
4058// the drain event emission and buffering.
4059
4060
4061
4062/*<replacement>*/
4063
4064var pna = __webpack_require__(9);
4065/*</replacement>*/
4066
4067module.exports = Writable;
4068
4069/* <replacement> */
4070function WriteReq(chunk, encoding, cb) {
4071 this.chunk = chunk;
4072 this.encoding = encoding;
4073 this.callback = cb;
4074 this.next = null;
4075}
4076
4077// It seems a linked list but it is not
4078// there will be only 2 of these for each stream
4079function CorkedRequest(state) {
4080 var _this = this;
4081
4082 this.next = null;
4083 this.entry = null;
4084 this.finish = function () {
4085 onCorkedFinish(_this, state);
4086 };
4087}
4088/* </replacement> */
4089
4090/*<replacement>*/
4091var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
4092/*</replacement>*/
4093
4094/*<replacement>*/
4095var Duplex;
4096/*</replacement>*/
4097
4098Writable.WritableState = WritableState;
4099
4100/*<replacement>*/
4101var util = __webpack_require__(8);
4102util.inherits = __webpack_require__(2);
4103/*</replacement>*/
4104
4105/*<replacement>*/
4106var internalUtil = {
4107 deprecate: __webpack_require__(56)
4108};
4109/*</replacement>*/
4110
4111/*<replacement>*/
4112var Stream = __webpack_require__(34);
4113/*</replacement>*/
4114
4115/*<replacement>*/
4116
4117var Buffer = __webpack_require__(11).Buffer;
4118var OurUint8Array = global.Uint8Array || function () {};
4119function _uint8ArrayToBuffer(chunk) {
4120 return Buffer.from(chunk);
4121}
4122function _isUint8Array(obj) {
4123 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
4124}
4125
4126/*</replacement>*/
4127
4128var destroyImpl = __webpack_require__(35);
4129
4130util.inherits(Writable, Stream);
4131
4132function nop() {}
4133
4134function WritableState(options, stream) {
4135 Duplex = Duplex || __webpack_require__(4);
4136
4137 options = options || {};
4138
4139 // Duplex streams are both readable and writable, but share
4140 // the same options object.
4141 // However, some cases require setting options to different
4142 // values for the readable and the writable sides of the duplex stream.
4143 // These options can be provided separately as readableXXX and writableXXX.
4144 var isDuplex = stream instanceof Duplex;
4145
4146 // object stream flag to indicate whether or not this stream
4147 // contains buffers or objects.
4148 this.objectMode = !!options.objectMode;
4149
4150 if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
4151
4152 // the point at which write() starts returning false
4153 // Note: 0 is a valid value, means that we always return false if
4154 // the entire buffer is not flushed immediately on write()
4155 var hwm = options.highWaterMark;
4156 var writableHwm = options.writableHighWaterMark;
4157 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
4158
4159 if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
4160
4161 // cast to ints.
4162 this.highWaterMark = Math.floor(this.highWaterMark);
4163
4164 // if _final has been called
4165 this.finalCalled = false;
4166
4167 // drain event flag.
4168 this.needDrain = false;
4169 // at the start of calling end()
4170 this.ending = false;
4171 // when end() has been called, and returned
4172 this.ended = false;
4173 // when 'finish' is emitted
4174 this.finished = false;
4175
4176 // has it been destroyed
4177 this.destroyed = false;
4178
4179 // should we decode strings into buffers before passing to _write?
4180 // this is here so that some node-core streams can optimize string
4181 // handling at a lower level.
4182 var noDecode = options.decodeStrings === false;
4183 this.decodeStrings = !noDecode;
4184
4185 // Crypto is kind of old and crusty. Historically, its default string
4186 // encoding is 'binary' so we have to make this configurable.
4187 // Everything else in the universe uses 'utf8', though.
4188 this.defaultEncoding = options.defaultEncoding || 'utf8';
4189
4190 // not an actual buffer we keep track of, but a measurement
4191 // of how much we're waiting to get pushed to some underlying
4192 // socket or file.
4193 this.length = 0;
4194
4195 // a flag to see when we're in the middle of a write.
4196 this.writing = false;
4197
4198 // when true all writes will be buffered until .uncork() call
4199 this.corked = 0;
4200
4201 // a flag to be able to tell if the onwrite cb is called immediately,
4202 // or on a later tick. We set this to true at first, because any
4203 // actions that shouldn't happen until "later" should generally also
4204 // not happen before the first write call.
4205 this.sync = true;
4206
4207 // a flag to know if we're processing previously buffered items, which
4208 // may call the _write() callback in the same tick, so that we don't
4209 // end up in an overlapped onwrite situation.
4210 this.bufferProcessing = false;
4211
4212 // the callback that's passed to _write(chunk,cb)
4213 this.onwrite = function (er) {
4214 onwrite(stream, er);
4215 };
4216
4217 // the callback that the user supplies to write(chunk,encoding,cb)
4218 this.writecb = null;
4219
4220 // the amount that is being written when _write is called.
4221 this.writelen = 0;
4222
4223 this.bufferedRequest = null;
4224 this.lastBufferedRequest = null;
4225
4226 // number of pending user-supplied write callbacks
4227 // this must be 0 before 'finish' can be emitted
4228 this.pendingcb = 0;
4229
4230 // emit prefinish if the only thing we're waiting for is _write cbs
4231 // This is relevant for synchronous Transform streams
4232 this.prefinished = false;
4233
4234 // True if the error was already emitted and should not be thrown again
4235 this.errorEmitted = false;
4236
4237 // count buffered requests
4238 this.bufferedRequestCount = 0;
4239
4240 // allocate the first CorkedRequest, there is always
4241 // one allocated and free to use, and we maintain at most two
4242 this.corkedRequestsFree = new CorkedRequest(this);
4243}
4244
4245WritableState.prototype.getBuffer = function getBuffer() {
4246 var current = this.bufferedRequest;
4247 var out = [];
4248 while (current) {
4249 out.push(current);
4250 current = current.next;
4251 }
4252 return out;
4253};
4254
4255(function () {
4256 try {
4257 Object.defineProperty(WritableState.prototype, 'buffer', {
4258 get: internalUtil.deprecate(function () {
4259 return this.getBuffer();
4260 }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
4261 });
4262 } catch (_) {}
4263})();
4264
4265// Test _writableState for inheritance to account for Duplex streams,
4266// whose prototype chain only points to Readable.
4267var realHasInstance;
4268if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
4269 realHasInstance = Function.prototype[Symbol.hasInstance];
4270 Object.defineProperty(Writable, Symbol.hasInstance, {
4271 value: function value(object) {
4272 if (realHasInstance.call(this, object)) return true;
4273 if (this !== Writable) return false;
4274
4275 return object && object._writableState instanceof WritableState;
4276 }
4277 });
4278} else {
4279 realHasInstance = function realHasInstance(object) {
4280 return object instanceof this;
4281 };
4282}
4283
4284function Writable(options) {
4285 Duplex = Duplex || __webpack_require__(4);
4286
4287 // Writable ctor is applied to Duplexes, too.
4288 // `realHasInstance` is necessary because using plain `instanceof`
4289 // would return false, as no `_writableState` property is attached.
4290
4291 // Trying to use the custom `instanceof` for Writable here will also break the
4292 // Node.js LazyTransform implementation, which has a non-trivial getter for
4293 // `_writableState` that would lead to infinite recursion.
4294 if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
4295 return new Writable(options);
4296 }
4297
4298 this._writableState = new WritableState(options, this);
4299
4300 // legacy.
4301 this.writable = true;
4302
4303 if (options) {
4304 if (typeof options.write === 'function') this._write = options.write;
4305
4306 if (typeof options.writev === 'function') this._writev = options.writev;
4307
4308 if (typeof options.destroy === 'function') this._destroy = options.destroy;
4309
4310 if (typeof options.final === 'function') this._final = options.final;
4311 }
4312
4313 Stream.call(this);
4314}
4315
4316// Otherwise people can pipe Writable streams, which is just wrong.
4317Writable.prototype.pipe = function () {
4318 this.emit('error', new Error('Cannot pipe, not readable'));
4319};
4320
4321function writeAfterEnd(stream, cb) {
4322 var er = new Error('write after end');
4323 // TODO: defer error events consistently everywhere, not just the cb
4324 stream.emit('error', er);
4325 pna.nextTick(cb, er);
4326}
4327
4328// Checks that a user-supplied chunk is valid, especially for the particular
4329// mode the stream is in. Currently this means that `null` is never accepted
4330// and undefined/non-string values are only allowed in object mode.
4331function validChunk(stream, state, chunk, cb) {
4332 var valid = true;
4333 var er = false;
4334
4335 if (chunk === null) {
4336 er = new TypeError('May not write null values to stream');
4337 } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
4338 er = new TypeError('Invalid non-string/buffer chunk');
4339 }
4340 if (er) {
4341 stream.emit('error', er);
4342 pna.nextTick(cb, er);
4343 valid = false;
4344 }
4345 return valid;
4346}
4347
4348Writable.prototype.write = function (chunk, encoding, cb) {
4349 var state = this._writableState;
4350 var ret = false;
4351 var isBuf = !state.objectMode && _isUint8Array(chunk);
4352
4353 if (isBuf && !Buffer.isBuffer(chunk)) {
4354 chunk = _uint8ArrayToBuffer(chunk);
4355 }
4356
4357 if (typeof encoding === 'function') {
4358 cb = encoding;
4359 encoding = null;
4360 }
4361
4362 if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
4363
4364 if (typeof cb !== 'function') cb = nop;
4365
4366 if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
4367 state.pendingcb++;
4368 ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
4369 }
4370
4371 return ret;
4372};
4373
4374Writable.prototype.cork = function () {
4375 var state = this._writableState;
4376
4377 state.corked++;
4378};
4379
4380Writable.prototype.uncork = function () {
4381 var state = this._writableState;
4382
4383 if (state.corked) {
4384 state.corked--;
4385
4386 if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
4387 }
4388};
4389
4390Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
4391 // node::ParseEncoding() requires lower case.
4392 if (typeof encoding === 'string') encoding = encoding.toLowerCase();
4393 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);
4394 this._writableState.defaultEncoding = encoding;
4395 return this;
4396};
4397
4398function decodeChunk(state, chunk, encoding) {
4399 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
4400 chunk = Buffer.from(chunk, encoding);
4401 }
4402 return chunk;
4403}
4404
4405Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
4406 // making it explicit this property is not enumerable
4407 // because otherwise some prototype manipulation in
4408 // userland will fail
4409 enumerable: false,
4410 get: function get() {
4411 return this._writableState.highWaterMark;
4412 }
4413});
4414
4415// if we're already writing something, then just put this
4416// in the queue, and wait our turn. Otherwise, call _write
4417// If we return false, then we need a drain event, so set that flag.
4418function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
4419 if (!isBuf) {
4420 var newChunk = decodeChunk(state, chunk, encoding);
4421 if (chunk !== newChunk) {
4422 isBuf = true;
4423 encoding = 'buffer';
4424 chunk = newChunk;
4425 }
4426 }
4427 var len = state.objectMode ? 1 : chunk.length;
4428
4429 state.length += len;
4430
4431 var ret = state.length < state.highWaterMark;
4432 // we must ensure that previous needDrain will not be reset to false.
4433 if (!ret) state.needDrain = true;
4434
4435 if (state.writing || state.corked) {
4436 var last = state.lastBufferedRequest;
4437 state.lastBufferedRequest = {
4438 chunk: chunk,
4439 encoding: encoding,
4440 isBuf: isBuf,
4441 callback: cb,
4442 next: null
4443 };
4444 if (last) {
4445 last.next = state.lastBufferedRequest;
4446 } else {
4447 state.bufferedRequest = state.lastBufferedRequest;
4448 }
4449 state.bufferedRequestCount += 1;
4450 } else {
4451 doWrite(stream, state, false, len, chunk, encoding, cb);
4452 }
4453
4454 return ret;
4455}
4456
4457function doWrite(stream, state, writev, len, chunk, encoding, cb) {
4458 state.writelen = len;
4459 state.writecb = cb;
4460 state.writing = true;
4461 state.sync = true;
4462 if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
4463 state.sync = false;
4464}
4465
4466function onwriteError(stream, state, sync, er, cb) {
4467 --state.pendingcb;
4468
4469 if (sync) {
4470 // defer the callback if we are being called synchronously
4471 // to avoid piling up things on the stack
4472 pna.nextTick(cb, er);
4473 // this can emit finish, and it will always happen
4474 // after error
4475 pna.nextTick(finishMaybe, stream, state);
4476 stream._writableState.errorEmitted = true;
4477 stream.emit('error', er);
4478 } else {
4479 // the caller expect this to happen before if
4480 // it is async
4481 cb(er);
4482 stream._writableState.errorEmitted = true;
4483 stream.emit('error', er);
4484 // this can emit finish, but finish must
4485 // always follow error
4486 finishMaybe(stream, state);
4487 }
4488}
4489
4490function onwriteStateUpdate(state) {
4491 state.writing = false;
4492 state.writecb = null;
4493 state.length -= state.writelen;
4494 state.writelen = 0;
4495}
4496
4497function onwrite(stream, er) {
4498 var state = stream._writableState;
4499 var sync = state.sync;
4500 var cb = state.writecb;
4501
4502 onwriteStateUpdate(state);
4503
4504 if (er) onwriteError(stream, state, sync, er, cb);else {
4505 // Check if we're actually ready to finish, but don't emit yet
4506 var finished = needFinish(state);
4507
4508 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
4509 clearBuffer(stream, state);
4510 }
4511
4512 if (sync) {
4513 /*<replacement>*/
4514 asyncWrite(afterWrite, stream, state, finished, cb);
4515 /*</replacement>*/
4516 } else {
4517 afterWrite(stream, state, finished, cb);
4518 }
4519 }
4520}
4521
4522function afterWrite(stream, state, finished, cb) {
4523 if (!finished) onwriteDrain(stream, state);
4524 state.pendingcb--;
4525 cb();
4526 finishMaybe(stream, state);
4527}
4528
4529// Must force callback to be called on nextTick, so that we don't
4530// emit 'drain' before the write() consumer gets the 'false' return
4531// value, and has a chance to attach a 'drain' listener.
4532function onwriteDrain(stream, state) {
4533 if (state.length === 0 && state.needDrain) {
4534 state.needDrain = false;
4535 stream.emit('drain');
4536 }
4537}
4538
4539// if there's something in the buffer waiting, then process it
4540function clearBuffer(stream, state) {
4541 state.bufferProcessing = true;
4542 var entry = state.bufferedRequest;
4543
4544 if (stream._writev && entry && entry.next) {
4545 // Fast case, write everything using _writev()
4546 var l = state.bufferedRequestCount;
4547 var buffer = new Array(l);
4548 var holder = state.corkedRequestsFree;
4549 holder.entry = entry;
4550
4551 var count = 0;
4552 var allBuffers = true;
4553 while (entry) {
4554 buffer[count] = entry;
4555 if (!entry.isBuf) allBuffers = false;
4556 entry = entry.next;
4557 count += 1;
4558 }
4559 buffer.allBuffers = allBuffers;
4560
4561 doWrite(stream, state, true, state.length, buffer, '', holder.finish);
4562
4563 // doWrite is almost always async, defer these to save a bit of time
4564 // as the hot path ends with doWrite
4565 state.pendingcb++;
4566 state.lastBufferedRequest = null;
4567 if (holder.next) {
4568 state.corkedRequestsFree = holder.next;
4569 holder.next = null;
4570 } else {
4571 state.corkedRequestsFree = new CorkedRequest(state);
4572 }
4573 state.bufferedRequestCount = 0;
4574 } else {
4575 // Slow case, write chunks one-by-one
4576 while (entry) {
4577 var chunk = entry.chunk;
4578 var encoding = entry.encoding;
4579 var cb = entry.callback;
4580 var len = state.objectMode ? 1 : chunk.length;
4581
4582 doWrite(stream, state, false, len, chunk, encoding, cb);
4583 entry = entry.next;
4584 state.bufferedRequestCount--;
4585 // if we didn't call the onwrite immediately, then
4586 // it means that we need to wait until it does.
4587 // also, that means that the chunk and cb are currently
4588 // being processed, so move the buffer counter past them.
4589 if (state.writing) {
4590 break;
4591 }
4592 }
4593
4594 if (entry === null) state.lastBufferedRequest = null;
4595 }
4596
4597 state.bufferedRequest = entry;
4598 state.bufferProcessing = false;
4599}
4600
4601Writable.prototype._write = function (chunk, encoding, cb) {
4602 cb(new Error('_write() is not implemented'));
4603};
4604
4605Writable.prototype._writev = null;
4606
4607Writable.prototype.end = function (chunk, encoding, cb) {
4608 var state = this._writableState;
4609
4610 if (typeof chunk === 'function') {
4611 cb = chunk;
4612 chunk = null;
4613 encoding = null;
4614 } else if (typeof encoding === 'function') {
4615 cb = encoding;
4616 encoding = null;
4617 }
4618
4619 if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
4620
4621 // .end() fully uncorks
4622 if (state.corked) {
4623 state.corked = 1;
4624 this.uncork();
4625 }
4626
4627 // ignore unnecessary end() calls.
4628 if (!state.ending && !state.finished) endWritable(this, state, cb);
4629};
4630
4631function needFinish(state) {
4632 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
4633}
4634function callFinal(stream, state) {
4635 stream._final(function (err) {
4636 state.pendingcb--;
4637 if (err) {
4638 stream.emit('error', err);
4639 }
4640 state.prefinished = true;
4641 stream.emit('prefinish');
4642 finishMaybe(stream, state);
4643 });
4644}
4645function prefinish(stream, state) {
4646 if (!state.prefinished && !state.finalCalled) {
4647 if (typeof stream._final === 'function') {
4648 state.pendingcb++;
4649 state.finalCalled = true;
4650 pna.nextTick(callFinal, stream, state);
4651 } else {
4652 state.prefinished = true;
4653 stream.emit('prefinish');
4654 }
4655 }
4656}
4657
4658function finishMaybe(stream, state) {
4659 var need = needFinish(state);
4660 if (need) {
4661 prefinish(stream, state);
4662 if (state.pendingcb === 0) {
4663 state.finished = true;
4664 stream.emit('finish');
4665 }
4666 }
4667 return need;
4668}
4669
4670function endWritable(stream, state, cb) {
4671 state.ending = true;
4672 finishMaybe(stream, state);
4673 if (cb) {
4674 if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
4675 }
4676 state.ended = true;
4677 stream.writable = false;
4678}
4679
4680function onCorkedFinish(corkReq, state, err) {
4681 var entry = corkReq.entry;
4682 corkReq.entry = null;
4683 while (entry) {
4684 var cb = entry.callback;
4685 state.pendingcb--;
4686 cb(err);
4687 entry = entry.next;
4688 }
4689 if (state.corkedRequestsFree) {
4690 state.corkedRequestsFree.next = corkReq;
4691 } else {
4692 state.corkedRequestsFree = corkReq;
4693 }
4694}
4695
4696Object.defineProperty(Writable.prototype, 'destroyed', {
4697 get: function get() {
4698 if (this._writableState === undefined) {
4699 return false;
4700 }
4701 return this._writableState.destroyed;
4702 },
4703 set: function set(value) {
4704 // we ignore the value if the stream
4705 // has not been initialized yet
4706 if (!this._writableState) {
4707 return;
4708 }
4709
4710 // backward compatibility, the user is explicitly
4711 // managing destroyed
4712 this._writableState.destroyed = value;
4713 }
4714});
4715
4716Writable.prototype.destroy = destroyImpl.destroy;
4717Writable.prototype._undestroy = destroyImpl.undestroy;
4718Writable.prototype._destroy = function (err, cb) {
4719 this.end();
4720 cb(err);
4721};
4722/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(36).setImmediate, __webpack_require__(1)))
4723
4724/***/ }),
4725/* 25 */
4726/***/ (function(module, exports, __webpack_require__) {
4727
4728"use strict";
4729// Copyright Joyent, Inc. and other Node contributors.
4730//
4731// Permission is hereby granted, free of charge, to any person obtaining a
4732// copy of this software and associated documentation files (the
4733// "Software"), to deal in the Software without restriction, including
4734// without limitation the rights to use, copy, modify, merge, publish,
4735// distribute, sublicense, and/or sell copies of the Software, and to permit
4736// persons to whom the Software is furnished to do so, subject to the
4737// following conditions:
4738//
4739// The above copyright notice and this permission notice shall be included
4740// in all copies or substantial portions of the Software.
4741//
4742// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
4743// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4744// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
4745// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
4746// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
4747// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
4748// USE OR OTHER DEALINGS IN THE SOFTWARE.
4749
4750
4751
4752/*<replacement>*/
4753
4754var Buffer = __webpack_require__(11).Buffer;
4755/*</replacement>*/
4756
4757var isEncoding = Buffer.isEncoding || function (encoding) {
4758 encoding = '' + encoding;
4759 switch (encoding && encoding.toLowerCase()) {
4760 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':
4761 return true;
4762 default:
4763 return false;
4764 }
4765};
4766
4767function _normalizeEncoding(enc) {
4768 if (!enc) return 'utf8';
4769 var retried;
4770 while (true) {
4771 switch (enc) {
4772 case 'utf8':
4773 case 'utf-8':
4774 return 'utf8';
4775 case 'ucs2':
4776 case 'ucs-2':
4777 case 'utf16le':
4778 case 'utf-16le':
4779 return 'utf16le';
4780 case 'latin1':
4781 case 'binary':
4782 return 'latin1';
4783 case 'base64':
4784 case 'ascii':
4785 case 'hex':
4786 return enc;
4787 default:
4788 if (retried) return; // undefined
4789 enc = ('' + enc).toLowerCase();
4790 retried = true;
4791 }
4792 }
4793};
4794
4795// Do not cache `Buffer.isEncoding` when checking encoding names as some
4796// modules monkey-patch it to support additional encodings
4797function normalizeEncoding(enc) {
4798 var nenc = _normalizeEncoding(enc);
4799 if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
4800 return nenc || enc;
4801}
4802
4803// StringDecoder provides an interface for efficiently splitting a series of
4804// buffers into a series of JS strings without breaking apart multi-byte
4805// characters.
4806exports.StringDecoder = StringDecoder;
4807function StringDecoder(encoding) {
4808 this.encoding = normalizeEncoding(encoding);
4809 var nb;
4810 switch (this.encoding) {
4811 case 'utf16le':
4812 this.text = utf16Text;
4813 this.end = utf16End;
4814 nb = 4;
4815 break;
4816 case 'utf8':
4817 this.fillLast = utf8FillLast;
4818 nb = 4;
4819 break;
4820 case 'base64':
4821 this.text = base64Text;
4822 this.end = base64End;
4823 nb = 3;
4824 break;
4825 default:
4826 this.write = simpleWrite;
4827 this.end = simpleEnd;
4828 return;
4829 }
4830 this.lastNeed = 0;
4831 this.lastTotal = 0;
4832 this.lastChar = Buffer.allocUnsafe(nb);
4833}
4834
4835StringDecoder.prototype.write = function (buf) {
4836 if (buf.length === 0) return '';
4837 var r;
4838 var i;
4839 if (this.lastNeed) {
4840 r = this.fillLast(buf);
4841 if (r === undefined) return '';
4842 i = this.lastNeed;
4843 this.lastNeed = 0;
4844 } else {
4845 i = 0;
4846 }
4847 if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
4848 return r || '';
4849};
4850
4851StringDecoder.prototype.end = utf8End;
4852
4853// Returns only complete characters in a Buffer
4854StringDecoder.prototype.text = utf8Text;
4855
4856// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
4857StringDecoder.prototype.fillLast = function (buf) {
4858 if (this.lastNeed <= buf.length) {
4859 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
4860 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
4861 }
4862 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
4863 this.lastNeed -= buf.length;
4864};
4865
4866// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
4867// continuation byte. If an invalid byte is detected, -2 is returned.
4868function utf8CheckByte(byte) {
4869 if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
4870 return byte >> 6 === 0x02 ? -1 : -2;
4871}
4872
4873// Checks at most 3 bytes at the end of a Buffer in order to detect an
4874// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
4875// needed to complete the UTF-8 character (if applicable) are returned.
4876function utf8CheckIncomplete(self, buf, i) {
4877 var j = buf.length - 1;
4878 if (j < i) return 0;
4879 var nb = utf8CheckByte(buf[j]);
4880 if (nb >= 0) {
4881 if (nb > 0) self.lastNeed = nb - 1;
4882 return nb;
4883 }
4884 if (--j < i || nb === -2) return 0;
4885 nb = utf8CheckByte(buf[j]);
4886 if (nb >= 0) {
4887 if (nb > 0) self.lastNeed = nb - 2;
4888 return nb;
4889 }
4890 if (--j < i || nb === -2) return 0;
4891 nb = utf8CheckByte(buf[j]);
4892 if (nb >= 0) {
4893 if (nb > 0) {
4894 if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
4895 }
4896 return nb;
4897 }
4898 return 0;
4899}
4900
4901// Validates as many continuation bytes for a multi-byte UTF-8 character as
4902// needed or are available. If we see a non-continuation byte where we expect
4903// one, we "replace" the validated continuation bytes we've seen so far with
4904// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
4905// behavior. The continuation byte check is included three times in the case
4906// where all of the continuation bytes for a character exist in the same buffer.
4907// It is also done this way as a slight performance increase instead of using a
4908// loop.
4909function utf8CheckExtraBytes(self, buf, p) {
4910 if ((buf[0] & 0xC0) !== 0x80) {
4911 self.lastNeed = 0;
4912 return '\uFFFD';
4913 }
4914 if (self.lastNeed > 1 && buf.length > 1) {
4915 if ((buf[1] & 0xC0) !== 0x80) {
4916 self.lastNeed = 1;
4917 return '\uFFFD';
4918 }
4919 if (self.lastNeed > 2 && buf.length > 2) {
4920 if ((buf[2] & 0xC0) !== 0x80) {
4921 self.lastNeed = 2;
4922 return '\uFFFD';
4923 }
4924 }
4925 }
4926}
4927
4928// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
4929function utf8FillLast(buf) {
4930 var p = this.lastTotal - this.lastNeed;
4931 var r = utf8CheckExtraBytes(this, buf, p);
4932 if (r !== undefined) return r;
4933 if (this.lastNeed <= buf.length) {
4934 buf.copy(this.lastChar, p, 0, this.lastNeed);
4935 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
4936 }
4937 buf.copy(this.lastChar, p, 0, buf.length);
4938 this.lastNeed -= buf.length;
4939}
4940
4941// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
4942// partial character, the character's bytes are buffered until the required
4943// number of bytes are available.
4944function utf8Text(buf, i) {
4945 var total = utf8CheckIncomplete(this, buf, i);
4946 if (!this.lastNeed) return buf.toString('utf8', i);
4947 this.lastTotal = total;
4948 var end = buf.length - (total - this.lastNeed);
4949 buf.copy(this.lastChar, 0, end);
4950 return buf.toString('utf8', i, end);
4951}
4952
4953// For UTF-8, a replacement character is added when ending on a partial
4954// character.
4955function utf8End(buf) {
4956 var r = buf && buf.length ? this.write(buf) : '';
4957 if (this.lastNeed) return r + '\uFFFD';
4958 return r;
4959}
4960
4961// UTF-16LE typically needs two bytes per character, but even if we have an even
4962// number of bytes available, we need to check if we end on a leading/high
4963// surrogate. In that case, we need to wait for the next two bytes in order to
4964// decode the last character properly.
4965function utf16Text(buf, i) {
4966 if ((buf.length - i) % 2 === 0) {
4967 var r = buf.toString('utf16le', i);
4968 if (r) {
4969 var c = r.charCodeAt(r.length - 1);
4970 if (c >= 0xD800 && c <= 0xDBFF) {
4971 this.lastNeed = 2;
4972 this.lastTotal = 4;
4973 this.lastChar[0] = buf[buf.length - 2];
4974 this.lastChar[1] = buf[buf.length - 1];
4975 return r.slice(0, -1);
4976 }
4977 }
4978 return r;
4979 }
4980 this.lastNeed = 1;
4981 this.lastTotal = 2;
4982 this.lastChar[0] = buf[buf.length - 1];
4983 return buf.toString('utf16le', i, buf.length - 1);
4984}
4985
4986// For UTF-16LE we do not explicitly append special replacement characters if we
4987// end on a partial character, we simply let v8 handle that.
4988function utf16End(buf) {
4989 var r = buf && buf.length ? this.write(buf) : '';
4990 if (this.lastNeed) {
4991 var end = this.lastTotal - this.lastNeed;
4992 return r + this.lastChar.toString('utf16le', 0, end);
4993 }
4994 return r;
4995}
4996
4997function base64Text(buf, i) {
4998 var n = (buf.length - i) % 3;
4999 if (n === 0) return buf.toString('base64', i);
5000 this.lastNeed = 3 - n;
5001 this.lastTotal = 3;
5002 if (n === 1) {
5003 this.lastChar[0] = buf[buf.length - 1];
5004 } else {
5005 this.lastChar[0] = buf[buf.length - 2];
5006 this.lastChar[1] = buf[buf.length - 1];
5007 }
5008 return buf.toString('base64', i, buf.length - n);
5009}
5010
5011function base64End(buf) {
5012 var r = buf && buf.length ? this.write(buf) : '';
5013 if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
5014 return r;
5015}
5016
5017// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
5018function simpleWrite(buf) {
5019 return buf.toString(this.encoding);
5020}
5021
5022function simpleEnd(buf) {
5023 return buf && buf.length ? this.write(buf) : '';
5024}
5025
5026/***/ }),
5027/* 26 */
5028/***/ (function(module, exports, __webpack_require__) {
5029
5030"use strict";
5031// Copyright Joyent, Inc. and other Node contributors.
5032//
5033// Permission is hereby granted, free of charge, to any person obtaining a
5034// copy of this software and associated documentation files (the
5035// "Software"), to deal in the Software without restriction, including
5036// without limitation the rights to use, copy, modify, merge, publish,
5037// distribute, sublicense, and/or sell copies of the Software, and to permit
5038// persons to whom the Software is furnished to do so, subject to the
5039// following conditions:
5040//
5041// The above copyright notice and this permission notice shall be included
5042// in all copies or substantial portions of the Software.
5043//
5044// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5045// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5046// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5047// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5048// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5049// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5050// USE OR OTHER DEALINGS IN THE SOFTWARE.
5051
5052
5053
5054var _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; };
5055
5056var punycode = __webpack_require__(61);
5057var util = __webpack_require__(63);
5058
5059exports.parse = urlParse;
5060exports.resolve = urlResolve;
5061exports.resolveObject = urlResolveObject;
5062exports.format = urlFormat;
5063
5064exports.Url = Url;
5065
5066function Url() {
5067 this.protocol = null;
5068 this.slashes = null;
5069 this.auth = null;
5070 this.host = null;
5071 this.port = null;
5072 this.hostname = null;
5073 this.hash = null;
5074 this.search = null;
5075 this.query = null;
5076 this.pathname = null;
5077 this.path = null;
5078 this.href = null;
5079}
5080
5081// Reference: RFC 3986, RFC 1808, RFC 2396
5082
5083// define these here so at least they only have to be
5084// compiled once on the first module load.
5085var protocolPattern = /^([a-z0-9.+-]+:)/i,
5086 portPattern = /:[0-9]*$/,
5087
5088
5089// Special case for a simple path URL
5090simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
5091
5092
5093// RFC 2396: characters reserved for delimiting URLs.
5094// We actually just auto-escape these.
5095delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
5096
5097
5098// RFC 2396: characters not allowed for various reasons.
5099unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
5100
5101
5102// Allowed by RFCs, but cause of XSS attacks. Always escape these.
5103autoEscape = ['\''].concat(unwise),
5104
5105// Characters that are never ever allowed in a hostname.
5106// Note that any invalid chars are also handled, but these
5107// are the ones that are *expected* to be seen, so we fast-path
5108// them.
5109nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
5110 hostEndingChars = ['/', '?', '#'],
5111 hostnameMaxLen = 255,
5112 hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
5113 hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
5114
5115// protocols that can allow "unsafe" and "unwise" chars.
5116unsafeProtocol = {
5117 'javascript': true,
5118 'javascript:': true
5119},
5120
5121// protocols that never have a hostname.
5122hostlessProtocol = {
5123 'javascript': true,
5124 'javascript:': true
5125},
5126
5127// protocols that always contain a // bit.
5128slashedProtocol = {
5129 'http': true,
5130 'https': true,
5131 'ftp': true,
5132 'gopher': true,
5133 'file': true,
5134 'http:': true,
5135 'https:': true,
5136 'ftp:': true,
5137 'gopher:': true,
5138 'file:': true
5139},
5140 querystring = __webpack_require__(64);
5141
5142function urlParse(url, parseQueryString, slashesDenoteHost) {
5143 if (url && util.isObject(url) && url instanceof Url) return url;
5144
5145 var u = new Url();
5146 u.parse(url, parseQueryString, slashesDenoteHost);
5147 return u;
5148}
5149
5150Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) {
5151 if (!util.isString(url)) {
5152 throw new TypeError("Parameter 'url' must be a string, not " + (typeof url === 'undefined' ? 'undefined' : _typeof(url)));
5153 }
5154
5155 // Copy chrome, IE, opera backslash-handling behavior.
5156 // Back slashes before the query string get converted to forward slashes
5157 // See: https://code.google.com/p/chromium/issues/detail?id=25916
5158 var queryIndex = url.indexOf('?'),
5159 splitter = queryIndex !== -1 && queryIndex < url.indexOf('#') ? '?' : '#',
5160 uSplit = url.split(splitter),
5161 slashRegex = /\\/g;
5162 uSplit[0] = uSplit[0].replace(slashRegex, '/');
5163 url = uSplit.join(splitter);
5164
5165 var rest = url;
5166
5167 // trim before proceeding.
5168 // This is to support parse stuff like " http://foo.com \n"
5169 rest = rest.trim();
5170
5171 if (!slashesDenoteHost && url.split('#').length === 1) {
5172 // Try fast path regexp
5173 var simplePath = simplePathPattern.exec(rest);
5174 if (simplePath) {
5175 this.path = rest;
5176 this.href = rest;
5177 this.pathname = simplePath[1];
5178 if (simplePath[2]) {
5179 this.search = simplePath[2];
5180 if (parseQueryString) {
5181 this.query = querystring.parse(this.search.substr(1));
5182 } else {
5183 this.query = this.search.substr(1);
5184 }
5185 } else if (parseQueryString) {
5186 this.search = '';
5187 this.query = {};
5188 }
5189 return this;
5190 }
5191 }
5192
5193 var proto = protocolPattern.exec(rest);
5194 if (proto) {
5195 proto = proto[0];
5196 var lowerProto = proto.toLowerCase();
5197 this.protocol = lowerProto;
5198 rest = rest.substr(proto.length);
5199 }
5200
5201 // figure out if it's got a host
5202 // user@server is *always* interpreted as a hostname, and url
5203 // resolution will treat //foo/bar as host=foo,path=bar because that's
5204 // how the browser resolves relative URLs.
5205 if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
5206 var slashes = rest.substr(0, 2) === '//';
5207 if (slashes && !(proto && hostlessProtocol[proto])) {
5208 rest = rest.substr(2);
5209 this.slashes = true;
5210 }
5211 }
5212
5213 if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
5214
5215 // there's a hostname.
5216 // the first instance of /, ?, ;, or # ends the host.
5217 //
5218 // If there is an @ in the hostname, then non-host chars *are* allowed
5219 // to the left of the last @ sign, unless some host-ending character
5220 // comes *before* the @-sign.
5221 // URLs are obnoxious.
5222 //
5223 // ex:
5224 // http://a@b@c/ => user:a@b host:c
5225 // http://a@b?@c => user:a host:c path:/?@c
5226
5227 // v0.12 TODO(isaacs): This is not quite how Chrome does things.
5228 // Review our test case against browsers more comprehensively.
5229
5230 // find the first instance of any hostEndingChars
5231 var hostEnd = -1;
5232 for (var i = 0; i < hostEndingChars.length; i++) {
5233 var hec = rest.indexOf(hostEndingChars[i]);
5234 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec;
5235 }
5236
5237 // at this point, either we have an explicit point where the
5238 // auth portion cannot go past, or the last @ char is the decider.
5239 var auth, atSign;
5240 if (hostEnd === -1) {
5241 // atSign can be anywhere.
5242 atSign = rest.lastIndexOf('@');
5243 } else {
5244 // atSign must be in auth portion.
5245 // http://a@b/c@d => host:b auth:a path:/c@d
5246 atSign = rest.lastIndexOf('@', hostEnd);
5247 }
5248
5249 // Now we have a portion which is definitely the auth.
5250 // Pull that off.
5251 if (atSign !== -1) {
5252 auth = rest.slice(0, atSign);
5253 rest = rest.slice(atSign + 1);
5254 this.auth = decodeURIComponent(auth);
5255 }
5256
5257 // the host is the remaining to the left of the first non-host char
5258 hostEnd = -1;
5259 for (var i = 0; i < nonHostChars.length; i++) {
5260 var hec = rest.indexOf(nonHostChars[i]);
5261 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec;
5262 }
5263 // if we still have not hit it, then the entire thing is a host.
5264 if (hostEnd === -1) hostEnd = rest.length;
5265
5266 this.host = rest.slice(0, hostEnd);
5267 rest = rest.slice(hostEnd);
5268
5269 // pull out port.
5270 this.parseHost();
5271
5272 // we've indicated that there is a hostname,
5273 // so even if it's empty, it has to be present.
5274 this.hostname = this.hostname || '';
5275
5276 // if hostname begins with [ and ends with ]
5277 // assume that it's an IPv6 address.
5278 var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']';
5279
5280 // validate a little.
5281 if (!ipv6Hostname) {
5282 var hostparts = this.hostname.split(/\./);
5283 for (var i = 0, l = hostparts.length; i < l; i++) {
5284 var part = hostparts[i];
5285 if (!part) continue;
5286 if (!part.match(hostnamePartPattern)) {
5287 var newpart = '';
5288 for (var j = 0, k = part.length; j < k; j++) {
5289 if (part.charCodeAt(j) > 127) {
5290 // we replace non-ASCII char with a temporary placeholder
5291 // we need this to make sure size of hostname is not
5292 // broken by replacing non-ASCII by nothing
5293 newpart += 'x';
5294 } else {
5295 newpart += part[j];
5296 }
5297 }
5298 // we test again with ASCII char only
5299 if (!newpart.match(hostnamePartPattern)) {
5300 var validParts = hostparts.slice(0, i);
5301 var notHost = hostparts.slice(i + 1);
5302 var bit = part.match(hostnamePartStart);
5303 if (bit) {
5304 validParts.push(bit[1]);
5305 notHost.unshift(bit[2]);
5306 }
5307 if (notHost.length) {
5308 rest = '/' + notHost.join('.') + rest;
5309 }
5310 this.hostname = validParts.join('.');
5311 break;
5312 }
5313 }
5314 }
5315 }
5316
5317 if (this.hostname.length > hostnameMaxLen) {
5318 this.hostname = '';
5319 } else {
5320 // hostnames are always lower case.
5321 this.hostname = this.hostname.toLowerCase();
5322 }
5323
5324 if (!ipv6Hostname) {
5325 // IDNA Support: Returns a punycoded representation of "domain".
5326 // It only converts parts of the domain name that
5327 // have non-ASCII characters, i.e. it doesn't matter if
5328 // you call it with a domain that already is ASCII-only.
5329 this.hostname = punycode.toASCII(this.hostname);
5330 }
5331
5332 var p = this.port ? ':' + this.port : '';
5333 var h = this.hostname || '';
5334 this.host = h + p;
5335 this.href += this.host;
5336
5337 // strip [ and ] from the hostname
5338 // the host field still retains them, though
5339 if (ipv6Hostname) {
5340 this.hostname = this.hostname.substr(1, this.hostname.length - 2);
5341 if (rest[0] !== '/') {
5342 rest = '/' + rest;
5343 }
5344 }
5345 }
5346
5347 // now rest is set to the post-host stuff.
5348 // chop off any delim chars.
5349 if (!unsafeProtocol[lowerProto]) {
5350
5351 // First, make 100% sure that any "autoEscape" chars get
5352 // escaped, even if encodeURIComponent doesn't think they
5353 // need to be.
5354 for (var i = 0, l = autoEscape.length; i < l; i++) {
5355 var ae = autoEscape[i];
5356 if (rest.indexOf(ae) === -1) continue;
5357 var esc = encodeURIComponent(ae);
5358 if (esc === ae) {
5359 esc = escape(ae);
5360 }
5361 rest = rest.split(ae).join(esc);
5362 }
5363 }
5364
5365 // chop off from the tail first.
5366 var hash = rest.indexOf('#');
5367 if (hash !== -1) {
5368 // got a fragment string.
5369 this.hash = rest.substr(hash);
5370 rest = rest.slice(0, hash);
5371 }
5372 var qm = rest.indexOf('?');
5373 if (qm !== -1) {
5374 this.search = rest.substr(qm);
5375 this.query = rest.substr(qm + 1);
5376 if (parseQueryString) {
5377 this.query = querystring.parse(this.query);
5378 }
5379 rest = rest.slice(0, qm);
5380 } else if (parseQueryString) {
5381 // no query string, but parseQueryString still requested
5382 this.search = '';
5383 this.query = {};
5384 }
5385 if (rest) this.pathname = rest;
5386 if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
5387 this.pathname = '/';
5388 }
5389
5390 //to support http.request
5391 if (this.pathname || this.search) {
5392 var p = this.pathname || '';
5393 var s = this.search || '';
5394 this.path = p + s;
5395 }
5396
5397 // finally, reconstruct the href based on what has been validated.
5398 this.href = this.format();
5399 return this;
5400};
5401
5402// format a parsed object into a url string
5403function urlFormat(obj) {
5404 // ensure it's an object, and not a string url.
5405 // If it's an obj, this is a no-op.
5406 // this way, you can call url_format() on strings
5407 // to clean up potentially wonky urls.
5408 if (util.isString(obj)) obj = urlParse(obj);
5409 if (!(obj instanceof Url)) return Url.prototype.format.call(obj);
5410 return obj.format();
5411}
5412
5413Url.prototype.format = function () {
5414 var auth = this.auth || '';
5415 if (auth) {
5416 auth = encodeURIComponent(auth);
5417 auth = auth.replace(/%3A/i, ':');
5418 auth += '@';
5419 }
5420
5421 var protocol = this.protocol || '',
5422 pathname = this.pathname || '',
5423 hash = this.hash || '',
5424 host = false,
5425 query = '';
5426
5427 if (this.host) {
5428 host = auth + this.host;
5429 } else if (this.hostname) {
5430 host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']');
5431 if (this.port) {
5432 host += ':' + this.port;
5433 }
5434 }
5435
5436 if (this.query && util.isObject(this.query) && Object.keys(this.query).length) {
5437 query = querystring.stringify(this.query);
5438 }
5439
5440 var search = this.search || query && '?' + query || '';
5441
5442 if (protocol && protocol.substr(-1) !== ':') protocol += ':';
5443
5444 // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.
5445 // unless they had them to begin with.
5446 if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {
5447 host = '//' + (host || '');
5448 if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
5449 } else if (!host) {
5450 host = '';
5451 }
5452
5453 if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
5454 if (search && search.charAt(0) !== '?') search = '?' + search;
5455
5456 pathname = pathname.replace(/[?#]/g, function (match) {
5457 return encodeURIComponent(match);
5458 });
5459 search = search.replace('#', '%23');
5460
5461 return protocol + host + pathname + search + hash;
5462};
5463
5464function urlResolve(source, relative) {
5465 return urlParse(source, false, true).resolve(relative);
5466}
5467
5468Url.prototype.resolve = function (relative) {
5469 return this.resolveObject(urlParse(relative, false, true)).format();
5470};
5471
5472function urlResolveObject(source, relative) {
5473 if (!source) return relative;
5474 return urlParse(source, false, true).resolveObject(relative);
5475}
5476
5477Url.prototype.resolveObject = function (relative) {
5478 if (util.isString(relative)) {
5479 var rel = new Url();
5480 rel.parse(relative, false, true);
5481 relative = rel;
5482 }
5483
5484 var result = new Url();
5485 var tkeys = Object.keys(this);
5486 for (var tk = 0; tk < tkeys.length; tk++) {
5487 var tkey = tkeys[tk];
5488 result[tkey] = this[tkey];
5489 }
5490
5491 // hash is always overridden, no matter what.
5492 // even href="" will remove it.
5493 result.hash = relative.hash;
5494
5495 // if the relative url is empty, then there's nothing left to do here.
5496 if (relative.href === '') {
5497 result.href = result.format();
5498 return result;
5499 }
5500
5501 // hrefs like //foo/bar always cut to the protocol.
5502 if (relative.slashes && !relative.protocol) {
5503 // take everything except the protocol from relative
5504 var rkeys = Object.keys(relative);
5505 for (var rk = 0; rk < rkeys.length; rk++) {
5506 var rkey = rkeys[rk];
5507 if (rkey !== 'protocol') result[rkey] = relative[rkey];
5508 }
5509
5510 //urlParse appends trailing / to urls like http://www.example.com
5511 if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) {
5512 result.path = result.pathname = '/';
5513 }
5514
5515 result.href = result.format();
5516 return result;
5517 }
5518
5519 if (relative.protocol && relative.protocol !== result.protocol) {
5520 // if it's a known url protocol, then changing
5521 // the protocol does weird things
5522 // first, if it's not file:, then we MUST have a host,
5523 // and if there was a path
5524 // to begin with, then we MUST have a path.
5525 // if it is file:, then the host is dropped,
5526 // because that's known to be hostless.
5527 // anything else is assumed to be absolute.
5528 if (!slashedProtocol[relative.protocol]) {
5529 var keys = Object.keys(relative);
5530 for (var v = 0; v < keys.length; v++) {
5531 var k = keys[v];
5532 result[k] = relative[k];
5533 }
5534 result.href = result.format();
5535 return result;
5536 }
5537
5538 result.protocol = relative.protocol;
5539 if (!relative.host && !hostlessProtocol[relative.protocol]) {
5540 var relPath = (relative.pathname || '').split('/');
5541 while (relPath.length && !(relative.host = relPath.shift())) {}
5542 if (!relative.host) relative.host = '';
5543 if (!relative.hostname) relative.hostname = '';
5544 if (relPath[0] !== '') relPath.unshift('');
5545 if (relPath.length < 2) relPath.unshift('');
5546 result.pathname = relPath.join('/');
5547 } else {
5548 result.pathname = relative.pathname;
5549 }
5550 result.search = relative.search;
5551 result.query = relative.query;
5552 result.host = relative.host || '';
5553 result.auth = relative.auth;
5554 result.hostname = relative.hostname || relative.host;
5555 result.port = relative.port;
5556 // to support http.request
5557 if (result.pathname || result.search) {
5558 var p = result.pathname || '';
5559 var s = result.search || '';
5560 result.path = p + s;
5561 }
5562 result.slashes = result.slashes || relative.slashes;
5563 result.href = result.format();
5564 return result;
5565 }
5566
5567 var isSourceAbs = result.pathname && result.pathname.charAt(0) === '/',
5568 isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === '/',
5569 mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname,
5570 removeAllDots = mustEndAbs,
5571 srcPath = result.pathname && result.pathname.split('/') || [],
5572 relPath = relative.pathname && relative.pathname.split('/') || [],
5573 psychotic = result.protocol && !slashedProtocol[result.protocol];
5574
5575 // if the url is a non-slashed url, then relative
5576 // links like ../.. should be able
5577 // to crawl up to the hostname, as well. This is strange.
5578 // result.protocol has already been set by now.
5579 // Later on, put the first path part into the host field.
5580 if (psychotic) {
5581 result.hostname = '';
5582 result.port = null;
5583 if (result.host) {
5584 if (srcPath[0] === '') srcPath[0] = result.host;else srcPath.unshift(result.host);
5585 }
5586 result.host = '';
5587 if (relative.protocol) {
5588 relative.hostname = null;
5589 relative.port = null;
5590 if (relative.host) {
5591 if (relPath[0] === '') relPath[0] = relative.host;else relPath.unshift(relative.host);
5592 }
5593 relative.host = null;
5594 }
5595 mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
5596 }
5597
5598 if (isRelAbs) {
5599 // it's absolute.
5600 result.host = relative.host || relative.host === '' ? relative.host : result.host;
5601 result.hostname = relative.hostname || relative.hostname === '' ? relative.hostname : result.hostname;
5602 result.search = relative.search;
5603 result.query = relative.query;
5604 srcPath = relPath;
5605 // fall through to the dot-handling below.
5606 } else if (relPath.length) {
5607 // it's relative
5608 // throw away the existing file, and take the new path instead.
5609 if (!srcPath) srcPath = [];
5610 srcPath.pop();
5611 srcPath = srcPath.concat(relPath);
5612 result.search = relative.search;
5613 result.query = relative.query;
5614 } else if (!util.isNullOrUndefined(relative.search)) {
5615 // just pull out the search.
5616 // like href='?foo'.
5617 // Put this after the other two cases because it simplifies the booleans
5618 if (psychotic) {
5619 result.hostname = result.host = srcPath.shift();
5620 //occationaly the auth can get stuck only in host
5621 //this especially happens in cases like
5622 //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
5623 var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false;
5624 if (authInHost) {
5625 result.auth = authInHost.shift();
5626 result.host = result.hostname = authInHost.shift();
5627 }
5628 }
5629 result.search = relative.search;
5630 result.query = relative.query;
5631 //to support http.request
5632 if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
5633 result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : '');
5634 }
5635 result.href = result.format();
5636 return result;
5637 }
5638
5639 if (!srcPath.length) {
5640 // no path at all. easy.
5641 // we've already handled the other stuff above.
5642 result.pathname = null;
5643 //to support http.request
5644 if (result.search) {
5645 result.path = '/' + result.search;
5646 } else {
5647 result.path = null;
5648 }
5649 result.href = result.format();
5650 return result;
5651 }
5652
5653 // if a url ENDs in . or .., then it must get a trailing slash.
5654 // however, if it ends in anything else non-slashy,
5655 // then it must NOT get a trailing slash.
5656 var last = srcPath.slice(-1)[0];
5657 var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === '';
5658
5659 // strip single dots, resolve double dots to parent dir
5660 // if the path tries to go above the root, `up` ends up > 0
5661 var up = 0;
5662 for (var i = srcPath.length; i >= 0; i--) {
5663 last = srcPath[i];
5664 if (last === '.') {
5665 srcPath.splice(i, 1);
5666 } else if (last === '..') {
5667 srcPath.splice(i, 1);
5668 up++;
5669 } else if (up) {
5670 srcPath.splice(i, 1);
5671 up--;
5672 }
5673 }
5674
5675 // if the path is allowed to go above the root, restore leading ..s
5676 if (!mustEndAbs && !removeAllDots) {
5677 for (; up--; up) {
5678 srcPath.unshift('..');
5679 }
5680 }
5681
5682 if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
5683 srcPath.unshift('');
5684 }
5685
5686 if (hasTrailingSlash && srcPath.join('/').substr(-1) !== '/') {
5687 srcPath.push('');
5688 }
5689
5690 var isAbsolute = srcPath[0] === '' || srcPath[0] && srcPath[0].charAt(0) === '/';
5691
5692 // put the host back
5693 if (psychotic) {
5694 result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : '';
5695 //occationaly the auth can get stuck only in host
5696 //this especially happens in cases like
5697 //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
5698 var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false;
5699 if (authInHost) {
5700 result.auth = authInHost.shift();
5701 result.host = result.hostname = authInHost.shift();
5702 }
5703 }
5704
5705 mustEndAbs = mustEndAbs || result.host && srcPath.length;
5706
5707 if (mustEndAbs && !isAbsolute) {
5708 srcPath.unshift('');
5709 }
5710
5711 if (!srcPath.length) {
5712 result.pathname = null;
5713 result.path = null;
5714 } else {
5715 result.pathname = srcPath.join('/');
5716 }
5717
5718 //to support request.http
5719 if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
5720 result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : '');
5721 }
5722 result.auth = relative.auth || result.auth;
5723 result.slashes = result.slashes || relative.slashes;
5724 result.href = result.format();
5725 return result;
5726};
5727
5728Url.prototype.parseHost = function () {
5729 var host = this.host;
5730 var port = portPattern.exec(host);
5731 if (port) {
5732 port = port[0];
5733 if (port !== ':') {
5734 this.port = port.substr(1);
5735 }
5736 host = host.substr(0, host.length - port.length);
5737 }
5738 if (host) this.hostname = host;
5739};
5740
5741/***/ }),
5742/* 27 */
5743/***/ (function(module, exports, __webpack_require__) {
5744
5745"use strict";
5746
5747
5748// Generated by CoffeeScript 1.12.7
5749(function () {
5750 exports.defaults = {
5751 "0.1": {
5752 explicitCharkey: false,
5753 trim: true,
5754 normalize: true,
5755 normalizeTags: false,
5756 attrkey: "@",
5757 charkey: "#",
5758 explicitArray: false,
5759 ignoreAttrs: false,
5760 mergeAttrs: false,
5761 explicitRoot: false,
5762 validator: null,
5763 xmlns: false,
5764 explicitChildren: false,
5765 childkey: '@@',
5766 charsAsChildren: false,
5767 includeWhiteChars: false,
5768 async: false,
5769 strict: true,
5770 attrNameProcessors: null,
5771 attrValueProcessors: null,
5772 tagNameProcessors: null,
5773 valueProcessors: null,
5774 emptyTag: ''
5775 },
5776 "0.2": {
5777 explicitCharkey: false,
5778 trim: false,
5779 normalize: false,
5780 normalizeTags: false,
5781 attrkey: "$",
5782 charkey: "_",
5783 explicitArray: true,
5784 ignoreAttrs: false,
5785 mergeAttrs: false,
5786 explicitRoot: true,
5787 validator: null,
5788 xmlns: false,
5789 explicitChildren: false,
5790 preserveChildrenOrder: false,
5791 childkey: '$$',
5792 charsAsChildren: false,
5793 includeWhiteChars: false,
5794 async: false,
5795 strict: true,
5796 attrNameProcessors: null,
5797 attrValueProcessors: null,
5798 tagNameProcessors: null,
5799 valueProcessors: null,
5800 rootName: 'root',
5801 xmldec: {
5802 'version': '1.0',
5803 'encoding': 'UTF-8',
5804 'standalone': true
5805 },
5806 doctype: null,
5807 renderOpts: {
5808 'pretty': true,
5809 'indent': ' ',
5810 'newline': '\n'
5811 },
5812 headless: false,
5813 chunkSize: 10000,
5814 emptyTag: '',
5815 cdata: false
5816 }
5817 };
5818}).call(undefined);
5819
5820/***/ }),
5821/* 28 */
5822/***/ (function(module, exports, __webpack_require__) {
5823
5824"use strict";
5825
5826
5827// Generated by CoffeeScript 1.12.7
5828(function () {
5829 var XMLCData,
5830 XMLComment,
5831 XMLDTDAttList,
5832 XMLDTDElement,
5833 XMLDTDEntity,
5834 XMLDTDNotation,
5835 XMLDeclaration,
5836 XMLDocType,
5837 XMLElement,
5838 XMLProcessingInstruction,
5839 XMLRaw,
5840 XMLStringWriter,
5841 XMLText,
5842 XMLWriterBase,
5843 extend = function extend(child, parent) {
5844 for (var key in parent) {
5845 if (hasProp.call(parent, key)) child[key] = parent[key];
5846 }function ctor() {
5847 this.constructor = child;
5848 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
5849 },
5850 hasProp = {}.hasOwnProperty;
5851
5852 XMLDeclaration = __webpack_require__(15);
5853
5854 XMLDocType = __webpack_require__(16);
5855
5856 XMLCData = __webpack_require__(13);
5857
5858 XMLComment = __webpack_require__(14);
5859
5860 XMLElement = __webpack_require__(12);
5861
5862 XMLRaw = __webpack_require__(21);
5863
5864 XMLText = __webpack_require__(22);
5865
5866 XMLProcessingInstruction = __webpack_require__(23);
5867
5868 XMLDTDAttList = __webpack_require__(17);
5869
5870 XMLDTDElement = __webpack_require__(19);
5871
5872 XMLDTDEntity = __webpack_require__(18);
5873
5874 XMLDTDNotation = __webpack_require__(20);
5875
5876 XMLWriterBase = __webpack_require__(42);
5877
5878 module.exports = XMLStringWriter = function (superClass) {
5879 extend(XMLStringWriter, superClass);
5880
5881 function XMLStringWriter(options) {
5882 XMLStringWriter.__super__.constructor.call(this, options);
5883 }
5884
5885 XMLStringWriter.prototype.document = function (doc) {
5886 var child, i, len, r, ref;
5887 this.textispresent = false;
5888 r = '';
5889 ref = doc.children;
5890 for (i = 0, len = ref.length; i < len; i++) {
5891 child = ref[i];
5892 r += function () {
5893 switch (false) {
5894 case !(child instanceof XMLDeclaration):
5895 return this.declaration(child);
5896 case !(child instanceof XMLDocType):
5897 return this.docType(child);
5898 case !(child instanceof XMLComment):
5899 return this.comment(child);
5900 case !(child instanceof XMLProcessingInstruction):
5901 return this.processingInstruction(child);
5902 default:
5903 return this.element(child, 0);
5904 }
5905 }.call(this);
5906 }
5907 if (this.pretty && r.slice(-this.newline.length) === this.newline) {
5908 r = r.slice(0, -this.newline.length);
5909 }
5910 return r;
5911 };
5912
5913 XMLStringWriter.prototype.attribute = function (att) {
5914 return ' ' + att.name + '="' + att.value + '"';
5915 };
5916
5917 XMLStringWriter.prototype.cdata = function (node, level) {
5918 return this.space(level) + '<![CDATA[' + node.text + ']]>' + this.newline;
5919 };
5920
5921 XMLStringWriter.prototype.comment = function (node, level) {
5922 return this.space(level) + '<!-- ' + node.text + ' -->' + this.newline;
5923 };
5924
5925 XMLStringWriter.prototype.declaration = function (node, level) {
5926 var r;
5927 r = this.space(level);
5928 r += '<?xml version="' + node.version + '"';
5929 if (node.encoding != null) {
5930 r += ' encoding="' + node.encoding + '"';
5931 }
5932 if (node.standalone != null) {
5933 r += ' standalone="' + node.standalone + '"';
5934 }
5935 r += this.spacebeforeslash + '?>';
5936 r += this.newline;
5937 return r;
5938 };
5939
5940 XMLStringWriter.prototype.docType = function (node, level) {
5941 var child, i, len, r, ref;
5942 level || (level = 0);
5943 r = this.space(level);
5944 r += '<!DOCTYPE ' + node.root().name;
5945 if (node.pubID && node.sysID) {
5946 r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
5947 } else if (node.sysID) {
5948 r += ' SYSTEM "' + node.sysID + '"';
5949 }
5950 if (node.children.length > 0) {
5951 r += ' [';
5952 r += this.newline;
5953 ref = node.children;
5954 for (i = 0, len = ref.length; i < len; i++) {
5955 child = ref[i];
5956 r += function () {
5957 switch (false) {
5958 case !(child instanceof XMLDTDAttList):
5959 return this.dtdAttList(child, level + 1);
5960 case !(child instanceof XMLDTDElement):
5961 return this.dtdElement(child, level + 1);
5962 case !(child instanceof XMLDTDEntity):
5963 return this.dtdEntity(child, level + 1);
5964 case !(child instanceof XMLDTDNotation):
5965 return this.dtdNotation(child, level + 1);
5966 case !(child instanceof XMLCData):
5967 return this.cdata(child, level + 1);
5968 case !(child instanceof XMLComment):
5969 return this.comment(child, level + 1);
5970 case !(child instanceof XMLProcessingInstruction):
5971 return this.processingInstruction(child, level + 1);
5972 default:
5973 throw new Error("Unknown DTD node type: " + child.constructor.name);
5974 }
5975 }.call(this);
5976 }
5977 r += ']';
5978 }
5979 r += this.spacebeforeslash + '>';
5980 r += this.newline;
5981 return r;
5982 };
5983
5984 XMLStringWriter.prototype.element = function (node, level) {
5985 var att, child, i, j, len, len1, name, r, ref, ref1, ref2, space, textispresentwasset;
5986 level || (level = 0);
5987 textispresentwasset = false;
5988 if (this.textispresent) {
5989 this.newline = '';
5990 this.pretty = false;
5991 } else {
5992 this.newline = this.newlinedefault;
5993 this.pretty = this.prettydefault;
5994 }
5995 space = this.space(level);
5996 r = '';
5997 r += space + '<' + node.name;
5998 ref = node.attributes;
5999 for (name in ref) {
6000 if (!hasProp.call(ref, name)) continue;
6001 att = ref[name];
6002 r += this.attribute(att);
6003 }
6004 if (node.children.length === 0 || node.children.every(function (e) {
6005 return e.value === '';
6006 })) {
6007 if (this.allowEmpty) {
6008 r += '></' + node.name + '>' + this.newline;
6009 } else {
6010 r += this.spacebeforeslash + '/>' + this.newline;
6011 }
6012 } else if (this.pretty && node.children.length === 1 && node.children[0].value != null) {
6013 r += '>';
6014 r += node.children[0].value;
6015 r += '</' + node.name + '>' + this.newline;
6016 } else {
6017 if (this.dontprettytextnodes) {
6018 ref1 = node.children;
6019 for (i = 0, len = ref1.length; i < len; i++) {
6020 child = ref1[i];
6021 if (child.value != null) {
6022 this.textispresent++;
6023 textispresentwasset = true;
6024 break;
6025 }
6026 }
6027 }
6028 if (this.textispresent) {
6029 this.newline = '';
6030 this.pretty = false;
6031 space = this.space(level);
6032 }
6033 r += '>' + this.newline;
6034 ref2 = node.children;
6035 for (j = 0, len1 = ref2.length; j < len1; j++) {
6036 child = ref2[j];
6037 r += function () {
6038 switch (false) {
6039 case !(child instanceof XMLCData):
6040 return this.cdata(child, level + 1);
6041 case !(child instanceof XMLComment):
6042 return this.comment(child, level + 1);
6043 case !(child instanceof XMLElement):
6044 return this.element(child, level + 1);
6045 case !(child instanceof XMLRaw):
6046 return this.raw(child, level + 1);
6047 case !(child instanceof XMLText):
6048 return this.text(child, level + 1);
6049 case !(child instanceof XMLProcessingInstruction):
6050 return this.processingInstruction(child, level + 1);
6051 default:
6052 throw new Error("Unknown XML node type: " + child.constructor.name);
6053 }
6054 }.call(this);
6055 }
6056 if (textispresentwasset) {
6057 this.textispresent--;
6058 }
6059 if (!this.textispresent) {
6060 this.newline = this.newlinedefault;
6061 this.pretty = this.prettydefault;
6062 }
6063 r += space + '</' + node.name + '>' + this.newline;
6064 }
6065 return r;
6066 };
6067
6068 XMLStringWriter.prototype.processingInstruction = function (node, level) {
6069 var r;
6070 r = this.space(level) + '<?' + node.target;
6071 if (node.value) {
6072 r += ' ' + node.value;
6073 }
6074 r += this.spacebeforeslash + '?>' + this.newline;
6075 return r;
6076 };
6077
6078 XMLStringWriter.prototype.raw = function (node, level) {
6079 return this.space(level) + node.value + this.newline;
6080 };
6081
6082 XMLStringWriter.prototype.text = function (node, level) {
6083 return this.space(level) + node.value + this.newline;
6084 };
6085
6086 XMLStringWriter.prototype.dtdAttList = function (node, level) {
6087 var r;
6088 r = this.space(level) + '<!ATTLIST ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType;
6089 if (node.defaultValueType !== '#DEFAULT') {
6090 r += ' ' + node.defaultValueType;
6091 }
6092 if (node.defaultValue) {
6093 r += ' "' + node.defaultValue + '"';
6094 }
6095 r += this.spacebeforeslash + '>' + this.newline;
6096 return r;
6097 };
6098
6099 XMLStringWriter.prototype.dtdElement = function (node, level) {
6100 return this.space(level) + '<!ELEMENT ' + node.name + ' ' + node.value + this.spacebeforeslash + '>' + this.newline;
6101 };
6102
6103 XMLStringWriter.prototype.dtdEntity = function (node, level) {
6104 var r;
6105 r = this.space(level) + '<!ENTITY';
6106 if (node.pe) {
6107 r += ' %';
6108 }
6109 r += ' ' + node.name;
6110 if (node.value) {
6111 r += ' "' + node.value + '"';
6112 } else {
6113 if (node.pubID && node.sysID) {
6114 r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
6115 } else if (node.sysID) {
6116 r += ' SYSTEM "' + node.sysID + '"';
6117 }
6118 if (node.nData) {
6119 r += ' NDATA ' + node.nData;
6120 }
6121 }
6122 r += this.spacebeforeslash + '>' + this.newline;
6123 return r;
6124 };
6125
6126 XMLStringWriter.prototype.dtdNotation = function (node, level) {
6127 var r;
6128 r = this.space(level) + '<!NOTATION ' + node.name;
6129 if (node.pubID && node.sysID) {
6130 r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
6131 } else if (node.pubID) {
6132 r += ' PUBLIC "' + node.pubID + '"';
6133 } else if (node.sysID) {
6134 r += ' SYSTEM "' + node.sysID + '"';
6135 }
6136 r += this.spacebeforeslash + '>' + this.newline;
6137 return r;
6138 };
6139
6140 XMLStringWriter.prototype.openNode = function (node, level) {
6141 var att, name, r, ref;
6142 level || (level = 0);
6143 if (node instanceof XMLElement) {
6144 r = this.space(level) + '<' + node.name;
6145 ref = node.attributes;
6146 for (name in ref) {
6147 if (!hasProp.call(ref, name)) continue;
6148 att = ref[name];
6149 r += this.attribute(att);
6150 }
6151 r += (node.children ? '>' : '/>') + this.newline;
6152 return r;
6153 } else {
6154 r = this.space(level) + '<!DOCTYPE ' + node.rootNodeName;
6155 if (node.pubID && node.sysID) {
6156 r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
6157 } else if (node.sysID) {
6158 r += ' SYSTEM "' + node.sysID + '"';
6159 }
6160 r += (node.children ? ' [' : '>') + this.newline;
6161 return r;
6162 }
6163 };
6164
6165 XMLStringWriter.prototype.closeNode = function (node, level) {
6166 level || (level = 0);
6167 switch (false) {
6168 case !(node instanceof XMLElement):
6169 return this.space(level) + '</' + node.name + '>' + this.newline;
6170 case !(node instanceof XMLDocType):
6171 return this.space(level) + ']>' + this.newline;
6172 }
6173 };
6174
6175 return XMLStringWriter;
6176 }(XMLWriterBase);
6177}).call(undefined);
6178
6179/***/ }),
6180/* 29 */
6181/***/ (function(module, exports, __webpack_require__) {
6182
6183"use strict";
6184/* WEBPACK VAR INJECTION */(function(global) {
6185
6186var ClientRequest = __webpack_require__(49);
6187var response = __webpack_require__(32);
6188var extend = __webpack_require__(59);
6189var statusCodes = __webpack_require__(60);
6190var url = __webpack_require__(26);
6191
6192var http = exports;
6193
6194http.request = function (opts, cb) {
6195 if (typeof opts === 'string') opts = url.parse(opts);else opts = extend(opts);
6196
6197 // Normally, the page is loaded from http or https, so not specifying a protocol
6198 // will result in a (valid) protocol-relative url. However, this won't work if
6199 // the protocol is something else, like 'file:'
6200 var defaultProtocol = global.location.protocol.search(/^https?:$/) === -1 ? 'http:' : '';
6201
6202 var protocol = opts.protocol || defaultProtocol;
6203 var host = opts.hostname || opts.host;
6204 var port = opts.port;
6205 var path = opts.path || '/';
6206
6207 // Necessary for IPv6 addresses
6208 if (host && host.indexOf(':') !== -1) host = '[' + host + ']';
6209
6210 // This may be a relative url. The browser should always be able to interpret it correctly.
6211 opts.url = (host ? protocol + '//' + host : '') + (port ? ':' + port : '') + path;
6212 opts.method = (opts.method || 'GET').toUpperCase();
6213 opts.headers = opts.headers || {};
6214
6215 // Also valid opts.auth, opts.mode
6216
6217 var req = new ClientRequest(opts);
6218 if (cb) req.on('response', cb);
6219 return req;
6220};
6221
6222http.get = function get(opts, cb) {
6223 var req = http.request(opts, cb);
6224 req.end();
6225 return req;
6226};
6227
6228http.ClientRequest = ClientRequest;
6229http.IncomingMessage = response.IncomingMessage;
6230
6231http.Agent = function () {};
6232http.Agent.defaultMaxSockets = 4;
6233
6234http.globalAgent = new http.Agent();
6235
6236http.STATUS_CODES = statusCodes;
6237
6238http.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'];
6239/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
6240
6241/***/ }),
6242/* 30 */
6243/***/ (function(module, exports, __webpack_require__) {
6244
6245"use strict";
6246
6247
6248var toString = {}.toString;
6249
6250module.exports = Array.isArray || function (arr) {
6251 return toString.call(arr) == '[object Array]';
6252};
6253
6254/***/ }),
6255/* 31 */
6256/***/ (function(module, exports, __webpack_require__) {
6257
6258"use strict";
6259/* WEBPACK VAR INJECTION */(function(global) {
6260
6261exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream);
6262
6263exports.writableStream = isFunction(global.WritableStream);
6264
6265exports.abortController = isFunction(global.AbortController);
6266
6267exports.blobConstructor = false;
6268try {
6269 new Blob([new ArrayBuffer(1)]);
6270 exports.blobConstructor = true;
6271} catch (e) {}
6272
6273// The xhr request to example.com may violate some restrictive CSP configurations,
6274// so if we're running in a browser that supports `fetch`, avoid calling getXHR()
6275// and assume support for certain features below.
6276var xhr;
6277function getXHR() {
6278 // Cache the xhr value
6279 if (xhr !== undefined) return xhr;
6280
6281 if (global.XMLHttpRequest) {
6282 xhr = new global.XMLHttpRequest();
6283 // If XDomainRequest is available (ie only, where xhr might not work
6284 // cross domain), use the page location. Otherwise use example.com
6285 // Note: this doesn't actually make an http request.
6286 try {
6287 xhr.open('GET', global.XDomainRequest ? '/' : 'https://example.com');
6288 } catch (e) {
6289 xhr = null;
6290 }
6291 } else {
6292 // Service workers don't have XHR
6293 xhr = null;
6294 }
6295 return xhr;
6296}
6297
6298function checkTypeSupport(type) {
6299 var xhr = getXHR();
6300 if (!xhr) return false;
6301 try {
6302 xhr.responseType = type;
6303 return xhr.responseType === type;
6304 } catch (e) {}
6305 return false;
6306}
6307
6308// For some strange reason, Safari 7.0 reports typeof global.ArrayBuffer === 'object'.
6309// Safari 7.1 appears to have fixed this bug.
6310var haveArrayBuffer = typeof global.ArrayBuffer !== 'undefined';
6311var haveSlice = haveArrayBuffer && isFunction(global.ArrayBuffer.prototype.slice);
6312
6313// If fetch is supported, then arraybuffer will be supported too. Skip calling
6314// checkTypeSupport(), since that calls getXHR().
6315exports.arraybuffer = exports.fetch || haveArrayBuffer && checkTypeSupport('arraybuffer');
6316
6317// These next two tests unavoidably show warnings in Chrome. Since fetch will always
6318// be used if it's available, just return false for these to avoid the warnings.
6319exports.msstream = !exports.fetch && haveSlice && checkTypeSupport('ms-stream');
6320exports.mozchunkedarraybuffer = !exports.fetch && haveArrayBuffer && checkTypeSupport('moz-chunked-arraybuffer');
6321
6322// If fetch is supported, then overrideMimeType will be supported too. Skip calling
6323// getXHR().
6324exports.overrideMimeType = exports.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false);
6325
6326exports.vbArray = isFunction(global.VBArray);
6327
6328function isFunction(value) {
6329 return typeof value === 'function';
6330}
6331
6332xhr = null; // Help gc
6333/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
6334
6335/***/ }),
6336/* 32 */
6337/***/ (function(module, exports, __webpack_require__) {
6338
6339"use strict";
6340/* WEBPACK VAR INJECTION */(function(process, global, Buffer) {
6341
6342var capability = __webpack_require__(31);
6343var inherits = __webpack_require__(2);
6344var stream = __webpack_require__(7);
6345
6346var rStates = exports.readyStates = {
6347 UNSENT: 0,
6348 OPENED: 1,
6349 HEADERS_RECEIVED: 2,
6350 LOADING: 3,
6351 DONE: 4
6352};
6353
6354var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, fetchTimer) {
6355 var self = this;
6356 stream.Readable.call(self);
6357
6358 self._mode = mode;
6359 self.headers = {};
6360 self.rawHeaders = [];
6361 self.trailers = {};
6362 self.rawTrailers = [];
6363
6364 // Fake the 'close' event, but only once 'end' fires
6365 self.on('end', function () {
6366 // The nextTick is necessary to prevent the 'request' module from causing an infinite loop
6367 process.nextTick(function () {
6368 self.emit('close');
6369 });
6370 });
6371
6372 if (mode === 'fetch') {
6373 var read = function read() {
6374 reader.read().then(function (result) {
6375 if (self._destroyed) return;
6376 if (result.done) {
6377 global.clearTimeout(fetchTimer);
6378 self.push(null);
6379 return;
6380 }
6381 self.push(new Buffer(result.value));
6382 read();
6383 }).catch(function (err) {
6384 global.clearTimeout(fetchTimer);
6385 if (!self._destroyed) self.emit('error', err);
6386 });
6387 };
6388
6389 self._fetchResponse = response;
6390
6391 self.url = response.url;
6392 self.statusCode = response.status;
6393 self.statusMessage = response.statusText;
6394
6395 response.headers.forEach(function (header, key) {
6396 self.headers[key.toLowerCase()] = header;
6397 self.rawHeaders.push(key, header);
6398 });
6399
6400 if (capability.writableStream) {
6401 var writable = new WritableStream({
6402 write: function write(chunk) {
6403 return new Promise(function (resolve, reject) {
6404 if (self._destroyed) {
6405 reject();
6406 } else if (self.push(new Buffer(chunk))) {
6407 resolve();
6408 } else {
6409 self._resumeFetch = resolve;
6410 }
6411 });
6412 },
6413 close: function close() {
6414 global.clearTimeout(fetchTimer);
6415 if (!self._destroyed) self.push(null);
6416 },
6417 abort: function abort(err) {
6418 if (!self._destroyed) self.emit('error', err);
6419 }
6420 });
6421
6422 try {
6423 response.body.pipeTo(writable).catch(function (err) {
6424 global.clearTimeout(fetchTimer);
6425 if (!self._destroyed) self.emit('error', err);
6426 });
6427 return;
6428 } catch (e) {} // pipeTo method isn't defined. Can't find a better way to feature test this
6429 }
6430 // fallback for when writableStream or pipeTo aren't available
6431 var reader = response.body.getReader();
6432
6433 read();
6434 } else {
6435 self._xhr = xhr;
6436 self._pos = 0;
6437
6438 self.url = xhr.responseURL;
6439 self.statusCode = xhr.status;
6440 self.statusMessage = xhr.statusText;
6441 var headers = xhr.getAllResponseHeaders().split(/\r?\n/);
6442 headers.forEach(function (header) {
6443 var matches = header.match(/^([^:]+):\s*(.*)/);
6444 if (matches) {
6445 var key = matches[1].toLowerCase();
6446 if (key === 'set-cookie') {
6447 if (self.headers[key] === undefined) {
6448 self.headers[key] = [];
6449 }
6450 self.headers[key].push(matches[2]);
6451 } else if (self.headers[key] !== undefined) {
6452 self.headers[key] += ', ' + matches[2];
6453 } else {
6454 self.headers[key] = matches[2];
6455 }
6456 self.rawHeaders.push(matches[1], matches[2]);
6457 }
6458 });
6459
6460 self._charset = 'x-user-defined';
6461 if (!capability.overrideMimeType) {
6462 var mimeType = self.rawHeaders['mime-type'];
6463 if (mimeType) {
6464 var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/);
6465 if (charsetMatch) {
6466 self._charset = charsetMatch[1].toLowerCase();
6467 }
6468 }
6469 if (!self._charset) self._charset = 'utf-8'; // best guess
6470 }
6471 }
6472};
6473
6474inherits(IncomingMessage, stream.Readable);
6475
6476IncomingMessage.prototype._read = function () {
6477 var self = this;
6478
6479 var resolve = self._resumeFetch;
6480 if (resolve) {
6481 self._resumeFetch = null;
6482 resolve();
6483 }
6484};
6485
6486IncomingMessage.prototype._onXHRProgress = function () {
6487 var self = this;
6488
6489 var xhr = self._xhr;
6490
6491 var response = null;
6492 switch (self._mode) {
6493 case 'text:vbarray':
6494 // For IE9
6495 if (xhr.readyState !== rStates.DONE) break;
6496 try {
6497 // This fails in IE8
6498 response = new global.VBArray(xhr.responseBody).toArray();
6499 } catch (e) {}
6500 if (response !== null) {
6501 self.push(new Buffer(response));
6502 break;
6503 }
6504 // Falls through in IE8
6505 case 'text':
6506 try {
6507 // This will fail when readyState = 3 in IE9. Switch mode and wait for readyState = 4
6508 response = xhr.responseText;
6509 } catch (e) {
6510 self._mode = 'text:vbarray';
6511 break;
6512 }
6513 if (response.length > self._pos) {
6514 var newData = response.substr(self._pos);
6515 if (self._charset === 'x-user-defined') {
6516 var buffer = new Buffer(newData.length);
6517 for (var i = 0; i < newData.length; i++) {
6518 buffer[i] = newData.charCodeAt(i) & 0xff;
6519 }self.push(buffer);
6520 } else {
6521 self.push(newData, self._charset);
6522 }
6523 self._pos = response.length;
6524 }
6525 break;
6526 case 'arraybuffer':
6527 if (xhr.readyState !== rStates.DONE || !xhr.response) break;
6528 response = xhr.response;
6529 self.push(new Buffer(new Uint8Array(response)));
6530 break;
6531 case 'moz-chunked-arraybuffer':
6532 // take whole
6533 response = xhr.response;
6534 if (xhr.readyState !== rStates.LOADING || !response) break;
6535 self.push(new Buffer(new Uint8Array(response)));
6536 break;
6537 case 'ms-stream':
6538 response = xhr.response;
6539 if (xhr.readyState !== rStates.LOADING) break;
6540 var reader = new global.MSStreamReader();
6541 reader.onprogress = function () {
6542 if (reader.result.byteLength > self._pos) {
6543 self.push(new Buffer(new Uint8Array(reader.result.slice(self._pos))));
6544 self._pos = reader.result.byteLength;
6545 }
6546 };
6547 reader.onload = function () {
6548 self.push(null);
6549 };
6550 // reader.onerror = ??? // TODO: this
6551 reader.readAsArrayBuffer(response);
6552 break;
6553 }
6554
6555 // The ms-stream case handles end separately in reader.onload()
6556 if (self._xhr.readyState === rStates.DONE && self._mode !== 'ms-stream') {
6557 self.push(null);
6558 }
6559};
6560/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(1), __webpack_require__(5).Buffer))
6561
6562/***/ }),
6563/* 33 */
6564/***/ (function(module, exports, __webpack_require__) {
6565
6566"use strict";
6567/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
6568//
6569// Permission is hereby granted, free of charge, to any person obtaining a
6570// copy of this software and associated documentation files (the
6571// "Software"), to deal in the Software without restriction, including
6572// without limitation the rights to use, copy, modify, merge, publish,
6573// distribute, sublicense, and/or sell copies of the Software, and to permit
6574// persons to whom the Software is furnished to do so, subject to the
6575// following conditions:
6576//
6577// The above copyright notice and this permission notice shall be included
6578// in all copies or substantial portions of the Software.
6579//
6580// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6581// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6582// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
6583// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
6584// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
6585// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
6586// USE OR OTHER DEALINGS IN THE SOFTWARE.
6587
6588
6589
6590/*<replacement>*/
6591
6592var pna = __webpack_require__(9);
6593/*</replacement>*/
6594
6595module.exports = Readable;
6596
6597/*<replacement>*/
6598var isArray = __webpack_require__(30);
6599/*</replacement>*/
6600
6601/*<replacement>*/
6602var Duplex;
6603/*</replacement>*/
6604
6605Readable.ReadableState = ReadableState;
6606
6607/*<replacement>*/
6608var EE = __webpack_require__(10).EventEmitter;
6609
6610var EElistenerCount = function EElistenerCount(emitter, type) {
6611 return emitter.listeners(type).length;
6612};
6613/*</replacement>*/
6614
6615/*<replacement>*/
6616var Stream = __webpack_require__(34);
6617/*</replacement>*/
6618
6619/*<replacement>*/
6620
6621var Buffer = __webpack_require__(11).Buffer;
6622var OurUint8Array = global.Uint8Array || function () {};
6623function _uint8ArrayToBuffer(chunk) {
6624 return Buffer.from(chunk);
6625}
6626function _isUint8Array(obj) {
6627 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
6628}
6629
6630/*</replacement>*/
6631
6632/*<replacement>*/
6633var util = __webpack_require__(8);
6634util.inherits = __webpack_require__(2);
6635/*</replacement>*/
6636
6637/*<replacement>*/
6638var debugUtil = __webpack_require__(52);
6639var debug = void 0;
6640if (debugUtil && debugUtil.debuglog) {
6641 debug = debugUtil.debuglog('stream');
6642} else {
6643 debug = function debug() {};
6644}
6645/*</replacement>*/
6646
6647var BufferList = __webpack_require__(53);
6648var destroyImpl = __webpack_require__(35);
6649var StringDecoder;
6650
6651util.inherits(Readable, Stream);
6652
6653var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
6654
6655function prependListener(emitter, event, fn) {
6656 // Sadly this is not cacheable as some libraries bundle their own
6657 // event emitter implementation with them.
6658 if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
6659
6660 // This is a hack to make sure that our error handler is attached before any
6661 // userland ones. NEVER DO THIS. This is here only because this code needs
6662 // to continue to work with older versions of Node.js that do not include
6663 // the prependListener() method. The goal is to eventually remove this hack.
6664 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]];
6665}
6666
6667function ReadableState(options, stream) {
6668 Duplex = Duplex || __webpack_require__(4);
6669
6670 options = options || {};
6671
6672 // Duplex streams are both readable and writable, but share
6673 // the same options object.
6674 // However, some cases require setting options to different
6675 // values for the readable and the writable sides of the duplex stream.
6676 // These options can be provided separately as readableXXX and writableXXX.
6677 var isDuplex = stream instanceof Duplex;
6678
6679 // object stream flag. Used to make read(n) ignore n and to
6680 // make all the buffer merging and length checks go away
6681 this.objectMode = !!options.objectMode;
6682
6683 if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
6684
6685 // the point at which it stops calling _read() to fill the buffer
6686 // Note: 0 is a valid value, means "don't call _read preemptively ever"
6687 var hwm = options.highWaterMark;
6688 var readableHwm = options.readableHighWaterMark;
6689 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
6690
6691 if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
6692
6693 // cast to ints.
6694 this.highWaterMark = Math.floor(this.highWaterMark);
6695
6696 // A linked list is used to store data chunks instead of an array because the
6697 // linked list can remove elements from the beginning faster than
6698 // array.shift()
6699 this.buffer = new BufferList();
6700 this.length = 0;
6701 this.pipes = null;
6702 this.pipesCount = 0;
6703 this.flowing = null;
6704 this.ended = false;
6705 this.endEmitted = false;
6706 this.reading = false;
6707
6708 // a flag to be able to tell if the event 'readable'/'data' is emitted
6709 // immediately, or on a later tick. We set this to true at first, because
6710 // any actions that shouldn't happen until "later" should generally also
6711 // not happen before the first read call.
6712 this.sync = true;
6713
6714 // whenever we return null, then we set a flag to say
6715 // that we're awaiting a 'readable' event emission.
6716 this.needReadable = false;
6717 this.emittedReadable = false;
6718 this.readableListening = false;
6719 this.resumeScheduled = false;
6720
6721 // has it been destroyed
6722 this.destroyed = false;
6723
6724 // Crypto is kind of old and crusty. Historically, its default string
6725 // encoding is 'binary' so we have to make this configurable.
6726 // Everything else in the universe uses 'utf8', though.
6727 this.defaultEncoding = options.defaultEncoding || 'utf8';
6728
6729 // the number of writers that are awaiting a drain event in .pipe()s
6730 this.awaitDrain = 0;
6731
6732 // if true, a maybeReadMore has been scheduled
6733 this.readingMore = false;
6734
6735 this.decoder = null;
6736 this.encoding = null;
6737 if (options.encoding) {
6738 if (!StringDecoder) StringDecoder = __webpack_require__(25).StringDecoder;
6739 this.decoder = new StringDecoder(options.encoding);
6740 this.encoding = options.encoding;
6741 }
6742}
6743
6744function Readable(options) {
6745 Duplex = Duplex || __webpack_require__(4);
6746
6747 if (!(this instanceof Readable)) return new Readable(options);
6748
6749 this._readableState = new ReadableState(options, this);
6750
6751 // legacy
6752 this.readable = true;
6753
6754 if (options) {
6755 if (typeof options.read === 'function') this._read = options.read;
6756
6757 if (typeof options.destroy === 'function') this._destroy = options.destroy;
6758 }
6759
6760 Stream.call(this);
6761}
6762
6763Object.defineProperty(Readable.prototype, 'destroyed', {
6764 get: function get() {
6765 if (this._readableState === undefined) {
6766 return false;
6767 }
6768 return this._readableState.destroyed;
6769 },
6770 set: function set(value) {
6771 // we ignore the value if the stream
6772 // has not been initialized yet
6773 if (!this._readableState) {
6774 return;
6775 }
6776
6777 // backward compatibility, the user is explicitly
6778 // managing destroyed
6779 this._readableState.destroyed = value;
6780 }
6781});
6782
6783Readable.prototype.destroy = destroyImpl.destroy;
6784Readable.prototype._undestroy = destroyImpl.undestroy;
6785Readable.prototype._destroy = function (err, cb) {
6786 this.push(null);
6787 cb(err);
6788};
6789
6790// Manually shove something into the read() buffer.
6791// This returns true if the highWaterMark has not been hit yet,
6792// similar to how Writable.write() returns true if you should
6793// write() some more.
6794Readable.prototype.push = function (chunk, encoding) {
6795 var state = this._readableState;
6796 var skipChunkCheck;
6797
6798 if (!state.objectMode) {
6799 if (typeof chunk === 'string') {
6800 encoding = encoding || state.defaultEncoding;
6801 if (encoding !== state.encoding) {
6802 chunk = Buffer.from(chunk, encoding);
6803 encoding = '';
6804 }
6805 skipChunkCheck = true;
6806 }
6807 } else {
6808 skipChunkCheck = true;
6809 }
6810
6811 return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
6812};
6813
6814// Unshift should *always* be something directly out of read()
6815Readable.prototype.unshift = function (chunk) {
6816 return readableAddChunk(this, chunk, null, true, false);
6817};
6818
6819function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
6820 var state = stream._readableState;
6821 if (chunk === null) {
6822 state.reading = false;
6823 onEofChunk(stream, state);
6824 } else {
6825 var er;
6826 if (!skipChunkCheck) er = chunkInvalid(state, chunk);
6827 if (er) {
6828 stream.emit('error', er);
6829 } else if (state.objectMode || chunk && chunk.length > 0) {
6830 if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
6831 chunk = _uint8ArrayToBuffer(chunk);
6832 }
6833
6834 if (addToFront) {
6835 if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
6836 } else if (state.ended) {
6837 stream.emit('error', new Error('stream.push() after EOF'));
6838 } else {
6839 state.reading = false;
6840 if (state.decoder && !encoding) {
6841 chunk = state.decoder.write(chunk);
6842 if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
6843 } else {
6844 addChunk(stream, state, chunk, false);
6845 }
6846 }
6847 } else if (!addToFront) {
6848 state.reading = false;
6849 }
6850 }
6851
6852 return needMoreData(state);
6853}
6854
6855function addChunk(stream, state, chunk, addToFront) {
6856 if (state.flowing && state.length === 0 && !state.sync) {
6857 stream.emit('data', chunk);
6858 stream.read(0);
6859 } else {
6860 // update the buffer info.
6861 state.length += state.objectMode ? 1 : chunk.length;
6862 if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
6863
6864 if (state.needReadable) emitReadable(stream);
6865 }
6866 maybeReadMore(stream, state);
6867}
6868
6869function chunkInvalid(state, chunk) {
6870 var er;
6871 if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
6872 er = new TypeError('Invalid non-string/buffer chunk');
6873 }
6874 return er;
6875}
6876
6877// if it's past the high water mark, we can push in some more.
6878// Also, if we have no data yet, we can stand some
6879// more bytes. This is to work around cases where hwm=0,
6880// such as the repl. Also, if the push() triggered a
6881// readable event, and the user called read(largeNumber) such that
6882// needReadable was set, then we ought to push more, so that another
6883// 'readable' event will be triggered.
6884function needMoreData(state) {
6885 return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
6886}
6887
6888Readable.prototype.isPaused = function () {
6889 return this._readableState.flowing === false;
6890};
6891
6892// backwards compatibility.
6893Readable.prototype.setEncoding = function (enc) {
6894 if (!StringDecoder) StringDecoder = __webpack_require__(25).StringDecoder;
6895 this._readableState.decoder = new StringDecoder(enc);
6896 this._readableState.encoding = enc;
6897 return this;
6898};
6899
6900// Don't raise the hwm > 8MB
6901var MAX_HWM = 0x800000;
6902function computeNewHighWaterMark(n) {
6903 if (n >= MAX_HWM) {
6904 n = MAX_HWM;
6905 } else {
6906 // Get the next highest power of 2 to prevent increasing hwm excessively in
6907 // tiny amounts
6908 n--;
6909 n |= n >>> 1;
6910 n |= n >>> 2;
6911 n |= n >>> 4;
6912 n |= n >>> 8;
6913 n |= n >>> 16;
6914 n++;
6915 }
6916 return n;
6917}
6918
6919// This function is designed to be inlinable, so please take care when making
6920// changes to the function body.
6921function howMuchToRead(n, state) {
6922 if (n <= 0 || state.length === 0 && state.ended) return 0;
6923 if (state.objectMode) return 1;
6924 if (n !== n) {
6925 // Only flow one buffer at a time
6926 if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
6927 }
6928 // If we're asking for more than the current hwm, then raise the hwm.
6929 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
6930 if (n <= state.length) return n;
6931 // Don't have enough
6932 if (!state.ended) {
6933 state.needReadable = true;
6934 return 0;
6935 }
6936 return state.length;
6937}
6938
6939// you can override either this method, or the async _read(n) below.
6940Readable.prototype.read = function (n) {
6941 debug('read', n);
6942 n = parseInt(n, 10);
6943 var state = this._readableState;
6944 var nOrig = n;
6945
6946 if (n !== 0) state.emittedReadable = false;
6947
6948 // if we're doing read(0) to trigger a readable event, but we
6949 // already have a bunch of data in the buffer, then just trigger
6950 // the 'readable' event and move on.
6951 if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
6952 debug('read: emitReadable', state.length, state.ended);
6953 if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
6954 return null;
6955 }
6956
6957 n = howMuchToRead(n, state);
6958
6959 // if we've ended, and we're now clear, then finish it up.
6960 if (n === 0 && state.ended) {
6961 if (state.length === 0) endReadable(this);
6962 return null;
6963 }
6964
6965 // All the actual chunk generation logic needs to be
6966 // *below* the call to _read. The reason is that in certain
6967 // synthetic stream cases, such as passthrough streams, _read
6968 // may be a completely synchronous operation which may change
6969 // the state of the read buffer, providing enough data when
6970 // before there was *not* enough.
6971 //
6972 // So, the steps are:
6973 // 1. Figure out what the state of things will be after we do
6974 // a read from the buffer.
6975 //
6976 // 2. If that resulting state will trigger a _read, then call _read.
6977 // Note that this may be asynchronous, or synchronous. Yes, it is
6978 // deeply ugly to write APIs this way, but that still doesn't mean
6979 // that the Readable class should behave improperly, as streams are
6980 // designed to be sync/async agnostic.
6981 // Take note if the _read call is sync or async (ie, if the read call
6982 // has returned yet), so that we know whether or not it's safe to emit
6983 // 'readable' etc.
6984 //
6985 // 3. Actually pull the requested chunks out of the buffer and return.
6986
6987 // if we need a readable event, then we need to do some reading.
6988 var doRead = state.needReadable;
6989 debug('need readable', doRead);
6990
6991 // if we currently have less than the highWaterMark, then also read some
6992 if (state.length === 0 || state.length - n < state.highWaterMark) {
6993 doRead = true;
6994 debug('length less than watermark', doRead);
6995 }
6996
6997 // however, if we've ended, then there's no point, and if we're already
6998 // reading, then it's unnecessary.
6999 if (state.ended || state.reading) {
7000 doRead = false;
7001 debug('reading or ended', doRead);
7002 } else if (doRead) {
7003 debug('do read');
7004 state.reading = true;
7005 state.sync = true;
7006 // if the length is currently zero, then we *need* a readable event.
7007 if (state.length === 0) state.needReadable = true;
7008 // call internal read method
7009 this._read(state.highWaterMark);
7010 state.sync = false;
7011 // If _read pushed data synchronously, then `reading` will be false,
7012 // and we need to re-evaluate how much data we can return to the user.
7013 if (!state.reading) n = howMuchToRead(nOrig, state);
7014 }
7015
7016 var ret;
7017 if (n > 0) ret = fromList(n, state);else ret = null;
7018
7019 if (ret === null) {
7020 state.needReadable = true;
7021 n = 0;
7022 } else {
7023 state.length -= n;
7024 }
7025
7026 if (state.length === 0) {
7027 // If we have nothing in the buffer, then we want to know
7028 // as soon as we *do* get something into the buffer.
7029 if (!state.ended) state.needReadable = true;
7030
7031 // If we tried to read() past the EOF, then emit end on the next tick.
7032 if (nOrig !== n && state.ended) endReadable(this);
7033 }
7034
7035 if (ret !== null) this.emit('data', ret);
7036
7037 return ret;
7038};
7039
7040function onEofChunk(stream, state) {
7041 if (state.ended) return;
7042 if (state.decoder) {
7043 var chunk = state.decoder.end();
7044 if (chunk && chunk.length) {
7045 state.buffer.push(chunk);
7046 state.length += state.objectMode ? 1 : chunk.length;
7047 }
7048 }
7049 state.ended = true;
7050
7051 // emit 'readable' now to make sure it gets picked up.
7052 emitReadable(stream);
7053}
7054
7055// Don't emit readable right away in sync mode, because this can trigger
7056// another read() call => stack overflow. This way, it might trigger
7057// a nextTick recursion warning, but that's not so bad.
7058function emitReadable(stream) {
7059 var state = stream._readableState;
7060 state.needReadable = false;
7061 if (!state.emittedReadable) {
7062 debug('emitReadable', state.flowing);
7063 state.emittedReadable = true;
7064 if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
7065 }
7066}
7067
7068function emitReadable_(stream) {
7069 debug('emit readable');
7070 stream.emit('readable');
7071 flow(stream);
7072}
7073
7074// at this point, the user has presumably seen the 'readable' event,
7075// and called read() to consume some data. that may have triggered
7076// in turn another _read(n) call, in which case reading = true if
7077// it's in progress.
7078// However, if we're not ended, or reading, and the length < hwm,
7079// then go ahead and try to read some more preemptively.
7080function maybeReadMore(stream, state) {
7081 if (!state.readingMore) {
7082 state.readingMore = true;
7083 pna.nextTick(maybeReadMore_, stream, state);
7084 }
7085}
7086
7087function maybeReadMore_(stream, state) {
7088 var len = state.length;
7089 while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
7090 debug('maybeReadMore read 0');
7091 stream.read(0);
7092 if (len === state.length)
7093 // didn't get any data, stop spinning.
7094 break;else len = state.length;
7095 }
7096 state.readingMore = false;
7097}
7098
7099// abstract method. to be overridden in specific implementation classes.
7100// call cb(er, data) where data is <= n in length.
7101// for virtual (non-string, non-buffer) streams, "length" is somewhat
7102// arbitrary, and perhaps not very meaningful.
7103Readable.prototype._read = function (n) {
7104 this.emit('error', new Error('_read() is not implemented'));
7105};
7106
7107Readable.prototype.pipe = function (dest, pipeOpts) {
7108 var src = this;
7109 var state = this._readableState;
7110
7111 switch (state.pipesCount) {
7112 case 0:
7113 state.pipes = dest;
7114 break;
7115 case 1:
7116 state.pipes = [state.pipes, dest];
7117 break;
7118 default:
7119 state.pipes.push(dest);
7120 break;
7121 }
7122 state.pipesCount += 1;
7123 debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
7124
7125 var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
7126
7127 var endFn = doEnd ? onend : unpipe;
7128 if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
7129
7130 dest.on('unpipe', onunpipe);
7131 function onunpipe(readable, unpipeInfo) {
7132 debug('onunpipe');
7133 if (readable === src) {
7134 if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
7135 unpipeInfo.hasUnpiped = true;
7136 cleanup();
7137 }
7138 }
7139 }
7140
7141 function onend() {
7142 debug('onend');
7143 dest.end();
7144 }
7145
7146 // when the dest drains, it reduces the awaitDrain counter
7147 // on the source. This would be more elegant with a .once()
7148 // handler in flow(), but adding and removing repeatedly is
7149 // too slow.
7150 var ondrain = pipeOnDrain(src);
7151 dest.on('drain', ondrain);
7152
7153 var cleanedUp = false;
7154 function cleanup() {
7155 debug('cleanup');
7156 // cleanup event handlers once the pipe is broken
7157 dest.removeListener('close', onclose);
7158 dest.removeListener('finish', onfinish);
7159 dest.removeListener('drain', ondrain);
7160 dest.removeListener('error', onerror);
7161 dest.removeListener('unpipe', onunpipe);
7162 src.removeListener('end', onend);
7163 src.removeListener('end', unpipe);
7164 src.removeListener('data', ondata);
7165
7166 cleanedUp = true;
7167
7168 // if the reader is waiting for a drain event from this
7169 // specific writer, then it would cause it to never start
7170 // flowing again.
7171 // So, if this is awaiting a drain, then we just call it now.
7172 // If we don't know, then assume that we are waiting for one.
7173 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
7174 }
7175
7176 // If the user pushes more data while we're writing to dest then we'll end up
7177 // in ondata again. However, we only want to increase awaitDrain once because
7178 // dest will only emit one 'drain' event for the multiple writes.
7179 // => Introduce a guard on increasing awaitDrain.
7180 var increasedAwaitDrain = false;
7181 src.on('data', ondata);
7182 function ondata(chunk) {
7183 debug('ondata');
7184 increasedAwaitDrain = false;
7185 var ret = dest.write(chunk);
7186 if (false === ret && !increasedAwaitDrain) {
7187 // If the user unpiped during `dest.write()`, it is possible
7188 // to get stuck in a permanently paused state if that write
7189 // also returned false.
7190 // => Check whether `dest` is still a piping destination.
7191 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
7192 debug('false write response, pause', src._readableState.awaitDrain);
7193 src._readableState.awaitDrain++;
7194 increasedAwaitDrain = true;
7195 }
7196 src.pause();
7197 }
7198 }
7199
7200 // if the dest has an error, then stop piping into it.
7201 // however, don't suppress the throwing behavior for this.
7202 function onerror(er) {
7203 debug('onerror', er);
7204 unpipe();
7205 dest.removeListener('error', onerror);
7206 if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
7207 }
7208
7209 // Make sure our error handler is attached before userland ones.
7210 prependListener(dest, 'error', onerror);
7211
7212 // Both close and finish should trigger unpipe, but only once.
7213 function onclose() {
7214 dest.removeListener('finish', onfinish);
7215 unpipe();
7216 }
7217 dest.once('close', onclose);
7218 function onfinish() {
7219 debug('onfinish');
7220 dest.removeListener('close', onclose);
7221 unpipe();
7222 }
7223 dest.once('finish', onfinish);
7224
7225 function unpipe() {
7226 debug('unpipe');
7227 src.unpipe(dest);
7228 }
7229
7230 // tell the dest that it's being piped to
7231 dest.emit('pipe', src);
7232
7233 // start the flow if it hasn't been started already.
7234 if (!state.flowing) {
7235 debug('pipe resume');
7236 src.resume();
7237 }
7238
7239 return dest;
7240};
7241
7242function pipeOnDrain(src) {
7243 return function () {
7244 var state = src._readableState;
7245 debug('pipeOnDrain', state.awaitDrain);
7246 if (state.awaitDrain) state.awaitDrain--;
7247 if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
7248 state.flowing = true;
7249 flow(src);
7250 }
7251 };
7252}
7253
7254Readable.prototype.unpipe = function (dest) {
7255 var state = this._readableState;
7256 var unpipeInfo = { hasUnpiped: false };
7257
7258 // if we're not piping anywhere, then do nothing.
7259 if (state.pipesCount === 0) return this;
7260
7261 // just one destination. most common case.
7262 if (state.pipesCount === 1) {
7263 // passed in one, but it's not the right one.
7264 if (dest && dest !== state.pipes) return this;
7265
7266 if (!dest) dest = state.pipes;
7267
7268 // got a match.
7269 state.pipes = null;
7270 state.pipesCount = 0;
7271 state.flowing = false;
7272 if (dest) dest.emit('unpipe', this, unpipeInfo);
7273 return this;
7274 }
7275
7276 // slow case. multiple pipe destinations.
7277
7278 if (!dest) {
7279 // remove all.
7280 var dests = state.pipes;
7281 var len = state.pipesCount;
7282 state.pipes = null;
7283 state.pipesCount = 0;
7284 state.flowing = false;
7285
7286 for (var i = 0; i < len; i++) {
7287 dests[i].emit('unpipe', this, unpipeInfo);
7288 }return this;
7289 }
7290
7291 // try to find the right one.
7292 var index = indexOf(state.pipes, dest);
7293 if (index === -1) return this;
7294
7295 state.pipes.splice(index, 1);
7296 state.pipesCount -= 1;
7297 if (state.pipesCount === 1) state.pipes = state.pipes[0];
7298
7299 dest.emit('unpipe', this, unpipeInfo);
7300
7301 return this;
7302};
7303
7304// set up data events if they are asked for
7305// Ensure readable listeners eventually get something
7306Readable.prototype.on = function (ev, fn) {
7307 var res = Stream.prototype.on.call(this, ev, fn);
7308
7309 if (ev === 'data') {
7310 // Start flowing on next tick if stream isn't explicitly paused
7311 if (this._readableState.flowing !== false) this.resume();
7312 } else if (ev === 'readable') {
7313 var state = this._readableState;
7314 if (!state.endEmitted && !state.readableListening) {
7315 state.readableListening = state.needReadable = true;
7316 state.emittedReadable = false;
7317 if (!state.reading) {
7318 pna.nextTick(nReadingNextTick, this);
7319 } else if (state.length) {
7320 emitReadable(this);
7321 }
7322 }
7323 }
7324
7325 return res;
7326};
7327Readable.prototype.addListener = Readable.prototype.on;
7328
7329function nReadingNextTick(self) {
7330 debug('readable nexttick read 0');
7331 self.read(0);
7332}
7333
7334// pause() and resume() are remnants of the legacy readable stream API
7335// If the user uses them, then switch into old mode.
7336Readable.prototype.resume = function () {
7337 var state = this._readableState;
7338 if (!state.flowing) {
7339 debug('resume');
7340 state.flowing = true;
7341 resume(this, state);
7342 }
7343 return this;
7344};
7345
7346function resume(stream, state) {
7347 if (!state.resumeScheduled) {
7348 state.resumeScheduled = true;
7349 pna.nextTick(resume_, stream, state);
7350 }
7351}
7352
7353function resume_(stream, state) {
7354 if (!state.reading) {
7355 debug('resume read 0');
7356 stream.read(0);
7357 }
7358
7359 state.resumeScheduled = false;
7360 state.awaitDrain = 0;
7361 stream.emit('resume');
7362 flow(stream);
7363 if (state.flowing && !state.reading) stream.read(0);
7364}
7365
7366Readable.prototype.pause = function () {
7367 debug('call pause flowing=%j', this._readableState.flowing);
7368 if (false !== this._readableState.flowing) {
7369 debug('pause');
7370 this._readableState.flowing = false;
7371 this.emit('pause');
7372 }
7373 return this;
7374};
7375
7376function flow(stream) {
7377 var state = stream._readableState;
7378 debug('flow', state.flowing);
7379 while (state.flowing && stream.read() !== null) {}
7380}
7381
7382// wrap an old-style stream as the async data source.
7383// This is *not* part of the readable stream interface.
7384// It is an ugly unfortunate mess of history.
7385Readable.prototype.wrap = function (stream) {
7386 var _this = this;
7387
7388 var state = this._readableState;
7389 var paused = false;
7390
7391 stream.on('end', function () {
7392 debug('wrapped end');
7393 if (state.decoder && !state.ended) {
7394 var chunk = state.decoder.end();
7395 if (chunk && chunk.length) _this.push(chunk);
7396 }
7397
7398 _this.push(null);
7399 });
7400
7401 stream.on('data', function (chunk) {
7402 debug('wrapped data');
7403 if (state.decoder) chunk = state.decoder.write(chunk);
7404
7405 // don't skip over falsy values in objectMode
7406 if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
7407
7408 var ret = _this.push(chunk);
7409 if (!ret) {
7410 paused = true;
7411 stream.pause();
7412 }
7413 });
7414
7415 // proxy all the other methods.
7416 // important when wrapping filters and duplexes.
7417 for (var i in stream) {
7418 if (this[i] === undefined && typeof stream[i] === 'function') {
7419 this[i] = function (method) {
7420 return function () {
7421 return stream[method].apply(stream, arguments);
7422 };
7423 }(i);
7424 }
7425 }
7426
7427 // proxy certain important events.
7428 for (var n = 0; n < kProxyEvents.length; n++) {
7429 stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
7430 }
7431
7432 // when we try to consume some more bytes, simply unpause the
7433 // underlying stream.
7434 this._read = function (n) {
7435 debug('wrapped _read', n);
7436 if (paused) {
7437 paused = false;
7438 stream.resume();
7439 }
7440 };
7441
7442 return this;
7443};
7444
7445Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
7446 // making it explicit this property is not enumerable
7447 // because otherwise some prototype manipulation in
7448 // userland will fail
7449 enumerable: false,
7450 get: function get() {
7451 return this._readableState.highWaterMark;
7452 }
7453});
7454
7455// exposed for testing purposes only.
7456Readable._fromList = fromList;
7457
7458// Pluck off n bytes from an array of buffers.
7459// Length is the combined lengths of all the buffers in the list.
7460// This function is designed to be inlinable, so please take care when making
7461// changes to the function body.
7462function fromList(n, state) {
7463 // nothing buffered
7464 if (state.length === 0) return null;
7465
7466 var ret;
7467 if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
7468 // read it all, truncate the list
7469 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);
7470 state.buffer.clear();
7471 } else {
7472 // read part of list
7473 ret = fromListPartial(n, state.buffer, state.decoder);
7474 }
7475
7476 return ret;
7477}
7478
7479// Extracts only enough buffered data to satisfy the amount requested.
7480// This function is designed to be inlinable, so please take care when making
7481// changes to the function body.
7482function fromListPartial(n, list, hasStrings) {
7483 var ret;
7484 if (n < list.head.data.length) {
7485 // slice is the same for buffers and strings
7486 ret = list.head.data.slice(0, n);
7487 list.head.data = list.head.data.slice(n);
7488 } else if (n === list.head.data.length) {
7489 // first chunk is a perfect match
7490 ret = list.shift();
7491 } else {
7492 // result spans more than one buffer
7493 ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
7494 }
7495 return ret;
7496}
7497
7498// Copies a specified amount of characters from the list of buffered data
7499// chunks.
7500// This function is designed to be inlinable, so please take care when making
7501// changes to the function body.
7502function copyFromBufferString(n, list) {
7503 var p = list.head;
7504 var c = 1;
7505 var ret = p.data;
7506 n -= ret.length;
7507 while (p = p.next) {
7508 var str = p.data;
7509 var nb = n > str.length ? str.length : n;
7510 if (nb === str.length) ret += str;else ret += str.slice(0, n);
7511 n -= nb;
7512 if (n === 0) {
7513 if (nb === str.length) {
7514 ++c;
7515 if (p.next) list.head = p.next;else list.head = list.tail = null;
7516 } else {
7517 list.head = p;
7518 p.data = str.slice(nb);
7519 }
7520 break;
7521 }
7522 ++c;
7523 }
7524 list.length -= c;
7525 return ret;
7526}
7527
7528// Copies a specified amount of bytes from the list of buffered data chunks.
7529// This function is designed to be inlinable, so please take care when making
7530// changes to the function body.
7531function copyFromBuffer(n, list) {
7532 var ret = Buffer.allocUnsafe(n);
7533 var p = list.head;
7534 var c = 1;
7535 p.data.copy(ret);
7536 n -= p.data.length;
7537 while (p = p.next) {
7538 var buf = p.data;
7539 var nb = n > buf.length ? buf.length : n;
7540 buf.copy(ret, ret.length - n, 0, nb);
7541 n -= nb;
7542 if (n === 0) {
7543 if (nb === buf.length) {
7544 ++c;
7545 if (p.next) list.head = p.next;else list.head = list.tail = null;
7546 } else {
7547 list.head = p;
7548 p.data = buf.slice(nb);
7549 }
7550 break;
7551 }
7552 ++c;
7553 }
7554 list.length -= c;
7555 return ret;
7556}
7557
7558function endReadable(stream) {
7559 var state = stream._readableState;
7560
7561 // If we get here before consuming all the bytes, then that is a
7562 // bug in node. Should never happen.
7563 if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
7564
7565 if (!state.endEmitted) {
7566 state.ended = true;
7567 pna.nextTick(endReadableNT, state, stream);
7568 }
7569}
7570
7571function endReadableNT(state, stream) {
7572 // Check that we didn't get one last unshift.
7573 if (!state.endEmitted && state.length === 0) {
7574 state.endEmitted = true;
7575 stream.readable = false;
7576 stream.emit('end');
7577 }
7578}
7579
7580function indexOf(xs, x) {
7581 for (var i = 0, l = xs.length; i < l; i++) {
7582 if (xs[i] === x) return i;
7583 }
7584 return -1;
7585}
7586/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(6)))
7587
7588/***/ }),
7589/* 34 */
7590/***/ (function(module, exports, __webpack_require__) {
7591
7592"use strict";
7593
7594
7595module.exports = __webpack_require__(10).EventEmitter;
7596
7597/***/ }),
7598/* 35 */
7599/***/ (function(module, exports, __webpack_require__) {
7600
7601"use strict";
7602
7603
7604/*<replacement>*/
7605
7606var pna = __webpack_require__(9);
7607/*</replacement>*/
7608
7609// undocumented cb() API, needed for core, not for public API
7610function destroy(err, cb) {
7611 var _this = this;
7612
7613 var readableDestroyed = this._readableState && this._readableState.destroyed;
7614 var writableDestroyed = this._writableState && this._writableState.destroyed;
7615
7616 if (readableDestroyed || writableDestroyed) {
7617 if (cb) {
7618 cb(err);
7619 } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
7620 pna.nextTick(emitErrorNT, this, err);
7621 }
7622 return this;
7623 }
7624
7625 // we set destroyed to true before firing error callbacks in order
7626 // to make it re-entrance safe in case destroy() is called within callbacks
7627
7628 if (this._readableState) {
7629 this._readableState.destroyed = true;
7630 }
7631
7632 // if this is a duplex stream mark the writable part as destroyed as well
7633 if (this._writableState) {
7634 this._writableState.destroyed = true;
7635 }
7636
7637 this._destroy(err || null, function (err) {
7638 if (!cb && err) {
7639 pna.nextTick(emitErrorNT, _this, err);
7640 if (_this._writableState) {
7641 _this._writableState.errorEmitted = true;
7642 }
7643 } else if (cb) {
7644 cb(err);
7645 }
7646 });
7647
7648 return this;
7649}
7650
7651function undestroy() {
7652 if (this._readableState) {
7653 this._readableState.destroyed = false;
7654 this._readableState.reading = false;
7655 this._readableState.ended = false;
7656 this._readableState.endEmitted = false;
7657 }
7658
7659 if (this._writableState) {
7660 this._writableState.destroyed = false;
7661 this._writableState.ended = false;
7662 this._writableState.ending = false;
7663 this._writableState.finished = false;
7664 this._writableState.errorEmitted = false;
7665 }
7666}
7667
7668function emitErrorNT(self, err) {
7669 self.emit('error', err);
7670}
7671
7672module.exports = {
7673 destroy: destroy,
7674 undestroy: undestroy
7675};
7676
7677/***/ }),
7678/* 36 */
7679/***/ (function(module, exports, __webpack_require__) {
7680
7681"use strict";
7682/* WEBPACK VAR INJECTION */(function(global) {
7683
7684var scope = typeof global !== "undefined" && global || typeof self !== "undefined" && self || window;
7685var apply = Function.prototype.apply;
7686
7687// DOM APIs, for completeness
7688
7689exports.setTimeout = function () {
7690 return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
7691};
7692exports.setInterval = function () {
7693 return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
7694};
7695exports.clearTimeout = exports.clearInterval = function (timeout) {
7696 if (timeout) {
7697 timeout.close();
7698 }
7699};
7700
7701function Timeout(id, clearFn) {
7702 this._id = id;
7703 this._clearFn = clearFn;
7704}
7705Timeout.prototype.unref = Timeout.prototype.ref = function () {};
7706Timeout.prototype.close = function () {
7707 this._clearFn.call(scope, this._id);
7708};
7709
7710// Does not start the time, just sets up the members needed.
7711exports.enroll = function (item, msecs) {
7712 clearTimeout(item._idleTimeoutId);
7713 item._idleTimeout = msecs;
7714};
7715
7716exports.unenroll = function (item) {
7717 clearTimeout(item._idleTimeoutId);
7718 item._idleTimeout = -1;
7719};
7720
7721exports._unrefActive = exports.active = function (item) {
7722 clearTimeout(item._idleTimeoutId);
7723
7724 var msecs = item._idleTimeout;
7725 if (msecs >= 0) {
7726 item._idleTimeoutId = setTimeout(function onTimeout() {
7727 if (item._onTimeout) item._onTimeout();
7728 }, msecs);
7729 }
7730};
7731
7732// setimmediate attaches itself to the global object
7733__webpack_require__(55);
7734// On some exotic environments, it's not clear which object `setimmediate` was
7735// able to install onto. Search each possibility in the same order as the
7736// `setimmediate` library.
7737exports.setImmediate = typeof self !== "undefined" && self.setImmediate || typeof global !== "undefined" && global.setImmediate || undefined && undefined.setImmediate;
7738exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || typeof global !== "undefined" && global.clearImmediate || undefined && undefined.clearImmediate;
7739/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
7740
7741/***/ }),
7742/* 37 */
7743/***/ (function(module, exports, __webpack_require__) {
7744
7745"use strict";
7746// Copyright Joyent, Inc. and other Node contributors.
7747//
7748// Permission is hereby granted, free of charge, to any person obtaining a
7749// copy of this software and associated documentation files (the
7750// "Software"), to deal in the Software without restriction, including
7751// without limitation the rights to use, copy, modify, merge, publish,
7752// distribute, sublicense, and/or sell copies of the Software, and to permit
7753// persons to whom the Software is furnished to do so, subject to the
7754// following conditions:
7755//
7756// The above copyright notice and this permission notice shall be included
7757// in all copies or substantial portions of the Software.
7758//
7759// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
7760// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
7761// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
7762// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
7763// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
7764// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
7765// USE OR OTHER DEALINGS IN THE SOFTWARE.
7766
7767// a transform stream is a readable/writable stream where you do
7768// something with the data. Sometimes it's called a "filter",
7769// but that's not a great name for it, since that implies a thing where
7770// some bits pass through, and others are simply ignored. (That would
7771// be a valid example of a transform, of course.)
7772//
7773// While the output is causally related to the input, it's not a
7774// necessarily symmetric or synchronous transformation. For example,
7775// a zlib stream might take multiple plain-text writes(), and then
7776// emit a single compressed chunk some time in the future.
7777//
7778// Here's how this works:
7779//
7780// The Transform stream has all the aspects of the readable and writable
7781// stream classes. When you write(chunk), that calls _write(chunk,cb)
7782// internally, and returns false if there's a lot of pending writes
7783// buffered up. When you call read(), that calls _read(n) until
7784// there's enough pending readable data buffered up.
7785//
7786// In a transform stream, the written data is placed in a buffer. When
7787// _read(n) is called, it transforms the queued up data, calling the
7788// buffered _write cb's as it consumes chunks. If consuming a single
7789// written chunk would result in multiple output chunks, then the first
7790// outputted bit calls the readcb, and subsequent chunks just go into
7791// the read buffer, and will cause it to emit 'readable' if necessary.
7792//
7793// This way, back-pressure is actually determined by the reading side,
7794// since _read has to be called to start processing a new chunk. However,
7795// a pathological inflate type of transform can cause excessive buffering
7796// here. For example, imagine a stream where every byte of input is
7797// interpreted as an integer from 0-255, and then results in that many
7798// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
7799// 1kb of data being output. In this case, you could write a very small
7800// amount of input, and end up with a very large amount of output. In
7801// such a pathological inflating mechanism, there'd be no way to tell
7802// the system to stop doing the transform. A single 4MB write could
7803// cause the system to run out of memory.
7804//
7805// However, even in such a pathological case, only a single written chunk
7806// would be consumed, and then the rest would wait (un-transformed) until
7807// the results of the previous transformed chunk were consumed.
7808
7809
7810
7811module.exports = Transform;
7812
7813var Duplex = __webpack_require__(4);
7814
7815/*<replacement>*/
7816var util = __webpack_require__(8);
7817util.inherits = __webpack_require__(2);
7818/*</replacement>*/
7819
7820util.inherits(Transform, Duplex);
7821
7822function afterTransform(er, data) {
7823 var ts = this._transformState;
7824 ts.transforming = false;
7825
7826 var cb = ts.writecb;
7827
7828 if (!cb) {
7829 return this.emit('error', new Error('write callback called multiple times'));
7830 }
7831
7832 ts.writechunk = null;
7833 ts.writecb = null;
7834
7835 if (data != null) // single equals check for both `null` and `undefined`
7836 this.push(data);
7837
7838 cb(er);
7839
7840 var rs = this._readableState;
7841 rs.reading = false;
7842 if (rs.needReadable || rs.length < rs.highWaterMark) {
7843 this._read(rs.highWaterMark);
7844 }
7845}
7846
7847function Transform(options) {
7848 if (!(this instanceof Transform)) return new Transform(options);
7849
7850 Duplex.call(this, options);
7851
7852 this._transformState = {
7853 afterTransform: afterTransform.bind(this),
7854 needTransform: false,
7855 transforming: false,
7856 writecb: null,
7857 writechunk: null,
7858 writeencoding: null
7859 };
7860
7861 // start out asking for a readable event once data is transformed.
7862 this._readableState.needReadable = true;
7863
7864 // we have implemented the _read method, and done the other things
7865 // that Readable wants before the first _read call, so unset the
7866 // sync guard flag.
7867 this._readableState.sync = false;
7868
7869 if (options) {
7870 if (typeof options.transform === 'function') this._transform = options.transform;
7871
7872 if (typeof options.flush === 'function') this._flush = options.flush;
7873 }
7874
7875 // When the writable side finishes, then flush out anything remaining.
7876 this.on('prefinish', prefinish);
7877}
7878
7879function prefinish() {
7880 var _this = this;
7881
7882 if (typeof this._flush === 'function') {
7883 this._flush(function (er, data) {
7884 done(_this, er, data);
7885 });
7886 } else {
7887 done(this, null, null);
7888 }
7889}
7890
7891Transform.prototype.push = function (chunk, encoding) {
7892 this._transformState.needTransform = false;
7893 return Duplex.prototype.push.call(this, chunk, encoding);
7894};
7895
7896// This is the part where you do stuff!
7897// override this function in implementation classes.
7898// 'chunk' is an input chunk.
7899//
7900// Call `push(newChunk)` to pass along transformed output
7901// to the readable side. You may call 'push' zero or more times.
7902//
7903// Call `cb(err)` when you are done with this chunk. If you pass
7904// an error, then that'll put the hurt on the whole operation. If you
7905// never call cb(), then you'll never get another chunk.
7906Transform.prototype._transform = function (chunk, encoding, cb) {
7907 throw new Error('_transform() is not implemented');
7908};
7909
7910Transform.prototype._write = function (chunk, encoding, cb) {
7911 var ts = this._transformState;
7912 ts.writecb = cb;
7913 ts.writechunk = chunk;
7914 ts.writeencoding = encoding;
7915 if (!ts.transforming) {
7916 var rs = this._readableState;
7917 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
7918 }
7919};
7920
7921// Doesn't matter what the args are here.
7922// _transform does all the work.
7923// That we got here means that the readable side wants more data.
7924Transform.prototype._read = function (n) {
7925 var ts = this._transformState;
7926
7927 if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
7928 ts.transforming = true;
7929 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
7930 } else {
7931 // mark that we need a transform, so that any data that comes in
7932 // will get processed, now that we've asked for it.
7933 ts.needTransform = true;
7934 }
7935};
7936
7937Transform.prototype._destroy = function (err, cb) {
7938 var _this2 = this;
7939
7940 Duplex.prototype._destroy.call(this, err, function (err2) {
7941 cb(err2);
7942 _this2.emit('close');
7943 });
7944};
7945
7946function done(stream, er, data) {
7947 if (er) return stream.emit('error', er);
7948
7949 if (data != null) // single equals check for both `null` and `undefined`
7950 stream.push(data);
7951
7952 // if there's nothing in the write buffer, then that means
7953 // that nothing more will ever be provided
7954 if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
7955
7956 if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
7957
7958 return stream.push(null);
7959}
7960
7961/***/ }),
7962/* 38 */
7963/***/ (function(module, exports) {
7964
7965/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */
7966module.exports = __webpack_amd_options__;
7967
7968/* WEBPACK VAR INJECTION */}.call(exports, {}))
7969
7970/***/ }),
7971/* 39 */
7972/***/ (function(module, exports, __webpack_require__) {
7973
7974"use strict";
7975
7976
7977// Generated by CoffeeScript 1.12.7
7978(function () {
7979 "use strict";
7980
7981 var builder,
7982 defaults,
7983 parser,
7984 processors,
7985 extend = function extend(child, parent) {
7986 for (var key in parent) {
7987 if (hasProp.call(parent, key)) child[key] = parent[key];
7988 }function ctor() {
7989 this.constructor = child;
7990 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
7991 },
7992 hasProp = {}.hasOwnProperty;
7993
7994 defaults = __webpack_require__(27);
7995
7996 builder = __webpack_require__(68);
7997
7998 parser = __webpack_require__(73);
7999
8000 processors = __webpack_require__(43);
8001
8002 exports.defaults = defaults.defaults;
8003
8004 exports.processors = processors;
8005
8006 exports.ValidationError = function (superClass) {
8007 extend(ValidationError, superClass);
8008
8009 function ValidationError(message) {
8010 this.message = message;
8011 }
8012
8013 return ValidationError;
8014 }(Error);
8015
8016 exports.Builder = builder.Builder;
8017
8018 exports.Parser = parser.Parser;
8019
8020 exports.parseString = parser.parseString;
8021}).call(undefined);
8022
8023/***/ }),
8024/* 40 */
8025/***/ (function(module, exports, __webpack_require__) {
8026
8027"use strict";
8028
8029
8030// Generated by CoffeeScript 1.12.7
8031(function () {
8032 var XMLAttribute;
8033
8034 module.exports = XMLAttribute = function () {
8035 function XMLAttribute(parent, name, value) {
8036 this.options = parent.options;
8037 this.stringify = parent.stringify;
8038 if (name == null) {
8039 throw new Error("Missing attribute name of element " + parent.name);
8040 }
8041 if (value == null) {
8042 throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name);
8043 }
8044 this.name = this.stringify.attName(name);
8045 this.value = this.stringify.attValue(value);
8046 }
8047
8048 XMLAttribute.prototype.clone = function () {
8049 return Object.create(this);
8050 };
8051
8052 XMLAttribute.prototype.toString = function (options) {
8053 return this.options.writer.set(options).attribute(this);
8054 };
8055
8056 return XMLAttribute;
8057 }();
8058}).call(undefined);
8059
8060/***/ }),
8061/* 41 */
8062/***/ (function(module, exports, __webpack_require__) {
8063
8064"use strict";
8065
8066
8067// Generated by CoffeeScript 1.12.7
8068(function () {
8069 var XMLStringifier,
8070 bind = function bind(fn, me) {
8071 return function () {
8072 return fn.apply(me, arguments);
8073 };
8074 },
8075 hasProp = {}.hasOwnProperty;
8076
8077 module.exports = XMLStringifier = function () {
8078 function XMLStringifier(options) {
8079 this.assertLegalChar = bind(this.assertLegalChar, this);
8080 var key, ref, value;
8081 options || (options = {});
8082 this.noDoubleEncoding = options.noDoubleEncoding;
8083 ref = options.stringify || {};
8084 for (key in ref) {
8085 if (!hasProp.call(ref, key)) continue;
8086 value = ref[key];
8087 this[key] = value;
8088 }
8089 }
8090
8091 XMLStringifier.prototype.eleName = function (val) {
8092 val = '' + val || '';
8093 return this.assertLegalChar(val);
8094 };
8095
8096 XMLStringifier.prototype.eleText = function (val) {
8097 val = '' + val || '';
8098 return this.assertLegalChar(this.elEscape(val));
8099 };
8100
8101 XMLStringifier.prototype.cdata = function (val) {
8102 val = '' + val || '';
8103 val = val.replace(']]>', ']]]]><![CDATA[>');
8104 return this.assertLegalChar(val);
8105 };
8106
8107 XMLStringifier.prototype.comment = function (val) {
8108 val = '' + val || '';
8109 if (val.match(/--/)) {
8110 throw new Error("Comment text cannot contain double-hypen: " + val);
8111 }
8112 return this.assertLegalChar(val);
8113 };
8114
8115 XMLStringifier.prototype.raw = function (val) {
8116 return '' + val || '';
8117 };
8118
8119 XMLStringifier.prototype.attName = function (val) {
8120 return val = '' + val || '';
8121 };
8122
8123 XMLStringifier.prototype.attValue = function (val) {
8124 val = '' + val || '';
8125 return this.attEscape(val);
8126 };
8127
8128 XMLStringifier.prototype.insTarget = function (val) {
8129 return '' + val || '';
8130 };
8131
8132 XMLStringifier.prototype.insValue = function (val) {
8133 val = '' + val || '';
8134 if (val.match(/\?>/)) {
8135 throw new Error("Invalid processing instruction value: " + val);
8136 }
8137 return val;
8138 };
8139
8140 XMLStringifier.prototype.xmlVersion = function (val) {
8141 val = '' + val || '';
8142 if (!val.match(/1\.[0-9]+/)) {
8143 throw new Error("Invalid version number: " + val);
8144 }
8145 return val;
8146 };
8147
8148 XMLStringifier.prototype.xmlEncoding = function (val) {
8149 val = '' + val || '';
8150 if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
8151 throw new Error("Invalid encoding: " + val);
8152 }
8153 return val;
8154 };
8155
8156 XMLStringifier.prototype.xmlStandalone = function (val) {
8157 if (val) {
8158 return "yes";
8159 } else {
8160 return "no";
8161 }
8162 };
8163
8164 XMLStringifier.prototype.dtdPubID = function (val) {
8165 return '' + val || '';
8166 };
8167
8168 XMLStringifier.prototype.dtdSysID = function (val) {
8169 return '' + val || '';
8170 };
8171
8172 XMLStringifier.prototype.dtdElementValue = function (val) {
8173 return '' + val || '';
8174 };
8175
8176 XMLStringifier.prototype.dtdAttType = function (val) {
8177 return '' + val || '';
8178 };
8179
8180 XMLStringifier.prototype.dtdAttDefault = function (val) {
8181 if (val != null) {
8182 return '' + val || '';
8183 } else {
8184 return val;
8185 }
8186 };
8187
8188 XMLStringifier.prototype.dtdEntityValue = function (val) {
8189 return '' + val || '';
8190 };
8191
8192 XMLStringifier.prototype.dtdNData = function (val) {
8193 return '' + val || '';
8194 };
8195
8196 XMLStringifier.prototype.convertAttKey = '@';
8197
8198 XMLStringifier.prototype.convertPIKey = '?';
8199
8200 XMLStringifier.prototype.convertTextKey = '#text';
8201
8202 XMLStringifier.prototype.convertCDataKey = '#cdata';
8203
8204 XMLStringifier.prototype.convertCommentKey = '#comment';
8205
8206 XMLStringifier.prototype.convertRawKey = '#raw';
8207
8208 XMLStringifier.prototype.assertLegalChar = function (str) {
8209 var res;
8210 res = str.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/);
8211 if (res) {
8212 throw new Error("Invalid character in string: " + str + " at index " + res.index);
8213 }
8214 return str;
8215 };
8216
8217 XMLStringifier.prototype.elEscape = function (str) {
8218 var ampregex;
8219 ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
8220 return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;');
8221 };
8222
8223 XMLStringifier.prototype.attEscape = function (str) {
8224 var ampregex;
8225 ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
8226 return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;');
8227 };
8228
8229 return XMLStringifier;
8230 }();
8231}).call(undefined);
8232
8233/***/ }),
8234/* 42 */
8235/***/ (function(module, exports, __webpack_require__) {
8236
8237"use strict";
8238
8239
8240// Generated by CoffeeScript 1.12.7
8241(function () {
8242 var XMLWriterBase,
8243 hasProp = {}.hasOwnProperty;
8244
8245 module.exports = XMLWriterBase = function () {
8246 function XMLWriterBase(options) {
8247 var key, ref, ref1, ref2, ref3, ref4, ref5, ref6, value;
8248 options || (options = {});
8249 this.pretty = options.pretty || false;
8250 this.allowEmpty = (ref = options.allowEmpty) != null ? ref : false;
8251 if (this.pretty) {
8252 this.indent = (ref1 = options.indent) != null ? ref1 : ' ';
8253 this.newline = (ref2 = options.newline) != null ? ref2 : '\n';
8254 this.offset = (ref3 = options.offset) != null ? ref3 : 0;
8255 this.dontprettytextnodes = (ref4 = options.dontprettytextnodes) != null ? ref4 : 0;
8256 } else {
8257 this.indent = '';
8258 this.newline = '';
8259 this.offset = 0;
8260 this.dontprettytextnodes = 0;
8261 }
8262 this.spacebeforeslash = (ref5 = options.spacebeforeslash) != null ? ref5 : '';
8263 if (this.spacebeforeslash === true) {
8264 this.spacebeforeslash = ' ';
8265 }
8266 this.newlinedefault = this.newline;
8267 this.prettydefault = this.pretty;
8268 ref6 = options.writer || {};
8269 for (key in ref6) {
8270 if (!hasProp.call(ref6, key)) continue;
8271 value = ref6[key];
8272 this[key] = value;
8273 }
8274 }
8275
8276 XMLWriterBase.prototype.set = function (options) {
8277 var key, ref, value;
8278 options || (options = {});
8279 if ("pretty" in options) {
8280 this.pretty = options.pretty;
8281 }
8282 if ("allowEmpty" in options) {
8283 this.allowEmpty = options.allowEmpty;
8284 }
8285 if (this.pretty) {
8286 this.indent = "indent" in options ? options.indent : ' ';
8287 this.newline = "newline" in options ? options.newline : '\n';
8288 this.offset = "offset" in options ? options.offset : 0;
8289 this.dontprettytextnodes = "dontprettytextnodes" in options ? options.dontprettytextnodes : 0;
8290 } else {
8291 this.indent = '';
8292 this.newline = '';
8293 this.offset = 0;
8294 this.dontprettytextnodes = 0;
8295 }
8296 this.spacebeforeslash = "spacebeforeslash" in options ? options.spacebeforeslash : '';
8297 if (this.spacebeforeslash === true) {
8298 this.spacebeforeslash = ' ';
8299 }
8300 this.newlinedefault = this.newline;
8301 this.prettydefault = this.pretty;
8302 ref = options.writer || {};
8303 for (key in ref) {
8304 if (!hasProp.call(ref, key)) continue;
8305 value = ref[key];
8306 this[key] = value;
8307 }
8308 return this;
8309 };
8310
8311 XMLWriterBase.prototype.space = function (level) {
8312 var indent;
8313 if (this.pretty) {
8314 indent = (level || 0) + this.offset + 1;
8315 if (indent > 0) {
8316 return new Array(indent).join(this.indent);
8317 } else {
8318 return '';
8319 }
8320 } else {
8321 return '';
8322 }
8323 };
8324
8325 return XMLWriterBase;
8326 }();
8327}).call(undefined);
8328
8329/***/ }),
8330/* 43 */
8331/***/ (function(module, exports, __webpack_require__) {
8332
8333"use strict";
8334
8335
8336// Generated by CoffeeScript 1.12.7
8337(function () {
8338 "use strict";
8339
8340 var prefixMatch;
8341
8342 prefixMatch = new RegExp(/(?!xmlns)^.*:/);
8343
8344 exports.normalize = function (str) {
8345 return str.toLowerCase();
8346 };
8347
8348 exports.firstCharLowerCase = function (str) {
8349 return str.charAt(0).toLowerCase() + str.slice(1);
8350 };
8351
8352 exports.stripPrefix = function (str) {
8353 return str.replace(prefixMatch, '');
8354 };
8355
8356 exports.parseNumbers = function (str) {
8357 if (!isNaN(str)) {
8358 str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);
8359 }
8360 return str;
8361 };
8362
8363 exports.parseBooleans = function (str) {
8364 if (/^(?:true|false)$/i.test(str)) {
8365 str = str.toLowerCase() === 'true';
8366 }
8367 return str;
8368 };
8369}).call(undefined);
8370
8371/***/ }),
8372/* 44 */
8373/***/ (function(module, exports) {
8374
8375module.exports = {"amp":"&","apos":"'","gt":">","lt":"<","quot":"\""}
8376
8377/***/ }),
8378/* 45 */
8379/***/ (function(module, exports) {
8380
8381module.exports = {"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\"","QUOT":"\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}
8382
8383/***/ }),
8384/* 46 */
8385/***/ (function(module, exports, __webpack_require__) {
8386
8387"use strict";
8388
8389
8390window.RSSParser = __webpack_require__(47);
8391
8392/***/ }),
8393/* 47 */
8394/***/ (function(module, exports, __webpack_require__) {
8395
8396"use strict";
8397
8398
8399module.exports = __webpack_require__(48);
8400
8401/***/ }),
8402/* 48 */
8403/***/ (function(module, exports, __webpack_require__) {
8404
8405"use strict";
8406
8407
8408var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8409
8410function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8411
8412var http = __webpack_require__(29);
8413var https = __webpack_require__(67);
8414var xml2js = __webpack_require__(39);
8415var url = __webpack_require__(26);
8416
8417var fields = __webpack_require__(81);
8418var utils = __webpack_require__(82);
8419
8420var DEFAULT_HEADERS = {
8421 'User-Agent': 'rss-parser',
8422 'Accept': 'application/rss+xml'
8423};
8424var DEFAULT_MAX_REDIRECTS = 5;
8425
8426var Parser = function () {
8427 function Parser() {
8428 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8429
8430 _classCallCheck(this, Parser);
8431
8432 options.headers = options.headers || {};
8433 options.xml2js = options.xml2js || {};
8434 options.customFields = options.customFields || {};
8435 options.customFields.item = options.customFields.item || [];
8436 options.customFields.feed = options.customFields.feed || [];
8437 if (!options.maxRedirects) options.maxRedirects = DEFAULT_MAX_REDIRECTS;
8438 this.options = options;
8439 this.xmlParser = new xml2js.Parser(this.options.xml2js);
8440 }
8441
8442 _createClass(Parser, [{
8443 key: 'parseString',
8444 value: function parseString(xml, callback) {
8445 var _this = this;
8446
8447 var prom = new Promise(function (resolve, reject) {
8448 _this.xmlParser.parseString(xml, function (err, result) {
8449 if (err) return reject(err);
8450 if (!result) {
8451 return reject(new Error('Unable to parse XML.'));
8452 }
8453 var feed = null;
8454 if (result.feed) {
8455 feed = _this.buildAtomFeed(result);
8456 } else if (result.rss && result.rss.$ && result.rss.$.version && result.rss.$.version.match(/^2/)) {
8457 feed = _this.buildRSS2(result);
8458 } else if (result['rdf:RDF']) {
8459 feed = _this.buildRSS1(result);
8460 } else if (result.rss && result.rss.$ && result.rss.$.version && result.rss.$.version.match(/0\.9/)) {
8461 feed = _this.buildRSS0_9(result);
8462 } else if (result.rss && _this.options.defaultRSS) {
8463 switch (_this.options.defaultRSS) {
8464 case 0.9:
8465 feed = _this.buildRSS0_9(result);
8466 break;
8467 case 1:
8468 feed = _this.buildRSS1(result);
8469 break;
8470 case 2:
8471 feed = _this.buildRSS2(result);
8472 break;
8473 default:
8474 return reject(new Error("default RSS version not recognized."));
8475 }
8476 } else {
8477 return reject(new Error("Feed not recognized as RSS 1 or 2."));
8478 }
8479 resolve(feed);
8480 });
8481 });
8482 prom = utils.maybePromisify(callback, prom);
8483 return prom;
8484 }
8485 }, {
8486 key: 'parseURL',
8487 value: function parseURL(feedUrl, callback) {
8488 var _this2 = this;
8489
8490 var redirectCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
8491
8492 var xml = '';
8493 var get = feedUrl.indexOf('https') === 0 ? https.get : http.get;
8494 var urlParts = url.parse(feedUrl);
8495 var headers = Object.assign({}, DEFAULT_HEADERS, this.options.headers);
8496 var prom = new Promise(function (resolve, reject) {
8497 var req = get({
8498 headers: headers,
8499 auth: urlParts.auth,
8500 protocol: urlParts.protocol,
8501 hostname: urlParts.hostname,
8502 port: urlParts.port,
8503 path: urlParts.path
8504 }, function (res) {
8505 if (_this2.options.maxRedirects && res.statusCode >= 300 && res.statusCode < 400 && res.headers['location']) {
8506 if (redirectCount === _this2.options.maxRedirects) {
8507 return reject(new Error("Too many redirects"));
8508 } else {
8509 return _this2.parseURL(res.headers['location'], null, redirectCount + 1).then(resolve, reject);
8510 }
8511 } else if (res.statusCode >= 300) {
8512 return reject(new Error("Status code " + res.statusCode));
8513 }
8514 var encoding = utils.getEncodingFromContentType(res.headers['content-type']);
8515 res.setEncoding(encoding);
8516 res.on('data', function (chunk) {
8517 xml += chunk;
8518 });
8519 res.on('end', function () {
8520 return _this2.parseString(xml).then(resolve, reject);
8521 });
8522 });
8523 req.on('error', reject);
8524 });
8525 prom = utils.maybePromisify(callback, prom);
8526 return prom;
8527 }
8528 }, {
8529 key: 'buildAtomFeed',
8530 value: function buildAtomFeed(xmlObj) {
8531 var _this3 = this;
8532
8533 var feed = { items: [] };
8534 utils.copyFromXML(xmlObj.feed, feed, this.options.customFields.feed);
8535 if (xmlObj.feed.link) {
8536 feed.link = utils.getLink(xmlObj.feed.link, 'alternate', 0);
8537 feed.feedUrl = utils.getLink(xmlObj.feed.link, 'self', 1);
8538 }
8539 if (xmlObj.feed.title) {
8540 var title = xmlObj.feed.title[0] || '';
8541 if (title._) title = title._;
8542 if (title) feed.title = title;
8543 }
8544 if (xmlObj.feed.updated) {
8545 feed.lastBuildDate = xmlObj.feed.updated[0];
8546 }
8547 (xmlObj.feed.entry || []).forEach(function (entry) {
8548 var item = {};
8549 utils.copyFromXML(entry, item, _this3.options.customFields.item);
8550 if (entry.title) {
8551 var _title = entry.title[0] || '';
8552 if (_title._) _title = _title._;
8553 if (_title) item.title = _title;
8554 }
8555 if (entry.link && entry.link.length) {
8556 item.link = utils.getLink(entry.link, 'alternate', 0);
8557 }
8558 if (entry.published && entry.published.length && entry.published[0].length) item.pubDate = new Date(entry.published[0]).toISOString();
8559 if (!item.pubDate && entry.updated && entry.updated.length && entry.updated[0].length) item.pubDate = new Date(entry.updated[0]).toISOString();
8560 if (entry.author && entry.author.length) item.author = entry.author[0].name[0];
8561 if (entry.content && entry.content.length) {
8562 item.content = utils.getContent(entry.content[0]);
8563 item.contentSnippet = utils.getSnippet(item.content);
8564 }
8565 if (entry.id) {
8566 item.id = entry.id[0];
8567 }
8568 _this3.setISODate(item);
8569 feed.items.push(item);
8570 });
8571 return feed;
8572 }
8573 }, {
8574 key: 'buildRSS0_9',
8575 value: function buildRSS0_9(xmlObj) {
8576 var channel = xmlObj.rss.channel[0];
8577 var items = channel.item;
8578 return this.buildRSS(channel, items);
8579 }
8580 }, {
8581 key: 'buildRSS1',
8582 value: function buildRSS1(xmlObj) {
8583 xmlObj = xmlObj['rdf:RDF'];
8584 var channel = xmlObj.channel[0];
8585 var items = xmlObj.item;
8586 return this.buildRSS(channel, items);
8587 }
8588 }, {
8589 key: 'buildRSS2',
8590 value: function buildRSS2(xmlObj) {
8591 var channel = xmlObj.rss.channel[0];
8592 var items = channel.item;
8593 var feed = this.buildRSS(channel, items);
8594 if (xmlObj.rss.$ && xmlObj.rss.$['xmlns:itunes']) {
8595 this.decorateItunes(feed, channel);
8596 }
8597 return feed;
8598 }
8599 }, {
8600 key: 'buildRSS',
8601 value: function buildRSS(channel, items) {
8602 var _this4 = this;
8603
8604 items = items || [];
8605 var feed = { items: [] };
8606 var feedFields = fields.feed.concat(this.options.customFields.feed);
8607 var itemFields = fields.item.concat(this.options.customFields.item);
8608 if (channel['atom:link']) feed.feedUrl = channel['atom:link'][0].$.href;
8609 if (channel.image && channel.image[0] && channel.image[0].url) {
8610 feed.image = {};
8611 var image = channel.image[0];
8612 if (image.link) feed.image.link = image.link[0];
8613 if (image.url) feed.image.url = image.url[0];
8614 if (image.title) feed.image.title = image.title[0];
8615 if (image.width) feed.image.width = image.width[0];
8616 if (image.height) feed.image.height = image.height[0];
8617 }
8618 utils.copyFromXML(channel, feed, feedFields);
8619 items.forEach(function (xmlItem) {
8620 var item = {};
8621 utils.copyFromXML(xmlItem, item, itemFields);
8622 if (xmlItem.enclosure) {
8623 item.enclosure = xmlItem.enclosure[0].$;
8624 }
8625 if (xmlItem.description) {
8626 item.content = utils.getContent(xmlItem.description[0]);
8627 item.contentSnippet = utils.getSnippet(item.content);
8628 }
8629 if (xmlItem.guid) {
8630 item.guid = xmlItem.guid[0];
8631 if (item.guid._) item.guid = item.guid._;
8632 }
8633 if (xmlItem.category) item.categories = xmlItem.category;
8634 _this4.setISODate(item);
8635 feed.items.push(item);
8636 });
8637 return feed;
8638 }
8639
8640 /**
8641 * Add iTunes specific fields from XML to extracted JSON
8642 *
8643 * @access public
8644 * @param {object} feed extracted
8645 * @param {object} channel parsed XML
8646 */
8647
8648 }, {
8649 key: 'decorateItunes',
8650 value: function decorateItunes(feed, channel) {
8651 var items = channel.item || [],
8652 entry = {};
8653 feed.itunes = {};
8654
8655 if (channel['itunes:owner']) {
8656 var owner = {},
8657 image = void 0;
8658
8659 if (channel['itunes:owner'][0]['itunes:name']) {
8660 owner.name = channel['itunes:owner'][0]['itunes:name'][0];
8661 }
8662 if (channel['itunes:owner'][0]['itunes:email']) {
8663 owner.email = channel['itunes:owner'][0]['itunes:email'][0];
8664 }
8665 if (channel['itunes:image']) {
8666 var hasImageHref = channel['itunes:image'][0] && channel['itunes:image'][0].$ && channel['itunes:image'][0].$.href;
8667 image = hasImageHref ? channel['itunes:image'][0].$.href : null;
8668 }
8669
8670 if (image) {
8671 feed.itunes.image = image;
8672 }
8673 feed.itunes.owner = owner;
8674 }
8675
8676 utils.copyFromXML(channel, feed.itunes, fields.podcastFeed);
8677 items.forEach(function (item, index) {
8678 var entry = feed.items[index];
8679 entry.itunes = {};
8680 utils.copyFromXML(item, entry.itunes, fields.podcastItem);
8681 var image = item['itunes:image'];
8682 if (image && image[0] && image[0].$ && image[0].$.href) {
8683 entry.itunes.image = image[0].$.href;
8684 }
8685 });
8686 }
8687 }, {
8688 key: 'setISODate',
8689 value: function setISODate(item) {
8690 var date = item.pubDate || item.date;
8691 if (date) {
8692 try {
8693 item.isoDate = new Date(date.trim()).toISOString();
8694 } catch (e) {
8695 // Ignore bad date format
8696 }
8697 }
8698 }
8699 }]);
8700
8701 return Parser;
8702}();
8703
8704module.exports = Parser;
8705
8706/***/ }),
8707/* 49 */
8708/***/ (function(module, exports, __webpack_require__) {
8709
8710"use strict";
8711/* WEBPACK VAR INJECTION */(function(Buffer, global, process) {
8712
8713var capability = __webpack_require__(31);
8714var inherits = __webpack_require__(2);
8715var response = __webpack_require__(32);
8716var stream = __webpack_require__(7);
8717var toArrayBuffer = __webpack_require__(58);
8718
8719var IncomingMessage = response.IncomingMessage;
8720var rStates = response.readyStates;
8721
8722function decideMode(preferBinary, useFetch) {
8723 if (capability.fetch && useFetch) {
8724 return 'fetch';
8725 } else if (capability.mozchunkedarraybuffer) {
8726 return 'moz-chunked-arraybuffer';
8727 } else if (capability.msstream) {
8728 return 'ms-stream';
8729 } else if (capability.arraybuffer && preferBinary) {
8730 return 'arraybuffer';
8731 } else if (capability.vbArray && preferBinary) {
8732 return 'text:vbarray';
8733 } else {
8734 return 'text';
8735 }
8736}
8737
8738var ClientRequest = module.exports = function (opts) {
8739 var self = this;
8740 stream.Writable.call(self);
8741
8742 self._opts = opts;
8743 self._body = [];
8744 self._headers = {};
8745 if (opts.auth) self.setHeader('Authorization', 'Basic ' + new Buffer(opts.auth).toString('base64'));
8746 Object.keys(opts.headers).forEach(function (name) {
8747 self.setHeader(name, opts.headers[name]);
8748 });
8749
8750 var preferBinary;
8751 var useFetch = true;
8752 if (opts.mode === 'disable-fetch' || 'requestTimeout' in opts && !capability.abortController) {
8753 // If the use of XHR should be preferred. Not typically needed.
8754 useFetch = false;
8755 preferBinary = true;
8756 } else if (opts.mode === 'prefer-streaming') {
8757 // If streaming is a high priority but binary compatibility and
8758 // the accuracy of the 'content-type' header aren't
8759 preferBinary = false;
8760 } else if (opts.mode === 'allow-wrong-content-type') {
8761 // If streaming is more important than preserving the 'content-type' header
8762 preferBinary = !capability.overrideMimeType;
8763 } else if (!opts.mode || opts.mode === 'default' || opts.mode === 'prefer-fast') {
8764 // Use binary if text streaming may corrupt data or the content-type header, or for speed
8765 preferBinary = true;
8766 } else {
8767 throw new Error('Invalid value for opts.mode');
8768 }
8769 self._mode = decideMode(preferBinary, useFetch);
8770 self._fetchTimer = null;
8771
8772 self.on('finish', function () {
8773 self._onFinish();
8774 });
8775};
8776
8777inherits(ClientRequest, stream.Writable);
8778
8779ClientRequest.prototype.setHeader = function (name, value) {
8780 var self = this;
8781 var lowerName = name.toLowerCase();
8782 // This check is not necessary, but it prevents warnings from browsers about setting unsafe
8783 // headers. To be honest I'm not entirely sure hiding these warnings is a good thing, but
8784 // http-browserify did it, so I will too.
8785 if (unsafeHeaders.indexOf(lowerName) !== -1) return;
8786
8787 self._headers[lowerName] = {
8788 name: name,
8789 value: value
8790 };
8791};
8792
8793ClientRequest.prototype.getHeader = function (name) {
8794 var header = this._headers[name.toLowerCase()];
8795 if (header) return header.value;
8796 return null;
8797};
8798
8799ClientRequest.prototype.removeHeader = function (name) {
8800 var self = this;
8801 delete self._headers[name.toLowerCase()];
8802};
8803
8804ClientRequest.prototype._onFinish = function () {
8805 var self = this;
8806
8807 if (self._destroyed) return;
8808 var opts = self._opts;
8809
8810 var headersObj = self._headers;
8811 var body = null;
8812 if (opts.method !== 'GET' && opts.method !== 'HEAD') {
8813 if (capability.arraybuffer) {
8814 body = toArrayBuffer(Buffer.concat(self._body));
8815 } else if (capability.blobConstructor) {
8816 body = new global.Blob(self._body.map(function (buffer) {
8817 return toArrayBuffer(buffer);
8818 }), {
8819 type: (headersObj['content-type'] || {}).value || ''
8820 });
8821 } else {
8822 // get utf8 string
8823 body = Buffer.concat(self._body).toString();
8824 }
8825 }
8826
8827 // create flattened list of headers
8828 var headersList = [];
8829 Object.keys(headersObj).forEach(function (keyName) {
8830 var name = headersObj[keyName].name;
8831 var value = headersObj[keyName].value;
8832 if (Array.isArray(value)) {
8833 value.forEach(function (v) {
8834 headersList.push([name, v]);
8835 });
8836 } else {
8837 headersList.push([name, value]);
8838 }
8839 });
8840
8841 if (self._mode === 'fetch') {
8842 var signal = null;
8843 var fetchTimer = null;
8844 if (capability.abortController) {
8845 var controller = new AbortController();
8846 signal = controller.signal;
8847 self._fetchAbortController = controller;
8848
8849 if ('requestTimeout' in opts && opts.requestTimeout !== 0) {
8850 self._fetchTimer = global.setTimeout(function () {
8851 self.emit('requestTimeout');
8852 if (self._fetchAbortController) self._fetchAbortController.abort();
8853 }, opts.requestTimeout);
8854 }
8855 }
8856
8857 global.fetch(self._opts.url, {
8858 method: self._opts.method,
8859 headers: headersList,
8860 body: body || undefined,
8861 mode: 'cors',
8862 credentials: opts.withCredentials ? 'include' : 'same-origin',
8863 signal: signal
8864 }).then(function (response) {
8865 self._fetchResponse = response;
8866 self._connect();
8867 }, function (reason) {
8868 global.clearTimeout(self._fetchTimer);
8869 if (!self._destroyed) self.emit('error', reason);
8870 });
8871 } else {
8872 var xhr = self._xhr = new global.XMLHttpRequest();
8873 try {
8874 xhr.open(self._opts.method, self._opts.url, true);
8875 } catch (err) {
8876 process.nextTick(function () {
8877 self.emit('error', err);
8878 });
8879 return;
8880 }
8881
8882 // Can't set responseType on really old browsers
8883 if ('responseType' in xhr) xhr.responseType = self._mode.split(':')[0];
8884
8885 if ('withCredentials' in xhr) xhr.withCredentials = !!opts.withCredentials;
8886
8887 if (self._mode === 'text' && 'overrideMimeType' in xhr) xhr.overrideMimeType('text/plain; charset=x-user-defined');
8888
8889 if ('requestTimeout' in opts) {
8890 xhr.timeout = opts.requestTimeout;
8891 xhr.ontimeout = function () {
8892 self.emit('requestTimeout');
8893 };
8894 }
8895
8896 headersList.forEach(function (header) {
8897 xhr.setRequestHeader(header[0], header[1]);
8898 });
8899
8900 self._response = null;
8901 xhr.onreadystatechange = function () {
8902 switch (xhr.readyState) {
8903 case rStates.LOADING:
8904 case rStates.DONE:
8905 self._onXHRProgress();
8906 break;
8907 }
8908 };
8909 // Necessary for streaming in Firefox, since xhr.response is ONLY defined
8910 // in onprogress, not in onreadystatechange with xhr.readyState = 3
8911 if (self._mode === 'moz-chunked-arraybuffer') {
8912 xhr.onprogress = function () {
8913 self._onXHRProgress();
8914 };
8915 }
8916
8917 xhr.onerror = function () {
8918 if (self._destroyed) return;
8919 self.emit('error', new Error('XHR error'));
8920 };
8921
8922 try {
8923 xhr.send(body);
8924 } catch (err) {
8925 process.nextTick(function () {
8926 self.emit('error', err);
8927 });
8928 return;
8929 }
8930 }
8931};
8932
8933/**
8934 * Checks if xhr.status is readable and non-zero, indicating no error.
8935 * Even though the spec says it should be available in readyState 3,
8936 * accessing it throws an exception in IE8
8937 */
8938function statusValid(xhr) {
8939 try {
8940 var status = xhr.status;
8941 return status !== null && status !== 0;
8942 } catch (e) {
8943 return false;
8944 }
8945}
8946
8947ClientRequest.prototype._onXHRProgress = function () {
8948 var self = this;
8949
8950 if (!statusValid(self._xhr) || self._destroyed) return;
8951
8952 if (!self._response) self._connect();
8953
8954 self._response._onXHRProgress();
8955};
8956
8957ClientRequest.prototype._connect = function () {
8958 var self = this;
8959
8960 if (self._destroyed) return;
8961
8962 self._response = new IncomingMessage(self._xhr, self._fetchResponse, self._mode, self._fetchTimer);
8963 self._response.on('error', function (err) {
8964 self.emit('error', err);
8965 });
8966
8967 self.emit('response', self._response);
8968};
8969
8970ClientRequest.prototype._write = function (chunk, encoding, cb) {
8971 var self = this;
8972
8973 self._body.push(chunk);
8974 cb();
8975};
8976
8977ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function () {
8978 var self = this;
8979 self._destroyed = true;
8980 global.clearTimeout(self._fetchTimer);
8981 if (self._response) self._response._destroyed = true;
8982 if (self._xhr) self._xhr.abort();else if (self._fetchAbortController) self._fetchAbortController.abort();
8983};
8984
8985ClientRequest.prototype.end = function (data, encoding, cb) {
8986 var self = this;
8987 if (typeof data === 'function') {
8988 cb = data;
8989 data = undefined;
8990 }
8991
8992 stream.Writable.prototype.end.call(self, data, encoding, cb);
8993};
8994
8995ClientRequest.prototype.flushHeaders = function () {};
8996ClientRequest.prototype.setTimeout = function () {};
8997ClientRequest.prototype.setNoDelay = function () {};
8998ClientRequest.prototype.setSocketKeepAlive = function () {};
8999
9000// Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method
9001var 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', 'via'];
9002/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5).Buffer, __webpack_require__(1), __webpack_require__(6)))
9003
9004/***/ }),
9005/* 50 */
9006/***/ (function(module, exports, __webpack_require__) {
9007
9008"use strict";
9009
9010
9011exports.byteLength = byteLength;
9012exports.toByteArray = toByteArray;
9013exports.fromByteArray = fromByteArray;
9014
9015var lookup = [];
9016var revLookup = [];
9017var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
9018
9019var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
9020for (var i = 0, len = code.length; i < len; ++i) {
9021 lookup[i] = code[i];
9022 revLookup[code.charCodeAt(i)] = i;
9023}
9024
9025// Support decoding URL-safe base64 strings, as Node.js does.
9026// See: https://en.wikipedia.org/wiki/Base64#URL_applications
9027revLookup['-'.charCodeAt(0)] = 62;
9028revLookup['_'.charCodeAt(0)] = 63;
9029
9030function getLens(b64) {
9031 var len = b64.length;
9032
9033 if (len % 4 > 0) {
9034 throw new Error('Invalid string. Length must be a multiple of 4');
9035 }
9036
9037 // Trim off extra bytes after placeholder bytes are found
9038 // See: https://github.com/beatgammit/base64-js/issues/42
9039 var validLen = b64.indexOf('=');
9040 if (validLen === -1) validLen = len;
9041
9042 var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
9043
9044 return [validLen, placeHoldersLen];
9045}
9046
9047// base64 is 4/3 + up to two characters of the original data
9048function byteLength(b64) {
9049 var lens = getLens(b64);
9050 var validLen = lens[0];
9051 var placeHoldersLen = lens[1];
9052 return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
9053}
9054
9055function _byteLength(b64, validLen, placeHoldersLen) {
9056 return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
9057}
9058
9059function toByteArray(b64) {
9060 var tmp;
9061 var lens = getLens(b64);
9062 var validLen = lens[0];
9063 var placeHoldersLen = lens[1];
9064
9065 var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
9066
9067 var curByte = 0;
9068
9069 // if there are placeholders, only get up to the last complete 4 chars
9070 var len = placeHoldersLen > 0 ? validLen - 4 : validLen;
9071
9072 for (var i = 0; i < len; i += 4) {
9073 tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
9074 arr[curByte++] = tmp >> 16 & 0xFF;
9075 arr[curByte++] = tmp >> 8 & 0xFF;
9076 arr[curByte++] = tmp & 0xFF;
9077 }
9078
9079 if (placeHoldersLen === 2) {
9080 tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
9081 arr[curByte++] = tmp & 0xFF;
9082 }
9083
9084 if (placeHoldersLen === 1) {
9085 tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
9086 arr[curByte++] = tmp >> 8 & 0xFF;
9087 arr[curByte++] = tmp & 0xFF;
9088 }
9089
9090 return arr;
9091}
9092
9093function tripletToBase64(num) {
9094 return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
9095}
9096
9097function encodeChunk(uint8, start, end) {
9098 var tmp;
9099 var output = [];
9100 for (var i = start; i < end; i += 3) {
9101 tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF);
9102 output.push(tripletToBase64(tmp));
9103 }
9104 return output.join('');
9105}
9106
9107function fromByteArray(uint8) {
9108 var tmp;
9109 var len = uint8.length;
9110 var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
9111 var parts = [];
9112 var maxChunkLength = 16383; // must be multiple of 3
9113
9114 // go through the array every three bytes, we'll deal with trailing stuff later
9115 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
9116 parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
9117 }
9118
9119 // pad the end with zeros, but make sure to not forget the extra bytes
9120 if (extraBytes === 1) {
9121 tmp = uint8[len - 1];
9122 parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '==');
9123 } else if (extraBytes === 2) {
9124 tmp = (uint8[len - 2] << 8) + uint8[len - 1];
9125 parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '=');
9126 }
9127
9128 return parts.join('');
9129}
9130
9131/***/ }),
9132/* 51 */
9133/***/ (function(module, exports, __webpack_require__) {
9134
9135"use strict";
9136
9137
9138exports.read = function (buffer, offset, isLE, mLen, nBytes) {
9139 var e, m;
9140 var eLen = nBytes * 8 - mLen - 1;
9141 var eMax = (1 << eLen) - 1;
9142 var eBias = eMax >> 1;
9143 var nBits = -7;
9144 var i = isLE ? nBytes - 1 : 0;
9145 var d = isLE ? -1 : 1;
9146 var s = buffer[offset + i];
9147
9148 i += d;
9149
9150 e = s & (1 << -nBits) - 1;
9151 s >>= -nBits;
9152 nBits += eLen;
9153 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
9154
9155 m = e & (1 << -nBits) - 1;
9156 e >>= -nBits;
9157 nBits += mLen;
9158 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
9159
9160 if (e === 0) {
9161 e = 1 - eBias;
9162 } else if (e === eMax) {
9163 return m ? NaN : (s ? -1 : 1) * Infinity;
9164 } else {
9165 m = m + Math.pow(2, mLen);
9166 e = e - eBias;
9167 }
9168 return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
9169};
9170
9171exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
9172 var e, m, c;
9173 var eLen = nBytes * 8 - mLen - 1;
9174 var eMax = (1 << eLen) - 1;
9175 var eBias = eMax >> 1;
9176 var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
9177 var i = isLE ? 0 : nBytes - 1;
9178 var d = isLE ? 1 : -1;
9179 var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
9180
9181 value = Math.abs(value);
9182
9183 if (isNaN(value) || value === Infinity) {
9184 m = isNaN(value) ? 1 : 0;
9185 e = eMax;
9186 } else {
9187 e = Math.floor(Math.log(value) / Math.LN2);
9188 if (value * (c = Math.pow(2, -e)) < 1) {
9189 e--;
9190 c *= 2;
9191 }
9192 if (e + eBias >= 1) {
9193 value += rt / c;
9194 } else {
9195 value += rt * Math.pow(2, 1 - eBias);
9196 }
9197 if (value * c >= 2) {
9198 e++;
9199 c /= 2;
9200 }
9201
9202 if (e + eBias >= eMax) {
9203 m = 0;
9204 e = eMax;
9205 } else if (e + eBias >= 1) {
9206 m = (value * c - 1) * Math.pow(2, mLen);
9207 e = e + eBias;
9208 } else {
9209 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
9210 e = 0;
9211 }
9212 }
9213
9214 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
9215
9216 e = e << mLen | m;
9217 eLen += mLen;
9218 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
9219
9220 buffer[offset + i - d] |= s * 128;
9221};
9222
9223/***/ }),
9224/* 52 */
9225/***/ (function(module, exports) {
9226
9227/* (ignored) */
9228
9229/***/ }),
9230/* 53 */
9231/***/ (function(module, exports, __webpack_require__) {
9232
9233"use strict";
9234
9235
9236function _classCallCheck(instance, Constructor) {
9237 if (!(instance instanceof Constructor)) {
9238 throw new TypeError("Cannot call a class as a function");
9239 }
9240}
9241
9242var Buffer = __webpack_require__(11).Buffer;
9243var util = __webpack_require__(54);
9244
9245function copyBuffer(src, target, offset) {
9246 src.copy(target, offset);
9247}
9248
9249module.exports = function () {
9250 function BufferList() {
9251 _classCallCheck(this, BufferList);
9252
9253 this.head = null;
9254 this.tail = null;
9255 this.length = 0;
9256 }
9257
9258 BufferList.prototype.push = function push(v) {
9259 var entry = { data: v, next: null };
9260 if (this.length > 0) this.tail.next = entry;else this.head = entry;
9261 this.tail = entry;
9262 ++this.length;
9263 };
9264
9265 BufferList.prototype.unshift = function unshift(v) {
9266 var entry = { data: v, next: this.head };
9267 if (this.length === 0) this.tail = entry;
9268 this.head = entry;
9269 ++this.length;
9270 };
9271
9272 BufferList.prototype.shift = function shift() {
9273 if (this.length === 0) return;
9274 var ret = this.head.data;
9275 if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
9276 --this.length;
9277 return ret;
9278 };
9279
9280 BufferList.prototype.clear = function clear() {
9281 this.head = this.tail = null;
9282 this.length = 0;
9283 };
9284
9285 BufferList.prototype.join = function join(s) {
9286 if (this.length === 0) return '';
9287 var p = this.head;
9288 var ret = '' + p.data;
9289 while (p = p.next) {
9290 ret += s + p.data;
9291 }return ret;
9292 };
9293
9294 BufferList.prototype.concat = function concat(n) {
9295 if (this.length === 0) return Buffer.alloc(0);
9296 if (this.length === 1) return this.head.data;
9297 var ret = Buffer.allocUnsafe(n >>> 0);
9298 var p = this.head;
9299 var i = 0;
9300 while (p) {
9301 copyBuffer(p.data, ret, i);
9302 i += p.data.length;
9303 p = p.next;
9304 }
9305 return ret;
9306 };
9307
9308 return BufferList;
9309}();
9310
9311if (util && util.inspect && util.inspect.custom) {
9312 module.exports.prototype[util.inspect.custom] = function () {
9313 var obj = util.inspect({ length: this.length });
9314 return this.constructor.name + ' ' + obj;
9315 };
9316}
9317
9318/***/ }),
9319/* 54 */
9320/***/ (function(module, exports) {
9321
9322/* (ignored) */
9323
9324/***/ }),
9325/* 55 */
9326/***/ (function(module, exports, __webpack_require__) {
9327
9328"use strict";
9329/* WEBPACK VAR INJECTION */(function(global, process) {
9330
9331(function (global, undefined) {
9332 "use strict";
9333
9334 if (global.setImmediate) {
9335 return;
9336 }
9337
9338 var nextHandle = 1; // Spec says greater than zero
9339 var tasksByHandle = {};
9340 var currentlyRunningATask = false;
9341 var doc = global.document;
9342 var registerImmediate;
9343
9344 function setImmediate(callback) {
9345 // Callback can either be a function or a string
9346 if (typeof callback !== "function") {
9347 callback = new Function("" + callback);
9348 }
9349 // Copy function arguments
9350 var args = new Array(arguments.length - 1);
9351 for (var i = 0; i < args.length; i++) {
9352 args[i] = arguments[i + 1];
9353 }
9354 // Store and register the task
9355 var task = { callback: callback, args: args };
9356 tasksByHandle[nextHandle] = task;
9357 registerImmediate(nextHandle);
9358 return nextHandle++;
9359 }
9360
9361 function clearImmediate(handle) {
9362 delete tasksByHandle[handle];
9363 }
9364
9365 function run(task) {
9366 var callback = task.callback;
9367 var args = task.args;
9368 switch (args.length) {
9369 case 0:
9370 callback();
9371 break;
9372 case 1:
9373 callback(args[0]);
9374 break;
9375 case 2:
9376 callback(args[0], args[1]);
9377 break;
9378 case 3:
9379 callback(args[0], args[1], args[2]);
9380 break;
9381 default:
9382 callback.apply(undefined, args);
9383 break;
9384 }
9385 }
9386
9387 function runIfPresent(handle) {
9388 // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
9389 // So if we're currently running a task, we'll need to delay this invocation.
9390 if (currentlyRunningATask) {
9391 // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
9392 // "too much recursion" error.
9393 setTimeout(runIfPresent, 0, handle);
9394 } else {
9395 var task = tasksByHandle[handle];
9396 if (task) {
9397 currentlyRunningATask = true;
9398 try {
9399 run(task);
9400 } finally {
9401 clearImmediate(handle);
9402 currentlyRunningATask = false;
9403 }
9404 }
9405 }
9406 }
9407
9408 function installNextTickImplementation() {
9409 registerImmediate = function registerImmediate(handle) {
9410 process.nextTick(function () {
9411 runIfPresent(handle);
9412 });
9413 };
9414 }
9415
9416 function canUsePostMessage() {
9417 // The test against `importScripts` prevents this implementation from being installed inside a web worker,
9418 // where `global.postMessage` means something completely different and can't be used for this purpose.
9419 if (global.postMessage && !global.importScripts) {
9420 var postMessageIsAsynchronous = true;
9421 var oldOnMessage = global.onmessage;
9422 global.onmessage = function () {
9423 postMessageIsAsynchronous = false;
9424 };
9425 global.postMessage("", "*");
9426 global.onmessage = oldOnMessage;
9427 return postMessageIsAsynchronous;
9428 }
9429 }
9430
9431 function installPostMessageImplementation() {
9432 // Installs an event handler on `global` for the `message` event: see
9433 // * https://developer.mozilla.org/en/DOM/window.postMessage
9434 // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
9435
9436 var messagePrefix = "setImmediate$" + Math.random() + "$";
9437 var onGlobalMessage = function onGlobalMessage(event) {
9438 if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) {
9439 runIfPresent(+event.data.slice(messagePrefix.length));
9440 }
9441 };
9442
9443 if (global.addEventListener) {
9444 global.addEventListener("message", onGlobalMessage, false);
9445 } else {
9446 global.attachEvent("onmessage", onGlobalMessage);
9447 }
9448
9449 registerImmediate = function registerImmediate(handle) {
9450 global.postMessage(messagePrefix + handle, "*");
9451 };
9452 }
9453
9454 function installMessageChannelImplementation() {
9455 var channel = new MessageChannel();
9456 channel.port1.onmessage = function (event) {
9457 var handle = event.data;
9458 runIfPresent(handle);
9459 };
9460
9461 registerImmediate = function registerImmediate(handle) {
9462 channel.port2.postMessage(handle);
9463 };
9464 }
9465
9466 function installReadyStateChangeImplementation() {
9467 var html = doc.documentElement;
9468 registerImmediate = function registerImmediate(handle) {
9469 // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
9470 // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
9471 var script = doc.createElement("script");
9472 script.onreadystatechange = function () {
9473 runIfPresent(handle);
9474 script.onreadystatechange = null;
9475 html.removeChild(script);
9476 script = null;
9477 };
9478 html.appendChild(script);
9479 };
9480 }
9481
9482 function installSetTimeoutImplementation() {
9483 registerImmediate = function registerImmediate(handle) {
9484 setTimeout(runIfPresent, 0, handle);
9485 };
9486 }
9487
9488 // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
9489 var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
9490 attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
9491
9492 // Don't get fooled by e.g. browserify environments.
9493 if ({}.toString.call(global.process) === "[object process]") {
9494 // For Node.js before 0.9
9495 installNextTickImplementation();
9496 } else if (canUsePostMessage()) {
9497 // For non-IE10 modern browsers
9498 installPostMessageImplementation();
9499 } else if (global.MessageChannel) {
9500 // For web workers, where supported
9501 installMessageChannelImplementation();
9502 } else if (doc && "onreadystatechange" in doc.createElement("script")) {
9503 // For IE 6–8
9504 installReadyStateChangeImplementation();
9505 } else {
9506 // For older browsers
9507 installSetTimeoutImplementation();
9508 }
9509
9510 attachTo.setImmediate = setImmediate;
9511 attachTo.clearImmediate = clearImmediate;
9512})(typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self);
9513/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(6)))
9514
9515/***/ }),
9516/* 56 */
9517/***/ (function(module, exports, __webpack_require__) {
9518
9519"use strict";
9520/* WEBPACK VAR INJECTION */(function(global) {
9521
9522/**
9523 * Module exports.
9524 */
9525
9526module.exports = deprecate;
9527
9528/**
9529 * Mark that a method should not be used.
9530 * Returns a modified function which warns once by default.
9531 *
9532 * If `localStorage.noDeprecation = true` is set, then it is a no-op.
9533 *
9534 * If `localStorage.throwDeprecation = true` is set, then deprecated functions
9535 * will throw an Error when invoked.
9536 *
9537 * If `localStorage.traceDeprecation = true` is set, then deprecated functions
9538 * will invoke `console.trace()` instead of `console.error()`.
9539 *
9540 * @param {Function} fn - the function to deprecate
9541 * @param {String} msg - the string to print to the console when `fn` is invoked
9542 * @returns {Function} a new "deprecated" version of `fn`
9543 * @api public
9544 */
9545
9546function deprecate(fn, msg) {
9547 if (config('noDeprecation')) {
9548 return fn;
9549 }
9550
9551 var warned = false;
9552 function deprecated() {
9553 if (!warned) {
9554 if (config('throwDeprecation')) {
9555 throw new Error(msg);
9556 } else if (config('traceDeprecation')) {
9557 console.trace(msg);
9558 } else {
9559 console.warn(msg);
9560 }
9561 warned = true;
9562 }
9563 return fn.apply(this, arguments);
9564 }
9565
9566 return deprecated;
9567}
9568
9569/**
9570 * Checks `localStorage` for boolean values for the given `name`.
9571 *
9572 * @param {String} name
9573 * @returns {Boolean}
9574 * @api private
9575 */
9576
9577function config(name) {
9578 // accessing global.localStorage can trigger a DOMException in sandboxed iframes
9579 try {
9580 if (!global.localStorage) return false;
9581 } catch (_) {
9582 return false;
9583 }
9584 var val = global.localStorage[name];
9585 if (null == val) return false;
9586 return String(val).toLowerCase() === 'true';
9587}
9588/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
9589
9590/***/ }),
9591/* 57 */
9592/***/ (function(module, exports, __webpack_require__) {
9593
9594"use strict";
9595// Copyright Joyent, Inc. and other Node contributors.
9596//
9597// Permission is hereby granted, free of charge, to any person obtaining a
9598// copy of this software and associated documentation files (the
9599// "Software"), to deal in the Software without restriction, including
9600// without limitation the rights to use, copy, modify, merge, publish,
9601// distribute, sublicense, and/or sell copies of the Software, and to permit
9602// persons to whom the Software is furnished to do so, subject to the
9603// following conditions:
9604//
9605// The above copyright notice and this permission notice shall be included
9606// in all copies or substantial portions of the Software.
9607//
9608// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9609// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9610// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
9611// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
9612// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
9613// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
9614// USE OR OTHER DEALINGS IN THE SOFTWARE.
9615
9616// a passthrough stream.
9617// basically just the most minimal sort of Transform stream.
9618// Every written chunk gets output as-is.
9619
9620
9621
9622module.exports = PassThrough;
9623
9624var Transform = __webpack_require__(37);
9625
9626/*<replacement>*/
9627var util = __webpack_require__(8);
9628util.inherits = __webpack_require__(2);
9629/*</replacement>*/
9630
9631util.inherits(PassThrough, Transform);
9632
9633function PassThrough(options) {
9634 if (!(this instanceof PassThrough)) return new PassThrough(options);
9635
9636 Transform.call(this, options);
9637}
9638
9639PassThrough.prototype._transform = function (chunk, encoding, cb) {
9640 cb(null, chunk);
9641};
9642
9643/***/ }),
9644/* 58 */
9645/***/ (function(module, exports, __webpack_require__) {
9646
9647"use strict";
9648
9649
9650var Buffer = __webpack_require__(5).Buffer;
9651
9652module.exports = function (buf) {
9653 // If the buffer is backed by a Uint8Array, a faster version will work
9654 if (buf instanceof Uint8Array) {
9655 // If the buffer isn't a subarray, return the underlying ArrayBuffer
9656 if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
9657 return buf.buffer;
9658 } else if (typeof buf.buffer.slice === 'function') {
9659 // Otherwise we need to get a proper copy
9660 return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
9661 }
9662 }
9663
9664 if (Buffer.isBuffer(buf)) {
9665 // This is the slow version that will work with any Buffer
9666 // implementation (even in old browsers)
9667 var arrayCopy = new Uint8Array(buf.length);
9668 var len = buf.length;
9669 for (var i = 0; i < len; i++) {
9670 arrayCopy[i] = buf[i];
9671 }
9672 return arrayCopy.buffer;
9673 } else {
9674 throw new Error('Argument must be a Buffer');
9675 }
9676};
9677
9678/***/ }),
9679/* 59 */
9680/***/ (function(module, exports, __webpack_require__) {
9681
9682"use strict";
9683
9684
9685module.exports = extend;
9686
9687var hasOwnProperty = Object.prototype.hasOwnProperty;
9688
9689function extend() {
9690 var target = {};
9691
9692 for (var i = 0; i < arguments.length; i++) {
9693 var source = arguments[i];
9694
9695 for (var key in source) {
9696 if (hasOwnProperty.call(source, key)) {
9697 target[key] = source[key];
9698 }
9699 }
9700 }
9701
9702 return target;
9703}
9704
9705/***/ }),
9706/* 60 */
9707/***/ (function(module, exports, __webpack_require__) {
9708
9709"use strict";
9710
9711
9712module.exports = {
9713 "100": "Continue",
9714 "101": "Switching Protocols",
9715 "102": "Processing",
9716 "200": "OK",
9717 "201": "Created",
9718 "202": "Accepted",
9719 "203": "Non-Authoritative Information",
9720 "204": "No Content",
9721 "205": "Reset Content",
9722 "206": "Partial Content",
9723 "207": "Multi-Status",
9724 "208": "Already Reported",
9725 "226": "IM Used",
9726 "300": "Multiple Choices",
9727 "301": "Moved Permanently",
9728 "302": "Found",
9729 "303": "See Other",
9730 "304": "Not Modified",
9731 "305": "Use Proxy",
9732 "307": "Temporary Redirect",
9733 "308": "Permanent Redirect",
9734 "400": "Bad Request",
9735 "401": "Unauthorized",
9736 "402": "Payment Required",
9737 "403": "Forbidden",
9738 "404": "Not Found",
9739 "405": "Method Not Allowed",
9740 "406": "Not Acceptable",
9741 "407": "Proxy Authentication Required",
9742 "408": "Request Timeout",
9743 "409": "Conflict",
9744 "410": "Gone",
9745 "411": "Length Required",
9746 "412": "Precondition Failed",
9747 "413": "Payload Too Large",
9748 "414": "URI Too Long",
9749 "415": "Unsupported Media Type",
9750 "416": "Range Not Satisfiable",
9751 "417": "Expectation Failed",
9752 "418": "I'm a teapot",
9753 "421": "Misdirected Request",
9754 "422": "Unprocessable Entity",
9755 "423": "Locked",
9756 "424": "Failed Dependency",
9757 "425": "Unordered Collection",
9758 "426": "Upgrade Required",
9759 "428": "Precondition Required",
9760 "429": "Too Many Requests",
9761 "431": "Request Header Fields Too Large",
9762 "451": "Unavailable For Legal Reasons",
9763 "500": "Internal Server Error",
9764 "501": "Not Implemented",
9765 "502": "Bad Gateway",
9766 "503": "Service Unavailable",
9767 "504": "Gateway Timeout",
9768 "505": "HTTP Version Not Supported",
9769 "506": "Variant Also Negotiates",
9770 "507": "Insufficient Storage",
9771 "508": "Loop Detected",
9772 "509": "Bandwidth Limit Exceeded",
9773 "510": "Not Extended",
9774 "511": "Network Authentication Required"
9775};
9776
9777/***/ }),
9778/* 61 */
9779/***/ (function(module, exports, __webpack_require__) {
9780
9781"use strict";
9782/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;
9783
9784var _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; };
9785
9786/*! https://mths.be/punycode v1.4.1 by @mathias */
9787;(function (root) {
9788
9789 /** Detect free variables */
9790 var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
9791 var freeModule = ( false ? 'undefined' : _typeof(module)) == 'object' && module && !module.nodeType && module;
9792 var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global;
9793 if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal) {
9794 root = freeGlobal;
9795 }
9796
9797 /**
9798 * The `punycode` object.
9799 * @name punycode
9800 * @type Object
9801 */
9802 var punycode,
9803
9804
9805 /** Highest positive signed 32-bit float value */
9806 maxInt = 2147483647,
9807 // aka. 0x7FFFFFFF or 2^31-1
9808
9809 /** Bootstring parameters */
9810 base = 36,
9811 tMin = 1,
9812 tMax = 26,
9813 skew = 38,
9814 damp = 700,
9815 initialBias = 72,
9816 initialN = 128,
9817 // 0x80
9818 delimiter = '-',
9819 // '\x2D'
9820
9821 /** Regular expressions */
9822 regexPunycode = /^xn--/,
9823 regexNonASCII = /[^\x20-\x7E]/,
9824 // unprintable ASCII chars + non-ASCII chars
9825 regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g,
9826 // RFC 3490 separators
9827
9828 /** Error messages */
9829 errors = {
9830 'overflow': 'Overflow: input needs wider integers to process',
9831 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
9832 'invalid-input': 'Invalid input'
9833 },
9834
9835
9836 /** Convenience shortcuts */
9837 baseMinusTMin = base - tMin,
9838 floor = Math.floor,
9839 stringFromCharCode = String.fromCharCode,
9840
9841
9842 /** Temporary variable */
9843 key;
9844
9845 /*--------------------------------------------------------------------------*/
9846
9847 /**
9848 * A generic error utility function.
9849 * @private
9850 * @param {String} type The error type.
9851 * @returns {Error} Throws a `RangeError` with the applicable error message.
9852 */
9853 function error(type) {
9854 throw new RangeError(errors[type]);
9855 }
9856
9857 /**
9858 * A generic `Array#map` utility function.
9859 * @private
9860 * @param {Array} array The array to iterate over.
9861 * @param {Function} callback The function that gets called for every array
9862 * item.
9863 * @returns {Array} A new array of values returned by the callback function.
9864 */
9865 function map(array, fn) {
9866 var length = array.length;
9867 var result = [];
9868 while (length--) {
9869 result[length] = fn(array[length]);
9870 }
9871 return result;
9872 }
9873
9874 /**
9875 * A simple `Array#map`-like wrapper to work with domain name strings or email
9876 * addresses.
9877 * @private
9878 * @param {String} domain The domain name or email address.
9879 * @param {Function} callback The function that gets called for every
9880 * character.
9881 * @returns {Array} A new string of characters returned by the callback
9882 * function.
9883 */
9884 function mapDomain(string, fn) {
9885 var parts = string.split('@');
9886 var result = '';
9887 if (parts.length > 1) {
9888 // In email addresses, only the domain name should be punycoded. Leave
9889 // the local part (i.e. everything up to `@`) intact.
9890 result = parts[0] + '@';
9891 string = parts[1];
9892 }
9893 // Avoid `split(regex)` for IE8 compatibility. See #17.
9894 string = string.replace(regexSeparators, '\x2E');
9895 var labels = string.split('.');
9896 var encoded = map(labels, fn).join('.');
9897 return result + encoded;
9898 }
9899
9900 /**
9901 * Creates an array containing the numeric code points of each Unicode
9902 * character in the string. While JavaScript uses UCS-2 internally,
9903 * this function will convert a pair of surrogate halves (each of which
9904 * UCS-2 exposes as separate characters) into a single code point,
9905 * matching UTF-16.
9906 * @see `punycode.ucs2.encode`
9907 * @see <https://mathiasbynens.be/notes/javascript-encoding>
9908 * @memberOf punycode.ucs2
9909 * @name decode
9910 * @param {String} string The Unicode input string (UCS-2).
9911 * @returns {Array} The new array of code points.
9912 */
9913 function ucs2decode(string) {
9914 var output = [],
9915 counter = 0,
9916 length = string.length,
9917 value,
9918 extra;
9919 while (counter < length) {
9920 value = string.charCodeAt(counter++);
9921 if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
9922 // high surrogate, and there is a next character
9923 extra = string.charCodeAt(counter++);
9924 if ((extra & 0xFC00) == 0xDC00) {
9925 // low surrogate
9926 output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
9927 } else {
9928 // unmatched surrogate; only append this code unit, in case the next
9929 // code unit is the high surrogate of a surrogate pair
9930 output.push(value);
9931 counter--;
9932 }
9933 } else {
9934 output.push(value);
9935 }
9936 }
9937 return output;
9938 }
9939
9940 /**
9941 * Creates a string based on an array of numeric code points.
9942 * @see `punycode.ucs2.decode`
9943 * @memberOf punycode.ucs2
9944 * @name encode
9945 * @param {Array} codePoints The array of numeric code points.
9946 * @returns {String} The new Unicode string (UCS-2).
9947 */
9948 function ucs2encode(array) {
9949 return map(array, function (value) {
9950 var output = '';
9951 if (value > 0xFFFF) {
9952 value -= 0x10000;
9953 output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
9954 value = 0xDC00 | value & 0x3FF;
9955 }
9956 output += stringFromCharCode(value);
9957 return output;
9958 }).join('');
9959 }
9960
9961 /**
9962 * Converts a basic code point into a digit/integer.
9963 * @see `digitToBasic()`
9964 * @private
9965 * @param {Number} codePoint The basic numeric code point value.
9966 * @returns {Number} The numeric value of a basic code point (for use in
9967 * representing integers) in the range `0` to `base - 1`, or `base` if
9968 * the code point does not represent a value.
9969 */
9970 function basicToDigit(codePoint) {
9971 if (codePoint - 48 < 10) {
9972 return codePoint - 22;
9973 }
9974 if (codePoint - 65 < 26) {
9975 return codePoint - 65;
9976 }
9977 if (codePoint - 97 < 26) {
9978 return codePoint - 97;
9979 }
9980 return base;
9981 }
9982
9983 /**
9984 * Converts a digit/integer into a basic code point.
9985 * @see `basicToDigit()`
9986 * @private
9987 * @param {Number} digit The numeric value of a basic code point.
9988 * @returns {Number} The basic code point whose value (when used for
9989 * representing integers) is `digit`, which needs to be in the range
9990 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
9991 * used; else, the lowercase form is used. The behavior is undefined
9992 * if `flag` is non-zero and `digit` has no uppercase form.
9993 */
9994 function digitToBasic(digit, flag) {
9995 // 0..25 map to ASCII a..z or A..Z
9996 // 26..35 map to ASCII 0..9
9997 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
9998 }
9999
10000 /**
10001 * Bias adaptation function as per section 3.4 of RFC 3492.
10002 * https://tools.ietf.org/html/rfc3492#section-3.4
10003 * @private
10004 */
10005 function adapt(delta, numPoints, firstTime) {
10006 var k = 0;
10007 delta = firstTime ? floor(delta / damp) : delta >> 1;
10008 delta += floor(delta / numPoints);
10009 for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {
10010 delta = floor(delta / baseMinusTMin);
10011 }
10012 return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
10013 }
10014
10015 /**
10016 * Converts a Punycode string of ASCII-only symbols to a string of Unicode
10017 * symbols.
10018 * @memberOf punycode
10019 * @param {String} input The Punycode string of ASCII-only symbols.
10020 * @returns {String} The resulting string of Unicode symbols.
10021 */
10022 function decode(input) {
10023 // Don't use UCS-2
10024 var output = [],
10025 inputLength = input.length,
10026 out,
10027 i = 0,
10028 n = initialN,
10029 bias = initialBias,
10030 basic,
10031 j,
10032 index,
10033 oldi,
10034 w,
10035 k,
10036 digit,
10037 t,
10038
10039 /** Cached calculation results */
10040 baseMinusT;
10041
10042 // Handle the basic code points: let `basic` be the number of input code
10043 // points before the last delimiter, or `0` if there is none, then copy
10044 // the first basic code points to the output.
10045
10046 basic = input.lastIndexOf(delimiter);
10047 if (basic < 0) {
10048 basic = 0;
10049 }
10050
10051 for (j = 0; j < basic; ++j) {
10052 // if it's not a basic code point
10053 if (input.charCodeAt(j) >= 0x80) {
10054 error('not-basic');
10055 }
10056 output.push(input.charCodeAt(j));
10057 }
10058
10059 // Main decoding loop: start just after the last delimiter if any basic code
10060 // points were copied; start at the beginning otherwise.
10061
10062 for (index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{
10063
10064 // `index` is the index of the next character to be consumed.
10065 // Decode a generalized variable-length integer into `delta`,
10066 // which gets added to `i`. The overflow checking is easier
10067 // if we increase `i` as we go, then subtract off its starting
10068 // value at the end to obtain `delta`.
10069 for (oldi = i, w = 1, k = base;; /* no condition */k += base) {
10070
10071 if (index >= inputLength) {
10072 error('invalid-input');
10073 }
10074
10075 digit = basicToDigit(input.charCodeAt(index++));
10076
10077 if (digit >= base || digit > floor((maxInt - i) / w)) {
10078 error('overflow');
10079 }
10080
10081 i += digit * w;
10082 t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
10083
10084 if (digit < t) {
10085 break;
10086 }
10087
10088 baseMinusT = base - t;
10089 if (w > floor(maxInt / baseMinusT)) {
10090 error('overflow');
10091 }
10092
10093 w *= baseMinusT;
10094 }
10095
10096 out = output.length + 1;
10097 bias = adapt(i - oldi, out, oldi == 0);
10098
10099 // `i` was supposed to wrap around from `out` to `0`,
10100 // incrementing `n` each time, so we'll fix that now:
10101 if (floor(i / out) > maxInt - n) {
10102 error('overflow');
10103 }
10104
10105 n += floor(i / out);
10106 i %= out;
10107
10108 // Insert `n` at position `i` of the output
10109 output.splice(i++, 0, n);
10110 }
10111
10112 return ucs2encode(output);
10113 }
10114
10115 /**
10116 * Converts a string of Unicode symbols (e.g. a domain name label) to a
10117 * Punycode string of ASCII-only symbols.
10118 * @memberOf punycode
10119 * @param {String} input The string of Unicode symbols.
10120 * @returns {String} The resulting Punycode string of ASCII-only symbols.
10121 */
10122 function encode(input) {
10123 var n,
10124 delta,
10125 handledCPCount,
10126 basicLength,
10127 bias,
10128 j,
10129 m,
10130 q,
10131 k,
10132 t,
10133 currentValue,
10134 output = [],
10135
10136 /** `inputLength` will hold the number of code points in `input`. */
10137 inputLength,
10138
10139 /** Cached calculation results */
10140 handledCPCountPlusOne,
10141 baseMinusT,
10142 qMinusT;
10143
10144 // Convert the input in UCS-2 to Unicode
10145 input = ucs2decode(input);
10146
10147 // Cache the length
10148 inputLength = input.length;
10149
10150 // Initialize the state
10151 n = initialN;
10152 delta = 0;
10153 bias = initialBias;
10154
10155 // Handle the basic code points
10156 for (j = 0; j < inputLength; ++j) {
10157 currentValue = input[j];
10158 if (currentValue < 0x80) {
10159 output.push(stringFromCharCode(currentValue));
10160 }
10161 }
10162
10163 handledCPCount = basicLength = output.length;
10164
10165 // `handledCPCount` is the number of code points that have been handled;
10166 // `basicLength` is the number of basic code points.
10167
10168 // Finish the basic string - if it is not empty - with a delimiter
10169 if (basicLength) {
10170 output.push(delimiter);
10171 }
10172
10173 // Main encoding loop:
10174 while (handledCPCount < inputLength) {
10175
10176 // All non-basic code points < n have been handled already. Find the next
10177 // larger one:
10178 for (m = maxInt, j = 0; j < inputLength; ++j) {
10179 currentValue = input[j];
10180 if (currentValue >= n && currentValue < m) {
10181 m = currentValue;
10182 }
10183 }
10184
10185 // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
10186 // but guard against overflow
10187 handledCPCountPlusOne = handledCPCount + 1;
10188 if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
10189 error('overflow');
10190 }
10191
10192 delta += (m - n) * handledCPCountPlusOne;
10193 n = m;
10194
10195 for (j = 0; j < inputLength; ++j) {
10196 currentValue = input[j];
10197
10198 if (currentValue < n && ++delta > maxInt) {
10199 error('overflow');
10200 }
10201
10202 if (currentValue == n) {
10203 // Represent delta as a generalized variable-length integer
10204 for (q = delta, k = base;; /* no condition */k += base) {
10205 t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
10206 if (q < t) {
10207 break;
10208 }
10209 qMinusT = q - t;
10210 baseMinusT = base - t;
10211 output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
10212 q = floor(qMinusT / baseMinusT);
10213 }
10214
10215 output.push(stringFromCharCode(digitToBasic(q, 0)));
10216 bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
10217 delta = 0;
10218 ++handledCPCount;
10219 }
10220 }
10221
10222 ++delta;
10223 ++n;
10224 }
10225 return output.join('');
10226 }
10227
10228 /**
10229 * Converts a Punycode string representing a domain name or an email address
10230 * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
10231 * it doesn't matter if you call it on a string that has already been
10232 * converted to Unicode.
10233 * @memberOf punycode
10234 * @param {String} input The Punycoded domain name or email address to
10235 * convert to Unicode.
10236 * @returns {String} The Unicode representation of the given Punycode
10237 * string.
10238 */
10239 function toUnicode(input) {
10240 return mapDomain(input, function (string) {
10241 return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
10242 });
10243 }
10244
10245 /**
10246 * Converts a Unicode string representing a domain name or an email address to
10247 * Punycode. Only the non-ASCII parts of the domain name will be converted,
10248 * i.e. it doesn't matter if you call it with a domain that's already in
10249 * ASCII.
10250 * @memberOf punycode
10251 * @param {String} input The domain name or email address to convert, as a
10252 * Unicode string.
10253 * @returns {String} The Punycode representation of the given domain name or
10254 * email address.
10255 */
10256 function toASCII(input) {
10257 return mapDomain(input, function (string) {
10258 return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
10259 });
10260 }
10261
10262 /*--------------------------------------------------------------------------*/
10263
10264 /** Define the public API */
10265 punycode = {
10266 /**
10267 * A string representing the current Punycode.js version number.
10268 * @memberOf punycode
10269 * @type String
10270 */
10271 'version': '1.4.1',
10272 /**
10273 * An object of methods to convert from JavaScript's internal character
10274 * representation (UCS-2) to Unicode code points, and back.
10275 * @see <https://mathiasbynens.be/notes/javascript-encoding>
10276 * @memberOf punycode
10277 * @type Object
10278 */
10279 'ucs2': {
10280 'decode': ucs2decode,
10281 'encode': ucs2encode
10282 },
10283 'decode': decode,
10284 'encode': encode,
10285 'toASCII': toASCII,
10286 'toUnicode': toUnicode
10287 };
10288
10289 /** Expose `punycode` */
10290 // Some AMD build optimizers, like r.js, check for specific condition patterns
10291 // like the following:
10292 if ("function" == 'function' && _typeof(__webpack_require__(38)) == 'object' && __webpack_require__(38)) {
10293 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
10294 return punycode;
10295 }).call(exports, __webpack_require__, exports, module),
10296 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
10297 } else if (freeExports && freeModule) {
10298 if (module.exports == freeExports) {
10299 // in Node.js, io.js, or RingoJS v0.8.0+
10300 freeModule.exports = punycode;
10301 } else {
10302 // in Narwhal or RingoJS v0.7.0-
10303 for (key in punycode) {
10304 punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
10305 }
10306 }
10307 } else {
10308 // in Rhino or a web browser
10309 root.punycode = punycode;
10310 }
10311})(undefined);
10312/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(62)(module), __webpack_require__(1)))
10313
10314/***/ }),
10315/* 62 */
10316/***/ (function(module, exports, __webpack_require__) {
10317
10318"use strict";
10319
10320
10321module.exports = function (module) {
10322 if (!module.webpackPolyfill) {
10323 module.deprecate = function () {};
10324 module.paths = [];
10325 // module.parent = undefined by default
10326 if (!module.children) module.children = [];
10327 Object.defineProperty(module, "loaded", {
10328 enumerable: true,
10329 get: function get() {
10330 return module.l;
10331 }
10332 });
10333 Object.defineProperty(module, "id", {
10334 enumerable: true,
10335 get: function get() {
10336 return module.i;
10337 }
10338 });
10339 module.webpackPolyfill = 1;
10340 }
10341 return module;
10342};
10343
10344/***/ }),
10345/* 63 */
10346/***/ (function(module, exports, __webpack_require__) {
10347
10348"use strict";
10349
10350
10351var _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; };
10352
10353module.exports = {
10354 isString: function isString(arg) {
10355 return typeof arg === 'string';
10356 },
10357 isObject: function isObject(arg) {
10358 return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && arg !== null;
10359 },
10360 isNull: function isNull(arg) {
10361 return arg === null;
10362 },
10363 isNullOrUndefined: function isNullOrUndefined(arg) {
10364 return arg == null;
10365 }
10366};
10367
10368/***/ }),
10369/* 64 */
10370/***/ (function(module, exports, __webpack_require__) {
10371
10372"use strict";
10373
10374
10375exports.decode = exports.parse = __webpack_require__(65);
10376exports.encode = exports.stringify = __webpack_require__(66);
10377
10378/***/ }),
10379/* 65 */
10380/***/ (function(module, exports, __webpack_require__) {
10381
10382"use strict";
10383// Copyright Joyent, Inc. and other Node contributors.
10384//
10385// Permission is hereby granted, free of charge, to any person obtaining a
10386// copy of this software and associated documentation files (the
10387// "Software"), to deal in the Software without restriction, including
10388// without limitation the rights to use, copy, modify, merge, publish,
10389// distribute, sublicense, and/or sell copies of the Software, and to permit
10390// persons to whom the Software is furnished to do so, subject to the
10391// following conditions:
10392//
10393// The above copyright notice and this permission notice shall be included
10394// in all copies or substantial portions of the Software.
10395//
10396// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10397// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10398// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
10399// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
10400// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
10401// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
10402// USE OR OTHER DEALINGS IN THE SOFTWARE.
10403
10404
10405
10406// If obj.hasOwnProperty has been overridden, then calling
10407// obj.hasOwnProperty(prop) will break.
10408// See: https://github.com/joyent/node/issues/1707
10409
10410function hasOwnProperty(obj, prop) {
10411 return Object.prototype.hasOwnProperty.call(obj, prop);
10412}
10413
10414module.exports = function (qs, sep, eq, options) {
10415 sep = sep || '&';
10416 eq = eq || '=';
10417 var obj = {};
10418
10419 if (typeof qs !== 'string' || qs.length === 0) {
10420 return obj;
10421 }
10422
10423 var regexp = /\+/g;
10424 qs = qs.split(sep);
10425
10426 var maxKeys = 1000;
10427 if (options && typeof options.maxKeys === 'number') {
10428 maxKeys = options.maxKeys;
10429 }
10430
10431 var len = qs.length;
10432 // maxKeys <= 0 means that we should not limit keys count
10433 if (maxKeys > 0 && len > maxKeys) {
10434 len = maxKeys;
10435 }
10436
10437 for (var i = 0; i < len; ++i) {
10438 var x = qs[i].replace(regexp, '%20'),
10439 idx = x.indexOf(eq),
10440 kstr,
10441 vstr,
10442 k,
10443 v;
10444
10445 if (idx >= 0) {
10446 kstr = x.substr(0, idx);
10447 vstr = x.substr(idx + 1);
10448 } else {
10449 kstr = x;
10450 vstr = '';
10451 }
10452
10453 k = decodeURIComponent(kstr);
10454 v = decodeURIComponent(vstr);
10455
10456 if (!hasOwnProperty(obj, k)) {
10457 obj[k] = v;
10458 } else if (isArray(obj[k])) {
10459 obj[k].push(v);
10460 } else {
10461 obj[k] = [obj[k], v];
10462 }
10463 }
10464
10465 return obj;
10466};
10467
10468var isArray = Array.isArray || function (xs) {
10469 return Object.prototype.toString.call(xs) === '[object Array]';
10470};
10471
10472/***/ }),
10473/* 66 */
10474/***/ (function(module, exports, __webpack_require__) {
10475
10476"use strict";
10477// Copyright Joyent, Inc. and other Node contributors.
10478//
10479// Permission is hereby granted, free of charge, to any person obtaining a
10480// copy of this software and associated documentation files (the
10481// "Software"), to deal in the Software without restriction, including
10482// without limitation the rights to use, copy, modify, merge, publish,
10483// distribute, sublicense, and/or sell copies of the Software, and to permit
10484// persons to whom the Software is furnished to do so, subject to the
10485// following conditions:
10486//
10487// The above copyright notice and this permission notice shall be included
10488// in all copies or substantial portions of the Software.
10489//
10490// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10491// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10492// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
10493// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
10494// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
10495// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
10496// USE OR OTHER DEALINGS IN THE SOFTWARE.
10497
10498
10499
10500var _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; };
10501
10502var stringifyPrimitive = function stringifyPrimitive(v) {
10503 switch (typeof v === 'undefined' ? 'undefined' : _typeof(v)) {
10504 case 'string':
10505 return v;
10506
10507 case 'boolean':
10508 return v ? 'true' : 'false';
10509
10510 case 'number':
10511 return isFinite(v) ? v : '';
10512
10513 default:
10514 return '';
10515 }
10516};
10517
10518module.exports = function (obj, sep, eq, name) {
10519 sep = sep || '&';
10520 eq = eq || '=';
10521 if (obj === null) {
10522 obj = undefined;
10523 }
10524
10525 if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object') {
10526 return map(objectKeys(obj), function (k) {
10527 var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
10528 if (isArray(obj[k])) {
10529 return map(obj[k], function (v) {
10530 return ks + encodeURIComponent(stringifyPrimitive(v));
10531 }).join(sep);
10532 } else {
10533 return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
10534 }
10535 }).join(sep);
10536 }
10537
10538 if (!name) return '';
10539 return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj));
10540};
10541
10542var isArray = Array.isArray || function (xs) {
10543 return Object.prototype.toString.call(xs) === '[object Array]';
10544};
10545
10546function map(xs, f) {
10547 if (xs.map) return xs.map(f);
10548 var res = [];
10549 for (var i = 0; i < xs.length; i++) {
10550 res.push(f(xs[i], i));
10551 }
10552 return res;
10553}
10554
10555var objectKeys = Object.keys || function (obj) {
10556 var res = [];
10557 for (var key in obj) {
10558 if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
10559 }
10560 return res;
10561};
10562
10563/***/ }),
10564/* 67 */
10565/***/ (function(module, exports, __webpack_require__) {
10566
10567"use strict";
10568
10569
10570var http = __webpack_require__(29);
10571var url = __webpack_require__(26);
10572
10573var https = module.exports;
10574
10575for (var key in http) {
10576 if (http.hasOwnProperty(key)) https[key] = http[key];
10577}
10578
10579https.request = function (params, cb) {
10580 params = validateParams(params);
10581 return http.request.call(this, params, cb);
10582};
10583
10584https.get = function (params, cb) {
10585 params = validateParams(params);
10586 return http.get.call(this, params, cb);
10587};
10588
10589function validateParams(params) {
10590 if (typeof params === 'string') {
10591 params = url.parse(params);
10592 }
10593 if (!params.protocol) {
10594 params.protocol = 'https:';
10595 }
10596 if (params.protocol !== 'https:') {
10597 throw new Error('Protocol "' + params.protocol + '" not supported. Expected "https:"');
10598 }
10599 return params;
10600}
10601
10602/***/ }),
10603/* 68 */
10604/***/ (function(module, exports, __webpack_require__) {
10605
10606"use strict";
10607
10608
10609var _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; };
10610
10611// Generated by CoffeeScript 1.12.7
10612(function () {
10613 "use strict";
10614
10615 var builder,
10616 defaults,
10617 escapeCDATA,
10618 requiresCDATA,
10619 wrapCDATA,
10620 hasProp = {}.hasOwnProperty;
10621
10622 builder = __webpack_require__(69);
10623
10624 defaults = __webpack_require__(27).defaults;
10625
10626 requiresCDATA = function requiresCDATA(entry) {
10627 return typeof entry === "string" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0);
10628 };
10629
10630 wrapCDATA = function wrapCDATA(entry) {
10631 return "<![CDATA[" + escapeCDATA(entry) + "]]>";
10632 };
10633
10634 escapeCDATA = function escapeCDATA(entry) {
10635 return entry.replace(']]>', ']]]]><![CDATA[>');
10636 };
10637
10638 exports.Builder = function () {
10639 function Builder(opts) {
10640 var key, ref, value;
10641 this.options = {};
10642 ref = defaults["0.2"];
10643 for (key in ref) {
10644 if (!hasProp.call(ref, key)) continue;
10645 value = ref[key];
10646 this.options[key] = value;
10647 }
10648 for (key in opts) {
10649 if (!hasProp.call(opts, key)) continue;
10650 value = opts[key];
10651 this.options[key] = value;
10652 }
10653 }
10654
10655 Builder.prototype.buildObject = function (rootObj) {
10656 var attrkey, charkey, render, rootElement, rootName;
10657 attrkey = this.options.attrkey;
10658 charkey = this.options.charkey;
10659 if (Object.keys(rootObj).length === 1 && this.options.rootName === defaults['0.2'].rootName) {
10660 rootName = Object.keys(rootObj)[0];
10661 rootObj = rootObj[rootName];
10662 } else {
10663 rootName = this.options.rootName;
10664 }
10665 render = function (_this) {
10666 return function (element, obj) {
10667 var attr, child, entry, index, key, value;
10668 if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') {
10669 if (_this.options.cdata && requiresCDATA(obj)) {
10670 element.raw(wrapCDATA(obj));
10671 } else {
10672 element.txt(obj);
10673 }
10674 } else if (Array.isArray(obj)) {
10675 for (index in obj) {
10676 if (!hasProp.call(obj, index)) continue;
10677 child = obj[index];
10678 for (key in child) {
10679 entry = child[key];
10680 element = render(element.ele(key), entry).up();
10681 }
10682 }
10683 } else {
10684 for (key in obj) {
10685 if (!hasProp.call(obj, key)) continue;
10686 child = obj[key];
10687 if (key === attrkey) {
10688 if ((typeof child === 'undefined' ? 'undefined' : _typeof(child)) === "object") {
10689 for (attr in child) {
10690 value = child[attr];
10691 element = element.att(attr, value);
10692 }
10693 }
10694 } else if (key === charkey) {
10695 if (_this.options.cdata && requiresCDATA(child)) {
10696 element = element.raw(wrapCDATA(child));
10697 } else {
10698 element = element.txt(child);
10699 }
10700 } else if (Array.isArray(child)) {
10701 for (index in child) {
10702 if (!hasProp.call(child, index)) continue;
10703 entry = child[index];
10704 if (typeof entry === 'string') {
10705 if (_this.options.cdata && requiresCDATA(entry)) {
10706 element = element.ele(key).raw(wrapCDATA(entry)).up();
10707 } else {
10708 element = element.ele(key, entry).up();
10709 }
10710 } else {
10711 element = render(element.ele(key), entry).up();
10712 }
10713 }
10714 } else if ((typeof child === 'undefined' ? 'undefined' : _typeof(child)) === "object") {
10715 element = render(element.ele(key), child).up();
10716 } else {
10717 if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) {
10718 element = element.ele(key).raw(wrapCDATA(child)).up();
10719 } else {
10720 if (child == null) {
10721 child = '';
10722 }
10723 element = element.ele(key, child.toString()).up();
10724 }
10725 }
10726 }
10727 }
10728 return element;
10729 };
10730 }(this);
10731 rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {
10732 headless: this.options.headless,
10733 allowSurrogateChars: this.options.allowSurrogateChars
10734 });
10735 return render(rootElement, rootObj).end(this.options.renderOpts);
10736 };
10737
10738 return Builder;
10739 }();
10740}).call(undefined);
10741
10742/***/ }),
10743/* 69 */
10744/***/ (function(module, exports, __webpack_require__) {
10745
10746"use strict";
10747
10748
10749// Generated by CoffeeScript 1.12.7
10750(function () {
10751 var XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref;
10752
10753 ref = __webpack_require__(3), assign = ref.assign, isFunction = ref.isFunction;
10754
10755 XMLDocument = __webpack_require__(70);
10756
10757 XMLDocumentCB = __webpack_require__(71);
10758
10759 XMLStringWriter = __webpack_require__(28);
10760
10761 XMLStreamWriter = __webpack_require__(72);
10762
10763 module.exports.create = function (name, xmldec, doctype, options) {
10764 var doc, root;
10765 if (name == null) {
10766 throw new Error("Root element needs a name");
10767 }
10768 options = assign({}, xmldec, doctype, options);
10769 doc = new XMLDocument(options);
10770 root = doc.element(name);
10771 if (!options.headless) {
10772 doc.declaration(options);
10773 if (options.pubID != null || options.sysID != null) {
10774 doc.doctype(options);
10775 }
10776 }
10777 return root;
10778 };
10779
10780 module.exports.begin = function (options, onData, onEnd) {
10781 var ref1;
10782 if (isFunction(options)) {
10783 ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1];
10784 options = {};
10785 }
10786 if (onData) {
10787 return new XMLDocumentCB(options, onData, onEnd);
10788 } else {
10789 return new XMLDocument(options);
10790 }
10791 };
10792
10793 module.exports.stringWriter = function (options) {
10794 return new XMLStringWriter(options);
10795 };
10796
10797 module.exports.streamWriter = function (stream, options) {
10798 return new XMLStreamWriter(stream, options);
10799 };
10800}).call(undefined);
10801
10802/***/ }),
10803/* 70 */
10804/***/ (function(module, exports, __webpack_require__) {
10805
10806"use strict";
10807
10808
10809// Generated by CoffeeScript 1.12.7
10810(function () {
10811 var XMLDocument,
10812 XMLNode,
10813 XMLStringWriter,
10814 XMLStringifier,
10815 isPlainObject,
10816 extend = function extend(child, parent) {
10817 for (var key in parent) {
10818 if (hasProp.call(parent, key)) child[key] = parent[key];
10819 }function ctor() {
10820 this.constructor = child;
10821 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
10822 },
10823 hasProp = {}.hasOwnProperty;
10824
10825 isPlainObject = __webpack_require__(3).isPlainObject;
10826
10827 XMLNode = __webpack_require__(0);
10828
10829 XMLStringifier = __webpack_require__(41);
10830
10831 XMLStringWriter = __webpack_require__(28);
10832
10833 module.exports = XMLDocument = function (superClass) {
10834 extend(XMLDocument, superClass);
10835
10836 function XMLDocument(options) {
10837 XMLDocument.__super__.constructor.call(this, null);
10838 options || (options = {});
10839 if (!options.writer) {
10840 options.writer = new XMLStringWriter();
10841 }
10842 this.options = options;
10843 this.stringify = new XMLStringifier(options);
10844 this.isDocument = true;
10845 }
10846
10847 XMLDocument.prototype.end = function (writer) {
10848 var writerOptions;
10849 if (!writer) {
10850 writer = this.options.writer;
10851 } else if (isPlainObject(writer)) {
10852 writerOptions = writer;
10853 writer = this.options.writer.set(writerOptions);
10854 }
10855 return writer.document(this);
10856 };
10857
10858 XMLDocument.prototype.toString = function (options) {
10859 return this.options.writer.set(options).document(this);
10860 };
10861
10862 return XMLDocument;
10863 }(XMLNode);
10864}).call(undefined);
10865
10866/***/ }),
10867/* 71 */
10868/***/ (function(module, exports, __webpack_require__) {
10869
10870"use strict";
10871
10872
10873// Generated by CoffeeScript 1.12.7
10874(function () {
10875 var XMLAttribute,
10876 XMLCData,
10877 XMLComment,
10878 XMLDTDAttList,
10879 XMLDTDElement,
10880 XMLDTDEntity,
10881 XMLDTDNotation,
10882 XMLDeclaration,
10883 XMLDocType,
10884 XMLDocumentCB,
10885 XMLElement,
10886 XMLProcessingInstruction,
10887 XMLRaw,
10888 XMLStringWriter,
10889 XMLStringifier,
10890 XMLText,
10891 isFunction,
10892 isObject,
10893 isPlainObject,
10894 ref,
10895 hasProp = {}.hasOwnProperty;
10896
10897 ref = __webpack_require__(3), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject;
10898
10899 XMLElement = __webpack_require__(12);
10900
10901 XMLCData = __webpack_require__(13);
10902
10903 XMLComment = __webpack_require__(14);
10904
10905 XMLRaw = __webpack_require__(21);
10906
10907 XMLText = __webpack_require__(22);
10908
10909 XMLProcessingInstruction = __webpack_require__(23);
10910
10911 XMLDeclaration = __webpack_require__(15);
10912
10913 XMLDocType = __webpack_require__(16);
10914
10915 XMLDTDAttList = __webpack_require__(17);
10916
10917 XMLDTDEntity = __webpack_require__(18);
10918
10919 XMLDTDElement = __webpack_require__(19);
10920
10921 XMLDTDNotation = __webpack_require__(20);
10922
10923 XMLAttribute = __webpack_require__(40);
10924
10925 XMLStringifier = __webpack_require__(41);
10926
10927 XMLStringWriter = __webpack_require__(28);
10928
10929 module.exports = XMLDocumentCB = function () {
10930 function XMLDocumentCB(options, onData, onEnd) {
10931 var writerOptions;
10932 options || (options = {});
10933 if (!options.writer) {
10934 options.writer = new XMLStringWriter(options);
10935 } else if (isPlainObject(options.writer)) {
10936 writerOptions = options.writer;
10937 options.writer = new XMLStringWriter(writerOptions);
10938 }
10939 this.options = options;
10940 this.writer = options.writer;
10941 this.stringify = new XMLStringifier(options);
10942 this.onDataCallback = onData || function () {};
10943 this.onEndCallback = onEnd || function () {};
10944 this.currentNode = null;
10945 this.currentLevel = -1;
10946 this.openTags = {};
10947 this.documentStarted = false;
10948 this.documentCompleted = false;
10949 this.root = null;
10950 }
10951
10952 XMLDocumentCB.prototype.node = function (name, attributes, text) {
10953 var ref1;
10954 if (name == null) {
10955 throw new Error("Missing node name");
10956 }
10957 if (this.root && this.currentLevel === -1) {
10958 throw new Error("Document can only have one root node");
10959 }
10960 this.openCurrent();
10961 name = name.valueOf();
10962 if (attributes == null) {
10963 attributes = {};
10964 }
10965 attributes = attributes.valueOf();
10966 if (!isObject(attributes)) {
10967 ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
10968 }
10969 this.currentNode = new XMLElement(this, name, attributes);
10970 this.currentNode.children = false;
10971 this.currentLevel++;
10972 this.openTags[this.currentLevel] = this.currentNode;
10973 if (text != null) {
10974 this.text(text);
10975 }
10976 return this;
10977 };
10978
10979 XMLDocumentCB.prototype.element = function (name, attributes, text) {
10980 if (this.currentNode && this.currentNode instanceof XMLDocType) {
10981 return this.dtdElement.apply(this, arguments);
10982 } else {
10983 return this.node(name, attributes, text);
10984 }
10985 };
10986
10987 XMLDocumentCB.prototype.attribute = function (name, value) {
10988 var attName, attValue;
10989 if (!this.currentNode || this.currentNode.children) {
10990 throw new Error("att() can only be used immediately after an ele() call in callback mode");
10991 }
10992 if (name != null) {
10993 name = name.valueOf();
10994 }
10995 if (isObject(name)) {
10996 for (attName in name) {
10997 if (!hasProp.call(name, attName)) continue;
10998 attValue = name[attName];
10999 this.attribute(attName, attValue);
11000 }
11001 } else {
11002 if (isFunction(value)) {
11003 value = value.apply();
11004 }
11005 if (!this.options.skipNullAttributes || value != null) {
11006 this.currentNode.attributes[name] = new XMLAttribute(this, name, value);
11007 }
11008 }
11009 return this;
11010 };
11011
11012 XMLDocumentCB.prototype.text = function (value) {
11013 var node;
11014 this.openCurrent();
11015 node = new XMLText(this, value);
11016 this.onData(this.writer.text(node, this.currentLevel + 1));
11017 return this;
11018 };
11019
11020 XMLDocumentCB.prototype.cdata = function (value) {
11021 var node;
11022 this.openCurrent();
11023 node = new XMLCData(this, value);
11024 this.onData(this.writer.cdata(node, this.currentLevel + 1));
11025 return this;
11026 };
11027
11028 XMLDocumentCB.prototype.comment = function (value) {
11029 var node;
11030 this.openCurrent();
11031 node = new XMLComment(this, value);
11032 this.onData(this.writer.comment(node, this.currentLevel + 1));
11033 return this;
11034 };
11035
11036 XMLDocumentCB.prototype.raw = function (value) {
11037 var node;
11038 this.openCurrent();
11039 node = new XMLRaw(this, value);
11040 this.onData(this.writer.raw(node, this.currentLevel + 1));
11041 return this;
11042 };
11043
11044 XMLDocumentCB.prototype.instruction = function (target, value) {
11045 var i, insTarget, insValue, len, node;
11046 this.openCurrent();
11047 if (target != null) {
11048 target = target.valueOf();
11049 }
11050 if (value != null) {
11051 value = value.valueOf();
11052 }
11053 if (Array.isArray(target)) {
11054 for (i = 0, len = target.length; i < len; i++) {
11055 insTarget = target[i];
11056 this.instruction(insTarget);
11057 }
11058 } else if (isObject(target)) {
11059 for (insTarget in target) {
11060 if (!hasProp.call(target, insTarget)) continue;
11061 insValue = target[insTarget];
11062 this.instruction(insTarget, insValue);
11063 }
11064 } else {
11065 if (isFunction(value)) {
11066 value = value.apply();
11067 }
11068 node = new XMLProcessingInstruction(this, target, value);
11069 this.onData(this.writer.processingInstruction(node, this.currentLevel + 1));
11070 }
11071 return this;
11072 };
11073
11074 XMLDocumentCB.prototype.declaration = function (version, encoding, standalone) {
11075 var node;
11076 this.openCurrent();
11077 if (this.documentStarted) {
11078 throw new Error("declaration() must be the first node");
11079 }
11080 node = new XMLDeclaration(this, version, encoding, standalone);
11081 this.onData(this.writer.declaration(node, this.currentLevel + 1));
11082 return this;
11083 };
11084
11085 XMLDocumentCB.prototype.doctype = function (root, pubID, sysID) {
11086 this.openCurrent();
11087 if (root == null) {
11088 throw new Error("Missing root node name");
11089 }
11090 if (this.root) {
11091 throw new Error("dtd() must come before the root node");
11092 }
11093 this.currentNode = new XMLDocType(this, pubID, sysID);
11094 this.currentNode.rootNodeName = root;
11095 this.currentNode.children = false;
11096 this.currentLevel++;
11097 this.openTags[this.currentLevel] = this.currentNode;
11098 return this;
11099 };
11100
11101 XMLDocumentCB.prototype.dtdElement = function (name, value) {
11102 var node;
11103 this.openCurrent();
11104 node = new XMLDTDElement(this, name, value);
11105 this.onData(this.writer.dtdElement(node, this.currentLevel + 1));
11106 return this;
11107 };
11108
11109 XMLDocumentCB.prototype.attList = function (elementName, attributeName, attributeType, defaultValueType, defaultValue) {
11110 var node;
11111 this.openCurrent();
11112 node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
11113 this.onData(this.writer.dtdAttList(node, this.currentLevel + 1));
11114 return this;
11115 };
11116
11117 XMLDocumentCB.prototype.entity = function (name, value) {
11118 var node;
11119 this.openCurrent();
11120 node = new XMLDTDEntity(this, false, name, value);
11121 this.onData(this.writer.dtdEntity(node, this.currentLevel + 1));
11122 return this;
11123 };
11124
11125 XMLDocumentCB.prototype.pEntity = function (name, value) {
11126 var node;
11127 this.openCurrent();
11128 node = new XMLDTDEntity(this, true, name, value);
11129 this.onData(this.writer.dtdEntity(node, this.currentLevel + 1));
11130 return this;
11131 };
11132
11133 XMLDocumentCB.prototype.notation = function (name, value) {
11134 var node;
11135 this.openCurrent();
11136 node = new XMLDTDNotation(this, name, value);
11137 this.onData(this.writer.dtdNotation(node, this.currentLevel + 1));
11138 return this;
11139 };
11140
11141 XMLDocumentCB.prototype.up = function () {
11142 if (this.currentLevel < 0) {
11143 throw new Error("The document node has no parent");
11144 }
11145 if (this.currentNode) {
11146 if (this.currentNode.children) {
11147 this.closeNode(this.currentNode);
11148 } else {
11149 this.openNode(this.currentNode);
11150 }
11151 this.currentNode = null;
11152 } else {
11153 this.closeNode(this.openTags[this.currentLevel]);
11154 }
11155 delete this.openTags[this.currentLevel];
11156 this.currentLevel--;
11157 return this;
11158 };
11159
11160 XMLDocumentCB.prototype.end = function () {
11161 while (this.currentLevel >= 0) {
11162 this.up();
11163 }
11164 return this.onEnd();
11165 };
11166
11167 XMLDocumentCB.prototype.openCurrent = function () {
11168 if (this.currentNode) {
11169 this.currentNode.children = true;
11170 return this.openNode(this.currentNode);
11171 }
11172 };
11173
11174 XMLDocumentCB.prototype.openNode = function (node) {
11175 if (!node.isOpen) {
11176 if (!this.root && this.currentLevel === 0 && node instanceof XMLElement) {
11177 this.root = node;
11178 }
11179 this.onData(this.writer.openNode(node, this.currentLevel));
11180 return node.isOpen = true;
11181 }
11182 };
11183
11184 XMLDocumentCB.prototype.closeNode = function (node) {
11185 if (!node.isClosed) {
11186 this.onData(this.writer.closeNode(node, this.currentLevel));
11187 return node.isClosed = true;
11188 }
11189 };
11190
11191 XMLDocumentCB.prototype.onData = function (chunk) {
11192 this.documentStarted = true;
11193 return this.onDataCallback(chunk);
11194 };
11195
11196 XMLDocumentCB.prototype.onEnd = function () {
11197 this.documentCompleted = true;
11198 return this.onEndCallback();
11199 };
11200
11201 XMLDocumentCB.prototype.ele = function () {
11202 return this.element.apply(this, arguments);
11203 };
11204
11205 XMLDocumentCB.prototype.nod = function (name, attributes, text) {
11206 return this.node(name, attributes, text);
11207 };
11208
11209 XMLDocumentCB.prototype.txt = function (value) {
11210 return this.text(value);
11211 };
11212
11213 XMLDocumentCB.prototype.dat = function (value) {
11214 return this.cdata(value);
11215 };
11216
11217 XMLDocumentCB.prototype.com = function (value) {
11218 return this.comment(value);
11219 };
11220
11221 XMLDocumentCB.prototype.ins = function (target, value) {
11222 return this.instruction(target, value);
11223 };
11224
11225 XMLDocumentCB.prototype.dec = function (version, encoding, standalone) {
11226 return this.declaration(version, encoding, standalone);
11227 };
11228
11229 XMLDocumentCB.prototype.dtd = function (root, pubID, sysID) {
11230 return this.doctype(root, pubID, sysID);
11231 };
11232
11233 XMLDocumentCB.prototype.e = function (name, attributes, text) {
11234 return this.element(name, attributes, text);
11235 };
11236
11237 XMLDocumentCB.prototype.n = function (name, attributes, text) {
11238 return this.node(name, attributes, text);
11239 };
11240
11241 XMLDocumentCB.prototype.t = function (value) {
11242 return this.text(value);
11243 };
11244
11245 XMLDocumentCB.prototype.d = function (value) {
11246 return this.cdata(value);
11247 };
11248
11249 XMLDocumentCB.prototype.c = function (value) {
11250 return this.comment(value);
11251 };
11252
11253 XMLDocumentCB.prototype.r = function (value) {
11254 return this.raw(value);
11255 };
11256
11257 XMLDocumentCB.prototype.i = function (target, value) {
11258 return this.instruction(target, value);
11259 };
11260
11261 XMLDocumentCB.prototype.att = function () {
11262 if (this.currentNode && this.currentNode instanceof XMLDocType) {
11263 return this.attList.apply(this, arguments);
11264 } else {
11265 return this.attribute.apply(this, arguments);
11266 }
11267 };
11268
11269 XMLDocumentCB.prototype.a = function () {
11270 if (this.currentNode && this.currentNode instanceof XMLDocType) {
11271 return this.attList.apply(this, arguments);
11272 } else {
11273 return this.attribute.apply(this, arguments);
11274 }
11275 };
11276
11277 XMLDocumentCB.prototype.ent = function (name, value) {
11278 return this.entity(name, value);
11279 };
11280
11281 XMLDocumentCB.prototype.pent = function (name, value) {
11282 return this.pEntity(name, value);
11283 };
11284
11285 XMLDocumentCB.prototype.not = function (name, value) {
11286 return this.notation(name, value);
11287 };
11288
11289 return XMLDocumentCB;
11290 }();
11291}).call(undefined);
11292
11293/***/ }),
11294/* 72 */
11295/***/ (function(module, exports, __webpack_require__) {
11296
11297"use strict";
11298
11299
11300// Generated by CoffeeScript 1.12.7
11301(function () {
11302 var XMLCData,
11303 XMLComment,
11304 XMLDTDAttList,
11305 XMLDTDElement,
11306 XMLDTDEntity,
11307 XMLDTDNotation,
11308 XMLDeclaration,
11309 XMLDocType,
11310 XMLElement,
11311 XMLProcessingInstruction,
11312 XMLRaw,
11313 XMLStreamWriter,
11314 XMLText,
11315 XMLWriterBase,
11316 extend = function extend(child, parent) {
11317 for (var key in parent) {
11318 if (hasProp.call(parent, key)) child[key] = parent[key];
11319 }function ctor() {
11320 this.constructor = child;
11321 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
11322 },
11323 hasProp = {}.hasOwnProperty;
11324
11325 XMLDeclaration = __webpack_require__(15);
11326
11327 XMLDocType = __webpack_require__(16);
11328
11329 XMLCData = __webpack_require__(13);
11330
11331 XMLComment = __webpack_require__(14);
11332
11333 XMLElement = __webpack_require__(12);
11334
11335 XMLRaw = __webpack_require__(21);
11336
11337 XMLText = __webpack_require__(22);
11338
11339 XMLProcessingInstruction = __webpack_require__(23);
11340
11341 XMLDTDAttList = __webpack_require__(17);
11342
11343 XMLDTDElement = __webpack_require__(19);
11344
11345 XMLDTDEntity = __webpack_require__(18);
11346
11347 XMLDTDNotation = __webpack_require__(20);
11348
11349 XMLWriterBase = __webpack_require__(42);
11350
11351 module.exports = XMLStreamWriter = function (superClass) {
11352 extend(XMLStreamWriter, superClass);
11353
11354 function XMLStreamWriter(stream, options) {
11355 XMLStreamWriter.__super__.constructor.call(this, options);
11356 this.stream = stream;
11357 }
11358
11359 XMLStreamWriter.prototype.document = function (doc) {
11360 var child, i, j, len, len1, ref, ref1, results;
11361 ref = doc.children;
11362 for (i = 0, len = ref.length; i < len; i++) {
11363 child = ref[i];
11364 child.isLastRootNode = false;
11365 }
11366 doc.children[doc.children.length - 1].isLastRootNode = true;
11367 ref1 = doc.children;
11368 results = [];
11369 for (j = 0, len1 = ref1.length; j < len1; j++) {
11370 child = ref1[j];
11371 switch (false) {
11372 case !(child instanceof XMLDeclaration):
11373 results.push(this.declaration(child));
11374 break;
11375 case !(child instanceof XMLDocType):
11376 results.push(this.docType(child));
11377 break;
11378 case !(child instanceof XMLComment):
11379 results.push(this.comment(child));
11380 break;
11381 case !(child instanceof XMLProcessingInstruction):
11382 results.push(this.processingInstruction(child));
11383 break;
11384 default:
11385 results.push(this.element(child));
11386 }
11387 }
11388 return results;
11389 };
11390
11391 XMLStreamWriter.prototype.attribute = function (att) {
11392 return this.stream.write(' ' + att.name + '="' + att.value + '"');
11393 };
11394
11395 XMLStreamWriter.prototype.cdata = function (node, level) {
11396 return this.stream.write(this.space(level) + '<![CDATA[' + node.text + ']]>' + this.endline(node));
11397 };
11398
11399 XMLStreamWriter.prototype.comment = function (node, level) {
11400 return this.stream.write(this.space(level) + '<!-- ' + node.text + ' -->' + this.endline(node));
11401 };
11402
11403 XMLStreamWriter.prototype.declaration = function (node, level) {
11404 this.stream.write(this.space(level));
11405 this.stream.write('<?xml version="' + node.version + '"');
11406 if (node.encoding != null) {
11407 this.stream.write(' encoding="' + node.encoding + '"');
11408 }
11409 if (node.standalone != null) {
11410 this.stream.write(' standalone="' + node.standalone + '"');
11411 }
11412 this.stream.write(this.spacebeforeslash + '?>');
11413 return this.stream.write(this.endline(node));
11414 };
11415
11416 XMLStreamWriter.prototype.docType = function (node, level) {
11417 var child, i, len, ref;
11418 level || (level = 0);
11419 this.stream.write(this.space(level));
11420 this.stream.write('<!DOCTYPE ' + node.root().name);
11421 if (node.pubID && node.sysID) {
11422 this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
11423 } else if (node.sysID) {
11424 this.stream.write(' SYSTEM "' + node.sysID + '"');
11425 }
11426 if (node.children.length > 0) {
11427 this.stream.write(' [');
11428 this.stream.write(this.endline(node));
11429 ref = node.children;
11430 for (i = 0, len = ref.length; i < len; i++) {
11431 child = ref[i];
11432 switch (false) {
11433 case !(child instanceof XMLDTDAttList):
11434 this.dtdAttList(child, level + 1);
11435 break;
11436 case !(child instanceof XMLDTDElement):
11437 this.dtdElement(child, level + 1);
11438 break;
11439 case !(child instanceof XMLDTDEntity):
11440 this.dtdEntity(child, level + 1);
11441 break;
11442 case !(child instanceof XMLDTDNotation):
11443 this.dtdNotation(child, level + 1);
11444 break;
11445 case !(child instanceof XMLCData):
11446 this.cdata(child, level + 1);
11447 break;
11448 case !(child instanceof XMLComment):
11449 this.comment(child, level + 1);
11450 break;
11451 case !(child instanceof XMLProcessingInstruction):
11452 this.processingInstruction(child, level + 1);
11453 break;
11454 default:
11455 throw new Error("Unknown DTD node type: " + child.constructor.name);
11456 }
11457 }
11458 this.stream.write(']');
11459 }
11460 this.stream.write(this.spacebeforeslash + '>');
11461 return this.stream.write(this.endline(node));
11462 };
11463
11464 XMLStreamWriter.prototype.element = function (node, level) {
11465 var att, child, i, len, name, ref, ref1, space;
11466 level || (level = 0);
11467 space = this.space(level);
11468 this.stream.write(space + '<' + node.name);
11469 ref = node.attributes;
11470 for (name in ref) {
11471 if (!hasProp.call(ref, name)) continue;
11472 att = ref[name];
11473 this.attribute(att);
11474 }
11475 if (node.children.length === 0 || node.children.every(function (e) {
11476 return e.value === '';
11477 })) {
11478 if (this.allowEmpty) {
11479 this.stream.write('></' + node.name + '>');
11480 } else {
11481 this.stream.write(this.spacebeforeslash + '/>');
11482 }
11483 } else if (this.pretty && node.children.length === 1 && node.children[0].value != null) {
11484 this.stream.write('>');
11485 this.stream.write(node.children[0].value);
11486 this.stream.write('</' + node.name + '>');
11487 } else {
11488 this.stream.write('>' + this.newline);
11489 ref1 = node.children;
11490 for (i = 0, len = ref1.length; i < len; i++) {
11491 child = ref1[i];
11492 switch (false) {
11493 case !(child instanceof XMLCData):
11494 this.cdata(child, level + 1);
11495 break;
11496 case !(child instanceof XMLComment):
11497 this.comment(child, level + 1);
11498 break;
11499 case !(child instanceof XMLElement):
11500 this.element(child, level + 1);
11501 break;
11502 case !(child instanceof XMLRaw):
11503 this.raw(child, level + 1);
11504 break;
11505 case !(child instanceof XMLText):
11506 this.text(child, level + 1);
11507 break;
11508 case !(child instanceof XMLProcessingInstruction):
11509 this.processingInstruction(child, level + 1);
11510 break;
11511 default:
11512 throw new Error("Unknown XML node type: " + child.constructor.name);
11513 }
11514 }
11515 this.stream.write(space + '</' + node.name + '>');
11516 }
11517 return this.stream.write(this.endline(node));
11518 };
11519
11520 XMLStreamWriter.prototype.processingInstruction = function (node, level) {
11521 this.stream.write(this.space(level) + '<?' + node.target);
11522 if (node.value) {
11523 this.stream.write(' ' + node.value);
11524 }
11525 return this.stream.write(this.spacebeforeslash + '?>' + this.endline(node));
11526 };
11527
11528 XMLStreamWriter.prototype.raw = function (node, level) {
11529 return this.stream.write(this.space(level) + node.value + this.endline(node));
11530 };
11531
11532 XMLStreamWriter.prototype.text = function (node, level) {
11533 return this.stream.write(this.space(level) + node.value + this.endline(node));
11534 };
11535
11536 XMLStreamWriter.prototype.dtdAttList = function (node, level) {
11537 this.stream.write(this.space(level) + '<!ATTLIST ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType);
11538 if (node.defaultValueType !== '#DEFAULT') {
11539 this.stream.write(' ' + node.defaultValueType);
11540 }
11541 if (node.defaultValue) {
11542 this.stream.write(' "' + node.defaultValue + '"');
11543 }
11544 return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
11545 };
11546
11547 XMLStreamWriter.prototype.dtdElement = function (node, level) {
11548 this.stream.write(this.space(level) + '<!ELEMENT ' + node.name + ' ' + node.value);
11549 return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
11550 };
11551
11552 XMLStreamWriter.prototype.dtdEntity = function (node, level) {
11553 this.stream.write(this.space(level) + '<!ENTITY');
11554 if (node.pe) {
11555 this.stream.write(' %');
11556 }
11557 this.stream.write(' ' + node.name);
11558 if (node.value) {
11559 this.stream.write(' "' + node.value + '"');
11560 } else {
11561 if (node.pubID && node.sysID) {
11562 this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
11563 } else if (node.sysID) {
11564 this.stream.write(' SYSTEM "' + node.sysID + '"');
11565 }
11566 if (node.nData) {
11567 this.stream.write(' NDATA ' + node.nData);
11568 }
11569 }
11570 return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
11571 };
11572
11573 XMLStreamWriter.prototype.dtdNotation = function (node, level) {
11574 this.stream.write(this.space(level) + '<!NOTATION ' + node.name);
11575 if (node.pubID && node.sysID) {
11576 this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
11577 } else if (node.pubID) {
11578 this.stream.write(' PUBLIC "' + node.pubID + '"');
11579 } else if (node.sysID) {
11580 this.stream.write(' SYSTEM "' + node.sysID + '"');
11581 }
11582 return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
11583 };
11584
11585 XMLStreamWriter.prototype.endline = function (node) {
11586 if (!node.isLastRootNode) {
11587 return this.newline;
11588 } else {
11589 return '';
11590 }
11591 };
11592
11593 return XMLStreamWriter;
11594 }(XMLWriterBase);
11595}).call(undefined);
11596
11597/***/ }),
11598/* 73 */
11599/***/ (function(module, exports, __webpack_require__) {
11600
11601"use strict";
11602
11603
11604var _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; };
11605
11606// Generated by CoffeeScript 1.12.7
11607(function () {
11608 "use strict";
11609
11610 var bom,
11611 defaults,
11612 events,
11613 isEmpty,
11614 processItem,
11615 processors,
11616 sax,
11617 setImmediate,
11618 bind = function bind(fn, me) {
11619 return function () {
11620 return fn.apply(me, arguments);
11621 };
11622 },
11623 extend = function extend(child, parent) {
11624 for (var key in parent) {
11625 if (hasProp.call(parent, key)) child[key] = parent[key];
11626 }function ctor() {
11627 this.constructor = child;
11628 }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;
11629 },
11630 hasProp = {}.hasOwnProperty;
11631
11632 sax = __webpack_require__(74);
11633
11634 events = __webpack_require__(10);
11635
11636 bom = __webpack_require__(80);
11637
11638 processors = __webpack_require__(43);
11639
11640 setImmediate = __webpack_require__(36).setImmediate;
11641
11642 defaults = __webpack_require__(27).defaults;
11643
11644 isEmpty = function isEmpty(thing) {
11645 return (typeof thing === 'undefined' ? 'undefined' : _typeof(thing)) === "object" && thing != null && Object.keys(thing).length === 0;
11646 };
11647
11648 processItem = function processItem(processors, item, key) {
11649 var i, len, process;
11650 for (i = 0, len = processors.length; i < len; i++) {
11651 process = processors[i];
11652 item = process(item, key);
11653 }
11654 return item;
11655 };
11656
11657 exports.Parser = function (superClass) {
11658 extend(Parser, superClass);
11659
11660 function Parser(opts) {
11661 this.parseString = bind(this.parseString, this);
11662 this.reset = bind(this.reset, this);
11663 this.assignOrPush = bind(this.assignOrPush, this);
11664 this.processAsync = bind(this.processAsync, this);
11665 var key, ref, value;
11666 if (!(this instanceof exports.Parser)) {
11667 return new exports.Parser(opts);
11668 }
11669 this.options = {};
11670 ref = defaults["0.2"];
11671 for (key in ref) {
11672 if (!hasProp.call(ref, key)) continue;
11673 value = ref[key];
11674 this.options[key] = value;
11675 }
11676 for (key in opts) {
11677 if (!hasProp.call(opts, key)) continue;
11678 value = opts[key];
11679 this.options[key] = value;
11680 }
11681 if (this.options.xmlns) {
11682 this.options.xmlnskey = this.options.attrkey + "ns";
11683 }
11684 if (this.options.normalizeTags) {
11685 if (!this.options.tagNameProcessors) {
11686 this.options.tagNameProcessors = [];
11687 }
11688 this.options.tagNameProcessors.unshift(processors.normalize);
11689 }
11690 this.reset();
11691 }
11692
11693 Parser.prototype.processAsync = function () {
11694 var chunk, err;
11695 try {
11696 if (this.remaining.length <= this.options.chunkSize) {
11697 chunk = this.remaining;
11698 this.remaining = '';
11699 this.saxParser = this.saxParser.write(chunk);
11700 return this.saxParser.close();
11701 } else {
11702 chunk = this.remaining.substr(0, this.options.chunkSize);
11703 this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);
11704 this.saxParser = this.saxParser.write(chunk);
11705 return setImmediate(this.processAsync);
11706 }
11707 } catch (error1) {
11708 err = error1;
11709 if (!this.saxParser.errThrown) {
11710 this.saxParser.errThrown = true;
11711 return this.emit(err);
11712 }
11713 }
11714 };
11715
11716 Parser.prototype.assignOrPush = function (obj, key, newValue) {
11717 if (!(key in obj)) {
11718 if (!this.options.explicitArray) {
11719 return obj[key] = newValue;
11720 } else {
11721 return obj[key] = [newValue];
11722 }
11723 } else {
11724 if (!(obj[key] instanceof Array)) {
11725 obj[key] = [obj[key]];
11726 }
11727 return obj[key].push(newValue);
11728 }
11729 };
11730
11731 Parser.prototype.reset = function () {
11732 var attrkey, charkey, ontext, stack;
11733 this.removeAllListeners();
11734 this.saxParser = sax.parser(this.options.strict, {
11735 trim: false,
11736 normalize: false,
11737 xmlns: this.options.xmlns
11738 });
11739 this.saxParser.errThrown = false;
11740 this.saxParser.onerror = function (_this) {
11741 return function (error) {
11742 _this.saxParser.resume();
11743 if (!_this.saxParser.errThrown) {
11744 _this.saxParser.errThrown = true;
11745 return _this.emit("error", error);
11746 }
11747 };
11748 }(this);
11749 this.saxParser.onend = function (_this) {
11750 return function () {
11751 if (!_this.saxParser.ended) {
11752 _this.saxParser.ended = true;
11753 return _this.emit("end", _this.resultObject);
11754 }
11755 };
11756 }(this);
11757 this.saxParser.ended = false;
11758 this.EXPLICIT_CHARKEY = this.options.explicitCharkey;
11759 this.resultObject = null;
11760 stack = [];
11761 attrkey = this.options.attrkey;
11762 charkey = this.options.charkey;
11763 this.saxParser.onopentag = function (_this) {
11764 return function (node) {
11765 var key, newValue, obj, processedKey, ref;
11766 obj = {};
11767 obj[charkey] = "";
11768 if (!_this.options.ignoreAttrs) {
11769 ref = node.attributes;
11770 for (key in ref) {
11771 if (!hasProp.call(ref, key)) continue;
11772 if (!(attrkey in obj) && !_this.options.mergeAttrs) {
11773 obj[attrkey] = {};
11774 }
11775 newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
11776 processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
11777 if (_this.options.mergeAttrs) {
11778 _this.assignOrPush(obj, processedKey, newValue);
11779 } else {
11780 obj[attrkey][processedKey] = newValue;
11781 }
11782 }
11783 }
11784 obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;
11785 if (_this.options.xmlns) {
11786 obj[_this.options.xmlnskey] = {
11787 uri: node.uri,
11788 local: node.local
11789 };
11790 }
11791 return stack.push(obj);
11792 };
11793 }(this);
11794 this.saxParser.onclosetag = function (_this) {
11795 return function () {
11796 var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;
11797 obj = stack.pop();
11798 nodeName = obj["#name"];
11799 if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) {
11800 delete obj["#name"];
11801 }
11802 if (obj.cdata === true) {
11803 cdata = obj.cdata;
11804 delete obj.cdata;
11805 }
11806 s = stack[stack.length - 1];
11807 if (obj[charkey].match(/^\s*$/) && !cdata) {
11808 emptyStr = obj[charkey];
11809 delete obj[charkey];
11810 } else {
11811 if (_this.options.trim) {
11812 obj[charkey] = obj[charkey].trim();
11813 }
11814 if (_this.options.normalize) {
11815 obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim();
11816 }
11817 obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];
11818 if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
11819 obj = obj[charkey];
11820 }
11821 }
11822 if (isEmpty(obj)) {
11823 obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;
11824 }
11825 if (_this.options.validator != null) {
11826 xpath = "/" + function () {
11827 var i, len, results;
11828 results = [];
11829 for (i = 0, len = stack.length; i < len; i++) {
11830 node = stack[i];
11831 results.push(node["#name"]);
11832 }
11833 return results;
11834 }().concat(nodeName).join("/");
11835 (function () {
11836 var err;
11837 try {
11838 return obj = _this.options.validator(xpath, s && s[nodeName], obj);
11839 } catch (error1) {
11840 err = error1;
11841 return _this.emit("error", err);
11842 }
11843 })();
11844 }
11845 if (_this.options.explicitChildren && !_this.options.mergeAttrs && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object') {
11846 if (!_this.options.preserveChildrenOrder) {
11847 node = {};
11848 if (_this.options.attrkey in obj) {
11849 node[_this.options.attrkey] = obj[_this.options.attrkey];
11850 delete obj[_this.options.attrkey];
11851 }
11852 if (!_this.options.charsAsChildren && _this.options.charkey in obj) {
11853 node[_this.options.charkey] = obj[_this.options.charkey];
11854 delete obj[_this.options.charkey];
11855 }
11856 if (Object.getOwnPropertyNames(obj).length > 0) {
11857 node[_this.options.childkey] = obj;
11858 }
11859 obj = node;
11860 } else if (s) {
11861 s[_this.options.childkey] = s[_this.options.childkey] || [];
11862 objClone = {};
11863 for (key in obj) {
11864 if (!hasProp.call(obj, key)) continue;
11865 objClone[key] = obj[key];
11866 }
11867 s[_this.options.childkey].push(objClone);
11868 delete obj["#name"];
11869 if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
11870 obj = obj[charkey];
11871 }
11872 }
11873 }
11874 if (stack.length > 0) {
11875 return _this.assignOrPush(s, nodeName, obj);
11876 } else {
11877 if (_this.options.explicitRoot) {
11878 old = obj;
11879 obj = {};
11880 obj[nodeName] = old;
11881 }
11882 _this.resultObject = obj;
11883 _this.saxParser.ended = true;
11884 return _this.emit("end", _this.resultObject);
11885 }
11886 };
11887 }(this);
11888 ontext = function (_this) {
11889 return function (text) {
11890 var charChild, s;
11891 s = stack[stack.length - 1];
11892 if (s) {
11893 s[charkey] += text;
11894 if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, '').trim() !== '')) {
11895 s[_this.options.childkey] = s[_this.options.childkey] || [];
11896 charChild = {
11897 '#name': '__text__'
11898 };
11899 charChild[charkey] = text;
11900 if (_this.options.normalize) {
11901 charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim();
11902 }
11903 s[_this.options.childkey].push(charChild);
11904 }
11905 return s;
11906 }
11907 };
11908 }(this);
11909 this.saxParser.ontext = ontext;
11910 return this.saxParser.oncdata = function (_this) {
11911 return function (text) {
11912 var s;
11913 s = ontext(text);
11914 if (s) {
11915 return s.cdata = true;
11916 }
11917 };
11918 }(this);
11919 };
11920
11921 Parser.prototype.parseString = function (str, cb) {
11922 var err;
11923 if (cb != null && typeof cb === "function") {
11924 this.on("end", function (result) {
11925 this.reset();
11926 return cb(null, result);
11927 });
11928 this.on("error", function (err) {
11929 this.reset();
11930 return cb(err);
11931 });
11932 }
11933 try {
11934 str = str.toString();
11935 if (str.trim() === '') {
11936 this.emit("end", null);
11937 return true;
11938 }
11939 str = bom.stripBOM(str);
11940 if (this.options.async) {
11941 this.remaining = str;
11942 setImmediate(this.processAsync);
11943 return this.saxParser;
11944 }
11945 return this.saxParser.write(str).close();
11946 } catch (error1) {
11947 err = error1;
11948 if (!(this.saxParser.errThrown || this.saxParser.ended)) {
11949 this.emit('error', err);
11950 return this.saxParser.errThrown = true;
11951 } else if (this.saxParser.ended) {
11952 throw err;
11953 }
11954 }
11955 };
11956
11957 return Parser;
11958 }(events.EventEmitter);
11959
11960 exports.parseString = function (str, a, b) {
11961 var cb, options, parser;
11962 if (b != null) {
11963 if (typeof b === 'function') {
11964 cb = b;
11965 }
11966 if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object') {
11967 options = a;
11968 }
11969 } else {
11970 if (typeof a === 'function') {
11971 cb = a;
11972 }
11973 options = {};
11974 }
11975 parser = new exports.Parser(options);
11976 return parser.parseString(str, cb);
11977 };
11978}).call(undefined);
11979
11980/***/ }),
11981/* 74 */
11982/***/ (function(module, exports, __webpack_require__) {
11983
11984"use strict";
11985/* WEBPACK VAR INJECTION */(function(Buffer) {
11986
11987var _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; };
11988
11989;(function (sax) {
11990 // wrapper for non-node envs
11991 sax.parser = function (strict, opt) {
11992 return new SAXParser(strict, opt);
11993 };
11994 sax.SAXParser = SAXParser;
11995 sax.SAXStream = SAXStream;
11996 sax.createStream = createStream;
11997
11998 // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
11999 // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
12000 // since that's the earliest that a buffer overrun could occur. This way, checks are
12001 // as rare as required, but as often as necessary to ensure never crossing this bound.
12002 // Furthermore, buffers are only tested at most once per write(), so passing a very
12003 // large string into write() might have undesirable effects, but this is manageable by
12004 // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
12005 // edge case, result in creating at most one complete copy of the string passed in.
12006 // Set to Infinity to have unlimited buffers.
12007 sax.MAX_BUFFER_LENGTH = 64 * 1024;
12008
12009 var buffers = ['comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', 'procInstName', 'procInstBody', 'entity', 'attribName', 'attribValue', 'cdata', 'script'];
12010
12011 sax.EVENTS = ['text', 'processinginstruction', 'sgmldeclaration', 'doctype', 'comment', 'opentagstart', 'attribute', 'opentag', 'closetag', 'opencdata', 'cdata', 'closecdata', 'error', 'end', 'ready', 'script', 'opennamespace', 'closenamespace'];
12012
12013 function SAXParser(strict, opt) {
12014 if (!(this instanceof SAXParser)) {
12015 return new SAXParser(strict, opt);
12016 }
12017
12018 var parser = this;
12019 clearBuffers(parser);
12020 parser.q = parser.c = '';
12021 parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH;
12022 parser.opt = opt || {};
12023 parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;
12024 parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase';
12025 parser.tags = [];
12026 parser.closed = parser.closedRoot = parser.sawRoot = false;
12027 parser.tag = parser.error = null;
12028 parser.strict = !!strict;
12029 parser.noscript = !!(strict || parser.opt.noscript);
12030 parser.state = S.BEGIN;
12031 parser.strictEntities = parser.opt.strictEntities;
12032 parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES);
12033 parser.attribList = [];
12034
12035 // namespaces form a prototype chain.
12036 // it always points at the current tag,
12037 // which protos to its parent tag.
12038 if (parser.opt.xmlns) {
12039 parser.ns = Object.create(rootNS);
12040 }
12041
12042 // mostly just for error reporting
12043 parser.trackPosition = parser.opt.position !== false;
12044 if (parser.trackPosition) {
12045 parser.position = parser.line = parser.column = 0;
12046 }
12047 emit(parser, 'onready');
12048 }
12049
12050 if (!Object.create) {
12051 Object.create = function (o) {
12052 function F() {}
12053 F.prototype = o;
12054 var newf = new F();
12055 return newf;
12056 };
12057 }
12058
12059 if (!Object.keys) {
12060 Object.keys = function (o) {
12061 var a = [];
12062 for (var i in o) {
12063 if (o.hasOwnProperty(i)) a.push(i);
12064 }return a;
12065 };
12066 }
12067
12068 function checkBufferLength(parser) {
12069 var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10);
12070 var maxActual = 0;
12071 for (var i = 0, l = buffers.length; i < l; i++) {
12072 var len = parser[buffers[i]].length;
12073 if (len > maxAllowed) {
12074 // Text/cdata nodes can get big, and since they're buffered,
12075 // we can get here under normal conditions.
12076 // Avoid issues by emitting the text node now,
12077 // so at least it won't get any bigger.
12078 switch (buffers[i]) {
12079 case 'textNode':
12080 closeText(parser);
12081 break;
12082
12083 case 'cdata':
12084 emitNode(parser, 'oncdata', parser.cdata);
12085 parser.cdata = '';
12086 break;
12087
12088 case 'script':
12089 emitNode(parser, 'onscript', parser.script);
12090 parser.script = '';
12091 break;
12092
12093 default:
12094 error(parser, 'Max buffer length exceeded: ' + buffers[i]);
12095 }
12096 }
12097 maxActual = Math.max(maxActual, len);
12098 }
12099 // schedule the next check for the earliest possible buffer overrun.
12100 var m = sax.MAX_BUFFER_LENGTH - maxActual;
12101 parser.bufferCheckPosition = m + parser.position;
12102 }
12103
12104 function clearBuffers(parser) {
12105 for (var i = 0, l = buffers.length; i < l; i++) {
12106 parser[buffers[i]] = '';
12107 }
12108 }
12109
12110 function flushBuffers(parser) {
12111 closeText(parser);
12112 if (parser.cdata !== '') {
12113 emitNode(parser, 'oncdata', parser.cdata);
12114 parser.cdata = '';
12115 }
12116 if (parser.script !== '') {
12117 emitNode(parser, 'onscript', parser.script);
12118 parser.script = '';
12119 }
12120 }
12121
12122 SAXParser.prototype = {
12123 end: function end() {
12124 _end(this);
12125 },
12126 write: write,
12127 resume: function resume() {
12128 this.error = null;return this;
12129 },
12130 close: function close() {
12131 return this.write(null);
12132 },
12133 flush: function flush() {
12134 flushBuffers(this);
12135 }
12136 };
12137
12138 var Stream;
12139 try {
12140 Stream = __webpack_require__(75).Stream;
12141 } catch (ex) {
12142 Stream = function Stream() {};
12143 }
12144
12145 var streamWraps = sax.EVENTS.filter(function (ev) {
12146 return ev !== 'error' && ev !== 'end';
12147 });
12148
12149 function createStream(strict, opt) {
12150 return new SAXStream(strict, opt);
12151 }
12152
12153 function SAXStream(strict, opt) {
12154 if (!(this instanceof SAXStream)) {
12155 return new SAXStream(strict, opt);
12156 }
12157
12158 Stream.apply(this);
12159
12160 this._parser = new SAXParser(strict, opt);
12161 this.writable = true;
12162 this.readable = true;
12163
12164 var me = this;
12165
12166 this._parser.onend = function () {
12167 me.emit('end');
12168 };
12169
12170 this._parser.onerror = function (er) {
12171 me.emit('error', er);
12172
12173 // if didn't throw, then means error was handled.
12174 // go ahead and clear error, so we can write again.
12175 me._parser.error = null;
12176 };
12177
12178 this._decoder = null;
12179
12180 streamWraps.forEach(function (ev) {
12181 Object.defineProperty(me, 'on' + ev, {
12182 get: function get() {
12183 return me._parser['on' + ev];
12184 },
12185 set: function set(h) {
12186 if (!h) {
12187 me.removeAllListeners(ev);
12188 me._parser['on' + ev] = h;
12189 return h;
12190 }
12191 me.on(ev, h);
12192 },
12193 enumerable: true,
12194 configurable: false
12195 });
12196 });
12197 }
12198
12199 SAXStream.prototype = Object.create(Stream.prototype, {
12200 constructor: {
12201 value: SAXStream
12202 }
12203 });
12204
12205 SAXStream.prototype.write = function (data) {
12206 if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function' && Buffer.isBuffer(data)) {
12207 if (!this._decoder) {
12208 var SD = __webpack_require__(25).StringDecoder;
12209 this._decoder = new SD('utf8');
12210 }
12211 data = this._decoder.write(data);
12212 }
12213
12214 this._parser.write(data.toString());
12215 this.emit('data', data);
12216 return true;
12217 };
12218
12219 SAXStream.prototype.end = function (chunk) {
12220 if (chunk && chunk.length) {
12221 this.write(chunk);
12222 }
12223 this._parser.end();
12224 return true;
12225 };
12226
12227 SAXStream.prototype.on = function (ev, handler) {
12228 var me = this;
12229 if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {
12230 me._parser['on' + ev] = function () {
12231 var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
12232 args.splice(0, 0, ev);
12233 me.emit.apply(me, args);
12234 };
12235 }
12236
12237 return Stream.prototype.on.call(me, ev, handler);
12238 };
12239
12240 // this really needs to be replaced with character classes.
12241 // XML allows all manner of ridiculous numbers and digits.
12242 var CDATA = '[CDATA[';
12243 var DOCTYPE = 'DOCTYPE';
12244 var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
12245 var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/';
12246 var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE
12247
12248 // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
12249 // This implementation works on strings, a single character at a time
12250 // as such, it cannot ever support astral-plane characters (10000-EFFFF)
12251 // without a significant breaking change to either this parser, or the
12252 // JavaScript language. Implementation of an emoji-capable xml parser
12253 // is left as an exercise for the reader.
12254 };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]/;
12255
12256 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-]/;
12257
12258 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]/;
12259 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-]/;
12260
12261 function isWhitespace(c) {
12262 return c === ' ' || c === '\n' || c === '\r' || c === '\t';
12263 }
12264
12265 function isQuote(c) {
12266 return c === '"' || c === '\'';
12267 }
12268
12269 function isAttribEnd(c) {
12270 return c === '>' || isWhitespace(c);
12271 }
12272
12273 function isMatch(regex, c) {
12274 return regex.test(c);
12275 }
12276
12277 function notMatch(regex, c) {
12278 return !isMatch(regex, c);
12279 }
12280
12281 var S = 0;
12282 sax.STATE = {
12283 BEGIN: S++, // leading byte order mark or whitespace
12284 BEGIN_WHITESPACE: S++, // leading whitespace
12285 TEXT: S++, // general stuff
12286 TEXT_ENTITY: S++, // &amp and such.
12287 OPEN_WAKA: S++, // <
12288 SGML_DECL: S++, // <!BLARG
12289 SGML_DECL_QUOTED: S++, // <!BLARG foo "bar
12290 DOCTYPE: S++, // <!DOCTYPE
12291 DOCTYPE_QUOTED: S++, // <!DOCTYPE "//blah
12292 DOCTYPE_DTD: S++, // <!DOCTYPE "//blah" [ ...
12293 DOCTYPE_DTD_QUOTED: S++, // <!DOCTYPE "//blah" [ "foo
12294 COMMENT_STARTING: S++, // <!-
12295 COMMENT: S++, // <!--
12296 COMMENT_ENDING: S++, // <!-- blah -
12297 COMMENT_ENDED: S++, // <!-- blah --
12298 CDATA: S++, // <![CDATA[ something
12299 CDATA_ENDING: S++, // ]
12300 CDATA_ENDING_2: S++, // ]]
12301 PROC_INST: S++, // <?hi
12302 PROC_INST_BODY: S++, // <?hi there
12303 PROC_INST_ENDING: S++, // <?hi "there" ?
12304 OPEN_TAG: S++, // <strong
12305 OPEN_TAG_SLASH: S++, // <strong /
12306 ATTRIB: S++, // <a
12307 ATTRIB_NAME: S++, // <a foo
12308 ATTRIB_NAME_SAW_WHITE: S++, // <a foo _
12309 ATTRIB_VALUE: S++, // <a foo=
12310 ATTRIB_VALUE_QUOTED: S++, // <a foo="bar
12311 ATTRIB_VALUE_CLOSED: S++, // <a foo="bar"
12312 ATTRIB_VALUE_UNQUOTED: S++, // <a foo=bar
12313 ATTRIB_VALUE_ENTITY_Q: S++, // <foo bar="&quot;"
12314 ATTRIB_VALUE_ENTITY_U: S++, // <foo bar=&quot
12315 CLOSE_TAG: S++, // </a
12316 CLOSE_TAG_SAW_WHITE: S++, // </a >
12317 SCRIPT: S++, // <script> ...
12318 SCRIPT_ENDING: S++ // <script> ... <
12319 };
12320
12321 sax.XML_ENTITIES = {
12322 'amp': '&',
12323 'gt': '>',
12324 'lt': '<',
12325 'quot': '"',
12326 'apos': "'"
12327 };
12328
12329 sax.ENTITIES = {
12330 'amp': '&',
12331 'gt': '>',
12332 'lt': '<',
12333 'quot': '"',
12334 'apos': "'",
12335 'AElig': 198,
12336 'Aacute': 193,
12337 'Acirc': 194,
12338 'Agrave': 192,
12339 'Aring': 197,
12340 'Atilde': 195,
12341 'Auml': 196,
12342 'Ccedil': 199,
12343 'ETH': 208,
12344 'Eacute': 201,
12345 'Ecirc': 202,
12346 'Egrave': 200,
12347 'Euml': 203,
12348 'Iacute': 205,
12349 'Icirc': 206,
12350 'Igrave': 204,
12351 'Iuml': 207,
12352 'Ntilde': 209,
12353 'Oacute': 211,
12354 'Ocirc': 212,
12355 'Ograve': 210,
12356 'Oslash': 216,
12357 'Otilde': 213,
12358 'Ouml': 214,
12359 'THORN': 222,
12360 'Uacute': 218,
12361 'Ucirc': 219,
12362 'Ugrave': 217,
12363 'Uuml': 220,
12364 'Yacute': 221,
12365 'aacute': 225,
12366 'acirc': 226,
12367 'aelig': 230,
12368 'agrave': 224,
12369 'aring': 229,
12370 'atilde': 227,
12371 'auml': 228,
12372 'ccedil': 231,
12373 'eacute': 233,
12374 'ecirc': 234,
12375 'egrave': 232,
12376 'eth': 240,
12377 'euml': 235,
12378 'iacute': 237,
12379 'icirc': 238,
12380 'igrave': 236,
12381 'iuml': 239,
12382 'ntilde': 241,
12383 'oacute': 243,
12384 'ocirc': 244,
12385 'ograve': 242,
12386 'oslash': 248,
12387 'otilde': 245,
12388 'ouml': 246,
12389 'szlig': 223,
12390 'thorn': 254,
12391 'uacute': 250,
12392 'ucirc': 251,
12393 'ugrave': 249,
12394 'uuml': 252,
12395 'yacute': 253,
12396 'yuml': 255,
12397 'copy': 169,
12398 'reg': 174,
12399 'nbsp': 160,
12400 'iexcl': 161,
12401 'cent': 162,
12402 'pound': 163,
12403 'curren': 164,
12404 'yen': 165,
12405 'brvbar': 166,
12406 'sect': 167,
12407 'uml': 168,
12408 'ordf': 170,
12409 'laquo': 171,
12410 'not': 172,
12411 'shy': 173,
12412 'macr': 175,
12413 'deg': 176,
12414 'plusmn': 177,
12415 'sup1': 185,
12416 'sup2': 178,
12417 'sup3': 179,
12418 'acute': 180,
12419 'micro': 181,
12420 'para': 182,
12421 'middot': 183,
12422 'cedil': 184,
12423 'ordm': 186,
12424 'raquo': 187,
12425 'frac14': 188,
12426 'frac12': 189,
12427 'frac34': 190,
12428 'iquest': 191,
12429 'times': 215,
12430 'divide': 247,
12431 'OElig': 338,
12432 'oelig': 339,
12433 'Scaron': 352,
12434 'scaron': 353,
12435 'Yuml': 376,
12436 'fnof': 402,
12437 'circ': 710,
12438 'tilde': 732,
12439 'Alpha': 913,
12440 'Beta': 914,
12441 'Gamma': 915,
12442 'Delta': 916,
12443 'Epsilon': 917,
12444 'Zeta': 918,
12445 'Eta': 919,
12446 'Theta': 920,
12447 'Iota': 921,
12448 'Kappa': 922,
12449 'Lambda': 923,
12450 'Mu': 924,
12451 'Nu': 925,
12452 'Xi': 926,
12453 'Omicron': 927,
12454 'Pi': 928,
12455 'Rho': 929,
12456 'Sigma': 931,
12457 'Tau': 932,
12458 'Upsilon': 933,
12459 'Phi': 934,
12460 'Chi': 935,
12461 'Psi': 936,
12462 'Omega': 937,
12463 'alpha': 945,
12464 'beta': 946,
12465 'gamma': 947,
12466 'delta': 948,
12467 'epsilon': 949,
12468 'zeta': 950,
12469 'eta': 951,
12470 'theta': 952,
12471 'iota': 953,
12472 'kappa': 954,
12473 'lambda': 955,
12474 'mu': 956,
12475 'nu': 957,
12476 'xi': 958,
12477 'omicron': 959,
12478 'pi': 960,
12479 'rho': 961,
12480 'sigmaf': 962,
12481 'sigma': 963,
12482 'tau': 964,
12483 'upsilon': 965,
12484 'phi': 966,
12485 'chi': 967,
12486 'psi': 968,
12487 'omega': 969,
12488 'thetasym': 977,
12489 'upsih': 978,
12490 'piv': 982,
12491 'ensp': 8194,
12492 'emsp': 8195,
12493 'thinsp': 8201,
12494 'zwnj': 8204,
12495 'zwj': 8205,
12496 'lrm': 8206,
12497 'rlm': 8207,
12498 'ndash': 8211,
12499 'mdash': 8212,
12500 'lsquo': 8216,
12501 'rsquo': 8217,
12502 'sbquo': 8218,
12503 'ldquo': 8220,
12504 'rdquo': 8221,
12505 'bdquo': 8222,
12506 'dagger': 8224,
12507 'Dagger': 8225,
12508 'bull': 8226,
12509 'hellip': 8230,
12510 'permil': 8240,
12511 'prime': 8242,
12512 'Prime': 8243,
12513 'lsaquo': 8249,
12514 'rsaquo': 8250,
12515 'oline': 8254,
12516 'frasl': 8260,
12517 'euro': 8364,
12518 'image': 8465,
12519 'weierp': 8472,
12520 'real': 8476,
12521 'trade': 8482,
12522 'alefsym': 8501,
12523 'larr': 8592,
12524 'uarr': 8593,
12525 'rarr': 8594,
12526 'darr': 8595,
12527 'harr': 8596,
12528 'crarr': 8629,
12529 'lArr': 8656,
12530 'uArr': 8657,
12531 'rArr': 8658,
12532 'dArr': 8659,
12533 'hArr': 8660,
12534 'forall': 8704,
12535 'part': 8706,
12536 'exist': 8707,
12537 'empty': 8709,
12538 'nabla': 8711,
12539 'isin': 8712,
12540 'notin': 8713,
12541 'ni': 8715,
12542 'prod': 8719,
12543 'sum': 8721,
12544 'minus': 8722,
12545 'lowast': 8727,
12546 'radic': 8730,
12547 'prop': 8733,
12548 'infin': 8734,
12549 'ang': 8736,
12550 'and': 8743,
12551 'or': 8744,
12552 'cap': 8745,
12553 'cup': 8746,
12554 'int': 8747,
12555 'there4': 8756,
12556 'sim': 8764,
12557 'cong': 8773,
12558 'asymp': 8776,
12559 'ne': 8800,
12560 'equiv': 8801,
12561 'le': 8804,
12562 'ge': 8805,
12563 'sub': 8834,
12564 'sup': 8835,
12565 'nsub': 8836,
12566 'sube': 8838,
12567 'supe': 8839,
12568 'oplus': 8853,
12569 'otimes': 8855,
12570 'perp': 8869,
12571 'sdot': 8901,
12572 'lceil': 8968,
12573 'rceil': 8969,
12574 'lfloor': 8970,
12575 'rfloor': 8971,
12576 'lang': 9001,
12577 'rang': 9002,
12578 'loz': 9674,
12579 'spades': 9824,
12580 'clubs': 9827,
12581 'hearts': 9829,
12582 'diams': 9830
12583 };
12584
12585 Object.keys(sax.ENTITIES).forEach(function (key) {
12586 var e = sax.ENTITIES[key];
12587 var s = typeof e === 'number' ? String.fromCharCode(e) : e;
12588 sax.ENTITIES[key] = s;
12589 });
12590
12591 for (var s in sax.STATE) {
12592 sax.STATE[sax.STATE[s]] = s;
12593 }
12594
12595 // shorthand
12596 S = sax.STATE;
12597
12598 function emit(parser, event, data) {
12599 parser[event] && parser[event](data);
12600 }
12601
12602 function emitNode(parser, nodeType, data) {
12603 if (parser.textNode) closeText(parser);
12604 emit(parser, nodeType, data);
12605 }
12606
12607 function closeText(parser) {
12608 parser.textNode = textopts(parser.opt, parser.textNode);
12609 if (parser.textNode) emit(parser, 'ontext', parser.textNode);
12610 parser.textNode = '';
12611 }
12612
12613 function textopts(opt, text) {
12614 if (opt.trim) text = text.trim();
12615 if (opt.normalize) text = text.replace(/\s+/g, ' ');
12616 return text;
12617 }
12618
12619 function error(parser, er) {
12620 closeText(parser);
12621 if (parser.trackPosition) {
12622 er += '\nLine: ' + parser.line + '\nColumn: ' + parser.column + '\nChar: ' + parser.c;
12623 }
12624 er = new Error(er);
12625 parser.error = er;
12626 emit(parser, 'onerror', er);
12627 return parser;
12628 }
12629
12630 function _end(parser) {
12631 if (parser.sawRoot && !parser.closedRoot) strictFail(parser, 'Unclosed root tag');
12632 if (parser.state !== S.BEGIN && parser.state !== S.BEGIN_WHITESPACE && parser.state !== S.TEXT) {
12633 error(parser, 'Unexpected end');
12634 }
12635 closeText(parser);
12636 parser.c = '';
12637 parser.closed = true;
12638 emit(parser, 'onend');
12639 SAXParser.call(parser, parser.strict, parser.opt);
12640 return parser;
12641 }
12642
12643 function strictFail(parser, message) {
12644 if ((typeof parser === 'undefined' ? 'undefined' : _typeof(parser)) !== 'object' || !(parser instanceof SAXParser)) {
12645 throw new Error('bad call to strictFail');
12646 }
12647 if (parser.strict) {
12648 error(parser, message);
12649 }
12650 }
12651
12652 function newTag(parser) {
12653 if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]();
12654 var parent = parser.tags[parser.tags.length - 1] || parser;
12655 var tag = parser.tag = { name: parser.tagName, attributes: {}
12656
12657 // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
12658 };if (parser.opt.xmlns) {
12659 tag.ns = parent.ns;
12660 }
12661 parser.attribList.length = 0;
12662 emitNode(parser, 'onopentagstart', tag);
12663 }
12664
12665 function qname(name, attribute) {
12666 var i = name.indexOf(':');
12667 var qualName = i < 0 ? ['', name] : name.split(':');
12668 var prefix = qualName[0];
12669 var local = qualName[1];
12670
12671 // <x "xmlns"="http://foo">
12672 if (attribute && name === 'xmlns') {
12673 prefix = 'xmlns';
12674 local = '';
12675 }
12676
12677 return { prefix: prefix, local: local };
12678 }
12679
12680 function attrib(parser) {
12681 if (!parser.strict) {
12682 parser.attribName = parser.attribName[parser.looseCase]();
12683 }
12684
12685 if (parser.attribList.indexOf(parser.attribName) !== -1 || parser.tag.attributes.hasOwnProperty(parser.attribName)) {
12686 parser.attribName = parser.attribValue = '';
12687 return;
12688 }
12689
12690 if (parser.opt.xmlns) {
12691 var qn = qname(parser.attribName, true);
12692 var prefix = qn.prefix;
12693 var local = qn.local;
12694
12695 if (prefix === 'xmlns') {
12696 // namespace binding attribute. push the binding into scope
12697 if (local === 'xml' && parser.attribValue !== XML_NAMESPACE) {
12698 strictFail(parser, 'xml: prefix must be bound to ' + XML_NAMESPACE + '\n' + 'Actual: ' + parser.attribValue);
12699 } else if (local === 'xmlns' && parser.attribValue !== XMLNS_NAMESPACE) {
12700 strictFail(parser, 'xmlns: prefix must be bound to ' + XMLNS_NAMESPACE + '\n' + 'Actual: ' + parser.attribValue);
12701 } else {
12702 var tag = parser.tag;
12703 var parent = parser.tags[parser.tags.length - 1] || parser;
12704 if (tag.ns === parent.ns) {
12705 tag.ns = Object.create(parent.ns);
12706 }
12707 tag.ns[local] = parser.attribValue;
12708 }
12709 }
12710
12711 // defer onattribute events until all attributes have been seen
12712 // so any new bindings can take effect. preserve attribute order
12713 // so deferred events can be emitted in document order
12714 parser.attribList.push([parser.attribName, parser.attribValue]);
12715 } else {
12716 // in non-xmlns mode, we can emit the event right away
12717 parser.tag.attributes[parser.attribName] = parser.attribValue;
12718 emitNode(parser, 'onattribute', {
12719 name: parser.attribName,
12720 value: parser.attribValue
12721 });
12722 }
12723
12724 parser.attribName = parser.attribValue = '';
12725 }
12726
12727 function openTag(parser, selfClosing) {
12728 if (parser.opt.xmlns) {
12729 // emit namespace binding events
12730 var tag = parser.tag;
12731
12732 // add namespace info to tag
12733 var qn = qname(parser.tagName);
12734 tag.prefix = qn.prefix;
12735 tag.local = qn.local;
12736 tag.uri = tag.ns[qn.prefix] || '';
12737
12738 if (tag.prefix && !tag.uri) {
12739 strictFail(parser, 'Unbound namespace prefix: ' + JSON.stringify(parser.tagName));
12740 tag.uri = qn.prefix;
12741 }
12742
12743 var parent = parser.tags[parser.tags.length - 1] || parser;
12744 if (tag.ns && parent.ns !== tag.ns) {
12745 Object.keys(tag.ns).forEach(function (p) {
12746 emitNode(parser, 'onopennamespace', {
12747 prefix: p,
12748 uri: tag.ns[p]
12749 });
12750 });
12751 }
12752
12753 // handle deferred onattribute events
12754 // Note: do not apply default ns to attributes:
12755 // http://www.w3.org/TR/REC-xml-names/#defaulting
12756 for (var i = 0, l = parser.attribList.length; i < l; i++) {
12757 var nv = parser.attribList[i];
12758 var name = nv[0];
12759 var value = nv[1];
12760 var qualName = qname(name, true);
12761 var prefix = qualName.prefix;
12762 var local = qualName.local;
12763 var uri = prefix === '' ? '' : tag.ns[prefix] || '';
12764 var a = {
12765 name: name,
12766 value: value,
12767 prefix: prefix,
12768 local: local,
12769 uri: uri
12770
12771 // if there's any attributes with an undefined namespace,
12772 // then fail on them now.
12773 };if (prefix && prefix !== 'xmlns' && !uri) {
12774 strictFail(parser, 'Unbound namespace prefix: ' + JSON.stringify(prefix));
12775 a.uri = prefix;
12776 }
12777 parser.tag.attributes[name] = a;
12778 emitNode(parser, 'onattribute', a);
12779 }
12780 parser.attribList.length = 0;
12781 }
12782
12783 parser.tag.isSelfClosing = !!selfClosing;
12784
12785 // process the tag
12786 parser.sawRoot = true;
12787 parser.tags.push(parser.tag);
12788 emitNode(parser, 'onopentag', parser.tag);
12789 if (!selfClosing) {
12790 // special case for <script> in non-strict mode.
12791 if (!parser.noscript && parser.tagName.toLowerCase() === 'script') {
12792 parser.state = S.SCRIPT;
12793 } else {
12794 parser.state = S.TEXT;
12795 }
12796 parser.tag = null;
12797 parser.tagName = '';
12798 }
12799 parser.attribName = parser.attribValue = '';
12800 parser.attribList.length = 0;
12801 }
12802
12803 function closeTag(parser) {
12804 if (!parser.tagName) {
12805 strictFail(parser, 'Weird empty close tag.');
12806 parser.textNode += '</>';
12807 parser.state = S.TEXT;
12808 return;
12809 }
12810
12811 if (parser.script) {
12812 if (parser.tagName !== 'script') {
12813 parser.script += '</' + parser.tagName + '>';
12814 parser.tagName = '';
12815 parser.state = S.SCRIPT;
12816 return;
12817 }
12818 emitNode(parser, 'onscript', parser.script);
12819 parser.script = '';
12820 }
12821
12822 // first make sure that the closing tag actually exists.
12823 // <a><b></c></b></a> will close everything, otherwise.
12824 var t = parser.tags.length;
12825 var tagName = parser.tagName;
12826 if (!parser.strict) {
12827 tagName = tagName[parser.looseCase]();
12828 }
12829 var closeTo = tagName;
12830 while (t--) {
12831 var close = parser.tags[t];
12832 if (close.name !== closeTo) {
12833 // fail the first time in strict mode
12834 strictFail(parser, 'Unexpected close tag');
12835 } else {
12836 break;
12837 }
12838 }
12839
12840 // didn't find it. we already failed for strict, so just abort.
12841 if (t < 0) {
12842 strictFail(parser, 'Unmatched closing tag: ' + parser.tagName);
12843 parser.textNode += '</' + parser.tagName + '>';
12844 parser.state = S.TEXT;
12845 return;
12846 }
12847 parser.tagName = tagName;
12848 var s = parser.tags.length;
12849 while (s-- > t) {
12850 var tag = parser.tag = parser.tags.pop();
12851 parser.tagName = parser.tag.name;
12852 emitNode(parser, 'onclosetag', parser.tagName);
12853
12854 var x = {};
12855 for (var i in tag.ns) {
12856 x[i] = tag.ns[i];
12857 }
12858
12859 var parent = parser.tags[parser.tags.length - 1] || parser;
12860 if (parser.opt.xmlns && tag.ns !== parent.ns) {
12861 // remove namespace bindings introduced by tag
12862 Object.keys(tag.ns).forEach(function (p) {
12863 var n = tag.ns[p];
12864 emitNode(parser, 'onclosenamespace', { prefix: p, uri: n });
12865 });
12866 }
12867 }
12868 if (t === 0) parser.closedRoot = true;
12869 parser.tagName = parser.attribValue = parser.attribName = '';
12870 parser.attribList.length = 0;
12871 parser.state = S.TEXT;
12872 }
12873
12874 function parseEntity(parser) {
12875 var entity = parser.entity;
12876 var entityLC = entity.toLowerCase();
12877 var num;
12878 var numStr = '';
12879
12880 if (parser.ENTITIES[entity]) {
12881 return parser.ENTITIES[entity];
12882 }
12883 if (parser.ENTITIES[entityLC]) {
12884 return parser.ENTITIES[entityLC];
12885 }
12886 entity = entityLC;
12887 if (entity.charAt(0) === '#') {
12888 if (entity.charAt(1) === 'x') {
12889 entity = entity.slice(2);
12890 num = parseInt(entity, 16);
12891 numStr = num.toString(16);
12892 } else {
12893 entity = entity.slice(1);
12894 num = parseInt(entity, 10);
12895 numStr = num.toString(10);
12896 }
12897 }
12898 entity = entity.replace(/^0+/, '');
12899 if (isNaN(num) || numStr.toLowerCase() !== entity) {
12900 strictFail(parser, 'Invalid character entity');
12901 return '&' + parser.entity + ';';
12902 }
12903
12904 return String.fromCodePoint(num);
12905 }
12906
12907 function beginWhiteSpace(parser, c) {
12908 if (c === '<') {
12909 parser.state = S.OPEN_WAKA;
12910 parser.startTagPosition = parser.position;
12911 } else if (!isWhitespace(c)) {
12912 // have to process this as a text node.
12913 // weird, but happens.
12914 strictFail(parser, 'Non-whitespace before first tag.');
12915 parser.textNode = c;
12916 parser.state = S.TEXT;
12917 }
12918 }
12919
12920 function charAt(chunk, i) {
12921 var result = '';
12922 if (i < chunk.length) {
12923 result = chunk.charAt(i);
12924 }
12925 return result;
12926 }
12927
12928 function write(chunk) {
12929 var parser = this;
12930 if (this.error) {
12931 throw this.error;
12932 }
12933 if (parser.closed) {
12934 return error(parser, 'Cannot write after close. Assign an onready handler.');
12935 }
12936 if (chunk === null) {
12937 return _end(parser);
12938 }
12939 if ((typeof chunk === 'undefined' ? 'undefined' : _typeof(chunk)) === 'object') {
12940 chunk = chunk.toString();
12941 }
12942 var i = 0;
12943 var c = '';
12944 while (true) {
12945 c = charAt(chunk, i++);
12946 parser.c = c;
12947
12948 if (!c) {
12949 break;
12950 }
12951
12952 if (parser.trackPosition) {
12953 parser.position++;
12954 if (c === '\n') {
12955 parser.line++;
12956 parser.column = 0;
12957 } else {
12958 parser.column++;
12959 }
12960 }
12961
12962 switch (parser.state) {
12963 case S.BEGIN:
12964 parser.state = S.BEGIN_WHITESPACE;
12965 if (c === '\uFEFF') {
12966 continue;
12967 }
12968 beginWhiteSpace(parser, c);
12969 continue;
12970
12971 case S.BEGIN_WHITESPACE:
12972 beginWhiteSpace(parser, c);
12973 continue;
12974
12975 case S.TEXT:
12976 if (parser.sawRoot && !parser.closedRoot) {
12977 var starti = i - 1;
12978 while (c && c !== '<' && c !== '&') {
12979 c = charAt(chunk, i++);
12980 if (c && parser.trackPosition) {
12981 parser.position++;
12982 if (c === '\n') {
12983 parser.line++;
12984 parser.column = 0;
12985 } else {
12986 parser.column++;
12987 }
12988 }
12989 }
12990 parser.textNode += chunk.substring(starti, i - 1);
12991 }
12992 if (c === '<' && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
12993 parser.state = S.OPEN_WAKA;
12994 parser.startTagPosition = parser.position;
12995 } else {
12996 if (!isWhitespace(c) && (!parser.sawRoot || parser.closedRoot)) {
12997 strictFail(parser, 'Text data outside of root node.');
12998 }
12999 if (c === '&') {
13000 parser.state = S.TEXT_ENTITY;
13001 } else {
13002 parser.textNode += c;
13003 }
13004 }
13005 continue;
13006
13007 case S.SCRIPT:
13008 // only non-strict
13009 if (c === '<') {
13010 parser.state = S.SCRIPT_ENDING;
13011 } else {
13012 parser.script += c;
13013 }
13014 continue;
13015
13016 case S.SCRIPT_ENDING:
13017 if (c === '/') {
13018 parser.state = S.CLOSE_TAG;
13019 } else {
13020 parser.script += '<' + c;
13021 parser.state = S.SCRIPT;
13022 }
13023 continue;
13024
13025 case S.OPEN_WAKA:
13026 // either a /, ?, !, or text is coming next.
13027 if (c === '!') {
13028 parser.state = S.SGML_DECL;
13029 parser.sgmlDecl = '';
13030 } else if (isWhitespace(c)) {
13031 // wait for it...
13032 } else if (isMatch(nameStart, c)) {
13033 parser.state = S.OPEN_TAG;
13034 parser.tagName = c;
13035 } else if (c === '/') {
13036 parser.state = S.CLOSE_TAG;
13037 parser.tagName = '';
13038 } else if (c === '?') {
13039 parser.state = S.PROC_INST;
13040 parser.procInstName = parser.procInstBody = '';
13041 } else {
13042 strictFail(parser, 'Unencoded <');
13043 // if there was some whitespace, then add that in.
13044 if (parser.startTagPosition + 1 < parser.position) {
13045 var pad = parser.position - parser.startTagPosition;
13046 c = new Array(pad).join(' ') + c;
13047 }
13048 parser.textNode += '<' + c;
13049 parser.state = S.TEXT;
13050 }
13051 continue;
13052
13053 case S.SGML_DECL:
13054 if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
13055 emitNode(parser, 'onopencdata');
13056 parser.state = S.CDATA;
13057 parser.sgmlDecl = '';
13058 parser.cdata = '';
13059 } else if (parser.sgmlDecl + c === '--') {
13060 parser.state = S.COMMENT;
13061 parser.comment = '';
13062 parser.sgmlDecl = '';
13063 } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
13064 parser.state = S.DOCTYPE;
13065 if (parser.doctype || parser.sawRoot) {
13066 strictFail(parser, 'Inappropriately located doctype declaration');
13067 }
13068 parser.doctype = '';
13069 parser.sgmlDecl = '';
13070 } else if (c === '>') {
13071 emitNode(parser, 'onsgmldeclaration', parser.sgmlDecl);
13072 parser.sgmlDecl = '';
13073 parser.state = S.TEXT;
13074 } else if (isQuote(c)) {
13075 parser.state = S.SGML_DECL_QUOTED;
13076 parser.sgmlDecl += c;
13077 } else {
13078 parser.sgmlDecl += c;
13079 }
13080 continue;
13081
13082 case S.SGML_DECL_QUOTED:
13083 if (c === parser.q) {
13084 parser.state = S.SGML_DECL;
13085 parser.q = '';
13086 }
13087 parser.sgmlDecl += c;
13088 continue;
13089
13090 case S.DOCTYPE:
13091 if (c === '>') {
13092 parser.state = S.TEXT;
13093 emitNode(parser, 'ondoctype', parser.doctype);
13094 parser.doctype = true; // just remember that we saw it.
13095 } else {
13096 parser.doctype += c;
13097 if (c === '[') {
13098 parser.state = S.DOCTYPE_DTD;
13099 } else if (isQuote(c)) {
13100 parser.state = S.DOCTYPE_QUOTED;
13101 parser.q = c;
13102 }
13103 }
13104 continue;
13105
13106 case S.DOCTYPE_QUOTED:
13107 parser.doctype += c;
13108 if (c === parser.q) {
13109 parser.q = '';
13110 parser.state = S.DOCTYPE;
13111 }
13112 continue;
13113
13114 case S.DOCTYPE_DTD:
13115 parser.doctype += c;
13116 if (c === ']') {
13117 parser.state = S.DOCTYPE;
13118 } else if (isQuote(c)) {
13119 parser.state = S.DOCTYPE_DTD_QUOTED;
13120 parser.q = c;
13121 }
13122 continue;
13123
13124 case S.DOCTYPE_DTD_QUOTED:
13125 parser.doctype += c;
13126 if (c === parser.q) {
13127 parser.state = S.DOCTYPE_DTD;
13128 parser.q = '';
13129 }
13130 continue;
13131
13132 case S.COMMENT:
13133 if (c === '-') {
13134 parser.state = S.COMMENT_ENDING;
13135 } else {
13136 parser.comment += c;
13137 }
13138 continue;
13139
13140 case S.COMMENT_ENDING:
13141 if (c === '-') {
13142 parser.state = S.COMMENT_ENDED;
13143 parser.comment = textopts(parser.opt, parser.comment);
13144 if (parser.comment) {
13145 emitNode(parser, 'oncomment', parser.comment);
13146 }
13147 parser.comment = '';
13148 } else {
13149 parser.comment += '-' + c;
13150 parser.state = S.COMMENT;
13151 }
13152 continue;
13153
13154 case S.COMMENT_ENDED:
13155 if (c !== '>') {
13156 strictFail(parser, 'Malformed comment');
13157 // allow <!-- blah -- bloo --> in non-strict mode,
13158 // which is a comment of " blah -- bloo "
13159 parser.comment += '--' + c;
13160 parser.state = S.COMMENT;
13161 } else {
13162 parser.state = S.TEXT;
13163 }
13164 continue;
13165
13166 case S.CDATA:
13167 if (c === ']') {
13168 parser.state = S.CDATA_ENDING;
13169 } else {
13170 parser.cdata += c;
13171 }
13172 continue;
13173
13174 case S.CDATA_ENDING:
13175 if (c === ']') {
13176 parser.state = S.CDATA_ENDING_2;
13177 } else {
13178 parser.cdata += ']' + c;
13179 parser.state = S.CDATA;
13180 }
13181 continue;
13182
13183 case S.CDATA_ENDING_2:
13184 if (c === '>') {
13185 if (parser.cdata) {
13186 emitNode(parser, 'oncdata', parser.cdata);
13187 }
13188 emitNode(parser, 'onclosecdata');
13189 parser.cdata = '';
13190 parser.state = S.TEXT;
13191 } else if (c === ']') {
13192 parser.cdata += ']';
13193 } else {
13194 parser.cdata += ']]' + c;
13195 parser.state = S.CDATA;
13196 }
13197 continue;
13198
13199 case S.PROC_INST:
13200 if (c === '?') {
13201 parser.state = S.PROC_INST_ENDING;
13202 } else if (isWhitespace(c)) {
13203 parser.state = S.PROC_INST_BODY;
13204 } else {
13205 parser.procInstName += c;
13206 }
13207 continue;
13208
13209 case S.PROC_INST_BODY:
13210 if (!parser.procInstBody && isWhitespace(c)) {
13211 continue;
13212 } else if (c === '?') {
13213 parser.state = S.PROC_INST_ENDING;
13214 } else {
13215 parser.procInstBody += c;
13216 }
13217 continue;
13218
13219 case S.PROC_INST_ENDING:
13220 if (c === '>') {
13221 emitNode(parser, 'onprocessinginstruction', {
13222 name: parser.procInstName,
13223 body: parser.procInstBody
13224 });
13225 parser.procInstName = parser.procInstBody = '';
13226 parser.state = S.TEXT;
13227 } else {
13228 parser.procInstBody += '?' + c;
13229 parser.state = S.PROC_INST_BODY;
13230 }
13231 continue;
13232
13233 case S.OPEN_TAG:
13234 if (isMatch(nameBody, c)) {
13235 parser.tagName += c;
13236 } else {
13237 newTag(parser);
13238 if (c === '>') {
13239 openTag(parser);
13240 } else if (c === '/') {
13241 parser.state = S.OPEN_TAG_SLASH;
13242 } else {
13243 if (!isWhitespace(c)) {
13244 strictFail(parser, 'Invalid character in tag name');
13245 }
13246 parser.state = S.ATTRIB;
13247 }
13248 }
13249 continue;
13250
13251 case S.OPEN_TAG_SLASH:
13252 if (c === '>') {
13253 openTag(parser, true);
13254 closeTag(parser);
13255 } else {
13256 strictFail(parser, 'Forward-slash in opening tag not followed by >');
13257 parser.state = S.ATTRIB;
13258 }
13259 continue;
13260
13261 case S.ATTRIB:
13262 // haven't read the attribute name yet.
13263 if (isWhitespace(c)) {
13264 continue;
13265 } else if (c === '>') {
13266 openTag(parser);
13267 } else if (c === '/') {
13268 parser.state = S.OPEN_TAG_SLASH;
13269 } else if (isMatch(nameStart, c)) {
13270 parser.attribName = c;
13271 parser.attribValue = '';
13272 parser.state = S.ATTRIB_NAME;
13273 } else {
13274 strictFail(parser, 'Invalid attribute name');
13275 }
13276 continue;
13277
13278 case S.ATTRIB_NAME:
13279 if (c === '=') {
13280 parser.state = S.ATTRIB_VALUE;
13281 } else if (c === '>') {
13282 strictFail(parser, 'Attribute without value');
13283 parser.attribValue = parser.attribName;
13284 attrib(parser);
13285 openTag(parser);
13286 } else if (isWhitespace(c)) {
13287 parser.state = S.ATTRIB_NAME_SAW_WHITE;
13288 } else if (isMatch(nameBody, c)) {
13289 parser.attribName += c;
13290 } else {
13291 strictFail(parser, 'Invalid attribute name');
13292 }
13293 continue;
13294
13295 case S.ATTRIB_NAME_SAW_WHITE:
13296 if (c === '=') {
13297 parser.state = S.ATTRIB_VALUE;
13298 } else if (isWhitespace(c)) {
13299 continue;
13300 } else {
13301 strictFail(parser, 'Attribute without value');
13302 parser.tag.attributes[parser.attribName] = '';
13303 parser.attribValue = '';
13304 emitNode(parser, 'onattribute', {
13305 name: parser.attribName,
13306 value: ''
13307 });
13308 parser.attribName = '';
13309 if (c === '>') {
13310 openTag(parser);
13311 } else if (isMatch(nameStart, c)) {
13312 parser.attribName = c;
13313 parser.state = S.ATTRIB_NAME;
13314 } else {
13315 strictFail(parser, 'Invalid attribute name');
13316 parser.state = S.ATTRIB;
13317 }
13318 }
13319 continue;
13320
13321 case S.ATTRIB_VALUE:
13322 if (isWhitespace(c)) {
13323 continue;
13324 } else if (isQuote(c)) {
13325 parser.q = c;
13326 parser.state = S.ATTRIB_VALUE_QUOTED;
13327 } else {
13328 strictFail(parser, 'Unquoted attribute value');
13329 parser.state = S.ATTRIB_VALUE_UNQUOTED;
13330 parser.attribValue = c;
13331 }
13332 continue;
13333
13334 case S.ATTRIB_VALUE_QUOTED:
13335 if (c !== parser.q) {
13336 if (c === '&') {
13337 parser.state = S.ATTRIB_VALUE_ENTITY_Q;
13338 } else {
13339 parser.attribValue += c;
13340 }
13341 continue;
13342 }
13343 attrib(parser);
13344 parser.q = '';
13345 parser.state = S.ATTRIB_VALUE_CLOSED;
13346 continue;
13347
13348 case S.ATTRIB_VALUE_CLOSED:
13349 if (isWhitespace(c)) {
13350 parser.state = S.ATTRIB;
13351 } else if (c === '>') {
13352 openTag(parser);
13353 } else if (c === '/') {
13354 parser.state = S.OPEN_TAG_SLASH;
13355 } else if (isMatch(nameStart, c)) {
13356 strictFail(parser, 'No whitespace between attributes');
13357 parser.attribName = c;
13358 parser.attribValue = '';
13359 parser.state = S.ATTRIB_NAME;
13360 } else {
13361 strictFail(parser, 'Invalid attribute name');
13362 }
13363 continue;
13364
13365 case S.ATTRIB_VALUE_UNQUOTED:
13366 if (!isAttribEnd(c)) {
13367 if (c === '&') {
13368 parser.state = S.ATTRIB_VALUE_ENTITY_U;
13369 } else {
13370 parser.attribValue += c;
13371 }
13372 continue;
13373 }
13374 attrib(parser);
13375 if (c === '>') {
13376 openTag(parser);
13377 } else {
13378 parser.state = S.ATTRIB;
13379 }
13380 continue;
13381
13382 case S.CLOSE_TAG:
13383 if (!parser.tagName) {
13384 if (isWhitespace(c)) {
13385 continue;
13386 } else if (notMatch(nameStart, c)) {
13387 if (parser.script) {
13388 parser.script += '</' + c;
13389 parser.state = S.SCRIPT;
13390 } else {
13391 strictFail(parser, 'Invalid tagname in closing tag.');
13392 }
13393 } else {
13394 parser.tagName = c;
13395 }
13396 } else if (c === '>') {
13397 closeTag(parser);
13398 } else if (isMatch(nameBody, c)) {
13399 parser.tagName += c;
13400 } else if (parser.script) {
13401 parser.script += '</' + parser.tagName;
13402 parser.tagName = '';
13403 parser.state = S.SCRIPT;
13404 } else {
13405 if (!isWhitespace(c)) {
13406 strictFail(parser, 'Invalid tagname in closing tag');
13407 }
13408 parser.state = S.CLOSE_TAG_SAW_WHITE;
13409 }
13410 continue;
13411
13412 case S.CLOSE_TAG_SAW_WHITE:
13413 if (isWhitespace(c)) {
13414 continue;
13415 }
13416 if (c === '>') {
13417 closeTag(parser);
13418 } else {
13419 strictFail(parser, 'Invalid characters in closing tag');
13420 }
13421 continue;
13422
13423 case S.TEXT_ENTITY:
13424 case S.ATTRIB_VALUE_ENTITY_Q:
13425 case S.ATTRIB_VALUE_ENTITY_U:
13426 var returnState;
13427 var buffer;
13428 switch (parser.state) {
13429 case S.TEXT_ENTITY:
13430 returnState = S.TEXT;
13431 buffer = 'textNode';
13432 break;
13433
13434 case S.ATTRIB_VALUE_ENTITY_Q:
13435 returnState = S.ATTRIB_VALUE_QUOTED;
13436 buffer = 'attribValue';
13437 break;
13438
13439 case S.ATTRIB_VALUE_ENTITY_U:
13440 returnState = S.ATTRIB_VALUE_UNQUOTED;
13441 buffer = 'attribValue';
13442 break;
13443 }
13444
13445 if (c === ';') {
13446 parser[buffer] += parseEntity(parser);
13447 parser.entity = '';
13448 parser.state = returnState;
13449 } else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) {
13450 parser.entity += c;
13451 } else {
13452 strictFail(parser, 'Invalid character in entity name');
13453 parser[buffer] += '&' + parser.entity + c;
13454 parser.entity = '';
13455 parser.state = returnState;
13456 }
13457
13458 continue;
13459
13460 default:
13461 throw new Error(parser, 'Unknown state: ' + parser.state);
13462 }
13463 } // while
13464
13465 if (parser.position >= parser.bufferCheckPosition) {
13466 checkBufferLength(parser);
13467 }
13468 return parser;
13469 }
13470
13471 /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
13472 /* istanbul ignore next */
13473 if (!String.fromCodePoint) {
13474 (function () {
13475 var stringFromCharCode = String.fromCharCode;
13476 var floor = Math.floor;
13477 var fromCodePoint = function fromCodePoint() {
13478 var MAX_SIZE = 0x4000;
13479 var codeUnits = [];
13480 var highSurrogate;
13481 var lowSurrogate;
13482 var index = -1;
13483 var length = arguments.length;
13484 if (!length) {
13485 return '';
13486 }
13487 var result = '';
13488 while (++index < length) {
13489 var codePoint = Number(arguments[index]);
13490 if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
13491 codePoint < 0 || // not a valid Unicode code point
13492 codePoint > 0x10FFFF || // not a valid Unicode code point
13493 floor(codePoint) !== codePoint // not an integer
13494 ) {
13495 throw RangeError('Invalid code point: ' + codePoint);
13496 }
13497 if (codePoint <= 0xFFFF) {
13498 // BMP code point
13499 codeUnits.push(codePoint);
13500 } else {
13501 // Astral code point; split in surrogate halves
13502 // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
13503 codePoint -= 0x10000;
13504 highSurrogate = (codePoint >> 10) + 0xD800;
13505 lowSurrogate = codePoint % 0x400 + 0xDC00;
13506 codeUnits.push(highSurrogate, lowSurrogate);
13507 }
13508 if (index + 1 === length || codeUnits.length > MAX_SIZE) {
13509 result += stringFromCharCode.apply(null, codeUnits);
13510 codeUnits.length = 0;
13511 }
13512 }
13513 return result;
13514 };
13515 /* istanbul ignore next */
13516 if (Object.defineProperty) {
13517 Object.defineProperty(String, 'fromCodePoint', {
13518 value: fromCodePoint,
13519 configurable: true,
13520 writable: true
13521 });
13522 } else {
13523 String.fromCodePoint = fromCodePoint;
13524 }
13525 })();
13526 }
13527})( false ? undefined.sax = {} : exports);
13528/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5).Buffer))
13529
13530/***/ }),
13531/* 75 */
13532/***/ (function(module, exports, __webpack_require__) {
13533
13534"use strict";
13535
13536
13537// Copyright Joyent, Inc. and other Node contributors.
13538//
13539// Permission is hereby granted, free of charge, to any person obtaining a
13540// copy of this software and associated documentation files (the
13541// "Software"), to deal in the Software without restriction, including
13542// without limitation the rights to use, copy, modify, merge, publish,
13543// distribute, sublicense, and/or sell copies of the Software, and to permit
13544// persons to whom the Software is furnished to do so, subject to the
13545// following conditions:
13546//
13547// The above copyright notice and this permission notice shall be included
13548// in all copies or substantial portions of the Software.
13549//
13550// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13551// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13552// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
13553// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
13554// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
13555// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
13556// USE OR OTHER DEALINGS IN THE SOFTWARE.
13557
13558module.exports = Stream;
13559
13560var EE = __webpack_require__(10).EventEmitter;
13561var inherits = __webpack_require__(2);
13562
13563inherits(Stream, EE);
13564Stream.Readable = __webpack_require__(7);
13565Stream.Writable = __webpack_require__(76);
13566Stream.Duplex = __webpack_require__(77);
13567Stream.Transform = __webpack_require__(78);
13568Stream.PassThrough = __webpack_require__(79);
13569
13570// Backwards-compat with node 0.4.x
13571Stream.Stream = Stream;
13572
13573// old-style streams. Note that the pipe method (the only relevant
13574// part of this class) is overridden in the Readable class.
13575
13576function Stream() {
13577 EE.call(this);
13578}
13579
13580Stream.prototype.pipe = function (dest, options) {
13581 var source = this;
13582
13583 function ondata(chunk) {
13584 if (dest.writable) {
13585 if (false === dest.write(chunk) && source.pause) {
13586 source.pause();
13587 }
13588 }
13589 }
13590
13591 source.on('data', ondata);
13592
13593 function ondrain() {
13594 if (source.readable && source.resume) {
13595 source.resume();
13596 }
13597 }
13598
13599 dest.on('drain', ondrain);
13600
13601 // If the 'end' option is not supplied, dest.end() will be called when
13602 // source gets the 'end' or 'close' events. Only dest.end() once.
13603 if (!dest._isStdio && (!options || options.end !== false)) {
13604 source.on('end', onend);
13605 source.on('close', onclose);
13606 }
13607
13608 var didOnEnd = false;
13609 function onend() {
13610 if (didOnEnd) return;
13611 didOnEnd = true;
13612
13613 dest.end();
13614 }
13615
13616 function onclose() {
13617 if (didOnEnd) return;
13618 didOnEnd = true;
13619
13620 if (typeof dest.destroy === 'function') dest.destroy();
13621 }
13622
13623 // don't leave dangling pipes when there are errors.
13624 function onerror(er) {
13625 cleanup();
13626 if (EE.listenerCount(this, 'error') === 0) {
13627 throw er; // Unhandled stream error in pipe.
13628 }
13629 }
13630
13631 source.on('error', onerror);
13632 dest.on('error', onerror);
13633
13634 // remove all the event listeners that were added.
13635 function cleanup() {
13636 source.removeListener('data', ondata);
13637 dest.removeListener('drain', ondrain);
13638
13639 source.removeListener('end', onend);
13640 source.removeListener('close', onclose);
13641
13642 source.removeListener('error', onerror);
13643 dest.removeListener('error', onerror);
13644
13645 source.removeListener('end', cleanup);
13646 source.removeListener('close', cleanup);
13647
13648 dest.removeListener('close', cleanup);
13649 }
13650
13651 source.on('end', cleanup);
13652 source.on('close', cleanup);
13653
13654 dest.on('close', cleanup);
13655
13656 dest.emit('pipe', source);
13657
13658 // Allow for unix-like usage: A.pipe(B).pipe(C)
13659 return dest;
13660};
13661
13662/***/ }),
13663/* 76 */
13664/***/ (function(module, exports, __webpack_require__) {
13665
13666"use strict";
13667
13668
13669module.exports = __webpack_require__(24);
13670
13671/***/ }),
13672/* 77 */
13673/***/ (function(module, exports, __webpack_require__) {
13674
13675"use strict";
13676
13677
13678module.exports = __webpack_require__(4);
13679
13680/***/ }),
13681/* 78 */
13682/***/ (function(module, exports, __webpack_require__) {
13683
13684"use strict";
13685
13686
13687module.exports = __webpack_require__(7).Transform;
13688
13689/***/ }),
13690/* 79 */
13691/***/ (function(module, exports, __webpack_require__) {
13692
13693"use strict";
13694
13695
13696module.exports = __webpack_require__(7).PassThrough;
13697
13698/***/ }),
13699/* 80 */
13700/***/ (function(module, exports, __webpack_require__) {
13701
13702"use strict";
13703
13704
13705// Generated by CoffeeScript 1.12.7
13706(function () {
13707 "use strict";
13708
13709 exports.stripBOM = function (str) {
13710 if (str[0] === "\uFEFF") {
13711 return str.substring(1);
13712 } else {
13713 return str;
13714 }
13715 };
13716}).call(undefined);
13717
13718/***/ }),
13719/* 81 */
13720/***/ (function(module, exports, __webpack_require__) {
13721
13722"use strict";
13723
13724
13725var fields = module.exports = {};
13726
13727fields.feed = [['author', 'creator'], ['dc:publisher', 'publisher'], ['dc:creator', 'creator'], ['dc:source', 'source'], ['dc:title', 'title'], ['dc:type', 'type'], 'title', 'description', 'author', 'pubDate', 'webMaster', 'managingEditor', 'generator', 'link', 'language', 'copyright', 'lastBuildDate', 'docs', 'generator', 'ttl', 'rating', 'skipHours', 'skipDays'];
13728
13729fields.item = [['author', 'creator'], ['dc:creator', 'creator'], ['dc:date', 'date'], ['dc:language', 'language'], ['dc:rights', 'rights'], ['dc:source', 'source'], ['dc:title', 'title'], 'title', 'link', 'pubDate', 'author', 'content:encoded', 'enclosure', 'dc:creator', 'dc:date', 'comments'];
13730
13731var mapItunesField = function mapItunesField(f) {
13732 return ['itunes:' + f, f];
13733};
13734
13735fields.podcastFeed = ['author', 'subtitle', 'summary', 'explicit'].map(mapItunesField);
13736
13737fields.podcastItem = ['author', 'subtitle', 'summary', 'explicit', 'duration', 'image', 'episode', 'image', 'season', 'keywords'].map(mapItunesField);
13738
13739/***/ }),
13740/* 82 */
13741/***/ (function(module, exports, __webpack_require__) {
13742
13743"use strict";
13744
13745
13746var _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; };
13747
13748var utils = module.exports = {};
13749var entities = __webpack_require__(83);
13750var xml2js = __webpack_require__(39);
13751
13752utils.stripHtml = function (str) {
13753 return str.replace(/<(?:.|\n)*?>/gm, '');
13754};
13755
13756utils.getSnippet = function (str) {
13757 return entities.decode(utils.stripHtml(str)).trim();
13758};
13759
13760utils.getLink = function (links, rel, fallbackIdx) {
13761 if (!links) return;
13762 for (var i = 0; i < links.length; ++i) {
13763 if (links[i].$.rel === rel) return links[i].$.href;
13764 }
13765 if (links[fallbackIdx]) return links[fallbackIdx].$.href;
13766};
13767
13768utils.getContent = function (content) {
13769 if (typeof content._ === 'string') {
13770 return content._;
13771 } else if ((typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object') {
13772 var builder = new xml2js.Builder({ headless: true, explicitRoot: true, rootName: 'div', renderOpts: { pretty: false } });
13773 return builder.buildObject(content);
13774 } else {
13775 return content;
13776 }
13777};
13778
13779utils.copyFromXML = function (xml, dest, fields) {
13780 fields.forEach(function (f) {
13781 var from = f;
13782 var to = f;
13783 var options = {};
13784 if (Array.isArray(f)) {
13785 from = f[0];
13786 to = f[1];
13787 if (f.length > 2) {
13788 options = f[2];
13789 }
13790 }
13791 var _options = options,
13792 keepArray = _options.keepArray;
13793
13794 if (xml[from] !== undefined) dest[to] = keepArray ? xml[from] : xml[from][0];
13795 });
13796};
13797
13798utils.maybePromisify = function (callback, promise) {
13799 if (!callback) return promise;
13800 return promise.then(function (data) {
13801 return setTimeout(function () {
13802 return callback(null, data);
13803 });
13804 }, function (err) {
13805 return setTimeout(function () {
13806 return callback(err);
13807 });
13808 });
13809};
13810
13811var DEFAULT_ENCODING = 'utf8';
13812var ENCODING_REGEX = /(encoding|charset)\s*=\s*(\S+)/;
13813var SUPPORTED_ENCODINGS = ['ascii', 'utf8', 'utf16le', 'ucs2', 'base64', 'latin1', 'binary', 'hex'];
13814var ENCODING_ALIASES = {
13815 'utf-8': 'utf8',
13816 'iso-8859-1': 'latin1'
13817};
13818
13819utils.getEncodingFromContentType = function (contentType) {
13820 contentType = contentType || '';
13821 var match = contentType.match(ENCODING_REGEX);
13822 var encoding = (match || [])[2] || '';
13823 encoding = encoding.toLowerCase();
13824 encoding = ENCODING_ALIASES[encoding] || encoding;
13825 if (!encoding || SUPPORTED_ENCODINGS.indexOf(encoding) === -1) {
13826 encoding = DEFAULT_ENCODING;
13827 }
13828 return encoding;
13829};
13830
13831/***/ }),
13832/* 83 */
13833/***/ (function(module, exports, __webpack_require__) {
13834
13835"use strict";
13836
13837
13838var encode = __webpack_require__(84),
13839 decode = __webpack_require__(85);
13840
13841exports.decode = function (data, level) {
13842 return (!level || level <= 0 ? decode.XML : decode.HTML)(data);
13843};
13844
13845exports.decodeStrict = function (data, level) {
13846 return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data);
13847};
13848
13849exports.encode = function (data, level) {
13850 return (!level || level <= 0 ? encode.XML : encode.HTML)(data);
13851};
13852
13853exports.encodeXML = encode.XML;
13854
13855exports.encodeHTML4 = exports.encodeHTML5 = exports.encodeHTML = encode.HTML;
13856
13857exports.decodeXML = exports.decodeXMLStrict = decode.XML;
13858
13859exports.decodeHTML4 = exports.decodeHTML5 = exports.decodeHTML = decode.HTML;
13860
13861exports.decodeHTML4Strict = exports.decodeHTML5Strict = exports.decodeHTMLStrict = decode.HTMLStrict;
13862
13863exports.escape = encode.escape;
13864
13865/***/ }),
13866/* 84 */
13867/***/ (function(module, exports, __webpack_require__) {
13868
13869"use strict";
13870
13871
13872var inverseXML = getInverseObj(__webpack_require__(44)),
13873 xmlReplacer = getInverseReplacer(inverseXML);
13874
13875exports.XML = getInverse(inverseXML, xmlReplacer);
13876
13877var inverseHTML = getInverseObj(__webpack_require__(45)),
13878 htmlReplacer = getInverseReplacer(inverseHTML);
13879
13880exports.HTML = getInverse(inverseHTML, htmlReplacer);
13881
13882function getInverseObj(obj) {
13883 return Object.keys(obj).sort().reduce(function (inverse, name) {
13884 inverse[obj[name]] = "&" + name + ";";
13885 return inverse;
13886 }, {});
13887}
13888
13889function getInverseReplacer(inverse) {
13890 var single = [],
13891 multiple = [];
13892
13893 Object.keys(inverse).forEach(function (k) {
13894 if (k.length === 1) {
13895 single.push("\\" + k);
13896 } else {
13897 multiple.push(k);
13898 }
13899 });
13900
13901 //TODO add ranges
13902 multiple.unshift("[" + single.join("") + "]");
13903
13904 return new RegExp(multiple.join("|"), "g");
13905}
13906
13907var re_nonASCII = /[^\0-\x7F]/g,
13908 re_astralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
13909
13910function singleCharReplacer(c) {
13911 return "&#x" + c.charCodeAt(0).toString(16).toUpperCase() + ";";
13912}
13913
13914function astralReplacer(c) {
13915 // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
13916 var high = c.charCodeAt(0);
13917 var low = c.charCodeAt(1);
13918 var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
13919 return "&#x" + codePoint.toString(16).toUpperCase() + ";";
13920}
13921
13922function getInverse(inverse, re) {
13923 function func(name) {
13924 return inverse[name];
13925 }
13926
13927 return function (data) {
13928 return data.replace(re, func).replace(re_astralSymbols, astralReplacer).replace(re_nonASCII, singleCharReplacer);
13929 };
13930}
13931
13932var re_xmlChars = getInverseReplacer(inverseXML);
13933
13934function escapeXML(data) {
13935 return data.replace(re_xmlChars, singleCharReplacer).replace(re_astralSymbols, astralReplacer).replace(re_nonASCII, singleCharReplacer);
13936}
13937
13938exports.escape = escapeXML;
13939
13940/***/ }),
13941/* 85 */
13942/***/ (function(module, exports, __webpack_require__) {
13943
13944"use strict";
13945
13946
13947var entityMap = __webpack_require__(45),
13948 legacyMap = __webpack_require__(86),
13949 xmlMap = __webpack_require__(44),
13950 decodeCodePoint = __webpack_require__(87);
13951
13952var decodeXMLStrict = getStrictDecoder(xmlMap),
13953 decodeHTMLStrict = getStrictDecoder(entityMap);
13954
13955function getStrictDecoder(map) {
13956 var keys = Object.keys(map).join("|"),
13957 replace = getReplacer(map);
13958
13959 keys += "|#[xX][\\da-fA-F]+|#\\d+";
13960
13961 var re = new RegExp("&(?:" + keys + ");", "g");
13962
13963 return function (str) {
13964 return String(str).replace(re, replace);
13965 };
13966}
13967
13968var decodeHTML = function () {
13969 var legacy = Object.keys(legacyMap).sort(sorter);
13970
13971 var keys = Object.keys(entityMap).sort(sorter);
13972
13973 for (var i = 0, j = 0; i < keys.length; i++) {
13974 if (legacy[j] === keys[i]) {
13975 keys[i] += ";?";
13976 j++;
13977 } else {
13978 keys[i] += ";";
13979 }
13980 }
13981
13982 var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"),
13983 replace = getReplacer(entityMap);
13984
13985 function replacer(str) {
13986 if (str.substr(-1) !== ";") str += ";";
13987 return replace(str);
13988 }
13989
13990 //TODO consider creating a merged map
13991 return function (str) {
13992 return String(str).replace(re, replacer);
13993 };
13994}();
13995
13996function sorter(a, b) {
13997 return a < b ? 1 : -1;
13998}
13999
14000function getReplacer(map) {
14001 return function replace(str) {
14002 if (str.charAt(1) === "#") {
14003 if (str.charAt(2) === "X" || str.charAt(2) === "x") {
14004 return decodeCodePoint(parseInt(str.substr(3), 16));
14005 }
14006 return decodeCodePoint(parseInt(str.substr(2), 10));
14007 }
14008 return map[str.slice(1, -1)];
14009 };
14010}
14011
14012module.exports = {
14013 XML: decodeXMLStrict,
14014 HTML: decodeHTML,
14015 HTMLStrict: decodeHTMLStrict
14016};
14017
14018/***/ }),
14019/* 86 */
14020/***/ (function(module, exports) {
14021
14022module.exports = {"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\"","QUOT":"\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}
14023
14024/***/ }),
14025/* 87 */
14026/***/ (function(module, exports, __webpack_require__) {
14027
14028"use strict";
14029
14030
14031var decodeMap = __webpack_require__(88);
14032
14033module.exports = decodeCodePoint;
14034
14035// modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
14036function decodeCodePoint(codePoint) {
14037
14038 if (codePoint >= 0xD800 && codePoint <= 0xDFFF || codePoint > 0x10FFFF) {
14039 return "\uFFFD";
14040 }
14041
14042 if (codePoint in decodeMap) {
14043 codePoint = decodeMap[codePoint];
14044 }
14045
14046 var output = "";
14047
14048 if (codePoint > 0xFFFF) {
14049 codePoint -= 0x10000;
14050 output += String.fromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
14051 codePoint = 0xDC00 | codePoint & 0x3FF;
14052 }
14053
14054 output += String.fromCharCode(codePoint);
14055 return output;
14056}
14057
14058/***/ }),
14059/* 88 */
14060/***/ (function(module, exports) {
14061
14062module.exports = {"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}
14063
14064/***/ })
14065/******/ ]);
14066//# sourceMappingURL=rss-parser.min.js.map
\No newline at end of file