axios_rails 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4dbace6993e18b9590f6161d6a05e5f9d3224bd7
4
- data.tar.gz: 6010c861f6ce174c7b61022ccfc274419c77c306
3
+ metadata.gz: d0fbfbdccbe169763d3d14319a927cc31cc5c461
4
+ data.tar.gz: e148afdfcd3d93f8aca0a1ca9cf9b36358692658
5
5
  SHA512:
6
- metadata.gz: 714499c8a2e23eb178e5b3a948ef1b3ee68897c85374d6d667177f6297229078df28e85c8099632c5e887ccd66cf82e52d14ac2d8e7f6d9e8cb3d764b5500316
7
- data.tar.gz: 905cfaf1b7a93def915fdbb6f24774196730e0fceeedd33fc61d6947fcb7062e6b9c201a2c481c76ac6c0a6a2496565db951e0617af9621b11ddbe146491dfa7
6
+ metadata.gz: 2c97361748c4f5d47bda79129c01db8d9be6ad3d02cc7e336a4af5ea4d5bfb1479dc43d85ff47e49226ef65f2fa6733a62cdd6f2070a9b24396e8058cdfd9ac4
7
+ data.tar.gz: c256ce996c74b6fe9bc02a57cde7dd171482b806454a6d6603414668e3c822cdf260dd670859a42f4baf6358e291636df89d32836574181eea7e698631a7d170
@@ -1,3 +1,4 @@
1
+
1
2
  var axios =
2
3
  /******/ (function(modules) { // webpackBootstrap
3
4
  /******/ // The module cache
@@ -51,9 +52,14 @@ var axios =
51
52
  /* 1 */
52
53
  /***/ function(module, exports, __webpack_require__) {
53
54
 
54
- /* WEBPACK VAR INJECTION */(function(process) {var Promise = __webpack_require__(13).Promise;
55
- var defaults = __webpack_require__(3);
56
- var utils = __webpack_require__(4);
55
+ var defaults = __webpack_require__(2);
56
+ var utils = __webpack_require__(3);
57
+ var deprecatedMethod = __webpack_require__(4);
58
+ var dispatchRequest = __webpack_require__(5);
59
+ var InterceptorManager = __webpack_require__(6);
60
+
61
+ // Polyfill ES6 Promise if needed
62
+ __webpack_require__(9).polyfill();
57
63
 
58
64
  var axios = module.exports = function axios(config) {
59
65
  config = utils.merge({
@@ -66,32 +72,20 @@ var axios =
66
72
  // Don't allow overriding defaults.withCredentials
67
73
  config.withCredentials = config.withCredentials || defaults.withCredentials;
68
74
 
69
- var promise = new Promise(function (resolve, reject) {
70
- try {
71
- // For browsers use XHR adapter
72
- if (typeof window !== 'undefined') {
73
- __webpack_require__(5)(resolve, reject, config);
74
- }
75
- // For node use HTTP adapter
76
- else if (typeof process !== 'undefined') {
77
- __webpack_require__(2)(resolve, reject, config);
78
- }
79
- } catch (e) {
80
- reject(e);
81
- }
75
+ // Hook up interceptors middleware
76
+ var chain = [dispatchRequest, undefined];
77
+ var promise = Promise.resolve(config);
78
+
79
+ axios.interceptors.request.forEach(function (interceptor) {
80
+ chain.unshift(interceptor.fulfilled, interceptor.rejected);
82
81
  });
83
82
 
84
- function deprecatedMethod(method, instead, docs) {
85
- try {
86
- console.warn(
87
- 'DEPRECATED method `' + method + '`.' +
88
- (instead ? ' Use `' + instead + '` instead.' : '') +
89
- ' This method will be removed in a future release.');
83
+ axios.interceptors.response.forEach(function (interceptor) {
84
+ chain.push(interceptor.fulfilled, interceptor.rejected);
85
+ });
90
86
 
91
- if (docs) {
92
- console.warn('For more information about usage see ' + docs);
93
- }
94
- } catch (e) {}
87
+ while (chain.length) {
88
+ promise = promise.then(chain.shift(), chain.shift());
95
89
  }
96
90
 
97
91
  // Provide alias for success
@@ -124,7 +118,13 @@ var axios =
124
118
  axios.all = function (promises) {
125
119
  return Promise.all(promises);
126
120
  };
127
- axios.spread = __webpack_require__(6);
121
+ axios.spread = __webpack_require__(7);
122
+
123
+ // Expose interceptors
124
+ axios.interceptors = {
125
+ request: new InterceptorManager(),
126
+ response: new InterceptorManager()
127
+ };
128
128
 
129
129
  // Provide aliases for supported request methods
130
130
  createShortMethods('delete', 'get', 'head');
@@ -152,22 +152,16 @@ var axios =
152
152
  };
153
153
  });
154
154
  }
155
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
156
155
 
157
- /***/ },
158
- /* 2 */
159
- /***/ function(module, exports, __webpack_require__) {
160
156
 
161
- if(typeof undefined === 'undefined') {var e = new Error("Cannot find module \"undefined\""); e.code = 'MODULE_NOT_FOUND'; throw e;}
162
- module.exports = undefined;
163
157
 
164
158
  /***/ },
165
- /* 3 */
159
+ /* 2 */
166
160
  /***/ function(module, exports, __webpack_require__) {
167
161
 
168
162
  'use strict';
169
163
 
170
- var utils = __webpack_require__(4);
164
+ var utils = __webpack_require__(3);
171
165
 
172
166
  var JSON_START = /^\s*(\[|\{[^\{])/;
173
167
  var JSON_END = /[\}\]]\s*$/;
@@ -218,7 +212,7 @@ var axios =
218
212
  };
219
213
 
220
214
  /***/ },
221
- /* 4 */
215
+ /* 3 */
222
216
  /***/ function(module, exports, __webpack_require__) {
223
217
 
224
218
  // utils is a library of generic helper functions non-specific to axios
@@ -245,6 +239,16 @@ var axios =
245
239
  return toString.call(val) === '[object ArrayBuffer]';
246
240
  }
247
241
 
242
+ /**
243
+ * Determine if a value is a FormData
244
+ *
245
+ * @param {Object} val The value to test
246
+ * @returns {boolean} True if value is an FormData, otherwise false
247
+ */
248
+ function isFormData(val) {
249
+ return toString.call(val) === '[object FormData]';
250
+ }
251
+
248
252
  /**
249
253
  * Determine if a value is a view on an ArrayBuffer
250
254
  *
@@ -411,6 +415,7 @@ var axios =
411
415
  module.exports = {
412
416
  isArray: isArray,
413
417
  isArrayBuffer: isArrayBuffer,
418
+ isFormData: isFormData,
414
419
  isArrayBufferView: isArrayBufferView,
415
420
  isString: isString,
416
421
  isNumber: isNumber,
@@ -424,17 +429,169 @@ var axios =
424
429
  trim: trim
425
430
  };
426
431
 
432
+ /***/ },
433
+ /* 4 */
434
+ /***/ function(module, exports, __webpack_require__) {
435
+
436
+ 'use strict';
437
+
438
+ /**
439
+ * Supply a warning to the developer that a method they are using
440
+ * has been deprecated.
441
+ *
442
+ * @param {string} method The name of the deprecated method
443
+ * @param {string} [instead] The alternate method to use if applicable
444
+ * @param {string} [docs] The documentation URL to get further details
445
+ */
446
+ module.exports = function deprecatedMethod(method, instead, docs) {
447
+ try {
448
+ console.warn(
449
+ 'DEPRECATED method `' + method + '`.' +
450
+ (instead ? ' Use `' + instead + '` instead.' : '') +
451
+ ' This method will be removed in a future release.');
452
+
453
+ if (docs) {
454
+ console.warn('For more information about usage see ' + docs);
455
+ }
456
+ } catch (e) {}
457
+ };
458
+
459
+
427
460
  /***/ },
428
461
  /* 5 */
429
462
  /***/ function(module, exports, __webpack_require__) {
430
463
 
431
- var defaults = __webpack_require__(3);
432
- var utils = __webpack_require__(4);
433
- var buildUrl = __webpack_require__(8);
434
- var cookies = __webpack_require__(9);
435
- var parseHeaders = __webpack_require__(10);
436
- var transformData = __webpack_require__(11);
437
- var urlIsSameOrigin = __webpack_require__(12);
464
+ /* WEBPACK VAR INJECTION */(function(process) {'use strict';
465
+
466
+ var Promise = __webpack_require__(9).Promise;
467
+
468
+ /**
469
+ * Dispatch a request to the server using whichever adapter
470
+ * is supported by the current environment.
471
+ *
472
+ * @param {object} config The config that is to be used for the request
473
+ * @returns {Promise} The Promise to be fulfilled
474
+ */
475
+ module.exports = function dispatchRequest(config) {
476
+ return new Promise(function (resolve, reject) {
477
+ try {
478
+ // For browsers use XHR adapter
479
+ if (typeof window !== 'undefined') {
480
+ __webpack_require__(8)(resolve, reject, config);
481
+ }
482
+ // For node use HTTP adapter
483
+ else if (typeof process !== 'undefined') {
484
+ __webpack_require__(8)(resolve, reject, config);
485
+ }
486
+ } catch (e) {
487
+ reject(e);
488
+ }
489
+ });
490
+ };
491
+
492
+
493
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)))
494
+
495
+ /***/ },
496
+ /* 6 */
497
+ /***/ function(module, exports, __webpack_require__) {
498
+
499
+ 'use strict';
500
+
501
+ var utils = __webpack_require__(3);
502
+
503
+ function InterceptorManager() {
504
+ this.handlers = [];
505
+ };
506
+
507
+ /**
508
+ * Add a new interceptor to the stack
509
+ *
510
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
511
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
512
+ *
513
+ * @return {Number} An ID used to remove interceptor later
514
+ */
515
+ InterceptorManager.prototype.use = function (fulfilled, rejected) {
516
+ this.handlers.push({
517
+ fulfilled: fulfilled,
518
+ rejected: rejected
519
+ });
520
+ return this.handlers.length - 1;
521
+ };
522
+
523
+ /**
524
+ * Remove an interceptor from the stack
525
+ *
526
+ * @param {Number} id The ID that was returned by `use`
527
+ */
528
+ InterceptorManager.prototype.eject = function (id) {
529
+ if (this.handlers[id]) {
530
+ this.handlers[id] = null;
531
+ }
532
+ };
533
+
534
+ /**
535
+ * Iterate over all the registered interceptors
536
+ *
537
+ * This method is particularly useful for skipping over any
538
+ * interceptors that may have become `null` calling `remove`.
539
+ *
540
+ * @param {Function} fn The function to call for each interceptor
541
+ */
542
+ InterceptorManager.prototype.forEach = function (fn) {
543
+ utils.forEach(this.handlers, function (h) {
544
+ if (h !== null) {
545
+ fn(h);
546
+ }
547
+ });
548
+ };
549
+
550
+ module.exports = InterceptorManager;
551
+
552
+
553
+
554
+ /***/ },
555
+ /* 7 */
556
+ /***/ function(module, exports, __webpack_require__) {
557
+
558
+ /**
559
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
560
+ *
561
+ * Common use case would be to use `Function.prototype.apply`.
562
+ *
563
+ * ```js
564
+ * function f(x, y, z) {}
565
+ * var args = [1, 2, 3];
566
+ * f.apply(null, args);
567
+ * ```
568
+ *
569
+ * With `spread` this example can be re-written.
570
+ *
571
+ * ```js
572
+ * spread(function(x, y, z) {})([1, 2, 3]);
573
+ * ```
574
+ *
575
+ * @param {Function} callback
576
+ * @returns {Function}
577
+ */
578
+ module.exports = function spread(callback) {
579
+ return function (arr) {
580
+ callback.apply(null, arr);
581
+ };
582
+ };
583
+
584
+ /***/ },
585
+ /* 8 */
586
+ /***/ function(module, exports, __webpack_require__) {
587
+
588
+ var defaults = __webpack_require__(2);
589
+ var utils = __webpack_require__(3);
590
+ var buildUrl = __webpack_require__(11);
591
+ var cookies = __webpack_require__(12);
592
+ var parseHeaders = __webpack_require__(13);
593
+ var transformData = __webpack_require__(14);
594
+ var urlIsSameOrigin = __webpack_require__(15);
438
595
 
439
596
  module.exports = function xhrAdapter(resolve, reject, config) {
440
597
  // Transform request data
@@ -451,9 +608,13 @@ var axios =
451
608
  config.headers || {}
452
609
  );
453
610
 
611
+ if (utils.isFormData(data)) {
612
+ delete headers['Content-Type']; // Let the browser set it
613
+ }
614
+
454
615
  // Create the request
455
616
  var request = new(XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP');
456
- request.open(config.method, buildUrl(config.url, config.params), true);
617
+ request.open(config.method.toUpperCase(), buildUrl(config.url, config.params), true);
457
618
 
458
619
  // Listen for ready state
459
620
  request.onreadystatechange = function () {
@@ -526,131 +687,1097 @@ var axios =
526
687
  };
527
688
 
528
689
  /***/ },
529
- /* 6 */
690
+ /* 9 */
530
691
  /***/ function(module, exports, __webpack_require__) {
531
692
 
532
- /**
533
- * Syntactic sugar for invoking a function and expanding an array for arguments.
534
- *
535
- * Common use case would be to use `Function.prototype.apply`.
536
- *
537
- * ```js
538
- * function f(x, y, z) {}
539
- * var args = [1, 2, 3];
540
- * f.apply(null, args);
541
- * ```
542
- *
543
- * With `spread` this example can be re-written.
544
- *
545
- * ```js
546
- * spread(function(x, y, z) {})([1, 2, 3]);
547
- * ```
548
- *
549
- * @param {Function} callback
550
- * @returns {Function}
693
+ var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(process, global, module) {/*!
694
+ * @overview es6-promise - a tiny implementation of Promises/A+.
695
+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
696
+ * @license Licensed under MIT license
697
+ * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
698
+ * @version 2.0.1
551
699
  */
552
- module.exports = function spread(callback) {
553
- return function (arr) {
554
- callback.apply(null, arr);
555
- };
556
- };
557
-
558
- /***/ },
559
- /* 7 */
560
- /***/ function(module, exports, __webpack_require__) {
561
700
 
562
- // shim for using process in browser
701
+ (function() {
702
+ "use strict";
563
703
 
564
- var process = module.exports = {};
704
+ function $$utils$$objectOrFunction(x) {
705
+ return typeof x === 'function' || (typeof x === 'object' && x !== null);
706
+ }
565
707
 
566
- process.nextTick = (function () {
567
- var canSetImmediate = typeof window !== 'undefined'
568
- && window.setImmediate;
569
- var canPost = typeof window !== 'undefined'
570
- && window.postMessage && window.addEventListener
571
- ;
708
+ function $$utils$$isFunction(x) {
709
+ return typeof x === 'function';
710
+ }
572
711
 
573
- if (canSetImmediate) {
574
- return function (f) { return window.setImmediate(f) };
712
+ function $$utils$$isMaybeThenable(x) {
713
+ return typeof x === 'object' && x !== null;
575
714
  }
576
715
 
577
- if (canPost) {
578
- var queue = [];
579
- window.addEventListener('message', function (ev) {
580
- var source = ev.source;
581
- if ((source === window || source === null) && ev.data === 'process-tick') {
582
- ev.stopPropagation();
583
- if (queue.length > 0) {
584
- var fn = queue.shift();
585
- fn();
586
- }
587
- }
588
- }, true);
716
+ var $$utils$$_isArray;
589
717
 
590
- return function nextTick(fn) {
591
- queue.push(fn);
592
- window.postMessage('process-tick', '*');
593
- };
718
+ if (!Array.isArray) {
719
+ $$utils$$_isArray = function (x) {
720
+ return Object.prototype.toString.call(x) === '[object Array]';
721
+ };
722
+ } else {
723
+ $$utils$$_isArray = Array.isArray;
594
724
  }
595
725
 
596
- return function nextTick(fn) {
597
- setTimeout(fn, 0);
726
+ var $$utils$$isArray = $$utils$$_isArray;
727
+ var $$utils$$now = Date.now || function() { return new Date().getTime(); };
728
+ function $$utils$$F() { }
729
+
730
+ var $$utils$$o_create = (Object.create || function (o) {
731
+ if (arguments.length > 1) {
732
+ throw new Error('Second argument not supported');
733
+ }
734
+ if (typeof o !== 'object') {
735
+ throw new TypeError('Argument must be an object');
736
+ }
737
+ $$utils$$F.prototype = o;
738
+ return new $$utils$$F();
739
+ });
740
+
741
+ var $$asap$$len = 0;
742
+
743
+ var $$asap$$default = function asap(callback, arg) {
744
+ $$asap$$queue[$$asap$$len] = callback;
745
+ $$asap$$queue[$$asap$$len + 1] = arg;
746
+ $$asap$$len += 2;
747
+ if ($$asap$$len === 2) {
748
+ // If len is 1, that means that we need to schedule an async flush.
749
+ // If additional callbacks are queued before the queue is flushed, they
750
+ // will be processed by this flush that we are scheduling.
751
+ $$asap$$scheduleFlush();
752
+ }
598
753
  };
599
- })();
600
754
 
601
- process.title = 'browser';
602
- process.browser = true;
603
- process.env = {};
604
- process.argv = [];
755
+ var $$asap$$browserGlobal = (typeof window !== 'undefined') ? window : {};
756
+ var $$asap$$BrowserMutationObserver = $$asap$$browserGlobal.MutationObserver || $$asap$$browserGlobal.WebKitMutationObserver;
605
757
 
606
- function noop() {}
758
+ // test for web worker but not in IE10
759
+ var $$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' &&
760
+ typeof importScripts !== 'undefined' &&
761
+ typeof MessageChannel !== 'undefined';
607
762
 
608
- process.on = noop;
609
- process.addListener = noop;
610
- process.once = noop;
611
- process.off = noop;
612
- process.removeListener = noop;
613
- process.removeAllListeners = noop;
614
- process.emit = noop;
763
+ // node
764
+ function $$asap$$useNextTick() {
765
+ return function() {
766
+ process.nextTick($$asap$$flush);
767
+ };
768
+ }
615
769
 
616
- process.binding = function (name) {
617
- throw new Error('process.binding is not supported');
618
- }
770
+ function $$asap$$useMutationObserver() {
771
+ var iterations = 0;
772
+ var observer = new $$asap$$BrowserMutationObserver($$asap$$flush);
773
+ var node = document.createTextNode('');
774
+ observer.observe(node, { characterData: true });
619
775
 
620
- // TODO(shtylman)
621
- process.cwd = function () { return '/' };
622
- process.chdir = function (dir) {
623
- throw new Error('process.chdir is not supported');
624
- };
776
+ return function() {
777
+ node.data = (iterations = ++iterations % 2);
778
+ };
779
+ }
625
780
 
781
+ // web worker
782
+ function $$asap$$useMessageChannel() {
783
+ var channel = new MessageChannel();
784
+ channel.port1.onmessage = $$asap$$flush;
785
+ return function () {
786
+ channel.port2.postMessage(0);
787
+ };
788
+ }
626
789
 
627
- /***/ },
628
- /* 8 */
629
- /***/ function(module, exports, __webpack_require__) {
790
+ function $$asap$$useSetTimeout() {
791
+ return function() {
792
+ setTimeout($$asap$$flush, 1);
793
+ };
794
+ }
630
795
 
631
- 'use strict';
796
+ var $$asap$$queue = new Array(1000);
632
797
 
633
- var utils = __webpack_require__(4);
798
+ function $$asap$$flush() {
799
+ for (var i = 0; i < $$asap$$len; i+=2) {
800
+ var callback = $$asap$$queue[i];
801
+ var arg = $$asap$$queue[i+1];
634
802
 
635
- function encode(val) {
636
- return encodeURIComponent(val).
637
- replace(/%40/gi, '@').
638
- replace(/%3A/gi, ':').
639
- replace(/%24/g, '$').
640
- replace(/%2C/gi, ',').
641
- replace(/%20/g, '+');
642
- }
803
+ callback(arg);
643
804
 
644
- module.exports = function buildUrl(url, params) {
645
- if (!params) {
646
- return url;
647
- }
805
+ $$asap$$queue[i] = undefined;
806
+ $$asap$$queue[i+1] = undefined;
807
+ }
648
808
 
649
- var parts = [];
809
+ $$asap$$len = 0;
810
+ }
650
811
 
651
- utils.forEach(params, function (val, key) {
652
- if (val === null || typeof val === 'undefined') {
653
- return;
812
+ var $$asap$$scheduleFlush;
813
+
814
+ // Decide what async method to use to triggering processing of queued callbacks:
815
+ if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
816
+ $$asap$$scheduleFlush = $$asap$$useNextTick();
817
+ } else if ($$asap$$BrowserMutationObserver) {
818
+ $$asap$$scheduleFlush = $$asap$$useMutationObserver();
819
+ } else if ($$asap$$isWorker) {
820
+ $$asap$$scheduleFlush = $$asap$$useMessageChannel();
821
+ } else {
822
+ $$asap$$scheduleFlush = $$asap$$useSetTimeout();
823
+ }
824
+
825
+ function $$$internal$$noop() {}
826
+ var $$$internal$$PENDING = void 0;
827
+ var $$$internal$$FULFILLED = 1;
828
+ var $$$internal$$REJECTED = 2;
829
+ var $$$internal$$GET_THEN_ERROR = new $$$internal$$ErrorObject();
830
+
831
+ function $$$internal$$selfFullfillment() {
832
+ return new TypeError("You cannot resolve a promise with itself");
833
+ }
834
+
835
+ function $$$internal$$cannotReturnOwn() {
836
+ return new TypeError('A promises callback cannot return that same promise.')
837
+ }
838
+
839
+ function $$$internal$$getThen(promise) {
840
+ try {
841
+ return promise.then;
842
+ } catch(error) {
843
+ $$$internal$$GET_THEN_ERROR.error = error;
844
+ return $$$internal$$GET_THEN_ERROR;
845
+ }
846
+ }
847
+
848
+ function $$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
849
+ try {
850
+ then.call(value, fulfillmentHandler, rejectionHandler);
851
+ } catch(e) {
852
+ return e;
853
+ }
854
+ }
855
+
856
+ function $$$internal$$handleForeignThenable(promise, thenable, then) {
857
+ $$asap$$default(function(promise) {
858
+ var sealed = false;
859
+ var error = $$$internal$$tryThen(then, thenable, function(value) {
860
+ if (sealed) { return; }
861
+ sealed = true;
862
+ if (thenable !== value) {
863
+ $$$internal$$resolve(promise, value);
864
+ } else {
865
+ $$$internal$$fulfill(promise, value);
866
+ }
867
+ }, function(reason) {
868
+ if (sealed) { return; }
869
+ sealed = true;
870
+
871
+ $$$internal$$reject(promise, reason);
872
+ }, 'Settle: ' + (promise._label || ' unknown promise'));
873
+
874
+ if (!sealed && error) {
875
+ sealed = true;
876
+ $$$internal$$reject(promise, error);
877
+ }
878
+ }, promise);
879
+ }
880
+
881
+ function $$$internal$$handleOwnThenable(promise, thenable) {
882
+ if (thenable._state === $$$internal$$FULFILLED) {
883
+ $$$internal$$fulfill(promise, thenable._result);
884
+ } else if (promise._state === $$$internal$$REJECTED) {
885
+ $$$internal$$reject(promise, thenable._result);
886
+ } else {
887
+ $$$internal$$subscribe(thenable, undefined, function(value) {
888
+ $$$internal$$resolve(promise, value);
889
+ }, function(reason) {
890
+ $$$internal$$reject(promise, reason);
891
+ });
892
+ }
893
+ }
894
+
895
+ function $$$internal$$handleMaybeThenable(promise, maybeThenable) {
896
+ if (maybeThenable.constructor === promise.constructor) {
897
+ $$$internal$$handleOwnThenable(promise, maybeThenable);
898
+ } else {
899
+ var then = $$$internal$$getThen(maybeThenable);
900
+
901
+ if (then === $$$internal$$GET_THEN_ERROR) {
902
+ $$$internal$$reject(promise, $$$internal$$GET_THEN_ERROR.error);
903
+ } else if (then === undefined) {
904
+ $$$internal$$fulfill(promise, maybeThenable);
905
+ } else if ($$utils$$isFunction(then)) {
906
+ $$$internal$$handleForeignThenable(promise, maybeThenable, then);
907
+ } else {
908
+ $$$internal$$fulfill(promise, maybeThenable);
909
+ }
910
+ }
911
+ }
912
+
913
+ function $$$internal$$resolve(promise, value) {
914
+ if (promise === value) {
915
+ $$$internal$$reject(promise, $$$internal$$selfFullfillment());
916
+ } else if ($$utils$$objectOrFunction(value)) {
917
+ $$$internal$$handleMaybeThenable(promise, value);
918
+ } else {
919
+ $$$internal$$fulfill(promise, value);
920
+ }
921
+ }
922
+
923
+ function $$$internal$$publishRejection(promise) {
924
+ if (promise._onerror) {
925
+ promise._onerror(promise._result);
926
+ }
927
+
928
+ $$$internal$$publish(promise);
929
+ }
930
+
931
+ function $$$internal$$fulfill(promise, value) {
932
+ if (promise._state !== $$$internal$$PENDING) { return; }
933
+
934
+ promise._result = value;
935
+ promise._state = $$$internal$$FULFILLED;
936
+
937
+ if (promise._subscribers.length === 0) {
938
+ } else {
939
+ $$asap$$default($$$internal$$publish, promise);
940
+ }
941
+ }
942
+
943
+ function $$$internal$$reject(promise, reason) {
944
+ if (promise._state !== $$$internal$$PENDING) { return; }
945
+ promise._state = $$$internal$$REJECTED;
946
+ promise._result = reason;
947
+
948
+ $$asap$$default($$$internal$$publishRejection, promise);
949
+ }
950
+
951
+ function $$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
952
+ var subscribers = parent._subscribers;
953
+ var length = subscribers.length;
954
+
955
+ parent._onerror = null;
956
+
957
+ subscribers[length] = child;
958
+ subscribers[length + $$$internal$$FULFILLED] = onFulfillment;
959
+ subscribers[length + $$$internal$$REJECTED] = onRejection;
960
+
961
+ if (length === 0 && parent._state) {
962
+ $$asap$$default($$$internal$$publish, parent);
963
+ }
964
+ }
965
+
966
+ function $$$internal$$publish(promise) {
967
+ var subscribers = promise._subscribers;
968
+ var settled = promise._state;
969
+
970
+ if (subscribers.length === 0) { return; }
971
+
972
+ var child, callback, detail = promise._result;
973
+
974
+ for (var i = 0; i < subscribers.length; i += 3) {
975
+ child = subscribers[i];
976
+ callback = subscribers[i + settled];
977
+
978
+ if (child) {
979
+ $$$internal$$invokeCallback(settled, child, callback, detail);
980
+ } else {
981
+ callback(detail);
982
+ }
983
+ }
984
+
985
+ promise._subscribers.length = 0;
986
+ }
987
+
988
+ function $$$internal$$ErrorObject() {
989
+ this.error = null;
990
+ }
991
+
992
+ var $$$internal$$TRY_CATCH_ERROR = new $$$internal$$ErrorObject();
993
+
994
+ function $$$internal$$tryCatch(callback, detail) {
995
+ try {
996
+ return callback(detail);
997
+ } catch(e) {
998
+ $$$internal$$TRY_CATCH_ERROR.error = e;
999
+ return $$$internal$$TRY_CATCH_ERROR;
1000
+ }
1001
+ }
1002
+
1003
+ function $$$internal$$invokeCallback(settled, promise, callback, detail) {
1004
+ var hasCallback = $$utils$$isFunction(callback),
1005
+ value, error, succeeded, failed;
1006
+
1007
+ if (hasCallback) {
1008
+ value = $$$internal$$tryCatch(callback, detail);
1009
+
1010
+ if (value === $$$internal$$TRY_CATCH_ERROR) {
1011
+ failed = true;
1012
+ error = value.error;
1013
+ value = null;
1014
+ } else {
1015
+ succeeded = true;
1016
+ }
1017
+
1018
+ if (promise === value) {
1019
+ $$$internal$$reject(promise, $$$internal$$cannotReturnOwn());
1020
+ return;
1021
+ }
1022
+
1023
+ } else {
1024
+ value = detail;
1025
+ succeeded = true;
1026
+ }
1027
+
1028
+ if (promise._state !== $$$internal$$PENDING) {
1029
+ // noop
1030
+ } else if (hasCallback && succeeded) {
1031
+ $$$internal$$resolve(promise, value);
1032
+ } else if (failed) {
1033
+ $$$internal$$reject(promise, error);
1034
+ } else if (settled === $$$internal$$FULFILLED) {
1035
+ $$$internal$$fulfill(promise, value);
1036
+ } else if (settled === $$$internal$$REJECTED) {
1037
+ $$$internal$$reject(promise, value);
1038
+ }
1039
+ }
1040
+
1041
+ function $$$internal$$initializePromise(promise, resolver) {
1042
+ try {
1043
+ resolver(function resolvePromise(value){
1044
+ $$$internal$$resolve(promise, value);
1045
+ }, function rejectPromise(reason) {
1046
+ $$$internal$$reject(promise, reason);
1047
+ });
1048
+ } catch(e) {
1049
+ $$$internal$$reject(promise, e);
1050
+ }
1051
+ }
1052
+
1053
+ function $$$enumerator$$makeSettledResult(state, position, value) {
1054
+ if (state === $$$internal$$FULFILLED) {
1055
+ return {
1056
+ state: 'fulfilled',
1057
+ value: value
1058
+ };
1059
+ } else {
1060
+ return {
1061
+ state: 'rejected',
1062
+ reason: value
1063
+ };
1064
+ }
1065
+ }
1066
+
1067
+ function $$$enumerator$$Enumerator(Constructor, input, abortOnReject, label) {
1068
+ this._instanceConstructor = Constructor;
1069
+ this.promise = new Constructor($$$internal$$noop, label);
1070
+ this._abortOnReject = abortOnReject;
1071
+
1072
+ if (this._validateInput(input)) {
1073
+ this._input = input;
1074
+ this.length = input.length;
1075
+ this._remaining = input.length;
1076
+
1077
+ this._init();
1078
+
1079
+ if (this.length === 0) {
1080
+ $$$internal$$fulfill(this.promise, this._result);
1081
+ } else {
1082
+ this.length = this.length || 0;
1083
+ this._enumerate();
1084
+ if (this._remaining === 0) {
1085
+ $$$internal$$fulfill(this.promise, this._result);
1086
+ }
1087
+ }
1088
+ } else {
1089
+ $$$internal$$reject(this.promise, this._validationError());
1090
+ }
1091
+ }
1092
+
1093
+ $$$enumerator$$Enumerator.prototype._validateInput = function(input) {
1094
+ return $$utils$$isArray(input);
1095
+ };
1096
+
1097
+ $$$enumerator$$Enumerator.prototype._validationError = function() {
1098
+ return new Error('Array Methods must be provided an Array');
1099
+ };
1100
+
1101
+ $$$enumerator$$Enumerator.prototype._init = function() {
1102
+ this._result = new Array(this.length);
1103
+ };
1104
+
1105
+ var $$$enumerator$$default = $$$enumerator$$Enumerator;
1106
+
1107
+ $$$enumerator$$Enumerator.prototype._enumerate = function() {
1108
+ var length = this.length;
1109
+ var promise = this.promise;
1110
+ var input = this._input;
1111
+
1112
+ for (var i = 0; promise._state === $$$internal$$PENDING && i < length; i++) {
1113
+ this._eachEntry(input[i], i);
1114
+ }
1115
+ };
1116
+
1117
+ $$$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) {
1118
+ var c = this._instanceConstructor;
1119
+ if ($$utils$$isMaybeThenable(entry)) {
1120
+ if (entry.constructor === c && entry._state !== $$$internal$$PENDING) {
1121
+ entry._onerror = null;
1122
+ this._settledAt(entry._state, i, entry._result);
1123
+ } else {
1124
+ this._willSettleAt(c.resolve(entry), i);
1125
+ }
1126
+ } else {
1127
+ this._remaining--;
1128
+ this._result[i] = this._makeResult($$$internal$$FULFILLED, i, entry);
1129
+ }
1130
+ };
1131
+
1132
+ $$$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) {
1133
+ var promise = this.promise;
1134
+
1135
+ if (promise._state === $$$internal$$PENDING) {
1136
+ this._remaining--;
1137
+
1138
+ if (this._abortOnReject && state === $$$internal$$REJECTED) {
1139
+ $$$internal$$reject(promise, value);
1140
+ } else {
1141
+ this._result[i] = this._makeResult(state, i, value);
1142
+ }
1143
+ }
1144
+
1145
+ if (this._remaining === 0) {
1146
+ $$$internal$$fulfill(promise, this._result);
1147
+ }
1148
+ };
1149
+
1150
+ $$$enumerator$$Enumerator.prototype._makeResult = function(state, i, value) {
1151
+ return value;
1152
+ };
1153
+
1154
+ $$$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) {
1155
+ var enumerator = this;
1156
+
1157
+ $$$internal$$subscribe(promise, undefined, function(value) {
1158
+ enumerator._settledAt($$$internal$$FULFILLED, i, value);
1159
+ }, function(reason) {
1160
+ enumerator._settledAt($$$internal$$REJECTED, i, reason);
1161
+ });
1162
+ };
1163
+
1164
+ var $$promise$all$$default = function all(entries, label) {
1165
+ return new $$$enumerator$$default(this, entries, true /* abort on reject */, label).promise;
1166
+ };
1167
+
1168
+ var $$promise$race$$default = function race(entries, label) {
1169
+ /*jshint validthis:true */
1170
+ var Constructor = this;
1171
+
1172
+ var promise = new Constructor($$$internal$$noop, label);
1173
+
1174
+ if (!$$utils$$isArray(entries)) {
1175
+ $$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
1176
+ return promise;
1177
+ }
1178
+
1179
+ var length = entries.length;
1180
+
1181
+ function onFulfillment(value) {
1182
+ $$$internal$$resolve(promise, value);
1183
+ }
1184
+
1185
+ function onRejection(reason) {
1186
+ $$$internal$$reject(promise, reason);
1187
+ }
1188
+
1189
+ for (var i = 0; promise._state === $$$internal$$PENDING && i < length; i++) {
1190
+ $$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
1191
+ }
1192
+
1193
+ return promise;
1194
+ };
1195
+
1196
+ var $$promise$resolve$$default = function resolve(object, label) {
1197
+ /*jshint validthis:true */
1198
+ var Constructor = this;
1199
+
1200
+ if (object && typeof object === 'object' && object.constructor === Constructor) {
1201
+ return object;
1202
+ }
1203
+
1204
+ var promise = new Constructor($$$internal$$noop, label);
1205
+ $$$internal$$resolve(promise, object);
1206
+ return promise;
1207
+ };
1208
+
1209
+ var $$promise$reject$$default = function reject(reason, label) {
1210
+ /*jshint validthis:true */
1211
+ var Constructor = this;
1212
+ var promise = new Constructor($$$internal$$noop, label);
1213
+ $$$internal$$reject(promise, reason);
1214
+ return promise;
1215
+ };
1216
+
1217
+ var $$es6$promise$promise$$counter = 0;
1218
+
1219
+ function $$es6$promise$promise$$needsResolver() {
1220
+ throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
1221
+ }
1222
+
1223
+ function $$es6$promise$promise$$needsNew() {
1224
+ throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
1225
+ }
1226
+
1227
+ var $$es6$promise$promise$$default = $$es6$promise$promise$$Promise;
1228
+
1229
+ /**
1230
+ Promise objects represent the eventual result of an asynchronous operation. The
1231
+ primary way of interacting with a promise is through its `then` method, which
1232
+ registers callbacks to receive either a promise’s eventual value or the reason
1233
+ why the promise cannot be fulfilled.
1234
+
1235
+ Terminology
1236
+ -----------
1237
+
1238
+ - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
1239
+ - `thenable` is an object or function that defines a `then` method.
1240
+ - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
1241
+ - `exception` is a value that is thrown using the throw statement.
1242
+ - `reason` is a value that indicates why a promise was rejected.
1243
+ - `settled` the final resting state of a promise, fulfilled or rejected.
1244
+
1245
+ A promise can be in one of three states: pending, fulfilled, or rejected.
1246
+
1247
+ Promises that are fulfilled have a fulfillment value and are in the fulfilled
1248
+ state. Promises that are rejected have a rejection reason and are in the
1249
+ rejected state. A fulfillment value is never a thenable.
1250
+
1251
+ Promises can also be said to *resolve* a value. If this value is also a
1252
+ promise, then the original promise's settled state will match the value's
1253
+ settled state. So a promise that *resolves* a promise that rejects will
1254
+ itself reject, and a promise that *resolves* a promise that fulfills will
1255
+ itself fulfill.
1256
+
1257
+
1258
+ Basic Usage:
1259
+ ------------
1260
+
1261
+ ```js
1262
+ var promise = new Promise(function(resolve, reject) {
1263
+ // on success
1264
+ resolve(value);
1265
+
1266
+ // on failure
1267
+ reject(reason);
1268
+ });
1269
+
1270
+ promise.then(function(value) {
1271
+ // on fulfillment
1272
+ }, function(reason) {
1273
+ // on rejection
1274
+ });
1275
+ ```
1276
+
1277
+ Advanced Usage:
1278
+ ---------------
1279
+
1280
+ Promises shine when abstracting away asynchronous interactions such as
1281
+ `XMLHttpRequest`s.
1282
+
1283
+ ```js
1284
+ function getJSON(url) {
1285
+ return new Promise(function(resolve, reject){
1286
+ var xhr = new XMLHttpRequest();
1287
+
1288
+ xhr.open('GET', url);
1289
+ xhr.onreadystatechange = handler;
1290
+ xhr.responseType = 'json';
1291
+ xhr.setRequestHeader('Accept', 'application/json');
1292
+ xhr.send();
1293
+
1294
+ function handler() {
1295
+ if (this.readyState === this.DONE) {
1296
+ if (this.status === 200) {
1297
+ resolve(this.response);
1298
+ } else {
1299
+ reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
1300
+ }
1301
+ }
1302
+ };
1303
+ });
1304
+ }
1305
+
1306
+ getJSON('/posts.json').then(function(json) {
1307
+ // on fulfillment
1308
+ }, function(reason) {
1309
+ // on rejection
1310
+ });
1311
+ ```
1312
+
1313
+ Unlike callbacks, promises are great composable primitives.
1314
+
1315
+ ```js
1316
+ Promise.all([
1317
+ getJSON('/posts'),
1318
+ getJSON('/comments')
1319
+ ]).then(function(values){
1320
+ values[0] // => postsJSON
1321
+ values[1] // => commentsJSON
1322
+
1323
+ return values;
1324
+ });
1325
+ ```
1326
+
1327
+ @class Promise
1328
+ @param {function} resolver
1329
+ Useful for tooling.
1330
+ @constructor
1331
+ */
1332
+ function $$es6$promise$promise$$Promise(resolver) {
1333
+ this._id = $$es6$promise$promise$$counter++;
1334
+ this._state = undefined;
1335
+ this._result = undefined;
1336
+ this._subscribers = [];
1337
+
1338
+ if ($$$internal$$noop !== resolver) {
1339
+ if (!$$utils$$isFunction(resolver)) {
1340
+ $$es6$promise$promise$$needsResolver();
1341
+ }
1342
+
1343
+ if (!(this instanceof $$es6$promise$promise$$Promise)) {
1344
+ $$es6$promise$promise$$needsNew();
1345
+ }
1346
+
1347
+ $$$internal$$initializePromise(this, resolver);
1348
+ }
1349
+ }
1350
+
1351
+ $$es6$promise$promise$$Promise.all = $$promise$all$$default;
1352
+ $$es6$promise$promise$$Promise.race = $$promise$race$$default;
1353
+ $$es6$promise$promise$$Promise.resolve = $$promise$resolve$$default;
1354
+ $$es6$promise$promise$$Promise.reject = $$promise$reject$$default;
1355
+
1356
+ $$es6$promise$promise$$Promise.prototype = {
1357
+ constructor: $$es6$promise$promise$$Promise,
1358
+
1359
+ /**
1360
+ The primary way of interacting with a promise is through its `then` method,
1361
+ which registers callbacks to receive either a promise's eventual value or the
1362
+ reason why the promise cannot be fulfilled.
1363
+
1364
+ ```js
1365
+ findUser().then(function(user){
1366
+ // user is available
1367
+ }, function(reason){
1368
+ // user is unavailable, and you are given the reason why
1369
+ });
1370
+ ```
1371
+
1372
+ Chaining
1373
+ --------
1374
+
1375
+ The return value of `then` is itself a promise. This second, 'downstream'
1376
+ promise is resolved with the return value of the first promise's fulfillment
1377
+ or rejection handler, or rejected if the handler throws an exception.
1378
+
1379
+ ```js
1380
+ findUser().then(function (user) {
1381
+ return user.name;
1382
+ }, function (reason) {
1383
+ return 'default name';
1384
+ }).then(function (userName) {
1385
+ // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
1386
+ // will be `'default name'`
1387
+ });
1388
+
1389
+ findUser().then(function (user) {
1390
+ throw new Error('Found user, but still unhappy');
1391
+ }, function (reason) {
1392
+ throw new Error('`findUser` rejected and we're unhappy');
1393
+ }).then(function (value) {
1394
+ // never reached
1395
+ }, function (reason) {
1396
+ // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
1397
+ // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
1398
+ });
1399
+ ```
1400
+ If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
1401
+
1402
+ ```js
1403
+ findUser().then(function (user) {
1404
+ throw new PedagogicalException('Upstream error');
1405
+ }).then(function (value) {
1406
+ // never reached
1407
+ }).then(function (value) {
1408
+ // never reached
1409
+ }, function (reason) {
1410
+ // The `PedgagocialException` is propagated all the way down to here
1411
+ });
1412
+ ```
1413
+
1414
+ Assimilation
1415
+ ------------
1416
+
1417
+ Sometimes the value you want to propagate to a downstream promise can only be
1418
+ retrieved asynchronously. This can be achieved by returning a promise in the
1419
+ fulfillment or rejection handler. The downstream promise will then be pending
1420
+ until the returned promise is settled. This is called *assimilation*.
1421
+
1422
+ ```js
1423
+ findUser().then(function (user) {
1424
+ return findCommentsByAuthor(user);
1425
+ }).then(function (comments) {
1426
+ // The user's comments are now available
1427
+ });
1428
+ ```
1429
+
1430
+ If the assimliated promise rejects, then the downstream promise will also reject.
1431
+
1432
+ ```js
1433
+ findUser().then(function (user) {
1434
+ return findCommentsByAuthor(user);
1435
+ }).then(function (comments) {
1436
+ // If `findCommentsByAuthor` fulfills, we'll have the value here
1437
+ }, function (reason) {
1438
+ // If `findCommentsByAuthor` rejects, we'll have the reason here
1439
+ });
1440
+ ```
1441
+
1442
+ Simple Example
1443
+ --------------
1444
+
1445
+ Synchronous Example
1446
+
1447
+ ```javascript
1448
+ var result;
1449
+
1450
+ try {
1451
+ result = findResult();
1452
+ // success
1453
+ } catch(reason) {
1454
+ // failure
1455
+ }
1456
+ ```
1457
+
1458
+ Errback Example
1459
+
1460
+ ```js
1461
+ findResult(function(result, err){
1462
+ if (err) {
1463
+ // failure
1464
+ } else {
1465
+ // success
1466
+ }
1467
+ });
1468
+ ```
1469
+
1470
+ Promise Example;
1471
+
1472
+ ```javascript
1473
+ findResult().then(function(result){
1474
+ // success
1475
+ }, function(reason){
1476
+ // failure
1477
+ });
1478
+ ```
1479
+
1480
+ Advanced Example
1481
+ --------------
1482
+
1483
+ Synchronous Example
1484
+
1485
+ ```javascript
1486
+ var author, books;
1487
+
1488
+ try {
1489
+ author = findAuthor();
1490
+ books = findBooksByAuthor(author);
1491
+ // success
1492
+ } catch(reason) {
1493
+ // failure
1494
+ }
1495
+ ```
1496
+
1497
+ Errback Example
1498
+
1499
+ ```js
1500
+
1501
+ function foundBooks(books) {
1502
+
1503
+ }
1504
+
1505
+ function failure(reason) {
1506
+
1507
+ }
1508
+
1509
+ findAuthor(function(author, err){
1510
+ if (err) {
1511
+ failure(err);
1512
+ // failure
1513
+ } else {
1514
+ try {
1515
+ findBoooksByAuthor(author, function(books, err) {
1516
+ if (err) {
1517
+ failure(err);
1518
+ } else {
1519
+ try {
1520
+ foundBooks(books);
1521
+ } catch(reason) {
1522
+ failure(reason);
1523
+ }
1524
+ }
1525
+ });
1526
+ } catch(error) {
1527
+ failure(err);
1528
+ }
1529
+ // success
1530
+ }
1531
+ });
1532
+ ```
1533
+
1534
+ Promise Example;
1535
+
1536
+ ```javascript
1537
+ findAuthor().
1538
+ then(findBooksByAuthor).
1539
+ then(function(books){
1540
+ // found books
1541
+ }).catch(function(reason){
1542
+ // something went wrong
1543
+ });
1544
+ ```
1545
+
1546
+ @method then
1547
+ @param {Function} onFulfilled
1548
+ @param {Function} onRejected
1549
+ Useful for tooling.
1550
+ @return {Promise}
1551
+ */
1552
+ then: function(onFulfillment, onRejection) {
1553
+ var parent = this;
1554
+ var state = parent._state;
1555
+
1556
+ if (state === $$$internal$$FULFILLED && !onFulfillment || state === $$$internal$$REJECTED && !onRejection) {
1557
+ return this;
1558
+ }
1559
+
1560
+ var child = new this.constructor($$$internal$$noop);
1561
+ var result = parent._result;
1562
+
1563
+ if (state) {
1564
+ var callback = arguments[state - 1];
1565
+ $$asap$$default(function(){
1566
+ $$$internal$$invokeCallback(state, child, callback, result);
1567
+ });
1568
+ } else {
1569
+ $$$internal$$subscribe(parent, child, onFulfillment, onRejection);
1570
+ }
1571
+
1572
+ return child;
1573
+ },
1574
+
1575
+ /**
1576
+ `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
1577
+ as the catch block of a try/catch statement.
1578
+
1579
+ ```js
1580
+ function findAuthor(){
1581
+ throw new Error('couldn't find that author');
1582
+ }
1583
+
1584
+ // synchronous
1585
+ try {
1586
+ findAuthor();
1587
+ } catch(reason) {
1588
+ // something went wrong
1589
+ }
1590
+
1591
+ // async with promises
1592
+ findAuthor().catch(function(reason){
1593
+ // something went wrong
1594
+ });
1595
+ ```
1596
+
1597
+ @method catch
1598
+ @param {Function} onRejection
1599
+ Useful for tooling.
1600
+ @return {Promise}
1601
+ */
1602
+ 'catch': function(onRejection) {
1603
+ return this.then(null, onRejection);
1604
+ }
1605
+ };
1606
+
1607
+ var $$es6$promise$polyfill$$default = function polyfill() {
1608
+ var local;
1609
+
1610
+ if (typeof global !== 'undefined') {
1611
+ local = global;
1612
+ } else if (typeof window !== 'undefined' && window.document) {
1613
+ local = window;
1614
+ } else {
1615
+ local = self;
1616
+ }
1617
+
1618
+ var es6PromiseSupport =
1619
+ "Promise" in local &&
1620
+ // Some of these methods are missing from
1621
+ // Firefox/Chrome experimental implementations
1622
+ "resolve" in local.Promise &&
1623
+ "reject" in local.Promise &&
1624
+ "all" in local.Promise &&
1625
+ "race" in local.Promise &&
1626
+ // Older version of the spec had a resolver object
1627
+ // as the arg rather than a function
1628
+ (function() {
1629
+ var resolve;
1630
+ new local.Promise(function(r) { resolve = r; });
1631
+ return $$utils$$isFunction(resolve);
1632
+ }());
1633
+
1634
+ if (!es6PromiseSupport) {
1635
+ local.Promise = $$es6$promise$promise$$default;
1636
+ }
1637
+ };
1638
+
1639
+ var es6$promise$umd$$ES6Promise = {
1640
+ 'Promise': $$es6$promise$promise$$default,
1641
+ 'polyfill': $$es6$promise$polyfill$$default
1642
+ };
1643
+
1644
+ /* global define:true module:true window: true */
1645
+ if ("function" === 'function' && __webpack_require__(16)['amd']) {
1646
+ !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { return es6$promise$umd$$ES6Promise; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
1647
+ } else if (typeof module !== 'undefined' && module['exports']) {
1648
+ module['exports'] = es6$promise$umd$$ES6Promise;
1649
+ } else if (typeof this !== 'undefined') {
1650
+ this['ES6Promise'] = es6$promise$umd$$ES6Promise;
1651
+ }
1652
+ }).call(this);
1653
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10), (function() { return this; }()), __webpack_require__(17)(module)))
1654
+
1655
+ /***/ },
1656
+ /* 10 */
1657
+ /***/ function(module, exports, __webpack_require__) {
1658
+
1659
+ // shim for using process in browser
1660
+
1661
+ var process = module.exports = {};
1662
+
1663
+ process.nextTick = (function () {
1664
+ var canSetImmediate = typeof window !== 'undefined'
1665
+ && window.setImmediate;
1666
+ var canMutationObserver = typeof window !== 'undefined'
1667
+ && window.MutationObserver;
1668
+ var canPost = typeof window !== 'undefined'
1669
+ && window.postMessage && window.addEventListener
1670
+ ;
1671
+
1672
+ if (canSetImmediate) {
1673
+ return function (f) { return window.setImmediate(f) };
1674
+ }
1675
+
1676
+ var queue = [];
1677
+
1678
+ if (canMutationObserver) {
1679
+ var hiddenDiv = document.createElement("div");
1680
+ var observer = new MutationObserver(function () {
1681
+ var queueList = queue.slice();
1682
+ queue.length = 0;
1683
+ queueList.forEach(function (fn) {
1684
+ fn();
1685
+ });
1686
+ });
1687
+
1688
+ observer.observe(hiddenDiv, { attributes: true });
1689
+
1690
+ return function nextTick(fn) {
1691
+ if (!queue.length) {
1692
+ hiddenDiv.setAttribute('yes', 'no');
1693
+ }
1694
+ queue.push(fn);
1695
+ };
1696
+ }
1697
+
1698
+ if (canPost) {
1699
+ window.addEventListener('message', function (ev) {
1700
+ var source = ev.source;
1701
+ if ((source === window || source === null) && ev.data === 'process-tick') {
1702
+ ev.stopPropagation();
1703
+ if (queue.length > 0) {
1704
+ var fn = queue.shift();
1705
+ fn();
1706
+ }
1707
+ }
1708
+ }, true);
1709
+
1710
+ return function nextTick(fn) {
1711
+ queue.push(fn);
1712
+ window.postMessage('process-tick', '*');
1713
+ };
1714
+ }
1715
+
1716
+ return function nextTick(fn) {
1717
+ setTimeout(fn, 0);
1718
+ };
1719
+ })();
1720
+
1721
+ process.title = 'browser';
1722
+ process.browser = true;
1723
+ process.env = {};
1724
+ process.argv = [];
1725
+
1726
+ function noop() {}
1727
+
1728
+ process.on = noop;
1729
+ process.addListener = noop;
1730
+ process.once = noop;
1731
+ process.off = noop;
1732
+ process.removeListener = noop;
1733
+ process.removeAllListeners = noop;
1734
+ process.emit = noop;
1735
+
1736
+ process.binding = function (name) {
1737
+ throw new Error('process.binding is not supported');
1738
+ };
1739
+
1740
+ // TODO(shtylman)
1741
+ process.cwd = function () { return '/' };
1742
+ process.chdir = function (dir) {
1743
+ throw new Error('process.chdir is not supported');
1744
+ };
1745
+
1746
+
1747
+ /***/ },
1748
+ /* 11 */
1749
+ /***/ function(module, exports, __webpack_require__) {
1750
+
1751
+ 'use strict';
1752
+
1753
+ var utils = __webpack_require__(3);
1754
+
1755
+ function encode(val) {
1756
+ return encodeURIComponent(val).
1757
+ replace(/%40/gi, '@').
1758
+ replace(/%3A/gi, ':').
1759
+ replace(/%24/g, '$').
1760
+ replace(/%2C/gi, ',').
1761
+ replace(/%20/g, '+');
1762
+ }
1763
+
1764
+ /**
1765
+ * Build a URL by appending params to the end
1766
+ *
1767
+ * @param {string} url The base of the url (e.g., http://www.google.com)
1768
+ * @param {object} [params] The params to be appended
1769
+ * @returns {string} The formatted url
1770
+ */
1771
+ module.exports = function buildUrl(url, params) {
1772
+ if (!params) {
1773
+ return url;
1774
+ }
1775
+
1776
+ var parts = [];
1777
+
1778
+ utils.forEach(params, function (val, key) {
1779
+ if (val === null || typeof val === 'undefined') {
1780
+ return;
654
1781
  }
655
1782
  if (!utils.isArray(val)) {
656
1783
  val = [val];
@@ -674,13 +1801,14 @@ var axios =
674
1801
  return url;
675
1802
  };
676
1803
 
1804
+
677
1805
  /***/ },
678
- /* 9 */
1806
+ /* 12 */
679
1807
  /***/ function(module, exports, __webpack_require__) {
680
1808
 
681
1809
  'use strict';
682
1810
 
683
- var utils = __webpack_require__(4);
1811
+ var utils = __webpack_require__(3);
684
1812
 
685
1813
  module.exports = {
686
1814
  write: function write(name, value, expires, path, domain, secure) {
@@ -717,12 +1845,12 @@ var axios =
717
1845
  };
718
1846
 
719
1847
  /***/ },
720
- /* 10 */
1848
+ /* 13 */
721
1849
  /***/ function(module, exports, __webpack_require__) {
722
1850
 
723
1851
  'use strict';
724
1852
 
725
- var utils = __webpack_require__(4);
1853
+ var utils = __webpack_require__(3);
726
1854
 
727
1855
  /**
728
1856
  * Parse headers into an object
@@ -756,12 +1884,12 @@ var axios =
756
1884
  };
757
1885
 
758
1886
  /***/ },
759
- /* 11 */
1887
+ /* 14 */
760
1888
  /***/ function(module, exports, __webpack_require__) {
761
1889
 
762
1890
  'use strict';
763
1891
 
764
- var utils = __webpack_require__(4);
1892
+ var utils = __webpack_require__(3);
765
1893
 
766
1894
  /**
767
1895
  * Transform the data for a request or a response
@@ -780,13 +1908,13 @@ var axios =
780
1908
  };
781
1909
 
782
1910
  /***/ },
783
- /* 12 */
1911
+ /* 15 */
784
1912
  /***/ function(module, exports, __webpack_require__) {
785
1913
 
786
1914
  'use strict';
787
1915
 
788
1916
  var msie = /(msie|trident)/i.test(navigator.userAgent);
789
- var utils = __webpack_require__(4);
1917
+ var utils = __webpack_require__(3);
790
1918
  var urlParsingNode = document.createElement('a');
791
1919
  var originUrl = urlResolve(window.location.href);
792
1920
 
@@ -834,653 +1962,28 @@ var axios =
834
1962
  parsed.host === originUrl.host);
835
1963
  };
836
1964
 
837
- /***/ },
838
- /* 13 */
839
- /***/ function(module, exports, __webpack_require__) {
840
-
841
- "use strict";
842
- var Promise = __webpack_require__(14).Promise;
843
- var polyfill = __webpack_require__(15).polyfill;
844
- exports.Promise = Promise;
845
- exports.polyfill = polyfill;
846
-
847
- /***/ },
848
- /* 14 */
849
- /***/ function(module, exports, __webpack_require__) {
850
-
851
- "use strict";
852
- var config = __webpack_require__(16).config;
853
- var configure = __webpack_require__(16).configure;
854
- var objectOrFunction = __webpack_require__(17).objectOrFunction;
855
- var isFunction = __webpack_require__(17).isFunction;
856
- var now = __webpack_require__(17).now;
857
- var all = __webpack_require__(18).all;
858
- var race = __webpack_require__(19).race;
859
- var staticResolve = __webpack_require__(20).resolve;
860
- var staticReject = __webpack_require__(21).reject;
861
- var asap = __webpack_require__(22).asap;
862
-
863
- var counter = 0;
864
-
865
- config.async = asap; // default async is asap;
866
-
867
- function Promise(resolver) {
868
- if (!isFunction(resolver)) {
869
- throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
870
- }
871
-
872
- if (!(this instanceof Promise)) {
873
- throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
874
- }
875
-
876
- this._subscribers = [];
877
-
878
- invokeResolver(resolver, this);
879
- }
880
-
881
- function invokeResolver(resolver, promise) {
882
- function resolvePromise(value) {
883
- resolve(promise, value);
884
- }
885
-
886
- function rejectPromise(reason) {
887
- reject(promise, reason);
888
- }
889
-
890
- try {
891
- resolver(resolvePromise, rejectPromise);
892
- } catch(e) {
893
- rejectPromise(e);
894
- }
895
- }
896
-
897
- function invokeCallback(settled, promise, callback, detail) {
898
- var hasCallback = isFunction(callback),
899
- value, error, succeeded, failed;
900
-
901
- if (hasCallback) {
902
- try {
903
- value = callback(detail);
904
- succeeded = true;
905
- } catch(e) {
906
- failed = true;
907
- error = e;
908
- }
909
- } else {
910
- value = detail;
911
- succeeded = true;
912
- }
913
-
914
- if (handleThenable(promise, value)) {
915
- return;
916
- } else if (hasCallback && succeeded) {
917
- resolve(promise, value);
918
- } else if (failed) {
919
- reject(promise, error);
920
- } else if (settled === FULFILLED) {
921
- resolve(promise, value);
922
- } else if (settled === REJECTED) {
923
- reject(promise, value);
924
- }
925
- }
926
-
927
- var PENDING = void 0;
928
- var SEALED = 0;
929
- var FULFILLED = 1;
930
- var REJECTED = 2;
931
-
932
- function subscribe(parent, child, onFulfillment, onRejection) {
933
- var subscribers = parent._subscribers;
934
- var length = subscribers.length;
935
-
936
- subscribers[length] = child;
937
- subscribers[length + FULFILLED] = onFulfillment;
938
- subscribers[length + REJECTED] = onRejection;
939
- }
940
-
941
- function publish(promise, settled) {
942
- var child, callback, subscribers = promise._subscribers, detail = promise._detail;
943
-
944
- for (var i = 0; i < subscribers.length; i += 3) {
945
- child = subscribers[i];
946
- callback = subscribers[i + settled];
947
-
948
- invokeCallback(settled, child, callback, detail);
949
- }
950
-
951
- promise._subscribers = null;
952
- }
953
-
954
- Promise.prototype = {
955
- constructor: Promise,
956
-
957
- _state: undefined,
958
- _detail: undefined,
959
- _subscribers: undefined,
960
-
961
- then: function(onFulfillment, onRejection) {
962
- var promise = this;
963
-
964
- var thenPromise = new this.constructor(function() {});
965
-
966
- if (this._state) {
967
- var callbacks = arguments;
968
- config.async(function invokePromiseCallback() {
969
- invokeCallback(promise._state, thenPromise, callbacks[promise._state - 1], promise._detail);
970
- });
971
- } else {
972
- subscribe(this, thenPromise, onFulfillment, onRejection);
973
- }
974
-
975
- return thenPromise;
976
- },
977
-
978
- 'catch': function(onRejection) {
979
- return this.then(null, onRejection);
980
- }
981
- };
982
-
983
- Promise.all = all;
984
- Promise.race = race;
985
- Promise.resolve = staticResolve;
986
- Promise.reject = staticReject;
987
-
988
- function handleThenable(promise, value) {
989
- var then = null,
990
- resolved;
991
-
992
- try {
993
- if (promise === value) {
994
- throw new TypeError("A promises callback cannot return that same promise.");
995
- }
996
-
997
- if (objectOrFunction(value)) {
998
- then = value.then;
999
-
1000
- if (isFunction(then)) {
1001
- then.call(value, function(val) {
1002
- if (resolved) { return true; }
1003
- resolved = true;
1004
-
1005
- if (value !== val) {
1006
- resolve(promise, val);
1007
- } else {
1008
- fulfill(promise, val);
1009
- }
1010
- }, function(val) {
1011
- if (resolved) { return true; }
1012
- resolved = true;
1013
-
1014
- reject(promise, val);
1015
- });
1016
-
1017
- return true;
1018
- }
1019
- }
1020
- } catch (error) {
1021
- if (resolved) { return true; }
1022
- reject(promise, error);
1023
- return true;
1024
- }
1025
-
1026
- return false;
1027
- }
1028
-
1029
- function resolve(promise, value) {
1030
- if (promise === value) {
1031
- fulfill(promise, value);
1032
- } else if (!handleThenable(promise, value)) {
1033
- fulfill(promise, value);
1034
- }
1035
- }
1036
-
1037
- function fulfill(promise, value) {
1038
- if (promise._state !== PENDING) { return; }
1039
- promise._state = SEALED;
1040
- promise._detail = value;
1041
-
1042
- config.async(publishFulfillment, promise);
1043
- }
1044
-
1045
- function reject(promise, reason) {
1046
- if (promise._state !== PENDING) { return; }
1047
- promise._state = SEALED;
1048
- promise._detail = reason;
1049
-
1050
- config.async(publishRejection, promise);
1051
- }
1052
-
1053
- function publishFulfillment(promise) {
1054
- publish(promise, promise._state = FULFILLED);
1055
- }
1056
-
1057
- function publishRejection(promise) {
1058
- publish(promise, promise._state = REJECTED);
1059
- }
1060
-
1061
- exports.Promise = Promise;
1062
-
1063
- /***/ },
1064
- /* 15 */
1065
- /***/ function(module, exports, __webpack_require__) {
1066
-
1067
- /* WEBPACK VAR INJECTION */(function(global) {"use strict";
1068
- /*global self*/
1069
- var RSVPPromise = __webpack_require__(14).Promise;
1070
- var isFunction = __webpack_require__(17).isFunction;
1071
-
1072
- function polyfill() {
1073
- var local;
1074
-
1075
- if (typeof global !== 'undefined') {
1076
- local = global;
1077
- } else if (typeof window !== 'undefined' && window.document) {
1078
- local = window;
1079
- } else {
1080
- local = self;
1081
- }
1082
-
1083
- var es6PromiseSupport =
1084
- "Promise" in local &&
1085
- // Some of these methods are missing from
1086
- // Firefox/Chrome experimental implementations
1087
- "resolve" in local.Promise &&
1088
- "reject" in local.Promise &&
1089
- "all" in local.Promise &&
1090
- "race" in local.Promise &&
1091
- // Older version of the spec had a resolver object
1092
- // as the arg rather than a function
1093
- (function() {
1094
- var resolve;
1095
- new local.Promise(function(r) { resolve = r; });
1096
- return isFunction(resolve);
1097
- }());
1098
-
1099
- if (!es6PromiseSupport) {
1100
- local.Promise = RSVPPromise;
1101
- }
1102
- }
1103
-
1104
- exports.polyfill = polyfill;
1105
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1106
-
1107
1965
  /***/ },
1108
1966
  /* 16 */
1109
1967
  /***/ function(module, exports, __webpack_require__) {
1110
1968
 
1111
- "use strict";
1112
- var config = {
1113
- instrument: false
1114
- };
1115
-
1116
- function configure(name, value) {
1117
- if (arguments.length === 2) {
1118
- config[name] = value;
1119
- } else {
1120
- return config[name];
1121
- }
1122
- }
1969
+ module.exports = function() { throw new Error("define cannot be used indirect"); };
1123
1970
 
1124
- exports.config = config;
1125
- exports.configure = configure;
1126
1971
 
1127
1972
  /***/ },
1128
1973
  /* 17 */
1129
1974
  /***/ function(module, exports, __webpack_require__) {
1130
1975
 
1131
- "use strict";
1132
- function objectOrFunction(x) {
1133
- return isFunction(x) || (typeof x === "object" && x !== null);
1134
- }
1135
-
1136
- function isFunction(x) {
1137
- return typeof x === "function";
1138
- }
1139
-
1140
- function isArray(x) {
1141
- return Object.prototype.toString.call(x) === "[object Array]";
1142
- }
1143
-
1144
- // Date.now is not available in browsers < IE9
1145
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility
1146
- var now = Date.now || function() { return new Date().getTime(); };
1147
-
1148
-
1149
- exports.objectOrFunction = objectOrFunction;
1150
- exports.isFunction = isFunction;
1151
- exports.isArray = isArray;
1152
- exports.now = now;
1153
-
1154
- /***/ },
1155
- /* 18 */
1156
- /***/ function(module, exports, __webpack_require__) {
1157
-
1158
- "use strict";
1159
- /* global toString */
1160
-
1161
- var isArray = __webpack_require__(17).isArray;
1162
- var isFunction = __webpack_require__(17).isFunction;
1163
-
1164
- /**
1165
- Returns a promise that is fulfilled when all the given promises have been
1166
- fulfilled, or rejected if any of them become rejected. The return promise
1167
- is fulfilled with an array that gives all the values in the order they were
1168
- passed in the `promises` array argument.
1169
-
1170
- Example:
1171
-
1172
- ```javascript
1173
- var promise1 = RSVP.resolve(1);
1174
- var promise2 = RSVP.resolve(2);
1175
- var promise3 = RSVP.resolve(3);
1176
- var promises = [ promise1, promise2, promise3 ];
1177
-
1178
- RSVP.all(promises).then(function(array){
1179
- // The array here would be [ 1, 2, 3 ];
1180
- });
1181
- ```
1182
-
1183
- If any of the `promises` given to `RSVP.all` are rejected, the first promise
1184
- that is rejected will be given as an argument to the returned promises's
1185
- rejection handler. For example:
1186
-
1187
- Example:
1188
-
1189
- ```javascript
1190
- var promise1 = RSVP.resolve(1);
1191
- var promise2 = RSVP.reject(new Error("2"));
1192
- var promise3 = RSVP.reject(new Error("3"));
1193
- var promises = [ promise1, promise2, promise3 ];
1194
-
1195
- RSVP.all(promises).then(function(array){
1196
- // Code here never runs because there are rejected promises!
1197
- }, function(error) {
1198
- // error.message === "2"
1199
- });
1200
- ```
1201
-
1202
- @method all
1203
- @for RSVP
1204
- @param {Array} promises
1205
- @param {String} label
1206
- @return {Promise} promise that is fulfilled when all `promises` have been
1207
- fulfilled, or rejected if any of them become rejected.
1208
- */
1209
- function all(promises) {
1210
- /*jshint validthis:true */
1211
- var Promise = this;
1212
-
1213
- if (!isArray(promises)) {
1214
- throw new TypeError('You must pass an array to all.');
1215
- }
1216
-
1217
- return new Promise(function(resolve, reject) {
1218
- var results = [], remaining = promises.length,
1219
- promise;
1220
-
1221
- if (remaining === 0) {
1222
- resolve([]);
1223
- }
1224
-
1225
- function resolver(index) {
1226
- return function(value) {
1227
- resolveAll(index, value);
1228
- };
1229
- }
1230
-
1231
- function resolveAll(index, value) {
1232
- results[index] = value;
1233
- if (--remaining === 0) {
1234
- resolve(results);
1235
- }
1236
- }
1237
-
1238
- for (var i = 0; i < promises.length; i++) {
1239
- promise = promises[i];
1240
-
1241
- if (promise && isFunction(promise.then)) {
1242
- promise.then(resolver(i), reject);
1243
- } else {
1244
- resolveAll(i, promise);
1245
- }
1246
- }
1247
- });
1248
- }
1249
-
1250
- exports.all = all;
1251
-
1252
- /***/ },
1253
- /* 19 */
1254
- /***/ function(module, exports, __webpack_require__) {
1255
-
1256
- "use strict";
1257
- /* global toString */
1258
- var isArray = __webpack_require__(17).isArray;
1259
-
1260
- /**
1261
- `RSVP.race` allows you to watch a series of promises and act as soon as the
1262
- first promise given to the `promises` argument fulfills or rejects.
1263
-
1264
- Example:
1265
-
1266
- ```javascript
1267
- var promise1 = new RSVP.Promise(function(resolve, reject){
1268
- setTimeout(function(){
1269
- resolve("promise 1");
1270
- }, 200);
1271
- });
1272
-
1273
- var promise2 = new RSVP.Promise(function(resolve, reject){
1274
- setTimeout(function(){
1275
- resolve("promise 2");
1276
- }, 100);
1277
- });
1278
-
1279
- RSVP.race([promise1, promise2]).then(function(result){
1280
- // result === "promise 2" because it was resolved before promise1
1281
- // was resolved.
1282
- });
1283
- ```
1284
-
1285
- `RSVP.race` is deterministic in that only the state of the first completed
1286
- promise matters. For example, even if other promises given to the `promises`
1287
- array argument are resolved, but the first completed promise has become
1288
- rejected before the other promises became fulfilled, the returned promise
1289
- will become rejected:
1290
-
1291
- ```javascript
1292
- var promise1 = new RSVP.Promise(function(resolve, reject){
1293
- setTimeout(function(){
1294
- resolve("promise 1");
1295
- }, 200);
1296
- });
1297
-
1298
- var promise2 = new RSVP.Promise(function(resolve, reject){
1299
- setTimeout(function(){
1300
- reject(new Error("promise 2"));
1301
- }, 100);
1302
- });
1303
-
1304
- RSVP.race([promise1, promise2]).then(function(result){
1305
- // Code here never runs because there are rejected promises!
1306
- }, function(reason){
1307
- // reason.message === "promise2" because promise 2 became rejected before
1308
- // promise 1 became fulfilled
1309
- });
1310
- ```
1311
-
1312
- @method race
1313
- @for RSVP
1314
- @param {Array} promises array of promises to observe
1315
- @param {String} label optional string for describing the promise returned.
1316
- Useful for tooling.
1317
- @return {Promise} a promise that becomes fulfilled with the value the first
1318
- completed promises is resolved with if the first completed promise was
1319
- fulfilled, or rejected with the reason that the first completed promise
1320
- was rejected with.
1321
- */
1322
- function race(promises) {
1323
- /*jshint validthis:true */
1324
- var Promise = this;
1325
-
1326
- if (!isArray(promises)) {
1327
- throw new TypeError('You must pass an array to race.');
1328
- }
1329
- return new Promise(function(resolve, reject) {
1330
- var results = [], promise;
1331
-
1332
- for (var i = 0; i < promises.length; i++) {
1333
- promise = promises[i];
1334
-
1335
- if (promise && typeof promise.then === 'function') {
1336
- promise.then(resolve, reject);
1337
- } else {
1338
- resolve(promise);
1339
- }
1340
- }
1341
- });
1342
- }
1343
-
1344
- exports.race = race;
1345
-
1346
- /***/ },
1347
- /* 20 */
1348
- /***/ function(module, exports, __webpack_require__) {
1349
-
1350
- "use strict";
1351
- function resolve(value) {
1352
- /*jshint validthis:true */
1353
- if (value && typeof value === 'object' && value.constructor === this) {
1354
- return value;
1355
- }
1356
-
1357
- var Promise = this;
1358
-
1359
- return new Promise(function(resolve) {
1360
- resolve(value);
1361
- });
1362
- }
1363
-
1364
- exports.resolve = resolve;
1365
-
1366
- /***/ },
1367
- /* 21 */
1368
- /***/ function(module, exports, __webpack_require__) {
1369
-
1370
- "use strict";
1371
- /**
1372
- `RSVP.reject` returns a promise that will become rejected with the passed
1373
- `reason`. `RSVP.reject` is essentially shorthand for the following:
1374
-
1375
- ```javascript
1376
- var promise = new RSVP.Promise(function(resolve, reject){
1377
- reject(new Error('WHOOPS'));
1378
- });
1379
-
1380
- promise.then(function(value){
1381
- // Code here doesn't run because the promise is rejected!
1382
- }, function(reason){
1383
- // reason.message === 'WHOOPS'
1384
- });
1385
- ```
1386
-
1387
- Instead of writing the above, your code now simply becomes the following:
1388
-
1389
- ```javascript
1390
- var promise = RSVP.reject(new Error('WHOOPS'));
1391
-
1392
- promise.then(function(value){
1393
- // Code here doesn't run because the promise is rejected!
1394
- }, function(reason){
1395
- // reason.message === 'WHOOPS'
1396
- });
1397
- ```
1398
-
1399
- @method reject
1400
- @for RSVP
1401
- @param {Any} reason value that the returned promise will be rejected with.
1402
- @param {String} label optional string for identifying the returned promise.
1403
- Useful for tooling.
1404
- @return {Promise} a promise that will become rejected with the given
1405
- `reason`.
1406
- */
1407
- function reject(reason) {
1408
- /*jshint validthis:true */
1409
- var Promise = this;
1410
-
1411
- return new Promise(function (resolve, reject) {
1412
- reject(reason);
1413
- });
1414
- }
1415
-
1416
- exports.reject = reject;
1417
-
1418
- /***/ },
1419
- /* 22 */
1420
- /***/ function(module, exports, __webpack_require__) {
1421
-
1422
- /* WEBPACK VAR INJECTION */(function(global, process) {"use strict";
1423
- var browserGlobal = (typeof window !== 'undefined') ? window : {};
1424
- var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
1425
- var local = (typeof global !== 'undefined') ? global : (this === undefined? window:this);
1426
-
1427
- // node
1428
- function useNextTick() {
1429
- return function() {
1430
- process.nextTick(flush);
1431
- };
1432
- }
1433
-
1434
- function useMutationObserver() {
1435
- var iterations = 0;
1436
- var observer = new BrowserMutationObserver(flush);
1437
- var node = document.createTextNode('');
1438
- observer.observe(node, { characterData: true });
1439
-
1440
- return function() {
1441
- node.data = (iterations = ++iterations % 2);
1442
- };
1443
- }
1444
-
1445
- function useSetTimeout() {
1446
- return function() {
1447
- local.setTimeout(flush, 1);
1448
- };
1449
- }
1450
-
1451
- var queue = [];
1452
- function flush() {
1453
- for (var i = 0; i < queue.length; i++) {
1454
- var tuple = queue[i];
1455
- var callback = tuple[0], arg = tuple[1];
1456
- callback(arg);
1457
- }
1458
- queue = [];
1459
- }
1460
-
1461
- var scheduleFlush;
1462
-
1463
- // Decide what async method to use to triggering processing of queued callbacks:
1464
- if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
1465
- scheduleFlush = useNextTick();
1466
- } else if (BrowserMutationObserver) {
1467
- scheduleFlush = useMutationObserver();
1468
- } else {
1469
- scheduleFlush = useSetTimeout();
1470
- }
1471
-
1472
- function asap(callback, arg) {
1473
- var length = queue.push([callback, arg]);
1474
- if (length === 1) {
1475
- // If length is 1, that means that we need to schedule an async flush.
1476
- // If additional callbacks are queued before the queue is flushed, they
1477
- // will be processed by this flush that we are scheduling.
1478
- scheduleFlush();
1976
+ module.exports = function(module) {
1977
+ if(!module.webpackPolyfill) {
1978
+ module.deprecate = function() {};
1979
+ module.paths = [];
1980
+ // module.parent = undefined by default
1981
+ module.children = [];
1982
+ module.webpackPolyfill = 1;
1479
1983
  }
1984
+ return module;
1480
1985
  }
1481
1986
 
1482
- exports.asap = asap;
1483
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(7)))
1484
1987
 
1485
1988
  /***/ }
1486
1989
  /******/ ])