diff --git a/submissions/artfuldev/.editorconfig b/submissions/artfuldev/.editorconfig new file mode 100644 index 0000000..b3dfee7 --- /dev/null +++ b/submissions/artfuldev/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 diff --git a/submissions/artfuldev/.gitignore b/submissions/artfuldev/.gitignore new file mode 100644 index 0000000..515e604 --- /dev/null +++ b/submissions/artfuldev/.gitignore @@ -0,0 +1,2 @@ +typings/ +node_modules/ diff --git a/submissions/artfuldev/.vscode/launch.json b/submissions/artfuldev/.vscode/launch.json new file mode 100644 index 0000000..ec0cef4 --- /dev/null +++ b/submissions/artfuldev/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Chrome against localhost, with sourcemaps", + "type": "chrome", + "request": "launch", + "url": "http://localhost:3000", + "sourceMaps": true, + "webRoot": "${workspaceRoot}" + }, + { + "name": "Attach to Chrome, with sourcemaps", + "type": "chrome", + "request": "attach", + "port": 9222, + "sourceMaps": true, + "webRoot": "${workspaceRoot}" + } + ] +} \ No newline at end of file diff --git a/submissions/artfuldev/.vscode/settings.json b/submissions/artfuldev/.vscode/settings.json new file mode 100644 index 0000000..6f67995 --- /dev/null +++ b/submissions/artfuldev/.vscode/settings.json @@ -0,0 +1,12 @@ +// Place your settings in this file to overwrite default and user settings. +{ + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.DS_Store": true, + "node_modules": true, + "dist": true, + "**/*.js": { "when": "$(basename).ts"}, + "**/*.js.map": true + } +} \ No newline at end of file diff --git a/submissions/artfuldev/dist/app.js b/submissions/artfuldev/dist/app.js new file mode 100644 index 0000000..174e01c --- /dev/null +++ b/submissions/artfuldev/dist/app.js @@ -0,0 +1,16844 @@ +/******/ (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] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = 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; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var main_1 = __webpack_require__(1); + var dom_1 = __webpack_require__(9); + var xstream_run_1 = __webpack_require__(133); + var planets_1 = __webpack_require__(136); + var jedis_1 = __webpack_require__(137); + xstream_run_1.run(main_1.default, { + dom: dom_1.makeDOMDriver('#app'), + planets: planets_1.makePlanetsDriver(), + jedis: jedis_1.makeJedisDriver() + }); + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var intent_1 = __webpack_require__(2); + var model_1 = __webpack_require__(3); + var view_1 = __webpack_require__(8); + var requests_1 = __webpack_require__(130); + function main(sources) { + var jedi$ = sources.jedis.jedi$; + var planet$ = sources.planets.planet$; + var state$ = model_1.default(planet$, jedi$, intent_1.default(sources)); + var vNode$ = view_1.default(state$); + var id$ = requests_1.default(state$); + var sinks = { + dom: vNode$, + jedis: id$ + }; + return sinks; + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = main; + + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + "use strict"; + function intent(sources) { + var dom = sources.dom; + var intent = { + scrollUp$: dom + .select('.css-button-up') + .events('click') + .filter(function (ev) { return ev.target.className.indexOf('disabled') === -1; }) + .mapTo(true), + scrollDown$: dom + .select('.css-button-down') + .events('click') + .filter(function (ev) { return ev.target.className.indexOf('disabled') === -1; }) + .mapTo(true) + }; + return intent; + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = intent; + + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var reducers_1 = __webpack_require__(4); + function model(planet$, jedi$, intent) { + var reducer$ = reducers_1.default(planet$, jedi$, intent); + var state$ = reducer$.fold(function (next, reducer) { return reducer(next); }, reducers_1.InitialState); + return state$; + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = model; + + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var xstream_1 = __webpack_require__(5); + var immutable_1 = __webpack_require__(7); + var JediRecord = immutable_1.Record({ + id: 0, + name: null, + homeworld: null, + master: null, + apprentice: null + }); + var Jedi = (function (_super) { + __extends(Jedi, _super); + function Jedi(props) { + _super.call(this, props); + } + return Jedi; + }(JediRecord)); + var ApplicationStateRecord = immutable_1.Record({ + planet: null, + jedis: new Array(), + down: false, + up: false, + matchedId: -1 + }); + var ApplicationState = (function (_super) { + __extends(ApplicationState, _super); + function ApplicationState(props) { + _super.call(this, props); + } + return ApplicationState; + }(ApplicationStateRecord)); + exports.InitialState = new ApplicationState({ + planet: null, + jedis: [ + null, + null, + null, + null, + null + ], + down: false, + up: false, + matchedId: -1 + }); + function reducers(planet$, jedi$, intent) { + var xs = xstream_1.Stream; + var planetReducer$ = planet$ + .map(function (planet) { + return function (state) { + var appState = state; + var nextState = appState.set('planet', planet); + return nextState; + }; + }); + var jedisReducer$ = xs.merge(jedi$ + .map(function (jedi) { + return function (state) { + var jedis = state.jedis || new Array(5); + var masterIndex = jedis + .map(function (j) { return (j && j.master) ? j.master.id : -1; }) + .indexOf(jedi.id); + var appState = state; + var index = 2; + if (masterIndex !== -1) + index = masterIndex - 1; + else { + var apprenticeIndex = jedis + .map(function (j) { return (j && j.apprentice) ? j.apprentice.id : -1; }) + .indexOf(jedi.id); + if (apprenticeIndex !== -1) + index = apprenticeIndex + 1; + } + var newJedis = jedis + .map(function (j, i) { + return i === index + ? new Jedi(jedi) + : j; + }); + var nextState = appState.set('jedis', newJedis); + return nextState; + }; + }), intent.scrollUp$ + .mapTo(function (state) { + var jedis = state.jedis; + var newJedis = jedis + .map(function (jedi, i, array) { return (i < 2) ? null : array[i - 2]; }); + var appState = state; + var nextState = appState.set('jedis', newJedis); + return nextState; + }), intent.scrollDown$ + .mapTo(function (state) { + var jedis = state.jedis; + var newJedis = jedis + .map(function (jedi, i, array) { return (i > 2) ? null : array[i + 2]; }); + var appState = state; + var nextState = appState.set('jedis', newJedis); + return nextState; + })); + var downReducer$ = jedisReducer$ + .mapTo(function (state) { + var jedis = state.jedis; + var lastJedi = jedis.filter(function (jedi) { return !!jedi; }).pop(); + var index = jedis.indexOf(lastJedi); + var down = lastJedi && lastJedi.apprentice && lastJedi.apprentice.id; + var appState = state; + var nextState = appState.set('down', down); + return nextState; + }); + var upReducer$ = jedisReducer$ + .mapTo(function (state) { + var jedis = state.jedis; + var firstJedi = jedis.filter(function (jedi) { return !!jedi; }).shift(); + var index = jedis.indexOf(firstJedi); + var up = firstJedi && firstJedi.master && firstJedi.master.id; + var appState = state; + var nextState = appState.set('up', up); + return nextState; + }); + var matchedIdReducer$ = xs.merge(jedi$, planet$).mapTo(function (state) { + var planet = state.planet; + var appState = state; + var noMatchState = appState.set('matchedId', -1); + if (!planet || !planet.id) + return noMatchState; + var planetId = planet.id; + var matchedJedi = state.jedis + .filter(function (jedi) { return !!jedi && jedi.homeworld.id === planetId; }) + .pop(); + if (!matchedJedi) + return noMatchState; + var nextState = noMatchState.set('matchedId', matchedJedi.id); + return nextState; + }); + return xs.merge(planetReducer$, jedisReducer$, downReducer$, upReducer$, matchedIdReducer$); + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = reducers; + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var core_1 = __webpack_require__(6); + exports.Stream = core_1.Stream; + exports.MemoryStream = core_1.MemoryStream; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = core_1.Stream; + //# sourceMappingURL=index.js.map + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var NO = {}; + function noop() { } + function copy(a) { + var l = a.length; + var b = Array(l); + for (var i = 0; i < l; ++i) { + b[i] = a[i]; + } + return b; + } + exports.NO_IL = { + _n: noop, + _e: noop, + _c: noop, + }; + // mutates the input + function internalizeProducer(producer) { + producer._start = + function _start(il) { + il.next = il._n; + il.error = il._e; + il.complete = il._c; + this.start(il); + }; + producer._stop = producer.stop; + } + function compose2(f1, f2) { + return function composedFn(arg) { + return f1(f2(arg)); + }; + } + function and(f1, f2) { + return function andFn(t) { + return f1(t) && f2(t); + }; + } + var MergeProducer = (function () { + function MergeProducer(insArr) { + this.type = 'merge'; + this.insArr = insArr; + this.out = NO; + this.ac = 0; + } + MergeProducer.prototype._start = function (out) { + this.out = out; + var s = this.insArr; + var L = s.length; + this.ac = L; + for (var i = 0; i < L; i++) { + s[i]._add(this); + } + }; + MergeProducer.prototype._stop = function () { + var s = this.insArr; + var L = s.length; + for (var i = 0; i < L; i++) { + s[i]._remove(this); + } + this.out = NO; + }; + MergeProducer.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + u._n(t); + }; + MergeProducer.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + MergeProducer.prototype._c = function () { + if (--this.ac <= 0) { + var u = this.out; + if (u === NO) + return; + u._c(); + } + }; + return MergeProducer; + }()); + exports.MergeProducer = MergeProducer; + var CombineListener = (function () { + function CombineListener(i, out, p) { + this.i = i; + this.out = out; + this.p = p; + p.ils.push(this); + } + CombineListener.prototype._n = function (t) { + var p = this.p, out = this.out; + if (!out) + return; + if (p.up(t, this.i)) { + out._n(p.vals); + } + }; + CombineListener.prototype._e = function (err) { + var out = this.out; + if (!out) + return; + out._e(err); + }; + CombineListener.prototype._c = function () { + var p = this.p; + if (!p.out) + return; + if (--p.Nc === 0) { + p.out._c(); + } + }; + return CombineListener; + }()); + exports.CombineListener = CombineListener; + var CombineProducer = (function () { + function CombineProducer(insArr) { + this.type = 'combine'; + this.insArr = insArr; + this.out = NO; + this.ils = []; + this.Nc = this.Nn = 0; + this.vals = []; + } + CombineProducer.prototype.up = function (t, i) { + var v = this.vals[i]; + var Nn = !this.Nn ? 0 : v === NO ? --this.Nn : this.Nn; + this.vals[i] = t; + return Nn === 0; + }; + CombineProducer.prototype._start = function (out) { + this.out = out; + var s = this.insArr; + var n = this.Nc = this.Nn = s.length; + var vals = this.vals = new Array(n); + if (n === 0) { + out._n([]); + out._c(); + } + else { + for (var i = 0; i < n; i++) { + vals[i] = NO; + s[i]._add(new CombineListener(i, out, this)); + } + } + }; + CombineProducer.prototype._stop = function () { + var s = this.insArr; + var n = s.length; + for (var i = 0; i < n; i++) { + s[i]._remove(this.ils[i]); + } + this.out = NO; + this.ils = []; + this.vals = []; + }; + return CombineProducer; + }()); + exports.CombineProducer = CombineProducer; + var FromArrayProducer = (function () { + function FromArrayProducer(a) { + this.type = 'fromArray'; + this.a = a; + } + FromArrayProducer.prototype._start = function (out) { + var a = this.a; + for (var i = 0, l = a.length; i < l; i++) { + out._n(a[i]); + } + out._c(); + }; + FromArrayProducer.prototype._stop = function () { + }; + return FromArrayProducer; + }()); + exports.FromArrayProducer = FromArrayProducer; + var FromPromiseProducer = (function () { + function FromPromiseProducer(p) { + this.type = 'fromPromise'; + this.on = false; + this.p = p; + } + FromPromiseProducer.prototype._start = function (out) { + var prod = this; + this.on = true; + this.p.then(function (v) { + if (prod.on) { + out._n(v); + out._c(); + } + }, function (e) { + out._e(e); + }).then(null, function (err) { + setTimeout(function () { throw err; }); + }); + }; + FromPromiseProducer.prototype._stop = function () { + this.on = false; + }; + return FromPromiseProducer; + }()); + exports.FromPromiseProducer = FromPromiseProducer; + var PeriodicProducer = (function () { + function PeriodicProducer(period) { + this.type = 'periodic'; + this.period = period; + this.intervalID = -1; + this.i = 0; + } + PeriodicProducer.prototype._start = function (stream) { + var self = this; + function intervalHandler() { stream._n(self.i++); } + this.intervalID = setInterval(intervalHandler, this.period); + }; + PeriodicProducer.prototype._stop = function () { + if (this.intervalID !== -1) + clearInterval(this.intervalID); + this.intervalID = -1; + this.i = 0; + }; + return PeriodicProducer; + }()); + exports.PeriodicProducer = PeriodicProducer; + var DebugOperator = (function () { + function DebugOperator(arg, ins) { + this.type = 'debug'; + this.ins = ins; + this.out = NO; + this.s = noop; + this.l = ''; + if (typeof arg === 'string') { + this.l = arg; + } + else { + this.s = arg; + } + } + DebugOperator.prototype._start = function (out) { + this.out = out; + this.ins._add(this); + }; + DebugOperator.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + DebugOperator.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + var s = this.s, l = this.l; + if (s !== noop) { + try { + s(t); + } + catch (e) { + u._e(e); + } + } + else if (l) { + console.log(l + ':', t); + } + else { + console.log(t); + } + u._n(t); + }; + DebugOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + DebugOperator.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return DebugOperator; + }()); + exports.DebugOperator = DebugOperator; + var DropOperator = (function () { + function DropOperator(max, ins) { + this.type = 'drop'; + this.ins = ins; + this.out = NO; + this.max = max; + this.dropped = 0; + } + DropOperator.prototype._start = function (out) { + this.out = out; + this.dropped = 0; + this.ins._add(this); + }; + DropOperator.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + DropOperator.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + if (this.dropped++ >= this.max) + u._n(t); + }; + DropOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + DropOperator.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return DropOperator; + }()); + exports.DropOperator = DropOperator; + var OtherIL = (function () { + function OtherIL(out, op) { + this.out = out; + this.op = op; + } + OtherIL.prototype._n = function (t) { + this.op.end(); + }; + OtherIL.prototype._e = function (err) { + this.out._e(err); + }; + OtherIL.prototype._c = function () { + this.op.end(); + }; + return OtherIL; + }()); + var EndWhenOperator = (function () { + function EndWhenOperator(o, ins) { + this.type = 'endWhen'; + this.ins = ins; + this.out = NO; + this.o = o; + this.oil = exports.NO_IL; + } + EndWhenOperator.prototype._start = function (out) { + this.out = out; + this.o._add(this.oil = new OtherIL(out, this)); + this.ins._add(this); + }; + EndWhenOperator.prototype._stop = function () { + this.ins._remove(this); + this.o._remove(this.oil); + this.out = NO; + this.oil = exports.NO_IL; + }; + EndWhenOperator.prototype.end = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + EndWhenOperator.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + u._n(t); + }; + EndWhenOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + EndWhenOperator.prototype._c = function () { + this.end(); + }; + return EndWhenOperator; + }()); + exports.EndWhenOperator = EndWhenOperator; + var FilterOperator = (function () { + function FilterOperator(passes, ins) { + this.type = 'filter'; + this.ins = ins; + this.out = NO; + this.passes = passes; + } + FilterOperator.prototype._start = function (out) { + this.out = out; + this.ins._add(this); + }; + FilterOperator.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + FilterOperator.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + try { + if (this.passes(t)) + u._n(t); + } + catch (e) { + u._e(e); + } + }; + FilterOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + FilterOperator.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return FilterOperator; + }()); + exports.FilterOperator = FilterOperator; + var FlattenListener = (function () { + function FlattenListener(out, op) { + this.out = out; + this.op = op; + } + FlattenListener.prototype._n = function (t) { + this.out._n(t); + }; + FlattenListener.prototype._e = function (err) { + this.out._e(err); + }; + FlattenListener.prototype._c = function () { + this.op.inner = NO; + this.op.less(); + }; + return FlattenListener; + }()); + var FlattenOperator = (function () { + function FlattenOperator(ins) { + this.type = 'flatten'; + this.ins = ins; + this.out = NO; + this.open = true; + this.inner = NO; + this.il = exports.NO_IL; + } + FlattenOperator.prototype._start = function (out) { + this.out = out; + this.open = true; + this.inner = NO; + this.il = exports.NO_IL; + this.ins._add(this); + }; + FlattenOperator.prototype._stop = function () { + this.ins._remove(this); + if (this.inner !== NO) + this.inner._remove(this.il); + this.out = NO; + this.open = true; + this.inner = NO; + this.il = exports.NO_IL; + }; + FlattenOperator.prototype.less = function () { + var u = this.out; + if (u === NO) + return; + if (!this.open && this.inner === NO) + u._c(); + }; + FlattenOperator.prototype._n = function (s) { + var u = this.out; + if (u === NO) + return; + var _a = this, inner = _a.inner, il = _a.il; + if (inner !== NO && il !== exports.NO_IL) + inner._remove(il); + (this.inner = s)._add(this.il = new FlattenListener(u, this)); + }; + FlattenOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + FlattenOperator.prototype._c = function () { + this.open = false; + this.less(); + }; + return FlattenOperator; + }()); + exports.FlattenOperator = FlattenOperator; + var FoldOperator = (function () { + function FoldOperator(f, seed, ins) { + this.type = 'fold'; + this.ins = ins; + this.out = NO; + this.f = f; + this.acc = this.seed = seed; + } + FoldOperator.prototype._start = function (out) { + this.out = out; + this.acc = this.seed; + out._n(this.acc); + this.ins._add(this); + }; + FoldOperator.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + this.acc = this.seed; + }; + FoldOperator.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + try { + u._n(this.acc = this.f(this.acc, t)); + } + catch (e) { + u._e(e); + } + }; + FoldOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + FoldOperator.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return FoldOperator; + }()); + exports.FoldOperator = FoldOperator; + var LastOperator = (function () { + function LastOperator(ins) { + this.type = 'last'; + this.ins = ins; + this.out = NO; + this.has = false; + this.val = NO; + } + LastOperator.prototype._start = function (out) { + this.out = out; + this.has = false; + this.ins._add(this); + }; + LastOperator.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + this.val = NO; + }; + LastOperator.prototype._n = function (t) { + this.has = true; + this.val = t; + }; + LastOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + LastOperator.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + if (this.has) { + u._n(this.val); + u._c(); + } + else { + u._e('TODO show proper error'); + } + }; + return LastOperator; + }()); + exports.LastOperator = LastOperator; + var MapFlattenInner = (function () { + function MapFlattenInner(out, op) { + this.out = out; + this.op = op; + } + MapFlattenInner.prototype._n = function (r) { + this.out._n(r); + }; + MapFlattenInner.prototype._e = function (err) { + this.out._e(err); + }; + MapFlattenInner.prototype._c = function () { + this.op.inner = NO; + this.op.less(); + }; + return MapFlattenInner; + }()); + var MapFlattenOperator = (function () { + function MapFlattenOperator(mapOp) { + this.type = mapOp.type + "+flatten"; + this.ins = mapOp.ins; + this.out = NO; + this.mapOp = mapOp; + this.inner = NO; + this.il = exports.NO_IL; + this.open = true; + } + MapFlattenOperator.prototype._start = function (out) { + this.out = out; + this.inner = NO; + this.il = exports.NO_IL; + this.open = true; + this.mapOp.ins._add(this); + }; + MapFlattenOperator.prototype._stop = function () { + this.mapOp.ins._remove(this); + if (this.inner !== NO) + this.inner._remove(this.il); + this.out = NO; + this.inner = NO; + this.il = exports.NO_IL; + }; + MapFlattenOperator.prototype.less = function () { + if (!this.open && this.inner === NO) { + var u = this.out; + if (u === NO) + return; + u._c(); + } + }; + MapFlattenOperator.prototype._n = function (v) { + var u = this.out; + if (u === NO) + return; + var _a = this, inner = _a.inner, il = _a.il; + if (inner !== NO && il !== exports.NO_IL) + inner._remove(il); + try { + (this.inner = this.mapOp.project(v))._add(this.il = new MapFlattenInner(u, this)); + } + catch (e) { + u._e(e); + } + }; + MapFlattenOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + MapFlattenOperator.prototype._c = function () { + this.open = false; + this.less(); + }; + return MapFlattenOperator; + }()); + exports.MapFlattenOperator = MapFlattenOperator; + var MapOperator = (function () { + function MapOperator(project, ins) { + this.type = 'map'; + this.ins = ins; + this.out = NO; + this.project = project; + } + MapOperator.prototype._start = function (out) { + this.out = out; + this.ins._add(this); + }; + MapOperator.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + MapOperator.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + try { + u._n(this.project(t)); + } + catch (e) { + u._e(e); + } + }; + MapOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + MapOperator.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return MapOperator; + }()); + exports.MapOperator = MapOperator; + var FilterMapOperator = (function (_super) { + __extends(FilterMapOperator, _super); + function FilterMapOperator(passes, project, ins) { + _super.call(this, project, ins); + this.type = 'filter+map'; + this.passes = passes; + } + FilterMapOperator.prototype._n = function (v) { + if (this.passes(v)) { + _super.prototype._n.call(this, v); + } + ; + }; + return FilterMapOperator; + }(MapOperator)); + exports.FilterMapOperator = FilterMapOperator; + var RememberOperator = (function () { + function RememberOperator(ins) { + this.type = 'remember'; + this.ins = ins; + this.out = NO; + } + RememberOperator.prototype._start = function (out) { + this.out = out; + this.ins._add(out); + }; + RememberOperator.prototype._stop = function () { + this.ins._remove(this.out); + this.out = NO; + }; + return RememberOperator; + }()); + exports.RememberOperator = RememberOperator; + var ReplaceErrorOperator = (function () { + function ReplaceErrorOperator(fn, ins) { + this.type = 'replaceError'; + this.ins = ins; + this.out = NO; + this.fn = fn; + } + ReplaceErrorOperator.prototype._start = function (out) { + this.out = out; + this.ins._add(this); + }; + ReplaceErrorOperator.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + ReplaceErrorOperator.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + u._n(t); + }; + ReplaceErrorOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + try { + this.ins._remove(this); + (this.ins = this.fn(err))._add(this); + } + catch (e) { + u._e(e); + } + }; + ReplaceErrorOperator.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return ReplaceErrorOperator; + }()); + exports.ReplaceErrorOperator = ReplaceErrorOperator; + var StartWithOperator = (function () { + function StartWithOperator(ins, val) { + this.type = 'startWith'; + this.ins = ins; + this.out = NO; + this.val = val; + } + StartWithOperator.prototype._start = function (out) { + this.out = out; + this.out._n(this.val); + this.ins._add(out); + }; + StartWithOperator.prototype._stop = function () { + this.ins._remove(this.out); + this.out = NO; + }; + return StartWithOperator; + }()); + exports.StartWithOperator = StartWithOperator; + var TakeOperator = (function () { + function TakeOperator(max, ins) { + this.type = 'take'; + this.ins = ins; + this.out = NO; + this.max = max; + this.taken = 0; + } + TakeOperator.prototype._start = function (out) { + this.out = out; + this.taken = 0; + this.ins._add(this); + }; + TakeOperator.prototype._stop = function () { + this.ins._remove(this); + this.out = NO; + }; + TakeOperator.prototype._n = function (t) { + var u = this.out; + if (u === NO) + return; + if (this.taken++ < this.max - 1) { + u._n(t); + } + else { + u._n(t); + u._c(); + } + }; + TakeOperator.prototype._e = function (err) { + var u = this.out; + if (u === NO) + return; + u._e(err); + }; + TakeOperator.prototype._c = function () { + var u = this.out; + if (u === NO) + return; + u._c(); + }; + return TakeOperator; + }()); + exports.TakeOperator = TakeOperator; + var Stream = (function () { + function Stream(producer) { + this._prod = producer || NO; + this._ils = []; + this._stopID = NO; + this._target = NO; + this._err = NO; + } + Stream.prototype._n = function (t) { + var a = this._ils; + var L = a.length; + if (L == 1) + a[0]._n(t); + else { + var b = copy(a); + for (var i = 0; i < L; i++) + b[i]._n(t); + } + }; + Stream.prototype._e = function (err) { + if (this._err !== NO) + return; + this._err = err; + var a = this._ils; + var L = a.length; + if (L == 1) + a[0]._e(err); + else { + var b = copy(a); + for (var i = 0; i < L; i++) + b[i]._e(err); + } + this._x(); + }; + Stream.prototype._c = function () { + var a = this._ils; + var L = a.length; + if (L == 1) + a[0]._c(); + else { + var b = copy(a); + for (var i = 0; i < L; i++) + b[i]._c(); + } + this._x(); + }; + Stream.prototype._x = function () { + if (this._ils.length === 0) + return; + if (this._prod !== NO) + this._prod._stop(); + this._err = NO; + this._ils = []; + }; + Stream.prototype._lateStop = function () { + // this._prod is not null, because this _lateStop is called from _remove + // where we already checked that this._prod is truthy + this._prod._stop(); + this._err = NO; + this._stopID = NO; + }; + Stream.prototype._add = function (il) { + var ta = this._target; + if (ta !== NO) + return ta._add(il); + var a = this._ils; + a.push(il); + if (a.length === 1) { + if (this._stopID !== NO) { + clearTimeout(this._stopID); + this._stopID = NO; + } + var p = this._prod; + if (p !== NO) + p._start(this); + } + }; + Stream.prototype._remove = function (il) { + var _this = this; + var ta = this._target; + if (ta !== NO) + return ta._remove(il); + var a = this._ils; + var i = a.indexOf(il); + if (i > -1) { + a.splice(i, 1); + if (this._prod !== NO && a.length <= 0) { + this._err = NO; + this._stopID = setTimeout(function () { return _this._lateStop(); }); + } + else if (a.length === 1) { + this._pruneCycles(); + } + } + }; + // If all paths stemming from `this` stream eventually end at `this` + // stream, then we remove the single listener of `this` stream, to + // force it to end its execution and dispose resources. This method + // assumes as a precondition that this._ils has just one listener. + Stream.prototype._pruneCycles = function () { + if (this._hasNoSinks(this, [])) { + this._remove(this._ils[0]); + } + }; + // Checks whether *there is no* path starting from `x` that leads to an end + // listener (sink) in the stream graph, following edges A->B where B is a + // listener of A. This means these paths constitute a cycle somehow. Is given + // a trace of all visited nodes so far. + Stream.prototype._hasNoSinks = function (x, trace) { + if (trace.indexOf(x) !== -1) { + return true; + } + else if (x.out === this) { + return true; + } + else if (x.out && x.out !== NO) { + return this._hasNoSinks(x.out, trace.concat(x)); + } + else if (x._ils) { + for (var i = 0, N = x._ils.length; i < N; i++) { + if (!this._hasNoSinks(x._ils[i], trace.concat(x))) { + return false; + } + } + return true; + } + else { + return false; + } + }; + Stream.prototype.ctor = function () { + return this instanceof MemoryStream ? MemoryStream : Stream; + }; + /** + * Adds a Listener to the Stream. + * + * @param {Listener} listener + */ + Stream.prototype.addListener = function (listener) { + if (typeof listener.next !== 'function' + || typeof listener.error !== 'function' + || typeof listener.complete !== 'function') { + throw new Error('stream.addListener() requires all three next, error, ' + + 'and complete functions.'); + } + listener._n = listener.next; + listener._e = listener.error; + listener._c = listener.complete; + this._add(listener); + }; + /** + * Removes a Listener from the Stream, assuming the Listener was added to it. + * + * @param {Listener} listener + */ + Stream.prototype.removeListener = function (listener) { + this._remove(listener); + }; + /** + * Creates a new Stream given a Producer. + * + * @factory true + * @param {Producer} producer An optional Producer that dictates how to + * start, generate events, and stop the Stream. + * @return {Stream} + */ + Stream.create = function (producer) { + if (producer) { + if (typeof producer.start !== 'function' + || typeof producer.stop !== 'function') { + throw new Error('producer requires both start and stop functions'); + } + internalizeProducer(producer); // mutates the input + } + return new Stream(producer); + }; + /** + * Creates a new MemoryStream given a Producer. + * + * @factory true + * @param {Producer} producer An optional Producer that dictates how to + * start, generate events, and stop the Stream. + * @return {MemoryStream} + */ + Stream.createWithMemory = function (producer) { + if (producer) { + internalizeProducer(producer); // mutates the input + } + return new MemoryStream(producer); + }; + /** + * Creates a Stream that does nothing when started. It never emits any event. + * + * Marble diagram: + * + * ```text + * never + * ----------------------- + * ``` + * + * @factory true + * @return {Stream} + */ + Stream.never = function () { + return new Stream({ _start: noop, _stop: noop }); + }; + /** + * Creates a Stream that immediately emits the "complete" notification when + * started, and that's it. + * + * Marble diagram: + * + * ```text + * empty + * -| + * ``` + * + * @factory true + * @return {Stream} + */ + Stream.empty = function () { + return new Stream({ + _start: function (il) { il._c(); }, + _stop: noop, + }); + }; + /** + * Creates a Stream that immediately emits an "error" notification with the + * value you passed as the `error` argument when the stream starts, and that's + * it. + * + * Marble diagram: + * + * ```text + * throw(X) + * -X + * ``` + * + * @factory true + * @param error The error event to emit on the created stream. + * @return {Stream} + */ + Stream.throw = function (error) { + return new Stream({ + _start: function (il) { il._e(error); }, + _stop: noop, + }); + }; + /** + * Creates a Stream that immediately emits the arguments that you give to + * *of*, then completes. + * + * Marble diagram: + * + * ```text + * of(1,2,3) + * 123| + * ``` + * + * @factory true + * @param a The first value you want to emit as an event on the stream. + * @param b The second value you want to emit as an event on the stream. One + * or more of these values may be given as arguments. + * @return {Stream} + */ + Stream.of = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i - 0] = arguments[_i]; + } + return Stream.fromArray(items); + }; + /** + * Converts an array to a stream. The returned stream will emit synchronously + * all the items in the array, and then complete. + * + * Marble diagram: + * + * ```text + * fromArray([1,2,3]) + * 123| + * ``` + * + * @factory true + * @param {Array} array The array to be converted as a stream. + * @return {Stream} + */ + Stream.fromArray = function (array) { + return new Stream(new FromArrayProducer(array)); + }; + /** + * Converts a promise to a stream. The returned stream will emit the resolved + * value of the promise, and then complete. However, if the promise is + * rejected, the stream will emit the corresponding error. + * + * Marble diagram: + * + * ```text + * fromPromise( ----42 ) + * -----------------42| + * ``` + * + * @factory true + * @param {Promise} promise The promise to be converted as a stream. + * @return {Stream} + */ + Stream.fromPromise = function (promise) { + return new Stream(new FromPromiseProducer(promise)); + }; + /** + * Creates a stream that periodically emits incremental numbers, every + * `period` milliseconds. + * + * Marble diagram: + * + * ```text + * periodic(1000) + * ---0---1---2---3---4---... + * ``` + * + * @factory true + * @param {number} period The interval in milliseconds to use as a rate of + * emission. + * @return {Stream} + */ + Stream.periodic = function (period) { + return new Stream(new PeriodicProducer(period)); + }; + /** + * Blends multiple streams together, emitting events from all of them + * concurrently. + * + * *merge* takes multiple streams as arguments, and creates a stream that + * behaves like each of the argument streams, in parallel. + * + * Marble diagram: + * + * ```text + * --1----2-----3--------4--- + * ----a-----b----c---d------ + * merge + * --1-a--2--b--3-c---d--4--- + * ``` + * + * @factory true + * @param {Stream} stream1 A stream to merge together with other streams. + * @param {Stream} stream2 A stream to merge together with other streams. Two + * or more streams may be given as arguments. + * @return {Stream} + */ + Stream.merge = function () { + var streams = []; + for (var _i = 0; _i < arguments.length; _i++) { + streams[_i - 0] = arguments[_i]; + } + return new Stream(new MergeProducer(streams)); + }; + Stream.prototype._map = function (project) { + var p = this._prod; + var ctor = this.ctor(); + if (p instanceof FilterOperator) { + return new ctor(new FilterMapOperator(p.passes, project, p.ins)); + } + if (p instanceof FilterMapOperator) { + return new ctor(new FilterMapOperator(p.passes, compose2(project, p.project), p.ins)); + } + if (p instanceof MapOperator) { + return new ctor(new MapOperator(compose2(project, p.project), p.ins)); + } + return new ctor(new MapOperator(project, this)); + }; + /** + * Transforms each event from the input Stream through a `project` function, + * to get a Stream that emits those transformed events. + * + * Marble diagram: + * + * ```text + * --1---3--5-----7------ + * map(i => i * 10) + * --10--30-50----70----- + * ``` + * + * @param {Function} project A function of type `(t: T) => U` that takes event + * `t` of type `T` from the input Stream and produces an event of type `U`, to + * be emitted on the output Stream. + * @return {Stream} + */ + Stream.prototype.map = function (project) { + return this._map(project); + }; + /** + * It's like `map`, but transforms each input event to always the same + * constant value on the output Stream. + * + * Marble diagram: + * + * ```text + * --1---3--5-----7----- + * mapTo(10) + * --10--10-10----10---- + * ``` + * + * @param projectedValue A value to emit on the output Stream whenever the + * input Stream emits any value. + * @return {Stream} + */ + Stream.prototype.mapTo = function (projectedValue) { + var s = this.map(function () { return projectedValue; }); + var op = s._prod; + op.type = op.type.replace('map', 'mapTo'); + return s; + }; + /** + * Only allows events that pass the test given by the `passes` argument. + * + * Each event from the input stream is given to the `passes` function. If the + * function returns `true`, the event is forwarded to the output stream, + * otherwise it is ignored and not forwarded. + * + * Marble diagram: + * + * ```text + * --1---2--3-----4-----5---6--7-8-- + * filter(i => i % 2 === 0) + * ------2--------4---------6----8-- + * ``` + * + * @param {Function} passes A function of type `(t: T) +> boolean` that takes + * an event from the input stream and checks if it passes, by returning a + * boolean. + * @return {Stream} + */ + Stream.prototype.filter = function (passes) { + var p = this._prod; + if (p instanceof FilterOperator) { + return new Stream(new FilterOperator(and(passes, p.passes), p.ins)); + } + return new Stream(new FilterOperator(passes, this)); + }; + /** + * Lets the first `amount` many events from the input stream pass to the + * output stream, then makes the output stream complete. + * + * Marble diagram: + * + * ```text + * --a---b--c----d---e-- + * take(3) + * --a---b--c| + * ``` + * + * @param {number} amount How many events to allow from the input stream + * before completing the output stream. + * @return {Stream} + */ + Stream.prototype.take = function (amount) { + return new (this.ctor())(new TakeOperator(amount, this)); + }; + /** + * Ignores the first `amount` many events from the input stream, and then + * after that starts forwarding events from the input stream to the output + * stream. + * + * Marble diagram: + * + * ```text + * --a---b--c----d---e-- + * drop(3) + * --------------d---e-- + * ``` + * + * @param {number} amount How many events to ignore from the input stream + * before forwarding all events from the input stream to the output stream. + * @return {Stream} + */ + Stream.prototype.drop = function (amount) { + return new Stream(new DropOperator(amount, this)); + }; + /** + * When the input stream completes, the output stream will emit the last event + * emitted by the input stream, and then will also complete. + * + * Marble diagram: + * + * ```text + * --a---b--c--d----| + * last() + * -----------------d| + * ``` + * + * @return {Stream} + */ + Stream.prototype.last = function () { + return new Stream(new LastOperator(this)); + }; + /** + * Prepends the given `initial` value to the sequence of events emitted by the + * input stream. The returned stream is a MemoryStream, which means it is + * already `remember()`'d. + * + * Marble diagram: + * + * ```text + * ---1---2-----3--- + * startWith(0) + * 0--1---2-----3--- + * ``` + * + * @param initial The value or event to prepend. + * @return {MemoryStream} + */ + Stream.prototype.startWith = function (initial) { + return new MemoryStream(new StartWithOperator(this, initial)); + }; + /** + * Uses another stream to determine when to complete the current stream. + * + * When the given `other` stream emits an event or completes, the output + * stream will complete. Before that happens, the output stream will behaves + * like the input stream. + * + * Marble diagram: + * + * ```text + * ---1---2-----3--4----5----6--- + * endWhen( --------a--b--| ) + * ---1---2-----3--4--| + * ``` + * + * @param other Some other stream that is used to know when should the output + * stream of this operator complete. + * @return {Stream} + */ + Stream.prototype.endWhen = function (other) { + return new (this.ctor())(new EndWhenOperator(other, this)); + }; + /** + * "Folds" the stream onto itself. + * + * Combines events from the past throughout + * the entire execution of the input stream, allowing you to accumulate them + * together. It's essentially like `Array.prototype.reduce`. The returned + * stream is a MemoryStream, which means it is already `remember()`'d. + * + * The output stream starts by emitting the `seed` which you give as argument. + * Then, when an event happens on the input stream, it is combined with that + * seed value through the `accumulate` function, and the output value is + * emitted on the output stream. `fold` remembers that output value as `acc` + * ("accumulator"), and then when a new input event `t` happens, `acc` will be + * combined with that to produce the new `acc` and so forth. + * + * Marble diagram: + * + * ```text + * ------1-----1--2----1----1------ + * fold((acc, x) => acc + x, 3) + * 3-----4-----5--7----8----9------ + * ``` + * + * @param {Function} accumulate A function of type `(acc: R, t: T) => R` that + * takes the previous accumulated value `acc` and the incoming event from the + * input stream and produces the new accumulated value. + * @param seed The initial accumulated value, of type `R`. + * @return {MemoryStream} + */ + Stream.prototype.fold = function (accumulate, seed) { + return new MemoryStream(new FoldOperator(accumulate, seed, this)); + }; + /** + * Replaces an error with another stream. + * + * When (and if) an error happens on the input stream, instead of forwarding + * that error to the output stream, *replaceError* will call the `replace` + * function which returns the stream that the output stream will replicate. + * And, in case that new stream also emits an error, `replace` will be called + * again to get another stream to start replicating. + * + * Marble diagram: + * + * ```text + * --1---2-----3--4-----X + * replaceError( () => --10--| ) + * --1---2-----3--4--------10--| + * ``` + * + * @param {Function} replace A function of type `(err) => Stream` that takes + * the error that occurred on the input stream or on the previous replacement + * stream and returns a new stream. The output stream will behave like the + * stream that this function returns. + * @return {Stream} + */ + Stream.prototype.replaceError = function (replace) { + return new (this.ctor())(new ReplaceErrorOperator(replace, this)); + }; + /** + * Flattens a "stream of streams", handling only one nested stream at a time + * (no concurrency). + * + * If the input stream is a stream that emits streams, then this operator will + * return an output stream which is a flat stream: emits regular events. The + * flattening happens without concurrency. It works like this: when the input + * stream emits a nested stream, *flatten* will start imitating that nested + * one. However, as soon as the next nested stream is emitted on the input + * stream, *flatten* will forget the previous nested one it was imitating, and + * will start imitating the new nested one. + * + * Marble diagram: + * + * ```text + * --+--------+--------------- + * \ \ + * \ ----1----2---3-- + * --a--b----c----d-------- + * flatten + * -----a--b------1----2---3-- + * ``` + * + * @return {Stream} + */ + Stream.prototype.flatten = function () { + var p = this._prod; + return new Stream(p instanceof MapOperator && !(p instanceof FilterMapOperator) ? + new MapFlattenOperator(p) : + new FlattenOperator(this)); + }; + /** + * Passes the input stream to a custom operator, to produce an output stream. + * + * *compose* is a handy way of using an existing function in a chained style. + * Instead of writing `outStream = f(inStream)` you can write + * `outStream = inStream.compose(f)`. + * + * @param {function} operator A function that takes a stream as input and + * returns a stream as well. + * @return {Stream} + */ + Stream.prototype.compose = function (operator) { + return operator(this); + }; + /** + * Returns an output stream that behaves like the input stream, but also + * remembers the most recent event that happens on the input stream, so that a + * newly added listener will immediately receive that memorised event. + * + * @return {MemoryStream} + */ + Stream.prototype.remember = function () { + return new MemoryStream(new RememberOperator(this)); + }; + /** + * Returns an output stream that identically behaves like the input stream, + * but also runs a `spy` function fo each event, to help you debug your app. + * + * *debug* takes a `spy` function as argument, and runs that for each event + * happening on the input stream. If you don't provide the `spy` argument, + * then *debug* will just `console.log` each event. This helps you to + * understand the flow of events through some operator chain. + * + * Please note that if the output stream has no listeners, then it will not + * start, which means `spy` will never run because no actual event happens in + * that case. + * + * Marble diagram: + * + * ```text + * --1----2-----3-----4-- + * debug + * --1----2-----3-----4-- + * ``` + * + * @param {function} labelOrSpy A string to use as the label when printing + * debug information on the console, or a 'spy' function that takes an event + * as argument, and does not need to return anything. + * @return {Stream} + */ + Stream.prototype.debug = function (labelOrSpy) { + return new (this.ctor())(new DebugOperator(labelOrSpy, this)); + }; + /** + * *imitate* changes this current Stream to emit the same events that the + * `other` given Stream does. This method returns nothing. + * + * This method exists to allow one thing: **circular dependency of streams**. + * For instance, let's imagine that for some reason you need to create a + * circular dependency where stream `first$` depends on stream `second$` + * which in turn depends on `first$`: + * + * + * ```js + * import delay from 'xstream/extra/delay' + * + * var first$ = second$.map(x => x * 10).take(3); + * var second$ = first$.map(x => x + 1).startWith(1).compose(delay(100)); + * ``` + * + * However, that is invalid JavaScript, because `second$` is undefined + * on the first line. This is how *imitate* can help solve it: + * + * ```js + * import delay from 'xstream/extra/delay' + * + * var secondProxy$ = xs.create(); + * var first$ = secondProxy$.map(x => x * 10).take(3); + * var second$ = first$.map(x => x + 1).startWith(1).compose(delay(100)); + * secondProxy$.imitate(second$); + * ``` + * + * We create `secondProxy$` before the others, so it can be used in the + * declaration of `first$`. Then, after both `first$` and `second$` are + * defined, we hook `secondProxy$` with `second$` with `imitate()` to tell + * that they are "the same". `imitate` will not trigger the start of any + * stream, it just binds `secondProxy$` and `second$` together. + * + * The following is an example where `imitate()` is important in Cycle.js + * applications. A parent component contains some child components. A child + * has an action stream which is given to the parent to define its state: + * + * + * ```js + * const childActionProxy$ = xs.create(); + * const parent = Parent({...sources, childAction$: childActionProxy$}); + * const childAction$ = parent.state$.map(s => s.child.action$).flatten(); + * childActionProxy$.imitate(childAction$); + * ``` + * + * Note, though, that **`imitate()` does not support MemoryStreams**. If we + * would attempt to imitate a MemoryStream in a circular dependency, we would + * either get a race condition (where the symptom would be "nothing happens") + * or an infinite cyclic emission of values. It's useful to think about + * MemoryStreams as cells in a spreadsheet. It doesn't make any sense to + * define a spreadsheet cell `A1` with a formula that depends on `B1` and + * cell `B1` defined with a formula that depends on `A1`. + * + * If you find yourself wanting to use `imitate()` with a + * MemoryStream, you should rework your code around `imitate()` to use a + * Stream instead. Look for the stream in the circular dependency that + * represents an event stream, and that would be a candidate for creating a + * proxy Stream which then imitates the target Stream. + * + * @param {Stream} target The other stream to imitate on the current one. Must + * not be a MemoryStream. + */ + Stream.prototype.imitate = function (target) { + if (target instanceof MemoryStream) { + throw new Error('A MemoryStream was given to imitate(), but it only ' + + 'supports a Stream. Read more about this restriction here: ' + + 'https://github.com/staltz/xstream#faq'); + } + this._target = target; + for (var ils = this._ils, N = ils.length, i = 0; i < N; i++) { + target._add(ils[i]); + } + this._ils = []; + }; + /** + * Forces the Stream to emit the given value to its listeners. + * + * As the name indicates, if you use this, you are most likely doing something + * The Wrong Way. Please try to understand the reactive way before using this + * method. Use it only when you know what you are doing. + * + * @param value The "next" value you want to broadcast to all listeners of + * this Stream. + */ + Stream.prototype.shamefullySendNext = function (value) { + this._n(value); + }; + /** + * Forces the Stream to emit the given error to its listeners. + * + * As the name indicates, if you use this, you are most likely doing something + * The Wrong Way. Please try to understand the reactive way before using this + * method. Use it only when you know what you are doing. + * + * @param {any} error The error you want to broadcast to all the listeners of + * this Stream. + */ + Stream.prototype.shamefullySendError = function (error) { + this._e(error); + }; + /** + * Forces the Stream to emit the "completed" event to its listeners. + * + * As the name indicates, if you use this, you are most likely doing something + * The Wrong Way. Please try to understand the reactive way before using this + * method. Use it only when you know what you are doing. + */ + Stream.prototype.shamefullySendComplete = function () { + this._c(); + }; + /** + * Combines multiple input streams together to return a stream whose events + * are arrays that collect the latest events from each input stream. + * + * *combine* internally remembers the most recent event from each of the input + * streams. When any of the input streams emits an event, that event together + * with all the other saved events are combined into an array. That array will + * be emitted on the output stream. It's essentially a way of joining together + * the events from multiple streams. + * + * Marble diagram: + * + * ```text + * --1----2-----3--------4--- + * ----a-----b-----c--d------ + * combine + * ----1a-2a-2b-3b-3c-3d-4d-- + * ``` + * + * @factory true + * @param {Stream} stream1 A stream to combine together with other streams. + * @param {Stream} stream2 A stream to combine together with other streams. + * Multiple streams, not just two, may be given as arguments. + * @return {Stream} + */ + Stream.combine = function combine() { + var streams = []; + for (var _i = 0; _i < arguments.length; _i++) { + streams[_i - 0] = arguments[_i]; + } + return new Stream(new CombineProducer(streams)); + }; + return Stream; + }()); + exports.Stream = Stream; + var MemoryStream = (function (_super) { + __extends(MemoryStream, _super); + function MemoryStream(producer) { + _super.call(this, producer); + this._has = false; + } + MemoryStream.prototype._n = function (x) { + this._v = x; + this._has = true; + _super.prototype._n.call(this, x); + }; + MemoryStream.prototype._add = function (il) { + if (this._has) { + il._n(this._v); + } + _super.prototype._add.call(this, il); + }; + MemoryStream.prototype._lateStop = function () { + this._has = false; + _super.prototype._lateStop.call(this); + }; + MemoryStream.prototype._x = function () { + this._has = false; + _super.prototype._x.call(this); + }; + MemoryStream.prototype.map = function (project) { + return this._map(project); + }; + MemoryStream.prototype.mapTo = function (projectedValue) { + return _super.prototype.mapTo.call(this, projectedValue); + }; + MemoryStream.prototype.take = function (amount) { + return _super.prototype.take.call(this, amount); + }; + MemoryStream.prototype.endWhen = function (other) { + return _super.prototype.endWhen.call(this, other); + }; + MemoryStream.prototype.replaceError = function (replace) { + return _super.prototype.replaceError.call(this, replace); + }; + MemoryStream.prototype.debug = function (labelOrSpy) { + return _super.prototype.debug.call(this, labelOrSpy); + }; + return MemoryStream; + }(Stream)); + exports.MemoryStream = MemoryStream; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Stream; + //# sourceMappingURL=core.js.map + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright (c) 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + (function (global, factory) { + true ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.Immutable = factory()); + }(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice; + + function createClass(ctor, superClass) { + if (superClass) { + ctor.prototype = Object.create(superClass.prototype); + } + ctor.prototype.constructor = ctor; + } + + function Iterable(value) { + return isIterable(value) ? value : Seq(value); + } + + + createClass(KeyedIterable, Iterable); + function KeyedIterable(value) { + return isKeyed(value) ? value : KeyedSeq(value); + } + + + createClass(IndexedIterable, Iterable); + function IndexedIterable(value) { + return isIndexed(value) ? value : IndexedSeq(value); + } + + + createClass(SetIterable, Iterable); + function SetIterable(value) { + return isIterable(value) && !isAssociative(value) ? value : SetSeq(value); + } + + + + function isIterable(maybeIterable) { + return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]); + } + + function isKeyed(maybeKeyed) { + return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]); + } + + function isIndexed(maybeIndexed) { + return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]); + } + + function isAssociative(maybeAssociative) { + return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); + } + + function isOrdered(maybeOrdered) { + return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]); + } + + Iterable.isIterable = isIterable; + Iterable.isKeyed = isKeyed; + Iterable.isIndexed = isIndexed; + Iterable.isAssociative = isAssociative; + Iterable.isOrdered = isOrdered; + + Iterable.Keyed = KeyedIterable; + Iterable.Indexed = IndexedIterable; + Iterable.Set = SetIterable; + + + var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; + var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; + var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; + var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; + + // Used for setting prototype methods that IE8 chokes on. + var DELETE = 'delete'; + + // Constants describing the size of trie nodes. + var SHIFT = 5; // Resulted in best performance after ______? + var SIZE = 1 << SHIFT; + var MASK = SIZE - 1; + + // A consistent shared value representing "not set" which equals nothing other + // than itself, and nothing that could be provided externally. + var NOT_SET = {}; + + // Boolean references, Rough equivalent of `bool &`. + var CHANGE_LENGTH = { value: false }; + var DID_ALTER = { value: false }; + + function MakeRef(ref) { + ref.value = false; + return ref; + } + + function SetRef(ref) { + ref && (ref.value = true); + } + + // A function which returns a value representing an "owner" for transient writes + // to tries. The return value will only ever equal itself, and will not equal + // the return of any subsequent call of this function. + function OwnerID() {} + + // http://jsperf.com/copy-array-inline + function arrCopy(arr, offset) { + offset = offset || 0; + var len = Math.max(0, arr.length - offset); + var newArr = new Array(len); + for (var ii = 0; ii < len; ii++) { + newArr[ii] = arr[ii + offset]; + } + return newArr; + } + + function ensureSize(iter) { + if (iter.size === undefined) { + iter.size = iter.__iterate(returnTrue); + } + return iter.size; + } + + function wrapIndex(iter, index) { + // This implements "is array index" which the ECMAString spec defines as: + // + // A String property name P is an array index if and only if + // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal + // to 2^32−1. + // + // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects + if (typeof index !== 'number') { + var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32 + if ('' + uint32Index !== index || uint32Index === 4294967295) { + return NaN; + } + index = uint32Index; + } + return index < 0 ? ensureSize(iter) + index : index; + } + + function returnTrue() { + return true; + } + + function wholeSlice(begin, end, size) { + return (begin === 0 || (size !== undefined && begin <= -size)) && + (end === undefined || (size !== undefined && end >= size)); + } + + function resolveBegin(begin, size) { + return resolveIndex(begin, size, 0); + } + + function resolveEnd(end, size) { + return resolveIndex(end, size, size); + } + + function resolveIndex(index, size, defaultIndex) { + return index === undefined ? + defaultIndex : + index < 0 ? + Math.max(0, size + index) : + size === undefined ? + index : + Math.min(size, index); + } + + /* global Symbol */ + + var ITERATE_KEYS = 0; + var ITERATE_VALUES = 1; + var ITERATE_ENTRIES = 2; + + var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + + var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; + + + function Iterator(next) { + this.next = next; + } + + Iterator.prototype.toString = function() { + return '[Iterator]'; + }; + + + Iterator.KEYS = ITERATE_KEYS; + Iterator.VALUES = ITERATE_VALUES; + Iterator.ENTRIES = ITERATE_ENTRIES; + + Iterator.prototype.inspect = + Iterator.prototype.toSource = function () { return this.toString(); } + Iterator.prototype[ITERATOR_SYMBOL] = function () { + return this; + }; + + + function iteratorValue(type, k, v, iteratorResult) { + var value = type === 0 ? k : type === 1 ? v : [k, v]; + iteratorResult ? (iteratorResult.value = value) : (iteratorResult = { + value: value, done: false + }); + return iteratorResult; + } + + function iteratorDone() { + return { value: undefined, done: true }; + } + + function hasIterator(maybeIterable) { + return !!getIteratorFn(maybeIterable); + } + + function isIterator(maybeIterator) { + return maybeIterator && typeof maybeIterator.next === 'function'; + } + + function getIterator(iterable) { + var iteratorFn = getIteratorFn(iterable); + return iteratorFn && iteratorFn.call(iterable); + } + + function getIteratorFn(iterable) { + var iteratorFn = iterable && ( + (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || + iterable[FAUX_ITERATOR_SYMBOL] + ); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + function isArrayLike(value) { + return value && typeof value.length === 'number'; + } + + createClass(Seq, Iterable); + function Seq(value) { + return value === null || value === undefined ? emptySequence() : + isIterable(value) ? value.toSeq() : seqFromValue(value); + } + + Seq.of = function(/*...values*/) { + return Seq(arguments); + }; + + Seq.prototype.toSeq = function() { + return this; + }; + + Seq.prototype.toString = function() { + return this.__toString('Seq {', '}'); + }; + + Seq.prototype.cacheResult = function() { + if (!this._cache && this.__iterateUncached) { + this._cache = this.entrySeq().toArray(); + this.size = this._cache.length; + } + return this; + }; + + // abstract __iterateUncached(fn, reverse) + + Seq.prototype.__iterate = function(fn, reverse) { + return seqIterate(this, fn, reverse, true); + }; + + // abstract __iteratorUncached(type, reverse) + + Seq.prototype.__iterator = function(type, reverse) { + return seqIterator(this, type, reverse, true); + }; + + + + createClass(KeyedSeq, Seq); + function KeyedSeq(value) { + return value === null || value === undefined ? + emptySequence().toKeyedSeq() : + isIterable(value) ? + (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : + keyedSeqFromValue(value); + } + + KeyedSeq.prototype.toKeyedSeq = function() { + return this; + }; + + + + createClass(IndexedSeq, Seq); + function IndexedSeq(value) { + return value === null || value === undefined ? emptySequence() : + !isIterable(value) ? indexedSeqFromValue(value) : + isKeyed(value) ? value.entrySeq() : value.toIndexedSeq(); + } + + IndexedSeq.of = function(/*...values*/) { + return IndexedSeq(arguments); + }; + + IndexedSeq.prototype.toIndexedSeq = function() { + return this; + }; + + IndexedSeq.prototype.toString = function() { + return this.__toString('Seq [', ']'); + }; + + IndexedSeq.prototype.__iterate = function(fn, reverse) { + return seqIterate(this, fn, reverse, false); + }; + + IndexedSeq.prototype.__iterator = function(type, reverse) { + return seqIterator(this, type, reverse, false); + }; + + + + createClass(SetSeq, Seq); + function SetSeq(value) { + return ( + value === null || value === undefined ? emptySequence() : + !isIterable(value) ? indexedSeqFromValue(value) : + isKeyed(value) ? value.entrySeq() : value + ).toSetSeq(); + } + + SetSeq.of = function(/*...values*/) { + return SetSeq(arguments); + }; + + SetSeq.prototype.toSetSeq = function() { + return this; + }; + + + + Seq.isSeq = isSeq; + Seq.Keyed = KeyedSeq; + Seq.Set = SetSeq; + Seq.Indexed = IndexedSeq; + + var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; + + Seq.prototype[IS_SEQ_SENTINEL] = true; + + + + createClass(ArraySeq, IndexedSeq); + function ArraySeq(array) { + this._array = array; + this.size = array.length; + } + + ArraySeq.prototype.get = function(index, notSetValue) { + return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; + }; + + ArraySeq.prototype.__iterate = function(fn, reverse) { + var array = this._array; + var maxIndex = array.length - 1; + for (var ii = 0; ii <= maxIndex; ii++) { + if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) { + return ii + 1; + } + } + return ii; + }; + + ArraySeq.prototype.__iterator = function(type, reverse) { + var array = this._array; + var maxIndex = array.length - 1; + var ii = 0; + return new Iterator(function() + {return ii > maxIndex ? + iteratorDone() : + iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])} + ); + }; + + + + createClass(ObjectSeq, KeyedSeq); + function ObjectSeq(object) { + var keys = Object.keys(object); + this._object = object; + this._keys = keys; + this.size = keys.length; + } + + ObjectSeq.prototype.get = function(key, notSetValue) { + if (notSetValue !== undefined && !this.has(key)) { + return notSetValue; + } + return this._object[key]; + }; + + ObjectSeq.prototype.has = function(key) { + return this._object.hasOwnProperty(key); + }; + + ObjectSeq.prototype.__iterate = function(fn, reverse) { + var object = this._object; + var keys = this._keys; + var maxIndex = keys.length - 1; + for (var ii = 0; ii <= maxIndex; ii++) { + var key = keys[reverse ? maxIndex - ii : ii]; + if (fn(object[key], key, this) === false) { + return ii + 1; + } + } + return ii; + }; + + ObjectSeq.prototype.__iterator = function(type, reverse) { + var object = this._object; + var keys = this._keys; + var maxIndex = keys.length - 1; + var ii = 0; + return new Iterator(function() { + var key = keys[reverse ? maxIndex - ii : ii]; + return ii++ > maxIndex ? + iteratorDone() : + iteratorValue(type, key, object[key]); + }); + }; + + ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true; + + + createClass(IterableSeq, IndexedSeq); + function IterableSeq(iterable) { + this._iterable = iterable; + this.size = iterable.length || iterable.size; + } + + IterableSeq.prototype.__iterateUncached = function(fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterable = this._iterable; + var iterator = getIterator(iterable); + var iterations = 0; + if (isIterator(iterator)) { + var step; + while (!(step = iterator.next()).done) { + if (fn(step.value, iterations++, this) === false) { + break; + } + } + } + return iterations; + }; + + IterableSeq.prototype.__iteratorUncached = function(type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterable = this._iterable; + var iterator = getIterator(iterable); + if (!isIterator(iterator)) { + return new Iterator(iteratorDone); + } + var iterations = 0; + return new Iterator(function() { + var step = iterator.next(); + return step.done ? step : iteratorValue(type, iterations++, step.value); + }); + }; + + + + createClass(IteratorSeq, IndexedSeq); + function IteratorSeq(iterator) { + this._iterator = iterator; + this._iteratorCache = []; + } + + IteratorSeq.prototype.__iterateUncached = function(fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterator = this._iterator; + var cache = this._iteratorCache; + var iterations = 0; + while (iterations < cache.length) { + if (fn(cache[iterations], iterations++, this) === false) { + return iterations; + } + } + var step; + while (!(step = iterator.next()).done) { + var val = step.value; + cache[iterations] = val; + if (fn(val, iterations++, this) === false) { + break; + } + } + return iterations; + }; + + IteratorSeq.prototype.__iteratorUncached = function(type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = this._iterator; + var cache = this._iteratorCache; + var iterations = 0; + return new Iterator(function() { + if (iterations >= cache.length) { + var step = iterator.next(); + if (step.done) { + return step; + } + cache[iterations] = step.value; + } + return iteratorValue(type, iterations, cache[iterations++]); + }); + }; + + + + + // # pragma Helper functions + + function isSeq(maybeSeq) { + return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]); + } + + var EMPTY_SEQ; + + function emptySequence() { + return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); + } + + function keyedSeqFromValue(value) { + var seq = + Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : + isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : + hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : + typeof value === 'object' ? new ObjectSeq(value) : + undefined; + if (!seq) { + throw new TypeError( + 'Expected Array or iterable object of [k, v] entries, '+ + 'or keyed object: ' + value + ); + } + return seq; + } + + function indexedSeqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (!seq) { + throw new TypeError( + 'Expected Array or iterable object of values: ' + value + ); + } + return seq; + } + + function seqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value) || + (typeof value === 'object' && new ObjectSeq(value)); + if (!seq) { + throw new TypeError( + 'Expected Array or iterable object of values, or keyed object: ' + value + ); + } + return seq; + } + + function maybeIndexedSeqFromValue(value) { + return ( + isArrayLike(value) ? new ArraySeq(value) : + isIterator(value) ? new IteratorSeq(value) : + hasIterator(value) ? new IterableSeq(value) : + undefined + ); + } + + function seqIterate(seq, fn, reverse, useKeys) { + var cache = seq._cache; + if (cache) { + var maxIndex = cache.length - 1; + for (var ii = 0; ii <= maxIndex; ii++) { + var entry = cache[reverse ? maxIndex - ii : ii]; + if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) { + return ii + 1; + } + } + return ii; + } + return seq.__iterateUncached(fn, reverse); + } + + function seqIterator(seq, type, reverse, useKeys) { + var cache = seq._cache; + if (cache) { + var maxIndex = cache.length - 1; + var ii = 0; + return new Iterator(function() { + var entry = cache[reverse ? maxIndex - ii : ii]; + return ii++ > maxIndex ? + iteratorDone() : + iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]); + }); + } + return seq.__iteratorUncached(type, reverse); + } + + function fromJS(json, converter) { + return converter ? + fromJSWith(converter, json, '', {'': json}) : + fromJSDefault(json); + } + + function fromJSWith(converter, json, key, parentJSON) { + if (Array.isArray(json)) { + return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); + } + if (isPlainObj(json)) { + return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); + } + return json; + } + + function fromJSDefault(json) { + if (Array.isArray(json)) { + return IndexedSeq(json).map(fromJSDefault).toList(); + } + if (isPlainObj(json)) { + return KeyedSeq(json).map(fromJSDefault).toMap(); + } + return json; + } + + function isPlainObj(value) { + return value && (value.constructor === Object || value.constructor === undefined); + } + + /** + * An extension of the "same-value" algorithm as [described for use by ES6 Map + * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality) + * + * NaN is considered the same as NaN, however -0 and 0 are considered the same + * value, which is different from the algorithm described by + * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * This is extended further to allow Objects to describe the values they + * represent, by way of `valueOf` or `equals` (and `hashCode`). + * + * Note: because of this extension, the key equality of Immutable.Map and the + * value equality of Immutable.Set will differ from ES6 Map and Set. + * + * ### Defining custom values + * + * The easiest way to describe the value an object represents is by implementing + * `valueOf`. For example, `Date` represents a value by returning a unix + * timestamp for `valueOf`: + * + * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ... + * var date2 = new Date(1234567890000); + * date1.valueOf(); // 1234567890000 + * assert( date1 !== date2 ); + * assert( Immutable.is( date1, date2 ) ); + * + * Note: overriding `valueOf` may have other implications if you use this object + * where JavaScript expects a primitive, such as implicit string coercion. + * + * For more complex types, especially collections, implementing `valueOf` may + * not be performant. An alternative is to implement `equals` and `hashCode`. + * + * `equals` takes another object, presumably of similar type, and returns true + * if the it is equal. Equality is symmetrical, so the same result should be + * returned if this and the argument are flipped. + * + * assert( a.equals(b) === b.equals(a) ); + * + * `hashCode` returns a 32bit integer number representing the object which will + * be used to determine how to store the value object in a Map or Set. You must + * provide both or neither methods, one must not exist without the other. + * + * Also, an important relationship between these methods must be upheld: if two + * values are equal, they *must* return the same hashCode. If the values are not + * equal, they might have the same hashCode; this is called a hash collision, + * and while undesirable for performance reasons, it is acceptable. + * + * if (a.equals(b)) { + * assert( a.hashCode() === b.hashCode() ); + * } + * + * All Immutable collections implement `equals` and `hashCode`. + * + */ + function is(valueA, valueB) { + if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { + return true; + } + if (!valueA || !valueB) { + return false; + } + if (typeof valueA.valueOf === 'function' && + typeof valueB.valueOf === 'function') { + valueA = valueA.valueOf(); + valueB = valueB.valueOf(); + if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { + return true; + } + if (!valueA || !valueB) { + return false; + } + } + if (typeof valueA.equals === 'function' && + typeof valueB.equals === 'function' && + valueA.equals(valueB)) { + return true; + } + return false; + } + + function deepEqual(a, b) { + if (a === b) { + return true; + } + + if ( + !isIterable(b) || + a.size !== undefined && b.size !== undefined && a.size !== b.size || + a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || + isKeyed(a) !== isKeyed(b) || + isIndexed(a) !== isIndexed(b) || + isOrdered(a) !== isOrdered(b) + ) { + return false; + } + + if (a.size === 0 && b.size === 0) { + return true; + } + + var notAssociative = !isAssociative(a); + + if (isOrdered(a)) { + var entries = a.entries(); + return b.every(function(v, k) { + var entry = entries.next().value; + return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); + }) && entries.next().done; + } + + var flipped = false; + + if (a.size === undefined) { + if (b.size === undefined) { + if (typeof a.cacheResult === 'function') { + a.cacheResult(); + } + } else { + flipped = true; + var _ = a; + a = b; + b = _; + } + } + + var allEqual = true; + var bSize = b.__iterate(function(v, k) { + if (notAssociative ? !a.has(v) : + flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) { + allEqual = false; + return false; + } + }); + + return allEqual && a.size === bSize; + } + + createClass(Repeat, IndexedSeq); + + function Repeat(value, times) { + if (!(this instanceof Repeat)) { + return new Repeat(value, times); + } + this._value = value; + this.size = times === undefined ? Infinity : Math.max(0, times); + if (this.size === 0) { + if (EMPTY_REPEAT) { + return EMPTY_REPEAT; + } + EMPTY_REPEAT = this; + } + } + + Repeat.prototype.toString = function() { + if (this.size === 0) { + return 'Repeat []'; + } + return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; + }; + + Repeat.prototype.get = function(index, notSetValue) { + return this.has(index) ? this._value : notSetValue; + }; + + Repeat.prototype.includes = function(searchValue) { + return is(this._value, searchValue); + }; + + Repeat.prototype.slice = function(begin, end) { + var size = this.size; + return wholeSlice(begin, end, size) ? this : + new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size)); + }; + + Repeat.prototype.reverse = function() { + return this; + }; + + Repeat.prototype.indexOf = function(searchValue) { + if (is(this._value, searchValue)) { + return 0; + } + return -1; + }; + + Repeat.prototype.lastIndexOf = function(searchValue) { + if (is(this._value, searchValue)) { + return this.size; + } + return -1; + }; + + Repeat.prototype.__iterate = function(fn, reverse) { + for (var ii = 0; ii < this.size; ii++) { + if (fn(this._value, ii, this) === false) { + return ii + 1; + } + } + return ii; + }; + + Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this; + var ii = 0; + return new Iterator(function() + {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()} + ); + }; + + Repeat.prototype.equals = function(other) { + return other instanceof Repeat ? + is(this._value, other._value) : + deepEqual(other); + }; + + + var EMPTY_REPEAT; + + function invariant(condition, error) { + if (!condition) throw new Error(error); + } + + createClass(Range, IndexedSeq); + + function Range(start, end, step) { + if (!(this instanceof Range)) { + return new Range(start, end, step); + } + invariant(step !== 0, 'Cannot step a Range by 0'); + start = start || 0; + if (end === undefined) { + end = Infinity; + } + step = step === undefined ? 1 : Math.abs(step); + if (end < start) { + step = -step; + } + this._start = start; + this._end = end; + this._step = step; + this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); + if (this.size === 0) { + if (EMPTY_RANGE) { + return EMPTY_RANGE; + } + EMPTY_RANGE = this; + } + } + + Range.prototype.toString = function() { + if (this.size === 0) { + return 'Range []'; + } + return 'Range [ ' + + this._start + '...' + this._end + + (this._step !== 1 ? ' by ' + this._step : '') + + ' ]'; + }; + + Range.prototype.get = function(index, notSetValue) { + return this.has(index) ? + this._start + wrapIndex(this, index) * this._step : + notSetValue; + }; + + Range.prototype.includes = function(searchValue) { + var possibleIndex = (searchValue - this._start) / this._step; + return possibleIndex >= 0 && + possibleIndex < this.size && + possibleIndex === Math.floor(possibleIndex); + }; + + Range.prototype.slice = function(begin, end) { + if (wholeSlice(begin, end, this.size)) { + return this; + } + begin = resolveBegin(begin, this.size); + end = resolveEnd(end, this.size); + if (end <= begin) { + return new Range(0, 0); + } + return new Range(this.get(begin, this._end), this.get(end, this._end), this._step); + }; + + Range.prototype.indexOf = function(searchValue) { + var offsetValue = searchValue - this._start; + if (offsetValue % this._step === 0) { + var index = offsetValue / this._step; + if (index >= 0 && index < this.size) { + return index + } + } + return -1; + }; + + Range.prototype.lastIndexOf = function(searchValue) { + return this.indexOf(searchValue); + }; + + Range.prototype.__iterate = function(fn, reverse) { + var maxIndex = this.size - 1; + var step = this._step; + var value = reverse ? this._start + maxIndex * step : this._start; + for (var ii = 0; ii <= maxIndex; ii++) { + if (fn(value, ii, this) === false) { + return ii + 1; + } + value += reverse ? -step : step; + } + return ii; + }; + + Range.prototype.__iterator = function(type, reverse) { + var maxIndex = this.size - 1; + var step = this._step; + var value = reverse ? this._start + maxIndex * step : this._start; + var ii = 0; + return new Iterator(function() { + var v = value; + value += reverse ? -step : step; + return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v); + }); + }; + + Range.prototype.equals = function(other) { + return other instanceof Range ? + this._start === other._start && + this._end === other._end && + this._step === other._step : + deepEqual(this, other); + }; + + + var EMPTY_RANGE; + + createClass(Collection, Iterable); + function Collection() { + throw TypeError('Abstract'); + } + + + createClass(KeyedCollection, Collection);function KeyedCollection() {} + + createClass(IndexedCollection, Collection);function IndexedCollection() {} + + createClass(SetCollection, Collection);function SetCollection() {} + + + Collection.Keyed = KeyedCollection; + Collection.Indexed = IndexedCollection; + Collection.Set = SetCollection; + + var imul = + typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? + Math.imul : + function imul(a, b) { + a = a | 0; // int + b = b | 0; // int + var c = a & 0xffff; + var d = b & 0xffff; + // Shift by 0 fixes the sign on the high part. + return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int + }; + + // v8 has an optimization for storing 31-bit signed numbers. + // Values which have either 00 or 11 as the high order bits qualify. + // This function drops the highest order bit in a signed number, maintaining + // the sign bit. + function smi(i32) { + return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF); + } + + function hash(o) { + if (o === false || o === null || o === undefined) { + return 0; + } + if (typeof o.valueOf === 'function') { + o = o.valueOf(); + if (o === false || o === null || o === undefined) { + return 0; + } + } + if (o === true) { + return 1; + } + var type = typeof o; + if (type === 'number') { + if (o !== o || o === Infinity) { + return 0; + } + var h = o | 0; + if (h !== o) { + h ^= o * 0xFFFFFFFF; + } + while (o > 0xFFFFFFFF) { + o /= 0xFFFFFFFF; + h ^= o; + } + return smi(h); + } + if (type === 'string') { + return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o); + } + if (typeof o.hashCode === 'function') { + return o.hashCode(); + } + if (type === 'object') { + return hashJSObj(o); + } + if (typeof o.toString === 'function') { + return hashString(o.toString()); + } + throw new Error('Value type ' + type + ' cannot be hashed.'); + } + + function cachedHashString(string) { + var hash = stringHashCache[string]; + if (hash === undefined) { + hash = hashString(string); + if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { + STRING_HASH_CACHE_SIZE = 0; + stringHashCache = {}; + } + STRING_HASH_CACHE_SIZE++; + stringHashCache[string] = hash; + } + return hash; + } + + // http://jsperf.com/hashing-strings + function hashString(string) { + // This is the hash from JVM + // The hash code for a string is computed as + // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1], + // where s[i] is the ith character of the string and n is the length of + // the string. We "mod" the result to make it between 0 (inclusive) and 2^31 + // (exclusive) by dropping high bits. + var hash = 0; + for (var ii = 0; ii < string.length; ii++) { + hash = 31 * hash + string.charCodeAt(ii) | 0; + } + return smi(hash); + } + + function hashJSObj(obj) { + var hash; + if (usingWeakMap) { + hash = weakMap.get(obj); + if (hash !== undefined) { + return hash; + } + } + + hash = obj[UID_HASH_KEY]; + if (hash !== undefined) { + return hash; + } + + if (!canDefineProperty) { + hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; + if (hash !== undefined) { + return hash; + } + + hash = getIENodeHash(obj); + if (hash !== undefined) { + return hash; + } + } + + hash = ++objHashUID; + if (objHashUID & 0x40000000) { + objHashUID = 0; + } + + if (usingWeakMap) { + weakMap.set(obj, hash); + } else if (isExtensible !== undefined && isExtensible(obj) === false) { + throw new Error('Non-extensible objects are not allowed as keys.'); + } else if (canDefineProperty) { + Object.defineProperty(obj, UID_HASH_KEY, { + 'enumerable': false, + 'configurable': false, + 'writable': false, + 'value': hash + }); + } else if (obj.propertyIsEnumerable !== undefined && + obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { + // Since we can't define a non-enumerable property on the object + // we'll hijack one of the less-used non-enumerable properties to + // save our hash on it. Since this is a function it will not show up in + // `JSON.stringify` which is what we want. + obj.propertyIsEnumerable = function() { + return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments); + }; + obj.propertyIsEnumerable[UID_HASH_KEY] = hash; + } else if (obj.nodeType !== undefined) { + // At this point we couldn't get the IE `uniqueID` to use as a hash + // and we couldn't use a non-enumerable property to exploit the + // dontEnum bug so we simply add the `UID_HASH_KEY` on the node + // itself. + obj[UID_HASH_KEY] = hash; + } else { + throw new Error('Unable to set a non-enumerable property on object.'); + } + + return hash; + } + + // Get references to ES5 object methods. + var isExtensible = Object.isExtensible; + + // True if Object.defineProperty works as expected. IE8 fails this test. + var canDefineProperty = (function() { + try { + Object.defineProperty({}, '@', {}); + return true; + } catch (e) { + return false; + } + }()); + + // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it + // and avoid memory leaks from the IE cloneNode bug. + function getIENodeHash(node) { + if (node && node.nodeType > 0) { + switch (node.nodeType) { + case 1: // Element + return node.uniqueID; + case 9: // Document + return node.documentElement && node.documentElement.uniqueID; + } + } + } + + // If possible, use a WeakMap. + var usingWeakMap = typeof WeakMap === 'function'; + var weakMap; + if (usingWeakMap) { + weakMap = new WeakMap(); + } + + var objHashUID = 0; + + var UID_HASH_KEY = '__immutablehash__'; + if (typeof Symbol === 'function') { + UID_HASH_KEY = Symbol(UID_HASH_KEY); + } + + var STRING_HASH_CACHE_MIN_STRLEN = 16; + var STRING_HASH_CACHE_MAX_SIZE = 255; + var STRING_HASH_CACHE_SIZE = 0; + var stringHashCache = {}; + + function assertNotInfinite(size) { + invariant( + size !== Infinity, + 'Cannot perform this action with an infinite size.' + ); + } + + createClass(Map, KeyedCollection); + + // @pragma Construction + + function Map(value) { + return value === null || value === undefined ? emptyMap() : + isMap(value) && !isOrdered(value) ? value : + emptyMap().withMutations(function(map ) { + var iter = KeyedIterable(value); + assertNotInfinite(iter.size); + iter.forEach(function(v, k) {return map.set(k, v)}); + }); + } + + Map.of = function() {var keyValues = SLICE$0.call(arguments, 0); + return emptyMap().withMutations(function(map ) { + for (var i = 0; i < keyValues.length; i += 2) { + if (i + 1 >= keyValues.length) { + throw new Error('Missing value for key: ' + keyValues[i]); + } + map.set(keyValues[i], keyValues[i + 1]); + } + }); + }; + + Map.prototype.toString = function() { + return this.__toString('Map {', '}'); + }; + + // @pragma Access + + Map.prototype.get = function(k, notSetValue) { + return this._root ? + this._root.get(0, undefined, k, notSetValue) : + notSetValue; + }; + + // @pragma Modification + + Map.prototype.set = function(k, v) { + return updateMap(this, k, v); + }; + + Map.prototype.setIn = function(keyPath, v) { + return this.updateIn(keyPath, NOT_SET, function() {return v}); + }; + + Map.prototype.remove = function(k) { + return updateMap(this, k, NOT_SET); + }; + + Map.prototype.deleteIn = function(keyPath) { + return this.updateIn(keyPath, function() {return NOT_SET}); + }; + + Map.prototype.update = function(k, notSetValue, updater) { + return arguments.length === 1 ? + k(this) : + this.updateIn([k], notSetValue, updater); + }; + + Map.prototype.updateIn = function(keyPath, notSetValue, updater) { + if (!updater) { + updater = notSetValue; + notSetValue = undefined; + } + var updatedValue = updateInDeepMap( + this, + forceIterator(keyPath), + notSetValue, + updater + ); + return updatedValue === NOT_SET ? undefined : updatedValue; + }; + + Map.prototype.clear = function() { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._root = null; + this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyMap(); + }; + + // @pragma Composition + + Map.prototype.merge = function(/*...iters*/) { + return mergeIntoMapWith(this, undefined, arguments); + }; + + Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); + return mergeIntoMapWith(this, merger, iters); + }; + + Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); + return this.updateIn( + keyPath, + emptyMap(), + function(m ) {return typeof m.merge === 'function' ? + m.merge.apply(m, iters) : + iters[iters.length - 1]} + ); + }; + + Map.prototype.mergeDeep = function(/*...iters*/) { + return mergeIntoMapWith(this, deepMerger, arguments); + }; + + Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); + return mergeIntoMapWith(this, deepMergerWith(merger), iters); + }; + + Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); + return this.updateIn( + keyPath, + emptyMap(), + function(m ) {return typeof m.mergeDeep === 'function' ? + m.mergeDeep.apply(m, iters) : + iters[iters.length - 1]} + ); + }; + + Map.prototype.sort = function(comparator) { + // Late binding + return OrderedMap(sortFactory(this, comparator)); + }; + + Map.prototype.sortBy = function(mapper, comparator) { + // Late binding + return OrderedMap(sortFactory(this, comparator, mapper)); + }; + + // @pragma Mutability + + Map.prototype.withMutations = function(fn) { + var mutable = this.asMutable(); + fn(mutable); + return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; + }; + + Map.prototype.asMutable = function() { + return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); + }; + + Map.prototype.asImmutable = function() { + return this.__ensureOwner(); + }; + + Map.prototype.wasAltered = function() { + return this.__altered; + }; + + Map.prototype.__iterator = function(type, reverse) { + return new MapIterator(this, type, reverse); + }; + + Map.prototype.__iterate = function(fn, reverse) {var this$0 = this; + var iterations = 0; + this._root && this._root.iterate(function(entry ) { + iterations++; + return fn(entry[1], entry[0], this$0); + }, reverse); + return iterations; + }; + + Map.prototype.__ensureOwner = function(ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeMap(this.size, this._root, ownerID, this.__hash); + }; + + + function isMap(maybeMap) { + return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]); + } + + Map.isMap = isMap; + + var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; + + var MapPrototype = Map.prototype; + MapPrototype[IS_MAP_SENTINEL] = true; + MapPrototype[DELETE] = MapPrototype.remove; + MapPrototype.removeIn = MapPrototype.deleteIn; + + + // #pragma Trie Nodes + + + + function ArrayMapNode(ownerID, entries) { + this.ownerID = ownerID; + this.entries = entries; + } + + ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { + var entries = this.entries; + for (var ii = 0, len = entries.length; ii < len; ii++) { + if (is(key, entries[ii][0])) { + return entries[ii][1]; + } + } + return notSetValue; + }; + + ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + var removed = value === NOT_SET; + + var entries = this.entries; + var idx = 0; + for (var len = entries.length; idx < len; idx++) { + if (is(key, entries[idx][0])) { + break; + } + } + var exists = idx < len; + + if (exists ? entries[idx][1] === value : removed) { + return this; + } + + SetRef(didAlter); + (removed || !exists) && SetRef(didChangeSize); + + if (removed && entries.length === 1) { + return; // undefined + } + + if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) { + return createNodes(ownerID, entries, key, value); + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newEntries = isEditable ? entries : arrCopy(entries); + + if (exists) { + if (removed) { + idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); + } else { + newEntries[idx] = [key, value]; + } + } else { + newEntries.push([key, value]); + } + + if (isEditable) { + this.entries = newEntries; + return this; + } + + return new ArrayMapNode(ownerID, newEntries); + }; + + + + + function BitmapIndexedNode(ownerID, bitmap, nodes) { + this.ownerID = ownerID; + this.bitmap = bitmap; + this.nodes = nodes; + } + + BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK)); + var bitmap = this.bitmap; + return (bitmap & bit) === 0 ? notSetValue : + this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue); + }; + + BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var bit = 1 << keyHashFrag; + var bitmap = this.bitmap; + var exists = (bitmap & bit) !== 0; + + if (!exists && value === NOT_SET) { + return this; + } + + var idx = popCount(bitmap & (bit - 1)); + var nodes = this.nodes; + var node = exists ? nodes[idx] : undefined; + var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); + + if (newNode === node) { + return this; + } + + if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) { + return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); + } + + if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) { + return nodes[idx ^ 1]; + } + + if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) { + return newNode; + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit; + var newNodes = exists ? newNode ? + setIn(nodes, idx, newNode, isEditable) : + spliceOut(nodes, idx, isEditable) : + spliceIn(nodes, idx, newNode, isEditable); + + if (isEditable) { + this.bitmap = newBitmap; + this.nodes = newNodes; + return this; + } + + return new BitmapIndexedNode(ownerID, newBitmap, newNodes); + }; + + + + + function HashArrayMapNode(ownerID, count, nodes) { + this.ownerID = ownerID; + this.count = count; + this.nodes = nodes; + } + + HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var node = this.nodes[idx]; + return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue; + }; + + HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var removed = value === NOT_SET; + var nodes = this.nodes; + var node = nodes[idx]; + + if (removed && !node) { + return this; + } + + var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); + if (newNode === node) { + return this; + } + + var newCount = this.count; + if (!node) { + newCount++; + } else if (!newNode) { + newCount--; + if (newCount < MIN_HASH_ARRAY_MAP_SIZE) { + return packNodes(ownerID, nodes, newCount, idx); + } + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newNodes = setIn(nodes, idx, newNode, isEditable); + + if (isEditable) { + this.count = newCount; + this.nodes = newNodes; + return this; + } + + return new HashArrayMapNode(ownerID, newCount, newNodes); + }; + + + + + function HashCollisionNode(ownerID, keyHash, entries) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entries = entries; + } + + HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) { + var entries = this.entries; + for (var ii = 0, len = entries.length; ii < len; ii++) { + if (is(key, entries[ii][0])) { + return entries[ii][1]; + } + } + return notSetValue; + }; + + HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + + var removed = value === NOT_SET; + + if (keyHash !== this.keyHash) { + if (removed) { + return this; + } + SetRef(didAlter); + SetRef(didChangeSize); + return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); + } + + var entries = this.entries; + var idx = 0; + for (var len = entries.length; idx < len; idx++) { + if (is(key, entries[idx][0])) { + break; + } + } + var exists = idx < len; + + if (exists ? entries[idx][1] === value : removed) { + return this; + } + + SetRef(didAlter); + (removed || !exists) && SetRef(didChangeSize); + + if (removed && len === 2) { + return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newEntries = isEditable ? entries : arrCopy(entries); + + if (exists) { + if (removed) { + idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); + } else { + newEntries[idx] = [key, value]; + } + } else { + newEntries.push([key, value]); + } + + if (isEditable) { + this.entries = newEntries; + return this; + } + + return new HashCollisionNode(ownerID, this.keyHash, newEntries); + }; + + + + + function ValueNode(ownerID, keyHash, entry) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entry = entry; + } + + ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) { + return is(key, this.entry[0]) ? this.entry[1] : notSetValue; + }; + + ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + var removed = value === NOT_SET; + var keyMatch = is(key, this.entry[0]); + if (keyMatch ? value === this.entry[1] : removed) { + return this; + } + + SetRef(didAlter); + + if (removed) { + SetRef(didChangeSize); + return; // undefined + } + + if (keyMatch) { + if (ownerID && ownerID === this.ownerID) { + this.entry[1] = value; + return this; + } + return new ValueNode(ownerID, this.keyHash, [key, value]); + } + + SetRef(didChangeSize); + return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]); + }; + + + + // #pragma Iterators + + ArrayMapNode.prototype.iterate = + HashCollisionNode.prototype.iterate = function (fn, reverse) { + var entries = this.entries; + for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { + if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { + return false; + } + } + } + + BitmapIndexedNode.prototype.iterate = + HashArrayMapNode.prototype.iterate = function (fn, reverse) { + var nodes = this.nodes; + for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { + var node = nodes[reverse ? maxIndex - ii : ii]; + if (node && node.iterate(fn, reverse) === false) { + return false; + } + } + } + + ValueNode.prototype.iterate = function (fn, reverse) { + return fn(this.entry); + } + + createClass(MapIterator, Iterator); + + function MapIterator(map, type, reverse) { + this._type = type; + this._reverse = reverse; + this._stack = map._root && mapIteratorFrame(map._root); + } + + MapIterator.prototype.next = function() { + var type = this._type; + var stack = this._stack; + while (stack) { + var node = stack.node; + var index = stack.index++; + var maxIndex; + if (node.entry) { + if (index === 0) { + return mapIteratorValue(type, node.entry); + } + } else if (node.entries) { + maxIndex = node.entries.length - 1; + if (index <= maxIndex) { + return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]); + } + } else { + maxIndex = node.nodes.length - 1; + if (index <= maxIndex) { + var subNode = node.nodes[this._reverse ? maxIndex - index : index]; + if (subNode) { + if (subNode.entry) { + return mapIteratorValue(type, subNode.entry); + } + stack = this._stack = mapIteratorFrame(subNode, stack); + } + continue; + } + } + stack = this._stack = this._stack.__prev; + } + return iteratorDone(); + }; + + + function mapIteratorValue(type, entry) { + return iteratorValue(type, entry[0], entry[1]); + } + + function mapIteratorFrame(node, prev) { + return { + node: node, + index: 0, + __prev: prev + }; + } + + function makeMap(size, root, ownerID, hash) { + var map = Object.create(MapPrototype); + map.size = size; + map._root = root; + map.__ownerID = ownerID; + map.__hash = hash; + map.__altered = false; + return map; + } + + var EMPTY_MAP; + function emptyMap() { + return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); + } + + function updateMap(map, k, v) { + var newRoot; + var newSize; + if (!map._root) { + if (v === NOT_SET) { + return map; + } + newSize = 1; + newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); + } else { + var didChangeSize = MakeRef(CHANGE_LENGTH); + var didAlter = MakeRef(DID_ALTER); + newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter); + if (!didAlter.value) { + return map; + } + newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0); + } + if (map.__ownerID) { + map.size = newSize; + map._root = newRoot; + map.__hash = undefined; + map.__altered = true; + return map; + } + return newRoot ? makeMap(newSize, newRoot) : emptyMap(); + } + + function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (!node) { + if (value === NOT_SET) { + return node; + } + SetRef(didAlter); + SetRef(didChangeSize); + return new ValueNode(ownerID, keyHash, [key, value]); + } + return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter); + } + + function isLeafNode(node) { + return node.constructor === ValueNode || node.constructor === HashCollisionNode; + } + + function mergeIntoNode(node, ownerID, shift, keyHash, entry) { + if (node.keyHash === keyHash) { + return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); + } + + var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; + var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + + var newNode; + var nodes = idx1 === idx2 ? + [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : + ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]); + + return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes); + } + + function createNodes(ownerID, entries, key, value) { + if (!ownerID) { + ownerID = new OwnerID(); + } + var node = new ValueNode(ownerID, hash(key), [key, value]); + for (var ii = 0; ii < entries.length; ii++) { + var entry = entries[ii]; + node = node.update(ownerID, 0, undefined, entry[0], entry[1]); + } + return node; + } + + function packNodes(ownerID, nodes, count, excluding) { + var bitmap = 0; + var packedII = 0; + var packedNodes = new Array(count); + for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { + var node = nodes[ii]; + if (node !== undefined && ii !== excluding) { + bitmap |= bit; + packedNodes[packedII++] = node; + } + } + return new BitmapIndexedNode(ownerID, bitmap, packedNodes); + } + + function expandNodes(ownerID, nodes, bitmap, including, node) { + var count = 0; + var expandedNodes = new Array(SIZE); + for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { + expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; + } + expandedNodes[including] = node; + return new HashArrayMapNode(ownerID, count + 1, expandedNodes); + } + + function mergeIntoMapWith(map, merger, iterables) { + var iters = []; + for (var ii = 0; ii < iterables.length; ii++) { + var value = iterables[ii]; + var iter = KeyedIterable(value); + if (!isIterable(value)) { + iter = iter.map(function(v ) {return fromJS(v)}); + } + iters.push(iter); + } + return mergeIntoCollectionWith(map, merger, iters); + } + + function deepMerger(existing, value, key) { + return existing && existing.mergeDeep && isIterable(value) ? + existing.mergeDeep(value) : + is(existing, value) ? existing : value; + } + + function deepMergerWith(merger) { + return function(existing, value, key) { + if (existing && existing.mergeDeepWith && isIterable(value)) { + return existing.mergeDeepWith(merger, value); + } + var nextValue = merger(existing, value, key); + return is(existing, nextValue) ? existing : nextValue; + }; + } + + function mergeIntoCollectionWith(collection, merger, iters) { + iters = iters.filter(function(x ) {return x.size !== 0}); + if (iters.length === 0) { + return collection; + } + if (collection.size === 0 && !collection.__ownerID && iters.length === 1) { + return collection.constructor(iters[0]); + } + return collection.withMutations(function(collection ) { + var mergeIntoMap = merger ? + function(value, key) { + collection.update(key, NOT_SET, function(existing ) + {return existing === NOT_SET ? value : merger(existing, value, key)} + ); + } : + function(value, key) { + collection.set(key, value); + } + for (var ii = 0; ii < iters.length; ii++) { + iters[ii].forEach(mergeIntoMap); + } + }); + } + + function updateInDeepMap(existing, keyPathIter, notSetValue, updater) { + var isNotSet = existing === NOT_SET; + var step = keyPathIter.next(); + if (step.done) { + var existingValue = isNotSet ? notSetValue : existing; + var newValue = updater(existingValue); + return newValue === existingValue ? existing : newValue; + } + invariant( + isNotSet || (existing && existing.set), + 'invalid keyPath' + ); + var key = step.value; + var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET); + var nextUpdated = updateInDeepMap( + nextExisting, + keyPathIter, + notSetValue, + updater + ); + return nextUpdated === nextExisting ? existing : + nextUpdated === NOT_SET ? existing.remove(key) : + (isNotSet ? emptyMap() : existing).set(key, nextUpdated); + } + + function popCount(x) { + x = x - ((x >> 1) & 0x55555555); + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x + (x >> 4)) & 0x0f0f0f0f; + x = x + (x >> 8); + x = x + (x >> 16); + return x & 0x7f; + } + + function setIn(array, idx, val, canEdit) { + var newArray = canEdit ? array : arrCopy(array); + newArray[idx] = val; + return newArray; + } + + function spliceIn(array, idx, val, canEdit) { + var newLen = array.length + 1; + if (canEdit && idx + 1 === newLen) { + array[idx] = val; + return array; + } + var newArray = new Array(newLen); + var after = 0; + for (var ii = 0; ii < newLen; ii++) { + if (ii === idx) { + newArray[ii] = val; + after = -1; + } else { + newArray[ii] = array[ii + after]; + } + } + return newArray; + } + + function spliceOut(array, idx, canEdit) { + var newLen = array.length - 1; + if (canEdit && idx === newLen) { + array.pop(); + return array; + } + var newArray = new Array(newLen); + var after = 0; + for (var ii = 0; ii < newLen; ii++) { + if (ii === idx) { + after = 1; + } + newArray[ii] = array[ii + after]; + } + return newArray; + } + + var MAX_ARRAY_MAP_SIZE = SIZE / 4; + var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; + var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; + + createClass(List, IndexedCollection); + + // @pragma Construction + + function List(value) { + var empty = emptyList(); + if (value === null || value === undefined) { + return empty; + } + if (isList(value)) { + return value; + } + var iter = IndexedIterable(value); + var size = iter.size; + if (size === 0) { + return empty; + } + assertNotInfinite(size); + if (size > 0 && size < SIZE) { + return makeList(0, size, SHIFT, null, new VNode(iter.toArray())); + } + return empty.withMutations(function(list ) { + list.setSize(size); + iter.forEach(function(v, i) {return list.set(i, v)}); + }); + } + + List.of = function(/*...values*/) { + return this(arguments); + }; + + List.prototype.toString = function() { + return this.__toString('List [', ']'); + }; + + // @pragma Access + + List.prototype.get = function(index, notSetValue) { + index = wrapIndex(this, index); + if (index >= 0 && index < this.size) { + index += this._origin; + var node = listNodeFor(this, index); + return node && node.array[index & MASK]; + } + return notSetValue; + }; + + // @pragma Modification + + List.prototype.set = function(index, value) { + return updateList(this, index, value); + }; + + List.prototype.remove = function(index) { + return !this.has(index) ? this : + index === 0 ? this.shift() : + index === this.size - 1 ? this.pop() : + this.splice(index, 1); + }; + + List.prototype.insert = function(index, value) { + return this.splice(index, 0, value); + }; + + List.prototype.clear = function() { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = this._origin = this._capacity = 0; + this._level = SHIFT; + this._root = this._tail = null; + this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyList(); + }; + + List.prototype.push = function(/*...values*/) { + var values = arguments; + var oldSize = this.size; + return this.withMutations(function(list ) { + setListBounds(list, 0, oldSize + values.length); + for (var ii = 0; ii < values.length; ii++) { + list.set(oldSize + ii, values[ii]); + } + }); + }; + + List.prototype.pop = function() { + return setListBounds(this, 0, -1); + }; + + List.prototype.unshift = function(/*...values*/) { + var values = arguments; + return this.withMutations(function(list ) { + setListBounds(list, -values.length); + for (var ii = 0; ii < values.length; ii++) { + list.set(ii, values[ii]); + } + }); + }; + + List.prototype.shift = function() { + return setListBounds(this, 1); + }; + + // @pragma Composition + + List.prototype.merge = function(/*...iters*/) { + return mergeIntoListWith(this, undefined, arguments); + }; + + List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); + return mergeIntoListWith(this, merger, iters); + }; + + List.prototype.mergeDeep = function(/*...iters*/) { + return mergeIntoListWith(this, deepMerger, arguments); + }; + + List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); + return mergeIntoListWith(this, deepMergerWith(merger), iters); + }; + + List.prototype.setSize = function(size) { + return setListBounds(this, 0, size); + }; + + // @pragma Iteration + + List.prototype.slice = function(begin, end) { + var size = this.size; + if (wholeSlice(begin, end, size)) { + return this; + } + return setListBounds( + this, + resolveBegin(begin, size), + resolveEnd(end, size) + ); + }; + + List.prototype.__iterator = function(type, reverse) { + var index = 0; + var values = iterateList(this, reverse); + return new Iterator(function() { + var value = values(); + return value === DONE ? + iteratorDone() : + iteratorValue(type, index++, value); + }); + }; + + List.prototype.__iterate = function(fn, reverse) { + var index = 0; + var values = iterateList(this, reverse); + var value; + while ((value = values()) !== DONE) { + if (fn(value, index++, this) === false) { + break; + } + } + return index; + }; + + List.prototype.__ensureOwner = function(ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + this.__ownerID = ownerID; + return this; + } + return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash); + }; + + + function isList(maybeList) { + return !!(maybeList && maybeList[IS_LIST_SENTINEL]); + } + + List.isList = isList; + + var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; + + var ListPrototype = List.prototype; + ListPrototype[IS_LIST_SENTINEL] = true; + ListPrototype[DELETE] = ListPrototype.remove; + ListPrototype.setIn = MapPrototype.setIn; + ListPrototype.deleteIn = + ListPrototype.removeIn = MapPrototype.removeIn; + ListPrototype.update = MapPrototype.update; + ListPrototype.updateIn = MapPrototype.updateIn; + ListPrototype.mergeIn = MapPrototype.mergeIn; + ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; + ListPrototype.withMutations = MapPrototype.withMutations; + ListPrototype.asMutable = MapPrototype.asMutable; + ListPrototype.asImmutable = MapPrototype.asImmutable; + ListPrototype.wasAltered = MapPrototype.wasAltered; + + + + function VNode(array, ownerID) { + this.array = array; + this.ownerID = ownerID; + } + + // TODO: seems like these methods are very similar + + VNode.prototype.removeBefore = function(ownerID, level, index) { + if (index === level ? 1 << level : 0 || this.array.length === 0) { + return this; + } + var originIndex = (index >>> level) & MASK; + if (originIndex >= this.array.length) { + return new VNode([], ownerID); + } + var removingFirst = originIndex === 0; + var newChild; + if (level > 0) { + var oldChild = this.array[originIndex]; + newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); + if (newChild === oldChild && removingFirst) { + return this; + } + } + if (removingFirst && !newChild) { + return this; + } + var editable = editableVNode(this, ownerID); + if (!removingFirst) { + for (var ii = 0; ii < originIndex; ii++) { + editable.array[ii] = undefined; + } + } + if (newChild) { + editable.array[originIndex] = newChild; + } + return editable; + }; + + VNode.prototype.removeAfter = function(ownerID, level, index) { + if (index === (level ? 1 << level : 0) || this.array.length === 0) { + return this; + } + var sizeIndex = ((index - 1) >>> level) & MASK; + if (sizeIndex >= this.array.length) { + return this; + } + + var newChild; + if (level > 0) { + var oldChild = this.array[sizeIndex]; + newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); + if (newChild === oldChild && sizeIndex === this.array.length - 1) { + return this; + } + } + + var editable = editableVNode(this, ownerID); + editable.array.splice(sizeIndex + 1); + if (newChild) { + editable.array[sizeIndex] = newChild; + } + return editable; + }; + + + + var DONE = {}; + + function iterateList(list, reverse) { + var left = list._origin; + var right = list._capacity; + var tailPos = getTailOffset(right); + var tail = list._tail; + + return iterateNodeOrLeaf(list._root, list._level, 0); + + function iterateNodeOrLeaf(node, level, offset) { + return level === 0 ? + iterateLeaf(node, offset) : + iterateNode(node, level, offset); + } + + function iterateLeaf(node, offset) { + var array = offset === tailPos ? tail && tail.array : node && node.array; + var from = offset > left ? 0 : left - offset; + var to = right - offset; + if (to > SIZE) { + to = SIZE; + } + return function() { + if (from === to) { + return DONE; + } + var idx = reverse ? --to : from++; + return array && array[idx]; + }; + } + + function iterateNode(node, level, offset) { + var values; + var array = node && node.array; + var from = offset > left ? 0 : (left - offset) >> level; + var to = ((right - offset) >> level) + 1; + if (to > SIZE) { + to = SIZE; + } + return function() { + do { + if (values) { + var value = values(); + if (value !== DONE) { + return value; + } + values = null; + } + if (from === to) { + return DONE; + } + var idx = reverse ? --to : from++; + values = iterateNodeOrLeaf( + array && array[idx], level - SHIFT, offset + (idx << level) + ); + } while (true); + }; + } + } + + function makeList(origin, capacity, level, root, tail, ownerID, hash) { + var list = Object.create(ListPrototype); + list.size = capacity - origin; + list._origin = origin; + list._capacity = capacity; + list._level = level; + list._root = root; + list._tail = tail; + list.__ownerID = ownerID; + list.__hash = hash; + list.__altered = false; + return list; + } + + var EMPTY_LIST; + function emptyList() { + return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT)); + } + + function updateList(list, index, value) { + index = wrapIndex(list, index); + + if (index !== index) { + return list; + } + + if (index >= list.size || index < 0) { + return list.withMutations(function(list ) { + index < 0 ? + setListBounds(list, index).set(0, value) : + setListBounds(list, 0, index + 1).set(index, value) + }); + } + + index += list._origin; + + var newTail = list._tail; + var newRoot = list._root; + var didAlter = MakeRef(DID_ALTER); + if (index >= getTailOffset(list._capacity)) { + newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); + } else { + newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter); + } + + if (!didAlter.value) { + return list; + } + + if (list.__ownerID) { + list._root = newRoot; + list._tail = newTail; + list.__hash = undefined; + list.__altered = true; + return list; + } + return makeList(list._origin, list._capacity, list._level, newRoot, newTail); + } + + function updateVNode(node, ownerID, level, index, value, didAlter) { + var idx = (index >>> level) & MASK; + var nodeHas = node && idx < node.array.length; + if (!nodeHas && value === undefined) { + return node; + } + + var newNode; + + if (level > 0) { + var lowerNode = node && node.array[idx]; + var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter); + if (newLowerNode === lowerNode) { + return node; + } + newNode = editableVNode(node, ownerID); + newNode.array[idx] = newLowerNode; + return newNode; + } + + if (nodeHas && node.array[idx] === value) { + return node; + } + + SetRef(didAlter); + + newNode = editableVNode(node, ownerID); + if (value === undefined && idx === newNode.array.length - 1) { + newNode.array.pop(); + } else { + newNode.array[idx] = value; + } + return newNode; + } + + function editableVNode(node, ownerID) { + if (ownerID && node && ownerID === node.ownerID) { + return node; + } + return new VNode(node ? node.array.slice() : [], ownerID); + } + + function listNodeFor(list, rawIndex) { + if (rawIndex >= getTailOffset(list._capacity)) { + return list._tail; + } + if (rawIndex < 1 << (list._level + SHIFT)) { + var node = list._root; + var level = list._level; + while (node && level > 0) { + node = node.array[(rawIndex >>> level) & MASK]; + level -= SHIFT; + } + return node; + } + } + + function setListBounds(list, begin, end) { + // Sanitize begin & end using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + if (begin !== undefined) { + begin = begin | 0; + } + if (end !== undefined) { + end = end | 0; + } + var owner = list.__ownerID || new OwnerID(); + var oldOrigin = list._origin; + var oldCapacity = list._capacity; + var newOrigin = oldOrigin + begin; + var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end; + if (newOrigin === oldOrigin && newCapacity === oldCapacity) { + return list; + } + + // If it's going to end after it starts, it's empty. + if (newOrigin >= newCapacity) { + return list.clear(); + } + + var newLevel = list._level; + var newRoot = list._root; + + // New origin might need creating a higher root. + var offsetShift = 0; + while (newOrigin + offsetShift < 0) { + newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner); + newLevel += SHIFT; + offsetShift += 1 << newLevel; + } + if (offsetShift) { + newOrigin += offsetShift; + oldOrigin += offsetShift; + newCapacity += offsetShift; + oldCapacity += offsetShift; + } + + var oldTailOffset = getTailOffset(oldCapacity); + var newTailOffset = getTailOffset(newCapacity); + + // New size might need creating a higher root. + while (newTailOffset >= 1 << (newLevel + SHIFT)) { + newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner); + newLevel += SHIFT; + } + + // Locate or create the new tail. + var oldTail = list._tail; + var newTail = newTailOffset < oldTailOffset ? + listNodeFor(list, newCapacity - 1) : + newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; + + // Merge Tail into tree. + if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) { + newRoot = editableVNode(newRoot, owner); + var node = newRoot; + for (var level = newLevel; level > SHIFT; level -= SHIFT) { + var idx = (oldTailOffset >>> level) & MASK; + node = node.array[idx] = editableVNode(node.array[idx], owner); + } + node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail; + } + + // If the size has been reduced, there's a chance the tail needs to be trimmed. + if (newCapacity < oldCapacity) { + newTail = newTail && newTail.removeAfter(owner, 0, newCapacity); + } + + // If the new origin is within the tail, then we do not need a root. + if (newOrigin >= newTailOffset) { + newOrigin -= newTailOffset; + newCapacity -= newTailOffset; + newLevel = SHIFT; + newRoot = null; + newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); + + // Otherwise, if the root has been trimmed, garbage collect. + } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { + offsetShift = 0; + + // Identify the new top root node of the subtree of the old root. + while (newRoot) { + var beginIndex = (newOrigin >>> newLevel) & MASK; + if (beginIndex !== (newTailOffset >>> newLevel) & MASK) { + break; + } + if (beginIndex) { + offsetShift += (1 << newLevel) * beginIndex; + } + newLevel -= SHIFT; + newRoot = newRoot.array[beginIndex]; + } + + // Trim the new sides of the new root. + if (newRoot && newOrigin > oldOrigin) { + newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); + } + if (newRoot && newTailOffset < oldTailOffset) { + newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift); + } + if (offsetShift) { + newOrigin -= offsetShift; + newCapacity -= offsetShift; + } + } + + if (list.__ownerID) { + list.size = newCapacity - newOrigin; + list._origin = newOrigin; + list._capacity = newCapacity; + list._level = newLevel; + list._root = newRoot; + list._tail = newTail; + list.__hash = undefined; + list.__altered = true; + return list; + } + return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); + } + + function mergeIntoListWith(list, merger, iterables) { + var iters = []; + var maxSize = 0; + for (var ii = 0; ii < iterables.length; ii++) { + var value = iterables[ii]; + var iter = IndexedIterable(value); + if (iter.size > maxSize) { + maxSize = iter.size; + } + if (!isIterable(value)) { + iter = iter.map(function(v ) {return fromJS(v)}); + } + iters.push(iter); + } + if (maxSize > list.size) { + list = list.setSize(maxSize); + } + return mergeIntoCollectionWith(list, merger, iters); + } + + function getTailOffset(size) { + return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT); + } + + createClass(OrderedMap, Map); + + // @pragma Construction + + function OrderedMap(value) { + return value === null || value === undefined ? emptyOrderedMap() : + isOrderedMap(value) ? value : + emptyOrderedMap().withMutations(function(map ) { + var iter = KeyedIterable(value); + assertNotInfinite(iter.size); + iter.forEach(function(v, k) {return map.set(k, v)}); + }); + } + + OrderedMap.of = function(/*...values*/) { + return this(arguments); + }; + + OrderedMap.prototype.toString = function() { + return this.__toString('OrderedMap {', '}'); + }; + + // @pragma Access + + OrderedMap.prototype.get = function(k, notSetValue) { + var index = this._map.get(k); + return index !== undefined ? this._list.get(index)[1] : notSetValue; + }; + + // @pragma Modification + + OrderedMap.prototype.clear = function() { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._map.clear(); + this._list.clear(); + return this; + } + return emptyOrderedMap(); + }; + + OrderedMap.prototype.set = function(k, v) { + return updateOrderedMap(this, k, v); + }; + + OrderedMap.prototype.remove = function(k) { + return updateOrderedMap(this, k, NOT_SET); + }; + + OrderedMap.prototype.wasAltered = function() { + return this._map.wasAltered() || this._list.wasAltered(); + }; + + OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this; + return this._list.__iterate( + function(entry ) {return entry && fn(entry[1], entry[0], this$0)}, + reverse + ); + }; + + OrderedMap.prototype.__iterator = function(type, reverse) { + return this._list.fromEntrySeq().__iterator(type, reverse); + }; + + OrderedMap.prototype.__ensureOwner = function(ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + var newList = this._list.__ensureOwner(ownerID); + if (!ownerID) { + this.__ownerID = ownerID; + this._map = newMap; + this._list = newList; + return this; + } + return makeOrderedMap(newMap, newList, ownerID, this.__hash); + }; + + + function isOrderedMap(maybeOrderedMap) { + return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); + } + + OrderedMap.isOrderedMap = isOrderedMap; + + OrderedMap.prototype[IS_ORDERED_SENTINEL] = true; + OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; + + + + function makeOrderedMap(map, list, ownerID, hash) { + var omap = Object.create(OrderedMap.prototype); + omap.size = map ? map.size : 0; + omap._map = map; + omap._list = list; + omap.__ownerID = ownerID; + omap.__hash = hash; + return omap; + } + + var EMPTY_ORDERED_MAP; + function emptyOrderedMap() { + return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())); + } + + function updateOrderedMap(omap, k, v) { + var map = omap._map; + var list = omap._list; + var i = map.get(k); + var has = i !== undefined; + var newMap; + var newList; + if (v === NOT_SET) { // removed + if (!has) { + return omap; + } + if (list.size >= SIZE && list.size >= map.size * 2) { + newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx}); + newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap(); + if (omap.__ownerID) { + newMap.__ownerID = newList.__ownerID = omap.__ownerID; + } + } else { + newMap = map.remove(k); + newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); + } + } else { + if (has) { + if (v === list.get(i)[1]) { + return omap; + } + newMap = map; + newList = list.set(i, [k, v]); + } else { + newMap = map.set(k, list.size); + newList = list.set(list.size, [k, v]); + } + } + if (omap.__ownerID) { + omap.size = newMap.size; + omap._map = newMap; + omap._list = newList; + omap.__hash = undefined; + return omap; + } + return makeOrderedMap(newMap, newList); + } + + createClass(ToKeyedSequence, KeyedSeq); + function ToKeyedSequence(indexed, useKeys) { + this._iter = indexed; + this._useKeys = useKeys; + this.size = indexed.size; + } + + ToKeyedSequence.prototype.get = function(key, notSetValue) { + return this._iter.get(key, notSetValue); + }; + + ToKeyedSequence.prototype.has = function(key) { + return this._iter.has(key); + }; + + ToKeyedSequence.prototype.valueSeq = function() { + return this._iter.valueSeq(); + }; + + ToKeyedSequence.prototype.reverse = function() {var this$0 = this; + var reversedSequence = reverseFactory(this, true); + if (!this._useKeys) { + reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()}; + } + return reversedSequence; + }; + + ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this; + var mappedSequence = mapFactory(this, mapper, context); + if (!this._useKeys) { + mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)}; + } + return mappedSequence; + }; + + ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; + var ii; + return this._iter.__iterate( + this._useKeys ? + function(v, k) {return fn(v, k, this$0)} : + ((ii = reverse ? resolveSize(this) : 0), + function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}), + reverse + ); + }; + + ToKeyedSequence.prototype.__iterator = function(type, reverse) { + if (this._useKeys) { + return this._iter.__iterator(type, reverse); + } + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + var ii = reverse ? resolveSize(this) : 0; + return new Iterator(function() { + var step = iterator.next(); + return step.done ? step : + iteratorValue(type, reverse ? --ii : ii++, step.value, step); + }); + }; + + ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true; + + + createClass(ToIndexedSequence, IndexedSeq); + function ToIndexedSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + ToIndexedSequence.prototype.includes = function(value) { + return this._iter.includes(value); + }; + + ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; + var iterations = 0; + return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse); + }; + + ToIndexedSequence.prototype.__iterator = function(type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + var iterations = 0; + return new Iterator(function() { + var step = iterator.next(); + return step.done ? step : + iteratorValue(type, iterations++, step.value, step) + }); + }; + + + + createClass(ToSetSequence, SetSeq); + function ToSetSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + ToSetSequence.prototype.has = function(key) { + return this._iter.includes(key); + }; + + ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; + return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse); + }; + + ToSetSequence.prototype.__iterator = function(type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new Iterator(function() { + var step = iterator.next(); + return step.done ? step : + iteratorValue(type, step.value, step.value, step); + }); + }; + + + + createClass(FromEntriesSequence, KeyedSeq); + function FromEntriesSequence(entries) { + this._iter = entries; + this.size = entries.size; + } + + FromEntriesSequence.prototype.entrySeq = function() { + return this._iter.toSeq(); + }; + + FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; + return this._iter.__iterate(function(entry ) { + // Check if entry exists first so array access doesn't throw for holes + // in the parent iteration. + if (entry) { + validateEntry(entry); + var indexedIterable = isIterable(entry); + return fn( + indexedIterable ? entry.get(1) : entry[1], + indexedIterable ? entry.get(0) : entry[0], + this$0 + ); + } + }, reverse); + }; + + FromEntriesSequence.prototype.__iterator = function(type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new Iterator(function() { + while (true) { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + // Check if entry exists first so array access doesn't throw for holes + // in the parent iteration. + if (entry) { + validateEntry(entry); + var indexedIterable = isIterable(entry); + return iteratorValue( + type, + indexedIterable ? entry.get(0) : entry[0], + indexedIterable ? entry.get(1) : entry[1], + step + ); + } + } + }); + }; + + + ToIndexedSequence.prototype.cacheResult = + ToKeyedSequence.prototype.cacheResult = + ToSetSequence.prototype.cacheResult = + FromEntriesSequence.prototype.cacheResult = + cacheResultThrough; + + + function flipFactory(iterable) { + var flipSequence = makeSequence(iterable); + flipSequence._iter = iterable; + flipSequence.size = iterable.size; + flipSequence.flip = function() {return iterable}; + flipSequence.reverse = function () { + var reversedSequence = iterable.reverse.apply(this); // super.reverse() + reversedSequence.flip = function() {return iterable.reverse()}; + return reversedSequence; + }; + flipSequence.has = function(key ) {return iterable.includes(key)}; + flipSequence.includes = function(key ) {return iterable.has(key)}; + flipSequence.cacheResult = cacheResultThrough; + flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; + return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse); + } + flipSequence.__iteratorUncached = function(type, reverse) { + if (type === ITERATE_ENTRIES) { + var iterator = iterable.__iterator(type, reverse); + return new Iterator(function() { + var step = iterator.next(); + if (!step.done) { + var k = step.value[0]; + step.value[0] = step.value[1]; + step.value[1] = k; + } + return step; + }); + } + return iterable.__iterator( + type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, + reverse + ); + } + return flipSequence; + } + + + function mapFactory(iterable, mapper, context) { + var mappedSequence = makeSequence(iterable); + mappedSequence.size = iterable.size; + mappedSequence.has = function(key ) {return iterable.has(key)}; + mappedSequence.get = function(key, notSetValue) { + var v = iterable.get(key, NOT_SET); + return v === NOT_SET ? + notSetValue : + mapper.call(context, v, key, iterable); + }; + mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; + return iterable.__iterate( + function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false}, + reverse + ); + } + mappedSequence.__iteratorUncached = function (type, reverse) { + var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); + return new Iterator(function() { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var key = entry[0]; + return iteratorValue( + type, + key, + mapper.call(context, entry[1], key, iterable), + step + ); + }); + } + return mappedSequence; + } + + + function reverseFactory(iterable, useKeys) { + var reversedSequence = makeSequence(iterable); + reversedSequence._iter = iterable; + reversedSequence.size = iterable.size; + reversedSequence.reverse = function() {return iterable}; + if (iterable.flip) { + reversedSequence.flip = function () { + var flipSequence = flipFactory(iterable); + flipSequence.reverse = function() {return iterable.flip()}; + return flipSequence; + }; + } + reversedSequence.get = function(key, notSetValue) + {return iterable.get(useKeys ? key : -1 - key, notSetValue)}; + reversedSequence.has = function(key ) + {return iterable.has(useKeys ? key : -1 - key)}; + reversedSequence.includes = function(value ) {return iterable.includes(value)}; + reversedSequence.cacheResult = cacheResultThrough; + reversedSequence.__iterate = function (fn, reverse) {var this$0 = this; + return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse); + }; + reversedSequence.__iterator = + function(type, reverse) {return iterable.__iterator(type, !reverse)}; + return reversedSequence; + } + + + function filterFactory(iterable, predicate, context, useKeys) { + var filterSequence = makeSequence(iterable); + if (useKeys) { + filterSequence.has = function(key ) { + var v = iterable.get(key, NOT_SET); + return v !== NOT_SET && !!predicate.call(context, v, key, iterable); + }; + filterSequence.get = function(key, notSetValue) { + var v = iterable.get(key, NOT_SET); + return v !== NOT_SET && predicate.call(context, v, key, iterable) ? + v : notSetValue; + }; + } + filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; + var iterations = 0; + iterable.__iterate(function(v, k, c) { + if (predicate.call(context, v, k, c)) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$0); + } + }, reverse); + return iterations; + }; + filterSequence.__iteratorUncached = function (type, reverse) { + var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); + var iterations = 0; + return new Iterator(function() { + while (true) { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var key = entry[0]; + var value = entry[1]; + if (predicate.call(context, value, key, iterable)) { + return iteratorValue(type, useKeys ? key : iterations++, value, step); + } + } + }); + } + return filterSequence; + } + + + function countByFactory(iterable, grouper, context) { + var groups = Map().asMutable(); + iterable.__iterate(function(v, k) { + groups.update( + grouper.call(context, v, k, iterable), + 0, + function(a ) {return a + 1} + ); + }); + return groups.asImmutable(); + } + + + function groupByFactory(iterable, grouper, context) { + var isKeyedIter = isKeyed(iterable); + var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable(); + iterable.__iterate(function(v, k) { + groups.update( + grouper.call(context, v, k, iterable), + function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)} + ); + }); + var coerce = iterableClass(iterable); + return groups.map(function(arr ) {return reify(iterable, coerce(arr))}); + } + + + function sliceFactory(iterable, begin, end, useKeys) { + var originalSize = iterable.size; + + // Sanitize begin & end using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + if (begin !== undefined) { + begin = begin | 0; + } + if (end !== undefined) { + if (end === Infinity) { + end = originalSize; + } else { + end = end | 0; + } + } + + if (wholeSlice(begin, end, originalSize)) { + return iterable; + } + + var resolvedBegin = resolveBegin(begin, originalSize); + var resolvedEnd = resolveEnd(end, originalSize); + + // begin or end will be NaN if they were provided as negative numbers and + // this iterable's size is unknown. In that case, cache first so there is + // a known size and these do not resolve to NaN. + if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) { + return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys); + } + + // Note: resolvedEnd is undefined when the original sequence's length is + // unknown and this slice did not supply an end and should contain all + // elements after resolvedBegin. + // In that case, resolvedSize will be NaN and sliceSize will remain undefined. + var resolvedSize = resolvedEnd - resolvedBegin; + var sliceSize; + if (resolvedSize === resolvedSize) { + sliceSize = resolvedSize < 0 ? 0 : resolvedSize; + } + + var sliceSeq = makeSequence(iterable); + + // If iterable.size is undefined, the size of the realized sliceSeq is + // unknown at this point unless the number of items to slice is 0 + sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined; + + if (!useKeys && isSeq(iterable) && sliceSize >= 0) { + sliceSeq.get = function (index, notSetValue) { + index = wrapIndex(this, index); + return index >= 0 && index < sliceSize ? + iterable.get(index + resolvedBegin, notSetValue) : + notSetValue; + } + } + + sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this; + if (sliceSize === 0) { + return 0; + } + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var skipped = 0; + var isSkipping = true; + var iterations = 0; + iterable.__iterate(function(v, k) { + if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$0) !== false && + iterations !== sliceSize; + } + }); + return iterations; + }; + + sliceSeq.__iteratorUncached = function(type, reverse) { + if (sliceSize !== 0 && reverse) { + return this.cacheResult().__iterator(type, reverse); + } + // Don't bother instantiating parent iterator if taking 0. + var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse); + var skipped = 0; + var iterations = 0; + return new Iterator(function() { + while (skipped++ < resolvedBegin) { + iterator.next(); + } + if (++iterations > sliceSize) { + return iteratorDone(); + } + var step = iterator.next(); + if (useKeys || type === ITERATE_VALUES) { + return step; + } else if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations - 1, undefined, step); + } else { + return iteratorValue(type, iterations - 1, step.value[1], step); + } + }); + } + + return sliceSeq; + } + + + function takeWhileFactory(iterable, predicate, context) { + var takeSequence = makeSequence(iterable); + takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterations = 0; + iterable.__iterate(function(v, k, c) + {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)} + ); + return iterations; + }; + takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); + var iterating = true; + return new Iterator(function() { + if (!iterating) { + return iteratorDone(); + } + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var k = entry[0]; + var v = entry[1]; + if (!predicate.call(context, v, k, this$0)) { + iterating = false; + return iteratorDone(); + } + return type === ITERATE_ENTRIES ? step : + iteratorValue(type, k, v, step); + }); + }; + return takeSequence; + } + + + function skipWhileFactory(iterable, predicate, context, useKeys) { + var skipSequence = makeSequence(iterable); + skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var isSkipping = true; + var iterations = 0; + iterable.__iterate(function(v, k, c) { + if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$0); + } + }); + return iterations; + }; + skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); + var skipping = true; + var iterations = 0; + return new Iterator(function() { + var step, k, v; + do { + step = iterator.next(); + if (step.done) { + if (useKeys || type === ITERATE_VALUES) { + return step; + } else if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations++, undefined, step); + } else { + return iteratorValue(type, iterations++, step.value[1], step); + } + } + var entry = step.value; + k = entry[0]; + v = entry[1]; + skipping && (skipping = predicate.call(context, v, k, this$0)); + } while (skipping); + return type === ITERATE_ENTRIES ? step : + iteratorValue(type, k, v, step); + }); + }; + return skipSequence; + } + + + function concatFactory(iterable, values) { + var isKeyedIterable = isKeyed(iterable); + var iters = [iterable].concat(values).map(function(v ) { + if (!isIterable(v)) { + v = isKeyedIterable ? + keyedSeqFromValue(v) : + indexedSeqFromValue(Array.isArray(v) ? v : [v]); + } else if (isKeyedIterable) { + v = KeyedIterable(v); + } + return v; + }).filter(function(v ) {return v.size !== 0}); + + if (iters.length === 0) { + return iterable; + } + + if (iters.length === 1) { + var singleton = iters[0]; + if (singleton === iterable || + isKeyedIterable && isKeyed(singleton) || + isIndexed(iterable) && isIndexed(singleton)) { + return singleton; + } + } + + var concatSeq = new ArraySeq(iters); + if (isKeyedIterable) { + concatSeq = concatSeq.toKeyedSeq(); + } else if (!isIndexed(iterable)) { + concatSeq = concatSeq.toSetSeq(); + } + concatSeq = concatSeq.flatten(true); + concatSeq.size = iters.reduce( + function(sum, seq) { + if (sum !== undefined) { + var size = seq.size; + if (size !== undefined) { + return sum + size; + } + } + }, + 0 + ); + return concatSeq; + } + + + function flattenFactory(iterable, depth, useKeys) { + var flatSequence = makeSequence(iterable); + flatSequence.__iterateUncached = function(fn, reverse) { + var iterations = 0; + var stopped = false; + function flatDeep(iter, currentDepth) {var this$0 = this; + iter.__iterate(function(v, k) { + if ((!depth || currentDepth < depth) && isIterable(v)) { + flatDeep(v, currentDepth + 1); + } else if (fn(v, useKeys ? k : iterations++, this$0) === false) { + stopped = true; + } + return !stopped; + }, reverse); + } + flatDeep(iterable, 0); + return iterations; + } + flatSequence.__iteratorUncached = function(type, reverse) { + var iterator = iterable.__iterator(type, reverse); + var stack = []; + var iterations = 0; + return new Iterator(function() { + while (iterator) { + var step = iterator.next(); + if (step.done !== false) { + iterator = stack.pop(); + continue; + } + var v = step.value; + if (type === ITERATE_ENTRIES) { + v = v[1]; + } + if ((!depth || stack.length < depth) && isIterable(v)) { + stack.push(iterator); + iterator = v.__iterator(type, reverse); + } else { + return useKeys ? step : iteratorValue(type, iterations++, v, step); + } + } + return iteratorDone(); + }); + } + return flatSequence; + } + + + function flatMapFactory(iterable, mapper, context) { + var coerce = iterableClass(iterable); + return iterable.toSeq().map( + function(v, k) {return coerce(mapper.call(context, v, k, iterable))} + ).flatten(true); + } + + + function interposeFactory(iterable, separator) { + var interposedSequence = makeSequence(iterable); + interposedSequence.size = iterable.size && iterable.size * 2 -1; + interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; + var iterations = 0; + iterable.__iterate(function(v, k) + {return (!iterations || fn(separator, iterations++, this$0) !== false) && + fn(v, iterations++, this$0) !== false}, + reverse + ); + return iterations; + }; + interposedSequence.__iteratorUncached = function(type, reverse) { + var iterator = iterable.__iterator(ITERATE_VALUES, reverse); + var iterations = 0; + var step; + return new Iterator(function() { + if (!step || iterations % 2) { + step = iterator.next(); + if (step.done) { + return step; + } + } + return iterations % 2 ? + iteratorValue(type, iterations++, separator) : + iteratorValue(type, iterations++, step.value, step); + }); + }; + return interposedSequence; + } + + + function sortFactory(iterable, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + var isKeyedIterable = isKeyed(iterable); + var index = 0; + var entries = iterable.toSeq().map( + function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]} + ).toArray(); + entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach( + isKeyedIterable ? + function(v, i) { entries[i].length = 2; } : + function(v, i) { entries[i] = v[1]; } + ); + return isKeyedIterable ? KeyedSeq(entries) : + isIndexed(iterable) ? IndexedSeq(entries) : + SetSeq(entries); + } + + + function maxFactory(iterable, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + if (mapper) { + var entry = iterable.toSeq() + .map(function(v, k) {return [v, mapper(v, k, iterable)]}) + .reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a}); + return entry && entry[0]; + } else { + return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a}); + } + } + + function maxCompare(comparator, a, b) { + var comp = comparator(b, a); + // b is considered the new max if the comparator declares them equal, but + // they are not equal and b is in fact a nullish value. + return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0; + } + + + function zipWithFactory(keyIter, zipper, iters) { + var zipSequence = makeSequence(keyIter); + zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min(); + // Note: this a generic base implementation of __iterate in terms of + // __iterator which may be more generically useful in the future. + zipSequence.__iterate = function(fn, reverse) { + /* generic: + var iterator = this.__iterator(ITERATE_ENTRIES, reverse); + var step; + var iterations = 0; + while (!(step = iterator.next()).done) { + iterations++; + if (fn(step.value[1], step.value[0], this) === false) { + break; + } + } + return iterations; + */ + // indexed: + var iterator = this.__iterator(ITERATE_VALUES, reverse); + var step; + var iterations = 0; + while (!(step = iterator.next()).done) { + if (fn(step.value, iterations++, this) === false) { + break; + } + } + return iterations; + }; + zipSequence.__iteratorUncached = function(type, reverse) { + var iterators = iters.map(function(i ) + {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))} + ); + var iterations = 0; + var isDone = false; + return new Iterator(function() { + var steps; + if (!isDone) { + steps = iterators.map(function(i ) {return i.next()}); + isDone = steps.some(function(s ) {return s.done}); + } + if (isDone) { + return iteratorDone(); + } + return iteratorValue( + type, + iterations++, + zipper.apply(null, steps.map(function(s ) {return s.value})) + ); + }); + }; + return zipSequence + } + + + // #pragma Helper Functions + + function reify(iter, seq) { + return isSeq(iter) ? seq : iter.constructor(seq); + } + + function validateEntry(entry) { + if (entry !== Object(entry)) { + throw new TypeError('Expected [K, V] tuple: ' + entry); + } + } + + function resolveSize(iter) { + assertNotInfinite(iter.size); + return ensureSize(iter); + } + + function iterableClass(iterable) { + return isKeyed(iterable) ? KeyedIterable : + isIndexed(iterable) ? IndexedIterable : + SetIterable; + } + + function makeSequence(iterable) { + return Object.create( + ( + isKeyed(iterable) ? KeyedSeq : + isIndexed(iterable) ? IndexedSeq : + SetSeq + ).prototype + ); + } + + function cacheResultThrough() { + if (this._iter.cacheResult) { + this._iter.cacheResult(); + this.size = this._iter.size; + return this; + } else { + return Seq.prototype.cacheResult.call(this); + } + } + + function defaultComparator(a, b) { + return a > b ? 1 : a < b ? -1 : 0; + } + + function forceIterator(keyPath) { + var iter = getIterator(keyPath); + if (!iter) { + // Array might not be iterable in this environment, so we need a fallback + // to our wrapped type. + if (!isArrayLike(keyPath)) { + throw new TypeError('Expected iterable or array-like: ' + keyPath); + } + iter = getIterator(Iterable(keyPath)); + } + return iter; + } + + createClass(Record, KeyedCollection); + + function Record(defaultValues, name) { + var hasInitialized; + + var RecordType = function Record(values) { + if (values instanceof RecordType) { + return values; + } + if (!(this instanceof RecordType)) { + return new RecordType(values); + } + if (!hasInitialized) { + hasInitialized = true; + var keys = Object.keys(defaultValues); + setProps(RecordTypePrototype, keys); + RecordTypePrototype.size = keys.length; + RecordTypePrototype._name = name; + RecordTypePrototype._keys = keys; + RecordTypePrototype._defaultValues = defaultValues; + } + this._map = Map(values); + }; + + var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype); + RecordTypePrototype.constructor = RecordType; + + return RecordType; + } + + Record.prototype.toString = function() { + return this.__toString(recordName(this) + ' {', '}'); + }; + + // @pragma Access + + Record.prototype.has = function(k) { + return this._defaultValues.hasOwnProperty(k); + }; + + Record.prototype.get = function(k, notSetValue) { + if (!this.has(k)) { + return notSetValue; + } + var defaultVal = this._defaultValues[k]; + return this._map ? this._map.get(k, defaultVal) : defaultVal; + }; + + // @pragma Modification + + Record.prototype.clear = function() { + if (this.__ownerID) { + this._map && this._map.clear(); + return this; + } + var RecordType = this.constructor; + return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap())); + }; + + Record.prototype.set = function(k, v) { + if (!this.has(k)) { + throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this)); + } + if (this._map && !this._map.has(k)) { + var defaultVal = this._defaultValues[k]; + if (v === defaultVal) { + return this; + } + } + var newMap = this._map && this._map.set(k, v); + if (this.__ownerID || newMap === this._map) { + return this; + } + return makeRecord(this, newMap); + }; + + Record.prototype.remove = function(k) { + if (!this.has(k)) { + return this; + } + var newMap = this._map && this._map.remove(k); + if (this.__ownerID || newMap === this._map) { + return this; + } + return makeRecord(this, newMap); + }; + + Record.prototype.wasAltered = function() { + return this._map.wasAltered(); + }; + + Record.prototype.__iterator = function(type, reverse) {var this$0 = this; + return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse); + }; + + Record.prototype.__iterate = function(fn, reverse) {var this$0 = this; + return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse); + }; + + Record.prototype.__ensureOwner = function(ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map && this._map.__ensureOwner(ownerID); + if (!ownerID) { + this.__ownerID = ownerID; + this._map = newMap; + return this; + } + return makeRecord(this, newMap, ownerID); + }; + + + var RecordPrototype = Record.prototype; + RecordPrototype[DELETE] = RecordPrototype.remove; + RecordPrototype.deleteIn = + RecordPrototype.removeIn = MapPrototype.removeIn; + RecordPrototype.merge = MapPrototype.merge; + RecordPrototype.mergeWith = MapPrototype.mergeWith; + RecordPrototype.mergeIn = MapPrototype.mergeIn; + RecordPrototype.mergeDeep = MapPrototype.mergeDeep; + RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith; + RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; + RecordPrototype.setIn = MapPrototype.setIn; + RecordPrototype.update = MapPrototype.update; + RecordPrototype.updateIn = MapPrototype.updateIn; + RecordPrototype.withMutations = MapPrototype.withMutations; + RecordPrototype.asMutable = MapPrototype.asMutable; + RecordPrototype.asImmutable = MapPrototype.asImmutable; + + + function makeRecord(likeRecord, map, ownerID) { + var record = Object.create(Object.getPrototypeOf(likeRecord)); + record._map = map; + record.__ownerID = ownerID; + return record; + } + + function recordName(record) { + return record._name || record.constructor.name || 'Record'; + } + + function setProps(prototype, names) { + try { + names.forEach(setProp.bind(undefined, prototype)); + } catch (error) { + // Object.defineProperty failed. Probably IE8. + } + } + + function setProp(prototype, name) { + Object.defineProperty(prototype, name, { + get: function() { + return this.get(name); + }, + set: function(value) { + invariant(this.__ownerID, 'Cannot set on an immutable record.'); + this.set(name, value); + } + }); + } + + createClass(Set, SetCollection); + + // @pragma Construction + + function Set(value) { + return value === null || value === undefined ? emptySet() : + isSet(value) && !isOrdered(value) ? value : + emptySet().withMutations(function(set ) { + var iter = SetIterable(value); + assertNotInfinite(iter.size); + iter.forEach(function(v ) {return set.add(v)}); + }); + } + + Set.of = function(/*...values*/) { + return this(arguments); + }; + + Set.fromKeys = function(value) { + return this(KeyedIterable(value).keySeq()); + }; + + Set.prototype.toString = function() { + return this.__toString('Set {', '}'); + }; + + // @pragma Access + + Set.prototype.has = function(value) { + return this._map.has(value); + }; + + // @pragma Modification + + Set.prototype.add = function(value) { + return updateSet(this, this._map.set(value, true)); + }; + + Set.prototype.remove = function(value) { + return updateSet(this, this._map.remove(value)); + }; + + Set.prototype.clear = function() { + return updateSet(this, this._map.clear()); + }; + + // @pragma Composition + + Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0); + iters = iters.filter(function(x ) {return x.size !== 0}); + if (iters.length === 0) { + return this; + } + if (this.size === 0 && !this.__ownerID && iters.length === 1) { + return this.constructor(iters[0]); + } + return this.withMutations(function(set ) { + for (var ii = 0; ii < iters.length; ii++) { + SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)}); + } + }); + }; + + Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0); + if (iters.length === 0) { + return this; + } + iters = iters.map(function(iter ) {return SetIterable(iter)}); + var originalSet = this; + return this.withMutations(function(set ) { + originalSet.forEach(function(value ) { + if (!iters.every(function(iter ) {return iter.includes(value)})) { + set.remove(value); + } + }); + }); + }; + + Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0); + if (iters.length === 0) { + return this; + } + iters = iters.map(function(iter ) {return SetIterable(iter)}); + var originalSet = this; + return this.withMutations(function(set ) { + originalSet.forEach(function(value ) { + if (iters.some(function(iter ) {return iter.includes(value)})) { + set.remove(value); + } + }); + }); + }; + + Set.prototype.merge = function() { + return this.union.apply(this, arguments); + }; + + Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); + return this.union.apply(this, iters); + }; + + Set.prototype.sort = function(comparator) { + // Late binding + return OrderedSet(sortFactory(this, comparator)); + }; + + Set.prototype.sortBy = function(mapper, comparator) { + // Late binding + return OrderedSet(sortFactory(this, comparator, mapper)); + }; + + Set.prototype.wasAltered = function() { + return this._map.wasAltered(); + }; + + Set.prototype.__iterate = function(fn, reverse) {var this$0 = this; + return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse); + }; + + Set.prototype.__iterator = function(type, reverse) { + return this._map.map(function(_, k) {return k}).__iterator(type, reverse); + }; + + Set.prototype.__ensureOwner = function(ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + if (!ownerID) { + this.__ownerID = ownerID; + this._map = newMap; + return this; + } + return this.__make(newMap, ownerID); + }; + + + function isSet(maybeSet) { + return !!(maybeSet && maybeSet[IS_SET_SENTINEL]); + } + + Set.isSet = isSet; + + var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; + + var SetPrototype = Set.prototype; + SetPrototype[IS_SET_SENTINEL] = true; + SetPrototype[DELETE] = SetPrototype.remove; + SetPrototype.mergeDeep = SetPrototype.merge; + SetPrototype.mergeDeepWith = SetPrototype.mergeWith; + SetPrototype.withMutations = MapPrototype.withMutations; + SetPrototype.asMutable = MapPrototype.asMutable; + SetPrototype.asImmutable = MapPrototype.asImmutable; + + SetPrototype.__empty = emptySet; + SetPrototype.__make = makeSet; + + function updateSet(set, newMap) { + if (set.__ownerID) { + set.size = newMap.size; + set._map = newMap; + return set; + } + return newMap === set._map ? set : + newMap.size === 0 ? set.__empty() : + set.__make(newMap); + } + + function makeSet(map, ownerID) { + var set = Object.create(SetPrototype); + set.size = map ? map.size : 0; + set._map = map; + set.__ownerID = ownerID; + return set; + } + + var EMPTY_SET; + function emptySet() { + return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); + } + + createClass(OrderedSet, Set); + + // @pragma Construction + + function OrderedSet(value) { + return value === null || value === undefined ? emptyOrderedSet() : + isOrderedSet(value) ? value : + emptyOrderedSet().withMutations(function(set ) { + var iter = SetIterable(value); + assertNotInfinite(iter.size); + iter.forEach(function(v ) {return set.add(v)}); + }); + } + + OrderedSet.of = function(/*...values*/) { + return this(arguments); + }; + + OrderedSet.fromKeys = function(value) { + return this(KeyedIterable(value).keySeq()); + }; + + OrderedSet.prototype.toString = function() { + return this.__toString('OrderedSet {', '}'); + }; + + + function isOrderedSet(maybeOrderedSet) { + return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); + } + + OrderedSet.isOrderedSet = isOrderedSet; + + var OrderedSetPrototype = OrderedSet.prototype; + OrderedSetPrototype[IS_ORDERED_SENTINEL] = true; + + OrderedSetPrototype.__empty = emptyOrderedSet; + OrderedSetPrototype.__make = makeOrderedSet; + + function makeOrderedSet(map, ownerID) { + var set = Object.create(OrderedSetPrototype); + set.size = map ? map.size : 0; + set._map = map; + set.__ownerID = ownerID; + return set; + } + + var EMPTY_ORDERED_SET; + function emptyOrderedSet() { + return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())); + } + + createClass(Stack, IndexedCollection); + + // @pragma Construction + + function Stack(value) { + return value === null || value === undefined ? emptyStack() : + isStack(value) ? value : + emptyStack().unshiftAll(value); + } + + Stack.of = function(/*...values*/) { + return this(arguments); + }; + + Stack.prototype.toString = function() { + return this.__toString('Stack [', ']'); + }; + + // @pragma Access + + Stack.prototype.get = function(index, notSetValue) { + var head = this._head; + index = wrapIndex(this, index); + while (head && index--) { + head = head.next; + } + return head ? head.value : notSetValue; + }; + + Stack.prototype.peek = function() { + return this._head && this._head.value; + }; + + // @pragma Modification + + Stack.prototype.push = function(/*...values*/) { + if (arguments.length === 0) { + return this; + } + var newSize = this.size + arguments.length; + var head = this._head; + for (var ii = arguments.length - 1; ii >= 0; ii--) { + head = { + value: arguments[ii], + next: head + }; + } + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + Stack.prototype.pushAll = function(iter) { + iter = IndexedIterable(iter); + if (iter.size === 0) { + return this; + } + assertNotInfinite(iter.size); + var newSize = this.size; + var head = this._head; + iter.reverse().forEach(function(value ) { + newSize++; + head = { + value: value, + next: head + }; + }); + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + Stack.prototype.pop = function() { + return this.slice(1); + }; + + Stack.prototype.unshift = function(/*...values*/) { + return this.push.apply(this, arguments); + }; + + Stack.prototype.unshiftAll = function(iter) { + return this.pushAll(iter); + }; + + Stack.prototype.shift = function() { + return this.pop.apply(this, arguments); + }; + + Stack.prototype.clear = function() { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._head = undefined; + this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyStack(); + }; + + Stack.prototype.slice = function(begin, end) { + if (wholeSlice(begin, end, this.size)) { + return this; + } + var resolvedBegin = resolveBegin(begin, this.size); + var resolvedEnd = resolveEnd(end, this.size); + if (resolvedEnd !== this.size) { + // super.slice(begin, end); + return IndexedCollection.prototype.slice.call(this, begin, end); + } + var newSize = this.size - resolvedBegin; + var head = this._head; + while (resolvedBegin--) { + head = head.next; + } + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + // @pragma Mutability + + Stack.prototype.__ensureOwner = function(ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeStack(this.size, this._head, ownerID, this.__hash); + }; + + // @pragma Iteration + + Stack.prototype.__iterate = function(fn, reverse) { + if (reverse) { + return this.reverse().__iterate(fn); + } + var iterations = 0; + var node = this._head; + while (node) { + if (fn(node.value, iterations++, this) === false) { + break; + } + node = node.next; + } + return iterations; + }; + + Stack.prototype.__iterator = function(type, reverse) { + if (reverse) { + return this.reverse().__iterator(type); + } + var iterations = 0; + var node = this._head; + return new Iterator(function() { + if (node) { + var value = node.value; + node = node.next; + return iteratorValue(type, iterations++, value); + } + return iteratorDone(); + }); + }; + + + function isStack(maybeStack) { + return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]); + } + + Stack.isStack = isStack; + + var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; + + var StackPrototype = Stack.prototype; + StackPrototype[IS_STACK_SENTINEL] = true; + StackPrototype.withMutations = MapPrototype.withMutations; + StackPrototype.asMutable = MapPrototype.asMutable; + StackPrototype.asImmutable = MapPrototype.asImmutable; + StackPrototype.wasAltered = MapPrototype.wasAltered; + + + function makeStack(size, head, ownerID, hash) { + var map = Object.create(StackPrototype); + map.size = size; + map._head = head; + map.__ownerID = ownerID; + map.__hash = hash; + map.__altered = false; + return map; + } + + var EMPTY_STACK; + function emptyStack() { + return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); + } + + /** + * Contributes additional methods to a constructor + */ + function mixin(ctor, methods) { + var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; }; + Object.keys(methods).forEach(keyCopier); + Object.getOwnPropertySymbols && + Object.getOwnPropertySymbols(methods).forEach(keyCopier); + return ctor; + } + + Iterable.Iterator = Iterator; + + mixin(Iterable, { + + // ### Conversion to other types + + toArray: function() { + assertNotInfinite(this.size); + var array = new Array(this.size || 0); + this.valueSeq().__iterate(function(v, i) { array[i] = v; }); + return array; + }, + + toIndexedSeq: function() { + return new ToIndexedSequence(this); + }, + + toJS: function() { + return this.toSeq().map( + function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value} + ).__toJS(); + }, + + toJSON: function() { + return this.toSeq().map( + function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value} + ).__toJS(); + }, + + toKeyedSeq: function() { + return new ToKeyedSequence(this, true); + }, + + toMap: function() { + // Use Late Binding here to solve the circular dependency. + return Map(this.toKeyedSeq()); + }, + + toObject: function() { + assertNotInfinite(this.size); + var object = {}; + this.__iterate(function(v, k) { object[k] = v; }); + return object; + }, + + toOrderedMap: function() { + // Use Late Binding here to solve the circular dependency. + return OrderedMap(this.toKeyedSeq()); + }, + + toOrderedSet: function() { + // Use Late Binding here to solve the circular dependency. + return OrderedSet(isKeyed(this) ? this.valueSeq() : this); + }, + + toSet: function() { + // Use Late Binding here to solve the circular dependency. + return Set(isKeyed(this) ? this.valueSeq() : this); + }, + + toSetSeq: function() { + return new ToSetSequence(this); + }, + + toSeq: function() { + return isIndexed(this) ? this.toIndexedSeq() : + isKeyed(this) ? this.toKeyedSeq() : + this.toSetSeq(); + }, + + toStack: function() { + // Use Late Binding here to solve the circular dependency. + return Stack(isKeyed(this) ? this.valueSeq() : this); + }, + + toList: function() { + // Use Late Binding here to solve the circular dependency. + return List(isKeyed(this) ? this.valueSeq() : this); + }, + + + // ### Common JavaScript methods and properties + + toString: function() { + return '[Iterable]'; + }, + + __toString: function(head, tail) { + if (this.size === 0) { + return head + tail; + } + return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail; + }, + + + // ### ES6 Collection methods (ES6 Array and Map) + + concat: function() {var values = SLICE$0.call(arguments, 0); + return reify(this, concatFactory(this, values)); + }, + + includes: function(searchValue) { + return this.some(function(value ) {return is(value, searchValue)}); + }, + + entries: function() { + return this.__iterator(ITERATE_ENTRIES); + }, + + every: function(predicate, context) { + assertNotInfinite(this.size); + var returnValue = true; + this.__iterate(function(v, k, c) { + if (!predicate.call(context, v, k, c)) { + returnValue = false; + return false; + } + }); + return returnValue; + }, + + filter: function(predicate, context) { + return reify(this, filterFactory(this, predicate, context, true)); + }, + + find: function(predicate, context, notSetValue) { + var entry = this.findEntry(predicate, context); + return entry ? entry[1] : notSetValue; + }, + + forEach: function(sideEffect, context) { + assertNotInfinite(this.size); + return this.__iterate(context ? sideEffect.bind(context) : sideEffect); + }, + + join: function(separator) { + assertNotInfinite(this.size); + separator = separator !== undefined ? '' + separator : ','; + var joined = ''; + var isFirst = true; + this.__iterate(function(v ) { + isFirst ? (isFirst = false) : (joined += separator); + joined += v !== null && v !== undefined ? v.toString() : ''; + }); + return joined; + }, + + keys: function() { + return this.__iterator(ITERATE_KEYS); + }, + + map: function(mapper, context) { + return reify(this, mapFactory(this, mapper, context)); + }, + + reduce: function(reducer, initialReduction, context) { + assertNotInfinite(this.size); + var reduction; + var useFirst; + if (arguments.length < 2) { + useFirst = true; + } else { + reduction = initialReduction; + } + this.__iterate(function(v, k, c) { + if (useFirst) { + useFirst = false; + reduction = v; + } else { + reduction = reducer.call(context, reduction, v, k, c); + } + }); + return reduction; + }, + + reduceRight: function(reducer, initialReduction, context) { + var reversed = this.toKeyedSeq().reverse(); + return reversed.reduce.apply(reversed, arguments); + }, + + reverse: function() { + return reify(this, reverseFactory(this, true)); + }, + + slice: function(begin, end) { + return reify(this, sliceFactory(this, begin, end, true)); + }, + + some: function(predicate, context) { + return !this.every(not(predicate), context); + }, + + sort: function(comparator) { + return reify(this, sortFactory(this, comparator)); + }, + + values: function() { + return this.__iterator(ITERATE_VALUES); + }, + + + // ### More sequential methods + + butLast: function() { + return this.slice(0, -1); + }, + + isEmpty: function() { + return this.size !== undefined ? this.size === 0 : !this.some(function() {return true}); + }, + + count: function(predicate, context) { + return ensureSize( + predicate ? this.toSeq().filter(predicate, context) : this + ); + }, + + countBy: function(grouper, context) { + return countByFactory(this, grouper, context); + }, + + equals: function(other) { + return deepEqual(this, other); + }, + + entrySeq: function() { + var iterable = this; + if (iterable._cache) { + // We cache as an entries array, so we can just return the cache! + return new ArraySeq(iterable._cache); + } + var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq(); + entriesSequence.fromEntrySeq = function() {return iterable.toSeq()}; + return entriesSequence; + }, + + filterNot: function(predicate, context) { + return this.filter(not(predicate), context); + }, + + findEntry: function(predicate, context, notSetValue) { + var found = notSetValue; + this.__iterate(function(v, k, c) { + if (predicate.call(context, v, k, c)) { + found = [k, v]; + return false; + } + }); + return found; + }, + + findKey: function(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry && entry[0]; + }, + + findLast: function(predicate, context, notSetValue) { + return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); + }, + + findLastEntry: function(predicate, context, notSetValue) { + return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue); + }, + + findLastKey: function(predicate, context) { + return this.toKeyedSeq().reverse().findKey(predicate, context); + }, + + first: function() { + return this.find(returnTrue); + }, + + flatMap: function(mapper, context) { + return reify(this, flatMapFactory(this, mapper, context)); + }, + + flatten: function(depth) { + return reify(this, flattenFactory(this, depth, true)); + }, + + fromEntrySeq: function() { + return new FromEntriesSequence(this); + }, + + get: function(searchKey, notSetValue) { + return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue); + }, + + getIn: function(searchKeyPath, notSetValue) { + var nested = this; + // Note: in an ES6 environment, we would prefer: + // for (var key of searchKeyPath) { + var iter = forceIterator(searchKeyPath); + var step; + while (!(step = iter.next()).done) { + var key = step.value; + nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET; + if (nested === NOT_SET) { + return notSetValue; + } + } + return nested; + }, + + groupBy: function(grouper, context) { + return groupByFactory(this, grouper, context); + }, + + has: function(searchKey) { + return this.get(searchKey, NOT_SET) !== NOT_SET; + }, + + hasIn: function(searchKeyPath) { + return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; + }, + + isSubset: function(iter) { + iter = typeof iter.includes === 'function' ? iter : Iterable(iter); + return this.every(function(value ) {return iter.includes(value)}); + }, + + isSuperset: function(iter) { + iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter); + return iter.isSubset(this); + }, + + keyOf: function(searchValue) { + return this.findKey(function(value ) {return is(value, searchValue)}); + }, + + keySeq: function() { + return this.toSeq().map(keyMapper).toIndexedSeq(); + }, + + last: function() { + return this.toSeq().reverse().first(); + }, + + lastKeyOf: function(searchValue) { + return this.toKeyedSeq().reverse().keyOf(searchValue); + }, + + max: function(comparator) { + return maxFactory(this, comparator); + }, + + maxBy: function(mapper, comparator) { + return maxFactory(this, comparator, mapper); + }, + + min: function(comparator) { + return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator); + }, + + minBy: function(mapper, comparator) { + return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper); + }, + + rest: function() { + return this.slice(1); + }, + + skip: function(amount) { + return this.slice(Math.max(0, amount)); + }, + + skipLast: function(amount) { + return reify(this, this.toSeq().reverse().skip(amount).reverse()); + }, + + skipWhile: function(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, true)); + }, + + skipUntil: function(predicate, context) { + return this.skipWhile(not(predicate), context); + }, + + sortBy: function(mapper, comparator) { + return reify(this, sortFactory(this, comparator, mapper)); + }, + + take: function(amount) { + return this.slice(0, Math.max(0, amount)); + }, + + takeLast: function(amount) { + return reify(this, this.toSeq().reverse().take(amount).reverse()); + }, + + takeWhile: function(predicate, context) { + return reify(this, takeWhileFactory(this, predicate, context)); + }, + + takeUntil: function(predicate, context) { + return this.takeWhile(not(predicate), context); + }, + + valueSeq: function() { + return this.toIndexedSeq(); + }, + + + // ### Hashable Object + + hashCode: function() { + return this.__hash || (this.__hash = hashIterable(this)); + } + + + // ### Internal + + // abstract __iterate(fn, reverse) + + // abstract __iterator(type, reverse) + }); + + // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; + // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; + // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; + // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; + + var IterablePrototype = Iterable.prototype; + IterablePrototype[IS_ITERABLE_SENTINEL] = true; + IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values; + IterablePrototype.__toJS = IterablePrototype.toArray; + IterablePrototype.__toStringMapper = quoteString; + IterablePrototype.inspect = + IterablePrototype.toSource = function() { return this.toString(); }; + IterablePrototype.chain = IterablePrototype.flatMap; + IterablePrototype.contains = IterablePrototype.includes; + + mixin(KeyedIterable, { + + // ### More sequential methods + + flip: function() { + return reify(this, flipFactory(this)); + }, + + mapEntries: function(mapper, context) {var this$0 = this; + var iterations = 0; + return reify(this, + this.toSeq().map( + function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)} + ).fromEntrySeq() + ); + }, + + mapKeys: function(mapper, context) {var this$0 = this; + return reify(this, + this.toSeq().flip().map( + function(k, v) {return mapper.call(context, k, v, this$0)} + ).flip() + ); + } + + }); + + var KeyedIterablePrototype = KeyedIterable.prototype; + KeyedIterablePrototype[IS_KEYED_SENTINEL] = true; + KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries; + KeyedIterablePrototype.__toJS = IterablePrototype.toObject; + KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)}; + + + + mixin(IndexedIterable, { + + // ### Conversion to other types + + toKeyedSeq: function() { + return new ToKeyedSequence(this, false); + }, + + + // ### ES6 Collection methods (ES6 Array and Map) + + filter: function(predicate, context) { + return reify(this, filterFactory(this, predicate, context, false)); + }, + + findIndex: function(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + indexOf: function(searchValue) { + var key = this.keyOf(searchValue); + return key === undefined ? -1 : key; + }, + + lastIndexOf: function(searchValue) { + var key = this.lastKeyOf(searchValue); + return key === undefined ? -1 : key; + }, + + reverse: function() { + return reify(this, reverseFactory(this, false)); + }, + + slice: function(begin, end) { + return reify(this, sliceFactory(this, begin, end, false)); + }, + + splice: function(index, removeNum /*, ...values*/) { + var numArgs = arguments.length; + removeNum = Math.max(removeNum | 0, 0); + if (numArgs === 0 || (numArgs === 2 && !removeNum)) { + return this; + } + // If index is negative, it should resolve relative to the size of the + // collection. However size may be expensive to compute if not cached, so + // only call count() if the number is in fact negative. + index = resolveBegin(index, index < 0 ? this.count() : this.size); + var spliced = this.slice(0, index); + return reify( + this, + numArgs === 1 ? + spliced : + spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) + ); + }, + + + // ### More collection methods + + findLastIndex: function(predicate, context) { + var entry = this.findLastEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + first: function() { + return this.get(0); + }, + + flatten: function(depth) { + return reify(this, flattenFactory(this, depth, false)); + }, + + get: function(index, notSetValue) { + index = wrapIndex(this, index); + return (index < 0 || (this.size === Infinity || + (this.size !== undefined && index > this.size))) ? + notSetValue : + this.find(function(_, key) {return key === index}, undefined, notSetValue); + }, + + has: function(index) { + index = wrapIndex(this, index); + return index >= 0 && (this.size !== undefined ? + this.size === Infinity || index < this.size : + this.indexOf(index) !== -1 + ); + }, + + interpose: function(separator) { + return reify(this, interposeFactory(this, separator)); + }, + + interleave: function(/*...iterables*/) { + var iterables = [this].concat(arrCopy(arguments)); + var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables); + var interleaved = zipped.flatten(true); + if (zipped.size) { + interleaved.size = zipped.size * iterables.length; + } + return reify(this, interleaved); + }, + + keySeq: function() { + return Range(0, this.size); + }, + + last: function() { + return this.get(-1); + }, + + skipWhile: function(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, false)); + }, + + zip: function(/*, ...iterables */) { + var iterables = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, iterables)); + }, + + zipWith: function(zipper/*, ...iterables */) { + var iterables = arrCopy(arguments); + iterables[0] = this; + return reify(this, zipWithFactory(this, zipper, iterables)); + } + + }); + + IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true; + IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true; + + + + mixin(SetIterable, { + + // ### ES6 Collection methods (ES6 Array and Map) + + get: function(value, notSetValue) { + return this.has(value) ? value : notSetValue; + }, + + includes: function(value) { + return this.has(value); + }, + + + // ### More sequential methods + + keySeq: function() { + return this.valueSeq(); + } + + }); + + SetIterable.prototype.has = IterablePrototype.includes; + SetIterable.prototype.contains = SetIterable.prototype.includes; + + + // Mixin subclasses + + mixin(KeyedSeq, KeyedIterable.prototype); + mixin(IndexedSeq, IndexedIterable.prototype); + mixin(SetSeq, SetIterable.prototype); + + mixin(KeyedCollection, KeyedIterable.prototype); + mixin(IndexedCollection, IndexedIterable.prototype); + mixin(SetCollection, SetIterable.prototype); + + + // #pragma Helper functions + + function keyMapper(v, k) { + return k; + } + + function entryMapper(v, k) { + return [k, v]; + } + + function not(predicate) { + return function() { + return !predicate.apply(this, arguments); + } + } + + function neg(predicate) { + return function() { + return -predicate.apply(this, arguments); + } + } + + function quoteString(value) { + return typeof value === 'string' ? JSON.stringify(value) : String(value); + } + + function defaultZipper() { + return arrCopy(arguments); + } + + function defaultNegComparator(a, b) { + return a < b ? 1 : a > b ? -1 : 0; + } + + function hashIterable(iterable) { + if (iterable.size === Infinity) { + return 0; + } + var ordered = isOrdered(iterable); + var keyed = isKeyed(iterable); + var h = ordered ? 1 : 0; + var size = iterable.__iterate( + keyed ? + ordered ? + function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } : + function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } : + ordered ? + function(v ) { h = 31 * h + hash(v) | 0; } : + function(v ) { h = h + hash(v) | 0; } + ); + return murmurHashOfSize(size, h); + } + + function murmurHashOfSize(size, h) { + h = imul(h, 0xCC9E2D51); + h = imul(h << 15 | h >>> -15, 0x1B873593); + h = imul(h << 13 | h >>> -13, 5); + h = (h + 0xE6546B64 | 0) ^ size; + h = imul(h ^ h >>> 16, 0x85EBCA6B); + h = imul(h ^ h >>> 13, 0xC2B2AE35); + h = smi(h ^ h >>> 16); + return h; + } + + function hashMerge(a, b) { + return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int + } + + var Immutable = { + + Iterable: Iterable, + + Seq: Seq, + Collection: Collection, + Map: Map, + OrderedMap: OrderedMap, + List: List, + Stack: Stack, + Set: Set, + OrderedSet: OrderedSet, + + Record: Record, + Range: Range, + Repeat: Repeat, + + is: is, + fromJS: fromJS + + }; + + return Immutable; + + })); + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var dom_1 = __webpack_require__(9); + function renderJediSlot(jedi, state) { + var matched = state.matchedId == (jedi && jedi.id); + var props = { style: { color: matched ? 'red' : null } }; + return dom_1.li('.css-slot', props, jedi + ? [ + dom_1.h3([jedi.name]), + dom_1.h6(['Homeworld: ' + jedi.homeworld.name]) + ] + : []); + } + function disableIfNotAllowed(allowed) { + return (allowed ? '' : '.css-button-disabled'); + } + function view(state$) { + var vNode$ = state$ + .map(function (state) { + var down = state.down; + var up = state.up; + var planetName = (state.planet && state.planet.name) || ''; + var matched = state.matchedId !== -1; + return dom_1.div('.css-root', [ + dom_1.h1('.css-planet-monitor', 'Obi-Wan currently on ' + planetName), + dom_1.section('.css-scrollable-list', [ + dom_1.ul('.css-slots', state.jedis.map(function (jedi) { return renderJediSlot(jedi, state); })), + dom_1.div('.css-scroll-buttons', [ + dom_1.button('.css-button-up' + disableIfNotAllowed(up && !matched)), + dom_1.button('.css-button-down' + disableIfNotAllowed(down && !matched)) + ]) + ]) + ]); + }); + return vNode$; + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = view; + + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var thunk = __webpack_require__(10); + exports.thunk = thunk; + /** + * A factory for the DOM driver function. + * + * Takes a `container` to define the target on the existing DOM which this + * driver will operate on, and an `options` object as the second argument. The + * input to this driver is a stream of virtual DOM objects, or in other words, + * Snabbdom "VNode" objects. The output of this driver is a "DOMSource": a + * collection of Observables queried with the methods `select()` and `events()`. + * + * `DOMSource.select(selector)` returns a new DOMSource with scope restricted to + * the element(s) that matches the CSS `selector` given. + * + * `DOMSource.events(eventType, options)` returns a stream of events of + * `eventType` happening on the elements that match the current DOMSource. The + * returned stream is an *xstream* Stream if you use `@cycle/xstream-run` to run + * your app with this driver, or it is an RxJS Observable if you use + * `@cycle/rxjs-run`, and so forth. The `options` parameter can have the field + * `useCapture`, which is by default `false`, except it is `true` for event + * types that do not bubble. Read more here + * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener + * about the `useCapture` and its purpose. + * + * `DOMSource.elements()` returns a stream of the DOM element(s) matched by the + * selectors in the DOMSource. Also, `DOMSource.select(':root').elements()` + * returns a stream of DOM element corresponding to the root (or container) of + * the app on the DOM. + * + * @param {(String|HTMLElement)} container the DOM selector for the element + * (or the element itself) to contain the rendering of the VTrees. + * @param {DOMDriverOptions} options an object with two optional fields: + * `transposition: boolean` enables/disables transposition of inner streams in + * the virtual DOM tree, `modules: array` contains additional Snabbdom modules. + * @return {Function} the DOM driver function. The function expects a stream of + * of VNode as input, and outputs the DOMSource object. + * @function makeDOMDriver + */ + var makeDOMDriver_1 = __webpack_require__(14); + exports.makeDOMDriver = makeDOMDriver_1.makeDOMDriver; + /** + * A factory for the HTML driver function. + * + * Takes an `effect` callback function and an `options` object as arguments. The + * input to this driver is a stream of virtual DOM objects, or in other words, + * Snabbdom "VNode" objects. The output of this driver is a "DOMSource": a + * collection of Observables queried with the methods `select()` and `events()`. + * + * The HTML Driver is supplementary to the DOM Driver. Instead of producing + * elements on the DOM, it generates HTML as strings and does a side effect on + * those HTML strings. That side effect is described by the `effect` callback + * function. So, if you want to use the HTML Driver on the server-side to render + * your application as HTML and send as a response (which is the typical use + * case for the HTML Driver), you need to pass something like the + * `html => response.send(html)` function as the `effect` argument. This way, + * the driver knows what side effect to cause based on the HTML string it just + * rendered. + * + * The HTML driver is useful only for that side effect in the `effect` callback. + * It can be considered a sink-only driver. However, in order to serve as a + * transparent replacement to the DOM Driver when rendering from the server, the + * HTML driver returns a source object that behaves just like the DOMSource. + * This helps reuse the same application that is written for the DOM Driver. + * This fake DOMSource returns empty streams when you query it, because there + * are no user events on the server. + * + * `DOMSource.select(selector)` returns a new DOMSource with scope restricted to + * the element(s) that matches the CSS `selector` given. + * + * `DOMSource.events(eventType, options)` returns an empty stream. The returned + * stream is an *xstream* Stream if you use `@cycle/xstream-run` to run your app + * with this driver, or it is an RxJS Observable if you use `@cycle/rxjs-run`, + * and so forth. + * + * `DOMSource.elements()` returns the stream of HTML string rendered from your + * sink virtual DOM stream. + * + * @param {Function} effect a callback function that takes a string of rendered + * HTML as input and should run a side effect, returning nothing. + * @param {HTMLDriverOptions} options an object with one optional field: + * `transposition: boolean` enables/disables transposition of inner streams in + * the virtual DOM tree. + * @return {Function} the HTML driver function. The function expects a stream of + * of VNode as input, and outputs the DOMSource object. + * @function makeHTMLDriver + */ + var makeHTMLDriver_1 = __webpack_require__(93); + exports.makeHTMLDriver = makeHTMLDriver_1.makeHTMLDriver; + /** + * A factory function to create mocked DOMSource objects, for testing purposes. + * + * Takes a `streamAdapter` and a `mockConfig` object as arguments, and returns + * a DOMSource that can be given to any Cycle.js app that expects a DOMSource in + * the sources, for testing. + * + * The `streamAdapter` parameter is a package such as `@cycle/xstream-adapter`, + * `@cycle/rxjs-adapter`, etc. Import it as `import a from '@cycle/rx-adapter`, + * then provide it to `mockDOMSource. This is important so the DOMSource created + * knows which stream library should it use to export its streams when you call + * `DOMSource.events()` for instance. + * + * The `mockConfig` parameter is an object specifying selectors, eventTypes and + * their streams. Example: + * + * ```js + * const domSource = mockDOMSource(RxAdapter, { + * '.foo': { + * 'click': Rx.Observable.of({target: {}}), + * 'mouseover': Rx.Observable.of({target: {}}), + * }, + * '.bar': { + * 'scroll': Rx.Observable.of({target: {}}), + * elements: Rx.Observable.of({tagName: 'div'}), + * } + * }); + * + * // Usage + * const click$ = domSource.select('.foo').events('click'); + * const element$ = domSource.select('.bar').elements(); + * ``` + * + * @param {Object} mockConfig an object where keys are selector strings + * and values are objects. Those nested objects have `eventType` strings as keys + * and values are streams you created. + * @return {Object} fake DOM source object, with an API containing `select()` + * and `events()` and `elements()` which can be used just like the DOM Driver's + * DOMSource. + * + * @function mockDOMSource + */ + var mockDOMSource_1 = __webpack_require__(128); + exports.mockDOMSource = mockDOMSource_1.mockDOMSource; + /** + * The hyperscript function `h()` is a function to create virtual DOM objects, + * also known as VNodes. Call + * + * ```js + * h('div.myClass', {style: {color: 'red'}}, []) + * ``` + * + * to create a VNode that represents a `DIV` element with className `myClass`, + * styled with red color, and no children because the `[]` array was passed. The + * API is `h(tagOrSelector, optionalData, optionalChildrenOrText)`. + * + * However, usually you should use "hyperscript helpers", which are shortcut + * functions based on hyperscript. There is one hyperscript helper function for + * each DOM tagName, such as `h1()`, `h2()`, `div()`, `span()`, `label()`, + * `input()`. For instance, the previous example could have been written + * as: + * + * ```js + * div('.myClass', {style: {color: 'red'}}, []) + * ``` + * + * There are also SVG helper functions, which apply the appropriate SVG + * namespace to the resulting elements. `svg()` function creates the top-most + * SVG element, and `svg.g`, `svg.polygon`, `svg.circle`, `svg.path` are for + * SVG-specific child elements. Example: + * + * ```js + * svg({width: 150, height: 150}, [ + * svg.polygon({ + * attrs: { + * class: 'triangle', + * points: '20 0 20 150 150 20' + * } + * }) + * ]) + * ``` + * + * @function h + */ + var hyperscript_1 = __webpack_require__(27); + exports.h = hyperscript_1.h; + var hyperscript_helpers_1 = __webpack_require__(129); + exports.svg = hyperscript_helpers_1.default.svg; + exports.a = hyperscript_helpers_1.default.a; + exports.abbr = hyperscript_helpers_1.default.abbr; + exports.address = hyperscript_helpers_1.default.address; + exports.area = hyperscript_helpers_1.default.area; + exports.article = hyperscript_helpers_1.default.article; + exports.aside = hyperscript_helpers_1.default.aside; + exports.audio = hyperscript_helpers_1.default.audio; + exports.b = hyperscript_helpers_1.default.b; + exports.base = hyperscript_helpers_1.default.base; + exports.bdi = hyperscript_helpers_1.default.bdi; + exports.bdo = hyperscript_helpers_1.default.bdo; + exports.blockquote = hyperscript_helpers_1.default.blockquote; + exports.body = hyperscript_helpers_1.default.body; + exports.br = hyperscript_helpers_1.default.br; + exports.button = hyperscript_helpers_1.default.button; + exports.canvas = hyperscript_helpers_1.default.canvas; + exports.caption = hyperscript_helpers_1.default.caption; + exports.cite = hyperscript_helpers_1.default.cite; + exports.code = hyperscript_helpers_1.default.code; + exports.col = hyperscript_helpers_1.default.col; + exports.colgroup = hyperscript_helpers_1.default.colgroup; + exports.dd = hyperscript_helpers_1.default.dd; + exports.del = hyperscript_helpers_1.default.del; + exports.dfn = hyperscript_helpers_1.default.dfn; + exports.dir = hyperscript_helpers_1.default.dir; + exports.div = hyperscript_helpers_1.default.div; + exports.dl = hyperscript_helpers_1.default.dl; + exports.dt = hyperscript_helpers_1.default.dt; + exports.em = hyperscript_helpers_1.default.em; + exports.embed = hyperscript_helpers_1.default.embed; + exports.fieldset = hyperscript_helpers_1.default.fieldset; + exports.figcaption = hyperscript_helpers_1.default.figcaption; + exports.figure = hyperscript_helpers_1.default.figure; + exports.footer = hyperscript_helpers_1.default.footer; + exports.form = hyperscript_helpers_1.default.form; + exports.h1 = hyperscript_helpers_1.default.h1; + exports.h2 = hyperscript_helpers_1.default.h2; + exports.h3 = hyperscript_helpers_1.default.h3; + exports.h4 = hyperscript_helpers_1.default.h4; + exports.h5 = hyperscript_helpers_1.default.h5; + exports.h6 = hyperscript_helpers_1.default.h6; + exports.head = hyperscript_helpers_1.default.head; + exports.header = hyperscript_helpers_1.default.header; + exports.hgroup = hyperscript_helpers_1.default.hgroup; + exports.hr = hyperscript_helpers_1.default.hr; + exports.html = hyperscript_helpers_1.default.html; + exports.i = hyperscript_helpers_1.default.i; + exports.iframe = hyperscript_helpers_1.default.iframe; + exports.img = hyperscript_helpers_1.default.img; + exports.input = hyperscript_helpers_1.default.input; + exports.ins = hyperscript_helpers_1.default.ins; + exports.kbd = hyperscript_helpers_1.default.kbd; + exports.keygen = hyperscript_helpers_1.default.keygen; + exports.label = hyperscript_helpers_1.default.label; + exports.legend = hyperscript_helpers_1.default.legend; + exports.li = hyperscript_helpers_1.default.li; + exports.link = hyperscript_helpers_1.default.link; + exports.main = hyperscript_helpers_1.default.main; + exports.map = hyperscript_helpers_1.default.map; + exports.mark = hyperscript_helpers_1.default.mark; + exports.menu = hyperscript_helpers_1.default.menu; + exports.meta = hyperscript_helpers_1.default.meta; + exports.nav = hyperscript_helpers_1.default.nav; + exports.noscript = hyperscript_helpers_1.default.noscript; + exports.object = hyperscript_helpers_1.default.object; + exports.ol = hyperscript_helpers_1.default.ol; + exports.optgroup = hyperscript_helpers_1.default.optgroup; + exports.option = hyperscript_helpers_1.default.option; + exports.p = hyperscript_helpers_1.default.p; + exports.param = hyperscript_helpers_1.default.param; + exports.pre = hyperscript_helpers_1.default.pre; + exports.progress = hyperscript_helpers_1.default.progress; + exports.q = hyperscript_helpers_1.default.q; + exports.rp = hyperscript_helpers_1.default.rp; + exports.rt = hyperscript_helpers_1.default.rt; + exports.ruby = hyperscript_helpers_1.default.ruby; + exports.s = hyperscript_helpers_1.default.s; + exports.samp = hyperscript_helpers_1.default.samp; + exports.script = hyperscript_helpers_1.default.script; + exports.section = hyperscript_helpers_1.default.section; + exports.select = hyperscript_helpers_1.default.select; + exports.small = hyperscript_helpers_1.default.small; + exports.source = hyperscript_helpers_1.default.source; + exports.span = hyperscript_helpers_1.default.span; + exports.strong = hyperscript_helpers_1.default.strong; + exports.style = hyperscript_helpers_1.default.style; + exports.sub = hyperscript_helpers_1.default.sub; + exports.sup = hyperscript_helpers_1.default.sup; + exports.table = hyperscript_helpers_1.default.table; + exports.tbody = hyperscript_helpers_1.default.tbody; + exports.td = hyperscript_helpers_1.default.td; + exports.textarea = hyperscript_helpers_1.default.textarea; + exports.tfoot = hyperscript_helpers_1.default.tfoot; + exports.th = hyperscript_helpers_1.default.th; + exports.thead = hyperscript_helpers_1.default.thead; + exports.title = hyperscript_helpers_1.default.title; + exports.tr = hyperscript_helpers_1.default.tr; + exports.u = hyperscript_helpers_1.default.u; + exports.ul = hyperscript_helpers_1.default.ul; + exports.video = hyperscript_helpers_1.default.video; + //# sourceMappingURL=index.js.map + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + var h = __webpack_require__(11); + + function init(thunk) { + var i, cur = thunk.data; + cur.vnode = cur.fn.apply(undefined, cur.args); + } + + function prepatch(oldThunk, thunk) { + var i, old = oldThunk.data, cur = thunk.data; + var oldArgs = old.args, args = cur.args; + cur.vnode = old.vnode; + if (old.fn !== cur.fn || oldArgs.length !== args.length) { + cur.vnode = cur.fn.apply(undefined, args); + return; + } + for (i = 0; i < args.length; ++i) { + if (oldArgs[i] !== args[i]) { + cur.vnode = cur.fn.apply(undefined, args); + return; + } + } + } + + module.exports = function(name, fn /* args */) { + var i, args = []; + for (i = 2; i < arguments.length; ++i) { + args[i - 2] = arguments[i]; + } + return h('thunk' + name, { + hook: {init: init, prepatch: prepatch}, + fn: fn, args: args, + }); + }; + + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + var VNode = __webpack_require__(12); + var is = __webpack_require__(13); + + function addNS(data, children) { + data.ns = 'http://www.w3.org/2000/svg'; + if (children !== undefined) { + for (var i = 0; i < children.length; ++i) { + addNS(children[i].data, children[i].children); + } + } + } + + module.exports = function h(sel, b, c) { + var data = {}, children, text, i; + if (arguments.length === 3) { + data = b; + if (is.array(c)) { children = c; } + else if (is.primitive(c)) { text = c; } + } else if (arguments.length === 2) { + if (is.array(b)) { children = b; } + else if (is.primitive(b)) { text = b; } + else { data = b; } + } + if (is.array(children)) { + for (i = 0; i < children.length; ++i) { + if (is.primitive(children[i])) children[i] = VNode(undefined, undefined, undefined, children[i]); + } + } + if (sel[0] === 's' && sel[1] === 'v' && sel[2] === 'g') { + addNS(data, children); + } + return VNode(sel, data, children, text, undefined); + }; + + +/***/ }, +/* 12 */ +/***/ function(module, exports) { + + module.exports = function(sel, data, children, text, elm) { + var key = data === undefined ? undefined : data.key; + return {sel: sel, data: data, children: children, + text: text, elm: elm, key: key}; + }; + + +/***/ }, +/* 13 */ +/***/ function(module, exports) { + + module.exports = { + array: Array.isArray, + primitive: function(s) { return typeof s === 'string' || typeof s === 'number'; }, + }; + + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var snabbdom_1 = __webpack_require__(15); + var xstream_1 = __webpack_require__(5); + var MainDOMSource_1 = __webpack_require__(17); + var VNodeWrapper_1 = __webpack_require__(26); + var utils_1 = __webpack_require__(21); + var modules_1 = __webpack_require__(31); + var isolateModule_1 = __webpack_require__(38); + var transposition_1 = __webpack_require__(92); + var xstream_adapter_1 = __webpack_require__(18); + var MapPolyfill = __webpack_require__(39); + function makeDOMDriverInputGuard(modules) { + if (!Array.isArray(modules)) { + throw new Error("Optional modules option must be " + + "an array for snabbdom modules"); + } + } + function domDriverInputGuard(view$) { + if (!view$ + || typeof view$.addListener !== "function" + || typeof view$.fold !== "function") { + throw new Error("The DOM driver function expects as input a Stream of " + + "virtual DOM elements"); + } + } + function makeDOMDriver(container, options) { + if (!options) { + options = {}; + } + var transposition = options.transposition || false; + var modules = options.modules || modules_1.default; + var isolateModule = new isolateModule_1.IsolateModule((new MapPolyfill())); + var patch = snabbdom_1.init([isolateModule.createModule()].concat(modules)); + var rootElement = utils_1.getElement(container); + var vnodeWrapper = new VNodeWrapper_1.VNodeWrapper(rootElement); + var delegators = new MapPolyfill(); + makeDOMDriverInputGuard(modules); + function DOMDriver(vnode$, runStreamAdapter) { + domDriverInputGuard(vnode$); + var transposeVNode = transposition_1.makeTransposeVNode(runStreamAdapter); + var preprocessedVNode$ = (transposition ? vnode$.map(transposeVNode).flatten() : vnode$); + var rootElement$ = preprocessedVNode$ + .map(function (vnode) { return vnodeWrapper.call(vnode); }) + .fold(patch, rootElement) + .drop(1) + .map(function unwrapElementFromVNode(vnode) { return vnode.elm; }) + .compose(function (stream) { return xstream_1.default.merge(stream, xstream_1.default.never()); }) // don't complete this stream + .startWith(rootElement); + /* tslint:disable:no-empty */ + rootElement$.addListener({ next: function () { }, error: function () { }, complete: function () { } }); + /* tslint:enable:no-empty */ + return new MainDOMSource_1.MainDOMSource(rootElement$, runStreamAdapter, [], isolateModule, delegators); + } + ; + DOMDriver.streamAdapter = xstream_adapter_1.default; + return DOMDriver; + } + exports.makeDOMDriver = makeDOMDriver; + //# sourceMappingURL=makeDOMDriver.js.map + +/***/ }, +/* 15 */ +/***/ function(module, exports, __webpack_require__) { + + // jshint newcap: false + /* global require, module, document, Node */ + 'use strict'; + + var VNode = __webpack_require__(12); + var is = __webpack_require__(13); + var domApi = __webpack_require__(16); + + function isUndef(s) { return s === undefined; } + function isDef(s) { return s !== undefined; } + + var emptyNode = VNode('', {}, [], undefined, undefined); + + function sameVnode(vnode1, vnode2) { + return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel; + } + + function createKeyToOldIdx(children, beginIdx, endIdx) { + var i, map = {}, key; + for (i = beginIdx; i <= endIdx; ++i) { + key = children[i].key; + if (isDef(key)) map[key] = i; + } + return map; + } + + var hooks = ['create', 'update', 'remove', 'destroy', 'pre', 'post']; + + function init(modules, api) { + var i, j, cbs = {}; + + if (isUndef(api)) api = domApi; + + for (i = 0; i < hooks.length; ++i) { + cbs[hooks[i]] = []; + for (j = 0; j < modules.length; ++j) { + if (modules[j][hooks[i]] !== undefined) cbs[hooks[i]].push(modules[j][hooks[i]]); + } + } + + function emptyNodeAt(elm) { + return VNode(api.tagName(elm).toLowerCase(), {}, [], undefined, elm); + } + + function createRmCb(childElm, listeners) { + return function() { + if (--listeners === 0) { + var parent = api.parentNode(childElm); + api.removeChild(parent, childElm); + } + }; + } + + function createElm(vnode, insertedVnodeQueue) { + var i, thunk, data = vnode.data; + if (isDef(data)) { + if (isDef(i = data.hook) && isDef(i = i.init)) i(vnode); + if (isDef(i = data.vnode)) { + thunk = vnode; + vnode = i; + } + } + var elm, children = vnode.children, sel = vnode.sel; + if (isDef(sel)) { + // Parse selector + var hashIdx = sel.indexOf('#'); + var dotIdx = sel.indexOf('.', hashIdx); + var hash = hashIdx > 0 ? hashIdx : sel.length; + var dot = dotIdx > 0 ? dotIdx : sel.length; + var tag = hashIdx !== -1 || dotIdx !== -1 ? sel.slice(0, Math.min(hash, dot)) : sel; + elm = vnode.elm = isDef(data) && isDef(i = data.ns) ? api.createElementNS(i, tag) + : api.createElement(tag); + if (hash < dot) elm.id = sel.slice(hash + 1, dot); + if (dotIdx > 0) elm.className = sel.slice(dot+1).replace(/\./g, ' '); + if (is.array(children)) { + for (i = 0; i < children.length; ++i) { + api.appendChild(elm, createElm(children[i], insertedVnodeQueue)); + } + } else if (is.primitive(vnode.text)) { + api.appendChild(elm, api.createTextNode(vnode.text)); + } + for (i = 0; i < cbs.create.length; ++i) cbs.create[i](emptyNode, vnode); + i = vnode.data.hook; // Reuse variable + if (isDef(i)) { + if (i.create) i.create(emptyNode, vnode); + if (i.insert) insertedVnodeQueue.push(vnode); + } + } else { + elm = vnode.elm = api.createTextNode(vnode.text); + } + if (isDef(thunk)) thunk.elm = vnode.elm; + return vnode.elm; + } + + function addVnodes(parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) { + for (; startIdx <= endIdx; ++startIdx) { + api.insertBefore(parentElm, createElm(vnodes[startIdx], insertedVnodeQueue), before); + } + } + + function invokeDestroyHook(vnode) { + var i, j, data = vnode.data; + if (isDef(data)) { + if (isDef(i = data.hook) && isDef(i = i.destroy)) i(vnode); + for (i = 0; i < cbs.destroy.length; ++i) cbs.destroy[i](vnode); + if (isDef(i = vnode.children)) { + for (j = 0; j < vnode.children.length; ++j) { + invokeDestroyHook(vnode.children[j]); + } + } + if (isDef(i = data.vnode)) invokeDestroyHook(i); + } + } + + function removeVnodes(parentElm, vnodes, startIdx, endIdx) { + for (; startIdx <= endIdx; ++startIdx) { + var i, listeners, rm, ch = vnodes[startIdx]; + if (isDef(ch)) { + if (isDef(ch.sel)) { + invokeDestroyHook(ch); + listeners = cbs.remove.length + 1; + rm = createRmCb(ch.elm, listeners); + for (i = 0; i < cbs.remove.length; ++i) cbs.remove[i](ch, rm); + if (isDef(i = ch.data) && isDef(i = i.hook) && isDef(i = i.remove)) { + i(ch, rm); + } else { + rm(); + } + } else { // Text node + api.removeChild(parentElm, ch.elm); + } + } + } + } + + function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue) { + var oldStartIdx = 0, newStartIdx = 0; + var oldEndIdx = oldCh.length - 1; + var oldStartVnode = oldCh[0]; + var oldEndVnode = oldCh[oldEndIdx]; + var newEndIdx = newCh.length - 1; + var newStartVnode = newCh[0]; + var newEndVnode = newCh[newEndIdx]; + var oldKeyToIdx, idxInOld, elmToMove, before; + + while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { + if (isUndef(oldStartVnode)) { + oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left + } else if (isUndef(oldEndVnode)) { + oldEndVnode = oldCh[--oldEndIdx]; + } else if (sameVnode(oldStartVnode, newStartVnode)) { + patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue); + oldStartVnode = oldCh[++oldStartIdx]; + newStartVnode = newCh[++newStartIdx]; + } else if (sameVnode(oldEndVnode, newEndVnode)) { + patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue); + oldEndVnode = oldCh[--oldEndIdx]; + newEndVnode = newCh[--newEndIdx]; + } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right + patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue); + api.insertBefore(parentElm, oldStartVnode.elm, api.nextSibling(oldEndVnode.elm)); + oldStartVnode = oldCh[++oldStartIdx]; + newEndVnode = newCh[--newEndIdx]; + } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left + patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue); + api.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); + oldEndVnode = oldCh[--oldEndIdx]; + newStartVnode = newCh[++newStartIdx]; + } else { + if (isUndef(oldKeyToIdx)) oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); + idxInOld = oldKeyToIdx[newStartVnode.key]; + if (isUndef(idxInOld)) { // New element + api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm); + newStartVnode = newCh[++newStartIdx]; + } else { + elmToMove = oldCh[idxInOld]; + patchVnode(elmToMove, newStartVnode, insertedVnodeQueue); + oldCh[idxInOld] = undefined; + api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm); + newStartVnode = newCh[++newStartIdx]; + } + } + } + if (oldStartIdx > oldEndIdx) { + before = isUndef(newCh[newEndIdx+1]) ? null : newCh[newEndIdx+1].elm; + addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); + } else if (newStartIdx > newEndIdx) { + removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); + } + } + + function patchVnode(oldVnode, vnode, insertedVnodeQueue) { + var i, hook; + if (isDef(i = vnode.data) && isDef(hook = i.hook) && isDef(i = hook.prepatch)) { + i(oldVnode, vnode); + } + if (isDef(i = oldVnode.data) && isDef(i = i.vnode)) oldVnode = i; + if (isDef(i = vnode.data) && isDef(i = i.vnode)) { + patchVnode(oldVnode, i, insertedVnodeQueue); + vnode.elm = i.elm; + return; + } + var elm = vnode.elm = oldVnode.elm, oldCh = oldVnode.children, ch = vnode.children; + if (oldVnode === vnode) return; + if (!sameVnode(oldVnode, vnode)) { + var parentElm = api.parentNode(oldVnode.elm); + elm = createElm(vnode, insertedVnodeQueue); + api.insertBefore(parentElm, elm, oldVnode.elm); + removeVnodes(parentElm, [oldVnode], 0, 0); + return; + } + if (isDef(vnode.data)) { + for (i = 0; i < cbs.update.length; ++i) cbs.update[i](oldVnode, vnode); + i = vnode.data.hook; + if (isDef(i) && isDef(i = i.update)) i(oldVnode, vnode); + } + if (isUndef(vnode.text)) { + if (isDef(oldCh) && isDef(ch)) { + if (oldCh !== ch) updateChildren(elm, oldCh, ch, insertedVnodeQueue); + } else if (isDef(ch)) { + if (isDef(oldVnode.text)) api.setTextContent(elm, ''); + addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); + } else if (isDef(oldCh)) { + removeVnodes(elm, oldCh, 0, oldCh.length - 1); + } else if (isDef(oldVnode.text)) { + api.setTextContent(elm, ''); + } + } else if (oldVnode.text !== vnode.text) { + api.setTextContent(elm, vnode.text); + } + if (isDef(hook) && isDef(i = hook.postpatch)) { + i(oldVnode, vnode); + } + } + + return function(oldVnode, vnode) { + var i, elm, parent; + var insertedVnodeQueue = []; + for (i = 0; i < cbs.pre.length; ++i) cbs.pre[i](); + + if (isUndef(oldVnode.sel)) { + oldVnode = emptyNodeAt(oldVnode); + } + + if (sameVnode(oldVnode, vnode)) { + patchVnode(oldVnode, vnode, insertedVnodeQueue); + } else { + elm = oldVnode.elm; + parent = api.parentNode(elm); + + createElm(vnode, insertedVnodeQueue); + + if (parent !== null) { + api.insertBefore(parent, vnode.elm, api.nextSibling(elm)); + removeVnodes(parent, [oldVnode], 0, 0); + } + } + + for (i = 0; i < insertedVnodeQueue.length; ++i) { + insertedVnodeQueue[i].data.hook.insert(insertedVnodeQueue[i]); + } + for (i = 0; i < cbs.post.length; ++i) cbs.post[i](); + return vnode; + }; + } + + module.exports = {init: init}; + + +/***/ }, +/* 16 */ +/***/ function(module, exports) { + + function createElement(tagName){ + return document.createElement(tagName); + } + + function createElementNS(namespaceURI, qualifiedName){ + return document.createElementNS(namespaceURI, qualifiedName); + } + + function createTextNode(text){ + return document.createTextNode(text); + } + + + function insertBefore(parentNode, newNode, referenceNode){ + parentNode.insertBefore(newNode, referenceNode); + } + + + function removeChild(node, child){ + node.removeChild(child); + } + + function appendChild(node, child){ + node.appendChild(child); + } + + function parentNode(node){ + return node.parentElement; + } + + function nextSibling(node){ + return node.nextSibling; + } + + function tagName(node){ + return node.tagName; + } + + function setTextContent(node, text){ + node.textContent = text; + } + + module.exports = { + createElement: createElement, + createElementNS: createElementNS, + createTextNode: createTextNode, + appendChild: appendChild, + removeChild: removeChild, + insertBefore: insertBefore, + parentNode: parentNode, + nextSibling: nextSibling, + tagName: tagName, + setTextContent: setTextContent + }; + + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_adapter_1 = __webpack_require__(18); + var xstream_1 = __webpack_require__(5); + var ElementFinder_1 = __webpack_require__(19); + var fromEvent_1 = __webpack_require__(23); + var isolate_1 = __webpack_require__(24); + var EventDelegator_1 = __webpack_require__(25); + var utils_1 = __webpack_require__(21); + var matchesSelector; + try { + matchesSelector = __webpack_require__(22); + } + catch (e) { + matchesSelector = Function.prototype; + } + var eventTypesThatDontBubble = [ + "blur", + "canplay", + "canplaythrough", + "change", + "durationchange", + "emptied", + "ended", + "focus", + "load", + "loadeddata", + "loadedmetadata", + "mouseenter", + "mouseleave", + "pause", + "play", + "playing", + "ratechange", + "reset", + "scroll", + "seeked", + "seeking", + "stalled", + "submit", + "suspend", + "timeupdate", + "unload", + "volumechange", + "waiting", + ]; + function determineUseCapture(eventType, options) { + var result = false; + if (typeof options.useCapture === "boolean") { + result = options.useCapture; + } + if (eventTypesThatDontBubble.indexOf(eventType) !== -1) { + result = true; + } + return result; + } + var MainDOMSource = (function () { + function MainDOMSource(_rootElement$, _runStreamAdapter, _namespace, _isolateModule, _delegators) { + if (_namespace === void 0) { _namespace = []; } + this._rootElement$ = _rootElement$; + this._runStreamAdapter = _runStreamAdapter; + this._namespace = _namespace; + this._isolateModule = _isolateModule; + this._delegators = _delegators; + this.isolateSource = isolate_1.isolateSource; + this.isolateSink = isolate_1.isolateSink; + } + MainDOMSource.prototype.elements = function () { + var output$; + if (this._namespace.length === 0) { + output$ = this._rootElement$; + } + else { + var elementFinder_1 = new ElementFinder_1.ElementFinder(this._namespace, this._isolateModule); + output$ = this._rootElement$.map(function (el) { return elementFinder_1.call(el); }); + } + var runSA = this._runStreamAdapter; + return runSA.remember(runSA.adapt(output$, xstream_adapter_1.default.streamSubscribe)); + }; + Object.defineProperty(MainDOMSource.prototype, "namespace", { + get: function () { + return this._namespace; + }, + enumerable: true, + configurable: true + }); + MainDOMSource.prototype.select = function (selector) { + if (typeof selector !== 'string') { + throw new Error("DOM driver's select() expects the argument to be a " + + "string as a CSS selector"); + } + var trimmedSelector = selector.trim(); + var childNamespace = trimmedSelector === ":root" ? + this._namespace : + this._namespace.concat(trimmedSelector); + return new MainDOMSource(this._rootElement$, this._runStreamAdapter, childNamespace, this._isolateModule, this._delegators); + }; + MainDOMSource.prototype.events = function (eventType, options) { + if (options === void 0) { options = {}; } + if (typeof eventType !== "string") { + throw new Error("DOM driver's events() expects argument to be a " + + "string representing the event type to listen for."); + } + var useCapture = determineUseCapture(eventType, options); + var namespace = this._namespace; + var scope = utils_1.getScope(namespace); + var keyParts = [eventType, useCapture]; + if (scope) { + keyParts.push(scope); + } + var key = keyParts.join('~'); + var domSource = this; + var rootElement$; + if (scope) { + var hadIsolated_mutable_1 = false; + rootElement$ = this._rootElement$ + .filter(function (rootElement) { + var hasIsolated = !!domSource._isolateModule.getIsolatedElement(scope); + var shouldPass = hasIsolated && !hadIsolated_mutable_1; + hadIsolated_mutable_1 = hasIsolated; + return shouldPass; + }); + } + else { + rootElement$ = this._rootElement$.take(2); + } + var event$ = rootElement$ + .map(function setupEventDelegatorOnTopElement(rootElement) { + // Event listener just for the root element + if (!namespace || namespace.length === 0) { + return fromEvent_1.fromEvent(rootElement, eventType, useCapture); + } + // Event listener on the top element as an EventDelegator + var delegators = domSource._delegators; + var top = scope + ? domSource._isolateModule.getIsolatedElement(scope) + : rootElement; + var delegator; + if (delegators.has(key)) { + delegator = delegators.get(key); + delegator.updateTopElement(top); + } + else { + delegator = new EventDelegator_1.EventDelegator(top, eventType, useCapture, domSource._isolateModule); + delegators.set(key, delegator); + } + var subject = xstream_1.default.create(); + if (scope) { + domSource._isolateModule.addEventDelegator(scope, delegator); + } + delegator.addDestination(subject, namespace); + return subject; + }) + .flatten(); + return this._runStreamAdapter.adapt(event$, xstream_adapter_1.default.streamSubscribe); + }; + MainDOMSource.prototype.dispose = function () { + this._isolateModule.reset(); + }; + return MainDOMSource; + }()); + exports.MainDOMSource = MainDOMSource; + //# sourceMappingURL=MainDOMSource.js.map + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_1 = __webpack_require__(5); + var XStreamAdapter = { + adapt: function (originStream, originStreamSubscribe) { + if (XStreamAdapter.isValidStream(originStream)) { + return originStream; + } + ; + var dispose = null; + return xstream_1.default.create({ + start: function (out) { + var observer = out; + dispose = originStreamSubscribe(originStream, observer); + }, + stop: function () { + if (typeof dispose === 'function') { + dispose(); + } + } + }); + }, + makeSubject: function () { + var stream = xstream_1.default.create(); + var observer = { + next: function (x) { stream.shamefullySendNext(x); }, + error: function (err) { stream.shamefullySendError(err); }, + complete: function () { stream.shamefullySendComplete(); } + }; + return { observer: observer, stream: stream }; + }, + remember: function (stream) { + return stream.remember(); + }, + isValidStream: function (stream) { + return (typeof stream.addListener === 'function' && + typeof stream.shamefullySendNext === 'function'); + }, + streamSubscribe: function (stream, observer) { + stream.addListener(observer); + return function () { return stream.removeListener(observer); }; + } + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = XStreamAdapter; + //# sourceMappingURL=index.js.map + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var ScopeChecker_1 = __webpack_require__(20); + var utils_1 = __webpack_require__(21); + var matchesSelector; + try { + matchesSelector = __webpack_require__(22); + } + catch (e) { + matchesSelector = Function.prototype; + } + function toElArray(input) { + return Array.prototype.slice.call(input); + } + var ElementFinder = (function () { + function ElementFinder(namespace, isolateModule) { + this.namespace = namespace; + this.isolateModule = isolateModule; + } + ElementFinder.prototype.call = function (rootElement) { + var namespace = this.namespace; + if (namespace.join("") === "") { + return rootElement; + } + var scope = utils_1.getScope(namespace); + var scopeChecker = new ScopeChecker_1.ScopeChecker(scope, this.isolateModule); + var selector = utils_1.getSelectors(namespace); + var topNode = rootElement; + var topNodeMatches = []; + if (scope.length > 0) { + topNode = this.isolateModule.getIsolatedElement(scope) || rootElement; + if (selector && matchesSelector(topNode, selector)) { + topNodeMatches.push(topNode); + } + } + return toElArray(topNode.querySelectorAll(selector)) + .filter(scopeChecker.isStrictlyInRootScope, scopeChecker) + .concat(topNodeMatches); + }; + return ElementFinder; + }()); + exports.ElementFinder = ElementFinder; + //# sourceMappingURL=ElementFinder.js.map + +/***/ }, +/* 20 */ +/***/ function(module, exports) { + + "use strict"; + var ScopeChecker = (function () { + function ScopeChecker(scope, isolateModule) { + this.scope = scope; + this.isolateModule = isolateModule; + } + ScopeChecker.prototype.isStrictlyInRootScope = function (leaf) { + for (var el = leaf; el; el = el.parentElement) { + var scope = this.isolateModule.isIsolatedElement(el); + if (scope && scope !== this.scope) { + return false; + } + if (scope) { + return true; + } + } + return true; + }; + return ScopeChecker; + }()); + exports.ScopeChecker = ScopeChecker; + //# sourceMappingURL=ScopeChecker.js.map + +/***/ }, +/* 21 */ +/***/ function(module, exports) { + + "use strict"; + function isElement(obj) { + return typeof HTMLElement === "object" ? + obj instanceof HTMLElement || obj instanceof DocumentFragment : + obj && typeof obj === "object" && obj !== null && + (obj.nodeType === 1 || obj.nodeType === 11) && + typeof obj.nodeName === "string"; + } + exports.SCOPE_PREFIX = "$$CYCLEDOM$$-"; + function getElement(selectors) { + var domElement = (typeof selectors === "string" ? + document.querySelector(selectors) : + selectors); + if (typeof selectors === "string" && domElement === null) { + throw new Error("Cannot render into unknown element `" + selectors + "`"); + } + else if (!isElement(domElement)) { + throw new Error("Given container is not a DOM element neither a " + + "selector string."); + } + return domElement; + } + exports.getElement = getElement; + function getScope(namespace) { + return namespace + .filter(function (c) { return c.indexOf(exports.SCOPE_PREFIX) > -1; }) + .slice(-1) // only need the latest, most specific, isolated boundary + .join(""); + } + exports.getScope = getScope; + function getSelectors(namespace) { + return namespace.filter(function (c) { return c.indexOf(exports.SCOPE_PREFIX) === -1; }).join(" "); + } + exports.getSelectors = getSelectors; + //# sourceMappingURL=utils.js.map + +/***/ }, +/* 22 */ +/***/ function(module, exports) { + + 'use strict'; + + var proto = Element.prototype; + var vendor = proto.matches + || proto.matchesSelector + || proto.webkitMatchesSelector + || proto.mozMatchesSelector + || proto.msMatchesSelector + || proto.oMatchesSelector; + + module.exports = match; + + /** + * Match `el` to `selector`. + * + * @param {Element} el + * @param {String} selector + * @return {Boolean} + * @api public + */ + + function match(el, selector) { + if (vendor) return vendor.call(el, selector); + var nodes = el.parentNode.querySelectorAll(selector); + for (var i = 0; i < nodes.length; i++) { + if (nodes[i] == el) return true; + } + return false; + } + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_1 = __webpack_require__(5); + function fromEvent(element, eventName, useCapture) { + if (useCapture === void 0) { useCapture = false; } + return xstream_1.Stream.create({ + element: element, + next: null, + start: function start(listener) { + this.next = function next(event) { listener.next(event); }; + this.element.addEventListener(eventName, this.next, useCapture); + }, + stop: function stop() { + this.element.removeEventListener(eventName, this.next, useCapture); + } + }); + } + exports.fromEvent = fromEvent; + //# sourceMappingURL=fromEvent.js.map + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var utils_1 = __webpack_require__(21); + function isolateSource(source, scope) { + return source.select(utils_1.SCOPE_PREFIX + scope); + } + exports.isolateSource = isolateSource; + function isolateSink(sink, scope) { + return sink.map(function (vTree) { + if (vTree.data.isolate) { + var existingScope = parseInt(vTree.data.isolate.split(utils_1.SCOPE_PREFIX + 'cycle')[1]); + var _scope = parseInt(scope.split('cycle')[1]); + if (isNaN(existingScope) || isNaN(_scope) || existingScope > _scope) { + return vTree; + } + } + vTree.data.isolate = utils_1.SCOPE_PREFIX + scope; + return vTree; + }); + } + exports.isolateSink = isolateSink; + //# sourceMappingURL=isolate.js.map + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var ScopeChecker_1 = __webpack_require__(20); + var utils_1 = __webpack_require__(21); + var matchesSelector; + try { + matchesSelector = __webpack_require__(22); + } + catch (e) { + matchesSelector = Function.prototype; + } + /** + * Attaches an actual event listener to the DOM root element, + * handles "destinations" (interested DOMSource output subjects), and bubbling. + */ + var EventDelegator = (function () { + function EventDelegator(topElement, eventType, useCapture, isolateModule) { + var _this = this; + this.topElement = topElement; + this.eventType = eventType; + this.useCapture = useCapture; + this.isolateModule = isolateModule; + this.destinations = []; + this.roof = topElement.parentElement; + if (useCapture) { + this.domListener = function (ev) { return _this.capture(ev); }; + } + else { + this.domListener = function (ev) { return _this.bubble(ev); }; + } + topElement.addEventListener(eventType, this.domListener, useCapture); + } + EventDelegator.prototype.bubble = function (rawEvent) { + if (!document.body.contains(rawEvent.currentTarget)) { + return; + } + var ev = this.patchEvent(rawEvent); + for (var el = ev.target; el && el !== this.roof; el = el.parentElement) { + if (!document.body.contains(el)) { + ev.stopPropagation(); + } + if (ev.propagationHasBeenStopped) { + return; + } + this.matchEventAgainstDestinations(el, ev); + } + }; + EventDelegator.prototype.matchEventAgainstDestinations = function (el, ev) { + for (var i = 0, n = this.destinations.length; i < n; i++) { + var dest = this.destinations[i]; + if (!dest.scopeChecker.isStrictlyInRootScope(el)) { + continue; + } + if (matchesSelector(el, dest.selector)) { + this.mutateEventCurrentTarget(ev, el); + dest.subject._n(ev); + } + } + }; + EventDelegator.prototype.capture = function (ev) { + for (var i = 0, n = this.destinations.length; i < n; i++) { + var dest = this.destinations[i]; + if (matchesSelector(ev.target, dest.selector)) { + dest.subject._n(ev); + } + } + }; + EventDelegator.prototype.addDestination = function (subject, namespace) { + var scope = utils_1.getScope(namespace); + var selector = utils_1.getSelectors(namespace); + var scopeChecker = new ScopeChecker_1.ScopeChecker(scope, this.isolateModule); + this.destinations.push({ subject: subject, scopeChecker: scopeChecker, selector: selector }); + }; + EventDelegator.prototype.patchEvent = function (event) { + var pEvent = event; + pEvent.propagationHasBeenStopped = false; + var oldStopPropagation = pEvent.stopPropagation; + pEvent.stopPropagation = function stopPropagation() { + oldStopPropagation.call(this); + this.propagationHasBeenStopped = true; + }; + return pEvent; + }; + EventDelegator.prototype.mutateEventCurrentTarget = function (event, currentTargetElement) { + try { + Object.defineProperty(event, "currentTarget", { + value: currentTargetElement, + configurable: true, + }); + } + catch (err) { + console.log("please use event.ownerTarget"); + } + event.ownerTarget = currentTargetElement; + }; + EventDelegator.prototype.updateTopElement = function (newTopElement) { + this.topElement.removeEventListener(this.eventType, this.domListener, this.useCapture); + newTopElement.addEventListener(this.eventType, this.domListener, this.useCapture); + this.topElement = newTopElement; + }; + return EventDelegator; + }()); + exports.EventDelegator = EventDelegator; + //# sourceMappingURL=EventDelegator.js.map + +/***/ }, +/* 26 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var hyperscript_1 = __webpack_require__(27); + var classNameFromVNode_1 = __webpack_require__(28); + var selectorParser_1 = __webpack_require__(29); + var VNodeWrapper = (function () { + function VNodeWrapper(rootElement) { + this.rootElement = rootElement; + } + VNodeWrapper.prototype.call = function (vnode) { + var _a = selectorParser_1.default(vnode.sel), selectorTagName = _a.tagName, selectorId = _a.id; + var vNodeClassName = classNameFromVNode_1.default(vnode); + var vNodeData = vnode.data || {}; + var vNodeDataProps = vNodeData.props || {}; + var _b = vNodeDataProps.id, vNodeId = _b === void 0 ? selectorId : _b; + var isVNodeAndRootElementIdentical = vNodeId.toUpperCase() === this.rootElement.id.toUpperCase() && + selectorTagName.toUpperCase() === this.rootElement.tagName.toUpperCase() && + vNodeClassName.toUpperCase() === this.rootElement.className.toUpperCase(); + if (isVNodeAndRootElementIdentical) { + return vnode; + } + var _c = this.rootElement, tagName = _c.tagName, id = _c.id, className = _c.className; + var elementId = id ? "#" + id : ""; + var elementClassName = className ? + "." + className.split(" ").join(".") : ""; + return hyperscript_1.h("" + tagName + elementId + elementClassName, {}, [vnode]); + }; + return VNodeWrapper; + }()); + exports.VNodeWrapper = VNodeWrapper; + //# sourceMappingURL=VNodeWrapper.js.map + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var is = __webpack_require__(13); + var vnode = __webpack_require__(12); + function isGenericStream(x) { + return !Array.isArray(x) && typeof x.map === "function"; + } + function mutateStreamWithNS(vNode) { + addNS(vNode.data, vNode.children, vNode.sel); + return vNode; + } + function addNS(data, children, selector) { + data.ns = "http://www.w3.org/2000/svg"; + if (selector !== "foreignObject" && typeof children !== "undefined" && is.array(children)) { + for (var i = 0; i < children.length; ++i) { + if (isGenericStream(children[i])) { + children[i] = children[i].map(mutateStreamWithNS); + } + else { + addNS(children[i].data, children[i].children, children[i].sel); + } + } + } + } + function h(sel, b, c) { + var data = {}; + var children; + var text; + var i; + if (arguments.length === 3) { + data = b; + if (is.array(c)) { + children = c; + } + else if (is.primitive(c)) { + text = c; + } + } + else if (arguments.length === 2) { + if (is.array(b)) { + children = b; + } + else if (is.primitive(b)) { + text = b; + } + else { + data = b; + } + } + if (is.array(children)) { + children = children.filter(function (x) { return x; }); + for (i = 0; i < children.length; ++i) { + if (is.primitive(children[i])) { + children[i] = vnode(undefined, undefined, undefined, children[i]); + } + } + } + if (sel[0] === 's' && sel[1] === 'v' && sel[2] === 'g') { + addNS(data, children, sel); + } + return vnode(sel, data, children, text, undefined); + } + exports.h = h; + ; + //# sourceMappingURL=hyperscript.js.map + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = classNameFromVNode; + + var _selectorParser2 = __webpack_require__(29); + + var _selectorParser3 = _interopRequireDefault(_selectorParser2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function classNameFromVNode(vNode) { + var _selectorParser = (0, _selectorParser3.default)(vNode.sel); + + var cn = _selectorParser.className; + + if (!vNode.data) { + return cn; + } + + var _vNode$data = vNode.data; + var dataClass = _vNode$data.class; + var props = _vNode$data.props; + + if (dataClass) { + var c = Object.keys(vNode.data.class).filter(function (cl) { + return vNode.data.class[cl]; + }); + cn += ' ' + c.join(' '); + } + + if (props && props.className) { + cn += ' ' + props.className; + } + + return cn.trim(); + } + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = selectorParser; + + var _browserSplit = __webpack_require__(30); + + var _browserSplit2 = _interopRequireDefault(_browserSplit); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var classIdSplit = /([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/; + var notClassId = /^\.|#/; + + function selectorParser() { + var selector = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0]; + + var tagName = undefined; + var id = ''; + var classes = []; + + var tagParts = (0, _browserSplit2.default)(selector, classIdSplit); + + if (notClassId.test(tagParts[1]) || selector === '') { + tagName = 'div'; + } + + var part = undefined; + var type = undefined; + var i = undefined; + + for (i = 0; i < tagParts.length; i++) { + part = tagParts[i]; + + if (!part) { + continue; + } + + type = part.charAt(0); + + if (!tagName) { + tagName = part; + } else if (type === '.') { + classes.push(part.substring(1, part.length)); + } else if (type === '#') { + id = part.substring(1, part.length); + } + } + + return { + tagName: tagName, + id: id, + className: classes.join(' ') + }; + } + +/***/ }, +/* 30 */ +/***/ function(module, exports) { + + /*! + * Cross-Browser Split 1.1.1 + * Copyright 2007-2012 Steven Levithan + * Available under the MIT License + * ECMAScript compliant, uniform cross-browser split method + */ + + /** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * split('a b c d', ' '); + * // -> ['a', 'b', 'c', 'd'] + * + * // With limit + * split('a b c d', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * split('..word1 word2..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', ' ', 'word', '2', '..'] + */ + module.exports = (function split(undef) { + + var nativeSplit = String.prototype.split, + compliantExecNpcg = /()??/.exec("")[1] === undef, + // NPCG: nonparticipating capturing group + self; + + self = function(str, separator, limit) { + // If `separator` is not a regex, use `nativeSplit` + if (Object.prototype.toString.call(separator) !== "[object RegExp]") { + return nativeSplit.call(str, separator, limit); + } + var output = [], + flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.extended ? "x" : "") + // Proposed for ES6 + (separator.sticky ? "y" : ""), + // Firefox 3+ + lastLastIndex = 0, + // Make `global` and avoid `lastIndex` issues by working with a copy + separator = new RegExp(separator.source, flags + "g"), + separator2, match, lastIndex, lastLength; + str += ""; // Type-convert + if (!compliantExecNpcg) { + // Doesn't need flags gy, but they don't hurt + separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags); + } + /* Values for `limit`, per the spec: + * If undefined: 4294967295 // Math.pow(2, 32) - 1 + * If 0, Infinity, or NaN: 0 + * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296; + * If negative number: 4294967296 - Math.floor(Math.abs(limit)) + * If other: Type-convert, then use the above rules + */ + limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1 + limit >>> 0; // ToUint32(limit) + while (match = separator.exec(str)) { + // `separator.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0].length; + if (lastIndex > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for + // nonparticipating capturing groups + if (!compliantExecNpcg && match.length > 1) { + match[0].replace(separator2, function() { + for (var i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undef) { + match[i] = undef; + } + } + }); + } + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= limit) { + break; + } + } + if (separator.lastIndex === match.index) { + separator.lastIndex++; // Avoid an infinite loop + } + } + if (lastLastIndex === str.length) { + if (lastLength || !separator.test("")) { + output.push(""); + } + } else { + output.push(str.slice(lastLastIndex)); + } + return output.length > limit ? output.slice(0, limit) : output; + }; + + return self; + })(); + + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var ClassModule = __webpack_require__(32); + exports.ClassModule = ClassModule; + var PropsModule = __webpack_require__(33); + exports.PropsModule = PropsModule; + var AttrsModule = __webpack_require__(34); + exports.AttrsModule = AttrsModule; + var EventsModule = __webpack_require__(35); + exports.EventsModule = EventsModule; + var StyleModule = __webpack_require__(36); + exports.StyleModule = StyleModule; + var HeroModule = __webpack_require__(37); + exports.HeroModule = HeroModule; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = [StyleModule, ClassModule, PropsModule, AttrsModule]; + //# sourceMappingURL=modules.js.map + +/***/ }, +/* 32 */ +/***/ function(module, exports) { + + function updateClass(oldVnode, vnode) { + var cur, name, elm = vnode.elm, + oldClass = oldVnode.data.class || {}, + klass = vnode.data.class || {}; + for (name in oldClass) { + if (!klass[name]) { + elm.classList.remove(name); + } + } + for (name in klass) { + cur = klass[name]; + if (cur !== oldClass[name]) { + elm.classList[cur ? 'add' : 'remove'](name); + } + } + } + + module.exports = {create: updateClass, update: updateClass}; + + +/***/ }, +/* 33 */ +/***/ function(module, exports) { + + function updateProps(oldVnode, vnode) { + var key, cur, old, elm = vnode.elm, + oldProps = oldVnode.data.props || {}, props = vnode.data.props || {}; + for (key in oldProps) { + if (!props[key]) { + delete elm[key]; + } + } + for (key in props) { + cur = props[key]; + old = oldProps[key]; + if (old !== cur && (key !== 'value' || elm[key] !== cur)) { + elm[key] = cur; + } + } + } + + module.exports = {create: updateProps, update: updateProps}; + + +/***/ }, +/* 34 */ +/***/ function(module, exports) { + + var booleanAttrs = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "compact", "controls", "declare", + "default", "defaultchecked", "defaultmuted", "defaultselected", "defer", "disabled", "draggable", + "enabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "itemscope", "loop", "multiple", + "muted", "nohref", "noresize", "noshade", "novalidate", "nowrap", "open", "pauseonexit", "readonly", + "required", "reversed", "scoped", "seamless", "selected", "sortable", "spellcheck", "translate", + "truespeed", "typemustmatch", "visible"]; + + var booleanAttrsDict = {}; + for(var i=0, len = booleanAttrs.length; i < len; i++) { + booleanAttrsDict[booleanAttrs[i]] = true; + } + + function updateAttrs(oldVnode, vnode) { + var key, cur, old, elm = vnode.elm, + oldAttrs = oldVnode.data.attrs || {}, attrs = vnode.data.attrs || {}; + + // update modified attributes, add new attributes + for (key in attrs) { + cur = attrs[key]; + old = oldAttrs[key]; + if (old !== cur) { + // TODO: add support to namespaced attributes (setAttributeNS) + if(!cur && booleanAttrsDict[key]) + elm.removeAttribute(key); + else + elm.setAttribute(key, cur); + } + } + //remove removed attributes + // use `in` operator since the previous `for` iteration uses it (.i.e. add even attributes with undefined value) + // the other option is to remove all attributes with value == undefined + for (key in oldAttrs) { + if (!(key in attrs)) { + elm.removeAttribute(key); + } + } + } + + module.exports = {create: updateAttrs, update: updateAttrs}; + + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + var is = __webpack_require__(13); + + function arrInvoker(arr) { + return function() { + // Special case when length is two, for performance + arr.length === 2 ? arr[0](arr[1]) : arr[0].apply(undefined, arr.slice(1)); + }; + } + + function fnInvoker(o) { + return function(ev) { o.fn(ev); }; + } + + function updateEventListeners(oldVnode, vnode) { + var name, cur, old, elm = vnode.elm, + oldOn = oldVnode.data.on || {}, on = vnode.data.on; + if (!on) return; + for (name in on) { + cur = on[name]; + old = oldOn[name]; + if (old === undefined) { + if (is.array(cur)) { + elm.addEventListener(name, arrInvoker(cur)); + } else { + cur = {fn: cur}; + on[name] = cur; + elm.addEventListener(name, fnInvoker(cur)); + } + } else if (is.array(old)) { + // Deliberately modify old array since it's captured in closure created with `arrInvoker` + old.length = cur.length; + for (var i = 0; i < old.length; ++i) old[i] = cur[i]; + on[name] = old; + } else { + old.fn = cur; + on[name] = old; + } + } + } + + module.exports = {create: updateEventListeners, update: updateEventListeners}; + + +/***/ }, +/* 36 */ +/***/ function(module, exports) { + + var raf = (typeof window !== 'undefined' && window.requestAnimationFrame) || setTimeout; + var nextFrame = function(fn) { raf(function() { raf(fn); }); }; + + function setNextFrame(obj, prop, val) { + nextFrame(function() { obj[prop] = val; }); + } + + function updateStyle(oldVnode, vnode) { + var cur, name, elm = vnode.elm, + oldStyle = oldVnode.data.style || {}, + style = vnode.data.style || {}, + oldHasDel = 'delayed' in oldStyle; + for (name in oldStyle) { + if (!style[name]) { + elm.style[name] = ''; + } + } + for (name in style) { + cur = style[name]; + if (name === 'delayed') { + for (name in style.delayed) { + cur = style.delayed[name]; + if (!oldHasDel || cur !== oldStyle.delayed[name]) { + setNextFrame(elm.style, name, cur); + } + } + } else if (name !== 'remove' && cur !== oldStyle[name]) { + elm.style[name] = cur; + } + } + } + + function applyDestroyStyle(vnode) { + var style, name, elm = vnode.elm, s = vnode.data.style; + if (!s || !(style = s.destroy)) return; + for (name in style) { + elm.style[name] = style[name]; + } + } + + function applyRemoveStyle(vnode, rm) { + var s = vnode.data.style; + if (!s || !s.remove) { + rm(); + return; + } + var name, elm = vnode.elm, idx, i = 0, maxDur = 0, + compStyle, style = s.remove, amount = 0, applied = []; + for (name in style) { + applied.push(name); + elm.style[name] = style[name]; + } + compStyle = getComputedStyle(elm); + var props = compStyle['transition-property'].split(', '); + for (; i < props.length; ++i) { + if(applied.indexOf(props[i]) !== -1) amount++; + } + elm.addEventListener('transitionend', function(ev) { + if (ev.target === elm) --amount; + if (amount === 0) rm(); + }); + } + + module.exports = {create: updateStyle, update: updateStyle, destroy: applyDestroyStyle, remove: applyRemoveStyle}; + + +/***/ }, +/* 37 */ +/***/ function(module, exports) { + + var raf = (typeof window !== 'undefined' && window.requestAnimationFrame) || setTimeout; + var nextFrame = function(fn) { raf(function() { raf(fn); }); }; + + function setNextFrame(obj, prop, val) { + nextFrame(function() { obj[prop] = val; }); + } + + function getTextNodeRect(textNode) { + var rect; + if (document.createRange) { + var range = document.createRange(); + range.selectNodeContents(textNode); + if (range.getBoundingClientRect) { + rect = range.getBoundingClientRect(); + } + } + return rect; + } + + function calcTransformOrigin(isTextNode, textRect, boundingRect) { + if (isTextNode) { + if (textRect) { + //calculate pixels to center of text from left edge of bounding box + var relativeCenterX = textRect.left + textRect.width/2 - boundingRect.left; + var relativeCenterY = textRect.top + textRect.height/2 - boundingRect.top; + return relativeCenterX + 'px ' + relativeCenterY + 'px'; + } + } + return '0 0'; //top left + } + + function getTextDx(oldTextRect, newTextRect) { + if (oldTextRect && newTextRect) { + return ((oldTextRect.left + oldTextRect.width/2) - (newTextRect.left + newTextRect.width/2)); + } + return 0; + } + function getTextDy(oldTextRect, newTextRect) { + if (oldTextRect && newTextRect) { + return ((oldTextRect.top + oldTextRect.height/2) - (newTextRect.top + newTextRect.height/2)); + } + return 0; + } + + function isTextElement(elm) { + return elm.childNodes.length === 1 && elm.childNodes[0].nodeType === 3; + } + + var removed, created; + + function pre(oldVnode, vnode) { + removed = {}; + created = []; + } + + function create(oldVnode, vnode) { + var hero = vnode.data.hero; + if (hero && hero.id) { + created.push(hero.id); + created.push(vnode); + } + } + + function destroy(vnode) { + var hero = vnode.data.hero; + if (hero && hero.id) { + var elm = vnode.elm; + vnode.isTextNode = isTextElement(elm); //is this a text node? + vnode.boundingRect = elm.getBoundingClientRect(); //save the bounding rectangle to a new property on the vnode + vnode.textRect = vnode.isTextNode ? getTextNodeRect(elm.childNodes[0]) : null; //save bounding rect of inner text node + var computedStyle = window.getComputedStyle(elm, null); //get current styles (includes inherited properties) + vnode.savedStyle = JSON.parse(JSON.stringify(computedStyle)); //save a copy of computed style values + removed[hero.id] = vnode; + } + } + + function post() { + var i, id, newElm, oldVnode, oldElm, hRatio, wRatio, + oldRect, newRect, dx, dy, origTransform, origTransition, + newStyle, oldStyle, newComputedStyle, isTextNode, + newTextRect, oldTextRect; + for (i = 0; i < created.length; i += 2) { + id = created[i]; + newElm = created[i+1].elm; + oldVnode = removed[id]; + if (oldVnode) { + isTextNode = oldVnode.isTextNode && isTextElement(newElm); //Are old & new both text? + newStyle = newElm.style; + newComputedStyle = window.getComputedStyle(newElm, null); //get full computed style for new element + oldElm = oldVnode.elm; + oldStyle = oldElm.style; + //Overall element bounding boxes + newRect = newElm.getBoundingClientRect(); + oldRect = oldVnode.boundingRect; //previously saved bounding rect + //Text node bounding boxes & distances + if (isTextNode) { + newTextRect = getTextNodeRect(newElm.childNodes[0]); + oldTextRect = oldVnode.textRect; + dx = getTextDx(oldTextRect, newTextRect); + dy = getTextDy(oldTextRect, newTextRect); + } else { + //Calculate distances between old & new positions + dx = oldRect.left - newRect.left; + dy = oldRect.top - newRect.top; + } + hRatio = newRect.height / (Math.max(oldRect.height, 1)); + wRatio = isTextNode ? hRatio : newRect.width / (Math.max(oldRect.width, 1)); //text scales based on hRatio + // Animate new element + origTransform = newStyle.transform; + origTransition = newStyle.transition; + if (newComputedStyle.display === 'inline') //inline elements cannot be transformed + newStyle.display = 'inline-block'; //this does not appear to have any negative side effects + newStyle.transition = origTransition + 'transform 0s'; + newStyle.transformOrigin = calcTransformOrigin(isTextNode, newTextRect, newRect); + newStyle.opacity = '0'; + newStyle.transform = origTransform + 'translate('+dx+'px, '+dy+'px) ' + + 'scale('+1/wRatio+', '+1/hRatio+')'; + setNextFrame(newStyle, 'transition', origTransition); + setNextFrame(newStyle, 'transform', origTransform); + setNextFrame(newStyle, 'opacity', '1'); + // Animate old element + for (var key in oldVnode.savedStyle) { //re-apply saved inherited properties + if (parseInt(key) != key) { + var ms = key.substring(0,2) === 'ms'; + var moz = key.substring(0,3) === 'moz'; + var webkit = key.substring(0,6) === 'webkit'; + if (!ms && !moz && !webkit) //ignore prefixed style properties + oldStyle[key] = oldVnode.savedStyle[key]; + } + } + oldStyle.position = 'absolute'; + oldStyle.top = oldRect.top + 'px'; //start at existing position + oldStyle.left = oldRect.left + 'px'; + oldStyle.width = oldRect.width + 'px'; //Needed for elements who were sized relative to their parents + oldStyle.height = oldRect.height + 'px'; //Needed for elements who were sized relative to their parents + oldStyle.margin = 0; //Margin on hero element leads to incorrect positioning + oldStyle.transformOrigin = calcTransformOrigin(isTextNode, oldTextRect, oldRect); + oldStyle.transform = ''; + oldStyle.opacity = '1'; + document.body.appendChild(oldElm); + setNextFrame(oldStyle, 'transform', 'translate('+ -dx +'px, '+ -dy +'px) scale('+wRatio+', '+hRatio+')'); //scale must be on far right for translate to be correct + setNextFrame(oldStyle, 'opacity', '0'); + oldElm.addEventListener('transitionend', function(ev) { + if (ev.propertyName === 'transform') + document.body.removeChild(ev.target); + }); + } + } + removed = created = undefined; + } + + module.exports = {pre: pre, create: create, destroy: destroy, post: post}; + + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var MapPolyfill = __webpack_require__(39); + var IsolateModule = (function () { + function IsolateModule(isolatedElements) { + this.isolatedElements = isolatedElements; + this.eventDelegators = new MapPolyfill(); + } + IsolateModule.prototype.setScope = function (elm, scope) { + this.isolatedElements.set(scope, elm); + }; + IsolateModule.prototype.removeScope = function (scope) { + this.isolatedElements.delete(scope); + }; + IsolateModule.prototype.getIsolatedElement = function (scope) { + return this.isolatedElements.get(scope); + }; + IsolateModule.prototype.isIsolatedElement = function (elm) { + var iterator = this.isolatedElements.entries(); + var hasNext = true; + while (hasNext) { + try { + var result = iterator.next(); + var _a = result.value, scope = _a[0], element = _a[1]; + if (elm === element) { + return scope; + } + } + catch (err) { + hasNext = false; + } + } + return false; + }; + IsolateModule.prototype.addEventDelegator = function (scope, eventDelegator) { + var delegators = this.eventDelegators.get(scope); + if (!delegators) { + delegators = []; + this.eventDelegators.set(scope, delegators); + } + delegators[delegators.length] = eventDelegator; + }; + IsolateModule.prototype.reset = function () { + this.isolatedElements.clear(); + }; + IsolateModule.prototype.createModule = function () { + var self = this; + return { + create: function (oldVNode, vNode) { + var _a = oldVNode.data, oldData = _a === void 0 ? {} : _a; + var elm = vNode.elm, _b = vNode.data, data = _b === void 0 ? {} : _b; + var oldScope = oldData.isolate || ""; + var scope = data.isolate || ""; + if (scope) { + if (oldScope) { + self.removeScope(oldScope); + } + self.setScope(elm, scope); + var delegators = self.eventDelegators.get(scope); + if (delegators) { + for (var i = 0, len = delegators.length; i < len; ++i) { + delegators[i].updateTopElement(elm); + } + } + else if (delegators === void 0) { + self.eventDelegators.set(scope, []); + } + } + if (oldScope && !scope) { + self.removeScope(scope); + } + }, + update: function (oldVNode, vNode) { + var _a = oldVNode.data, oldData = _a === void 0 ? {} : _a; + var elm = vNode.elm, _b = vNode.data, data = _b === void 0 ? {} : _b; + var oldScope = oldData.isolate || ""; + var scope = data.isolate || ""; + if (scope && scope !== oldScope) { + if (oldScope) { + self.removeScope(oldScope); + } + self.setScope(elm, scope); + } + if (oldScope && !scope) { + self.removeScope(scope); + } + }, + remove: function (_a, cb) { + var data = _a.data; + data = data || {}; + var scope = data.isolate; + if (scope) { + self.removeScope(scope); + if (self.eventDelegators.get(scope)) { + self.eventDelegators.set(scope, []); + } + } + cb(); + }, + destroy: function (_a) { + var data = _a.data; + data = data || {}; + var scope = data.isolate; + if (scope) { + self.removeScope(scope); + if (self.eventDelegators.get(scope)) { + self.eventDelegators.set(scope, []); + } + } + } + }; + }; + return IsolateModule; + }()); + exports.IsolateModule = IsolateModule; + //# sourceMappingURL=isolateModule.js.map + +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(40)() ? Map : __webpack_require__(41); + + +/***/ }, +/* 40 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function () { + var map, iterator, result; + if (typeof Map !== 'function') return false; + try { + // WebKit doesn't support arguments and crashes + map = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]); + } catch (e) { + return false; + } + if (String(map) !== '[object Map]') return false; + if (map.size !== 3) return false; + if (typeof map.clear !== 'function') return false; + if (typeof map.delete !== 'function') return false; + if (typeof map.entries !== 'function') return false; + if (typeof map.forEach !== 'function') return false; + if (typeof map.get !== 'function') return false; + if (typeof map.has !== 'function') return false; + if (typeof map.keys !== 'function') return false; + if (typeof map.set !== 'function') return false; + if (typeof map.values !== 'function') return false; + + iterator = map.entries(); + result = iterator.next(); + if (result.done !== false) return false; + if (!result.value) return false; + if (result.value[0] !== 'raz') return false; + if (result.value[1] !== 'one') return false; + + return true; + }; + + +/***/ }, +/* 41 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var clear = __webpack_require__(42) + , eIndexOf = __webpack_require__(44) + , setPrototypeOf = __webpack_require__(50) + , callable = __webpack_require__(55) + , validValue = __webpack_require__(43) + , d = __webpack_require__(56) + , ee = __webpack_require__(68) + , Symbol = __webpack_require__(69) + , iterator = __webpack_require__(74) + , forOf = __webpack_require__(78) + , Iterator = __webpack_require__(88) + , isNative = __webpack_require__(91) + + , call = Function.prototype.call + , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf + , MapPoly; + + module.exports = MapPoly = function (/*iterable*/) { + var iterable = arguments[0], keys, values, self; + if (!(this instanceof MapPoly)) throw new TypeError('Constructor requires \'new\''); + if (isNative && setPrototypeOf && (Map !== MapPoly)) { + self = setPrototypeOf(new Map(), getPrototypeOf(this)); + } else { + self = this; + } + if (iterable != null) iterator(iterable); + defineProperties(self, { + __mapKeysData__: d('c', keys = []), + __mapValuesData__: d('c', values = []) + }); + if (!iterable) return self; + forOf(iterable, function (value) { + var key = validValue(value)[0]; + value = value[1]; + if (eIndexOf.call(keys, key) !== -1) return; + keys.push(key); + values.push(value); + }, self); + return self; + }; + + if (isNative) { + if (setPrototypeOf) setPrototypeOf(MapPoly, Map); + MapPoly.prototype = Object.create(Map.prototype, { + constructor: d(MapPoly) + }); + } + + ee(defineProperties(MapPoly.prototype, { + clear: d(function () { + if (!this.__mapKeysData__.length) return; + clear.call(this.__mapKeysData__); + clear.call(this.__mapValuesData__); + this.emit('_clear'); + }), + delete: d(function (key) { + var index = eIndexOf.call(this.__mapKeysData__, key); + if (index === -1) return false; + this.__mapKeysData__.splice(index, 1); + this.__mapValuesData__.splice(index, 1); + this.emit('_delete', index, key); + return true; + }), + entries: d(function () { return new Iterator(this, 'key+value'); }), + forEach: d(function (cb/*, thisArg*/) { + var thisArg = arguments[1], iterator, result; + callable(cb); + iterator = this.entries(); + result = iterator._next(); + while (result !== undefined) { + call.call(cb, thisArg, this.__mapValuesData__[result], + this.__mapKeysData__[result], this); + result = iterator._next(); + } + }), + get: d(function (key) { + var index = eIndexOf.call(this.__mapKeysData__, key); + if (index === -1) return; + return this.__mapValuesData__[index]; + }), + has: d(function (key) { + return (eIndexOf.call(this.__mapKeysData__, key) !== -1); + }), + keys: d(function () { return new Iterator(this, 'key'); }), + set: d(function (key, value) { + var index = eIndexOf.call(this.__mapKeysData__, key), emit; + if (index === -1) { + index = this.__mapKeysData__.push(key) - 1; + emit = true; + } + this.__mapValuesData__[index] = value; + if (emit) this.emit('_add', index, key); + return this; + }), + size: d.gs(function () { return this.__mapKeysData__.length; }), + values: d(function () { return new Iterator(this, 'value'); }), + toString: d(function () { return '[object Map]'; }) + })); + Object.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () { + return this.entries(); + })); + Object.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map')); + + +/***/ }, +/* 42 */ +/***/ function(module, exports, __webpack_require__) { + + // Inspired by Google Closure: + // http://closure-library.googlecode.com/svn/docs/ + // closure_goog_array_array.js.html#goog.array.clear + + 'use strict'; + + var value = __webpack_require__(43); + + module.exports = function () { + value(this).length = 0; + return this; + }; + + +/***/ }, +/* 43 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function (value) { + if (value == null) throw new TypeError("Cannot use null or undefined"); + return value; + }; + + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var toPosInt = __webpack_require__(45) + , value = __webpack_require__(43) + + , indexOf = Array.prototype.indexOf + , hasOwnProperty = Object.prototype.hasOwnProperty + , abs = Math.abs, floor = Math.floor; + + module.exports = function (searchElement/*, fromIndex*/) { + var i, l, fromIndex, val; + if (searchElement === searchElement) { //jslint: ignore + return indexOf.apply(this, arguments); + } + + l = toPosInt(value(this).length); + fromIndex = arguments[1]; + if (isNaN(fromIndex)) fromIndex = 0; + else if (fromIndex >= 0) fromIndex = floor(fromIndex); + else fromIndex = toPosInt(this.length) - floor(abs(fromIndex)); + + for (i = fromIndex; i < l; ++i) { + if (hasOwnProperty.call(this, i)) { + val = this[i]; + if (val !== val) return i; //jslint: ignore + } + } + return -1; + }; + + +/***/ }, +/* 45 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var toInteger = __webpack_require__(46) + + , max = Math.max; + + module.exports = function (value) { return max(0, toInteger(value)); }; + + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var sign = __webpack_require__(47) + + , abs = Math.abs, floor = Math.floor; + + module.exports = function (value) { + if (isNaN(value)) return 0; + value = Number(value); + if ((value === 0) || !isFinite(value)) return value; + return sign(value) * floor(abs(value)); + }; + + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(48)() + ? Math.sign + : __webpack_require__(49); + + +/***/ }, +/* 48 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function () { + var sign = Math.sign; + if (typeof sign !== 'function') return false; + return ((sign(10) === 1) && (sign(-20) === -1)); + }; + + +/***/ }, +/* 49 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function (value) { + value = Number(value); + if (isNaN(value) || (value === 0)) return value; + return (value > 0) ? 1 : -1; + }; + + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(51)() + ? Object.setPrototypeOf + : __webpack_require__(52); + + +/***/ }, +/* 51 */ +/***/ function(module, exports) { + + 'use strict'; + + var create = Object.create, getPrototypeOf = Object.getPrototypeOf + , x = {}; + + module.exports = function (/*customCreate*/) { + var setPrototypeOf = Object.setPrototypeOf + , customCreate = arguments[0] || create; + if (typeof setPrototypeOf !== 'function') return false; + return getPrototypeOf(setPrototypeOf(customCreate(null), x)) === x; + }; + + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + // Big thanks to @WebReflection for sorting this out + // https://gist.github.com/WebReflection/5593554 + + 'use strict'; + + var isObject = __webpack_require__(53) + , value = __webpack_require__(43) + + , isPrototypeOf = Object.prototype.isPrototypeOf + , defineProperty = Object.defineProperty + , nullDesc = { configurable: true, enumerable: false, writable: true, + value: undefined } + , validate; + + validate = function (obj, prototype) { + value(obj); + if ((prototype === null) || isObject(prototype)) return obj; + throw new TypeError('Prototype must be null or an object'); + }; + + module.exports = (function (status) { + var fn, set; + if (!status) return null; + if (status.level === 2) { + if (status.set) { + set = status.set; + fn = function (obj, prototype) { + set.call(validate(obj, prototype), prototype); + return obj; + }; + } else { + fn = function (obj, prototype) { + validate(obj, prototype).__proto__ = prototype; + return obj; + }; + } + } else { + fn = function self(obj, prototype) { + var isNullBase; + validate(obj, prototype); + isNullBase = isPrototypeOf.call(self.nullPolyfill, obj); + if (isNullBase) delete self.nullPolyfill.__proto__; + if (prototype === null) prototype = self.nullPolyfill; + obj.__proto__ = prototype; + if (isNullBase) defineProperty(self.nullPolyfill, '__proto__', nullDesc); + return obj; + }; + } + return Object.defineProperty(fn, 'level', { configurable: false, + enumerable: false, writable: false, value: status.level }); + }((function () { + var x = Object.create(null), y = {}, set + , desc = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__'); + + if (desc) { + try { + set = desc.set; // Opera crashes at this point + set.call(x, y); + } catch (ignore) { } + if (Object.getPrototypeOf(x) === y) return { set: set, level: 2 }; + } + + x.__proto__ = y; + if (Object.getPrototypeOf(x) === y) return { level: 2 }; + + x = {}; + x.__proto__ = y; + if (Object.getPrototypeOf(x) === y) return { level: 1 }; + + return false; + }()))); + + __webpack_require__(54); + + +/***/ }, +/* 53 */ +/***/ function(module, exports) { + + 'use strict'; + + var map = { function: true, object: true }; + + module.exports = function (x) { + return ((x != null) && map[typeof x]) || false; + }; + + +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { + + // Workaround for http://code.google.com/p/v8/issues/detail?id=2804 + + 'use strict'; + + var create = Object.create, shim; + + if (!__webpack_require__(51)()) { + shim = __webpack_require__(52); + } + + module.exports = (function () { + var nullObject, props, desc; + if (!shim) return create; + if (shim.level !== 1) return create; + + nullObject = {}; + props = {}; + desc = { configurable: false, enumerable: false, writable: true, + value: undefined }; + Object.getOwnPropertyNames(Object.prototype).forEach(function (name) { + if (name === '__proto__') { + props[name] = { configurable: true, enumerable: false, writable: true, + value: undefined }; + return; + } + props[name] = desc; + }); + Object.defineProperties(nullObject, props); + + Object.defineProperty(shim, 'nullPolyfill', { configurable: false, + enumerable: false, writable: false, value: nullObject }); + + return function (prototype, props) { + return create((prototype === null) ? nullObject : prototype, props); + }; + }()); + + +/***/ }, +/* 55 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function (fn) { + if (typeof fn !== 'function') throw new TypeError(fn + " is not a function"); + return fn; + }; + + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var assign = __webpack_require__(57) + , normalizeOpts = __webpack_require__(63) + , isCallable = __webpack_require__(64) + , contains = __webpack_require__(65) + + , d; + + d = module.exports = function (dscr, value/*, options*/) { + var c, e, w, options, desc; + if ((arguments.length < 2) || (typeof dscr !== 'string')) { + options = value; + value = dscr; + dscr = null; + } else { + options = arguments[2]; + } + if (dscr == null) { + c = w = true; + e = false; + } else { + c = contains.call(dscr, 'c'); + e = contains.call(dscr, 'e'); + w = contains.call(dscr, 'w'); + } + + desc = { value: value, configurable: c, enumerable: e, writable: w }; + return !options ? desc : assign(normalizeOpts(options), desc); + }; + + d.gs = function (dscr, get, set/*, options*/) { + var c, e, options, desc; + if (typeof dscr !== 'string') { + options = set; + set = get; + get = dscr; + dscr = null; + } else { + options = arguments[3]; + } + if (get == null) { + get = undefined; + } else if (!isCallable(get)) { + options = get; + get = set = undefined; + } else if (set == null) { + set = undefined; + } else if (!isCallable(set)) { + options = set; + set = undefined; + } + if (dscr == null) { + c = true; + e = false; + } else { + c = contains.call(dscr, 'c'); + e = contains.call(dscr, 'e'); + } + + desc = { get: get, set: set, configurable: c, enumerable: e }; + return !options ? desc : assign(normalizeOpts(options), desc); + }; + + +/***/ }, +/* 57 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(58)() + ? Object.assign + : __webpack_require__(59); + + +/***/ }, +/* 58 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function () { + var assign = Object.assign, obj; + if (typeof assign !== 'function') return false; + obj = { foo: 'raz' }; + assign(obj, { bar: 'dwa' }, { trzy: 'trzy' }); + return (obj.foo + obj.bar + obj.trzy) === 'razdwatrzy'; + }; + + +/***/ }, +/* 59 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var keys = __webpack_require__(60) + , value = __webpack_require__(43) + + , max = Math.max; + + module.exports = function (dest, src/*, …srcn*/) { + var error, i, l = max(arguments.length, 2), assign; + dest = Object(value(dest)); + assign = function (key) { + try { dest[key] = src[key]; } catch (e) { + if (!error) error = e; + } + }; + for (i = 1; i < l; ++i) { + src = arguments[i]; + keys(src).forEach(assign); + } + if (error !== undefined) throw error; + return dest; + }; + + +/***/ }, +/* 60 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(61)() + ? Object.keys + : __webpack_require__(62); + + +/***/ }, +/* 61 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function () { + try { + Object.keys('primitive'); + return true; + } catch (e) { return false; } + }; + + +/***/ }, +/* 62 */ +/***/ function(module, exports) { + + 'use strict'; + + var keys = Object.keys; + + module.exports = function (object) { + return keys(object == null ? object : Object(object)); + }; + + +/***/ }, +/* 63 */ +/***/ function(module, exports) { + + 'use strict'; + + var forEach = Array.prototype.forEach, create = Object.create; + + var process = function (src, obj) { + var key; + for (key in src) obj[key] = src[key]; + }; + + module.exports = function (options/*, …options*/) { + var result = create(null); + forEach.call(arguments, function (options) { + if (options == null) return; + process(Object(options), result); + }); + return result; + }; + + +/***/ }, +/* 64 */ +/***/ function(module, exports) { + + // Deprecated + + 'use strict'; + + module.exports = function (obj) { return typeof obj === 'function'; }; + + +/***/ }, +/* 65 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(66)() + ? String.prototype.contains + : __webpack_require__(67); + + +/***/ }, +/* 66 */ +/***/ function(module, exports) { + + 'use strict'; + + var str = 'razdwatrzy'; + + module.exports = function () { + if (typeof str.contains !== 'function') return false; + return ((str.contains('dwa') === true) && (str.contains('foo') === false)); + }; + + +/***/ }, +/* 67 */ +/***/ function(module, exports) { + + 'use strict'; + + var indexOf = String.prototype.indexOf; + + module.exports = function (searchString/*, position*/) { + return indexOf.call(this, searchString, arguments[1]) > -1; + }; + + +/***/ }, +/* 68 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var d = __webpack_require__(56) + , callable = __webpack_require__(55) + + , apply = Function.prototype.apply, call = Function.prototype.call + , create = Object.create, defineProperty = Object.defineProperty + , defineProperties = Object.defineProperties + , hasOwnProperty = Object.prototype.hasOwnProperty + , descriptor = { configurable: true, enumerable: false, writable: true } + + , on, once, off, emit, methods, descriptors, base; + + on = function (type, listener) { + var data; + + callable(listener); + + if (!hasOwnProperty.call(this, '__ee__')) { + data = descriptor.value = create(null); + defineProperty(this, '__ee__', descriptor); + descriptor.value = null; + } else { + data = this.__ee__; + } + if (!data[type]) data[type] = listener; + else if (typeof data[type] === 'object') data[type].push(listener); + else data[type] = [data[type], listener]; + + return this; + }; + + once = function (type, listener) { + var once, self; + + callable(listener); + self = this; + on.call(this, type, once = function () { + off.call(self, type, once); + apply.call(listener, this, arguments); + }); + + once.__eeOnceListener__ = listener; + return this; + }; + + off = function (type, listener) { + var data, listeners, candidate, i; + + callable(listener); + + if (!hasOwnProperty.call(this, '__ee__')) return this; + data = this.__ee__; + if (!data[type]) return this; + listeners = data[type]; + + if (typeof listeners === 'object') { + for (i = 0; (candidate = listeners[i]); ++i) { + if ((candidate === listener) || + (candidate.__eeOnceListener__ === listener)) { + if (listeners.length === 2) data[type] = listeners[i ? 0 : 1]; + else listeners.splice(i, 1); + } + } + } else { + if ((listeners === listener) || + (listeners.__eeOnceListener__ === listener)) { + delete data[type]; + } + } + + return this; + }; + + emit = function (type) { + var i, l, listener, listeners, args; + + if (!hasOwnProperty.call(this, '__ee__')) return; + listeners = this.__ee__[type]; + if (!listeners) return; + + if (typeof listeners === 'object') { + l = arguments.length; + args = new Array(l - 1); + for (i = 1; i < l; ++i) args[i - 1] = arguments[i]; + + listeners = listeners.slice(); + for (i = 0; (listener = listeners[i]); ++i) { + apply.call(listener, this, args); + } + } else { + switch (arguments.length) { + case 1: + call.call(listeners, this); + break; + case 2: + call.call(listeners, this, arguments[1]); + break; + case 3: + call.call(listeners, this, arguments[1], arguments[2]); + break; + default: + l = arguments.length; + args = new Array(l - 1); + for (i = 1; i < l; ++i) { + args[i - 1] = arguments[i]; + } + apply.call(listeners, this, args); + } + } + }; + + methods = { + on: on, + once: once, + off: off, + emit: emit + }; + + descriptors = { + on: d(on), + once: d(once), + off: d(off), + emit: d(emit) + }; + + base = defineProperties({}, descriptors); + + module.exports = exports = function (o) { + return (o == null) ? create(base) : defineProperties(Object(o), descriptors); + }; + exports.methods = methods; + + +/***/ }, +/* 69 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(70)() ? Symbol : __webpack_require__(71); + + +/***/ }, +/* 70 */ +/***/ function(module, exports) { + + 'use strict'; + + var validTypes = { object: true, symbol: true }; + + module.exports = function () { + var symbol; + if (typeof Symbol !== 'function') return false; + symbol = Symbol('test symbol'); + try { String(symbol); } catch (e) { return false; } + + // Return 'true' also for polyfills + if (!validTypes[typeof Symbol.iterator]) return false; + if (!validTypes[typeof Symbol.toPrimitive]) return false; + if (!validTypes[typeof Symbol.toStringTag]) return false; + + return true; + }; + + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + // ES2015 Symbol polyfill for environments that do not support it (or partially support it) + + 'use strict'; + + var d = __webpack_require__(56) + , validateSymbol = __webpack_require__(72) + + , create = Object.create, defineProperties = Object.defineProperties + , defineProperty = Object.defineProperty, objPrototype = Object.prototype + , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null) + , isNativeSafe; + + if (typeof Symbol === 'function') { + NativeSymbol = Symbol; + try { + String(NativeSymbol()); + isNativeSafe = true; + } catch (ignore) {} + } + + var generateName = (function () { + var created = create(null); + return function (desc) { + var postfix = 0, name, ie11BugWorkaround; + while (created[desc + (postfix || '')]) ++postfix; + desc += (postfix || ''); + created[desc] = true; + name = '@@' + desc; + defineProperty(objPrototype, name, d.gs(null, function (value) { + // For IE11 issue see: + // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ + // ie11-broken-getters-on-dom-objects + // https://github.com/medikoo/es6-symbol/issues/12 + if (ie11BugWorkaround) return; + ie11BugWorkaround = true; + defineProperty(this, name, d(value)); + ie11BugWorkaround = false; + })); + return name; + }; + }()); + + // Internal constructor (not one exposed) for creating Symbol instances. + // This one is used to ensure that `someSymbol instanceof Symbol` always return false + HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor'); + return SymbolPolyfill(description); + }; + + // Exposed `Symbol` constructor + // (returns instances of HiddenSymbol) + module.exports = SymbolPolyfill = function Symbol(description) { + var symbol; + if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); + if (isNativeSafe) return NativeSymbol(description); + symbol = create(HiddenSymbol.prototype); + description = (description === undefined ? '' : String(description)); + return defineProperties(symbol, { + __description__: d('', description), + __name__: d('', generateName(description)) + }); + }; + defineProperties(SymbolPolyfill, { + for: d(function (key) { + if (globalSymbols[key]) return globalSymbols[key]; + return (globalSymbols[key] = SymbolPolyfill(String(key))); + }), + keyFor: d(function (s) { + var key; + validateSymbol(s); + for (key in globalSymbols) if (globalSymbols[key] === s) return key; + }), + + // If there's native implementation of given symbol, let's fallback to it + // to ensure proper interoperability with other native functions e.g. Array.from + hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')), + isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) || + SymbolPolyfill('isConcatSpreadable')), + iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')), + match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')), + replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')), + search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')), + species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')), + split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')), + toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')), + toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')), + unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables')) + }); + + // Internal tweaks for real symbol producer + defineProperties(HiddenSymbol.prototype, { + constructor: d(SymbolPolyfill), + toString: d('', function () { return this.__name__; }) + }); + + // Proper implementation of methods exposed on Symbol.prototype + // They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype + defineProperties(SymbolPolyfill.prototype, { + toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), + valueOf: d(function () { return validateSymbol(this); }) + }); + defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () { + var symbol = validateSymbol(this); + if (typeof symbol === 'symbol') return symbol; + return symbol.toString(); + })); + defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); + + // Proper implementaton of toPrimitive and toStringTag for returned symbol instances + defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, + d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])); + + // Note: It's important to define `toPrimitive` as last one, as some implementations + // implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) + // And that may invoke error in definition flow: + // See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 + defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, + d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); + + +/***/ }, +/* 72 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isSymbol = __webpack_require__(73); + + module.exports = function (value) { + if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); + return value; + }; + + +/***/ }, +/* 73 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function (x) { + if (!x) return false; + if (typeof x === 'symbol') return true; + if (!x.constructor) return false; + if (x.constructor.name !== 'Symbol') return false; + return (x[x.constructor.toStringTag] === 'Symbol'); + }; + + +/***/ }, +/* 74 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isIterable = __webpack_require__(75); + + module.exports = function (value) { + if (!isIterable(value)) throw new TypeError(value + " is not iterable"); + return value; + }; + + +/***/ }, +/* 75 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isArguments = __webpack_require__(76) + , isString = __webpack_require__(77) + , iteratorSymbol = __webpack_require__(69).iterator + + , isArray = Array.isArray; + + module.exports = function (value) { + if (value == null) return false; + if (isArray(value)) return true; + if (isString(value)) return true; + if (isArguments(value)) return true; + return (typeof value[iteratorSymbol] === 'function'); + }; + + +/***/ }, +/* 76 */ +/***/ function(module, exports) { + + 'use strict'; + + var toString = Object.prototype.toString + + , id = toString.call((function () { return arguments; }())); + + module.exports = function (x) { return (toString.call(x) === id); }; + + +/***/ }, +/* 77 */ +/***/ function(module, exports) { + + 'use strict'; + + var toString = Object.prototype.toString + + , id = toString.call(''); + + module.exports = function (x) { + return (typeof x === 'string') || (x && (typeof x === 'object') && + ((x instanceof String) || (toString.call(x) === id))) || false; + }; + + +/***/ }, +/* 78 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isArguments = __webpack_require__(76) + , callable = __webpack_require__(55) + , isString = __webpack_require__(77) + , get = __webpack_require__(79) + + , isArray = Array.isArray, call = Function.prototype.call + , some = Array.prototype.some; + + module.exports = function (iterable, cb/*, thisArg*/) { + var mode, thisArg = arguments[2], result, doBreak, broken, i, l, char, code; + if (isArray(iterable) || isArguments(iterable)) mode = 'array'; + else if (isString(iterable)) mode = 'string'; + else iterable = get(iterable); + + callable(cb); + doBreak = function () { broken = true; }; + if (mode === 'array') { + some.call(iterable, function (value) { + call.call(cb, thisArg, value, doBreak); + if (broken) return true; + }); + return; + } + if (mode === 'string') { + l = iterable.length; + for (i = 0; i < l; ++i) { + char = iterable[i]; + if ((i + 1) < l) { + code = char.charCodeAt(0); + if ((code >= 0xD800) && (code <= 0xDBFF)) char += iterable[++i]; + } + call.call(cb, thisArg, char, doBreak); + if (broken) break; + } + return; + } + result = iterable.next(); + + while (!result.done) { + call.call(cb, thisArg, result.value, doBreak); + if (broken) return; + result = iterable.next(); + } + }; + + +/***/ }, +/* 79 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isArguments = __webpack_require__(76) + , isString = __webpack_require__(77) + , ArrayIterator = __webpack_require__(80) + , StringIterator = __webpack_require__(87) + , iterable = __webpack_require__(74) + , iteratorSymbol = __webpack_require__(69).iterator; + + module.exports = function (obj) { + if (typeof iterable(obj)[iteratorSymbol] === 'function') return obj[iteratorSymbol](); + if (isArguments(obj)) return new ArrayIterator(obj); + if (isString(obj)) return new StringIterator(obj); + return new ArrayIterator(obj); + }; + + +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var setPrototypeOf = __webpack_require__(50) + , contains = __webpack_require__(65) + , d = __webpack_require__(56) + , Iterator = __webpack_require__(81) + + , defineProperty = Object.defineProperty + , ArrayIterator; + + ArrayIterator = module.exports = function (arr, kind) { + if (!(this instanceof ArrayIterator)) return new ArrayIterator(arr, kind); + Iterator.call(this, arr); + if (!kind) kind = 'value'; + else if (contains.call(kind, 'key+value')) kind = 'key+value'; + else if (contains.call(kind, 'key')) kind = 'key'; + else kind = 'value'; + defineProperty(this, '__kind__', d('', kind)); + }; + if (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator); + + ArrayIterator.prototype = Object.create(Iterator.prototype, { + constructor: d(ArrayIterator), + _resolve: d(function (i) { + if (this.__kind__ === 'value') return this.__list__[i]; + if (this.__kind__ === 'key+value') return [i, this.__list__[i]]; + return i; + }), + toString: d(function () { return '[object Array Iterator]'; }) + }); + + +/***/ }, +/* 81 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var clear = __webpack_require__(42) + , assign = __webpack_require__(57) + , callable = __webpack_require__(55) + , value = __webpack_require__(43) + , d = __webpack_require__(56) + , autoBind = __webpack_require__(82) + , Symbol = __webpack_require__(69) + + , defineProperty = Object.defineProperty + , defineProperties = Object.defineProperties + , Iterator; + + module.exports = Iterator = function (list, context) { + if (!(this instanceof Iterator)) return new Iterator(list, context); + defineProperties(this, { + __list__: d('w', value(list)), + __context__: d('w', context), + __nextIndex__: d('w', 0) + }); + if (!context) return; + callable(context.on); + context.on('_add', this._onAdd); + context.on('_delete', this._onDelete); + context.on('_clear', this._onClear); + }; + + defineProperties(Iterator.prototype, assign({ + constructor: d(Iterator), + _next: d(function () { + var i; + if (!this.__list__) return; + if (this.__redo__) { + i = this.__redo__.shift(); + if (i !== undefined) return i; + } + if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; + this._unBind(); + }), + next: d(function () { return this._createResult(this._next()); }), + _createResult: d(function (i) { + if (i === undefined) return { done: true, value: undefined }; + return { done: false, value: this._resolve(i) }; + }), + _resolve: d(function (i) { return this.__list__[i]; }), + _unBind: d(function () { + this.__list__ = null; + delete this.__redo__; + if (!this.__context__) return; + this.__context__.off('_add', this._onAdd); + this.__context__.off('_delete', this._onDelete); + this.__context__.off('_clear', this._onClear); + this.__context__ = null; + }), + toString: d(function () { return '[object Iterator]'; }) + }, autoBind({ + _onAdd: d(function (index) { + if (index >= this.__nextIndex__) return; + ++this.__nextIndex__; + if (!this.__redo__) { + defineProperty(this, '__redo__', d('c', [index])); + return; + } + this.__redo__.forEach(function (redo, i) { + if (redo >= index) this.__redo__[i] = ++redo; + }, this); + this.__redo__.push(index); + }), + _onDelete: d(function (index) { + var i; + if (index >= this.__nextIndex__) return; + --this.__nextIndex__; + if (!this.__redo__) return; + i = this.__redo__.indexOf(index); + if (i !== -1) this.__redo__.splice(i, 1); + this.__redo__.forEach(function (redo, i) { + if (redo > index) this.__redo__[i] = --redo; + }, this); + }), + _onClear: d(function () { + if (this.__redo__) clear.call(this.__redo__); + this.__nextIndex__ = 0; + }) + }))); + + defineProperty(Iterator.prototype, Symbol.iterator, d(function () { + return this; + })); + defineProperty(Iterator.prototype, Symbol.toStringTag, d('', 'Iterator')); + + +/***/ }, +/* 82 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var copy = __webpack_require__(83) + , map = __webpack_require__(84) + , callable = __webpack_require__(55) + , validValue = __webpack_require__(43) + + , bind = Function.prototype.bind, defineProperty = Object.defineProperty + , hasOwnProperty = Object.prototype.hasOwnProperty + , define; + + define = function (name, desc, bindTo) { + var value = validValue(desc) && callable(desc.value), dgs; + dgs = copy(desc); + delete dgs.writable; + delete dgs.value; + dgs.get = function () { + if (hasOwnProperty.call(this, name)) return value; + desc.value = bind.call(value, (bindTo == null) ? this : this[bindTo]); + defineProperty(this, name, desc); + return this[name]; + }; + return dgs; + }; + + module.exports = function (props/*, bindTo*/) { + var bindTo = arguments[1]; + return map(props, function (desc, name) { + return define(name, desc, bindTo); + }); + }; + + +/***/ }, +/* 83 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var assign = __webpack_require__(57) + , value = __webpack_require__(43); + + module.exports = function (obj) { + var copy = Object(value(obj)); + if (copy !== obj) return copy; + return assign({}, obj); + }; + + +/***/ }, +/* 84 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var callable = __webpack_require__(55) + , forEach = __webpack_require__(85) + + , call = Function.prototype.call; + + module.exports = function (obj, cb/*, thisArg*/) { + var o = {}, thisArg = arguments[2]; + callable(cb); + forEach(obj, function (value, key, obj, index) { + o[key] = call.call(cb, thisArg, value, key, obj, index); + }); + return o; + }; + + +/***/ }, +/* 85 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(86)('forEach'); + + +/***/ }, +/* 86 */ +/***/ function(module, exports, __webpack_require__) { + + // Internal method, used by iteration functions. + // Calls a function for each key-value pair found in object + // Optionally takes compareFn to iterate object in specific order + + 'use strict'; + + var callable = __webpack_require__(55) + , value = __webpack_require__(43) + + , bind = Function.prototype.bind, call = Function.prototype.call, keys = Object.keys + , propertyIsEnumerable = Object.prototype.propertyIsEnumerable; + + module.exports = function (method, defVal) { + return function (obj, cb/*, thisArg, compareFn*/) { + var list, thisArg = arguments[2], compareFn = arguments[3]; + obj = Object(value(obj)); + callable(cb); + + list = keys(obj); + if (compareFn) { + list.sort((typeof compareFn === 'function') ? bind.call(compareFn, obj) : undefined); + } + if (typeof method !== 'function') method = list[method]; + return call.call(method, list, function (key, index) { + if (!propertyIsEnumerable.call(obj, key)) return defVal; + return call.call(cb, thisArg, obj[key], key, obj, index); + }); + }; + }; + + +/***/ }, +/* 87 */ +/***/ function(module, exports, __webpack_require__) { + + // Thanks @mathiasbynens + // http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols + + 'use strict'; + + var setPrototypeOf = __webpack_require__(50) + , d = __webpack_require__(56) + , Iterator = __webpack_require__(81) + + , defineProperty = Object.defineProperty + , StringIterator; + + StringIterator = module.exports = function (str) { + if (!(this instanceof StringIterator)) return new StringIterator(str); + str = String(str); + Iterator.call(this, str); + defineProperty(this, '__length__', d('', str.length)); + + }; + if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator); + + StringIterator.prototype = Object.create(Iterator.prototype, { + constructor: d(StringIterator), + _next: d(function () { + if (!this.__list__) return; + if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++; + this._unBind(); + }), + _resolve: d(function (i) { + var char = this.__list__[i], code; + if (this.__nextIndex__ === this.__length__) return char; + code = char.charCodeAt(0); + if ((code >= 0xD800) && (code <= 0xDBFF)) return char + this.__list__[this.__nextIndex__++]; + return char; + }), + toString: d(function () { return '[object String Iterator]'; }) + }); + + +/***/ }, +/* 88 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var setPrototypeOf = __webpack_require__(50) + , d = __webpack_require__(56) + , Iterator = __webpack_require__(81) + , toStringTagSymbol = __webpack_require__(69).toStringTag + , kinds = __webpack_require__(89) + + , defineProperties = Object.defineProperties + , unBind = Iterator.prototype._unBind + , MapIterator; + + MapIterator = module.exports = function (map, kind) { + if (!(this instanceof MapIterator)) return new MapIterator(map, kind); + Iterator.call(this, map.__mapKeysData__, map); + if (!kind || !kinds[kind]) kind = 'key+value'; + defineProperties(this, { + __kind__: d('', kind), + __values__: d('w', map.__mapValuesData__) + }); + }; + if (setPrototypeOf) setPrototypeOf(MapIterator, Iterator); + + MapIterator.prototype = Object.create(Iterator.prototype, { + constructor: d(MapIterator), + _resolve: d(function (i) { + if (this.__kind__ === 'value') return this.__values__[i]; + if (this.__kind__ === 'key') return this.__list__[i]; + return [this.__list__[i], this.__values__[i]]; + }), + _unBind: d(function () { + this.__values__ = null; + unBind.call(this); + }), + toString: d(function () { return '[object Map Iterator]'; }) + }); + Object.defineProperty(MapIterator.prototype, toStringTagSymbol, + d('c', 'Map Iterator')); + + +/***/ }, +/* 89 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = __webpack_require__(90)('key', + 'value', 'key+value'); + + +/***/ }, +/* 90 */ +/***/ function(module, exports) { + + 'use strict'; + + var forEach = Array.prototype.forEach, create = Object.create; + + module.exports = function (arg/*, …args*/) { + var set = create(null); + forEach.call(arguments, function (name) { set[name] = true; }); + return set; + }; + + +/***/ }, +/* 91 */ +/***/ function(module, exports) { + + // Exports true if environment provides native `Map` implementation, + // whatever that is. + + 'use strict'; + + module.exports = (function () { + if (typeof Map === 'undefined') return false; + return (Object.prototype.toString.call(new Map()) === '[object Map]'); + }()); + + +/***/ }, +/* 92 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_adapter_1 = __webpack_require__(18); + var xstream_1 = __webpack_require__(5); + function createVTree(vnode, children) { + return { + sel: vnode.sel, + data: vnode.data, + text: vnode.text, + elm: vnode.elm, + key: vnode.key, + children: children, + }; + } + function makeTransposeVNode(runStreamAdapter) { + return function transposeVNode(vnode) { + if (!vnode) { + return null; + } + else if (vnode && typeof vnode.data === "object" && vnode.data.static) { + return xstream_1.default.of(vnode); + } + else if (runStreamAdapter.isValidStream(vnode)) { + var xsStream = xstream_adapter_1.default.adapt(vnode, runStreamAdapter.streamSubscribe); + return xsStream.map(transposeVNode).flatten(); + } + else if (typeof vnode === "object") { + if (!vnode.children || vnode.children.length === 0) { + return xstream_1.default.of(vnode); + } + var vnodeChildren = vnode.children + .map(transposeVNode) + .filter(function (x) { return x !== null; }); + if (vnodeChildren.length === 0) { + return xstream_1.default.of(createVTree(vnode, [])); + } + else { + return xstream_1.default.combine.apply(xstream_1.default, vnodeChildren) + .map(function (children) { return createVTree(vnode, children.slice()); }); + } + } + else { + throw new Error("Unhandled vTree Value"); + } + }; + } + exports.makeTransposeVNode = makeTransposeVNode; + //# sourceMappingURL=transposition.js.map + +/***/ }, +/* 93 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_adapter_1 = __webpack_require__(18); + var transposition_1 = __webpack_require__(92); + var HTMLSource_1 = __webpack_require__(94); + var toHTML = __webpack_require__(95); + /* tslint:disable:no-empty */ + var noop = function () { }; + /* tslint:enable:no-empty */ + function makeHTMLDriver(effect, options) { + if (!options) { + options = {}; + } + var transposition = options.transposition || false; + function htmlDriver(vnode$, runStreamAdapter) { + var transposeVNode = transposition_1.makeTransposeVNode(runStreamAdapter); + var preprocessedVNode$ = (transposition ? vnode$.map(transposeVNode).flatten() : vnode$); + var html$ = preprocessedVNode$.last().map(toHTML); + html$.addListener({ + next: effect || noop, + error: noop, + complete: noop, + }); + return new HTMLSource_1.HTMLSource(html$, runStreamAdapter); + } + ; + htmlDriver.streamAdapter = xstream_adapter_1.default; + return htmlDriver; + } + exports.makeHTMLDriver = makeHTMLDriver; + //# sourceMappingURL=makeHTMLDriver.js.map + +/***/ }, +/* 94 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_1 = __webpack_require__(5); + var xstream_adapter_1 = __webpack_require__(18); + var HTMLSource = (function () { + function HTMLSource(html$, runSA) { + this.runSA = runSA; + this._html$ = html$; + this._empty$ = runSA.adapt(xstream_1.default.empty(), xstream_adapter_1.default.streamSubscribe); + } + HTMLSource.prototype.elements = function () { + return this.runSA.adapt(this._html$, xstream_adapter_1.default.streamSubscribe); + }; + HTMLSource.prototype.select = function (selector) { + return new HTMLSource(xstream_1.default.empty(), this.runSA); + }; + HTMLSource.prototype.events = function (eventType, options) { + return this._empty$; + }; + return HTMLSource; + }()); + exports.HTMLSource = HTMLSource; + //# sourceMappingURL=HTMLSource.js.map + +/***/ }, +/* 95 */ +/***/ function(module, exports, __webpack_require__) { + + + var init = __webpack_require__(96); + + module.exports = init([__webpack_require__(101), __webpack_require__(122)]); + +/***/ }, +/* 96 */ +/***/ function(module, exports, __webpack_require__) { + + + var parseSelector = __webpack_require__(97); + var VOID_ELEMENTS = __webpack_require__(99); + var CONTAINER_ELEMENTS = __webpack_require__(100); + + module.exports = function init(modules) { + function parse(data) { + return modules.reduce(function (arr, fn) { + arr.push(fn(data)); + return arr; + }, []).filter(function (result) { + return result !== ''; + }); + } + + return function renderToString(vnode) { + if (!vnode.sel && vnode.text) { + return vnode.text; + } + + vnode.data = vnode.data || {}; + + // Support thunks + if (typeof vnode.sel === 'string' && vnode.sel.slice(0, 5) === 'thunk') { + vnode = vnode.data.fn.apply(null, vnode.data.args); + } + + var tagName = parseSelector(vnode.sel).tagName; + var attributes = parse(vnode); + var svg = vnode.data.ns === 'http://www.w3.org/2000/svg'; + var tag = []; + + // Open tag + tag.push('<' + tagName); + if (attributes.length) { + tag.push(' ' + attributes.join(' ')); + } + if (svg && CONTAINER_ELEMENTS[tagName] !== true) { + tag.push(' /'); + } + tag.push('>'); + + // Close tag, if needed + if (VOID_ELEMENTS[tagName] !== true && !svg || svg && CONTAINER_ELEMENTS[tagName] === true) { + if (vnode.data.props && vnode.data.props.innerHTML) { + tag.push(vnode.data.props.innerHTML); + } else if (vnode.text) { + tag.push(vnode.text); + } else if (vnode.children) { + vnode.children.forEach(function (child) { + tag.push(renderToString(child)); + }); + } + tag.push(''); + } + + return tag.join(''); + }; + }; + +/***/ }, +/* 97 */ +/***/ function(module, exports, __webpack_require__) { + + + // https://github.com/Matt-Esch/virtual-dom/blob/master/virtual-hyperscript/parse-tag.js + + var split = __webpack_require__(98); + + var classIdSplit = /([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/; + var notClassId = /^\.|#/; + + module.exports = function parseSelector(selector, upper) { + selector = selector || ''; + var tagName; + var id = ''; + var classes = []; + + var tagParts = split(selector, classIdSplit); + + if (notClassId.test(tagParts[1]) || selector === '') { + tagName = 'div'; + } + + var part, type, i; + + for (i = 0; i < tagParts.length; i++) { + part = tagParts[i]; + + if (!part) { + continue; + } + + type = part.charAt(0); + + if (!tagName) { + tagName = part; + } else if (type === '.') { + classes.push(part.substring(1, part.length)); + } else if (type === '#') { + id = part.substring(1, part.length); + } + } + + return { + tagName: upper === true ? tagName.toUpperCase() : tagName, + id: id, + className: classes.join(' ') + }; + }; + +/***/ }, +/* 98 */ +/***/ function(module, exports) { + + /*! + * Cross-Browser Split 1.1.1 + * Copyright 2007-2012 Steven Levithan + * Available under the MIT License + * ECMAScript compliant, uniform cross-browser split method + */ + + /** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * split('a b c d', ' '); + * // -> ['a', 'b', 'c', 'd'] + * + * // With limit + * split('a b c d', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * split('..word1 word2..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', ' ', 'word', '2', '..'] + */ + module.exports = (function split(undef) { + + var nativeSplit = String.prototype.split, + compliantExecNpcg = /()??/.exec("")[1] === undef, + // NPCG: nonparticipating capturing group + self; + + self = function(str, separator, limit) { + // If `separator` is not a regex, use `nativeSplit` + if (Object.prototype.toString.call(separator) !== "[object RegExp]") { + return nativeSplit.call(str, separator, limit); + } + var output = [], + flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.extended ? "x" : "") + // Proposed for ES6 + (separator.sticky ? "y" : ""), + // Firefox 3+ + lastLastIndex = 0, + // Make `global` and avoid `lastIndex` issues by working with a copy + separator = new RegExp(separator.source, flags + "g"), + separator2, match, lastIndex, lastLength; + str += ""; // Type-convert + if (!compliantExecNpcg) { + // Doesn't need flags gy, but they don't hurt + separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags); + } + /* Values for `limit`, per the spec: + * If undefined: 4294967295 // Math.pow(2, 32) - 1 + * If 0, Infinity, or NaN: 0 + * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296; + * If negative number: 4294967296 - Math.floor(Math.abs(limit)) + * If other: Type-convert, then use the above rules + */ + limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1 + limit >>> 0; // ToUint32(limit) + while (match = separator.exec(str)) { + // `separator.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0].length; + if (lastIndex > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for + // nonparticipating capturing groups + if (!compliantExecNpcg && match.length > 1) { + match[0].replace(separator2, function() { + for (var i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undef) { + match[i] = undef; + } + } + }); + } + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= limit) { + break; + } + } + if (separator.lastIndex === match.index) { + separator.lastIndex++; // Avoid an infinite loop + } + } + if (lastLastIndex === str.length) { + if (lastLength || !separator.test("")) { + output.push(""); + } + } else { + output.push(str.slice(lastLastIndex)); + } + return output.length > limit ? output.slice(0, limit) : output; + }; + + return self; + })(); + + +/***/ }, +/* 99 */ +/***/ function(module, exports) { + + + // http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements + + module.exports = { + area: true, + base: true, + br: true, + col: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + +/***/ }, +/* 100 */ +/***/ function(module, exports) { + + + // All SVG children elements, not in this list, should self-close + + module.exports = { + // http://www.w3.org/TR/SVG/intro.html#TermContainerElement + 'a': true, + 'defs': true, + 'glyph': true, + 'g': true, + 'marker': true, + 'mask': true, + 'missing-glyph': true, + 'pattern': true, + 'svg': true, + 'switch': true, + 'symbol': true, + + // http://www.w3.org/TR/SVG/intro.html#TermDescriptiveElement + 'desc': true, + 'metadata': true, + 'title': true + }; + +/***/ }, +/* 101 */ +/***/ function(module, exports, __webpack_require__) { + + + var forOwn = __webpack_require__(102); + var escape = __webpack_require__(109); + var union = __webpack_require__(112); + + var parseSelector = __webpack_require__(97); + + // data.attrs, data.props, data.class + + module.exports = function attributes(vnode) { + var selector = parseSelector(vnode.sel); + var parsedClasses = selector.className.split(' '); + + var attributes = []; + var classes = []; + var values = {}; + + if (selector.id) { + values.id = selector.id; + } + + setAttributes(vnode.data.props, values); + setAttributes(vnode.data.attrs, values); // `attrs` override `props`, not sure if this is good so + + if (vnode.data.class) { + // Omit `className` attribute if `class` is set on vnode + values.class = undefined; + } + forOwn(vnode.data.class, function (value, key) { + if (value === true) { + classes.push(key); + } + }); + classes = union(classes, values.class, parsedClasses).filter(function (x) { + return x !== ''; + }); + + if (classes.length) { + values.class = classes.join(' '); + } + + forOwn(values, function (value, key) { + attributes.push(value === true ? key : key + '="' + escape(value) + '"'); + }); + + return attributes.length ? attributes.join(' ') : ''; + }; + + function setAttributes(values, target) { + forOwn(values, function (value, key) { + if (key === 'htmlFor') { + target['for'] = value; + return; + } + if (key === 'className') { + target['class'] = value.split(' '); + return; + } + if (key === 'innerHTML') { + return; + } + target[key] = value; + }); + } + +/***/ }, +/* 102 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 3.0.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var baseFor = __webpack_require__(103), + bindCallback = __webpack_require__(104), + keys = __webpack_require__(105); + + /** + * The base implementation of `_.forOwn` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return baseFor(object, iteratee, keys); + } + + /** + * Creates a function for `_.forOwn` or `_.forOwnRight`. + * + * @private + * @param {Function} objectFunc The function to iterate over an object. + * @returns {Function} Returns the new each function. + */ + function createForOwn(objectFunc) { + return function(object, iteratee, thisArg) { + if (typeof iteratee != 'function' || thisArg !== undefined) { + iteratee = bindCallback(iteratee, thisArg, 3); + } + return objectFunc(object, iteratee); + }; + } + + /** + * Iterates over own enumerable properties of an object invoking `iteratee` + * for each property. The `iteratee` is bound to `thisArg` and invoked with + * three arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => logs 'a' and 'b' (iteration order is not guaranteed) + */ + var forOwn = createForOwn(baseForOwn); + + module.exports = forOwn; + + +/***/ }, +/* 103 */ +/***/ function(module, exports) { + + /** + * lodash 3.0.3 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** + * The base implementation of `baseForIn` and `baseForOwn` which iterates + * over `object` properties returned by `keysFunc` invoking `iteratee` for + * each property. Iteratee functions may exit iteration early by explicitly + * returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * Creates a base function for methods like `_.forIn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + module.exports = baseFor; + + +/***/ }, +/* 104 */ +/***/ function(module, exports) { + + /** + * lodash 3.0.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** + * A specialized version of `baseCallback` which only supports `this` binding + * and specifying the number of arguments to provide to `func`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ + function bindCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + if (thisArg === undefined) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + case 5: return function(value, other, key, object, source) { + return func.call(thisArg, value, other, key, object, source); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; + } + + /** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ + function identity(value) { + return value; + } + + module.exports = bindCallback; + + +/***/ }, +/* 105 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 3.1.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var getNative = __webpack_require__(106), + isArguments = __webpack_require__(107), + isArray = __webpack_require__(108); + + /** Used to detect unsigned integer values. */ + var reIsUint = /^\d+$/; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeKeys = getNative(Object, 'keys'); + + /** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * A fallback implementation of `Object.keys` which creates an array of the + * own enumerable property names of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function shimKeys(object) { + var props = keysIn(object), + propsLength = props.length, + length = propsLength && object.length; + + var allowIndexes = !!length && isLength(length) && + (isArray(object) || isArguments(object)); + + var index = -1, + result = []; + + while (++index < propsLength) { + var key = props[index]; + if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { + result.push(key); + } + } + return result; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + var keys = !nativeKeys ? shimKeys : function(object) { + var Ctor = object == null ? undefined : object.constructor; + if ((typeof Ctor == 'function' && Ctor.prototype === object) || + (typeof object != 'function' && isArrayLike(object))) { + return shimKeys(object); + } + return isObject(object) ? nativeKeys(object) : []; + }; + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + if (object == null) { + return []; + } + if (!isObject(object)) { + object = Object(object); + } + var length = object.length; + length = (length && isLength(length) && + (isArray(object) || isArguments(object)) && length) || 0; + + var Ctor = object.constructor, + index = -1, + isProto = typeof Ctor == 'function' && Ctor.prototype === object, + result = Array(length), + skipIndexes = length > 0; + + while (++index < length) { + result[index] = (index + ''); + } + for (var key in object) { + if (!(skipIndexes && isIndex(key, length)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + module.exports = keys; + + +/***/ }, +/* 106 */ +/***/ function(module, exports) { + + /** + * lodash 3.9.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** `Object#toString` result references. */ + var funcTag = '[object Function]'; + + /** Used to detect host constructors (Safari > 5). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var fnToString = Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); + } + + module.exports = getNative; + + +/***/ }, +/* 107 */ +/***/ function(module, exports) { + + /** + * lodash 3.0.8 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + } + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + module.exports = isArguments; + + +/***/ }, +/* 108 */ +/***/ function(module, exports) { + + /** + * lodash 3.0.4 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** `Object#toString` result references. */ + var arrayTag = '[object Array]', + funcTag = '[object Function]'; + + /** Used to detect host constructors (Safari > 5). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var fnToString = Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeIsArray = getNative(Array, 'isArray'); + + /** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */ + var isArray = nativeIsArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; + }; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); + } + + module.exports = isArray; + + +/***/ }, +/* 109 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 3.2.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var root = __webpack_require__(110); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; + + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + + /** Used to match HTML entities and HTML characters. */ + var reUnescapedHtml = /[&<>"'`]/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(chr) { + return htmlEscapes[chr]; + } + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Built-in value references. */ + var Symbol = root.Symbol; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = Symbol ? symbolProto.toString : undefined; + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); + } + + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to + * their corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. + * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in IE < 9, they can break out of + * attribute values or HTML comments. See [#59](https://html5sec.org/#59), + * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and + * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) + * for more details. + * + * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) + * to reduce XSS vectors. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + module.exports = escape; + + +/***/ }, +/* 110 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(module, global) {/** + * lodash 3.0.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** Used to determine if values are of the language type `Object`. */ + var objectTypes = { + 'function': true, + 'object': true + }; + + /** Detect free variable `exports`. */ + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + + /** Detect free variable `module`. */ + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + + /** Detect free variable `self`. */ + var freeSelf = checkGlobal(objectTypes[typeof self] && self); + + /** Detect free variable `window`. */ + var freeWindow = checkGlobal(objectTypes[typeof window] && window); + + /** Detect `this` as the global object. */ + var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + + /** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ + var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + + /** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ + function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; + } + + module.exports = root; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(111)(module), (function() { return this; }()))) + +/***/ }, +/* 111 */ +/***/ function(module, exports) { + + module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + module.children = []; + module.webpackPolyfill = 1; + } + return module; + } + + +/***/ }, +/* 112 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 3.1.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.2 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var baseFlatten = __webpack_require__(113), + baseUniq = __webpack_require__(116), + restParam = __webpack_require__(121); + + /** + * Creates an array of unique values, in order, of the provided arrays using + * `SameValueZero` for equality comparisons. + * + * **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) + * comparisons are like strict equality comparisons, e.g. `===`, except that + * `NaN` matches `NaN`. + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([1, 2], [4, 2], [2, 1]); + * // => [1, 2, 4] + */ + var union = restParam(function(arrays) { + return baseUniq(baseFlatten(arrays, false, true)); + }); + + module.exports = union; + + +/***/ }, +/* 113 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 3.1.4 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var isArguments = __webpack_require__(114), + isArray = __webpack_require__(115); + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * The base implementation of `_.flatten` with added support for restricting + * flattening and specifying the start index. + * + * @private + * @param {Array} array The array to flatten. + * @param {boolean} [isDeep] Specify a deep flatten. + * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, isDeep, isStrict, result) { + result || (result = []); + + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index]; + if (isObjectLike(value) && isArrayLike(value) && + (isStrict || isArray(value) || isArguments(value))) { + if (isDeep) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, isDeep, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + module.exports = baseFlatten; + + +/***/ }, +/* 114 */ +/***/ function(module, exports) { + + /** + * lodash 3.0.8 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + } + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + module.exports = isArguments; + + +/***/ }, +/* 115 */ +/***/ function(module, exports) { + + /** + * lodash 3.0.4 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** `Object#toString` result references. */ + var arrayTag = '[object Array]', + funcTag = '[object Function]'; + + /** Used to detect host constructors (Safari > 5). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var fnToString = Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeIsArray = getNative(Array, 'isArray'); + + /** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */ + var isArray = nativeIsArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; + }; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); + } + + module.exports = isArray; + + +/***/ }, +/* 116 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 3.0.3 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var baseIndexOf = __webpack_require__(117), + cacheIndexOf = __webpack_require__(118), + createCache = __webpack_require__(119); + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** + * The base implementation of `_.uniq` without support for callback shorthands + * and `this` binding. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The function invoked per iteration. + * @returns {Array} Returns the new duplicate-value-free array. + */ + function baseUniq(array, iteratee) { + var index = -1, + indexOf = baseIndexOf, + length = array.length, + isCommon = true, + isLarge = isCommon && length >= LARGE_ARRAY_SIZE, + seen = isLarge ? createCache() : null, + result = []; + + if (seen) { + indexOf = cacheIndexOf; + isCommon = false; + } else { + isLarge = false; + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value, index, array) : value; + + if (isCommon && value === value) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (indexOf(seen, computed, 0) < 0) { + if (iteratee || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + module.exports = baseUniq; + + +/***/ }, +/* 117 */ +/***/ function(module, exports) { + + /** + * lodash 3.1.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.2 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** + * The base implementation of `_.indexOf` without support for binary searches. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return indexOfNaN(array, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Gets the index at which the first occurrence of `NaN` is found in `array`. + * If `fromRight` is provided elements of `array` are iterated from right to left. + * + * @private + * @param {Array} array The array to search. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched `NaN`, else `-1`. + */ + function indexOfNaN(array, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 0 : -1); + + while ((fromRight ? index-- : ++index < length)) { + var other = array[index]; + if (other !== other) { + return index; + } + } + return -1; + } + + module.exports = baseIndexOf; + + +/***/ }, +/* 118 */ +/***/ function(module, exports) { + + /** + * lodash 3.0.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** + * Checks if `value` is in `cache` mimicking the return signature of + * `_.indexOf` by returning `0` if the value is found, else `-1`. + * + * @private + * @param {Object} cache The cache to search. + * @param {*} value The value to search for. + * @returns {number} Returns `0` if `value` is found, else `-1`. + */ + function cacheIndexOf(cache, value) { + var data = cache.data, + result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; + + return result ? 0 : -1; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + module.exports = cacheIndexOf; + + +/***/ }, +/* 119 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {/** + * lodash 3.1.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var getNative = __webpack_require__(120); + + /** Native method references. */ + var Set = getNative(global, 'Set'); + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeCreate = getNative(Object, 'create'); + + /** + * + * Creates a cache object to store unique values. + * + * @private + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var length = values ? values.length : 0; + + this.data = { 'hash': nativeCreate(null), 'set': new Set }; + while (length--) { + this.push(values[length]); + } + } + + /** + * Adds `value` to the cache. + * + * @private + * @name push + * @memberOf SetCache + * @param {*} value The value to cache. + */ + function cachePush(value) { + var data = this.data; + if (typeof value == 'string' || isObject(value)) { + data.set.add(value); + } else { + data.hash[value] = true; + } + } + + /** + * Creates a `Set` cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [values] The values to cache. + * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. + */ + function createCache(values) { + return (nativeCreate && Set) ? new SetCache(values) : null; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + // Add functions to the `Set` cache. + SetCache.prototype.push = cachePush; + + module.exports = createCache; + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 120 */ +/***/ function(module, exports) { + + /** + * lodash 3.9.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** `Object#toString` result references. */ + var funcTag = '[object Function]'; + + /** Used to detect host constructors (Safari > 5). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var fnToString = Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); + } + + module.exports = getNative; + + +/***/ }, +/* 121 */ +/***/ function(module, exports) { + + /** + * lodash 3.6.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as an array. + * + * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.restParam(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function restParam(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + rest = Array(length); + + while (++index < length) { + rest[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, rest); + case 1: return func.call(this, args[0], rest); + case 2: return func.call(this, args[0], args[1], rest); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = rest; + return func.apply(this, otherArgs); + }; + } + + module.exports = restParam; + + +/***/ }, +/* 122 */ +/***/ function(module, exports, __webpack_require__) { + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var forOwn = __webpack_require__(102); + var escape = __webpack_require__(109); + var kebabCase = __webpack_require__(123); + + // data.style + + module.exports = function style(vnode) { + var styles = []; + var style = vnode.data.style || {}; + + // merge in `delayed` properties + if (style.delayed) { + _extends(style, style.delayed); + } + + forOwn(style, function (value, key) { + // omit hook objects + if (typeof value === 'string') { + styles.push(kebabCase(key) + ': ' + escape(value)); + } + }); + + return styles.length ? 'style="' + styles.join('; ') + '"' : ''; + }; + +/***/ }, +/* 123 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 3.1.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var deburr = __webpack_require__(124), + words = __webpack_require__(126); + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string)), callback, ''); + }; + } + + /** + * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__foo_bar__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + module.exports = kebabCase; + + +/***/ }, +/* 124 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 3.2.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var root = __webpack_require__(125); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; + + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + + /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ + var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; + + /** Used to compose unicode character classes. */ + var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0'; + + /** Used to compose unicode capture groups. */ + var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to map latin-1 supplementary letters to basic latin letters. */ + var deburredLetters = { + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss' + }; + + /** + * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + function deburrLetter(letter) { + return deburredLetters[letter]; + } + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Built-in value references. */ + var Symbol = root.Symbol; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = Symbol ? symbolProto.toString : undefined; + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); + } + + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); + } + + module.exports = deburr; + + +/***/ }, +/* 125 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(module, global) {/** + * lodash 3.0.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** Used to determine if values are of the language type `Object`. */ + var objectTypes = { + 'function': true, + 'object': true + }; + + /** Detect free variable `exports`. */ + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + + /** Detect free variable `module`. */ + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + + /** Detect free variable `self`. */ + var freeSelf = checkGlobal(objectTypes[typeof self] && self); + + /** Detect free variable `window`. */ + var freeWindow = checkGlobal(objectTypes[typeof window] && window); + + /** Detect `this` as the global object. */ + var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + + /** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ + var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + + /** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ + function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; + } + + module.exports = root; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(111)(module), (function() { return this; }()))) + +/***/ }, +/* 126 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 3.2.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var root = __webpack_require__(127); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; + + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsQuoteRange = '\\u2018\\u2019\\u201c\\u201d', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsQuoteRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', + rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; + + /** Used to match non-compound words composed of alphanumeric characters. */ + var reBasicWord = /[a-zA-Z0-9]+/g; + + /** Used to match complex or compound words. */ + var reComplexWord = RegExp([ + rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', + rsUpper + '?' + rsLowerMisc + '+', + rsUpper + '+', + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasComplexWord = /[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Built-in value references. */ + var Symbol = root.Symbol; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = Symbol ? symbolProto.toString : undefined; + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); + } + + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Splits `string` into an array of its words. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to inspect. + * @param {RegExp|string} [pattern] The pattern to match words. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @returns {Array} Returns the words of `string`. + * @example + * + * _.words('fred, barney, & pebbles'); + * // => ['fred', 'barney', 'pebbles'] + * + * _.words('fred, barney, & pebbles', /[^, ]+/g); + * // => ['fred', 'barney', '&', 'pebbles'] + */ + function words(string, pattern, guard) { + string = toString(string); + pattern = guard ? undefined : pattern; + + if (pattern === undefined) { + pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord; + } + return string.match(pattern) || []; + } + + module.exports = words; + + +/***/ }, +/* 127 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(module, global) {/** + * lodash 3.0.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** Used to determine if values are of the language type `Object`. */ + var objectTypes = { + 'function': true, + 'object': true + }; + + /** Detect free variable `exports`. */ + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + + /** Detect free variable `module`. */ + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + + /** Detect free variable `self`. */ + var freeSelf = checkGlobal(objectTypes[typeof self] && self); + + /** Detect free variable `window`. */ + var freeWindow = checkGlobal(objectTypes[typeof window] && window); + + /** Detect `this` as the global object. */ + var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + + /** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ + var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + + /** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ + function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; + } + + module.exports = root; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(111)(module), (function() { return this; }()))) + +/***/ }, +/* 128 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_adapter_1 = __webpack_require__(18); + var xstream_1 = __webpack_require__(5); + var MockedDOMSource = (function () { + function MockedDOMSource(_streamAdapter, _mockConfig) { + this._streamAdapter = _streamAdapter; + this._mockConfig = _mockConfig; + if (_mockConfig.elements) { + this._elements = _mockConfig.elements; + } + else { + this._elements = _streamAdapter.adapt(xstream_1.default.empty(), xstream_adapter_1.default.streamSubscribe); + } + } + MockedDOMSource.prototype.elements = function () { + return this._elements; + }; + MockedDOMSource.prototype.events = function (eventType, options) { + var mockConfig = this._mockConfig; + var keys = Object.keys(mockConfig); + var keysLen = keys.length; + for (var i = 0; i < keysLen; i++) { + var key = keys[i]; + if (key === eventType) { + return mockConfig[key]; + } + } + return this._streamAdapter.adapt(xstream_1.default.empty(), xstream_adapter_1.default.streamSubscribe); + }; + MockedDOMSource.prototype.select = function (selector) { + var mockConfig = this._mockConfig; + var keys = Object.keys(mockConfig); + var keysLen = keys.length; + for (var i = 0; i < keysLen; i++) { + var key = keys[i]; + if (key === selector) { + return new MockedDOMSource(this._streamAdapter, mockConfig[key]); + } + } + return new MockedDOMSource(this._streamAdapter, {}); + }; + return MockedDOMSource; + }()); + exports.MockedDOMSource = MockedDOMSource; + function mockDOMSource(streamAdapter, mockConfig) { + return new MockedDOMSource(streamAdapter, mockConfig); + } + exports.mockDOMSource = mockDOMSource; + //# sourceMappingURL=mockDOMSource.js.map + +/***/ }, +/* 129 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var hyperscript_1 = __webpack_require__(27); + function isValidString(param) { + return typeof param === 'string' && param.length > 0; + } + function isSelector(param) { + return isValidString(param) && (param[0] === '.' || param[0] === '#'); + } + function createTagFunction(tagName) { + return function hyperscript(first, b, c) { + if (isSelector(first)) { + if (typeof b !== 'undefined' && typeof c !== 'undefined') { + return hyperscript_1.h(tagName + first, b, c); + } + else if (typeof b !== 'undefined') { + return hyperscript_1.h(tagName + first, b); + } + else { + return hyperscript_1.h(tagName + first, {}); + } + } + else if (!!b) { + return hyperscript_1.h(tagName, first, b); + } + else if (!!first) { + return hyperscript_1.h(tagName, first); + } + else { + return hyperscript_1.h(tagName, {}); + } + }; + } + var SVG_TAG_NAMES = [ + 'a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', + 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'colorProfile', + 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', + 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', + 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', + 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', + 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', + 'feSpotlight', 'feTile', 'feTurbulence', 'filter', 'font', 'fontFace', + 'fontFaceFormat', 'fontFaceName', 'fontFaceSrc', 'fontFaceUri', + 'foreignObject', 'g', 'glyph', 'glyphRef', 'hkern', 'image', 'line', + 'linearGradient', 'marker', 'mask', 'metadata', 'missingGlyph', 'mpath', + 'path', 'pattern', 'polygon', 'polyling', 'radialGradient', 'rect', 'script', + 'set', 'stop', 'style', 'switch', 'symbol', 'text', 'textPath', 'title', + 'tref', 'tspan', 'use', 'view', 'vkern' + ]; + var svg = createTagFunction('svg'); + SVG_TAG_NAMES.forEach(function (tag) { + svg[tag] = createTagFunction(tag); + }); + var TAG_NAMES = [ + 'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', + 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', + 'cite', 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', + 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', + 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', + 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', + 'li', 'link', 'main', 'map', 'mark', 'menu', 'meta', 'nav', 'noscript', + 'object', 'ol', 'optgroup', 'option', 'p', 'param', 'pre', 'progress', 'q', + 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', + 'source', 'span', 'strong', 'style', 'sub', 'sup', 'table', 'tbody', 'td', + 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'u', 'ul', 'video' + ]; + var exported = { SVG_TAG_NAMES: SVG_TAG_NAMES, TAG_NAMES: TAG_NAMES, svg: svg, isSelector: isSelector, createTagFunction: createTagFunction }; + TAG_NAMES.forEach(function (n) { + exported[n] = createTagFunction(n); + }); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = exported; + //# sourceMappingURL=hyperscript-helpers.js.map + +/***/ }, +/* 130 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_1 = __webpack_require__(5); + var dropRepeats_1 = __webpack_require__(131); + var flattenConcurrently_1 = __webpack_require__(132); + var xs = xstream_1.Stream; + function canJediBeAdded(jedi, jedis) { + var first = jedis[0]; + var last = jedis[4]; + var isMasterOfFirst = first !== null && first.master.id === jedi.id; + var isApprenticeOfLast = last !== null && last.apprentice.id === jedi.id; + var loadedIds = jedis + .filter(Boolean) + .map(function (jedi) { return jedi.id; }); + var alreadyLoaded = loadedIds.indexOf(jedi.id) !== -1; + return !alreadyLoaded && !isMasterOfFirst && !isApprenticeOfLast; + } + function neighborsToLoad(state) { + var jedi$ = xs.fromArray(state.jedis); + var matched = state.matchedId !== -1; + var neighbors$ = jedi$ + .filter(Boolean) + .map(function (jedi) { return xs.of(jedi.master, jedi.apprentice); }) + .compose(flattenConcurrently_1.default) + .filter(function (jedi) { + return Boolean(jedi.id) + && canJediBeAdded(jedi, state.jedis) + && !matched; + }); + return neighbors$; + } + function hash(state) { + var jedis = state.jedis + .map(function (jedi) { return !!jedi ? jedi.id : '*'; }) + .join('-'); + return jedis + '|' + state.matchedId; + } + var distinctStates = dropRepeats_1.default(function (prev, next) { return hash(prev) === hash(next); }); + var distinctIds = dropRepeats_1.default(function (prev, next) { return prev === next; }); + function requests(state$) { + var distinctState$ = state$.compose(distinctStates); + var request$ = xs.merge(distinctState$ + .map(neighborsToLoad) + .compose(flattenConcurrently_1.default) + .map(function (jedi) { return jedi.id; }), distinctState$ + .filter(function (state) { return state.matchedId !== -1; }) + .mapTo(-1)).compose(distinctIds) + .startWith(3616); + return request$; + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = requests; + + +/***/ }, +/* 131 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var core_1 = __webpack_require__(6); + var empty = {}; + var DropRepeatsOperator = (function () { + function DropRepeatsOperator(fn, ins) { + this.fn = fn; + this.ins = ins; + this.type = 'dropRepeats'; + this.out = null; + this.v = empty; + } + DropRepeatsOperator.prototype._start = function (out) { + this.out = out; + this.ins._add(this); + }; + DropRepeatsOperator.prototype._stop = function () { + this.ins._remove(this); + this.out = null; + this.v = empty; + }; + DropRepeatsOperator.prototype.isEq = function (x, y) { + return this.fn ? this.fn(x, y) : x === y; + }; + DropRepeatsOperator.prototype._n = function (t) { + var u = this.out; + if (!u) + return; + var v = this.v; + if (v === empty || !this.isEq(t, v)) { + u._n(t); + } + this.v = t; + }; + DropRepeatsOperator.prototype._e = function (err) { + var u = this.out; + if (!u) + return; + u._e(err); + }; + DropRepeatsOperator.prototype._c = function () { + var u = this.out; + if (!u) + return; + u._c(); + }; + return DropRepeatsOperator; + }()); + exports.DropRepeatsOperator = DropRepeatsOperator; + /** + * Drops consecutive duplicate values in a stream. + * + * Marble diagram: + * + * ```text + * --1--2--1--1--1--2--3--4--3--3| + * dropRepeats + * --1--2--1--------2--3--4--3---| + * ``` + * + * Example: + * + * ```js + * import dropRepeats from 'xstream/extra/dropRepeats' + * + * const stream = xs.of(1, 2, 1, 1, 1, 2, 3, 4, 3, 3) + * .compose(dropRepeats()) + * + * stream.addListener({ + * next: i => console.log(i), + * error: err => console.error(err), + * complete: () => console.log('completed') + * }) + * ``` + * + * ```text + * > 1 + * > 2 + * > 1 + * > 2 + * > 3 + * > 4 + * > 3 + * > completed + * ``` + * + * Example with a custom isEqual function: + * + * ```js + * import dropRepeats from 'xstream/extra/dropRepeats' + * + * const stream = xs.of('a', 'b', 'a', 'A', 'B', 'b') + * .compose(dropRepeats((x, y) => x.toLowerCase() === y.toLowerCase())) + * + * stream.addListener({ + * next: i => console.log(i), + * error: err => console.error(err), + * complete: () => console.log('completed') + * }) + * ``` + * + * ```text + * > a + * > b + * > a + * > B + * > completed + * ``` + * + * @param {Function} isEqual An optional function of type + * `(x: T, y: T) => boolean` that takes an event from the input stream and + * checks if it is equal to previous event, by returning a boolean. + * @return {Stream} + */ + function dropRepeats(isEqual) { + if (isEqual === void 0) { isEqual = null; } + return function dropRepeatsOperator(ins) { + return new core_1.Stream(new DropRepeatsOperator(isEqual, ins)); + }; + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = dropRepeats; + //# sourceMappingURL=dropRepeats.js.map + +/***/ }, +/* 132 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var core_1 = __webpack_require__(6); + var FCIL = (function () { + function FCIL(out, op) { + this.out = out; + this.op = op; + } + FCIL.prototype._n = function (t) { + this.out._n(t); + }; + FCIL.prototype._e = function (err) { + this.out._e(err); + }; + FCIL.prototype._c = function () { + this.op.less(); + }; + return FCIL; + }()); + var FlattenConcOperator = (function () { + function FlattenConcOperator(ins) { + this.ins = ins; + this.type = 'flattenConcurrently'; + this.active = 1; // number of outers and inners that have not yet ended + this.out = null; + } + FlattenConcOperator.prototype._start = function (out) { + this.out = out; + this.ins._add(this); + }; + FlattenConcOperator.prototype._stop = function () { + this.ins._remove(this); + this.active = 1; + this.out = null; + }; + FlattenConcOperator.prototype.less = function () { + if (--this.active === 0) { + var u = this.out; + if (!u) + return; + u._c(); + } + }; + FlattenConcOperator.prototype._n = function (s) { + var u = this.out; + if (!u) + return; + this.active++; + s._add(new FCIL(u, this)); + }; + FlattenConcOperator.prototype._e = function (err) { + var u = this.out; + if (!u) + return; + u._e(err); + }; + FlattenConcOperator.prototype._c = function () { + this.less(); + }; + return FlattenConcOperator; + }()); + exports.FlattenConcOperator = FlattenConcOperator; + /** + * Flattens a "stream of streams", handling multiple concurrent nested streams + * simultaneously. + * + * If the input stream is a stream that emits streams, then this operator will + * return an output stream which is a flat stream: emits regular events. The + * flattening happens concurrently. It works like this: when the input stream + * emits a nested stream, *flattenConcurrently* will start imitating that + * nested one. When the next nested stream is emitted on the input stream, + * *flattenConcurrently* will also imitate that new one, but will continue to + * imitate the previous nested streams as well. + * + * Marble diagram: + * + * ```text + * --+--------+--------------- + * \ \ + * \ ----1----2---3-- + * --a--b----c----d-------- + * flattenConcurrently + * -----a--b----c-1--d-2---3-- + * ``` + * + * @return {Stream} + */ + function flattenConcurrently(ins) { + return new core_1.Stream(new FlattenConcOperator(ins)); + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = flattenConcurrently; + //# sourceMappingURL=flattenConcurrently.js.map + +/***/ }, +/* 133 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var base_1 = __webpack_require__(134); + var xstream_adapter_1 = __webpack_require__(135); + /** + * Takes a `main` function and circularly connects it to the given collection + * of driver functions. + * + * **Example:** + * ```js + * import {run} from '@cycle/xstream-run'; + * const dispose = run(main, drivers); + * // ... + * dispose(); + * ``` + * + * The `main` function expects a collection of "source" streams (returned from + * drivers) as input, and should return a collection of "sink" streams (to be + * given to drivers). A "collection of streams" is a JavaScript object where + * keys match the driver names registered by the `drivers` object, and values + * are the streams. Refer to the documentation of each driver to see more + * details on what types of sources it outputs and sinks it receives. + * + * @param {Function} main a function that takes `sources` as input and outputs + * `sinks`. + * @param {Object} drivers an object where keys are driver names and values + * are driver functions. + * @return {Function} a dispose function, used to terminate the execution of the + * Cycle.js program, cleaning up resources used. + * @function run + */ + function run(main, drivers) { + var run = base_1.default(main, drivers, { streamAdapter: xstream_adapter_1.default }).run; + return run(); + } + exports.run = run; + /** + * A function that prepares the Cycle application to be executed. Takes a `main` + * function and prepares to circularly connects it to the given collection of + * driver functions. As an output, `Cycle()` returns an object with three + * properties: `sources`, `sinks` and `run`. Only when `run()` is called will + * the application actually execute. Refer to the documentation of `run()` for + * more details. + * + * **Example:** + * ```js + * import Cycle from '@cycle/xstream-run'; + * const {sources, sinks, run} = Cycle(main, drivers); + * // ... + * const dispose = run(); // Executes the application + * // ... + * dispose(); + * ``` + * + * @param {Function} main a function that takes `sources` as input and outputs + * `sinks`. + * @param {Object} drivers an object where keys are driver names and values + * are driver functions. + * @return {Object} an object with three properties: `sources`, `sinks` and + * `run`. `sources` is the collection of driver sources, `sinks` is the + * collection of driver sinks, these can be used for debugging or testing. `run` + * is the function that once called will execute the application. + * @function Cycle + */ + var Cycle = function (main, drivers) { + return base_1.default(main, drivers, { streamAdapter: xstream_adapter_1.default }); + }; + Cycle.run = run; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Cycle; + //# sourceMappingURL=index.js.map + +/***/ }, +/* 134 */ +/***/ function(module, exports) { + + "use strict"; + function logToConsoleError(err) { + var target = err.stack || err; + if (console && console.error) { + console.error(target); + } + else if (console && console.log) { + console.log(target); + } + } + function makeSinkProxies(drivers, streamAdapter) { + var sinkProxies = {}; + for (var name_1 in drivers) { + if (drivers.hasOwnProperty(name_1)) { + var holdSubject = streamAdapter.makeSubject(); + var driverStreamAdapter = drivers[name_1].streamAdapter || streamAdapter; + var stream = driverStreamAdapter.adapt(holdSubject.stream, streamAdapter.streamSubscribe); + sinkProxies[name_1] = { + stream: stream, + observer: holdSubject.observer, + }; + } + } + return sinkProxies; + } + function callDrivers(drivers, sinkProxies, streamAdapter) { + var sources = {}; + for (var name_2 in drivers) { + if (drivers.hasOwnProperty(name_2)) { + var driverOutput = drivers[name_2](sinkProxies[name_2].stream, streamAdapter, name_2); + var driverStreamAdapter = drivers[name_2].streamAdapter; + if (driverStreamAdapter && driverStreamAdapter.isValidStream(driverOutput)) { + sources[name_2] = streamAdapter.adapt(driverOutput, driverStreamAdapter.streamSubscribe); + } + else { + sources[name_2] = driverOutput; + } + } + } + return sources; + } + function replicateMany(sinks, sinkProxies, streamAdapter) { + var results = Object.keys(sinks) + .filter(function (name) { return !!sinkProxies[name]; }) + .map(function (name) { + return streamAdapter.streamSubscribe(sinks[name], { + next: function (x) { sinkProxies[name].observer.next(x); }, + error: function (err) { + logToConsoleError(err); + sinkProxies[name].observer.error(err); + }, + complete: function (x) { + sinkProxies[name].observer.complete(x); + } + }); + }); + var disposeFunctions = results + .filter(function (dispose) { return typeof dispose === 'function'; }); + return function () { + disposeFunctions.forEach(function (dispose) { return dispose(); }); + }; + } + function disposeSources(sources) { + for (var k in sources) { + if (sources.hasOwnProperty(k) && sources[k] + && typeof sources[k].dispose === 'function') { + sources[k].dispose(); + } + } + } + var isObjectEmpty = function (obj) { return Object.keys(obj).length === 0; }; + function Cycle(main, drivers, options) { + if (typeof main !== "function") { + throw new Error("First argument given to Cycle must be the 'main' " + + "function."); + } + if (typeof drivers !== "object" || drivers === null) { + throw new Error("Second argument given to Cycle must be an object " + + "with driver functions as properties."); + } + if (isObjectEmpty(drivers)) { + throw new Error("Second argument given to Cycle must be an object " + + "with at least one driver function declared as a property."); + } + var streamAdapter = options.streamAdapter; + if (!streamAdapter || isObjectEmpty(streamAdapter)) { + throw new Error("Third argument given to Cycle must be an options object " + + "with the streamAdapter key supplied with a valid stream adapter."); + } + var sinkProxies = makeSinkProxies(drivers, streamAdapter); + var sources = callDrivers(drivers, sinkProxies, streamAdapter); + var sinks = main(sources); + if (typeof window !== 'undefined') { + window.Cyclejs = { sinks: sinks }; + } + var run = function () { + var disposeReplication = replicateMany(sinks, sinkProxies, streamAdapter); + return function () { + disposeSources(sources); + disposeReplication(); + }; + }; + return { sinks: sinks, sources: sources, run: run }; + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Cycle; + //# sourceMappingURL=index.js.map + +/***/ }, +/* 135 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_1 = __webpack_require__(5); + var XStreamAdapter = { + adapt: function (originStream, originStreamSubscribe) { + if (XStreamAdapter.isValidStream(originStream)) { + return originStream; + } + ; + var dispose = null; + return xstream_1.default.create({ + start: function (out) { + var observer = out; + dispose = originStreamSubscribe(originStream, observer); + }, + stop: function () { + if (typeof dispose === 'function') { + dispose(); + } + } + }); + }, + makeSubject: function () { + var stream = xstream_1.default.create(); + var observer = { + next: function (x) { stream.shamefullySendNext(x); }, + error: function (err) { stream.shamefullySendError(err); }, + complete: function () { stream.shamefullySendComplete(); } + }; + return { observer: observer, stream: stream }; + }, + remember: function (stream) { + return stream.remember(); + }, + isValidStream: function (stream) { + return (typeof stream.addListener === 'function' && + typeof stream.shamefullySendNext === 'function'); + }, + streamSubscribe: function (stream, observer) { + stream.addListener(observer); + return function () { return stream.removeListener(observer); }; + } + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = XStreamAdapter; + //# sourceMappingURL=index.js.map + +/***/ }, +/* 136 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_1 = __webpack_require__(5); + var PlanetsSource = (function () { + function PlanetsSource() { + var xs = xstream_1.Stream; + var producer = { + start: function (listener) { + this.connection = new WebSocket('ws://localhost:4000'); + this.connection.onmessage = + function (msg) { + return listener.next(JSON.parse(msg.data)); + }; + this.connection.onerror = + function (err) { return listener.error(err); }; + }, + stop: function () { + this.connection.close(); + } + }; + this.planet$ = xs.create(producer); + } + return PlanetsSource; + }()); + exports.PlanetsSource = PlanetsSource; + function makePlanetsDriver() { + function planetsDriver() { + return new PlanetsSource(); + } + return planetsDriver; + } + exports.makePlanetsDriver = makePlanetsDriver; + + +/***/ }, +/* 137 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_1 = __webpack_require__(5); + var http_1 = __webpack_require__(138); + var xstream_adapter_1 = __webpack_require__(142); + var JEDI_URL = 'http://localhost:3000/dark-jedis/'; + var JedisSource = (function () { + function JedisSource(jediRequest$) { + var xs = xstream_1.Stream; + var id$ = jediRequest$.filter(function (req) { return req !== -1; }); + var cancel$ = jediRequest$.filter(function (req) { return req === -1; }).mapTo(true); + var request$ = id$ + .map(function (id) { + var requestOptions = { + url: JEDI_URL + id, + category: 'jedis', + lazy: true + }; + return requestOptions; + }); + var http = http_1.makeHTTPDriver()(request$, xstream_adapter_1.default); + var cancel$$ = cancel$.mapTo(xs.of(null)); + var response$$ = http.select('jedis'); + this.jedi$ = + xs + .merge(response$$, cancel$$) + .flatten() + .filter(Boolean) + .map(function (response) { return JSON.parse(response.text); }) + .remember(); + } + return JedisSource; + }()); + exports.JedisSource = JedisSource; + function makeJedisDriver() { + function jedisDriver(jediRequest$) { + return new JedisSource(jediRequest$); + } + return jedisDriver; + } + exports.makeJedisDriver = makeJedisDriver; + + +/***/ }, +/* 138 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + /** + * HTTP Driver factory. + * + * This is a function which, when called, returns a HTTP Driver for Cycle.js + * apps. The driver is also a function, and it takes a stream of requests as + * input, and outputs an HTTP Source, an object with some functions to query for + * response streams. + * + * **Requests**. The stream of requests should emit either strings or objects. + * If the stream emits strings, those should be the URL of the remote resource + * over HTTP. If the stream emits objects, these should be instructions how + * superagent should execute the request. These objects follow a structure + * similar to superagent's request API itself. `request` object properties: + * + * - `url` *(String)*: the remote resource path. **required** + * - `method` *(String)*: HTTP Method for the request (GET, POST, PUT, etc). + * - `category` *(String)*: an optional and arbitrary key that may be used in + * the HTTP Source when querying for the response. E.g. + * `sources.http.select(category)` + * - `query` *(Object)*: an object with the payload for `GET` or `POST`. + * - `send` *(Object)*: an object with the payload for `POST`. + * - `headers` *(Object)*: object specifying HTTP headers. + * - `accept` *(String)*: the Accept header. + * - `type` *(String)*: a short-hand for setting Content-Type. + * - `user` *(String)*: username for authentication. + * - `password` *(String)*: password for authentication. + * - `field` *(Object)*: object where key/values are Form fields. + * - `progress` *(Boolean)*: whether or not to detect and emit progress events + * on the response Observable. + * - `attach` *(Array)*: array of objects, where each object specifies `name`, + * `path`, and `filename` of a resource to upload. + * - `withCredentials` *(Boolean)*: enables the ability to send cookies from the + * origin. + * - `redirects` *(Number)*: number of redirects to follow. + * - `lazy` *(Boolean)*: whether or not this request runs lazily, which means + * the request happens if and only if its corresponding response stream from the + * HTTP Source is subscribed to. By default this value is false: requests run + * eagerly, even if their response is ignored by the application. + * + * **Responses**. A metastream is a stream that emits streams. The HTTP Source + * manages response metastreams. These streams of responses have a `request` + * field attached to them (to the stream object itself) indicating which request + * (from the driver input) generated this response streams. The HTTP Source has + * functions `filter()` and `select()`, but is not itself a stream. So you can + * call `sources.HTTP.filter(request => request.url === X)` to get a new HTTP + * Source object which is filtered for response streams that match the condition + * given, and may call `sources.HTTP.select(category)` to get a metastream of + * response that match the category key. With an HTTP Source, you can also call + * `httpSource.select()` with no param to get the metastream. You should flatten + * the metastream before consuming it, then the resulting response stream will + * emit the response object received through superagent. + * + * @return {Function} the HTTP Driver function + * @function makeHTTPDriver + */ + var http_driver_1 = __webpack_require__(139); + exports.makeHTTPDriver = http_driver_1.makeHTTPDriver; + //# sourceMappingURL=index.js.map + +/***/ }, +/* 139 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_1 = __webpack_require__(5); + var MainHTTPSource_1 = __webpack_require__(140); + var xstream_adapter_1 = __webpack_require__(142); + var superagent = __webpack_require__(143); + function preprocessReqOptions(reqOptions) { + reqOptions.withCredentials = reqOptions.withCredentials || false; + reqOptions.redirects = typeof reqOptions.redirects === 'number' ? reqOptions.redirects : 5; + reqOptions.method = reqOptions.method || "get"; + return reqOptions; + } + function optionsToSuperagent(rawReqOptions) { + var reqOptions = preprocessReqOptions(rawReqOptions); + if (typeof reqOptions.url !== "string") { + throw new Error("Please provide a `url` property in the request options."); + } + var lowerCaseMethod = reqOptions.method.toLowerCase(); + var sanitizedMethod = lowerCaseMethod === "delete" ? "del" : lowerCaseMethod; + var request = superagent[sanitizedMethod](reqOptions.url); + if (typeof request.redirects === "function") { + request = request.redirects(reqOptions.redirects); + } + if (reqOptions.type) { + request = request.type(reqOptions.type); + } + if (reqOptions.send) { + request = request.send(reqOptions.send); + } + if (reqOptions.accept) { + request = request.accept(reqOptions.accept); + } + if (reqOptions.query) { + request = request.query(reqOptions.query); + } + if (reqOptions.withCredentials) { + request = request.withCredentials(); + } + if (typeof reqOptions.user === 'string' && typeof reqOptions.password === 'string') { + request = request.auth(reqOptions.user, reqOptions.password); + } + if (reqOptions.headers) { + for (var key in reqOptions.headers) { + if (reqOptions.headers.hasOwnProperty(key)) { + request = request.set(key, reqOptions.headers[key]); + } + } + } + if (reqOptions.field) { + for (var key in reqOptions.field) { + if (reqOptions.field.hasOwnProperty(key)) { + request = request.field(key, reqOptions.field[key]); + } + } + } + if (reqOptions.attach) { + for (var i = reqOptions.attach.length - 1; i >= 0; i--) { + var a = reqOptions.attach[i]; + request = request.attach(a.name, a.path, a.filename); + } + } + return request; + } + exports.optionsToSuperagent = optionsToSuperagent; + function createResponse$(reqInput) { + return xstream_1.default.create({ + start: function startResponseStream(listener) { + try { + var reqOptions_1 = normalizeRequestInput(reqInput); + this.request = optionsToSuperagent(reqOptions_1); + if (reqOptions_1.progress) { + this.request = this.request.on('progress', function (res) { + res.request = reqOptions_1; + listener.next(res); + }); + } + this.request.end(function (err, res) { + if (err) { + listener.error(err); + } + else { + res.request = reqOptions_1; + listener.next(res); + listener.complete(); + } + }); + } + catch (err) { + listener.error(err); + } + }, + stop: function stopResponseStream() { + if (this.request && this.request.abort) { + this.request.abort(); + } + }, + }); + } + exports.createResponse$ = createResponse$; + function softNormalizeRequestInput(reqInput) { + var reqOptions; + try { + reqOptions = normalizeRequestInput(reqInput); + } + catch (err) { + reqOptions = { url: 'Error', _error: err }; + } + return reqOptions; + } + function normalizeRequestInput(reqOptions) { + if (typeof reqOptions === 'string') { + return { url: reqOptions }; + } + else if (typeof reqOptions === 'object') { + return reqOptions; + } + else { + throw new Error("Observable of requests given to HTTP Driver must emit " + + "either URL strings or objects with parameters."); + } + } + function makeRequestInputToResponse$(runStreamAdapter) { + return function requestInputToResponse$(reqInput) { + var response$ = createResponse$(reqInput).remember(); + var reqOptions = softNormalizeRequestInput(reqInput); + if (!reqOptions.lazy) { + /* tslint:disable:no-empty */ + response$.addListener({ next: function () { }, error: function () { }, complete: function () { } }); + } + response$ = (runStreamAdapter) ? + runStreamAdapter.adapt(response$, xstream_adapter_1.default.streamSubscribe) : + response$; + Object.defineProperty(response$, 'request', { + value: reqOptions, + writable: false, + }); + return response$; + }; + } + function makeHTTPDriver() { + function httpDriver(request$, runSA, name) { + var response$$ = request$ + .map(makeRequestInputToResponse$(runSA)); + var httpSource = new MainHTTPSource_1.MainHTTPSource(response$$, runSA, name, []); + /* tslint:disable:no-empty */ + response$$.addListener({ next: function () { }, error: function () { }, complete: function () { } }); + /* tslint:enable:no-empty */ + return httpSource; + } + httpDriver.streamAdapter = xstream_adapter_1.default; + return httpDriver; + } + exports.makeHTTPDriver = makeHTTPDriver; + //# sourceMappingURL=http-driver.js.map + +/***/ }, +/* 140 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var isolate_1 = __webpack_require__(141); + var xstream_adapter_1 = __webpack_require__(142); + var MainHTTPSource = (function () { + function MainHTTPSource(_res$$, runStreamAdapter, _name, _namespace) { + if (_namespace === void 0) { _namespace = []; } + this._res$$ = _res$$; + this.runStreamAdapter = runStreamAdapter; + this._name = _name; + this._namespace = _namespace; + this.isolateSource = isolate_1.isolateSource; + this.isolateSink = isolate_1.isolateSink; + } + MainHTTPSource.prototype.filter = function (predicate) { + var filteredResponse$$ = this._res$$.filter(function (r$) { return predicate(r$.request); }); + return new MainHTTPSource(filteredResponse$$, this.runStreamAdapter, this._name, this._namespace); + }; + MainHTTPSource.prototype.select = function (category) { + var res$$ = this._res$$; + if (category) { + res$$ = this._res$$.filter(function (res$) { return res$.request && res$.request.category === category; }); + } + var out = this.runStreamAdapter.adapt(res$$, xstream_adapter_1.default.streamSubscribe); + out._isCycleSource = this._name; + return out; + }; + return MainHTTPSource; + }()); + exports.MainHTTPSource = MainHTTPSource; + //# sourceMappingURL=MainHTTPSource.js.map + +/***/ }, +/* 141 */ +/***/ function(module, exports) { + + "use strict"; + function isolateSource(httpSource, scope) { + return httpSource.filter(function (request) { + return Array.isArray(request._namespace) && + request._namespace.indexOf(scope) !== -1; + }); + } + exports.isolateSource = isolateSource; + function isolateSink(request$, scope) { + return request$.map(function (req) { + if (typeof req === "string") { + return { url: req, _namespace: [scope] }; + } + var reqOptions = req; + reqOptions._namespace = reqOptions._namespace || []; + reqOptions._namespace.push(scope); + return reqOptions; + }); + } + exports.isolateSink = isolateSink; + //# sourceMappingURL=isolate.js.map + +/***/ }, +/* 142 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var xstream_1 = __webpack_require__(5); + var XStreamAdapter = { + adapt: function (originStream, originStreamSubscribe) { + if (XStreamAdapter.isValidStream(originStream)) { + return originStream; + } + ; + var dispose = null; + return xstream_1.default.create({ + start: function (out) { + var observer = out; + dispose = originStreamSubscribe(originStream, observer); + }, + stop: function () { + if (typeof dispose === 'function') { + dispose(); + } + } + }); + }, + makeSubject: function () { + var stream = xstream_1.default.create(); + var observer = { + next: function (x) { stream.shamefullySendNext(x); }, + error: function (err) { stream.shamefullySendError(err); }, + complete: function () { stream.shamefullySendComplete(); } + }; + return { observer: observer, stream: stream }; + }, + remember: function (stream) { + return stream.remember(); + }, + isValidStream: function (stream) { + return (typeof stream.addListener === 'function' && + typeof stream.shamefullySendNext === 'function'); + }, + streamSubscribe: function (stream, observer) { + stream.addListener(observer); + return function () { return stream.removeListener(observer); }; + } + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = XStreamAdapter; + //# sourceMappingURL=index.js.map + +/***/ }, +/* 143 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Root reference for iframes. + */ + + var root; + if (typeof window !== 'undefined') { // Browser window + root = window; + } else if (typeof self !== 'undefined') { // Web Worker + root = self; + } else { // Other environments + console.warn("Using browser-only version of superagent in non-browser environment"); + root = this; + } + + var Emitter = __webpack_require__(144); + var requestBase = __webpack_require__(145); + var isObject = __webpack_require__(146); + + /** + * Noop. + */ + + function noop(){}; + + /** + * Expose `request`. + */ + + var request = module.exports = __webpack_require__(147).bind(null, Request); + + /** + * Determine XHR. + */ + + request.getXHR = function () { + if (root.XMLHttpRequest + && (!root.location || 'file:' != root.location.protocol + || !root.ActiveXObject)) { + return new XMLHttpRequest; + } else { + try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {} + try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {} + try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {} + try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {} + } + throw Error("Browser-only verison of superagent could not find XHR"); + }; + + /** + * Removes leading and trailing whitespace, added to support IE. + * + * @param {String} s + * @return {String} + * @api private + */ + + var trim = ''.trim + ? function(s) { return s.trim(); } + : function(s) { return s.replace(/(^\s*|\s*$)/g, ''); }; + + /** + * Serialize the given `obj`. + * + * @param {Object} obj + * @return {String} + * @api private + */ + + function serialize(obj) { + if (!isObject(obj)) return obj; + var pairs = []; + for (var key in obj) { + if (null != obj[key]) { + pushEncodedKeyValuePair(pairs, key, obj[key]); + } + } + return pairs.join('&'); + } + + /** + * Helps 'serialize' with serializing arrays. + * Mutates the pairs array. + * + * @param {Array} pairs + * @param {String} key + * @param {Mixed} val + */ + + function pushEncodedKeyValuePair(pairs, key, val) { + if (Array.isArray(val)) { + return val.forEach(function(v) { + pushEncodedKeyValuePair(pairs, key, v); + }); + } else if (isObject(val)) { + for(var subkey in val) { + pushEncodedKeyValuePair(pairs, key + '[' + subkey + ']', val[subkey]); + } + return; + } + pairs.push(encodeURIComponent(key) + + '=' + encodeURIComponent(val)); + } + + /** + * Expose serialization method. + */ + + request.serializeObject = serialize; + + /** + * Parse the given x-www-form-urlencoded `str`. + * + * @param {String} str + * @return {Object} + * @api private + */ + + function parseString(str) { + var obj = {}; + var pairs = str.split('&'); + var pair; + var pos; + + for (var i = 0, len = pairs.length; i < len; ++i) { + pair = pairs[i]; + pos = pair.indexOf('='); + if (pos == -1) { + obj[decodeURIComponent(pair)] = ''; + } else { + obj[decodeURIComponent(pair.slice(0, pos))] = + decodeURIComponent(pair.slice(pos + 1)); + } + } + + return obj; + } + + /** + * Expose parser. + */ + + request.parseString = parseString; + + /** + * Default MIME type map. + * + * superagent.types.xml = 'application/xml'; + * + */ + + request.types = { + html: 'text/html', + json: 'application/json', + xml: 'application/xml', + urlencoded: 'application/x-www-form-urlencoded', + 'form': 'application/x-www-form-urlencoded', + 'form-data': 'application/x-www-form-urlencoded' + }; + + /** + * Default serialization map. + * + * superagent.serialize['application/xml'] = function(obj){ + * return 'generated xml here'; + * }; + * + */ + + request.serialize = { + 'application/x-www-form-urlencoded': serialize, + 'application/json': JSON.stringify + }; + + /** + * Default parsers. + * + * superagent.parse['application/xml'] = function(str){ + * return { object parsed from str }; + * }; + * + */ + + request.parse = { + 'application/x-www-form-urlencoded': parseString, + 'application/json': JSON.parse + }; + + /** + * Parse the given header `str` into + * an object containing the mapped fields. + * + * @param {String} str + * @return {Object} + * @api private + */ + + function parseHeader(str) { + var lines = str.split(/\r?\n/); + var fields = {}; + var index; + var line; + var field; + var val; + + lines.pop(); // trailing CRLF + + for (var i = 0, len = lines.length; i < len; ++i) { + line = lines[i]; + index = line.indexOf(':'); + field = line.slice(0, index).toLowerCase(); + val = trim(line.slice(index + 1)); + fields[field] = val; + } + + return fields; + } + + /** + * Check if `mime` is json or has +json structured syntax suffix. + * + * @param {String} mime + * @return {Boolean} + * @api private + */ + + function isJSON(mime) { + return /[\/+]json\b/.test(mime); + } + + /** + * Return the mime type for the given `str`. + * + * @param {String} str + * @return {String} + * @api private + */ + + function type(str){ + return str.split(/ *; */).shift(); + }; + + /** + * Return header field parameters. + * + * @param {String} str + * @return {Object} + * @api private + */ + + function params(str){ + return str.split(/ *; */).reduce(function(obj, str){ + var parts = str.split(/ *= */), + key = parts.shift(), + val = parts.shift(); + + if (key && val) obj[key] = val; + return obj; + }, {}); + }; + + /** + * Initialize a new `Response` with the given `xhr`. + * + * - set flags (.ok, .error, etc) + * - parse header + * + * Examples: + * + * Aliasing `superagent` as `request` is nice: + * + * request = superagent; + * + * We can use the promise-like API, or pass callbacks: + * + * request.get('/').end(function(res){}); + * request.get('/', function(res){}); + * + * Sending data can be chained: + * + * request + * .post('/user') + * .send({ name: 'tj' }) + * .end(function(res){}); + * + * Or passed to `.send()`: + * + * request + * .post('/user') + * .send({ name: 'tj' }, function(res){}); + * + * Or passed to `.post()`: + * + * request + * .post('/user', { name: 'tj' }) + * .end(function(res){}); + * + * Or further reduced to a single call for simple cases: + * + * request + * .post('/user', { name: 'tj' }, function(res){}); + * + * @param {XMLHTTPRequest} xhr + * @param {Object} options + * @api private + */ + + function Response(req, options) { + options = options || {}; + this.req = req; + this.xhr = this.req.xhr; + // responseText is accessible only if responseType is '' or 'text' and on older browsers + this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined') + ? this.xhr.responseText + : null; + this.statusText = this.req.xhr.statusText; + this._setStatusProperties(this.xhr.status); + this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders()); + // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but + // getResponseHeader still works. so we get content-type even if getting + // other headers fails. + this.header['content-type'] = this.xhr.getResponseHeader('content-type'); + this._setHeaderProperties(this.header); + this.body = this.req.method != 'HEAD' + ? this._parseBody(this.text ? this.text : this.xhr.response) + : null; + } + + /** + * Get case-insensitive `field` value. + * + * @param {String} field + * @return {String} + * @api public + */ + + Response.prototype.get = function(field){ + return this.header[field.toLowerCase()]; + }; + + /** + * Set header related properties: + * + * - `.type` the content type without params + * + * A response of "Content-Type: text/plain; charset=utf-8" + * will provide you with a `.type` of "text/plain". + * + * @param {Object} header + * @api private + */ + + Response.prototype._setHeaderProperties = function(header){ + // content-type + var ct = this.header['content-type'] || ''; + this.type = type(ct); + + // params + var obj = params(ct); + for (var key in obj) this[key] = obj[key]; + }; + + /** + * Parse the given body `str`. + * + * Used for auto-parsing of bodies. Parsers + * are defined on the `superagent.parse` object. + * + * @param {String} str + * @return {Mixed} + * @api private + */ + + Response.prototype._parseBody = function(str){ + var parse = request.parse[this.type]; + if (!parse && isJSON(this.type)) { + parse = request.parse['application/json']; + } + return parse && str && (str.length || str instanceof Object) + ? parse(str) + : null; + }; + + /** + * Set flags such as `.ok` based on `status`. + * + * For example a 2xx response will give you a `.ok` of __true__ + * whereas 5xx will be __false__ and `.error` will be __true__. The + * `.clientError` and `.serverError` are also available to be more + * specific, and `.statusType` is the class of error ranging from 1..5 + * sometimes useful for mapping respond colors etc. + * + * "sugar" properties are also defined for common cases. Currently providing: + * + * - .noContent + * - .badRequest + * - .unauthorized + * - .notAcceptable + * - .notFound + * + * @param {Number} status + * @api private + */ + + Response.prototype._setStatusProperties = function(status){ + // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request + if (status === 1223) { + status = 204; + } + + var type = status / 100 | 0; + + // status / class + this.status = this.statusCode = status; + this.statusType = type; + + // basics + this.info = 1 == type; + this.ok = 2 == type; + this.clientError = 4 == type; + this.serverError = 5 == type; + this.error = (4 == type || 5 == type) + ? this.toError() + : false; + + // sugar + this.accepted = 202 == status; + this.noContent = 204 == status; + this.badRequest = 400 == status; + this.unauthorized = 401 == status; + this.notAcceptable = 406 == status; + this.notFound = 404 == status; + this.forbidden = 403 == status; + }; + + /** + * Return an `Error` representative of this response. + * + * @return {Error} + * @api public + */ + + Response.prototype.toError = function(){ + var req = this.req; + var method = req.method; + var url = req.url; + + var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')'; + var err = new Error(msg); + err.status = this.status; + err.method = method; + err.url = url; + + return err; + }; + + /** + * Expose `Response`. + */ + + request.Response = Response; + + /** + * Initialize a new `Request` with the given `method` and `url`. + * + * @param {String} method + * @param {String} url + * @api public + */ + + function Request(method, url) { + var self = this; + this._query = this._query || []; + this.method = method; + this.url = url; + this.header = {}; // preserves header name case + this._header = {}; // coerces header names to lowercase + this.on('end', function(){ + var err = null; + var res = null; + + try { + res = new Response(self); + } catch(e) { + err = new Error('Parser is unable to parse the response'); + err.parse = true; + err.original = e; + // issue #675: return the raw response if the response parsing fails + err.rawResponse = self.xhr && self.xhr.responseText ? self.xhr.responseText : null; + // issue #876: return the http status code if the response parsing fails + err.statusCode = self.xhr && self.xhr.status ? self.xhr.status : null; + return self.callback(err); + } + + self.emit('response', res); + + var new_err; + try { + if (res.status < 200 || res.status >= 300) { + new_err = new Error(res.statusText || 'Unsuccessful HTTP response'); + new_err.original = err; + new_err.response = res; + new_err.status = res.status; + } + } catch(e) { + new_err = e; // #985 touching res may cause INVALID_STATE_ERR on old Android + } + + // #1000 don't catch errors from the callback to avoid double calling it + if (new_err) { + self.callback(new_err, res); + } else { + self.callback(null, res); + } + }); + } + + /** + * Mixin `Emitter` and `requestBase`. + */ + + Emitter(Request.prototype); + for (var key in requestBase) { + Request.prototype[key] = requestBase[key]; + } + + /** + * Set Content-Type to `type`, mapping values from `request.types`. + * + * Examples: + * + * superagent.types.xml = 'application/xml'; + * + * request.post('/') + * .type('xml') + * .send(xmlstring) + * .end(callback); + * + * request.post('/') + * .type('application/xml') + * .send(xmlstring) + * .end(callback); + * + * @param {String} type + * @return {Request} for chaining + * @api public + */ + + Request.prototype.type = function(type){ + this.set('Content-Type', request.types[type] || type); + return this; + }; + + /** + * Set responseType to `val`. Presently valid responseTypes are 'blob' and + * 'arraybuffer'. + * + * Examples: + * + * req.get('/') + * .responseType('blob') + * .end(callback); + * + * @param {String} val + * @return {Request} for chaining + * @api public + */ + + Request.prototype.responseType = function(val){ + this._responseType = val; + return this; + }; + + /** + * Set Accept to `type`, mapping values from `request.types`. + * + * Examples: + * + * superagent.types.json = 'application/json'; + * + * request.get('/agent') + * .accept('json') + * .end(callback); + * + * request.get('/agent') + * .accept('application/json') + * .end(callback); + * + * @param {String} accept + * @return {Request} for chaining + * @api public + */ + + Request.prototype.accept = function(type){ + this.set('Accept', request.types[type] || type); + return this; + }; + + /** + * Set Authorization field value with `user` and `pass`. + * + * @param {String} user + * @param {String} pass + * @param {Object} options with 'type' property 'auto' or 'basic' (default 'basic') + * @return {Request} for chaining + * @api public + */ + + Request.prototype.auth = function(user, pass, options){ + if (!options) { + options = { + type: 'basic' + } + } + + switch (options.type) { + case 'basic': + var str = btoa(user + ':' + pass); + this.set('Authorization', 'Basic ' + str); + break; + + case 'auto': + this.username = user; + this.password = pass; + break; + } + return this; + }; + + /** + * Add query-string `val`. + * + * Examples: + * + * request.get('/shoes') + * .query('size=10') + * .query({ color: 'blue' }) + * + * @param {Object|String} val + * @return {Request} for chaining + * @api public + */ + + Request.prototype.query = function(val){ + if ('string' != typeof val) val = serialize(val); + if (val) this._query.push(val); + return this; + }; + + /** + * Queue the given `file` as an attachment to the specified `field`, + * with optional `filename`. + * + * ``` js + * request.post('/upload') + * .attach('content', new Blob(['hey!'], { type: "text/html"})) + * .end(callback); + * ``` + * + * @param {String} field + * @param {Blob|File} file + * @param {String} filename + * @return {Request} for chaining + * @api public + */ + + Request.prototype.attach = function(field, file, filename){ + this._getFormData().append(field, file, filename || file.name); + return this; + }; + + Request.prototype._getFormData = function(){ + if (!this._formData) { + this._formData = new root.FormData(); + } + return this._formData; + }; + + /** + * Invoke the callback with `err` and `res` + * and handle arity check. + * + * @param {Error} err + * @param {Response} res + * @api private + */ + + Request.prototype.callback = function(err, res){ + var fn = this._callback; + this.clearTimeout(); + fn(err, res); + }; + + /** + * Invoke callback with x-domain error. + * + * @api private + */ + + Request.prototype.crossDomainError = function(){ + var err = new Error('Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.'); + err.crossDomain = true; + + err.status = this.status; + err.method = this.method; + err.url = this.url; + + this.callback(err); + }; + + /** + * Invoke callback with timeout error. + * + * @api private + */ + + Request.prototype._timeoutError = function(){ + var timeout = this._timeout; + var err = new Error('timeout of ' + timeout + 'ms exceeded'); + err.timeout = timeout; + this.callback(err); + }; + + /** + * Compose querystring to append to req.url + * + * @api private + */ + + Request.prototype._appendQueryString = function(){ + var query = this._query.join('&'); + if (query) { + this.url += ~this.url.indexOf('?') + ? '&' + query + : '?' + query; + } + }; + + /** + * Initiate request, invoking callback `fn(res)` + * with an instanceof `Response`. + * + * @param {Function} fn + * @return {Request} for chaining + * @api public + */ + + Request.prototype.end = function(fn){ + var self = this; + var xhr = this.xhr = request.getXHR(); + var timeout = this._timeout; + var data = this._formData || this._data; + + // store callback + this._callback = fn || noop; + + // state change + xhr.onreadystatechange = function(){ + if (4 != xhr.readyState) return; + + // In IE9, reads to any property (e.g. status) off of an aborted XHR will + // result in the error "Could not complete the operation due to error c00c023f" + var status; + try { status = xhr.status } catch(e) { status = 0; } + + if (0 == status) { + if (self.timedout) return self._timeoutError(); + if (self._aborted) return; + return self.crossDomainError(); + } + self.emit('end'); + }; + + // progress + var handleProgress = function(e){ + if (e.total > 0) { + e.percent = e.loaded / e.total * 100; + } + e.direction = 'download'; + self.emit('progress', e); + }; + if (this.hasListeners('progress')) { + xhr.onprogress = handleProgress; + } + try { + if (xhr.upload && this.hasListeners('progress')) { + xhr.upload.onprogress = handleProgress; + } + } catch(e) { + // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist. + // Reported here: + // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context + } + + // timeout + if (timeout && !this._timer) { + this._timer = setTimeout(function(){ + self.timedout = true; + self.abort(); + }, timeout); + } + + // querystring + this._appendQueryString(); + + // initiate request + if (this.username && this.password) { + xhr.open(this.method, this.url, true, this.username, this.password); + } else { + xhr.open(this.method, this.url, true); + } + + // CORS + if (this._withCredentials) xhr.withCredentials = true; + + // body + if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !this._isHost(data)) { + // serialize stuff + var contentType = this._header['content-type']; + var serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : '']; + if (!serialize && isJSON(contentType)) serialize = request.serialize['application/json']; + if (serialize) data = serialize(data); + } + + // set header fields + for (var field in this.header) { + if (null == this.header[field]) continue; + xhr.setRequestHeader(field, this.header[field]); + } + + if (this._responseType) { + xhr.responseType = this._responseType; + } + + // send stuff + this.emit('request', this); + + // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing) + // We need null here if data is undefined + xhr.send(typeof data !== 'undefined' ? data : null); + return this; + }; + + + /** + * Expose `Request`. + */ + + request.Request = Request; + + /** + * GET `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + request.get = function(url, data, fn){ + var req = request('GET', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.query(data); + if (fn) req.end(fn); + return req; + }; + + /** + * HEAD `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + request.head = function(url, data, fn){ + var req = request('HEAD', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; + }; + + /** + * OPTIONS query to `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + request.options = function(url, data, fn){ + var req = request('OPTIONS', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; + }; + + /** + * DELETE `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + function del(url, fn){ + var req = request('DELETE', url); + if (fn) req.end(fn); + return req; + }; + + request['del'] = del; + request['delete'] = del; + + /** + * PATCH `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} [data] + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + request.patch = function(url, data, fn){ + var req = request('PATCH', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; + }; + + /** + * POST `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} [data] + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + request.post = function(url, data, fn){ + var req = request('POST', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; + }; + + /** + * PUT `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + + request.put = function(url, data, fn){ + var req = request('PUT', url); + if ('function' == typeof data) fn = data, data = null; + if (data) req.send(data); + if (fn) req.end(fn); + return req; + }; + + +/***/ }, +/* 144 */ +/***/ function(module, exports, __webpack_require__) { + + + /** + * Expose `Emitter`. + */ + + if (true) { + module.exports = Emitter; + } + + /** + * Initialize a new `Emitter`. + * + * @api public + */ + + function Emitter(obj) { + if (obj) return mixin(obj); + }; + + /** + * Mixin the emitter properties. + * + * @param {Object} obj + * @return {Object} + * @api private + */ + + function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; + } + + /** + * Listen on the given `event` with `fn`. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + + Emitter.prototype.on = + Emitter.prototype.addEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + (this._callbacks['$' + event] = this._callbacks['$' + event] || []) + .push(fn); + return this; + }; + + /** + * Adds an `event` listener that will be invoked a single + * time then automatically removed. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + + Emitter.prototype.once = function(event, fn){ + function on() { + this.off(event, on); + fn.apply(this, arguments); + } + + on.fn = fn; + this.on(event, on); + return this; + }; + + /** + * Remove the given callback for `event` or all + * registered callbacks. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + + Emitter.prototype.off = + Emitter.prototype.removeListener = + Emitter.prototype.removeAllListeners = + Emitter.prototype.removeEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + + // all + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } + + // specific event + var callbacks = this._callbacks['$' + event]; + if (!callbacks) return this; + + // remove all handlers + if (1 == arguments.length) { + delete this._callbacks['$' + event]; + return this; + } + + // remove specific handler + var cb; + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; + } + } + return this; + }; + + /** + * Emit `event` with the given args. + * + * @param {String} event + * @param {Mixed} ... + * @return {Emitter} + */ + + Emitter.prototype.emit = function(event){ + this._callbacks = this._callbacks || {}; + var args = [].slice.call(arguments, 1) + , callbacks = this._callbacks['$' + event]; + + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + + return this; + }; + + /** + * Return array of callbacks for `event`. + * + * @param {String} event + * @return {Array} + * @api public + */ + + Emitter.prototype.listeners = function(event){ + this._callbacks = this._callbacks || {}; + return this._callbacks['$' + event] || []; + }; + + /** + * Check if this emitter has `event` handlers. + * + * @param {String} event + * @return {Boolean} + * @api public + */ + + Emitter.prototype.hasListeners = function(event){ + return !! this.listeners(event).length; + }; + + +/***/ }, +/* 145 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Module of mixed-in functions shared between node and client code + */ + var isObject = __webpack_require__(146); + + /** + * Clear previous timeout. + * + * @return {Request} for chaining + * @api public + */ + + exports.clearTimeout = function _clearTimeout(){ + this._timeout = 0; + clearTimeout(this._timer); + return this; + }; + + /** + * Override default response body parser + * + * This function will be called to convert incoming data into request.body + * + * @param {Function} + * @api public + */ + + exports.parse = function parse(fn){ + this._parser = fn; + return this; + }; + + /** + * Override default request body serializer + * + * This function will be called to convert data set via .send or .attach into payload to send + * + * @param {Function} + * @api public + */ + + exports.serialize = function serialize(fn){ + this._serializer = fn; + return this; + }; + + /** + * Set timeout to `ms`. + * + * @param {Number} ms + * @return {Request} for chaining + * @api public + */ + + exports.timeout = function timeout(ms){ + this._timeout = ms; + return this; + }; + + /** + * Promise support + * + * @param {Function} resolve + * @param {Function} reject + * @return {Request} + */ + + exports.then = function then(resolve, reject) { + if (!this._fullfilledPromise) { + var self = this; + this._fullfilledPromise = new Promise(function(innerResolve, innerReject){ + self.end(function(err, res){ + if (err) innerReject(err); else innerResolve(res); + }); + }); + } + return this._fullfilledPromise.then(resolve, reject); + } + + /** + * Allow for extension + */ + + exports.use = function use(fn) { + fn(this); + return this; + } + + + /** + * Get request header `field`. + * Case-insensitive. + * + * @param {String} field + * @return {String} + * @api public + */ + + exports.get = function(field){ + return this._header[field.toLowerCase()]; + }; + + /** + * Get case-insensitive header `field` value. + * This is a deprecated internal API. Use `.get(field)` instead. + * + * (getHeader is no longer used internally by the superagent code base) + * + * @param {String} field + * @return {String} + * @api private + * @deprecated + */ + + exports.getHeader = exports.get; + + /** + * Set header `field` to `val`, or multiple fields with one object. + * Case-insensitive. + * + * Examples: + * + * req.get('/') + * .set('Accept', 'application/json') + * .set('X-API-Key', 'foobar') + * .end(callback); + * + * req.get('/') + * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' }) + * .end(callback); + * + * @param {String|Object} field + * @param {String} val + * @return {Request} for chaining + * @api public + */ + + exports.set = function(field, val){ + if (isObject(field)) { + for (var key in field) { + this.set(key, field[key]); + } + return this; + } + this._header[field.toLowerCase()] = val; + this.header[field] = val; + return this; + }; + + /** + * Remove header `field`. + * Case-insensitive. + * + * Example: + * + * req.get('/') + * .unset('User-Agent') + * .end(callback); + * + * @param {String} field + */ + exports.unset = function(field){ + delete this._header[field.toLowerCase()]; + delete this.header[field]; + return this; + }; + + /** + * Write the field `name` and `val` for "multipart/form-data" + * request bodies. + * + * ``` js + * request.post('/upload') + * .field('foo', 'bar') + * .end(callback); + * ``` + * + * @param {String} name + * @param {String|Blob|File|Buffer|fs.ReadStream} val + * @return {Request} for chaining + * @api public + */ + exports.field = function(name, val) { + this._getFormData().append(name, val); + return this; + }; + + /** + * Abort the request, and clear potential timeout. + * + * @return {Request} + * @api public + */ + exports.abort = function(){ + if (this._aborted) { + return this; + } + this._aborted = true; + this.xhr && this.xhr.abort(); // browser + this.req && this.req.abort(); // node + this.clearTimeout(); + this.emit('abort'); + return this; + }; + + /** + * Enable transmission of cookies with x-domain requests. + * + * Note that for this to work the origin must not be + * using "Access-Control-Allow-Origin" with a wildcard, + * and also must set "Access-Control-Allow-Credentials" + * to "true". + * + * @api public + */ + + exports.withCredentials = function(){ + // This is browser-only functionality. Node side is no-op. + this._withCredentials = true; + return this; + }; + + /** + * Set the max redirects to `n`. Does noting in browser XHR implementation. + * + * @param {Number} n + * @return {Request} for chaining + * @api public + */ + + exports.redirects = function(n){ + this._maxRedirects = n; + return this; + }; + + /** + * Convert to a plain javascript object (not JSON string) of scalar properties. + * Note as this method is designed to return a useful non-this value, + * it cannot be chained. + * + * @return {Object} describing method, url, and data of this request + * @api public + */ + + exports.toJSON = function(){ + return { + method: this.method, + url: this.url, + data: this._data, + headers: this._header + }; + }; + + /** + * Check if `obj` is a host object, + * we don't want to serialize these :) + * + * TODO: future proof, move to compoent land + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ + + exports._isHost = function _isHost(obj) { + var str = {}.toString.call(obj); + + switch (str) { + case '[object File]': + case '[object Blob]': + case '[object FormData]': + return true; + default: + return false; + } + } + + /** + * Send `data` as the request body, defaulting the `.type()` to "json" when + * an object is given. + * + * Examples: + * + * // manual json + * request.post('/user') + * .type('json') + * .send('{"name":"tj"}') + * .end(callback) + * + * // auto json + * request.post('/user') + * .send({ name: 'tj' }) + * .end(callback) + * + * // manual x-www-form-urlencoded + * request.post('/user') + * .type('form') + * .send('name=tj') + * .end(callback) + * + * // auto x-www-form-urlencoded + * request.post('/user') + * .type('form') + * .send({ name: 'tj' }) + * .end(callback) + * + * // defaults to x-www-form-urlencoded + * request.post('/user') + * .send('name=tobi') + * .send('species=ferret') + * .end(callback) + * + * @param {String|Object} data + * @return {Request} for chaining + * @api public + */ + + exports.send = function(data){ + var obj = isObject(data); + var type = this._header['content-type']; + + // merge + if (obj && isObject(this._data)) { + for (var key in data) { + this._data[key] = data[key]; + } + } else if ('string' == typeof data) { + // default to x-www-form-urlencoded + if (!type) this.type('form'); + type = this._header['content-type']; + if ('application/x-www-form-urlencoded' == type) { + this._data = this._data + ? this._data + '&' + data + : data; + } else { + this._data = (this._data || '') + data; + } + } else { + this._data = data; + } + + if (!obj || this._isHost(data)) return this; + + // default to json + if (!type) this.type('json'); + return this; + }; + + +/***/ }, +/* 146 */ +/***/ function(module, exports) { + + /** + * Check if `obj` is an object. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ + + function isObject(obj) { + return null !== obj && 'object' === typeof obj; + } + + module.exports = isObject; + + +/***/ }, +/* 147 */ +/***/ function(module, exports) { + + // The node and browser modules expose versions of this with the + // appropriate constructor function bound as first argument + /** + * Issue a request: + * + * Examples: + * + * request('GET', '/users').end(callback) + * request('/users').end(callback) + * request('/users', callback) + * + * @param {String} method + * @param {String|Function} url or callback + * @return {Request} + * @api public + */ + + function request(RequestConstructor, method, url) { + // callback + if ('function' == typeof url) { + return new RequestConstructor('GET', method).end(url); + } + + // url first + if (2 == arguments.length) { + return new RequestConstructor('GET', method); + } + + return new RequestConstructor(method, url); + } + + module.exports = request; + + +/***/ } +/******/ ]); +//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/submissions/artfuldev/dist/app.js.map b/submissions/artfuldev/dist/app.js.map new file mode 100644 index 0000000..a086d67 --- /dev/null +++ b/submissions/artfuldev/dist/app.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap ccbe942a5b899d1ded87","webpack:///./src/app.ts","webpack:///./src/main.ts","webpack:///./src/intent.ts","webpack:///./src/model.ts","webpack:///./src/reducers.ts","webpack:///./~/xstream/index.js","webpack:///./~/xstream/core.js","webpack:///./~/immutable/dist/immutable.js","webpack:///./src/view.ts","webpack:///./~/@cycle/dom/lib/index.js","webpack:///./~/@cycle/dom/~/snabbdom/thunk.js","webpack:///./~/@cycle/dom/~/snabbdom/h.js","webpack:///./~/@cycle/dom/~/snabbdom/vnode.js","webpack:///./~/@cycle/dom/~/snabbdom/is.js","webpack:///./~/@cycle/dom/lib/makeDOMDriver.js","webpack:///./~/@cycle/dom/~/snabbdom/snabbdom.js","webpack:///./~/@cycle/dom/~/snabbdom/htmldomapi.js","webpack:///./~/@cycle/dom/lib/MainDOMSource.js","webpack:///./~/@cycle/dom/~/@cycle/xstream-adapter/lib/index.js","webpack:///./~/@cycle/dom/lib/ElementFinder.js","webpack:///./~/@cycle/dom/lib/ScopeChecker.js","webpack:///./~/@cycle/dom/lib/utils.js","webpack:///./~/@cycle/dom/~/matches-selector/index.js","webpack:///./~/@cycle/dom/lib/fromEvent.js","webpack:///./~/@cycle/dom/lib/isolate.js","webpack:///./~/@cycle/dom/lib/EventDelegator.js","webpack:///./~/@cycle/dom/lib/VNodeWrapper.js","webpack:///./~/@cycle/dom/lib/hyperscript.js","webpack:///./~/@cycle/dom/~/snabbdom-selector/lib/classNameFromVNode.js","webpack:///./~/@cycle/dom/~/snabbdom-selector/lib/selectorParser.js","webpack:///./~/@cycle/dom/~/snabbdom-selector/~/browser-split/index.js","webpack:///./~/@cycle/dom/lib/modules.js","webpack:///./~/@cycle/dom/~/snabbdom/modules/class.js","webpack:///./~/@cycle/dom/~/snabbdom/modules/props.js","webpack:///./~/@cycle/dom/~/snabbdom/modules/attributes.js","webpack:///./~/@cycle/dom/~/snabbdom/modules/eventlisteners.js","webpack:///./~/@cycle/dom/~/snabbdom/modules/style.js","webpack:///./~/@cycle/dom/~/snabbdom/modules/hero.js","webpack:///./~/@cycle/dom/lib/isolateModule.js","webpack:///./~/@cycle/dom/~/es6-map/index.js","webpack:///./~/@cycle/dom/~/es6-map/is-implemented.js","webpack:///./~/@cycle/dom/~/es6-map/polyfill.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/array/#/clear.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/valid-value.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/array/#/e-index-of.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/number/to-pos-integer.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/number/to-integer.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/math/sign/index.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/math/sign/is-implemented.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/math/sign/shim.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/set-prototype-of/index.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/set-prototype-of/is-implemented.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/set-prototype-of/shim.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/is-object.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/create.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/valid-callable.js","webpack:///./~/@cycle/dom/~/es6-map/~/d/index.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/assign/index.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/assign/is-implemented.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/assign/shim.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/keys/index.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/keys/is-implemented.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/keys/shim.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/normalize-options.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/is-callable.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/string/#/contains/index.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/string/#/contains/is-implemented.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/string/#/contains/shim.js","webpack:///./~/@cycle/dom/~/es6-map/~/event-emitter/index.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-symbol/index.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-symbol/is-implemented.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-symbol/polyfill.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-symbol/validate-symbol.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-symbol/is-symbol.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-iterator/valid-iterable.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-iterator/is-iterable.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/function/is-arguments.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/string/is-string.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-iterator/for-of.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-iterator/get.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-iterator/array.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-iterator/index.js","webpack:///./~/@cycle/dom/~/es6-map/~/d/auto-bind.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/copy.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/map.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/for-each.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/_iterate.js","webpack:///./~/@cycle/dom/~/es6-map/~/es6-iterator/string.js","webpack:///./~/@cycle/dom/~/es6-map/lib/iterator.js","webpack:///./~/@cycle/dom/~/es6-map/lib/iterator-kinds.js","webpack:///./~/@cycle/dom/~/es6-map/~/es5-ext/object/primitive-set.js","webpack:///./~/@cycle/dom/~/es6-map/is-native-implemented.js","webpack:///./~/@cycle/dom/lib/transposition.js","webpack:///./~/@cycle/dom/lib/makeHTMLDriver.js","webpack:///./~/@cycle/dom/lib/HTMLSource.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/lib/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/lib/init.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/lib/parse-selector.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/browser-split/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/lib/void-elements.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/lib/container-elements.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/lib/modules/attributes.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash._basefor/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash._bindcallback/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash.keys/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash.keys/~/lodash._getnative/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash.keys/~/lodash.isarguments/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash.keys/~/lodash.isarray/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.escape/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.escape/~/lodash._root/index.js","webpack:///./~/webpack/buildin/module.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseflatten/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseflatten/~/lodash.isarguments/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseflatten/~/lodash.isarray/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseuniq/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseuniq/~/lodash._baseindexof/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseuniq/~/lodash._cacheindexof/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseuniq/~/lodash._createcache/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseuniq/~/lodash._createcache/~/lodash._getnative/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash.restparam/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/lib/modules/style.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.kebabcase/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.kebabcase/~/lodash.deburr/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.kebabcase/~/lodash.deburr/~/lodash._root/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.kebabcase/~/lodash.words/index.js","webpack:///./~/@cycle/dom/~/snabbdom-to-html/~/lodash.kebabcase/~/lodash.words/~/lodash._root/index.js","webpack:///./~/@cycle/dom/lib/mockDOMSource.js","webpack:///./~/@cycle/dom/lib/hyperscript-helpers.js","webpack:///./src/requests.ts","webpack:///./~/xstream/extra/dropRepeats.js","webpack:///./~/xstream/extra/flattenConcurrently.js","webpack:///./~/@cycle/xstream-run/lib/index.js","webpack:///./~/@cycle/xstream-run/~/@cycle/base/lib/index.js","webpack:///./~/@cycle/xstream-run/~/@cycle/xstream-adapter/lib/index.js","webpack:///./src/drivers/planets.ts","webpack:///./src/drivers/jedis.ts","webpack:///./~/@cycle/http/lib/index.js","webpack:///./~/@cycle/http/lib/http-driver.js","webpack:///./~/@cycle/http/lib/MainHTTPSource.js","webpack:///./~/@cycle/http/lib/isolate.js","webpack:///./~/@cycle/xstream-adapter/lib/index.js","webpack:///./~/superagent/lib/client.js","webpack:///./~/component-emitter/index.js","webpack:///./~/superagent/lib/request-base.js","webpack:///./~/superagent/lib/is-object.js","webpack:///./~/superagent/lib/request.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;ACtCA,kCAAiB,CAAQ,CAAC;AAC1B,iCAA8B,CAAY,CAAC;AAC3C,yCAAoB,GAAoB,CAAC;AACzC,qCAAkC,GAAmB,CAAC;AACtD,mCAAgC,GAAiB,CAAC;AAElD,kBAAG,CAAC,cAAI,EAAE;KACR,GAAG,EAAE,mBAAa,CAAC,MAAM,CAAC;KAC1B,OAAO,EAAE,2BAAiB,EAAE;KAC5B,KAAK,EAAE,uBAAe,EAAE;EACzB,CAAC,CAAC;;;;;;;;ACTH,oCAAmB,CAAU,CAAC;AAC9B,mCAAkB,CAAS,CAAC;AAC5B,kCAAiB,CAAQ,CAAC;AAC1B,sCAAqB,GAAY,CAAC;AAElC,eAAc,OAAiB;KAC7B,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;KAClC,IAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;KACxC,IAAM,MAAM,GAAG,eAAK,CAAC,OAAO,EAAE,KAAK,EAAE,gBAAM,CAAC,OAAO,CAAC,CAAC,CAAC;KACtD,IAAM,MAAM,GAAG,cAAI,CAAC,MAAM,CAAC,CAAC;KAC5B,IAAM,GAAG,GAAG,kBAAQ,CAAC,MAAM,CAAC,CAAC;KAC7B,IAAM,KAAK,GAAG;SACZ,GAAG,EAAE,MAAM;SACX,KAAK,EAAE,GAAG;MACX,CAAC;KACF,MAAM,CAAC,KAAK,CAAC;AACf,EAAC;AAED;mBAAe,IAAI,CAAC;;;;;;;;ACVpB,iBAAgB,OAAiB;KAC/B,IAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;KACxB,IAAM,MAAM,GAAG;SACb,SAAS,EAAE,GAAG;cACX,MAAM,CAAC,gBAAgB,CAAC;cACxB,MAAM,CAAC,OAAO,CAAC;cACf,MAAM,CAAC,YAAE,IAAI,OAAC,EAAE,CAAC,MAAsB,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAA/D,CAA+D,CAAC;cAC7E,KAAK,CAAC,IAAI,CAAC;SACd,WAAW,EAAE,GAAG;cACb,MAAM,CAAC,kBAAkB,CAAC;cAC1B,MAAM,CAAC,OAAO,CAAC;cACf,MAAM,CAAC,YAAE,IAAI,OAAC,EAAE,CAAC,MAAsB,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAA/D,CAA+D,CAAC;cAC7E,KAAK,CAAC,IAAI,CAAC;MACf,CAAC;KACF,MAAM,CAAC,MAAM,CAAC;AAChB,EAAC;AAED;mBAAe,MAAM,CAAC;;;;;;;;ACxBtB,sCAAuC,CAAY,CAAC;AAKpD,gBAAe,OAAwB,EAAE,KAAoB,EAAE,MAAe;KAC5E,IAAM,QAAQ,GAAG,kBAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;KAClD,IAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAC,IAAI,EAAE,OAAO,IAAK,cAAO,CAAC,IAAI,CAAC,EAAb,CAAa,EAAE,uBAAY,CAAC,CAAC;KAC7E,MAAM,CAAC,MAAM,CAAC;AAChB,EAAC;AAED;mBAAe,KAAK,CAAC;;;;;;;;;;;;;ACbrB,qCAAuB,CAAS,CAAC;AAGjC,uCAAuB,CAAW,CAAC;AAInC,KAAM,UAAU,GAAG,kBAAM,CAAC;KACxB,EAAE,EAAE,CAAC;KACL,IAAI,EAAE,IAAI;KACV,SAAS,EAAE,IAAI;KACf,MAAM,EAAE,IAAI;KACZ,UAAU,EAAE,IAAI;EACjB,CAAC,CAAC;AAEH;KAAmB,wBAAU;KAM3B,cAAY,KAAY;SACtB,kBAAM,KAAK,CAAC,CAAC;KACf,CAAC;KACH,WAAC;AAAD,EAAC,CATkB,UAAU,GAS5B;AAED,KAAM,sBAAsB,GAAG,kBAAM,CAAC;KACpC,MAAM,EAAE,IAAI;KACZ,KAAK,EAAE,IAAI,KAAK,EAAS;KACzB,IAAI,EAAE,KAAK;KACX,EAAE,EAAE,KAAK;KACT,SAAS,EAAE,CAAC,CAAC;EACd,CAAC,CAAC;AAEH;KAA+B,oCAAsB;KAMnD,0BAAY,KAAwB;SAClC,kBAAM,KAAK,CAAC,CAAC;KACf,CAAC;KACH,uBAAC;AAAD,EAAC,CAT8B,sBAAsB,GASpD;AAEY,qBAAY,GAAsB,IAAI,gBAAgB,CAAC;KAClE,MAAM,EAAE,IAAI;KACZ,KAAK,EAAE;SACL,IAAI;SACJ,IAAI;SACJ,IAAI;SACJ,IAAI;SACJ,IAAI;MACL;KACD,IAAI,EAAE,KAAK;KACX,EAAE,EAAE,KAAK;KACT,SAAS,EAAE,CAAC,CAAC;EACd,CAAC,CAAC;AAEH,mBAAkB,OAAwB,EAAE,KAAoB,EAAE,MAAe;KAC/E,IAAM,EAAE,GAAG,gBAAM,CAAC;KAElB,IAAM,cAAc,GAClB,OAAO;UACJ,GAAG,CAAC,gBAAM;SACT,iBAAC,KAAwB;aACvB,IAAM,QAAQ,GAAG,KAAyB,CAAC;aAC3C,IAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAqB,CAAC;aACrE,MAAM,CAAC,SAAS,CAAC;SACnB,CAAC;KAJD,CAIC,CAAC,CAAC;KAET,IAAM,aAAa,GACjB,EAAE,CAAC,KAAK,CACN,KAAK;UACF,GAAG,CAAC,cAAI;SACP,iBAAC,KAAwB;aACvB,IAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,IAAI,KAAK,CAAQ,CAAC,CAAC,CAAC;aACjD,IAAM,WAAW,GACf,KAAK;kBACF,GAAG,CAAC,WAAC,IAAI,QAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,EAAlC,CAAkC,CAAC;kBAC5C,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aACtB,IAAM,QAAQ,GAAG,KAAyB,CAAC;aAC3C,IAAI,KAAK,GAAG,CAAC,CAAC;aACd,EAAE,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,CAAC;iBACrB,KAAK,GAAG,WAAW,GAAG,CAAC,CAAC;aAC1B,IAAI,CAAC,CAAC;iBACJ,IAAM,eAAe,GACnB,KAAK;sBACF,GAAG,CAAC,WAAC,IAAI,QAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC,EAA1C,CAA0C,CAAC;sBACpD,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;iBACtB,EAAE,CAAC,CAAC,eAAe,KAAK,CAAC,CAAC,CAAC;qBACzB,KAAK,GAAG,eAAe,GAAG,CAAC,CAAC;aAChC,CAAC;aACD,IAAM,QAAQ,GACZ,KAAK;kBACF,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC;iBACR,QAAC,KAAK,KAAK;uBACP,IAAI,IAAI,CAAC,IAAI,CAAC;uBACd,CAAC;aAFL,CAEK,CAAC,CAAC;aACb,IAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAqB,CAAC;aACtE,MAAM,CAAC,SAAS,CAAC;SACnB,CAAC;KA1BD,CA0BC,CAAC,EACN,MAAM,CAAC,SAAS;UACb,KAAK,CAAC,UAAC,KAAwB;SAC9B,IAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;SAC1B,IAAM,QAAQ,GACZ,KAAK;cACF,GAAG,CAAC,UAAC,IAAI,EAAE,CAAC,EAAE,KAAK,IAAK,QAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAA7B,CAA6B,CAAC,CAAC;SAC5D,IAAM,QAAQ,GAAG,KAAyB,CAAC;SAC3C,IAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAqB,CAAC;SACtE,MAAM,CAAC,SAAS,CAAC;KACnB,CAAC,CAAC,EACJ,MAAM,CAAC,WAAW;UACf,KAAK,CAAC,UAAC,KAAwB;SAC9B,IAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;SAC1B,IAAM,QAAQ,GACZ,KAAK;cACF,GAAG,CAAC,UAAC,IAAI,EAAE,CAAC,EAAE,KAAK,IAAK,QAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAA7B,CAA6B,CAAC,CAAC;SAC5D,IAAM,QAAQ,GAAG,KAAyB,CAAC;SAC3C,IAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAqB,CAAC;SACtE,MAAM,CAAC,SAAS,CAAC;KACnB,CAAC,CAAC,CACL,CAAC;KAEJ,IAAM,YAAY,GAChB,aAAa;UACV,KAAK,CAAC,UAAC,KAAwB;SAC9B,IAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;SAC1B,IAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,cAAI,IAAI,QAAC,CAAC,IAAI,EAAN,CAAM,CAAC,CAAC,GAAG,EAAE,CAAC;SACpD,IAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACtC,IAAM,IAAI,GAAG,QAAQ,IAAI,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;SACvE,IAAM,QAAQ,GAAG,KAAyB,CAAC;SAC3C,IAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAqB,CAAC;SACjE,MAAM,CAAC,SAAS,CAAC;KACnB,CAAC,CAAC,CAAC;KAEP,IAAM,UAAU,GACd,aAAa;UACV,KAAK,CAAC,UAAC,KAAwB;SAC9B,IAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;SAC1B,IAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,cAAI,IAAI,QAAC,CAAC,IAAI,EAAN,CAAM,CAAC,CAAC,KAAK,EAAE,CAAC;SACvD,IAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SACvC,IAAM,EAAE,GAAG,SAAS,IAAI,SAAS,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;SAChE,IAAM,QAAQ,GAAG,KAAyB,CAAC;SAC3C,IAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAqB,CAAC;SAC7D,MAAM,CAAC,SAAS,CAAC;KACnB,CAAC,CAAC,CAAC;KAEP,IAAM,iBAAiB,GACrB,EAAE,CAAC,KAAK,CACN,KAAK,EACL,OAAO,CACR,CAAC,KAAK,CAAC,UAAC,KAAwB;SAC/B,IAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;SAC5B,IAAM,QAAQ,GAAG,KAAyB,CAAC;SAC3C,IAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAqB,CAAC;SACvE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;aACxB,MAAM,CAAC,YAAY,CAAC;SACtB,IAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC;SAC3B,IAAM,WAAW,GACf,KAAK,CAAC,KAAK;cACR,MAAM,CAAC,cAAI,IAAI,QAAC,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,QAAQ,EAAxC,CAAwC,CAAC;cACxD,GAAG,EAAE,CAAC;SACX,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;aACf,MAAM,CAAC,YAAY,CAAC;SACtB,IAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAqB,CAAC;SACpF,MAAM,CAAC,SAAS,CAAC;KACnB,CAAC,CAAC,CAAC;KAEL,MAAM,CAAC,EAAE,CAAC,KAAK,CACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,UAAU,EACV,iBAAiB,CAClB,CAAC;AACJ,EAAC;AAED;mBAAe,QAAQ,CAAC;;;;;;;AClLxB;AACA;AACA;AACA;AACA,+CAA8C,cAAc;AAC5D;AACA,kC;;;;;;ACNA;AACA;AACA;AACA,oBAAmB,sBAAsB;AACzC;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT,qCAAoC,WAAW,EAAE;AACjD,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAoC,qBAAqB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAuD,0BAA0B,EAAE;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,SAAS;AACxB;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,SAAS;AACxB;AACA,iBAAgB;AAChB;AACA;AACA;AACA,2CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA,4BAA2B,4BAA4B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA,oCAAmC,SAAS,EAAE;AAC9C;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA,oCAAmC,cAAc,EAAE;AACnD;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA,yBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,MAAM;AACrB,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,QAAQ;AACvB,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,OAAO;AACtB;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,OAAO;AACtB,gBAAe,OAAO;AACtB;AACA,iBAAgB;AAChB;AACA;AACA;AACA,yBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,SAAS;AACxB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA,uCAAsC,uBAAuB,EAAE;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,SAAS;AACxB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,OAAO;AACtB;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,OAAO;AACtB;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,SAAS;AACxB;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,SAAS;AACxB;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,SAAS;AACxB;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,SAAS;AACxB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA8B,4CAA4C;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,IAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,OAAO;AACtB,gBAAe,OAAO;AACtB;AACA,iBAAgB;AAChB;AACA;AACA;AACA,yBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA,+CAA8C,cAAc;AAC5D;AACA,iC;;;;;;ACprDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,oBAAoB,cAAc;;AAEnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAgB;AAChB;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAuB;AACvB,oBAAmB;;AAEnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAoB,UAAU;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA,8CAA6C,wBAAwB;AACrE;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA,aAAY;AACZ;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAmC,KAAK;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;;AAEA;;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;;;;AAKA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;AAEA;AACA;AACA,wCAAuC,SAAS;AAChD;AACA;;AAEA;AACA;AACA,oFAAmF,yCAAyC;AAC5H;AACA;AACA,kFAAiF,yCAAyC;AAC1H;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA6C;AAC7C;AACA,0BAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA,4DAA2D;AAC3D;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;;AAGA,4CAA2C;;AAE3C,8CAA6C;;AAE7C,0CAAyC;;;AAGzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAgB;AAChB,iBAAgB;AAChB;AACA;AACA;AACA,8EAA6E;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,+BAA8B,SAAS;AACvC;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAwC,qBAAqB;AAC7D,UAAS;AACT;;AAEA,0BAAyB;AACzB;AACA,wBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA,oCAAmC,KAAK;AACxC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,2DAA0D,SAAS;AACnE;;AAEA;AACA;AACA;;AAEA;AACA,kDAAiD,eAAe;AAChE;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,iDAAgD;AAChD;AACA;;AAEA,gDAA+C;AAC/C;AACA;AACA;AACA,uBAAsB;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qDAAoD;AACpD;AACA;;AAEA,oDAAmD;AACnD;AACA;AACA;AACA,uBAAsB;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sDAAqD;AACrD;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;;;;AAIA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA4C,UAAU;AACtD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qCAAoC,WAAW;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,gBAAe;AACf;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;AAKA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;AAKA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;AAKA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA4C,UAAU;AACtD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qCAAoC,WAAW;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;AAKA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,gBAAe;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;AAIA;;AAEA;AACA;AACA;AACA,oDAAmD,gBAAgB;AACnE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kDAAiD,gBAAgB;AACjE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kDAAiD,UAAU;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAoB,cAAc;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA,uCAAsC,iBAAiB;AACvD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wCAAuC,oBAAoB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA,uBAAsB,mBAAmB;AACzC;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAoB,aAAa;AACjC;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAoB,aAAa;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC,sBAAsB;AAC5D,QAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAwB,oBAAoB;AAC5C;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yBAAwB,oBAAoB;AAC5C;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kDAAiD;AACjD;AACA;;AAEA;AACA;AACA;;AAEA,sDAAqD;AACrD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAgC,eAAe;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC,iBAAiB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAwC,qBAAqB;AAC7D,UAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA,2CAA0C,KAAK;AAC/C;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA4D;AAC5D;AACA,2BAA0B,+CAA+C;AACzE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB;AACxB;AACA;AACA;AACA;AACA,sDAAqD,wCAAwC;AAC7F,6DAA4D,gBAAgB;AAC5E;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qDAAoD;AACpD;AACA;AACA,kDAAiD;AACjD;AACA;AACA;;AAEA,gEAA+D;AAC/D;AACA;AACA,gDAA+C;AAC/C;AACA;AACA;;AAEA,kEAAiE;AACjE;AACA;AACA;AACA,4BAA2B,wBAAwB;AACnD;AACA,2BAA0B,4CAA4C;AACtE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oEAAmE;AACnE;AACA,iDAAgD,mCAAmC;AACnF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gEAA+D;AAC/D,iDAAgD,wBAAwB;AACxE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,sCAAqC;AACrC;AACA,2DAA0D;AAC1D,4CAA2C;AAC3C;AACA;AACA,wCAAuC;AACvC,6CAA4C;AAC5C;AACA,8DAA6D;AAC7D,kDAAiD,kCAAkC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,0CAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,gEAA+D;AAC/D;AACA,6BAA4B,8DAA8D;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,6CAA4C;AAC5C;AACA;AACA;AACA,6CAA4C;AAC5C;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP,mDAAkD;AAClD;AACA,0DAAyD;AACzD,kDAAiD,wBAAwB;AACzE;AACA;AACA,iCAAgC;AAChC;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA,MAAK;AACL;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA,MAAK;AACL;AACA,uCAAsC,oCAAoC;AAC1E;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA,QAAO;AACP;;AAEA;AACA;;;AAGA;AACA;AACA,6DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,gEAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;;AAGA;AACA;AACA,8DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,gEAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,QAAO;AACP;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,MAAK,uBAAuB,oBAAoB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,8CAA6C;AAC7C;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;;AAGA;AACA;AACA;AACA,wBAAuB;AACvB;AACA;;;AAGA;AACA;AACA;AACA,mEAAkE;AAClE;AACA;AACA,UAAS;AACT,+CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB;AACvB;AACA,mCAAkC,6CAA6C;AAC/E;AACA,wBAAuB,uBAAuB,EAAE;AAChD,wBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA8B,mCAAmC;AACjE,kCAAiC,kDAAkD;AACnF;AACA,MAAK;AACL,+CAA8C,4CAA4C;AAC1F;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,8DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,+CAA8C,gBAAgB;AAC9D,6CAA4C,cAAc;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAqD,eAAe;AACpE;AACA,QAAO;AACP;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,oDAAmD,KAAK;AACxD;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4DAA2D;AAC3D,sEAAqE,qBAAqB;AAC1F;;AAEA,yDAAwD;AACxD,sEAAqE,qBAAqB;AAC1F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,kBAAkB;AACvD,UAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAmC,KAAK;AACxC;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,uCAAsC;AACtC,0CAAyC,oBAAoB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB,mBAAmB;AAC3C,4DAA2D,sBAAsB;AACjF;AACA,QAAO;AACP;;AAEA,2CAA0C;AAC1C;AACA;AACA;AACA,0CAAyC,yBAAyB;AAClE;AACA;AACA;AACA,6CAA4C,4BAA4B;AACxE;AACA;AACA,UAAS;AACT,QAAO;AACP;;AAEA,0CAAyC;AACzC;AACA;AACA;AACA,0CAAyC,yBAAyB;AAClE;AACA;AACA;AACA,2CAA0C,4BAA4B;AACtE;AACA;AACA,UAAS;AACT,QAAO;AACP;;AAEA;AACA;AACA;;AAEA,iDAAgD;AAChD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sDAAqD;AACrD,mDAAkD,wBAAwB;AAC1E;;AAEA;AACA,6CAA4C,SAAS;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,kBAAkB;AACvD,UAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2CAA0C,KAAK;AAC/C;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0CAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;;;AAGA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qCAAoC,oCAAoC;AACxE;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,kDAAiD,cAAc,EAAE;AACjE;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,2BAA0B;AAC1B;AACA,MAAK;;AAEL;AACA;AACA,2BAA0B;AAC1B;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,uCAAsC,eAAe,EAAE;AACvD;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;;AAGL;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,MAAK;;;AAGL;;AAEA,yBAAwB;AACxB;AACA,MAAK;;AAEL;AACA,0CAAyC,8BAA8B;AACvE,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,QAAO;AACP;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;;AAGL;;AAEA;AACA;AACA,MAAK;;AAEL;AACA,kFAAiF,YAAY;AAC7F,MAAK;;AAEL;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAkD;AAClD;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA,2CAA0C,0BAA0B;AACpE,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,2CAA0C,4BAA4B;AACtE,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA,6CAA4C,8BAA8B;AAC1E,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;;AAGL;;AAEA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA2C,wBAAwB;AACnE;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,MAAK;;AAEL,4CAA2C;AAC3C;AACA;AACA;AACA,4BAA2B;AAC3B;AACA;AACA,MAAK;;AAEL,yCAAwC;AACxC;AACA;AACA,4BAA2B;AAC3B;AACA;AACA;;AAEA,IAAG;;AAEH;AACA;AACA;AACA;AACA,8DAA6D;;;;AAI7D;;AAEA;;AAEA;AACA;AACA,MAAK;;;AAGL;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;;AAGL;;AAEA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,sCAAqC,qBAAqB;AAC1D,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA,IAAG;;AAEH;AACA;;;;AAIA;;AAEA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA,IAAG;;AAEH;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B,8CAA8C,EAAE;AAC3E,4BAA2B,yCAAyC,EAAE;AACtE;AACA,yBAAwB,0BAA0B,EAAE;AACpD,yBAAwB,qBAAqB;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yDAAwD;AACxD;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,EAAC,G;;;;;;;ACh3JD,iCAAgE,CAAY,CAAC;AAI7E,yBAAwB,IAAW,EAAE,KAAwB;KAC3D,IAAM,OAAO,GAAG,KAAK,CAAC,SAAS,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;KACrD,IAAM,KAAK,GAAG,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,EAAE,EAAE,CAAC;KAC3D,MAAM,CAAC,QAAE,CAAC,WAAW,EAAE,KAAK,EAC1B,IAAI;WACA;aACA,QAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACf,QAAE,CAAC,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;UAC1C;WACC,EAAE,CACP,CAAC;AACJ,EAAC;AAED,8BAA6B,OAAgB;KAC3C,MAAM,CAAC,CAAC,OAAO,GAAG,EAAE,GAAG,sBAAsB,CAAC;AAChD,EAAC;AAED,eAAc,MAAiC;KAC7C,IAAM,MAAM,GACV,MAAM;UACH,GAAG,CAAC,eAAK;SACR,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;SACxB,IAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;SACpB,IAAM,UAAU,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC7D,IAAM,OAAO,GAAG,KAAK,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC;SACvC,MAAM,CAAC,SAAG,CAAC,WAAW,EAAE;aACtB,QAAE,CAAC,qBAAqB,EAAE,uBAAuB,GAAG,UAAU,CAAC;aAC/D,aAAO,CAAC,sBAAsB,EAAE;iBAC9B,QAAE,CAAC,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,cAAI,IAAI,qBAAc,CAAC,IAAI,EAAE,KAAK,CAAC,EAA3B,CAA2B,CAAC,CAAC;iBACtE,SAAG,CAAC,qBAAqB,EAAE;qBACzB,YAAM,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;qBAC9D,YAAM,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;kBACnE,CAAC;cACH,CAAC;UACH,CAAC,CAAC;KACL,CAAC,CAAC,CAAC;KACP,MAAM,CAAC,MAAM,CAAC;AAChB,EAAC;AAED;mBAAe,IAAI,CAAC;;;;;;;AC7CpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,qBAAqB;AAChC;AACA,YAAW,iBAAiB;AAC5B;AACA;AACA,aAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA,YAAW,kBAAkB;AAC7B;AACA;AACA,aAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAkC,WAAW;AAC7C,uCAAsC,WAAW;AACjD,OAAM;AACN;AACA,oCAAmC,WAAW;AAC9C,oCAAmC,eAAe;AAClD;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,QAAQ,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAoB,QAAQ,cAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,wBAAwB;AAChC;AACA;AACA;AACA;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;ACrRA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAa,sBAAsB;AACnC;AACA;AACA;AACA,YAAW,+BAA+B;AAC1C;AACA,IAAG;AACH;;;;;;;AChCA;AACA;;AAEA;AACA;AACA;AACA,oBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;;AAEA;AACA,gBAAe;AACf;AACA;AACA,uBAAsB,cAAc;AACpC,gCAA+B,UAAU;AACzC,IAAG;AACH,uBAAsB,cAAc;AACpC,gCAA+B,UAAU;AACzC,WAAU,UAAU;AACpB;AACA;AACA,gBAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AChCA;AACA;AACA,WAAU;AACV;AACA;;;;;;;ACJA;AACA;AACA,2BAA0B,uDAAuD,EAAE;AACnF;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC,iCAAiC,EAAE;AACtE;AACA;AACA,0DAAyD,kBAAkB,EAAE;AAC7E,yCAAwC,mEAAmE,EAAE;AAC7G;AACA;AACA,mCAAkC,oBAAoB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,EAAE;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0C;;;;;;AC1DA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAqB,wBAAwB;AAC7C,oBAAmB,wBAAwB;;AAE3C,6BAA4B;;AAE5B;AACA;AACA;;AAEA;AACA,kBAAiB;AACjB,qBAAoB,aAAa;AACjC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,cAAa,kBAAkB;AAC/B;AACA,gBAAe,oBAAoB;AACnC;AACA;AACA;;AAEA;AACA,oDAAmD;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,qBAAqB;AACxC;AACA;AACA,QAAO;AACP;AACA;AACA,kBAAiB,uBAAuB;AACxC,2BAA0B;AAC1B;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAU,oBAAoB;AAC9B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAiB,wBAAwB;AACzC;AACA,oBAAmB,2BAA2B;AAC9C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAU,oBAAoB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,uBAAuB;AAC5C;AACA;AACA,YAAW;AACX;AACA;AACA,UAAS,OAAO;AAChB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,8CAA6C;AAC7C,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,QAAO,kDAAkD;AACzD;AACA;AACA;AACA;AACA,QAAO,kDAAkD;AACzD;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,iCAAgC;AAChC;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB,uBAAuB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAe,oBAAoB;;AAEnC;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,gBAAe,+BAA+B;AAC9C;AACA;AACA,gBAAe,qBAAqB;AACpC;AACA;AACA;;AAEA,mBAAkB;;;;;;;AC1QlB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAoC,iBAAiB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA4D,iCAAiC,EAAE;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA,0C;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,MAAK;AACL;AACA;AACA;AACA,iCAAgC,8BAA8B,EAAE;AAChE,oCAAmC,iCAAiC,EAAE;AACtE,oCAAmC,iCAAiC;AACpE;AACA,iBAAgB;AAChB,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,6BAA4B,wCAAwC;AACpE;AACA;AACA,+CAA8C,cAAc;AAC5D;AACA,kC;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA,0C;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B,IAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA,yC;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA8B,6CAA6C,EAAE;AAC7E;AACA;AACA;AACA;AACA;AACA,2CAA0C,+CAA+C,EAAE;AAC3F;AACA;AACA,kC;;;;;;AClCA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,QAAQ;AACnB,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,kBAAiB,kBAAkB;AACnC;AACA;AACA;AACA,E;;;;;;AC5BA;AACA;AACA;AACA,iCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA,+CAA8C,sBAAsB;AACpE;AACA,UAAS;AACT;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,sC;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,oC;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA8C,0BAA0B;AACxE;AACA;AACA,+CAA8C,yBAAyB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAgC,wBAAwB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAgC,mEAAmE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA,2C;;;;;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA8E;AAC9E;AACA;AACA,EAAC;AACD;AACA,yC;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAiD,UAAU,EAAE;AAC7D,oBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wC;;;;;;AC/DA;;AAEA;AACA;AACA,EAAC;AACD;;AAEA;;AAEA;;AAEA,uCAAsC,uCAAuC,gBAAgB;;AAE7F;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA,E;;;;;;ACtCA;;AAEA;AACA;AACA,EAAC;AACD;;AAEA;;AAEA;;AAEA,uCAAsC,uCAAuC,gBAAgB;;AAE7F;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,cAAa,qBAAqB;AAClC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,cAAc;AACzB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAqD;AACrD;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,EAAC;;;;;;;ACzGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA8C,cAAc;AAC5D;AACA,oC;;;;;;ACfA;AACA;AACA,2CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAkB;;;;;;;ACjBlB;AACA;AACA,2CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAkB;;;;;;;ACjBlB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wCAAuC,SAAS;AAChD;AACA;;AAEA;AACA;AACA,2CAA0C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAkB;;;;;;;ACtClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAuB,UAAU;AACjC;;AAEA;AACA;AACA,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP,gBAAe;AACf;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,sBAAqB,gBAAgB;AACrC;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA,mBAAkB;;;;;;;ACxClB;AACA,+BAA8B,iBAAiB,SAAS,EAAE,EAAE;;AAE5D;AACA,yBAAwB,iBAAiB,EAAE;AAC3C;;AAEA;AACA;AACA,2CAA0C;AAC1C,qCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ,kBAAkB;AAC1B;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA,mBAAkB;;;;;;;AC/DlB;AACA,+BAA8B,iBAAiB,SAAS,EAAE,EAAE;;AAE5D;AACA,yBAAwB,iBAAiB,EAAE;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2CAA0C;AAC1C,sDAAqD;AACrD,mFAAkF;AAClF,4DAA2D;AAC3D,kEAAiE;AACjE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa,oBAAoB;AACjC;AACA;AACA;AACA;AACA,iEAAgE;AAChE;AACA,gEAA+D;AAC/D;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA,mFAAkF;AAClF;AACA;AACA;AACA;AACA,2CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAwC;AACxC;AACA,6CAA4C;AAC5C,+CAA8C;AAC9C,2BAA0B;AAC1B;AACA;AACA;AACA;AACA,gHAA+G;AAC/G;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;;AAEA,mBAAkB;;;;;;;ACvJlB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAoE;AACpE,gFAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAgE,SAAS;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,qEAAoE;AACpE,gFAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA,0C;;;;;;AClHA;;AAEA;;;;;;;ACFA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;AC/BA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF,0BAAyB,wCAAwC,EAAE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA,GAAE;AACF,uBAAsB,kCAAkC,EAAE;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF,0BAAyB,oCAAoC,EAAE;AAC/D,yBAAwB,oCAAoC,EAAE;AAC9D,2BAA0B,uBAAuB,EAAE;AACnD,EAAC;AACD;AACA;AACA,EAAC;AACD;;;;;;;ACvGA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;;;;;;ACXA;;AAEA;AACA;AACA;AACA;;;;;;;ACLA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,wCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB,OAAO;AAC3B;AACA;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;;;;;;;AC5BA;;AAEA;;AAEA;;AAEA,oCAAmC,iCAAiC;;;;;;;ACNpE;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACXA;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACNA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACNA;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACVA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,iBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA4C;AAC5C,4DAA2D;AAC3D,EAAC;AACD,qCAAoC;AACpC;;AAEA;AACA;AACA,mBAAkB;AAClB;AACA,IAAG,iBAAiB;AACpB,+CAA8C;AAC9C;;AAEA;AACA,8CAA6C;;AAE7C;AACA;AACA,8CAA6C;;AAE7C;AACA,EAAC;;AAED;;;;;;;ACxEA;;AAEA,YAAW;;AAEX;AACA;AACA;;;;;;;ACNA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,mBAAkB;AAClB;AACA;AACA;AACA;AACA,GAAE;AACF;;AAEA,+CAA8C;AAC9C,0DAAyD;;AAEzD;AACA;AACA;AACA,EAAC;;;;;;;ACnCD;;AAEA;AACA;AACA;AACA;;;;;;;ACLA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;;AAEA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA,GAAE;AACF;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;;AAEA,UAAS;AACT;AACA;;;;;;;AC9DA;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;AACA;AACA;AACA,SAAQ;AACR,eAAc,aAAa,GAAG,eAAe;AAC7C;AACA;;;;;;;ACRA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,QAAO,sBAAsB,EAAE;AAC/B;AACA;AACA;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrBA;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;AACA;AACA;AACA;AACA,GAAE,YAAY,cAAc;AAC5B;;;;;;;ACPA;;AAEA;;AAEA;AACA;AACA;;;;;;;ACNA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;;;;;;;AChBA;;AAEA;;AAEA,kCAAiC,kCAAkC;;;;;;;ACJnE;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;;AAEA;AACA;AACA;AACA;;;;;;;ACPA;;AAEA;;AAEA;AACA;AACA;;;;;;;ACNA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAkB;;AAElB;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,cAAa,4BAA4B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa,OAAO;;AAEpB;AACA,cAAa,2BAA2B;AACxC;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAA0B;;AAE1B;AACA;AACA;AACA;;;;;;;ACnIA;;AAEA;;;;;;;ACFA;;AAEA,mBAAkB;;AAElB;AACA;AACA;AACA;AACA,OAAM,gBAAgB,EAAE,YAAY,cAAc;;AAElD;AACA;AACA;AACA;;AAEA;AACA;;;;;;;AChBA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA,+BAA8B,sBAAsB,EAAE;AACtD,EAAC;;AAED;AACA;AACA;AACA,2BAA0B,gEAAgE,EAAE;AAC5F,0BAAyB,6BAA6B,EAAE;AACxD,EAAC;AACD;AACA;AACA;AACA;AACA,EAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrHA;;AAEA;;AAEA;AACA;AACA;AACA;;;;;;;ACPA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACRA;;AAEA;;AAEA;AACA;AACA;AACA;;;;;;;ACPA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACdA;;AAEA;;AAEA,sCAAqC,kBAAkB,EAAE;;AAEzD,gCAA+B,kCAAkC;;;;;;;ACNjE;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;;;;;;ACTA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,yBAAwB,eAAe;AACvC;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC7CA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACdA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF,2BAA0B,kCAAkC,EAAE;AAC9D,EAAC;;;;;;;AC7BD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF,uBAAsB,yCAAyC,EAAE;AACjE;AACA,gCAA+B;AAC/B,WAAU;AACV,GAAE;AACF,4BAA2B,yBAAyB,EAAE;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF,2BAA0B,4BAA4B,EAAE;AACxD,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,GAAE;AACF;AACA;AACA;AACA,GAAE;AACF,EAAC;;AAED;AACA;AACA,EAAC;AACD;;;;;;;ACzFA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAE;AACF;;;;;;;AC9BA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB;AACjB;;;;;;;ACTA;;AAEA;AACA;;AAEA;;AAEA;AACA,YAAW;AACX;AACA;AACA;AACA,GAAE;AACF;AACA;;;;;;;ACdA;;AAEA;;;;;;;ACFA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;;;;;;AC5BA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF,2BAA0B,mCAAmC,EAAE;AAC/D,EAAC;;;;;;;ACpCD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA,GAAE;AACF,2BAA0B,gCAAgC,EAAE;AAC5D,EAAC;AACD;AACA;;;;;;;ACrCA;;AAEA;AACA;;;;;;;ACHA;;AAEA;;AAEA;AACA;AACA,2CAA0C,kBAAkB,EAAE;AAC9D;AACA;;;;;;;ACRA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,EAAC;;;;;;;ACRD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC,mBAAmB,EAAE;AAC3D;AACA;AACA;AACA;AACA;AACA,+CAA8C,6CAA6C,EAAE;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0C;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2C;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA,uC;;;;;;;ACpBA;;AAEA,6E;;;;;;;ACFA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,G;;;;;;;ACzDA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,cAAa,qBAAqB;AAClC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,G;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,cAAc;AACzB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAqD;AACrD;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,EAAC;;;;;;;;ACxGD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;;AClBA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,G;;;;;;;ACpBA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2CAA0C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,E;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;;AAEA;;;;;;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,QAAQ;AACnB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,EAAE;AACb,YAAW,OAAO;AAClB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,EAAE;AACf;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC3OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4DAA2D;AAC3D;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACxIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,8BAA6B,kBAAkB,EAAE;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AClPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4DAA2D;AAC3D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,0BAAyB,kBAAkB,EAAE;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb,aAAY;AACZ,aAAY;AACZ,eAAc;AACd,cAAa;AACb,cAAa;AACb;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,YAAY;AACzB;AACA;AACA;AACA;;AAEA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,MAAM;AACjB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,QAAQ;AACnB,YAAW,QAAQ;AACnB,YAAW,MAAM;AACjB,cAAa,MAAM;AACnB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,8BAA6B,kBAAkB,EAAE;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AClPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4DAA2D;AAC3D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,0BAAyB,kBAAkB,EAAE;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,SAAS;AACpB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,EAAE;AACb,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,OAAO;AAClB,YAAW,QAAQ;AACnB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;;AAEA,gBAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,cAAa,YAAY;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4DAA2D;AAC3D;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACxIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AClEA,oDAAmD,gBAAgB,sBAAsB,OAAO,2BAA2B,0BAA0B,yDAAyD,2BAA2B,EAAE,EAAE,EAAE,eAAe;;AAE9P;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH,oDAAmD;AACnD,G;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,SAAS;AACpB,YAAW,EAAE;AACb,YAAW,QAAQ;AACnB,cAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,YAAY;AACzB;AACA;AACA;AACA;;AAEA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAA+C,EAAE;AACjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,cAAc;AACzB,aAAY,OAAO;AACnB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,YAAY;AACzB;AACA;AACA;AACA;;AAEA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,aAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,aAAa;AACpC;AACA;AACA;AACA;AACA;AACA,2DAA0D;AAC1D;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA,0C;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA,EAAC;AACD,+CAA8C,cAAc;AAC5D;AACA,gD;;;;;;;ACvEA,qCAAuB,CAAS,CAAC;AAEjC,yCAAwB,GAA2B,CAAC;AACpD,iDAAgC,GAAmC,CAAC;AAGpE,KAAM,EAAE,GAAG,gBAAM,CAAC;AAElB,yBAAwB,IAAqB,EAAE,KAAc;KAC3D,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;KACvB,IAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;KACtB,IAAM,eAAe,GAAG,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;KACtE,IAAM,kBAAkB,GAAG,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;KAC3E,IAAM,SAAS,GACb,KAAK;UACF,MAAM,CAAC,OAAO,CAAC;UACf,GAAG,CAAC,cAAI,IAAI,WAAI,CAAC,EAAE,EAAP,CAAO,CAAC,CAAC;KAC1B,IAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;KACxD,MAAM,CAAC,CAAC,aAAa,IAAI,CAAC,eAAe,IAAI,CAAC,kBAAkB;AAClE,EAAC;AAED,0BAAyB,KAAwB;KAC/C,IAAM,KAAK,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACxC,IAAM,OAAO,GAAG,KAAK,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC;KACvC,IAAM,UAAU,GACd,KAAK;UACF,MAAM,CAAC,OAAO,CAAC;UACf,GAAG,CAAC,cAAI,IAAI,SAAE,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,EAAnC,CAAmC,CAAC;UAChD,OAAO,CAAC,6BAAmB,CAAC;UAC5B,MAAM,CAAC,cAAI;SACV,cAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACb,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC;gBACjC,CAAC,OAAO;KAFX,CAEW,CAAC,CAAC;KACnB,MAAM,CAAC,UAAU,CAAC;AACpB,EAAC;AAED,eAAc,KAAwB;KACpC,IAAM,KAAK,GACT,KAAK,CAAC,KAAK;UACR,GAAG,CAAC,cAAI,IAAI,QAAC,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,EAAtB,CAAsB,CAAC;UACnC,IAAI,CAAC,GAAG,CAAC,CAAC;KACf,MAAM,CAAC,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC;AACvC,EAAC;AAED,KAAM,cAAc,GAAG,qBAAW,CAChC,UAAC,IAAI,EAAE,IAAI,IAAK,WAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,EAAzB,CAAyB,CAC1C,CAAC;AAEF,KAAM,WAAW,GAAG,qBAAW,CAC7B,UAAC,IAAI,EAAE,IAAI,IAAK,WAAI,KAAK,IAAI,EAAb,CAAa,CAC9B,CAAC;AAEF,mBAAkB,MAAiC;KACjD,IAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;KACtD,IAAM,QAAQ,GACZ,EAAE,CAAC,KAAK,CACN,cAAc;UACX,GAAG,CAAC,eAAe,CAAC;UACpB,OAAO,CAAC,6BAAmB,CAAC;UAC5B,GAAG,CAAC,cAAI,IAAI,WAAI,CAAC,EAAE,EAAP,CAAO,CAAC,EACvB,cAAc;UACX,MAAM,CAAC,eAAK,IAAI,YAAK,CAAC,SAAS,KAAK,CAAC,CAAC,EAAtB,CAAsB,CAAC;UACvC,KAAK,CAAC,CAAC,CAAC,CAAC,CACb,CAAC,OAAO,CAAC,WAAW,CAAC;UACrB,SAAS,CAAC,IAAI,CAAC,CAAC;KACnB,MAAM,CAAC,QAAQ,CAAC;AAClB,EAAC;AAED;mBAAe,QAAQ,CAAC;;;;;;;ACpExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA,aAAY;AACZ;AACA;AACA,8BAA6B,gBAAgB;AAC7C;AACA;AACA;AACA;AACA,+CAA8C,cAAc;AAC5D;AACA,wC;;;;;;ACzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA,yBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA,+CAA8C,cAAc;AAC5D;AACA,gD;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,IAAI;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA,YAAW,OAAO;AAClB;AACA,aAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,8CAA6C,2CAA2C;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU,oBAAoB;AAC9B;AACA,0BAAyB;AACzB;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA,YAAW,OAAO;AAClB;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,2CAA0C,2CAA2C;AACrF;AACA;AACA,+CAA8C,cAAc;AAC5D;AACA,kC;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAiC,4BAA4B,EAAE;AAC/D;AACA;AACA,iCAAgC,oCAAoC,EAAE;AACtE;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,UAAS;AACT,MAAK;AACL;AACA,qCAAoC,sCAAsC,EAAE;AAC5E;AACA,sDAAqD,kBAAkB,EAAE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAoC,sCAAsC;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY;AACZ;AACA,+CAA8C,cAAc;AAC5D;AACA,kC;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,MAAK;AACL;AACA;AACA;AACA,iCAAgC,8BAA8B,EAAE;AAChE,oCAAmC,iCAAiC,EAAE;AACtE,oCAAmC,iCAAiC;AACpE;AACA,iBAAgB;AAChB,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,6BAA4B,wCAAwC;AACpE;AACA;AACA,+CAA8C,cAAc;AAC5D;AACA,kC;;;;;;;AC5CA,qCAA2C,CAAS,CAAC;AAOrD;KAEE;SACE,IAAM,EAAE,GAAG,gBAAM,CAAC;SAClB,IAAM,QAAQ,GAAsB;aAClC,KAAK,EAAE,UAAU,QAA2B;iBAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;iBACvD,IAAI,CAAC,UAAU,CAAC,SAAS;qBACvB,aAAG;yBACD,eAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAc,CAAY,CAAC;qBAAxD,CAAwD,CAAC;iBAC7D,IAAI,CAAC,UAAU,CAAC,OAAO;qBACrB,aAAG,IAAI,eAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EAAnB,CAAmB,CAAC;aAC/B,CAAC;aACD,IAAI,EAAE;iBACJ,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;aAC1B,CAAC;UACF,CAAC;SACF,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;KACrC,CAAC;KACH,oBAAC;AAAD,EAAC;AAnBY,sBAAa,gBAmBzB;AAED;KACE;SACE,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;KAC7B,CAAC;KACD,MAAM,CAAC,aAAa,CAAC;AACvB,EAAC;AALe,0BAAiB,oBAKhC;;;;;;;;ACjCD,qCAA2C,CAAS,CAAC;AACrD,kCAAqE,GAAa,CAAC;AAEnF,6CAA2B,GAAwB,CAAC;AAoBpD,KAAM,QAAQ,GAAG,mCAAmC,CAAC;AAErD;KAEE,qBAAY,YAA4B;SACtC,IAAM,EAAE,GAAG,gBAAM,CAAC;SAClB,IAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,aAAG,IAAI,UAAG,KAAK,CAAC,CAAC,EAAV,CAAU,CAAC,CAAC;SACnD,IAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,aAAG,IAAI,UAAG,KAAK,CAAC,CAAC,EAAV,CAAU,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACnE,IAAM,QAAQ,GACZ,GAAG;cACA,GAAG,CAAC,YAAE;aACL,IAAM,cAAc,GAAmB;iBACrC,GAAG,EAAE,QAAQ,GAAG,EAAE;iBAClB,QAAQ,EAAE,OAAO;iBACjB,IAAI,EAAE,IAAI;cACX,CAAC;aACF,MAAM,CAAC,cAAc,CAAC;SACxB,CAAC,CAAC,CAAC;SACP,IAAM,IAAI,GAAe,qBAAc,EAAE,CAAC,QAAQ,EAAE,yBAAc,CAAC,CAAC;SACpE,IAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAW,IAAI,CAAC,CAAC,CAAC;SACtD,IAAM,UAAU,GAA6B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SAClE,IAAI,CAAC,KAAK;aACR,EAAE;kBACC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC;kBAC3B,OAAO,EAAE;kBACT,MAAM,CAAC,OAAO,CAAC;kBACf,GAAG,CAAC,kBAAQ,IAAI,WAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAU,EAAlC,CAAkC,CAAC;kBACnD,QAAQ,EAAE,CAAC;KAClB,CAAC;KACH,kBAAC;AAAD,EAAC;AA3BY,oBAAW,cA2BvB;AAED;KACE,qBAAqB,YAA4B;SAC/C,MAAM,CAAC,IAAI,WAAW,CAAC,YAAY,CAAC,CAAC;KACvC,CAAC;KACD,MAAM,CAAC,WAAW,CAAC;AACrB,EAAC;AALe,wBAAe,kBAK9B;;;;;;;AC3DD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,kC;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAkD,QAAQ;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,UAAS;AACT,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC,oBAAoB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,EAAE;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAgC,oBAAoB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,EAAE;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wC;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA,qCAAoC,iBAAiB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAmE,8BAA8B,EAAE;AACnG;AACA;AACA;AACA;AACA;AACA,yDAAwD,2DAA2D,EAAE;AACrH;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA,2C;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,oC;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,MAAK;AACL;AACA;AACA;AACA,iCAAgC,8BAA8B,EAAE;AAChE,oCAAmC,iCAAiC,EAAE;AACtE,oCAAmC,iCAAiC;AACpE;AACA,iBAAgB;AAChB,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,6BAA4B,wCAAwC;AACpE;AACA;AACA,+CAA8C,cAAc;AAC5D;AACA,kC;;;;;;AC5CA;AACA;AACA;;AAEA;AACA,qCAAoC;AACpC;AACA,EAAC,wCAAwC;AACzC;AACA,EAAC,OAAO;AACR;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,UAAS,+CAA+C,EAAE;AAC1D,UAAS,gDAAgD,EAAE;AAC3D,UAAS,gDAAgD,EAAE;AAC3D,UAAS,4CAA4C,EAAE;AACvD;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA,kBAAiB,iBAAiB;AAClC,kBAAiB,sCAAsC;;AAEvD;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,OAAO;AAClB,YAAW,MAAM;AACjB;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,cAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sCAAqC,SAAS;AAC9C;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAc;;AAEd,sCAAqC,SAAS;AAC9C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA,wBAAuB;AACvB;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA,wBAAuB;AACvB;AACA;AACA;;AAEA;AACA;AACA,IAAG,IAAI;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA4C;AAC5C,yCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA,kBAAiB,aAAa;AAC9B,+BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA,kBAAiB,aAAa,iBAAiB;AAC/C;AACA;AACA;AACA;AACA,2BAA0B,aAAa;AACvC,+BAA8B;AAC9B;AACA;AACA;AACA;AACA,2BAA0B,aAAa,iBAAiB;AACxD;AACA,YAAW,eAAe;AAC1B,YAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4CAA2C;AAC3C;AACA;AACA,YAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAmB;AACnB,qBAAoB;AACpB;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,mBAAkB;AAClB;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc,gBAAgB;AAC9B;AACA,WAAU,cAAc;AACxB,YAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAwE,mBAAmB;AAC3F;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,UAAU;AACrB,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,SAAS;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS,sBAAsB,WAAW,YAAY;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,6FAA4F;AAC5F;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,eAAe;AAC1B,YAAW,SAAS;AACpB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,eAAe;AAC1B,YAAW,SAAS;AACpB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,eAAe;AAC1B,YAAW,SAAS;AACpB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,MAAM;AACjB,YAAW,SAAS;AACpB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,MAAM;AACjB,YAAW,SAAS;AACpB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,eAAe;AAC1B,YAAW,SAAS;AACpB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC58BA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,MAAM;AACjB,aAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA2C,SAAS;AACpD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;;;;;;;AClKA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,aAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,mCAAkC;AAClC,QAAO;AACP,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB,oDAAoD;AACpE;AACA;AACA,YAAW,cAAc;AACzB,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,sCAAsC;AACjD,aAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAA+B;AAC/B,gCAA+B;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAY,OAAO;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA,eAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA,mBAAkB,aAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAkB,aAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,cAAc;AACzB,aAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;;;;;AC1VA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,gBAAgB;AAC3B,aAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA","file":"./dist/app.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap ccbe942a5b899d1ded87\n **/","import main from './main';\nimport { makeDOMDriver } from '@cycle/dom';\nimport { run } from '@cycle/xstream-run';\nimport { makePlanetsDriver } from './drivers/planets';\nimport { makeJedisDriver } from './drivers/jedis';\n\nrun(main, {\n dom: makeDOMDriver('#app'),\n planets: makePlanetsDriver(),\n jedis: makeJedisDriver()\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/app.ts\n **/","import { ISources, ISinks } from './definitions';\nimport intent from './intent';\nimport model from './model';\nimport view from './view';\nimport requests from './requests';\n\nfunction main(sources: ISources): ISinks {\n const jedi$ = sources.jedis.jedi$;\n const planet$ = sources.planets.planet$;\n const state$ = model(planet$, jedi$, intent(sources));\n const vNode$ = view(state$);\n const id$ = requests(state$);\n const sinks = {\n dom: vNode$,\n jedis: id$\n };\n return sinks;\n}\n\nexport default main;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main.ts\n **/","import { ISources } from './definitions';\nimport { Stream } from 'xstream';\n\nexport interface IIntent {\n scrollUp$: Stream;\n scrollDown$: Stream;\n\n}\n\nfunction intent(sources: ISources): IIntent {\n const dom = sources.dom;\n const intent = {\n scrollUp$: dom\n .select('.css-button-up')\n .events('click')\n .filter(ev => (ev.target as HTMLElement).className.indexOf('disabled') === -1)\n .mapTo(true),\n scrollDown$: dom\n .select('.css-button-down')\n .events('click')\n .filter(ev => (ev.target as HTMLElement).className.indexOf('disabled') === -1)\n .mapTo(true)\n };\n return intent;\n}\n\nexport default intent;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/intent.ts\n **/","import { Stream } from 'xstream';\nimport { IIntent } from './intent';\nimport reducers, { InitialState } from './reducers';\nimport { IApplicationState } from './definitions';\nimport { IPlanet } from './drivers/planets';\nimport { IJedi } from './drivers/jedis';\n\nfunction model(planet$: Stream, jedi$: Stream, intent: IIntent): Stream {\n const reducer$ = reducers(planet$, jedi$, intent);\n const state$ = reducer$.fold((next, reducer) => reducer(next), InitialState);\n return state$;\n}\n\nexport default model;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/model.ts\n **/","import { Stream } from 'xstream';\nimport { IIntent } from './intent';\nimport { ISources, IApplicationState } from './definitions';\nimport { Record } from 'immutable';\nimport { IPlanet } from './drivers/planets';\nimport { IJedi, INamedEntity, ILinkableEntity } from './drivers/jedis';\n\nconst JediRecord = Record({\n id: 0,\n name: null,\n homeworld: null,\n master: null,\n apprentice: null\n});\n\nclass Jedi extends JediRecord implements IJedi {\n id: number;\n name: string;\n homeworld: INamedEntity;\n master: ILinkableEntity;\n apprentice: ILinkableEntity;\n constructor(props: IJedi) {\n super(props);\n }\n}\n\nconst ApplicationStateRecord = Record({\n planet: null,\n jedis: new Array(),\n down: false,\n up: false,\n matchedId: -1\n});\n\nclass ApplicationState extends ApplicationStateRecord implements IApplicationState {\n planet: IPlanet;\n jedis: IJedi[];\n down: boolean;\n up: boolean;\n matchedId: number;\n constructor(props: IApplicationState) {\n super(props);\n }\n}\n\nexport const InitialState: IApplicationState = new ApplicationState({\n planet: null,\n jedis: [\n null,\n null,\n null,\n null,\n null\n ],\n down: false,\n up: false,\n matchedId: -1\n});\n\nfunction reducers(planet$: Stream, jedi$: Stream, intent: IIntent): Stream<(state: IApplicationState) => IApplicationState> {\n const xs = Stream;\n\n const planetReducer$ =\n planet$\n .map(planet =>\n (state: IApplicationState) => {\n const appState = state as ApplicationState;\n const nextState = appState.set('planet', planet) as ApplicationState;\n return nextState;\n });\n\n const jedisReducer$ =\n xs.merge(\n jedi$\n .map(jedi =>\n (state: IApplicationState) => {\n const jedis = state.jedis || new Array(5);\n const masterIndex =\n jedis\n .map(j => (j && j.master) ? j.master.id : -1)\n .indexOf(jedi.id);\n const appState = state as ApplicationState;\n var index = 2;\n if (masterIndex !== -1)\n index = masterIndex - 1;\n else {\n const apprenticeIndex =\n jedis\n .map(j => (j && j.apprentice) ? j.apprentice.id : -1)\n .indexOf(jedi.id);\n if (apprenticeIndex !== -1)\n index = apprenticeIndex + 1;\n }\n const newJedis =\n jedis\n .map((j, i) =>\n i === index\n ? new Jedi(jedi)\n : j);\n const nextState = appState.set('jedis', newJedis) as ApplicationState;\n return nextState;\n }),\n intent.scrollUp$\n .mapTo((state: IApplicationState) => {\n const jedis = state.jedis;\n const newJedis =\n jedis\n .map((jedi, i, array) => (i < 2) ? null : array[i - 2]);\n const appState = state as ApplicationState;\n const nextState = appState.set('jedis', newJedis) as ApplicationState;\n return nextState;\n }),\n intent.scrollDown$\n .mapTo((state: IApplicationState) => {\n const jedis = state.jedis;\n const newJedis =\n jedis\n .map((jedi, i, array) => (i > 2) ? null : array[i + 2]);\n const appState = state as ApplicationState;\n const nextState = appState.set('jedis', newJedis) as ApplicationState;\n return nextState;\n })\n );\n\n const downReducer$ =\n jedisReducer$\n .mapTo((state: IApplicationState) => {\n const jedis = state.jedis;\n const lastJedi = jedis.filter(jedi => !!jedi).pop();\n const index = jedis.indexOf(lastJedi);\n const down = lastJedi && lastJedi.apprentice && lastJedi.apprentice.id;\n const appState = state as ApplicationState;\n const nextState = appState.set('down', down) as ApplicationState;\n return nextState;\n });\n\n const upReducer$ =\n jedisReducer$\n .mapTo((state: IApplicationState) => {\n const jedis = state.jedis;\n const firstJedi = jedis.filter(jedi => !!jedi).shift();\n const index = jedis.indexOf(firstJedi);\n const up = firstJedi && firstJedi.master && firstJedi.master.id;\n const appState = state as ApplicationState;\n const nextState = appState.set('up', up) as ApplicationState;\n return nextState;\n });\n\n const matchedIdReducer$ =\n xs.merge<{}>(\n jedi$,\n planet$\n ).mapTo((state: IApplicationState) => {\n const planet = state.planet;\n const appState = state as ApplicationState;\n const noMatchState = appState.set('matchedId', -1) as ApplicationState;\n if (!planet || !planet.id)\n return noMatchState;\n const planetId = planet.id;\n const matchedJedi =\n state.jedis\n .filter(jedi => !!jedi && jedi.homeworld.id === planetId)\n .pop();\n if (!matchedJedi)\n return noMatchState;\n const nextState = noMatchState.set('matchedId', matchedJedi.id) as ApplicationState;\n return nextState;\n });\n\n return xs.merge(\n planetReducer$,\n jedisReducer$,\n downReducer$,\n upReducer$,\n matchedIdReducer$\n );\n}\n\nexport default reducers;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/reducers.ts\n **/","\"use strict\";\nvar core_1 = require('./core');\nexports.Stream = core_1.Stream;\nexports.MemoryStream = core_1.MemoryStream;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = core_1.Stream;\n//# sourceMappingURL=index.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/xstream/index.js\n ** module id = 5\n ** module chunks = 0\n **/","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar NO = {};\nfunction noop() { }\nfunction copy(a) {\n var l = a.length;\n var b = Array(l);\n for (var i = 0; i < l; ++i) {\n b[i] = a[i];\n }\n return b;\n}\nexports.NO_IL = {\n _n: noop,\n _e: noop,\n _c: noop,\n};\n// mutates the input\nfunction internalizeProducer(producer) {\n producer._start =\n function _start(il) {\n il.next = il._n;\n il.error = il._e;\n il.complete = il._c;\n this.start(il);\n };\n producer._stop = producer.stop;\n}\nfunction compose2(f1, f2) {\n return function composedFn(arg) {\n return f1(f2(arg));\n };\n}\nfunction and(f1, f2) {\n return function andFn(t) {\n return f1(t) && f2(t);\n };\n}\nvar MergeProducer = (function () {\n function MergeProducer(insArr) {\n this.type = 'merge';\n this.insArr = insArr;\n this.out = NO;\n this.ac = 0;\n }\n MergeProducer.prototype._start = function (out) {\n this.out = out;\n var s = this.insArr;\n var L = s.length;\n this.ac = L;\n for (var i = 0; i < L; i++) {\n s[i]._add(this);\n }\n };\n MergeProducer.prototype._stop = function () {\n var s = this.insArr;\n var L = s.length;\n for (var i = 0; i < L; i++) {\n s[i]._remove(this);\n }\n this.out = NO;\n };\n MergeProducer.prototype._n = function (t) {\n var u = this.out;\n if (u === NO)\n return;\n u._n(t);\n };\n MergeProducer.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n MergeProducer.prototype._c = function () {\n if (--this.ac <= 0) {\n var u = this.out;\n if (u === NO)\n return;\n u._c();\n }\n };\n return MergeProducer;\n}());\nexports.MergeProducer = MergeProducer;\nvar CombineListener = (function () {\n function CombineListener(i, out, p) {\n this.i = i;\n this.out = out;\n this.p = p;\n p.ils.push(this);\n }\n CombineListener.prototype._n = function (t) {\n var p = this.p, out = this.out;\n if (!out)\n return;\n if (p.up(t, this.i)) {\n out._n(p.vals);\n }\n };\n CombineListener.prototype._e = function (err) {\n var out = this.out;\n if (!out)\n return;\n out._e(err);\n };\n CombineListener.prototype._c = function () {\n var p = this.p;\n if (!p.out)\n return;\n if (--p.Nc === 0) {\n p.out._c();\n }\n };\n return CombineListener;\n}());\nexports.CombineListener = CombineListener;\nvar CombineProducer = (function () {\n function CombineProducer(insArr) {\n this.type = 'combine';\n this.insArr = insArr;\n this.out = NO;\n this.ils = [];\n this.Nc = this.Nn = 0;\n this.vals = [];\n }\n CombineProducer.prototype.up = function (t, i) {\n var v = this.vals[i];\n var Nn = !this.Nn ? 0 : v === NO ? --this.Nn : this.Nn;\n this.vals[i] = t;\n return Nn === 0;\n };\n CombineProducer.prototype._start = function (out) {\n this.out = out;\n var s = this.insArr;\n var n = this.Nc = this.Nn = s.length;\n var vals = this.vals = new Array(n);\n if (n === 0) {\n out._n([]);\n out._c();\n }\n else {\n for (var i = 0; i < n; i++) {\n vals[i] = NO;\n s[i]._add(new CombineListener(i, out, this));\n }\n }\n };\n CombineProducer.prototype._stop = function () {\n var s = this.insArr;\n var n = s.length;\n for (var i = 0; i < n; i++) {\n s[i]._remove(this.ils[i]);\n }\n this.out = NO;\n this.ils = [];\n this.vals = [];\n };\n return CombineProducer;\n}());\nexports.CombineProducer = CombineProducer;\nvar FromArrayProducer = (function () {\n function FromArrayProducer(a) {\n this.type = 'fromArray';\n this.a = a;\n }\n FromArrayProducer.prototype._start = function (out) {\n var a = this.a;\n for (var i = 0, l = a.length; i < l; i++) {\n out._n(a[i]);\n }\n out._c();\n };\n FromArrayProducer.prototype._stop = function () {\n };\n return FromArrayProducer;\n}());\nexports.FromArrayProducer = FromArrayProducer;\nvar FromPromiseProducer = (function () {\n function FromPromiseProducer(p) {\n this.type = 'fromPromise';\n this.on = false;\n this.p = p;\n }\n FromPromiseProducer.prototype._start = function (out) {\n var prod = this;\n this.on = true;\n this.p.then(function (v) {\n if (prod.on) {\n out._n(v);\n out._c();\n }\n }, function (e) {\n out._e(e);\n }).then(null, function (err) {\n setTimeout(function () { throw err; });\n });\n };\n FromPromiseProducer.prototype._stop = function () {\n this.on = false;\n };\n return FromPromiseProducer;\n}());\nexports.FromPromiseProducer = FromPromiseProducer;\nvar PeriodicProducer = (function () {\n function PeriodicProducer(period) {\n this.type = 'periodic';\n this.period = period;\n this.intervalID = -1;\n this.i = 0;\n }\n PeriodicProducer.prototype._start = function (stream) {\n var self = this;\n function intervalHandler() { stream._n(self.i++); }\n this.intervalID = setInterval(intervalHandler, this.period);\n };\n PeriodicProducer.prototype._stop = function () {\n if (this.intervalID !== -1)\n clearInterval(this.intervalID);\n this.intervalID = -1;\n this.i = 0;\n };\n return PeriodicProducer;\n}());\nexports.PeriodicProducer = PeriodicProducer;\nvar DebugOperator = (function () {\n function DebugOperator(arg, ins) {\n this.type = 'debug';\n this.ins = ins;\n this.out = NO;\n this.s = noop;\n this.l = '';\n if (typeof arg === 'string') {\n this.l = arg;\n }\n else {\n this.s = arg;\n }\n }\n DebugOperator.prototype._start = function (out) {\n this.out = out;\n this.ins._add(this);\n };\n DebugOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.out = NO;\n };\n DebugOperator.prototype._n = function (t) {\n var u = this.out;\n if (u === NO)\n return;\n var s = this.s, l = this.l;\n if (s !== noop) {\n try {\n s(t);\n }\n catch (e) {\n u._e(e);\n }\n }\n else if (l) {\n console.log(l + ':', t);\n }\n else {\n console.log(t);\n }\n u._n(t);\n };\n DebugOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n DebugOperator.prototype._c = function () {\n var u = this.out;\n if (u === NO)\n return;\n u._c();\n };\n return DebugOperator;\n}());\nexports.DebugOperator = DebugOperator;\nvar DropOperator = (function () {\n function DropOperator(max, ins) {\n this.type = 'drop';\n this.ins = ins;\n this.out = NO;\n this.max = max;\n this.dropped = 0;\n }\n DropOperator.prototype._start = function (out) {\n this.out = out;\n this.dropped = 0;\n this.ins._add(this);\n };\n DropOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.out = NO;\n };\n DropOperator.prototype._n = function (t) {\n var u = this.out;\n if (u === NO)\n return;\n if (this.dropped++ >= this.max)\n u._n(t);\n };\n DropOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n DropOperator.prototype._c = function () {\n var u = this.out;\n if (u === NO)\n return;\n u._c();\n };\n return DropOperator;\n}());\nexports.DropOperator = DropOperator;\nvar OtherIL = (function () {\n function OtherIL(out, op) {\n this.out = out;\n this.op = op;\n }\n OtherIL.prototype._n = function (t) {\n this.op.end();\n };\n OtherIL.prototype._e = function (err) {\n this.out._e(err);\n };\n OtherIL.prototype._c = function () {\n this.op.end();\n };\n return OtherIL;\n}());\nvar EndWhenOperator = (function () {\n function EndWhenOperator(o, ins) {\n this.type = 'endWhen';\n this.ins = ins;\n this.out = NO;\n this.o = o;\n this.oil = exports.NO_IL;\n }\n EndWhenOperator.prototype._start = function (out) {\n this.out = out;\n this.o._add(this.oil = new OtherIL(out, this));\n this.ins._add(this);\n };\n EndWhenOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.o._remove(this.oil);\n this.out = NO;\n this.oil = exports.NO_IL;\n };\n EndWhenOperator.prototype.end = function () {\n var u = this.out;\n if (u === NO)\n return;\n u._c();\n };\n EndWhenOperator.prototype._n = function (t) {\n var u = this.out;\n if (u === NO)\n return;\n u._n(t);\n };\n EndWhenOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n EndWhenOperator.prototype._c = function () {\n this.end();\n };\n return EndWhenOperator;\n}());\nexports.EndWhenOperator = EndWhenOperator;\nvar FilterOperator = (function () {\n function FilterOperator(passes, ins) {\n this.type = 'filter';\n this.ins = ins;\n this.out = NO;\n this.passes = passes;\n }\n FilterOperator.prototype._start = function (out) {\n this.out = out;\n this.ins._add(this);\n };\n FilterOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.out = NO;\n };\n FilterOperator.prototype._n = function (t) {\n var u = this.out;\n if (u === NO)\n return;\n try {\n if (this.passes(t))\n u._n(t);\n }\n catch (e) {\n u._e(e);\n }\n };\n FilterOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n FilterOperator.prototype._c = function () {\n var u = this.out;\n if (u === NO)\n return;\n u._c();\n };\n return FilterOperator;\n}());\nexports.FilterOperator = FilterOperator;\nvar FlattenListener = (function () {\n function FlattenListener(out, op) {\n this.out = out;\n this.op = op;\n }\n FlattenListener.prototype._n = function (t) {\n this.out._n(t);\n };\n FlattenListener.prototype._e = function (err) {\n this.out._e(err);\n };\n FlattenListener.prototype._c = function () {\n this.op.inner = NO;\n this.op.less();\n };\n return FlattenListener;\n}());\nvar FlattenOperator = (function () {\n function FlattenOperator(ins) {\n this.type = 'flatten';\n this.ins = ins;\n this.out = NO;\n this.open = true;\n this.inner = NO;\n this.il = exports.NO_IL;\n }\n FlattenOperator.prototype._start = function (out) {\n this.out = out;\n this.open = true;\n this.inner = NO;\n this.il = exports.NO_IL;\n this.ins._add(this);\n };\n FlattenOperator.prototype._stop = function () {\n this.ins._remove(this);\n if (this.inner !== NO)\n this.inner._remove(this.il);\n this.out = NO;\n this.open = true;\n this.inner = NO;\n this.il = exports.NO_IL;\n };\n FlattenOperator.prototype.less = function () {\n var u = this.out;\n if (u === NO)\n return;\n if (!this.open && this.inner === NO)\n u._c();\n };\n FlattenOperator.prototype._n = function (s) {\n var u = this.out;\n if (u === NO)\n return;\n var _a = this, inner = _a.inner, il = _a.il;\n if (inner !== NO && il !== exports.NO_IL)\n inner._remove(il);\n (this.inner = s)._add(this.il = new FlattenListener(u, this));\n };\n FlattenOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n FlattenOperator.prototype._c = function () {\n this.open = false;\n this.less();\n };\n return FlattenOperator;\n}());\nexports.FlattenOperator = FlattenOperator;\nvar FoldOperator = (function () {\n function FoldOperator(f, seed, ins) {\n this.type = 'fold';\n this.ins = ins;\n this.out = NO;\n this.f = f;\n this.acc = this.seed = seed;\n }\n FoldOperator.prototype._start = function (out) {\n this.out = out;\n this.acc = this.seed;\n out._n(this.acc);\n this.ins._add(this);\n };\n FoldOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.out = NO;\n this.acc = this.seed;\n };\n FoldOperator.prototype._n = function (t) {\n var u = this.out;\n if (u === NO)\n return;\n try {\n u._n(this.acc = this.f(this.acc, t));\n }\n catch (e) {\n u._e(e);\n }\n };\n FoldOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n FoldOperator.prototype._c = function () {\n var u = this.out;\n if (u === NO)\n return;\n u._c();\n };\n return FoldOperator;\n}());\nexports.FoldOperator = FoldOperator;\nvar LastOperator = (function () {\n function LastOperator(ins) {\n this.type = 'last';\n this.ins = ins;\n this.out = NO;\n this.has = false;\n this.val = NO;\n }\n LastOperator.prototype._start = function (out) {\n this.out = out;\n this.has = false;\n this.ins._add(this);\n };\n LastOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.out = NO;\n this.val = NO;\n };\n LastOperator.prototype._n = function (t) {\n this.has = true;\n this.val = t;\n };\n LastOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n LastOperator.prototype._c = function () {\n var u = this.out;\n if (u === NO)\n return;\n if (this.has) {\n u._n(this.val);\n u._c();\n }\n else {\n u._e('TODO show proper error');\n }\n };\n return LastOperator;\n}());\nexports.LastOperator = LastOperator;\nvar MapFlattenInner = (function () {\n function MapFlattenInner(out, op) {\n this.out = out;\n this.op = op;\n }\n MapFlattenInner.prototype._n = function (r) {\n this.out._n(r);\n };\n MapFlattenInner.prototype._e = function (err) {\n this.out._e(err);\n };\n MapFlattenInner.prototype._c = function () {\n this.op.inner = NO;\n this.op.less();\n };\n return MapFlattenInner;\n}());\nvar MapFlattenOperator = (function () {\n function MapFlattenOperator(mapOp) {\n this.type = mapOp.type + \"+flatten\";\n this.ins = mapOp.ins;\n this.out = NO;\n this.mapOp = mapOp;\n this.inner = NO;\n this.il = exports.NO_IL;\n this.open = true;\n }\n MapFlattenOperator.prototype._start = function (out) {\n this.out = out;\n this.inner = NO;\n this.il = exports.NO_IL;\n this.open = true;\n this.mapOp.ins._add(this);\n };\n MapFlattenOperator.prototype._stop = function () {\n this.mapOp.ins._remove(this);\n if (this.inner !== NO)\n this.inner._remove(this.il);\n this.out = NO;\n this.inner = NO;\n this.il = exports.NO_IL;\n };\n MapFlattenOperator.prototype.less = function () {\n if (!this.open && this.inner === NO) {\n var u = this.out;\n if (u === NO)\n return;\n u._c();\n }\n };\n MapFlattenOperator.prototype._n = function (v) {\n var u = this.out;\n if (u === NO)\n return;\n var _a = this, inner = _a.inner, il = _a.il;\n if (inner !== NO && il !== exports.NO_IL)\n inner._remove(il);\n try {\n (this.inner = this.mapOp.project(v))._add(this.il = new MapFlattenInner(u, this));\n }\n catch (e) {\n u._e(e);\n }\n };\n MapFlattenOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n MapFlattenOperator.prototype._c = function () {\n this.open = false;\n this.less();\n };\n return MapFlattenOperator;\n}());\nexports.MapFlattenOperator = MapFlattenOperator;\nvar MapOperator = (function () {\n function MapOperator(project, ins) {\n this.type = 'map';\n this.ins = ins;\n this.out = NO;\n this.project = project;\n }\n MapOperator.prototype._start = function (out) {\n this.out = out;\n this.ins._add(this);\n };\n MapOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.out = NO;\n };\n MapOperator.prototype._n = function (t) {\n var u = this.out;\n if (u === NO)\n return;\n try {\n u._n(this.project(t));\n }\n catch (e) {\n u._e(e);\n }\n };\n MapOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n MapOperator.prototype._c = function () {\n var u = this.out;\n if (u === NO)\n return;\n u._c();\n };\n return MapOperator;\n}());\nexports.MapOperator = MapOperator;\nvar FilterMapOperator = (function (_super) {\n __extends(FilterMapOperator, _super);\n function FilterMapOperator(passes, project, ins) {\n _super.call(this, project, ins);\n this.type = 'filter+map';\n this.passes = passes;\n }\n FilterMapOperator.prototype._n = function (v) {\n if (this.passes(v)) {\n _super.prototype._n.call(this, v);\n }\n ;\n };\n return FilterMapOperator;\n}(MapOperator));\nexports.FilterMapOperator = FilterMapOperator;\nvar RememberOperator = (function () {\n function RememberOperator(ins) {\n this.type = 'remember';\n this.ins = ins;\n this.out = NO;\n }\n RememberOperator.prototype._start = function (out) {\n this.out = out;\n this.ins._add(out);\n };\n RememberOperator.prototype._stop = function () {\n this.ins._remove(this.out);\n this.out = NO;\n };\n return RememberOperator;\n}());\nexports.RememberOperator = RememberOperator;\nvar ReplaceErrorOperator = (function () {\n function ReplaceErrorOperator(fn, ins) {\n this.type = 'replaceError';\n this.ins = ins;\n this.out = NO;\n this.fn = fn;\n }\n ReplaceErrorOperator.prototype._start = function (out) {\n this.out = out;\n this.ins._add(this);\n };\n ReplaceErrorOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.out = NO;\n };\n ReplaceErrorOperator.prototype._n = function (t) {\n var u = this.out;\n if (u === NO)\n return;\n u._n(t);\n };\n ReplaceErrorOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n try {\n this.ins._remove(this);\n (this.ins = this.fn(err))._add(this);\n }\n catch (e) {\n u._e(e);\n }\n };\n ReplaceErrorOperator.prototype._c = function () {\n var u = this.out;\n if (u === NO)\n return;\n u._c();\n };\n return ReplaceErrorOperator;\n}());\nexports.ReplaceErrorOperator = ReplaceErrorOperator;\nvar StartWithOperator = (function () {\n function StartWithOperator(ins, val) {\n this.type = 'startWith';\n this.ins = ins;\n this.out = NO;\n this.val = val;\n }\n StartWithOperator.prototype._start = function (out) {\n this.out = out;\n this.out._n(this.val);\n this.ins._add(out);\n };\n StartWithOperator.prototype._stop = function () {\n this.ins._remove(this.out);\n this.out = NO;\n };\n return StartWithOperator;\n}());\nexports.StartWithOperator = StartWithOperator;\nvar TakeOperator = (function () {\n function TakeOperator(max, ins) {\n this.type = 'take';\n this.ins = ins;\n this.out = NO;\n this.max = max;\n this.taken = 0;\n }\n TakeOperator.prototype._start = function (out) {\n this.out = out;\n this.taken = 0;\n this.ins._add(this);\n };\n TakeOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.out = NO;\n };\n TakeOperator.prototype._n = function (t) {\n var u = this.out;\n if (u === NO)\n return;\n if (this.taken++ < this.max - 1) {\n u._n(t);\n }\n else {\n u._n(t);\n u._c();\n }\n };\n TakeOperator.prototype._e = function (err) {\n var u = this.out;\n if (u === NO)\n return;\n u._e(err);\n };\n TakeOperator.prototype._c = function () {\n var u = this.out;\n if (u === NO)\n return;\n u._c();\n };\n return TakeOperator;\n}());\nexports.TakeOperator = TakeOperator;\nvar Stream = (function () {\n function Stream(producer) {\n this._prod = producer || NO;\n this._ils = [];\n this._stopID = NO;\n this._target = NO;\n this._err = NO;\n }\n Stream.prototype._n = function (t) {\n var a = this._ils;\n var L = a.length;\n if (L == 1)\n a[0]._n(t);\n else {\n var b = copy(a);\n for (var i = 0; i < L; i++)\n b[i]._n(t);\n }\n };\n Stream.prototype._e = function (err) {\n if (this._err !== NO)\n return;\n this._err = err;\n var a = this._ils;\n var L = a.length;\n if (L == 1)\n a[0]._e(err);\n else {\n var b = copy(a);\n for (var i = 0; i < L; i++)\n b[i]._e(err);\n }\n this._x();\n };\n Stream.prototype._c = function () {\n var a = this._ils;\n var L = a.length;\n if (L == 1)\n a[0]._c();\n else {\n var b = copy(a);\n for (var i = 0; i < L; i++)\n b[i]._c();\n }\n this._x();\n };\n Stream.prototype._x = function () {\n if (this._ils.length === 0)\n return;\n if (this._prod !== NO)\n this._prod._stop();\n this._err = NO;\n this._ils = [];\n };\n Stream.prototype._lateStop = function () {\n // this._prod is not null, because this _lateStop is called from _remove\n // where we already checked that this._prod is truthy\n this._prod._stop();\n this._err = NO;\n this._stopID = NO;\n };\n Stream.prototype._add = function (il) {\n var ta = this._target;\n if (ta !== NO)\n return ta._add(il);\n var a = this._ils;\n a.push(il);\n if (a.length === 1) {\n if (this._stopID !== NO) {\n clearTimeout(this._stopID);\n this._stopID = NO;\n }\n var p = this._prod;\n if (p !== NO)\n p._start(this);\n }\n };\n Stream.prototype._remove = function (il) {\n var _this = this;\n var ta = this._target;\n if (ta !== NO)\n return ta._remove(il);\n var a = this._ils;\n var i = a.indexOf(il);\n if (i > -1) {\n a.splice(i, 1);\n if (this._prod !== NO && a.length <= 0) {\n this._err = NO;\n this._stopID = setTimeout(function () { return _this._lateStop(); });\n }\n else if (a.length === 1) {\n this._pruneCycles();\n }\n }\n };\n // If all paths stemming from `this` stream eventually end at `this`\n // stream, then we remove the single listener of `this` stream, to\n // force it to end its execution and dispose resources. This method\n // assumes as a precondition that this._ils has just one listener.\n Stream.prototype._pruneCycles = function () {\n if (this._hasNoSinks(this, [])) {\n this._remove(this._ils[0]);\n }\n };\n // Checks whether *there is no* path starting from `x` that leads to an end\n // listener (sink) in the stream graph, following edges A->B where B is a\n // listener of A. This means these paths constitute a cycle somehow. Is given\n // a trace of all visited nodes so far.\n Stream.prototype._hasNoSinks = function (x, trace) {\n if (trace.indexOf(x) !== -1) {\n return true;\n }\n else if (x.out === this) {\n return true;\n }\n else if (x.out && x.out !== NO) {\n return this._hasNoSinks(x.out, trace.concat(x));\n }\n else if (x._ils) {\n for (var i = 0, N = x._ils.length; i < N; i++) {\n if (!this._hasNoSinks(x._ils[i], trace.concat(x))) {\n return false;\n }\n }\n return true;\n }\n else {\n return false;\n }\n };\n Stream.prototype.ctor = function () {\n return this instanceof MemoryStream ? MemoryStream : Stream;\n };\n /**\n * Adds a Listener to the Stream.\n *\n * @param {Listener} listener\n */\n Stream.prototype.addListener = function (listener) {\n if (typeof listener.next !== 'function'\n || typeof listener.error !== 'function'\n || typeof listener.complete !== 'function') {\n throw new Error('stream.addListener() requires all three next, error, ' +\n 'and complete functions.');\n }\n listener._n = listener.next;\n listener._e = listener.error;\n listener._c = listener.complete;\n this._add(listener);\n };\n /**\n * Removes a Listener from the Stream, assuming the Listener was added to it.\n *\n * @param {Listener} listener\n */\n Stream.prototype.removeListener = function (listener) {\n this._remove(listener);\n };\n /**\n * Creates a new Stream given a Producer.\n *\n * @factory true\n * @param {Producer} producer An optional Producer that dictates how to\n * start, generate events, and stop the Stream.\n * @return {Stream}\n */\n Stream.create = function (producer) {\n if (producer) {\n if (typeof producer.start !== 'function'\n || typeof producer.stop !== 'function') {\n throw new Error('producer requires both start and stop functions');\n }\n internalizeProducer(producer); // mutates the input\n }\n return new Stream(producer);\n };\n /**\n * Creates a new MemoryStream given a Producer.\n *\n * @factory true\n * @param {Producer} producer An optional Producer that dictates how to\n * start, generate events, and stop the Stream.\n * @return {MemoryStream}\n */\n Stream.createWithMemory = function (producer) {\n if (producer) {\n internalizeProducer(producer); // mutates the input\n }\n return new MemoryStream(producer);\n };\n /**\n * Creates a Stream that does nothing when started. It never emits any event.\n *\n * Marble diagram:\n *\n * ```text\n * never\n * -----------------------\n * ```\n *\n * @factory true\n * @return {Stream}\n */\n Stream.never = function () {\n return new Stream({ _start: noop, _stop: noop });\n };\n /**\n * Creates a Stream that immediately emits the \"complete\" notification when\n * started, and that's it.\n *\n * Marble diagram:\n *\n * ```text\n * empty\n * -|\n * ```\n *\n * @factory true\n * @return {Stream}\n */\n Stream.empty = function () {\n return new Stream({\n _start: function (il) { il._c(); },\n _stop: noop,\n });\n };\n /**\n * Creates a Stream that immediately emits an \"error\" notification with the\n * value you passed as the `error` argument when the stream starts, and that's\n * it.\n *\n * Marble diagram:\n *\n * ```text\n * throw(X)\n * -X\n * ```\n *\n * @factory true\n * @param error The error event to emit on the created stream.\n * @return {Stream}\n */\n Stream.throw = function (error) {\n return new Stream({\n _start: function (il) { il._e(error); },\n _stop: noop,\n });\n };\n /**\n * Creates a Stream that immediately emits the arguments that you give to\n * *of*, then completes.\n *\n * Marble diagram:\n *\n * ```text\n * of(1,2,3)\n * 123|\n * ```\n *\n * @factory true\n * @param a The first value you want to emit as an event on the stream.\n * @param b The second value you want to emit as an event on the stream. One\n * or more of these values may be given as arguments.\n * @return {Stream}\n */\n Stream.of = function () {\n var items = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n items[_i - 0] = arguments[_i];\n }\n return Stream.fromArray(items);\n };\n /**\n * Converts an array to a stream. The returned stream will emit synchronously\n * all the items in the array, and then complete.\n *\n * Marble diagram:\n *\n * ```text\n * fromArray([1,2,3])\n * 123|\n * ```\n *\n * @factory true\n * @param {Array} array The array to be converted as a stream.\n * @return {Stream}\n */\n Stream.fromArray = function (array) {\n return new Stream(new FromArrayProducer(array));\n };\n /**\n * Converts a promise to a stream. The returned stream will emit the resolved\n * value of the promise, and then complete. However, if the promise is\n * rejected, the stream will emit the corresponding error.\n *\n * Marble diagram:\n *\n * ```text\n * fromPromise( ----42 )\n * -----------------42|\n * ```\n *\n * @factory true\n * @param {Promise} promise The promise to be converted as a stream.\n * @return {Stream}\n */\n Stream.fromPromise = function (promise) {\n return new Stream(new FromPromiseProducer(promise));\n };\n /**\n * Creates a stream that periodically emits incremental numbers, every\n * `period` milliseconds.\n *\n * Marble diagram:\n *\n * ```text\n * periodic(1000)\n * ---0---1---2---3---4---...\n * ```\n *\n * @factory true\n * @param {number} period The interval in milliseconds to use as a rate of\n * emission.\n * @return {Stream}\n */\n Stream.periodic = function (period) {\n return new Stream(new PeriodicProducer(period));\n };\n /**\n * Blends multiple streams together, emitting events from all of them\n * concurrently.\n *\n * *merge* takes multiple streams as arguments, and creates a stream that\n * behaves like each of the argument streams, in parallel.\n *\n * Marble diagram:\n *\n * ```text\n * --1----2-----3--------4---\n * ----a-----b----c---d------\n * merge\n * --1-a--2--b--3-c---d--4---\n * ```\n *\n * @factory true\n * @param {Stream} stream1 A stream to merge together with other streams.\n * @param {Stream} stream2 A stream to merge together with other streams. Two\n * or more streams may be given as arguments.\n * @return {Stream}\n */\n Stream.merge = function () {\n var streams = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n streams[_i - 0] = arguments[_i];\n }\n return new Stream(new MergeProducer(streams));\n };\n Stream.prototype._map = function (project) {\n var p = this._prod;\n var ctor = this.ctor();\n if (p instanceof FilterOperator) {\n return new ctor(new FilterMapOperator(p.passes, project, p.ins));\n }\n if (p instanceof FilterMapOperator) {\n return new ctor(new FilterMapOperator(p.passes, compose2(project, p.project), p.ins));\n }\n if (p instanceof MapOperator) {\n return new ctor(new MapOperator(compose2(project, p.project), p.ins));\n }\n return new ctor(new MapOperator(project, this));\n };\n /**\n * Transforms each event from the input Stream through a `project` function,\n * to get a Stream that emits those transformed events.\n *\n * Marble diagram:\n *\n * ```text\n * --1---3--5-----7------\n * map(i => i * 10)\n * --10--30-50----70-----\n * ```\n *\n * @param {Function} project A function of type `(t: T) => U` that takes event\n * `t` of type `T` from the input Stream and produces an event of type `U`, to\n * be emitted on the output Stream.\n * @return {Stream}\n */\n Stream.prototype.map = function (project) {\n return this._map(project);\n };\n /**\n * It's like `map`, but transforms each input event to always the same\n * constant value on the output Stream.\n *\n * Marble diagram:\n *\n * ```text\n * --1---3--5-----7-----\n * mapTo(10)\n * --10--10-10----10----\n * ```\n *\n * @param projectedValue A value to emit on the output Stream whenever the\n * input Stream emits any value.\n * @return {Stream}\n */\n Stream.prototype.mapTo = function (projectedValue) {\n var s = this.map(function () { return projectedValue; });\n var op = s._prod;\n op.type = op.type.replace('map', 'mapTo');\n return s;\n };\n /**\n * Only allows events that pass the test given by the `passes` argument.\n *\n * Each event from the input stream is given to the `passes` function. If the\n * function returns `true`, the event is forwarded to the output stream,\n * otherwise it is ignored and not forwarded.\n *\n * Marble diagram:\n *\n * ```text\n * --1---2--3-----4-----5---6--7-8--\n * filter(i => i % 2 === 0)\n * ------2--------4---------6----8--\n * ```\n *\n * @param {Function} passes A function of type `(t: T) +> boolean` that takes\n * an event from the input stream and checks if it passes, by returning a\n * boolean.\n * @return {Stream}\n */\n Stream.prototype.filter = function (passes) {\n var p = this._prod;\n if (p instanceof FilterOperator) {\n return new Stream(new FilterOperator(and(passes, p.passes), p.ins));\n }\n return new Stream(new FilterOperator(passes, this));\n };\n /**\n * Lets the first `amount` many events from the input stream pass to the\n * output stream, then makes the output stream complete.\n *\n * Marble diagram:\n *\n * ```text\n * --a---b--c----d---e--\n * take(3)\n * --a---b--c|\n * ```\n *\n * @param {number} amount How many events to allow from the input stream\n * before completing the output stream.\n * @return {Stream}\n */\n Stream.prototype.take = function (amount) {\n return new (this.ctor())(new TakeOperator(amount, this));\n };\n /**\n * Ignores the first `amount` many events from the input stream, and then\n * after that starts forwarding events from the input stream to the output\n * stream.\n *\n * Marble diagram:\n *\n * ```text\n * --a---b--c----d---e--\n * drop(3)\n * --------------d---e--\n * ```\n *\n * @param {number} amount How many events to ignore from the input stream\n * before forwarding all events from the input stream to the output stream.\n * @return {Stream}\n */\n Stream.prototype.drop = function (amount) {\n return new Stream(new DropOperator(amount, this));\n };\n /**\n * When the input stream completes, the output stream will emit the last event\n * emitted by the input stream, and then will also complete.\n *\n * Marble diagram:\n *\n * ```text\n * --a---b--c--d----|\n * last()\n * -----------------d|\n * ```\n *\n * @return {Stream}\n */\n Stream.prototype.last = function () {\n return new Stream(new LastOperator(this));\n };\n /**\n * Prepends the given `initial` value to the sequence of events emitted by the\n * input stream. The returned stream is a MemoryStream, which means it is\n * already `remember()`'d.\n *\n * Marble diagram:\n *\n * ```text\n * ---1---2-----3---\n * startWith(0)\n * 0--1---2-----3---\n * ```\n *\n * @param initial The value or event to prepend.\n * @return {MemoryStream}\n */\n Stream.prototype.startWith = function (initial) {\n return new MemoryStream(new StartWithOperator(this, initial));\n };\n /**\n * Uses another stream to determine when to complete the current stream.\n *\n * When the given `other` stream emits an event or completes, the output\n * stream will complete. Before that happens, the output stream will behaves\n * like the input stream.\n *\n * Marble diagram:\n *\n * ```text\n * ---1---2-----3--4----5----6---\n * endWhen( --------a--b--| )\n * ---1---2-----3--4--|\n * ```\n *\n * @param other Some other stream that is used to know when should the output\n * stream of this operator complete.\n * @return {Stream}\n */\n Stream.prototype.endWhen = function (other) {\n return new (this.ctor())(new EndWhenOperator(other, this));\n };\n /**\n * \"Folds\" the stream onto itself.\n *\n * Combines events from the past throughout\n * the entire execution of the input stream, allowing you to accumulate them\n * together. It's essentially like `Array.prototype.reduce`. The returned\n * stream is a MemoryStream, which means it is already `remember()`'d.\n *\n * The output stream starts by emitting the `seed` which you give as argument.\n * Then, when an event happens on the input stream, it is combined with that\n * seed value through the `accumulate` function, and the output value is\n * emitted on the output stream. `fold` remembers that output value as `acc`\n * (\"accumulator\"), and then when a new input event `t` happens, `acc` will be\n * combined with that to produce the new `acc` and so forth.\n *\n * Marble diagram:\n *\n * ```text\n * ------1-----1--2----1----1------\n * fold((acc, x) => acc + x, 3)\n * 3-----4-----5--7----8----9------\n * ```\n *\n * @param {Function} accumulate A function of type `(acc: R, t: T) => R` that\n * takes the previous accumulated value `acc` and the incoming event from the\n * input stream and produces the new accumulated value.\n * @param seed The initial accumulated value, of type `R`.\n * @return {MemoryStream}\n */\n Stream.prototype.fold = function (accumulate, seed) {\n return new MemoryStream(new FoldOperator(accumulate, seed, this));\n };\n /**\n * Replaces an error with another stream.\n *\n * When (and if) an error happens on the input stream, instead of forwarding\n * that error to the output stream, *replaceError* will call the `replace`\n * function which returns the stream that the output stream will replicate.\n * And, in case that new stream also emits an error, `replace` will be called\n * again to get another stream to start replicating.\n *\n * Marble diagram:\n *\n * ```text\n * --1---2-----3--4-----X\n * replaceError( () => --10--| )\n * --1---2-----3--4--------10--|\n * ```\n *\n * @param {Function} replace A function of type `(err) => Stream` that takes\n * the error that occurred on the input stream or on the previous replacement\n * stream and returns a new stream. The output stream will behave like the\n * stream that this function returns.\n * @return {Stream}\n */\n Stream.prototype.replaceError = function (replace) {\n return new (this.ctor())(new ReplaceErrorOperator(replace, this));\n };\n /**\n * Flattens a \"stream of streams\", handling only one nested stream at a time\n * (no concurrency).\n *\n * If the input stream is a stream that emits streams, then this operator will\n * return an output stream which is a flat stream: emits regular events. The\n * flattening happens without concurrency. It works like this: when the input\n * stream emits a nested stream, *flatten* will start imitating that nested\n * one. However, as soon as the next nested stream is emitted on the input\n * stream, *flatten* will forget the previous nested one it was imitating, and\n * will start imitating the new nested one.\n *\n * Marble diagram:\n *\n * ```text\n * --+--------+---------------\n * \\ \\\n * \\ ----1----2---3--\n * --a--b----c----d--------\n * flatten\n * -----a--b------1----2---3--\n * ```\n *\n * @return {Stream}\n */\n Stream.prototype.flatten = function () {\n var p = this._prod;\n return new Stream(p instanceof MapOperator && !(p instanceof FilterMapOperator) ?\n new MapFlattenOperator(p) :\n new FlattenOperator(this));\n };\n /**\n * Passes the input stream to a custom operator, to produce an output stream.\n *\n * *compose* is a handy way of using an existing function in a chained style.\n * Instead of writing `outStream = f(inStream)` you can write\n * `outStream = inStream.compose(f)`.\n *\n * @param {function} operator A function that takes a stream as input and\n * returns a stream as well.\n * @return {Stream}\n */\n Stream.prototype.compose = function (operator) {\n return operator(this);\n };\n /**\n * Returns an output stream that behaves like the input stream, but also\n * remembers the most recent event that happens on the input stream, so that a\n * newly added listener will immediately receive that memorised event.\n *\n * @return {MemoryStream}\n */\n Stream.prototype.remember = function () {\n return new MemoryStream(new RememberOperator(this));\n };\n /**\n * Returns an output stream that identically behaves like the input stream,\n * but also runs a `spy` function fo each event, to help you debug your app.\n *\n * *debug* takes a `spy` function as argument, and runs that for each event\n * happening on the input stream. If you don't provide the `spy` argument,\n * then *debug* will just `console.log` each event. This helps you to\n * understand the flow of events through some operator chain.\n *\n * Please note that if the output stream has no listeners, then it will not\n * start, which means `spy` will never run because no actual event happens in\n * that case.\n *\n * Marble diagram:\n *\n * ```text\n * --1----2-----3-----4--\n * debug\n * --1----2-----3-----4--\n * ```\n *\n * @param {function} labelOrSpy A string to use as the label when printing\n * debug information on the console, or a 'spy' function that takes an event\n * as argument, and does not need to return anything.\n * @return {Stream}\n */\n Stream.prototype.debug = function (labelOrSpy) {\n return new (this.ctor())(new DebugOperator(labelOrSpy, this));\n };\n /**\n * *imitate* changes this current Stream to emit the same events that the\n * `other` given Stream does. This method returns nothing.\n *\n * This method exists to allow one thing: **circular dependency of streams**.\n * For instance, let's imagine that for some reason you need to create a\n * circular dependency where stream `first$` depends on stream `second$`\n * which in turn depends on `first$`:\n *\n * \n * ```js\n * import delay from 'xstream/extra/delay'\n *\n * var first$ = second$.map(x => x * 10).take(3);\n * var second$ = first$.map(x => x + 1).startWith(1).compose(delay(100));\n * ```\n *\n * However, that is invalid JavaScript, because `second$` is undefined\n * on the first line. This is how *imitate* can help solve it:\n *\n * ```js\n * import delay from 'xstream/extra/delay'\n *\n * var secondProxy$ = xs.create();\n * var first$ = secondProxy$.map(x => x * 10).take(3);\n * var second$ = first$.map(x => x + 1).startWith(1).compose(delay(100));\n * secondProxy$.imitate(second$);\n * ```\n *\n * We create `secondProxy$` before the others, so it can be used in the\n * declaration of `first$`. Then, after both `first$` and `second$` are\n * defined, we hook `secondProxy$` with `second$` with `imitate()` to tell\n * that they are \"the same\". `imitate` will not trigger the start of any\n * stream, it just binds `secondProxy$` and `second$` together.\n *\n * The following is an example where `imitate()` is important in Cycle.js\n * applications. A parent component contains some child components. A child\n * has an action stream which is given to the parent to define its state:\n *\n * \n * ```js\n * const childActionProxy$ = xs.create();\n * const parent = Parent({...sources, childAction$: childActionProxy$});\n * const childAction$ = parent.state$.map(s => s.child.action$).flatten();\n * childActionProxy$.imitate(childAction$);\n * ```\n *\n * Note, though, that **`imitate()` does not support MemoryStreams**. If we\n * would attempt to imitate a MemoryStream in a circular dependency, we would\n * either get a race condition (where the symptom would be \"nothing happens\")\n * or an infinite cyclic emission of values. It's useful to think about\n * MemoryStreams as cells in a spreadsheet. It doesn't make any sense to\n * define a spreadsheet cell `A1` with a formula that depends on `B1` and\n * cell `B1` defined with a formula that depends on `A1`.\n *\n * If you find yourself wanting to use `imitate()` with a\n * MemoryStream, you should rework your code around `imitate()` to use a\n * Stream instead. Look for the stream in the circular dependency that\n * represents an event stream, and that would be a candidate for creating a\n * proxy Stream which then imitates the target Stream.\n *\n * @param {Stream} target The other stream to imitate on the current one. Must\n * not be a MemoryStream.\n */\n Stream.prototype.imitate = function (target) {\n if (target instanceof MemoryStream) {\n throw new Error('A MemoryStream was given to imitate(), but it only ' +\n 'supports a Stream. Read more about this restriction here: ' +\n 'https://github.com/staltz/xstream#faq');\n }\n this._target = target;\n for (var ils = this._ils, N = ils.length, i = 0; i < N; i++) {\n target._add(ils[i]);\n }\n this._ils = [];\n };\n /**\n * Forces the Stream to emit the given value to its listeners.\n *\n * As the name indicates, if you use this, you are most likely doing something\n * The Wrong Way. Please try to understand the reactive way before using this\n * method. Use it only when you know what you are doing.\n *\n * @param value The \"next\" value you want to broadcast to all listeners of\n * this Stream.\n */\n Stream.prototype.shamefullySendNext = function (value) {\n this._n(value);\n };\n /**\n * Forces the Stream to emit the given error to its listeners.\n *\n * As the name indicates, if you use this, you are most likely doing something\n * The Wrong Way. Please try to understand the reactive way before using this\n * method. Use it only when you know what you are doing.\n *\n * @param {any} error The error you want to broadcast to all the listeners of\n * this Stream.\n */\n Stream.prototype.shamefullySendError = function (error) {\n this._e(error);\n };\n /**\n * Forces the Stream to emit the \"completed\" event to its listeners.\n *\n * As the name indicates, if you use this, you are most likely doing something\n * The Wrong Way. Please try to understand the reactive way before using this\n * method. Use it only when you know what you are doing.\n */\n Stream.prototype.shamefullySendComplete = function () {\n this._c();\n };\n /**\n * Combines multiple input streams together to return a stream whose events\n * are arrays that collect the latest events from each input stream.\n *\n * *combine* internally remembers the most recent event from each of the input\n * streams. When any of the input streams emits an event, that event together\n * with all the other saved events are combined into an array. That array will\n * be emitted on the output stream. It's essentially a way of joining together\n * the events from multiple streams.\n *\n * Marble diagram:\n *\n * ```text\n * --1----2-----3--------4---\n * ----a-----b-----c--d------\n * combine\n * ----1a-2a-2b-3b-3c-3d-4d--\n * ```\n *\n * @factory true\n * @param {Stream} stream1 A stream to combine together with other streams.\n * @param {Stream} stream2 A stream to combine together with other streams.\n * Multiple streams, not just two, may be given as arguments.\n * @return {Stream}\n */\n Stream.combine = function combine() {\n var streams = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n streams[_i - 0] = arguments[_i];\n }\n return new Stream(new CombineProducer(streams));\n };\n return Stream;\n}());\nexports.Stream = Stream;\nvar MemoryStream = (function (_super) {\n __extends(MemoryStream, _super);\n function MemoryStream(producer) {\n _super.call(this, producer);\n this._has = false;\n }\n MemoryStream.prototype._n = function (x) {\n this._v = x;\n this._has = true;\n _super.prototype._n.call(this, x);\n };\n MemoryStream.prototype._add = function (il) {\n if (this._has) {\n il._n(this._v);\n }\n _super.prototype._add.call(this, il);\n };\n MemoryStream.prototype._lateStop = function () {\n this._has = false;\n _super.prototype._lateStop.call(this);\n };\n MemoryStream.prototype._x = function () {\n this._has = false;\n _super.prototype._x.call(this);\n };\n MemoryStream.prototype.map = function (project) {\n return this._map(project);\n };\n MemoryStream.prototype.mapTo = function (projectedValue) {\n return _super.prototype.mapTo.call(this, projectedValue);\n };\n MemoryStream.prototype.take = function (amount) {\n return _super.prototype.take.call(this, amount);\n };\n MemoryStream.prototype.endWhen = function (other) {\n return _super.prototype.endWhen.call(this, other);\n };\n MemoryStream.prototype.replaceError = function (replace) {\n return _super.prototype.replaceError.call(this, replace);\n };\n MemoryStream.prototype.debug = function (labelOrSpy) {\n return _super.prototype.debug.call(this, labelOrSpy);\n };\n return MemoryStream;\n}(Stream));\nexports.MemoryStream = MemoryStream;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Stream;\n//# sourceMappingURL=core.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/xstream/core.js\n ** module id = 6\n ** module chunks = 0\n **/","/**\n * Copyright (c) 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.Immutable = factory());\n}(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice;\n\n function createClass(ctor, superClass) {\n if (superClass) {\n ctor.prototype = Object.create(superClass.prototype);\n }\n ctor.prototype.constructor = ctor;\n }\n\n function Iterable(value) {\n return isIterable(value) ? value : Seq(value);\n }\n\n\n createClass(KeyedIterable, Iterable);\n function KeyedIterable(value) {\n return isKeyed(value) ? value : KeyedSeq(value);\n }\n\n\n createClass(IndexedIterable, Iterable);\n function IndexedIterable(value) {\n return isIndexed(value) ? value : IndexedSeq(value);\n }\n\n\n createClass(SetIterable, Iterable);\n function SetIterable(value) {\n return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);\n }\n\n\n\n function isIterable(maybeIterable) {\n return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);\n }\n\n function isKeyed(maybeKeyed) {\n return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);\n }\n\n function isIndexed(maybeIndexed) {\n return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);\n }\n\n function isAssociative(maybeAssociative) {\n return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);\n }\n\n function isOrdered(maybeOrdered) {\n return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);\n }\n\n Iterable.isIterable = isIterable;\n Iterable.isKeyed = isKeyed;\n Iterable.isIndexed = isIndexed;\n Iterable.isAssociative = isAssociative;\n Iterable.isOrdered = isOrdered;\n\n Iterable.Keyed = KeyedIterable;\n Iterable.Indexed = IndexedIterable;\n Iterable.Set = SetIterable;\n\n\n var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';\n\n // Used for setting prototype methods that IE8 chokes on.\n var DELETE = 'delete';\n\n // Constants describing the size of trie nodes.\n var SHIFT = 5; // Resulted in best performance after ______?\n var SIZE = 1 << SHIFT;\n var MASK = SIZE - 1;\n\n // A consistent shared value representing \"not set\" which equals nothing other\n // than itself, and nothing that could be provided externally.\n var NOT_SET = {};\n\n // Boolean references, Rough equivalent of `bool &`.\n var CHANGE_LENGTH = { value: false };\n var DID_ALTER = { value: false };\n\n function MakeRef(ref) {\n ref.value = false;\n return ref;\n }\n\n function SetRef(ref) {\n ref && (ref.value = true);\n }\n\n // A function which returns a value representing an \"owner\" for transient writes\n // to tries. The return value will only ever equal itself, and will not equal\n // the return of any subsequent call of this function.\n function OwnerID() {}\n\n // http://jsperf.com/copy-array-inline\n function arrCopy(arr, offset) {\n offset = offset || 0;\n var len = Math.max(0, arr.length - offset);\n var newArr = new Array(len);\n for (var ii = 0; ii < len; ii++) {\n newArr[ii] = arr[ii + offset];\n }\n return newArr;\n }\n\n function ensureSize(iter) {\n if (iter.size === undefined) {\n iter.size = iter.__iterate(returnTrue);\n }\n return iter.size;\n }\n\n function wrapIndex(iter, index) {\n // This implements \"is array index\" which the ECMAString spec defines as:\n //\n // A String property name P is an array index if and only if\n // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal\n // to 2^32−1.\n //\n // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects\n if (typeof index !== 'number') {\n var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32\n if ('' + uint32Index !== index || uint32Index === 4294967295) {\n return NaN;\n }\n index = uint32Index;\n }\n return index < 0 ? ensureSize(iter) + index : index;\n }\n\n function returnTrue() {\n return true;\n }\n\n function wholeSlice(begin, end, size) {\n return (begin === 0 || (size !== undefined && begin <= -size)) &&\n (end === undefined || (size !== undefined && end >= size));\n }\n\n function resolveBegin(begin, size) {\n return resolveIndex(begin, size, 0);\n }\n\n function resolveEnd(end, size) {\n return resolveIndex(end, size, size);\n }\n\n function resolveIndex(index, size, defaultIndex) {\n return index === undefined ?\n defaultIndex :\n index < 0 ?\n Math.max(0, size + index) :\n size === undefined ?\n index :\n Math.min(size, index);\n }\n\n /* global Symbol */\n\n var ITERATE_KEYS = 0;\n var ITERATE_VALUES = 1;\n var ITERATE_ENTRIES = 2;\n\n var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator';\n\n var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;\n\n\n function Iterator(next) {\n this.next = next;\n }\n\n Iterator.prototype.toString = function() {\n return '[Iterator]';\n };\n\n\n Iterator.KEYS = ITERATE_KEYS;\n Iterator.VALUES = ITERATE_VALUES;\n Iterator.ENTRIES = ITERATE_ENTRIES;\n\n Iterator.prototype.inspect =\n Iterator.prototype.toSource = function () { return this.toString(); }\n Iterator.prototype[ITERATOR_SYMBOL] = function () {\n return this;\n };\n\n\n function iteratorValue(type, k, v, iteratorResult) {\n var value = type === 0 ? k : type === 1 ? v : [k, v];\n iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {\n value: value, done: false\n });\n return iteratorResult;\n }\n\n function iteratorDone() {\n return { value: undefined, done: true };\n }\n\n function hasIterator(maybeIterable) {\n return !!getIteratorFn(maybeIterable);\n }\n\n function isIterator(maybeIterator) {\n return maybeIterator && typeof maybeIterator.next === 'function';\n }\n\n function getIterator(iterable) {\n var iteratorFn = getIteratorFn(iterable);\n return iteratorFn && iteratorFn.call(iterable);\n }\n\n function getIteratorFn(iterable) {\n var iteratorFn = iterable && (\n (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) ||\n iterable[FAUX_ITERATOR_SYMBOL]\n );\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n function isArrayLike(value) {\n return value && typeof value.length === 'number';\n }\n\n createClass(Seq, Iterable);\n function Seq(value) {\n return value === null || value === undefined ? emptySequence() :\n isIterable(value) ? value.toSeq() : seqFromValue(value);\n }\n\n Seq.of = function(/*...values*/) {\n return Seq(arguments);\n };\n\n Seq.prototype.toSeq = function() {\n return this;\n };\n\n Seq.prototype.toString = function() {\n return this.__toString('Seq {', '}');\n };\n\n Seq.prototype.cacheResult = function() {\n if (!this._cache && this.__iterateUncached) {\n this._cache = this.entrySeq().toArray();\n this.size = this._cache.length;\n }\n return this;\n };\n\n // abstract __iterateUncached(fn, reverse)\n\n Seq.prototype.__iterate = function(fn, reverse) {\n return seqIterate(this, fn, reverse, true);\n };\n\n // abstract __iteratorUncached(type, reverse)\n\n Seq.prototype.__iterator = function(type, reverse) {\n return seqIterator(this, type, reverse, true);\n };\n\n\n\n createClass(KeyedSeq, Seq);\n function KeyedSeq(value) {\n return value === null || value === undefined ?\n emptySequence().toKeyedSeq() :\n isIterable(value) ?\n (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) :\n keyedSeqFromValue(value);\n }\n\n KeyedSeq.prototype.toKeyedSeq = function() {\n return this;\n };\n\n\n\n createClass(IndexedSeq, Seq);\n function IndexedSeq(value) {\n return value === null || value === undefined ? emptySequence() :\n !isIterable(value) ? indexedSeqFromValue(value) :\n isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();\n }\n\n IndexedSeq.of = function(/*...values*/) {\n return IndexedSeq(arguments);\n };\n\n IndexedSeq.prototype.toIndexedSeq = function() {\n return this;\n };\n\n IndexedSeq.prototype.toString = function() {\n return this.__toString('Seq [', ']');\n };\n\n IndexedSeq.prototype.__iterate = function(fn, reverse) {\n return seqIterate(this, fn, reverse, false);\n };\n\n IndexedSeq.prototype.__iterator = function(type, reverse) {\n return seqIterator(this, type, reverse, false);\n };\n\n\n\n createClass(SetSeq, Seq);\n function SetSeq(value) {\n return (\n value === null || value === undefined ? emptySequence() :\n !isIterable(value) ? indexedSeqFromValue(value) :\n isKeyed(value) ? value.entrySeq() : value\n ).toSetSeq();\n }\n\n SetSeq.of = function(/*...values*/) {\n return SetSeq(arguments);\n };\n\n SetSeq.prototype.toSetSeq = function() {\n return this;\n };\n\n\n\n Seq.isSeq = isSeq;\n Seq.Keyed = KeyedSeq;\n Seq.Set = SetSeq;\n Seq.Indexed = IndexedSeq;\n\n var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';\n\n Seq.prototype[IS_SEQ_SENTINEL] = true;\n\n\n\n createClass(ArraySeq, IndexedSeq);\n function ArraySeq(array) {\n this._array = array;\n this.size = array.length;\n }\n\n ArraySeq.prototype.get = function(index, notSetValue) {\n return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;\n };\n\n ArraySeq.prototype.__iterate = function(fn, reverse) {\n var array = this._array;\n var maxIndex = array.length - 1;\n for (var ii = 0; ii <= maxIndex; ii++) {\n if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {\n return ii + 1;\n }\n }\n return ii;\n };\n\n ArraySeq.prototype.__iterator = function(type, reverse) {\n var array = this._array;\n var maxIndex = array.length - 1;\n var ii = 0;\n return new Iterator(function() \n {return ii > maxIndex ?\n iteratorDone() :\n iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])}\n );\n };\n\n\n\n createClass(ObjectSeq, KeyedSeq);\n function ObjectSeq(object) {\n var keys = Object.keys(object);\n this._object = object;\n this._keys = keys;\n this.size = keys.length;\n }\n\n ObjectSeq.prototype.get = function(key, notSetValue) {\n if (notSetValue !== undefined && !this.has(key)) {\n return notSetValue;\n }\n return this._object[key];\n };\n\n ObjectSeq.prototype.has = function(key) {\n return this._object.hasOwnProperty(key);\n };\n\n ObjectSeq.prototype.__iterate = function(fn, reverse) {\n var object = this._object;\n var keys = this._keys;\n var maxIndex = keys.length - 1;\n for (var ii = 0; ii <= maxIndex; ii++) {\n var key = keys[reverse ? maxIndex - ii : ii];\n if (fn(object[key], key, this) === false) {\n return ii + 1;\n }\n }\n return ii;\n };\n\n ObjectSeq.prototype.__iterator = function(type, reverse) {\n var object = this._object;\n var keys = this._keys;\n var maxIndex = keys.length - 1;\n var ii = 0;\n return new Iterator(function() {\n var key = keys[reverse ? maxIndex - ii : ii];\n return ii++ > maxIndex ?\n iteratorDone() :\n iteratorValue(type, key, object[key]);\n });\n };\n\n ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;\n\n\n createClass(IterableSeq, IndexedSeq);\n function IterableSeq(iterable) {\n this._iterable = iterable;\n this.size = iterable.length || iterable.size;\n }\n\n IterableSeq.prototype.__iterateUncached = function(fn, reverse) {\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n var iterable = this._iterable;\n var iterator = getIterator(iterable);\n var iterations = 0;\n if (isIterator(iterator)) {\n var step;\n while (!(step = iterator.next()).done) {\n if (fn(step.value, iterations++, this) === false) {\n break;\n }\n }\n }\n return iterations;\n };\n\n IterableSeq.prototype.__iteratorUncached = function(type, reverse) {\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n var iterable = this._iterable;\n var iterator = getIterator(iterable);\n if (!isIterator(iterator)) {\n return new Iterator(iteratorDone);\n }\n var iterations = 0;\n return new Iterator(function() {\n var step = iterator.next();\n return step.done ? step : iteratorValue(type, iterations++, step.value);\n });\n };\n\n\n\n createClass(IteratorSeq, IndexedSeq);\n function IteratorSeq(iterator) {\n this._iterator = iterator;\n this._iteratorCache = [];\n }\n\n IteratorSeq.prototype.__iterateUncached = function(fn, reverse) {\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n var iterator = this._iterator;\n var cache = this._iteratorCache;\n var iterations = 0;\n while (iterations < cache.length) {\n if (fn(cache[iterations], iterations++, this) === false) {\n return iterations;\n }\n }\n var step;\n while (!(step = iterator.next()).done) {\n var val = step.value;\n cache[iterations] = val;\n if (fn(val, iterations++, this) === false) {\n break;\n }\n }\n return iterations;\n };\n\n IteratorSeq.prototype.__iteratorUncached = function(type, reverse) {\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n var iterator = this._iterator;\n var cache = this._iteratorCache;\n var iterations = 0;\n return new Iterator(function() {\n if (iterations >= cache.length) {\n var step = iterator.next();\n if (step.done) {\n return step;\n }\n cache[iterations] = step.value;\n }\n return iteratorValue(type, iterations, cache[iterations++]);\n });\n };\n\n\n\n\n // # pragma Helper functions\n\n function isSeq(maybeSeq) {\n return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);\n }\n\n var EMPTY_SEQ;\n\n function emptySequence() {\n return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));\n }\n\n function keyedSeqFromValue(value) {\n var seq =\n Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() :\n isIterator(value) ? new IteratorSeq(value).fromEntrySeq() :\n hasIterator(value) ? new IterableSeq(value).fromEntrySeq() :\n typeof value === 'object' ? new ObjectSeq(value) :\n undefined;\n if (!seq) {\n throw new TypeError(\n 'Expected Array or iterable object of [k, v] entries, '+\n 'or keyed object: ' + value\n );\n }\n return seq;\n }\n\n function indexedSeqFromValue(value) {\n var seq = maybeIndexedSeqFromValue(value);\n if (!seq) {\n throw new TypeError(\n 'Expected Array or iterable object of values: ' + value\n );\n }\n return seq;\n }\n\n function seqFromValue(value) {\n var seq = maybeIndexedSeqFromValue(value) ||\n (typeof value === 'object' && new ObjectSeq(value));\n if (!seq) {\n throw new TypeError(\n 'Expected Array or iterable object of values, or keyed object: ' + value\n );\n }\n return seq;\n }\n\n function maybeIndexedSeqFromValue(value) {\n return (\n isArrayLike(value) ? new ArraySeq(value) :\n isIterator(value) ? new IteratorSeq(value) :\n hasIterator(value) ? new IterableSeq(value) :\n undefined\n );\n }\n\n function seqIterate(seq, fn, reverse, useKeys) {\n var cache = seq._cache;\n if (cache) {\n var maxIndex = cache.length - 1;\n for (var ii = 0; ii <= maxIndex; ii++) {\n var entry = cache[reverse ? maxIndex - ii : ii];\n if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {\n return ii + 1;\n }\n }\n return ii;\n }\n return seq.__iterateUncached(fn, reverse);\n }\n\n function seqIterator(seq, type, reverse, useKeys) {\n var cache = seq._cache;\n if (cache) {\n var maxIndex = cache.length - 1;\n var ii = 0;\n return new Iterator(function() {\n var entry = cache[reverse ? maxIndex - ii : ii];\n return ii++ > maxIndex ?\n iteratorDone() :\n iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);\n });\n }\n return seq.__iteratorUncached(type, reverse);\n }\n\n function fromJS(json, converter) {\n return converter ?\n fromJSWith(converter, json, '', {'': json}) :\n fromJSDefault(json);\n }\n\n function fromJSWith(converter, json, key, parentJSON) {\n if (Array.isArray(json)) {\n return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)}));\n }\n if (isPlainObj(json)) {\n return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)}));\n }\n return json;\n }\n\n function fromJSDefault(json) {\n if (Array.isArray(json)) {\n return IndexedSeq(json).map(fromJSDefault).toList();\n }\n if (isPlainObj(json)) {\n return KeyedSeq(json).map(fromJSDefault).toMap();\n }\n return json;\n }\n\n function isPlainObj(value) {\n return value && (value.constructor === Object || value.constructor === undefined);\n }\n\n /**\n * An extension of the \"same-value\" algorithm as [described for use by ES6 Map\n * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)\n *\n * NaN is considered the same as NaN, however -0 and 0 are considered the same\n * value, which is different from the algorithm described by\n * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).\n *\n * This is extended further to allow Objects to describe the values they\n * represent, by way of `valueOf` or `equals` (and `hashCode`).\n *\n * Note: because of this extension, the key equality of Immutable.Map and the\n * value equality of Immutable.Set will differ from ES6 Map and Set.\n *\n * ### Defining custom values\n *\n * The easiest way to describe the value an object represents is by implementing\n * `valueOf`. For example, `Date` represents a value by returning a unix\n * timestamp for `valueOf`:\n *\n * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...\n * var date2 = new Date(1234567890000);\n * date1.valueOf(); // 1234567890000\n * assert( date1 !== date2 );\n * assert( Immutable.is( date1, date2 ) );\n *\n * Note: overriding `valueOf` may have other implications if you use this object\n * where JavaScript expects a primitive, such as implicit string coercion.\n *\n * For more complex types, especially collections, implementing `valueOf` may\n * not be performant. An alternative is to implement `equals` and `hashCode`.\n *\n * `equals` takes another object, presumably of similar type, and returns true\n * if the it is equal. Equality is symmetrical, so the same result should be\n * returned if this and the argument are flipped.\n *\n * assert( a.equals(b) === b.equals(a) );\n *\n * `hashCode` returns a 32bit integer number representing the object which will\n * be used to determine how to store the value object in a Map or Set. You must\n * provide both or neither methods, one must not exist without the other.\n *\n * Also, an important relationship between these methods must be upheld: if two\n * values are equal, they *must* return the same hashCode. If the values are not\n * equal, they might have the same hashCode; this is called a hash collision,\n * and while undesirable for performance reasons, it is acceptable.\n *\n * if (a.equals(b)) {\n * assert( a.hashCode() === b.hashCode() );\n * }\n *\n * All Immutable collections implement `equals` and `hashCode`.\n *\n */\n function is(valueA, valueB) {\n if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {\n return true;\n }\n if (!valueA || !valueB) {\n return false;\n }\n if (typeof valueA.valueOf === 'function' &&\n typeof valueB.valueOf === 'function') {\n valueA = valueA.valueOf();\n valueB = valueB.valueOf();\n if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {\n return true;\n }\n if (!valueA || !valueB) {\n return false;\n }\n }\n if (typeof valueA.equals === 'function' &&\n typeof valueB.equals === 'function' &&\n valueA.equals(valueB)) {\n return true;\n }\n return false;\n }\n\n function deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (\n !isIterable(b) ||\n a.size !== undefined && b.size !== undefined && a.size !== b.size ||\n a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash ||\n isKeyed(a) !== isKeyed(b) ||\n isIndexed(a) !== isIndexed(b) ||\n isOrdered(a) !== isOrdered(b)\n ) {\n return false;\n }\n\n if (a.size === 0 && b.size === 0) {\n return true;\n }\n\n var notAssociative = !isAssociative(a);\n\n if (isOrdered(a)) {\n var entries = a.entries();\n return b.every(function(v, k) {\n var entry = entries.next().value;\n return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));\n }) && entries.next().done;\n }\n\n var flipped = false;\n\n if (a.size === undefined) {\n if (b.size === undefined) {\n if (typeof a.cacheResult === 'function') {\n a.cacheResult();\n }\n } else {\n flipped = true;\n var _ = a;\n a = b;\n b = _;\n }\n }\n\n var allEqual = true;\n var bSize = b.__iterate(function(v, k) {\n if (notAssociative ? !a.has(v) :\n flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {\n allEqual = false;\n return false;\n }\n });\n\n return allEqual && a.size === bSize;\n }\n\n createClass(Repeat, IndexedSeq);\n\n function Repeat(value, times) {\n if (!(this instanceof Repeat)) {\n return new Repeat(value, times);\n }\n this._value = value;\n this.size = times === undefined ? Infinity : Math.max(0, times);\n if (this.size === 0) {\n if (EMPTY_REPEAT) {\n return EMPTY_REPEAT;\n }\n EMPTY_REPEAT = this;\n }\n }\n\n Repeat.prototype.toString = function() {\n if (this.size === 0) {\n return 'Repeat []';\n }\n return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';\n };\n\n Repeat.prototype.get = function(index, notSetValue) {\n return this.has(index) ? this._value : notSetValue;\n };\n\n Repeat.prototype.includes = function(searchValue) {\n return is(this._value, searchValue);\n };\n\n Repeat.prototype.slice = function(begin, end) {\n var size = this.size;\n return wholeSlice(begin, end, size) ? this :\n new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));\n };\n\n Repeat.prototype.reverse = function() {\n return this;\n };\n\n Repeat.prototype.indexOf = function(searchValue) {\n if (is(this._value, searchValue)) {\n return 0;\n }\n return -1;\n };\n\n Repeat.prototype.lastIndexOf = function(searchValue) {\n if (is(this._value, searchValue)) {\n return this.size;\n }\n return -1;\n };\n\n Repeat.prototype.__iterate = function(fn, reverse) {\n for (var ii = 0; ii < this.size; ii++) {\n if (fn(this._value, ii, this) === false) {\n return ii + 1;\n }\n }\n return ii;\n };\n\n Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this;\n var ii = 0;\n return new Iterator(function() \n {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()}\n );\n };\n\n Repeat.prototype.equals = function(other) {\n return other instanceof Repeat ?\n is(this._value, other._value) :\n deepEqual(other);\n };\n\n\n var EMPTY_REPEAT;\n\n function invariant(condition, error) {\n if (!condition) throw new Error(error);\n }\n\n createClass(Range, IndexedSeq);\n\n function Range(start, end, step) {\n if (!(this instanceof Range)) {\n return new Range(start, end, step);\n }\n invariant(step !== 0, 'Cannot step a Range by 0');\n start = start || 0;\n if (end === undefined) {\n end = Infinity;\n }\n step = step === undefined ? 1 : Math.abs(step);\n if (end < start) {\n step = -step;\n }\n this._start = start;\n this._end = end;\n this._step = step;\n this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);\n if (this.size === 0) {\n if (EMPTY_RANGE) {\n return EMPTY_RANGE;\n }\n EMPTY_RANGE = this;\n }\n }\n\n Range.prototype.toString = function() {\n if (this.size === 0) {\n return 'Range []';\n }\n return 'Range [ ' +\n this._start + '...' + this._end +\n (this._step !== 1 ? ' by ' + this._step : '') +\n ' ]';\n };\n\n Range.prototype.get = function(index, notSetValue) {\n return this.has(index) ?\n this._start + wrapIndex(this, index) * this._step :\n notSetValue;\n };\n\n Range.prototype.includes = function(searchValue) {\n var possibleIndex = (searchValue - this._start) / this._step;\n return possibleIndex >= 0 &&\n possibleIndex < this.size &&\n possibleIndex === Math.floor(possibleIndex);\n };\n\n Range.prototype.slice = function(begin, end) {\n if (wholeSlice(begin, end, this.size)) {\n return this;\n }\n begin = resolveBegin(begin, this.size);\n end = resolveEnd(end, this.size);\n if (end <= begin) {\n return new Range(0, 0);\n }\n return new Range(this.get(begin, this._end), this.get(end, this._end), this._step);\n };\n\n Range.prototype.indexOf = function(searchValue) {\n var offsetValue = searchValue - this._start;\n if (offsetValue % this._step === 0) {\n var index = offsetValue / this._step;\n if (index >= 0 && index < this.size) {\n return index\n }\n }\n return -1;\n };\n\n Range.prototype.lastIndexOf = function(searchValue) {\n return this.indexOf(searchValue);\n };\n\n Range.prototype.__iterate = function(fn, reverse) {\n var maxIndex = this.size - 1;\n var step = this._step;\n var value = reverse ? this._start + maxIndex * step : this._start;\n for (var ii = 0; ii <= maxIndex; ii++) {\n if (fn(value, ii, this) === false) {\n return ii + 1;\n }\n value += reverse ? -step : step;\n }\n return ii;\n };\n\n Range.prototype.__iterator = function(type, reverse) {\n var maxIndex = this.size - 1;\n var step = this._step;\n var value = reverse ? this._start + maxIndex * step : this._start;\n var ii = 0;\n return new Iterator(function() {\n var v = value;\n value += reverse ? -step : step;\n return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);\n });\n };\n\n Range.prototype.equals = function(other) {\n return other instanceof Range ?\n this._start === other._start &&\n this._end === other._end &&\n this._step === other._step :\n deepEqual(this, other);\n };\n\n\n var EMPTY_RANGE;\n\n createClass(Collection, Iterable);\n function Collection() {\n throw TypeError('Abstract');\n }\n\n\n createClass(KeyedCollection, Collection);function KeyedCollection() {}\n\n createClass(IndexedCollection, Collection);function IndexedCollection() {}\n\n createClass(SetCollection, Collection);function SetCollection() {}\n\n\n Collection.Keyed = KeyedCollection;\n Collection.Indexed = IndexedCollection;\n Collection.Set = SetCollection;\n\n var imul =\n typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ?\n Math.imul :\n function imul(a, b) {\n a = a | 0; // int\n b = b | 0; // int\n var c = a & 0xffff;\n var d = b & 0xffff;\n // Shift by 0 fixes the sign on the high part.\n return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int\n };\n\n // v8 has an optimization for storing 31-bit signed numbers.\n // Values which have either 00 or 11 as the high order bits qualify.\n // This function drops the highest order bit in a signed number, maintaining\n // the sign bit.\n function smi(i32) {\n return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n }\n\n function hash(o) {\n if (o === false || o === null || o === undefined) {\n return 0;\n }\n if (typeof o.valueOf === 'function') {\n o = o.valueOf();\n if (o === false || o === null || o === undefined) {\n return 0;\n }\n }\n if (o === true) {\n return 1;\n }\n var type = typeof o;\n if (type === 'number') {\n if (o !== o || o === Infinity) {\n return 0;\n }\n var h = o | 0;\n if (h !== o) {\n h ^= o * 0xFFFFFFFF;\n }\n while (o > 0xFFFFFFFF) {\n o /= 0xFFFFFFFF;\n h ^= o;\n }\n return smi(h);\n }\n if (type === 'string') {\n return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);\n }\n if (typeof o.hashCode === 'function') {\n return o.hashCode();\n }\n if (type === 'object') {\n return hashJSObj(o);\n }\n if (typeof o.toString === 'function') {\n return hashString(o.toString());\n }\n throw new Error('Value type ' + type + ' cannot be hashed.');\n }\n\n function cachedHashString(string) {\n var hash = stringHashCache[string];\n if (hash === undefined) {\n hash = hashString(string);\n if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {\n STRING_HASH_CACHE_SIZE = 0;\n stringHashCache = {};\n }\n STRING_HASH_CACHE_SIZE++;\n stringHashCache[string] = hash;\n }\n return hash;\n }\n\n // http://jsperf.com/hashing-strings\n function hashString(string) {\n // This is the hash from JVM\n // The hash code for a string is computed as\n // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],\n // where s[i] is the ith character of the string and n is the length of\n // the string. We \"mod\" the result to make it between 0 (inclusive) and 2^31\n // (exclusive) by dropping high bits.\n var hash = 0;\n for (var ii = 0; ii < string.length; ii++) {\n hash = 31 * hash + string.charCodeAt(ii) | 0;\n }\n return smi(hash);\n }\n\n function hashJSObj(obj) {\n var hash;\n if (usingWeakMap) {\n hash = weakMap.get(obj);\n if (hash !== undefined) {\n return hash;\n }\n }\n\n hash = obj[UID_HASH_KEY];\n if (hash !== undefined) {\n return hash;\n }\n\n if (!canDefineProperty) {\n hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];\n if (hash !== undefined) {\n return hash;\n }\n\n hash = getIENodeHash(obj);\n if (hash !== undefined) {\n return hash;\n }\n }\n\n hash = ++objHashUID;\n if (objHashUID & 0x40000000) {\n objHashUID = 0;\n }\n\n if (usingWeakMap) {\n weakMap.set(obj, hash);\n } else if (isExtensible !== undefined && isExtensible(obj) === false) {\n throw new Error('Non-extensible objects are not allowed as keys.');\n } else if (canDefineProperty) {\n Object.defineProperty(obj, UID_HASH_KEY, {\n 'enumerable': false,\n 'configurable': false,\n 'writable': false,\n 'value': hash\n });\n } else if (obj.propertyIsEnumerable !== undefined &&\n obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {\n // Since we can't define a non-enumerable property on the object\n // we'll hijack one of the less-used non-enumerable properties to\n // save our hash on it. Since this is a function it will not show up in\n // `JSON.stringify` which is what we want.\n obj.propertyIsEnumerable = function() {\n return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);\n };\n obj.propertyIsEnumerable[UID_HASH_KEY] = hash;\n } else if (obj.nodeType !== undefined) {\n // At this point we couldn't get the IE `uniqueID` to use as a hash\n // and we couldn't use a non-enumerable property to exploit the\n // dontEnum bug so we simply add the `UID_HASH_KEY` on the node\n // itself.\n obj[UID_HASH_KEY] = hash;\n } else {\n throw new Error('Unable to set a non-enumerable property on object.');\n }\n\n return hash;\n }\n\n // Get references to ES5 object methods.\n var isExtensible = Object.isExtensible;\n\n // True if Object.defineProperty works as expected. IE8 fails this test.\n var canDefineProperty = (function() {\n try {\n Object.defineProperty({}, '@', {});\n return true;\n } catch (e) {\n return false;\n }\n }());\n\n // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it\n // and avoid memory leaks from the IE cloneNode bug.\n function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }\n\n // If possible, use a WeakMap.\n var usingWeakMap = typeof WeakMap === 'function';\n var weakMap;\n if (usingWeakMap) {\n weakMap = new WeakMap();\n }\n\n var objHashUID = 0;\n\n var UID_HASH_KEY = '__immutablehash__';\n if (typeof Symbol === 'function') {\n UID_HASH_KEY = Symbol(UID_HASH_KEY);\n }\n\n var STRING_HASH_CACHE_MIN_STRLEN = 16;\n var STRING_HASH_CACHE_MAX_SIZE = 255;\n var STRING_HASH_CACHE_SIZE = 0;\n var stringHashCache = {};\n\n function assertNotInfinite(size) {\n invariant(\n size !== Infinity,\n 'Cannot perform this action with an infinite size.'\n );\n }\n\n createClass(Map, KeyedCollection);\n\n // @pragma Construction\n\n function Map(value) {\n return value === null || value === undefined ? emptyMap() :\n isMap(value) && !isOrdered(value) ? value :\n emptyMap().withMutations(function(map ) {\n var iter = KeyedIterable(value);\n assertNotInfinite(iter.size);\n iter.forEach(function(v, k) {return map.set(k, v)});\n });\n }\n\n Map.of = function() {var keyValues = SLICE$0.call(arguments, 0);\n return emptyMap().withMutations(function(map ) {\n for (var i = 0; i < keyValues.length; i += 2) {\n if (i + 1 >= keyValues.length) {\n throw new Error('Missing value for key: ' + keyValues[i]);\n }\n map.set(keyValues[i], keyValues[i + 1]);\n }\n });\n };\n\n Map.prototype.toString = function() {\n return this.__toString('Map {', '}');\n };\n\n // @pragma Access\n\n Map.prototype.get = function(k, notSetValue) {\n return this._root ?\n this._root.get(0, undefined, k, notSetValue) :\n notSetValue;\n };\n\n // @pragma Modification\n\n Map.prototype.set = function(k, v) {\n return updateMap(this, k, v);\n };\n\n Map.prototype.setIn = function(keyPath, v) {\n return this.updateIn(keyPath, NOT_SET, function() {return v});\n };\n\n Map.prototype.remove = function(k) {\n return updateMap(this, k, NOT_SET);\n };\n\n Map.prototype.deleteIn = function(keyPath) {\n return this.updateIn(keyPath, function() {return NOT_SET});\n };\n\n Map.prototype.update = function(k, notSetValue, updater) {\n return arguments.length === 1 ?\n k(this) :\n this.updateIn([k], notSetValue, updater);\n };\n\n Map.prototype.updateIn = function(keyPath, notSetValue, updater) {\n if (!updater) {\n updater = notSetValue;\n notSetValue = undefined;\n }\n var updatedValue = updateInDeepMap(\n this,\n forceIterator(keyPath),\n notSetValue,\n updater\n );\n return updatedValue === NOT_SET ? undefined : updatedValue;\n };\n\n Map.prototype.clear = function() {\n if (this.size === 0) {\n return this;\n }\n if (this.__ownerID) {\n this.size = 0;\n this._root = null;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n return emptyMap();\n };\n\n // @pragma Composition\n\n Map.prototype.merge = function(/*...iters*/) {\n return mergeIntoMapWith(this, undefined, arguments);\n };\n\n Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);\n return mergeIntoMapWith(this, merger, iters);\n };\n\n Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);\n return this.updateIn(\n keyPath,\n emptyMap(),\n function(m ) {return typeof m.merge === 'function' ?\n m.merge.apply(m, iters) :\n iters[iters.length - 1]}\n );\n };\n\n Map.prototype.mergeDeep = function(/*...iters*/) {\n return mergeIntoMapWith(this, deepMerger, arguments);\n };\n\n Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);\n return mergeIntoMapWith(this, deepMergerWith(merger), iters);\n };\n\n Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);\n return this.updateIn(\n keyPath,\n emptyMap(),\n function(m ) {return typeof m.mergeDeep === 'function' ?\n m.mergeDeep.apply(m, iters) :\n iters[iters.length - 1]}\n );\n };\n\n Map.prototype.sort = function(comparator) {\n // Late binding\n return OrderedMap(sortFactory(this, comparator));\n };\n\n Map.prototype.sortBy = function(mapper, comparator) {\n // Late binding\n return OrderedMap(sortFactory(this, comparator, mapper));\n };\n\n // @pragma Mutability\n\n Map.prototype.withMutations = function(fn) {\n var mutable = this.asMutable();\n fn(mutable);\n return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;\n };\n\n Map.prototype.asMutable = function() {\n return this.__ownerID ? this : this.__ensureOwner(new OwnerID());\n };\n\n Map.prototype.asImmutable = function() {\n return this.__ensureOwner();\n };\n\n Map.prototype.wasAltered = function() {\n return this.__altered;\n };\n\n Map.prototype.__iterator = function(type, reverse) {\n return new MapIterator(this, type, reverse);\n };\n\n Map.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n var iterations = 0;\n this._root && this._root.iterate(function(entry ) {\n iterations++;\n return fn(entry[1], entry[0], this$0);\n }, reverse);\n return iterations;\n };\n\n Map.prototype.__ensureOwner = function(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n if (!ownerID) {\n this.__ownerID = ownerID;\n this.__altered = false;\n return this;\n }\n return makeMap(this.size, this._root, ownerID, this.__hash);\n };\n\n\n function isMap(maybeMap) {\n return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);\n }\n\n Map.isMap = isMap;\n\n var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';\n\n var MapPrototype = Map.prototype;\n MapPrototype[IS_MAP_SENTINEL] = true;\n MapPrototype[DELETE] = MapPrototype.remove;\n MapPrototype.removeIn = MapPrototype.deleteIn;\n\n\n // #pragma Trie Nodes\n\n\n\n function ArrayMapNode(ownerID, entries) {\n this.ownerID = ownerID;\n this.entries = entries;\n }\n\n ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {\n var entries = this.entries;\n for (var ii = 0, len = entries.length; ii < len; ii++) {\n if (is(key, entries[ii][0])) {\n return entries[ii][1];\n }\n }\n return notSetValue;\n };\n\n ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n var removed = value === NOT_SET;\n\n var entries = this.entries;\n var idx = 0;\n for (var len = entries.length; idx < len; idx++) {\n if (is(key, entries[idx][0])) {\n break;\n }\n }\n var exists = idx < len;\n\n if (exists ? entries[idx][1] === value : removed) {\n return this;\n }\n\n SetRef(didAlter);\n (removed || !exists) && SetRef(didChangeSize);\n\n if (removed && entries.length === 1) {\n return; // undefined\n }\n\n if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {\n return createNodes(ownerID, entries, key, value);\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newEntries = isEditable ? entries : arrCopy(entries);\n\n if (exists) {\n if (removed) {\n idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n } else {\n newEntries[idx] = [key, value];\n }\n } else {\n newEntries.push([key, value]);\n }\n\n if (isEditable) {\n this.entries = newEntries;\n return this;\n }\n\n return new ArrayMapNode(ownerID, newEntries);\n };\n\n\n\n\n function BitmapIndexedNode(ownerID, bitmap, nodes) {\n this.ownerID = ownerID;\n this.bitmap = bitmap;\n this.nodes = nodes;\n }\n\n BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK));\n var bitmap = this.bitmap;\n return (bitmap & bit) === 0 ? notSetValue :\n this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue);\n };\n\n BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var bit = 1 << keyHashFrag;\n var bitmap = this.bitmap;\n var exists = (bitmap & bit) !== 0;\n\n if (!exists && value === NOT_SET) {\n return this;\n }\n\n var idx = popCount(bitmap & (bit - 1));\n var nodes = this.nodes;\n var node = exists ? nodes[idx] : undefined;\n var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\n if (newNode === node) {\n return this;\n }\n\n if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {\n return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);\n }\n\n if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {\n return nodes[idx ^ 1];\n }\n\n if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {\n return newNode;\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;\n var newNodes = exists ? newNode ?\n setIn(nodes, idx, newNode, isEditable) :\n spliceOut(nodes, idx, isEditable) :\n spliceIn(nodes, idx, newNode, isEditable);\n\n if (isEditable) {\n this.bitmap = newBitmap;\n this.nodes = newNodes;\n return this;\n }\n\n return new BitmapIndexedNode(ownerID, newBitmap, newNodes);\n };\n\n\n\n\n function HashArrayMapNode(ownerID, count, nodes) {\n this.ownerID = ownerID;\n this.count = count;\n this.nodes = nodes;\n }\n\n HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var node = this.nodes[idx];\n return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;\n };\n\n HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var removed = value === NOT_SET;\n var nodes = this.nodes;\n var node = nodes[idx];\n\n if (removed && !node) {\n return this;\n }\n\n var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n if (newNode === node) {\n return this;\n }\n\n var newCount = this.count;\n if (!node) {\n newCount++;\n } else if (!newNode) {\n newCount--;\n if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {\n return packNodes(ownerID, nodes, newCount, idx);\n }\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newNodes = setIn(nodes, idx, newNode, isEditable);\n\n if (isEditable) {\n this.count = newCount;\n this.nodes = newNodes;\n return this;\n }\n\n return new HashArrayMapNode(ownerID, newCount, newNodes);\n };\n\n\n\n\n function HashCollisionNode(ownerID, keyHash, entries) {\n this.ownerID = ownerID;\n this.keyHash = keyHash;\n this.entries = entries;\n }\n\n HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) {\n var entries = this.entries;\n for (var ii = 0, len = entries.length; ii < len; ii++) {\n if (is(key, entries[ii][0])) {\n return entries[ii][1];\n }\n }\n return notSetValue;\n };\n\n HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var removed = value === NOT_SET;\n\n if (keyHash !== this.keyHash) {\n if (removed) {\n return this;\n }\n SetRef(didAlter);\n SetRef(didChangeSize);\n return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);\n }\n\n var entries = this.entries;\n var idx = 0;\n for (var len = entries.length; idx < len; idx++) {\n if (is(key, entries[idx][0])) {\n break;\n }\n }\n var exists = idx < len;\n\n if (exists ? entries[idx][1] === value : removed) {\n return this;\n }\n\n SetRef(didAlter);\n (removed || !exists) && SetRef(didChangeSize);\n\n if (removed && len === 2) {\n return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newEntries = isEditable ? entries : arrCopy(entries);\n\n if (exists) {\n if (removed) {\n idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n } else {\n newEntries[idx] = [key, value];\n }\n } else {\n newEntries.push([key, value]);\n }\n\n if (isEditable) {\n this.entries = newEntries;\n return this;\n }\n\n return new HashCollisionNode(ownerID, this.keyHash, newEntries);\n };\n\n\n\n\n function ValueNode(ownerID, keyHash, entry) {\n this.ownerID = ownerID;\n this.keyHash = keyHash;\n this.entry = entry;\n }\n\n ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) {\n return is(key, this.entry[0]) ? this.entry[1] : notSetValue;\n };\n\n ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n var removed = value === NOT_SET;\n var keyMatch = is(key, this.entry[0]);\n if (keyMatch ? value === this.entry[1] : removed) {\n return this;\n }\n\n SetRef(didAlter);\n\n if (removed) {\n SetRef(didChangeSize);\n return; // undefined\n }\n\n if (keyMatch) {\n if (ownerID && ownerID === this.ownerID) {\n this.entry[1] = value;\n return this;\n }\n return new ValueNode(ownerID, this.keyHash, [key, value]);\n }\n\n SetRef(didChangeSize);\n return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);\n };\n\n\n\n // #pragma Iterators\n\n ArrayMapNode.prototype.iterate =\n HashCollisionNode.prototype.iterate = function (fn, reverse) {\n var entries = this.entries;\n for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {\n if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {\n return false;\n }\n }\n }\n\n BitmapIndexedNode.prototype.iterate =\n HashArrayMapNode.prototype.iterate = function (fn, reverse) {\n var nodes = this.nodes;\n for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n var node = nodes[reverse ? maxIndex - ii : ii];\n if (node && node.iterate(fn, reverse) === false) {\n return false;\n }\n }\n }\n\n ValueNode.prototype.iterate = function (fn, reverse) {\n return fn(this.entry);\n }\n\n createClass(MapIterator, Iterator);\n\n function MapIterator(map, type, reverse) {\n this._type = type;\n this._reverse = reverse;\n this._stack = map._root && mapIteratorFrame(map._root);\n }\n\n MapIterator.prototype.next = function() {\n var type = this._type;\n var stack = this._stack;\n while (stack) {\n var node = stack.node;\n var index = stack.index++;\n var maxIndex;\n if (node.entry) {\n if (index === 0) {\n return mapIteratorValue(type, node.entry);\n }\n } else if (node.entries) {\n maxIndex = node.entries.length - 1;\n if (index <= maxIndex) {\n return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);\n }\n } else {\n maxIndex = node.nodes.length - 1;\n if (index <= maxIndex) {\n var subNode = node.nodes[this._reverse ? maxIndex - index : index];\n if (subNode) {\n if (subNode.entry) {\n return mapIteratorValue(type, subNode.entry);\n }\n stack = this._stack = mapIteratorFrame(subNode, stack);\n }\n continue;\n }\n }\n stack = this._stack = this._stack.__prev;\n }\n return iteratorDone();\n };\n\n\n function mapIteratorValue(type, entry) {\n return iteratorValue(type, entry[0], entry[1]);\n }\n\n function mapIteratorFrame(node, prev) {\n return {\n node: node,\n index: 0,\n __prev: prev\n };\n }\n\n function makeMap(size, root, ownerID, hash) {\n var map = Object.create(MapPrototype);\n map.size = size;\n map._root = root;\n map.__ownerID = ownerID;\n map.__hash = hash;\n map.__altered = false;\n return map;\n }\n\n var EMPTY_MAP;\n function emptyMap() {\n return EMPTY_MAP || (EMPTY_MAP = makeMap(0));\n }\n\n function updateMap(map, k, v) {\n var newRoot;\n var newSize;\n if (!map._root) {\n if (v === NOT_SET) {\n return map;\n }\n newSize = 1;\n newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);\n } else {\n var didChangeSize = MakeRef(CHANGE_LENGTH);\n var didAlter = MakeRef(DID_ALTER);\n newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);\n if (!didAlter.value) {\n return map;\n }\n newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);\n }\n if (map.__ownerID) {\n map.size = newSize;\n map._root = newRoot;\n map.__hash = undefined;\n map.__altered = true;\n return map;\n }\n return newRoot ? makeMap(newSize, newRoot) : emptyMap();\n }\n\n function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (!node) {\n if (value === NOT_SET) {\n return node;\n }\n SetRef(didAlter);\n SetRef(didChangeSize);\n return new ValueNode(ownerID, keyHash, [key, value]);\n }\n return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);\n }\n\n function isLeafNode(node) {\n return node.constructor === ValueNode || node.constructor === HashCollisionNode;\n }\n\n function mergeIntoNode(node, ownerID, shift, keyHash, entry) {\n if (node.keyHash === keyHash) {\n return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);\n }\n\n var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;\n var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\n var newNode;\n var nodes = idx1 === idx2 ?\n [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] :\n ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);\n\n return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);\n }\n\n function createNodes(ownerID, entries, key, value) {\n if (!ownerID) {\n ownerID = new OwnerID();\n }\n var node = new ValueNode(ownerID, hash(key), [key, value]);\n for (var ii = 0; ii < entries.length; ii++) {\n var entry = entries[ii];\n node = node.update(ownerID, 0, undefined, entry[0], entry[1]);\n }\n return node;\n }\n\n function packNodes(ownerID, nodes, count, excluding) {\n var bitmap = 0;\n var packedII = 0;\n var packedNodes = new Array(count);\n for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {\n var node = nodes[ii];\n if (node !== undefined && ii !== excluding) {\n bitmap |= bit;\n packedNodes[packedII++] = node;\n }\n }\n return new BitmapIndexedNode(ownerID, bitmap, packedNodes);\n }\n\n function expandNodes(ownerID, nodes, bitmap, including, node) {\n var count = 0;\n var expandedNodes = new Array(SIZE);\n for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {\n expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;\n }\n expandedNodes[including] = node;\n return new HashArrayMapNode(ownerID, count + 1, expandedNodes);\n }\n\n function mergeIntoMapWith(map, merger, iterables) {\n var iters = [];\n for (var ii = 0; ii < iterables.length; ii++) {\n var value = iterables[ii];\n var iter = KeyedIterable(value);\n if (!isIterable(value)) {\n iter = iter.map(function(v ) {return fromJS(v)});\n }\n iters.push(iter);\n }\n return mergeIntoCollectionWith(map, merger, iters);\n }\n\n function deepMerger(existing, value, key) {\n return existing && existing.mergeDeep && isIterable(value) ?\n existing.mergeDeep(value) :\n is(existing, value) ? existing : value;\n }\n\n function deepMergerWith(merger) {\n return function(existing, value, key) {\n if (existing && existing.mergeDeepWith && isIterable(value)) {\n return existing.mergeDeepWith(merger, value);\n }\n var nextValue = merger(existing, value, key);\n return is(existing, nextValue) ? existing : nextValue;\n };\n }\n\n function mergeIntoCollectionWith(collection, merger, iters) {\n iters = iters.filter(function(x ) {return x.size !== 0});\n if (iters.length === 0) {\n return collection;\n }\n if (collection.size === 0 && !collection.__ownerID && iters.length === 1) {\n return collection.constructor(iters[0]);\n }\n return collection.withMutations(function(collection ) {\n var mergeIntoMap = merger ?\n function(value, key) {\n collection.update(key, NOT_SET, function(existing )\n {return existing === NOT_SET ? value : merger(existing, value, key)}\n );\n } :\n function(value, key) {\n collection.set(key, value);\n }\n for (var ii = 0; ii < iters.length; ii++) {\n iters[ii].forEach(mergeIntoMap);\n }\n });\n }\n\n function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {\n var isNotSet = existing === NOT_SET;\n var step = keyPathIter.next();\n if (step.done) {\n var existingValue = isNotSet ? notSetValue : existing;\n var newValue = updater(existingValue);\n return newValue === existingValue ? existing : newValue;\n }\n invariant(\n isNotSet || (existing && existing.set),\n 'invalid keyPath'\n );\n var key = step.value;\n var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);\n var nextUpdated = updateInDeepMap(\n nextExisting,\n keyPathIter,\n notSetValue,\n updater\n );\n return nextUpdated === nextExisting ? existing :\n nextUpdated === NOT_SET ? existing.remove(key) :\n (isNotSet ? emptyMap() : existing).set(key, nextUpdated);\n }\n\n function popCount(x) {\n x = x - ((x >> 1) & 0x55555555);\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333);\n x = (x + (x >> 4)) & 0x0f0f0f0f;\n x = x + (x >> 8);\n x = x + (x >> 16);\n return x & 0x7f;\n }\n\n function setIn(array, idx, val, canEdit) {\n var newArray = canEdit ? array : arrCopy(array);\n newArray[idx] = val;\n return newArray;\n }\n\n function spliceIn(array, idx, val, canEdit) {\n var newLen = array.length + 1;\n if (canEdit && idx + 1 === newLen) {\n array[idx] = val;\n return array;\n }\n var newArray = new Array(newLen);\n var after = 0;\n for (var ii = 0; ii < newLen; ii++) {\n if (ii === idx) {\n newArray[ii] = val;\n after = -1;\n } else {\n newArray[ii] = array[ii + after];\n }\n }\n return newArray;\n }\n\n function spliceOut(array, idx, canEdit) {\n var newLen = array.length - 1;\n if (canEdit && idx === newLen) {\n array.pop();\n return array;\n }\n var newArray = new Array(newLen);\n var after = 0;\n for (var ii = 0; ii < newLen; ii++) {\n if (ii === idx) {\n after = 1;\n }\n newArray[ii] = array[ii + after];\n }\n return newArray;\n }\n\n var MAX_ARRAY_MAP_SIZE = SIZE / 4;\n var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;\n var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;\n\n createClass(List, IndexedCollection);\n\n // @pragma Construction\n\n function List(value) {\n var empty = emptyList();\n if (value === null || value === undefined) {\n return empty;\n }\n if (isList(value)) {\n return value;\n }\n var iter = IndexedIterable(value);\n var size = iter.size;\n if (size === 0) {\n return empty;\n }\n assertNotInfinite(size);\n if (size > 0 && size < SIZE) {\n return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));\n }\n return empty.withMutations(function(list ) {\n list.setSize(size);\n iter.forEach(function(v, i) {return list.set(i, v)});\n });\n }\n\n List.of = function(/*...values*/) {\n return this(arguments);\n };\n\n List.prototype.toString = function() {\n return this.__toString('List [', ']');\n };\n\n // @pragma Access\n\n List.prototype.get = function(index, notSetValue) {\n index = wrapIndex(this, index);\n if (index >= 0 && index < this.size) {\n index += this._origin;\n var node = listNodeFor(this, index);\n return node && node.array[index & MASK];\n }\n return notSetValue;\n };\n\n // @pragma Modification\n\n List.prototype.set = function(index, value) {\n return updateList(this, index, value);\n };\n\n List.prototype.remove = function(index) {\n return !this.has(index) ? this :\n index === 0 ? this.shift() :\n index === this.size - 1 ? this.pop() :\n this.splice(index, 1);\n };\n\n List.prototype.insert = function(index, value) {\n return this.splice(index, 0, value);\n };\n\n List.prototype.clear = function() {\n if (this.size === 0) {\n return this;\n }\n if (this.__ownerID) {\n this.size = this._origin = this._capacity = 0;\n this._level = SHIFT;\n this._root = this._tail = null;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n return emptyList();\n };\n\n List.prototype.push = function(/*...values*/) {\n var values = arguments;\n var oldSize = this.size;\n return this.withMutations(function(list ) {\n setListBounds(list, 0, oldSize + values.length);\n for (var ii = 0; ii < values.length; ii++) {\n list.set(oldSize + ii, values[ii]);\n }\n });\n };\n\n List.prototype.pop = function() {\n return setListBounds(this, 0, -1);\n };\n\n List.prototype.unshift = function(/*...values*/) {\n var values = arguments;\n return this.withMutations(function(list ) {\n setListBounds(list, -values.length);\n for (var ii = 0; ii < values.length; ii++) {\n list.set(ii, values[ii]);\n }\n });\n };\n\n List.prototype.shift = function() {\n return setListBounds(this, 1);\n };\n\n // @pragma Composition\n\n List.prototype.merge = function(/*...iters*/) {\n return mergeIntoListWith(this, undefined, arguments);\n };\n\n List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);\n return mergeIntoListWith(this, merger, iters);\n };\n\n List.prototype.mergeDeep = function(/*...iters*/) {\n return mergeIntoListWith(this, deepMerger, arguments);\n };\n\n List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);\n return mergeIntoListWith(this, deepMergerWith(merger), iters);\n };\n\n List.prototype.setSize = function(size) {\n return setListBounds(this, 0, size);\n };\n\n // @pragma Iteration\n\n List.prototype.slice = function(begin, end) {\n var size = this.size;\n if (wholeSlice(begin, end, size)) {\n return this;\n }\n return setListBounds(\n this,\n resolveBegin(begin, size),\n resolveEnd(end, size)\n );\n };\n\n List.prototype.__iterator = function(type, reverse) {\n var index = 0;\n var values = iterateList(this, reverse);\n return new Iterator(function() {\n var value = values();\n return value === DONE ?\n iteratorDone() :\n iteratorValue(type, index++, value);\n });\n };\n\n List.prototype.__iterate = function(fn, reverse) {\n var index = 0;\n var values = iterateList(this, reverse);\n var value;\n while ((value = values()) !== DONE) {\n if (fn(value, index++, this) === false) {\n break;\n }\n }\n return index;\n };\n\n List.prototype.__ensureOwner = function(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n if (!ownerID) {\n this.__ownerID = ownerID;\n return this;\n }\n return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);\n };\n\n\n function isList(maybeList) {\n return !!(maybeList && maybeList[IS_LIST_SENTINEL]);\n }\n\n List.isList = isList;\n\n var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';\n\n var ListPrototype = List.prototype;\n ListPrototype[IS_LIST_SENTINEL] = true;\n ListPrototype[DELETE] = ListPrototype.remove;\n ListPrototype.setIn = MapPrototype.setIn;\n ListPrototype.deleteIn =\n ListPrototype.removeIn = MapPrototype.removeIn;\n ListPrototype.update = MapPrototype.update;\n ListPrototype.updateIn = MapPrototype.updateIn;\n ListPrototype.mergeIn = MapPrototype.mergeIn;\n ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n ListPrototype.withMutations = MapPrototype.withMutations;\n ListPrototype.asMutable = MapPrototype.asMutable;\n ListPrototype.asImmutable = MapPrototype.asImmutable;\n ListPrototype.wasAltered = MapPrototype.wasAltered;\n\n\n\n function VNode(array, ownerID) {\n this.array = array;\n this.ownerID = ownerID;\n }\n\n // TODO: seems like these methods are very similar\n\n VNode.prototype.removeBefore = function(ownerID, level, index) {\n if (index === level ? 1 << level : 0 || this.array.length === 0) {\n return this;\n }\n var originIndex = (index >>> level) & MASK;\n if (originIndex >= this.array.length) {\n return new VNode([], ownerID);\n }\n var removingFirst = originIndex === 0;\n var newChild;\n if (level > 0) {\n var oldChild = this.array[originIndex];\n newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);\n if (newChild === oldChild && removingFirst) {\n return this;\n }\n }\n if (removingFirst && !newChild) {\n return this;\n }\n var editable = editableVNode(this, ownerID);\n if (!removingFirst) {\n for (var ii = 0; ii < originIndex; ii++) {\n editable.array[ii] = undefined;\n }\n }\n if (newChild) {\n editable.array[originIndex] = newChild;\n }\n return editable;\n };\n\n VNode.prototype.removeAfter = function(ownerID, level, index) {\n if (index === (level ? 1 << level : 0) || this.array.length === 0) {\n return this;\n }\n var sizeIndex = ((index - 1) >>> level) & MASK;\n if (sizeIndex >= this.array.length) {\n return this;\n }\n\n var newChild;\n if (level > 0) {\n var oldChild = this.array[sizeIndex];\n newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);\n if (newChild === oldChild && sizeIndex === this.array.length - 1) {\n return this;\n }\n }\n\n var editable = editableVNode(this, ownerID);\n editable.array.splice(sizeIndex + 1);\n if (newChild) {\n editable.array[sizeIndex] = newChild;\n }\n return editable;\n };\n\n\n\n var DONE = {};\n\n function iterateList(list, reverse) {\n var left = list._origin;\n var right = list._capacity;\n var tailPos = getTailOffset(right);\n var tail = list._tail;\n\n return iterateNodeOrLeaf(list._root, list._level, 0);\n\n function iterateNodeOrLeaf(node, level, offset) {\n return level === 0 ?\n iterateLeaf(node, offset) :\n iterateNode(node, level, offset);\n }\n\n function iterateLeaf(node, offset) {\n var array = offset === tailPos ? tail && tail.array : node && node.array;\n var from = offset > left ? 0 : left - offset;\n var to = right - offset;\n if (to > SIZE) {\n to = SIZE;\n }\n return function() {\n if (from === to) {\n return DONE;\n }\n var idx = reverse ? --to : from++;\n return array && array[idx];\n };\n }\n\n function iterateNode(node, level, offset) {\n var values;\n var array = node && node.array;\n var from = offset > left ? 0 : (left - offset) >> level;\n var to = ((right - offset) >> level) + 1;\n if (to > SIZE) {\n to = SIZE;\n }\n return function() {\n do {\n if (values) {\n var value = values();\n if (value !== DONE) {\n return value;\n }\n values = null;\n }\n if (from === to) {\n return DONE;\n }\n var idx = reverse ? --to : from++;\n values = iterateNodeOrLeaf(\n array && array[idx], level - SHIFT, offset + (idx << level)\n );\n } while (true);\n };\n }\n }\n\n function makeList(origin, capacity, level, root, tail, ownerID, hash) {\n var list = Object.create(ListPrototype);\n list.size = capacity - origin;\n list._origin = origin;\n list._capacity = capacity;\n list._level = level;\n list._root = root;\n list._tail = tail;\n list.__ownerID = ownerID;\n list.__hash = hash;\n list.__altered = false;\n return list;\n }\n\n var EMPTY_LIST;\n function emptyList() {\n return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));\n }\n\n function updateList(list, index, value) {\n index = wrapIndex(list, index);\n\n if (index !== index) {\n return list;\n }\n\n if (index >= list.size || index < 0) {\n return list.withMutations(function(list ) {\n index < 0 ?\n setListBounds(list, index).set(0, value) :\n setListBounds(list, 0, index + 1).set(index, value)\n });\n }\n\n index += list._origin;\n\n var newTail = list._tail;\n var newRoot = list._root;\n var didAlter = MakeRef(DID_ALTER);\n if (index >= getTailOffset(list._capacity)) {\n newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);\n } else {\n newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);\n }\n\n if (!didAlter.value) {\n return list;\n }\n\n if (list.__ownerID) {\n list._root = newRoot;\n list._tail = newTail;\n list.__hash = undefined;\n list.__altered = true;\n return list;\n }\n return makeList(list._origin, list._capacity, list._level, newRoot, newTail);\n }\n\n function updateVNode(node, ownerID, level, index, value, didAlter) {\n var idx = (index >>> level) & MASK;\n var nodeHas = node && idx < node.array.length;\n if (!nodeHas && value === undefined) {\n return node;\n }\n\n var newNode;\n\n if (level > 0) {\n var lowerNode = node && node.array[idx];\n var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);\n if (newLowerNode === lowerNode) {\n return node;\n }\n newNode = editableVNode(node, ownerID);\n newNode.array[idx] = newLowerNode;\n return newNode;\n }\n\n if (nodeHas && node.array[idx] === value) {\n return node;\n }\n\n SetRef(didAlter);\n\n newNode = editableVNode(node, ownerID);\n if (value === undefined && idx === newNode.array.length - 1) {\n newNode.array.pop();\n } else {\n newNode.array[idx] = value;\n }\n return newNode;\n }\n\n function editableVNode(node, ownerID) {\n if (ownerID && node && ownerID === node.ownerID) {\n return node;\n }\n return new VNode(node ? node.array.slice() : [], ownerID);\n }\n\n function listNodeFor(list, rawIndex) {\n if (rawIndex >= getTailOffset(list._capacity)) {\n return list._tail;\n }\n if (rawIndex < 1 << (list._level + SHIFT)) {\n var node = list._root;\n var level = list._level;\n while (node && level > 0) {\n node = node.array[(rawIndex >>> level) & MASK];\n level -= SHIFT;\n }\n return node;\n }\n }\n\n function setListBounds(list, begin, end) {\n // Sanitize begin & end using this shorthand for ToInt32(argument)\n // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32\n if (begin !== undefined) {\n begin = begin | 0;\n }\n if (end !== undefined) {\n end = end | 0;\n }\n var owner = list.__ownerID || new OwnerID();\n var oldOrigin = list._origin;\n var oldCapacity = list._capacity;\n var newOrigin = oldOrigin + begin;\n var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;\n if (newOrigin === oldOrigin && newCapacity === oldCapacity) {\n return list;\n }\n\n // If it's going to end after it starts, it's empty.\n if (newOrigin >= newCapacity) {\n return list.clear();\n }\n\n var newLevel = list._level;\n var newRoot = list._root;\n\n // New origin might need creating a higher root.\n var offsetShift = 0;\n while (newOrigin + offsetShift < 0) {\n newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);\n newLevel += SHIFT;\n offsetShift += 1 << newLevel;\n }\n if (offsetShift) {\n newOrigin += offsetShift;\n oldOrigin += offsetShift;\n newCapacity += offsetShift;\n oldCapacity += offsetShift;\n }\n\n var oldTailOffset = getTailOffset(oldCapacity);\n var newTailOffset = getTailOffset(newCapacity);\n\n // New size might need creating a higher root.\n while (newTailOffset >= 1 << (newLevel + SHIFT)) {\n newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);\n newLevel += SHIFT;\n }\n\n // Locate or create the new tail.\n var oldTail = list._tail;\n var newTail = newTailOffset < oldTailOffset ?\n listNodeFor(list, newCapacity - 1) :\n newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;\n\n // Merge Tail into tree.\n if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {\n newRoot = editableVNode(newRoot, owner);\n var node = newRoot;\n for (var level = newLevel; level > SHIFT; level -= SHIFT) {\n var idx = (oldTailOffset >>> level) & MASK;\n node = node.array[idx] = editableVNode(node.array[idx], owner);\n }\n node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;\n }\n\n // If the size has been reduced, there's a chance the tail needs to be trimmed.\n if (newCapacity < oldCapacity) {\n newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);\n }\n\n // If the new origin is within the tail, then we do not need a root.\n if (newOrigin >= newTailOffset) {\n newOrigin -= newTailOffset;\n newCapacity -= newTailOffset;\n newLevel = SHIFT;\n newRoot = null;\n newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);\n\n // Otherwise, if the root has been trimmed, garbage collect.\n } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {\n offsetShift = 0;\n\n // Identify the new top root node of the subtree of the old root.\n while (newRoot) {\n var beginIndex = (newOrigin >>> newLevel) & MASK;\n if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {\n break;\n }\n if (beginIndex) {\n offsetShift += (1 << newLevel) * beginIndex;\n }\n newLevel -= SHIFT;\n newRoot = newRoot.array[beginIndex];\n }\n\n // Trim the new sides of the new root.\n if (newRoot && newOrigin > oldOrigin) {\n newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);\n }\n if (newRoot && newTailOffset < oldTailOffset) {\n newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);\n }\n if (offsetShift) {\n newOrigin -= offsetShift;\n newCapacity -= offsetShift;\n }\n }\n\n if (list.__ownerID) {\n list.size = newCapacity - newOrigin;\n list._origin = newOrigin;\n list._capacity = newCapacity;\n list._level = newLevel;\n list._root = newRoot;\n list._tail = newTail;\n list.__hash = undefined;\n list.__altered = true;\n return list;\n }\n return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);\n }\n\n function mergeIntoListWith(list, merger, iterables) {\n var iters = [];\n var maxSize = 0;\n for (var ii = 0; ii < iterables.length; ii++) {\n var value = iterables[ii];\n var iter = IndexedIterable(value);\n if (iter.size > maxSize) {\n maxSize = iter.size;\n }\n if (!isIterable(value)) {\n iter = iter.map(function(v ) {return fromJS(v)});\n }\n iters.push(iter);\n }\n if (maxSize > list.size) {\n list = list.setSize(maxSize);\n }\n return mergeIntoCollectionWith(list, merger, iters);\n }\n\n function getTailOffset(size) {\n return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);\n }\n\n createClass(OrderedMap, Map);\n\n // @pragma Construction\n\n function OrderedMap(value) {\n return value === null || value === undefined ? emptyOrderedMap() :\n isOrderedMap(value) ? value :\n emptyOrderedMap().withMutations(function(map ) {\n var iter = KeyedIterable(value);\n assertNotInfinite(iter.size);\n iter.forEach(function(v, k) {return map.set(k, v)});\n });\n }\n\n OrderedMap.of = function(/*...values*/) {\n return this(arguments);\n };\n\n OrderedMap.prototype.toString = function() {\n return this.__toString('OrderedMap {', '}');\n };\n\n // @pragma Access\n\n OrderedMap.prototype.get = function(k, notSetValue) {\n var index = this._map.get(k);\n return index !== undefined ? this._list.get(index)[1] : notSetValue;\n };\n\n // @pragma Modification\n\n OrderedMap.prototype.clear = function() {\n if (this.size === 0) {\n return this;\n }\n if (this.__ownerID) {\n this.size = 0;\n this._map.clear();\n this._list.clear();\n return this;\n }\n return emptyOrderedMap();\n };\n\n OrderedMap.prototype.set = function(k, v) {\n return updateOrderedMap(this, k, v);\n };\n\n OrderedMap.prototype.remove = function(k) {\n return updateOrderedMap(this, k, NOT_SET);\n };\n\n OrderedMap.prototype.wasAltered = function() {\n return this._map.wasAltered() || this._list.wasAltered();\n };\n\n OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n return this._list.__iterate(\n function(entry ) {return entry && fn(entry[1], entry[0], this$0)},\n reverse\n );\n };\n\n OrderedMap.prototype.__iterator = function(type, reverse) {\n return this._list.fromEntrySeq().__iterator(type, reverse);\n };\n\n OrderedMap.prototype.__ensureOwner = function(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n var newMap = this._map.__ensureOwner(ownerID);\n var newList = this._list.__ensureOwner(ownerID);\n if (!ownerID) {\n this.__ownerID = ownerID;\n this._map = newMap;\n this._list = newList;\n return this;\n }\n return makeOrderedMap(newMap, newList, ownerID, this.__hash);\n };\n\n\n function isOrderedMap(maybeOrderedMap) {\n return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);\n }\n\n OrderedMap.isOrderedMap = isOrderedMap;\n\n OrderedMap.prototype[IS_ORDERED_SENTINEL] = true;\n OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;\n\n\n\n function makeOrderedMap(map, list, ownerID, hash) {\n var omap = Object.create(OrderedMap.prototype);\n omap.size = map ? map.size : 0;\n omap._map = map;\n omap._list = list;\n omap.__ownerID = ownerID;\n omap.__hash = hash;\n return omap;\n }\n\n var EMPTY_ORDERED_MAP;\n function emptyOrderedMap() {\n return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));\n }\n\n function updateOrderedMap(omap, k, v) {\n var map = omap._map;\n var list = omap._list;\n var i = map.get(k);\n var has = i !== undefined;\n var newMap;\n var newList;\n if (v === NOT_SET) { // removed\n if (!has) {\n return omap;\n }\n if (list.size >= SIZE && list.size >= map.size * 2) {\n newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx});\n newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap();\n if (omap.__ownerID) {\n newMap.__ownerID = newList.__ownerID = omap.__ownerID;\n }\n } else {\n newMap = map.remove(k);\n newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);\n }\n } else {\n if (has) {\n if (v === list.get(i)[1]) {\n return omap;\n }\n newMap = map;\n newList = list.set(i, [k, v]);\n } else {\n newMap = map.set(k, list.size);\n newList = list.set(list.size, [k, v]);\n }\n }\n if (omap.__ownerID) {\n omap.size = newMap.size;\n omap._map = newMap;\n omap._list = newList;\n omap.__hash = undefined;\n return omap;\n }\n return makeOrderedMap(newMap, newList);\n }\n\n createClass(ToKeyedSequence, KeyedSeq);\n function ToKeyedSequence(indexed, useKeys) {\n this._iter = indexed;\n this._useKeys = useKeys;\n this.size = indexed.size;\n }\n\n ToKeyedSequence.prototype.get = function(key, notSetValue) {\n return this._iter.get(key, notSetValue);\n };\n\n ToKeyedSequence.prototype.has = function(key) {\n return this._iter.has(key);\n };\n\n ToKeyedSequence.prototype.valueSeq = function() {\n return this._iter.valueSeq();\n };\n\n ToKeyedSequence.prototype.reverse = function() {var this$0 = this;\n var reversedSequence = reverseFactory(this, true);\n if (!this._useKeys) {\n reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()};\n }\n return reversedSequence;\n };\n\n ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this;\n var mappedSequence = mapFactory(this, mapper, context);\n if (!this._useKeys) {\n mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)};\n }\n return mappedSequence;\n };\n\n ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n var ii;\n return this._iter.__iterate(\n this._useKeys ?\n function(v, k) {return fn(v, k, this$0)} :\n ((ii = reverse ? resolveSize(this) : 0),\n function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}),\n reverse\n );\n };\n\n ToKeyedSequence.prototype.__iterator = function(type, reverse) {\n if (this._useKeys) {\n return this._iter.__iterator(type, reverse);\n }\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n var ii = reverse ? resolveSize(this) : 0;\n return new Iterator(function() {\n var step = iterator.next();\n return step.done ? step :\n iteratorValue(type, reverse ? --ii : ii++, step.value, step);\n });\n };\n\n ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;\n\n\n createClass(ToIndexedSequence, IndexedSeq);\n function ToIndexedSequence(iter) {\n this._iter = iter;\n this.size = iter.size;\n }\n\n ToIndexedSequence.prototype.includes = function(value) {\n return this._iter.includes(value);\n };\n\n ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n var iterations = 0;\n return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse);\n };\n\n ToIndexedSequence.prototype.__iterator = function(type, reverse) {\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n var iterations = 0;\n return new Iterator(function() {\n var step = iterator.next();\n return step.done ? step :\n iteratorValue(type, iterations++, step.value, step)\n });\n };\n\n\n\n createClass(ToSetSequence, SetSeq);\n function ToSetSequence(iter) {\n this._iter = iter;\n this.size = iter.size;\n }\n\n ToSetSequence.prototype.has = function(key) {\n return this._iter.includes(key);\n };\n\n ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse);\n };\n\n ToSetSequence.prototype.__iterator = function(type, reverse) {\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n return new Iterator(function() {\n var step = iterator.next();\n return step.done ? step :\n iteratorValue(type, step.value, step.value, step);\n });\n };\n\n\n\n createClass(FromEntriesSequence, KeyedSeq);\n function FromEntriesSequence(entries) {\n this._iter = entries;\n this.size = entries.size;\n }\n\n FromEntriesSequence.prototype.entrySeq = function() {\n return this._iter.toSeq();\n };\n\n FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n return this._iter.__iterate(function(entry ) {\n // Check if entry exists first so array access doesn't throw for holes\n // in the parent iteration.\n if (entry) {\n validateEntry(entry);\n var indexedIterable = isIterable(entry);\n return fn(\n indexedIterable ? entry.get(1) : entry[1],\n indexedIterable ? entry.get(0) : entry[0],\n this$0\n );\n }\n }, reverse);\n };\n\n FromEntriesSequence.prototype.__iterator = function(type, reverse) {\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n return new Iterator(function() {\n while (true) {\n var step = iterator.next();\n if (step.done) {\n return step;\n }\n var entry = step.value;\n // Check if entry exists first so array access doesn't throw for holes\n // in the parent iteration.\n if (entry) {\n validateEntry(entry);\n var indexedIterable = isIterable(entry);\n return iteratorValue(\n type,\n indexedIterable ? entry.get(0) : entry[0],\n indexedIterable ? entry.get(1) : entry[1],\n step\n );\n }\n }\n });\n };\n\n\n ToIndexedSequence.prototype.cacheResult =\n ToKeyedSequence.prototype.cacheResult =\n ToSetSequence.prototype.cacheResult =\n FromEntriesSequence.prototype.cacheResult =\n cacheResultThrough;\n\n\n function flipFactory(iterable) {\n var flipSequence = makeSequence(iterable);\n flipSequence._iter = iterable;\n flipSequence.size = iterable.size;\n flipSequence.flip = function() {return iterable};\n flipSequence.reverse = function () {\n var reversedSequence = iterable.reverse.apply(this); // super.reverse()\n reversedSequence.flip = function() {return iterable.reverse()};\n return reversedSequence;\n };\n flipSequence.has = function(key ) {return iterable.includes(key)};\n flipSequence.includes = function(key ) {return iterable.has(key)};\n flipSequence.cacheResult = cacheResultThrough;\n flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;\n return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse);\n }\n flipSequence.__iteratorUncached = function(type, reverse) {\n if (type === ITERATE_ENTRIES) {\n var iterator = iterable.__iterator(type, reverse);\n return new Iterator(function() {\n var step = iterator.next();\n if (!step.done) {\n var k = step.value[0];\n step.value[0] = step.value[1];\n step.value[1] = k;\n }\n return step;\n });\n }\n return iterable.__iterator(\n type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES,\n reverse\n );\n }\n return flipSequence;\n }\n\n\n function mapFactory(iterable, mapper, context) {\n var mappedSequence = makeSequence(iterable);\n mappedSequence.size = iterable.size;\n mappedSequence.has = function(key ) {return iterable.has(key)};\n mappedSequence.get = function(key, notSetValue) {\n var v = iterable.get(key, NOT_SET);\n return v === NOT_SET ?\n notSetValue :\n mapper.call(context, v, key, iterable);\n };\n mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;\n return iterable.__iterate(\n function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false},\n reverse\n );\n }\n mappedSequence.__iteratorUncached = function (type, reverse) {\n var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n return new Iterator(function() {\n var step = iterator.next();\n if (step.done) {\n return step;\n }\n var entry = step.value;\n var key = entry[0];\n return iteratorValue(\n type,\n key,\n mapper.call(context, entry[1], key, iterable),\n step\n );\n });\n }\n return mappedSequence;\n }\n\n\n function reverseFactory(iterable, useKeys) {\n var reversedSequence = makeSequence(iterable);\n reversedSequence._iter = iterable;\n reversedSequence.size = iterable.size;\n reversedSequence.reverse = function() {return iterable};\n if (iterable.flip) {\n reversedSequence.flip = function () {\n var flipSequence = flipFactory(iterable);\n flipSequence.reverse = function() {return iterable.flip()};\n return flipSequence;\n };\n }\n reversedSequence.get = function(key, notSetValue) \n {return iterable.get(useKeys ? key : -1 - key, notSetValue)};\n reversedSequence.has = function(key )\n {return iterable.has(useKeys ? key : -1 - key)};\n reversedSequence.includes = function(value ) {return iterable.includes(value)};\n reversedSequence.cacheResult = cacheResultThrough;\n reversedSequence.__iterate = function (fn, reverse) {var this$0 = this;\n return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse);\n };\n reversedSequence.__iterator =\n function(type, reverse) {return iterable.__iterator(type, !reverse)};\n return reversedSequence;\n }\n\n\n function filterFactory(iterable, predicate, context, useKeys) {\n var filterSequence = makeSequence(iterable);\n if (useKeys) {\n filterSequence.has = function(key ) {\n var v = iterable.get(key, NOT_SET);\n return v !== NOT_SET && !!predicate.call(context, v, key, iterable);\n };\n filterSequence.get = function(key, notSetValue) {\n var v = iterable.get(key, NOT_SET);\n return v !== NOT_SET && predicate.call(context, v, key, iterable) ?\n v : notSetValue;\n };\n }\n filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;\n var iterations = 0;\n iterable.__iterate(function(v, k, c) {\n if (predicate.call(context, v, k, c)) {\n iterations++;\n return fn(v, useKeys ? k : iterations - 1, this$0);\n }\n }, reverse);\n return iterations;\n };\n filterSequence.__iteratorUncached = function (type, reverse) {\n var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n var iterations = 0;\n return new Iterator(function() {\n while (true) {\n var step = iterator.next();\n if (step.done) {\n return step;\n }\n var entry = step.value;\n var key = entry[0];\n var value = entry[1];\n if (predicate.call(context, value, key, iterable)) {\n return iteratorValue(type, useKeys ? key : iterations++, value, step);\n }\n }\n });\n }\n return filterSequence;\n }\n\n\n function countByFactory(iterable, grouper, context) {\n var groups = Map().asMutable();\n iterable.__iterate(function(v, k) {\n groups.update(\n grouper.call(context, v, k, iterable),\n 0,\n function(a ) {return a + 1}\n );\n });\n return groups.asImmutable();\n }\n\n\n function groupByFactory(iterable, grouper, context) {\n var isKeyedIter = isKeyed(iterable);\n var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();\n iterable.__iterate(function(v, k) {\n groups.update(\n grouper.call(context, v, k, iterable),\n function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)}\n );\n });\n var coerce = iterableClass(iterable);\n return groups.map(function(arr ) {return reify(iterable, coerce(arr))});\n }\n\n\n function sliceFactory(iterable, begin, end, useKeys) {\n var originalSize = iterable.size;\n\n // Sanitize begin & end using this shorthand for ToInt32(argument)\n // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32\n if (begin !== undefined) {\n begin = begin | 0;\n }\n if (end !== undefined) {\n if (end === Infinity) {\n end = originalSize;\n } else {\n end = end | 0;\n }\n }\n\n if (wholeSlice(begin, end, originalSize)) {\n return iterable;\n }\n\n var resolvedBegin = resolveBegin(begin, originalSize);\n var resolvedEnd = resolveEnd(end, originalSize);\n\n // begin or end will be NaN if they were provided as negative numbers and\n // this iterable's size is unknown. In that case, cache first so there is\n // a known size and these do not resolve to NaN.\n if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {\n return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);\n }\n\n // Note: resolvedEnd is undefined when the original sequence's length is\n // unknown and this slice did not supply an end and should contain all\n // elements after resolvedBegin.\n // In that case, resolvedSize will be NaN and sliceSize will remain undefined.\n var resolvedSize = resolvedEnd - resolvedBegin;\n var sliceSize;\n if (resolvedSize === resolvedSize) {\n sliceSize = resolvedSize < 0 ? 0 : resolvedSize;\n }\n\n var sliceSeq = makeSequence(iterable);\n\n // If iterable.size is undefined, the size of the realized sliceSeq is\n // unknown at this point unless the number of items to slice is 0\n sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined;\n\n if (!useKeys && isSeq(iterable) && sliceSize >= 0) {\n sliceSeq.get = function (index, notSetValue) {\n index = wrapIndex(this, index);\n return index >= 0 && index < sliceSize ?\n iterable.get(index + resolvedBegin, notSetValue) :\n notSetValue;\n }\n }\n\n sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this;\n if (sliceSize === 0) {\n return 0;\n }\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n var skipped = 0;\n var isSkipping = true;\n var iterations = 0;\n iterable.__iterate(function(v, k) {\n if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {\n iterations++;\n return fn(v, useKeys ? k : iterations - 1, this$0) !== false &&\n iterations !== sliceSize;\n }\n });\n return iterations;\n };\n\n sliceSeq.__iteratorUncached = function(type, reverse) {\n if (sliceSize !== 0 && reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n // Don't bother instantiating parent iterator if taking 0.\n var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse);\n var skipped = 0;\n var iterations = 0;\n return new Iterator(function() {\n while (skipped++ < resolvedBegin) {\n iterator.next();\n }\n if (++iterations > sliceSize) {\n return iteratorDone();\n }\n var step = iterator.next();\n if (useKeys || type === ITERATE_VALUES) {\n return step;\n } else if (type === ITERATE_KEYS) {\n return iteratorValue(type, iterations - 1, undefined, step);\n } else {\n return iteratorValue(type, iterations - 1, step.value[1], step);\n }\n });\n }\n\n return sliceSeq;\n }\n\n\n function takeWhileFactory(iterable, predicate, context) {\n var takeSequence = makeSequence(iterable);\n takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n var iterations = 0;\n iterable.__iterate(function(v, k, c) \n {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)}\n );\n return iterations;\n };\n takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n var iterating = true;\n return new Iterator(function() {\n if (!iterating) {\n return iteratorDone();\n }\n var step = iterator.next();\n if (step.done) {\n return step;\n }\n var entry = step.value;\n var k = entry[0];\n var v = entry[1];\n if (!predicate.call(context, v, k, this$0)) {\n iterating = false;\n return iteratorDone();\n }\n return type === ITERATE_ENTRIES ? step :\n iteratorValue(type, k, v, step);\n });\n };\n return takeSequence;\n }\n\n\n function skipWhileFactory(iterable, predicate, context, useKeys) {\n var skipSequence = makeSequence(iterable);\n skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n var isSkipping = true;\n var iterations = 0;\n iterable.__iterate(function(v, k, c) {\n if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {\n iterations++;\n return fn(v, useKeys ? k : iterations - 1, this$0);\n }\n });\n return iterations;\n };\n skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n var skipping = true;\n var iterations = 0;\n return new Iterator(function() {\n var step, k, v;\n do {\n step = iterator.next();\n if (step.done) {\n if (useKeys || type === ITERATE_VALUES) {\n return step;\n } else if (type === ITERATE_KEYS) {\n return iteratorValue(type, iterations++, undefined, step);\n } else {\n return iteratorValue(type, iterations++, step.value[1], step);\n }\n }\n var entry = step.value;\n k = entry[0];\n v = entry[1];\n skipping && (skipping = predicate.call(context, v, k, this$0));\n } while (skipping);\n return type === ITERATE_ENTRIES ? step :\n iteratorValue(type, k, v, step);\n });\n };\n return skipSequence;\n }\n\n\n function concatFactory(iterable, values) {\n var isKeyedIterable = isKeyed(iterable);\n var iters = [iterable].concat(values).map(function(v ) {\n if (!isIterable(v)) {\n v = isKeyedIterable ?\n keyedSeqFromValue(v) :\n indexedSeqFromValue(Array.isArray(v) ? v : [v]);\n } else if (isKeyedIterable) {\n v = KeyedIterable(v);\n }\n return v;\n }).filter(function(v ) {return v.size !== 0});\n\n if (iters.length === 0) {\n return iterable;\n }\n\n if (iters.length === 1) {\n var singleton = iters[0];\n if (singleton === iterable ||\n isKeyedIterable && isKeyed(singleton) ||\n isIndexed(iterable) && isIndexed(singleton)) {\n return singleton;\n }\n }\n\n var concatSeq = new ArraySeq(iters);\n if (isKeyedIterable) {\n concatSeq = concatSeq.toKeyedSeq();\n } else if (!isIndexed(iterable)) {\n concatSeq = concatSeq.toSetSeq();\n }\n concatSeq = concatSeq.flatten(true);\n concatSeq.size = iters.reduce(\n function(sum, seq) {\n if (sum !== undefined) {\n var size = seq.size;\n if (size !== undefined) {\n return sum + size;\n }\n }\n },\n 0\n );\n return concatSeq;\n }\n\n\n function flattenFactory(iterable, depth, useKeys) {\n var flatSequence = makeSequence(iterable);\n flatSequence.__iterateUncached = function(fn, reverse) {\n var iterations = 0;\n var stopped = false;\n function flatDeep(iter, currentDepth) {var this$0 = this;\n iter.__iterate(function(v, k) {\n if ((!depth || currentDepth < depth) && isIterable(v)) {\n flatDeep(v, currentDepth + 1);\n } else if (fn(v, useKeys ? k : iterations++, this$0) === false) {\n stopped = true;\n }\n return !stopped;\n }, reverse);\n }\n flatDeep(iterable, 0);\n return iterations;\n }\n flatSequence.__iteratorUncached = function(type, reverse) {\n var iterator = iterable.__iterator(type, reverse);\n var stack = [];\n var iterations = 0;\n return new Iterator(function() {\n while (iterator) {\n var step = iterator.next();\n if (step.done !== false) {\n iterator = stack.pop();\n continue;\n }\n var v = step.value;\n if (type === ITERATE_ENTRIES) {\n v = v[1];\n }\n if ((!depth || stack.length < depth) && isIterable(v)) {\n stack.push(iterator);\n iterator = v.__iterator(type, reverse);\n } else {\n return useKeys ? step : iteratorValue(type, iterations++, v, step);\n }\n }\n return iteratorDone();\n });\n }\n return flatSequence;\n }\n\n\n function flatMapFactory(iterable, mapper, context) {\n var coerce = iterableClass(iterable);\n return iterable.toSeq().map(\n function(v, k) {return coerce(mapper.call(context, v, k, iterable))}\n ).flatten(true);\n }\n\n\n function interposeFactory(iterable, separator) {\n var interposedSequence = makeSequence(iterable);\n interposedSequence.size = iterable.size && iterable.size * 2 -1;\n interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;\n var iterations = 0;\n iterable.__iterate(function(v, k) \n {return (!iterations || fn(separator, iterations++, this$0) !== false) &&\n fn(v, iterations++, this$0) !== false},\n reverse\n );\n return iterations;\n };\n interposedSequence.__iteratorUncached = function(type, reverse) {\n var iterator = iterable.__iterator(ITERATE_VALUES, reverse);\n var iterations = 0;\n var step;\n return new Iterator(function() {\n if (!step || iterations % 2) {\n step = iterator.next();\n if (step.done) {\n return step;\n }\n }\n return iterations % 2 ?\n iteratorValue(type, iterations++, separator) :\n iteratorValue(type, iterations++, step.value, step);\n });\n };\n return interposedSequence;\n }\n\n\n function sortFactory(iterable, comparator, mapper) {\n if (!comparator) {\n comparator = defaultComparator;\n }\n var isKeyedIterable = isKeyed(iterable);\n var index = 0;\n var entries = iterable.toSeq().map(\n function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]}\n ).toArray();\n entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach(\n isKeyedIterable ?\n function(v, i) { entries[i].length = 2; } :\n function(v, i) { entries[i] = v[1]; }\n );\n return isKeyedIterable ? KeyedSeq(entries) :\n isIndexed(iterable) ? IndexedSeq(entries) :\n SetSeq(entries);\n }\n\n\n function maxFactory(iterable, comparator, mapper) {\n if (!comparator) {\n comparator = defaultComparator;\n }\n if (mapper) {\n var entry = iterable.toSeq()\n .map(function(v, k) {return [v, mapper(v, k, iterable)]})\n .reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a});\n return entry && entry[0];\n } else {\n return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a});\n }\n }\n\n function maxCompare(comparator, a, b) {\n var comp = comparator(b, a);\n // b is considered the new max if the comparator declares them equal, but\n // they are not equal and b is in fact a nullish value.\n return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0;\n }\n\n\n function zipWithFactory(keyIter, zipper, iters) {\n var zipSequence = makeSequence(keyIter);\n zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min();\n // Note: this a generic base implementation of __iterate in terms of\n // __iterator which may be more generically useful in the future.\n zipSequence.__iterate = function(fn, reverse) {\n /* generic:\n var iterator = this.__iterator(ITERATE_ENTRIES, reverse);\n var step;\n var iterations = 0;\n while (!(step = iterator.next()).done) {\n iterations++;\n if (fn(step.value[1], step.value[0], this) === false) {\n break;\n }\n }\n return iterations;\n */\n // indexed:\n var iterator = this.__iterator(ITERATE_VALUES, reverse);\n var step;\n var iterations = 0;\n while (!(step = iterator.next()).done) {\n if (fn(step.value, iterations++, this) === false) {\n break;\n }\n }\n return iterations;\n };\n zipSequence.__iteratorUncached = function(type, reverse) {\n var iterators = iters.map(function(i )\n {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))}\n );\n var iterations = 0;\n var isDone = false;\n return new Iterator(function() {\n var steps;\n if (!isDone) {\n steps = iterators.map(function(i ) {return i.next()});\n isDone = steps.some(function(s ) {return s.done});\n }\n if (isDone) {\n return iteratorDone();\n }\n return iteratorValue(\n type,\n iterations++,\n zipper.apply(null, steps.map(function(s ) {return s.value}))\n );\n });\n };\n return zipSequence\n }\n\n\n // #pragma Helper Functions\n\n function reify(iter, seq) {\n return isSeq(iter) ? seq : iter.constructor(seq);\n }\n\n function validateEntry(entry) {\n if (entry !== Object(entry)) {\n throw new TypeError('Expected [K, V] tuple: ' + entry);\n }\n }\n\n function resolveSize(iter) {\n assertNotInfinite(iter.size);\n return ensureSize(iter);\n }\n\n function iterableClass(iterable) {\n return isKeyed(iterable) ? KeyedIterable :\n isIndexed(iterable) ? IndexedIterable :\n SetIterable;\n }\n\n function makeSequence(iterable) {\n return Object.create(\n (\n isKeyed(iterable) ? KeyedSeq :\n isIndexed(iterable) ? IndexedSeq :\n SetSeq\n ).prototype\n );\n }\n\n function cacheResultThrough() {\n if (this._iter.cacheResult) {\n this._iter.cacheResult();\n this.size = this._iter.size;\n return this;\n } else {\n return Seq.prototype.cacheResult.call(this);\n }\n }\n\n function defaultComparator(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n }\n\n function forceIterator(keyPath) {\n var iter = getIterator(keyPath);\n if (!iter) {\n // Array might not be iterable in this environment, so we need a fallback\n // to our wrapped type.\n if (!isArrayLike(keyPath)) {\n throw new TypeError('Expected iterable or array-like: ' + keyPath);\n }\n iter = getIterator(Iterable(keyPath));\n }\n return iter;\n }\n\n createClass(Record, KeyedCollection);\n\n function Record(defaultValues, name) {\n var hasInitialized;\n\n var RecordType = function Record(values) {\n if (values instanceof RecordType) {\n return values;\n }\n if (!(this instanceof RecordType)) {\n return new RecordType(values);\n }\n if (!hasInitialized) {\n hasInitialized = true;\n var keys = Object.keys(defaultValues);\n setProps(RecordTypePrototype, keys);\n RecordTypePrototype.size = keys.length;\n RecordTypePrototype._name = name;\n RecordTypePrototype._keys = keys;\n RecordTypePrototype._defaultValues = defaultValues;\n }\n this._map = Map(values);\n };\n\n var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);\n RecordTypePrototype.constructor = RecordType;\n\n return RecordType;\n }\n\n Record.prototype.toString = function() {\n return this.__toString(recordName(this) + ' {', '}');\n };\n\n // @pragma Access\n\n Record.prototype.has = function(k) {\n return this._defaultValues.hasOwnProperty(k);\n };\n\n Record.prototype.get = function(k, notSetValue) {\n if (!this.has(k)) {\n return notSetValue;\n }\n var defaultVal = this._defaultValues[k];\n return this._map ? this._map.get(k, defaultVal) : defaultVal;\n };\n\n // @pragma Modification\n\n Record.prototype.clear = function() {\n if (this.__ownerID) {\n this._map && this._map.clear();\n return this;\n }\n var RecordType = this.constructor;\n return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));\n };\n\n Record.prototype.set = function(k, v) {\n if (!this.has(k)) {\n throw new Error('Cannot set unknown key \"' + k + '\" on ' + recordName(this));\n }\n if (this._map && !this._map.has(k)) {\n var defaultVal = this._defaultValues[k];\n if (v === defaultVal) {\n return this;\n }\n }\n var newMap = this._map && this._map.set(k, v);\n if (this.__ownerID || newMap === this._map) {\n return this;\n }\n return makeRecord(this, newMap);\n };\n\n Record.prototype.remove = function(k) {\n if (!this.has(k)) {\n return this;\n }\n var newMap = this._map && this._map.remove(k);\n if (this.__ownerID || newMap === this._map) {\n return this;\n }\n return makeRecord(this, newMap);\n };\n\n Record.prototype.wasAltered = function() {\n return this._map.wasAltered();\n };\n\n Record.prototype.__iterator = function(type, reverse) {var this$0 = this;\n return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse);\n };\n\n Record.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse);\n };\n\n Record.prototype.__ensureOwner = function(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n var newMap = this._map && this._map.__ensureOwner(ownerID);\n if (!ownerID) {\n this.__ownerID = ownerID;\n this._map = newMap;\n return this;\n }\n return makeRecord(this, newMap, ownerID);\n };\n\n\n var RecordPrototype = Record.prototype;\n RecordPrototype[DELETE] = RecordPrototype.remove;\n RecordPrototype.deleteIn =\n RecordPrototype.removeIn = MapPrototype.removeIn;\n RecordPrototype.merge = MapPrototype.merge;\n RecordPrototype.mergeWith = MapPrototype.mergeWith;\n RecordPrototype.mergeIn = MapPrototype.mergeIn;\n RecordPrototype.mergeDeep = MapPrototype.mergeDeep;\n RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;\n RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n RecordPrototype.setIn = MapPrototype.setIn;\n RecordPrototype.update = MapPrototype.update;\n RecordPrototype.updateIn = MapPrototype.updateIn;\n RecordPrototype.withMutations = MapPrototype.withMutations;\n RecordPrototype.asMutable = MapPrototype.asMutable;\n RecordPrototype.asImmutable = MapPrototype.asImmutable;\n\n\n function makeRecord(likeRecord, map, ownerID) {\n var record = Object.create(Object.getPrototypeOf(likeRecord));\n record._map = map;\n record.__ownerID = ownerID;\n return record;\n }\n\n function recordName(record) {\n return record._name || record.constructor.name || 'Record';\n }\n\n function setProps(prototype, names) {\n try {\n names.forEach(setProp.bind(undefined, prototype));\n } catch (error) {\n // Object.defineProperty failed. Probably IE8.\n }\n }\n\n function setProp(prototype, name) {\n Object.defineProperty(prototype, name, {\n get: function() {\n return this.get(name);\n },\n set: function(value) {\n invariant(this.__ownerID, 'Cannot set on an immutable record.');\n this.set(name, value);\n }\n });\n }\n\n createClass(Set, SetCollection);\n\n // @pragma Construction\n\n function Set(value) {\n return value === null || value === undefined ? emptySet() :\n isSet(value) && !isOrdered(value) ? value :\n emptySet().withMutations(function(set ) {\n var iter = SetIterable(value);\n assertNotInfinite(iter.size);\n iter.forEach(function(v ) {return set.add(v)});\n });\n }\n\n Set.of = function(/*...values*/) {\n return this(arguments);\n };\n\n Set.fromKeys = function(value) {\n return this(KeyedIterable(value).keySeq());\n };\n\n Set.prototype.toString = function() {\n return this.__toString('Set {', '}');\n };\n\n // @pragma Access\n\n Set.prototype.has = function(value) {\n return this._map.has(value);\n };\n\n // @pragma Modification\n\n Set.prototype.add = function(value) {\n return updateSet(this, this._map.set(value, true));\n };\n\n Set.prototype.remove = function(value) {\n return updateSet(this, this._map.remove(value));\n };\n\n Set.prototype.clear = function() {\n return updateSet(this, this._map.clear());\n };\n\n // @pragma Composition\n\n Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0);\n iters = iters.filter(function(x ) {return x.size !== 0});\n if (iters.length === 0) {\n return this;\n }\n if (this.size === 0 && !this.__ownerID && iters.length === 1) {\n return this.constructor(iters[0]);\n }\n return this.withMutations(function(set ) {\n for (var ii = 0; ii < iters.length; ii++) {\n SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)});\n }\n });\n };\n\n Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0);\n if (iters.length === 0) {\n return this;\n }\n iters = iters.map(function(iter ) {return SetIterable(iter)});\n var originalSet = this;\n return this.withMutations(function(set ) {\n originalSet.forEach(function(value ) {\n if (!iters.every(function(iter ) {return iter.includes(value)})) {\n set.remove(value);\n }\n });\n });\n };\n\n Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0);\n if (iters.length === 0) {\n return this;\n }\n iters = iters.map(function(iter ) {return SetIterable(iter)});\n var originalSet = this;\n return this.withMutations(function(set ) {\n originalSet.forEach(function(value ) {\n if (iters.some(function(iter ) {return iter.includes(value)})) {\n set.remove(value);\n }\n });\n });\n };\n\n Set.prototype.merge = function() {\n return this.union.apply(this, arguments);\n };\n\n Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);\n return this.union.apply(this, iters);\n };\n\n Set.prototype.sort = function(comparator) {\n // Late binding\n return OrderedSet(sortFactory(this, comparator));\n };\n\n Set.prototype.sortBy = function(mapper, comparator) {\n // Late binding\n return OrderedSet(sortFactory(this, comparator, mapper));\n };\n\n Set.prototype.wasAltered = function() {\n return this._map.wasAltered();\n };\n\n Set.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse);\n };\n\n Set.prototype.__iterator = function(type, reverse) {\n return this._map.map(function(_, k) {return k}).__iterator(type, reverse);\n };\n\n Set.prototype.__ensureOwner = function(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n var newMap = this._map.__ensureOwner(ownerID);\n if (!ownerID) {\n this.__ownerID = ownerID;\n this._map = newMap;\n return this;\n }\n return this.__make(newMap, ownerID);\n };\n\n\n function isSet(maybeSet) {\n return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);\n }\n\n Set.isSet = isSet;\n\n var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';\n\n var SetPrototype = Set.prototype;\n SetPrototype[IS_SET_SENTINEL] = true;\n SetPrototype[DELETE] = SetPrototype.remove;\n SetPrototype.mergeDeep = SetPrototype.merge;\n SetPrototype.mergeDeepWith = SetPrototype.mergeWith;\n SetPrototype.withMutations = MapPrototype.withMutations;\n SetPrototype.asMutable = MapPrototype.asMutable;\n SetPrototype.asImmutable = MapPrototype.asImmutable;\n\n SetPrototype.__empty = emptySet;\n SetPrototype.__make = makeSet;\n\n function updateSet(set, newMap) {\n if (set.__ownerID) {\n set.size = newMap.size;\n set._map = newMap;\n return set;\n }\n return newMap === set._map ? set :\n newMap.size === 0 ? set.__empty() :\n set.__make(newMap);\n }\n\n function makeSet(map, ownerID) {\n var set = Object.create(SetPrototype);\n set.size = map ? map.size : 0;\n set._map = map;\n set.__ownerID = ownerID;\n return set;\n }\n\n var EMPTY_SET;\n function emptySet() {\n return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));\n }\n\n createClass(OrderedSet, Set);\n\n // @pragma Construction\n\n function OrderedSet(value) {\n return value === null || value === undefined ? emptyOrderedSet() :\n isOrderedSet(value) ? value :\n emptyOrderedSet().withMutations(function(set ) {\n var iter = SetIterable(value);\n assertNotInfinite(iter.size);\n iter.forEach(function(v ) {return set.add(v)});\n });\n }\n\n OrderedSet.of = function(/*...values*/) {\n return this(arguments);\n };\n\n OrderedSet.fromKeys = function(value) {\n return this(KeyedIterable(value).keySeq());\n };\n\n OrderedSet.prototype.toString = function() {\n return this.__toString('OrderedSet {', '}');\n };\n\n\n function isOrderedSet(maybeOrderedSet) {\n return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);\n }\n\n OrderedSet.isOrderedSet = isOrderedSet;\n\n var OrderedSetPrototype = OrderedSet.prototype;\n OrderedSetPrototype[IS_ORDERED_SENTINEL] = true;\n\n OrderedSetPrototype.__empty = emptyOrderedSet;\n OrderedSetPrototype.__make = makeOrderedSet;\n\n function makeOrderedSet(map, ownerID) {\n var set = Object.create(OrderedSetPrototype);\n set.size = map ? map.size : 0;\n set._map = map;\n set.__ownerID = ownerID;\n return set;\n }\n\n var EMPTY_ORDERED_SET;\n function emptyOrderedSet() {\n return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));\n }\n\n createClass(Stack, IndexedCollection);\n\n // @pragma Construction\n\n function Stack(value) {\n return value === null || value === undefined ? emptyStack() :\n isStack(value) ? value :\n emptyStack().unshiftAll(value);\n }\n\n Stack.of = function(/*...values*/) {\n return this(arguments);\n };\n\n Stack.prototype.toString = function() {\n return this.__toString('Stack [', ']');\n };\n\n // @pragma Access\n\n Stack.prototype.get = function(index, notSetValue) {\n var head = this._head;\n index = wrapIndex(this, index);\n while (head && index--) {\n head = head.next;\n }\n return head ? head.value : notSetValue;\n };\n\n Stack.prototype.peek = function() {\n return this._head && this._head.value;\n };\n\n // @pragma Modification\n\n Stack.prototype.push = function(/*...values*/) {\n if (arguments.length === 0) {\n return this;\n }\n var newSize = this.size + arguments.length;\n var head = this._head;\n for (var ii = arguments.length - 1; ii >= 0; ii--) {\n head = {\n value: arguments[ii],\n next: head\n };\n }\n if (this.__ownerID) {\n this.size = newSize;\n this._head = head;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n return makeStack(newSize, head);\n };\n\n Stack.prototype.pushAll = function(iter) {\n iter = IndexedIterable(iter);\n if (iter.size === 0) {\n return this;\n }\n assertNotInfinite(iter.size);\n var newSize = this.size;\n var head = this._head;\n iter.reverse().forEach(function(value ) {\n newSize++;\n head = {\n value: value,\n next: head\n };\n });\n if (this.__ownerID) {\n this.size = newSize;\n this._head = head;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n return makeStack(newSize, head);\n };\n\n Stack.prototype.pop = function() {\n return this.slice(1);\n };\n\n Stack.prototype.unshift = function(/*...values*/) {\n return this.push.apply(this, arguments);\n };\n\n Stack.prototype.unshiftAll = function(iter) {\n return this.pushAll(iter);\n };\n\n Stack.prototype.shift = function() {\n return this.pop.apply(this, arguments);\n };\n\n Stack.prototype.clear = function() {\n if (this.size === 0) {\n return this;\n }\n if (this.__ownerID) {\n this.size = 0;\n this._head = undefined;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n return emptyStack();\n };\n\n Stack.prototype.slice = function(begin, end) {\n if (wholeSlice(begin, end, this.size)) {\n return this;\n }\n var resolvedBegin = resolveBegin(begin, this.size);\n var resolvedEnd = resolveEnd(end, this.size);\n if (resolvedEnd !== this.size) {\n // super.slice(begin, end);\n return IndexedCollection.prototype.slice.call(this, begin, end);\n }\n var newSize = this.size - resolvedBegin;\n var head = this._head;\n while (resolvedBegin--) {\n head = head.next;\n }\n if (this.__ownerID) {\n this.size = newSize;\n this._head = head;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n return makeStack(newSize, head);\n };\n\n // @pragma Mutability\n\n Stack.prototype.__ensureOwner = function(ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n if (!ownerID) {\n this.__ownerID = ownerID;\n this.__altered = false;\n return this;\n }\n return makeStack(this.size, this._head, ownerID, this.__hash);\n };\n\n // @pragma Iteration\n\n Stack.prototype.__iterate = function(fn, reverse) {\n if (reverse) {\n return this.reverse().__iterate(fn);\n }\n var iterations = 0;\n var node = this._head;\n while (node) {\n if (fn(node.value, iterations++, this) === false) {\n break;\n }\n node = node.next;\n }\n return iterations;\n };\n\n Stack.prototype.__iterator = function(type, reverse) {\n if (reverse) {\n return this.reverse().__iterator(type);\n }\n var iterations = 0;\n var node = this._head;\n return new Iterator(function() {\n if (node) {\n var value = node.value;\n node = node.next;\n return iteratorValue(type, iterations++, value);\n }\n return iteratorDone();\n });\n };\n\n\n function isStack(maybeStack) {\n return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);\n }\n\n Stack.isStack = isStack;\n\n var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';\n\n var StackPrototype = Stack.prototype;\n StackPrototype[IS_STACK_SENTINEL] = true;\n StackPrototype.withMutations = MapPrototype.withMutations;\n StackPrototype.asMutable = MapPrototype.asMutable;\n StackPrototype.asImmutable = MapPrototype.asImmutable;\n StackPrototype.wasAltered = MapPrototype.wasAltered;\n\n\n function makeStack(size, head, ownerID, hash) {\n var map = Object.create(StackPrototype);\n map.size = size;\n map._head = head;\n map.__ownerID = ownerID;\n map.__hash = hash;\n map.__altered = false;\n return map;\n }\n\n var EMPTY_STACK;\n function emptyStack() {\n return EMPTY_STACK || (EMPTY_STACK = makeStack(0));\n }\n\n /**\n * Contributes additional methods to a constructor\n */\n function mixin(ctor, methods) {\n var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; };\n Object.keys(methods).forEach(keyCopier);\n Object.getOwnPropertySymbols &&\n Object.getOwnPropertySymbols(methods).forEach(keyCopier);\n return ctor;\n }\n\n Iterable.Iterator = Iterator;\n\n mixin(Iterable, {\n\n // ### Conversion to other types\n\n toArray: function() {\n assertNotInfinite(this.size);\n var array = new Array(this.size || 0);\n this.valueSeq().__iterate(function(v, i) { array[i] = v; });\n return array;\n },\n\n toIndexedSeq: function() {\n return new ToIndexedSequence(this);\n },\n\n toJS: function() {\n return this.toSeq().map(\n function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value}\n ).__toJS();\n },\n\n toJSON: function() {\n return this.toSeq().map(\n function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value}\n ).__toJS();\n },\n\n toKeyedSeq: function() {\n return new ToKeyedSequence(this, true);\n },\n\n toMap: function() {\n // Use Late Binding here to solve the circular dependency.\n return Map(this.toKeyedSeq());\n },\n\n toObject: function() {\n assertNotInfinite(this.size);\n var object = {};\n this.__iterate(function(v, k) { object[k] = v; });\n return object;\n },\n\n toOrderedMap: function() {\n // Use Late Binding here to solve the circular dependency.\n return OrderedMap(this.toKeyedSeq());\n },\n\n toOrderedSet: function() {\n // Use Late Binding here to solve the circular dependency.\n return OrderedSet(isKeyed(this) ? this.valueSeq() : this);\n },\n\n toSet: function() {\n // Use Late Binding here to solve the circular dependency.\n return Set(isKeyed(this) ? this.valueSeq() : this);\n },\n\n toSetSeq: function() {\n return new ToSetSequence(this);\n },\n\n toSeq: function() {\n return isIndexed(this) ? this.toIndexedSeq() :\n isKeyed(this) ? this.toKeyedSeq() :\n this.toSetSeq();\n },\n\n toStack: function() {\n // Use Late Binding here to solve the circular dependency.\n return Stack(isKeyed(this) ? this.valueSeq() : this);\n },\n\n toList: function() {\n // Use Late Binding here to solve the circular dependency.\n return List(isKeyed(this) ? this.valueSeq() : this);\n },\n\n\n // ### Common JavaScript methods and properties\n\n toString: function() {\n return '[Iterable]';\n },\n\n __toString: function(head, tail) {\n if (this.size === 0) {\n return head + tail;\n }\n return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;\n },\n\n\n // ### ES6 Collection methods (ES6 Array and Map)\n\n concat: function() {var values = SLICE$0.call(arguments, 0);\n return reify(this, concatFactory(this, values));\n },\n\n includes: function(searchValue) {\n return this.some(function(value ) {return is(value, searchValue)});\n },\n\n entries: function() {\n return this.__iterator(ITERATE_ENTRIES);\n },\n\n every: function(predicate, context) {\n assertNotInfinite(this.size);\n var returnValue = true;\n this.__iterate(function(v, k, c) {\n if (!predicate.call(context, v, k, c)) {\n returnValue = false;\n return false;\n }\n });\n return returnValue;\n },\n\n filter: function(predicate, context) {\n return reify(this, filterFactory(this, predicate, context, true));\n },\n\n find: function(predicate, context, notSetValue) {\n var entry = this.findEntry(predicate, context);\n return entry ? entry[1] : notSetValue;\n },\n\n forEach: function(sideEffect, context) {\n assertNotInfinite(this.size);\n return this.__iterate(context ? sideEffect.bind(context) : sideEffect);\n },\n\n join: function(separator) {\n assertNotInfinite(this.size);\n separator = separator !== undefined ? '' + separator : ',';\n var joined = '';\n var isFirst = true;\n this.__iterate(function(v ) {\n isFirst ? (isFirst = false) : (joined += separator);\n joined += v !== null && v !== undefined ? v.toString() : '';\n });\n return joined;\n },\n\n keys: function() {\n return this.__iterator(ITERATE_KEYS);\n },\n\n map: function(mapper, context) {\n return reify(this, mapFactory(this, mapper, context));\n },\n\n reduce: function(reducer, initialReduction, context) {\n assertNotInfinite(this.size);\n var reduction;\n var useFirst;\n if (arguments.length < 2) {\n useFirst = true;\n } else {\n reduction = initialReduction;\n }\n this.__iterate(function(v, k, c) {\n if (useFirst) {\n useFirst = false;\n reduction = v;\n } else {\n reduction = reducer.call(context, reduction, v, k, c);\n }\n });\n return reduction;\n },\n\n reduceRight: function(reducer, initialReduction, context) {\n var reversed = this.toKeyedSeq().reverse();\n return reversed.reduce.apply(reversed, arguments);\n },\n\n reverse: function() {\n return reify(this, reverseFactory(this, true));\n },\n\n slice: function(begin, end) {\n return reify(this, sliceFactory(this, begin, end, true));\n },\n\n some: function(predicate, context) {\n return !this.every(not(predicate), context);\n },\n\n sort: function(comparator) {\n return reify(this, sortFactory(this, comparator));\n },\n\n values: function() {\n return this.__iterator(ITERATE_VALUES);\n },\n\n\n // ### More sequential methods\n\n butLast: function() {\n return this.slice(0, -1);\n },\n\n isEmpty: function() {\n return this.size !== undefined ? this.size === 0 : !this.some(function() {return true});\n },\n\n count: function(predicate, context) {\n return ensureSize(\n predicate ? this.toSeq().filter(predicate, context) : this\n );\n },\n\n countBy: function(grouper, context) {\n return countByFactory(this, grouper, context);\n },\n\n equals: function(other) {\n return deepEqual(this, other);\n },\n\n entrySeq: function() {\n var iterable = this;\n if (iterable._cache) {\n // We cache as an entries array, so we can just return the cache!\n return new ArraySeq(iterable._cache);\n }\n var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();\n entriesSequence.fromEntrySeq = function() {return iterable.toSeq()};\n return entriesSequence;\n },\n\n filterNot: function(predicate, context) {\n return this.filter(not(predicate), context);\n },\n\n findEntry: function(predicate, context, notSetValue) {\n var found = notSetValue;\n this.__iterate(function(v, k, c) {\n if (predicate.call(context, v, k, c)) {\n found = [k, v];\n return false;\n }\n });\n return found;\n },\n\n findKey: function(predicate, context) {\n var entry = this.findEntry(predicate, context);\n return entry && entry[0];\n },\n\n findLast: function(predicate, context, notSetValue) {\n return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);\n },\n\n findLastEntry: function(predicate, context, notSetValue) {\n return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue);\n },\n\n findLastKey: function(predicate, context) {\n return this.toKeyedSeq().reverse().findKey(predicate, context);\n },\n\n first: function() {\n return this.find(returnTrue);\n },\n\n flatMap: function(mapper, context) {\n return reify(this, flatMapFactory(this, mapper, context));\n },\n\n flatten: function(depth) {\n return reify(this, flattenFactory(this, depth, true));\n },\n\n fromEntrySeq: function() {\n return new FromEntriesSequence(this);\n },\n\n get: function(searchKey, notSetValue) {\n return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue);\n },\n\n getIn: function(searchKeyPath, notSetValue) {\n var nested = this;\n // Note: in an ES6 environment, we would prefer:\n // for (var key of searchKeyPath) {\n var iter = forceIterator(searchKeyPath);\n var step;\n while (!(step = iter.next()).done) {\n var key = step.value;\n nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;\n if (nested === NOT_SET) {\n return notSetValue;\n }\n }\n return nested;\n },\n\n groupBy: function(grouper, context) {\n return groupByFactory(this, grouper, context);\n },\n\n has: function(searchKey) {\n return this.get(searchKey, NOT_SET) !== NOT_SET;\n },\n\n hasIn: function(searchKeyPath) {\n return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;\n },\n\n isSubset: function(iter) {\n iter = typeof iter.includes === 'function' ? iter : Iterable(iter);\n return this.every(function(value ) {return iter.includes(value)});\n },\n\n isSuperset: function(iter) {\n iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter);\n return iter.isSubset(this);\n },\n\n keyOf: function(searchValue) {\n return this.findKey(function(value ) {return is(value, searchValue)});\n },\n\n keySeq: function() {\n return this.toSeq().map(keyMapper).toIndexedSeq();\n },\n\n last: function() {\n return this.toSeq().reverse().first();\n },\n\n lastKeyOf: function(searchValue) {\n return this.toKeyedSeq().reverse().keyOf(searchValue);\n },\n\n max: function(comparator) {\n return maxFactory(this, comparator);\n },\n\n maxBy: function(mapper, comparator) {\n return maxFactory(this, comparator, mapper);\n },\n\n min: function(comparator) {\n return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);\n },\n\n minBy: function(mapper, comparator) {\n return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);\n },\n\n rest: function() {\n return this.slice(1);\n },\n\n skip: function(amount) {\n return this.slice(Math.max(0, amount));\n },\n\n skipLast: function(amount) {\n return reify(this, this.toSeq().reverse().skip(amount).reverse());\n },\n\n skipWhile: function(predicate, context) {\n return reify(this, skipWhileFactory(this, predicate, context, true));\n },\n\n skipUntil: function(predicate, context) {\n return this.skipWhile(not(predicate), context);\n },\n\n sortBy: function(mapper, comparator) {\n return reify(this, sortFactory(this, comparator, mapper));\n },\n\n take: function(amount) {\n return this.slice(0, Math.max(0, amount));\n },\n\n takeLast: function(amount) {\n return reify(this, this.toSeq().reverse().take(amount).reverse());\n },\n\n takeWhile: function(predicate, context) {\n return reify(this, takeWhileFactory(this, predicate, context));\n },\n\n takeUntil: function(predicate, context) {\n return this.takeWhile(not(predicate), context);\n },\n\n valueSeq: function() {\n return this.toIndexedSeq();\n },\n\n\n // ### Hashable Object\n\n hashCode: function() {\n return this.__hash || (this.__hash = hashIterable(this));\n }\n\n\n // ### Internal\n\n // abstract __iterate(fn, reverse)\n\n // abstract __iterator(type, reverse)\n });\n\n // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';\n\n var IterablePrototype = Iterable.prototype;\n IterablePrototype[IS_ITERABLE_SENTINEL] = true;\n IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;\n IterablePrototype.__toJS = IterablePrototype.toArray;\n IterablePrototype.__toStringMapper = quoteString;\n IterablePrototype.inspect =\n IterablePrototype.toSource = function() { return this.toString(); };\n IterablePrototype.chain = IterablePrototype.flatMap;\n IterablePrototype.contains = IterablePrototype.includes;\n\n mixin(KeyedIterable, {\n\n // ### More sequential methods\n\n flip: function() {\n return reify(this, flipFactory(this));\n },\n\n mapEntries: function(mapper, context) {var this$0 = this;\n var iterations = 0;\n return reify(this,\n this.toSeq().map(\n function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)}\n ).fromEntrySeq()\n );\n },\n\n mapKeys: function(mapper, context) {var this$0 = this;\n return reify(this,\n this.toSeq().flip().map(\n function(k, v) {return mapper.call(context, k, v, this$0)}\n ).flip()\n );\n }\n\n });\n\n var KeyedIterablePrototype = KeyedIterable.prototype;\n KeyedIterablePrototype[IS_KEYED_SENTINEL] = true;\n KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;\n KeyedIterablePrototype.__toJS = IterablePrototype.toObject;\n KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)};\n\n\n\n mixin(IndexedIterable, {\n\n // ### Conversion to other types\n\n toKeyedSeq: function() {\n return new ToKeyedSequence(this, false);\n },\n\n\n // ### ES6 Collection methods (ES6 Array and Map)\n\n filter: function(predicate, context) {\n return reify(this, filterFactory(this, predicate, context, false));\n },\n\n findIndex: function(predicate, context) {\n var entry = this.findEntry(predicate, context);\n return entry ? entry[0] : -1;\n },\n\n indexOf: function(searchValue) {\n var key = this.keyOf(searchValue);\n return key === undefined ? -1 : key;\n },\n\n lastIndexOf: function(searchValue) {\n var key = this.lastKeyOf(searchValue);\n return key === undefined ? -1 : key;\n },\n\n reverse: function() {\n return reify(this, reverseFactory(this, false));\n },\n\n slice: function(begin, end) {\n return reify(this, sliceFactory(this, begin, end, false));\n },\n\n splice: function(index, removeNum /*, ...values*/) {\n var numArgs = arguments.length;\n removeNum = Math.max(removeNum | 0, 0);\n if (numArgs === 0 || (numArgs === 2 && !removeNum)) {\n return this;\n }\n // If index is negative, it should resolve relative to the size of the\n // collection. However size may be expensive to compute if not cached, so\n // only call count() if the number is in fact negative.\n index = resolveBegin(index, index < 0 ? this.count() : this.size);\n var spliced = this.slice(0, index);\n return reify(\n this,\n numArgs === 1 ?\n spliced :\n spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))\n );\n },\n\n\n // ### More collection methods\n\n findLastIndex: function(predicate, context) {\n var entry = this.findLastEntry(predicate, context);\n return entry ? entry[0] : -1;\n },\n\n first: function() {\n return this.get(0);\n },\n\n flatten: function(depth) {\n return reify(this, flattenFactory(this, depth, false));\n },\n\n get: function(index, notSetValue) {\n index = wrapIndex(this, index);\n return (index < 0 || (this.size === Infinity ||\n (this.size !== undefined && index > this.size))) ?\n notSetValue :\n this.find(function(_, key) {return key === index}, undefined, notSetValue);\n },\n\n has: function(index) {\n index = wrapIndex(this, index);\n return index >= 0 && (this.size !== undefined ?\n this.size === Infinity || index < this.size :\n this.indexOf(index) !== -1\n );\n },\n\n interpose: function(separator) {\n return reify(this, interposeFactory(this, separator));\n },\n\n interleave: function(/*...iterables*/) {\n var iterables = [this].concat(arrCopy(arguments));\n var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables);\n var interleaved = zipped.flatten(true);\n if (zipped.size) {\n interleaved.size = zipped.size * iterables.length;\n }\n return reify(this, interleaved);\n },\n\n keySeq: function() {\n return Range(0, this.size);\n },\n\n last: function() {\n return this.get(-1);\n },\n\n skipWhile: function(predicate, context) {\n return reify(this, skipWhileFactory(this, predicate, context, false));\n },\n\n zip: function(/*, ...iterables */) {\n var iterables = [this].concat(arrCopy(arguments));\n return reify(this, zipWithFactory(this, defaultZipper, iterables));\n },\n\n zipWith: function(zipper/*, ...iterables */) {\n var iterables = arrCopy(arguments);\n iterables[0] = this;\n return reify(this, zipWithFactory(this, zipper, iterables));\n }\n\n });\n\n IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;\n IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;\n\n\n\n mixin(SetIterable, {\n\n // ### ES6 Collection methods (ES6 Array and Map)\n\n get: function(value, notSetValue) {\n return this.has(value) ? value : notSetValue;\n },\n\n includes: function(value) {\n return this.has(value);\n },\n\n\n // ### More sequential methods\n\n keySeq: function() {\n return this.valueSeq();\n }\n\n });\n\n SetIterable.prototype.has = IterablePrototype.includes;\n SetIterable.prototype.contains = SetIterable.prototype.includes;\n\n\n // Mixin subclasses\n\n mixin(KeyedSeq, KeyedIterable.prototype);\n mixin(IndexedSeq, IndexedIterable.prototype);\n mixin(SetSeq, SetIterable.prototype);\n\n mixin(KeyedCollection, KeyedIterable.prototype);\n mixin(IndexedCollection, IndexedIterable.prototype);\n mixin(SetCollection, SetIterable.prototype);\n\n\n // #pragma Helper functions\n\n function keyMapper(v, k) {\n return k;\n }\n\n function entryMapper(v, k) {\n return [k, v];\n }\n\n function not(predicate) {\n return function() {\n return !predicate.apply(this, arguments);\n }\n }\n\n function neg(predicate) {\n return function() {\n return -predicate.apply(this, arguments);\n }\n }\n\n function quoteString(value) {\n return typeof value === 'string' ? JSON.stringify(value) : String(value);\n }\n\n function defaultZipper() {\n return arrCopy(arguments);\n }\n\n function defaultNegComparator(a, b) {\n return a < b ? 1 : a > b ? -1 : 0;\n }\n\n function hashIterable(iterable) {\n if (iterable.size === Infinity) {\n return 0;\n }\n var ordered = isOrdered(iterable);\n var keyed = isKeyed(iterable);\n var h = ordered ? 1 : 0;\n var size = iterable.__iterate(\n keyed ?\n ordered ?\n function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } :\n function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } :\n ordered ?\n function(v ) { h = 31 * h + hash(v) | 0; } :\n function(v ) { h = h + hash(v) | 0; }\n );\n return murmurHashOfSize(size, h);\n }\n\n function murmurHashOfSize(size, h) {\n h = imul(h, 0xCC9E2D51);\n h = imul(h << 15 | h >>> -15, 0x1B873593);\n h = imul(h << 13 | h >>> -13, 5);\n h = (h + 0xE6546B64 | 0) ^ size;\n h = imul(h ^ h >>> 16, 0x85EBCA6B);\n h = imul(h ^ h >>> 13, 0xC2B2AE35);\n h = smi(h ^ h >>> 16);\n return h;\n }\n\n function hashMerge(a, b) {\n return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int\n }\n\n var Immutable = {\n\n Iterable: Iterable,\n\n Seq: Seq,\n Collection: Collection,\n Map: Map,\n OrderedMap: OrderedMap,\n List: List,\n Stack: Stack,\n Set: Set,\n OrderedSet: OrderedSet,\n\n Record: Record,\n Range: Range,\n Repeat: Repeat,\n\n is: is,\n fromJS: fromJS\n\n };\n\n return Immutable;\n\n}));\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/immutable/dist/immutable.js\n ** module id = 7\n ** module chunks = 0\n **/","import { Stream } from 'xstream';\nimport { ISinks } from './definitions';\nimport { div, h1, section, ul, li, h3, h6, button, VNode } from '@cycle/dom';\nimport { IApplicationState } from './definitions';\nimport { IJedi } from './drivers/jedis';\n\nfunction renderJediSlot(jedi: IJedi, state: IApplicationState): VNode {\n const matched = state.matchedId == (jedi && jedi.id);\n const props = { style: { color: matched ? 'red' : null } };\n return li('.css-slot', props,\n jedi\n ? [\n h3([jedi.name]),\n h6(['Homeworld: ' + jedi.homeworld.name])\n ]\n : []\n );\n}\n\nfunction disableIfNotAllowed(allowed: boolean): string {\n return (allowed ? '' : '.css-button-disabled')\n}\n\nfunction view(state$: Stream): Stream {\n const vNode$ =\n state$\n .map(state => {\n const down = state.down;\n const up = state.up;\n const planetName = (state.planet && state.planet.name) || '';\n const matched = state.matchedId !== -1;\n return div('.css-root', [\n h1('.css-planet-monitor', 'Obi-Wan currently on ' + planetName),\n section('.css-scrollable-list', [\n ul('.css-slots', state.jedis.map(jedi => renderJediSlot(jedi, state))),\n div('.css-scroll-buttons', [\n button('.css-button-up' + disableIfNotAllowed(up && !matched)),\n button('.css-button-down' + disableIfNotAllowed(down && !matched))\n ])\n ])\n ]);\n });\n return vNode$;\n}\n\nexport default view;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/view.ts\n **/","\"use strict\";\nvar thunk = require('snabbdom/thunk');\nexports.thunk = thunk;\n/**\n * A factory for the DOM driver function.\n *\n * Takes a `container` to define the target on the existing DOM which this\n * driver will operate on, and an `options` object as the second argument. The\n * input to this driver is a stream of virtual DOM objects, or in other words,\n * Snabbdom \"VNode\" objects. The output of this driver is a \"DOMSource\": a\n * collection of Observables queried with the methods `select()` and `events()`.\n *\n * `DOMSource.select(selector)` returns a new DOMSource with scope restricted to\n * the element(s) that matches the CSS `selector` given.\n *\n * `DOMSource.events(eventType, options)` returns a stream of events of\n * `eventType` happening on the elements that match the current DOMSource. The\n * returned stream is an *xstream* Stream if you use `@cycle/xstream-run` to run\n * your app with this driver, or it is an RxJS Observable if you use\n * `@cycle/rxjs-run`, and so forth. The `options` parameter can have the field\n * `useCapture`, which is by default `false`, except it is `true` for event\n * types that do not bubble. Read more here\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n * about the `useCapture` and its purpose.\n *\n * `DOMSource.elements()` returns a stream of the DOM element(s) matched by the\n * selectors in the DOMSource. Also, `DOMSource.select(':root').elements()`\n * returns a stream of DOM element corresponding to the root (or container) of\n * the app on the DOM.\n *\n * @param {(String|HTMLElement)} container the DOM selector for the element\n * (or the element itself) to contain the rendering of the VTrees.\n * @param {DOMDriverOptions} options an object with two optional fields:\n * `transposition: boolean` enables/disables transposition of inner streams in\n * the virtual DOM tree, `modules: array` contains additional Snabbdom modules.\n * @return {Function} the DOM driver function. The function expects a stream of\n * of VNode as input, and outputs the DOMSource object.\n * @function makeDOMDriver\n */\nvar makeDOMDriver_1 = require('./makeDOMDriver');\nexports.makeDOMDriver = makeDOMDriver_1.makeDOMDriver;\n/**\n * A factory for the HTML driver function.\n *\n * Takes an `effect` callback function and an `options` object as arguments. The\n * input to this driver is a stream of virtual DOM objects, or in other words,\n * Snabbdom \"VNode\" objects. The output of this driver is a \"DOMSource\": a\n * collection of Observables queried with the methods `select()` and `events()`.\n *\n * The HTML Driver is supplementary to the DOM Driver. Instead of producing\n * elements on the DOM, it generates HTML as strings and does a side effect on\n * those HTML strings. That side effect is described by the `effect` callback\n * function. So, if you want to use the HTML Driver on the server-side to render\n * your application as HTML and send as a response (which is the typical use\n * case for the HTML Driver), you need to pass something like the\n * `html => response.send(html)` function as the `effect` argument. This way,\n * the driver knows what side effect to cause based on the HTML string it just\n * rendered.\n *\n * The HTML driver is useful only for that side effect in the `effect` callback.\n * It can be considered a sink-only driver. However, in order to serve as a\n * transparent replacement to the DOM Driver when rendering from the server, the\n * HTML driver returns a source object that behaves just like the DOMSource.\n * This helps reuse the same application that is written for the DOM Driver.\n * This fake DOMSource returns empty streams when you query it, because there\n * are no user events on the server.\n *\n * `DOMSource.select(selector)` returns a new DOMSource with scope restricted to\n * the element(s) that matches the CSS `selector` given.\n *\n * `DOMSource.events(eventType, options)` returns an empty stream. The returned\n * stream is an *xstream* Stream if you use `@cycle/xstream-run` to run your app\n * with this driver, or it is an RxJS Observable if you use `@cycle/rxjs-run`,\n * and so forth.\n *\n * `DOMSource.elements()` returns the stream of HTML string rendered from your\n * sink virtual DOM stream.\n *\n * @param {Function} effect a callback function that takes a string of rendered\n * HTML as input and should run a side effect, returning nothing.\n * @param {HTMLDriverOptions} options an object with one optional field:\n * `transposition: boolean` enables/disables transposition of inner streams in\n * the virtual DOM tree.\n * @return {Function} the HTML driver function. The function expects a stream of\n * of VNode as input, and outputs the DOMSource object.\n * @function makeHTMLDriver\n */\nvar makeHTMLDriver_1 = require('./makeHTMLDriver');\nexports.makeHTMLDriver = makeHTMLDriver_1.makeHTMLDriver;\n/**\n * A factory function to create mocked DOMSource objects, for testing purposes.\n *\n * Takes a `streamAdapter` and a `mockConfig` object as arguments, and returns\n * a DOMSource that can be given to any Cycle.js app that expects a DOMSource in\n * the sources, for testing.\n *\n * The `streamAdapter` parameter is a package such as `@cycle/xstream-adapter`,\n * `@cycle/rxjs-adapter`, etc. Import it as `import a from '@cycle/rx-adapter`,\n * then provide it to `mockDOMSource. This is important so the DOMSource created\n * knows which stream library should it use to export its streams when you call\n * `DOMSource.events()` for instance.\n *\n * The `mockConfig` parameter is an object specifying selectors, eventTypes and\n * their streams. Example:\n *\n * ```js\n * const domSource = mockDOMSource(RxAdapter, {\n * '.foo': {\n * 'click': Rx.Observable.of({target: {}}),\n * 'mouseover': Rx.Observable.of({target: {}}),\n * },\n * '.bar': {\n * 'scroll': Rx.Observable.of({target: {}}),\n * elements: Rx.Observable.of({tagName: 'div'}),\n * }\n * });\n *\n * // Usage\n * const click$ = domSource.select('.foo').events('click');\n * const element$ = domSource.select('.bar').elements();\n * ```\n *\n * @param {Object} mockConfig an object where keys are selector strings\n * and values are objects. Those nested objects have `eventType` strings as keys\n * and values are streams you created.\n * @return {Object} fake DOM source object, with an API containing `select()`\n * and `events()` and `elements()` which can be used just like the DOM Driver's\n * DOMSource.\n *\n * @function mockDOMSource\n */\nvar mockDOMSource_1 = require('./mockDOMSource');\nexports.mockDOMSource = mockDOMSource_1.mockDOMSource;\n/**\n * The hyperscript function `h()` is a function to create virtual DOM objects,\n * also known as VNodes. Call\n *\n * ```js\n * h('div.myClass', {style: {color: 'red'}}, [])\n * ```\n *\n * to create a VNode that represents a `DIV` element with className `myClass`,\n * styled with red color, and no children because the `[]` array was passed. The\n * API is `h(tagOrSelector, optionalData, optionalChildrenOrText)`.\n *\n * However, usually you should use \"hyperscript helpers\", which are shortcut\n * functions based on hyperscript. There is one hyperscript helper function for\n * each DOM tagName, such as `h1()`, `h2()`, `div()`, `span()`, `label()`,\n * `input()`. For instance, the previous example could have been written\n * as:\n *\n * ```js\n * div('.myClass', {style: {color: 'red'}}, [])\n * ```\n *\n * There are also SVG helper functions, which apply the appropriate SVG\n * namespace to the resulting elements. `svg()` function creates the top-most\n * SVG element, and `svg.g`, `svg.polygon`, `svg.circle`, `svg.path` are for\n * SVG-specific child elements. Example:\n *\n * ```js\n * svg({width: 150, height: 150}, [\n * svg.polygon({\n * attrs: {\n * class: 'triangle',\n * points: '20 0 20 150 150 20'\n * }\n * })\n * ])\n * ```\n *\n * @function h\n */\nvar hyperscript_1 = require('./hyperscript');\nexports.h = hyperscript_1.h;\nvar hyperscript_helpers_1 = require('./hyperscript-helpers');\nexports.svg = hyperscript_helpers_1.default.svg;\nexports.a = hyperscript_helpers_1.default.a;\nexports.abbr = hyperscript_helpers_1.default.abbr;\nexports.address = hyperscript_helpers_1.default.address;\nexports.area = hyperscript_helpers_1.default.area;\nexports.article = hyperscript_helpers_1.default.article;\nexports.aside = hyperscript_helpers_1.default.aside;\nexports.audio = hyperscript_helpers_1.default.audio;\nexports.b = hyperscript_helpers_1.default.b;\nexports.base = hyperscript_helpers_1.default.base;\nexports.bdi = hyperscript_helpers_1.default.bdi;\nexports.bdo = hyperscript_helpers_1.default.bdo;\nexports.blockquote = hyperscript_helpers_1.default.blockquote;\nexports.body = hyperscript_helpers_1.default.body;\nexports.br = hyperscript_helpers_1.default.br;\nexports.button = hyperscript_helpers_1.default.button;\nexports.canvas = hyperscript_helpers_1.default.canvas;\nexports.caption = hyperscript_helpers_1.default.caption;\nexports.cite = hyperscript_helpers_1.default.cite;\nexports.code = hyperscript_helpers_1.default.code;\nexports.col = hyperscript_helpers_1.default.col;\nexports.colgroup = hyperscript_helpers_1.default.colgroup;\nexports.dd = hyperscript_helpers_1.default.dd;\nexports.del = hyperscript_helpers_1.default.del;\nexports.dfn = hyperscript_helpers_1.default.dfn;\nexports.dir = hyperscript_helpers_1.default.dir;\nexports.div = hyperscript_helpers_1.default.div;\nexports.dl = hyperscript_helpers_1.default.dl;\nexports.dt = hyperscript_helpers_1.default.dt;\nexports.em = hyperscript_helpers_1.default.em;\nexports.embed = hyperscript_helpers_1.default.embed;\nexports.fieldset = hyperscript_helpers_1.default.fieldset;\nexports.figcaption = hyperscript_helpers_1.default.figcaption;\nexports.figure = hyperscript_helpers_1.default.figure;\nexports.footer = hyperscript_helpers_1.default.footer;\nexports.form = hyperscript_helpers_1.default.form;\nexports.h1 = hyperscript_helpers_1.default.h1;\nexports.h2 = hyperscript_helpers_1.default.h2;\nexports.h3 = hyperscript_helpers_1.default.h3;\nexports.h4 = hyperscript_helpers_1.default.h4;\nexports.h5 = hyperscript_helpers_1.default.h5;\nexports.h6 = hyperscript_helpers_1.default.h6;\nexports.head = hyperscript_helpers_1.default.head;\nexports.header = hyperscript_helpers_1.default.header;\nexports.hgroup = hyperscript_helpers_1.default.hgroup;\nexports.hr = hyperscript_helpers_1.default.hr;\nexports.html = hyperscript_helpers_1.default.html;\nexports.i = hyperscript_helpers_1.default.i;\nexports.iframe = hyperscript_helpers_1.default.iframe;\nexports.img = hyperscript_helpers_1.default.img;\nexports.input = hyperscript_helpers_1.default.input;\nexports.ins = hyperscript_helpers_1.default.ins;\nexports.kbd = hyperscript_helpers_1.default.kbd;\nexports.keygen = hyperscript_helpers_1.default.keygen;\nexports.label = hyperscript_helpers_1.default.label;\nexports.legend = hyperscript_helpers_1.default.legend;\nexports.li = hyperscript_helpers_1.default.li;\nexports.link = hyperscript_helpers_1.default.link;\nexports.main = hyperscript_helpers_1.default.main;\nexports.map = hyperscript_helpers_1.default.map;\nexports.mark = hyperscript_helpers_1.default.mark;\nexports.menu = hyperscript_helpers_1.default.menu;\nexports.meta = hyperscript_helpers_1.default.meta;\nexports.nav = hyperscript_helpers_1.default.nav;\nexports.noscript = hyperscript_helpers_1.default.noscript;\nexports.object = hyperscript_helpers_1.default.object;\nexports.ol = hyperscript_helpers_1.default.ol;\nexports.optgroup = hyperscript_helpers_1.default.optgroup;\nexports.option = hyperscript_helpers_1.default.option;\nexports.p = hyperscript_helpers_1.default.p;\nexports.param = hyperscript_helpers_1.default.param;\nexports.pre = hyperscript_helpers_1.default.pre;\nexports.progress = hyperscript_helpers_1.default.progress;\nexports.q = hyperscript_helpers_1.default.q;\nexports.rp = hyperscript_helpers_1.default.rp;\nexports.rt = hyperscript_helpers_1.default.rt;\nexports.ruby = hyperscript_helpers_1.default.ruby;\nexports.s = hyperscript_helpers_1.default.s;\nexports.samp = hyperscript_helpers_1.default.samp;\nexports.script = hyperscript_helpers_1.default.script;\nexports.section = hyperscript_helpers_1.default.section;\nexports.select = hyperscript_helpers_1.default.select;\nexports.small = hyperscript_helpers_1.default.small;\nexports.source = hyperscript_helpers_1.default.source;\nexports.span = hyperscript_helpers_1.default.span;\nexports.strong = hyperscript_helpers_1.default.strong;\nexports.style = hyperscript_helpers_1.default.style;\nexports.sub = hyperscript_helpers_1.default.sub;\nexports.sup = hyperscript_helpers_1.default.sup;\nexports.table = hyperscript_helpers_1.default.table;\nexports.tbody = hyperscript_helpers_1.default.tbody;\nexports.td = hyperscript_helpers_1.default.td;\nexports.textarea = hyperscript_helpers_1.default.textarea;\nexports.tfoot = hyperscript_helpers_1.default.tfoot;\nexports.th = hyperscript_helpers_1.default.th;\nexports.thead = hyperscript_helpers_1.default.thead;\nexports.title = hyperscript_helpers_1.default.title;\nexports.tr = hyperscript_helpers_1.default.tr;\nexports.u = hyperscript_helpers_1.default.u;\nexports.ul = hyperscript_helpers_1.default.ul;\nexports.video = hyperscript_helpers_1.default.video;\n//# sourceMappingURL=index.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/index.js\n ** module id = 9\n ** module chunks = 0\n **/","var h = require('./h');\n\nfunction init(thunk) {\n var i, cur = thunk.data;\n cur.vnode = cur.fn.apply(undefined, cur.args);\n}\n\nfunction prepatch(oldThunk, thunk) {\n var i, old = oldThunk.data, cur = thunk.data;\n var oldArgs = old.args, args = cur.args;\n cur.vnode = old.vnode;\n if (old.fn !== cur.fn || oldArgs.length !== args.length) {\n cur.vnode = cur.fn.apply(undefined, args);\n return;\n }\n for (i = 0; i < args.length; ++i) {\n if (oldArgs[i] !== args[i]) {\n cur.vnode = cur.fn.apply(undefined, args);\n return;\n }\n }\n}\n\nmodule.exports = function(name, fn /* args */) {\n var i, args = [];\n for (i = 2; i < arguments.length; ++i) {\n args[i - 2] = arguments[i];\n }\n return h('thunk' + name, {\n hook: {init: init, prepatch: prepatch},\n fn: fn, args: args,\n });\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/thunk.js\n ** module id = 10\n ** module chunks = 0\n **/","var VNode = require('./vnode');\nvar is = require('./is');\n\nfunction addNS(data, children) {\n data.ns = 'http://www.w3.org/2000/svg';\n if (children !== undefined) {\n for (var i = 0; i < children.length; ++i) {\n addNS(children[i].data, children[i].children);\n }\n }\n}\n\nmodule.exports = function h(sel, b, c) {\n var data = {}, children, text, i;\n if (arguments.length === 3) {\n data = b;\n if (is.array(c)) { children = c; }\n else if (is.primitive(c)) { text = c; }\n } else if (arguments.length === 2) {\n if (is.array(b)) { children = b; }\n else if (is.primitive(b)) { text = b; }\n else { data = b; }\n }\n if (is.array(children)) {\n for (i = 0; i < children.length; ++i) {\n if (is.primitive(children[i])) children[i] = VNode(undefined, undefined, undefined, children[i]);\n }\n }\n if (sel[0] === 's' && sel[1] === 'v' && sel[2] === 'g') {\n addNS(data, children);\n }\n return VNode(sel, data, children, text, undefined);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/h.js\n ** module id = 11\n ** module chunks = 0\n **/","module.exports = function(sel, data, children, text, elm) {\n var key = data === undefined ? undefined : data.key;\n return {sel: sel, data: data, children: children,\n text: text, elm: elm, key: key};\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/vnode.js\n ** module id = 12\n ** module chunks = 0\n **/","module.exports = {\n array: Array.isArray,\n primitive: function(s) { return typeof s === 'string' || typeof s === 'number'; },\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/is.js\n ** module id = 13\n ** module chunks = 0\n **/","\"use strict\";\nvar snabbdom_1 = require('snabbdom');\nvar xstream_1 = require('xstream');\nvar MainDOMSource_1 = require('./MainDOMSource');\nvar VNodeWrapper_1 = require('./VNodeWrapper');\nvar utils_1 = require('./utils');\nvar modules_1 = require('./modules');\nvar isolateModule_1 = require('./isolateModule');\nvar transposition_1 = require('./transposition');\nvar xstream_adapter_1 = require('@cycle/xstream-adapter');\nvar MapPolyfill = require('es6-map');\nfunction makeDOMDriverInputGuard(modules) {\n if (!Array.isArray(modules)) {\n throw new Error(\"Optional modules option must be \" +\n \"an array for snabbdom modules\");\n }\n}\nfunction domDriverInputGuard(view$) {\n if (!view$\n || typeof view$.addListener !== \"function\"\n || typeof view$.fold !== \"function\") {\n throw new Error(\"The DOM driver function expects as input a Stream of \" +\n \"virtual DOM elements\");\n }\n}\nfunction makeDOMDriver(container, options) {\n if (!options) {\n options = {};\n }\n var transposition = options.transposition || false;\n var modules = options.modules || modules_1.default;\n var isolateModule = new isolateModule_1.IsolateModule((new MapPolyfill()));\n var patch = snabbdom_1.init([isolateModule.createModule()].concat(modules));\n var rootElement = utils_1.getElement(container);\n var vnodeWrapper = new VNodeWrapper_1.VNodeWrapper(rootElement);\n var delegators = new MapPolyfill();\n makeDOMDriverInputGuard(modules);\n function DOMDriver(vnode$, runStreamAdapter) {\n domDriverInputGuard(vnode$);\n var transposeVNode = transposition_1.makeTransposeVNode(runStreamAdapter);\n var preprocessedVNode$ = (transposition ? vnode$.map(transposeVNode).flatten() : vnode$);\n var rootElement$ = preprocessedVNode$\n .map(function (vnode) { return vnodeWrapper.call(vnode); })\n .fold(patch, rootElement)\n .drop(1)\n .map(function unwrapElementFromVNode(vnode) { return vnode.elm; })\n .compose(function (stream) { return xstream_1.default.merge(stream, xstream_1.default.never()); }) // don't complete this stream\n .startWith(rootElement);\n /* tslint:disable:no-empty */\n rootElement$.addListener({ next: function () { }, error: function () { }, complete: function () { } });\n /* tslint:enable:no-empty */\n return new MainDOMSource_1.MainDOMSource(rootElement$, runStreamAdapter, [], isolateModule, delegators);\n }\n ;\n DOMDriver.streamAdapter = xstream_adapter_1.default;\n return DOMDriver;\n}\nexports.makeDOMDriver = makeDOMDriver;\n//# sourceMappingURL=makeDOMDriver.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/makeDOMDriver.js\n ** module id = 14\n ** module chunks = 0\n **/","// jshint newcap: false\n/* global require, module, document, Node */\n'use strict';\n\nvar VNode = require('./vnode');\nvar is = require('./is');\nvar domApi = require('./htmldomapi.js');\n\nfunction isUndef(s) { return s === undefined; }\nfunction isDef(s) { return s !== undefined; }\n\nvar emptyNode = VNode('', {}, [], undefined, undefined);\n\nfunction sameVnode(vnode1, vnode2) {\n return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;\n}\n\nfunction createKeyToOldIdx(children, beginIdx, endIdx) {\n var i, map = {}, key;\n for (i = beginIdx; i <= endIdx; ++i) {\n key = children[i].key;\n if (isDef(key)) map[key] = i;\n }\n return map;\n}\n\nvar hooks = ['create', 'update', 'remove', 'destroy', 'pre', 'post'];\n\nfunction init(modules, api) {\n var i, j, cbs = {};\n\n if (isUndef(api)) api = domApi;\n\n for (i = 0; i < hooks.length; ++i) {\n cbs[hooks[i]] = [];\n for (j = 0; j < modules.length; ++j) {\n if (modules[j][hooks[i]] !== undefined) cbs[hooks[i]].push(modules[j][hooks[i]]);\n }\n }\n\n function emptyNodeAt(elm) {\n return VNode(api.tagName(elm).toLowerCase(), {}, [], undefined, elm);\n }\n\n function createRmCb(childElm, listeners) {\n return function() {\n if (--listeners === 0) {\n var parent = api.parentNode(childElm);\n api.removeChild(parent, childElm);\n }\n };\n }\n\n function createElm(vnode, insertedVnodeQueue) {\n var i, thunk, data = vnode.data;\n if (isDef(data)) {\n if (isDef(i = data.hook) && isDef(i = i.init)) i(vnode);\n if (isDef(i = data.vnode)) {\n thunk = vnode;\n vnode = i;\n }\n }\n var elm, children = vnode.children, sel = vnode.sel;\n if (isDef(sel)) {\n // Parse selector\n var hashIdx = sel.indexOf('#');\n var dotIdx = sel.indexOf('.', hashIdx);\n var hash = hashIdx > 0 ? hashIdx : sel.length;\n var dot = dotIdx > 0 ? dotIdx : sel.length;\n var tag = hashIdx !== -1 || dotIdx !== -1 ? sel.slice(0, Math.min(hash, dot)) : sel;\n elm = vnode.elm = isDef(data) && isDef(i = data.ns) ? api.createElementNS(i, tag)\n : api.createElement(tag);\n if (hash < dot) elm.id = sel.slice(hash + 1, dot);\n if (dotIdx > 0) elm.className = sel.slice(dot+1).replace(/\\./g, ' ');\n if (is.array(children)) {\n for (i = 0; i < children.length; ++i) {\n api.appendChild(elm, createElm(children[i], insertedVnodeQueue));\n }\n } else if (is.primitive(vnode.text)) {\n api.appendChild(elm, api.createTextNode(vnode.text));\n }\n for (i = 0; i < cbs.create.length; ++i) cbs.create[i](emptyNode, vnode);\n i = vnode.data.hook; // Reuse variable\n if (isDef(i)) {\n if (i.create) i.create(emptyNode, vnode);\n if (i.insert) insertedVnodeQueue.push(vnode);\n }\n } else {\n elm = vnode.elm = api.createTextNode(vnode.text);\n }\n if (isDef(thunk)) thunk.elm = vnode.elm;\n return vnode.elm;\n }\n\n function addVnodes(parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) {\n for (; startIdx <= endIdx; ++startIdx) {\n api.insertBefore(parentElm, createElm(vnodes[startIdx], insertedVnodeQueue), before);\n }\n }\n\n function invokeDestroyHook(vnode) {\n var i, j, data = vnode.data;\n if (isDef(data)) {\n if (isDef(i = data.hook) && isDef(i = i.destroy)) i(vnode);\n for (i = 0; i < cbs.destroy.length; ++i) cbs.destroy[i](vnode);\n if (isDef(i = vnode.children)) {\n for (j = 0; j < vnode.children.length; ++j) {\n invokeDestroyHook(vnode.children[j]);\n }\n }\n if (isDef(i = data.vnode)) invokeDestroyHook(i);\n }\n }\n\n function removeVnodes(parentElm, vnodes, startIdx, endIdx) {\n for (; startIdx <= endIdx; ++startIdx) {\n var i, listeners, rm, ch = vnodes[startIdx];\n if (isDef(ch)) {\n if (isDef(ch.sel)) {\n invokeDestroyHook(ch);\n listeners = cbs.remove.length + 1;\n rm = createRmCb(ch.elm, listeners);\n for (i = 0; i < cbs.remove.length; ++i) cbs.remove[i](ch, rm);\n if (isDef(i = ch.data) && isDef(i = i.hook) && isDef(i = i.remove)) {\n i(ch, rm);\n } else {\n rm();\n }\n } else { // Text node\n api.removeChild(parentElm, ch.elm);\n }\n }\n }\n }\n\n function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue) {\n var oldStartIdx = 0, newStartIdx = 0;\n var oldEndIdx = oldCh.length - 1;\n var oldStartVnode = oldCh[0];\n var oldEndVnode = oldCh[oldEndIdx];\n var newEndIdx = newCh.length - 1;\n var newStartVnode = newCh[0];\n var newEndVnode = newCh[newEndIdx];\n var oldKeyToIdx, idxInOld, elmToMove, before;\n\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n if (isUndef(oldStartVnode)) {\n oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left\n } else if (isUndef(oldEndVnode)) {\n oldEndVnode = oldCh[--oldEndIdx];\n } else if (sameVnode(oldStartVnode, newStartVnode)) {\n patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);\n oldStartVnode = oldCh[++oldStartIdx];\n newStartVnode = newCh[++newStartIdx];\n } else if (sameVnode(oldEndVnode, newEndVnode)) {\n patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);\n oldEndVnode = oldCh[--oldEndIdx];\n newEndVnode = newCh[--newEndIdx];\n } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right\n patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);\n api.insertBefore(parentElm, oldStartVnode.elm, api.nextSibling(oldEndVnode.elm));\n oldStartVnode = oldCh[++oldStartIdx];\n newEndVnode = newCh[--newEndIdx];\n } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left\n patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);\n api.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n oldEndVnode = oldCh[--oldEndIdx];\n newStartVnode = newCh[++newStartIdx];\n } else {\n if (isUndef(oldKeyToIdx)) oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);\n idxInOld = oldKeyToIdx[newStartVnode.key];\n if (isUndef(idxInOld)) { // New element\n api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);\n newStartVnode = newCh[++newStartIdx];\n } else {\n elmToMove = oldCh[idxInOld];\n patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);\n oldCh[idxInOld] = undefined;\n api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm);\n newStartVnode = newCh[++newStartIdx];\n }\n }\n }\n if (oldStartIdx > oldEndIdx) {\n before = isUndef(newCh[newEndIdx+1]) ? null : newCh[newEndIdx+1].elm;\n addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);\n } else if (newStartIdx > newEndIdx) {\n removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n }\n }\n\n function patchVnode(oldVnode, vnode, insertedVnodeQueue) {\n var i, hook;\n if (isDef(i = vnode.data) && isDef(hook = i.hook) && isDef(i = hook.prepatch)) {\n i(oldVnode, vnode);\n }\n if (isDef(i = oldVnode.data) && isDef(i = i.vnode)) oldVnode = i;\n if (isDef(i = vnode.data) && isDef(i = i.vnode)) {\n patchVnode(oldVnode, i, insertedVnodeQueue);\n vnode.elm = i.elm;\n return;\n }\n var elm = vnode.elm = oldVnode.elm, oldCh = oldVnode.children, ch = vnode.children;\n if (oldVnode === vnode) return;\n if (!sameVnode(oldVnode, vnode)) {\n var parentElm = api.parentNode(oldVnode.elm);\n elm = createElm(vnode, insertedVnodeQueue);\n api.insertBefore(parentElm, elm, oldVnode.elm);\n removeVnodes(parentElm, [oldVnode], 0, 0);\n return;\n }\n if (isDef(vnode.data)) {\n for (i = 0; i < cbs.update.length; ++i) cbs.update[i](oldVnode, vnode);\n i = vnode.data.hook;\n if (isDef(i) && isDef(i = i.update)) i(oldVnode, vnode);\n }\n if (isUndef(vnode.text)) {\n if (isDef(oldCh) && isDef(ch)) {\n if (oldCh !== ch) updateChildren(elm, oldCh, ch, insertedVnodeQueue);\n } else if (isDef(ch)) {\n if (isDef(oldVnode.text)) api.setTextContent(elm, '');\n addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);\n } else if (isDef(oldCh)) {\n removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n } else if (isDef(oldVnode.text)) {\n api.setTextContent(elm, '');\n }\n } else if (oldVnode.text !== vnode.text) {\n api.setTextContent(elm, vnode.text);\n }\n if (isDef(hook) && isDef(i = hook.postpatch)) {\n i(oldVnode, vnode);\n }\n }\n\n return function(oldVnode, vnode) {\n var i, elm, parent;\n var insertedVnodeQueue = [];\n for (i = 0; i < cbs.pre.length; ++i) cbs.pre[i]();\n\n if (isUndef(oldVnode.sel)) {\n oldVnode = emptyNodeAt(oldVnode);\n }\n\n if (sameVnode(oldVnode, vnode)) {\n patchVnode(oldVnode, vnode, insertedVnodeQueue);\n } else {\n elm = oldVnode.elm;\n parent = api.parentNode(elm);\n\n createElm(vnode, insertedVnodeQueue);\n\n if (parent !== null) {\n api.insertBefore(parent, vnode.elm, api.nextSibling(elm));\n removeVnodes(parent, [oldVnode], 0, 0);\n }\n }\n\n for (i = 0; i < insertedVnodeQueue.length; ++i) {\n insertedVnodeQueue[i].data.hook.insert(insertedVnodeQueue[i]);\n }\n for (i = 0; i < cbs.post.length; ++i) cbs.post[i]();\n return vnode;\n };\n}\n\nmodule.exports = {init: init};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/snabbdom.js\n ** module id = 15\n ** module chunks = 0\n **/","function createElement(tagName){\n return document.createElement(tagName);\n}\n\nfunction createElementNS(namespaceURI, qualifiedName){\n return document.createElementNS(namespaceURI, qualifiedName);\n}\n\nfunction createTextNode(text){\n return document.createTextNode(text);\n}\n\n\nfunction insertBefore(parentNode, newNode, referenceNode){\n parentNode.insertBefore(newNode, referenceNode);\n}\n\n\nfunction removeChild(node, child){\n node.removeChild(child);\n}\n\nfunction appendChild(node, child){\n node.appendChild(child);\n}\n\nfunction parentNode(node){\n return node.parentElement;\n}\n\nfunction nextSibling(node){\n return node.nextSibling;\n}\n\nfunction tagName(node){\n return node.tagName;\n}\n\nfunction setTextContent(node, text){\n node.textContent = text;\n}\n\nmodule.exports = {\n createElement: createElement,\n createElementNS: createElementNS,\n createTextNode: createTextNode,\n appendChild: appendChild,\n removeChild: removeChild,\n insertBefore: insertBefore,\n parentNode: parentNode,\n nextSibling: nextSibling,\n tagName: tagName,\n setTextContent: setTextContent\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/htmldomapi.js\n ** module id = 16\n ** module chunks = 0\n **/","\"use strict\";\nvar xstream_adapter_1 = require('@cycle/xstream-adapter');\nvar xstream_1 = require('xstream');\nvar ElementFinder_1 = require('./ElementFinder');\nvar fromEvent_1 = require('./fromEvent');\nvar isolate_1 = require('./isolate');\nvar EventDelegator_1 = require('./EventDelegator');\nvar utils_1 = require('./utils');\nvar matchesSelector;\ntry {\n matchesSelector = require(\"matches-selector\");\n}\ncatch (e) {\n matchesSelector = Function.prototype;\n}\nvar eventTypesThatDontBubble = [\n \"blur\",\n \"canplay\",\n \"canplaythrough\",\n \"change\",\n \"durationchange\",\n \"emptied\",\n \"ended\",\n \"focus\",\n \"load\",\n \"loadeddata\",\n \"loadedmetadata\",\n \"mouseenter\",\n \"mouseleave\",\n \"pause\",\n \"play\",\n \"playing\",\n \"ratechange\",\n \"reset\",\n \"scroll\",\n \"seeked\",\n \"seeking\",\n \"stalled\",\n \"submit\",\n \"suspend\",\n \"timeupdate\",\n \"unload\",\n \"volumechange\",\n \"waiting\",\n];\nfunction determineUseCapture(eventType, options) {\n var result = false;\n if (typeof options.useCapture === \"boolean\") {\n result = options.useCapture;\n }\n if (eventTypesThatDontBubble.indexOf(eventType) !== -1) {\n result = true;\n }\n return result;\n}\nvar MainDOMSource = (function () {\n function MainDOMSource(_rootElement$, _runStreamAdapter, _namespace, _isolateModule, _delegators) {\n if (_namespace === void 0) { _namespace = []; }\n this._rootElement$ = _rootElement$;\n this._runStreamAdapter = _runStreamAdapter;\n this._namespace = _namespace;\n this._isolateModule = _isolateModule;\n this._delegators = _delegators;\n this.isolateSource = isolate_1.isolateSource;\n this.isolateSink = isolate_1.isolateSink;\n }\n MainDOMSource.prototype.elements = function () {\n var output$;\n if (this._namespace.length === 0) {\n output$ = this._rootElement$;\n }\n else {\n var elementFinder_1 = new ElementFinder_1.ElementFinder(this._namespace, this._isolateModule);\n output$ = this._rootElement$.map(function (el) { return elementFinder_1.call(el); });\n }\n var runSA = this._runStreamAdapter;\n return runSA.remember(runSA.adapt(output$, xstream_adapter_1.default.streamSubscribe));\n };\n Object.defineProperty(MainDOMSource.prototype, \"namespace\", {\n get: function () {\n return this._namespace;\n },\n enumerable: true,\n configurable: true\n });\n MainDOMSource.prototype.select = function (selector) {\n if (typeof selector !== 'string') {\n throw new Error(\"DOM driver's select() expects the argument to be a \" +\n \"string as a CSS selector\");\n }\n var trimmedSelector = selector.trim();\n var childNamespace = trimmedSelector === \":root\" ?\n this._namespace :\n this._namespace.concat(trimmedSelector);\n return new MainDOMSource(this._rootElement$, this._runStreamAdapter, childNamespace, this._isolateModule, this._delegators);\n };\n MainDOMSource.prototype.events = function (eventType, options) {\n if (options === void 0) { options = {}; }\n if (typeof eventType !== \"string\") {\n throw new Error(\"DOM driver's events() expects argument to be a \" +\n \"string representing the event type to listen for.\");\n }\n var useCapture = determineUseCapture(eventType, options);\n var namespace = this._namespace;\n var scope = utils_1.getScope(namespace);\n var keyParts = [eventType, useCapture];\n if (scope) {\n keyParts.push(scope);\n }\n var key = keyParts.join('~');\n var domSource = this;\n var rootElement$;\n if (scope) {\n var hadIsolated_mutable_1 = false;\n rootElement$ = this._rootElement$\n .filter(function (rootElement) {\n var hasIsolated = !!domSource._isolateModule.getIsolatedElement(scope);\n var shouldPass = hasIsolated && !hadIsolated_mutable_1;\n hadIsolated_mutable_1 = hasIsolated;\n return shouldPass;\n });\n }\n else {\n rootElement$ = this._rootElement$.take(2);\n }\n var event$ = rootElement$\n .map(function setupEventDelegatorOnTopElement(rootElement) {\n // Event listener just for the root element\n if (!namespace || namespace.length === 0) {\n return fromEvent_1.fromEvent(rootElement, eventType, useCapture);\n }\n // Event listener on the top element as an EventDelegator\n var delegators = domSource._delegators;\n var top = scope\n ? domSource._isolateModule.getIsolatedElement(scope)\n : rootElement;\n var delegator;\n if (delegators.has(key)) {\n delegator = delegators.get(key);\n delegator.updateTopElement(top);\n }\n else {\n delegator = new EventDelegator_1.EventDelegator(top, eventType, useCapture, domSource._isolateModule);\n delegators.set(key, delegator);\n }\n var subject = xstream_1.default.create();\n if (scope) {\n domSource._isolateModule.addEventDelegator(scope, delegator);\n }\n delegator.addDestination(subject, namespace);\n return subject;\n })\n .flatten();\n return this._runStreamAdapter.adapt(event$, xstream_adapter_1.default.streamSubscribe);\n };\n MainDOMSource.prototype.dispose = function () {\n this._isolateModule.reset();\n };\n return MainDOMSource;\n}());\nexports.MainDOMSource = MainDOMSource;\n//# sourceMappingURL=MainDOMSource.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/MainDOMSource.js\n ** module id = 17\n ** module chunks = 0\n **/","\"use strict\";\nvar xstream_1 = require('xstream');\nvar XStreamAdapter = {\n adapt: function (originStream, originStreamSubscribe) {\n if (XStreamAdapter.isValidStream(originStream)) {\n return originStream;\n }\n ;\n var dispose = null;\n return xstream_1.default.create({\n start: function (out) {\n var observer = out;\n dispose = originStreamSubscribe(originStream, observer);\n },\n stop: function () {\n if (typeof dispose === 'function') {\n dispose();\n }\n }\n });\n },\n makeSubject: function () {\n var stream = xstream_1.default.create();\n var observer = {\n next: function (x) { stream.shamefullySendNext(x); },\n error: function (err) { stream.shamefullySendError(err); },\n complete: function () { stream.shamefullySendComplete(); }\n };\n return { observer: observer, stream: stream };\n },\n remember: function (stream) {\n return stream.remember();\n },\n isValidStream: function (stream) {\n return (typeof stream.addListener === 'function' &&\n typeof stream.shamefullySendNext === 'function');\n },\n streamSubscribe: function (stream, observer) {\n stream.addListener(observer);\n return function () { return stream.removeListener(observer); };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = XStreamAdapter;\n//# sourceMappingURL=index.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/@cycle/xstream-adapter/lib/index.js\n ** module id = 18\n ** module chunks = 0\n **/","\"use strict\";\nvar ScopeChecker_1 = require('./ScopeChecker');\nvar utils_1 = require('./utils');\nvar matchesSelector;\ntry {\n matchesSelector = require(\"matches-selector\");\n}\ncatch (e) {\n matchesSelector = Function.prototype;\n}\nfunction toElArray(input) {\n return Array.prototype.slice.call(input);\n}\nvar ElementFinder = (function () {\n function ElementFinder(namespace, isolateModule) {\n this.namespace = namespace;\n this.isolateModule = isolateModule;\n }\n ElementFinder.prototype.call = function (rootElement) {\n var namespace = this.namespace;\n if (namespace.join(\"\") === \"\") {\n return rootElement;\n }\n var scope = utils_1.getScope(namespace);\n var scopeChecker = new ScopeChecker_1.ScopeChecker(scope, this.isolateModule);\n var selector = utils_1.getSelectors(namespace);\n var topNode = rootElement;\n var topNodeMatches = [];\n if (scope.length > 0) {\n topNode = this.isolateModule.getIsolatedElement(scope) || rootElement;\n if (selector && matchesSelector(topNode, selector)) {\n topNodeMatches.push(topNode);\n }\n }\n return toElArray(topNode.querySelectorAll(selector))\n .filter(scopeChecker.isStrictlyInRootScope, scopeChecker)\n .concat(topNodeMatches);\n };\n return ElementFinder;\n}());\nexports.ElementFinder = ElementFinder;\n//# sourceMappingURL=ElementFinder.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/ElementFinder.js\n ** module id = 19\n ** module chunks = 0\n **/","\"use strict\";\nvar ScopeChecker = (function () {\n function ScopeChecker(scope, isolateModule) {\n this.scope = scope;\n this.isolateModule = isolateModule;\n }\n ScopeChecker.prototype.isStrictlyInRootScope = function (leaf) {\n for (var el = leaf; el; el = el.parentElement) {\n var scope = this.isolateModule.isIsolatedElement(el);\n if (scope && scope !== this.scope) {\n return false;\n }\n if (scope) {\n return true;\n }\n }\n return true;\n };\n return ScopeChecker;\n}());\nexports.ScopeChecker = ScopeChecker;\n//# sourceMappingURL=ScopeChecker.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/ScopeChecker.js\n ** module id = 20\n ** module chunks = 0\n **/","\"use strict\";\nfunction isElement(obj) {\n return typeof HTMLElement === \"object\" ?\n obj instanceof HTMLElement || obj instanceof DocumentFragment :\n obj && typeof obj === \"object\" && obj !== null &&\n (obj.nodeType === 1 || obj.nodeType === 11) &&\n typeof obj.nodeName === \"string\";\n}\nexports.SCOPE_PREFIX = \"$$CYCLEDOM$$-\";\nfunction getElement(selectors) {\n var domElement = (typeof selectors === \"string\" ?\n document.querySelector(selectors) :\n selectors);\n if (typeof selectors === \"string\" && domElement === null) {\n throw new Error(\"Cannot render into unknown element `\" + selectors + \"`\");\n }\n else if (!isElement(domElement)) {\n throw new Error(\"Given container is not a DOM element neither a \" +\n \"selector string.\");\n }\n return domElement;\n}\nexports.getElement = getElement;\nfunction getScope(namespace) {\n return namespace\n .filter(function (c) { return c.indexOf(exports.SCOPE_PREFIX) > -1; })\n .slice(-1) // only need the latest, most specific, isolated boundary\n .join(\"\");\n}\nexports.getScope = getScope;\nfunction getSelectors(namespace) {\n return namespace.filter(function (c) { return c.indexOf(exports.SCOPE_PREFIX) === -1; }).join(\" \");\n}\nexports.getSelectors = getSelectors;\n//# sourceMappingURL=utils.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/utils.js\n ** module id = 21\n ** module chunks = 0\n **/","'use strict';\n\nvar proto = Element.prototype;\nvar vendor = proto.matches\n || proto.matchesSelector\n || proto.webkitMatchesSelector\n || proto.mozMatchesSelector\n || proto.msMatchesSelector\n || proto.oMatchesSelector;\n\nmodule.exports = match;\n\n/**\n * Match `el` to `selector`.\n *\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n * @api public\n */\n\nfunction match(el, selector) {\n if (vendor) return vendor.call(el, selector);\n var nodes = el.parentNode.querySelectorAll(selector);\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i] == el) return true;\n }\n return false;\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/matches-selector/index.js\n ** module id = 22\n ** module chunks = 0\n **/","\"use strict\";\nvar xstream_1 = require('xstream');\nfunction fromEvent(element, eventName, useCapture) {\n if (useCapture === void 0) { useCapture = false; }\n return xstream_1.Stream.create({\n element: element,\n next: null,\n start: function start(listener) {\n this.next = function next(event) { listener.next(event); };\n this.element.addEventListener(eventName, this.next, useCapture);\n },\n stop: function stop() {\n this.element.removeEventListener(eventName, this.next, useCapture);\n }\n });\n}\nexports.fromEvent = fromEvent;\n//# sourceMappingURL=fromEvent.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/fromEvent.js\n ** module id = 23\n ** module chunks = 0\n **/","\"use strict\";\nvar utils_1 = require('./utils');\nfunction isolateSource(source, scope) {\n return source.select(utils_1.SCOPE_PREFIX + scope);\n}\nexports.isolateSource = isolateSource;\nfunction isolateSink(sink, scope) {\n return sink.map(function (vTree) {\n if (vTree.data.isolate) {\n var existingScope = parseInt(vTree.data.isolate.split(utils_1.SCOPE_PREFIX + 'cycle')[1]);\n var _scope = parseInt(scope.split('cycle')[1]);\n if (isNaN(existingScope) || isNaN(_scope) || existingScope > _scope) {\n return vTree;\n }\n }\n vTree.data.isolate = utils_1.SCOPE_PREFIX + scope;\n return vTree;\n });\n}\nexports.isolateSink = isolateSink;\n//# sourceMappingURL=isolate.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/isolate.js\n ** module id = 24\n ** module chunks = 0\n **/","\"use strict\";\nvar ScopeChecker_1 = require('./ScopeChecker');\nvar utils_1 = require('./utils');\nvar matchesSelector;\ntry {\n matchesSelector = require(\"matches-selector\");\n}\ncatch (e) {\n matchesSelector = Function.prototype;\n}\n/**\n * Attaches an actual event listener to the DOM root element,\n * handles \"destinations\" (interested DOMSource output subjects), and bubbling.\n */\nvar EventDelegator = (function () {\n function EventDelegator(topElement, eventType, useCapture, isolateModule) {\n var _this = this;\n this.topElement = topElement;\n this.eventType = eventType;\n this.useCapture = useCapture;\n this.isolateModule = isolateModule;\n this.destinations = [];\n this.roof = topElement.parentElement;\n if (useCapture) {\n this.domListener = function (ev) { return _this.capture(ev); };\n }\n else {\n this.domListener = function (ev) { return _this.bubble(ev); };\n }\n topElement.addEventListener(eventType, this.domListener, useCapture);\n }\n EventDelegator.prototype.bubble = function (rawEvent) {\n if (!document.body.contains(rawEvent.currentTarget)) {\n return;\n }\n var ev = this.patchEvent(rawEvent);\n for (var el = ev.target; el && el !== this.roof; el = el.parentElement) {\n if (!document.body.contains(el)) {\n ev.stopPropagation();\n }\n if (ev.propagationHasBeenStopped) {\n return;\n }\n this.matchEventAgainstDestinations(el, ev);\n }\n };\n EventDelegator.prototype.matchEventAgainstDestinations = function (el, ev) {\n for (var i = 0, n = this.destinations.length; i < n; i++) {\n var dest = this.destinations[i];\n if (!dest.scopeChecker.isStrictlyInRootScope(el)) {\n continue;\n }\n if (matchesSelector(el, dest.selector)) {\n this.mutateEventCurrentTarget(ev, el);\n dest.subject._n(ev);\n }\n }\n };\n EventDelegator.prototype.capture = function (ev) {\n for (var i = 0, n = this.destinations.length; i < n; i++) {\n var dest = this.destinations[i];\n if (matchesSelector(ev.target, dest.selector)) {\n dest.subject._n(ev);\n }\n }\n };\n EventDelegator.prototype.addDestination = function (subject, namespace) {\n var scope = utils_1.getScope(namespace);\n var selector = utils_1.getSelectors(namespace);\n var scopeChecker = new ScopeChecker_1.ScopeChecker(scope, this.isolateModule);\n this.destinations.push({ subject: subject, scopeChecker: scopeChecker, selector: selector });\n };\n EventDelegator.prototype.patchEvent = function (event) {\n var pEvent = event;\n pEvent.propagationHasBeenStopped = false;\n var oldStopPropagation = pEvent.stopPropagation;\n pEvent.stopPropagation = function stopPropagation() {\n oldStopPropagation.call(this);\n this.propagationHasBeenStopped = true;\n };\n return pEvent;\n };\n EventDelegator.prototype.mutateEventCurrentTarget = function (event, currentTargetElement) {\n try {\n Object.defineProperty(event, \"currentTarget\", {\n value: currentTargetElement,\n configurable: true,\n });\n }\n catch (err) {\n console.log(\"please use event.ownerTarget\");\n }\n event.ownerTarget = currentTargetElement;\n };\n EventDelegator.prototype.updateTopElement = function (newTopElement) {\n this.topElement.removeEventListener(this.eventType, this.domListener, this.useCapture);\n newTopElement.addEventListener(this.eventType, this.domListener, this.useCapture);\n this.topElement = newTopElement;\n };\n return EventDelegator;\n}());\nexports.EventDelegator = EventDelegator;\n//# sourceMappingURL=EventDelegator.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/EventDelegator.js\n ** module id = 25\n ** module chunks = 0\n **/","\"use strict\";\nvar hyperscript_1 = require('./hyperscript');\nvar classNameFromVNode_1 = require('snabbdom-selector/lib/classNameFromVNode');\nvar selectorParser_1 = require('snabbdom-selector/lib/selectorParser');\nvar VNodeWrapper = (function () {\n function VNodeWrapper(rootElement) {\n this.rootElement = rootElement;\n }\n VNodeWrapper.prototype.call = function (vnode) {\n var _a = selectorParser_1.default(vnode.sel), selectorTagName = _a.tagName, selectorId = _a.id;\n var vNodeClassName = classNameFromVNode_1.default(vnode);\n var vNodeData = vnode.data || {};\n var vNodeDataProps = vNodeData.props || {};\n var _b = vNodeDataProps.id, vNodeId = _b === void 0 ? selectorId : _b;\n var isVNodeAndRootElementIdentical = vNodeId.toUpperCase() === this.rootElement.id.toUpperCase() &&\n selectorTagName.toUpperCase() === this.rootElement.tagName.toUpperCase() &&\n vNodeClassName.toUpperCase() === this.rootElement.className.toUpperCase();\n if (isVNodeAndRootElementIdentical) {\n return vnode;\n }\n var _c = this.rootElement, tagName = _c.tagName, id = _c.id, className = _c.className;\n var elementId = id ? \"#\" + id : \"\";\n var elementClassName = className ?\n \".\" + className.split(\" \").join(\".\") : \"\";\n return hyperscript_1.h(\"\" + tagName + elementId + elementClassName, {}, [vnode]);\n };\n return VNodeWrapper;\n}());\nexports.VNodeWrapper = VNodeWrapper;\n//# sourceMappingURL=VNodeWrapper.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/VNodeWrapper.js\n ** module id = 26\n ** module chunks = 0\n **/","\"use strict\";\nvar is = require('snabbdom/is');\nvar vnode = require('snabbdom/vnode');\nfunction isGenericStream(x) {\n return !Array.isArray(x) && typeof x.map === \"function\";\n}\nfunction mutateStreamWithNS(vNode) {\n addNS(vNode.data, vNode.children, vNode.sel);\n return vNode;\n}\nfunction addNS(data, children, selector) {\n data.ns = \"http://www.w3.org/2000/svg\";\n if (selector !== \"foreignObject\" && typeof children !== \"undefined\" && is.array(children)) {\n for (var i = 0; i < children.length; ++i) {\n if (isGenericStream(children[i])) {\n children[i] = children[i].map(mutateStreamWithNS);\n }\n else {\n addNS(children[i].data, children[i].children, children[i].sel);\n }\n }\n }\n}\nfunction h(sel, b, c) {\n var data = {};\n var children;\n var text;\n var i;\n if (arguments.length === 3) {\n data = b;\n if (is.array(c)) {\n children = c;\n }\n else if (is.primitive(c)) {\n text = c;\n }\n }\n else if (arguments.length === 2) {\n if (is.array(b)) {\n children = b;\n }\n else if (is.primitive(b)) {\n text = b;\n }\n else {\n data = b;\n }\n }\n if (is.array(children)) {\n children = children.filter(function (x) { return x; });\n for (i = 0; i < children.length; ++i) {\n if (is.primitive(children[i])) {\n children[i] = vnode(undefined, undefined, undefined, children[i]);\n }\n }\n }\n if (sel[0] === 's' && sel[1] === 'v' && sel[2] === 'g') {\n addNS(data, children, sel);\n }\n return vnode(sel, data, children, text, undefined);\n}\nexports.h = h;\n;\n//# sourceMappingURL=hyperscript.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/hyperscript.js\n ** module id = 27\n ** module chunks = 0\n **/","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = classNameFromVNode;\n\nvar _selectorParser2 = require('./selectorParser');\n\nvar _selectorParser3 = _interopRequireDefault(_selectorParser2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction classNameFromVNode(vNode) {\n var _selectorParser = (0, _selectorParser3.default)(vNode.sel);\n\n var cn = _selectorParser.className;\n\n if (!vNode.data) {\n return cn;\n }\n\n var _vNode$data = vNode.data;\n var dataClass = _vNode$data.class;\n var props = _vNode$data.props;\n\n if (dataClass) {\n var c = Object.keys(vNode.data.class).filter(function (cl) {\n return vNode.data.class[cl];\n });\n cn += ' ' + c.join(' ');\n }\n\n if (props && props.className) {\n cn += ' ' + props.className;\n }\n\n return cn.trim();\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-selector/lib/classNameFromVNode.js\n ** module id = 28\n ** module chunks = 0\n **/","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = selectorParser;\n\nvar _browserSplit = require('browser-split');\n\nvar _browserSplit2 = _interopRequireDefault(_browserSplit);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar classIdSplit = /([\\.#]?[a-zA-Z0-9\\u007F-\\uFFFF_:-]+)/;\nvar notClassId = /^\\.|#/;\n\nfunction selectorParser() {\n var selector = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];\n\n var tagName = undefined;\n var id = '';\n var classes = [];\n\n var tagParts = (0, _browserSplit2.default)(selector, classIdSplit);\n\n if (notClassId.test(tagParts[1]) || selector === '') {\n tagName = 'div';\n }\n\n var part = undefined;\n var type = undefined;\n var i = undefined;\n\n for (i = 0; i < tagParts.length; i++) {\n part = tagParts[i];\n\n if (!part) {\n continue;\n }\n\n type = part.charAt(0);\n\n if (!tagName) {\n tagName = part;\n } else if (type === '.') {\n classes.push(part.substring(1, part.length));\n } else if (type === '#') {\n id = part.substring(1, part.length);\n }\n }\n\n return {\n tagName: tagName,\n id: id,\n className: classes.join(' ')\n };\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-selector/lib/selectorParser.js\n ** module id = 29\n ** module chunks = 0\n **/","/*!\n * Cross-Browser Split 1.1.1\n * Copyright 2007-2012 Steven Levithan \n * Available under the MIT License\n * ECMAScript compliant, uniform cross-browser split method\n */\n\n/**\n * Splits a string into an array of strings using a regex or string separator. Matches of the\n * separator are not included in the result array. However, if `separator` is a regex that contains\n * capturing groups, backreferences are spliced into the result each time `separator` is matched.\n * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably\n * cross-browser.\n * @param {String} str String to split.\n * @param {RegExp|String} separator Regex or string to use for separating the string.\n * @param {Number} [limit] Maximum number of items to include in the result array.\n * @returns {Array} Array of substrings.\n * @example\n *\n * // Basic use\n * split('a b c d', ' ');\n * // -> ['a', 'b', 'c', 'd']\n *\n * // With limit\n * split('a b c d', ' ', 2);\n * // -> ['a', 'b']\n *\n * // Backreferences in result array\n * split('..word1 word2..', /([a-z]+)(\\d+)/i);\n * // -> ['..', 'word', '1', ' ', 'word', '2', '..']\n */\nmodule.exports = (function split(undef) {\n\n var nativeSplit = String.prototype.split,\n compliantExecNpcg = /()??/.exec(\"\")[1] === undef,\n // NPCG: nonparticipating capturing group\n self;\n\n self = function(str, separator, limit) {\n // If `separator` is not a regex, use `nativeSplit`\n if (Object.prototype.toString.call(separator) !== \"[object RegExp]\") {\n return nativeSplit.call(str, separator, limit);\n }\n var output = [],\n flags = (separator.ignoreCase ? \"i\" : \"\") + (separator.multiline ? \"m\" : \"\") + (separator.extended ? \"x\" : \"\") + // Proposed for ES6\n (separator.sticky ? \"y\" : \"\"),\n // Firefox 3+\n lastLastIndex = 0,\n // Make `global` and avoid `lastIndex` issues by working with a copy\n separator = new RegExp(separator.source, flags + \"g\"),\n separator2, match, lastIndex, lastLength;\n str += \"\"; // Type-convert\n if (!compliantExecNpcg) {\n // Doesn't need flags gy, but they don't hurt\n separator2 = new RegExp(\"^\" + separator.source + \"$(?!\\\\s)\", flags);\n }\n /* Values for `limit`, per the spec:\n * If undefined: 4294967295 // Math.pow(2, 32) - 1\n * If 0, Infinity, or NaN: 0\n * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;\n * If negative number: 4294967296 - Math.floor(Math.abs(limit))\n * If other: Type-convert, then use the above rules\n */\n limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1\n limit >>> 0; // ToUint32(limit)\n while (match = separator.exec(str)) {\n // `separator.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0].length;\n if (lastIndex > lastLastIndex) {\n output.push(str.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for\n // nonparticipating capturing groups\n if (!compliantExecNpcg && match.length > 1) {\n match[0].replace(separator2, function() {\n for (var i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undef) {\n match[i] = undef;\n }\n }\n });\n }\n if (match.length > 1 && match.index < str.length) {\n Array.prototype.push.apply(output, match.slice(1));\n }\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= limit) {\n break;\n }\n }\n if (separator.lastIndex === match.index) {\n separator.lastIndex++; // Avoid an infinite loop\n }\n }\n if (lastLastIndex === str.length) {\n if (lastLength || !separator.test(\"\")) {\n output.push(\"\");\n }\n } else {\n output.push(str.slice(lastLastIndex));\n }\n return output.length > limit ? output.slice(0, limit) : output;\n };\n\n return self;\n})();\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-selector/~/browser-split/index.js\n ** module id = 30\n ** module chunks = 0\n **/","\"use strict\";\nvar ClassModule = require('snabbdom/modules/class');\nexports.ClassModule = ClassModule;\nvar PropsModule = require('snabbdom/modules/props');\nexports.PropsModule = PropsModule;\nvar AttrsModule = require('snabbdom/modules/attributes');\nexports.AttrsModule = AttrsModule;\nvar EventsModule = require('snabbdom/modules/eventlisteners');\nexports.EventsModule = EventsModule;\nvar StyleModule = require('snabbdom/modules/style');\nexports.StyleModule = StyleModule;\nvar HeroModule = require('snabbdom/modules/hero');\nexports.HeroModule = HeroModule;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = [StyleModule, ClassModule, PropsModule, AttrsModule];\n//# sourceMappingURL=modules.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/modules.js\n ** module id = 31\n ** module chunks = 0\n **/","function updateClass(oldVnode, vnode) {\n var cur, name, elm = vnode.elm,\n oldClass = oldVnode.data.class || {},\n klass = vnode.data.class || {};\n for (name in oldClass) {\n if (!klass[name]) {\n elm.classList.remove(name);\n }\n }\n for (name in klass) {\n cur = klass[name];\n if (cur !== oldClass[name]) {\n elm.classList[cur ? 'add' : 'remove'](name);\n }\n }\n}\n\nmodule.exports = {create: updateClass, update: updateClass};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/modules/class.js\n ** module id = 32\n ** module chunks = 0\n **/","function updateProps(oldVnode, vnode) {\n var key, cur, old, elm = vnode.elm,\n oldProps = oldVnode.data.props || {}, props = vnode.data.props || {};\n for (key in oldProps) {\n if (!props[key]) {\n delete elm[key];\n }\n }\n for (key in props) {\n cur = props[key];\n old = oldProps[key];\n if (old !== cur && (key !== 'value' || elm[key] !== cur)) {\n elm[key] = cur;\n }\n }\n}\n\nmodule.exports = {create: updateProps, update: updateProps};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/modules/props.js\n ** module id = 33\n ** module chunks = 0\n **/","var booleanAttrs = [\"allowfullscreen\", \"async\", \"autofocus\", \"autoplay\", \"checked\", \"compact\", \"controls\", \"declare\", \n \"default\", \"defaultchecked\", \"defaultmuted\", \"defaultselected\", \"defer\", \"disabled\", \"draggable\", \n \"enabled\", \"formnovalidate\", \"hidden\", \"indeterminate\", \"inert\", \"ismap\", \"itemscope\", \"loop\", \"multiple\", \n \"muted\", \"nohref\", \"noresize\", \"noshade\", \"novalidate\", \"nowrap\", \"open\", \"pauseonexit\", \"readonly\", \n \"required\", \"reversed\", \"scoped\", \"seamless\", \"selected\", \"sortable\", \"spellcheck\", \"translate\", \n \"truespeed\", \"typemustmatch\", \"visible\"];\n \nvar booleanAttrsDict = {};\nfor(var i=0, len = booleanAttrs.length; i < len; i++) {\n booleanAttrsDict[booleanAttrs[i]] = true;\n}\n \nfunction updateAttrs(oldVnode, vnode) {\n var key, cur, old, elm = vnode.elm,\n oldAttrs = oldVnode.data.attrs || {}, attrs = vnode.data.attrs || {};\n \n // update modified attributes, add new attributes\n for (key in attrs) {\n cur = attrs[key];\n old = oldAttrs[key];\n if (old !== cur) {\n // TODO: add support to namespaced attributes (setAttributeNS)\n if(!cur && booleanAttrsDict[key])\n elm.removeAttribute(key);\n else\n elm.setAttribute(key, cur);\n }\n }\n //remove removed attributes\n // use `in` operator since the previous `for` iteration uses it (.i.e. add even attributes with undefined value)\n // the other option is to remove all attributes with value == undefined\n for (key in oldAttrs) {\n if (!(key in attrs)) {\n elm.removeAttribute(key);\n }\n }\n}\n\nmodule.exports = {create: updateAttrs, update: updateAttrs};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/modules/attributes.js\n ** module id = 34\n ** module chunks = 0\n **/","var is = require('../is');\n\nfunction arrInvoker(arr) {\n return function() {\n // Special case when length is two, for performance\n arr.length === 2 ? arr[0](arr[1]) : arr[0].apply(undefined, arr.slice(1));\n };\n}\n\nfunction fnInvoker(o) {\n return function(ev) { o.fn(ev); };\n}\n\nfunction updateEventListeners(oldVnode, vnode) {\n var name, cur, old, elm = vnode.elm,\n oldOn = oldVnode.data.on || {}, on = vnode.data.on;\n if (!on) return;\n for (name in on) {\n cur = on[name];\n old = oldOn[name];\n if (old === undefined) {\n if (is.array(cur)) {\n elm.addEventListener(name, arrInvoker(cur));\n } else {\n cur = {fn: cur};\n on[name] = cur;\n elm.addEventListener(name, fnInvoker(cur));\n }\n } else if (is.array(old)) {\n // Deliberately modify old array since it's captured in closure created with `arrInvoker`\n old.length = cur.length;\n for (var i = 0; i < old.length; ++i) old[i] = cur[i];\n on[name] = old;\n } else {\n old.fn = cur;\n on[name] = old;\n }\n }\n}\n\nmodule.exports = {create: updateEventListeners, update: updateEventListeners};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/modules/eventlisteners.js\n ** module id = 35\n ** module chunks = 0\n **/","var raf = (typeof window !== 'undefined' && window.requestAnimationFrame) || setTimeout;\nvar nextFrame = function(fn) { raf(function() { raf(fn); }); };\n\nfunction setNextFrame(obj, prop, val) {\n nextFrame(function() { obj[prop] = val; });\n}\n\nfunction updateStyle(oldVnode, vnode) {\n var cur, name, elm = vnode.elm,\n oldStyle = oldVnode.data.style || {},\n style = vnode.data.style || {},\n oldHasDel = 'delayed' in oldStyle;\n for (name in oldStyle) {\n if (!style[name]) {\n elm.style[name] = '';\n }\n }\n for (name in style) {\n cur = style[name];\n if (name === 'delayed') {\n for (name in style.delayed) {\n cur = style.delayed[name];\n if (!oldHasDel || cur !== oldStyle.delayed[name]) {\n setNextFrame(elm.style, name, cur);\n }\n }\n } else if (name !== 'remove' && cur !== oldStyle[name]) {\n elm.style[name] = cur;\n }\n }\n}\n\nfunction applyDestroyStyle(vnode) {\n var style, name, elm = vnode.elm, s = vnode.data.style;\n if (!s || !(style = s.destroy)) return;\n for (name in style) {\n elm.style[name] = style[name];\n }\n}\n\nfunction applyRemoveStyle(vnode, rm) {\n var s = vnode.data.style;\n if (!s || !s.remove) {\n rm();\n return;\n }\n var name, elm = vnode.elm, idx, i = 0, maxDur = 0,\n compStyle, style = s.remove, amount = 0, applied = [];\n for (name in style) {\n applied.push(name);\n elm.style[name] = style[name];\n }\n compStyle = getComputedStyle(elm);\n var props = compStyle['transition-property'].split(', ');\n for (; i < props.length; ++i) {\n if(applied.indexOf(props[i]) !== -1) amount++;\n }\n elm.addEventListener('transitionend', function(ev) {\n if (ev.target === elm) --amount;\n if (amount === 0) rm();\n });\n}\n\nmodule.exports = {create: updateStyle, update: updateStyle, destroy: applyDestroyStyle, remove: applyRemoveStyle};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/modules/style.js\n ** module id = 36\n ** module chunks = 0\n **/","var raf = (typeof window !== 'undefined' && window.requestAnimationFrame) || setTimeout;\nvar nextFrame = function(fn) { raf(function() { raf(fn); }); };\n\nfunction setNextFrame(obj, prop, val) {\n nextFrame(function() { obj[prop] = val; });\n}\n\nfunction getTextNodeRect(textNode) {\n var rect;\n if (document.createRange) {\n var range = document.createRange();\n range.selectNodeContents(textNode);\n if (range.getBoundingClientRect) {\n rect = range.getBoundingClientRect();\n }\n }\n return rect;\n}\n\nfunction calcTransformOrigin(isTextNode, textRect, boundingRect) {\n if (isTextNode) {\n if (textRect) {\n //calculate pixels to center of text from left edge of bounding box\n var relativeCenterX = textRect.left + textRect.width/2 - boundingRect.left;\n var relativeCenterY = textRect.top + textRect.height/2 - boundingRect.top;\n return relativeCenterX + 'px ' + relativeCenterY + 'px';\n }\n }\n return '0 0'; //top left\n}\n\nfunction getTextDx(oldTextRect, newTextRect) {\n if (oldTextRect && newTextRect) {\n return ((oldTextRect.left + oldTextRect.width/2) - (newTextRect.left + newTextRect.width/2));\n }\n return 0;\n}\nfunction getTextDy(oldTextRect, newTextRect) {\n if (oldTextRect && newTextRect) {\n return ((oldTextRect.top + oldTextRect.height/2) - (newTextRect.top + newTextRect.height/2));\n }\n return 0;\n}\n\nfunction isTextElement(elm) {\n return elm.childNodes.length === 1 && elm.childNodes[0].nodeType === 3;\n}\n\nvar removed, created;\n\nfunction pre(oldVnode, vnode) {\n removed = {};\n created = [];\n}\n\nfunction create(oldVnode, vnode) {\n var hero = vnode.data.hero;\n if (hero && hero.id) {\n created.push(hero.id);\n created.push(vnode);\n }\n}\n\nfunction destroy(vnode) {\n var hero = vnode.data.hero;\n if (hero && hero.id) {\n var elm = vnode.elm;\n vnode.isTextNode = isTextElement(elm); //is this a text node?\n vnode.boundingRect = elm.getBoundingClientRect(); //save the bounding rectangle to a new property on the vnode\n vnode.textRect = vnode.isTextNode ? getTextNodeRect(elm.childNodes[0]) : null; //save bounding rect of inner text node\n var computedStyle = window.getComputedStyle(elm, null); //get current styles (includes inherited properties)\n vnode.savedStyle = JSON.parse(JSON.stringify(computedStyle)); //save a copy of computed style values\n removed[hero.id] = vnode;\n }\n}\n\nfunction post() {\n var i, id, newElm, oldVnode, oldElm, hRatio, wRatio,\n oldRect, newRect, dx, dy, origTransform, origTransition,\n newStyle, oldStyle, newComputedStyle, isTextNode,\n newTextRect, oldTextRect;\n for (i = 0; i < created.length; i += 2) {\n id = created[i];\n newElm = created[i+1].elm;\n oldVnode = removed[id];\n if (oldVnode) {\n isTextNode = oldVnode.isTextNode && isTextElement(newElm); //Are old & new both text?\n newStyle = newElm.style;\n newComputedStyle = window.getComputedStyle(newElm, null); //get full computed style for new element\n oldElm = oldVnode.elm;\n oldStyle = oldElm.style;\n //Overall element bounding boxes\n newRect = newElm.getBoundingClientRect();\n oldRect = oldVnode.boundingRect; //previously saved bounding rect\n //Text node bounding boxes & distances\n if (isTextNode) {\n newTextRect = getTextNodeRect(newElm.childNodes[0]);\n oldTextRect = oldVnode.textRect;\n dx = getTextDx(oldTextRect, newTextRect);\n dy = getTextDy(oldTextRect, newTextRect);\n } else {\n //Calculate distances between old & new positions\n dx = oldRect.left - newRect.left;\n dy = oldRect.top - newRect.top;\n }\n hRatio = newRect.height / (Math.max(oldRect.height, 1));\n wRatio = isTextNode ? hRatio : newRect.width / (Math.max(oldRect.width, 1)); //text scales based on hRatio\n // Animate new element\n origTransform = newStyle.transform;\n origTransition = newStyle.transition;\n if (newComputedStyle.display === 'inline') //inline elements cannot be transformed\n newStyle.display = 'inline-block'; //this does not appear to have any negative side effects\n newStyle.transition = origTransition + 'transform 0s';\n newStyle.transformOrigin = calcTransformOrigin(isTextNode, newTextRect, newRect);\n newStyle.opacity = '0';\n newStyle.transform = origTransform + 'translate('+dx+'px, '+dy+'px) ' +\n 'scale('+1/wRatio+', '+1/hRatio+')';\n setNextFrame(newStyle, 'transition', origTransition);\n setNextFrame(newStyle, 'transform', origTransform);\n setNextFrame(newStyle, 'opacity', '1');\n // Animate old element\n for (var key in oldVnode.savedStyle) { //re-apply saved inherited properties\n if (parseInt(key) != key) {\n var ms = key.substring(0,2) === 'ms';\n var moz = key.substring(0,3) === 'moz';\n var webkit = key.substring(0,6) === 'webkit';\n \t if (!ms && !moz && !webkit) //ignore prefixed style properties\n \t oldStyle[key] = oldVnode.savedStyle[key];\n }\n }\n oldStyle.position = 'absolute';\n oldStyle.top = oldRect.top + 'px'; //start at existing position\n oldStyle.left = oldRect.left + 'px';\n oldStyle.width = oldRect.width + 'px'; //Needed for elements who were sized relative to their parents\n oldStyle.height = oldRect.height + 'px'; //Needed for elements who were sized relative to their parents\n oldStyle.margin = 0; //Margin on hero element leads to incorrect positioning\n oldStyle.transformOrigin = calcTransformOrigin(isTextNode, oldTextRect, oldRect);\n oldStyle.transform = '';\n oldStyle.opacity = '1';\n document.body.appendChild(oldElm);\n setNextFrame(oldStyle, 'transform', 'translate('+ -dx +'px, '+ -dy +'px) scale('+wRatio+', '+hRatio+')'); //scale must be on far right for translate to be correct\n setNextFrame(oldStyle, 'opacity', '0');\n oldElm.addEventListener('transitionend', function(ev) {\n if (ev.propertyName === 'transform')\n document.body.removeChild(ev.target);\n });\n }\n }\n removed = created = undefined;\n}\n\nmodule.exports = {pre: pre, create: create, destroy: destroy, post: post};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom/modules/hero.js\n ** module id = 37\n ** module chunks = 0\n **/","\"use strict\";\nvar MapPolyfill = require('es6-map');\nvar IsolateModule = (function () {\n function IsolateModule(isolatedElements) {\n this.isolatedElements = isolatedElements;\n this.eventDelegators = new MapPolyfill();\n }\n IsolateModule.prototype.setScope = function (elm, scope) {\n this.isolatedElements.set(scope, elm);\n };\n IsolateModule.prototype.removeScope = function (scope) {\n this.isolatedElements.delete(scope);\n };\n IsolateModule.prototype.getIsolatedElement = function (scope) {\n return this.isolatedElements.get(scope);\n };\n IsolateModule.prototype.isIsolatedElement = function (elm) {\n var iterator = this.isolatedElements.entries();\n var hasNext = true;\n while (hasNext) {\n try {\n var result = iterator.next();\n var _a = result.value, scope = _a[0], element = _a[1];\n if (elm === element) {\n return scope;\n }\n }\n catch (err) {\n hasNext = false;\n }\n }\n return false;\n };\n IsolateModule.prototype.addEventDelegator = function (scope, eventDelegator) {\n var delegators = this.eventDelegators.get(scope);\n if (!delegators) {\n delegators = [];\n this.eventDelegators.set(scope, delegators);\n }\n delegators[delegators.length] = eventDelegator;\n };\n IsolateModule.prototype.reset = function () {\n this.isolatedElements.clear();\n };\n IsolateModule.prototype.createModule = function () {\n var self = this;\n return {\n create: function (oldVNode, vNode) {\n var _a = oldVNode.data, oldData = _a === void 0 ? {} : _a;\n var elm = vNode.elm, _b = vNode.data, data = _b === void 0 ? {} : _b;\n var oldScope = oldData.isolate || \"\";\n var scope = data.isolate || \"\";\n if (scope) {\n if (oldScope) {\n self.removeScope(oldScope);\n }\n self.setScope(elm, scope);\n var delegators = self.eventDelegators.get(scope);\n if (delegators) {\n for (var i = 0, len = delegators.length; i < len; ++i) {\n delegators[i].updateTopElement(elm);\n }\n }\n else if (delegators === void 0) {\n self.eventDelegators.set(scope, []);\n }\n }\n if (oldScope && !scope) {\n self.removeScope(scope);\n }\n },\n update: function (oldVNode, vNode) {\n var _a = oldVNode.data, oldData = _a === void 0 ? {} : _a;\n var elm = vNode.elm, _b = vNode.data, data = _b === void 0 ? {} : _b;\n var oldScope = oldData.isolate || \"\";\n var scope = data.isolate || \"\";\n if (scope && scope !== oldScope) {\n if (oldScope) {\n self.removeScope(oldScope);\n }\n self.setScope(elm, scope);\n }\n if (oldScope && !scope) {\n self.removeScope(scope);\n }\n },\n remove: function (_a, cb) {\n var data = _a.data;\n data = data || {};\n var scope = data.isolate;\n if (scope) {\n self.removeScope(scope);\n if (self.eventDelegators.get(scope)) {\n self.eventDelegators.set(scope, []);\n }\n }\n cb();\n },\n destroy: function (_a) {\n var data = _a.data;\n data = data || {};\n var scope = data.isolate;\n if (scope) {\n self.removeScope(scope);\n if (self.eventDelegators.get(scope)) {\n self.eventDelegators.set(scope, []);\n }\n }\n }\n };\n };\n return IsolateModule;\n}());\nexports.IsolateModule = IsolateModule;\n//# sourceMappingURL=isolateModule.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/isolateModule.js\n ** module id = 38\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = require('./is-implemented')() ? Map : require('./polyfill');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/index.js\n ** module id = 39\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function () {\n\tvar map, iterator, result;\n\tif (typeof Map !== 'function') return false;\n\ttry {\n\t\t// WebKit doesn't support arguments and crashes\n\t\tmap = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]);\n\t} catch (e) {\n\t\treturn false;\n\t}\n\tif (String(map) !== '[object Map]') return false;\n\tif (map.size !== 3) return false;\n\tif (typeof map.clear !== 'function') return false;\n\tif (typeof map.delete !== 'function') return false;\n\tif (typeof map.entries !== 'function') return false;\n\tif (typeof map.forEach !== 'function') return false;\n\tif (typeof map.get !== 'function') return false;\n\tif (typeof map.has !== 'function') return false;\n\tif (typeof map.keys !== 'function') return false;\n\tif (typeof map.set !== 'function') return false;\n\tif (typeof map.values !== 'function') return false;\n\n\titerator = map.entries();\n\tresult = iterator.next();\n\tif (result.done !== false) return false;\n\tif (!result.value) return false;\n\tif (result.value[0] !== 'raz') return false;\n\tif (result.value[1] !== 'one') return false;\n\n\treturn true;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/is-implemented.js\n ** module id = 40\n ** module chunks = 0\n **/","'use strict';\n\nvar clear = require('es5-ext/array/#/clear')\n , eIndexOf = require('es5-ext/array/#/e-index-of')\n , setPrototypeOf = require('es5-ext/object/set-prototype-of')\n , callable = require('es5-ext/object/valid-callable')\n , validValue = require('es5-ext/object/valid-value')\n , d = require('d')\n , ee = require('event-emitter')\n , Symbol = require('es6-symbol')\n , iterator = require('es6-iterator/valid-iterable')\n , forOf = require('es6-iterator/for-of')\n , Iterator = require('./lib/iterator')\n , isNative = require('./is-native-implemented')\n\n , call = Function.prototype.call\n , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf\n , MapPoly;\n\nmodule.exports = MapPoly = function (/*iterable*/) {\n\tvar iterable = arguments[0], keys, values, self;\n\tif (!(this instanceof MapPoly)) throw new TypeError('Constructor requires \\'new\\'');\n\tif (isNative && setPrototypeOf && (Map !== MapPoly)) {\n\t\tself = setPrototypeOf(new Map(), getPrototypeOf(this));\n\t} else {\n\t\tself = this;\n\t}\n\tif (iterable != null) iterator(iterable);\n\tdefineProperties(self, {\n\t\t__mapKeysData__: d('c', keys = []),\n\t\t__mapValuesData__: d('c', values = [])\n\t});\n\tif (!iterable) return self;\n\tforOf(iterable, function (value) {\n\t\tvar key = validValue(value)[0];\n\t\tvalue = value[1];\n\t\tif (eIndexOf.call(keys, key) !== -1) return;\n\t\tkeys.push(key);\n\t\tvalues.push(value);\n\t}, self);\n\treturn self;\n};\n\nif (isNative) {\n\tif (setPrototypeOf) setPrototypeOf(MapPoly, Map);\n\tMapPoly.prototype = Object.create(Map.prototype, {\n\t\tconstructor: d(MapPoly)\n\t});\n}\n\nee(defineProperties(MapPoly.prototype, {\n\tclear: d(function () {\n\t\tif (!this.__mapKeysData__.length) return;\n\t\tclear.call(this.__mapKeysData__);\n\t\tclear.call(this.__mapValuesData__);\n\t\tthis.emit('_clear');\n\t}),\n\tdelete: d(function (key) {\n\t\tvar index = eIndexOf.call(this.__mapKeysData__, key);\n\t\tif (index === -1) return false;\n\t\tthis.__mapKeysData__.splice(index, 1);\n\t\tthis.__mapValuesData__.splice(index, 1);\n\t\tthis.emit('_delete', index, key);\n\t\treturn true;\n\t}),\n\tentries: d(function () { return new Iterator(this, 'key+value'); }),\n\tforEach: d(function (cb/*, thisArg*/) {\n\t\tvar thisArg = arguments[1], iterator, result;\n\t\tcallable(cb);\n\t\titerator = this.entries();\n\t\tresult = iterator._next();\n\t\twhile (result !== undefined) {\n\t\t\tcall.call(cb, thisArg, this.__mapValuesData__[result],\n\t\t\t\tthis.__mapKeysData__[result], this);\n\t\t\tresult = iterator._next();\n\t\t}\n\t}),\n\tget: d(function (key) {\n\t\tvar index = eIndexOf.call(this.__mapKeysData__, key);\n\t\tif (index === -1) return;\n\t\treturn this.__mapValuesData__[index];\n\t}),\n\thas: d(function (key) {\n\t\treturn (eIndexOf.call(this.__mapKeysData__, key) !== -1);\n\t}),\n\tkeys: d(function () { return new Iterator(this, 'key'); }),\n\tset: d(function (key, value) {\n\t\tvar index = eIndexOf.call(this.__mapKeysData__, key), emit;\n\t\tif (index === -1) {\n\t\t\tindex = this.__mapKeysData__.push(key) - 1;\n\t\t\temit = true;\n\t\t}\n\t\tthis.__mapValuesData__[index] = value;\n\t\tif (emit) this.emit('_add', index, key);\n\t\treturn this;\n\t}),\n\tsize: d.gs(function () { return this.__mapKeysData__.length; }),\n\tvalues: d(function () { return new Iterator(this, 'value'); }),\n\ttoString: d(function () { return '[object Map]'; })\n}));\nObject.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () {\n\treturn this.entries();\n}));\nObject.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map'));\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/polyfill.js\n ** module id = 41\n ** module chunks = 0\n **/","// Inspired by Google Closure:\n// http://closure-library.googlecode.com/svn/docs/\n// closure_goog_array_array.js.html#goog.array.clear\n\n'use strict';\n\nvar value = require('../../object/valid-value');\n\nmodule.exports = function () {\n\tvalue(this).length = 0;\n\treturn this;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/array/#/clear.js\n ** module id = 42\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function (value) {\n\tif (value == null) throw new TypeError(\"Cannot use null or undefined\");\n\treturn value;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/valid-value.js\n ** module id = 43\n ** module chunks = 0\n **/","'use strict';\n\nvar toPosInt = require('../../number/to-pos-integer')\n , value = require('../../object/valid-value')\n\n , indexOf = Array.prototype.indexOf\n , hasOwnProperty = Object.prototype.hasOwnProperty\n , abs = Math.abs, floor = Math.floor;\n\nmodule.exports = function (searchElement/*, fromIndex*/) {\n\tvar i, l, fromIndex, val;\n\tif (searchElement === searchElement) { //jslint: ignore\n\t\treturn indexOf.apply(this, arguments);\n\t}\n\n\tl = toPosInt(value(this).length);\n\tfromIndex = arguments[1];\n\tif (isNaN(fromIndex)) fromIndex = 0;\n\telse if (fromIndex >= 0) fromIndex = floor(fromIndex);\n\telse fromIndex = toPosInt(this.length) - floor(abs(fromIndex));\n\n\tfor (i = fromIndex; i < l; ++i) {\n\t\tif (hasOwnProperty.call(this, i)) {\n\t\t\tval = this[i];\n\t\t\tif (val !== val) return i; //jslint: ignore\n\t\t}\n\t}\n\treturn -1;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/array/#/e-index-of.js\n ** module id = 44\n ** module chunks = 0\n **/","'use strict';\n\nvar toInteger = require('./to-integer')\n\n , max = Math.max;\n\nmodule.exports = function (value) { return max(0, toInteger(value)); };\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/number/to-pos-integer.js\n ** module id = 45\n ** module chunks = 0\n **/","'use strict';\n\nvar sign = require('../math/sign')\n\n , abs = Math.abs, floor = Math.floor;\n\nmodule.exports = function (value) {\n\tif (isNaN(value)) return 0;\n\tvalue = Number(value);\n\tif ((value === 0) || !isFinite(value)) return value;\n\treturn sign(value) * floor(abs(value));\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/number/to-integer.js\n ** module id = 46\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = require('./is-implemented')()\n\t? Math.sign\n\t: require('./shim');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/math/sign/index.js\n ** module id = 47\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function () {\n\tvar sign = Math.sign;\n\tif (typeof sign !== 'function') return false;\n\treturn ((sign(10) === 1) && (sign(-20) === -1));\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/math/sign/is-implemented.js\n ** module id = 48\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function (value) {\n\tvalue = Number(value);\n\tif (isNaN(value) || (value === 0)) return value;\n\treturn (value > 0) ? 1 : -1;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/math/sign/shim.js\n ** module id = 49\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = require('./is-implemented')()\n\t? Object.setPrototypeOf\n\t: require('./shim');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/set-prototype-of/index.js\n ** module id = 50\n ** module chunks = 0\n **/","'use strict';\n\nvar create = Object.create, getPrototypeOf = Object.getPrototypeOf\n , x = {};\n\nmodule.exports = function (/*customCreate*/) {\n\tvar setPrototypeOf = Object.setPrototypeOf\n\t , customCreate = arguments[0] || create;\n\tif (typeof setPrototypeOf !== 'function') return false;\n\treturn getPrototypeOf(setPrototypeOf(customCreate(null), x)) === x;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/set-prototype-of/is-implemented.js\n ** module id = 51\n ** module chunks = 0\n **/","// Big thanks to @WebReflection for sorting this out\n// https://gist.github.com/WebReflection/5593554\n\n'use strict';\n\nvar isObject = require('../is-object')\n , value = require('../valid-value')\n\n , isPrototypeOf = Object.prototype.isPrototypeOf\n , defineProperty = Object.defineProperty\n , nullDesc = { configurable: true, enumerable: false, writable: true,\n\t\tvalue: undefined }\n , validate;\n\nvalidate = function (obj, prototype) {\n\tvalue(obj);\n\tif ((prototype === null) || isObject(prototype)) return obj;\n\tthrow new TypeError('Prototype must be null or an object');\n};\n\nmodule.exports = (function (status) {\n\tvar fn, set;\n\tif (!status) return null;\n\tif (status.level === 2) {\n\t\tif (status.set) {\n\t\t\tset = status.set;\n\t\t\tfn = function (obj, prototype) {\n\t\t\t\tset.call(validate(obj, prototype), prototype);\n\t\t\t\treturn obj;\n\t\t\t};\n\t\t} else {\n\t\t\tfn = function (obj, prototype) {\n\t\t\t\tvalidate(obj, prototype).__proto__ = prototype;\n\t\t\t\treturn obj;\n\t\t\t};\n\t\t}\n\t} else {\n\t\tfn = function self(obj, prototype) {\n\t\t\tvar isNullBase;\n\t\t\tvalidate(obj, prototype);\n\t\t\tisNullBase = isPrototypeOf.call(self.nullPolyfill, obj);\n\t\t\tif (isNullBase) delete self.nullPolyfill.__proto__;\n\t\t\tif (prototype === null) prototype = self.nullPolyfill;\n\t\t\tobj.__proto__ = prototype;\n\t\t\tif (isNullBase) defineProperty(self.nullPolyfill, '__proto__', nullDesc);\n\t\t\treturn obj;\n\t\t};\n\t}\n\treturn Object.defineProperty(fn, 'level', { configurable: false,\n\t\tenumerable: false, writable: false, value: status.level });\n}((function () {\n\tvar x = Object.create(null), y = {}, set\n\t , desc = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__');\n\n\tif (desc) {\n\t\ttry {\n\t\t\tset = desc.set; // Opera crashes at this point\n\t\t\tset.call(x, y);\n\t\t} catch (ignore) { }\n\t\tif (Object.getPrototypeOf(x) === y) return { set: set, level: 2 };\n\t}\n\n\tx.__proto__ = y;\n\tif (Object.getPrototypeOf(x) === y) return { level: 2 };\n\n\tx = {};\n\tx.__proto__ = y;\n\tif (Object.getPrototypeOf(x) === y) return { level: 1 };\n\n\treturn false;\n}())));\n\nrequire('../create');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/set-prototype-of/shim.js\n ** module id = 52\n ** module chunks = 0\n **/","'use strict';\n\nvar map = { function: true, object: true };\n\nmodule.exports = function (x) {\n\treturn ((x != null) && map[typeof x]) || false;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/is-object.js\n ** module id = 53\n ** module chunks = 0\n **/","// Workaround for http://code.google.com/p/v8/issues/detail?id=2804\n\n'use strict';\n\nvar create = Object.create, shim;\n\nif (!require('./set-prototype-of/is-implemented')()) {\n\tshim = require('./set-prototype-of/shim');\n}\n\nmodule.exports = (function () {\n\tvar nullObject, props, desc;\n\tif (!shim) return create;\n\tif (shim.level !== 1) return create;\n\n\tnullObject = {};\n\tprops = {};\n\tdesc = { configurable: false, enumerable: false, writable: true,\n\t\tvalue: undefined };\n\tObject.getOwnPropertyNames(Object.prototype).forEach(function (name) {\n\t\tif (name === '__proto__') {\n\t\t\tprops[name] = { configurable: true, enumerable: false, writable: true,\n\t\t\t\tvalue: undefined };\n\t\t\treturn;\n\t\t}\n\t\tprops[name] = desc;\n\t});\n\tObject.defineProperties(nullObject, props);\n\n\tObject.defineProperty(shim, 'nullPolyfill', { configurable: false,\n\t\tenumerable: false, writable: false, value: nullObject });\n\n\treturn function (prototype, props) {\n\t\treturn create((prototype === null) ? nullObject : prototype, props);\n\t};\n}());\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/create.js\n ** module id = 54\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function (fn) {\n\tif (typeof fn !== 'function') throw new TypeError(fn + \" is not a function\");\n\treturn fn;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/valid-callable.js\n ** module id = 55\n ** module chunks = 0\n **/","'use strict';\n\nvar assign = require('es5-ext/object/assign')\n , normalizeOpts = require('es5-ext/object/normalize-options')\n , isCallable = require('es5-ext/object/is-callable')\n , contains = require('es5-ext/string/#/contains')\n\n , d;\n\nd = module.exports = function (dscr, value/*, options*/) {\n\tvar c, e, w, options, desc;\n\tif ((arguments.length < 2) || (typeof dscr !== 'string')) {\n\t\toptions = value;\n\t\tvalue = dscr;\n\t\tdscr = null;\n\t} else {\n\t\toptions = arguments[2];\n\t}\n\tif (dscr == null) {\n\t\tc = w = true;\n\t\te = false;\n\t} else {\n\t\tc = contains.call(dscr, 'c');\n\t\te = contains.call(dscr, 'e');\n\t\tw = contains.call(dscr, 'w');\n\t}\n\n\tdesc = { value: value, configurable: c, enumerable: e, writable: w };\n\treturn !options ? desc : assign(normalizeOpts(options), desc);\n};\n\nd.gs = function (dscr, get, set/*, options*/) {\n\tvar c, e, options, desc;\n\tif (typeof dscr !== 'string') {\n\t\toptions = set;\n\t\tset = get;\n\t\tget = dscr;\n\t\tdscr = null;\n\t} else {\n\t\toptions = arguments[3];\n\t}\n\tif (get == null) {\n\t\tget = undefined;\n\t} else if (!isCallable(get)) {\n\t\toptions = get;\n\t\tget = set = undefined;\n\t} else if (set == null) {\n\t\tset = undefined;\n\t} else if (!isCallable(set)) {\n\t\toptions = set;\n\t\tset = undefined;\n\t}\n\tif (dscr == null) {\n\t\tc = true;\n\t\te = false;\n\t} else {\n\t\tc = contains.call(dscr, 'c');\n\t\te = contains.call(dscr, 'e');\n\t}\n\n\tdesc = { get: get, set: set, configurable: c, enumerable: e };\n\treturn !options ? desc : assign(normalizeOpts(options), desc);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/d/index.js\n ** module id = 56\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = require('./is-implemented')()\n\t? Object.assign\n\t: require('./shim');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/assign/index.js\n ** module id = 57\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function () {\n\tvar assign = Object.assign, obj;\n\tif (typeof assign !== 'function') return false;\n\tobj = { foo: 'raz' };\n\tassign(obj, { bar: 'dwa' }, { trzy: 'trzy' });\n\treturn (obj.foo + obj.bar + obj.trzy) === 'razdwatrzy';\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/assign/is-implemented.js\n ** module id = 58\n ** module chunks = 0\n **/","'use strict';\n\nvar keys = require('../keys')\n , value = require('../valid-value')\n\n , max = Math.max;\n\nmodule.exports = function (dest, src/*, …srcn*/) {\n\tvar error, i, l = max(arguments.length, 2), assign;\n\tdest = Object(value(dest));\n\tassign = function (key) {\n\t\ttry { dest[key] = src[key]; } catch (e) {\n\t\t\tif (!error) error = e;\n\t\t}\n\t};\n\tfor (i = 1; i < l; ++i) {\n\t\tsrc = arguments[i];\n\t\tkeys(src).forEach(assign);\n\t}\n\tif (error !== undefined) throw error;\n\treturn dest;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/assign/shim.js\n ** module id = 59\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = require('./is-implemented')()\n\t? Object.keys\n\t: require('./shim');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/keys/index.js\n ** module id = 60\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function () {\n\ttry {\n\t\tObject.keys('primitive');\n\t\treturn true;\n\t} catch (e) { return false; }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/keys/is-implemented.js\n ** module id = 61\n ** module chunks = 0\n **/","'use strict';\n\nvar keys = Object.keys;\n\nmodule.exports = function (object) {\n\treturn keys(object == null ? object : Object(object));\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/keys/shim.js\n ** module id = 62\n ** module chunks = 0\n **/","'use strict';\n\nvar forEach = Array.prototype.forEach, create = Object.create;\n\nvar process = function (src, obj) {\n\tvar key;\n\tfor (key in src) obj[key] = src[key];\n};\n\nmodule.exports = function (options/*, …options*/) {\n\tvar result = create(null);\n\tforEach.call(arguments, function (options) {\n\t\tif (options == null) return;\n\t\tprocess(Object(options), result);\n\t});\n\treturn result;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/normalize-options.js\n ** module id = 63\n ** module chunks = 0\n **/","// Deprecated\n\n'use strict';\n\nmodule.exports = function (obj) { return typeof obj === 'function'; };\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/is-callable.js\n ** module id = 64\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = require('./is-implemented')()\n\t? String.prototype.contains\n\t: require('./shim');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/string/#/contains/index.js\n ** module id = 65\n ** module chunks = 0\n **/","'use strict';\n\nvar str = 'razdwatrzy';\n\nmodule.exports = function () {\n\tif (typeof str.contains !== 'function') return false;\n\treturn ((str.contains('dwa') === true) && (str.contains('foo') === false));\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/string/#/contains/is-implemented.js\n ** module id = 66\n ** module chunks = 0\n **/","'use strict';\n\nvar indexOf = String.prototype.indexOf;\n\nmodule.exports = function (searchString/*, position*/) {\n\treturn indexOf.call(this, searchString, arguments[1]) > -1;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/string/#/contains/shim.js\n ** module id = 67\n ** module chunks = 0\n **/","'use strict';\n\nvar d = require('d')\n , callable = require('es5-ext/object/valid-callable')\n\n , apply = Function.prototype.apply, call = Function.prototype.call\n , create = Object.create, defineProperty = Object.defineProperty\n , defineProperties = Object.defineProperties\n , hasOwnProperty = Object.prototype.hasOwnProperty\n , descriptor = { configurable: true, enumerable: false, writable: true }\n\n , on, once, off, emit, methods, descriptors, base;\n\non = function (type, listener) {\n\tvar data;\n\n\tcallable(listener);\n\n\tif (!hasOwnProperty.call(this, '__ee__')) {\n\t\tdata = descriptor.value = create(null);\n\t\tdefineProperty(this, '__ee__', descriptor);\n\t\tdescriptor.value = null;\n\t} else {\n\t\tdata = this.__ee__;\n\t}\n\tif (!data[type]) data[type] = listener;\n\telse if (typeof data[type] === 'object') data[type].push(listener);\n\telse data[type] = [data[type], listener];\n\n\treturn this;\n};\n\nonce = function (type, listener) {\n\tvar once, self;\n\n\tcallable(listener);\n\tself = this;\n\ton.call(this, type, once = function () {\n\t\toff.call(self, type, once);\n\t\tapply.call(listener, this, arguments);\n\t});\n\n\tonce.__eeOnceListener__ = listener;\n\treturn this;\n};\n\noff = function (type, listener) {\n\tvar data, listeners, candidate, i;\n\n\tcallable(listener);\n\n\tif (!hasOwnProperty.call(this, '__ee__')) return this;\n\tdata = this.__ee__;\n\tif (!data[type]) return this;\n\tlisteners = data[type];\n\n\tif (typeof listeners === 'object') {\n\t\tfor (i = 0; (candidate = listeners[i]); ++i) {\n\t\t\tif ((candidate === listener) ||\n\t\t\t\t\t(candidate.__eeOnceListener__ === listener)) {\n\t\t\t\tif (listeners.length === 2) data[type] = listeners[i ? 0 : 1];\n\t\t\t\telse listeners.splice(i, 1);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ((listeners === listener) ||\n\t\t\t\t(listeners.__eeOnceListener__ === listener)) {\n\t\t\tdelete data[type];\n\t\t}\n\t}\n\n\treturn this;\n};\n\nemit = function (type) {\n\tvar i, l, listener, listeners, args;\n\n\tif (!hasOwnProperty.call(this, '__ee__')) return;\n\tlisteners = this.__ee__[type];\n\tif (!listeners) return;\n\n\tif (typeof listeners === 'object') {\n\t\tl = arguments.length;\n\t\targs = new Array(l - 1);\n\t\tfor (i = 1; i < l; ++i) args[i - 1] = arguments[i];\n\n\t\tlisteners = listeners.slice();\n\t\tfor (i = 0; (listener = listeners[i]); ++i) {\n\t\t\tapply.call(listener, this, args);\n\t\t}\n\t} else {\n\t\tswitch (arguments.length) {\n\t\tcase 1:\n\t\t\tcall.call(listeners, this);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcall.call(listeners, this, arguments[1]);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tcall.call(listeners, this, arguments[1], arguments[2]);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tl = arguments.length;\n\t\t\targs = new Array(l - 1);\n\t\t\tfor (i = 1; i < l; ++i) {\n\t\t\t\targs[i - 1] = arguments[i];\n\t\t\t}\n\t\t\tapply.call(listeners, this, args);\n\t\t}\n\t}\n};\n\nmethods = {\n\ton: on,\n\tonce: once,\n\toff: off,\n\temit: emit\n};\n\ndescriptors = {\n\ton: d(on),\n\tonce: d(once),\n\toff: d(off),\n\temit: d(emit)\n};\n\nbase = defineProperties({}, descriptors);\n\nmodule.exports = exports = function (o) {\n\treturn (o == null) ? create(base) : defineProperties(Object(o), descriptors);\n};\nexports.methods = methods;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/event-emitter/index.js\n ** module id = 68\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = require('./is-implemented')() ? Symbol : require('./polyfill');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-symbol/index.js\n ** module id = 69\n ** module chunks = 0\n **/","'use strict';\n\nvar validTypes = { object: true, symbol: true };\n\nmodule.exports = function () {\n\tvar symbol;\n\tif (typeof Symbol !== 'function') return false;\n\tsymbol = Symbol('test symbol');\n\ttry { String(symbol); } catch (e) { return false; }\n\n\t// Return 'true' also for polyfills\n\tif (!validTypes[typeof Symbol.iterator]) return false;\n\tif (!validTypes[typeof Symbol.toPrimitive]) return false;\n\tif (!validTypes[typeof Symbol.toStringTag]) return false;\n\n\treturn true;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-symbol/is-implemented.js\n ** module id = 70\n ** module chunks = 0\n **/","// ES2015 Symbol polyfill for environments that do not support it (or partially support it)\n\n'use strict';\n\nvar d = require('d')\n , validateSymbol = require('./validate-symbol')\n\n , create = Object.create, defineProperties = Object.defineProperties\n , defineProperty = Object.defineProperty, objPrototype = Object.prototype\n , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null)\n , isNativeSafe;\n\nif (typeof Symbol === 'function') {\n\tNativeSymbol = Symbol;\n\ttry {\n\t\tString(NativeSymbol());\n\t\tisNativeSafe = true;\n\t} catch (ignore) {}\n}\n\nvar generateName = (function () {\n\tvar created = create(null);\n\treturn function (desc) {\n\t\tvar postfix = 0, name, ie11BugWorkaround;\n\t\twhile (created[desc + (postfix || '')]) ++postfix;\n\t\tdesc += (postfix || '');\n\t\tcreated[desc] = true;\n\t\tname = '@@' + desc;\n\t\tdefineProperty(objPrototype, name, d.gs(null, function (value) {\n\t\t\t// For IE11 issue see:\n\t\t\t// https://connect.microsoft.com/IE/feedbackdetail/view/1928508/\n\t\t\t// ie11-broken-getters-on-dom-objects\n\t\t\t// https://github.com/medikoo/es6-symbol/issues/12\n\t\t\tif (ie11BugWorkaround) return;\n\t\t\tie11BugWorkaround = true;\n\t\t\tdefineProperty(this, name, d(value));\n\t\t\tie11BugWorkaround = false;\n\t\t}));\n\t\treturn name;\n\t};\n}());\n\n// Internal constructor (not one exposed) for creating Symbol instances.\n// This one is used to ensure that `someSymbol instanceof Symbol` always return false\nHiddenSymbol = function Symbol(description) {\n\tif (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor');\n\treturn SymbolPolyfill(description);\n};\n\n// Exposed `Symbol` constructor\n// (returns instances of HiddenSymbol)\nmodule.exports = SymbolPolyfill = function Symbol(description) {\n\tvar symbol;\n\tif (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor');\n\tif (isNativeSafe) return NativeSymbol(description);\n\tsymbol = create(HiddenSymbol.prototype);\n\tdescription = (description === undefined ? '' : String(description));\n\treturn defineProperties(symbol, {\n\t\t__description__: d('', description),\n\t\t__name__: d('', generateName(description))\n\t});\n};\ndefineProperties(SymbolPolyfill, {\n\tfor: d(function (key) {\n\t\tif (globalSymbols[key]) return globalSymbols[key];\n\t\treturn (globalSymbols[key] = SymbolPolyfill(String(key)));\n\t}),\n\tkeyFor: d(function (s) {\n\t\tvar key;\n\t\tvalidateSymbol(s);\n\t\tfor (key in globalSymbols) if (globalSymbols[key] === s) return key;\n\t}),\n\n\t// If there's native implementation of given symbol, let's fallback to it\n\t// to ensure proper interoperability with other native functions e.g. Array.from\n\thasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')),\n\tisConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) ||\n\t\tSymbolPolyfill('isConcatSpreadable')),\n\titerator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')),\n\tmatch: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')),\n\treplace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')),\n\tsearch: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')),\n\tspecies: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')),\n\tsplit: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')),\n\ttoPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')),\n\ttoStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')),\n\tunscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables'))\n});\n\n// Internal tweaks for real symbol producer\ndefineProperties(HiddenSymbol.prototype, {\n\tconstructor: d(SymbolPolyfill),\n\ttoString: d('', function () { return this.__name__; })\n});\n\n// Proper implementation of methods exposed on Symbol.prototype\n// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype\ndefineProperties(SymbolPolyfill.prototype, {\n\ttoString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }),\n\tvalueOf: d(function () { return validateSymbol(this); })\n});\ndefineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () {\n\tvar symbol = validateSymbol(this);\n\tif (typeof symbol === 'symbol') return symbol;\n\treturn symbol.toString();\n}));\ndefineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol'));\n\n// Proper implementaton of toPrimitive and toStringTag for returned symbol instances\ndefineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag,\n\td('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));\n\n// Note: It's important to define `toPrimitive` as last one, as some implementations\n// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols)\n// And that may invoke error in definition flow:\n// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149\ndefineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive,\n\td('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]));\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-symbol/polyfill.js\n ** module id = 71\n ** module chunks = 0\n **/","'use strict';\n\nvar isSymbol = require('./is-symbol');\n\nmodule.exports = function (value) {\n\tif (!isSymbol(value)) throw new TypeError(value + \" is not a symbol\");\n\treturn value;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-symbol/validate-symbol.js\n ** module id = 72\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function (x) {\n\tif (!x) return false;\n\tif (typeof x === 'symbol') return true;\n\tif (!x.constructor) return false;\n\tif (x.constructor.name !== 'Symbol') return false;\n\treturn (x[x.constructor.toStringTag] === 'Symbol');\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-symbol/is-symbol.js\n ** module id = 73\n ** module chunks = 0\n **/","'use strict';\n\nvar isIterable = require('./is-iterable');\n\nmodule.exports = function (value) {\n\tif (!isIterable(value)) throw new TypeError(value + \" is not iterable\");\n\treturn value;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-iterator/valid-iterable.js\n ** module id = 74\n ** module chunks = 0\n **/","'use strict';\n\nvar isArguments = require('es5-ext/function/is-arguments')\n , isString = require('es5-ext/string/is-string')\n , iteratorSymbol = require('es6-symbol').iterator\n\n , isArray = Array.isArray;\n\nmodule.exports = function (value) {\n\tif (value == null) return false;\n\tif (isArray(value)) return true;\n\tif (isString(value)) return true;\n\tif (isArguments(value)) return true;\n\treturn (typeof value[iteratorSymbol] === 'function');\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-iterator/is-iterable.js\n ** module id = 75\n ** module chunks = 0\n **/","'use strict';\n\nvar toString = Object.prototype.toString\n\n , id = toString.call((function () { return arguments; }()));\n\nmodule.exports = function (x) { return (toString.call(x) === id); };\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/function/is-arguments.js\n ** module id = 76\n ** module chunks = 0\n **/","'use strict';\n\nvar toString = Object.prototype.toString\n\n , id = toString.call('');\n\nmodule.exports = function (x) {\n\treturn (typeof x === 'string') || (x && (typeof x === 'object') &&\n\t\t((x instanceof String) || (toString.call(x) === id))) || false;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/string/is-string.js\n ** module id = 77\n ** module chunks = 0\n **/","'use strict';\n\nvar isArguments = require('es5-ext/function/is-arguments')\n , callable = require('es5-ext/object/valid-callable')\n , isString = require('es5-ext/string/is-string')\n , get = require('./get')\n\n , isArray = Array.isArray, call = Function.prototype.call\n , some = Array.prototype.some;\n\nmodule.exports = function (iterable, cb/*, thisArg*/) {\n\tvar mode, thisArg = arguments[2], result, doBreak, broken, i, l, char, code;\n\tif (isArray(iterable) || isArguments(iterable)) mode = 'array';\n\telse if (isString(iterable)) mode = 'string';\n\telse iterable = get(iterable);\n\n\tcallable(cb);\n\tdoBreak = function () { broken = true; };\n\tif (mode === 'array') {\n\t\tsome.call(iterable, function (value) {\n\t\t\tcall.call(cb, thisArg, value, doBreak);\n\t\t\tif (broken) return true;\n\t\t});\n\t\treturn;\n\t}\n\tif (mode === 'string') {\n\t\tl = iterable.length;\n\t\tfor (i = 0; i < l; ++i) {\n\t\t\tchar = iterable[i];\n\t\t\tif ((i + 1) < l) {\n\t\t\t\tcode = char.charCodeAt(0);\n\t\t\t\tif ((code >= 0xD800) && (code <= 0xDBFF)) char += iterable[++i];\n\t\t\t}\n\t\t\tcall.call(cb, thisArg, char, doBreak);\n\t\t\tif (broken) break;\n\t\t}\n\t\treturn;\n\t}\n\tresult = iterable.next();\n\n\twhile (!result.done) {\n\t\tcall.call(cb, thisArg, result.value, doBreak);\n\t\tif (broken) return;\n\t\tresult = iterable.next();\n\t}\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-iterator/for-of.js\n ** module id = 78\n ** module chunks = 0\n **/","'use strict';\n\nvar isArguments = require('es5-ext/function/is-arguments')\n , isString = require('es5-ext/string/is-string')\n , ArrayIterator = require('./array')\n , StringIterator = require('./string')\n , iterable = require('./valid-iterable')\n , iteratorSymbol = require('es6-symbol').iterator;\n\nmodule.exports = function (obj) {\n\tif (typeof iterable(obj)[iteratorSymbol] === 'function') return obj[iteratorSymbol]();\n\tif (isArguments(obj)) return new ArrayIterator(obj);\n\tif (isString(obj)) return new StringIterator(obj);\n\treturn new ArrayIterator(obj);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-iterator/get.js\n ** module id = 79\n ** module chunks = 0\n **/","'use strict';\n\nvar setPrototypeOf = require('es5-ext/object/set-prototype-of')\n , contains = require('es5-ext/string/#/contains')\n , d = require('d')\n , Iterator = require('./')\n\n , defineProperty = Object.defineProperty\n , ArrayIterator;\n\nArrayIterator = module.exports = function (arr, kind) {\n\tif (!(this instanceof ArrayIterator)) return new ArrayIterator(arr, kind);\n\tIterator.call(this, arr);\n\tif (!kind) kind = 'value';\n\telse if (contains.call(kind, 'key+value')) kind = 'key+value';\n\telse if (contains.call(kind, 'key')) kind = 'key';\n\telse kind = 'value';\n\tdefineProperty(this, '__kind__', d('', kind));\n};\nif (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator);\n\nArrayIterator.prototype = Object.create(Iterator.prototype, {\n\tconstructor: d(ArrayIterator),\n\t_resolve: d(function (i) {\n\t\tif (this.__kind__ === 'value') return this.__list__[i];\n\t\tif (this.__kind__ === 'key+value') return [i, this.__list__[i]];\n\t\treturn i;\n\t}),\n\ttoString: d(function () { return '[object Array Iterator]'; })\n});\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-iterator/array.js\n ** module id = 80\n ** module chunks = 0\n **/","'use strict';\n\nvar clear = require('es5-ext/array/#/clear')\n , assign = require('es5-ext/object/assign')\n , callable = require('es5-ext/object/valid-callable')\n , value = require('es5-ext/object/valid-value')\n , d = require('d')\n , autoBind = require('d/auto-bind')\n , Symbol = require('es6-symbol')\n\n , defineProperty = Object.defineProperty\n , defineProperties = Object.defineProperties\n , Iterator;\n\nmodule.exports = Iterator = function (list, context) {\n\tif (!(this instanceof Iterator)) return new Iterator(list, context);\n\tdefineProperties(this, {\n\t\t__list__: d('w', value(list)),\n\t\t__context__: d('w', context),\n\t\t__nextIndex__: d('w', 0)\n\t});\n\tif (!context) return;\n\tcallable(context.on);\n\tcontext.on('_add', this._onAdd);\n\tcontext.on('_delete', this._onDelete);\n\tcontext.on('_clear', this._onClear);\n};\n\ndefineProperties(Iterator.prototype, assign({\n\tconstructor: d(Iterator),\n\t_next: d(function () {\n\t\tvar i;\n\t\tif (!this.__list__) return;\n\t\tif (this.__redo__) {\n\t\t\ti = this.__redo__.shift();\n\t\t\tif (i !== undefined) return i;\n\t\t}\n\t\tif (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++;\n\t\tthis._unBind();\n\t}),\n\tnext: d(function () { return this._createResult(this._next()); }),\n\t_createResult: d(function (i) {\n\t\tif (i === undefined) return { done: true, value: undefined };\n\t\treturn { done: false, value: this._resolve(i) };\n\t}),\n\t_resolve: d(function (i) { return this.__list__[i]; }),\n\t_unBind: d(function () {\n\t\tthis.__list__ = null;\n\t\tdelete this.__redo__;\n\t\tif (!this.__context__) return;\n\t\tthis.__context__.off('_add', this._onAdd);\n\t\tthis.__context__.off('_delete', this._onDelete);\n\t\tthis.__context__.off('_clear', this._onClear);\n\t\tthis.__context__ = null;\n\t}),\n\ttoString: d(function () { return '[object Iterator]'; })\n}, autoBind({\n\t_onAdd: d(function (index) {\n\t\tif (index >= this.__nextIndex__) return;\n\t\t++this.__nextIndex__;\n\t\tif (!this.__redo__) {\n\t\t\tdefineProperty(this, '__redo__', d('c', [index]));\n\t\t\treturn;\n\t\t}\n\t\tthis.__redo__.forEach(function (redo, i) {\n\t\t\tif (redo >= index) this.__redo__[i] = ++redo;\n\t\t}, this);\n\t\tthis.__redo__.push(index);\n\t}),\n\t_onDelete: d(function (index) {\n\t\tvar i;\n\t\tif (index >= this.__nextIndex__) return;\n\t\t--this.__nextIndex__;\n\t\tif (!this.__redo__) return;\n\t\ti = this.__redo__.indexOf(index);\n\t\tif (i !== -1) this.__redo__.splice(i, 1);\n\t\tthis.__redo__.forEach(function (redo, i) {\n\t\t\tif (redo > index) this.__redo__[i] = --redo;\n\t\t}, this);\n\t}),\n\t_onClear: d(function () {\n\t\tif (this.__redo__) clear.call(this.__redo__);\n\t\tthis.__nextIndex__ = 0;\n\t})\n})));\n\ndefineProperty(Iterator.prototype, Symbol.iterator, d(function () {\n\treturn this;\n}));\ndefineProperty(Iterator.prototype, Symbol.toStringTag, d('', 'Iterator'));\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-iterator/index.js\n ** module id = 81\n ** module chunks = 0\n **/","'use strict';\n\nvar copy = require('es5-ext/object/copy')\n , map = require('es5-ext/object/map')\n , callable = require('es5-ext/object/valid-callable')\n , validValue = require('es5-ext/object/valid-value')\n\n , bind = Function.prototype.bind, defineProperty = Object.defineProperty\n , hasOwnProperty = Object.prototype.hasOwnProperty\n , define;\n\ndefine = function (name, desc, bindTo) {\n\tvar value = validValue(desc) && callable(desc.value), dgs;\n\tdgs = copy(desc);\n\tdelete dgs.writable;\n\tdelete dgs.value;\n\tdgs.get = function () {\n\t\tif (hasOwnProperty.call(this, name)) return value;\n\t\tdesc.value = bind.call(value, (bindTo == null) ? this : this[bindTo]);\n\t\tdefineProperty(this, name, desc);\n\t\treturn this[name];\n\t};\n\treturn dgs;\n};\n\nmodule.exports = function (props/*, bindTo*/) {\n\tvar bindTo = arguments[1];\n\treturn map(props, function (desc, name) {\n\t\treturn define(name, desc, bindTo);\n\t});\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/d/auto-bind.js\n ** module id = 82\n ** module chunks = 0\n **/","'use strict';\n\nvar assign = require('./assign')\n , value = require('./valid-value');\n\nmodule.exports = function (obj) {\n\tvar copy = Object(value(obj));\n\tif (copy !== obj) return copy;\n\treturn assign({}, obj);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/copy.js\n ** module id = 83\n ** module chunks = 0\n **/","'use strict';\n\nvar callable = require('./valid-callable')\n , forEach = require('./for-each')\n\n , call = Function.prototype.call;\n\nmodule.exports = function (obj, cb/*, thisArg*/) {\n\tvar o = {}, thisArg = arguments[2];\n\tcallable(cb);\n\tforEach(obj, function (value, key, obj, index) {\n\t\to[key] = call.call(cb, thisArg, value, key, obj, index);\n\t});\n\treturn o;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/map.js\n ** module id = 84\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = require('./_iterate')('forEach');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/for-each.js\n ** module id = 85\n ** module chunks = 0\n **/","// Internal method, used by iteration functions.\n// Calls a function for each key-value pair found in object\n// Optionally takes compareFn to iterate object in specific order\n\n'use strict';\n\nvar callable = require('./valid-callable')\n , value = require('./valid-value')\n\n , bind = Function.prototype.bind, call = Function.prototype.call, keys = Object.keys\n , propertyIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nmodule.exports = function (method, defVal) {\n\treturn function (obj, cb/*, thisArg, compareFn*/) {\n\t\tvar list, thisArg = arguments[2], compareFn = arguments[3];\n\t\tobj = Object(value(obj));\n\t\tcallable(cb);\n\n\t\tlist = keys(obj);\n\t\tif (compareFn) {\n\t\t\tlist.sort((typeof compareFn === 'function') ? bind.call(compareFn, obj) : undefined);\n\t\t}\n\t\tif (typeof method !== 'function') method = list[method];\n\t\treturn call.call(method, list, function (key, index) {\n\t\t\tif (!propertyIsEnumerable.call(obj, key)) return defVal;\n\t\t\treturn call.call(cb, thisArg, obj[key], key, obj, index);\n\t\t});\n\t};\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/_iterate.js\n ** module id = 86\n ** module chunks = 0\n **/","// Thanks @mathiasbynens\n// http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols\n\n'use strict';\n\nvar setPrototypeOf = require('es5-ext/object/set-prototype-of')\n , d = require('d')\n , Iterator = require('./')\n\n , defineProperty = Object.defineProperty\n , StringIterator;\n\nStringIterator = module.exports = function (str) {\n\tif (!(this instanceof StringIterator)) return new StringIterator(str);\n\tstr = String(str);\n\tIterator.call(this, str);\n\tdefineProperty(this, '__length__', d('', str.length));\n\n};\nif (setPrototypeOf) setPrototypeOf(StringIterator, Iterator);\n\nStringIterator.prototype = Object.create(Iterator.prototype, {\n\tconstructor: d(StringIterator),\n\t_next: d(function () {\n\t\tif (!this.__list__) return;\n\t\tif (this.__nextIndex__ < this.__length__) return this.__nextIndex__++;\n\t\tthis._unBind();\n\t}),\n\t_resolve: d(function (i) {\n\t\tvar char = this.__list__[i], code;\n\t\tif (this.__nextIndex__ === this.__length__) return char;\n\t\tcode = char.charCodeAt(0);\n\t\tif ((code >= 0xD800) && (code <= 0xDBFF)) return char + this.__list__[this.__nextIndex__++];\n\t\treturn char;\n\t}),\n\ttoString: d(function () { return '[object String Iterator]'; })\n});\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es6-iterator/string.js\n ** module id = 87\n ** module chunks = 0\n **/","'use strict';\n\nvar setPrototypeOf = require('es5-ext/object/set-prototype-of')\n , d = require('d')\n , Iterator = require('es6-iterator')\n , toStringTagSymbol = require('es6-symbol').toStringTag\n , kinds = require('./iterator-kinds')\n\n , defineProperties = Object.defineProperties\n , unBind = Iterator.prototype._unBind\n , MapIterator;\n\nMapIterator = module.exports = function (map, kind) {\n\tif (!(this instanceof MapIterator)) return new MapIterator(map, kind);\n\tIterator.call(this, map.__mapKeysData__, map);\n\tif (!kind || !kinds[kind]) kind = 'key+value';\n\tdefineProperties(this, {\n\t\t__kind__: d('', kind),\n\t\t__values__: d('w', map.__mapValuesData__)\n\t});\n};\nif (setPrototypeOf) setPrototypeOf(MapIterator, Iterator);\n\nMapIterator.prototype = Object.create(Iterator.prototype, {\n\tconstructor: d(MapIterator),\n\t_resolve: d(function (i) {\n\t\tif (this.__kind__ === 'value') return this.__values__[i];\n\t\tif (this.__kind__ === 'key') return this.__list__[i];\n\t\treturn [this.__list__[i], this.__values__[i]];\n\t}),\n\t_unBind: d(function () {\n\t\tthis.__values__ = null;\n\t\tunBind.call(this);\n\t}),\n\ttoString: d(function () { return '[object Map Iterator]'; })\n});\nObject.defineProperty(MapIterator.prototype, toStringTagSymbol,\n\td('c', 'Map Iterator'));\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/lib/iterator.js\n ** module id = 88\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = require('es5-ext/object/primitive-set')('key',\n\t'value', 'key+value');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/lib/iterator-kinds.js\n ** module id = 89\n ** module chunks = 0\n **/","'use strict';\n\nvar forEach = Array.prototype.forEach, create = Object.create;\n\nmodule.exports = function (arg/*, …args*/) {\n\tvar set = create(null);\n\tforEach.call(arguments, function (name) { set[name] = true; });\n\treturn set;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/~/es5-ext/object/primitive-set.js\n ** module id = 90\n ** module chunks = 0\n **/","// Exports true if environment provides native `Map` implementation,\n// whatever that is.\n\n'use strict';\n\nmodule.exports = (function () {\n\tif (typeof Map === 'undefined') return false;\n\treturn (Object.prototype.toString.call(new Map()) === '[object Map]');\n}());\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/es6-map/is-native-implemented.js\n ** module id = 91\n ** module chunks = 0\n **/","\"use strict\";\nvar xstream_adapter_1 = require('@cycle/xstream-adapter');\nvar xstream_1 = require('xstream');\nfunction createVTree(vnode, children) {\n return {\n sel: vnode.sel,\n data: vnode.data,\n text: vnode.text,\n elm: vnode.elm,\n key: vnode.key,\n children: children,\n };\n}\nfunction makeTransposeVNode(runStreamAdapter) {\n return function transposeVNode(vnode) {\n if (!vnode) {\n return null;\n }\n else if (vnode && typeof vnode.data === \"object\" && vnode.data.static) {\n return xstream_1.default.of(vnode);\n }\n else if (runStreamAdapter.isValidStream(vnode)) {\n var xsStream = xstream_adapter_1.default.adapt(vnode, runStreamAdapter.streamSubscribe);\n return xsStream.map(transposeVNode).flatten();\n }\n else if (typeof vnode === \"object\") {\n if (!vnode.children || vnode.children.length === 0) {\n return xstream_1.default.of(vnode);\n }\n var vnodeChildren = vnode.children\n .map(transposeVNode)\n .filter(function (x) { return x !== null; });\n if (vnodeChildren.length === 0) {\n return xstream_1.default.of(createVTree(vnode, []));\n }\n else {\n return xstream_1.default.combine.apply(xstream_1.default, vnodeChildren)\n .map(function (children) { return createVTree(vnode, children.slice()); });\n }\n }\n else {\n throw new Error(\"Unhandled vTree Value\");\n }\n };\n}\nexports.makeTransposeVNode = makeTransposeVNode;\n//# sourceMappingURL=transposition.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/transposition.js\n ** module id = 92\n ** module chunks = 0\n **/","\"use strict\";\nvar xstream_adapter_1 = require('@cycle/xstream-adapter');\nvar transposition_1 = require('./transposition');\nvar HTMLSource_1 = require('./HTMLSource');\nvar toHTML = require('snabbdom-to-html');\n/* tslint:disable:no-empty */\nvar noop = function () { };\n/* tslint:enable:no-empty */\nfunction makeHTMLDriver(effect, options) {\n if (!options) {\n options = {};\n }\n var transposition = options.transposition || false;\n function htmlDriver(vnode$, runStreamAdapter) {\n var transposeVNode = transposition_1.makeTransposeVNode(runStreamAdapter);\n var preprocessedVNode$ = (transposition ? vnode$.map(transposeVNode).flatten() : vnode$);\n var html$ = preprocessedVNode$.last().map(toHTML);\n html$.addListener({\n next: effect || noop,\n error: noop,\n complete: noop,\n });\n return new HTMLSource_1.HTMLSource(html$, runStreamAdapter);\n }\n ;\n htmlDriver.streamAdapter = xstream_adapter_1.default;\n return htmlDriver;\n}\nexports.makeHTMLDriver = makeHTMLDriver;\n//# sourceMappingURL=makeHTMLDriver.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/makeHTMLDriver.js\n ** module id = 93\n ** module chunks = 0\n **/","\"use strict\";\nvar xstream_1 = require('xstream');\nvar xstream_adapter_1 = require('@cycle/xstream-adapter');\nvar HTMLSource = (function () {\n function HTMLSource(html$, runSA) {\n this.runSA = runSA;\n this._html$ = html$;\n this._empty$ = runSA.adapt(xstream_1.default.empty(), xstream_adapter_1.default.streamSubscribe);\n }\n HTMLSource.prototype.elements = function () {\n return this.runSA.adapt(this._html$, xstream_adapter_1.default.streamSubscribe);\n };\n HTMLSource.prototype.select = function (selector) {\n return new HTMLSource(xstream_1.default.empty(), this.runSA);\n };\n HTMLSource.prototype.events = function (eventType, options) {\n return this._empty$;\n };\n return HTMLSource;\n}());\nexports.HTMLSource = HTMLSource;\n//# sourceMappingURL=HTMLSource.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/HTMLSource.js\n ** module id = 94\n ** module chunks = 0\n **/","\nvar init = require('./init');\n\nmodule.exports = init([require('./modules/attributes'), require('./modules/style')]);\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/lib/index.js\n ** module id = 95\n ** module chunks = 0\n **/","\nvar parseSelector = require('./parse-selector');\nvar VOID_ELEMENTS = require('./void-elements');\nvar CONTAINER_ELEMENTS = require('./container-elements');\n\nmodule.exports = function init(modules) {\n function parse(data) {\n return modules.reduce(function (arr, fn) {\n arr.push(fn(data));\n return arr;\n }, []).filter(function (result) {\n return result !== '';\n });\n }\n\n return function renderToString(vnode) {\n if (!vnode.sel && vnode.text) {\n return vnode.text;\n }\n\n vnode.data = vnode.data || {};\n\n // Support thunks\n if (typeof vnode.sel === 'string' && vnode.sel.slice(0, 5) === 'thunk') {\n vnode = vnode.data.fn.apply(null, vnode.data.args);\n }\n\n var tagName = parseSelector(vnode.sel).tagName;\n var attributes = parse(vnode);\n var svg = vnode.data.ns === 'http://www.w3.org/2000/svg';\n var tag = [];\n\n // Open tag\n tag.push('<' + tagName);\n if (attributes.length) {\n tag.push(' ' + attributes.join(' '));\n }\n if (svg && CONTAINER_ELEMENTS[tagName] !== true) {\n tag.push(' /');\n }\n tag.push('>');\n\n // Close tag, if needed\n if (VOID_ELEMENTS[tagName] !== true && !svg || svg && CONTAINER_ELEMENTS[tagName] === true) {\n if (vnode.data.props && vnode.data.props.innerHTML) {\n tag.push(vnode.data.props.innerHTML);\n } else if (vnode.text) {\n tag.push(vnode.text);\n } else if (vnode.children) {\n vnode.children.forEach(function (child) {\n tag.push(renderToString(child));\n });\n }\n tag.push('');\n }\n\n return tag.join('');\n };\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/lib/init.js\n ** module id = 96\n ** module chunks = 0\n **/","\n// https://github.com/Matt-Esch/virtual-dom/blob/master/virtual-hyperscript/parse-tag.js\n\nvar split = require('browser-split');\n\nvar classIdSplit = /([\\.#]?[a-zA-Z0-9\\u007F-\\uFFFF_:-]+)/;\nvar notClassId = /^\\.|#/;\n\nmodule.exports = function parseSelector(selector, upper) {\n selector = selector || '';\n var tagName;\n var id = '';\n var classes = [];\n\n var tagParts = split(selector, classIdSplit);\n\n if (notClassId.test(tagParts[1]) || selector === '') {\n tagName = 'div';\n }\n\n var part, type, i;\n\n for (i = 0; i < tagParts.length; i++) {\n part = tagParts[i];\n\n if (!part) {\n continue;\n }\n\n type = part.charAt(0);\n\n if (!tagName) {\n tagName = part;\n } else if (type === '.') {\n classes.push(part.substring(1, part.length));\n } else if (type === '#') {\n id = part.substring(1, part.length);\n }\n }\n\n return {\n tagName: upper === true ? tagName.toUpperCase() : tagName,\n id: id,\n className: classes.join(' ')\n };\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/lib/parse-selector.js\n ** module id = 97\n ** module chunks = 0\n **/","/*!\n * Cross-Browser Split 1.1.1\n * Copyright 2007-2012 Steven Levithan \n * Available under the MIT License\n * ECMAScript compliant, uniform cross-browser split method\n */\n\n/**\n * Splits a string into an array of strings using a regex or string separator. Matches of the\n * separator are not included in the result array. However, if `separator` is a regex that contains\n * capturing groups, backreferences are spliced into the result each time `separator` is matched.\n * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably\n * cross-browser.\n * @param {String} str String to split.\n * @param {RegExp|String} separator Regex or string to use for separating the string.\n * @param {Number} [limit] Maximum number of items to include in the result array.\n * @returns {Array} Array of substrings.\n * @example\n *\n * // Basic use\n * split('a b c d', ' ');\n * // -> ['a', 'b', 'c', 'd']\n *\n * // With limit\n * split('a b c d', ' ', 2);\n * // -> ['a', 'b']\n *\n * // Backreferences in result array\n * split('..word1 word2..', /([a-z]+)(\\d+)/i);\n * // -> ['..', 'word', '1', ' ', 'word', '2', '..']\n */\nmodule.exports = (function split(undef) {\n\n var nativeSplit = String.prototype.split,\n compliantExecNpcg = /()??/.exec(\"\")[1] === undef,\n // NPCG: nonparticipating capturing group\n self;\n\n self = function(str, separator, limit) {\n // If `separator` is not a regex, use `nativeSplit`\n if (Object.prototype.toString.call(separator) !== \"[object RegExp]\") {\n return nativeSplit.call(str, separator, limit);\n }\n var output = [],\n flags = (separator.ignoreCase ? \"i\" : \"\") + (separator.multiline ? \"m\" : \"\") + (separator.extended ? \"x\" : \"\") + // Proposed for ES6\n (separator.sticky ? \"y\" : \"\"),\n // Firefox 3+\n lastLastIndex = 0,\n // Make `global` and avoid `lastIndex` issues by working with a copy\n separator = new RegExp(separator.source, flags + \"g\"),\n separator2, match, lastIndex, lastLength;\n str += \"\"; // Type-convert\n if (!compliantExecNpcg) {\n // Doesn't need flags gy, but they don't hurt\n separator2 = new RegExp(\"^\" + separator.source + \"$(?!\\\\s)\", flags);\n }\n /* Values for `limit`, per the spec:\n * If undefined: 4294967295 // Math.pow(2, 32) - 1\n * If 0, Infinity, or NaN: 0\n * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;\n * If negative number: 4294967296 - Math.floor(Math.abs(limit))\n * If other: Type-convert, then use the above rules\n */\n limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1\n limit >>> 0; // ToUint32(limit)\n while (match = separator.exec(str)) {\n // `separator.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0].length;\n if (lastIndex > lastLastIndex) {\n output.push(str.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for\n // nonparticipating capturing groups\n if (!compliantExecNpcg && match.length > 1) {\n match[0].replace(separator2, function() {\n for (var i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undef) {\n match[i] = undef;\n }\n }\n });\n }\n if (match.length > 1 && match.index < str.length) {\n Array.prototype.push.apply(output, match.slice(1));\n }\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= limit) {\n break;\n }\n }\n if (separator.lastIndex === match.index) {\n separator.lastIndex++; // Avoid an infinite loop\n }\n }\n if (lastLastIndex === str.length) {\n if (lastLength || !separator.test(\"\")) {\n output.push(\"\");\n }\n } else {\n output.push(str.slice(lastLastIndex));\n }\n return output.length > limit ? output.slice(0, limit) : output;\n };\n\n return self;\n})();\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/browser-split/index.js\n ** module id = 98\n ** module chunks = 0\n **/","\n// http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n\nmodule.exports = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/lib/void-elements.js\n ** module id = 99\n ** module chunks = 0\n **/","\n// All SVG children elements, not in this list, should self-close\n\nmodule.exports = {\n // http://www.w3.org/TR/SVG/intro.html#TermContainerElement\n 'a': true,\n 'defs': true,\n 'glyph': true,\n 'g': true,\n 'marker': true,\n 'mask': true,\n 'missing-glyph': true,\n 'pattern': true,\n 'svg': true,\n 'switch': true,\n 'symbol': true,\n\n // http://www.w3.org/TR/SVG/intro.html#TermDescriptiveElement\n 'desc': true,\n 'metadata': true,\n 'title': true\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/lib/container-elements.js\n ** module id = 100\n ** module chunks = 0\n **/","\nvar forOwn = require('lodash.forown');\nvar escape = require('lodash.escape');\nvar union = require('lodash.union');\n\nvar parseSelector = require('../parse-selector');\n\n// data.attrs, data.props, data.class\n\nmodule.exports = function attributes(vnode) {\n var selector = parseSelector(vnode.sel);\n var parsedClasses = selector.className.split(' ');\n\n var attributes = [];\n var classes = [];\n var values = {};\n\n if (selector.id) {\n values.id = selector.id;\n }\n\n setAttributes(vnode.data.props, values);\n setAttributes(vnode.data.attrs, values); // `attrs` override `props`, not sure if this is good so\n\n if (vnode.data.class) {\n // Omit `className` attribute if `class` is set on vnode\n values.class = undefined;\n }\n forOwn(vnode.data.class, function (value, key) {\n if (value === true) {\n classes.push(key);\n }\n });\n classes = union(classes, values.class, parsedClasses).filter(function (x) {\n return x !== '';\n });\n\n if (classes.length) {\n values.class = classes.join(' ');\n }\n\n forOwn(values, function (value, key) {\n attributes.push(value === true ? key : key + '=\"' + escape(value) + '\"');\n });\n\n return attributes.length ? attributes.join(' ') : '';\n};\n\nfunction setAttributes(values, target) {\n forOwn(values, function (value, key) {\n if (key === 'htmlFor') {\n target['for'] = value;\n return;\n }\n if (key === 'className') {\n target['class'] = value.split(' ');\n return;\n }\n if (key === 'innerHTML') {\n return;\n }\n target[key] = value;\n });\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/lib/modules/attributes.js\n ** module id = 101\n ** module chunks = 0\n **/","/**\n * lodash 3.0.2 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar baseFor = require('lodash._basefor'),\n bindCallback = require('lodash._bindcallback'),\n keys = require('lodash.keys');\n\n/**\n * The base implementation of `_.forOwn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return baseFor(object, iteratee, keys);\n}\n\n/**\n * Creates a function for `_.forOwn` or `_.forOwnRight`.\n *\n * @private\n * @param {Function} objectFunc The function to iterate over an object.\n * @returns {Function} Returns the new each function.\n */\nfunction createForOwn(objectFunc) {\n return function(object, iteratee, thisArg) {\n if (typeof iteratee != 'function' || thisArg !== undefined) {\n iteratee = bindCallback(iteratee, thisArg, 3);\n }\n return objectFunc(object, iteratee);\n };\n}\n\n/**\n * Iterates over own enumerable properties of an object invoking `iteratee`\n * for each property. The `iteratee` is bound to `thisArg` and invoked with\n * three arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'a' and 'b' (iteration order is not guaranteed)\n */\nvar forOwn = createForOwn(baseForOwn);\n\nmodule.exports = forOwn;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/index.js\n ** module id = 102\n ** module chunks = 0\n **/","/**\n * lodash 3.0.3 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * Creates a base function for methods like `_.forIn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = baseFor;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash._basefor/index.js\n ** module id = 103\n ** module chunks = 0\n **/","/**\n * lodash 3.0.1 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/**\n * A specialized version of `baseCallback` which only supports `this` binding\n * and specifying the number of arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction bindCallback(func, thisArg, argCount) {\n if (typeof func != 'function') {\n return identity;\n }\n if (thisArg === undefined) {\n return func;\n }\n switch (argCount) {\n case 1: return function(value) {\n return func.call(thisArg, value);\n };\n case 3: return function(value, index, collection) {\n return func.call(thisArg, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(thisArg, accumulator, value, index, collection);\n };\n case 5: return function(value, other, key, object, source) {\n return func.call(thisArg, value, other, key, object, source);\n };\n }\n return function() {\n return func.apply(thisArg, arguments);\n };\n}\n\n/**\n * This method returns the first argument provided to it.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = bindCallback;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash._bindcallback/index.js\n ** module id = 104\n ** module chunks = 0\n **/","/**\n * lodash 3.1.2 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar getNative = require('lodash._getnative'),\n isArguments = require('lodash.isarguments'),\n isArray = require('lodash.isarray');\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^\\d+$/;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = getNative(Object, 'keys');\n\n/**\n * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\n/**\n * Checks if `value` is array-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n */\nfunction isArrayLike(value) {\n return value != null && isLength(getLength(value));\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * A fallback implementation of `Object.keys` which creates an array of the\n * own enumerable property names of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction shimKeys(object) {\n var props = keysIn(object),\n propsLength = props.length,\n length = propsLength && object.length;\n\n var allowIndexes = !!length && isLength(length) &&\n (isArray(object) || isArguments(object));\n\n var index = -1,\n result = [];\n\n while (++index < propsLength) {\n var key = props[index];\n if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nvar keys = !nativeKeys ? shimKeys : function(object) {\n var Ctor = object == null ? undefined : object.constructor;\n if ((typeof Ctor == 'function' && Ctor.prototype === object) ||\n (typeof object != 'function' && isArrayLike(object))) {\n return shimKeys(object);\n }\n return isObject(object) ? nativeKeys(object) : [];\n};\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n if (object == null) {\n return [];\n }\n if (!isObject(object)) {\n object = Object(object);\n }\n var length = object.length;\n length = (length && isLength(length) &&\n (isArray(object) || isArguments(object)) && length) || 0;\n\n var Ctor = object.constructor,\n index = -1,\n isProto = typeof Ctor == 'function' && Ctor.prototype === object,\n result = Array(length),\n skipIndexes = length > 0;\n\n while (++index < length) {\n result[index] = (index + '');\n }\n for (var key in object) {\n if (!(skipIndexes && isIndex(key, length)) &&\n !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = keys;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash.keys/index.js\n ** module id = 105\n ** module chunks = 0\n **/","/**\n * lodash 3.9.1 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used to detect host constructors (Safari > 5). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar fnToString = Function.prototype.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n fnToString.call(hasOwnProperty).replace(/[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = object == null ? undefined : object[key];\n return isNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in older versions of Chrome and Safari which return 'function' for regexes\n // and Safari 8 equivalents which return 'object' for typed array constructors.\n return isObject(value) && objToString.call(value) == funcTag;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(fnToString.call(value));\n }\n return isObjectLike(value) && reIsHostCtor.test(value);\n}\n\nmodule.exports = getNative;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash.keys/~/lodash._getnative/index.js\n ** module id = 106\n ** module chunks = 0\n **/","/**\n * lodash 3.0.8 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(getLength(value)) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array and weak map constructors,\n // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\nmodule.exports = isArguments;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash.keys/~/lodash.isarguments/index.js\n ** module id = 107\n ** module chunks = 0\n **/","/**\n * lodash 3.0.4 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** `Object#toString` result references. */\nvar arrayTag = '[object Array]',\n funcTag = '[object Function]';\n\n/** Used to detect host constructors (Safari > 5). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar fnToString = Function.prototype.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n fnToString.call(hasOwnProperty).replace(/[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeIsArray = getNative(Array, 'isArray');\n\n/**\n * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = object == null ? undefined : object[key];\n return isNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(function() { return arguments; }());\n * // => false\n */\nvar isArray = nativeIsArray || function(value) {\n return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n};\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in older versions of Chrome and Safari which return 'function' for regexes\n // and Safari 8 equivalents which return 'object' for typed array constructors.\n return isObject(value) && objToString.call(value) == funcTag;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(fnToString.call(value));\n }\n return isObjectLike(value) && reIsHostCtor.test(value);\n}\n\nmodule.exports = isArray;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.forown/~/lodash.keys/~/lodash.isarray/index.js\n ** module id = 108\n ** module chunks = 0\n **/","/**\n * lodash 3.2.0 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar root = require('lodash._root');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match HTML entities and HTML characters. */\nvar reUnescapedHtml = /[&<>\"'`]/g,\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n/** Used to map characters to HTML entities. */\nvar htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n\n/**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\nfunction escapeHtmlChar(chr) {\n return htmlEscapes[chr];\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = Symbol ? symbolProto.toString : undefined;\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (value == null) {\n return '';\n }\n if (isSymbol(value)) {\n return Symbol ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', \"'\", and \"\\`\" in `string` to\n * their corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value.\n * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * Backticks are escaped because in IE < 9, they can break out of\n * attribute values or HTML comments. See [#59](https://html5sec.org/#59),\n * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and\n * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)\n * for more details.\n *\n * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)\n * to reduce XSS vectors.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\nfunction escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n}\n\nmodule.exports = escape;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.escape/index.js\n ** module id = 109\n ** module chunks = 0\n **/","/**\n * lodash 3.0.1 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used to determine if values are of the language type `Object`. */\nvar objectTypes = {\n 'function': true,\n 'object': true\n};\n\n/** Detect free variable `exports`. */\nvar freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\n ? exports\n : undefined;\n\n/** Detect free variable `module`. */\nvar freeModule = (objectTypes[typeof module] && module && !module.nodeType)\n ? module\n : undefined;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\n\n/** Detect free variable `self`. */\nvar freeSelf = checkGlobal(objectTypes[typeof self] && self);\n\n/** Detect free variable `window`. */\nvar freeWindow = checkGlobal(objectTypes[typeof window] && window);\n\n/** Detect `this` as the global object. */\nvar thisGlobal = checkGlobal(objectTypes[typeof this] && this);\n\n/**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\nvar root = freeGlobal ||\n ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\n freeSelf || thisGlobal || Function('return this')();\n\n/**\n * Checks if `value` is a global object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {null|Object} Returns `value` if it's a global object, else `null`.\n */\nfunction checkGlobal(value) {\n return (value && value.Object === Object) ? value : null;\n}\n\nmodule.exports = root;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.escape/~/lodash._root/index.js\n ** module id = 110\n ** module chunks = 0\n **/","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tmodule.children = [];\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n}\r\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/webpack/buildin/module.js\n ** module id = 111\n ** module chunks = 0\n **/","/**\n * lodash 3.1.0 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.2 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar baseFlatten = require('lodash._baseflatten'),\n baseUniq = require('lodash._baseuniq'),\n restParam = require('lodash.restparam');\n\n/**\n * Creates an array of unique values, in order, of the provided arrays using\n * `SameValueZero` for equality comparisons.\n *\n * **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)\n * comparisons are like strict equality comparisons, e.g. `===`, except that\n * `NaN` matches `NaN`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([1, 2], [4, 2], [2, 1]);\n * // => [1, 2, 4]\n */\nvar union = restParam(function(arrays) {\n return baseUniq(baseFlatten(arrays, false, true));\n});\n\nmodule.exports = union;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/index.js\n ** module id = 112\n ** module chunks = 0\n **/","/**\n * lodash 3.1.4 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar isArguments = require('lodash.isarguments'),\n isArray = require('lodash.isarray');\n\n/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * The base implementation of `_.flatten` with added support for restricting\n * flattening and specifying the start index.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {boolean} [isDeep] Specify a deep flatten.\n * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, isDeep, isStrict, result) {\n result || (result = []);\n\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index];\n if (isObjectLike(value) && isArrayLike(value) &&\n (isStrict || isArray(value) || isArguments(value))) {\n if (isDeep) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, isDeep, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\n/**\n * Checks if `value` is array-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n */\nfunction isArrayLike(value) {\n return value != null && isLength(getLength(value));\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = baseFlatten;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseflatten/index.js\n ** module id = 113\n ** module chunks = 0\n **/","/**\n * lodash 3.0.8 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(getLength(value)) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array and weak map constructors,\n // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\nmodule.exports = isArguments;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseflatten/~/lodash.isarguments/index.js\n ** module id = 114\n ** module chunks = 0\n **/","/**\n * lodash 3.0.4 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** `Object#toString` result references. */\nvar arrayTag = '[object Array]',\n funcTag = '[object Function]';\n\n/** Used to detect host constructors (Safari > 5). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar fnToString = Function.prototype.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n fnToString.call(hasOwnProperty).replace(/[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeIsArray = getNative(Array, 'isArray');\n\n/**\n * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = object == null ? undefined : object[key];\n return isNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(function() { return arguments; }());\n * // => false\n */\nvar isArray = nativeIsArray || function(value) {\n return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n};\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in older versions of Chrome and Safari which return 'function' for regexes\n // and Safari 8 equivalents which return 'object' for typed array constructors.\n return isObject(value) && objToString.call(value) == funcTag;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(fnToString.call(value));\n }\n return isObjectLike(value) && reIsHostCtor.test(value);\n}\n\nmodule.exports = isArray;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseflatten/~/lodash.isarray/index.js\n ** module id = 115\n ** module chunks = 0\n **/","/**\n * lodash 3.0.3 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar baseIndexOf = require('lodash._baseindexof'),\n cacheIndexOf = require('lodash._cacheindexof'),\n createCache = require('lodash._createcache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniq` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The function invoked per iteration.\n * @returns {Array} Returns the new duplicate-value-free array.\n */\nfunction baseUniq(array, iteratee) {\n var index = -1,\n indexOf = baseIndexOf,\n length = array.length,\n isCommon = true,\n isLarge = isCommon && length >= LARGE_ARRAY_SIZE,\n seen = isLarge ? createCache() : null,\n result = [];\n\n if (seen) {\n indexOf = cacheIndexOf;\n isCommon = false;\n } else {\n isLarge = false;\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value, index, array) : value;\n\n if (isCommon && value === value) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (indexOf(seen, computed, 0) < 0) {\n if (iteratee || isLarge) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseuniq/index.js\n ** module id = 116\n ** module chunks = 0\n **/","/**\n * lodash 3.1.0 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.2 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/**\n * The base implementation of `_.indexOf` without support for binary searches.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n if (value !== value) {\n return indexOfNaN(array, fromIndex);\n }\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * Gets the index at which the first occurrence of `NaN` is found in `array`.\n * If `fromRight` is provided elements of `array` are iterated from right to left.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched `NaN`, else `-1`.\n */\nfunction indexOfNaN(array, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 0 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n var other = array[index];\n if (other !== other) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseIndexOf;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseuniq/~/lodash._baseindexof/index.js\n ** module id = 117\n ** module chunks = 0\n **/","/**\n * lodash 3.0.2 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/**\n * Checks if `value` is in `cache` mimicking the return signature of\n * `_.indexOf` by returning `0` if the value is found, else `-1`.\n *\n * @private\n * @param {Object} cache The cache to search.\n * @param {*} value The value to search for.\n * @returns {number} Returns `0` if `value` is found, else `-1`.\n */\nfunction cacheIndexOf(cache, value) {\n var data = cache.data,\n result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];\n\n return result ? 0 : -1;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\nmodule.exports = cacheIndexOf;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseuniq/~/lodash._cacheindexof/index.js\n ** module id = 118\n ** module chunks = 0\n **/","/**\n * lodash 3.1.2 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar getNative = require('lodash._getnative');\n\n/** Native method references. */\nvar Set = getNative(global, 'Set');\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeCreate = getNative(Object, 'create');\n\n/**\n *\n * Creates a cache object to store unique values.\n *\n * @private\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var length = values ? values.length : 0;\n\n this.data = { 'hash': nativeCreate(null), 'set': new Set };\n while (length--) {\n this.push(values[length]);\n }\n}\n\n/**\n * Adds `value` to the cache.\n *\n * @private\n * @name push\n * @memberOf SetCache\n * @param {*} value The value to cache.\n */\nfunction cachePush(value) {\n var data = this.data;\n if (typeof value == 'string' || isObject(value)) {\n data.set.add(value);\n } else {\n data.hash[value] = true;\n }\n}\n\n/**\n * Creates a `Set` cache object to optimize linear searches of large arrays.\n *\n * @private\n * @param {Array} [values] The values to cache.\n * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.\n */\nfunction createCache(values) {\n return (nativeCreate && Set) ? new SetCache(values) : null;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n// Add functions to the `Set` cache.\nSetCache.prototype.push = cachePush;\n\nmodule.exports = createCache;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseuniq/~/lodash._createcache/index.js\n ** module id = 119\n ** module chunks = 0\n **/","/**\n * lodash 3.9.1 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used to detect host constructors (Safari > 5). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar fnToString = Function.prototype.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n fnToString.call(hasOwnProperty).replace(/[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = object == null ? undefined : object[key];\n return isNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in older versions of Chrome and Safari which return 'function' for regexes\n // and Safari 8 equivalents which return 'object' for typed array constructors.\n return isObject(value) && objToString.call(value) == funcTag;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(fnToString.call(value));\n }\n return isObjectLike(value) && reIsHostCtor.test(value);\n}\n\nmodule.exports = getNative;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash._baseuniq/~/lodash._createcache/~/lodash._getnative/index.js\n ** module id = 120\n ** module chunks = 0\n **/","/**\n * lodash 3.6.1 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as an array.\n *\n * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.restParam(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction restParam(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n rest = Array(length);\n\n while (++index < length) {\n rest[index] = args[start + index];\n }\n switch (start) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, args[0], rest);\n case 2: return func.call(this, args[0], args[1], rest);\n }\n var otherArgs = Array(start + 1);\n index = -1;\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = rest;\n return func.apply(this, otherArgs);\n };\n}\n\nmodule.exports = restParam;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.union/~/lodash.restparam/index.js\n ** module id = 121\n ** module chunks = 0\n **/","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar forOwn = require('lodash.forown');\nvar escape = require('lodash.escape');\nvar kebabCase = require('lodash.kebabcase');\n\n// data.style\n\nmodule.exports = function style(vnode) {\n var styles = [];\n var style = vnode.data.style || {};\n\n // merge in `delayed` properties\n if (style.delayed) {\n _extends(style, style.delayed);\n }\n\n forOwn(style, function (value, key) {\n // omit hook objects\n if (typeof value === 'string') {\n styles.push(kebabCase(key) + ': ' + escape(value));\n }\n });\n\n return styles.length ? 'style=\"' + styles.join('; ') + '\"' : '';\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/lib/modules/style.js\n ** module id = 122\n ** module chunks = 0\n **/","/**\n * lodash 3.1.1 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar deburr = require('lodash.deburr'),\n words = require('lodash.words');\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string)), callback, '');\n };\n}\n\n/**\n * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__foo_bar__');\n * // => 'foo-bar'\n */\nvar kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n});\n\nmodule.exports = kebabCase;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.kebabcase/index.js\n ** module id = 123\n ** module chunks = 0\n **/","/**\n * lodash 3.2.0 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar root = require('lodash._root');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match latin-1 supplementary letters (excluding mathematical operators). */\nvar reLatin1 = /[\\xc0-\\xd6\\xd8-\\xde\\xdf-\\xf6\\xf8-\\xff]/g;\n\n/** Used to compose unicode character classes. */\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe23',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20f0';\n\n/** Used to compose unicode capture groups. */\nvar rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']';\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/** Used to map latin-1 supplementary letters to basic latin letters. */\nvar deburredLetters = {\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcC': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xeC': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss'\n};\n\n/**\n * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nfunction deburrLetter(letter) {\n return deburredLetters[letter];\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = Symbol ? symbolProto.toString : undefined;\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (value == null) {\n return '';\n }\n if (isSymbol(value)) {\n return Symbol ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');\n}\n\nmodule.exports = deburr;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.kebabcase/~/lodash.deburr/index.js\n ** module id = 124\n ** module chunks = 0\n **/","/**\n * lodash 3.0.1 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used to determine if values are of the language type `Object`. */\nvar objectTypes = {\n 'function': true,\n 'object': true\n};\n\n/** Detect free variable `exports`. */\nvar freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\n ? exports\n : undefined;\n\n/** Detect free variable `module`. */\nvar freeModule = (objectTypes[typeof module] && module && !module.nodeType)\n ? module\n : undefined;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\n\n/** Detect free variable `self`. */\nvar freeSelf = checkGlobal(objectTypes[typeof self] && self);\n\n/** Detect free variable `window`. */\nvar freeWindow = checkGlobal(objectTypes[typeof window] && window);\n\n/** Detect `this` as the global object. */\nvar thisGlobal = checkGlobal(objectTypes[typeof this] && this);\n\n/**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\nvar root = freeGlobal ||\n ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\n freeSelf || thisGlobal || Function('return this')();\n\n/**\n * Checks if `value` is a global object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {null|Object} Returns `value` if it's a global object, else `null`.\n */\nfunction checkGlobal(value) {\n return (value && value.Object === Object) ? value : null;\n}\n\nmodule.exports = root;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.kebabcase/~/lodash.deburr/~/lodash._root/index.js\n ** module id = 125\n ** module chunks = 0\n **/","/**\n * lodash 3.2.0 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar root = require('lodash._root');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe23',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20f0',\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsQuoteRange = '\\\\u2018\\\\u2019\\\\u201c\\\\u201d',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsQuoteRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',\n rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;\n\n/** Used to match non-compound words composed of alphanumeric characters. */\nvar reBasicWord = /[a-zA-Z0-9]+/g;\n\n/** Used to match complex or compound words. */\nvar reComplexWord = RegExp([\n rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',\n rsUpper + '?' + rsLowerMisc + '+',\n rsUpper + '+',\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasComplexWord = /[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = Symbol ? symbolProto.toString : undefined;\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (value == null) {\n return '';\n }\n if (isSymbol(value)) {\n return Symbol ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord;\n }\n return string.match(pattern) || [];\n}\n\nmodule.exports = words;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.kebabcase/~/lodash.words/index.js\n ** module id = 126\n ** module chunks = 0\n **/","/**\n * lodash 3.0.1 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used to determine if values are of the language type `Object`. */\nvar objectTypes = {\n 'function': true,\n 'object': true\n};\n\n/** Detect free variable `exports`. */\nvar freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)\n ? exports\n : undefined;\n\n/** Detect free variable `module`. */\nvar freeModule = (objectTypes[typeof module] && module && !module.nodeType)\n ? module\n : undefined;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);\n\n/** Detect free variable `self`. */\nvar freeSelf = checkGlobal(objectTypes[typeof self] && self);\n\n/** Detect free variable `window`. */\nvar freeWindow = checkGlobal(objectTypes[typeof window] && window);\n\n/** Detect `this` as the global object. */\nvar thisGlobal = checkGlobal(objectTypes[typeof this] && this);\n\n/**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\nvar root = freeGlobal ||\n ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||\n freeSelf || thisGlobal || Function('return this')();\n\n/**\n * Checks if `value` is a global object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {null|Object} Returns `value` if it's a global object, else `null`.\n */\nfunction checkGlobal(value) {\n return (value && value.Object === Object) ? value : null;\n}\n\nmodule.exports = root;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/~/snabbdom-to-html/~/lodash.kebabcase/~/lodash.words/~/lodash._root/index.js\n ** module id = 127\n ** module chunks = 0\n **/","\"use strict\";\nvar xstream_adapter_1 = require('@cycle/xstream-adapter');\nvar xstream_1 = require('xstream');\nvar MockedDOMSource = (function () {\n function MockedDOMSource(_streamAdapter, _mockConfig) {\n this._streamAdapter = _streamAdapter;\n this._mockConfig = _mockConfig;\n if (_mockConfig.elements) {\n this._elements = _mockConfig.elements;\n }\n else {\n this._elements = _streamAdapter.adapt(xstream_1.default.empty(), xstream_adapter_1.default.streamSubscribe);\n }\n }\n MockedDOMSource.prototype.elements = function () {\n return this._elements;\n };\n MockedDOMSource.prototype.events = function (eventType, options) {\n var mockConfig = this._mockConfig;\n var keys = Object.keys(mockConfig);\n var keysLen = keys.length;\n for (var i = 0; i < keysLen; i++) {\n var key = keys[i];\n if (key === eventType) {\n return mockConfig[key];\n }\n }\n return this._streamAdapter.adapt(xstream_1.default.empty(), xstream_adapter_1.default.streamSubscribe);\n };\n MockedDOMSource.prototype.select = function (selector) {\n var mockConfig = this._mockConfig;\n var keys = Object.keys(mockConfig);\n var keysLen = keys.length;\n for (var i = 0; i < keysLen; i++) {\n var key = keys[i];\n if (key === selector) {\n return new MockedDOMSource(this._streamAdapter, mockConfig[key]);\n }\n }\n return new MockedDOMSource(this._streamAdapter, {});\n };\n return MockedDOMSource;\n}());\nexports.MockedDOMSource = MockedDOMSource;\nfunction mockDOMSource(streamAdapter, mockConfig) {\n return new MockedDOMSource(streamAdapter, mockConfig);\n}\nexports.mockDOMSource = mockDOMSource;\n//# sourceMappingURL=mockDOMSource.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/mockDOMSource.js\n ** module id = 128\n ** module chunks = 0\n **/","\"use strict\";\nvar hyperscript_1 = require('./hyperscript');\nfunction isValidString(param) {\n return typeof param === 'string' && param.length > 0;\n}\nfunction isSelector(param) {\n return isValidString(param) && (param[0] === '.' || param[0] === '#');\n}\nfunction createTagFunction(tagName) {\n return function hyperscript(first, b, c) {\n if (isSelector(first)) {\n if (typeof b !== 'undefined' && typeof c !== 'undefined') {\n return hyperscript_1.h(tagName + first, b, c);\n }\n else if (typeof b !== 'undefined') {\n return hyperscript_1.h(tagName + first, b);\n }\n else {\n return hyperscript_1.h(tagName + first, {});\n }\n }\n else if (!!b) {\n return hyperscript_1.h(tagName, first, b);\n }\n else if (!!first) {\n return hyperscript_1.h(tagName, first);\n }\n else {\n return hyperscript_1.h(tagName, {});\n }\n };\n}\nvar SVG_TAG_NAMES = [\n 'a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor',\n 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'colorProfile',\n 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix',\n 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting',\n 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB',\n 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode',\n 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting',\n 'feSpotlight', 'feTile', 'feTurbulence', 'filter', 'font', 'fontFace',\n 'fontFaceFormat', 'fontFaceName', 'fontFaceSrc', 'fontFaceUri',\n 'foreignObject', 'g', 'glyph', 'glyphRef', 'hkern', 'image', 'line',\n 'linearGradient', 'marker', 'mask', 'metadata', 'missingGlyph', 'mpath',\n 'path', 'pattern', 'polygon', 'polyling', 'radialGradient', 'rect', 'script',\n 'set', 'stop', 'style', 'switch', 'symbol', 'text', 'textPath', 'title',\n 'tref', 'tspan', 'use', 'view', 'vkern'\n];\nvar svg = createTagFunction('svg');\nSVG_TAG_NAMES.forEach(function (tag) {\n svg[tag] = createTagFunction(tag);\n});\nvar TAG_NAMES = [\n 'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base',\n 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption',\n 'cite', 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl',\n 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form',\n 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html',\n 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend',\n 'li', 'link', 'main', 'map', 'mark', 'menu', 'meta', 'nav', 'noscript',\n 'object', 'ol', 'optgroup', 'option', 'p', 'param', 'pre', 'progress', 'q',\n 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small',\n 'source', 'span', 'strong', 'style', 'sub', 'sup', 'table', 'tbody', 'td',\n 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'u', 'ul', 'video'\n];\nvar exported = { SVG_TAG_NAMES: SVG_TAG_NAMES, TAG_NAMES: TAG_NAMES, svg: svg, isSelector: isSelector, createTagFunction: createTagFunction };\nTAG_NAMES.forEach(function (n) {\n exported[n] = createTagFunction(n);\n});\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exported;\n//# sourceMappingURL=hyperscript-helpers.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/dom/lib/hyperscript-helpers.js\n ** module id = 129\n ** module chunks = 0\n **/","import { Stream } from 'xstream';\nimport { IApplicationState } from './definitions';\nimport dropRepeats from 'xstream/extra/dropRepeats';\nimport flattenConcurrently from 'xstream/extra/flattenConcurrently';\nimport { ILinkableEntity, IJedi } from './drivers/jedis';\n\nconst xs = Stream;\n\nfunction canJediBeAdded(jedi: ILinkableEntity, jedis: IJedi[]) {\n const first = jedis[0];\n const last = jedis[4];\n const isMasterOfFirst = first !== null && first.master.id === jedi.id;\n const isApprenticeOfLast = last !== null && last.apprentice.id === jedi.id;\n const loadedIds =\n jedis\n .filter(Boolean)\n .map(jedi => jedi.id);\n const alreadyLoaded = loadedIds.indexOf(jedi.id) !== -1;\n return !alreadyLoaded && !isMasterOfFirst && !isApprenticeOfLast\n}\n\nfunction neighborsToLoad(state: IApplicationState): Stream {\n const jedi$ = xs.fromArray(state.jedis);\n const matched = state.matchedId !== -1;\n const neighbors$ =\n jedi$\n .filter(Boolean)\n .map(jedi => xs.of(jedi.master, jedi.apprentice))\n .compose(flattenConcurrently)\n .filter(jedi =>\n Boolean(jedi.id)\n && canJediBeAdded(jedi, state.jedis)\n && !matched);\n return neighbors$;\n}\n\nfunction hash(state: IApplicationState): string {\n const jedis =\n state.jedis\n .map(jedi => !!jedi ? jedi.id : '*')\n .join('-');\n return jedis + '|' + state.matchedId;\n}\n\nconst distinctStates = dropRepeats(\n (prev, next) => hash(prev) === hash(next)\n);\n\nconst distinctIds = dropRepeats(\n (prev, next) => prev === next\n);\n\nfunction requests(state$: Stream): Stream {\n const distinctState$ = state$.compose(distinctStates);\n const request$ =\n xs.merge(\n distinctState$\n .map(neighborsToLoad)\n .compose(flattenConcurrently)\n .map(jedi => jedi.id),\n distinctState$\n .filter(state => state.matchedId !== -1)\n .mapTo(-1)\n ).compose(distinctIds)\n .startWith(3616);\n return request$;\n}\n\nexport default requests;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/requests.ts\n **/","\"use strict\";\nvar core_1 = require('../core');\nvar empty = {};\nvar DropRepeatsOperator = (function () {\n function DropRepeatsOperator(fn, ins) {\n this.fn = fn;\n this.ins = ins;\n this.type = 'dropRepeats';\n this.out = null;\n this.v = empty;\n }\n DropRepeatsOperator.prototype._start = function (out) {\n this.out = out;\n this.ins._add(this);\n };\n DropRepeatsOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.out = null;\n this.v = empty;\n };\n DropRepeatsOperator.prototype.isEq = function (x, y) {\n return this.fn ? this.fn(x, y) : x === y;\n };\n DropRepeatsOperator.prototype._n = function (t) {\n var u = this.out;\n if (!u)\n return;\n var v = this.v;\n if (v === empty || !this.isEq(t, v)) {\n u._n(t);\n }\n this.v = t;\n };\n DropRepeatsOperator.prototype._e = function (err) {\n var u = this.out;\n if (!u)\n return;\n u._e(err);\n };\n DropRepeatsOperator.prototype._c = function () {\n var u = this.out;\n if (!u)\n return;\n u._c();\n };\n return DropRepeatsOperator;\n}());\nexports.DropRepeatsOperator = DropRepeatsOperator;\n/**\n * Drops consecutive duplicate values in a stream.\n *\n * Marble diagram:\n *\n * ```text\n * --1--2--1--1--1--2--3--4--3--3|\n * dropRepeats\n * --1--2--1--------2--3--4--3---|\n * ```\n *\n * Example:\n *\n * ```js\n * import dropRepeats from 'xstream/extra/dropRepeats'\n *\n * const stream = xs.of(1, 2, 1, 1, 1, 2, 3, 4, 3, 3)\n * .compose(dropRepeats())\n *\n * stream.addListener({\n * next: i => console.log(i),\n * error: err => console.error(err),\n * complete: () => console.log('completed')\n * })\n * ```\n *\n * ```text\n * > 1\n * > 2\n * > 1\n * > 2\n * > 3\n * > 4\n * > 3\n * > completed\n * ```\n *\n * Example with a custom isEqual function:\n *\n * ```js\n * import dropRepeats from 'xstream/extra/dropRepeats'\n *\n * const stream = xs.of('a', 'b', 'a', 'A', 'B', 'b')\n * .compose(dropRepeats((x, y) => x.toLowerCase() === y.toLowerCase()))\n *\n * stream.addListener({\n * next: i => console.log(i),\n * error: err => console.error(err),\n * complete: () => console.log('completed')\n * })\n * ```\n *\n * ```text\n * > a\n * > b\n * > a\n * > B\n * > completed\n * ```\n *\n * @param {Function} isEqual An optional function of type\n * `(x: T, y: T) => boolean` that takes an event from the input stream and\n * checks if it is equal to previous event, by returning a boolean.\n * @return {Stream}\n */\nfunction dropRepeats(isEqual) {\n if (isEqual === void 0) { isEqual = null; }\n return function dropRepeatsOperator(ins) {\n return new core_1.Stream(new DropRepeatsOperator(isEqual, ins));\n };\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = dropRepeats;\n//# sourceMappingURL=dropRepeats.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/xstream/extra/dropRepeats.js\n ** module id = 131\n ** module chunks = 0\n **/","\"use strict\";\nvar core_1 = require('../core');\nvar FCIL = (function () {\n function FCIL(out, op) {\n this.out = out;\n this.op = op;\n }\n FCIL.prototype._n = function (t) {\n this.out._n(t);\n };\n FCIL.prototype._e = function (err) {\n this.out._e(err);\n };\n FCIL.prototype._c = function () {\n this.op.less();\n };\n return FCIL;\n}());\nvar FlattenConcOperator = (function () {\n function FlattenConcOperator(ins) {\n this.ins = ins;\n this.type = 'flattenConcurrently';\n this.active = 1; // number of outers and inners that have not yet ended\n this.out = null;\n }\n FlattenConcOperator.prototype._start = function (out) {\n this.out = out;\n this.ins._add(this);\n };\n FlattenConcOperator.prototype._stop = function () {\n this.ins._remove(this);\n this.active = 1;\n this.out = null;\n };\n FlattenConcOperator.prototype.less = function () {\n if (--this.active === 0) {\n var u = this.out;\n if (!u)\n return;\n u._c();\n }\n };\n FlattenConcOperator.prototype._n = function (s) {\n var u = this.out;\n if (!u)\n return;\n this.active++;\n s._add(new FCIL(u, this));\n };\n FlattenConcOperator.prototype._e = function (err) {\n var u = this.out;\n if (!u)\n return;\n u._e(err);\n };\n FlattenConcOperator.prototype._c = function () {\n this.less();\n };\n return FlattenConcOperator;\n}());\nexports.FlattenConcOperator = FlattenConcOperator;\n/**\n * Flattens a \"stream of streams\", handling multiple concurrent nested streams\n * simultaneously.\n *\n * If the input stream is a stream that emits streams, then this operator will\n * return an output stream which is a flat stream: emits regular events. The\n * flattening happens concurrently. It works like this: when the input stream\n * emits a nested stream, *flattenConcurrently* will start imitating that\n * nested one. When the next nested stream is emitted on the input stream,\n * *flattenConcurrently* will also imitate that new one, but will continue to\n * imitate the previous nested streams as well.\n *\n * Marble diagram:\n *\n * ```text\n * --+--------+---------------\n * \\ \\\n * \\ ----1----2---3--\n * --a--b----c----d--------\n * flattenConcurrently\n * -----a--b----c-1--d-2---3--\n * ```\n *\n * @return {Stream}\n */\nfunction flattenConcurrently(ins) {\n return new core_1.Stream(new FlattenConcOperator(ins));\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = flattenConcurrently;\n//# sourceMappingURL=flattenConcurrently.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/xstream/extra/flattenConcurrently.js\n ** module id = 132\n ** module chunks = 0\n **/","\"use strict\";\nvar base_1 = require('@cycle/base');\nvar xstream_adapter_1 = require('@cycle/xstream-adapter');\n/**\n * Takes a `main` function and circularly connects it to the given collection\n * of driver functions.\n *\n * **Example:**\n * ```js\n * import {run} from '@cycle/xstream-run';\n * const dispose = run(main, drivers);\n * // ...\n * dispose();\n * ```\n *\n * The `main` function expects a collection of \"source\" streams (returned from\n * drivers) as input, and should return a collection of \"sink\" streams (to be\n * given to drivers). A \"collection of streams\" is a JavaScript object where\n * keys match the driver names registered by the `drivers` object, and values\n * are the streams. Refer to the documentation of each driver to see more\n * details on what types of sources it outputs and sinks it receives.\n *\n * @param {Function} main a function that takes `sources` as input and outputs\n * `sinks`.\n * @param {Object} drivers an object where keys are driver names and values\n * are driver functions.\n * @return {Function} a dispose function, used to terminate the execution of the\n * Cycle.js program, cleaning up resources used.\n * @function run\n */\nfunction run(main, drivers) {\n var run = base_1.default(main, drivers, { streamAdapter: xstream_adapter_1.default }).run;\n return run();\n}\nexports.run = run;\n/**\n * A function that prepares the Cycle application to be executed. Takes a `main`\n * function and prepares to circularly connects it to the given collection of\n * driver functions. As an output, `Cycle()` returns an object with three\n * properties: `sources`, `sinks` and `run`. Only when `run()` is called will\n * the application actually execute. Refer to the documentation of `run()` for\n * more details.\n *\n * **Example:**\n * ```js\n * import Cycle from '@cycle/xstream-run';\n * const {sources, sinks, run} = Cycle(main, drivers);\n * // ...\n * const dispose = run(); // Executes the application\n * // ...\n * dispose();\n * ```\n *\n * @param {Function} main a function that takes `sources` as input and outputs\n * `sinks`.\n * @param {Object} drivers an object where keys are driver names and values\n * are driver functions.\n * @return {Object} an object with three properties: `sources`, `sinks` and\n * `run`. `sources` is the collection of driver sources, `sinks` is the\n * collection of driver sinks, these can be used for debugging or testing. `run`\n * is the function that once called will execute the application.\n * @function Cycle\n */\nvar Cycle = function (main, drivers) {\n return base_1.default(main, drivers, { streamAdapter: xstream_adapter_1.default });\n};\nCycle.run = run;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Cycle;\n//# sourceMappingURL=index.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/xstream-run/lib/index.js\n ** module id = 133\n ** module chunks = 0\n **/","\"use strict\";\nfunction logToConsoleError(err) {\n var target = err.stack || err;\n if (console && console.error) {\n console.error(target);\n }\n else if (console && console.log) {\n console.log(target);\n }\n}\nfunction makeSinkProxies(drivers, streamAdapter) {\n var sinkProxies = {};\n for (var name_1 in drivers) {\n if (drivers.hasOwnProperty(name_1)) {\n var holdSubject = streamAdapter.makeSubject();\n var driverStreamAdapter = drivers[name_1].streamAdapter || streamAdapter;\n var stream = driverStreamAdapter.adapt(holdSubject.stream, streamAdapter.streamSubscribe);\n sinkProxies[name_1] = {\n stream: stream,\n observer: holdSubject.observer,\n };\n }\n }\n return sinkProxies;\n}\nfunction callDrivers(drivers, sinkProxies, streamAdapter) {\n var sources = {};\n for (var name_2 in drivers) {\n if (drivers.hasOwnProperty(name_2)) {\n var driverOutput = drivers[name_2](sinkProxies[name_2].stream, streamAdapter, name_2);\n var driverStreamAdapter = drivers[name_2].streamAdapter;\n if (driverStreamAdapter && driverStreamAdapter.isValidStream(driverOutput)) {\n sources[name_2] = streamAdapter.adapt(driverOutput, driverStreamAdapter.streamSubscribe);\n }\n else {\n sources[name_2] = driverOutput;\n }\n }\n }\n return sources;\n}\nfunction replicateMany(sinks, sinkProxies, streamAdapter) {\n var results = Object.keys(sinks)\n .filter(function (name) { return !!sinkProxies[name]; })\n .map(function (name) {\n return streamAdapter.streamSubscribe(sinks[name], {\n next: function (x) { sinkProxies[name].observer.next(x); },\n error: function (err) {\n logToConsoleError(err);\n sinkProxies[name].observer.error(err);\n },\n complete: function (x) {\n sinkProxies[name].observer.complete(x);\n }\n });\n });\n var disposeFunctions = results\n .filter(function (dispose) { return typeof dispose === 'function'; });\n return function () {\n disposeFunctions.forEach(function (dispose) { return dispose(); });\n };\n}\nfunction disposeSources(sources) {\n for (var k in sources) {\n if (sources.hasOwnProperty(k) && sources[k]\n && typeof sources[k].dispose === 'function') {\n sources[k].dispose();\n }\n }\n}\nvar isObjectEmpty = function (obj) { return Object.keys(obj).length === 0; };\nfunction Cycle(main, drivers, options) {\n if (typeof main !== \"function\") {\n throw new Error(\"First argument given to Cycle must be the 'main' \" +\n \"function.\");\n }\n if (typeof drivers !== \"object\" || drivers === null) {\n throw new Error(\"Second argument given to Cycle must be an object \" +\n \"with driver functions as properties.\");\n }\n if (isObjectEmpty(drivers)) {\n throw new Error(\"Second argument given to Cycle must be an object \" +\n \"with at least one driver function declared as a property.\");\n }\n var streamAdapter = options.streamAdapter;\n if (!streamAdapter || isObjectEmpty(streamAdapter)) {\n throw new Error(\"Third argument given to Cycle must be an options object \" +\n \"with the streamAdapter key supplied with a valid stream adapter.\");\n }\n var sinkProxies = makeSinkProxies(drivers, streamAdapter);\n var sources = callDrivers(drivers, sinkProxies, streamAdapter);\n var sinks = main(sources);\n if (typeof window !== 'undefined') {\n window.Cyclejs = { sinks: sinks };\n }\n var run = function () {\n var disposeReplication = replicateMany(sinks, sinkProxies, streamAdapter);\n return function () {\n disposeSources(sources);\n disposeReplication();\n };\n };\n return { sinks: sinks, sources: sources, run: run };\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Cycle;\n//# sourceMappingURL=index.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/xstream-run/~/@cycle/base/lib/index.js\n ** module id = 134\n ** module chunks = 0\n **/","\"use strict\";\nvar xstream_1 = require('xstream');\nvar XStreamAdapter = {\n adapt: function (originStream, originStreamSubscribe) {\n if (XStreamAdapter.isValidStream(originStream)) {\n return originStream;\n }\n ;\n var dispose = null;\n return xstream_1.default.create({\n start: function (out) {\n var observer = out;\n dispose = originStreamSubscribe(originStream, observer);\n },\n stop: function () {\n if (typeof dispose === 'function') {\n dispose();\n }\n }\n });\n },\n makeSubject: function () {\n var stream = xstream_1.default.create();\n var observer = {\n next: function (x) { stream.shamefullySendNext(x); },\n error: function (err) { stream.shamefullySendError(err); },\n complete: function () { stream.shamefullySendComplete(); }\n };\n return { observer: observer, stream: stream };\n },\n remember: function (stream) {\n return stream.remember();\n },\n isValidStream: function (stream) {\n return (typeof stream.addListener === 'function' &&\n typeof stream.shamefullySendNext === 'function');\n },\n streamSubscribe: function (stream, observer) {\n stream.addListener(observer);\n return function () { return stream.removeListener(observer); };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = XStreamAdapter;\n//# sourceMappingURL=index.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/xstream-run/~/@cycle/xstream-adapter/lib/index.js\n ** module id = 135\n ** module chunks = 0\n **/","import { Stream, Producer, Listener } from 'xstream';\n\nexport interface IPlanet {\n id: number;\n name: string;\n}\n\nexport class PlanetsSource {\n planet$: Stream;\n constructor() {\n const xs = Stream;\n const producer: Producer = {\n start: function (listener: Listener) {\n this.connection = new WebSocket('ws://localhost:4000');\n this.connection.onmessage =\n msg =>\n listener.next(JSON.parse(msg.data as string) as IPlanet);\n this.connection.onerror =\n err => listener.error(err);\n },\n stop: function () {\n this.connection.close();\n }\n };\n this.planet$ = xs.create(producer);\n }\n}\n\nexport function makePlanetsDriver() {\n function planetsDriver() {\n return new PlanetsSource();\n }\n return planetsDriver;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/drivers/planets.ts\n **/","import { Stream, Producer, Listener } from 'xstream';\nimport { HTTPSource, RequestOptions, Response, makeHTTPDriver } from '@cycle/http';\nimport { StreamAdapter } from '@cycle/base';\nimport XStreamAdapter from '@cycle/xstream-adapter';\n\ninterface IEntity {\n id: number;\n}\n\nexport interface INamedEntity extends IEntity {\n name: string;\n}\n\nexport interface ILinkableEntity extends IEntity {\n url: string;\n}\n\nexport interface IJedi extends INamedEntity {\n homeworld: INamedEntity;\n master: ILinkableEntity;\n apprentice: ILinkableEntity;\n}\n\nconst JEDI_URL = 'http://localhost:3000/dark-jedis/';\n\nexport class JedisSource {\n jedi$: Stream;\n constructor(jediRequest$: Stream) {\n const xs = Stream;\n const id$ = jediRequest$.filter(req => req !== -1);\n const cancel$ = jediRequest$.filter(req => req === -1).mapTo(true);\n const request$ =\n id$\n .map(id => {\n const requestOptions: RequestOptions = {\n url: JEDI_URL + id,\n category: 'jedis',\n lazy: true\n };\n return requestOptions;\n });\n const http: HTTPSource = makeHTTPDriver()(request$, XStreamAdapter);\n const cancel$$ = cancel$.mapTo(xs.of(null));\n const response$$: Stream> = http.select('jedis');\n this.jedi$ =\n xs\n .merge(response$$, cancel$$)\n .flatten()\n .filter(Boolean)\n .map(response => JSON.parse(response.text) as IJedi)\n .remember();\n }\n}\n\nexport function makeJedisDriver() {\n function jedisDriver(jediRequest$: Stream) {\n return new JedisSource(jediRequest$);\n }\n return jedisDriver;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/drivers/jedis.ts\n **/","\"use strict\";\n/**\n * HTTP Driver factory.\n *\n * This is a function which, when called, returns a HTTP Driver for Cycle.js\n * apps. The driver is also a function, and it takes a stream of requests as\n * input, and outputs an HTTP Source, an object with some functions to query for\n * response streams.\n *\n * **Requests**. The stream of requests should emit either strings or objects.\n * If the stream emits strings, those should be the URL of the remote resource\n * over HTTP. If the stream emits objects, these should be instructions how\n * superagent should execute the request. These objects follow a structure\n * similar to superagent's request API itself. `request` object properties:\n *\n * - `url` *(String)*: the remote resource path. **required**\n * - `method` *(String)*: HTTP Method for the request (GET, POST, PUT, etc).\n * - `category` *(String)*: an optional and arbitrary key that may be used in\n * the HTTP Source when querying for the response. E.g.\n * `sources.http.select(category)`\n * - `query` *(Object)*: an object with the payload for `GET` or `POST`.\n * - `send` *(Object)*: an object with the payload for `POST`.\n * - `headers` *(Object)*: object specifying HTTP headers.\n * - `accept` *(String)*: the Accept header.\n * - `type` *(String)*: a short-hand for setting Content-Type.\n * - `user` *(String)*: username for authentication.\n * - `password` *(String)*: password for authentication.\n * - `field` *(Object)*: object where key/values are Form fields.\n * - `progress` *(Boolean)*: whether or not to detect and emit progress events\n * on the response Observable.\n * - `attach` *(Array)*: array of objects, where each object specifies `name`,\n * `path`, and `filename` of a resource to upload.\n * - `withCredentials` *(Boolean)*: enables the ability to send cookies from the\n * origin.\n * - `redirects` *(Number)*: number of redirects to follow.\n * - `lazy` *(Boolean)*: whether or not this request runs lazily, which means\n * the request happens if and only if its corresponding response stream from the\n * HTTP Source is subscribed to. By default this value is false: requests run\n * eagerly, even if their response is ignored by the application.\n *\n * **Responses**. A metastream is a stream that emits streams. The HTTP Source\n * manages response metastreams. These streams of responses have a `request`\n * field attached to them (to the stream object itself) indicating which request\n * (from the driver input) generated this response streams. The HTTP Source has\n * functions `filter()` and `select()`, but is not itself a stream. So you can\n * call `sources.HTTP.filter(request => request.url === X)` to get a new HTTP\n * Source object which is filtered for response streams that match the condition\n * given, and may call `sources.HTTP.select(category)` to get a metastream of\n * response that match the category key. With an HTTP Source, you can also call\n * `httpSource.select()` with no param to get the metastream. You should flatten\n * the metastream before consuming it, then the resulting response stream will\n * emit the response object received through superagent.\n *\n * @return {Function} the HTTP Driver function\n * @function makeHTTPDriver\n */\nvar http_driver_1 = require('./http-driver');\nexports.makeHTTPDriver = http_driver_1.makeHTTPDriver;\n//# sourceMappingURL=index.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/http/lib/index.js\n ** module id = 138\n ** module chunks = 0\n **/","\"use strict\";\nvar xstream_1 = require('xstream');\nvar MainHTTPSource_1 = require('./MainHTTPSource');\nvar xstream_adapter_1 = require('@cycle/xstream-adapter');\nvar superagent = require('superagent');\nfunction preprocessReqOptions(reqOptions) {\n reqOptions.withCredentials = reqOptions.withCredentials || false;\n reqOptions.redirects = typeof reqOptions.redirects === 'number' ? reqOptions.redirects : 5;\n reqOptions.method = reqOptions.method || \"get\";\n return reqOptions;\n}\nfunction optionsToSuperagent(rawReqOptions) {\n var reqOptions = preprocessReqOptions(rawReqOptions);\n if (typeof reqOptions.url !== \"string\") {\n throw new Error(\"Please provide a `url` property in the request options.\");\n }\n var lowerCaseMethod = reqOptions.method.toLowerCase();\n var sanitizedMethod = lowerCaseMethod === \"delete\" ? \"del\" : lowerCaseMethod;\n var request = superagent[sanitizedMethod](reqOptions.url);\n if (typeof request.redirects === \"function\") {\n request = request.redirects(reqOptions.redirects);\n }\n if (reqOptions.type) {\n request = request.type(reqOptions.type);\n }\n if (reqOptions.send) {\n request = request.send(reqOptions.send);\n }\n if (reqOptions.accept) {\n request = request.accept(reqOptions.accept);\n }\n if (reqOptions.query) {\n request = request.query(reqOptions.query);\n }\n if (reqOptions.withCredentials) {\n request = request.withCredentials();\n }\n if (typeof reqOptions.user === 'string' && typeof reqOptions.password === 'string') {\n request = request.auth(reqOptions.user, reqOptions.password);\n }\n if (reqOptions.headers) {\n for (var key in reqOptions.headers) {\n if (reqOptions.headers.hasOwnProperty(key)) {\n request = request.set(key, reqOptions.headers[key]);\n }\n }\n }\n if (reqOptions.field) {\n for (var key in reqOptions.field) {\n if (reqOptions.field.hasOwnProperty(key)) {\n request = request.field(key, reqOptions.field[key]);\n }\n }\n }\n if (reqOptions.attach) {\n for (var i = reqOptions.attach.length - 1; i >= 0; i--) {\n var a = reqOptions.attach[i];\n request = request.attach(a.name, a.path, a.filename);\n }\n }\n return request;\n}\nexports.optionsToSuperagent = optionsToSuperagent;\nfunction createResponse$(reqInput) {\n return xstream_1.default.create({\n start: function startResponseStream(listener) {\n try {\n var reqOptions_1 = normalizeRequestInput(reqInput);\n this.request = optionsToSuperagent(reqOptions_1);\n if (reqOptions_1.progress) {\n this.request = this.request.on('progress', function (res) {\n res.request = reqOptions_1;\n listener.next(res);\n });\n }\n this.request.end(function (err, res) {\n if (err) {\n listener.error(err);\n }\n else {\n res.request = reqOptions_1;\n listener.next(res);\n listener.complete();\n }\n });\n }\n catch (err) {\n listener.error(err);\n }\n },\n stop: function stopResponseStream() {\n if (this.request && this.request.abort) {\n this.request.abort();\n }\n },\n });\n}\nexports.createResponse$ = createResponse$;\nfunction softNormalizeRequestInput(reqInput) {\n var reqOptions;\n try {\n reqOptions = normalizeRequestInput(reqInput);\n }\n catch (err) {\n reqOptions = { url: 'Error', _error: err };\n }\n return reqOptions;\n}\nfunction normalizeRequestInput(reqOptions) {\n if (typeof reqOptions === 'string') {\n return { url: reqOptions };\n }\n else if (typeof reqOptions === 'object') {\n return reqOptions;\n }\n else {\n throw new Error(\"Observable of requests given to HTTP Driver must emit \" +\n \"either URL strings or objects with parameters.\");\n }\n}\nfunction makeRequestInputToResponse$(runStreamAdapter) {\n return function requestInputToResponse$(reqInput) {\n var response$ = createResponse$(reqInput).remember();\n var reqOptions = softNormalizeRequestInput(reqInput);\n if (!reqOptions.lazy) {\n /* tslint:disable:no-empty */\n response$.addListener({ next: function () { }, error: function () { }, complete: function () { } });\n }\n response$ = (runStreamAdapter) ?\n runStreamAdapter.adapt(response$, xstream_adapter_1.default.streamSubscribe) :\n response$;\n Object.defineProperty(response$, 'request', {\n value: reqOptions,\n writable: false,\n });\n return response$;\n };\n}\nfunction makeHTTPDriver() {\n function httpDriver(request$, runSA, name) {\n var response$$ = request$\n .map(makeRequestInputToResponse$(runSA));\n var httpSource = new MainHTTPSource_1.MainHTTPSource(response$$, runSA, name, []);\n /* tslint:disable:no-empty */\n response$$.addListener({ next: function () { }, error: function () { }, complete: function () { } });\n /* tslint:enable:no-empty */\n return httpSource;\n }\n httpDriver.streamAdapter = xstream_adapter_1.default;\n return httpDriver;\n}\nexports.makeHTTPDriver = makeHTTPDriver;\n//# sourceMappingURL=http-driver.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/http/lib/http-driver.js\n ** module id = 139\n ** module chunks = 0\n **/","\"use strict\";\nvar isolate_1 = require('./isolate');\nvar xstream_adapter_1 = require('@cycle/xstream-adapter');\nvar MainHTTPSource = (function () {\n function MainHTTPSource(_res$$, runStreamAdapter, _name, _namespace) {\n if (_namespace === void 0) { _namespace = []; }\n this._res$$ = _res$$;\n this.runStreamAdapter = runStreamAdapter;\n this._name = _name;\n this._namespace = _namespace;\n this.isolateSource = isolate_1.isolateSource;\n this.isolateSink = isolate_1.isolateSink;\n }\n MainHTTPSource.prototype.filter = function (predicate) {\n var filteredResponse$$ = this._res$$.filter(function (r$) { return predicate(r$.request); });\n return new MainHTTPSource(filteredResponse$$, this.runStreamAdapter, this._name, this._namespace);\n };\n MainHTTPSource.prototype.select = function (category) {\n var res$$ = this._res$$;\n if (category) {\n res$$ = this._res$$.filter(function (res$) { return res$.request && res$.request.category === category; });\n }\n var out = this.runStreamAdapter.adapt(res$$, xstream_adapter_1.default.streamSubscribe);\n out._isCycleSource = this._name;\n return out;\n };\n return MainHTTPSource;\n}());\nexports.MainHTTPSource = MainHTTPSource;\n//# sourceMappingURL=MainHTTPSource.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/http/lib/MainHTTPSource.js\n ** module id = 140\n ** module chunks = 0\n **/","\"use strict\";\nfunction isolateSource(httpSource, scope) {\n return httpSource.filter(function (request) {\n return Array.isArray(request._namespace) &&\n request._namespace.indexOf(scope) !== -1;\n });\n}\nexports.isolateSource = isolateSource;\nfunction isolateSink(request$, scope) {\n return request$.map(function (req) {\n if (typeof req === \"string\") {\n return { url: req, _namespace: [scope] };\n }\n var reqOptions = req;\n reqOptions._namespace = reqOptions._namespace || [];\n reqOptions._namespace.push(scope);\n return reqOptions;\n });\n}\nexports.isolateSink = isolateSink;\n//# sourceMappingURL=isolate.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/http/lib/isolate.js\n ** module id = 141\n ** module chunks = 0\n **/","\"use strict\";\nvar xstream_1 = require('xstream');\nvar XStreamAdapter = {\n adapt: function (originStream, originStreamSubscribe) {\n if (XStreamAdapter.isValidStream(originStream)) {\n return originStream;\n }\n ;\n var dispose = null;\n return xstream_1.default.create({\n start: function (out) {\n var observer = out;\n dispose = originStreamSubscribe(originStream, observer);\n },\n stop: function () {\n if (typeof dispose === 'function') {\n dispose();\n }\n }\n });\n },\n makeSubject: function () {\n var stream = xstream_1.default.create();\n var observer = {\n next: function (x) { stream.shamefullySendNext(x); },\n error: function (err) { stream.shamefullySendError(err); },\n complete: function () { stream.shamefullySendComplete(); }\n };\n return { observer: observer, stream: stream };\n },\n remember: function (stream) {\n return stream.remember();\n },\n isValidStream: function (stream) {\n return (typeof stream.addListener === 'function' &&\n typeof stream.shamefullySendNext === 'function');\n },\n streamSubscribe: function (stream, observer) {\n stream.addListener(observer);\n return function () { return stream.removeListener(observer); };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = XStreamAdapter;\n//# sourceMappingURL=index.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/@cycle/xstream-adapter/lib/index.js\n ** module id = 142\n ** module chunks = 0\n **/","/**\n * Root reference for iframes.\n */\n\nvar root;\nif (typeof window !== 'undefined') { // Browser window\n root = window;\n} else if (typeof self !== 'undefined') { // Web Worker\n root = self;\n} else { // Other environments\n console.warn(\"Using browser-only version of superagent in non-browser environment\");\n root = this;\n}\n\nvar Emitter = require('emitter');\nvar requestBase = require('./request-base');\nvar isObject = require('./is-object');\n\n/**\n * Noop.\n */\n\nfunction noop(){};\n\n/**\n * Expose `request`.\n */\n\nvar request = module.exports = require('./request').bind(null, Request);\n\n/**\n * Determine XHR.\n */\n\nrequest.getXHR = function () {\n if (root.XMLHttpRequest\n && (!root.location || 'file:' != root.location.protocol\n || !root.ActiveXObject)) {\n return new XMLHttpRequest;\n } else {\n try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {}\n try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {}\n try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {}\n try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {}\n }\n throw Error(\"Browser-only verison of superagent could not find XHR\");\n};\n\n/**\n * Removes leading and trailing whitespace, added to support IE.\n *\n * @param {String} s\n * @return {String}\n * @api private\n */\n\nvar trim = ''.trim\n ? function(s) { return s.trim(); }\n : function(s) { return s.replace(/(^\\s*|\\s*$)/g, ''); };\n\n/**\n * Serialize the given `obj`.\n *\n * @param {Object} obj\n * @return {String}\n * @api private\n */\n\nfunction serialize(obj) {\n if (!isObject(obj)) return obj;\n var pairs = [];\n for (var key in obj) {\n if (null != obj[key]) {\n pushEncodedKeyValuePair(pairs, key, obj[key]);\n }\n }\n return pairs.join('&');\n}\n\n/**\n * Helps 'serialize' with serializing arrays.\n * Mutates the pairs array.\n *\n * @param {Array} pairs\n * @param {String} key\n * @param {Mixed} val\n */\n\nfunction pushEncodedKeyValuePair(pairs, key, val) {\n if (Array.isArray(val)) {\n return val.forEach(function(v) {\n pushEncodedKeyValuePair(pairs, key, v);\n });\n } else if (isObject(val)) {\n for(var subkey in val) {\n pushEncodedKeyValuePair(pairs, key + '[' + subkey + ']', val[subkey]);\n }\n return;\n }\n pairs.push(encodeURIComponent(key)\n + '=' + encodeURIComponent(val));\n}\n\n/**\n * Expose serialization method.\n */\n\n request.serializeObject = serialize;\n\n /**\n * Parse the given x-www-form-urlencoded `str`.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction parseString(str) {\n var obj = {};\n var pairs = str.split('&');\n var pair;\n var pos;\n\n for (var i = 0, len = pairs.length; i < len; ++i) {\n pair = pairs[i];\n pos = pair.indexOf('=');\n if (pos == -1) {\n obj[decodeURIComponent(pair)] = '';\n } else {\n obj[decodeURIComponent(pair.slice(0, pos))] =\n decodeURIComponent(pair.slice(pos + 1));\n }\n }\n\n return obj;\n}\n\n/**\n * Expose parser.\n */\n\nrequest.parseString = parseString;\n\n/**\n * Default MIME type map.\n *\n * superagent.types.xml = 'application/xml';\n *\n */\n\nrequest.types = {\n html: 'text/html',\n json: 'application/json',\n xml: 'application/xml',\n urlencoded: 'application/x-www-form-urlencoded',\n 'form': 'application/x-www-form-urlencoded',\n 'form-data': 'application/x-www-form-urlencoded'\n};\n\n/**\n * Default serialization map.\n *\n * superagent.serialize['application/xml'] = function(obj){\n * return 'generated xml here';\n * };\n *\n */\n\n request.serialize = {\n 'application/x-www-form-urlencoded': serialize,\n 'application/json': JSON.stringify\n };\n\n /**\n * Default parsers.\n *\n * superagent.parse['application/xml'] = function(str){\n * return { object parsed from str };\n * };\n *\n */\n\nrequest.parse = {\n 'application/x-www-form-urlencoded': parseString,\n 'application/json': JSON.parse\n};\n\n/**\n * Parse the given header `str` into\n * an object containing the mapped fields.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction parseHeader(str) {\n var lines = str.split(/\\r?\\n/);\n var fields = {};\n var index;\n var line;\n var field;\n var val;\n\n lines.pop(); // trailing CRLF\n\n for (var i = 0, len = lines.length; i < len; ++i) {\n line = lines[i];\n index = line.indexOf(':');\n field = line.slice(0, index).toLowerCase();\n val = trim(line.slice(index + 1));\n fields[field] = val;\n }\n\n return fields;\n}\n\n/**\n * Check if `mime` is json or has +json structured syntax suffix.\n *\n * @param {String} mime\n * @return {Boolean}\n * @api private\n */\n\nfunction isJSON(mime) {\n return /[\\/+]json\\b/.test(mime);\n}\n\n/**\n * Return the mime type for the given `str`.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nfunction type(str){\n return str.split(/ *; */).shift();\n};\n\n/**\n * Return header field parameters.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction params(str){\n return str.split(/ *; */).reduce(function(obj, str){\n var parts = str.split(/ *= */),\n key = parts.shift(),\n val = parts.shift();\n\n if (key && val) obj[key] = val;\n return obj;\n }, {});\n};\n\n/**\n * Initialize a new `Response` with the given `xhr`.\n *\n * - set flags (.ok, .error, etc)\n * - parse header\n *\n * Examples:\n *\n * Aliasing `superagent` as `request` is nice:\n *\n * request = superagent;\n *\n * We can use the promise-like API, or pass callbacks:\n *\n * request.get('/').end(function(res){});\n * request.get('/', function(res){});\n *\n * Sending data can be chained:\n *\n * request\n * .post('/user')\n * .send({ name: 'tj' })\n * .end(function(res){});\n *\n * Or passed to `.send()`:\n *\n * request\n * .post('/user')\n * .send({ name: 'tj' }, function(res){});\n *\n * Or passed to `.post()`:\n *\n * request\n * .post('/user', { name: 'tj' })\n * .end(function(res){});\n *\n * Or further reduced to a single call for simple cases:\n *\n * request\n * .post('/user', { name: 'tj' }, function(res){});\n *\n * @param {XMLHTTPRequest} xhr\n * @param {Object} options\n * @api private\n */\n\nfunction Response(req, options) {\n options = options || {};\n this.req = req;\n this.xhr = this.req.xhr;\n // responseText is accessible only if responseType is '' or 'text' and on older browsers\n this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined')\n ? this.xhr.responseText\n : null;\n this.statusText = this.req.xhr.statusText;\n this._setStatusProperties(this.xhr.status);\n this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders());\n // getAllResponseHeaders sometimes falsely returns \"\" for CORS requests, but\n // getResponseHeader still works. so we get content-type even if getting\n // other headers fails.\n this.header['content-type'] = this.xhr.getResponseHeader('content-type');\n this._setHeaderProperties(this.header);\n this.body = this.req.method != 'HEAD'\n ? this._parseBody(this.text ? this.text : this.xhr.response)\n : null;\n}\n\n/**\n * Get case-insensitive `field` value.\n *\n * @param {String} field\n * @return {String}\n * @api public\n */\n\nResponse.prototype.get = function(field){\n return this.header[field.toLowerCase()];\n};\n\n/**\n * Set header related properties:\n *\n * - `.type` the content type without params\n *\n * A response of \"Content-Type: text/plain; charset=utf-8\"\n * will provide you with a `.type` of \"text/plain\".\n *\n * @param {Object} header\n * @api private\n */\n\nResponse.prototype._setHeaderProperties = function(header){\n // content-type\n var ct = this.header['content-type'] || '';\n this.type = type(ct);\n\n // params\n var obj = params(ct);\n for (var key in obj) this[key] = obj[key];\n};\n\n/**\n * Parse the given body `str`.\n *\n * Used for auto-parsing of bodies. Parsers\n * are defined on the `superagent.parse` object.\n *\n * @param {String} str\n * @return {Mixed}\n * @api private\n */\n\nResponse.prototype._parseBody = function(str){\n var parse = request.parse[this.type];\n if (!parse && isJSON(this.type)) {\n parse = request.parse['application/json'];\n }\n return parse && str && (str.length || str instanceof Object)\n ? parse(str)\n : null;\n};\n\n/**\n * Set flags such as `.ok` based on `status`.\n *\n * For example a 2xx response will give you a `.ok` of __true__\n * whereas 5xx will be __false__ and `.error` will be __true__. The\n * `.clientError` and `.serverError` are also available to be more\n * specific, and `.statusType` is the class of error ranging from 1..5\n * sometimes useful for mapping respond colors etc.\n *\n * \"sugar\" properties are also defined for common cases. Currently providing:\n *\n * - .noContent\n * - .badRequest\n * - .unauthorized\n * - .notAcceptable\n * - .notFound\n *\n * @param {Number} status\n * @api private\n */\n\nResponse.prototype._setStatusProperties = function(status){\n // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request\n if (status === 1223) {\n status = 204;\n }\n\n var type = status / 100 | 0;\n\n // status / class\n this.status = this.statusCode = status;\n this.statusType = type;\n\n // basics\n this.info = 1 == type;\n this.ok = 2 == type;\n this.clientError = 4 == type;\n this.serverError = 5 == type;\n this.error = (4 == type || 5 == type)\n ? this.toError()\n : false;\n\n // sugar\n this.accepted = 202 == status;\n this.noContent = 204 == status;\n this.badRequest = 400 == status;\n this.unauthorized = 401 == status;\n this.notAcceptable = 406 == status;\n this.notFound = 404 == status;\n this.forbidden = 403 == status;\n};\n\n/**\n * Return an `Error` representative of this response.\n *\n * @return {Error}\n * @api public\n */\n\nResponse.prototype.toError = function(){\n var req = this.req;\n var method = req.method;\n var url = req.url;\n\n var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')';\n var err = new Error(msg);\n err.status = this.status;\n err.method = method;\n err.url = url;\n\n return err;\n};\n\n/**\n * Expose `Response`.\n */\n\nrequest.Response = Response;\n\n/**\n * Initialize a new `Request` with the given `method` and `url`.\n *\n * @param {String} method\n * @param {String} url\n * @api public\n */\n\nfunction Request(method, url) {\n var self = this;\n this._query = this._query || [];\n this.method = method;\n this.url = url;\n this.header = {}; // preserves header name case\n this._header = {}; // coerces header names to lowercase\n this.on('end', function(){\n var err = null;\n var res = null;\n\n try {\n res = new Response(self);\n } catch(e) {\n err = new Error('Parser is unable to parse the response');\n err.parse = true;\n err.original = e;\n // issue #675: return the raw response if the response parsing fails\n err.rawResponse = self.xhr && self.xhr.responseText ? self.xhr.responseText : null;\n // issue #876: return the http status code if the response parsing fails\n err.statusCode = self.xhr && self.xhr.status ? self.xhr.status : null;\n return self.callback(err);\n }\n\n self.emit('response', res);\n\n var new_err;\n try {\n if (res.status < 200 || res.status >= 300) {\n new_err = new Error(res.statusText || 'Unsuccessful HTTP response');\n new_err.original = err;\n new_err.response = res;\n new_err.status = res.status;\n }\n } catch(e) {\n new_err = e; // #985 touching res may cause INVALID_STATE_ERR on old Android\n }\n\n // #1000 don't catch errors from the callback to avoid double calling it\n if (new_err) {\n self.callback(new_err, res);\n } else {\n self.callback(null, res);\n }\n });\n}\n\n/**\n * Mixin `Emitter` and `requestBase`.\n */\n\nEmitter(Request.prototype);\nfor (var key in requestBase) {\n Request.prototype[key] = requestBase[key];\n}\n\n/**\n * Set Content-Type to `type`, mapping values from `request.types`.\n *\n * Examples:\n *\n * superagent.types.xml = 'application/xml';\n *\n * request.post('/')\n * .type('xml')\n * .send(xmlstring)\n * .end(callback);\n *\n * request.post('/')\n * .type('application/xml')\n * .send(xmlstring)\n * .end(callback);\n *\n * @param {String} type\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.type = function(type){\n this.set('Content-Type', request.types[type] || type);\n return this;\n};\n\n/**\n * Set responseType to `val`. Presently valid responseTypes are 'blob' and\n * 'arraybuffer'.\n *\n * Examples:\n *\n * req.get('/')\n * .responseType('blob')\n * .end(callback);\n *\n * @param {String} val\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.responseType = function(val){\n this._responseType = val;\n return this;\n};\n\n/**\n * Set Accept to `type`, mapping values from `request.types`.\n *\n * Examples:\n *\n * superagent.types.json = 'application/json';\n *\n * request.get('/agent')\n * .accept('json')\n * .end(callback);\n *\n * request.get('/agent')\n * .accept('application/json')\n * .end(callback);\n *\n * @param {String} accept\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.accept = function(type){\n this.set('Accept', request.types[type] || type);\n return this;\n};\n\n/**\n * Set Authorization field value with `user` and `pass`.\n *\n * @param {String} user\n * @param {String} pass\n * @param {Object} options with 'type' property 'auto' or 'basic' (default 'basic')\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.auth = function(user, pass, options){\n if (!options) {\n options = {\n type: 'basic'\n }\n }\n\n switch (options.type) {\n case 'basic':\n var str = btoa(user + ':' + pass);\n this.set('Authorization', 'Basic ' + str);\n break;\n\n case 'auto':\n this.username = user;\n this.password = pass;\n break;\n }\n return this;\n};\n\n/**\n* Add query-string `val`.\n*\n* Examples:\n*\n* request.get('/shoes')\n* .query('size=10')\n* .query({ color: 'blue' })\n*\n* @param {Object|String} val\n* @return {Request} for chaining\n* @api public\n*/\n\nRequest.prototype.query = function(val){\n if ('string' != typeof val) val = serialize(val);\n if (val) this._query.push(val);\n return this;\n};\n\n/**\n * Queue the given `file` as an attachment to the specified `field`,\n * with optional `filename`.\n *\n * ``` js\n * request.post('/upload')\n * .attach('content', new Blob(['hey!'], { type: \"text/html\"}))\n * .end(callback);\n * ```\n *\n * @param {String} field\n * @param {Blob|File} file\n * @param {String} filename\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.attach = function(field, file, filename){\n this._getFormData().append(field, file, filename || file.name);\n return this;\n};\n\nRequest.prototype._getFormData = function(){\n if (!this._formData) {\n this._formData = new root.FormData();\n }\n return this._formData;\n};\n\n/**\n * Invoke the callback with `err` and `res`\n * and handle arity check.\n *\n * @param {Error} err\n * @param {Response} res\n * @api private\n */\n\nRequest.prototype.callback = function(err, res){\n var fn = this._callback;\n this.clearTimeout();\n fn(err, res);\n};\n\n/**\n * Invoke callback with x-domain error.\n *\n * @api private\n */\n\nRequest.prototype.crossDomainError = function(){\n var err = new Error('Request has been terminated\\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.');\n err.crossDomain = true;\n\n err.status = this.status;\n err.method = this.method;\n err.url = this.url;\n\n this.callback(err);\n};\n\n/**\n * Invoke callback with timeout error.\n *\n * @api private\n */\n\nRequest.prototype._timeoutError = function(){\n var timeout = this._timeout;\n var err = new Error('timeout of ' + timeout + 'ms exceeded');\n err.timeout = timeout;\n this.callback(err);\n};\n\n/**\n * Compose querystring to append to req.url\n *\n * @api private\n */\n\nRequest.prototype._appendQueryString = function(){\n var query = this._query.join('&');\n if (query) {\n this.url += ~this.url.indexOf('?')\n ? '&' + query\n : '?' + query;\n }\n};\n\n/**\n * Initiate request, invoking callback `fn(res)`\n * with an instanceof `Response`.\n *\n * @param {Function} fn\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.end = function(fn){\n var self = this;\n var xhr = this.xhr = request.getXHR();\n var timeout = this._timeout;\n var data = this._formData || this._data;\n\n // store callback\n this._callback = fn || noop;\n\n // state change\n xhr.onreadystatechange = function(){\n if (4 != xhr.readyState) return;\n\n // In IE9, reads to any property (e.g. status) off of an aborted XHR will\n // result in the error \"Could not complete the operation due to error c00c023f\"\n var status;\n try { status = xhr.status } catch(e) { status = 0; }\n\n if (0 == status) {\n if (self.timedout) return self._timeoutError();\n if (self._aborted) return;\n return self.crossDomainError();\n }\n self.emit('end');\n };\n\n // progress\n var handleProgress = function(e){\n if (e.total > 0) {\n e.percent = e.loaded / e.total * 100;\n }\n e.direction = 'download';\n self.emit('progress', e);\n };\n if (this.hasListeners('progress')) {\n xhr.onprogress = handleProgress;\n }\n try {\n if (xhr.upload && this.hasListeners('progress')) {\n xhr.upload.onprogress = handleProgress;\n }\n } catch(e) {\n // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist.\n // Reported here:\n // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context\n }\n\n // timeout\n if (timeout && !this._timer) {\n this._timer = setTimeout(function(){\n self.timedout = true;\n self.abort();\n }, timeout);\n }\n\n // querystring\n this._appendQueryString();\n\n // initiate request\n if (this.username && this.password) {\n xhr.open(this.method, this.url, true, this.username, this.password);\n } else {\n xhr.open(this.method, this.url, true);\n }\n\n // CORS\n if (this._withCredentials) xhr.withCredentials = true;\n\n // body\n if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !this._isHost(data)) {\n // serialize stuff\n var contentType = this._header['content-type'];\n var serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : ''];\n if (!serialize && isJSON(contentType)) serialize = request.serialize['application/json'];\n if (serialize) data = serialize(data);\n }\n\n // set header fields\n for (var field in this.header) {\n if (null == this.header[field]) continue;\n xhr.setRequestHeader(field, this.header[field]);\n }\n\n if (this._responseType) {\n xhr.responseType = this._responseType;\n }\n\n // send stuff\n this.emit('request', this);\n\n // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing)\n // We need null here if data is undefined\n xhr.send(typeof data !== 'undefined' ? data : null);\n return this;\n};\n\n\n/**\n * Expose `Request`.\n */\n\nrequest.Request = Request;\n\n/**\n * GET `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.get = function(url, data, fn){\n var req = request('GET', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.query(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * HEAD `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.head = function(url, data, fn){\n var req = request('HEAD', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * OPTIONS query to `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.options = function(url, data, fn){\n var req = request('OPTIONS', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * DELETE `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nfunction del(url, fn){\n var req = request('DELETE', url);\n if (fn) req.end(fn);\n return req;\n};\n\nrequest['del'] = del;\nrequest['delete'] = del;\n\n/**\n * PATCH `url` with optional `data` and callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed} [data]\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.patch = function(url, data, fn){\n var req = request('PATCH', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * POST `url` with optional `data` and callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed} [data]\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.post = function(url, data, fn){\n var req = request('POST', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * PUT `url` with optional `data` and callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.put = function(url, data, fn){\n var req = request('PUT', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/superagent/lib/client.js\n ** module id = 143\n ** module chunks = 0\n **/","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n var args = [].slice.call(arguments, 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/component-emitter/index.js\n ** module id = 144\n ** module chunks = 0\n **/","/**\n * Module of mixed-in functions shared between node and client code\n */\nvar isObject = require('./is-object');\n\n/**\n * Clear previous timeout.\n *\n * @return {Request} for chaining\n * @api public\n */\n\nexports.clearTimeout = function _clearTimeout(){\n this._timeout = 0;\n clearTimeout(this._timer);\n return this;\n};\n\n/**\n * Override default response body parser\n *\n * This function will be called to convert incoming data into request.body\n *\n * @param {Function}\n * @api public\n */\n\nexports.parse = function parse(fn){\n this._parser = fn;\n return this;\n};\n\n/**\n * Override default request body serializer\n *\n * This function will be called to convert data set via .send or .attach into payload to send\n *\n * @param {Function}\n * @api public\n */\n\nexports.serialize = function serialize(fn){\n this._serializer = fn;\n return this;\n};\n\n/**\n * Set timeout to `ms`.\n *\n * @param {Number} ms\n * @return {Request} for chaining\n * @api public\n */\n\nexports.timeout = function timeout(ms){\n this._timeout = ms;\n return this;\n};\n\n/**\n * Promise support\n *\n * @param {Function} resolve\n * @param {Function} reject\n * @return {Request}\n */\n\nexports.then = function then(resolve, reject) {\n if (!this._fullfilledPromise) {\n var self = this;\n this._fullfilledPromise = new Promise(function(innerResolve, innerReject){\n self.end(function(err, res){\n if (err) innerReject(err); else innerResolve(res);\n });\n });\n }\n return this._fullfilledPromise.then(resolve, reject);\n}\n\n/**\n * Allow for extension\n */\n\nexports.use = function use(fn) {\n fn(this);\n return this;\n}\n\n\n/**\n * Get request header `field`.\n * Case-insensitive.\n *\n * @param {String} field\n * @return {String}\n * @api public\n */\n\nexports.get = function(field){\n return this._header[field.toLowerCase()];\n};\n\n/**\n * Get case-insensitive header `field` value.\n * This is a deprecated internal API. Use `.get(field)` instead.\n *\n * (getHeader is no longer used internally by the superagent code base)\n *\n * @param {String} field\n * @return {String}\n * @api private\n * @deprecated\n */\n\nexports.getHeader = exports.get;\n\n/**\n * Set header `field` to `val`, or multiple fields with one object.\n * Case-insensitive.\n *\n * Examples:\n *\n * req.get('/')\n * .set('Accept', 'application/json')\n * .set('X-API-Key', 'foobar')\n * .end(callback);\n *\n * req.get('/')\n * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' })\n * .end(callback);\n *\n * @param {String|Object} field\n * @param {String} val\n * @return {Request} for chaining\n * @api public\n */\n\nexports.set = function(field, val){\n if (isObject(field)) {\n for (var key in field) {\n this.set(key, field[key]);\n }\n return this;\n }\n this._header[field.toLowerCase()] = val;\n this.header[field] = val;\n return this;\n};\n\n/**\n * Remove header `field`.\n * Case-insensitive.\n *\n * Example:\n *\n * req.get('/')\n * .unset('User-Agent')\n * .end(callback);\n *\n * @param {String} field\n */\nexports.unset = function(field){\n delete this._header[field.toLowerCase()];\n delete this.header[field];\n return this;\n};\n\n/**\n * Write the field `name` and `val` for \"multipart/form-data\"\n * request bodies.\n *\n * ``` js\n * request.post('/upload')\n * .field('foo', 'bar')\n * .end(callback);\n * ```\n *\n * @param {String} name\n * @param {String|Blob|File|Buffer|fs.ReadStream} val\n * @return {Request} for chaining\n * @api public\n */\nexports.field = function(name, val) {\n this._getFormData().append(name, val);\n return this;\n};\n\n/**\n * Abort the request, and clear potential timeout.\n *\n * @return {Request}\n * @api public\n */\nexports.abort = function(){\n if (this._aborted) {\n return this;\n }\n this._aborted = true;\n this.xhr && this.xhr.abort(); // browser\n this.req && this.req.abort(); // node\n this.clearTimeout();\n this.emit('abort');\n return this;\n};\n\n/**\n * Enable transmission of cookies with x-domain requests.\n *\n * Note that for this to work the origin must not be\n * using \"Access-Control-Allow-Origin\" with a wildcard,\n * and also must set \"Access-Control-Allow-Credentials\"\n * to \"true\".\n *\n * @api public\n */\n\nexports.withCredentials = function(){\n // This is browser-only functionality. Node side is no-op.\n this._withCredentials = true;\n return this;\n};\n\n/**\n * Set the max redirects to `n`. Does noting in browser XHR implementation.\n *\n * @param {Number} n\n * @return {Request} for chaining\n * @api public\n */\n\nexports.redirects = function(n){\n this._maxRedirects = n;\n return this;\n};\n\n/**\n * Convert to a plain javascript object (not JSON string) of scalar properties.\n * Note as this method is designed to return a useful non-this value,\n * it cannot be chained.\n *\n * @return {Object} describing method, url, and data of this request\n * @api public\n */\n\nexports.toJSON = function(){\n return {\n method: this.method,\n url: this.url,\n data: this._data,\n headers: this._header\n };\n};\n\n/**\n * Check if `obj` is a host object,\n * we don't want to serialize these :)\n *\n * TODO: future proof, move to compoent land\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\nexports._isHost = function _isHost(obj) {\n var str = {}.toString.call(obj);\n\n switch (str) {\n case '[object File]':\n case '[object Blob]':\n case '[object FormData]':\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Send `data` as the request body, defaulting the `.type()` to \"json\" when\n * an object is given.\n *\n * Examples:\n *\n * // manual json\n * request.post('/user')\n * .type('json')\n * .send('{\"name\":\"tj\"}')\n * .end(callback)\n *\n * // auto json\n * request.post('/user')\n * .send({ name: 'tj' })\n * .end(callback)\n *\n * // manual x-www-form-urlencoded\n * request.post('/user')\n * .type('form')\n * .send('name=tj')\n * .end(callback)\n *\n * // auto x-www-form-urlencoded\n * request.post('/user')\n * .type('form')\n * .send({ name: 'tj' })\n * .end(callback)\n *\n * // defaults to x-www-form-urlencoded\n * request.post('/user')\n * .send('name=tobi')\n * .send('species=ferret')\n * .end(callback)\n *\n * @param {String|Object} data\n * @return {Request} for chaining\n * @api public\n */\n\nexports.send = function(data){\n var obj = isObject(data);\n var type = this._header['content-type'];\n\n // merge\n if (obj && isObject(this._data)) {\n for (var key in data) {\n this._data[key] = data[key];\n }\n } else if ('string' == typeof data) {\n // default to x-www-form-urlencoded\n if (!type) this.type('form');\n type = this._header['content-type'];\n if ('application/x-www-form-urlencoded' == type) {\n this._data = this._data\n ? this._data + '&' + data\n : data;\n } else {\n this._data = (this._data || '') + data;\n }\n } else {\n this._data = data;\n }\n\n if (!obj || this._isHost(data)) return this;\n\n // default to json\n if (!type) this.type('json');\n return this;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/superagent/lib/request-base.js\n ** module id = 145\n ** module chunks = 0\n **/","/**\n * Check if `obj` is an object.\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\nfunction isObject(obj) {\n return null !== obj && 'object' === typeof obj;\n}\n\nmodule.exports = isObject;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/superagent/lib/is-object.js\n ** module id = 146\n ** module chunks = 0\n **/","// The node and browser modules expose versions of this with the\n// appropriate constructor function bound as first argument\n/**\n * Issue a request:\n *\n * Examples:\n *\n * request('GET', '/users').end(callback)\n * request('/users').end(callback)\n * request('/users', callback)\n *\n * @param {String} method\n * @param {String|Function} url or callback\n * @return {Request}\n * @api public\n */\n\nfunction request(RequestConstructor, method, url) {\n // callback\n if ('function' == typeof url) {\n return new RequestConstructor('GET', method).end(url);\n }\n\n // url first\n if (2 == arguments.length) {\n return new RequestConstructor('GET', method);\n }\n\n return new RequestConstructor(method, url);\n}\n\nmodule.exports = request;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/superagent/lib/request.js\n ** module id = 147\n ** module chunks = 0\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/submissions/artfuldev/index.html b/submissions/artfuldev/index.html new file mode 100644 index 0000000..f05a957 --- /dev/null +++ b/submissions/artfuldev/index.html @@ -0,0 +1,16 @@ + + + + + + artfuldev's submimssion for the Flux Challenge + + + + + +
+ + + + diff --git a/submissions/artfuldev/package.json b/submissions/artfuldev/package.json new file mode 100644 index 0000000..faa02d3 --- /dev/null +++ b/submissions/artfuldev/package.json @@ -0,0 +1,28 @@ +{ + "name": "flux-challenge-artfuldev", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "dev": "concurrently \"webpack --watch\" \"lite-server\"", + "start": "npm run dev" + }, + "author": "Sudarsan Balaji", + "license": "MIT", + "dependencies": { + "@cycle/base": "^4.0.1", + "@cycle/dom": "^10.0.6", + "@cycle/http": "^11.0.1", + "@cycle/xstream-adapter": "^3.0.2", + "@cycle/xstream-run": "^3.0.3", + "immutable": "^3.8.1", + "xstream": "^5.2.0" + }, + "devDependencies": { + "concurrently": "^2.2.0", + "lite-server": "^2.2.2", + "ts-loader": "^0.8.2", + "typescript": "^1.8.10", + "typings": "^1.3.1", + "webpack": "^1.13.1" + } +} diff --git a/submissions/artfuldev/src/app.ts b/submissions/artfuldev/src/app.ts new file mode 100644 index 0000000..030165a --- /dev/null +++ b/submissions/artfuldev/src/app.ts @@ -0,0 +1,11 @@ +import main from './main'; +import { makeDOMDriver } from '@cycle/dom'; +import { run } from '@cycle/xstream-run'; +import { makePlanetsDriver } from './drivers/planets'; +import { makeJedisDriver } from './drivers/jedis'; + +run(main, { + dom: makeDOMDriver('#app'), + planets: makePlanetsDriver(), + jedis: makeJedisDriver() +}); diff --git a/submissions/artfuldev/src/definitions.ts b/submissions/artfuldev/src/definitions.ts new file mode 100644 index 0000000..a36250a --- /dev/null +++ b/submissions/artfuldev/src/definitions.ts @@ -0,0 +1,25 @@ +import { Stream } from 'xstream'; +import { VNode } from '@cycle/dom'; +import { DOMSource } from '@cycle/dom/xstream-typings'; +import { IPlanet, PlanetsSource } from './drivers/planets'; +import { IJedi, JedisSource } from './drivers/jedis'; +import { HTTPSource, RequestOptions } from '@cycle/http'; + +export interface ISources { + dom: DOMSource; + planets: PlanetsSource; + jedis: JedisSource; +} + +export interface ISinks { + dom: Stream; + jedis: Stream; +} + +export interface IApplicationState { + planet: IPlanet; + jedis: IJedi[]; + down: boolean; + up: boolean; + matchedId: number; +} diff --git a/submissions/artfuldev/src/drivers/jedis.ts b/submissions/artfuldev/src/drivers/jedis.ts new file mode 100644 index 0000000..ad76ce1 --- /dev/null +++ b/submissions/artfuldev/src/drivers/jedis.ts @@ -0,0 +1,60 @@ +import { Stream, Producer, Listener } from 'xstream'; +import { HTTPSource, RequestOptions, Response, makeHTTPDriver } from '@cycle/http'; +import { StreamAdapter } from '@cycle/base'; +import XStreamAdapter from '@cycle/xstream-adapter'; + +interface IEntity { + id: number; +} + +export interface INamedEntity extends IEntity { + name: string; +} + +export interface ILinkableEntity extends IEntity { + url: string; +} + +export interface IJedi extends INamedEntity { + homeworld: INamedEntity; + master: ILinkableEntity; + apprentice: ILinkableEntity; +} + +const JEDI_URL = 'http://localhost:3000/dark-jedis/'; + +export class JedisSource { + jedi$: Stream; + constructor(jediRequest$: Stream) { + const xs = Stream; + const id$ = jediRequest$.filter(req => req !== -1); + const cancel$ = jediRequest$.filter(req => req === -1).mapTo(true); + const request$ = + id$ + .map(id => { + const requestOptions: RequestOptions = { + url: JEDI_URL + id, + category: 'jedis', + lazy: true + }; + return requestOptions; + }); + const http: HTTPSource = makeHTTPDriver()(request$, XStreamAdapter); + const cancel$$ = cancel$.mapTo(xs.of(null)); + const response$$: Stream> = http.select('jedis'); + this.jedi$ = + xs + .merge(response$$, cancel$$) + .flatten() + .filter(Boolean) + .map(response => JSON.parse(response.text) as IJedi) + .remember(); + } +} + +export function makeJedisDriver() { + function jedisDriver(jediRequest$: Stream) { + return new JedisSource(jediRequest$); + } + return jedisDriver; +} diff --git a/submissions/artfuldev/src/drivers/planets.ts b/submissions/artfuldev/src/drivers/planets.ts new file mode 100644 index 0000000..77882c1 --- /dev/null +++ b/submissions/artfuldev/src/drivers/planets.ts @@ -0,0 +1,34 @@ +import { Stream, Producer, Listener } from 'xstream'; + +export interface IPlanet { + id: number; + name: string; +} + +export class PlanetsSource { + planet$: Stream; + constructor() { + const xs = Stream; + const producer: Producer = { + start: function (listener: Listener) { + this.connection = new WebSocket('ws://localhost:4000'); + this.connection.onmessage = + msg => + listener.next(JSON.parse(msg.data as string) as IPlanet); + this.connection.onerror = + err => listener.error(err); + }, + stop: function () { + this.connection.close(); + } + }; + this.planet$ = xs.create(producer); + } +} + +export function makePlanetsDriver() { + function planetsDriver() { + return new PlanetsSource(); + } + return planetsDriver; +} diff --git a/submissions/artfuldev/src/intent.ts b/submissions/artfuldev/src/intent.ts new file mode 100644 index 0000000..aef443d --- /dev/null +++ b/submissions/artfuldev/src/intent.ts @@ -0,0 +1,27 @@ +import { ISources } from './definitions'; +import { Stream } from 'xstream'; + +export interface IIntent { + scrollUp$: Stream; + scrollDown$: Stream; + +} + +function intent(sources: ISources): IIntent { + const dom = sources.dom; + const intent = { + scrollUp$: dom + .select('.css-button-up') + .events('click') + .filter(ev => (ev.target as HTMLElement).className.indexOf('disabled') === -1) + .mapTo(true), + scrollDown$: dom + .select('.css-button-down') + .events('click') + .filter(ev => (ev.target as HTMLElement).className.indexOf('disabled') === -1) + .mapTo(true) + }; + return intent; +} + +export default intent; diff --git a/submissions/artfuldev/src/main.ts b/submissions/artfuldev/src/main.ts new file mode 100644 index 0000000..097e312 --- /dev/null +++ b/submissions/artfuldev/src/main.ts @@ -0,0 +1,20 @@ +import { ISources, ISinks } from './definitions'; +import intent from './intent'; +import model from './model'; +import view from './view'; +import requests from './requests'; + +function main(sources: ISources): ISinks { + const jedi$ = sources.jedis.jedi$; + const planet$ = sources.planets.planet$; + const state$ = model(planet$, jedi$, intent(sources)); + const vNode$ = view(state$); + const id$ = requests(state$); + const sinks = { + dom: vNode$, + jedis: id$ + }; + return sinks; +} + +export default main; diff --git a/submissions/artfuldev/src/model.ts b/submissions/artfuldev/src/model.ts new file mode 100644 index 0000000..6e8dc30 --- /dev/null +++ b/submissions/artfuldev/src/model.ts @@ -0,0 +1,14 @@ +import { Stream } from 'xstream'; +import { IIntent } from './intent'; +import reducers, { InitialState } from './reducers'; +import { IApplicationState } from './definitions'; +import { IPlanet } from './drivers/planets'; +import { IJedi } from './drivers/jedis'; + +function model(planet$: Stream, jedi$: Stream, intent: IIntent): Stream { + const reducer$ = reducers(planet$, jedi$, intent); + const state$ = reducer$.fold((next, reducer) => reducer(next), InitialState); + return state$; +} + +export default model; diff --git a/submissions/artfuldev/src/reducers.ts b/submissions/artfuldev/src/reducers.ts new file mode 100644 index 0000000..5771312 --- /dev/null +++ b/submissions/artfuldev/src/reducers.ts @@ -0,0 +1,179 @@ +import { Stream } from 'xstream'; +import { IIntent } from './intent'; +import { ISources, IApplicationState } from './definitions'; +import { Record } from 'immutable'; +import { IPlanet } from './drivers/planets'; +import { IJedi, INamedEntity, ILinkableEntity } from './drivers/jedis'; + +const JediRecord = Record({ + id: 0, + name: null, + homeworld: null, + master: null, + apprentice: null +}); + +class Jedi extends JediRecord implements IJedi { + id: number; + name: string; + homeworld: INamedEntity; + master: ILinkableEntity; + apprentice: ILinkableEntity; + constructor(props: IJedi) { + super(props); + } +} + +const ApplicationStateRecord = Record({ + planet: null, + jedis: new Array(), + down: false, + up: false, + matchedId: -1 +}); + +class ApplicationState extends ApplicationStateRecord implements IApplicationState { + planet: IPlanet; + jedis: IJedi[]; + down: boolean; + up: boolean; + matchedId: number; + constructor(props: IApplicationState) { + super(props); + } +} + +export const InitialState: IApplicationState = new ApplicationState({ + planet: null, + jedis: [ + null, + null, + null, + null, + null + ], + down: false, + up: false, + matchedId: -1 +}); + +function reducers(planet$: Stream, jedi$: Stream, intent: IIntent): Stream<(state: IApplicationState) => IApplicationState> { + const xs = Stream; + + const planetReducer$ = + planet$ + .map(planet => + (state: IApplicationState) => { + const appState = state as ApplicationState; + const nextState = appState.set('planet', planet) as ApplicationState; + return nextState; + }); + + const jedisReducer$ = + xs.merge( + jedi$ + .map(jedi => + (state: IApplicationState) => { + const jedis = state.jedis || new Array(5); + const masterIndex = + jedis + .map(j => (j && j.master) ? j.master.id : -1) + .indexOf(jedi.id); + const appState = state as ApplicationState; + var index = 2; + if (masterIndex !== -1) + index = masterIndex - 1; + else { + const apprenticeIndex = + jedis + .map(j => (j && j.apprentice) ? j.apprentice.id : -1) + .indexOf(jedi.id); + if (apprenticeIndex !== -1) + index = apprenticeIndex + 1; + } + const newJedis = + jedis + .map((j, i) => + i === index + ? new Jedi(jedi) + : j); + const nextState = appState.set('jedis', newJedis) as ApplicationState; + return nextState; + }), + intent.scrollUp$ + .mapTo((state: IApplicationState) => { + const jedis = state.jedis; + const newJedis = + jedis + .map((jedi, i, array) => (i < 2) ? null : array[i - 2]); + const appState = state as ApplicationState; + const nextState = appState.set('jedis', newJedis) as ApplicationState; + return nextState; + }), + intent.scrollDown$ + .mapTo((state: IApplicationState) => { + const jedis = state.jedis; + const newJedis = + jedis + .map((jedi, i, array) => (i > 2) ? null : array[i + 2]); + const appState = state as ApplicationState; + const nextState = appState.set('jedis', newJedis) as ApplicationState; + return nextState; + }) + ); + + const downReducer$ = + jedisReducer$ + .mapTo((state: IApplicationState) => { + const jedis = state.jedis; + const lastJedi = jedis.filter(jedi => !!jedi).pop(); + const index = jedis.indexOf(lastJedi); + const down = lastJedi && lastJedi.apprentice && lastJedi.apprentice.id; + const appState = state as ApplicationState; + const nextState = appState.set('down', down) as ApplicationState; + return nextState; + }); + + const upReducer$ = + jedisReducer$ + .mapTo((state: IApplicationState) => { + const jedis = state.jedis; + const firstJedi = jedis.filter(jedi => !!jedi).shift(); + const index = jedis.indexOf(firstJedi); + const up = firstJedi && firstJedi.master && firstJedi.master.id; + const appState = state as ApplicationState; + const nextState = appState.set('up', up) as ApplicationState; + return nextState; + }); + + const matchedIdReducer$ = + xs.merge<{}>( + jedi$, + planet$ + ).mapTo((state: IApplicationState) => { + const planet = state.planet; + const appState = state as ApplicationState; + const noMatchState = appState.set('matchedId', -1) as ApplicationState; + if (!planet || !planet.id) + return noMatchState; + const planetId = planet.id; + const matchedJedi = + state.jedis + .filter(jedi => !!jedi && jedi.homeworld.id === planetId) + .pop(); + if (!matchedJedi) + return noMatchState; + const nextState = noMatchState.set('matchedId', matchedJedi.id) as ApplicationState; + return nextState; + }); + + return xs.merge( + planetReducer$, + jedisReducer$, + downReducer$, + upReducer$, + matchedIdReducer$ + ); +} + +export default reducers; diff --git a/submissions/artfuldev/src/requests.ts b/submissions/artfuldev/src/requests.ts new file mode 100644 index 0000000..41765bf --- /dev/null +++ b/submissions/artfuldev/src/requests.ts @@ -0,0 +1,69 @@ +import { Stream } from 'xstream'; +import { IApplicationState } from './definitions'; +import dropRepeats from 'xstream/extra/dropRepeats'; +import flattenConcurrently from 'xstream/extra/flattenConcurrently'; +import { ILinkableEntity, IJedi } from './drivers/jedis'; + +const xs = Stream; + +function canJediBeAdded(jedi: ILinkableEntity, jedis: IJedi[]) { + const first = jedis[0]; + const last = jedis[4]; + const isMasterOfFirst = first !== null && first.master.id === jedi.id; + const isApprenticeOfLast = last !== null && last.apprentice.id === jedi.id; + const loadedIds = + jedis + .filter(Boolean) + .map(jedi => jedi.id); + const alreadyLoaded = loadedIds.indexOf(jedi.id) !== -1; + return !alreadyLoaded && !isMasterOfFirst && !isApprenticeOfLast +} + +function neighborsToLoad(state: IApplicationState): Stream { + const jedi$ = xs.fromArray(state.jedis); + const matched = state.matchedId !== -1; + const neighbors$ = + jedi$ + .filter(Boolean) + .map(jedi => xs.of(jedi.master, jedi.apprentice)) + .compose(flattenConcurrently) + .filter(jedi => + Boolean(jedi.id) + && canJediBeAdded(jedi, state.jedis) + && !matched); + return neighbors$; +} + +function hash(state: IApplicationState): string { + const jedis = + state.jedis + .map(jedi => !!jedi ? jedi.id : '*') + .join('-'); + return jedis + '|' + state.matchedId; +} + +const distinctStates = dropRepeats( + (prev, next) => hash(prev) === hash(next) +); + +const distinctIds = dropRepeats( + (prev, next) => prev === next +); + +function requests(state$: Stream): Stream { + const distinctState$ = state$.compose(distinctStates); + const request$ = + xs.merge( + distinctState$ + .map(neighborsToLoad) + .compose(flattenConcurrently) + .map(jedi => jedi.id), + distinctState$ + .filter(state => state.matchedId !== -1) + .mapTo(-1) + ).compose(distinctIds) + .startWith(3616); + return request$; +} + +export default requests; diff --git a/submissions/artfuldev/src/view.ts b/submissions/artfuldev/src/view.ts new file mode 100644 index 0000000..3386c44 --- /dev/null +++ b/submissions/artfuldev/src/view.ts @@ -0,0 +1,46 @@ +import { Stream } from 'xstream'; +import { ISinks } from './definitions'; +import { div, h1, section, ul, li, h3, h6, button, VNode } from '@cycle/dom'; +import { IApplicationState } from './definitions'; +import { IJedi } from './drivers/jedis'; + +function renderJediSlot(jedi: IJedi, state: IApplicationState): VNode { + const matched = state.matchedId == (jedi && jedi.id); + const props = { style: { color: matched ? 'red' : null } }; + return li('.css-slot', props, + jedi + ? [ + h3([jedi.name]), + h6(['Homeworld: ' + jedi.homeworld.name]) + ] + : [] + ); +} + +function disableIfNotAllowed(allowed: boolean): string { + return (allowed ? '' : '.css-button-disabled') +} + +function view(state$: Stream): Stream { + const vNode$ = + state$ + .map(state => { + const down = state.down; + const up = state.up; + const planetName = (state.planet && state.planet.name) || ''; + const matched = state.matchedId !== -1; + return div('.css-root', [ + h1('.css-planet-monitor', 'Obi-Wan currently on ' + planetName), + section('.css-scrollable-list', [ + ul('.css-slots', state.jedis.map(jedi => renderJediSlot(jedi, state))), + div('.css-scroll-buttons', [ + button('.css-button-up' + disableIfNotAllowed(up && !matched)), + button('.css-button-down' + disableIfNotAllowed(down && !matched)) + ]) + ]) + ]); + }); + return vNode$; +} + +export default view; diff --git a/submissions/artfuldev/tsconfig.json b/submissions/artfuldev/tsconfig.json new file mode 100644 index 0000000..b976fbe --- /dev/null +++ b/submissions/artfuldev/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "sourceMap": true + }, + "exclude": [ + "node_modules" + ] +} diff --git a/submissions/artfuldev/typings.json b/submissions/artfuldev/typings.json new file mode 100644 index 0000000..8628705 --- /dev/null +++ b/submissions/artfuldev/typings.json @@ -0,0 +1,5 @@ +{ + "globalDependencies": { + "es6-shim": "registry:dt/es6-shim#0.31.2+20160602141504" + } +} diff --git a/submissions/artfuldev/webpack.config.js b/submissions/artfuldev/webpack.config.js new file mode 100644 index 0000000..2ac7f5c --- /dev/null +++ b/submissions/artfuldev/webpack.config.js @@ -0,0 +1,21 @@ +var webpack = require('webpack'); +module.exports = { + entry: './src/app.ts', + output: { + filename: './dist/app.js' + }, + // Turn on sourcemaps + devtool: 'source-map', + resolve: { + extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'] + }, + // Add minification + // plugins: [ + // new webpack.optimize.UglifyJsPlugin() + // ], + module: { + loaders: [ + { test: /\.ts$/, loader: 'ts' } + ] + } +} diff --git a/submissions/staltz/index.html b/submissions/staltz/index.html index bbe02c3..71b838a 100644 --- a/submissions/staltz/index.html +++ b/submissions/staltz/index.html @@ -11,4 +11,4 @@
- + \ No newline at end of file