browsed 0.2.8 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +28 -28
  3. data/browsed.gemspec +3 -4
  4. data/lib/browsed.rb +1 -1
  5. data/lib/browsed/browser.rb +2 -2
  6. data/lib/browsed/chrome.rb +2 -2
  7. data/lib/browsed/client.rb +4 -3
  8. data/lib/browsed/firefox.rb +2 -2
  9. data/lib/browsed/version.rb +1 -1
  10. metadata +13 -166
  11. data/lib/browsed/proxies/proxy-chain-server/node_modules/.bin/portastic +0 -1
  12. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/LICENSE +0 -21
  13. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/README.md +0 -57
  14. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/changelog.md +0 -1
  15. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.core.js +0 -3824
  16. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.core.min.js +0 -31
  17. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.js +0 -5666
  18. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.min.js +0 -31
  19. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/any.js +0 -21
  20. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/assert.js +0 -55
  21. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/async.js +0 -165
  22. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/bind.js +0 -67
  23. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/bluebird.js +0 -11
  24. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/call_get.js +0 -123
  25. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/cancel.js +0 -129
  26. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/catch_filter.js +0 -42
  27. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/context.js +0 -69
  28. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/debuggability.js +0 -934
  29. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/direct_resolve.js +0 -46
  30. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/each.js +0 -30
  31. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/errors.js +0 -116
  32. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/es5.js +0 -80
  33. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/filter.js +0 -12
  34. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/finally.js +0 -146
  35. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/generators.js +0 -223
  36. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/join.js +0 -168
  37. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/map.js +0 -168
  38. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/method.js +0 -55
  39. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/nodeback.js +0 -51
  40. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/nodeify.js +0 -58
  41. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/promise.js +0 -789
  42. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/promise_array.js +0 -185
  43. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/promisify.js +0 -314
  44. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/props.js +0 -118
  45. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/queue.js +0 -73
  46. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/race.js +0 -49
  47. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/reduce.js +0 -172
  48. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/schedule.js +0 -62
  49. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/settle.js +0 -43
  50. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/some.js +0 -148
  51. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/synchronous_inspection.js +0 -103
  52. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/thenables.js +0 -86
  53. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/timers.js +0 -93
  54. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/using.js +0 -226
  55. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/util.js +0 -389
  56. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/package.json +0 -102
  57. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/CHANGELOG.md +0 -408
  58. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/LICENSE +0 -22
  59. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/Readme.md +0 -428
  60. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/index.js +0 -1224
  61. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/package.json +0 -70
  62. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/typings/index.d.ts +0 -310
  63. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/.coveralls.yml +0 -1
  64. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/.eslintrc +0 -11
  65. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/.npmignore +0 -9
  66. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/.travis.yml +0 -14
  67. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/CHANGELOG.md +0 -362
  68. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/LICENSE +0 -19
  69. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/Makefile +0 -50
  70. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/README.md +0 -312
  71. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/component.json +0 -19
  72. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/karma.conf.js +0 -70
  73. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/node.js +0 -1
  74. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/package.json +0 -88
  75. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/browser.js +0 -185
  76. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/debug.js +0 -202
  77. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/index.js +0 -10
  78. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/inspector-log.js +0 -15
  79. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/node.js +0 -248
  80. data/lib/browsed/proxies/proxy-chain-server/node_modules/ms/index.js +0 -152
  81. data/lib/browsed/proxies/proxy-chain-server/node_modules/ms/license.md +0 -21
  82. data/lib/browsed/proxies/proxy-chain-server/node_modules/ms/package.json +0 -69
  83. data/lib/browsed/proxies/proxy-chain-server/node_modules/ms/readme.md +0 -51
  84. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/LICENSE +0 -13
  85. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/README.md +0 -148
  86. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/bin/portastic +0 -65
  87. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/history.md +0 -7
  88. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/index.js +0 -4
  89. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/lib/monitor.js +0 -59
  90. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/lib/portastic.js +0 -167
  91. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/LICENSE +0 -21
  92. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/README.md +0 -677
  93. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/changelog.md +0 -1730
  94. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/browser/bluebird.js +0 -4892
  95. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/browser/bluebird.min.js +0 -31
  96. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/any.js +0 -21
  97. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/assert.js +0 -55
  98. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/async.js +0 -150
  99. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/bind.js +0 -72
  100. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/bluebird.js +0 -11
  101. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/call_get.js +0 -123
  102. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/cancel.js +0 -48
  103. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/captured_trace.js +0 -493
  104. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/catch_filter.js +0 -66
  105. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/context.js +0 -38
  106. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/debuggability.js +0 -162
  107. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/direct_resolve.js +0 -63
  108. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/each.js +0 -12
  109. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/errors.js +0 -111
  110. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/es5.js +0 -80
  111. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/filter.js +0 -12
  112. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/finally.js +0 -98
  113. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/generators.js +0 -136
  114. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/join.js +0 -107
  115. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/map.js +0 -133
  116. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/method.js +0 -44
  117. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/nodeify.js +0 -59
  118. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/progress.js +0 -76
  119. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promise.js +0 -759
  120. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promise_array.js +0 -142
  121. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promise_resolver.js +0 -123
  122. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promisify.js +0 -307
  123. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/props.js +0 -79
  124. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/queue.js +0 -90
  125. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/race.js +0 -47
  126. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/reduce.js +0 -148
  127. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/schedule.js +0 -35
  128. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/settle.js +0 -40
  129. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/some.js +0 -125
  130. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/synchronous_inspection.js +0 -94
  131. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/thenables.js +0 -84
  132. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/timers.js +0 -64
  133. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/using.js +0 -213
  134. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/util.js +0 -321
  135. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/package.json +0 -103
  136. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/package.json +0 -69
  137. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/CHANGELOG.md +0 -109
  138. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/LICENSE +0 -201
  139. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/README.md +0 -278
  140. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/anonymize_proxy.js +0 -100
  141. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_base.js +0 -319
  142. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_custom_response.js +0 -96
  143. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_forward.js +0 -173
  144. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_tunnel_chain.js +0 -132
  145. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_tunnel_direct.js +0 -89
  146. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_tunnel_tcp_chain.js +0 -271
  147. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/index.js +0 -26
  148. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/run_locally.js +0 -66
  149. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/server.js +0 -595
  150. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/tcp_tunnel.js +0 -138
  151. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/testing_tcp_service.js +0 -37
  152. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/tools.js +0 -220
  153. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/package.json +0 -104
  154. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/LICENSE +0 -23
  155. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/README.md +0 -28
  156. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/package.json +0 -81
  157. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/underscore-min.js +0 -5
  158. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/underscore-min.js.map +0 -1
  159. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/underscore.js +0 -1692
  160. data/lib/browsed/proxies/proxy-chain-server/package-lock.json +0 -63
  161. data/lib/browsed/proxies/proxy-chain-server/package.json +0 -15
  162. data/lib/browsed/proxies/proxy-chain-server/server.js +0 -25
  163. data/lib/browsed/proxies/proxy_chain.rb +0 -39
@@ -1,31 +0,0 @@
1
- /* @preserve
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2013-2015 Petka Antonov
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
23
- *
24
- */
25
- /**
26
- * bluebird build version 2.11.0
27
- * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers
28
- */
29
- !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,r;return function n(t,e,r){function i(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,n,t,e,r)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,r){"use strict";e.exports=function(t){function e(t){var e=new r(t),n=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),n}var r=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},{}],2:[function(t,e,r){"use strict";function n(){this._isTickUsed=!1,this._lateQueue=new l(16),this._normalQueue=new l(16),this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=c.isStatic?c(this.drainQueues):c}function i(t,e,r){this._lateQueue.push(t,e,r),this._queueTick()}function o(t,e,r){this._normalQueue.push(t,e,r),this._queueTick()}function s(t){this._normalQueue._pushOne(t),this._queueTick()}var a;try{throw new Error}catch(u){a=u}var c=t("./schedule.js"),l=t("./queue.js"),h=t("./util.js");n.prototype.disableTrampolineIfNecessary=function(){h.hasDevTools&&(this._trampolineEnabled=!1)},n.prototype.enableTrampoline=function(){this._trampolineEnabled||(this._trampolineEnabled=!0,this._schedule=function(t){setTimeout(t,0)})},n.prototype.haveItemsQueued=function(){return this._normalQueue.length()>0},n.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(r){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},h.hasDevTools?(c.isStatic&&(c=function(t){setTimeout(t,0)}),n.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?i.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},n.prototype.invoke=function(t,e,r){this._trampolineEnabled?o.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},n.prototype.settlePromises=function(t){this._trampolineEnabled?s.call(this,t):this._schedule(function(){t._settlePromises()})}):(n.prototype.invokeLater=i,n.prototype.invoke=o,n.prototype.settlePromises=s),n.prototype.invokeFirst=function(t,e,r){this._normalQueue.unshift(t,e,r),this._queueTick()},n.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},n.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},n.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},n.prototype._reset=function(){this._isTickUsed=!1},e.exports=new n,e.exports.firstLineError=a},{"./queue.js":28,"./schedule.js":31,"./util.js":38}],3:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=function(t,e){this._reject(e)},i=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(n,n,null,this,t)},o=function(t,e){this._isPending()&&this._resolveCallback(e.target)},s=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(n){var a=r(n),u=new t(e);u._propagateFrom(this,1);var c=this._target();if(u._setBoundTo(a),a instanceof t){var l={promiseRejectionQueued:!1,promise:u,target:c,bindingPromise:a};c._then(e,i,u._progress,u,l),a._then(o,s,u._progress,u,l)}else u._resolveCallback(c);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=131072|this._bitField,this._boundTo=t):this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.bind=function(n,i){var o=r(n),s=new t(e);return s._setBoundTo(o),o instanceof t?o._then(function(){s._resolveCallback(i)},s._reject,s._progress,s,null):s._resolveCallback(i),s}}},{}],4:[function(t,e,r){"use strict";function n(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise.js")();o.noConflict=n,e.exports=o},{"./promise.js":23}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util.js"),u=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;e>i;++i)r[i-1]=arguments[i];return r.push(t),this._then(n,void 0,void 0,r,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util.js":38}],6:[function(t,e,r){"use strict";e.exports=function(e){var r=t("./errors.js"),n=t("./async.js"),i=r.CancellationError;e.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},e.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},e.prototype.cancellable=function(){return this._cancellable()?this:(n.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},e.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},e.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},{"./async.js":2,"./errors.js":13}],7:[function(t,e,r){"use strict";e.exports=function(){function e(t){this._parent=t;var r=this._length=1+(void 0===t?0:t._length);j(this,e),r>32&&this.uncycle()}function r(t,e){for(var r=0;r<e.length-1;++r)e[r].push("From previous event:"),e[r]=e[r].join("\n");return r<e.length&&(e[r]=e[r].join("\n")),t+"\n"+e.join("\n")}function n(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function i(t){for(var e=t[0],r=1;r<t.length;++r){for(var n=t[r],i=e.length-1,o=e[i],s=-1,a=n.length-1;a>=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function o(t){for(var e=[],r=0;r<t.length;++r){var n=t[r],i=_.test(n)||" (No stack trace)"===n,o=i&&y(n);i&&!o&&(v&&" "!==n.charAt(0)&&(n=" "+n),e.push(n))}return e}function s(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r<e.length;++r){var n=e[r];if(" (No stack trace)"===n||_.test(n))break}return r>0&&(e=e.slice(r)),e}function a(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+u(e)+">, no stack trace)"}function u(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function c(t){var e=t.match(g);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}var l,h=t("./async.js"),p=t("./util.js"),f=/[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/,_=null,d=null,v=!1;p.inherits(e,Error),e.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},e.prototype.parent=function(){return this._parent},e.prototype.hasParent=function(){return void 0!==this._parent},e.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var s=e.parseStackAndMessage(t),a=s.message,u=[s.stack],c=this;void 0!==c;)u.push(o(c.stack.split("\n"))),c=c._parent;i(u),n(u),p.notEnumerableProp(t,"stack",r(a,u)),p.notEnumerableProp(t,"__stackCleaned__",!0)}},e.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?s(t):[" (No stack trace)"],{message:r,stack:o(e)}},e.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+d(n,t)}else r=e+String(t);"function"==typeof l?l(r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}},e.unhandledRejection=function(t){e.formatAndLogError(t,"^--- With additional stack trace: ")},e.isSupported=function(){return"function"==typeof j},e.fireRejectionEvent=function(t,r,n,i){var o=!1;try{"function"==typeof r&&(o=!0,"rejectionHandled"===t?r(i):r(n,i))}catch(s){h.throwLater(s)}var a=!1;try{a=b(t,n,i)}catch(s){a=!0,h.throwLater(s)}var u=!1;if(m)try{u=m(t.toLowerCase(),{reason:n,promise:i})}catch(s){u=!0,h.throwLater(s)}a||o||u||"unhandledRejection"!==t||e.formatAndLogError(n,"Unhandled rejection ")};var y=function(){return!1},g=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;e.setBounds=function(t,r){if(e.isSupported()){for(var n,i,o=t.stack.split("\n"),s=r.stack.split("\n"),a=-1,u=-1,l=0;l<o.length;++l){var h=c(o[l]);if(h){n=h.fileName,a=h.line;break}}for(var l=0;l<s.length;++l){var h=c(s[l]);if(h){i=h.fileName,u=h.line;break}}0>a||0>u||!n||!i||n!==i||a>=u||(y=function(t){if(f.test(t))return!0;var e=c(t);return e&&e.fileName===n&&a<=e.line&&e.line<=u?!0:!1})}};var m,j=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():a(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,_=t,d=e;var r=Error.captureStackTrace;return y=function(t){return f.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return _=/@/,d=e,v=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i||"number"!=typeof Error.stackTraceLimit?(d=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?a(e):e.toString()},null):(_=t,d=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),b=function(){if(p.isNode)return function(t,e,r){return"rejectionHandled"===t?process.emit(t,r):process.emit(t,e,r)};var t=!1,e=!0;try{var r=new self.CustomEvent("test");t=r instanceof CustomEvent}catch(n){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(n){e=!1}e&&(m=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),n?!self.dispatchEvent(n):!1});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=o[t],i=self[n];return i?("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(l=function(t){console.warn(t)},p.isNode&&process.stderr.isTTY?l=function(t){process.stderr.write(""+t+"\n")}:p.isNode||"string"!=typeof(new Error).stack||(l=function(t){console.warn("%c"+t,"color: red")})),e}},{"./async.js":2,"./util.js":38}],8:[function(t,e,r){"use strict";e.exports=function(e){function r(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=t("./util.js"),o=t("./errors.js"),s=i.tryCatch,a=i.errorObj,u=t("./es5.js").keys,c=o.TypeError;return r.prototype.doFilter=function(t){for(var r=this._callback,i=this._promise,o=i._boundValue(),u=0,c=this._instances.length;c>u;++u){var l=this._instances[u],h=l===Error||null!=l&&l.prototype instanceof Error;if(h&&t instanceof l){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}if("function"==typeof l&&!h){var f=n(l,t);if(f===a){t=a.e;break}if(f){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}}}return e.e=t,e},r}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(t,e,r){"use strict";e.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){return r()?new n:void 0}function o(){var t=s.length-1;return t>=0?s[t]:void 0}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},{}],10:[function(t,e,r){"use strict";e.exports=function(e,r){var n,i,o=e._getDomain,s=t("./async.js"),a=t("./errors.js").Warning,u=t("./util.js"),c=u.canAttachTrace,l=u.isNode&&(!!process.env.BLUEBIRD_DEBUG||"development"===process.env.NODE_ENV);return u.isNode&&0==process.env.BLUEBIRD_DEBUG&&(l=!1),l&&s.disableTrampolineIfNecessary(),e.prototype._ignoreRejections=function(){this._unsetRejectionIsUnhandled(),this._bitField=16777216|this._bitField},e.prototype._ensurePossibleRejectionHandled=function(){0===(16777216&this._bitField)&&(this._setRejectionIsUnhandled(),s.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){r.fireRejectionEvent("rejectionHandled",n,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),r.fireRejectionEvent("unhandledRejection",i,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},e.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},e.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},e.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},e.prototype._captureStackTrace=function(){return l&&(this._trace=new r(this._peekContext())),this},e.prototype._attachExtraTrace=function(t,e){if(l&&c(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=r.parseStackAndMessage(t);u.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),u.notEnumerableProp(t,"__stackCleaned__",!0)}}},e.prototype._warn=function(t){var e=new a(t),n=this._peekContext();if(n)n.attachExtraTrace(e);else{var i=r.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}r.formatAndLogError(e,"")},e.onPossiblyUnhandledRejection=function(t){var e=o();i="function"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=o();n="function"==typeof t?null===e?t:e.bind(t):void 0},e.longStackTraces=function(){if(s.haveItemsQueued()&&l===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");l=r.isSupported(),l&&s.disableTrampolineIfNecessary()},e.hasLongStackTraces=function(){return l&&r.isSupported()},r.isSupported()||(e.longStackTraces=function(){},l=!1),function(){return l}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(t,e,r){"use strict";var n=t("./util.js"),i=n.isPrimitive;e.exports=function(t){var e=function(){return this},r=function(){throw this},n=function(){},o=function(){throw void 0},s=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(r){return void 0===r?this.then(n):i(r)?this._then(s(r,2),void 0,void 0,void 0,void 0):(r instanceof t&&r._ignoreRejections(),this._then(e,void 0,void 0,r,void 0))},t.prototype["throw"]=t.prototype.thenThrow=function(t){return void 0===t?this.then(o):i(t)?this._then(s(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},{"./util.js":38}],12:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},{}],13:[function(t,e,r){"use strict";function n(t,e){function r(n){return this instanceof r?(h(this,"message","string"==typeof n?n:e),h(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return l(r,Error),r}function i(t){return this instanceof i?(h(this,"name","OperationalError"),h(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(h(this,"message",t.message),h(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5.js"),u=a.freeze,c=t("./util.js"),l=c.inherits,h=c.notEnumerableProp,p=n("Warning","warning"),f=n("CancellationError","cancellation error"),_=n("TimeoutError","timeout error"),d=n("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(v){o=n("TypeError","type error"),s=n("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g<y.length;++g)"function"==typeof Array.prototype[y[g]]&&(d.prototype[y[g]]=Array.prototype[y[g]]);a.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var m=0;d.prototype.toString=function(){var t=Array(4*m+1).join(" "),e="\n"+t+"AggregateError of:\n";m++,t=Array(4*m+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",i=n.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];n=i.join("\n"),e+=n+"\n"}return m--,e},l(i,Error);var j=Error.__BluebirdErrorTypes__;j||(j=u({CancellationError:f,TimeoutError:_,OperationalError:i,RejectionError:i,AggregateError:d}),h(Error,"__BluebirdErrorTypes__",j)),e.exports={Error:Error,TypeError:o,RangeError:s,CancellationError:j.CancellationError,OperationalError:j.OperationalError,TimeoutError:j.TimeoutError,AggregateError:j.AggregateError,Warning:p}},{"./es5.js":14,"./util.js":38}],14:[function(t,e,r){var n=function(){"use strict";return void 0===this}();if(n)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:n,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!(r&&!r.writable&&!r.set)}};else{var i={}.hasOwnProperty,o={}.toString,s={}.constructor.prototype,a=function(t){var e=[];for(var r in t)i.call(t,r)&&e.push(r);return e},u=function(t,e){return{value:t[e]}},c=function(t,e,r){return t[e]=r.value,t},l=function(t){return t},h=function(t){try{return Object(t).constructor.prototype}catch(e){return s}},p=function(t){try{return"[object Array]"===o.call(t)}catch(e){return!1}};e.exports={isArray:p,keys:a,names:a,defineProperty:c,getDescriptor:u,freeze:l,getPrototypeOf:h,isES5:n,propertyIsWritable:function(){return!0}}}},{}],15:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,i){return r(t,n,i,e)}}},{}],16:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(){return this}function o(){throw this}function s(t){return function(){return t}}function a(t){return function(){throw t}}function u(t,e,r){var n;return n=p(e)?r?s(e):a(e):r?i:o,t._then(n,f,void 0,e,void 0)}function c(t){var i=this.promise,o=this.handler,s=i._isBound()?o.call(i._boundValue()):o();if(void 0!==s){var a=n(s,i);if(a instanceof e)return a=a._target(),u(a,t,i.isFulfilled())}return i.isRejected()?(r.e=t,r):t}function l(t){var r=this.promise,i=this.handler,o=r._isBound()?i.call(r._boundValue(),t):i(t);if(void 0!==o){var s=n(o,r);if(s instanceof e)return s=s._target(),u(s,t,!0)}return t}var h=t("./util.js"),p=h.isPrimitive,f=h.thrower;e.prototype._passThroughHandler=function(t,e){if("function"!=typeof t)return this.then();var r={promise:this,handler:t};return this._then(e?c:l,e?c:void 0,void 0,r,void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThroughHandler(t,!0)},e.prototype.tap=function(t){return this._passThroughHandler(t,!1)}}},{"./util.js":38}],17:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){function o(t,r,n){for(var o=0;o<r.length;++o){n._pushContext();var s=h(r[o])(t);if(n._popContext(),s===l){n._pushContext();var a=e.reject(l.e);return n._popContext(),a}var u=i(s,n);if(u instanceof e)return u}return null}function s(t,r,i,o){var s=this._promise=new e(n);s._captureStackTrace(),this._stack=o,this._generatorFunction=t,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(p):p}var a=t("./errors.js"),u=a.TypeError,c=t("./util.js"),l=c.errorObj,h=c.tryCatch,p=[];s.prototype.promise=function(){return this._promise},s.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._next(void 0)},s.prototype._continue=function(t){if(t===l)return this._promise._rejectCallback(t.e,!1,!0);var r=t.value;if(t.done===!0)this._promise._resolveCallback(r);else{var n=i(r,this._promise);if(!(n instanceof e)&&(n=o(n,this._yieldHandlers,this._promise),null===n))return void this._throw(new u("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/4Y4pDk\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));n._then(this._next,this._throw,void 0,this,null)}},s.prototype._throw=function(t){this._promise._attachExtraTrace(t),this._promise._pushContext();var e=h(this._generator["throw"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},s.prototype._next=function(t){this._promise._pushContext();var e=h(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},e.coroutine=function(t,e){if("function"!=typeof t)throw new u("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var r=Object(e).yieldHandler,n=s,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new n(void 0,void 0,r,i);return o._generator=e,o._next(void 0),o.promise()}},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new u("fn must be a function\n\n See http://goo.gl/916lJJ\n");p.push(t)},e.spawn=function(t){if("function"!=typeof t)return r("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var n=new s(t,this),i=n.promise();return n._run(e.spawn),i}}},{"./errors.js":13,"./util.js":38}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js");o.canEvaluate,o.tryCatch,o.errorObj;e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var n}for(var i=arguments.length,o=new Array(i),s=0;i>s;++s)o[s]=arguments[s];t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util.js":38}],19:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=c();this._callback=null===i?e:i.bind(e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:d,l.invoke(a,this,void 0)}function a(){this._init$(void 0,-2)}function u(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var c=e._getDomain,l=t("./async.js"),h=t("./util.js"),p=h.tryCatch,f=h.errorObj,_={},d=[];h.inherits(s,r),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===_){if(n[r]=t,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=t,void this._queue.push(r);null!==s&&(s[r]=t);var u=this._callback,c=this._promise._boundValue();this._promise._pushContext();var l=p(u).call(c,t,r,o);if(this._promise._popContext(),l===f)return this._reject(l.e);var h=i(l,this._promise);if(h instanceof e){if(h=h._target(),h._isPending())return a>=1&&this._inFlight++,n[r]=_,h._proxyPromiseArray(this,r);if(!h._isFulfilled())return this._reject(h._reason());l=h._value()}n[r]=l}var d=++this._totalResolved;d>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var n=t.pop();this._promiseFulfilled(r[n],n)}},s.prototype._filter=function(t,e){for(var r=e.length,n=new Array(r),i=0,o=0;r>o;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(this,t,e,null).promise()},e.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(t,e,r,i).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js"),s=o.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=s(t).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t,n,a){if("function"!=typeof t)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new e(r);u._captureStackTrace(),u._pushContext();var c=o.isArray(n)?s(t).apply(a,n):s(t).call(a,n);return u._popContext(),u._resolveFromSyncValue(c),u},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},{"./util.js":38}],21:[function(t,e,r){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundValue(),[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundValue(),i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundValue(),t);o===u&&s.throwLater(o.e)}var o=t("./util.js"),s=t("./async.js"),a=o.tryCatch,u=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(t,e,r){"use strict";e.exports=function(e,r){var n=t("./util.js"),i=t("./async.js"),o=n.tryCatch,s=n.errorObj;e.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},e.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},e.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},e.prototype._doProgressWith=function(t){var r=t.value,i=t.handler,a=t.promise,u=t.receiver,c=o(i).call(u,r);if(c===s){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof e?c._then(a._progress,null,null,a,void 0):a._progress(c)},e.prototype._progressUnchecked=function(t){for(var n=this._length(),o=this._progress,s=0;n>s;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof e)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:t}):i.invoke(o,u,t);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,t,u):c instanceof r&&!c._isResolved()&&c._promiseProgressed(t,u)}}}}},{"./async.js":2,"./util.js":38}],23:[function(t,e,r){"use strict";e.exports=function(){function r(t){if("function"!=typeof t)throw new p("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==r)throw new p("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==f&&this._resolveFromResolver(t)}function n(t){var e=new r(f);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._progressHandler0=t,e._promise0=t,e._receiver0=t,e._settledValue=t}var i,o=function(){return new p("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},s=function(){return new r.PromiseInspection(this._target())},a=function(t){return r.reject(new p(t))},u=t("./util.js");i=u.isNode?function(){var t=process.domain;return void 0===t&&(t=null),t}:function(){return null},u.notEnumerableProp(r,"_getDomain",i);var c={},l=t("./async.js"),h=t("./errors.js"),p=r.TypeError=h.TypeError;r.RangeError=h.RangeError,r.CancellationError=h.CancellationError,r.TimeoutError=h.TimeoutError,r.OperationalError=h.OperationalError,r.RejectionError=h.OperationalError,r.AggregateError=h.AggregateError;var f=function(){},_={},d={e:null},v=t("./thenables.js")(r,f),y=t("./promise_array.js")(r,f,v,a),g=t("./captured_trace.js")(),m=t("./debuggability.js")(r,g),j=t("./context.js")(r,g,m),b=t("./catch_filter.js")(d),w=t("./promise_resolver.js"),k=w._nodebackForPromise,E=u.errorObj,F=u.tryCatch;return r.prototype.toString=function(){return"[object Promise]"},r.prototype.caught=r.prototype["catch"]=function(t){var e=arguments.length;if(e>1){var n,i=new Array(e-1),o=0;for(n=0;e-1>n;++n){var s=arguments[n];if("function"!=typeof s)return r.reject(new p("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[n];var a=new b(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},r.prototype.reflect=function(){return this._then(s,s,void 0,this,void 0)},r.prototype.then=function(t,e,r){if(m()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+u.classString(t);arguments.length>1&&(n+=", "+u.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0);
30
- },r.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},r.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,_,void 0)},r.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},r.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},r.prototype.all=function(){return new y(this).promise()},r.prototype.error=function(t){return this.caught(u.originatesFromRejection,t)},r.getNewLibraryCopy=e.exports,r.is=function(t){return t instanceof r},r.fromNode=function(t){var e=new r(f),n=F(t)(k(e));return n===E&&e._rejectCallback(n.e,!0,!0),e},r.all=function(t){return new y(t).promise()},r.defer=r.pending=function(){var t=new r(f);return new w(t)},r.cast=function(t){var e=v(t);if(!(e instanceof r)){var n=e;e=new r(f),e._fulfillUnchecked(n)}return e},r.resolve=r.fulfilled=r.cast,r.reject=r.rejected=function(t){var e=new r(f);return e._captureStackTrace(),e._rejectCallback(t,!0),e},r.setScheduler=function(t){if("function"!=typeof t)throw new p("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=l._schedule;return l._schedule=t,e},r.prototype._then=function(t,e,n,o,s){var a=void 0!==s,u=a?s:new r(f);a||(u._propagateFrom(this,5),u._captureStackTrace());var c=this._target();c!==this&&(void 0===o&&(o=this._boundTo),a||u._setIsMigrated());var h=c._addCallbacks(t,e,n,u,o,i());return c._isResolved()&&!c._isSettlePromisesQueued()&&l.invoke(c._settlePromiseAtPostResolution,c,h),u},r.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},r.prototype._length=function(){return 131071&this._bitField},r.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},r.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},r.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},r.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},r.prototype._setRejected=function(){this._bitField=134217728|this._bitField},r.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},r.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},r.prototype._isFinal=function(){return(33554432&this._bitField)>0},r.prototype._cancellable=function(){return(67108864&this._bitField)>0},r.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},r.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},r.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},r.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},r.prototype._isMigrated=function(){return(4194304&this._bitField)>0},r.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return e===c?void 0:void 0===e&&this._isBound()?this._boundValue():e},r.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},r.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},r.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},r.prototype._boundValue=function(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t},r.prototype._migrateCallbacks=function(t,e){var n=t._fulfillmentHandlerAt(e),i=t._rejectionHandlerAt(e),o=t._progressHandlerAt(e),s=t._promiseAt(e),a=t._receiverAt(e);s instanceof r&&s._setIsMigrated(),void 0===a&&(a=c),this._addCallbacks(n,i,o,s,a,null)},r.prototype._addCallbacks=function(t,e,r,n,i,o){var s=this._length();if(s>=131066&&(s=0,this._setLength(0)),0===s)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=null===o?t:o.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===o?e:o.bind(e)),"function"==typeof r&&(this._progressHandler0=null===o?r:o.bind(r));else{var a=5*s-5;this[a+3]=n,this[a+4]=i,"function"==typeof t&&(this[a+0]=null===o?t:o.bind(t)),"function"==typeof e&&(this[a+1]=null===o?e:o.bind(e)),"function"==typeof r&&(this[a+2]=null===o?r:o.bind(r))}return this._setLength(s+1),s},r.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},r.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},r.prototype._resolveCallback=function(t,e){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(o(),!1,!0);var n=v(t,this);if(!(n instanceof r))return this._fulfill(t);var i=1|(e?4:0);this._propagateFrom(n,i);var s=n._target();if(s._isPending()){for(var a=this._length(),u=0;a>u;++u)s._migrateCallbacks(this,u);this._setFollowing(),this._setLength(0),this._setFollowee(s)}else s._isFulfilled()?this._fulfillUnchecked(s._value()):this._rejectUnchecked(s._reason(),s._getCarriedStackTrace())}},r.prototype._rejectCallback=function(t,e,r){r||u.markAsOriginatingFromRejection(t);var n=u.ensureErrorObject(t),i=n===t;this._attachExtraTrace(n,e?i:!1),this._reject(t,i?void 0:n)},r.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=F(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===E&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},r.prototype._settlePromiseFromHandler=function(t,e,r,n){if(!n._isRejected()){n._pushContext();var i;if(i=e!==_||this._isRejected()?F(t).call(e,r):F(t).apply(this._boundValue(),r),n._popContext(),i===E||i===n||i===d){var s=i===n?o():i.e;n._rejectCallback(s,!1,!0)}else n._resolveCallback(i)}},r.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},r.prototype._followee=function(){return this._rejectionHandler0},r.prototype._setFollowee=function(t){this._rejectionHandler0=t},r.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},r.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},r.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},r.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},r.prototype._settlePromiseAt=function(t){var e=this._promiseAt(t),n=e instanceof r;if(n&&e._isMigrated())return e._unsetIsMigrated(),l.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,a=this._receiverAt(t);this._clearCallbackDataAtIndex(t),"function"==typeof i?n?this._settlePromiseFromHandler(i,a,s,e):i.call(a,s,e):a instanceof y?a._isResolved()||(this._isFulfilled()?a._promiseFulfilled(s,e):a._promiseRejected(s,e)):n&&(this._isFulfilled()?e._fulfill(s):e._reject(s,o)),t>=4&&4===(31&t)&&l.invokeLater(this._setLength,this,0)},r.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},r.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},r.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},r.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},r.prototype._queueSettlePromises=function(){l.settlePromises(this),this._setSettlePromisesQueued()},r.prototype._fulfillUnchecked=function(t){if(t===this){var e=o();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},r.prototype._rejectUncheckedCheckError=function(t){var e=u.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},r.prototype._rejectUnchecked=function(t,e){if(t===this){var r=o();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void l.throwLater(function(t){throw"stack"in t&&l.invokeFirst(g.unhandledRejection,void 0,t),t},void 0===e?t:e):(void 0!==e&&e!==t&&this._setCarriedStackTrace(e),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},r.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},u.notEnumerableProp(r,"_makeSelfResolutionError",o),t("./progress.js")(r,y),t("./method.js")(r,f,v,a),t("./bind.js")(r,f,v),t("./finally.js")(r,d,v),t("./direct_resolve.js")(r),t("./synchronous_inspection.js")(r),t("./join.js")(r,y,v,f),r.version="2.11.0",r.Promise=r,t("./map.js")(r,y,a,v,f),t("./cancel.js")(r),t("./using.js")(r,a,v,j),t("./generators.js")(r,a,f,v),t("./nodeify.js")(r),t("./call_get.js")(r),t("./props.js")(r,y,v,a),t("./race.js")(r,f,v,a),t("./reduce.js")(r,y,a,v,f),t("./settle.js")(r,y),t("./some.js")(r,y,a),t("./promisify.js")(r,f),t("./any.js")(r),t("./each.js")(r,f),t("./timers.js")(r,f),t("./filter.js")(r,f),u.toFastProperties(r),u.toFastProperties(r.prototype),n({a:1}),n({b:2}),n({c:3}),n(1),n(function(){}),n(void 0),n(!1),n(new r(f)),g.setBounds(l.firstLineError,u.lastLineError),r}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){function o(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n,i=this._promise=new e(r);t instanceof e&&(n=t,i._propagateFrom(n,5)),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var a=t("./util.js"),u=a.isArray;return s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(t,r){var s=n(this._values,this._promise);if(s instanceof e){if(s=s._target(),this._values=s,!s._isFulfilled())return s._isPending()?void s._then(c,this._reject,void 0,this,r):void this._reject(s._reason());if(s=s._value(),!u(s)){var a=new e.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(a)}}else if(!u(s))return void this._promise._reject(i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===s.length)return void(-5===r?this._resolveEmptyArray():this._resolve(o(r)));var l=this.getActualLength(s.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var h=this._promise,p=0;l>p;++p){var f=this._isResolved(),_=n(s[p],h);_ instanceof e?(_=_._target(),f?_._ignoreRejections():_._isPending()?_._proxyPromiseArray(this,p):_._isFulfilled()?this._promiseFulfilled(_._value(),p):this._promiseRejected(_._reason(),p)):f||this._promiseFulfilled(_,p)}},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype.__hardReject__=s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},s.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},s.prototype._promiseRejected=function(t,e){this._totalResolved++,this._reject(t)},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},{"./util.js":38}],25:[function(t,e,r){"use strict";function n(t){return t instanceof Error&&f.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(n(t)){e=new h(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var r=f.keys(t),i=0;i<r.length;++i){var o=r[i];_.test(o)||(e[o]=t[o])}return e}return a.markAsOriginatingFromRejection(t),t}function o(t){return function(e,r){if(null!==t){if(e){var n=i(u(e));t._attachExtraTrace(n),t._reject(n)}else if(arguments.length>2){for(var o=arguments.length,s=new Array(o-1),a=1;o>a;++a)s[a-1]=arguments[a];t._fulfill(s)}else t._fulfill(r);t=null}}}var s,a=t("./util.js"),u=a.maybeWrapAsError,c=t("./errors.js"),l=c.TimeoutError,h=c.OperationalError,p=a.haveGetters,f=t("./es5.js"),_=/^(?:name|message|stack|cause)$/;if(s=p?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=o(t),this.callback=this.asCallback},p){var d={get:function(){return o(this.promise)}};f.defineProperty(s.prototype,"asCallback",d),f.defineProperty(s.prototype,"callback",d)}s._nodebackForPromise=o,s.prototype.toString=function(){return"[object PromiseResolver]"},s.prototype.resolve=s.prototype.fulfill=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},s.prototype.reject=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},s.prototype.progress=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},s.prototype.cancel=function(t){this.promise.cancel(t)},s.prototype.timeout=function(){this.reject(new l("timeout"))},s.prototype.isResolved=function(){return this.promise.isResolved()},s.prototype.toJSON=function(){return this.promise.toJSON()},e.exports=s},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t){return!w.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=f.getDataPropertyOrDefault(t,e+r,j);return n?i(n):!1}function s(t,e,r){for(var n=0;n<t.length;n+=2){var i=t[n];if(r.test(i))for(var o=i.replace(r,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new g("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/iWrZbw\n".replace("%s",e))}}function a(t,e,r,n){for(var a=f.inheritedDataKeys(t),u=[],c=0;c<a.length;++c){var l=a[c],h=t[l],p=n===k?!0:k(l,h,t);"function"!=typeof h||i(h)||o(t,l,e)||!n(l,h,t,p)||u.push(l,h)}return s(u,e,r),u}function u(t,n,i,o){function s(){var i=n;n===p&&(i=this);var o=new e(r);o._captureStackTrace();var s="string"==typeof u&&this!==a?this[u]:t,c=_(o);try{s.apply(i,d(arguments,c))}catch(l){o._rejectCallback(v(l),!0,!0)}return o}var a=function(){return this}(),u=t;return"string"==typeof u&&(t=o),f.notEnumerableProp(s,"__isPromisified__",!0),s}function c(t,e,r,n){for(var i=new RegExp(E(e)+"$"),o=a(t,e,i,r),s=0,u=o.length;u>s;s+=2){var c=o[s],l=o[s+1],h=c+e;if(n===F)t[h]=F(c,p,c,l,e);else{var _=n(l,function(){return F(c,p,c,l,e)});f.notEnumerableProp(_,"__isPromisified__",!0),t[h]=_}}return f.toFastProperties(t),t}function l(t,e){return F(t,e,void 0,t)}var h,p={},f=t("./util.js"),_=t("./promise_resolver.js")._nodebackForPromise,d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",j={__isPromisified__:!0},b=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],w=new RegExp("^(?:"+b.join("|")+")$"),k=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},E=function(t){return t.replace(/([$])/,"\\$")},F=y?h:u;e.promisify=function(t,e){if("function"!=typeof t)throw new g("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(i(t))return t;var r=l(t,arguments.length<2?p:e);return f.copyDescriptors(t,r,n),r},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=m);var n=e.filter;"function"!=typeof n&&(n=k);var i=e.promisifier;if("function"!=typeof i&&(i=F),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var o=f.inheritedDataKeys(t),s=0;s<o.length;++s){var a=t[o[s]];"constructor"!==o[s]&&f.isClass(a)&&(c(a.prototype,r,n,i),c(a,r,n,i))}return c(t,r,n,i)}}},{"./errors":13,"./promise_resolver.js":25,"./util.js":38}],27:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){function o(t){for(var e=c.keys(t),r=e.length,n=new Array(2*r),i=0;r>i;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function s(t){var r,s=n(t);return u(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,4),r):i("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var a=t("./util.js"),u=a.isObject,c=t("./es5.js");a.inherits(o,r),o.prototype._init=function(){this._init$(void 0,-3)},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}},o.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5.js":14,"./util.js":38}],28:[function(t,e,r){"use strict";function n(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacity<t},i.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var r=this._front+e&this._capacity-1;this[r]=t,this._length=e+1},i.prototype._unshiftOne=function(t){var e=this._capacity;this._checkCapacity(this.length()+1);var r=this._front,n=(r-1&e-1^e)-e;this[n]=t,this._front=n,this._length=this.length()+1},i.prototype.unshift=function(t,e,r){this._unshiftOne(r),this._unshiftOne(e),this._unshiftOne(t)},i.prototype.push=function(t,e,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(t),this._pushOne(e),void this._pushOne(r);var i=this._front+n-3;this._checkCapacity(n);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=r,this._length=n},i.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},i.prototype.length=function(){return this._length},i.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},i.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var r=this._front,i=this._length,o=r+i&e-1;n(this,0,this,e,o)},e.exports=i},{}],29:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){function o(t,o){var u=n(t);if(u instanceof e)return a(u);if(!s(t))return i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");var c=new e(r);void 0!==o&&c._propagateFrom(o,5);for(var l=c._fulfill,h=c._reject,p=0,f=t.length;f>p;++p){var _=t[p];(void 0!==_||p in t)&&e.cast(_)._then(l,h,void 0,c,null)}return c}var s=t("./util.js").isArray,a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util.js":38}],30:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){function s(t,r,n,s){this.constructor$(t),this._promise._captureStackTrace(),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var u=i(n,this._promise),h=!1,p=u instanceof e;p&&(u=u._target(),u._isPending()?u._proxyPromiseArray(this,-1):u._isFulfilled()?(n=u._value(),this._gotAccum=!0):(this._reject(u._reason()),h=!0)),p||this._zerothIsAccum||(this._gotAccum=!0);var f=c();this._callback=null===f?r:f.bind(r),this._accum=n,h||l.invoke(a,this,void 0)}function a(){this._init$(void 0,-5)}function u(t,e,r,i){if("function"!=typeof e)return n("fn must be a function\n\n See http://goo.gl/916lJJ\n");var o=new s(t,e,r,i);return o.promise()}var c=e._getDomain,l=t("./async.js"),h=t("./util.js"),p=h.tryCatch,f=h.errorObj;h.inherits(s,r),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(t,r){var n=this._values;n[r]=t;var o,s=this.length(),a=this._preservedValues,u=null!==a,c=this._gotAccum,l=this._valuesPhase;if(!l)for(l=this._valuesPhase=new Array(s),o=0;s>o;++o)l[o]=0;if(o=l[r],0===r&&this._zerothIsAccum?(this._accum=t,this._gotAccum=c=!0,l[r]=0===o?1:2):-1===r?(this._accum=t,this._gotAccum=c=!0):0===o?l[r]=1:(l[r]=2,this._accum=t),c){for(var h,_=this._callback,d=this._promise._boundValue(),v=this._reducingIndex;s>v;++v)if(o=l[v],2!==o){if(1!==o)return;if(t=n[v],this._promise._pushContext(),u?(a.push(t),h=p(_).call(d,t,v,s)):h=p(_).call(d,this._accum,t,v,s),this._promise._popContext(),h===f)return this._reject(h.e);var y=i(h,this._promise);if(y instanceof e){if(y=y._target(),y._isPending())return l[v]=4,y._proxyPromiseArray(this,v);if(!y._isFulfilled())return this._reject(y._reason());h=y._value()}this._reducingIndex=v+1,this._accum=h}else this._reducingIndex=v+1;this._resolve(u?a:this._accum)}},e.prototype.reduce=function(t,e){return u(this,t,e,null)},e.reduce=function(t,e,r,n){return u(t,e,r,n)}}},{"./async.js":2,"./util.js":38}],31:[function(t,e,r){"use strict";var n,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};if(i.isNode&&"undefined"==typeof MutationObserver){var s=global.setImmediate,a=process.nextTick;n=i.isRecentNode?function(t){s.call(global,t)}:function(t){a.call(process,t)}}else"undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&window.navigator.standalone?n="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:(n=function(t){var e=document.createElement("div"),r=new MutationObserver(t);return r.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},n.isStatic=!0);e.exports=n},{"./util":38}],32:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t){this.constructor$(t)}var i=e.PromiseInspection,o=t("./util.js");o.inherits(n,r),n.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},n.prototype._promiseRejected=function(t,e){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},e.settle=function(t){return new n(t).promise()},e.prototype.settle=function(){return new n(this).promise()}}},{"./util.js":38}],33:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util.js"),a=t("./errors.js").RangeError,u=t("./errors.js").AggregateError,c=s.isArray;s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values))},i.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new u,r=this.length();r<this._values.length;++r)e.push(this._values[r]);this._reject(e)}},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors.js":13,"./util.js":38}],34:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValue=t._settledValue):(this._bitField=0,this._settledValue=void 0)}e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return this._settledValue},e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return this._settledValue},e.prototype.isFulfilled=t.prototype._isFulfilled=function(){return(268435456&this._bitField)>0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0===(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e}},{}],35:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t,n){if(c(t)){if(t instanceof e)return t;if(o(t)){var l=new e(r);return t._then(l._fulfillUnchecked,l._rejectUncheckedCheckError,l._progressUnchecked,l,null),l}var h=a.tryCatch(i)(t);if(h===u){n&&n._pushContext();var l=e.reject(h.e);return n&&n._popContext(),l}if("function"==typeof h)return s(t,h,n)}return t}function i(t){return t.then}function o(t){return l.call(t,"_promise0")}function s(t,n,i){function o(t){l&&(l._resolveCallback(t),l=null)}function s(t){l&&(l._rejectCallback(t,p,!0),l=null)}function c(t){l&&"function"==typeof l._progress&&l._progress(t)}var l=new e(r),h=l;i&&i._pushContext(),l._captureStackTrace(),i&&i._popContext();var p=!0,f=a.tryCatch(n).call(t,o,s,c);return p=!1,l&&f===u&&(l._rejectCallback(f.e,!0,!0),l=null),h}var a=t("./util.js"),u=a.errorObj,c=a.isObject,l={}.hasOwnProperty;return n}},{"./util.js":38}],36:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util.js"),s=e.TimeoutError,a=function(t,e){if(t.isPending()){var r;!o.isPrimitive(e)&&e instanceof Error?r=e:("string"!=typeof e&&(e="operation timed out"),r=new s(e)),o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._cancel(r)}},u=function(t){return c(+this).thenReturn(t)},c=e.delay=function(t,n){if(void 0===n){n=t,t=void 0;var i=new e(r);return setTimeout(function(){i._fulfill()},n),i}return n=+n,e.resolve(t)._then(u,null,null,n,void 0)};e.prototype.delay=function(t){return c(this,t)},e.prototype.timeout=function(t,e){t=+t;var r=this.then().cancellable();r._cancellationParent=this;var o=setTimeout(function(){a(r,e)},t);return r._then(n,i,void 0,o,void 0)}}},{"./util.js":38}],37:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){function o(t){for(var r=t.length,n=0;r>n;++n){var i=t[n];if(i.isRejected())return e.reject(i.error());t[n]=i._settledValue}return t}function s(t){setTimeout(function(){throw t},0)}function a(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,r){function i(){if(o>=u)return c.resolve();var l=a(t[o++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(h){return s(h)}if(l instanceof e)return l._then(i,s,null,null,null)}i()}var o=0,u=t.length,c=e.defer();return i(),c.promise}function c(t){var e=new v;return e._settledValue=t,e._bitField=268435456,u(this,e).thenReturn(t)}function l(t){var e=new v;return e._settledValue=t,e._bitField=134217728,u(this,e).thenThrow(t)}function h(t,e,r){this._data=t,this._promise=e,this._context=r}function p(t,e,r){this.constructor$(t,e,r)}function f(t){return h.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}var _=t("./errors.js").TypeError,d=t("./util.js").inherits,v=e.PromiseInspection;h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},h.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=null!==e?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},h.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},d(p,h),p.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");var s,a=!0;2===t&&Array.isArray(arguments[0])?(s=arguments[0],
31
- t=s.length,a=!1):(s=arguments,t--);for(var u=new Array(t),p=0;t>p;++p){var _=s[p];if(h.isDisposer(_)){var d=_;_=_.promise(),_._setDisposable(d)}else{var v=n(_);v instanceof e&&(_=v._then(f,null,null,{resources:u,index:p},void 0))}u[p]=_}var y=e.settle(u).then(o).then(function(t){y._pushContext();var e;try{e=a?i.apply(void 0,t):i.call(void 0,t)}finally{y._popContext()}return e})._then(c,l,void 0,u,void 0);return u.promise=y,y},e.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(262144&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new _}}},{"./errors.js":13,"./util.js":38}],38:[function(t,e,r){"use strict";function n(){try{var t=C;return C=null,t.apply(this,arguments)}catch(e){return F.e=e,F}}function i(t){return C=t,n}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return!o(t)}function a(t){return o(t)?new Error(v(t)):t}function u(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function c(t,e,r){if(!w.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function l(t,e,r){if(o(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return w.defineProperty(t,e,n),t}function h(t){throw t}function p(t){try{if("function"==typeof t){var e=w.names(t.prototype),r=w.isES5&&e.length>1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=x.test(t+"")&&w.names(t).length>0;if(r||n||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function _(t){return R.test(t)}function d(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){try{l(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function m(t){return t instanceof Error&&w.propertyIsWritable(t,"stack")}function j(t){return{}.toString.call(t)}function b(t,e,r){for(var n=w.names(t),i=0;i<n.length;++i){var o=n[i];if(r(o))try{w.defineProperty(e,o,w.getDescriptor(t,o))}catch(s){}}}var w=t("./es5.js"),k="undefined"==typeof navigator,E=function(){try{var t={};return w.defineProperty(t,"f",{get:function(){return 3}}),3===t.f}catch(e){return!1}}(),F={e:{}},C,P=function(t,e){function r(){this.constructor=t,this.constructor$=e;for(var r in e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}var n={}.hasOwnProperty;return r.prototype=e.prototype,t.prototype=new r,t.prototype},T=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1};if(w.isES5){var r=Object.getOwnPropertyNames;return function(t){for(var n=[],i=Object.create(null);null!=t&&!e(t);){var o;try{o=r(t)}catch(s){return n}for(var a=0;a<o.length;++a){var u=o[a];if(!i[u]){i[u]=!0;var c=Object.getOwnPropertyDescriptor(t,u);null!=c&&null==c.get&&null==c.set&&n.push(u)}}t=w.getPrototypeOf(t)}return n}}var n={}.hasOwnProperty;return function(r){if(e(r))return[];var i=[];t:for(var o in r)if(n.call(r,o))i.push(o);else{for(var s=0;s<t.length;++s)if(n.call(t[s],o))continue t;i.push(o)}return i}}(),x=/this\s*\.\s*\S+\s*=/,R=/^[a-z$_][a-z$_0-9]*$/i,S=function(){return"stack"in new Error?function(t){return m(t)?t:new Error(v(t))}:function(t){if(m(t))return t;try{throw new Error(v(t))}catch(e){return e}}}(),A={isClass:p,isIdentifier:_,inheritedDataKeys:T,getDataPropertyOrDefault:c,thrower:h,isArray:w.isArray,haveGetters:E,notEnumerableProp:l,isPrimitive:o,isObject:s,canEvaluate:k,errorObj:F,tryCatch:i,inherits:P,withAppended:u,maybeWrapAsError:a,toFastProperties:f,filledRange:d,toString:v,canAttachTrace:m,ensureErrorObject:S,originatesFromRejection:g,markAsOriginatingFromRejection:y,classString:j,copyDescriptors:b,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:"undefined"!=typeof process&&"[object process]"===j(process).toLowerCase()};A.isRecentNode=A.isNode&&function(){var t=process.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}(),A.isNode&&A.toFastProperties(process);try{throw new Error}catch(O){A.lastLineError=O}e.exports=A},{"./es5.js":14}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise);
@@ -1,21 +0,0 @@
1
- "use strict";
2
- module.exports = function(Promise) {
3
- var SomePromiseArray = Promise._SomePromiseArray;
4
- function any(promises) {
5
- var ret = new SomePromiseArray(promises);
6
- var promise = ret.promise();
7
- ret.setHowMany(1);
8
- ret.setUnwrap();
9
- ret.init();
10
- return promise;
11
- }
12
-
13
- Promise.any = function (promises) {
14
- return any(promises);
15
- };
16
-
17
- Promise.prototype.any = function () {
18
- return any(this);
19
- };
20
-
21
- };
@@ -1,55 +0,0 @@
1
- "use strict";
2
- module.exports = (function(){
3
- var AssertionError = (function() {
4
- function AssertionError(a) {
5
- this.constructor$(a);
6
- this.message = a;
7
- this.name = "AssertionError";
8
- }
9
- AssertionError.prototype = new Error();
10
- AssertionError.prototype.constructor = AssertionError;
11
- AssertionError.prototype.constructor$ = Error;
12
- return AssertionError;
13
- })();
14
-
15
- function getParams(args) {
16
- var params = [];
17
- for (var i = 0; i < args.length; ++i) params.push("arg" + i);
18
- return params;
19
- }
20
-
21
- function nativeAssert(callName, args, expect) {
22
- try {
23
- var params = getParams(args);
24
- var constructorArgs = params;
25
- constructorArgs.push("return " +
26
- callName + "("+ params.join(",") + ");");
27
- var fn = Function.apply(null, constructorArgs);
28
- return fn.apply(null, args);
29
- } catch (e) {
30
- if (!(e instanceof SyntaxError)) {
31
- throw e;
32
- } else {
33
- return expect;
34
- }
35
- }
36
- }
37
-
38
- return function assert(boolExpr, message) {
39
- if (boolExpr === true) return;
40
-
41
- if (typeof boolExpr === "string" &&
42
- boolExpr.charAt(0) === "%") {
43
- var nativeCallName = boolExpr;
44
- var $_len = arguments.length;var args = new Array($_len - 2); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];}
45
- if (nativeAssert(nativeCallName, args, message) === message) return;
46
- message = (nativeCallName + " !== " + message);
47
- }
48
-
49
- var ret = new AssertionError(message);
50
- if (Error.captureStackTrace) {
51
- Error.captureStackTrace(ret, assert);
52
- }
53
- throw ret;
54
- };
55
- })();
@@ -1,150 +0,0 @@
1
- "use strict";
2
- var firstLineError;
3
- try {throw new Error(); } catch (e) {firstLineError = e;}
4
- var schedule = require("./schedule.js");
5
- var Queue = require("./queue.js");
6
- var util = require("./util.js");
7
-
8
- function Async() {
9
- this._isTickUsed = false;
10
- this._lateQueue = new Queue(16);
11
- this._normalQueue = new Queue(16);
12
- this._trampolineEnabled = true;
13
- var self = this;
14
- this.drainQueues = function () {
15
- self._drainQueues();
16
- };
17
- this._schedule =
18
- schedule.isStatic ? schedule(this.drainQueues) : schedule;
19
- }
20
-
21
- Async.prototype.disableTrampolineIfNecessary = function() {
22
- if (util.hasDevTools) {
23
- this._trampolineEnabled = false;
24
- }
25
- };
26
-
27
- Async.prototype.enableTrampoline = function() {
28
- if (!this._trampolineEnabled) {
29
- this._trampolineEnabled = true;
30
- this._schedule = function(fn) {
31
- setTimeout(fn, 0);
32
- };
33
- }
34
- };
35
-
36
- Async.prototype.haveItemsQueued = function () {
37
- return this._normalQueue.length() > 0;
38
- };
39
-
40
- Async.prototype.throwLater = function(fn, arg) {
41
- if (arguments.length === 1) {
42
- arg = fn;
43
- fn = function () { throw arg; };
44
- }
45
- if (typeof setTimeout !== "undefined") {
46
- setTimeout(function() {
47
- fn(arg);
48
- }, 0);
49
- } else try {
50
- this._schedule(function() {
51
- fn(arg);
52
- });
53
- } catch (e) {
54
- throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/m3OTXk\u000a");
55
- }
56
- };
57
-
58
- function AsyncInvokeLater(fn, receiver, arg) {
59
- this._lateQueue.push(fn, receiver, arg);
60
- this._queueTick();
61
- }
62
-
63
- function AsyncInvoke(fn, receiver, arg) {
64
- this._normalQueue.push(fn, receiver, arg);
65
- this._queueTick();
66
- }
67
-
68
- function AsyncSettlePromises(promise) {
69
- this._normalQueue._pushOne(promise);
70
- this._queueTick();
71
- }
72
-
73
- if (!util.hasDevTools) {
74
- Async.prototype.invokeLater = AsyncInvokeLater;
75
- Async.prototype.invoke = AsyncInvoke;
76
- Async.prototype.settlePromises = AsyncSettlePromises;
77
- } else {
78
- if (schedule.isStatic) {
79
- schedule = function(fn) { setTimeout(fn, 0); };
80
- }
81
- Async.prototype.invokeLater = function (fn, receiver, arg) {
82
- if (this._trampolineEnabled) {
83
- AsyncInvokeLater.call(this, fn, receiver, arg);
84
- } else {
85
- this._schedule(function() {
86
- setTimeout(function() {
87
- fn.call(receiver, arg);
88
- }, 100);
89
- });
90
- }
91
- };
92
-
93
- Async.prototype.invoke = function (fn, receiver, arg) {
94
- if (this._trampolineEnabled) {
95
- AsyncInvoke.call(this, fn, receiver, arg);
96
- } else {
97
- this._schedule(function() {
98
- fn.call(receiver, arg);
99
- });
100
- }
101
- };
102
-
103
- Async.prototype.settlePromises = function(promise) {
104
- if (this._trampolineEnabled) {
105
- AsyncSettlePromises.call(this, promise);
106
- } else {
107
- this._schedule(function() {
108
- promise._settlePromises();
109
- });
110
- }
111
- };
112
- }
113
-
114
- Async.prototype.invokeFirst = function (fn, receiver, arg) {
115
- this._normalQueue.unshift(fn, receiver, arg);
116
- this._queueTick();
117
- };
118
-
119
- Async.prototype._drainQueue = function(queue) {
120
- while (queue.length() > 0) {
121
- var fn = queue.shift();
122
- if (typeof fn !== "function") {
123
- fn._settlePromises();
124
- continue;
125
- }
126
- var receiver = queue.shift();
127
- var arg = queue.shift();
128
- fn.call(receiver, arg);
129
- }
130
- };
131
-
132
- Async.prototype._drainQueues = function () {
133
- this._drainQueue(this._normalQueue);
134
- this._reset();
135
- this._drainQueue(this._lateQueue);
136
- };
137
-
138
- Async.prototype._queueTick = function () {
139
- if (!this._isTickUsed) {
140
- this._isTickUsed = true;
141
- this._schedule(this.drainQueues);
142
- }
143
- };
144
-
145
- Async.prototype._reset = function () {
146
- this._isTickUsed = false;
147
- };
148
-
149
- module.exports = new Async();
150
- module.exports.firstLineError = firstLineError;
@@ -1,72 +0,0 @@
1
- "use strict";
2
- module.exports = function(Promise, INTERNAL, tryConvertToPromise) {
3
- var rejectThis = function(_, e) {
4
- this._reject(e);
5
- };
6
-
7
- var targetRejected = function(e, context) {
8
- context.promiseRejectionQueued = true;
9
- context.bindingPromise._then(rejectThis, rejectThis, null, this, e);
10
- };
11
-
12
- var bindingResolved = function(thisArg, context) {
13
- if (this._isPending()) {
14
- this._resolveCallback(context.target);
15
- }
16
- };
17
-
18
- var bindingRejected = function(e, context) {
19
- if (!context.promiseRejectionQueued) this._reject(e);
20
- };
21
-
22
- Promise.prototype.bind = function (thisArg) {
23
- var maybePromise = tryConvertToPromise(thisArg);
24
- var ret = new Promise(INTERNAL);
25
- ret._propagateFrom(this, 1);
26
- var target = this._target();
27
-
28
- ret._setBoundTo(maybePromise);
29
- if (maybePromise instanceof Promise) {
30
- var context = {
31
- promiseRejectionQueued: false,
32
- promise: ret,
33
- target: target,
34
- bindingPromise: maybePromise
35
- };
36
- target._then(INTERNAL, targetRejected, ret._progress, ret, context);
37
- maybePromise._then(
38
- bindingResolved, bindingRejected, ret._progress, ret, context);
39
- } else {
40
- ret._resolveCallback(target);
41
- }
42
- return ret;
43
- };
44
-
45
- Promise.prototype._setBoundTo = function (obj) {
46
- if (obj !== undefined) {
47
- this._bitField = this._bitField | 131072;
48
- this._boundTo = obj;
49
- } else {
50
- this._bitField = this._bitField & (~131072);
51
- }
52
- };
53
-
54
- Promise.prototype._isBound = function () {
55
- return (this._bitField & 131072) === 131072;
56
- };
57
-
58
- Promise.bind = function (thisArg, value) {
59
- var maybePromise = tryConvertToPromise(thisArg);
60
- var ret = new Promise(INTERNAL);
61
-
62
- ret._setBoundTo(maybePromise);
63
- if (maybePromise instanceof Promise) {
64
- maybePromise._then(function() {
65
- ret._resolveCallback(value);
66
- }, ret._reject, ret._progress, ret, null);
67
- } else {
68
- ret._resolveCallback(value);
69
- }
70
- return ret;
71
- };
72
- };
@@ -1,11 +0,0 @@
1
- "use strict";
2
- var old;
3
- if (typeof Promise !== "undefined") old = Promise;
4
- function noConflict() {
5
- try { if (Promise === bluebird) Promise = old; }
6
- catch (e) {}
7
- return bluebird;
8
- }
9
- var bluebird = require("./promise.js")();
10
- bluebird.noConflict = noConflict;
11
- module.exports = bluebird;
@@ -1,123 +0,0 @@
1
- "use strict";
2
- var cr = Object.create;
3
- if (cr) {
4
- var callerCache = cr(null);
5
- var getterCache = cr(null);
6
- callerCache[" size"] = getterCache[" size"] = 0;
7
- }
8
-
9
- module.exports = function(Promise) {
10
- var util = require("./util.js");
11
- var canEvaluate = util.canEvaluate;
12
- var isIdentifier = util.isIdentifier;
13
-
14
- var getMethodCaller;
15
- var getGetter;
16
- if (!false) {
17
- var makeMethodCaller = function (methodName) {
18
- return new Function("ensureMethod", " \n\
19
- return function(obj) { \n\
20
- 'use strict' \n\
21
- var len = this.length; \n\
22
- ensureMethod(obj, 'methodName'); \n\
23
- switch(len) { \n\
24
- case 1: return obj.methodName(this[0]); \n\
25
- case 2: return obj.methodName(this[0], this[1]); \n\
26
- case 3: return obj.methodName(this[0], this[1], this[2]); \n\
27
- case 0: return obj.methodName(); \n\
28
- default: \n\
29
- return obj.methodName.apply(obj, this); \n\
30
- } \n\
31
- }; \n\
32
- ".replace(/methodName/g, methodName))(ensureMethod);
33
- };
34
-
35
- var makeGetter = function (propertyName) {
36
- return new Function("obj", " \n\
37
- 'use strict'; \n\
38
- return obj.propertyName; \n\
39
- ".replace("propertyName", propertyName));
40
- };
41
-
42
- var getCompiled = function(name, compiler, cache) {
43
- var ret = cache[name];
44
- if (typeof ret !== "function") {
45
- if (!isIdentifier(name)) {
46
- return null;
47
- }
48
- ret = compiler(name);
49
- cache[name] = ret;
50
- cache[" size"]++;
51
- if (cache[" size"] > 512) {
52
- var keys = Object.keys(cache);
53
- for (var i = 0; i < 256; ++i) delete cache[keys[i]];
54
- cache[" size"] = keys.length - 256;
55
- }
56
- }
57
- return ret;
58
- };
59
-
60
- getMethodCaller = function(name) {
61
- return getCompiled(name, makeMethodCaller, callerCache);
62
- };
63
-
64
- getGetter = function(name) {
65
- return getCompiled(name, makeGetter, getterCache);
66
- };
67
- }
68
-
69
- function ensureMethod(obj, methodName) {
70
- var fn;
71
- if (obj != null) fn = obj[methodName];
72
- if (typeof fn !== "function") {
73
- var message = "Object " + util.classString(obj) + " has no method '" +
74
- util.toString(methodName) + "'";
75
- throw new Promise.TypeError(message);
76
- }
77
- return fn;
78
- }
79
-
80
- function caller(obj) {
81
- var methodName = this.pop();
82
- var fn = ensureMethod(obj, methodName);
83
- return fn.apply(obj, this);
84
- }
85
- Promise.prototype.call = function (methodName) {
86
- var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}
87
- if (!false) {
88
- if (canEvaluate) {
89
- var maybeCaller = getMethodCaller(methodName);
90
- if (maybeCaller !== null) {
91
- return this._then(
92
- maybeCaller, undefined, undefined, args, undefined);
93
- }
94
- }
95
- }
96
- args.push(methodName);
97
- return this._then(caller, undefined, undefined, args, undefined);
98
- };
99
-
100
- function namedGetter(obj) {
101
- return obj[this];
102
- }
103
- function indexedGetter(obj) {
104
- var index = +this;
105
- if (index < 0) index = Math.max(0, index + obj.length);
106
- return obj[index];
107
- }
108
- Promise.prototype.get = function (propertyName) {
109
- var isIndex = (typeof propertyName === "number");
110
- var getter;
111
- if (!isIndex) {
112
- if (canEvaluate) {
113
- var maybeGetter = getGetter(propertyName);
114
- getter = maybeGetter !== null ? maybeGetter : namedGetter;
115
- } else {
116
- getter = namedGetter;
117
- }
118
- } else {
119
- getter = indexedGetter;
120
- }
121
- return this._then(getter, undefined, undefined, propertyName, undefined);
122
- };
123
- };