telegram-mtproto
Version:
Telegram MTProto library
1,383 lines (1,172 loc) • 3.14 MB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["mtproto"] = factory();
else
root["mtproto"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 281);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
var _curry1 = __webpack_require__(1);
var _isPlaceholder = __webpack_require__(91);
/**
* Optimized internal two-arity curry function.
*
* @private
* @category Function
* @param {Function} fn The function to curry.
* @return {Function} The curried function.
*/
module.exports = function _curry2(fn) {
return function f2(a, b) {
switch (arguments.length) {
case 0:
return f2;
case 1:
return _isPlaceholder(a) ? f2 : _curry1(function (_b) {
return fn(a, _b);
});
default:
return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {
return fn(_a, b);
}) : _isPlaceholder(b) ? _curry1(function (_b) {
return fn(a, _b);
}) : fn(a, b);
}
};
};
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
var _isPlaceholder = __webpack_require__(91);
/**
* Optimized internal one-arity curry function.
*
* @private
* @category Function
* @param {Function} fn The function to curry.
* @return {Function} The curried function.
*/
module.exports = function _curry1(fn) {
return function f1(a) {
if (arguments.length === 0 || _isPlaceholder(a)) {
return f1;
} else {
return fn.apply(this, arguments);
}
};
};
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
var _curry1 = __webpack_require__(1);
var _curry2 = __webpack_require__(0);
var _isPlaceholder = __webpack_require__(91);
/**
* Optimized internal three-arity curry function.
*
* @private
* @category Function
* @param {Function} fn The function to curry.
* @return {Function} The curried function.
*/
module.exports = function _curry3(fn) {
return function f3(a, b, c) {
switch (arguments.length) {
case 0:
return f3;
case 1:
return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {
return fn(a, _b, _c);
});
case 2:
return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {
return fn(_a, b, _c);
}) : _isPlaceholder(b) ? _curry2(function (_b, _c) {
return fn(a, _b, _c);
}) : _curry1(function (_c) {
return fn(a, b, _c);
});
default:
return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {
return fn(_a, _b, c);
}) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {
return fn(_a, b, _c);
}) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {
return fn(a, _b, _c);
}) : _isPlaceholder(a) ? _curry1(function (_a) {
return fn(_a, b, c);
}) : _isPlaceholder(b) ? _curry1(function (_b) {
return fn(a, _b, c);
}) : _isPlaceholder(c) ? _curry1(function (_c) {
return fn(a, b, _c);
}) : fn(a, b, c);
}
};
};
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return error; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return typeError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return invalidArgument; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return invalidContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return invalidFuture; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__fn__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__const__ = __webpack_require__(80);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sanctuary_type_identifiers__ = __webpack_require__(81);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sanctuary_type_identifiers___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_sanctuary_type_identifiers__);
var error = message => {
throw new Error(message);
};
var typeError = message => {
throw new TypeError(message);
};
var invalidArgument = (it, at, expected, actual) => typeError(`${it} expects its ${__WEBPACK_IMPORTED_MODULE_1__const__["e" /* ordinal */][at]} argument to ${expected}\n Actual: ${Object(__WEBPACK_IMPORTED_MODULE_0__fn__["h" /* show */])(actual)}`);
var invalidContext = (it, actual) => typeError(`${it} was invoked outside the context of a Future. You might want to use` + ` a dispatcher instead\n Called on: ${Object(__WEBPACK_IMPORTED_MODULE_0__fn__["h" /* show */])(actual)}`);
var invalidNamespace = (m, x) => `The Future was not created by ${__WEBPACK_IMPORTED_MODULE_1__const__["d" /* namespace */]}. ` + `Make sure you transform other Futures to ${__WEBPACK_IMPORTED_MODULE_1__const__["d" /* namespace */]} Futures. ` + `Got ${x ? `a Future from ${x}` : 'an unscoped Future'}.` + '\n See: https://github.com/fluture-js/Fluture#casting-futures';
var invalidVersion = (m, x) => `The Future was created by ${x < __WEBPACK_IMPORTED_MODULE_1__const__["f" /* version */] ? 'an older' : 'a newer'} version of ${__WEBPACK_IMPORTED_MODULE_1__const__["d" /* namespace */]}. ` + 'This means that one of the sources which creates Futures is outdated. ' + 'Update this source, or transform its created Futures to be compatible.' + '\n See: https://github.com/fluture-js/Fluture#casting-futures';
var invalidFuture = (it, at, m, s = '') => {
var id = __WEBPACK_IMPORTED_MODULE_2_sanctuary_type_identifiers___default.a.parse(__WEBPACK_IMPORTED_MODULE_2_sanctuary_type_identifiers___default()(m));
var info = id.name === __WEBPACK_IMPORTED_MODULE_1__const__["c" /* name */] ? '\n' + (id.namespace !== __WEBPACK_IMPORTED_MODULE_1__const__["d" /* namespace */] ? invalidNamespace(m, id.namespace) : id.version !== __WEBPACK_IMPORTED_MODULE_1__const__["f" /* version */] ? invalidVersion(m, id.version) : 'Nothing seems wrong. Contact the Fluture maintainers.') : '';
typeError(`${it} expects ${__WEBPACK_IMPORTED_MODULE_1__const__["e" /* ordinal */][at] ? `its ${__WEBPACK_IMPORTED_MODULE_1__const__["e" /* ordinal */][at]} argument to be a valid Future` : at}.` + `${info}\n Actual: ${Object(__WEBPACK_IMPORTED_MODULE_0__fn__["h" /* show */])(m)} :: ${id.name}${s}`);
};
/***/ }),
/* 4 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return noop; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return moop; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return show; });
/* unused harmony export padf */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return showf; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mapArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return partial1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return partial2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return partial3; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return immediately; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sanctuary_type_classes__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sanctuary_type_classes___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sanctuary_type_classes__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_inspect_f__ = __webpack_require__(287);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_inspect_f___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_inspect_f__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bc__ = __webpack_require__(288);
var setImmediate = typeof global.setImmediate === 'function' ? global.setImmediate : /* istanbul ignore next: environment-specific */__WEBPACK_IMPORTED_MODULE_2__bc__["a" /* setImmediate */];
var noop = function noop() {};
var moop = function moop() {
return this;
};
var show = __WEBPACK_IMPORTED_MODULE_0_sanctuary_type_classes___default.a.toString;
var padf = (sf, s) => s.replace(/^/gm, sf).replace(sf, '');
var showf = f => padf(' ', __WEBPACK_IMPORTED_MODULE_1_inspect_f___default()(2, f));
var mapArray = (xs, f) => {
var l = xs.length,
ys = new Array(l);
for (var i = 0; i < l; i++) {
ys[i] = f(xs[i], i, xs);
}return ys;
};
var partial1 = (f, a) => function bound1(b, c, d) {
switch (arguments.length) {
case 1:
return f(a, b);
case 2:
return f(a, b, c);
default:
return f(a, b, c, d);
}
};
var partial2 = (f, a, b) => function bound2(c, d) {
return arguments.length === 1 ? f(a, b, c) : f(a, b, c, d);
};
var partial3 = (f, a, b, c) => function bound3(d) {
return f(a, b, c, d);
};
var immediately = f => x => setImmediate(f, x);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(20)))
/***/ }),
/* 5 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["b"] = Future;
/* harmony export (immutable) */ __webpack_exports__["d"] = isFuture;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Core; });
/* unused harmony export Computation */
/* unused harmony export Rejected */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return reject; });
/* harmony export (immutable) */ __webpack_exports__["c"] = Resolved;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return of; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return never; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isNever; });
/* unused harmony export Sequence */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_fn__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_is__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_throw__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_const__ = __webpack_require__(80);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_interpreter__ = __webpack_require__(289);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_list__ = __webpack_require__(291);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_sanctuary_type_identifiers__ = __webpack_require__(81);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_sanctuary_type_identifiers___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_sanctuary_type_identifiers__);
var throwRejection = x => Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["a" /* error */])(`Future#value was called on a rejected Future\n Actual: Future.reject(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["h" /* show */])(x)})`);
function Future(computation) {
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(computation)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future', 0, 'be a Function', computation);
return new Computation(computation);
}
function isFuture(x) {
return x instanceof Future || __WEBPACK_IMPORTED_MODULE_6_sanctuary_type_identifiers___default()(x) === __WEBPACK_IMPORTED_MODULE_3__internal_const__["a" /* $$type */];
}
Future.prototype.ap = function Future$ap(other) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#ap', this);
if (!isFuture(other)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["d" /* invalidFuture */])('Future#ap', 0, other);
return this._ap(other);
};
Future.prototype.map = function Future$map(mapper) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#map', this);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(mapper)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#map', 0, 'to be a Function', mapper);
return this._map(mapper);
};
Future.prototype.bimap = function Future$bimap(lmapper, rmapper) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#bimap', this);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(lmapper)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#bimap', 0, 'to be a Function', lmapper);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(rmapper)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#bimap', 1, 'to be a Function', rmapper);
return this._bimap(lmapper, rmapper);
};
Future.prototype.chain = function Future$chain(mapper) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#chain', this);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(mapper)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#chain', 0, 'to be a Function', mapper);
return this._chain(mapper);
};
Future.prototype.mapRej = function Future$mapRej(mapper) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#mapRej', this);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(mapper)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#mapRej', 0, 'to be a Function', mapper);
return this._mapRej(mapper);
};
Future.prototype.chainRej = function Future$chainRej(mapper) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#chainRej', this);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(mapper)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#chainRej', 0, 'to be a Function', mapper);
return this._chainRej(mapper);
};
Future.prototype.race = function Future$race(other) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#race', this);
if (!isFuture(other)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["d" /* invalidFuture */])('Future#race', 0, other);
return this._race(other);
};
Future.prototype.both = function Future$both(other) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#both', this);
if (!isFuture(other)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["d" /* invalidFuture */])('Future#both', 0, other);
return this._both(other);
};
Future.prototype.and = function Future$and(other) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#and', this);
if (!isFuture(other)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["d" /* invalidFuture */])('Future#and', 0, other);
return this._and(other);
};
Future.prototype.or = function Future$or(other) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#or', this);
if (!isFuture(other)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["d" /* invalidFuture */])('Future#or', 0, other);
return this._or(other);
};
Future.prototype.swap = function Future$swap() {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#ap', this);
return this._swap();
};
Future.prototype.fold = function Future$fold(lmapper, rmapper) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#ap', this);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(lmapper)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#fold', 0, 'to be a Function', lmapper);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(rmapper)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#fold', 1, 'to be a Function', rmapper);
return this._fold(lmapper, rmapper);
};
Future.prototype.finally = function Future$finally(other) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#finally', this);
if (!isFuture(other)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["d" /* invalidFuture */])('Future#finally', 0, other);
return this._finally(other);
};
Future.prototype.lastly = function Future$lastly(other) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#lastly', this);
if (!isFuture(other)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["d" /* invalidFuture */])('Future#lastly', 0, other);
return this._finally(other);
};
Future.prototype.fork = function Future$fork(rej, res) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#fork', this);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(rej)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#fork', 0, 'to be a Function', rej);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(res)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#fork', 0, 'to be a Function', res);
return this._fork(rej, res);
};
Future.prototype.value = function Future$value(res) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#value', this);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(res)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#value', 0, 'to be a Function', res);
return this._fork(throwRejection, res);
};
Future.prototype.done = function Future$done(callback) {
if (!isFuture(this)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["c" /* invalidContext */])('Future#done', this);
if (!Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(callback)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["b" /* invalidArgument */])('Future#done', 0, 'to be a Function', callback);
return this._fork(function Future$done$rej(x) {
callback(x);
}, function Future$done$res(x) {
callback(null, x);
});
};
Future.prototype.promise = function Future$promise() {
return new Promise((res, rej) => this._fork(rej, res));
};
Future.prototype.isRejected = function Future$isRejected() {
return false;
};
Future.prototype.isResolved = function Future$isResolved() {
return false;
};
Future.prototype.isSettled = function Future$isSettled() {
return this.isRejected() || this.isResolved();
};
Future.prototype.extractLeft = function Future$extractLeft() {
return [];
};
Future.prototype.extractRight = function Future$extractRight() {
return [];
};
var Core = Object.create(Future.prototype);
Core._ap = function Core$ap(other) {
return new Sequence(this)._ap(other);
};
Core._map = function Core$map(mapper) {
return new Sequence(this)._map(mapper);
};
Core._bimap = function Core$bimap(lmapper, rmapper) {
return new Sequence(this)._bimap(lmapper, rmapper);
};
Core._chain = function Core$chain(mapper) {
return new Sequence(this)._chain(mapper);
};
Core._mapRej = function Core$mapRej(mapper) {
return new Sequence(this)._mapRej(mapper);
};
Core._chainRej = function Core$chainRej(mapper) {
return new Sequence(this)._chainRej(mapper);
};
Core._race = function Core$race(other) {
return new Sequence(this)._race(other);
};
Core._both = function Core$both(other) {
return new Sequence(this)._both(other);
};
Core._and = function Core$and(other) {
return new Sequence(this)._and(other);
};
Core._or = function Core$or(other) {
return new Sequence(this)._or(other);
};
Core._swap = function Core$swap() {
return new Sequence(this)._swap();
};
Core._fold = function Core$fold(lmapper, rmapper) {
return new Sequence(this)._fold(lmapper, rmapper);
};
Core._finally = function Core$finally(other) {
return new Sequence(this)._finally(other);
};
function check$fork(f, c) {
if (!(f === undefined || Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(f) && f.length === 0)) Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["e" /* typeError */])('Future expected its computation to return a nullary function or void' + `\n Actual: ${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["h" /* show */])(f)}\n From calling: ${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(c)}`);
}
function Computation(computation) {
this._computation = computation;
}
Computation.prototype = Object.create(Core);
Computation.prototype._fork = function Computation$_fork(rej, res) {
var open = true;
var f = this._computation(function Computation$rej(x) {
if (open) {
open = false;
rej(x);
}
}, function Computation$res(x) {
if (open) {
open = false;
res(x);
}
});
check$fork(f, this._computation);
return function Computation$cancel() {
open && f && f();
open = false;
};
};
Computation.prototype.toString = function Computation$toString() {
return `Future(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(this._computation)})`;
};
function Rejected(value) {
this._value = value;
}
Rejected.prototype = Object.create(Core);
Rejected.prototype._ap = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Rejected.prototype._map = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Rejected.prototype._chain = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Rejected.prototype._race = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Rejected.prototype._both = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Rejected.prototype._and = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Rejected.prototype._or = function Rejected$or(other) {
return other;
};
Rejected.prototype._finally = function Rejected$finally(other) {
return other._and(this);
};
Rejected.prototype._swap = function Rejected$swap() {
return new Resolved(this._value);
};
Rejected.prototype._fork = function Rejected$_fork(rej) {
rej(this._value);
return __WEBPACK_IMPORTED_MODULE_0__internal_fn__["d" /* noop */];
};
Rejected.prototype.isRejected = function Rejected$isRejected() {
return true;
};
Rejected.prototype.extractLeft = function Rejected$extractLeft() {
return [this._value];
};
Rejected.prototype.toString = function Rejected$toString() {
return `Future.reject(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["h" /* show */])(this._value)})`;
};
var reject = x => new Rejected(x);
function Resolved(value) {
this._value = value;
}
Resolved.prototype = Object.create(Core);
Resolved.prototype._race = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Resolved.prototype._mapRej = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Resolved.prototype._or = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Resolved.prototype._and = function Resolved$and(other) {
return other;
};
Resolved.prototype._both = function Resolved$both(other) {
return other._map(x => [this._value, x]);
};
Resolved.prototype._swap = function Resolved$swap() {
return new Rejected(this._value);
};
Resolved.prototype._finally = function Resolved$finally(other) {
return other._map(() => this._value);
};
Resolved.prototype._fork = function _fork(rej, res) {
res(this._value);
return __WEBPACK_IMPORTED_MODULE_0__internal_fn__["d" /* noop */];
};
Resolved.prototype.isResolved = function Resolved$isResolved() {
return true;
};
Resolved.prototype.extractRight = function Resolved$extractRight() {
return [this._value];
};
Resolved.prototype.toString = function Resolved$toString() {
return `Future.of(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["h" /* show */])(this._value)})`;
};
var of = x => new Resolved(x);
function Never() {
this._isNever = true;
}
Never.prototype = Object.create(Future.prototype);
Never.prototype._ap = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._map = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._bimap = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._chain = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._mapRej = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._chainRej = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._both = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._or = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._swap = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._fold = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._finally = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["c" /* moop */];
Never.prototype._race = function Never$race(other) {
return other;
};
Never.prototype._fork = function Never$_fork() {
return __WEBPACK_IMPORTED_MODULE_0__internal_fn__["d" /* noop */];
};
Never.prototype.toString = function Never$toString() {
return 'Future.never';
};
var never = new Never();
var isNever = x => isFuture(x) && x._isNever === true;
function Eager(future) {
this.rej = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["d" /* noop */];
this.res = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["d" /* noop */];
this.rejected = false;
this.resolved = false;
this.value = null;
this.cancel = future._fork(x => {
this.value = x;
this.rejected = true;
this.cancel = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["d" /* noop */];
this.rej(x);
}, x => {
this.value = x;
this.resolved = true;
this.cancel = __WEBPACK_IMPORTED_MODULE_0__internal_fn__["d" /* noop */];
this.res(x);
});
}
Eager.prototype = Object.create(Core);
Eager.prototype._fork = function Eager$_fork(rej, res) {
if (this.rejected) rej(this.value);else if (this.resolved) res(this.value);else {
this.rej = rej;
this.res = res;
}
return this.cancel;
};
class Action {
rejected(x) {
this.cancel();return new Rejected(x);
}
resolved(x) {
this.cancel();return new Resolved(x);
}
run() {
return this;
}
cancel() {}
}
/* unused harmony export Action */
var check$ap = f => Object(__WEBPACK_IMPORTED_MODULE_1__internal_is__["c" /* isFunction */])(f) ? f : Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["e" /* typeError */])('Future#ap expects its first argument to be a Future of a Function' + `\n Actual: Future.of(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["h" /* show */])(f)})`);
class ApAction extends Action {
constructor(other) {
super();this.other = other;
}
resolved(f) {
check$ap(f);return this.other._map(x => f(x));
}
toString() {
return `ap(${this.other.toString()})`;
}
}
/* unused harmony export ApAction */
class MapAction extends Action {
constructor(mapper) {
super();this.mapper = mapper;
}
resolved(x) {
return new Resolved(this.mapper(x));
}
toString() {
return `map(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(this.mapper)})`;
}
}
/* unused harmony export MapAction */
class BimapAction extends Action {
constructor(lmapper, rmapper) {
super();this.lmapper = lmapper;this.rmapper = rmapper;
}
rejected(x) {
return new Rejected(this.lmapper(x));
}
resolved(x) {
return new Resolved(this.rmapper(x));
}
toString() {
return `bimap(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(this.lmapper)}, ${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(this.rmapper)})`;
}
}
/* unused harmony export BimapAction */
var check$chain = (m, f, x) => isFuture(m) ? m : Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["d" /* invalidFuture */])('Future#chain', 'the function it\'s given to return a Future', m, `\n From calling: ${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(f)}\n With: ${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["h" /* show */])(x)}`);
class ChainAction extends Action {
constructor(mapper) {
super();this.mapper = mapper;
}
resolved(x) {
return check$chain(this.mapper(x), this.mapper, x);
}
toString() {
return `chain(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(this.mapper)})`;
}
}
/* unused harmony export ChainAction */
class MapRejAction extends Action {
constructor(mapper) {
super();this.mapper = mapper;
}
rejected(x) {
return new Rejected(this.mapper(x));
}
toString() {
return `mapRej(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(this.mapper)})`;
}
}
/* unused harmony export MapRejAction */
var check$chainRej = (m, f, x) => isFuture(m) ? m : Object(__WEBPACK_IMPORTED_MODULE_2__internal_throw__["d" /* invalidFuture */])('Future#chainRej', 'the function it\'s given to return a Future', m, `\n From calling: ${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(f)}\n With: ${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["h" /* show */])(x)}`);
class ChainRejAction extends Action {
constructor(mapper) {
super();this.mapper = mapper;
}
rejected(x) {
return check$chainRej(this.mapper(x), this.mapper, x);
}
toString() {
return `chainRej(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(this.mapper)})`;
}
}
/* unused harmony export ChainRejAction */
class SwapAction extends Action {
constructor() {
super();return SwapAction.instance || (SwapAction.instance = this);
}
rejected(x) {
return new Resolved(x);
}
resolved(x) {
return new Rejected(x);
}
toString() {
return 'swap()';
}
}
/* unused harmony export SwapAction */
class FoldAction extends Action {
constructor(lmapper, rmapper) {
super();this.lmapper = lmapper;this.rmapper = rmapper;
}
rejected(x) {
return new Resolved(this.lmapper(x));
}
resolved(x) {
return new Resolved(this.rmapper(x));
}
toString() {
return `fold(${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(this.lmapper)}, ${Object(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["i" /* showf */])(this.rmapper)})`;
}
}
/* unused harmony export FoldAction */
class FinallyAction extends Action {
constructor(other) {
super();this.other = other;
}
cancel() {
this.other._fork(__WEBPACK_IMPORTED_MODULE_0__internal_fn__["d" /* noop */], __WEBPACK_IMPORTED_MODULE_0__internal_fn__["d" /* noop */])();
}
rejected(x) {
return this.other._and(new Rejected(x));
}
resolved(x) {
return this.other._map(() => x);
}
toString() {
return `finally(${this.other.toString()})`;
}
}
/* unused harmony export FinallyAction */
class AndAction extends Action {
constructor(other) {
super();this.other = other;
}
resolved() {
return this.other;
}
toString() {
return `and(${this.other.toString()})`;
}
}
/* unused harmony export AndAction */
class OrAction extends Action {
constructor(other) {
super();this.other = other;
}
rejected() {
return this.other;
}
toString() {
return `or(${this.other.toString()})`;
}
}
/* unused harmony export OrAction */
class RaceAction extends Action {
constructor(other) {
super();this.other = other;
}
run(early) {
return new RaceActionState(early, new Eager(this.other));
}
toString() {
return `race(${this.other.toString()})`;
}
}
/* unused harmony export RaceAction */
class RaceActionState extends RaceAction {
constructor(early, other) {
super(other);
this.cancel = other._fork(x => early(new Rejected(x), this), x => early(new Resolved(x), this));
}
}
/* unused harmony export RaceActionState */
class BothAction extends Action {
constructor(other) {
super();this.other = other;
}
run(early) {
return new BothActionState(early, new Eager(this.other));
}
resolved(x) {
return this.other._map(y => [x, y]);
}
toString() {
return `both(${this.other.toString()})`;
}
}
/* unused harmony export BothAction */
class BothActionState extends BothAction {
constructor(early, other) {
super(other);
this.cancel = this.other.fork(x => early(new Rejected(x), this), __WEBPACK_IMPORTED_MODULE_0__internal_fn__["d" /* noop */]);
}
}
/* unused harmony export BothActionState */
function Sequence(spawn, actions = __WEBPACK_IMPORTED_MODULE_5__internal_list__["b" /* empty */]) {
this._spawn = spawn;
this._actions = actions;
}
Sequence.prototype = Object.create(Future.prototype);
Sequence.prototype._transform = function Sequence$_transform(action) {
return new Sequence(this._spawn, Object(__WEBPACK_IMPORTED_MODULE_5__internal_list__["a" /* cons */])(action, this._actions));
};
Sequence.prototype._ap = function Sequence$ap(other) {
return this._transform(new ApAction(other));
};
Sequence.prototype._map = function Sequence$map(mapper) {
return this._transform(new MapAction(mapper));
};
Sequence.prototype._bimap = function Sequence$bimap(lmapper, rmapper) {
return this._transform(new BimapAction(lmapper, rmapper));
};
Sequence.prototype._chain = function Sequence$chain(mapper) {
return this._transform(new ChainAction(mapper));
};
Sequence.prototype._mapRej = function Sequence$mapRej(mapper) {
return this._transform(new MapRejAction(mapper));
};
Sequence.prototype._chainRej = function Sequence$chainRej(mapper) {
return this._transform(new ChainRejAction(mapper));
};
Sequence.prototype._race = function Sequence$race(other) {
return isNever(other) ? this : this._transform(new RaceAction(other));
};
Sequence.prototype._both = function Sequence$both(other) {
return this._transform(new BothAction(other));
};
Sequence.prototype._and = function Sequence$and(other) {
return this._transform(new AndAction(other));
};
Sequence.prototype._or = function Sequence$or(other) {
return this._transform(new OrAction(other));
};
Sequence.prototype._swap = function Sequence$swap() {
return this._transform(new SwapAction());
};
Sequence.prototype._fold = function Sequence$fold(lmapper, rmapper) {
return this._transform(new FoldAction(lmapper, rmapper));
};
Sequence.prototype._finally = function Sequence$finally(other) {
return this._transform(new FinallyAction(other));
};
Sequence.prototype._fork = __WEBPACK_IMPORTED_MODULE_4__internal_interpreter__["a" /* default */];
Sequence.prototype.toString = function Sequence$toString() {
var str = '',
tail = this._actions;
while (!tail.isEmpty) {
str = `.${tail.head.toString()}${str}`;
tail = tail.tail;
}
return `${this._spawn.toString()}${str}`;
};
/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = Stream;
/** @license MIT License (c) copyright 2010-2016 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
function Stream(source) {
this.source = source;
}
Stream.prototype.run = function (sink, scheduler) {
return this.source.run(sink, scheduler);
};
/***/ }),
/* 7 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isFunction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isThenable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isBoolean; });
/* unused harmony export isNumber */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isUnsigned; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isIterator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isArray; });
var isFunction = f => typeof f === 'function';
var isThenable = m => m instanceof Promise || Boolean(m) && isFunction(m.then);
var isBoolean = f => typeof f === 'boolean';
var isNumber = f => typeof f === 'number';
var isUnsigned = n => n === Infinity || isNumber(n) && n > 0 && n % 1 === 0;
var isObject = o => o !== null && typeof o === 'object';
var isIterator = i => isObject(i) && isFunction(i.next);
var isArray = Array.isArray;
/***/ }),
/* 8 */
/***/ (function(module, exports) {
/*::
export opaque type CryptoKey: number[] = number[]
declare export function toCryptoKey(x: number[]): CryptoKey
export opaque type DCNumber: number = number
declare export function toDCNumber(x: number): DCNumber
export opaque type UID: string = string
declare export function toUID(x: string): UID
export opaque type Response: { _: string, [field: string]: any } = {
_: string,
[field: string]: any
}
*/
/***/ }),
/* 9 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return cons; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return append; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return drop; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return tail; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return copy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return map; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return reduce; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return replace; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return remove; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return removeAll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return findIndex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isArrayLike; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return id; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return compose; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return apply; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return curry2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return curry3; });
/* unused harmony export curry4 */
/** @license MIT License (c) copyright 2010-2016 original author or authors */
// Non-mutating array operations
// cons :: a -> [a] -> [a]
// a with x prepended
function cons(x, a) {
var l = a.length;
var b = new Array(l + 1);
b[0] = x;
for (var i = 0; i < l; ++i) {
b[i + 1] = a[i];
}
return b;
}
// append :: a -> [a] -> [a]
// a with x appended
function append(x, a) {
var l = a.length;
var b = new Array(l + 1);
for (var i = 0; i < l; ++i) {
b[i] = a[i];
}
b[l] = x;
return b;
}
// drop :: Int -> [a] -> [a]
// drop first n elements
function drop(n, a) {
// eslint-disable-line complexity
if (n < 0) {
throw new TypeError('n must be >= 0');
}
var l = a.length;
if (n === 0 || l === 0) {
return a;
}
if (n >= l) {
return [];
}
return unsafeDrop(n, a, l - n);
}
// unsafeDrop :: Int -> [a] -> Int -> [a]
// Internal helper for drop
function unsafeDrop(n, a, l) {
var b = new Array(l);
for (var i = 0; i < l; ++i) {
b[i] = a[n + i];
}
return b;
}
// tail :: [a] -> [a]
// drop head element
function tail(a) {
return drop(1, a);
}
// copy :: [a] -> [a]
// duplicate a (shallow duplication)
function copy(a) {
var l = a.length;
var b = new Array(l);
for (var i = 0; i < l; ++i) {
b[i] = a[i];
}
return b;
}
// map :: (a -> b) -> [a] -> [b]
// transform each element with f
function map(f, a) {
var l = a.length;
var b = new Array(l);
for (var i = 0; i < l; ++i) {
b[i] = f(a[i]);
}
return b;
}
// reduce :: (a -> b -> a) -> a -> [b] -> a
// accumulate via left-fold
function reduce(f, z, a) {
var r = z;
for (var i = 0, l = a.length; i < l; ++i) {
r = f(r, a[i], i);
}
return r;
}
// replace :: a -> Int -> [a]
// replace element at index
function replace(x, i, a) {
// eslint-disable-line complexity
if (i < 0) {
throw new TypeError('i must be >= 0');
}
var l = a.length;
var b = new Array(l);
for (var j = 0; j < l; ++j) {
b[j] = i === j ? x : a[j];
}
return b;
}
// remove :: Int -> [a] -> [a]
// remove element at index
function remove(i, a) {
// eslint-disable-line complexity
if (i < 0) {
throw new TypeError('i must be >= 0');
}
var l = a.length;
if (l === 0 || i >= l) {
// exit early if index beyond end of array
return a;
}
if (l === 1) {
// exit early if index in bounds and length === 1
return [];
}
return unsafeRemove(i, a, l - 1);
}
// unsafeRemove :: Int -> [a] -> Int -> [a]
// Internal helper to remove element at index
function unsafeRemove(i, a, l) {
var b = new Array(l);
var j;
for (j = 0; j < i; ++j) {
b[j] = a[j];
}
for (j = i; j < l; ++j) {
b[j] = a[j + 1];
}
return b;
}
// removeAll :: (a -> boolean) -> [a] -> [a]
// remove all elements matching a predicate
function removeAll(f, a) {
var l = a.length;
var b = new Array(l);
var j = 0;
for (var x = void 0, i = 0; i < l; ++i) {
x = a[i];
if (!f(x)) {
b[j] = x;
++j;
}
}
b.length = j;
return b;
}
// findIndex :: a -> [a] -> Int
// find index of x in a, from the left
function findIndex(x, a) {
for (var i = 0, l = a.length; i < l; ++i) {
if (x === a[i]) {
return i;
}
}
return -1;
}
// isArrayLike :: * -> boolean
// Return true iff x is array-like
function isArrayLike(x) {
return x != null && typeof x.length === 'number' && typeof x !== 'function';
}
/** @license MIT License (c) copyright 2010-2016 original author or authors */
// id :: a -> a
var id = function (x) {
return x;
};
// compose :: (b -> c) -> (a -> b) -> (a -> c)
var compose = function (f, g) {
return function (x) {
return f(g(x));
};
};
// apply :: (a -> b) -> a -> b
var apply = function (f, x) {
return f(x);
};
// curry2 :: ((a, b) -> c) -> (a -> b -> c)
function curry2(f) {
function curried(a, b) {
switch (arguments.length) {
case 0:
return curried;
case 1:
return function (b) {
return f(a, b);
};
default:
return f(a, b);
}
}
return curried;
}
// curry3 :: ((a, b, c) -> d) -> (a -> b -> c -> d)
function curry3(f) {
function curried(a, b, c) {
// eslint-disable-line complexity
switch (arguments.length) {
case 0:
return curried;
case 1:
return curry2(function (b, c) {
return f(a, b, c);
});
case 2:
return function (c) {
return f(a, b, c);
};
default:
return f(a, b, c);
}
}
return curried;
}
// curry4 :: ((a, b, c, d) -> e) -> (a -> b -> c -> d -> e)
function curry4(f) {
function curried(a, b, c, d) {
// eslint-disable-line complexity
switch (arguments.length) {
case 0:
return curried;
case 1:
return curry3(function (b, c, d) {
return f(a, b, c, d);
});
case 2:
return curry2(function (c, d) {
return f(a, b, c, d);
});
case 3:
return function (d) {
return f(a, b, c, d);
};
default:
return f(a, b, c, d);
}
}
return curried;
}
/** @license MIT License (c) copyright 2016 original author or authors */
//# sourceMappingURL=index.es.js.map
/***/ }),
/* 10 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Stream__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__most_prelude__ = __webpack_require__(9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__source_core__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__source_from__ = __webpack_require__(449);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__source_periodic__ = __webpack_require__(456);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_symbol_observable__ = __webpack_require__(123);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_symbol_observable__);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__Stream__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_2__source_core__["c"]; });
/* unused harmony reexport just */
/* unused harmony reexport empty */
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_2__source_core__["b"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_3__source_from__["a"]; });
/* unused harmony reexport periodic */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__observable_subscribe__ = __webpack_require__(457);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__combinator_thru__ = __webpack_requi