text: (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var index_1=require("../Calculator/index");var styles_1=require("./styles");function view(calculatorVDom){return calculatorVDom.map(function(calcVNode){return dom_1.div(".app",[dom_1.h1(".title."+styles_1.default.title,""),calcVNode,dom_1.h2(".footnote."+styles_1.default.footnote,[dom_1.a({attrs:{href:"https://github.com/staltz/matrixmultiplication.xyz"}},"")])])})}function App(sources){var calculatorSinks=index_1.default(sources);var vdom$=view(calculatorSinks.DOM);var reducer$=calculatorSinks.onion;var sinks={DOM:vdom$,onion:reducer$};return sinks}exports.default=App},{"../Calculator/index":3,"./styles":2,"@cycle/dom":46}],2:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var typestyle_1=require("typestyle");var styles_1=require("../styles");typestyle_1.cssRule("body",{margin:0,color:styles_1.pallete.black,fontFamily:'"Source Sans Pro", serif',fontWeight:400});var Styles;(function(Styles){Styles.title=typestyle_1.style({position:"absolute",top:0,left:0,right:0,fontFamily:'"Vesper Libre", serif',fontWeight:400,textAlign:"center",margin:0,paddingTop:"1.5rem",paddingBottom:"3rem",zIndex:10,backgroundImage:"linear-gradient(to bottom, "+"white 0, "+"rgba(255,255,255,0.9) 60%, "+"rgba(255,255,255,0) 100%)"});Styles.footnote=typestyle_1.style({position:"fixed",left:0,right:0,bottom:0,fontFamily:'"Source Sans Pro", serif',fontSize:"14px",textAlign:"center",zIndex:-10,$nest:{"& > *":{color:styles_1.pallete.gray}}})})(Styles||(Styles={}));exports.default=Styles},{"../styles":34,typestyle:144}],3:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var isolate_1=require("@cycle/isolate");var index_1=require("../Matrix/index");var measure_1=require("./measure");var timers_1=require("./timers");var index_2=require("./intent/index");var index_3=require("./model/index");var index_4=require("./view/index");function Calculator(sources){var aSinks=isolate_1.default(index_1.default,"matrixA")(sources);var bSinks=isolate_1.default(index_1.default,"matrixB")(sources);var cSinks=isolate_1.default(index_1.default,"matrixC")(sources);var state$=sources.onion.state$;var measurements$=measure_1.default(sources.DOM);var actions=__assign({},index_2.default(sources.DOM),{allowContinueAction$:timers_1.default(state$)});var reducer$=index_3.default(actions,measurements$);var allReducer$=xstream_1.default.merge(reducer$,aSinks.onion,bSinks.onion);var vdom$=index_4.default(state$,aSinks.DOM,bSinks.DOM,cSinks.DOM);var sinks={DOM:vdom$,onion:allReducer$};return sinks}exports.default=Calculator},{"../Matrix/index":24,"./intent/index":5,"./measure":7,"./model/index":9,"./timers":16,"./view/index":19,"@cycle/isolate":54,xstream:153}],4:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function controlPanelIntent(domSource){var startMultiplyAction$=domSource.select(".multiply").events("click").mapTo(null);var nextStepAction$=domSource.select(".next").events("click").mapTo(null);var endAction$=domSource.select(".end").events("click").mapTo(null);var resetAction$=domSource.select(".reset").events("click").mapTo(null);return{startMultiplyAction$:startMultiplyAction$,nextStepAction$:nextStepAction$,endAction$:endAction$,resetAction$:resetAction$}}exports.controlPanelIntent=controlPanelIntent},{}],5:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var controlPanel_1=require("./controlPanel");var resize_1=require("./resize");function intent(domSource){var resizeAction$=resize_1.resizeIntent(domSource);var controlPanelActions=controlPanel_1.controlPanelIntent(domSource);return __assign({resizeAction$:resizeAction$},controlPanelActions)}exports.default=intent},{"./controlPanel":4,"./resize":6}],6:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");function createResizeAction(target,direction,amount){return{target:target,resizeParam:{direction:direction,amount:amount}}}function resizeIntent(domSource){var decreaseRowA$=domSource.select(".decreaseRowA").events("click").mapTo(createResizeAction("A","row",-1));var increaseRowA$=domSource.select(".increaseRowA").events("click").mapTo(createResizeAction("A","row",+1));var decreaseColA$=xstream_1.default.merge(domSource.select(".decreaseColA").events("click"),domSource.select(".decreaseRowB").events("click")).mapTo(createResizeAction("A","column",-1));var increaseColA$=xstream_1.default.merge(domSource.select(".increaseColA").events("click"),domSource.select(".increaseRowB").events("click")).mapTo(createResizeAction("A","column",+1));var decreaseRowB$=xstream_1.default.merge(domSource.select(".decreaseColA").events("click"),domSource.select(".decreaseRowB").events("click")).mapTo(createResizeAction("B","row",-1));var increaseRowB$=xstream_1.default.merge(domSource.select(".increaseColA").events("click"),domSource.select(".increaseRowB").events("click")).mapTo(createResizeAction("B","row",+1));var decreaseColB$=domSource.select(".decreaseColB").events("click").mapTo(createResizeAction("B","column",-1));var increaseColB$=domSource.select(".increaseColB").events("click").mapTo(createResizeAction("B","column",+1));return xstream_1.default.merge(decreaseRowA$,increaseRowA$,decreaseColA$,increaseColA$,decreaseRowB$,increaseRowB$,decreaseColB$,increaseColB$)}exports.resizeIntent=resizeIntent},{xstream:153}],7:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dropRepeats_1=require("xstream/extra/dropRepeats");var delay_1=require("xstream/extra/delay");function isNotNull(x){return x!==null}function measure(domSource){return domSource.select(".calculator").elements().map(function(e){var actualElement=Array.isArray(e)?e[0]:e;if(!actualElement){return null}var matrixAElem=actualElement.querySelector(".matrixA *");var matrixBElem=actualElement.querySelector(".matrixB *");if(!matrixAElem||!matrixBElem){return null}var someRow=matrixAElem.querySelector(".row");if(!someRow){return null}var measurements={matrixAHeight:matrixAElem.clientHeight,matrixBWidth:matrixBElem.clientWidth,matrixBHeight:matrixBElem.clientHeight,rowHeight:someRow.clientHeight};return measurements}).filter(isNotNull).compose(dropRepeats_1.default(function(m1,m2){return m1.matrixAHeight===m2.matrixAHeight&&m1.matrixBHeight===m2.matrixBHeight&&m1.matrixBWidth===m2.matrixBWidth})).compose(delay_1.default(16))}exports.default=measure},{"xstream/extra/delay":150,"xstream/extra/dropRepeats":151}],8:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function calculateCellMatrixC(i,j,matrixA,matrixB){var m=matrixA.numberColumns;var acc=0;for(var k=0;k<m;k++){var a=matrixA.get(i,k);var b=matrixB.get(k,j);if(a==null){a=1}if(b==null){b=1}acc+=a*b}return acc}function calculateNextMatrixC(nextStep,matrixA,matrixB,matrixC){var newMatrixC=matrixC;matrixC.rows.forEach(function(row,i){row.forEach(function(cellC,j){if(i+j===nextStep-2){var val=calculateCellMatrixC(i,j,matrixA,matrixB);newMatrixC=newMatrixC.set(i,j,val)}})});return newMatrixC}exports.calculateNextMatrixC=calculateNextMatrixC},{}],9:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var MatrixValues_1=require("../../utils/MatrixValues");var measure_1=require("./reducers/measure");var resize_1=require("./reducers/resize");var controlPanel_1=require("./reducers/controlPanel");var timers_1=require("./reducers/timers");var defaultState={step:0,canInteract:true,fastForwardToEnd:false,measurements:{matrixAHeight:0,matrixBWidth:0,matrixBHeight:0,rowHeight:0},matrixA:{values:MatrixValues_1.default.from([[-1,2,1],[0,1,0],[2,3,4]]),editable:true,id:"A"},matrixB:{values:MatrixValues_1.default.from([[2,5],[6,7],[-1,8]]),editable:true,id:"B"},matrixC:void 0};var initReducer$=xstream_1.default.of(function initReducer(prevState){if(!prevState){return defaultState}else{return prevState}});function model(actions,measurements$){return xstream_1.default.merge(initReducer$,measure_1.updateMeasurementsReducer$(measurements$),resize_1.resizeReducer$(actions.resizeAction$),controlPanel_1.startMultiplyReducer$(actions.startMultiplyAction$),controlPanel_1.nextStepReducer$(actions.nextStepAction$),controlPanel_1.fastForwardToEndReducer$(actions.endAction$),controlPanel_1.resetReducer$(actions.resetAction$),timers_1.allowContinueReducer$(actions.allowContinueAction$))}exports.default=model},{"../../utils/MatrixValues":35,"./reducers/controlPanel":11,"./reducers/measure":12,"./reducers/resize":13,"./reducers/timers":14,xstream:153}],10:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function totalCombSteps(state){return state.matrixA.values.numberRows+state.matrixB.values.numberColumns-2}exports.totalCombSteps=totalCombSteps;function lastCombStep(state){return 2+totalCombSteps(state)}exports.lastCombStep=lastCombStep;function isInCombStep(state){return(state.step===1&&state.canInteract||state.step>1)&&state.step<=lastCombStep(state)}exports.isInCombStep=isInCombStep},{}],11:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var MatrixValues_1=require("../../../utils/MatrixValues");var calculate_1=require("../calculate");var queries_1=require("../queries");function startMultiplyReducer$(action$){return action$.map(function(){return function startMultiplyReducer(prevState){if(prevState.step===0){return __assign({},prevState,{step:1,canInteract:false,fastForwardToEnd:false,matrixA:__assign({},prevState.matrixA,{editable:false}),matrixB:__assign({},prevState.matrixB,{editable:false}),matrixC:{editable:false,values:MatrixValues_1.default.ofDimensions(prevState.matrixA.values.numberRows,prevState.matrixB.values.numberColumns).setAll(null),id:"C"}})}else{return prevState}}})}exports.startMultiplyReducer$=startMultiplyReducer$;function nextStepReducer$(action$){return action$.map(function(){return function nextStepReducer(prevState){if(prevState.step>=1&&prevState.canInteract&&prevState.matrixC){var nextStep=prevState.step+1;return __assign({},prevState,{step:nextStep,canInteract:false,matrixC:__assign({},prevState.matrixC,{values:calculate_1.calculateNextMatrixC(nextStep,prevState.matrixA.values,prevState.matrixB.values,prevState.matrixC.values)})})}else{return prevState}}})}exports.nextStepReducer$=nextStepReducer$;function fastForwardToEndReducer$(action$){return action$.map(function(){return function fastForwardToEndReducer(prevState){if(prevState.step>=1&&prevState.canInteract&&prevState.matrixC){var nextStep=prevState.step+1;return __assign({},prevState,{step:nextStep,canInteract:false,fastForwardToEnd:nextStep<=queries_1.lastCombStep(prevState),matrixC:__assign({},prevState.matrixC,{values:calculate_1.calculateNextMatrixC(nextStep,prevState.matrixA.values,prevState.matrixB.values,prevState.matrixC.values)})})}else{return prevState}}})}exports.fastForwardToEndReducer$=fastForwardToEndReducer$;function resetReducer$(action$){return action$.map(function(){return function resetReducer(prevState){return __assign({},prevState,{step:0,canInteract:true,fastForwardToEnd:false,matrixA:__assign({},prevState.matrixA,{editable:true}),matrixB:__assign({},prevState.matrixB,{editable:true}),matrixC:void 0})}})}exports.resetReducer$=resetReducer$},{"../../../utils/MatrixValues":35,"../calculate":8,"../queries":10}],12:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});function updateMeasurementsReducer$(measurements$){return measurements$.map(function(measurements){return function(prevState){return __assign({},prevState,{measurements:measurements})}})}exports.updateMeasurementsReducer$=updateMeasurementsReducer$},{}],13:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});function resizeReducer$(action$){return action$.map(function(action){return function resizeReducer(prevState){var targetMatrix="matrix"+action.target;var nextState={step:prevState.step,canInteract:prevState.canInteract,fastForwardToEnd:prevState.fastForwardToEnd,measurements:prevState.measurements,matrixA:prevState.matrixA,matrixB:prevState.matrixB,matrixC:prevState.matrixC};var prevValues=prevState[targetMatrix].values;if(action.resizeParam.direction==="row"){nextState[targetMatrix]=__assign({},prevState[targetMatrix],{values:prevValues.resize(prevValues.numberRows+action.resizeParam.amount,prevValues.numberColumns)})}else{nextState[targetMatrix]=__assign({},prevState[targetMatrix],{values:prevValues.resize(prevValues.numberRows,prevValues.numberColumns+action.resizeParam.amount)})}return nextState}})}exports.resizeReducer$=resizeReducer$},{}],14:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var queries_1=require("../queries");var calculate_1=require("../calculate");function allowContinueReducer$(action$){return action$.map(function(){return function allowContinueReducer(prevState){if(prevState.fastForwardToEnd&&prevState.matrixC){var nextStep=prevState.step+1;return __assign({},prevState,{step:nextStep,canInteract:false,fastForwardToEnd:nextStep<=queries_1.lastCombStep(prevState),matrixC:__assign({},prevState.matrixC,{values:calculate_1.calculateNextMatrixC(nextStep,prevState.matrixA.values,prevState.matrixB.values,prevState.matrixC.values)})})}else{return __assign({},prevState,{canInteract:true,fastForwardToEnd:false})}}})}exports.allowContinueReducer$=allowContinueReducer$},{"../calculate":8,"../queries":10}],15:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var typestyle_1=require("typestyle");var styles_1=require("../Matrix/styles");var styles_2=require("../styles");var Styles;(function(Styles){Styles.matrixBracketWidth=styles_1.default.matrixBracketWidth;Styles.step1Duration1=600;Styles.step1Duration2=900;Styles.nextCombDuration=500;Styles.nextCombCellTransitionDelay=Styles.nextCombDuration*.5;Styles.colorPallete=styles_2.pallete;Styles.cellScaleWhenIntersecting=.55;Styles.cellTranslateXWhenIntersecting=16;Styles.cellTranslateYWhenIntersecting=10;Styles.finalResultDuration=1100;Styles.finalFadeDuration=Styles.finalResultDuration*.8;Styles.calculator=typestyle_1.style({marginTop:"200px",marginBottom:"100px"});Styles.matrices=typestyle_1.style({display:"flex",alignItems:"center",justifyContent:"center"});Styles.matrixWrapperTable=typestyle_1.style({borderSpacing:0});Styles.matrixA=typestyle_1.style({position:"relative"});Styles.matrixB=typestyle_1.style({transition:"opacity "+Styles.finalFadeDuration+"ms"});Styles.matrixC=typestyle_1.style({position:"relative",transitionDuration:"700ms",transitionProperty:"opacity, margin-left",transitionDelay:"300ms"});Styles.matrixCHidden=typestyle_1.style({position:"relative",transitionDuration:"0ms",transitionProperty:"opacity, margin-left",transitionDelay:"0ms"});Styles.resultEqualsSign=typestyle_1.style({fontSize:"24px",color:styles_2.pallete.grayDark,transitionDuration:"700ms",transitionProperty:"opacity, width, margin",transitionDelay:"700ms, 300ms, 300ms"});Styles.animatedCell=typestyle_1.style({transitionProperty:"opacity, color, transform",transitionDuration:"400ms",transitionDelay:Styles.nextCombCellTransitionDelay+"ms"});Styles.operatorGrid=typestyle_1.style({position:"absolute",top:"3px",left:"3px"});Styles.operatorCell=typestyle_1.style({transform:"scale(0.6)",transition:"opacity 300ms ease "+Styles.nextCombCellTransitionDelay+"ms"});Styles.plusSign=typestyle_1.style({$nest:{"&::after":{content:'"+"',display:"block",position:"absolute",top:0,left:"40px",fontSize:"24px",width:"2em",height:"2em",fontFamily:"'Source Sans Pro', sans-serif",lineHeight:"49px",textAlign:"center",border:"none",textIndent:"0",padding:"0",color:styles_2.pallete.black}}});Styles.controlPanel=typestyle_1.style({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",paddingTop:"86px",paddingBottom:"40px",backgroundImage:"linear-gradient(to bottom,\n      rgba(255,255,255,0) 0,\n      rgba(255,255,255,0.8) 92px,\n      rgba(255,255,255,0.8) 126px,\n      rgba(255,255,255,0) 100%)\n    ",zIndex:2,$nest:{"& > * + *":{marginLeft:"8px"}}});var commonButton={color:styles_2.pallete.white,border:"none",fontSize:"24px",padding:"8px 16px",$nest:{"& > svg":{marginBottom:"-2px",marginRight:"8px"}}};var commonButtonEnabled={boxShadow:"0 1px 1px 0 "+styles_2.pallete.gray,cursor:"pointer"};var commonButtonDisabled=typestyle_1.style(commonButton,{backgroundColor:styles_2.pallete.gray});Styles.multiplyButton=typestyle_1.style(commonButton,commonButtonEnabled,{backgroundColor:styles_2.pallete.blue,$nest:{"&:hover":{backgroundColor:styles_2.pallete.blueWeak}}});Styles.multiplyButtonDisabled=commonButtonDisabled;Styles.nextButton=Styles.multiplyButton;Styles.nextButtonDisabled=commonButtonDisabled;Styles.endButton=typestyle_1.style(commonButton,commonButtonEnabled,{backgroundColor:styles_2.pallete.orange,$nest:{"&:hover":{backgroundColor:styles_2.pallete.orangeWeak}}});Styles.endButtonDisabled=commonButtonDisabled;Styles.resetButton=Styles.multiplyButton;Styles.multiplyOrEqualsSign=typestyle_1.style({margin:"1em",fontSize:"24px",color:styles_2.pallete.grayDark});Styles.rowsResizer=typestyle_1.style({display:"flex",flexDirection:"column",justifyContent:"center",margin:"0 10px",zIndex:3});Styles.colsResizerContainer=typestyle_1.style({position:"relative"});Styles.colsResizer=typestyle_1.style({position:"absolute",minWidth:"76px",left:"-20px",right:"-20px",display:"flex",flexDirection:"row",justifyContent:"center",margin:"10px 0",zIndex:3});Styles.resizerButton=typestyle_1.style({backgroundColor:"rgba(0, 0, 0, 0)",boxShadow:"0 1px 1px 0 "+styles_2.pallete.gray,color:styles_2.pallete.grayDark,border:"none",fontSize:"20px",textAlign:"center",width:"30px",height:"30px",lineHeight:"30px",margin:"4px",cursor:"pointer",$nest:{"&:hover":{backgroundColor:styles_2.pallete.grayLight}}})})(Styles||(Styles={}));exports.default=Styles},{"../Matrix/styles":27,"../styles":34,typestyle:144}],16:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var delay_1=require("xstream/extra/delay");var dropRepeats_1=require("xstream/extra/dropRepeats");var queries_1=require("./model/queries");var styles_1=require("./styles");function timers(state$){var stateChange$=state$.compose(dropRepeats_1.default(function(s1,s2){return s1.step===s2.step&&s1.canInteract===s2.canInteract}));var allowContinueFromStartMultiply$=stateChange$.filter(function(state){return state.step===1&&!state.canInteract}).compose(delay_1.default(styles_1.default.step1Duration1+styles_1.default.step1Duration2)).mapTo(null);var allowContinueFromNextComb$=stateChange$.filter(function(state){return queries_1.isInCombStep(state)&&!state.canInteract}).compose(delay_1.default(styles_1.default.nextCombDuration)).mapTo(null);var allowContinueFromEnd$=stateChange$.filter(function(state){return state.step===queries_1.lastCombStep(state)+1&&!state.canInteract}).compose(delay_1.default(styles_1.default.finalResultDuration)).mapTo(null);return xstream_1.default.merge(allowContinueFromStartMultiply$,allowContinueFromNextComb$,allowContinueFromEnd$)}exports.default=timers},{"./model/queries":10,"./styles":15,xstream:153,"xstream/extra/delay":150,"xstream/extra/dropRepeats":151}],17:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var styles_1=require("../styles");exports.multiplySign="×";exports.zeroWidthSpace="​";function renderRowsResizer(id){return dom_1.div(".rowsResizer."+styles_1.default.rowsResizer,[dom_1.div(".decreaseRow"+id+"."+styles_1.default.resizerButton,"-"),dom_1.div(".increaseRow"+id+"."+styles_1.default.resizerButton,"+")])}exports.renderRowsResizer=renderRowsResizer;function renderColsResizer(id){return dom_1.div(".colsResizer."+styles_1.default.colsResizer,[dom_1.div(".decreaseCol"+id+"."+styles_1.default.resizerButton,"-"),dom_1.div(".increaseCol"+id+"."+styles_1.default.resizerButton,"+")])}exports.renderColsResizer=renderColsResizer},{"../styles":15,"@cycle/dom":46}],18:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var queries_1=require("../model/queries");var styles_1=require("../styles");var play_1=require("../../icons/play");var next_1=require("../../icons/next");var end_1=require("../../icons/end");var reset_1=require("../../icons/reset");function getArrayOfButtons(state){var step=state.step;var buttons=[];if(step===0){buttons=[dom_1.div(".multiply."+styles_1.default.multiplyButton,[play_1.default,"Multiply"])]}else if(step===1&&!state.canInteract){buttons=[dom_1.div(".multiply."+styles_1.default.multiplyButtonDisabled,[play_1.default,"Multiply"])]}else if(step>=1&&step<=queries_1.lastCombStep(state)&&state.canInteract){buttons=[dom_1.div(".next."+styles_1.default.nextButton,[next_1.default,"Next"]),dom_1.div(".end."+styles_1.default.endButton,[end_1.default,"End"])]}else if(step>=1&&step<=queries_1.lastCombStep(state)+1&&!state.canInteract){buttons=[dom_1.div(".next."+styles_1.default.nextButtonDisabled,[next_1.default,"Next"]),dom_1.div(".end."+styles_1.default.endButtonDisabled,[end_1.default,"End"])]}else if(step===queries_1.lastCombStep(state)+1&&state.canInteract){buttons=[dom_1.div(".reset."+styles_1.default.resetButton,[reset_1.default,"Reset"])]}return buttons}function renderControlPanel(state){return dom_1.div(".controlPanel."+styles_1.default.controlPanel,getArrayOfButtons(state))}exports.renderControlPanel=renderControlPanel},{"../../icons/end":29,"../../icons/next":30,"../../icons/play":31,"../../icons/reset":32,"../model/queries":10,"../styles":15,"@cycle/dom":46}],19:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var dom_1=require("@cycle/dom");var queries_1=require("../model/queries");var styles_1=require("../styles");var matrixA_1=require("./matrixA");var matrixB_1=require("./matrixB");var matrixC_1=require("./matrixC");var controlPanel_1=require("./controlPanel");var common_1=require("./common");var tweens_1=require("./tweens");function renderSign(state){if(queries_1.isInCombStep(state)){return dom_1.span(".multiplySign."+styles_1.default.multiplyOrEqualsSign,"=")}else{return dom_1.span(".tempEqualsSign."+styles_1.default.multiplyOrEqualsSign,common_1.multiplySign)}}function maybeRenderEqualsSign(state){var style={};if(state.step===queries_1.lastCombStep(state)+1){style={margin:"1em",width:"12px",opacity:"1"}}else if(state.step===0){return null}else{style={margin:"0",width:"0",opacity:"0.01"}}return dom_1.span(".resultEqualsSign."+styles_1.default.resultEqualsSign,{style:style},"=")}function view(state$,vdomA$,vdomB$,vdomC$){var transform$=tweens_1.makeTransform$(state$);return xstream_1.default.combine(state$,transform$,vdomA$,vdomB$,vdomC$.startWith(null)).map(function(_a){var state=_a[0],transform=_a[1],matrixA=_a[2],matrixB=_a[3],matrixC=_a[4];return dom_1.div(".calculator."+styles_1.default.calculator,[dom_1.div(".matrices."+styles_1.default.matrices,[matrixA_1.renderMatrixA(matrixA,state),renderSign(state),matrixB_1.renderMatrixB(matrixB,state,transform),maybeRenderEqualsSign(state),matrixC_1.maybeRenderMatrixC(matrixC,state)]),controlPanel_1.renderControlPanel(state)])})}exports.default=view},{"../model/queries":10,"../styles":15,"./common":17,"./controlPanel":18,"./matrixA":20,"./matrixB":21,"./matrixC":22,"./tweens":23,"@cycle/dom":46,xstream:153}],20:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var queries_1=require("../model/queries");var styles_1=require("../../Matrix/styles");var styles_2=require("../styles");var common_1=require("./common");function renderOperatorGrid(state){if(state.step===0){return null}var lastIntersectRow=state.step-2;var firstIntersectRow=state.step-2-state.matrixB.values.numberColumns;var rows=state.matrixA.values.rows;return dom_1.div(".operatorGrid."+styles_2.default.operatorGrid,rows.map(function(row,i){var shouldShowMultiply=firstIntersectRow<i&&i<=lastIntersectRow;return dom_1.ul("."+styles_1.default.row,row.map(function(cellVal,j){var shouldShowPlus=j<state.matrixA.values.numberColumns-1;return dom_1.li([dom_1.span(".operator",{class:(_a={},_a[styles_1.default.cell]=true,_a[styles_2.default.operatorCell]=true,_a[styles_2.default.plusSign]=shouldShowPlus,_a),style:{opacity:shouldShowMultiply?1:.01}},[common_1.multiplySign])]);var _a}))}))}function mutateCellStyles(state){var lastIntersectRow=state.step-2;var firstIntersectRow=state.step-2-state.matrixB.values.numberColumns;return function updateHook(prev,next){var all=next.elm.querySelectorAll(".cell");var _loop_1=function(i,N){var cellElem=all.item(i);var rowOfCell=parseInt(cellElem.dataset.row);if(queries_1.isInCombStep(state)){cellElem.classList.add(styles_2.default.animatedCell)}else if(state.step>queries_1.lastCombStep(state)){setTimeout(function(){return cellElem.classList.remove(styles_2.default.animatedCell)},styles_2.default.nextCombDuration)}if(firstIntersectRow<rowOfCell&&rowOfCell<=lastIntersectRow){cellElem.style.transform="\n          scale("+styles_2.default.cellScaleWhenIntersecting+")\n          translateX("+-styles_2.default.cellTranslateXWhenIntersecting+"px)\n          translateY("+styles_2.default.cellTranslateYWhenIntersecting+"px)\n        ";cellElem.style.color=styles_2.default.colorPallete.blue}else{cellElem.style.transform=null;cellElem.style.color=null}};for(var i=0,N=all.length;i<N;i++){_loop_1(i,N)}}}function renderMatrixA(matrixA,state){var showResizers=state.step===0;return dom_1.table(".matrixAWrapper."+styles_2.default.matrixWrapperTable,[dom_1.tr([dom_1.td(showResizers?[common_1.renderRowsResizer("A")]:[]),dom_1.td(".matrixA."+styles_2.default.matrixA,{hook:{update:mutateCellStyles(state)}},[matrixA,renderOperatorGrid(state)])]),dom_1.tr([dom_1.td(),dom_1.td(".colsResizerContainer."+styles_2.default.colsResizerContainer,showResizers?[common_1.renderColsResizer("A")]:[])])])}exports.renderMatrixA=renderMatrixA},{"../../Matrix/styles":27,"../model/queries":10,"../styles":15,"./common":17,"@cycle/dom":46}],21:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var queries_1=require("../model/queries");var styles_1=require("../styles");var common_1=require("./common");function getOpacity(state){if(state.step===queries_1.lastCombStep(state)+1&&!state.canInteract){return"0.01"}else if(state.step===queries_1.lastCombStep(state)+1&&state.canInteract){return"1"}else{return"1"}}function mutateCellStyles(state,transform){var lastIntersectCol=state.step-2;var firstIntersectCol=state.step-2-state.matrixA.values.numberRows;var rotateZTransform=transform.split(" ").filter(function(t){return t.match(/^rotateZ/)!==null}).pop().replace("-","+").trim();return function updateHook(prev,next){var all=next.elm.querySelectorAll(".cell");for(var i=0,N=all.length;i<N;i++){var cellElem=all.item(i);var colOfCell=parseInt(cellElem.dataset.col);if(rotateZTransform==="rotateZ(+90deg)"){cellElem.classList.add(styles_1.default.animatedCell)}else{cellElem.classList.remove(styles_1.default.animatedCell)}if(firstIntersectCol<colOfCell&&colOfCell<=lastIntersectCol){cellElem.style.transform="\n          "+rotateZTransform+"\n          scale("+styles_1.default.cellScaleWhenIntersecting+")\n          translateX("+styles_1.default.cellTranslateXWhenIntersecting+"px)\n          translateY("+-styles_1.default.cellTranslateYWhenIntersecting+"px)\n        ";cellElem.style.color=styles_1.default.colorPallete.blue}else{cellElem.style.transform=rotateZTransform;cellElem.style.color=null}}}}function renderMatrixB(matrixB,state,transform){var showResizers=state.step===0;var opacity=getOpacity(state);return dom_1.table(".matrixBWrapper."+styles_1.default.matrixWrapperTable,[dom_1.tr([dom_1.td(".matrixB."+styles_1.default.matrixB,{style:{opacity:opacity,transform:transform,transformOrigin:"bottom left"},hook:{update:mutateCellStyles(state,transform)}},[matrixB]),dom_1.td(showResizers?[common_1.renderRowsResizer("B")]:[])]),dom_1.tr([dom_1.td(".colsResizerContainer."+styles_1.default.colsResizerContainer,showResizers?[common_1.renderColsResizer("B")]:[]),dom_1.td()])])}exports.renderMatrixB=renderMatrixB},{"../model/queries":10,"../styles":15,"./common":17,"@cycle/dom":46}],22:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var queries_1=require("../model/queries");var styles_1=require("../styles");function mutateCellStyles(state){return function updateHook(prev,next){var all=next.elm.querySelectorAll(".cell");for(var i=0,N=all.length;i<N;i++){var cellElem=all.item(i);var rowOfCell=parseInt(cellElem.dataset.row);var colOfCell=parseInt(cellElem.dataset.col);if(queries_1.isInCombStep(state)){cellElem.classList.add(styles_1.default.animatedCell)}else{cellElem.classList.remove(styles_1.default.animatedCell)}if(rowOfCell+colOfCell>state.step-2){cellElem.style.color=null;cellElem.style.opacity="0.01"}else if(rowOfCell+colOfCell===state.step-2){cellElem.style.color=styles_1.default.colorPallete.blue;cellElem.style.opacity="1"}else{cellElem.style.color=null;cellElem.style.opacity="1"}}}}function maybeRenderMatrixC(matrixC,state){var step=state.step;if(matrixC===null||step===0||step===1&&!state.canInteract){return dom_1.div(".matrixC",{class:(_a={},_a[styles_1.default.matrixCHidden]=true,_a),style:{opacity:"0.01",marginLeft:"0"}})}else{matrixC.data=matrixC.data||{};matrixC.data.style=matrixC.data.style||{};matrixC.data.style.position="absolute"
  ;var xDist=state.measurements.matrixBWidth+8;var yDist=state.measurements.matrixAHeight*.5;return dom_1.div(".matrixC",{class:(_b={},_b[styles_1.default.matrixC]=true,_b),style:{transform:"translateX(-"+xDist+"px) translateY(-"+yDist+"px)",opacity:"1",marginLeft:step===queries_1.lastCombStep(state)+1?xDist+"px":"0"},hook:{update:mutateCellStyles(state)}},[matrixC])}var _a,_b}exports.maybeRenderMatrixC=maybeRenderMatrixC},{"../model/queries":10,"../styles":15,"@cycle/dom":46}],23:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var concat_1=require("xstream/extra/concat");var delay_1=require("xstream/extra/delay");var tween_1=require("xstream/extra/tween");var dropRepeats_1=require("xstream/extra/dropRepeats");var queries_1=require("../model/queries");var styles_1=require("../styles");var xMove=59.5;var padding=8;function makeStartMultiplyTransform$(state$){return state$.filter(function(state){return state.step===1}).map(function(state){var ease=tween_1.default.power2.easeInOut;var yLift=padding+state.measurements.matrixAHeight*.5+state.measurements.matrixBHeight*.5;return concat_1.default(tween_1.default({from:0,to:yLift,duration:styles_1.default.step1Duration1,ease:ease}).map(function(y){return"\n            translateX(0%)\n            translateY("+-y+"px)\n            rotateZ(0deg)\n          "}),tween_1.default({from:0,to:1,duration:styles_1.default.step1Duration2,ease:ease}).map(function(t){return"\n            translateX("+-t*xMove+"px)\n            translateY("+-yLift+"px)\n            rotateZ("+-Math.pow(t,2.3)*90+"deg)\n          "}))}).flatten()}function makeNextStepTransform$(state$){return state$.filter(function(state){return state.step>1&&state.step<=queries_1.lastCombStep(state)}).map(function(state){var ease=tween_1.default.power2.easeInOut;var duration=styles_1.default.nextCombDuration;var yLift=padding+state.measurements.matrixAHeight*.5+state.measurements.matrixBHeight*.5;var yPrev=state.step===2?yLift:yLift-padding-styles_1.default.matrixBracketWidth*2-state.measurements.rowHeight*(state.step-2);var yNext=yLift-padding-styles_1.default.matrixBracketWidth*2-state.measurements.rowHeight*(state.step-1);return tween_1.default({from:yPrev,to:yNext,duration:duration,ease:ease}).map(function(y){return"\n        translateX("+-xMove+"px)\n        translateY("+-y+"px)\n        rotateZ(-90deg)\n      "})}).flatten()}function makeEndTransform$(state$){return state$.filter(function(state){return state.step===queries_1.lastCombStep(state)+1}).map(function(state){var ease=tween_1.default.power2.easeInOut;var duration=styles_1.default.finalFadeDuration;var timeToReset=styles_1.default.finalResultDuration-duration;var yLift=padding+state.measurements.matrixAHeight*.5+state.measurements.matrixBHeight*.5;var yLastComb=yLift-padding-styles_1.default.matrixBracketWidth*2-state.measurements.rowHeight*(state.step-2);var yOutside=yLastComb-state.measurements.rowHeight-padding*4;return concat_1.default(tween_1.default({from:yLastComb,to:yOutside,duration:duration,ease:ease}).map(function(y){return"\n          translateX("+-xMove+"px)\n          translateY("+-y+"px)\n          rotateZ(-90deg)\n        "}),xstream_1.default.of("translateX(0px) translateY(0px) rotateZ(0deg)").compose(delay_1.default(timeToReset*.9)))}).flatten()}function makeTransform$(state$){var stateOnStepChange$=state$.compose(dropRepeats_1.default(function(s1,s2){return s1.step===s2.step}));return xstream_1.default.merge(makeStartMultiplyTransform$(stateOnStepChange$),makeNextStepTransform$(stateOnStepChange$),makeEndTransform$(stateOnStepChange$)).startWith("translateX(0%) translateY(0px) rotateZ(0deg)")}exports.makeTransform$=makeTransform$},{"../model/queries":10,"../styles":15,xstream:153,"xstream/extra/concat":149,"xstream/extra/delay":150,"xstream/extra/dropRepeats":151,"xstream/extra/tween":152}],24:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var intent_1=require("./intent");var model_1=require("./model");var view_1=require("./view");function Matrix(sources){var action$=intent_1.default(sources.DOM);var reducer$=model_1.default(action$);var vdom$=view_1.default(sources.onion.state$);var sinks={DOM:vdom$,onion:reducer$};return sinks}exports.default=Matrix},{"./intent":25,"./model":26,"./view":28}],25:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function intent(domSource){return domSource.select(".cell").events("input").map(function(ev){var inputEl=ev.target;return{row:parseInt(inputEl.attributes["data-row"].value),col:parseInt(inputEl.attributes["data-col"].value),val:parseFloat(inputEl.value)}}).filter(function(action){return!isNaN(action.val)})}exports.default=intent},{}],26:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var MatrixValues_1=require("../utils/MatrixValues");var defaultState={values:MatrixValues_1.default.ofDimensions(1,1),editable:true,id:"matrix"+Math.round(Math.random()*1e3)};function model(action$){var initReducer$=xstream_1.default.of(function initReducer(prevState){if(!prevState){return defaultState}else{return prevState}});var inputReducer$=action$.map(function(action){return function inputReducer(prevState){return __assign({},prevState,{values:prevState.values.set(action.row,action.col,action.val)})}});return xstream_1.default.merge(initReducer$,inputReducer$)}exports.default=model},{"../utils/MatrixValues":35,xstream:153}],27:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var typestyle_1=require("typestyle");var styles_1=require("../styles");var Styles;(function(Styles){Styles.matrixBracketWidth=2;Styles.matrixBracketWidthPx=Styles.matrixBracketWidth+"px";Styles.matrixBracketIngress="9px";Styles.matrixBracketColor=styles_1.pallete.black;Styles.matrix=typestyle_1.style({position:"relative",padding:Styles.matrixBracketWidth});Styles.leftBracket=typestyle_1.style({position:"absolute",left:0,bottom:0,top:0,width:Styles.matrixBracketWidth,backgroundColor:Styles.matrixBracketColor,$nest:{"&::before":{content:"''",backgroundColor:Styles.matrixBracketColor,position:"absolute",top:0,left:0,height:Styles.matrixBracketWidth,width:Styles.matrixBracketIngress},"&::after":{content:"''",backgroundColor:Styles.matrixBracketColor,position:"absolute",bottom:0,left:0,height:Styles.matrixBracketWidth,width:Styles.matrixBracketIngress}}});Styles.rightBracket=typestyle_1.style({position:"absolute",right:0,bottom:0,top:0,width:Styles.matrixBracketWidth,backgroundColor:Styles.matrixBracketColor,$nest:{"&::before":{content:"''",backgroundColor:Styles.matrixBracketColor,position:"absolute",top:0,right:0,height:Styles.matrixBracketWidth,width:Styles.matrixBracketIngress},"&::after":{content:"''",backgroundColor:Styles.matrixBracketColor,position:"absolute",bottom:0,right:0,height:Styles.matrixBracketWidth,width:Styles.matrixBracketIngress}}});var insetBoxShadow={"box-shadow":"inset 0px 1px 2px 0px rgba(0,0,0,0.5)"};Styles.row=typestyle_1.style({listStyleType:"none",padding:0,margin:0,display:"flex"});Styles.cell=typestyle_1.style({display:"inline-block",fontSize:"24px",width:"2em",height:"2em",fontFamily:"'Source Sans Pro', sans-serif",lineHeight:"49px",textAlign:"center",border:"none",textIndent:"0",padding:"0",color:styles_1.pallete.black,backgroundColor:"rgba(255,255,255,0)",$nest:{"input&":{$nest:{"&:hover":insetBoxShadow,"&:focus":insetBoxShadow}}}})})(Styles||(Styles={}));exports.default=Styles},{"../styles":34,typestyle:144}],28:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var styles_1=require("./styles");var zeroWidthSpace="​";function renderLeftBracket(state){return dom_1.div(".leftBracket."+styles_1.default.leftBracket,{key:"leftBracket"+state.id})}function renderRightBracket(state){return dom_1.div(".rightBracket."+styles_1.default.rightBracket,{key:"rightBracket"+state.id})}function renderCellAsInput(cellValue,i,j){return dom_1.input(".cell."+styles_1.default.cell,{key:"cell"+i+"-"+j,attrs:{type:"text","data-row":i,"data-col":j,value:typeof cellValue==="number"?""+cellValue:void 0}})}function renderCellAsSpan(cellValue,i,j){return dom_1.span(".cell."+styles_1.default.cell,{attrs:{"data-row":i,"data-col":j}},typeof cellValue==="number"?[""+cellValue]:[zeroWidthSpace])}function renderAllCells(state){return state.values.rows.map(function(row,i){return dom_1.ul(".row."+styles_1.default.row,{key:"row"+i},row.map(function(cellValue,j){return dom_1.li(".col",{key:"col"+j},[state.editable?renderCellAsInput(cellValue,i,j):renderCellAsSpan(cellValue,i,j)])}))})}function view(state$){return state$.map(function(state){return dom_1.div(".matrix."+styles_1.default.matrix,{key:state.id},[renderLeftBracket(state)].concat(renderAllCells(state),[renderRightBracket(state)]))})}exports.default=view},{"./styles":27,"@cycle/dom":46}],29:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var endIcon=dom_1.svg({attrs:{width:"20px",height:"20px",viewBox:"0 0 511.63 511.63",space:"preserve"}},[dom_1.svg.g([dom_1.svg.path({attrs:{d:"M506.203,41.968c-3.617-3.617-7.902-5.426-12.851-5.426H456.81c-4.948,0-9.232,1.809-12.847,5.426 c-3.62,3.619-5.427,7.902-5.427,12.851v193.572c-0.955-2.091-2.19-3.899-3.717-5.424L232.11,40.257 c-3.616-3.615-6.658-4.853-9.136-3.709c-2.474,1.141-3.711,4.187-3.711,9.135v202.708c-0.95-2.091-2.187-3.899-3.709-5.424 L12.847,40.257c-3.617-3.615-6.661-4.853-9.135-3.709C1.237,37.689,0,40.735,0,45.683v420.262c0,4.948,1.241,7.998,3.715,9.141 c2.474,1.14,5.518-0.099,9.135-3.72l202.707-202.708c1.52-1.708,2.76-3.519,3.709-5.421v202.708c0,4.948,1.237,7.994,3.711,9.134 s5.52-0.1,9.136-3.717l202.709-202.708c1.523-1.711,2.762-3.524,3.714-5.428v193.571c0,4.948,1.81,9.229,5.427,12.847 c3.614,3.617,7.898,5.425,12.847,5.425h36.546c4.944,0,9.232-1.808,12.85-5.425c3.614-3.617,5.425-7.898,5.425-12.847V54.819 C511.626,49.863,509.82,45.584,506.203,41.968z",fill:"#FFFFFF"}})])]);exports.default=endIcon},{"@cycle/dom":46}],30:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var nextIcon=dom_1.svg({attrs:{width:"20px",height:"20px",viewBox:"0 0 440.25 440.25",space:"preserve"}},[dom_1.svg.g([dom_1.svg.path({attrs:{d:"M434.823,207.279L232.111,4.571c-3.609-3.617-6.655-4.856-9.133-3.713c-2.475,1.143-3.712,4.189-3.712,9.137v202.708 c-0.949-2.091-2.187-3.901-3.711-5.424L12.847,4.571C9.229,0.954,6.186-0.285,3.711,0.858C1.237,2.001,0,5.047,0,9.995v420.262 c0,4.948,1.237,7.994,3.711,9.138c2.474,1.14,5.518-0.1,9.135-3.721l202.708-202.701c1.521-1.711,2.762-3.524,3.711-5.428v202.712 c0,4.948,1.237,7.991,3.712,9.131c2.478,1.143,5.523-0.093,9.133-3.714l202.712-202.708c3.61-3.617,5.428-7.901,5.428-12.847 C440.248,215.178,438.433,210.896,434.823,207.279z",fill:"#FFFFFF"}})])]);exports.default=nextIcon},{"@cycle/dom":46}],31:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var playIcon=dom_1.svg({attrs:{width:"20px",height:"20px",viewBox:"0 0 41.999 41.999",space:"preserve"}},[dom_1.svg.g([dom_1.svg.path({attrs:{d:"M36.068,20.176l-29-20C6.761-0.035,6.363-0.057,6.035,0.114C5.706,0.287,5.5,0.627,5.5,0.999v40 c0,0.372,0.206,0.713,0.535,0.886c0.146,0.076,0.306,0.114,0.465,0.114c0.199,0,0.397-0.06,0.568-0.177l29-20  c0.271-0.187,0.432-0.494,0.432-0.823S36.338,20.363,36.068,20.176z",fill:"#FFFFFF"}})])]);exports.default=playIcon},{"@cycle/dom":46}],32:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var resetIcon=dom_1.svg({attrs:{width:"20px",height:"20px",viewBox:"0 0 438.536 438.536",space:"preserve"}},[dom_1.svg.g([dom_1.svg.path({attrs:{d:"M421.125,134.191c-11.608-27.03-27.217-50.347-46.819-69.949C354.7,44.639,331.384,29.033,304.353,17.42 C277.325,5.807,248.969,0.005,219.275,0.005c-27.978,0-55.052,5.277-81.227,15.843C111.879,26.412,88.61,41.305,68.243,60.531 l-37.12-36.835c-5.711-5.901-12.275-7.232-19.701-3.999C3.807,22.937,0,28.554,0,36.547v127.907c0,4.948,1.809,9.231,5.426,12.847 c3.619,3.617,7.902,5.426,12.85,5.426h127.907c7.996,0,13.61-3.807,16.846-11.421c3.234-7.423,1.903-13.988-3.999-19.701 l-39.115-39.398c13.328-12.563,28.553-22.222,45.683-28.98c17.131-6.757,35.021-10.138,53.675-10.138 c19.793,0,38.687,3.858,56.674,11.563c17.99,7.71,33.544,18.131,46.679,31.265c13.134,13.131,23.555,28.69,31.265,46.679   c7.703,17.987,11.56,36.875,11.56,56.674c0,19.798-3.856,38.686-11.56,56.672c-7.71,17.987-18.131,33.544-31.265,46.679 c-13.135,13.134-28.695,23.558-46.679,31.265c-17.987,7.707-36.881,11.561-56.674,11.561c-22.651,0-44.064-4.949-64.241-14.843 c-20.174-9.894-37.209-23.883-51.104-41.973c-1.331-1.902-3.521-3.046-6.567-3.429c-2.856,0-5.236,0.855-7.139,2.566 l-39.114,39.402c-1.521,1.53-2.33,3.478-2.426,5.853c-0.094,2.385,0.527,4.524,1.858,6.427 c20.749,25.125,45.871,44.587,75.373,58.382c29.502,13.798,60.625,20.701,93.362,20.701c29.694,0,58.05-5.808,85.078-17.416 c27.031-11.607,50.34-27.22,69.949-46.821c19.605-19.609,35.211-42.921,46.822-69.949s17.411-55.392,17.411-85.08 C438.536,189.569,432.732,161.22,421.125,134.191z",fill:"#FFFFFF"}})])]);exports.default=resetIcon},{"@cycle/dom":46}],33:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var run_1=require("@cycle/run");var dom_1=require("@cycle/dom");var cycle_onionify_1=require("cycle-onionify");var index_1=require("./App/index");require("./styles");var typestyle_1=require("typestyle");var main=cycle_onionify_1.default(index_1.default);run_1.run(main,{DOM:dom_1.makeDOMDriver("#main-container")});typestyle_1.forceRenderStyles()},{"./App/index":1,"./styles":34,"@cycle/dom":46,"@cycle/run":56,"cycle-onionify":59,typestyle:144}],34:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var typestyle_1=require("typestyle");typestyle_1.cssRule("@font-face",{fontFamily:'"Source Sans Pro"',src:'url("./fonts/SourceSansPro-Regular.otf")',fontWeight:"normal"});typestyle_1.cssRule("@font-face",{fontFamily:'"Vesper Libre"',src:'url("./fonts/VesperLibre-Regular.ttf")',fontWeight:"normal"});exports.pallete={blue:"rgb(48, 141, 255)",blueWeak:"rgb(93, 166, 252)",orange:"rgb(255, 162, 48)",orangeWeak:"rgb(253, 180, 97)",white:"#FFFFFF",grayLight:"#EEEEEE",gray:"#C5C5C5",grayDark:"#686868",black:"#323232"}},{typestyle:144}],35:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var immutable_1=require("immutable");var MatrixValues=function(){function MatrixValues(){}MatrixValues.prototype.clone=function(){var mv=new MatrixValues;mv.numRows=this.numRows;mv.numCols=this.numCols;mv.values=this.values;return mv};MatrixValues.ofDimensions=function(rows,columns){var mv=new MatrixValues;mv.numRows=Math.max(1,rows);mv.numCols=Math.max(1,columns);mv.values=makeValues(rows,columns);return mv};MatrixValues.from=function(vals){var mv=new MatrixValues;mv.numRows=vals.length;mv.numCols=vals[0].length;mv.values=immutable_1.fromJS(vals);return mv};MatrixValues.prototype.resize=function(numRows,numColumns){var _a=this,oldNumRows=_a.numRows,oldNumCols=_a.numCols;var nR=Math.max(1,numRows);var nC=Math.max(1,numColumns);var mv=new MatrixValues;mv.numRows=nR;mv.numCols=nC;mv.values=this.values.setSize(nR).map(function(rows,rowIndex){if(rowIndex>=oldNumRows){return makeRow(nC)}else{return rows.setSize(nC).map(function(v,colIndex){return colIndex>=oldNumCols?1:v})}});return mv};MatrixValues.prototype.set=function(rowIndex,colIndex,value){var mv=this.clone();mv.values=mv.values.setIn([rowIndex,colIndex],value);return mv};MatrixValues.prototype.get=function(rowIndex,colIndex){return this.values.getIn([rowIndex,colIndex])};MatrixValues.prototype.setAll=function(value){var mv=new MatrixValues;mv.numRows=this.numRows;mv.numCols=this.numCols;mv.values=makeValues(mv.numRows,mv.numCols,value);return mv};Object.defineProperty(MatrixValues.prototype,"numberRows",{get:function(){return this.numRows},enumerable:true,configurable:true});Object.defineProperty(MatrixValues.prototype,"numberColumns",{get:function(){return this.numCols},enumerable:true,configurable:true});Object.defineProperty(MatrixValues.prototype,"rows",{get:function(){return this.values.toJS()},enumerable:true,configurable:true});return MatrixValues}();exports.default=MatrixValues;function makeValues(numRows,numColumns,val){if(val===void 0){val=1}var vals=new Array(numRows);for(var i=0;i<numRows;i++){vals[i]=makeRow(numColumns,val)}return immutable_1.List(vals)}function makeRow(numColumns,val){if(val===void 0){val=1}var row=new Array(numColumns);for(var i=0;i<numColumns;i++){row[i]=val}return immutable_1.List(row)}},{immutable:126}],36:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var adapt_1=require("@cycle/run/lib/adapt");var fromEvent_1=require("./fromEvent");var BodyDOMSource=function(){function BodyDOMSource(_name){this._name=_name}BodyDOMSource.prototype.select=function(selector){return this};BodyDOMSource.prototype.elements=function(){var out=adapt_1.adapt(xstream_1.default.of(document.body));out._isCycleSource=this._name;return out};BodyDOMSource.prototype.events=function(eventType,options){if(options===void 0){options={}}var stream;stream=fromEvent_1.fromEvent(document.body,eventType,options.useCapture,options.preventDefault);var out=adapt_1.adapt(stream);out._isCycleSource=this._name;return out};return BodyDOMSource}();exports.BodyDOMSource=BodyDOMSource},{"./fromEvent":44,"@cycle/run/lib/adapt":55,xstream:153}],37:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var adapt_1=require("@cycle/run/lib/adapt");var fromEvent_1=require("./fromEvent");var DocumentDOMSource=function(){function DocumentDOMSource(_name){this._name=_name}DocumentDOMSource.prototype.select=function(selector){return this};DocumentDOMSource.prototype.elements=function(){var out=adapt_1.adapt(xstream_1.default.of(document));out._isCycleSource=this._name;return out};DocumentDOMSource.prototype.events=function(eventType,options){if(options===void 0){options={}}var stream;stream=fromEvent_1.fromEvent(document,eventType,options.useCapture,options.preventDefault);var out=adapt_1.adapt(stream);out._isCycleSource=this._name;return out};return DocumentDOMSource}();exports.DocumentDOMSource=DocumentDOMSource},{"./fromEvent":44,"@cycle/run/lib/adapt":55,xstream:153}],38:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ScopeChecker_1=require("./ScopeChecker");var utils_1=require("./utils");var matchesSelector_1=require("./matchesSelector");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;var selector=utils_1.getSelectors(namespace);if(!selector){return rootElement}var fullScope=utils_1.getFullScope(namespace);var scopeChecker=new ScopeChecker_1.ScopeChecker(fullScope,this.isolateModule);var topNode=fullScope?this.isolateModule.getElement(fullScope)||rootElement:rootElement;var topNodeMatchesSelector=!!fullScope&&!!selector&&matchesSelector_1.matchesSelector(topNode,selector);return toElArray(topNode.querySelectorAll(selector)).filter(scopeChecker.isDirectlyInScope,scopeChecker).concat(topNodeMatchesSelector?[topNode]:[])};return ElementFinder}();exports.ElementFinder=ElementFinder},{"./ScopeChecker":42,"./matchesSelector":49,"./utils":53}],39:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var ScopeChecker_1=require("./ScopeChecker");var utils_1=require("./utils");var matchesSelector_1=require("./matchesSelector");function indexOf(arr,searchId){var minIndex=0;var maxIndex=arr.length-1;var currentIndex;var current;while(minIndex<=maxIndex){currentIndex=(minIndex+maxIndex)/2|0;current=arr[currentIndex];var currentId=current.id;if(currentId<searchId){minIndex=currentIndex+1}else if(currentId>searchId){maxIndex=currentIndex-1}else{return currentIndex}}return-1}var EventDelegator=function(){function EventDelegator(origin,eventType,useCapture,isolateModule,preventDefault){if(preventDefault===void 0){preventDefault=false}var _this=this;this.origin=origin;this.eventType=eventType;this.useCapture=useCapture;this.isolateModule=isolateModule;this.preventDefault=preventDefault;this.destinations=[];this._lastId=0;if(preventDefault){if(useCapture){this.listener=function(ev){ev.preventDefault();_this.capture(ev)}}else{this.listener=function(ev){ev.preventDefault();_this.bubble(ev)}}}else{if(useCapture){this.listener=function(ev){return _this.capture(ev)}}else{this.listener=function(ev){return _this.bubble(ev)}}}origin.addEventListener(eventType,this.listener,useCapture)}EventDelegator.prototype.updateOrigin=function(newOrigin){this.origin.removeEventListener(this.eventType,this.listener,this.useCapture);newOrigin.addEventListener(this.eventType,this.listener,this.useCapture);this.origin=newOrigin};EventDelegator.prototype.createDestination=function(namespace){var _this=this;var id=this._lastId++;var selector=utils_1.getSelectors(namespace);var scopeChecker=new ScopeChecker_1.ScopeChecker(utils_1.getFullScope(namespace),this.isolateModule);var subject=xstream_1.default.create({start:function(){},stop:function(){if("requestIdleCallback"in window){requestIdleCallback(function(){_this.removeDestination(id)})}else{_this.removeDestination(id)}}});var destination={id:id,selector:selector,scopeChecker:scopeChecker,subject:subject};this.destinations.push(destination);return subject};EventDelegator.prototype.removeDestination=function(id){var i=indexOf(this.destinations,id);i>=0&&this.destinations.splice(i,1)};EventDelegator.prototype.capture=function(ev){var n=this.destinations.length;for(var i=0;i<n;i++){var dest=this.destinations[i];if(matchesSelector_1.matchesSelector(ev.target,dest.selector)){dest.subject._n(ev)}}};EventDelegator.prototype.bubble=function(rawEvent){var origin=this.origin;if(!origin.contains(rawEvent.currentTarget)){return}var roof=origin.parentElement;var ev=this.patchEvent(rawEvent);for(var el=ev.target;el&&el!==roof;el=el.parentElement){if(!origin.contains(el)){ev.stopPropagation()}if(ev.propagationHasBeenStopped){return}this.matchEventAgainstDestinations(el,ev)}};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.matchEventAgainstDestinations=function(el,ev){var n=this.destinations.length;for(var i=0;i<n;i++){var dest=this.destinations[i];if(!dest.scopeChecker.isDirectlyInScope(el)){continue}if(matchesSelector_1.matchesSelector(el,dest.selector)){this.mutateEventCurrentTarget(ev,el);dest.subject._n(ev)}}};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};return EventDelegator}();exports.EventDelegator=EventDelegator},{"./ScopeChecker":42,"./matchesSelector":49,"./utils":53,xstream:153}],40:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var MapPolyfill=require("es6-map");var IsolateModule=function(){function IsolateModule(){this.elementsByFullScope=new MapPolyfill;this.delegatorsByFullScope=new MapPolyfill;this.fullScopesBeingUpdated=[]}IsolateModule.prototype.cleanupVNode=function(_a){var data=_a.data,elm=_a.elm;var fullScope=(data||{}).isolate||"";var isCurrentElm=this.elementsByFullScope.get(fullScope)===elm;var isScopeBeingUpdated=this.fullScopesBeingUpdated.indexOf(fullScope)>=0;if(fullScope&&isCurrentElm&&!isScopeBeingUpdated){this.elementsByFullScope.delete(fullScope);this.delegatorsByFullScope.delete(fullScope)}};IsolateModule.prototype.getElement=function(fullScope){return this.elementsByFullScope.get(fullScope)};IsolateModule.prototype.getFullScope=function(elm){var iterator=this.elementsByFullScope.entries();for(var result=iterator.next();!!result.value;result=iterator.next()){var _a=result.value,fullScope=_a[0],element=_a[1];if(elm===element){return fullScope}}return""};IsolateModule.prototype.addEventDelegator=function(fullScope,eventDelegator){var delegators=this.delegatorsByFullScope.get(fullScope);if(!delegators){delegators=[];this.delegatorsByFullScope.set(fullScope,delegators)}delegators[delegators.length]=eventDelegator};IsolateModule.prototype.reset=function(){this.elementsByFullScope.clear();this.delegatorsByFullScope.clear();this.fullScopesBeingUpdated=[]};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 oldFullScope=oldData.isolate||"";var fullScope=data.isolate||"";if(fullScope){self.fullScopesBeingUpdated.push(fullScope);if(oldFullScope){self.elementsByFullScope.delete(oldFullScope)}self.elementsByFullScope.set(fullScope,elm);var delegators=self.delegatorsByFullScope.get(fullScope);if(delegators){var len=delegators.length;for(var i=0;i<len;++i){delegators[i].updateOrigin(elm)}}}if(oldFullScope&&!fullScope){self.elementsByFullScope.delete(fullScope)}},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 oldFullScope=oldData.isolate||"";var fullScope=data.isolate||"";if(fullScope&&fullScope!==oldFullScope){if(oldFullScope){self.elementsByFullScope.delete(oldFullScope)}self.elementsByFullScope.set(fullScope,elm);var delegators=self.delegatorsByFullScope.get(oldFullScope);if(delegators){self.delegatorsByFullScope.delete(oldFullScope);self.delegatorsByFullScope.set(fullScope,delegators)}}if(oldFullScope&&!fullScope){self.elementsByFullScope.delete(oldFullScope);self.delegatorsByFullScope.delete(oldFullScope)}},destroy:function(vNode){self.cleanupVNode(vNode)},remove:function(vNode,cb){self.cleanupVNode(vNode);cb()},post:function(){self.fullScopesBeingUpdated=[]}}};return IsolateModule}();exports.IsolateModule=IsolateModule},{"es6-map":113}],41:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var adapt_1=require("@cycle/run/lib/adapt");var DocumentDOMSource_1=require("./DocumentDOMSource");var BodyDOMSource_1=require("./BodyDOMSource");var ElementFinder_1=require("./ElementFinder");var fromEvent_1=require("./fromEvent");var isolate_1=require("./isolate");var EventDelegator_1=require("./EventDelegator");var utils_1=require("./utils");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}function filterBasedOnIsolation(domSource,fullScope){return function filterBasedOnIsolationOperator(rootElement$){var initialState={wasIsolated:false,shouldPass:false,element:null};return rootElement$.fold(function checkIfShouldPass(state,element){var isIsolated=!!domSource._isolateModule.getElement(fullScope);state.shouldPass=isIsolated&&!state.wasIsolated;state.wasIsolated=isIsolated;state.element=element;return state},initialState).drop(1).filter(function(s){return s.shouldPass}).map(function(s){return s.element})}}var MainDOMSource=function(){function MainDOMSource(_rootElement$,_sanitation$,_namespace,_isolateModule,_delegators,_name){if(_namespace===void 0){_namespace=[]}var _this=this;this._rootElement$=_rootElement$;this._sanitation$=_sanitation$;this._namespace=_namespace;this._isolateModule=_isolateModule;this._delegators=_delegators;this._name=_name;this.isolateSource=isolate_1.isolateSource;this.isolateSink=function(sink,scope){if(scope===":root"){return sink}else if(utils_1.isClassOrId(scope)){return isolate_1.siblingIsolateSink(sink,scope)}else{var prevFullScope=utils_1.getFullScope(_this._namespace);var nextFullScope=[prevFullScope,scope].filter(function(x){return!!x}).join("-");return isolate_1.totalIsolateSink(sink,nextFullScope)}}}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 out=adapt_1.adapt(output$.remember());out._isCycleSource=this._name;return out};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")}if(selector==="document"){return new DocumentDOMSource_1.DocumentDOMSource(this._name)}if(selector==="body"){return new BodyDOMSource_1.BodyDOMSource(this._name)}var trimmedSelector=selector.trim();var childNamespace=trimmedSelector===":root"?this._namespace:this._namespace.concat(trimmedSelector);return new MainDOMSource(this._rootElement$,this._sanitation$,childNamespace,this._isolateModule,this._delegators,this._name)};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 fullScope=utils_1.getFullScope(namespace);var keyParts=[eventType,useCapture];if(fullScope){keyParts.push(fullScope)}var key=keyParts.join("~");var domSource=this;var rootElement$;if(fullScope){rootElement$=this._rootElement$.compose(filterBasedOnIsolation(domSource,fullScope))}else{rootElement$=this._rootElement$.take(2)}var event$=rootElement$.map(function setupEventDelegatorOnTopElement(rootElement){if(!namespace||namespace.length===0){return fromEvent_1.fromEvent(rootElement,eventType,useCapture,options.preventDefault)}var delegators=domSource._delegators;var origin=domSource._isolateModule.getElement(fullScope)||rootElement;var delegator;if(delegators.has(key)){delegator=delegators.get(key);delegator.updateOrigin(origin)}else{delegator=new EventDelegator_1.EventDelegator(origin,eventType,useCapture,domSource._isolateModule,options.preventDefault);delegators.set(key,delegator)}if(fullScope){domSource._isolateModule.addEventDelegator(fullScope,delegator)}var subject=delegator.createDestination(namespace);return subject}).flatten();var out=adapt_1.adapt(event$)
  ;out._isCycleSource=domSource._name;return out};MainDOMSource.prototype.dispose=function(){this._sanitation$.shamefullySendNext(null);this._isolateModule.reset()};return MainDOMSource}();exports.MainDOMSource=MainDOMSource},{"./BodyDOMSource":36,"./DocumentDOMSource":37,"./ElementFinder":38,"./EventDelegator":39,"./fromEvent":44,"./isolate":47,"./utils":53,"@cycle/run/lib/adapt":55}],42:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ScopeChecker=function(){function ScopeChecker(fullScope,isolateModule){this.fullScope=fullScope;this.isolateModule=isolateModule}ScopeChecker.prototype.isDirectlyInScope=function(leaf){for(var el=leaf;el;el=el.parentElement){var fullScope=this.isolateModule.getFullScope(el);if(fullScope&&fullScope!==this.fullScope){return false}if(fullScope){return true}}return true};return ScopeChecker}();exports.ScopeChecker=ScopeChecker},{}],43:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var h_1=require("snabbdom/h");var classNameFromVNode_1=require("snabbdom-selector/lib/commonjs/classNameFromVNode");var selectorParser_1=require("snabbdom-selector/lib/commonjs/selectorParser");var VNodeWrapper=function(){function VNodeWrapper(rootElement){this.rootElement=rootElement}VNodeWrapper.prototype.call=function(vnode){if(vnode===null){return this.wrap([])}var _a=selectorParser_1.selectorParser(vnode),selTagName=_a.tagName,selId=_a.id;var vNodeClassName=classNameFromVNode_1.classNameFromVNode(vnode);var vNodeData=vnode.data||{};var vNodeDataProps=vNodeData.props||{};var _b=vNodeDataProps.id,vNodeId=_b===void 0?selId:_b;var isVNodeAndRootElementIdentical=typeof vNodeId==="string"&&vNodeId.toUpperCase()===this.rootElement.id.toUpperCase()&&selTagName.toUpperCase()===this.rootElement.tagName.toUpperCase()&&vNodeClassName.toUpperCase()===this.rootElement.className.toUpperCase();if(isVNodeAndRootElementIdentical){return vnode}return this.wrap([vnode])};VNodeWrapper.prototype.wrap=function(children){var _a=this.rootElement,tagName=_a.tagName,id=_a.id,className=_a.className;var selId=id?"#"+id:"";var selClass=className?"."+className.split(" ").join("."):"";return h_1.h(""+tagName.toLowerCase()+selId+selClass,{},children)};return VNodeWrapper}();exports.VNodeWrapper=VNodeWrapper},{"snabbdom-selector/lib/commonjs/classNameFromVNode":128,"snabbdom-selector/lib/commonjs/selectorParser":129,"snabbdom/h":130}],44:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");function fromEvent(element,eventName,useCapture,preventDefault){if(useCapture===void 0){useCapture=false}if(preventDefault===void 0){preventDefault=false}return xstream_1.Stream.create({element:element,next:null,start:function start(listener){if(preventDefault){this.next=function next(event){event.preventDefault();listener.next(event)}}else{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},{xstream:153}],45:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var h_1=require("snabbdom/h");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(a,b,c){var hasA=typeof a!=="undefined";var hasB=typeof b!=="undefined";var hasC=typeof c!=="undefined";if(isSelector(a)){if(hasB&&hasC){return h_1.h(tagName+a,b,c)}else if(hasB){return h_1.h(tagName+a,b)}else{return h_1.h(tagName+a,{})}}else if(hasC){return h_1.h(tagName+a,b,c)}else if(hasB){return h_1.h(tagName,a,b)}else if(hasA){return h_1.h(tagName,a)}else{return h_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","polyline","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)});exports.default=exported},{"snabbdom/h":130}],46:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var thunk_1=require("./thunk");exports.thunk=thunk_1.thunk;var MainDOMSource_1=require("./MainDOMSource");exports.MainDOMSource=MainDOMSource_1.MainDOMSource;var makeDOMDriver_1=require("./makeDOMDriver");exports.makeDOMDriver=makeDOMDriver_1.makeDOMDriver;var mockDOMSource_1=require("./mockDOMSource");exports.mockDOMSource=mockDOMSource_1.mockDOMSource;exports.MockedDOMSource=mockDOMSource_1.MockedDOMSource;var h_1=require("snabbdom/h");exports.h=h_1.h;var hyperscript_helpers_1=require("./hyperscript-helpers");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},{"./MainDOMSource":41,"./hyperscript-helpers":45,"./makeDOMDriver":48,"./mockDOMSource":50,"./thunk":52,"snabbdom/h":130}],47:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var vnode_1=require("snabbdom/vnode");var utils_1=require("./utils");function totalIsolateSource(source,scope){return source.select(utils_1.SCOPE_PREFIX+scope)}function siblingIsolateSource(source,scope){return source.select(scope)}function isolateSource(source,scope){if(scope===":root"){return source}else if(utils_1.isClassOrId(scope)){return siblingIsolateSource(source,scope)}else{return totalIsolateSource(source,scope)}}exports.isolateSource=isolateSource;function siblingIsolateSink(sink,scope){return sink.map(function(node){return node?vnode_1.vnode(node.sel+scope,node.data,node.children,node.text,node.elm):node})}exports.siblingIsolateSink=siblingIsolateSink;function totalIsolateSink(sink,fullScope){return sink.map(function(node){if(!node){return node}if(node.data&&node.data.isolate){var isolateData=node.data.isolate;var prevFullScopeNum=isolateData.replace(/(cycle|\-)/g,"");var fullScopeNum=fullScope.replace(/(cycle|\-)/g,"");if(isNaN(parseInt(prevFullScopeNum))||isNaN(parseInt(fullScopeNum))||prevFullScopeNum>fullScopeNum){return node}}node.data=node.data||{};node.data.isolate=fullScope;if(typeof node.key==="undefined"){node.key=utils_1.SCOPE_PREFIX+fullScope}return node})}exports.totalIsolateSink=totalIsolateSink},{"./utils":53,"snabbdom/vnode":141}],48:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var snabbdom_1=require("snabbdom");var xstream_1=require("xstream");var MainDOMSource_1=require("./MainDOMSource");var tovnode_1=require("snabbdom/tovnode");var VNodeWrapper_1=require("./VNodeWrapper");var utils_1=require("./utils");var modules_1=require("./modules");var IsolateModule_1=require("./IsolateModule");var MapPolyfill=require("es6-map");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 dropCompletion(input){return xstream_1.default.merge(input,xstream_1.default.never())}function unwrapElementFromVNode(vnode){return vnode.elm}function reportSnabbdomError(err){(console.error||console.log)(err)}function makeDOMDriver(container,options){if(!options){options={}}var modules=options.modules||modules_1.default;var isolateModule=new IsolateModule_1.IsolateModule;var patch=snabbdom_1.init([isolateModule.createModule()].concat(modules));var rootElement=utils_1.getElement(container)||document.body;var vnodeWrapper=new VNodeWrapper_1.VNodeWrapper(rootElement);var delegators=new MapPolyfill;makeDOMDriverInputGuard(modules);function DOMDriver(vnode$,name){if(name===void 0){name="DOM"}domDriverInputGuard(vnode$);var sanitation$=xstream_1.default.create();var rootElement$=xstream_1.default.merge(vnode$.endWhen(sanitation$),sanitation$).map(function(vnode){return vnodeWrapper.call(vnode)}).fold(patch,tovnode_1.toVNode(rootElement)).drop(1).map(unwrapElementFromVNode).compose(dropCompletion).startWith(rootElement);var listener={error:reportSnabbdomError};if(document.readyState==="loading"){document.addEventListener("readystatechange",function(){if(document.readyState==="interactive"){rootElement$.addListener(listener)}})}else{rootElement$.addListener(listener)}return new MainDOMSource_1.MainDOMSource(rootElement$,sanitation$,[],isolateModule,delegators,name)}return DOMDriver}exports.makeDOMDriver=makeDOMDriver},{"./IsolateModule":40,"./MainDOMSource":41,"./VNodeWrapper":43,"./modules":51,"./utils":53,"es6-map":113,snabbdom:138,"snabbdom/tovnode":140,xstream:153}],49:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function createMatchesSelector(){var vendor;try{var proto=Element.prototype;vendor=proto.matches||proto.matchesSelector||proto.webkitMatchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector}catch(err){vendor=null}return function match(elem,selector){if(vendor){return vendor.call(elem,selector)}var nodes=elem.parentNode.querySelectorAll(selector);for(var i=0;i<nodes.length;i++){if(nodes[i]===elem){return true}}return false}}exports.matchesSelector=createMatchesSelector()},{}],50:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var adapt_1=require("@cycle/run/lib/adapt");var SCOPE_PREFIX="___";var MockedDOMSource=function(){function MockedDOMSource(_mockConfig){this._mockConfig=_mockConfig;if(_mockConfig["elements"]){this._elements=_mockConfig["elements"]}else{this._elements=adapt_1.adapt(xstream_1.default.empty())}}MockedDOMSource.prototype.elements=function(){var out=this._elements;out._isCycleSource="MockedDOM";return out};MockedDOMSource.prototype.events=function(eventType,options){var streamForEventType=this._mockConfig[eventType];var out=adapt_1.adapt(streamForEventType||xstream_1.default.empty());out._isCycleSource="MockedDOM";return out};MockedDOMSource.prototype.select=function(selector){var mockConfigForSelector=this._mockConfig[selector]||{};return new MockedDOMSource(mockConfigForSelector)};MockedDOMSource.prototype.isolateSource=function(source,scope){return source.select("."+SCOPE_PREFIX+scope)};MockedDOMSource.prototype.isolateSink=function(sink,scope){return sink.map(function(vnode){if(vnode.sel&&vnode.sel.indexOf(SCOPE_PREFIX+scope)!==-1){return vnode}else{vnode.sel+="."+SCOPE_PREFIX+scope;return vnode}})};return MockedDOMSource}();exports.MockedDOMSource=MockedDOMSource;function mockDOMSource(mockConfig){return new MockedDOMSource(mockConfig)}exports.mockDOMSource=mockDOMSource},{"@cycle/run/lib/adapt":55,xstream:153}],51:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var class_1=require("snabbdom/modules/class");exports.ClassModule=class_1.default;var props_1=require("snabbdom/modules/props");exports.PropsModule=props_1.default;var attributes_1=require("snabbdom/modules/attributes");exports.AttrsModule=attributes_1.default;var style_1=require("snabbdom/modules/style");exports.StyleModule=style_1.default;var dataset_1=require("snabbdom/modules/dataset");exports.DatasetModule=dataset_1.default;var modules=[style_1.default,class_1.default,props_1.default,attributes_1.default,dataset_1.default];exports.default=modules},{"snabbdom/modules/attributes":133,"snabbdom/modules/class":134,"snabbdom/modules/dataset":135,"snabbdom/modules/props":136,"snabbdom/modules/style":137}],52:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var h_1=require("snabbdom/h");function copyToThunk(vnode,thunk){thunk.elm=vnode.elm;vnode.data.fn=thunk.data.fn;vnode.data.args=thunk.data.args;vnode.data.isolate=thunk.data.isolate;thunk.data=vnode.data;thunk.children=vnode.children;thunk.text=vnode.text;thunk.elm=vnode.elm}function init(thunk){var cur=thunk.data;var vnode=cur.fn.apply(undefined,cur.args);copyToThunk(vnode,thunk)}function prepatch(oldVnode,thunk){var old=oldVnode.data,cur=thunk.data;var i;var oldArgs=old.args,args=cur.args;if(old.fn!==cur.fn||oldArgs.length!==args.length){copyToThunk(cur.fn.apply(undefined,args),thunk)}for(i=0;i<args.length;++i){if(oldArgs[i]!==args[i]){copyToThunk(cur.fn.apply(undefined,args),thunk);return}}copyToThunk(oldVnode,thunk)}exports.thunk=function thunk(sel,key,fn,args){if(args===undefined){args=fn;fn=key;key=undefined}return h_1.h(sel,{key:key,hook:{init:init,prepatch:prepatch},fn:fn,args:args})};exports.default=exports.thunk},{"snabbdom/h":130}],53:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function isElement(obj){var ELEM_TYPE=1;var FRAG_TYPE=11;return typeof HTMLElement==="object"?obj instanceof HTMLElement||obj instanceof DocumentFragment:obj&&typeof obj==="object"&&obj!==null&&(obj.nodeType===ELEM_TYPE||obj.nodeType===FRAG_TYPE)&&typeof obj.nodeName==="string"}function isClassOrId(str){return str.length>1&&(str[0]==="."||str[0]==="#")}exports.isClassOrId=isClassOrId;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 getFullScope(namespace){return namespace.filter(function(c){return c.indexOf(exports.SCOPE_PREFIX)>-1}).map(function(c){return c.replace(exports.SCOPE_PREFIX,"")}).join("-")}exports.getFullScope=getFullScope;function getSelectors(namespace){return namespace.filter(function(c){return c.indexOf(exports.SCOPE_PREFIX)===-1}).join(" ")}exports.getSelectors=getSelectors},{}],54:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function checkIsolateArgs(dataflowComponent,scope){if(typeof dataflowComponent!=="function"){throw new Error("First argument given to isolate() must be a "+"'dataflowComponent' function")}if(scope===null){throw new Error("Second argument given to isolate() must not be null")}}function normalizeScopes(sources,scopes,randomScope){var perChannel={};Object.keys(sources).forEach(function(channel){if(typeof scopes==="string"){perChannel[channel]=scopes;return}var candidate=scopes[channel];if(typeof candidate!=="undefined"){perChannel[channel]=candidate;return}var wildcard=scopes["*"];if(typeof wildcard!=="undefined"){perChannel[channel]=wildcard;return}perChannel[channel]=randomScope});return perChannel}function isolateAllSources(outerSources,scopes){var innerSources={};for(var channel in outerSources){var outerSource=outerSources[channel];if(outerSources.hasOwnProperty(channel)&&outerSource&&scopes[channel]!==null&&typeof outerSource.isolateSource==="function"){innerSources[channel]=outerSource.isolateSource(outerSource,scopes[channel])}else if(outerSources.hasOwnProperty(channel)){innerSources[channel]=outerSources[channel]}}return innerSources}function isolateAllSinks(sources,innerSinks,scopes){var outerSinks={};for(var channel in innerSinks){var source=sources[channel];var innerSink=innerSinks[channel];if(innerSinks.hasOwnProperty(channel)&&source&&scopes[channel]!==null&&typeof source.isolateSink==="function"){outerSinks[channel]=source.isolateSink(innerSink,scopes[channel])}else if(innerSinks.hasOwnProperty(channel)){outerSinks[channel]=innerSinks[channel]}}return outerSinks}var counter=0;function newScope(){return"cycle"+ ++counter}function isolate(component,scope){if(scope===void 0){scope=newScope()}checkIsolateArgs(component,scope);var randomScope=typeof scope==="object"?newScope():"";var scopes=typeof scope==="string"||typeof scope==="object"?scope:scope.toString();return function wrappedComponent(outerSources){var rest=[];for(var _i=1;_i<arguments.length;_i++){rest[_i-1]=arguments[_i]}var scopesPerChannel=normalizeScopes(outerSources,scopes,randomScope);var innerSources=isolateAllSources(outerSources,scopesPerChannel);var innerSinks=component.apply(void 0,[innerSources].concat(rest));var outerSinks=isolateAllSinks(outerSources,innerSinks,scopesPerChannel);return outerSinks}}isolate.reset=function(){return counter=0};exports.default=isolate},{}],55:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var adaptStream=function(x){return x};function setAdapt(f){adaptStream=f}exports.setAdapt=setAdapt;function adapt(stream){return adaptStream(stream)}exports.adapt=adapt},{}],56:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var adapt_1=require("./adapt");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){var sinkProxies={};for(var name_1 in drivers){if(drivers.hasOwnProperty(name_1)){sinkProxies[name_1]=xstream_1.default.createWithMemory()}}return sinkProxies}function callDrivers(drivers,sinkProxies){var sources={};for(var name_2 in drivers){if(drivers.hasOwnProperty(name_2)){sources[name_2]=drivers[name_2](sinkProxies[name_2],name_2);if(sources[name_2]&&typeof sources[name_2]==="object"){sources[name_2]._isCycleSource=name_2}}}return sources}function adaptSources(sources){for(var name_3 in sources){if(sources.hasOwnProperty(name_3)&&sources[name_3]&&typeof sources[name_3]["shamefullySendNext"]==="function"){sources[name_3]=adapt_1.adapt(sources[name_3])}}return sources}function replicateMany(sinks,sinkProxies){var sinkNames=Object.keys(sinks).filter(function(name){return!!sinkProxies[name]});var buffers={};var replicators={};sinkNames.forEach(function(name){buffers[name]={_n:[],_e:[]};replicators[name]={next:function(x){return buffers[name]._n.push(x)},error:function(err){return buffers[name]._e.push(err)},complete:function(){}}});var subscriptions=sinkNames.map(function(name){return xstream_1.default.fromObservable(sinks[name]).subscribe(replicators[name])});sinkNames.forEach(function(name){var listener=sinkProxies[name];var next=function(x){listener._n(x)};var error=function(err){logToConsoleError(err);listener._e(err)};buffers[name]._n.forEach(next);buffers[name]._e.forEach(error);replicators[name].next=next;replicators[name].error=error;replicators[name]._n=next;replicators[name]._e=error});buffers=null;return function disposeReplication(){subscriptions.forEach(function(s){return s.unsubscribe()});sinkNames.forEach(function(name){return sinkProxies[name]._c()})}}function disposeSources(sources){for(var k in sources){if(sources.hasOwnProperty(k)&&sources[k]&&sources[k].dispose){sources[k].dispose()}}}function isObjectEmpty(obj){return Object.keys(obj).length===0}function setup(main,drivers){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 sinkProxies=makeSinkProxies(drivers);var sources=callDrivers(drivers,sinkProxies);var adaptedSources=adaptSources(sources);var sinks=main(adaptedSources);if(typeof window!=="undefined"){window.Cyclejs=window.Cyclejs||{};window.Cyclejs.sinks=sinks}function run(){var disposeReplication=replicateMany(sinks,sinkProxies);return function dispose(){disposeSources(sources);disposeReplication()}}return{sinks:sinks,sources:sources,run:run}}exports.setup=setup;function run(main,drivers){var _a=setup(main,drivers),run=_a.run,sinks=_a.sinks;if(typeof window!=="undefined"&&window["CyclejsDevTool_startGraphSerializer"]){window["CyclejsDevTool_startGraphSerializer"](sinks)}return run()}exports.run=run;exports.default=run},{"./adapt":55,xstream:153}],57:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var adapt_1=require("@cycle/run/lib/adapt");var isolate_1=require("@cycle/isolate");var pickMerge_1=require("./pickMerge");var pickCombine_1=require("./pickCombine");var identityLens={get:function(outer){return outer},set:function(outer,inner){return inner}};function instanceLens(getKey,key){return{get:function(arr){if(typeof arr==="undefined"){return void 0}else{for(var i=0,n=arr.length;i<n;++i){if(getKey(arr[i])===key){return arr[i]}}return void 0}},set:function(arr,item){if(typeof arr==="undefined"){return[item]}else if(typeof item==="undefined"){return arr.filter(function(s){return getKey(s)!==key})}else{return arr.map(function(s){if(getKey(s)===key){return item}else{return s}})}}}}var Instances=function(){function Instances(instances$){this._instances$=instances$}Instances.prototype.pickMerge=function(selector){return adapt_1.adapt(this._instances$.compose(pickMerge_1.pickMerge(selector)))};Instances.prototype.pickCombine=function(selector){return adapt_1.adapt(this._instances$.compose(pickCombine_1.pickCombine(selector)))};return Instances}();exports.Instances=Instances;function defaultMakeScopes(key){return{"*":null}}var Collection=function(){function Collection(itemComp,state$,name,makeScopes){if(makeScopes===void 0){makeScopes=defaultMakeScopes}this._itemComp=itemComp;this._state$=state$;this._name=name;this._makeScopes=makeScopes;this._getKey=null}Collection.prototype.uniqueBy=function(getKey){return new UniqueCollection(this._itemComp,this._state$,this._name,getKey,this._makeScopes)};Collection.prototype.isolateEach=function(makeScopes){return new Collection(this._itemComp,this._state$,this._name,makeScopes)};Collection.prototype.build=function(sources){var _this=this;var instances$=this._state$.fold(function(acc,nextState){var dict=acc.dict;if(Array.isArray(nextState)){var nextInstArray=Array(nextState.length);var nextKeys_1=new Set;for(var i=0,n=nextState.length;i<n;++i){var key=_this._getKey===null?""+i:_this._getKey(nextState[i]);nextKeys_1.add(key);if(_this._getKey===null||!dict.has(key)){var onionScope=_this._getKey===null?i:instanceLens(_this._getKey,key);var otherScopes=_this._makeScopes(key);var scopes=typeof otherScopes==="string"?(_a={"*":otherScopes},_a[_this._name]=onionScope,_a):__assign({},otherScopes,(_b={},_b[_this._name]=onionScope,_b));var sinks=isolate_1.default(_this._itemComp,scopes)(sources);dict.set(key,sinks);nextInstArray[i]=sinks}else{nextInstArray[i]=dict.get(key)}nextInstArray[i]._key=key}dict.forEach(function(_,key){if(!nextKeys_1.has(key)){dict.delete(key)}});nextKeys_1.clear();return{dict:dict,arr:nextInstArray}}else{dict.clear();var key=_this._getKey===null?"this":_this._getKey(nextState);var onionScope=identityLens;var otherScopes=_this._makeScopes(key);var scopes=typeof otherScopes==="string"?(_c={"*":otherScopes},_c[_this._name]=onionScope,_c):__assign({},otherScopes,(_d={},_d[_this._name]=onionScope,_d));var sinks=isolate_1.default(_this._itemComp,scopes)(sources);dict.set(key,sinks);return{dict:dict,arr:[sinks]}}var _a,_b,_c,_d},{dict:new Map,arr:[]});return new Instances(instances$)};return Collection}();exports.Collection=Collection;var UniqueCollection=function(_super){__extends(UniqueCollection,_super);function UniqueCollection(itemComp,state$,name,getKey,makeScopes){if(makeScopes===void 0){makeScopes=defaultMakeScopes}var _this=_super.call(this,itemComp,state$,name,makeScopes)||this;_this._getKey=getKey;return _this}UniqueCollection.prototype.isolateEach=function(makeScopes){return new UniqueCollection(this._itemComp,this._state$,this._name,this._getKey,makeScopes)};return UniqueCollection}(Collection);exports.UniqueCollection=UniqueCollection},{"./pickCombine":61,"./pickMerge":62,"@cycle/isolate":54,"@cycle/run/lib/adapt":55}],58:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var dropRepeats_1=require("xstream/extra/dropRepeats");var adapt_1=require("@cycle/run/lib/adapt");var Collection_1=require("./Collection");function updateArrayEntry(array,scope,newVal){if(newVal===array[scope]){return array}var index=parseInt(scope);if(typeof newVal==="undefined"){return array.filter(function(val,i){return i!==index})}
  return array.map(function(val,i){return i===index?newVal:val})}function makeGetter(scope){if(typeof scope==="string"||typeof scope==="number"){return function lensGet(state){if(typeof state==="undefined"){return void 0}else{return state[scope]}}}else{return scope.get}}function makeSetter(scope){if(typeof scope==="string"||typeof scope==="number"){return function lensSet(state,childState){if(Array.isArray(state)){return updateArrayEntry(state,scope,childState)}else if(typeof state==="undefined"){return _a={},_a[scope]=childState,_a}else{return __assign({},state,(_b={},_b[scope]=childState,_b))}var _a,_b}}else{return scope.set}}function isolateSource(source,scope){return source.select(scope)}exports.isolateSource=isolateSource;function isolateSink(innerReducer$,scope){var get=makeGetter(scope);var set=makeSetter(scope);return innerReducer$.map(function(innerReducer){return function outerReducer(outer){var prevInner=get(outer);var nextInner=innerReducer(prevInner);if(prevInner===nextInner){return outer}else{return set(outer,nextInner)}}})}exports.isolateSink=isolateSink;var StateSource=function(){function StateSource(stream,name){this.isolateSource=isolateSource;this.isolateSink=isolateSink;this._state$=stream.filter(function(s){return typeof s!=="undefined"}).compose(dropRepeats_1.default()).remember();this._name=name;this.state$=adapt_1.adapt(this._state$);this._state$._isCycleSource=name}StateSource.prototype.select=function(scope){var get=makeGetter(scope);return new StateSource(this._state$.map(get),this._name)};StateSource.prototype.toCollection=function(itemComp){return new Collection_1.Collection(itemComp,this._state$,this._name)};return StateSource}();exports.StateSource=StateSource},{"./Collection":57,"@cycle/run/lib/adapt":55,"xstream/extra/dropRepeats":151}],59:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var onionify_1=require("./onionify");var StateSource_1=require("./StateSource");exports.StateSource=StateSource_1.StateSource;exports.isolateSource=StateSource_1.isolateSource;exports.isolateSink=StateSource_1.isolateSink;var Collection_1=require("./Collection");exports.Collection=Collection_1.Collection;exports.UniqueCollection=Collection_1.UniqueCollection;exports.Instances=Collection_1.Instances;var pickMerge_1=require("./pickMerge");exports.pickMerge=pickMerge_1.pickMerge;var pickCombine_1=require("./pickCombine");exports.pickCombine=pickCombine_1.pickCombine;exports.default=onionify_1.onionify},{"./Collection":57,"./StateSource":58,"./onionify":60,"./pickCombine":61,"./pickMerge":62}],60:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var StateSource_1=require("./StateSource");function onionify(main,name){if(name===void 0){name="onion"}return function mainOnionified(sources){var reducerMimic$=xstream_1.default.create();var state$=reducerMimic$.fold(function(state,reducer){return reducer(state)},void 0).drop(1);sources[name]=new StateSource_1.StateSource(state$,name);var sinks=main(sources);if(sinks[name]){var stream$=xstream_1.default.fromObservable(sinks[name]);reducerMimic$.imitate(stream$)}return sinks}}exports.onionify=onionify},{"./StateSource":58,xstream:153}],61:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var PickCombineListener=function(){function PickCombineListener(key,out,p,ins){this.key=key;this.out=out;this.p=p;this.val=xstream_1.NO;this.ins=ins}PickCombineListener.prototype._n=function(t){var p=this.p,out=this.out;this.val=t;if(out===null){return}this.p.up()};PickCombineListener.prototype._e=function(err){var out=this.out;if(out===null){return}out._e(err)};PickCombineListener.prototype._c=function(){};return PickCombineListener}();var PickCombine=function(){function PickCombine(sel,ins){this.type="combine";this.ins=ins;this.sel=sel;this.out=null;this.ils=new Map;this.inst=null}PickCombine.prototype._start=function(out){this.out=out;this.ins._add(this)};PickCombine.prototype._stop=function(){this.ins._remove(this);var ils=this.ils;ils.forEach(function(il){il.ins._remove(il);il.ins=null;il.out=null;il.val=null});ils.clear();this.out=null;this.ils=new Map;this.inst=null};PickCombine.prototype.up=function(){var arr=this.inst.arr;var n=arr.length;var ils=this.ils;var outArr=Array(n);for(var i=0;i<n;++i){var sinks=arr[i];var key=sinks._key;if(!ils.has(key)){return}var val=ils.get(key).val;if(val===xstream_1.NO){return}outArr[i]=val}this.out._n(outArr)};PickCombine.prototype._n=function(inst){this.inst=inst;var arrSinks=inst.arr;var ils=this.ils;var out=this.out;var sel=this.sel;var dict=inst.dict;var n=arrSinks.length;var removed=false;ils.forEach(function(il,key){if(!dict.has(key)){il.ins._remove(il);il.ins=null;il.out=null;il.val=null;ils.delete(key);removed=true}});if(n===0){out._n([]);return}var added=false;for(var i=0;i<n;++i){var sinks=arrSinks[i];var key=sinks._key;var sink=sinks[sel];if(!ils.has(key)){ils.set(key,new PickCombineListener(key,out,this,sink));added=true}}if(added){for(var i=0;i<n;++i){var sinks=arrSinks[i];var key=sinks._key;var sink=sinks[sel];if(sink._ils.length===0){sink._add(ils.get(key))}}}if(removed){this.up()}};PickCombine.prototype._e=function(e){var out=this.out;if(out===null){return}out._e(e)};PickCombine.prototype._c=function(){var out=this.out;if(out===null){return}out._c()};return PickCombine}();function pickCombine(selector){return function pickCombineOperator(inst$){return new xstream_1.Stream(new PickCombine(selector,inst$))}}exports.pickCombine=pickCombine},{xstream:153}],62:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var PickMergeListener=function(){function PickMergeListener(out,p,ins){this.ins=ins;this.out=out;this.p=p}PickMergeListener.prototype._n=function(t){var p=this.p,out=this.out;if(out===null){return}out._n(t)};PickMergeListener.prototype._e=function(err){var out=this.out;if(out===null){return}out._e(err)};PickMergeListener.prototype._c=function(){};return PickMergeListener}();var PickMerge=function(){function PickMerge(sel,ins){this.type="pickMerge";this.ins=ins;this.out=null;this.sel=sel;this.ils=new Map;this.inst=null}PickMerge.prototype._start=function(out){this.out=out;this.ins._add(this)};PickMerge.prototype._stop=function(){this.ins._remove(this);var ils=this.ils;ils.forEach(function(il,key){il.ins._remove(il);il.ins=null;il.out=null;ils.delete(key)});ils.clear();this.out=null;this.ils=new Map;this.inst=null};PickMerge.prototype._n=function(inst){this.inst=inst;var arrSinks=inst.arr;var ils=this.ils;var out=this.out;var sel=this.sel;var n=arrSinks.length;for(var i=0;i<n;++i){var sinks=arrSinks[i];var key=sinks._key;var sink=sinks[sel];if(!ils.has(key)){ils.set(key,new PickMergeListener(out,this,sink))}}for(var i=0;i<n;++i){var sinks=arrSinks[i];var key=sinks._key;var sink=sinks[sel];if(sink._ils.length===0){sink._add(ils.get(key))}}ils.forEach(function(il,key){if(!inst.dict.has(key)||!inst.dict.get(key)){il.ins._remove(il);il.ins=null;il.out=null;ils.delete(key)}})};PickMerge.prototype._e=function(err){var u=this.out;if(u===null)return;u._e(err)};PickMerge.prototype._c=function(){var u=this.out;if(u===null)return;u._c()};return PickMerge}();function pickMerge(selector){return function pickMergeOperator(inst$){return new xstream_1.Stream(new PickMerge(selector,inst$))}}exports.pickMerge=pickMerge},{xstream:153}],63:[function(require,module,exports){"use strict";var copy=require("es5-ext/object/copy"),normalizeOptions=require("es5-ext/object/normalize-options"),ensureCallable=require("es5-ext/object/valid-callable"),map=require("es5-ext/object/map"),callable=require("es5-ext/object/valid-callable"),validValue=require("es5-ext/object/valid-value"),bind=Function.prototype.bind,defineProperty=Object.defineProperty,hasOwnProperty=Object.prototype.hasOwnProperty,define;define=function(name,desc,options){var value=validValue(desc)&&callable(desc.value),dgs;dgs=copy(desc);delete dgs.writable;delete dgs.value;dgs.get=function(){if(!options.overwriteDefinition&&hasOwnProperty.call(this,name))return value;desc.value=bind.call(value,options.resolveContext?options.resolveContext(this):this);defineProperty(this,name,desc);return this[name]};return dgs};module.exports=function(props){var options=normalizeOptions(arguments[1]);if(options.resolveContext!=null)ensureCallable(options.resolveContext);return map(props,function(desc,name){return define(name,desc,options)})}},{"es5-ext/object/copy":85,"es5-ext/object/map":94,"es5-ext/object/normalize-options":95,"es5-ext/object/valid-callable":100,"es5-ext/object/valid-value":101}],64:[function(require,module,exports){"use strict";var assign=require("es5-ext/object/assign"),normalizeOpts=require("es5-ext/object/normalize-options"),isCallable=require("es5-ext/object/is-callable"),contains=require("es5-ext/string/#/contains"),d;d=module.exports=function(dscr,value){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){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)}},{"es5-ext/object/assign":82,"es5-ext/object/is-callable":88,"es5-ext/object/normalize-options":95,"es5-ext/string/#/contains":102}],65:[function(require,module,exports){"use strict";var value=require("../../object/valid-value");module.exports=function(){value(this).length=0;return this}},{"../../object/valid-value":101}],66:[function(require,module,exports){"use strict";var numberIsNaN=require("../../number/is-nan"),toPosInt=require("../../number/to-pos-integer"),value=require("../../object/valid-value"),indexOf=Array.prototype.indexOf,objHasOwnProperty=Object.prototype.hasOwnProperty,abs=Math.abs,floor=Math.floor;module.exports=function(searchElement){var i,length,fromIndex,val;if(!numberIsNaN(searchElement))return indexOf.apply(this,arguments);length=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<length;++i){if(objHasOwnProperty.call(this,i)){val=this[i];if(numberIsNaN(val))return i}}return-1}},{"../../number/is-nan":76,"../../number/to-pos-integer":80,"../../object/valid-value":101}],67:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Array.from:require("./shim")},{"./is-implemented":68,"./shim":69}],68:[function(require,module,exports){"use strict";module.exports=function(){var from=Array.from,arr,result;if(typeof from!=="function")return false;arr=["raz","dwa"];result=from(arr);return Boolean(result&&result!==arr&&result[1]==="dwa")}},{}],69:[function(require,module,exports){"use strict";var iteratorSymbol=require("es6-symbol").iterator,isArguments=require("../../function/is-arguments"),isFunction=require("../../function/is-function"),toPosInt=require("../../number/to-pos-integer"),callable=require("../../object/valid-callable"),validValue=require("../../object/valid-value"),isValue=require("../../object/is-value"),isString=require("../../string/is-string"),isArray=Array.isArray,call=Function.prototype.call,desc={configurable:true,enumerable:true,writable:true,value:null},defineProperty=Object.defineProperty;module.exports=function(arrayLike){var mapFn=arguments[1],thisArg=arguments[2],Context,i,j,arr,length,code,iterator,result,getIterator,value;arrayLike=Object(validValue(arrayLike));if(isValue(mapFn))callable(mapFn);if(!this||this===Array||!isFunction(this)){if(!mapFn){if(isArguments(arrayLike)){length=arrayLike.length;if(length!==1)return Array.apply(null,arrayLike);arr=new Array(1);arr[0]=arrayLike[0];return arr}if(isArray(arrayLike)){arr=new Array(length=arrayLike.length);for(i=0;i<length;++i)arr[i]=arrayLike[i];return arr}}arr=[]}else{Context=this}if(!isArray(arrayLike)){if((getIterator=arrayLike[iteratorSymbol])!==undefined){iterator=callable(getIterator).call(arrayLike);if(Context)arr=new Context;result=iterator.next();i=0;while(!result.done){value=mapFn?call.call(mapFn,thisArg,result.value,i):result.value;if(Context){desc.value=value;defineProperty(arr,i,desc)}else{arr[i]=value}result=iterator.next();++i}length=i}else if(isString(arrayLike)){length=arrayLike.length;if(Context)arr=new Context;for(i=0,j=0;i<length;++i){value=arrayLike[i];if(i+1<length){code=value.charCodeAt(0);if(code>=55296&&code<=56319)value+=arrayLike[++i]}value=mapFn?call.call(mapFn,thisArg,value,j):value;if(Context){desc.value=value;defineProperty(arr,j,desc)}else{arr[j]=value}++j}length=j}}if(length===undefined){length=toPosInt(arrayLike.length);if(Context)arr=new Context(length);for(i=0;i<length;++i){value=mapFn?call.call(mapFn,thisArg,arrayLike[i],i):arrayLike[i];if(Context){desc.value=value;defineProperty(arr,i,desc)}else{arr[i]=value}}}if(Context){desc.value=null;arr.length=length}return arr}},{"../../function/is-arguments":70,"../../function/is-function":71,"../../number/to-pos-integer":80,"../../object/is-value":90,"../../object/valid-callable":100,"../../object/valid-value":101,"../../string/is-string":105,"es6-symbol":119}],70:[function(require,module,exports){"use strict";var objToString=Object.prototype.toString,id=objToString.call(function(){return arguments}());module.exports=function(value){return objToString.call(value)===id}},{}],71:[function(require,module,exports){"use strict";var objToString=Object.prototype.toString,id=objToString.call(require("./noop"));module.exports=function(value){return typeof value==="function"&&objToString.call(value)===id}},{"./noop":72}],72:[function(require,module,exports){"use strict";module.exports=function(){}},{}],73:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Math.sign:require("./shim")},{"./is-implemented":74,"./shim":75}],74:[function(require,module,exports){"use strict";module.exports=function(){var sign=Math.sign;if(typeof sign!=="function")return false;return sign(10)===1&&sign(-20)===-1}},{}],75:[function(require,module,exports){"use strict";module.exports=function(value){value=Number(value);if(isNaN(value)||value===0)return value;return value>0?1:-1}},{}],76:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Number.isNaN:require("./shim")},{"./is-implemented":77,"./shim":78}],77:[function(require,module,exports){"use strict";module.exports=function(){var numberIsNaN=Number.isNaN;if(typeof numberIsNaN!=="function")return false;return!numberIsNaN({})&&numberIsNaN(NaN)&&!numberIsNaN(34)}},{}],78:[function(require,module,exports){"use strict";module.exports=function(value){return value!==value}},{}],79:[function(require,module,exports){"use strict";var sign=require("../math/sign"),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))}},{"../math/sign":73}],80:[function(require,module,exports){"use strict";var toInteger=require("./to-integer"),max=Math.max;module.exports=function(value){return max(0,toInteger(value))}},{"./to-integer":79}],81:[function(require,module,exports){"use strict";var callable=require("./valid-callable"),value=require("./valid-value"),bind=Function.prototype.bind,call=Function.prototype.call,keys=Object.keys,objPropertyIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=function(method,defVal){return function(obj,cb){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(!objPropertyIsEnumerable.call(obj,key))return defVal;return call.call(cb,thisArg,obj[key],key,obj,index)})}}},{"./valid-callable":100,"./valid-value":101}],82:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.assign:require("./shim")},{"./is-implemented":83,"./shim":84}],83:[function(require,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"}},{}],84:[function(require,module,exports){"use strict";var keys=require("../keys"),value=require("../valid-value"),max=Math.max;module.exports=function(dest,src){var error,i,length=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<length;++i){src=arguments[i];keys(src).forEach(assign)}if(error!==undefined)throw error;return dest}},{"../keys":91,"../valid-value":101}],85:[function(require,module,exports){"use strict";var aFrom=require("../array/from"),assign=require("./assign"),value=require("./valid-value");module.exports=function(obj){var copy=Object(value(obj)),propertyNames=arguments[1],options=Object(arguments[2]);if(copy!==obj&&!propertyNames)return copy;var result={};if(propertyNames){aFrom(propertyNames,function(propertyName){if(options.ensure||propertyName in obj)result[propertyName]=obj[propertyName]})}else{assign(result,obj)}return result}},{"../array/from":67,"./assign":82,"./valid-value":101}],86:[function(require,module,exports){"use strict";var create=Object.create,shim;if(!require("./set-prototype-of/is-implemented")()){shim=require("./set-prototype-of/shim")}module.exports=function(){var nullObject,polyProps,desc;if(!shim)return create;if(shim.level!==1)return create;nullObject={};polyProps={};desc={configurable:false,enumerable:false,writable:true,value:undefined};Object.getOwnPropertyNames(Object.prototype).forEach(function(name){if(name==="__proto__"){polyProps[name]={configurable:true,enumerable:false,writable:true,value:undefined};return}polyProps[name]=desc});Object.defineProperties(nullObject,polyProps);Object.defineProperty(shim,"nullPolyfill",{configurable:false,enumerable:false,writable:false,value:nullObject});return function(prototype,props){return create(prototype===null?nullObject:prototype,props)}}()},{"./set-prototype-of/is-implemented":98,"./set-prototype-of/shim":99}],87:[function(require,module,exports){"use strict";module.exports=require("./_iterate")("forEach")},{"./_iterate":81}],88:[function(require,module,exports){"use strict";module.exports=function(obj){return typeof obj==="function"}},{}],89:[function(require,module,exports){"use strict";var isValue=require("./is-value");var map={function:true,object:true};module.exports=function(value){return isValue(value)&&map[typeof value]||false}},{"./is-value":90}],90:[function(require,module,exports){"use strict";var _undefined=require("../function/noop")();module.exports=function(val){return val!==_undefined&&val!==null}},{"../function/noop":72}],91:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.keys:require("./shim")},{"./is-implemented":92,"./shim":93}],92:[function(require,module,exports){"use strict";module.exports=function(){try{Object.keys("primitive");return true}catch(e){return false}}},{}],93:[function(require,module,exports){"use strict";var isValue=require("../is-value");var keys=Object.keys;module.exports=function(object){return keys(isValue(object)?Object(object):object)}},{"../is-value":90}],94:[function(require,module,exports){"use strict";var callable=require("./valid-callable"),forEach=require("./for-each"),call=Function.prototype.call;module.exports=function(obj,cb){var result={},thisArg=arguments[2];callable(cb);forEach(obj,function(value,key,targetObj,index){result[key]=call.call(cb,thisArg,value,key,targetObj,index)});return result}},{"./for-each":87,"./valid-callable":100}],95:[function(require,module,exports){"use strict";var isValue=require("./is-value");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(opts1){var result=create(null);forEach.call(arguments,function(options){if(!isValue(options))return;process(Object(options),result)});return result}},{"./is-value":90}],96:[function(require,module,exports){"use strict";var forEach=Array.prototype.forEach,create=Object.create;module.exports=function(arg){var set=create(null);forEach.call(arguments,function(name){set[name]=true});return set}},{}],97:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.setPrototypeOf:require("./shim")},{"./is-implemented":98,"./shim":99}],98:[function(require,module,exports){"use strict";var create=Object.create,getPrototypeOf=Object.getPrototypeOf,plainObject={};module.exports=function(){var setPrototypeOf=Object.setPrototypeOf,customCreate=arguments[0]||create;if(typeof setPrototypeOf!=="function")return false;return getPrototypeOf(setPrototypeOf(customCreate(null),plainObject))===plainObject}},{}],99:[function(require,module,exports){"use strict";var isObject=require("../is-object"),value=require("../valid-value"),objIsPrototypeOf=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=objIsPrototypeOf.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 tmpObj1=Object.create(null),tmpObj2={},set,desc=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(desc){try{set=desc.set;set.call(tmpObj1,tmpObj2)}catch(ignore){}if(Object.getPrototypeOf(tmpObj1)===tmpObj2)return{set:set,level:2}}tmpObj1.__proto__=tmpObj2;if(Object.getPrototypeOf(tmpObj1)===tmpObj2)return{level:2};tmpObj1={};tmpObj1.__proto__=tmpObj2;if(Object.getPrototypeOf(tmpObj1)===tmpObj2)return{level:1};return false}());require("../create")},{"../create":86,"../is-object":89,"../valid-value":101}],100:[function(require,module,exports){"use strict";module.exports=function(fn){if(typeof fn!=="function")throw new TypeError(fn+" is not a function");return fn}},{}],101:[function(require,module,exports){"use strict";var isValue=require("./is-value");module.exports=function(value){if(!isValue(value))throw new TypeError("Cannot use null or undefined");return value}},{"./is-value":90}],102:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?String.prototype.contains:require("./shim")},{"./is-implemented":103,"./shim":104}],103:[function(require,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}},{}],104:[function(require,module,exports){"use strict";var indexOf=String.prototype.indexOf;module.exports=function(searchString){return indexOf.call(this,searchString,arguments[1])>-1}},{}],105:[function(require,module,exports){"use strict";var objToString=Object.prototype.toString,id=objToString.call("");module.exports=function(value){return typeof value==="string"||value&&typeof value==="object"&&(value instanceof String||objToString.call(value)===id)||false}},{}],106:[function(require,module,exports){"use strict";var setPrototypeOf=require("es5-ext/object/set-prototype-of"),contains=require("es5-ext/string/#/contains"),d=require("d"),Symbol=require("es6-symbol"),Iterator=require("./");var defineProperty=Object.defineProperty,ArrayIterator;ArrayIterator=module.exports=function(arr,kind){if(!(this instanceof ArrayIterator))throw new TypeError("Constructor requires 'new'");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);delete ArrayIterator.prototype.constructor;ArrayIterator.prototype=Object.create(Iterator.prototype,{_resolve:d(function(i){if(this.__kind__==="value")return this.__list__[i];if(this.__kind__==="key+value")return[i,this.__list__[i]];return i})});defineProperty(ArrayIterator.prototype,Symbol.toStringTag,d("c","Array Iterator"))},{"./":109,d:64,"es5-ext/object/set-prototype-of":97,"es5-ext/string/#/contains":102,"es6-symbol":119}],107:[function(require,module,exports){"use strict";var isArguments=require("es5-ext/function/is-arguments"),callable=require("es5-ext/object/valid-callable"),isString=require("es5-ext/string/is-string"),get=require("./get");var isArray=Array.isArray,call=Function.prototype.call,some=Array.prototype.some;module.exports=function(iterable,cb){var mode,thisArg=arguments[2],result,doBreak,broken,i,length,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);return broken});return}if(mode==="string"){length=iterable.length;for(i=0;i<length;++i){char=iterable[i];if(i+1<length){code=char.charCodeAt(0);if(code>=55296&&code<=56319)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()}}},{"./get":108,"es5-ext/function/is-arguments":70,"es5-ext/object/valid-callable":100,"es5-ext/string/is-string":105}],108:[function(require,module,exports){"use strict";var isArguments=require("es5-ext/function/is-arguments"),isString=require("es5-ext/string/is-string"),ArrayIterator=require("./array"),StringIterator=require("./string"),iterable=require("./valid-iterable"),iteratorSymbol=require("es6-symbol").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)}},{"./array":106,"./string":111,"./valid-iterable":112,"es5-ext/function/is-arguments":70,"es5-ext/string/is-string":105,"es6-symbol":119}],109:[function(require,module,exports){"use strict";var clear=require("es5-ext/array/#/clear"),assign=require("es5-ext/object/assign"),callable=require("es5-ext/object/valid-callable"),value=require("es5-ext/object/valid-value"),d=require("d"),autoBind=require("d/auto-bind"),Symbol=require("es6-symbol");var defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,Iterator;module.exports=Iterator=function(list,context){if(!(this instanceof Iterator))throw new TypeError("Constructor requires 'new'");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)};delete Iterator.prototype.constructor;defineProperties(Iterator.prototype,assign({_next:d(function(){var i;if(!this.__list__)return undefined;if(this.__redo__){i=this.__redo__.shift();if(i!==undefined)return i}if(this.__nextIndex__<this.__list__.length)return this.__nextIndex__++;this._unBind();return undefined}),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 "+(this[Symbol.toStringTag]||"Object")+"]"})},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,j){if(redo>index)this.__redo__[j]=--redo},this)}),_onClear:d(function(){if(this.__redo__)clear.call(this.__redo__);this.__nextIndex__=0})})));defineProperty(Iterator.prototype,Symbol.iterator,d(function(){return this}))},{d:64,"d/auto-bind":63,"es5-ext/array/#/clear":65,"es5-ext/object/assign":82,"es5-ext/object/valid-callable":100,"es5-ext/object/valid-value":101,"es6-symbol":119}],110:[function(require,module,exports){"use strict";var isArguments=require("es5-ext/function/is-arguments"),isValue=require("es5-ext/object/is-value"),isString=require("es5-ext/string/is-string");var iteratorSymbol=require("es6-symbol").iterator,isArray=Array.isArray;module.exports=function(value){if(!isValue(value))return false;if(isArray(value))return true;if(isString(value))return true;if(isArguments(value))return true;return typeof value[iteratorSymbol]==="function"}},{"es5-ext/function/is-arguments":70,"es5-ext/object/is-value":90,"es5-ext/string/is-string":105,"es6-symbol":119}],111:[function(require,module,exports){"use strict";var setPrototypeOf=require("es5-ext/object/set-prototype-of"),d=require("d"),Symbol=require("es6-symbol"),Iterator=require("./");var defineProperty=Object.defineProperty,StringIterator;StringIterator=module.exports=function(str){if(!(this instanceof StringIterator))throw new TypeError("Constructor requires 'new'");str=String(str);Iterator.call(this,str);defineProperty(this,"__length__",d("",str.length))};if(setPrototypeOf)setPrototypeOf(StringIterator,Iterator);delete StringIterator.prototype.constructor;StringIterator.prototype=Object.create(Iterator.prototype,{_next:d(function(){if(!this.__list__)return undefined;if(this.__nextIndex__<this.__length__)return this.__nextIndex__++;this._unBind();return undefined}),_resolve:d(function(i){var char=this.__list__[i],code;if(this.__nextIndex__===this.__length__)return char;code=char.charCodeAt(0);if(code>=55296&&code<=56319)return char+this.__list__[this.__nextIndex__++];return char})});defineProperty(StringIterator.prototype,Symbol.toStringTag,d("c","String Iterator"))},{"./":109,d:64,"es5-ext/object/set-prototype-of":97,
  "es6-symbol":119}],112:[function(require,module,exports){"use strict";var isIterable=require("./is-iterable");module.exports=function(value){if(!isIterable(value))throw new TypeError(value+" is not iterable");return value}},{"./is-iterable":110}],113:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Map:require("./polyfill")},{"./is-implemented":114,"./polyfill":118}],114:[function(require,module,exports){"use strict";module.exports=function(){var map,iterator,result;if(typeof Map!=="function")return false;try{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}},{}],115:[function(require,module,exports){"use strict";module.exports=function(){if(typeof Map==="undefined")return false;return Object.prototype.toString.call(new Map)==="[object Map]"}()},{}],116:[function(require,module,exports){"use strict";module.exports=require("es5-ext/object/primitive-set")("key","value","key+value")},{"es5-ext/object/primitive-set":96}],117:[function(require,module,exports){"use strict";var setPrototypeOf=require("es5-ext/object/set-prototype-of"),d=require("d"),Iterator=require("es6-iterator"),toStringTagSymbol=require("es6-symbol").toStringTag,kinds=require("./iterator-kinds"),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"))},{"./iterator-kinds":116,d:64,"es5-ext/object/set-prototype-of":97,"es6-iterator":109,"es6-symbol":119}],118:[function(require,module,exports){"use strict";var clear=require("es5-ext/array/#/clear"),eIndexOf=require("es5-ext/array/#/e-index-of"),setPrototypeOf=require("es5-ext/object/set-prototype-of"),callable=require("es5-ext/object/valid-callable"),validValue=require("es5-ext/object/valid-value"),d=require("d"),ee=require("event-emitter"),Symbol=require("es6-symbol"),iterator=require("es6-iterator/valid-iterable"),forOf=require("es6-iterator/for-of"),Iterator=require("./lib/iterator"),isNative=require("./is-native-implemented"),call=Function.prototype.call,defineProperties=Object.defineProperties,getPrototypeOf=Object.getPrototypeOf,MapPoly;module.exports=MapPoly=function(){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){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"))},{"./is-native-implemented":115,"./lib/iterator":117,d:64,"es5-ext/array/#/clear":65,"es5-ext/array/#/e-index-of":66,"es5-ext/object/set-prototype-of":97,"es5-ext/object/valid-callable":100,"es5-ext/object/valid-value":101,"es6-iterator/for-of":107,"es6-iterator/valid-iterable":112,"es6-symbol":119,"event-emitter":124}],119:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Symbol:require("./polyfill")},{"./is-implemented":120,"./polyfill":122}],120:[function(require,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}if(!validTypes[typeof Symbol.iterator])return false;if(!validTypes[typeof Symbol.toPrimitive])return false;if(!validTypes[typeof Symbol.toStringTag])return false;return true}},{}],121:[function(require,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"}},{}],122:[function(require,module,exports){"use strict";var d=require("d"),validateSymbol=require("./validate-symbol"),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){if(ie11BugWorkaround)return;ie11BugWorkaround=true;defineProperty(this,name,d(value));ie11BugWorkaround=false}));return name}}();HiddenSymbol=function Symbol(description){if(this instanceof HiddenSymbol)throw new TypeError("Symbol is not a constructor");return SymbolPolyfill(description)};module.exports=SymbolPolyfill=function Symbol(description){var symbol;if(this instanceof Symbol)throw new 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}),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"))});defineProperties(HiddenSymbol.prototype,{constructor:d(SymbolPolyfill),toString:d("",function(){return this.__name__})});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"));defineProperty(HiddenSymbol.prototype,SymbolPolyfill.toStringTag,d("c",SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));defineProperty(HiddenSymbol.prototype,SymbolPolyfill.toPrimitive,d("c",SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]))},{"./validate-symbol":123,d:64}],123:[function(require,module,exports){"use strict";var isSymbol=require("./is-symbol");module.exports=function(value){if(!isSymbol(value))throw new TypeError(value+" is not a symbol");return value}},{"./is-symbol":121}],124:[function(require,module,exports){"use strict";var d=require("d"),callable=require("es5-ext/object/valid-callable"),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},{d:64,"es5-ext/object/valid-callable":100}],125:[function(require,module,exports){(function(process){"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 instanceId=0;var uniqueId=0;exports.IS_UNIQUE="__DO_NOT_DEDUPE_STYLE__";var CSS_NUMBER={"animation-iteration-count":true,"box-flex":true,"box-flex-group":true,"column-count":true,"counter-increment":true,"counter-reset":true,flex:true,"flex-grow":true,"flex-positive":true,"flex-shrink":true,"flex-negative":true,"font-weight":true,"line-clamp":true,"line-height":true,opacity:true,order:true,orphans:true,"tab-size":true,widows:true,"z-index":true,zoom:true,"fill-opacity":true,"stroke-dashoffset":true,"stroke-opacity":true,"stroke-width":true};for(var _i=0,_a=["-webkit-","-ms-","-moz-","-o-"];_i<_a.length;_i++){var prefix=_a[_i];for(var _b=0,_c=Object.keys(CSS_NUMBER);_b<_c.length;_b++){var property=_c[_b];CSS_NUMBER[prefix+property]=true}}function hyphenate(propertyName){return propertyName.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function isAtRule(propertyName){return propertyName.charAt(0)==="@"}function isNestedStyle(value){return value!=null&&typeof value==="object"&&!Array.isArray(value)}function stringHash(str){var value=5381;var i=str.length;while(i){value=value*33^str.charCodeAt(--i)}return(value>>>0).toString(36)}exports.stringHash=stringHash;function styleToString(name,value){if(typeof value==="number"&&value!==0&&!CSS_NUMBER[name]){value=value+"px"}return name+":"+String(value).replace(/([\{\}\[\]])/g,"\\$1")}function sortTuples(value){return value.sort(function(a,b){return a[0]>b[0]?1:-1})}function parseUserStyles(styles,hasNestedStyles){var properties=[];var nestedStyles=[];var isUnique=false;for(var _i=0,_a=Object.keys(styles);_i<_a.length;_i++){var key=_a[_i];var value=styles[key];if(key===exports.IS_UNIQUE){isUnique=!!value}else if(isNestedStyle(value)){nestedStyles.push([key.trim(),value])}else{properties.push([hyphenate(key.trim()),value])}}return{properties:sortTuples(properties),nestedStyles:hasNestedStyles?nestedStyles:sortTuples(nestedStyles),isUnique:isUnique}}function stringifyProperties(properties){var result=[];var _loop_1=function(name_1,value){if(value!=null){if(Array.isArray(value)){result.push(value.filter(function(x){return x!=null}).map(function(x){return styleToString(name_1,x)}).join(";"))}else{result.push(styleToString(name_1,value))}}};for(var _i=0,properties_1=properties;_i<properties_1.length;_i++){var _a=properties_1[_i],name_1=_a[0],value=_a[1];_loop_1(name_1,value)}return result.join(";")}function interpolate(selector,parent){if(selector.indexOf("&")>-1){return selector.replace(/&/g,parent)}return parent+" "+selector}function collectHashedStyles(container,userStyles,isStyle,displayName){var styles=[];function stylize(cache,userStyles,selector){var _a=parseUserStyles(userStyles,isStyle),properties=_a.properties,nestedStyles=_a.nestedStyles,isUnique=_a.isUnique;var styleString=stringifyProperties(properties);var pid=styleString;if(styleString){var style=new Style(styleString,cache.hash,isUnique?"u"+(++uniqueId).toString(36):undefined);cache.add(style);styles.push([cache,selector,style])}for(var _i=0,nestedStyles_1=nestedStyles;_i<nestedStyles_1.length;_i++){var _b=nestedStyles_1[_i],name_2=_b[0],value=_b[1];pid+=name_2;if(isAtRule(name_2)){var rule=cache.add(new Rule(name_2,undefined,cache.hash));pid+=stylize(rule,value,selector)}else{pid+=stylize(cache,value,isStyle?interpolate(name_2,selector):name_2)}}return pid}var cache=new Cache(container.hash);var pid=stylize(cache,userStyles,"&");var hash="f"+cache.hash(pid);var id=displayName?displayName+"_"+hash:hash;for(var _i=0,styles_1=styles;_i<styles_1.length;_i++){var _a=styles_1[_i],cache_1=_a[0],selector=_a[1],style=_a[2];var key=isStyle?interpolate(selector,"."+id):selector;cache_1.get(style).add(new Selector(key,style.hash,undefined,pid))}container.merge(cache);return{pid:pid,id:id}}function registerUserStyles(container,styles,displayName){return collectHashedStyles(container,styles,true,displayName).id}function registerUserRule(container,selector,styles){var _a=parseUserStyles(styles,false),properties=_a.properties,nestedStyles=_a.nestedStyles,isUnique=_a.isUnique;if(properties.length&&nestedStyles.length){throw new TypeError("Registering a CSS rule can not use properties with nested styles")}var styleString=stringifyProperties(properties);var rule=new Rule(selector,styleString,container.hash,isUnique?"u"+(++uniqueId).toString(36):undefined);for(var _i=0,nestedStyles_2=nestedStyles;_i<nestedStyles_2.length;_i++){var _b=nestedStyles_2[_i],name_3=_b[0],value=_b[1];registerUserRule(rule,name_3,value)}container.add(rule)}function registerUserHashedRule(container,prefix,styles,displayName){var bucket=new Cache(container.hash);var _a=collectHashedStyles(bucket,styles,false,displayName),pid=_a.pid,id=_a.id;var atRule=new Rule(prefix+" "+id,undefined,container.hash,undefined,pid);atRule.merge(bucket);container.add(atRule);return id}function getStyles(container){return container.values().map(function(style){return style.getStyles()}).join("")}var Cache=function(){function Cache(hash){this.hash=hash;this.changeId=0;this._children={};this._keys=[];this._counts={}}Cache.prototype.values=function(){var _this=this;return this._keys.map(function(x){return _this._children[x]})};Cache.prototype.add=function(style){var count=this._counts[style.id]||0;var item=this._children[style.id]||style.clone();this._counts[style.id]=count+1;if(count===0){this._keys.push(item.id);this._children[item.id]=item;this.changeId++}else{if(item.getIdentifier()!==style.getIdentifier()){throw new TypeError("Hash collision: "+style.getStyles()+" === "+item.getStyles())}this._keys.splice(this._keys.indexOf(style.id),1);this._keys.push(style.id);if(item instanceof Cache&&style instanceof Cache){var prevChangeId=item.changeId;item.merge(style);if(item.changeId!==prevChangeId){this.changeId++}}}return item};Cache.prototype.remove=function(style){var count=this._counts[style.id];if(count>0){this._counts[style.id]=count-1;var item=this._children[style.id];if(count===1){delete this._counts[style.id];delete this._children[style.id];this._keys.splice(this._keys.indexOf(style.id),1);this.changeId++}else if(item instanceof Cache&&style instanceof Cache){var prevChangeId=item.changeId;item.unmerge(style);if(item.changeId!==prevChangeId){this.changeId++}}}};Cache.prototype.get=function(container){return this._children[container.id]};Cache.prototype.merge=function(cache){for(var _i=0,_a=cache.values();_i<_a.length;_i++){var value=_a[_i];this.add(value)}return this};Cache.prototype.unmerge=function(cache){for(var _i=0,_a=cache.values();_i<_a.length;_i++){var value=_a[_i];this.remove(value)}return this};Cache.prototype.clone=function(){return new Cache(this.hash).merge(this)};return Cache}();exports.Cache=Cache;var Selector=function(){function Selector(selector,hash,id,pid){if(id===void 0){id="s"+hash(selector)}if(pid===void 0){pid=""}this.selector=selector;this.hash=hash;this.id=id;this.pid=pid}Selector.prototype.getStyles=function(){return this.selector};Selector.prototype.getIdentifier=function(){return this.pid+"."+this.selector};Selector.prototype.clone=function(){return new Selector(this.selector,this.hash,this.id,this.pid)};return Selector}();exports.Selector=Selector;var Style=function(_super){__extends(Style,_super);function Style(style,hash,id){if(id===void 0){id="c"+hash(style)}var _this=_super.call(this,hash)||this;_this.style=style;_this.hash=hash;_this.id=id;return _this}Style.prototype.getStyles=function(){return this.values().map(function(x){return x.selector}).join(",")+"{"+this.style+"}"};Style.prototype.getIdentifier=function(){return this.style};Style.prototype.clone=function(){return new Style(this.style,this.hash,this.id).merge(this)};return Style}(Cache);exports.Style=Style;var Rule=function(_super){__extends(Rule,_super);function Rule(rule,style,hash,id,pid){if(style===void 0){style=""}if(id===void 0){id="a"+hash(rule+"."+style)}if(pid===void 0){pid=""}var _this=_super.call(this,hash)||this;_this.rule=rule;_this.style=style;_this.hash=hash;_this.id=id;_this.pid=pid;return _this}Rule.prototype.getStyles=function(){return this.rule+"{"+this.style+getStyles(this)+"}"};Rule.prototype.getIdentifier=function(){return this.pid+"."+this.rule+"."+this.style};Rule.prototype.clone=function(){return new Rule(this.rule,this.style,this.hash,this.id,this.pid).merge(this)};return Rule}(Cache);exports.Rule=Rule;var FreeStyle=function(_super){__extends(FreeStyle,_super);function FreeStyle(hash,debug,id){if(id===void 0){id="f"+(++instanceId).toString(36)}var _this=_super.call(this,hash)||this;_this.hash=hash;_this.debug=debug;_this.id=id;return _this}FreeStyle.prototype.registerStyle=function(styles,displayName){return registerUserStyles(this,styles,this.debug?displayName:undefined)};FreeStyle.prototype.registerKeyframes=function(keyframes,displayName){return registerUserHashedRule(this,"@keyframes",keyframes,this.debug?displayName:undefined)};FreeStyle.prototype.registerRule=function(rule,styles){return registerUserRule(this,rule,styles)};FreeStyle.prototype.getStyles=function(){return getStyles(this)};FreeStyle.prototype.getIdentifier=function(){return this.id};FreeStyle.prototype.clone=function(){return new FreeStyle(this.hash,this.debug,this.id).merge(this)};return FreeStyle}(Cache);exports.FreeStyle=FreeStyle;function create(hash,debug){if(hash===void 0){hash=stringHash}if(debug===void 0){debug=process.env.NODE_ENV!=="production"}return new FreeStyle(hash,debug)}exports.create=create}).call(this,require("_process"))},{_process:127}],126:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?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__@@";var DELETE="delete";var SHIFT=5;var SIZE=1<<SHIFT;var MASK=SIZE-1;var NOT_SET={};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)}function OwnerID(){}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){if(typeof index!=="number"){var uint32Index=index>>>0;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)}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(){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};Seq.prototype.__iterate=function(fn,reverse){return seqIterate(this,fn,reverse,true)};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(){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(){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++])})};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)}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(4294967295,2)===-2?Math.imul:function imul(a,b){a=a|0;b=b|0;var c=a&65535;var d=b&65535;return c*d+((a>>>16)*d+c*(b>>>16)<<16>>>0)|0};function smi(i32){return i32>>>1&1073741824|i32&3221225471}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*4294967295}while(o>4294967295){o/=4294967295;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}function hashString(string){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&1073741824){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){obj.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)};obj.propertyIsEnumerable[UID_HASH_KEY]=hash}else if(obj.nodeType!==undefined){obj[UID_HASH_KEY]=hash}else{throw new Error("Unable to set a non-enumerable property on object.")}return hash}var isExtensible=Object.isExtensible;var canDefineProperty=function(){try{Object.defineProperty({},"@",{});return true}catch(e){return false}}();function getIENodeHash(node){if(node&&node.nodeType>0){switch(node.nodeType){case 1:return node.uniqueID;case 9:return node.documentElement&&node.documentElement.uniqueID}}}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);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 {","}")};Map.prototype.get=function(k,notSetValue){return this._root?this._root.get(0,undefined,k,notSetValue):notSetValue};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()};Map.prototype.merge=function(){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(){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){return OrderedMap(sortFactory(this,comparator))};Map.prototype.sortBy=function(mapper,comparator){return OrderedMap(sortFactory(this,comparator,mapper))};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;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}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}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])};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&1431655765);x=(x&858993459)+(x>>2&858993459);x=x+(x>>4)&252645135;x=x+(x>>8);x=x+(x>>16);return x&127}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);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(){return this(arguments)};List.prototype.toString=function(){return this.__toString("List [","]")};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};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(){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(){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)};List.prototype.merge=function(){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(){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)};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}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){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(newOrigin>=newCapacity){return list.clear()}var newLevel=list._level;var newRoot=list._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);while(newTailOffset>=1<<newLevel+SHIFT){newRoot=new VNode(newRoot&&newRoot.array.length?[newRoot]:[],owner);newLevel+=SHIFT}var oldTail=list._tail;var newTail=newTailOffset<oldTailOffset?listNodeFor(list,newCapacity-1):newTailOffset>oldTailOffset?new VNode([],owner):oldTail;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(newCapacity<oldCapacity){newTail=newTail&&newTail.removeAfter(owner,0,newCapacity)}if(newOrigin>=newTailOffset){newOrigin-=newTailOffset;newCapacity-=newTailOffset;newLevel=SHIFT;newRoot=null;newTail=newTail&&newTail.removeBefore(owner,0,newOrigin)}else if(newOrigin>oldOrigin||newTailOffset<oldTailOffset){offsetShift=0;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]}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);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(){return this(arguments)};OrderedMap.prototype.toString=function(){return this.__toString("OrderedMap {","}")};OrderedMap.prototype.get=function(k,notSetValue){var index=this._map.get(k);return index!==undefined?this._list.get(index)[1]:notSetValue};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){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){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;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);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;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);if(resolvedBegin!==resolvedBegin||resolvedEnd!==resolvedEnd){return sliceFactory(iterable.toSeq().cacheResult(),begin,end,useKeys)}var resolvedSize=resolvedEnd-resolvedBegin;var sliceSize;if(resolvedSize===resolvedSize){sliceSize=resolvedSize<0?0:resolvedSize}var sliceSeq=makeSequence(iterable);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)}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);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();zipSequence.__iterate=function(fn,reverse){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}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){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)+" {","}")};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};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){}}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);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(){return this(arguments)};Set.fromKeys=function(value){return this(KeyedIterable(value).keySeq())};Set.prototype.toString=function(){return this.__toString("Set {","}")};Set.prototype.has=function(value){return this._map.has(value)};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())};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){return OrderedSet(sortFactory(this,comparator))};Set.prototype.sortBy=function(mapper,comparator){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);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(){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);function Stack(value){return value===null||value===undefined?emptyStack():isStack(value)?value:emptyStack().unshiftAll(value)}Stack.of=function(){return this(arguments)};Stack.prototype.toString=function(){return this.__toString("Stack [","]")};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};Stack.prototype.push=function(){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(){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){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)};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)};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))}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,{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(){return Map(this.toKeyedSeq())},toObject:function(){assertNotInfinite(this.size);var object={};this.__iterate(function(v,k){object[k]=v});return object},toOrderedMap:function(){return OrderedMap(this.toKeyedSeq())},toOrderedSet:function(){return OrderedSet(isKeyed(this)?this.valueSeq():this)},toSet:function(){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(){return Stack(isKeyed(this)?this.valueSeq():this)},toList:function(){return List(isKeyed(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(head,tail){if(this.size===0){return head+tail}return head+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+tail},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)},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){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;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()},hashCode:function(){return this.__hash||(this.__hash=hashIterable(this))}});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,{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,{toKeyedSeq:function(){return new ToKeyedSequence(this,false)},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){var numArgs=arguments.length;removeNum=Math.max(removeNum|0,0);if(numArgs===0||numArgs===2&&!removeNum){return this}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)))},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(){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(){var iterables=[this].concat(arrCopy(arguments));return reify(this,zipWithFactory(this,defaultZipper,iterables))},zipWith:function(zipper){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,{get:function(value,notSetValue){return this.has(value)?value:notSetValue},includes:function(value){return this.has(value)},keySeq:function(){return this.valueSeq()}});SetIterable.prototype.has=IterablePrototype.includes;SetIterable.prototype.contains=SetIterable.prototype.includes;mixin(KeyedSeq,KeyedIterable.prototype);mixin(IndexedSeq,IndexedIterable.prototype);mixin(SetSeq,SetIterable.prototype);mixin(KeyedCollection,KeyedIterable.prototype);mixin(IndexedCollection,IndexedIterable.prototype);mixin(SetCollection,SetIterable.prototype);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,3432918353);h=imul(h<<15|h>>>-15,461845907);h=imul(h<<13|h>>>-13,5);h=(h+3864292196|0)^size;h=imul(h^h>>>16,2246822507);h=imul(h^h>>>13,3266489909);h=smi(h^h>>>16);return h}function hashMerge(a,b){return a^b+2654435769+(a<<6)+(a>>2)|0}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})},{}],127:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[]};process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],128:[function(require,module,exports){"use strict";var selectorParser_1=require("./selectorParser");function classNameFromVNode(vNode){var _a=selectorParser_1.selectorParser(vNode).className,cn=_a===void 0?"":_a;if(!vNode.data){return cn}var _b=vNode.data,dataClass=_b.class,props=_b.props;if(dataClass){var c=Object.keys(dataClass).filter(function(cl){return dataClass[cl]});cn+=" "+c.join(" ")}if(props&&props.className){cn+=" "+props.className}return cn&&cn.trim()}exports.classNameFromVNode=classNameFromVNode},{"./selectorParser":129}],129:[function(require,module,exports){"use strict";function selectorParser(node){if(!node.sel){return{tagName:"",id:"",className:""}}var sel=node.sel;var hashIdx=sel.indexOf("#");var dotIdx=sel.indexOf(".",hashIdx);var hash=hashIdx>0?hashIdx:sel.length;var dot=dotIdx>0?dotIdx:sel.length;var tagName=hashIdx!==-1||dotIdx!==-1?sel.slice(0,Math.min(hash,dot)):sel;var id=hash<dot?sel.slice(hash+1,dot):void 0;var className=dotIdx>0?sel.slice(dot+1).replace(/\./g," "):void 0;return{tagName:tagName,id:id,className:className}}exports.selectorParser=selectorParser},{}],130:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var vnode_1=require("./vnode");var is=require("./is");function addNS(data,children,sel){data.ns="http://www.w3.org/2000/svg";if(sel!=="foreignObject"&&children!==undefined){for(var i=0;i<children.length;++i){var childData=children[i].data;if(childData!==undefined){addNS(childData,children[i].children,children[i].sel)}}}}function h(sel,b,c){var data={},children,text,i;if(c!==undefined){data=b;if(is.array(c)){children=c}else if(is.primitive(c)){text=c}else if(c&&c.sel){children=[c]}}else if(b!==undefined){if(is.array(b)){children=b}else if(is.primitive(b)){text=b}else if(b&&b.sel){children=[b]}else{data=b}}if(is.array(children)){for(i=0;i<children.length;++i){if(is.primitive(children[i]))children[i]=vnode_1.vnode(undefined,undefined,undefined,children[i])}}if(sel[0]==="s"&&sel[1]==="v"&&sel[2]==="g"&&(sel.length===3||sel[3]==="."||sel[3]==="#")){addNS(data,children,sel)}return vnode_1.vnode(sel,data,children,text,undefined)}exports.h=h;exports.default=h},{"./is":132,"./vnode":141}],131:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function createElement(tagName){return document.createElement(tagName)}function createElementNS(namespaceURI,qualifiedName){return document.createElementNS(namespaceURI,qualifiedName)}function createTextNode(text){return document.createTextNode(text)}function createComment(text){return document.createComment(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.parentNode}function nextSibling(node){return node.nextSibling}function tagName(elm){return elm.tagName}function setTextContent(node,text){node.textContent=text}function getTextContent(node){return node.textContent}function isElement(node){return node.nodeType===1}function isText(node){return node.nodeType===3}function isComment(node){return node.nodeType===8}exports.htmlDomApi={createElement:createElement,createElementNS:createElementNS,createTextNode:createTextNode,createComment:createComment,insertBefore:insertBefore,removeChild:removeChild,appendChild:appendChild,parentNode:parentNode,nextSibling:nextSibling,tagName:tagName,setTextContent:setTextContent,getTextContent:getTextContent,isElement:isElement,isText:isText,isComment:isComment};exports.default=exports.htmlDomApi},{}],132:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.array=Array.isArray;function primitive(s){return typeof s==="string"||typeof s==="number"}exports.primitive=primitive},{}],133:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});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 xlinkNS="http://www.w3.org/1999/xlink";var xmlNS="http://www.w3.org/XML/1998/namespace";var colonChar=58;var xChar=120;var booleanAttrsDict=Object.create(null);for(var i=0,len=booleanAttrs.length;i<len;i++){booleanAttrsDict[booleanAttrs[i]]=true}function updateAttrs(oldVnode,vnode){var key,elm=vnode.elm,oldAttrs=oldVnode.data.attrs,attrs=vnode.data.attrs;if(!oldAttrs&&!attrs)return;if(oldAttrs===attrs)return;oldAttrs=oldAttrs||{};attrs=attrs||{};for(key in attrs){var cur=attrs[key];var old=oldAttrs[key];if(old!==cur){if(booleanAttrsDict[key]){if(cur){elm.setAttribute(key,"")}else{elm.removeAttribute(key)}}else{if(key.charCodeAt(0)!==xChar){elm.setAttribute(key,cur)}else if(key.charCodeAt(3)===colonChar){elm.setAttributeNS(xmlNS,key,cur)}else if(key.charCodeAt(5)===colonChar){elm.setAttributeNS(xlinkNS,key,cur)}else{elm.setAttribute(key,cur)}}}}for(key in oldAttrs){if(!(key in attrs)){elm.removeAttribute(key)}}}exports.attributesModule={create:updateAttrs,update:updateAttrs};exports.default=exports.attributesModule},{}],134:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function updateClass(oldVnode,vnode){var cur,name,elm=vnode.elm,oldClass=oldVnode.data.class,klass=vnode.data.class;if(!oldClass&&!klass)return;if(oldClass===klass)return;oldClass=oldClass||{};klass=klass||{};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)}}}exports.classModule={create:updateClass,update:updateClass};exports.default=exports.classModule},{}],135:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var CAPS_REGEX=/[A-Z]/g;function updateDataset(oldVnode,vnode){var elm=vnode.elm,oldDataset=oldVnode.data.dataset,dataset=vnode.data.dataset,key;if(!oldDataset&&!dataset)return;if(oldDataset===dataset)return;oldDataset=oldDataset||{};dataset=dataset||{};var d=elm.dataset;for(key in oldDataset){if(!dataset[key]){if(d){delete d[key]}else{
  elm.removeAttribute("data-"+key.replace(CAPS_REGEX,"-$&").toLowerCase())}}}for(key in dataset){if(oldDataset[key]!==dataset[key]){if(d){d[key]=dataset[key]}else{elm.setAttribute("data-"+key.replace(CAPS_REGEX,"-$&").toLowerCase(),dataset[key])}}}}exports.datasetModule={create:updateDataset,update:updateDataset};exports.default=exports.datasetModule},{}],136:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function updateProps(oldVnode,vnode){var key,cur,old,elm=vnode.elm,oldProps=oldVnode.data.props,props=vnode.data.props;if(!oldProps&&!props)return;if(oldProps===props)return;oldProps=oldProps||{};props=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}}}exports.propsModule={create:updateProps,update:updateProps};exports.default=exports.propsModule},{}],137:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});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;if(!oldStyle&&!style)return;if(oldStyle===style)return;oldStyle=oldStyle||{};style=style||{};var oldHasDel="delayed"in oldStyle;for(name in oldStyle){if(!style[name]){if(name[0]==="-"&&name[1]==="-"){elm.style.removeProperty(name)}else{elm.style[name]=""}}}for(name in style){cur=style[name];if(name==="delayed"&&style.delayed){for(var name2 in style.delayed){cur=style.delayed[name2];if(!oldHasDel||cur!==oldStyle.delayed[name2]){setNextFrame(elm.style,name2,cur)}}}else if(name!=="remove"&&cur!==oldStyle[name]){if(name[0]==="-"&&name[1]==="-"){elm.style.setProperty(name,cur)}else{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,i=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()})}exports.styleModule={create:updateStyle,update:updateStyle,destroy:applyDestroyStyle,remove:applyRemoveStyle};exports.default=exports.styleModule},{}],138:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var vnode_1=require("./vnode");var is=require("./is");var htmldomapi_1=require("./htmldomapi");function isUndef(s){return s===undefined}function isDef(s){return s!==undefined}var emptyNode=vnode_1.default("",{},[],undefined,undefined);function sameVnode(vnode1,vnode2){return vnode1.key===vnode2.key&&vnode1.sel===vnode2.sel}function isVnode(vnode){return vnode.sel!==undefined}function createKeyToOldIdx(children,beginIdx,endIdx){var i,map={},key,ch;for(i=beginIdx;i<=endIdx;++i){ch=children[i];if(ch!=null){key=ch.key;if(key!==undefined)map[key]=i}}return map}var hooks=["create","update","remove","destroy","pre","post"];var h_1=require("./h");exports.h=h_1.h;var thunk_1=require("./thunk");exports.thunk=thunk_1.thunk;function init(modules,domApi){var i,j,cbs={};var api=domApi!==undefined?domApi:htmldomapi_1.default;for(i=0;i<hooks.length;++i){cbs[hooks[i]]=[];for(j=0;j<modules.length;++j){var hook=modules[j][hooks[i]];if(hook!==undefined){cbs[hooks[i]].push(hook)}}}function emptyNodeAt(elm){var id=elm.id?"#"+elm.id:"";var c=elm.className?"."+elm.className.split(" ").join("."):"";return vnode_1.default(api.tagName(elm).toLowerCase()+id+c,{},[],undefined,elm)}function createRmCb(childElm,listeners){return function rmCb(){if(--listeners===0){var parent_1=api.parentNode(childElm);api.removeChild(parent_1,childElm)}}}function createElm(vnode,insertedVnodeQueue){var i,data=vnode.data;if(data!==undefined){if(isDef(i=data.hook)&&isDef(i=i.init)){i(vnode);data=vnode.data}}var children=vnode.children,sel=vnode.sel;if(sel==="!"){if(isUndef(vnode.text)){vnode.text=""}vnode.elm=api.createComment(vnode.text)}else if(sel!==undefined){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;var elm=vnode.elm=isDef(data)&&isDef(i=data.ns)?api.createElementNS(i,tag):api.createElement(tag);if(hash<dot)elm.setAttribute("id",sel.slice(hash+1,dot));if(dotIdx>0)elm.setAttribute("class",sel.slice(dot+1).replace(/\./g," "));for(i=0;i<cbs.create.length;++i)cbs.create[i](emptyNode,vnode);if(is.array(children)){for(i=0;i<children.length;++i){var ch=children[i];if(ch!=null){api.appendChild(elm,createElm(ch,insertedVnodeQueue))}}}else if(is.primitive(vnode.text)){api.appendChild(elm,api.createTextNode(vnode.text))}i=vnode.data.hook;if(isDef(i)){if(i.create)i.create(emptyNode,vnode);if(i.insert)insertedVnodeQueue.push(vnode)}}else{vnode.elm=api.createTextNode(vnode.text)}return vnode.elm}function addVnodes(parentElm,before,vnodes,startIdx,endIdx,insertedVnodeQueue){for(;startIdx<=endIdx;++startIdx){var ch=vnodes[startIdx];if(ch!=null){api.insertBefore(parentElm,createElm(ch,insertedVnodeQueue),before)}}}function invokeDestroyHook(vnode){var i,j,data=vnode.data;if(data!==undefined){if(isDef(i=data.hook)&&isDef(i=i.destroy))i(vnode);for(i=0;i<cbs.destroy.length;++i)cbs.destroy[i](vnode);if(vnode.children!==undefined){for(j=0;j<vnode.children.length;++j){i=vnode.children[j];if(i!=null&&typeof i!=="string"){invokeDestroyHook(i)}}}}}function removeVnodes(parentElm,vnodes,startIdx,endIdx){for(;startIdx<=endIdx;++startIdx){var i_1=void 0,listeners=void 0,rm=void 0,ch=vnodes[startIdx];if(ch!=null){if(isDef(ch.sel)){invokeDestroyHook(ch);listeners=cbs.remove.length+1;rm=createRmCb(ch.elm,listeners);for(i_1=0;i_1<cbs.remove.length;++i_1)cbs.remove[i_1](ch,rm);if(isDef(i_1=ch.data)&&isDef(i_1=i_1.hook)&&isDef(i_1=i_1.remove)){i_1(ch,rm)}else{rm()}}else{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;var idxInOld;var elmToMove;var before;while(oldStartIdx<=oldEndIdx&&newStartIdx<=newEndIdx){if(oldStartVnode==null){oldStartVnode=oldCh[++oldStartIdx]}else if(oldEndVnode==null){oldEndVnode=oldCh[--oldEndIdx]}else if(newStartVnode==null){newStartVnode=newCh[++newStartIdx]}else if(newEndVnode==null){newEndVnode=newCh[--newEndIdx]}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)){patchVnode(oldStartVnode,newEndVnode,insertedVnodeQueue);api.insertBefore(parentElm,oldStartVnode.elm,api.nextSibling(oldEndVnode.elm));oldStartVnode=oldCh[++oldStartIdx];newEndVnode=newCh[--newEndIdx]}else if(sameVnode(oldEndVnode,newStartVnode)){patchVnode(oldEndVnode,newStartVnode,insertedVnodeQueue);api.insertBefore(parentElm,oldEndVnode.elm,oldStartVnode.elm);oldEndVnode=oldCh[--oldEndIdx];newStartVnode=newCh[++newStartIdx]}else{if(oldKeyToIdx===undefined){oldKeyToIdx=createKeyToOldIdx(oldCh,oldStartIdx,oldEndIdx)}idxInOld=oldKeyToIdx[newStartVnode.key];if(isUndef(idxInOld)){api.insertBefore(parentElm,createElm(newStartVnode,insertedVnodeQueue),oldStartVnode.elm);newStartVnode=newCh[++newStartIdx]}else{elmToMove=oldCh[idxInOld];if(elmToMove.sel!==newStartVnode.sel){api.insertBefore(parentElm,createElm(newStartVnode,insertedVnodeQueue),oldStartVnode.elm)}else{patchVnode(elmToMove,newStartVnode,insertedVnodeQueue);oldCh[idxInOld]=undefined;api.insertBefore(parentElm,elmToMove.elm,oldStartVnode.elm)}newStartVnode=newCh[++newStartIdx]}}}if(oldStartIdx>oldEndIdx){before=newCh[newEndIdx+1]==null?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)}var elm=vnode.elm=oldVnode.elm;var oldCh=oldVnode.children;var ch=vnode.children;if(oldVnode===vnode)return;if(vnode.data!==undefined){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 patch(oldVnode,vnode){var i,elm,parent;var insertedVnodeQueue=[];for(i=0;i<cbs.pre.length;++i)cbs.pre[i]();if(!isVnode(oldVnode)){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}}exports.init=init},{"./h":130,"./htmldomapi":131,"./is":132,"./thunk":139,"./vnode":141}],139:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var h_1=require("./h");function copyToThunk(vnode,thunk){thunk.elm=vnode.elm;vnode.data.fn=thunk.data.fn;vnode.data.args=thunk.data.args;thunk.data=vnode.data;thunk.children=vnode.children;thunk.text=vnode.text;thunk.elm=vnode.elm}function init(thunk){var cur=thunk.data;var vnode=cur.fn.apply(undefined,cur.args);copyToThunk(vnode,thunk)}function prepatch(oldVnode,thunk){var i,old=oldVnode.data,cur=thunk.data;var oldArgs=old.args,args=cur.args;if(old.fn!==cur.fn||oldArgs.length!==args.length){copyToThunk(cur.fn.apply(undefined,args),thunk);return}for(i=0;i<args.length;++i){if(oldArgs[i]!==args[i]){copyToThunk(cur.fn.apply(undefined,args),thunk);return}}copyToThunk(oldVnode,thunk)}exports.thunk=function thunk(sel,key,fn,args){if(args===undefined){args=fn;fn=key;key=undefined}return h_1.h(sel,{key:key,hook:{init:init,prepatch:prepatch},fn:fn,args:args})};exports.default=exports.thunk},{"./h":130}],140:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var vnode_1=require("./vnode");var htmldomapi_1=require("./htmldomapi");function toVNode(node,domApi){var api=domApi!==undefined?domApi:htmldomapi_1.default;var text;if(api.isElement(node)){var id=node.id?"#"+node.id:"";var cn=node.getAttribute("class");var c=cn?"."+cn.split(" ").join("."):"";var sel=api.tagName(node).toLowerCase()+id+c;var attrs={};var children=[];var name_1;var i=void 0,n=void 0;var elmAttrs=node.attributes;var elmChildren=node.childNodes;for(i=0,n=elmAttrs.length;i<n;i++){name_1=elmAttrs[i].nodeName;if(name_1!=="id"&&name_1!=="class"){attrs[name_1]=elmAttrs[i].nodeValue}}for(i=0,n=elmChildren.length;i<n;i++){children.push(toVNode(elmChildren[i]))}return vnode_1.default(sel,{attrs:attrs},children,undefined,node)}else if(api.isText(node)){text=api.getTextContent(node);return vnode_1.default(undefined,undefined,undefined,text,node)}else if(api.isComment(node)){text=api.getTextContent(node);return vnode_1.default("!",{},[],text,node)}else{return vnode_1.default("",{},[],undefined,undefined)}}exports.toVNode=toVNode;exports.default=toVNode},{"./htmldomapi":131,"./vnode":141}],141:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function vnode(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}}exports.vnode=vnode;exports.default=vnode},{}],142:[function(require,module,exports){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _ponyfill=require("./ponyfill.js");var _ponyfill2=_interopRequireDefault(_ponyfill);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var root;if(typeof self!=="undefined"){root=self}else if(typeof window!=="undefined"){root=window}else if(typeof global!=="undefined"){root=global}else if(typeof module!=="undefined"){root=module}else{root=Function("return this")()}var result=(0,_ponyfill2["default"])(root);exports["default"]=result}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./ponyfill.js":143}],143:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=symbolObservablePonyfill;function symbolObservablePonyfill(root){var result;var _Symbol=root.Symbol;if(typeof _Symbol==="function"){if(_Symbol.observable){result=_Symbol.observable}else{result=_Symbol("observable");_Symbol.observable=result}}else{result="@@observable"}return result}},{}],144:[function(require,module,exports){"use strict";var typestyle_1=require("./internal/typestyle");var types=require("./types");exports.types=types;var utilities_1=require("./internal/utilities");exports.extend=utilities_1.extend;exports.classes=utilities_1.classes;exports.media=utilities_1.media;var ts=new typestyle_1.TypeStyle({autoGenerateTag:true});exports.setStylesTarget=ts.setStylesTarget;exports.cssRaw=ts.cssRaw;exports.cssRule=ts.cssRule;exports.forceRenderStyles=ts.forceRenderStyles;exports.fontFace=ts.fontFace;exports.getStyles=ts.getStyles;exports.keyframes=ts.keyframes;exports.reinit=ts.reinit;exports.style=ts.style;function createTypeStyle(target){var instance=new typestyle_1.TypeStyle({autoGenerateTag:false});if(target){instance.setStylesTarget(target)}return instance}exports.createTypeStyle=createTypeStyle},{"./internal/typestyle":146,"./internal/utilities":147,"./types":148}],145:[function(require,module,exports){"use strict";var FreeStyle=require("free-style");function ensureStringObj(object){var result={};var debugName="";for(var key in object){var val=object[key];if(key==="$unique"){result[FreeStyle.IS_UNIQUE]=val}else if(key==="$nest"){var nested=val;for(var selector in nested){var subproperties=nested[selector];result[selector]=ensureStringObj(subproperties).result}}else if(key==="$debugName"){debugName=val}else{result[key]=val}}return{result:result,debugName:debugName}}exports.ensureStringObj=ensureStringObj;function explodeKeyframes(frames){var result={$debugName:undefined,keyframes:{}};for(var offset in frames){var val=frames[offset];if(offset==="$debugName"){result.$debugName=val}else{result.keyframes[offset]=val}}return result}exports.explodeKeyframes=explodeKeyframes},{"free-style":125}],146:[function(require,module,exports){"use strict";var formatting_1=require("./formatting");var utilities_1=require("./utilities");var FreeStyle=require("free-style");var TypeStyle=function(){function TypeStyle(_a){var autoGenerateTag=_a.autoGenerateTag;var _this=this;this.cssRaw=function(mustBeValidCSS){if(!mustBeValidCSS){return}_this._raw+=mustBeValidCSS||"";_this._pendingRawChange=true;_this._styleUpdated()};this.cssRule=function(selector){var objects=[];for(var _i=1;_i<arguments.length;_i++){objects[_i-1]=arguments[_i]}var object=formatting_1.ensureStringObj(utilities_1.extend.apply(void 0,objects)).result;_this._freeStyle.registerRule(selector,object);_this._styleUpdated();return};this.forceRenderStyles=function(){var target=_this._getTag();if(!target){return}target.textContent=_this.getStyles()};this.fontFace=function(){var fontFace=[];for(var _i=0;_i<arguments.length;_i++){fontFace[_i]=arguments[_i]}var freeStyle=_this._freeStyle;for(var _a=0,fontFace_1=fontFace;_a<fontFace_1.length;_a++){var face=fontFace_1[_a];freeStyle.registerRule("@font-face",face)}_this._styleUpdated();return};this.getStyles=function(){return(_this._raw||"")+_this._freeStyle.getStyles()};this.keyframes=function(frames){var _a=formatting_1.explodeKeyframes(frames),keyframes=_a.keyframes,$debugName=_a.$debugName;var animationName=_this._freeStyle.registerKeyframes(keyframes,$debugName);_this._styleUpdated();return animationName};this.reinit=function(){var freeStyle=FreeStyle.create();_this._freeStyle=freeStyle;_this._lastFreeStyleChangeId=freeStyle.changeId;_this._raw="";_this._pendingRawChange=false;var target=_this._getTag();if(target){target.textContent=""}};this.setStylesTarget=function(tag){if(_this._tag){_this._tag.textContent=""}_this._tag=tag;_this.forceRenderStyles()};this.style=function(){var objects=[];for(var _i=0;_i<arguments.length;_i++){objects[_i]=arguments[_i]}var freeStyle=_this._freeStyle;var _a=formatting_1.ensureStringObj(utilities_1.extend.apply(void 0,objects)),result=_a.result,debugName=_a.debugName;var className=debugName?freeStyle.registerStyle(result,debugName):freeStyle.registerStyle(result);_this._styleUpdated();return className};var freeStyle=FreeStyle.create();this._autoGenerateTag=autoGenerateTag;this._freeStyle=freeStyle;this._lastFreeStyleChangeId=freeStyle.changeId;this._pending=0;this._pendingRawChange=false;this._raw="";this._tag=undefined}TypeStyle.prototype._afterAllSync=function(cb){var _this=this;this._pending++;var pending=this._pending;utilities_1.raf(function(){if(pending!==_this._pending){return}cb()})};TypeStyle.prototype._getTag=function(){if(this._tag){return this._tag}if(this._autoGenerateTag){var tag=typeof window==="undefined"?{textContent:""}:document.createElement("style");if(typeof document!=="undefined"){document.head.appendChild(tag)}this._tag=tag;return tag}return undefined};TypeStyle.prototype._styleUpdated=function(){var _this=this;var changeId=this._freeStyle.changeId;var lastChangeId=this._lastFreeStyleChangeId;if(!this._pendingRawChange&&changeId===lastChangeId){return}this._lastFreeStyleChangeId=changeId;this._pendingRawChange=false;this._afterAllSync(function(){return _this.forceRenderStyles()})};return TypeStyle}();exports.TypeStyle=TypeStyle},{"./formatting":145,"./utilities":147,"free-style":125}],147:[function(require,module,exports){"use strict";exports.raf=typeof requestAnimationFrame==="undefined"?setTimeout:requestAnimationFrame.bind(window);function classes(){var classes=[];for(var _i=0;_i<arguments.length;_i++){classes[_i]=arguments[_i]}return classes.filter(function(c){return!!c}).join(" ")}exports.classes=classes;function extend(){var objects=[];for(var _i=0;_i<arguments.length;_i++){objects[_i]=arguments[_i]}var result={};for(var _a=0,objects_1=objects;_a<objects_1.length;_a++){var object=objects_1[_a];if(object==null||object===false){continue}for(var key in object){var val=object[key];if(!val&&val!==0){continue}if(key==="$nest"&&val){result[key]=result["$nest"]?extend(result["$nest"],val):val}else if(key.indexOf("&")!==-1||key.indexOf("@media")===0){result[key]=result[key]?extend(result[key],val):val}else{result[key]=val}}}return result}exports.extend=extend;exports.media=function(mediaQuery){var objects=[];for(var _i=1;_i<arguments.length;_i++){objects[_i-1]=arguments[_i]}var mediaQuerySections=[];if(mediaQuery.type)mediaQuerySections.push(mediaQuery.type);if(mediaQuery.orientation)mediaQuerySections.push(mediaQuery.orientation);if(mediaQuery.minWidth)mediaQuerySections.push("(min-width: "+mediaQuery.minWidth+"px)");if(mediaQuery.maxWidth)mediaQuerySections.push("(max-width: "+mediaQuery.maxWidth+"px)");var stringMediaQuery="@media "+mediaQuerySections.join(" and ");var object={$nest:(_a={},_a[stringMediaQuery]=extend.apply(void 0,objects),_a)};return object;var _a}},{}],148:[function(require,module,exports){"use strict"},{}],149:[function(require,module,exports){"use strict";var index_1=require("../index");var ConcatProducer=function(){function ConcatProducer(streams){this.streams=streams;this.type="concat";this.out=null;this.i=0}ConcatProducer.prototype._start=function(out){this.out=out;this.streams[this.i]._add(this)};ConcatProducer.prototype._stop=function(){var streams=this.streams;if(this.i<streams.length){streams[this.i]._remove(this)}this.i=0;this.out=null};ConcatProducer.prototype._n=function(t){var u=this.out;if(!u)return;u._n(t)};ConcatProducer.prototype._e=function(err){var u=this.out;if(!u)return;u._e(err)};ConcatProducer.prototype._c=function(){var u=this.out;if(!u)return;var streams=this.streams;streams[this.i]._remove(this);if(++this.i<streams.length){streams[this.i]._add(this)}else{u._c()}};return ConcatProducer}();function concat(){var streams=[];for(var _i=0;_i<arguments.length;_i++){streams[_i]=arguments[_i]}return new index_1.Stream(new ConcatProducer(streams))}Object.defineProperty(exports,"__esModule",{value:true});exports.default=concat},{"../index":153}],150:[function(require,module,exports){"use strict";var index_1=require("../index");var DelayOperator=function(){function DelayOperator(dt,ins){this.dt=dt;this.ins=ins;this.type="delay";this.out=null}DelayOperator.prototype._start=function(out){this.out=out;this.ins._add(this)};DelayOperator.prototype._stop=function(){this.ins._remove(this);this.out=null};DelayOperator.prototype._n=function(t){var u=this.out;if(!u)return;var id=setInterval(function(){u._n(t);clearInterval(id)},this.dt)};DelayOperator.prototype._e=function(err){var u=this.out;if(!u)return;var id=setInterval(function(){u._e(err);clearInterval(id)},this.dt)};DelayOperator.prototype._c=function(){var u=this.out;if(!u)return;var id=setInterval(function(){u._c();clearInterval(id)},this.dt)};return DelayOperator}();function delay(period){return function delayOperator(ins){return new index_1.Stream(new DelayOperator(period,ins))}}Object.defineProperty(exports,"__esModule",{value:true});exports.default=delay},{"../index":153}],151:[function(require,module,exports){"use strict";var index_1=require("../index");var empty={};var DropRepeatsOperator=function(){function DropRepeatsOperator(ins,fn){this.ins=ins;this.fn=fn;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))return;this.v=t;u._n(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;function dropRepeats(isEqual){if(isEqual===void 0){isEqual=void 0}return function dropRepeatsOperator(ins){return new index_1.Stream(new DropRepeatsOperator(ins,isEqual))}}Object.defineProperty(exports,"__esModule",{value:true});exports.default=dropRepeats},{"../index":153}],152:[function(require,module,exports){"use strict";var index_1=require("../index");var concat_1=require("./concat");function interpolate(y,from,to){return from*(1-y)+to*y}function flip(fn){return function(x){return 1-fn(1-x)}}function createEasing(fn){var fnFlipped=flip(fn);return{easeIn:function(x,from,to){return interpolate(fn(x),from,to)},easeOut:function(x,from,to){return interpolate(fnFlipped(x),from,to)},easeInOut:function(x,from,to){var y=x<.5?fn(2*x)*.5:.5+fnFlipped(2*(x-.5))*.5;return interpolate(y,from,to)}}}var easingPower2=createEasing(function(x){return x*x});var easingPower3=createEasing(function(x){return x*x*x});var easingPower4=createEasing(function(x){var xx=x*x;return xx*xx});var EXP_WEIGHT=6;var EXP_MAX=Math.exp(EXP_WEIGHT)-1;function expFn(x){return(Math.exp(x*EXP_WEIGHT)-1)/EXP_MAX}var easingExponential=createEasing(expFn);var OVERSHOOT=1.70158;var easingBack=createEasing(function(x){return x*x*((OVERSHOOT+1)*x-OVERSHOOT)});var PARAM1=7.5625;var PARAM2=2.75;function easeOutFn(x){var z=x;if(z<1/PARAM2){return PARAM1*z*z}else if(z<2/PARAM2){return PARAM1*(z-=1.5/PARAM2)*z+.75}else if(z<2.5/PARAM2){return PARAM1*(z-=2.25/PARAM2)*z+.9375}else{return PARAM1*(z-=2.625/PARAM2)*z+.984375}}var easingBounce=createEasing(function(x){return 1-easeOutFn(1-x)});var easingCirc=createEasing(function(x){return-(Math.sqrt(1-x*x)-1)});var PERIOD=.3;var OVERSHOOT_ELASTIC=PERIOD/4;var AMPLITUDE=1;function elasticIn(x){var z=x;if(z<=0){return 0}else if(z>=1){return 1}else{z-=1;return-(AMPLITUDE*Math.pow(2,10*z))*Math.sin((z-OVERSHOOT_ELASTIC)*(2*Math.PI)/PERIOD)}}var easingElastic=createEasing(elasticIn);var HALF_PI=Math.PI*.5;var easingSine=createEasing(function(x){return 1-Math.cos(x*HALF_PI)});var DEFAULT_INTERVAL=15;function tween(_a){var from=_a.from,to=_a.to,duration=_a.duration,_b=_a.ease,ease=_b===void 0?tweenFactory.linear.ease:_b,_c=_a.interval,interval=_c===void 0?DEFAULT_INTERVAL:_c;var totalTicks=Math.round(duration/interval);return index_1.Stream.periodic(interval).take(totalTicks).map(function(tick){return ease(tick/totalTicks,from,to)}).compose(function(s){return concat_1.default(s,index_1.Stream.of(to))})}var tweenFactory=tween;tweenFactory.linear={ease:interpolate};tweenFactory.power2=easingPower2;tweenFactory.power3=easingPower3;tweenFactory.power4=easingPower4;tweenFactory.exponential=easingExponential;tweenFactory.back=easingBack;tweenFactory.bounce=easingBounce;tweenFactory.circular=easingCirc;tweenFactory.elastic=easingElastic;tweenFactory.sine=easingSine;Object.defineProperty(exports,"__esModule",{value:true});exports.default=tweenFactory},{"../index":153,"./concat":149}],153:[function(require,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 symbol_observable_1=require("symbol-observable");var NO={};exports.NO=NO;function noop(){}function cp(a){var l=a.length;var b=Array(l);for(var i=0;i<l;++i)b[i]=a[i];return b}function and(f1,f2){return function andFn(t){return f1(t)&&f2(t)}}function _try(c,t,u){try{return c.f(t)}catch(e){u._e(e);return NO}}var NO_IL={_n:noop,_e:noop,_c:noop};exports.NO_IL=NO_IL;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}var StreamSub=function(){function StreamSub(_stream,_listener){this._stream=_stream;this._listener=_listener}StreamSub.prototype.unsubscribe=function(){this._stream.removeListener(this._listener)};return StreamSub}();var Observer=function(){function Observer(_listener){this._listener=_listener}Observer.prototype.next=function(value){this._listener._n(value)};Observer.prototype.error=function(err){this._listener._e(err)};Observer.prototype.complete=function(){this._listener._c()};return Observer}();var FromObservable=function(){function FromObservable(observable){this.type="fromObservable";this.ins=observable;this.active=false}FromObservable.prototype._start=function(out){this.out=out;this.active=true;this._sub=this.ins.subscribe(new Observer(out));if(!this.active)this._sub.unsubscribe()};FromObservable.prototype._stop=function(){if(this._sub)this._sub.unsubscribe();this.active=false};return FromObservable}();var Merge=function(){function Merge(insArr){this.type="merge";this.insArr=insArr;this.out=NO;this.ac=0}Merge.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)};Merge.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};Merge.prototype._n=function(t){var u=this.out;if(u===NO)return;u._n(t)};Merge.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Merge.prototype._c=function(){if(--this.ac<=0){var u=this.out;if(u===NO)return;u._c()}};return Merge}();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===NO)return;if(p.up(t,this.i)){var a=p.vals;var l=a.length;var b=Array(l);for(var i=0;i<l;++i)b[i]=a[i];out._n(b)}};CombineListener.prototype._e=function(err){var out=this.out;if(out===NO)return;out._e(err)};CombineListener.prototype._c=function(){var p=this.p;if(p.out===NO)return;if(--p.Nc===0)p.out._c()};return CombineListener}();var Combine=function(){function Combine(insArr){this.type="combine";this.insArr=insArr;this.out=NO;this.ils=[];this.Nc=this.Nn=0;this.vals=[]}Combine.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};Combine.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))}}};Combine.prototype._stop=function(){var s=this.insArr;var n=s.length;var ils=this.ils;for(var i=0;i<n;i++)s[i]._remove(ils[i]);this.out=NO;this.ils=[];this.vals=[]};return Combine}();var FromArray=function(){function FromArray(a){this.type="fromArray";this.a=a}FromArray.prototype._start=function(out){var a=this.a;for(var i=0,n=a.length;i<n;i++)out._n(a[i]);out._c()};FromArray.prototype._stop=function(){};return FromArray}();var FromPromise=function(){function FromPromise(p){this.type="fromPromise";this.on=false;this.p=p}FromPromise.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(noop,function(err){setTimeout(function(){throw err})})};FromPromise.prototype._stop=function(){this.on=false};return FromPromise}();var Periodic=function(){function Periodic(period){this.type="periodic";this.period=period;this.intervalID=-1;this.i=0}Periodic.prototype._start=function(out){var self=this;function intervalHandler(){out._n(self.i++)}this.intervalID=setInterval(intervalHandler,this.period)};Periodic.prototype._stop=function(){if(this.intervalID!==-1)clearInterval(this.intervalID);this.intervalID=-1;this.i=0};return Periodic}();var Debug=function(){function Debug(ins,arg){this.type="debug";this.ins=ins;this.out=NO;this.s=noop;this.l="";if(typeof arg==="string")this.l=arg;else if(typeof arg==="function")this.s=arg}Debug.prototype._start=function(out){this.out=out;this.ins._add(this)};Debug.prototype._stop=function(){this.ins._remove(this);this.out=NO};Debug.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)};Debug.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Debug.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return Debug}();var Drop=function(){function Drop(max,ins){this.type="drop";this.ins=ins;this.out=NO;this.max=max;this.dropped=0}Drop.prototype._start=function(out){this.out=out;this.dropped=0
  ;this.ins._add(this)};Drop.prototype._stop=function(){this.ins._remove(this);this.out=NO};Drop.prototype._n=function(t){var u=this.out;if(u===NO)return;if(this.dropped++>=this.max)u._n(t)};Drop.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Drop.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return Drop}();var EndWhenListener=function(){function EndWhenListener(out,op){this.out=out;this.op=op}EndWhenListener.prototype._n=function(){this.op.end()};EndWhenListener.prototype._e=function(err){this.out._e(err)};EndWhenListener.prototype._c=function(){this.op.end()};return EndWhenListener}();var EndWhen=function(){function EndWhen(o,ins){this.type="endWhen";this.ins=ins;this.out=NO;this.o=o;this.oil=NO_IL}EndWhen.prototype._start=function(out){this.out=out;this.o._add(this.oil=new EndWhenListener(out,this));this.ins._add(this)};EndWhen.prototype._stop=function(){this.ins._remove(this);this.o._remove(this.oil);this.out=NO;this.oil=NO_IL};EndWhen.prototype.end=function(){var u=this.out;if(u===NO)return;u._c()};EndWhen.prototype._n=function(t){var u=this.out;if(u===NO)return;u._n(t)};EndWhen.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};EndWhen.prototype._c=function(){this.end()};return EndWhen}();var Filter=function(){function Filter(passes,ins){this.type="filter";this.ins=ins;this.out=NO;this.f=passes}Filter.prototype._start=function(out){this.out=out;this.ins._add(this)};Filter.prototype._stop=function(){this.ins._remove(this);this.out=NO};Filter.prototype._n=function(t){var u=this.out;if(u===NO)return;var r=_try(this,t,u);if(r===NO||!r)return;u._n(t)};Filter.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Filter.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return Filter}();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 Flatten=function(){function Flatten(ins){this.type="flatten";this.ins=ins;this.out=NO;this.open=true;this.inner=NO;this.il=NO_IL}Flatten.prototype._start=function(out){this.out=out;this.open=true;this.inner=NO;this.il=NO_IL;this.ins._add(this)};Flatten.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=NO_IL};Flatten.prototype.less=function(){var u=this.out;if(u===NO)return;if(!this.open&&this.inner===NO)u._c()};Flatten.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!==NO_IL)inner._remove(il);(this.inner=s)._add(this.il=new FlattenListener(u,this))};Flatten.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Flatten.prototype._c=function(){this.open=false;this.less()};return Flatten}();var Fold=function(){function Fold(f,seed,ins){var _this=this;this.type="fold";this.ins=ins;this.out=NO;this.f=function(t){return f(_this.acc,t)};this.acc=this.seed=seed}Fold.prototype._start=function(out){this.out=out;this.acc=this.seed;out._n(this.acc);this.ins._add(this)};Fold.prototype._stop=function(){this.ins._remove(this);this.out=NO;this.acc=this.seed};Fold.prototype._n=function(t){var u=this.out;if(u===NO)return;var r=_try(this,t,u);if(r===NO)return;u._n(this.acc=r)};Fold.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Fold.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return Fold}();var Last=function(){function Last(ins){this.type="last";this.ins=ins;this.out=NO;this.has=false;this.val=NO}Last.prototype._start=function(out){this.out=out;this.has=false;this.ins._add(this)};Last.prototype._stop=function(){this.ins._remove(this);this.out=NO;this.val=NO};Last.prototype._n=function(t){this.has=true;this.val=t};Last.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Last.prototype._c=function(){var u=this.out;if(u===NO)return;if(this.has){u._n(this.val);u._c()}else u._e(new Error("last() failed because input stream completed"))};return Last}();var MapOp=function(){function MapOp(project,ins){this.type="map";this.ins=ins;this.out=NO;this.f=project}MapOp.prototype._start=function(out){this.out=out;this.ins._add(this)};MapOp.prototype._stop=function(){this.ins._remove(this);this.out=NO};MapOp.prototype._n=function(t){var u=this.out;if(u===NO)return;var r=_try(this,t,u);if(r===NO)return;u._n(r)};MapOp.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};MapOp.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return MapOp}();var Remember=function(){function Remember(ins){this.type="remember";this.ins=ins;this.out=NO}Remember.prototype._start=function(out){this.out=out;this.ins._add(out)};Remember.prototype._stop=function(){this.ins._remove(this.out);this.out=NO};return Remember}();var ReplaceError=function(){function ReplaceError(replacer,ins){this.type="replaceError";this.ins=ins;this.out=NO;this.f=replacer}ReplaceError.prototype._start=function(out){this.out=out;this.ins._add(this)};ReplaceError.prototype._stop=function(){this.ins._remove(this);this.out=NO};ReplaceError.prototype._n=function(t){var u=this.out;if(u===NO)return;u._n(t)};ReplaceError.prototype._e=function(err){var u=this.out;if(u===NO)return;try{this.ins._remove(this);(this.ins=this.f(err))._add(this)}catch(e){u._e(e)}};ReplaceError.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return ReplaceError}();var StartWith=function(){function StartWith(ins,val){this.type="startWith";this.ins=ins;this.out=NO;this.val=val}StartWith.prototype._start=function(out){this.out=out;this.out._n(this.val);this.ins._add(out)};StartWith.prototype._stop=function(){this.ins._remove(this.out);this.out=NO};return StartWith}();var Take=function(){function Take(max,ins){this.type="take";this.ins=ins;this.out=NO;this.max=max;this.taken=0}Take.prototype._start=function(out){this.out=out;this.taken=0;if(this.max<=0)out._c();else this.ins._add(this)};Take.prototype._stop=function(){this.ins._remove(this);this.out=NO};Take.prototype._n=function(t){var u=this.out;if(u===NO)return;var m=++this.taken;if(m<this.max)u._n(t);else if(m===this.max){u._n(t);u._c()}};Take.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Take.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return Take}();var Stream=function(){function Stream(producer){this._prod=producer||NO;this._ils=[];this._stopID=NO;this._dl=NO;this._d=false;this._target=NO;this._err=NO}Stream.prototype._n=function(t){var a=this._ils;var L=a.length;if(this._d)this._dl._n(t);if(L==1)a[0]._n(t);else if(L==0)return;else{var b=cp(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;this._x();if(this._d)this._dl._e(err);if(L==1)a[0]._e(err);else if(L==0)return;else{var b=cp(a);for(var i=0;i<L;i++)b[i]._e(err)}if(!this._d&&L==0)throw this._err};Stream.prototype._c=function(){var a=this._ils;var L=a.length;this._x();if(this._d)this._dl._c();if(L==1)a[0]._c();else if(L==0)return;else{var b=cp(a);for(var i=0;i<L;i++)b[i]._c()}};Stream.prototype._x=function(){if(this._ils.length===0)return;if(this._prod!==NO)this._prod._stop();this._err=NO;this._ils=[]};Stream.prototype._stopNow=function(){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)return;if(this._stopID!==NO){clearTimeout(this._stopID);this._stopID=NO}else{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._stopNow()})}else if(a.length===1){this._pruneCycles()}}};Stream.prototype._pruneCycles=function(){if(this._hasNoSinks(this,[]))this._remove(this._ils[0])};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};Stream.prototype.addListener=function(listener){listener._n=listener.next||noop;listener._e=listener.error||noop;listener._c=listener.complete||noop;this._add(listener)};Stream.prototype.removeListener=function(listener){this._remove(listener)};Stream.prototype.subscribe=function(listener){this.addListener(listener);return new StreamSub(this,listener)};Stream.prototype[symbol_observable_1.default]=function(){return this};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)}return new Stream(producer)};Stream.createWithMemory=function(producer){if(producer)internalizeProducer(producer);return new MemoryStream(producer)};Stream.never=function(){return new Stream({_start:noop,_stop:noop})};Stream.empty=function(){return new Stream({_start:function(il){il._c()},_stop:noop})};Stream.throw=function(error){return new Stream({_start:function(il){il._e(error)},_stop:noop})};Stream.from=function(input){if(typeof input[symbol_observable_1.default]==="function")return Stream.fromObservable(input);else if(typeof input.then==="function")return Stream.fromPromise(input);else if(Array.isArray(input))return Stream.fromArray(input);throw new TypeError("Type of input to from() must be an Array, Promise, or Observable")};Stream.of=function(){var items=[];for(var _i=0;_i<arguments.length;_i++){items[_i]=arguments[_i]}return Stream.fromArray(items)};Stream.fromArray=function(array){return new Stream(new FromArray(array))};Stream.fromPromise=function(promise){return new Stream(new FromPromise(promise))};Stream.fromObservable=function(obs){if(obs.endWhen)return obs;return new Stream(new FromObservable(obs))};Stream.periodic=function(period){return new Stream(new Periodic(period))};Stream.prototype._map=function(project){return new(this.ctor())(new MapOp(project,this))};Stream.prototype.map=function(project){return this._map(project)};Stream.prototype.mapTo=function(projectedValue){var s=this.map(function(){return projectedValue});var op=s._prod;op.type="mapTo";return s};Stream.prototype.filter=function(passes){var p=this._prod;if(p instanceof Filter)return new Stream(new Filter(and(p.f,passes),p.ins));return new Stream(new Filter(passes,this))};Stream.prototype.take=function(amount){return new(this.ctor())(new Take(amount,this))};Stream.prototype.drop=function(amount){return new Stream(new Drop(amount,this))};Stream.prototype.last=function(){return new Stream(new Last(this))};Stream.prototype.startWith=function(initial){return new MemoryStream(new StartWith(this,initial))};Stream.prototype.endWhen=function(other){return new(this.ctor())(new EndWhen(other,this))};Stream.prototype.fold=function(accumulate,seed){return new MemoryStream(new Fold(accumulate,seed,this))};Stream.prototype.replaceError=function(replace){return new(this.ctor())(new ReplaceError(replace,this))};Stream.prototype.flatten=function(){var p=this._prod;return new Stream(new Flatten(this))};Stream.prototype.compose=function(operator){return operator(this)};Stream.prototype.remember=function(){return new MemoryStream(new Remember(this))};Stream.prototype.debug=function(labelOrSpy){return new(this.ctor())(new Debug(this,labelOrSpy))};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=[]};Stream.prototype.shamefullySendNext=function(value){this._n(value)};Stream.prototype.shamefullySendError=function(error){this._e(error)};Stream.prototype.shamefullySendComplete=function(){this._c()};Stream.prototype.setDebugListener=function(listener){if(!listener){this._d=false;this._dl=NO}else{this._d=true;listener._n=listener.next||noop;listener._e=listener.error||noop;listener._c=listener.complete||noop;this._dl=listener}};return Stream}();Stream.merge=function merge(){var streams=[];for(var _i=0;_i<arguments.length;_i++){streams[_i]=arguments[_i]}return new Stream(new Merge(streams))};Stream.combine=function combine(){var streams=[];for(var _i=0;_i<arguments.length;_i++){streams[_i]=arguments[_i]}return new Stream(new Combine(streams))};exports.Stream=Stream;var MemoryStream=function(_super){__extends(MemoryStream,_super);function MemoryStream(producer){var _this=_super.call(this,producer)||this;_this._has=false;return _this}MemoryStream.prototype._n=function(x){this._v=x;this._has=true;_super.prototype._n.call(this,x)};MemoryStream.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._has)il._n(this._v);return}if(this._stopID!==NO){if(this._has)il._n(this._v);clearTimeout(this._stopID);this._stopID=NO}else if(this._has)il._n(this._v);else{var p=this._prod;if(p!==NO)p._start(this)}};MemoryStream.prototype._stopNow=function(){this._has=false;_super.prototype._stopNow.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.remember=function(){return this};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},{"symbol-observable":142}]},{},[33]);
  