Skip to content

Instantly share code, notes, and snippets.

@timwis
Last active February 10, 2016 14:34
Show Gist options
  • Save timwis/97e8f1f741f66724d57b to your computer and use it in GitHub Desktop.
Save timwis/97e8f1f741f66724d57b to your computer and use it in GitHub Desktop.
requirebin sketch
var Model = require('ampersand-model')
var View = require('ampersand-view')
var FormTemplate = document.getElementById('form-template').innerHTML
var FormModel = Model.extend({
props: {
'firstName': 'string',
'lastName': 'string'
}
})
var FormView = View.extend({
template: FormTemplate,
// Receive input
events: {
'change [data-hook=firstNameInput]': function (e) {
this.model.firstName = e.target.value
},
'change [data-hook=lastNameInput]': function (e) {
this.model.lastName = e.target.value
}
},
// Bind output
bindings: {
'model.firstName': {
hook: 'firstNameOutput',
type: 'value'
},
'model.lastName': {
hook: 'lastNameOutput',
type: 'value'
}
}
})
var formModel = new FormModel()
var formView = new FormView({model: formModel})
document.querySelector('#main').appendChild(formView.render().el)
require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-state"]=window.ampersand["ampersand-state"]||[];window.ampersand["ampersand-state"].push("4.9.1")}var uniqueId=require("lodash.uniqueid");var assign=require("lodash.assign");var cloneObj=function(obj){return assign({},obj)};var omit=require("lodash.omit");var escape=require("lodash.escape");var forOwn=require("lodash.forown");var includes=require("lodash.includes");var isString=require("lodash.isstring");var isObject=require("lodash.isobject");var isDate=require("lodash.isdate");var isFunction=require("lodash.isfunction");var _isEqual=require("lodash.isequal");var has=require("lodash.has");var result=require("lodash.result");var bind=require("lodash.bind");var union=require("lodash.union");var Events=require("ampersand-events");var KeyTree=require("key-tree-store");var arrayNext=require("array-next");var changeRE=/^change:/;var noop=function(){};function Base(attrs,options){options||(options={});this.cid||(this.cid=uniqueId("state"));this._events={};this._values={};this._definition=Object.create(this._definition);if(options.parse)attrs=this.parse(attrs,options);this.parent=options.parent;this.collection=options.collection;this._keyTree=new KeyTree;this._initCollections();this._initChildren();this._cache={};this._previousAttributes={};if(attrs)this.set(attrs,assign({silent:true,initial:true},options));this._changed={};if(this._derived)this._initDerived();if(options.init!==false)this.initialize.apply(this,arguments)}assign(Base.prototype,Events,{extraProperties:"ignore",idAttribute:"id",namespaceAttribute:"namespace",typeAttribute:"modelType",initialize:function(){return this},getId:function(){return this[this.idAttribute]},getNamespace:function(){return this[this.namespaceAttribute]},getType:function(){return this[this.typeAttribute]},isNew:function(){return this.getId()==null},escape:function(attr){return escape(this.get(attr))},isValid:function(options){return this._validate({},assign(options||{},{validate:true}))},parse:function(resp,options){return resp},serialize:function(options){var attrOpts=assign({props:true},options);var res=this.getAttributes(attrOpts,true);forOwn(this._children,function(value,key){res[key]=this[key].serialize()},this);forOwn(this._collections,function(value,key){res[key]=this[key].serialize()},this);return res},set:function(key,value,options){var self=this;var extraProperties=this.extraProperties;var wasChanging,changeEvents,newType,newVal,def,cast,err,attr,attrs,dataType,silent,unset,currentVal,initial,hasChanged,isEqual,onChange;if(isObject(key)||key===null){attrs=key;options=value}else{attrs={};attrs[key]=value}options=options||{};if(!this._validate(attrs,options))return false;unset=options.unset;silent=options.silent;initial=options.initial;wasChanging=this._changing;this._changing=true;changeEvents=[];if(initial){this._previousAttributes={}}else if(!wasChanging){this._previousAttributes=this.attributes;this._changed={}}for(var i=0,keys=Object.keys(attrs),len=keys.length;i<len;i++){attr=keys[i];newVal=attrs[attr];newType=typeof newVal;currentVal=this._values[attr];def=this._definition[attr];if(!def){if(this._children[attr]||this._collections[attr]){if(!isObject(newVal)){newVal={}}this[attr].set(newVal,options);continue}else if(extraProperties==="ignore"){continue}else if(extraProperties==="reject"){throw new TypeError('No "'+attr+'" property defined on '+(this.type||"this")+' model and extraProperties not set to "ignore" or "allow"')}else if(extraProperties==="allow"){def=this._createPropertyDefinition(attr,"any")}else if(extraProperties){throw new TypeError('Invalid value for extraProperties: "'+extraProperties+'"')}}isEqual=this._getCompareForType(def.type);onChange=this._getOnChangeForType(def.type);dataType=this._dataTypes[def.type];if(dataType&&dataType.set){cast=dataType.set(newVal);newVal=cast.val;newType=cast.type}if(def.test){err=def.test.call(this,newVal,newType);if(err){throw new TypeError("Property '"+attr+"' failed validation with error: "+err)}}if(newVal===undefined&&def.required){throw new TypeError("Required property '"+attr+"' must be of type "+def.type+". Tried to set "+newVal)}if(newVal===null&&def.required&&!def.allowNull){throw new TypeError("Property '"+attr+"' must be of type "+def.type+" (cannot be null). Tried to set "+newVal)}if(def.type&&def.type!=="any"&&def.type!==newType&&newVal!==null&&newVal!==undefined){throw new TypeError("Property '"+attr+"' must be of type "+def.type+". Tried to set "+newVal)}if(def.values&&!includes(def.values,newVal)){var defaultValue=result(def,"default");if(unset&&defaultValue!==undefined){newVal=defaultValue}else if(!unset||unset&&newVal!==undefined){throw new TypeError("Property '"+attr+"' must be one of values: "+def.values.join(", ")+". Tried to set "+newVal)}}hasChanged=initial||!isEqual(currentVal,newVal,attr);if(def.setOnce&&currentVal!==undefined&&hasChanged){throw new TypeError("Property '"+attr+"' can only be set once.")}if(hasChanged){onChange(newVal,currentVal,attr);if(!initial){this._changed[attr]=newVal;this._previousAttributes[attr]=currentVal;if(unset){delete this._values[attr]}if(!silent){changeEvents.push({prev:currentVal,val:newVal,key:attr})}}if(!unset){this._values[attr]=newVal}}else{delete this._changed[attr]}}if(changeEvents.length)this._pending=true;changeEvents.forEach(function(change){self.trigger("change:"+change.key,self,change.val,options)});if(wasChanging)return this;while(this._pending){this._pending=false;this.trigger("change",this,options)}this._pending=false;this._changing=false;return this},get:function(attr){return this[attr]},toggle:function(property){var def=this._definition[property];if(def.type==="boolean"){this[property]=!this[property]}else if(def&&def.values){this[property]=arrayNext(def.values,this[property])}else{throw new TypeError("Can only toggle properties that are type `boolean` or have `values` array.")}return this},previousAttributes:function(){return cloneObj(this._previousAttributes)},hasChanged:function(attr){if(attr==null)return!!Object.keys(this._changed).length;if(has(this._derived,attr)){return this._derived[attr].depList.some(function(dep){return this.hasChanged(dep)},this)}return has(this._changed,attr)},changedAttributes:function(diff){if(!diff)return this.hasChanged()?cloneObj(this._changed):false;var val,changed=false;var old=this._changing?this._previousAttributes:this.attributes;var def,isEqual;for(var attr in diff){def=this._definition[attr];if(!def)continue;isEqual=this._getCompareForType(def.type);if(isEqual(old[attr],val=diff[attr]))continue;(changed||(changed={}))[attr]=val}return changed},toJSON:function(){return this.serialize()},unset:function(attrs,options){var self=this;attrs=Array.isArray(attrs)?attrs:[attrs];attrs.forEach(function(key){var def=self._definition[key];if(!def)return;var val;if(def.required){val=result(def,"default");return self.set(key,val,options)}else{return self.set(key,val,assign({},options,{unset:true}))}})},clear:function(options){var self=this;Object.keys(this.attributes).forEach(function(key){self.unset(key,options)});return this},previous:function(attr){if(attr==null||!Object.keys(this._previousAttributes).length)return null;return this._previousAttributes[attr]},_getDefaultForType:function(type){var dataType=this._dataTypes[type];return dataType&&dataType["default"]},_getCompareForType:function(type){var dataType=this._dataTypes[type];if(dataType&&dataType.compare)return bind(dataType.compare,this);return _isEqual},_getOnChangeForType:function(type){var dataType=this._dataTypes[type];if(dataType&&dataType.onChange)return bind(dataType.onChange,this);return noop},_validate:function(attrs,options){if(!options.validate||!this.validate)return true;attrs=assign({},this.attributes,attrs);var error=this.validationError=this.validate(attrs,options)||null;if(!error)return true;this.trigger("invalid",this,error,assign(options||{},{validationError:error}));return false},_createPropertyDefinition:function(name,desc,isSession){return createPropertyDefinition(this,name,desc,isSession)},_ensureValidType:function(type){return includes(["string","number","boolean","array","object","date","state","any"].concat(Object.keys(this._dataTypes)),type)?type:undefined},getAttributes:function(options,raw){options=assign({session:false,props:false,derived:false},options||{});var res={};var val,def;for(var item in this._definition){def=this._definition[item];if(options.session&&def.session||options.props&&!def.session){val=raw?this._values[item]:this[item];if(raw&&val&&isFunction(val.serialize))val=val.serialize();if(typeof val==="undefined")val=result(def,"default");if(typeof val!=="undefined")res[item]=val}}if(options.derived){for(var derivedItem in this._derived)res[derivedItem]=this[derivedItem]}return res},_initDerived:function(){var self=this;forOwn(this._derived,function(value,name){var def=self._derived[name];def.deps=def.depList;var update=function(options){options=options||{};var newVal=def.fn.call(self);if(self._cache[name]!==newVal||!def.cache){if(def.cache){self._previousAttributes[name]=self._cache[name]}self._cache[name]=newVal;self.trigger("change:"+name,self,self._cache[name])}};def.deps.forEach(function(propString){self._keyTree.add(propString,update)})});this.on("all",function(eventName){if(changeRE.test(eventName)){self._keyTree.get(eventName.split(":")[1]).forEach(function(fn){fn()})}},this)},_getDerivedProperty:function(name,flushCache){if(this._derived[name].cache){if(flushCache||!this._cache.hasOwnProperty(name)){this._cache[name]=this._derived[name].fn.apply(this)}return this._cache[name]}else{return this._derived[name].fn.apply(this)}},_initCollections:function(){var coll;if(!this._collections)return;for(coll in this._collections){this._safeSet(coll,new this._collections[coll](null,{parent:this}))}},_initChildren:function(){var child;if(!this._children)return;for(child in this._children){this._safeSet(child,new this._children[child]({},{parent:this}));this.listenTo(this[child],"all",this._getEventBubblingHandler(child))}},_getEventBubblingHandler:function(propertyName){return bind(function(name,model,newValue){if(changeRE.test(name)){this.trigger("change:"+propertyName+"."+name.split(":")[1],model,newValue)}else if(name==="change"){this.trigger("change",this)}},this)},_verifyRequired:function(){var attrs=this.attributes;for(var def in this._definition){if(this._definition[def].required&&typeof attrs[def]==="undefined"){return false}}return true},_safeSet:function safeSet(property,value){if(property in this){throw new Error("Encountered namespace collision while setting instance property `"+property+"`")}this[property]=value;return this}});Object.defineProperties(Base.prototype,{attributes:{get:function(){return this.getAttributes({props:true,session:true})}},all:{get:function(){return this.getAttributes({session:true,props:true,derived:true})}},isState:{get:function(){return true},set:function(){}}});function createPropertyDefinition(object,name,desc,isSession){var def=object._definition[name]={};var type,descArray;if(isString(desc)){type=object._ensureValidType(desc);if(type)def.type=type}else{if(Array.isArray(desc)){descArray=desc;desc={type:descArray[0],required:descArray[1],"default":descArray[2]}}type=object._ensureValidType(desc.type);if(type)def.type=type;if(desc.required)def.required=true;if(desc["default"]&&typeof desc["default"]==="object"){throw new TypeError("The default value for "+name+" cannot be an object/array, must be a value or a function which returns a value/object/array")}def["default"]=desc["default"];def.allowNull=desc.allowNull?desc.allowNull:false;if(desc.setOnce)def.setOnce=true;if(def.required&&def["default"]===undefined&&!def.setOnce)def["default"]=object._getDefaultForType(type);def.test=desc.test;def.values=desc.values}if(isSession)def.session=true;if(!type){type=isString(desc)?desc:desc.type;console.warn("Invalid data type of `"+type+"` for `"+name+"` property. Use one of the default types or define your own")}Object.defineProperty(object,name,{set:function(val){this.set(name,val)},get:function(){if(!this._values){throw Error('You may be trying to `extend` a state object with "'+name+'" which has been defined in `props` on the object being extended')}var value=this._values[name];var typeDef=this._dataTypes[def.type];if(typeof value!=="undefined"){if(typeDef&&typeDef.get){value=typeDef.get(value)}return value}var defaultValue=result(def,"default");this._values[name]=defaultValue;if(typeof defaultValue!=="undefined"){var onChange=this._getOnChangeForType(def.type);onChange(defaultValue,value,name)}return defaultValue}});return def}function createDerivedProperty(modelProto,name,definition){var def=modelProto._derived[name]={fn:isFunction(definition)?definition:definition.fn,cache:definition.cache!==false,depList:definition.deps||[]};def.depList.forEach(function(dep){modelProto._deps[dep]=union(modelProto._deps[dep]||[],[name])});Object.defineProperty(modelProto,name,{get:function(){return this._getDerivedProperty(name)},set:function(){throw new TypeError("`"+name+"` is a derived property, it can't be set directly.")}})}var dataTypes={string:{"default":function(){return""}},date:{set:function(newVal){var newType;if(newVal==null){newType=typeof null}else if(!isDate(newVal)){var err=null;var dateVal=new Date(newVal).valueOf();if(isNaN(dateVal)){dateVal=new Date(parseInt(newVal,10)).valueOf();if(isNaN(dateVal))err=true}newVal=dateVal;newType="date";if(err){newType=typeof newVal}}else{newType="date";newVal=newVal.valueOf()}return{val:newVal,type:newType}},get:function(val){if(val==null){return val}return new Date(val)},"default":function(){return new Date}},array:{set:function(newVal){return{val:newVal,type:Array.isArray(newVal)?"array":typeof newVal}},"default":function(){return[]}},object:{set:function(newVal){var newType=typeof newVal;if(newType!=="object"&&newVal===undefined){newVal=null;newType="object"}return{val:newVal,type:newType}},"default":function(){return{}}},state:{set:function(newVal){var isInstance=newVal instanceof Base||newVal&&newVal.isState;if(isInstance){return{val:newVal,type:"state"}}else{return{val:newVal,type:typeof newVal}}},compare:function(currentVal,newVal){return currentVal===newVal},onChange:function(newVal,previousVal,attributeName){if(previousVal){this.stopListening(previousVal)}if(newVal!=null){this.listenTo(newVal,"all",this._getEventBubblingHandler(attributeName))}}}};function extend(protoProps){var parent=this;var child;if(protoProps&&protoProps.hasOwnProperty("constructor")){child=protoProps.constructor}else{child=function(){return parent.apply(this,arguments)}}assign(child,parent);var Surrogate=function(){this.constructor=child};Surrogate.prototype=parent.prototype;child.prototype=new Surrogate;child.prototype._derived=assign({},parent.prototype._derived);child.prototype._deps=assign({},parent.prototype._deps);child.prototype._definition=assign({},parent.prototype._definition);child.prototype._collections=assign({},parent.prototype._collections);child.prototype._children=assign({},parent.prototype._children);child.prototype._dataTypes=assign({},parent.prototype._dataTypes||dataTypes);if(protoProps){var omitFromExtend=["dataTypes","props","session","derived","collections","children"];for(var i=0;i<arguments.length;i++){var def=arguments[i];if(def.dataTypes){forOwn(def.dataTypes,function(def,name){child.prototype._dataTypes[name]=def})}if(def.props){forOwn(def.props,function(def,name){createPropertyDefinition(child.prototype,name,def)})}if(def.session){forOwn(def.session,function(def,name){createPropertyDefinition(child.prototype,name,def,true)})}if(def.derived){forOwn(def.derived,function(def,name){createDerivedProperty(child.prototype,name,def)})}if(def.collections){forOwn(def.collections,function(constructor,name){child.prototype._collections[name]=constructor})}if(def.children){forOwn(def.children,function(constructor,name){child.prototype._children[name]=constructor})}assign(child.prototype,omit(def,omitFromExtend))}}child.__super__=parent.prototype;return child}Base.extend=extend;module.exports=Base},{"ampersand-events":2,"array-next":14,"key-tree-store":15,"lodash.assign":102,"lodash.bind":16,"lodash.escape":20,"lodash.forown":21,"lodash.has":27,"lodash.includes":32,"lodash.isdate":40,"lodash.isequal":41,"lodash.isfunction":48,"lodash.isobject":126,"lodash.isstring":49,"lodash.omit":50,"lodash.result":127,"lodash.union":66,"lodash.uniqueid":75}],2:[function(require,module,exports){if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-events"]=window.ampersand["ampersand-events"]||[];window.ampersand["ampersand-events"].push("1.1.1")}var runOnce=require("lodash.once");var uniqueId=require("lodash.uniqueid");var keys=require("lodash.keys");var isEmpty=require("lodash.isempty");var each=require("lodash.foreach");var bind=require("lodash.bind");var assign=require("lodash.assign");var slice=Array.prototype.slice;var eventSplitter=/\s+/;var Events={on:function(name,callback,context){if(!eventsApi(this,"on",name,[callback,context])||!callback)return this;this._events||(this._events={});var events=this._events[name]||(this._events[name]=[]);events.push({callback:callback,context:context,ctx:context||this});return this},once:function(name,callback,context){if(!eventsApi(this,"once",name,[callback,context])||!callback)return this;var self=this;var once=runOnce(function(){self.off(name,once);callback.apply(this,arguments)});once._callback=callback;return this.on(name,once,context)},off:function(name,callback,context){var retain,ev,events,names,i,l,j,k;if(!this._events||!eventsApi(this,"off",name,[callback,context]))return this;if(!name&&!callback&&!context){this._events=void 0;return this}names=name?[name]:keys(this._events);for(i=0,l=names.length;i<l;i++){name=names[i];if(events=this._events[name]){this._events[name]=retain=[];if(callback||context){for(j=0,k=events.length;j<k;j++){ev=events[j];if(callback&&callback!==ev.callback&&callback!==ev.callback._callback||context&&context!==ev.context){retain.push(ev)}}}if(!retain.length)delete this._events[name]}}return this},trigger:function(name){if(!this._events)return this;var args=slice.call(arguments,1);if(!eventsApi(this,"trigger",name,args))return this;var events=this._events[name];var allEvents=this._events.all;if(events)triggerEvents(events,args);if(allEvents)triggerEvents(allEvents,arguments);return this},stopListening:function(obj,name,callback){var listeningTo=this._listeningTo;if(!listeningTo)return this;var remove=!name&&!callback;if(!callback&&typeof name==="object")callback=this;if(obj)(listeningTo={})[obj._listenId]=obj;for(var id in listeningTo){obj=listeningTo[id];obj.off(name,callback,this);if(remove||isEmpty(obj._events))delete this._listeningTo[id]}return this},createEmitter:function(obj){return assign(obj||{},Events)}};Events.bind=Events.on;Events.unbind=Events.off;var eventsApi=function(obj,action,name,rest){if(!name)return true;if(typeof name==="object"){for(var key in name){obj[action].apply(obj,[key,name[key]].concat(rest))}return false}if(eventSplitter.test(name)){var names=name.split(eventSplitter);for(var i=0,l=names.length;i<l;i++){obj[action].apply(obj,[names[i]].concat(rest))}return false}return true};var triggerEvents=function(events,args){var ev;var i=-1;var l=events.length;var a1=args[0];var a2=args[1];var a3=args[2];switch(args.length){case 0:while(++i<l)(ev=events[i]).callback.call(ev.ctx);return;case 1:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1);return;case 2:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1,a2);return;case 3:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1,a2,a3);return;default:while(++i<l)(ev=events[i]).callback.apply(ev.ctx,args);return}};var listenMethods={listenTo:"on",listenToOnce:"once"};each(listenMethods,function(implementation,method){Events[method]=function(obj,name,callback,run){var listeningTo=this._listeningTo||(this._listeningTo={});var id=obj._listenId||(obj._listenId=uniqueId("l"));listeningTo[id]=obj;if(!callback&&typeof name==="object")callback=this;obj[implementation](name,callback,this);return this}});Events.listenToAndRun=function(obj,name,callback){Events.listenTo.apply(this,arguments);if(!callback&&typeof name==="object")callback=this;callback.apply(this);return this};module.exports=Events},{"lodash.assign":102,"lodash.bind":16,"lodash.foreach":3,"lodash.isempty":7,"lodash.keys":9,"lodash.once":12,"lodash.uniqueid":75}],3:[function(require,module,exports){var arrayEach=require("lodash._arrayeach"),baseEach=require("lodash._baseeach"),bindCallback=require("lodash._bindcallback"),isArray=require("lodash.isarray");function createForEach(arrayFunc,eachFunc){return function(collection,iteratee,thisArg){return typeof iteratee=="function"&&thisArg===undefined&&isArray(collection)?arrayFunc(collection,iteratee):eachFunc(collection,bindCallback(iteratee,thisArg,3))}}var forEach=createForEach(arrayEach,baseEach);module.exports=forEach},{"lodash._arrayeach":4,"lodash._baseeach":5,"lodash._bindcallback":6,"lodash.isarray":39}],4:[function(require,module,exports){function arrayEach(array,iteratee){var index=-1,length=array.length;while(++index<length){if(iteratee(array[index],index,array)===false){break}}return array}module.exports=arrayEach},{}],5:[function(require,module,exports){var keys=require("lodash.keys");var MAX_SAFE_INTEGER=9007199254740991;var baseEach=createBaseEach(baseForOwn);var baseFor=createBaseFor();function baseForOwn(object,iteratee){return baseFor(object,iteratee,keys)}function baseProperty(key){return function(object){return object==null?undefined:object[key]}}function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){var length=collection?getLength(collection):0;if(!isLength(length)){return eachFunc(collection,iteratee)}var index=fromRight?length:-1,iterable=toObject(collection);while(fromRight?index--:++index<length){if(iteratee(iterable[index],index,iterable)===false){break}}return collection}}function createBaseFor(fromRight){return function(object,iteratee,keysFunc){var iterable=toObject(object),props=keysFunc(object),length=props.length,index=fromRight?length:-1;while(fromRight?index--:++index<length){var key=props[index];if(iteratee(iterable[key],key,iterable)===false){break}}return object}}var getLength=baseProperty("length");function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function toObject(value){return isObject(value)?value:Object(value)}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=baseEach},{"lodash.keys":9}],6:[function(require,module,exports){function bindCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(thisArg===undefined){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)};case 5:return function(value,other,key,object,source){return func.call(thisArg,value,other,key,object,source)}}return function(){return func.apply(thisArg,arguments)}}function identity(value){return value}module.exports=bindCallback},{}],7:[function(require,module,exports){var isArguments=require("lodash.isarguments"),isArray=require("lodash.isarray"),isFunction=require("lodash.isfunction"),isString=require("lodash.isstring"),keys=require("lodash.keys");function isObjectLike(value){return!!value&&typeof value=="object"}var MAX_SAFE_INTEGER=9007199254740991;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArrayLike(value){return value!=null&&isLength(getLength(value))}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isEmpty(value){if(value==null){return true}if(isArrayLike(value)&&(isArray(value)||isString(value)||isArguments(value)||isObjectLike(value)&&isFunction(value.splice))){return!value.length}return!keys(value).length}module.exports=isEmpty},{"lodash.isarguments":8,"lodash.isarray":39,"lodash.isfunction":48,"lodash.isstring":49,"lodash.keys":9}],8:[function(require,module,exports){var MAX_SAFE_INTEGER=9007199254740991;var argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]";var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var objectToString=objectProto.toString;var propertyIsEnumerable=objectProto.propertyIsEnumerable;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}function isArrayLike(value){return value!=null&&!(typeof value=="function"&&isFunction(value))&&isLength(getLength(value))}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function isObjectLike(value){return!!value&&typeof value=="object"}module.exports=isArguments},{}],9:[function(require,module,exports){var getNative=require("lodash._getnative"),isArguments=require("lodash.isarguments"),isArray=require("lodash.isarray");var reIsUint=/^\d+$/;var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var nativeKeys=getNative(Object,"keys");var MAX_SAFE_INTEGER=9007199254740991;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArrayLike(value){return value!=null&&isLength(getLength(value))}function isIndex(value,length){value=typeof value=="number"||reIsUint.test(value)?+value:-1;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function shimKeys(object){var props=keysIn(object),propsLength=props.length,length=propsLength&&object.length;var allowIndexes=!!length&&isLength(length)&&(isArray(object)||isArguments(object));var index=-1,result=[];while(++index<propsLength){var key=props[index];if(allowIndexes&&isIndex(key,length)||hasOwnProperty.call(object,key)){result.push(key)}}return result}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}var keys=!nativeKeys?shimKeys:function(object){var Ctor=object==null?undefined:object.constructor;if(typeof Ctor=="function"&&Ctor.prototype===object||typeof object!="function"&&isArrayLike(object)){return shimKeys(object)}return isObject(object)?nativeKeys(object):[]};function keysIn(object){if(object==null){return[]}if(!isObject(object)){object=Object(object)}var length=object.length;length=length&&isLength(length)&&(isArray(object)||isArguments(object))&&length||0;var Ctor=object.constructor,index=-1,isProto=typeof Ctor=="function"&&Ctor.prototype===object,result=Array(length),skipIndexes=length>0;while(++index<length){result[index]=index+""}for(var key in object){if(!(skipIndexes&&isIndex(key,length))&&!(key=="constructor"&&(isProto||!hasOwnProperty.call(object,key)))){result.push(key)}}return result}module.exports=keys},{"lodash._getnative":10,"lodash.isarguments":11,"lodash.isarray":39}],10:[function(require,module,exports){var funcTag="[object Function]";var reIsHostCtor=/^\[object .+?Constructor\]$/;function isObjectLike(value){return!!value&&typeof value=="object"}var objectProto=Object.prototype;var fnToString=Function.prototype.toString;var hasOwnProperty=objectProto.hasOwnProperty;var objToString=objectProto.toString;var reIsNative=RegExp("^"+fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function getNative(object,key){var value=object==null?undefined:object[key];return isNative(value)?value:undefined}function isFunction(value){return isObject(value)&&objToString.call(value)==funcTag}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function isNative(value){if(value==null){return false}if(isFunction(value)){return reIsNative.test(fnToString.call(value))}return isObjectLike(value)&&reIsHostCtor.test(value)}module.exports=getNative},{}],11:[function(require,module,exports){module.exports=require(8)},{}],12:[function(require,module,exports){var before=require("lodash.before");function once(func){return before(2,func)}module.exports=once},{"lodash.before":13}],13:[function(require,module,exports){var FUNC_ERROR_TEXT="Expected a function";function before(n,func){var result;if(typeof func!="function"){if(typeof n=="function"){var temp=n;n=func;func=temp}else{throw new TypeError(FUNC_ERROR_TEXT)}}return function(){if(--n>0){result=func.apply(this,arguments)}if(n<=1){func=undefined}return result}}module.exports=before},{}],14:[function(require,module,exports){module.exports=function arrayNext(array,currentItem){var len=array.length;var newIndex=array.indexOf(currentItem)+1;if(newIndex>len-1)newIndex=0;return array[newIndex]}},{}],15:[function(require,module,exports){var slice=Array.prototype.slice;function KeyTreeStore(options){options=options||{};if(typeof options!=="object"){throw new TypeError("Options must be an object")}var DEFAULT_SEPARATOR=".";this.storage={};this.separator=options.separator||DEFAULT_SEPARATOR}KeyTreeStore.prototype.add=function(keypath,obj){var arr=this.storage[keypath]||(this.storage[keypath]=[]);arr.push(obj)};KeyTreeStore.prototype.remove=function(obj){var path,arr;for(path in this.storage){arr=this.storage[path];arr.some(function(item,index){if(item===obj){arr.splice(index,1);return true}})}};KeyTreeStore.prototype.get=function(keypath){var res=[];var key;for(key in this.storage){if(!keypath||keypath===key||key.indexOf(keypath+this.separator)===0){res=res.concat(this.storage[key])}}return res};KeyTreeStore.prototype.getGrouped=function(keypath){var res={};var key;for(key in this.storage){if(!keypath||keypath===key||key.indexOf(keypath+this.separator)===0){res[key]=slice.call(this.storage[key])}}return res};KeyTreeStore.prototype.getAll=function(keypath){var res={};var key;for(key in this.storage){if(keypath===key||key.indexOf(keypath+this.separator)===0){res[key]=slice.call(this.storage[key])}}return res};KeyTreeStore.prototype.run=function(keypath,context){var args=slice.call(arguments,2);this.get(keypath).forEach(function(fn){fn.apply(context||this,args)})};module.exports=KeyTreeStore},{}],16:[function(require,module,exports){var createWrapper=require("lodash._createwrapper"),replaceHolders=require("lodash._replaceholders"),restParam=require("lodash.restparam");var BIND_FLAG=1,PARTIAL_FLAG=32;var bind=restParam(function(func,thisArg,partials){var bitmask=BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,bind.placeholder);bitmask|=PARTIAL_FLAG}return createWrapper(func,bitmask,thisArg,partials,holders);
});bind.placeholder={};module.exports=bind},{"lodash._createwrapper":17,"lodash._replaceholders":18,"lodash.restparam":19}],17:[function(require,module,exports){(function(global){var BIND_FLAG=1,BIND_KEY_FLAG=2,CURRY_BOUND_FLAG=4,CURRY_FLAG=8,CURRY_RIGHT_FLAG=16,PARTIAL_FLAG=32,PARTIAL_RIGHT_FLAG=64,ARY_FLAG=128,FLIP_FLAG=512;var FUNC_ERROR_TEXT="Expected a function";var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=0/0;var PLACEHOLDER="__lodash_placeholder__";var funcTag="[object Function]",genTag="[object GeneratorFunction]";var reTrim=/^\s+|\s+$/g;var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;var reIsBinary=/^0b[01]+$/i;var reIsOctal=/^0o[0-7]+$/i;var reIsUint=/^(?:0|[1-9]\d*)$/;var objectTypes={"function":true,object:true};var freeParseInt=parseInt;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType?exports:null;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType?module:null;var freeGlobal=checkGlobal(freeExports&&freeModule&&typeof global=="object"&&global);var freeSelf=checkGlobal(objectTypes[typeof self]&&self);var freeWindow=checkGlobal(objectTypes[typeof window]&&window);var thisGlobal=checkGlobal(objectTypes[typeof this]&&this);var root=freeGlobal||freeWindow!==(thisGlobal&&thisGlobal.window)&&freeWindow||freeSelf||thisGlobal||Function("return this")();function apply(func,thisArg,args){var length=args.length;switch(length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function checkGlobal(value){return value&&value.Object===Object?value:null}function isIndex(value,length){value=typeof value=="number"||reIsUint.test(value)?+value:-1;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=-1,result=[];while(++index<length){if(array[index]===placeholder){array[index]=PLACEHOLDER;result[++resIndex]=index}}return result}var objectProto=Object.prototype;var objectToString=objectProto.toString;var nativeMax=Math.max,nativeMin=Math.min;var baseCreate=function(){function object(){}return function(prototype){if(isObject(prototype)){object.prototype=prototype;var result=new object;object.prototype=undefined}return result||{}}}();function composeArgs(args,partials,holders){var holdersLength=holders.length,argsIndex=-1,argsLength=nativeMax(args.length-holdersLength,0),leftIndex=-1,leftLength=partials.length,result=Array(leftLength+argsLength);while(++leftIndex<leftLength){result[leftIndex]=partials[leftIndex]}while(++argsIndex<holdersLength){result[holders[argsIndex]]=args[argsIndex]}while(argsLength--){result[leftIndex++]=args[argsIndex++]}return result}function composeArgsRight(args,partials,holders){var holdersIndex=-1,holdersLength=holders.length,argsIndex=-1,argsLength=nativeMax(args.length-holdersLength,0),rightIndex=-1,rightLength=partials.length,result=Array(argsLength+rightLength);while(++argsIndex<argsLength){result[argsIndex]=args[argsIndex]}var offset=argsIndex;while(++rightIndex<rightLength){result[offset+rightIndex]=partials[rightIndex]}while(++holdersIndex<holdersLength){result[offset+holders[holdersIndex]]=args[argsIndex++]}return result}function copyArray(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index<length){array[index]=source[index]}return array}function createBaseWrapper(func,bitmask,thisArg){var isBind=bitmask&BIND_FLAG,Ctor=createCtorWrapper(func);function wrapper(){var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return fn.apply(isBind?thisArg:this,arguments)}return wrapper}function createCtorWrapper(Ctor){return function(){var args=arguments;switch(args.length){case 0:return new Ctor;case 1:return new Ctor(args[0]);case 2:return new Ctor(args[0],args[1]);case 3:return new Ctor(args[0],args[1],args[2]);case 4:return new Ctor(args[0],args[1],args[2],args[3]);case 5:return new Ctor(args[0],args[1],args[2],args[3],args[4]);case 6:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5]);case 7:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5],args[6])}var thisBinding=baseCreate(Ctor.prototype),result=Ctor.apply(thisBinding,args);return isObject(result)?result:thisBinding}}function createCurryWrapper(func,bitmask,arity){var Ctor=createCtorWrapper(func);function wrapper(){var length=arguments.length,index=length,args=Array(length),fn=this&&this!==root&&this instanceof wrapper?Ctor:func,placeholder=wrapper.placeholder;while(index--){args[index]=arguments[index]}var holders=length<3&&args[0]!==placeholder&&args[length-1]!==placeholder?[]:replaceHolders(args,placeholder);length-=holders.length;return length<arity?createRecurryWrapper(func,bitmask,createHybridWrapper,placeholder,undefined,args,holders,undefined,undefined,arity-length):apply(fn,this,args)}return wrapper}function createHybridWrapper(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){var isAry=bitmask&ARY_FLAG,isBind=bitmask&BIND_FLAG,isBindKey=bitmask&BIND_KEY_FLAG,isCurry=bitmask&CURRY_FLAG,isCurryRight=bitmask&CURRY_RIGHT_FLAG,isFlip=bitmask&FLIP_FLAG,Ctor=isBindKey?undefined:createCtorWrapper(func);function wrapper(){var length=arguments.length,index=length,args=Array(length);while(index--){args[index]=arguments[index]}if(partials){args=composeArgs(args,partials,holders)}if(partialsRight){args=composeArgsRight(args,partialsRight,holdersRight)}if(isCurry||isCurryRight){var placeholder=wrapper.placeholder,argsHolders=replaceHolders(args,placeholder);length-=argsHolders.length;if(length<arity){return createRecurryWrapper(func,bitmask,createHybridWrapper,placeholder,thisArg,args,argsHolders,argPos,ary,arity-length)}}var thisBinding=isBind?thisArg:this,fn=isBindKey?thisBinding[func]:func;if(argPos){args=reorder(args,argPos)}else if(isFlip&&args.length>1){args.reverse()}if(isAry&&ary<args.length){args.length=ary}if(this&&this!==root&&this instanceof wrapper){fn=Ctor||createCtorWrapper(fn)}return fn.apply(thisBinding,args)}return wrapper}function createPartialWrapper(func,bitmask,thisArg,partials){var isBind=bitmask&BIND_FLAG,Ctor=createCtorWrapper(func);function wrapper(){var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength),fn=this&&this!==root&&this instanceof wrapper?Ctor:func;while(++leftIndex<leftLength){args[leftIndex]=partials[leftIndex]}while(argsLength--){args[leftIndex++]=arguments[++argsIndex]}return apply(fn,isBind?thisArg:this,args)}return wrapper}function createRecurryWrapper(func,bitmask,wrapFunc,placeholder,thisArg,partials,holders,argPos,ary,arity){var isCurry=bitmask&CURRY_FLAG,newArgPos=argPos?copyArray(argPos):undefined,newsHolders=isCurry?holders:undefined,newHoldersRight=isCurry?undefined:holders,newPartials=isCurry?partials:undefined,newPartialsRight=isCurry?undefined:partials;bitmask|=isCurry?PARTIAL_FLAG:PARTIAL_RIGHT_FLAG;bitmask&=~(isCurry?PARTIAL_RIGHT_FLAG:PARTIAL_FLAG);if(!(bitmask&CURRY_BOUND_FLAG)){bitmask&=~(BIND_FLAG|BIND_KEY_FLAG)}var result=wrapFunc(func,bitmask,thisArg,newPartials,newsHolders,newPartialsRight,newHoldersRight,newArgPos,ary,arity);result.placeholder=placeholder;return result}function createWrapper(func,bitmask,thisArg,partials,holders,argPos,ary,arity){var isBindKey=bitmask&BIND_KEY_FLAG;if(!isBindKey&&typeof func!="function"){throw new TypeError(FUNC_ERROR_TEXT)}var length=partials?partials.length:0;if(!length){bitmask&=~(PARTIAL_FLAG|PARTIAL_RIGHT_FLAG);partials=holders=undefined}ary=ary===undefined?ary:nativeMax(toInteger(ary),0);arity=arity===undefined?arity:toInteger(arity);length-=holders?holders.length:0;if(bitmask&PARTIAL_RIGHT_FLAG){var partialsRight=partials,holdersRight=holders;partials=holders=undefined}var newData=[func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity];func=newData[0];bitmask=newData[1];thisArg=newData[2];partials=newData[3];holders=newData[4];arity=newData[9]=newData[9]==null?isBindKey?0:func.length:nativeMax(newData[9]-length,0);if(!arity&&bitmask&(CURRY_FLAG|CURRY_RIGHT_FLAG)){bitmask&=~(CURRY_FLAG|CURRY_RIGHT_FLAG)}if(!bitmask||bitmask==BIND_FLAG){var result=createBaseWrapper(func,bitmask,thisArg)}else if(bitmask==CURRY_FLAG||bitmask==CURRY_RIGHT_FLAG){result=createCurryWrapper(func,bitmask,arity)}else if((bitmask==PARTIAL_FLAG||bitmask==(BIND_FLAG|PARTIAL_FLAG))&&!holders.length){result=createPartialWrapper(func,bitmask,thisArg,partials)}else{result=createHybridWrapper.apply(undefined,newData)}return result}function reorder(array,indexes){var arrLength=array.length,length=nativeMin(indexes.length,arrLength),oldArray=copyArray(array);while(length--){var index=indexes[length];array[length]=isIndex(index,arrLength)?oldArray[index]:undefined}return array}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function toInteger(value){if(!value){return value===0?value:0}value=toNumber(value);if(value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER}var remainder=value%1;return value===value?remainder?value-remainder:value:0}function toNumber(value){if(isObject(value)){var other=isFunction(value.valueOf)?value.valueOf():value;value=isObject(other)?other+"":other}if(typeof value!="string"){return value===0?value:+value}value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}module.exports=createWrapper}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],18:[function(require,module,exports){var PLACEHOLDER="__lodash_placeholder__";function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=-1,result=[];while(++index<length){if(array[index]===placeholder){array[index]=PLACEHOLDER;result[++resIndex]=index}}return result}module.exports=replaceHolders},{}],19:[function(require,module,exports){var FUNC_ERROR_TEXT="Expected a function";var nativeMax=Math.max;function restParam(func,start){if(typeof func!="function"){throw new TypeError(FUNC_ERROR_TEXT)}start=nativeMax(start===undefined?func.length-1:+start||0,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),rest=Array(length);while(++index<length){rest[index]=args[start+index]}switch(start){case 0:return func.call(this,rest);case 1:return func.call(this,args[0],rest);case 2:return func.call(this,args[0],args[1],rest)}var otherArgs=Array(start+1);index=-1;while(++index<start){otherArgs[index]=args[index]}otherArgs[start]=rest;return func.apply(this,otherArgs)}}module.exports=restParam},{}],20:[function(require,module,exports){(function(global){var INFINITY=1/0;var symbolTag="[object Symbol]";var reUnescapedHtml=/[&<>"'`]/g,reHasUnescapedHtml=RegExp(reUnescapedHtml.source);var htmlEscapes={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"};var objectTypes={"function":true,object:true};var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType?exports:null;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType?module:null;var freeGlobal=checkGlobal(freeExports&&freeModule&&typeof global=="object"&&global);var freeSelf=checkGlobal(objectTypes[typeof self]&&self);var freeWindow=checkGlobal(objectTypes[typeof window]&&window);var thisGlobal=checkGlobal(objectTypes[typeof this]&&this);var root=freeGlobal||freeWindow!==(thisGlobal&&thisGlobal.window)&&freeWindow||freeSelf||thisGlobal||Function("return this")();function checkGlobal(value){return value&&value.Object===Object?value:null}function escapeHtmlChar(chr){return htmlEscapes[chr]}var objectProto=Object.prototype;var objectToString=objectProto.toString;var Symbol=root.Symbol;var symbolProto=Symbol?Symbol.prototype:undefined,symbolToString=Symbol?symbolProto.toString:undefined;function isObjectLike(value){return!!value&&typeof value=="object"}function isSymbol(value){return typeof value=="symbol"||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){if(typeof value=="string"){return value}if(value==null){return""}if(isSymbol(value)){return Symbol?symbolToString.call(value):""}var result=value+"";return result=="0"&&1/value==-INFINITY?"-0":result}function escape(string){string=toString(string);return string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string}module.exports=escape}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],21:[function(require,module,exports){var baseFor=require("lodash._basefor"),bindCallback=require("lodash._bindcallback"),keys=require("lodash.keys");function baseForOwn(object,iteratee){return baseFor(object,iteratee,keys)}function createForOwn(objectFunc){return function(object,iteratee,thisArg){if(typeof iteratee!="function"||thisArg!==undefined){iteratee=bindCallback(iteratee,thisArg,3)}return objectFunc(object,iteratee)}}var forOwn=createForOwn(baseForOwn);module.exports=forOwn},{"lodash._basefor":22,"lodash._bindcallback":23,"lodash.keys":24}],22:[function(require,module,exports){var baseFor=createBaseFor();function createBaseFor(fromRight){return function(object,iteratee,keysFunc){var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;while(length--){var key=props[fromRight?length:++index];if(iteratee(iterable[key],key,iterable)===false){break}}return object}}module.exports=baseFor},{}],23:[function(require,module,exports){module.exports=require(6)},{}],24:[function(require,module,exports){module.exports=require(9)},{"lodash._getnative":25,"lodash.isarguments":26,"lodash.isarray":39}],25:[function(require,module,exports){module.exports=require(10)},{}],26:[function(require,module,exports){module.exports=require(8)},{}],27:[function(require,module,exports){var baseGet=require("lodash._baseget"),baseSlice=require("lodash._baseslice"),toPath=require("lodash._topath"),isArguments=require("lodash.isarguments"),isArray=require("lodash.isarray");var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;var reIsUint=/^\d+$/;var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var MAX_SAFE_INTEGER=9007199254740991;function isIndex(value,length){value=typeof value=="number"||reIsUint.test(value)?+value:-1;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function isKey(value,object){var type=typeof value;if(type=="string"&&reIsPlainProp.test(value)||type=="number"){return true}if(isArray(value)){return false}var result=!reIsDeepProp.test(value);return result||object!=null&&value in toObject(object)}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function toObject(value){return isObject(value)?value:Object(value)}function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function has(object,path){if(object==null){return false}var result=hasOwnProperty.call(object,path);if(!result&&!isKey(path)){path=toPath(path);object=path.length==1?object:baseGet(object,baseSlice(path,0,-1));if(object==null){return false}path=last(path);result=hasOwnProperty.call(object,path)}return result||isLength(object.length)&&isIndex(path,object.length)&&(isArray(object)||isArguments(object))}module.exports=has},{"lodash._baseget":28,"lodash._baseslice":29,"lodash._topath":30,"lodash.isarguments":31,"lodash.isarray":39}],28:[function(require,module,exports){function baseGet(object,path,pathKey){if(object==null){return}if(pathKey!==undefined&&pathKey in toObject(object)){path=[pathKey]}var index=0,length=path.length;while(object!=null&&index<length){object=object[path[index++]]}return index&&index==length?object:undefined}function toObject(value){return isObject(value)?value:Object(value)}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=baseGet},{}],29:[function(require,module,exports){function baseSlice(array,start,end){var index=-1,length=array.length;start=start==null?0:+start||0;if(start<0){start=-start>length?0:length+start}end=end===undefined||end>length?length:+end||0;if(end<0){end+=length}length=start>end?0:end-start>>>0;start>>>=0;var result=Array(length);while(++index<length){result[index]=array[index+start]}return result}module.exports=baseSlice},{}],30:[function(require,module,exports){var isArray=require("lodash.isarray");var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;var reEscapeChar=/\\(\\)?/g;function baseToString(value){return value==null?"":value+""}function toPath(value){if(isArray(value)){return value}var result=[];baseToString(value).replace(rePropName,function(match,number,quote,string){result.push(quote?string.replace(reEscapeChar,"$1"):number||match)});return result}module.exports=toPath},{"lodash.isarray":39}],31:[function(require,module,exports){module.exports=require(8)},{}],32:[function(require,module,exports){var baseIndexOf=require("lodash._baseindexof"),baseValues=require("lodash._basevalues"),isIterateeCall=require("lodash._isiterateecall"),isArray=require("lodash.isarray"),isString=require("lodash.isstring"),keys=require("lodash.keys");var nativeMax=Math.max;var MAX_SAFE_INTEGER=9007199254740991;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function includes(collection,target,fromIndex,guard){var length=collection?getLength(collection):0;if(!isLength(length)){collection=values(collection);length=collection.length}if(typeof fromIndex!="number"||guard&&isIterateeCall(target,fromIndex,guard)){fromIndex=0}else{fromIndex=fromIndex<0?nativeMax(length+fromIndex,0):fromIndex||0}return typeof collection=="string"||!isArray(collection)&&isString(collection)?fromIndex<=length&&collection.indexOf(target,fromIndex)>-1:!!length&&baseIndexOf(collection,target,fromIndex)>-1}function values(object){return baseValues(object,keys(object))}module.exports=includes},{"lodash._baseindexof":33,"lodash._basevalues":34,"lodash._isiterateecall":35,"lodash.isarray":39,"lodash.isstring":49,"lodash.keys":36}],33:[function(require,module,exports){function baseIndexOf(array,value,fromIndex){if(value!==value){return indexOfNaN(array,fromIndex)}var index=fromIndex-1,length=array.length;while(++index<length){if(array[index]===value){return index}}return-1}function indexOfNaN(array,fromIndex,fromRight){var length=array.length,index=fromIndex+(fromRight?0:-1);while(fromRight?index--:++index<length){var other=array[index];if(other!==other){return index}}return-1}module.exports=baseIndexOf},{}],34:[function(require,module,exports){function baseValues(object,props){var index=-1,length=props.length,result=Array(length);while(++index<length){result[index]=object[props[index]]}return result}module.exports=baseValues},{}],35:[function(require,module,exports){var reIsUint=/^\d+$/;var MAX_SAFE_INTEGER=9007199254740991;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArrayLike(value){return value!=null&&isLength(getLength(value))}function isIndex(value,length){value=typeof value=="number"||reIsUint.test(value)?+value:-1;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function isIterateeCall(value,index,object){if(!isObject(object)){return false}var type=typeof index;if(type=="number"?isArrayLike(object)&&isIndex(index,object.length):type=="string"&&index in object){var other=object[index];return value===value?value===other:other!==other}return false}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=isIterateeCall},{}],36:[function(require,module,exports){module.exports=require(9)},{"lodash._getnative":37,"lodash.isarguments":38,"lodash.isarray":39}],37:[function(require,module,exports){module.exports=require(10)},{}],38:[function(require,module,exports){module.exports=require(8)},{}],39:[function(require,module,exports){var arrayTag="[object Array]",funcTag="[object Function]";var reIsHostCtor=/^\[object .+?Constructor\]$/;function isObjectLike(value){return!!value&&typeof value=="object"}var objectProto=Object.prototype;var fnToString=Function.prototype.toString;var hasOwnProperty=objectProto.hasOwnProperty;var objToString=objectProto.toString;var reIsNative=RegExp("^"+fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var nativeIsArray=getNative(Array,"isArray");var MAX_SAFE_INTEGER=9007199254740991;function getNative(object,key){var value=object==null?undefined:object[key];return isNative(value)?value:undefined}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}var isArray=nativeIsArray||function(value){return isObjectLike(value)&&isLength(value.length)&&objToString.call(value)==arrayTag};function isFunction(value){return isObject(value)&&objToString.call(value)==funcTag}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function isNative(value){if(value==null){return false}if(isFunction(value)){return reIsNative.test(fnToString.call(value))}return isObjectLike(value)&&reIsHostCtor.test(value)}module.exports=isArray},{}],40:[function(require,module,exports){var dateTag="[object Date]";var objectProto=Object.prototype;var objectToString=objectProto.toString;function isDate(value){return isObjectLike(value)&&objectToString.call(value)==dateTag}function isObjectLike(value){return!!value&&typeof value=="object"}module.exports=isDate},{}],41:[function(require,module,exports){var baseIsEqual=require("lodash._baseisequal"),bindCallback=require("lodash._bindcallback");function isEqual(value,other,customizer,thisArg){customizer=typeof customizer=="function"?bindCallback(customizer,thisArg,3):undefined;var result=customizer?customizer(value,other):undefined;return result===undefined?baseIsEqual(value,other,customizer):!!result}module.exports=isEqual},{"lodash._baseisequal":42,"lodash._bindcallback":47}],42:[function(require,module,exports){var isArray=require("lodash.isarray"),isTypedArray=require("lodash.istypedarray"),keys=require("lodash.keys");var argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",stringTag="[object String]";function isObjectLike(value){return!!value&&typeof value=="object"}var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var objToString=objectProto.toString;function arraySome(array,predicate){var index=-1,length=array.length;while(++index<length){if(predicate(array[index],index,array)){return true}}return false}function baseIsEqual(value,other,customizer,isLoose,stackA,stackB){if(value===other){return true}if(value==null||other==null||!isObject(value)&&!isObjectLike(other)){return value!==value&&other!==other}return baseIsEqualDeep(value,other,baseIsEqual,customizer,isLoose,stackA,stackB)}function baseIsEqualDeep(object,other,equalFunc,customizer,isLoose,stackA,stackB){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=arrayTag,othTag=arrayTag;if(!objIsArr){objTag=objToString.call(object);if(objTag==argsTag){objTag=objectTag}else if(objTag!=objectTag){objIsArr=isTypedArray(object)}}if(!othIsArr){othTag=objToString.call(other);if(othTag==argsTag){othTag=objectTag}else if(othTag!=objectTag){othIsArr=isTypedArray(other)}}var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&!(objIsArr||objIsObj)){return equalByTag(object,other,objTag)}if(!isLoose){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){return equalFunc(objIsWrapped?object.value():object,othIsWrapped?other.value():other,customizer,isLoose,stackA,stackB)}}if(!isSameTag){return false}stackA||(stackA=[]);stackB||(stackB=[]);var length=stackA.length;while(length--){if(stackA[length]==object){return stackB[length]==other}}stackA.push(object);stackB.push(other);var result=(objIsArr?equalArrays:equalObjects)(object,other,equalFunc,customizer,isLoose,stackA,stackB);stackA.pop();stackB.pop();return result}function equalArrays(array,other,equalFunc,customizer,isLoose,stackA,stackB){var index=-1,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isLoose&&othLength>arrLength)){return false}while(++index<arrLength){var arrValue=array[index],othValue=other[index],result=customizer?customizer(isLoose?othValue:arrValue,isLoose?arrValue:othValue,index):undefined;if(result!==undefined){if(result){continue}return false}if(isLoose){if(!arraySome(other,function(othValue){return arrValue===othValue||equalFunc(arrValue,othValue,customizer,isLoose,stackA,stackB)})){return false}}else if(!(arrValue===othValue||equalFunc(arrValue,othValue,customizer,isLoose,stackA,stackB))){return false}}return true}function equalByTag(object,other,tag){switch(tag){case boolTag:case dateTag:return+object==+other;case errorTag:return object.name==other.name&&object.message==other.message;case numberTag:return object!=+object?other!=+other:object==+other;case regexpTag:case stringTag:return object==other+""}return false}function equalObjects(object,other,equalFunc,customizer,isLoose,stackA,stackB){var objProps=keys(object),objLength=objProps.length,othProps=keys(other),othLength=othProps.length;if(objLength!=othLength&&!isLoose){return false}var index=objLength;while(index--){var key=objProps[index];if(!(isLoose?key in other:hasOwnProperty.call(other,key))){return false}}var skipCtor=isLoose;while(++index<objLength){key=objProps[index];var objValue=object[key],othValue=other[key],result=customizer?customizer(isLoose?othValue:objValue,isLoose?objValue:othValue,key):undefined;if(!(result===undefined?equalFunc(objValue,othValue,customizer,isLoose,stackA,stackB):result)){return false}skipCtor||(skipCtor=key=="constructor")}if(!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;if(objCtor!=othCtor&&("constructor"in object&&"constructor"in other)&&!(typeof objCtor=="function"&&objCtor instanceof objCtor&&typeof othCtor=="function"&&othCtor instanceof othCtor)){return false}}return true}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=baseIsEqual},{"lodash.isarray":39,"lodash.istypedarray":43,"lodash.keys":44}],43:[function(require,module,exports){var MAX_SAFE_INTEGER=9007199254740991;var argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]";var arrayBufferTag="[object ArrayBuffer]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]";var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;var objectProto=Object.prototype;var objectToString=objectProto.toString;function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObjectLike(value){return!!value&&typeof value=="object"}function isTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[objectToString.call(value)]}module.exports=isTypedArray},{}],44:[function(require,module,exports){module.exports=require(9)},{"lodash._getnative":45,"lodash.isarguments":46,"lodash.isarray":39}],45:[function(require,module,exports){module.exports=require(10)},{}],46:[function(require,module,exports){module.exports=require(8)},{}],47:[function(require,module,exports){module.exports=require(6)},{}],48:[function(require,module,exports){var funcTag="[object Function]",genTag="[object GeneratorFunction]";var objectProto=Object.prototype;var objectToString=objectProto.toString;function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=isFunction},{}],49:[function(require,module,exports){var stringTag="[object String]";function isObjectLike(value){return!!value&&typeof value=="object"}var objectProto=Object.prototype;var objToString=objectProto.toString;function isString(value){return typeof value=="string"||isObjectLike(value)&&objToString.call(value)==stringTag}module.exports=isString},{}],50:[function(require,module,exports){var arrayMap=require("lodash._arraymap"),baseDifference=require("lodash._basedifference"),baseFlatten=require("lodash._baseflatten"),bindCallback=require("lodash._bindcallback"),pickByArray=require("lodash._pickbyarray"),pickByCallback=require("lodash._pickbycallback"),keysIn=require("lodash.keysin"),restParam=require("lodash.restparam");var omit=restParam(function(object,props){if(object==null){return{}}if(typeof props[0]!="function"){var props=arrayMap(baseFlatten(props),String);return pickByArray(object,baseDifference(keysIn(object),props))}var predicate=bindCallback(props[0],props[1],3);return pickByCallback(object,function(value,key,object){return!predicate(value,key,object)})});module.exports=omit},{"lodash._arraymap":51,"lodash._basedifference":52,"lodash._baseflatten":57,"lodash._bindcallback":59,"lodash._pickbyarray":60,"lodash._pickbycallback":61,"lodash.keysin":63,"lodash.restparam":65}],51:[function(require,module,exports){function arrayMap(array,iteratee){var index=-1,length=array.length,result=Array(length);while(++index<length){result[index]=iteratee(array[index],index,array)}return result}module.exports=arrayMap},{}],52:[function(require,module,exports){var baseIndexOf=require("lodash._baseindexof"),cacheIndexOf=require("lodash._cacheindexof"),createCache=require("lodash._createcache");var LARGE_ARRAY_SIZE=200;function baseDifference(array,values){var length=array?array.length:0,result=[];if(!length){return result}var index=-1,indexOf=baseIndexOf,isCommon=true,cache=isCommon&&values.length>=LARGE_ARRAY_SIZE?createCache(values):null,valuesLength=values.length;if(cache){indexOf=cacheIndexOf;isCommon=false;values=cache}outer:while(++index<length){var value=array[index];
if(isCommon&&value===value){var valuesIndex=valuesLength;while(valuesIndex--){if(values[valuesIndex]===value){continue outer}}result.push(value)}else if(indexOf(values,value,0)<0){result.push(value)}}return result}module.exports=baseDifference},{"lodash._baseindexof":53,"lodash._cacheindexof":54,"lodash._createcache":55}],53:[function(require,module,exports){module.exports=require(33)},{}],54:[function(require,module,exports){function cacheIndexOf(cache,value){var data=cache.data,result=typeof value=="string"||isObject(value)?data.set.has(value):data.hash[value];return result?0:-1}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=cacheIndexOf},{}],55:[function(require,module,exports){(function(global){var getNative=require("lodash._getnative");var Set=getNative(global,"Set");var nativeCreate=getNative(Object,"create");function SetCache(values){var length=values?values.length:0;this.data={hash:nativeCreate(null),set:new Set};while(length--){this.push(values[length])}}function cachePush(value){var data=this.data;if(typeof value=="string"||isObject(value)){data.set.add(value)}else{data.hash[value]=true}}function createCache(values){return nativeCreate&&Set?new SetCache(values):null}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}SetCache.prototype.push=cachePush;module.exports=createCache}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"lodash._getnative":56}],56:[function(require,module,exports){module.exports=require(10)},{}],57:[function(require,module,exports){var isArguments=require("lodash.isarguments"),isArray=require("lodash.isarray");function isObjectLike(value){return!!value&&typeof value=="object"}var MAX_SAFE_INTEGER=9007199254740991;function arrayPush(array,values){var index=-1,length=values.length,offset=array.length;while(++index<length){array[offset+index]=values[index]}return array}function baseFlatten(array,isDeep,isStrict,result){result||(result=[]);var index=-1,length=array.length;while(++index<length){var value=array[index];if(isObjectLike(value)&&isArrayLike(value)&&(isStrict||isArray(value)||isArguments(value))){if(isDeep){baseFlatten(value,isDeep,isStrict,result)}else{arrayPush(result,value)}}else if(!isStrict){result[result.length]=value}}return result}function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArrayLike(value){return value!=null&&isLength(getLength(value))}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}module.exports=baseFlatten},{"lodash.isarguments":58,"lodash.isarray":39}],58:[function(require,module,exports){module.exports=require(8)},{}],59:[function(require,module,exports){module.exports=require(6)},{}],60:[function(require,module,exports){function pickByArray(object,props){object=toObject(object);var index=-1,length=props.length,result={};while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}return result}function toObject(value){return isObject(value)?value:Object(value)}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=pickByArray},{}],61:[function(require,module,exports){var baseFor=require("lodash._basefor"),keysIn=require("lodash.keysin");function baseForIn(object,iteratee){return baseFor(object,iteratee,keysIn)}function pickByCallback(object,predicate){var result={};baseForIn(object,function(value,key,object){if(predicate(value,key,object)){result[key]=value}});return result}module.exports=pickByCallback},{"lodash._basefor":62,"lodash.keysin":63}],62:[function(require,module,exports){module.exports=require(22)},{}],63:[function(require,module,exports){var isArguments=require("lodash.isarguments"),isArray=require("lodash.isarray");var reIsUint=/^\d+$/;var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var MAX_SAFE_INTEGER=9007199254740991;function isIndex(value,length){value=typeof value=="number"||reIsUint.test(value)?+value:-1;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function keysIn(object){if(object==null){return[]}if(!isObject(object)){object=Object(object)}var length=object.length;length=length&&isLength(length)&&(isArray(object)||isArguments(object))&&length||0;var Ctor=object.constructor,index=-1,isProto=typeof Ctor=="function"&&Ctor.prototype===object,result=Array(length),skipIndexes=length>0;while(++index<length){result[index]=index+""}for(var key in object){if(!(skipIndexes&&isIndex(key,length))&&!(key=="constructor"&&(isProto||!hasOwnProperty.call(object,key)))){result.push(key)}}return result}module.exports=keysIn},{"lodash.isarguments":64,"lodash.isarray":39}],64:[function(require,module,exports){module.exports=require(8)},{}],65:[function(require,module,exports){module.exports=require(19)},{}],66:[function(require,module,exports){var baseFlatten=require("lodash._baseflatten"),baseUniq=require("lodash._baseuniq"),restParam=require("lodash.restparam");var union=restParam(function(arrays){return baseUniq(baseFlatten(arrays,false,true))});module.exports=union},{"lodash._baseflatten":67,"lodash._baseuniq":69,"lodash.restparam":74}],67:[function(require,module,exports){module.exports=require(57)},{"lodash.isarguments":68,"lodash.isarray":39}],68:[function(require,module,exports){module.exports=require(8)},{}],69:[function(require,module,exports){var baseIndexOf=require("lodash._baseindexof"),cacheIndexOf=require("lodash._cacheindexof"),createCache=require("lodash._createcache");var LARGE_ARRAY_SIZE=200;function baseUniq(array,iteratee){var index=-1,indexOf=baseIndexOf,length=array.length,isCommon=true,isLarge=isCommon&&length>=LARGE_ARRAY_SIZE,seen=isLarge?createCache():null,result=[];if(seen){indexOf=cacheIndexOf;isCommon=false}else{isLarge=false;seen=iteratee?[]:result}outer:while(++index<length){var value=array[index],computed=iteratee?iteratee(value,index,array):value;if(isCommon&&value===value){var seenIndex=seen.length;while(seenIndex--){if(seen[seenIndex]===computed){continue outer}}if(iteratee){seen.push(computed)}result.push(value)}else if(indexOf(seen,computed,0)<0){if(iteratee||isLarge){seen.push(computed)}result.push(value)}}return result}module.exports=baseUniq},{"lodash._baseindexof":70,"lodash._cacheindexof":71,"lodash._createcache":72}],70:[function(require,module,exports){module.exports=require(33)},{}],71:[function(require,module,exports){module.exports=require(54)},{}],72:[function(require,module,exports){module.exports=require(55)},{"lodash._getnative":73}],73:[function(require,module,exports){module.exports=require(10)},{}],74:[function(require,module,exports){module.exports=require(19)},{}],75:[function(require,module,exports){(function(global){var INFINITY=1/0;var symbolTag="[object Symbol]";var objectTypes={"function":true,object:true};var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType?exports:null;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType?module:null;var freeGlobal=checkGlobal(freeExports&&freeModule&&typeof global=="object"&&global);var freeSelf=checkGlobal(objectTypes[typeof self]&&self);var freeWindow=checkGlobal(objectTypes[typeof window]&&window);var thisGlobal=checkGlobal(objectTypes[typeof this]&&this);var root=freeGlobal||freeWindow!==(thisGlobal&&thisGlobal.window)&&freeWindow||freeSelf||thisGlobal||Function("return this")();function checkGlobal(value){return value&&value.Object===Object?value:null}var objectProto=Object.prototype;var idCounter=0;var objectToString=objectProto.toString;var Symbol=root.Symbol;var symbolProto=Symbol?Symbol.prototype:undefined,symbolToString=Symbol?symbolProto.toString:undefined;function isObjectLike(value){return!!value&&typeof value=="object"}function isSymbol(value){return typeof value=="symbol"||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){if(typeof value=="string"){return value}if(value==null){return""}if(isSymbol(value)){return Symbol?symbolToString.call(value):""}var result=value+"";return result=="0"&&1/value==-INFINITY?"-0":result}function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id}module.exports=uniqueId}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],76:[function(require,module,exports){var xhr=require("xhr");module.exports=require("./core")(xhr)},{"./core":77,xhr:94}],77:[function(require,module,exports){if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-sync"]=window.ampersand["ampersand-sync"]||[];window.ampersand["ampersand-sync"].push("4.0.3")}var result=require("lodash.result");var defaults=require("lodash.defaults");var includes=require("lodash.includes");var assign=require("lodash.assign");var qs=require("qs");var mediaType=require("media-type");module.exports=function(xhr){var urlError=function(){throw new Error('A "url" property or function must be specified')};var methodMap={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};return function(method,model,optionsInput){var options=assign({},optionsInput);var type=methodMap[method];var headers={};defaults(options||(options={}),{emulateHTTP:false,emulateJSON:false,xhrImplementation:xhr});var params={type:type};var ajaxConfig=result(model,"ajaxConfig")||{};var key;if(ajaxConfig.headers){for(key in ajaxConfig.headers){headers[key.toLowerCase()]=ajaxConfig.headers[key]}}if(options.headers){for(key in options.headers){headers[key.toLowerCase()]=options.headers[key]}delete options.headers}assign(params,ajaxConfig);params.headers=headers;if(!options.url){options.url=result(model,"url")||urlError()}if(options.data==null&&model&&(method==="create"||method==="update"||method==="patch")){params.json=options.attrs||model.toJSON(options)}if(options.data&&type==="GET"){options.url+=includes(options.url,"?")?"&":"?";options.url+=qs.stringify(options.data);delete options.data}if(options.emulateJSON){params.headers["content-type"]="application/x-www-form-urlencoded";params.body=params.json?{model:params.json}:{};delete params.json}if(options.emulateHTTP&&(type==="PUT"||type==="DELETE"||type==="PATCH")){params.type="POST";if(options.emulateJSON)params.body._method=type;params.headers["x-http-method-override"]=type}if(options.emulateJSON){params.body=qs.stringify(params.body)}if(ajaxConfig.xhrFields){var beforeSend=ajaxConfig.beforeSend;params.beforeSend=function(req){assign(req,ajaxConfig.xhrFields);if(beforeSend)return beforeSend.apply(this,arguments)};params.xhrFields=ajaxConfig.xhrFields}params.method=params.type;var ajaxSettings=assign(params,options);var request=options.xhrImplementation(ajaxSettings,function(err,resp,body){if(err||resp.statusCode>=400){if(options.error){try{body=JSON.parse(body)}catch(e){}var message=err?err.message:body||"HTTP"+resp.statusCode;options.error(resp,"error",message)}}else{var accept=mediaType.fromString(params.headers.accept);var parseJson=accept.isValid()&&accept.type==="application"&&(accept.subtype==="json"||accept.suffix==="json");if(typeof body==="string"&&(!params.headers.accept||parseJson)){try{body=JSON.parse(body)}catch(err){if(options.error)options.error(resp,"error",err.message);if(options.always)options.always(err,resp,body);return}}if(options.success)options.success(body,"success",resp)}if(options.always)options.always(err,resp,body)});if(model)model.trigger("request",model,request,optionsInput,ajaxSettings);request.ajaxSettings=ajaxSettings;return request}}},{"lodash.assign":102,"lodash.defaults":78,"lodash.includes":80,"lodash.result":127,"media-type":89,qs:90}],78:[function(require,module,exports){var assign=require("lodash.assign"),restParam=require("lodash.restparam");function assignDefaults(objectValue,sourceValue){return objectValue===undefined?sourceValue:objectValue}function createDefaults(assigner,customizer){return restParam(function(args){var object=args[0];if(object==null){return object}args.push(customizer);return assigner.apply(undefined,args)})}var defaults=createDefaults(assign,assignDefaults);module.exports=defaults},{"lodash.assign":102,"lodash.restparam":79}],79:[function(require,module,exports){module.exports=require(19)},{}],80:[function(require,module,exports){module.exports=require(32)},{"lodash._baseindexof":81,"lodash._basevalues":82,"lodash._isiterateecall":83,"lodash.isarray":84,"lodash.isstring":85,"lodash.keys":86}],81:[function(require,module,exports){module.exports=require(33)},{}],82:[function(require,module,exports){module.exports=require(34)},{}],83:[function(require,module,exports){module.exports=require(35)},{}],84:[function(require,module,exports){module.exports=require(39)},{}],85:[function(require,module,exports){module.exports=require(49)},{}],86:[function(require,module,exports){module.exports=require(9)},{"lodash._getnative":87,"lodash.isarguments":88,"lodash.isarray":84}],87:[function(require,module,exports){module.exports=require(10)},{}],88:[function(require,module,exports){module.exports=require(8)},{}],89:[function(require,module,exports){var MediaType=function(){this.type=null;this._setSubtypeAndSuffix(null);this.parameters={}};MediaType.prototype.isValid=function(){return this.type!==null&&this.subtype!==null&&this.subtype!=="example"};MediaType.prototype._setSubtypeAndSuffix=function(subtype){this.subtype=subtype;this.subtypeFacets=[];this.suffix=null;if(subtype){if(subtype.indexOf("+")>-1&&subtype.substr(-1)!=="+"){var fixes=subtype.split("+",2);this.subtype=fixes[0];this.subtypeFacets=fixes[0].split(".");this.suffix=fixes[1]}else{this.subtypeFacets=subtype.split(".")}}};MediaType.prototype.hasSuffix=function(){return!!this.suffix};MediaType.prototype._firstSubtypeFacetEquals=function(str){return this.subtypeFacets.length>0&&this.subtypeFacets[0]===str};MediaType.prototype.isVendor=function(){return this._firstSubtypeFacetEquals("vnd")};MediaType.prototype.isPersonal=function(){return this._firstSubtypeFacetEquals("prs")};MediaType.prototype.isExperimental=function(){return this._firstSubtypeFacetEquals("x")||this.subtype.substring(0,2).toLowerCase()==="x-"};MediaType.prototype.asString=function(){var str="";if(this.isValid()){str=str+this.type+"/"+this.subtype;if(this.hasSuffix()){str=str+"+"+this.suffix}var parameterKeys=Object.keys(this.parameters);if(parameterKeys.length>0){var parameters=[];var that=this;parameterKeys.sort(function(a,b){return a.localeCompare(b)}).forEach(function(element){parameters.push(element+"="+wrapQuotes(that.parameters[element]))});str=str+";"+parameters.join(";")}}return str};var wrapQuotes=function(str){return str.indexOf(";")>-1?'"'+str+'"':str};var unwrapQuotes=function(str){return str.substr(0,1)==='"'&&str.substr(-1)==='"'?str.substr(1,str.length-2):str};var mediaTypeMatcher=/^(application|audio|image|message|model|multipart|text|video|\*)\/([a-zA-Z0-9!#$%^&\*_\-\+{}\|'.`~]{1,127})(;.*)?$/;var parameterSplitter=/;(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/;exports.fromString=function(str){var mediaType=new MediaType;if(str){var match=str.match(mediaTypeMatcher);if(match&&!(match[1]==="*"&&match[2]!=="*")){mediaType.type=match[1];mediaType._setSubtypeAndSuffix(match[2]);if(match[3]){match[3].substr(1).split(parameterSplitter).forEach(function(parameter){var keyAndValue=parameter.split("=",2);if(keyAndValue.length===2){mediaType.parameters[keyAndValue[0].toLowerCase().trim()]=unwrapQuotes(keyAndValue[1].trim())}})}}}return mediaType}},{}],90:[function(require,module,exports){var Stringify=require("./stringify");var Parse=require("./parse");var internals={};module.exports={stringify:Stringify,parse:Parse}},{"./parse":91,"./stringify":92}],91:[function(require,module,exports){var Utils=require("./utils");var internals={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:false,plainObjects:false,allowPrototypes:false};internals.parseValues=function(str,options){var obj={};var parts=str.split(options.delimiter,options.parameterLimit===Infinity?undefined:options.parameterLimit);for(var i=0,il=parts.length;i<il;++i){var part=parts[i];var pos=part.indexOf("]=")===-1?part.indexOf("="):part.indexOf("]=")+1;if(pos===-1){obj[Utils.decode(part)]="";if(options.strictNullHandling){obj[Utils.decode(part)]=null}}else{var key=Utils.decode(part.slice(0,pos));var val=Utils.decode(part.slice(pos+1));if(!Object.prototype.hasOwnProperty.call(obj,key)){obj[key]=val}else{obj[key]=[].concat(obj[key]).concat(val)}}}return obj};internals.parseObject=function(chain,val,options){if(!chain.length){return val}var root=chain.shift();var obj;if(root==="[]"){obj=[];obj=obj.concat(internals.parseObject(chain,val,options))}else{obj=options.plainObjects?Object.create(null):{};var cleanRoot=root[0]==="["&&root[root.length-1]==="]"?root.slice(1,root.length-1):root;var index=parseInt(cleanRoot,10);var indexString=""+index;if(!isNaN(index)&&root!==cleanRoot&&indexString===cleanRoot&&index>=0&&(options.parseArrays&&index<=options.arrayLimit)){obj=[];obj[index]=internals.parseObject(chain,val,options)}else{obj[cleanRoot]=internals.parseObject(chain,val,options)}}return obj};internals.parseKeys=function(key,val,options){if(!key){return}if(options.allowDots){key=key.replace(/\.([^\.\[]+)/g,"[$1]")}var parent=/^([^\[\]]*)/;var child=/(\[[^\[\]]*\])/g;var segment=parent.exec(key);var keys=[];if(segment[1]){if(!options.plainObjects&&Object.prototype.hasOwnProperty(segment[1])){if(!options.allowPrototypes){return}}keys.push(segment[1])}var i=0;while((segment=child.exec(key))!==null&&i<options.depth){++i;if(!options.plainObjects&&Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g,""))){if(!options.allowPrototypes){continue}}keys.push(segment[1])}if(segment){keys.push("["+key.slice(segment.index)+"]")}return internals.parseObject(keys,val,options)};module.exports=function(str,options){options=options||{};options.delimiter=typeof options.delimiter==="string"||Utils.isRegExp(options.delimiter)?options.delimiter:internals.delimiter;options.depth=typeof options.depth==="number"?options.depth:internals.depth;options.arrayLimit=typeof options.arrayLimit==="number"?options.arrayLimit:internals.arrayLimit;options.parseArrays=options.parseArrays!==false;options.allowDots=options.allowDots!==false;options.plainObjects=typeof options.plainObjects==="boolean"?options.plainObjects:internals.plainObjects;options.allowPrototypes=typeof options.allowPrototypes==="boolean"?options.allowPrototypes:internals.allowPrototypes;options.parameterLimit=typeof options.parameterLimit==="number"?options.parameterLimit:internals.parameterLimit;options.strictNullHandling=typeof options.strictNullHandling==="boolean"?options.strictNullHandling:internals.strictNullHandling;if(str===""||str===null||typeof str==="undefined"){return options.plainObjects?Object.create(null):{}}var tempObj=typeof str==="string"?internals.parseValues(str,options):str;var obj=options.plainObjects?Object.create(null):{};var keys=Object.keys(tempObj);for(var i=0,il=keys.length;i<il;++i){var key=keys[i];var newObj=internals.parseKeys(key,tempObj[key],options);obj=Utils.merge(obj,newObj,options)}return Utils.compact(obj)}},{"./utils":93}],92:[function(require,module,exports){var Utils=require("./utils");var internals={delimiter:"&",arrayPrefixGenerators:{brackets:function(prefix,key){return prefix+"[]"},indices:function(prefix,key){return prefix+"["+key+"]"},repeat:function(prefix,key){return prefix}},strictNullHandling:false};internals.stringify=function(obj,prefix,generateArrayPrefix,strictNullHandling,filter){if(typeof filter==="function"){obj=filter(prefix,obj)}else if(Utils.isBuffer(obj)){obj=obj.toString()}else if(obj instanceof Date){obj=obj.toISOString()}else if(obj===null){if(strictNullHandling){return Utils.encode(prefix)}obj=""}if(typeof obj==="string"||typeof obj==="number"||typeof obj==="boolean"){return[Utils.encode(prefix)+"="+Utils.encode(obj)]}var values=[];if(typeof obj==="undefined"){return values}var objKeys=Array.isArray(filter)?filter:Object.keys(obj);for(var i=0,il=objKeys.length;i<il;++i){var key=objKeys[i];if(Array.isArray(obj)){values=values.concat(internals.stringify(obj[key],generateArrayPrefix(prefix,key),generateArrayPrefix,strictNullHandling,filter))}else{values=values.concat(internals.stringify(obj[key],prefix+"["+key+"]",generateArrayPrefix,strictNullHandling,filter))}}return values};module.exports=function(obj,options){options=options||{};var delimiter=typeof options.delimiter==="undefined"?internals.delimiter:options.delimiter;var strictNullHandling=typeof options.strictNullHandling==="boolean"?options.strictNullHandling:internals.strictNullHandling;var objKeys;var filter;if(typeof options.filter==="function"){filter=options.filter;obj=filter("",obj)}else if(Array.isArray(options.filter)){objKeys=filter=options.filter}var keys=[];if(typeof obj!=="object"||obj===null){return""}var arrayFormat;if(options.arrayFormat in internals.arrayPrefixGenerators){arrayFormat=options.arrayFormat}else if("indices"in options){arrayFormat=options.indices?"indices":"repeat"}else{arrayFormat="indices"}var generateArrayPrefix=internals.arrayPrefixGenerators[arrayFormat];if(!objKeys){objKeys=Object.keys(obj)}for(var i=0,il=objKeys.length;i<il;++i){var key=objKeys[i];keys=keys.concat(internals.stringify(obj[key],key,generateArrayPrefix,strictNullHandling,filter))}return keys.join(delimiter)}},{"./utils":93}],93:[function(require,module,exports){var internals={};internals.hexTable=new Array(256);for(var h=0;h<256;++h){internals.hexTable[h]="%"+((h<16?"0":"")+h.toString(16)).toUpperCase()}exports.arrayToObject=function(source,options){var obj=options.plainObjects?Object.create(null):{};for(var i=0,il=source.length;i<il;++i){if(typeof source[i]!=="undefined"){obj[i]=source[i]}}return obj};exports.merge=function(target,source,options){if(!source){return target}if(typeof source!=="object"){if(Array.isArray(target)){target.push(source)}else if(typeof target==="object"){target[source]=true}else{target=[target,source]}return target}if(typeof target!=="object"){target=[target].concat(source);return target}if(Array.isArray(target)&&!Array.isArray(source)){target=exports.arrayToObject(target,options)}var keys=Object.keys(source);for(var k=0,kl=keys.length;k<kl;++k){var key=keys[k];var value=source[key];if(!Object.prototype.hasOwnProperty.call(target,key)){target[key]=value}else{target[key]=exports.merge(target[key],value,options)}}return target};exports.decode=function(str){try{return decodeURIComponent(str.replace(/\+/g," "))}catch(e){return str}};exports.encode=function(str){if(str.length===0){return str}if(typeof str!=="string"){str=""+str}var out="";for(var i=0,il=str.length;i<il;++i){var c=str.charCodeAt(i);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122){out+=str[i];continue}if(c<128){out+=internals.hexTable[c];continue}if(c<2048){out+=internals.hexTable[192|c>>6]+internals.hexTable[128|c&63];continue}if(c<55296||c>=57344){out+=internals.hexTable[224|c>>12]+internals.hexTable[128|c>>6&63]+internals.hexTable[128|c&63];continue}++i;c=65536+((c&1023)<<10|str.charCodeAt(i)&1023);out+=internals.hexTable[240|c>>18]+internals.hexTable[128|c>>12&63]+internals.hexTable[128|c>>6&63]+internals.hexTable[128|c&63]}return out};exports.compact=function(obj,refs){if(typeof obj!=="object"||obj===null){return obj}refs=refs||[];var lookup=refs.indexOf(obj);if(lookup!==-1){return refs[lookup]}refs.push(obj);if(Array.isArray(obj)){var compacted=[];for(var i=0,il=obj.length;i<il;++i){if(typeof obj[i]!=="undefined"){compacted.push(obj[i])}}return compacted}var keys=Object.keys(obj);for(i=0,il=keys.length;i<il;++i){var key=keys[i];obj[key]=exports.compact(obj[key],refs)}return obj};exports.isRegExp=function(obj){return Object.prototype.toString.call(obj)==="[object RegExp]"};exports.isBuffer=function(obj){if(obj===null||typeof obj==="undefined"){return false}return!!(obj.constructor&&obj.constructor.isBuffer&&obj.constructor.isBuffer(obj))}},{}],94:[function(require,module,exports){"use strict";var window=require("global/window");var once=require("once");var isFunction=require("is-function");var parseHeaders=require("parse-headers");var xtend=require("xtend");module.exports=createXHR;createXHR.XMLHttpRequest=window.XMLHttpRequest||noop;createXHR.XDomainRequest="withCredentials"in new createXHR.XMLHttpRequest?createXHR.XMLHttpRequest:window.XDomainRequest;forEachArray(["get","put","post","patch","head","delete"],function(method){createXHR[method==="delete"?"del":method]=function(uri,options,callback){options=initParams(uri,options,callback);options.method=method.toUpperCase();return _createXHR(options)}});function forEachArray(array,iterator){for(var i=0;i<array.length;i++){iterator(array[i])}}function isEmpty(obj){for(var i in obj){if(obj.hasOwnProperty(i))return false}return true}function initParams(uri,options,callback){var params=uri;if(isFunction(options)){callback=options;if(typeof uri==="string"){params={uri:uri}}}else{params=xtend(options,{uri:uri})}params.callback=callback;return params}function createXHR(uri,options,callback){options=initParams(uri,options,callback);return _createXHR(options)}function _createXHR(options){var callback=options.callback;if(typeof callback==="undefined"){throw new Error("callback argument missing")}callback=once(callback);function readystatechange(){if(xhr.readyState===4){loadFunc()}}function getBody(){var body=undefined;if(xhr.response){body=xhr.response}else if(xhr.responseType==="text"||!xhr.responseType){body=xhr.responseText||xhr.responseXML}if(isJson){try{body=JSON.parse(body)}catch(e){}}return body}var failureResponse={body:undefined,headers:{},statusCode:0,method:method,url:uri,rawRequest:xhr};function errorFunc(evt){clearTimeout(timeoutTimer);if(!(evt instanceof Error)){evt=new Error(""+(evt||"Unknown XMLHttpRequest Error"))}evt.statusCode=0;callback(evt,failureResponse)}function loadFunc(){if(aborted)return;var status;clearTimeout(timeoutTimer);if(options.useXDR&&xhr.status===undefined){status=200}else{status=xhr.status===1223?204:xhr.status}var response=failureResponse;var err=null;if(status!==0){response={body:getBody(),statusCode:status,method:method,headers:{},url:uri,rawRequest:xhr};if(xhr.getAllResponseHeaders){response.headers=parseHeaders(xhr.getAllResponseHeaders())}}else{err=new Error("Internal XMLHttpRequest Error")}callback(err,response,response.body)}var xhr=options.xhr||null;if(!xhr){if(options.cors||options.useXDR){xhr=new createXHR.XDomainRequest}else{xhr=new createXHR.XMLHttpRequest}}var key;var aborted;var uri=xhr.url=options.uri||options.url;var method=xhr.method=options.method||"GET";var body=options.body||options.data||null;var headers=xhr.headers=options.headers||{};var sync=!!options.sync;var isJson=false;var timeoutTimer;if("json"in options){isJson=true;headers["accept"]||headers["Accept"]||(headers["Accept"]="application/json");if(method!=="GET"&&method!=="HEAD"){headers["content-type"]||headers["Content-Type"]||(headers["Content-Type"]="application/json");body=JSON.stringify(options.json)}}xhr.onreadystatechange=readystatechange;xhr.onload=loadFunc;xhr.onerror=errorFunc;xhr.onprogress=function(){};xhr.ontimeout=errorFunc;xhr.open(method,uri,!sync,options.username,options.password);if(!sync){xhr.withCredentials=!!options.withCredentials}if(!sync&&options.timeout>0){timeoutTimer=setTimeout(function(){aborted=true;xhr.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT";errorFunc(e)},options.timeout)}if(xhr.setRequestHeader){for(key in headers){if(headers.hasOwnProperty(key)){xhr.setRequestHeader(key,headers[key])}}}else if(options.headers&&!isEmpty(options.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in options){xhr.responseType=options.responseType}if("beforeSend"in options&&typeof options.beforeSend==="function"){options.beforeSend(xhr)}xhr.send(body);return xhr}function noop(){}},{"global/window":95,"is-function":96,once:97,"parse-headers":100,xtend:101}],95:[function(require,module,exports){(function(global){if(typeof window!=="undefined"){module.exports=window}else if(typeof global!=="undefined"){module.exports=global}else if(typeof self!=="undefined"){module.exports=self}else{module.exports={}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],96:[function(require,module,exports){module.exports=isFunction;var toString=Object.prototype.toString;function isFunction(fn){var string=toString.call(fn);return string==="[object Function]"||typeof fn==="function"&&string!=="[object RegExp]"||typeof window!=="undefined"&&(fn===window.setTimeout||fn===window.alert||fn===window.confirm||fn===window.prompt)}},{}],97:[function(require,module,exports){module.exports=once;once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true})});function once(fn){var called=false;return function(){if(called)return;called=true;return fn.apply(this,arguments)}}},{}],98:[function(require,module,exports){var isFunction=require("is-function");module.exports=forEach;var toString=Object.prototype.toString;var hasOwnProperty=Object.prototype.hasOwnProperty;function forEach(list,iterator,context){if(!isFunction(iterator)){throw new TypeError("iterator must be a function")}if(arguments.length<3){context=this}if(toString.call(list)==="[object Array]")forEachArray(list,iterator,context);else if(typeof list==="string")forEachString(list,iterator,context);else forEachObject(list,iterator,context)}function forEachArray(array,iterator,context){for(var i=0,len=array.length;i<len;i++){if(hasOwnProperty.call(array,i)){iterator.call(context,array[i],i,array)}}}function forEachString(string,iterator,context){for(var i=0,len=string.length;i<len;i++){iterator.call(context,string.charAt(i),i,string)}}function forEachObject(object,iterator,context){for(var k in object){if(hasOwnProperty.call(object,k)){iterator.call(context,object[k],k,object)}}}},{"is-function":96}],99:[function(require,module,exports){exports=module.exports=trim;function trim(str){return str.replace(/^\s*|\s*$/g,"")}exports.left=function(str){return str.replace(/^\s*/,"")};exports.right=function(str){return str.replace(/\s*$/,"")}},{}],100:[function(require,module,exports){var trim=require("trim"),forEach=require("for-each"),isArray=function(arg){return Object.prototype.toString.call(arg)==="[object Array]"};module.exports=function(headers){if(!headers)return{};var result={};forEach(trim(headers).split("\n"),function(row){var index=row.indexOf(":"),key=trim(row.slice(0,index)).toLowerCase(),value=trim(row.slice(index+1));if(typeof result[key]==="undefined"){result[key]=value}else if(isArray(result[key])){result[key].push(value)}else{result[key]=[result[key],value]}});return result}},{"for-each":98,trim:99}],101:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target}},{}],102:[function(require,module,exports){var baseAssign=require("lodash._baseassign"),createAssigner=require("lodash._createassigner"),keys=require("lodash.keys");function assignWith(object,source,customizer){var index=-1,props=keys(source),length=props.length;while(++index<length){var key=props[index],value=object[key],result=customizer(value,source[key],key,object,source);if((result===result?result!==value:value===value)||value===undefined&&!(key in object)){
object[key]=result}}return object}var assign=createAssigner(function(object,source,customizer){return customizer?assignWith(object,source,customizer):baseAssign(object,source)});module.exports=assign},{"lodash._baseassign":103,"lodash._createassigner":105,"lodash.keys":109}],103:[function(require,module,exports){var baseCopy=require("lodash._basecopy"),keys=require("lodash.keys");function baseAssign(object,source){return source==null?object:baseCopy(source,keys(source),object)}module.exports=baseAssign},{"lodash._basecopy":104,"lodash.keys":109}],104:[function(require,module,exports){function baseCopy(source,props,object){object||(object={});var index=-1,length=props.length;while(++index<length){var key=props[index];object[key]=source[key]}return object}module.exports=baseCopy},{}],105:[function(require,module,exports){var bindCallback=require("lodash._bindcallback"),isIterateeCall=require("lodash._isiterateecall"),restParam=require("lodash.restparam");function createAssigner(assigner){return restParam(function(object,sources){var index=-1,length=object==null?0:sources.length,customizer=length>2?sources[length-2]:undefined,guard=length>2?sources[2]:undefined,thisArg=length>1?sources[length-1]:undefined;if(typeof customizer=="function"){customizer=bindCallback(customizer,thisArg,5);length-=2}else{customizer=typeof thisArg=="function"?thisArg:undefined;length-=customizer?1:0}if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1}while(++index<length){var source=sources[index];if(source){assigner(object,source,customizer)}}return object})}module.exports=createAssigner},{"lodash._bindcallback":106,"lodash._isiterateecall":107,"lodash.restparam":108}],106:[function(require,module,exports){module.exports=require(6)},{}],107:[function(require,module,exports){module.exports=require(35)},{}],108:[function(require,module,exports){module.exports=require(19)},{}],109:[function(require,module,exports){module.exports=require(9)},{"lodash._getnative":110,"lodash.isarguments":111,"lodash.isarray":112}],110:[function(require,module,exports){module.exports=require(10)},{}],111:[function(require,module,exports){module.exports=require(8)},{}],112:[function(require,module,exports){module.exports=require(39)},{}],113:[function(require,module,exports){var baseClone=require("lodash._baseclone"),bindCallback=require("lodash._bindcallback"),isIterateeCall=require("lodash._isiterateecall");function clone(value,isDeep,customizer,thisArg){if(isDeep&&typeof isDeep!="boolean"&&isIterateeCall(value,isDeep,customizer)){isDeep=false}else if(typeof isDeep=="function"){thisArg=customizer;customizer=isDeep;isDeep=false}return typeof customizer=="function"?baseClone(value,isDeep,bindCallback(customizer,thisArg,3)):baseClone(value,isDeep)}module.exports=clone},{"lodash._baseclone":114,"lodash._bindcallback":124,"lodash._isiterateecall":125}],114:[function(require,module,exports){(function(global){var arrayCopy=require("lodash._arraycopy"),arrayEach=require("lodash._arrayeach"),baseAssign=require("lodash._baseassign"),baseFor=require("lodash._basefor"),isArray=require("lodash.isarray"),keys=require("lodash.keys");var argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]";var arrayBufferTag="[object ArrayBuffer]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]";var reFlags=/\w*$/;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[stringTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=true;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[mapTag]=cloneableTags[setTag]=cloneableTags[weakMapTag]=false;var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var objToString=objectProto.toString;var ArrayBuffer=global.ArrayBuffer,Uint8Array=global.Uint8Array;function baseClone(value,isDeep,customizer,key,object,stackA,stackB){var result;if(customizer){result=object?customizer(value,key,object):customizer(value)}if(result!==undefined){return result}if(!isObject(value)){return value}var isArr=isArray(value);if(isArr){result=initCloneArray(value);if(!isDeep){return arrayCopy(value,result)}}else{var tag=objToString.call(value),isFunc=tag==funcTag;if(tag==objectTag||tag==argsTag||isFunc&&!object){result=initCloneObject(isFunc?{}:value);if(!isDeep){return baseAssign(result,value)}}else{return cloneableTags[tag]?initCloneByTag(value,tag,isDeep):object?value:{}}}stackA||(stackA=[]);stackB||(stackB=[]);var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}stackA.push(value);stackB.push(result);(isArr?arrayEach:baseForOwn)(value,function(subValue,key){result[key]=baseClone(subValue,isDeep,customizer,key,value,stackA,stackB)});return result}function baseForOwn(object,iteratee){return baseFor(object,iteratee,keys)}function bufferClone(buffer){var result=new ArrayBuffer(buffer.byteLength),view=new Uint8Array(result);view.set(new Uint8Array(buffer));return result}function initCloneArray(array){var length=array.length,result=new array.constructor(length);if(length&&typeof array[0]=="string"&&hasOwnProperty.call(array,"index")){result.index=array.index;result.input=array.input}return result}function initCloneObject(object){var Ctor=object.constructor;if(!(typeof Ctor=="function"&&Ctor instanceof Ctor)){Ctor=Object}return new Ctor}function initCloneByTag(object,tag,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return bufferClone(object);case boolTag:case dateTag:return new Ctor(+object);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:var buffer=object.buffer;return new Ctor(isDeep?bufferClone(buffer):buffer,object.byteOffset,object.length);case numberTag:case stringTag:return new Ctor(object);case regexpTag:var result=new Ctor(object.source,reFlags.exec(object));result.lastIndex=object.lastIndex}return result}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=baseClone}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"lodash._arraycopy":115,"lodash._arrayeach":116,"lodash._baseassign":117,"lodash._basefor":119,"lodash.isarray":120,"lodash.keys":121}],115:[function(require,module,exports){function arrayCopy(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index<length){array[index]=source[index]}return array}module.exports=arrayCopy},{}],116:[function(require,module,exports){module.exports=require(4)},{}],117:[function(require,module,exports){module.exports=require(103)},{"lodash._basecopy":118,"lodash.keys":121}],118:[function(require,module,exports){module.exports=require(104)},{}],119:[function(require,module,exports){module.exports=require(22)},{}],120:[function(require,module,exports){module.exports=require(39)},{}],121:[function(require,module,exports){module.exports=require(9)},{"lodash._getnative":122,"lodash.isarguments":123,"lodash.isarray":120}],122:[function(require,module,exports){module.exports=require(10)},{}],123:[function(require,module,exports){module.exports=require(8)},{}],124:[function(require,module,exports){module.exports=require(6)},{}],125:[function(require,module,exports){module.exports=require(35)},{}],126:[function(require,module,exports){function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=isObject},{}],127:[function(require,module,exports){var baseGet=require("lodash._baseget"),baseSlice=require("lodash._baseslice"),toPath=require("lodash._topath"),isArray=require("lodash.isarray"),isFunction=require("lodash.isfunction");var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(value,object){var type=typeof value;if(type=="string"&&reIsPlainProp.test(value)||type=="number"){return true}if(isArray(value)){return false}var result=!reIsDeepProp.test(value);return result||object!=null&&value in toObject(object)}function toObject(value){return isObject(value)?value:Object(value)}function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function result(object,path,defaultValue){var result=object==null?undefined:object[path];if(result===undefined){if(object!=null&&!isKey(path,object)){path=toPath(path);object=path.length==1?object:baseGet(object,baseSlice(path,0,-1));result=object==null?undefined:object[last(path)]}result=result===undefined?defaultValue:result}return isFunction(result)?result.call(object):result}module.exports=result},{"lodash._baseget":128,"lodash._baseslice":129,"lodash._topath":130,"lodash.isarray":131,"lodash.isfunction":132}],128:[function(require,module,exports){module.exports=require(28)},{}],129:[function(require,module,exports){module.exports=require(29)},{}],130:[function(require,module,exports){module.exports=require(30)},{"lodash.isarray":131}],131:[function(require,module,exports){module.exports=require(39)},{}],132:[function(require,module,exports){module.exports=require(48)},{}],"ampersand-model":[function(require,module,exports){if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-model"]=window.ampersand["ampersand-model"]||[];window.ampersand["ampersand-model"].push("6.0.2")}var State=require("ampersand-state");var sync=require("ampersand-sync");var assign=require("lodash.assign");var isObject=require("lodash.isobject");var clone=require("lodash.clone");var result=require("lodash.result");var urlError=function(){throw new Error('A "url" property or function must be specified')};var wrapError=function(model,options){var error=options.error;options.error=function(resp){if(error)error(model,resp,options);model.trigger("error",model,resp,options)}};var Model=State.extend({save:function(key,val,options){var attrs,method;if(key==null||typeof key==="object"){attrs=key;options=val}else{(attrs={})[key]=val}options=assign({validate:true},options);if(attrs&&!options.wait){if(!this.set(attrs,options))return false}else{if(!this._validate(attrs,options))return false}if(options.parse===void 0)options.parse=true;var model=this;var success=options.success;options.success=function(resp){var serverAttrs=model.parse(resp,options);if(options.wait)serverAttrs=assign(attrs||{},serverAttrs);if(isObject(serverAttrs)&&!model.set(serverAttrs,options)){return false}if(success)success(model,resp,options);model.trigger("sync",model,resp,options)};wrapError(this,options);method=this.isNew()?"create":options.patch?"patch":"update";if(method==="patch")options.attrs=attrs;if(options.wait&&method!=="patch")options.attrs=assign(model.serialize(),attrs);var sync=this.sync(method,this,options);options.xhr=sync;return sync},fetch:function(options){options=options?clone(options):{};if(options.parse===void 0)options.parse=true;var model=this;var success=options.success;options.success=function(resp){if(!model.set(model.parse(resp,options),options))return false;if(success)success(model,resp,options);model.trigger("sync",model,resp,options)};wrapError(this,options);var sync=this.sync("read",this,options);options.xhr=sync;return sync},destroy:function(options){options=options?clone(options):{};var model=this;var success=options.success;var destroy=function(){model.trigger("destroy",model,model.collection,options)};options.success=function(resp){if(options.wait||model.isNew())destroy();if(success)success(model,resp,options);if(!model.isNew())model.trigger("sync",model,resp,options)};if(this.isNew()){options.success();return false}wrapError(this,options);var sync=this.sync("delete",this,options);options.xhr=sync;if(!options.wait)destroy();return sync},sync:function(){return sync.apply(this,arguments)},url:function(){var base=result(this,"urlRoot")||result(this.collection,"url")||urlError();if(this.isNew())return base;return base+(base.charAt(base.length-1)==="/"?"":"/")+encodeURIComponent(this.getId())}});module.exports=Model},{"ampersand-state":1,"ampersand-sync":76,"lodash.assign":102,"lodash.clone":113,"lodash.isobject":126,"lodash.result":127}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-collection-view"]=window.ampersand["ampersand-collection-view"]||[];window.ampersand["ampersand-collection-view"].push("1.4.0")}var assign=require("lodash.assign");var invoke=require("lodash.invoke");var pick=require("lodash.pick");var find=require("lodash.find");var difference=require("lodash.difference");var Events=require("ampersand-events");var ampExtend=require("ampersand-class-extend");var options=["collection","el","viewOptions","view","emptyView","filter","reverse","parent"];function CollectionView(spec){if(!spec){throw new ReferenceError("Collection view missing required parameters: collection, el")}if(!spec.collection){throw new ReferenceError("Collection view requires a collection")}if(!spec.el&&!this.insertSelf){throw new ReferenceError("Collection view requires an el")}assign(this,pick(spec,options));this.views=[];this.listenTo(this.collection,"add",this._addViewForModel);this.listenTo(this.collection,"remove",this._removeViewForModel);this.listenTo(this.collection,"sort",this._rerenderAll);this.listenTo(this.collection,"refresh reset",this._reset)}assign(CollectionView.prototype,Events,{render:function(){this._renderAll();return this},remove:function(){invoke(this.views,"remove");this.stopListening()},_getViewByModel:function(model){return find(this.views,function(view){return model===view.model})},_createViewForModel:function(model,renderOpts){var defaultViewOptions={model:model,collection:this.collection,parent:this};var view=new this.view(assign(defaultViewOptions,this.viewOptions));this.views.push(view);view.renderedByParentView=true;view.render(renderOpts);return view},_getOrCreateByModel:function(model,renderOpts){return this._getViewByModel(model)||this._createViewForModel(model,renderOpts)},_addViewForModel:function(model,collection,options){var matches=this.filter?this.filter(model):true;if(!matches){return}if(this.renderedEmptyView){this.renderedEmptyView.remove();delete this.renderedEmptyView}var view=this._getOrCreateByModel(model,{containerEl:this.el});if(options&&options.rerender){this._insertView(view)}else{this._insertViewAtIndex(view)}},_insertViewAtIndex:function(view){if(!view.insertSelf){var pos=this.collection.indexOf(view.model);var modelToInsertBefore,viewToInsertBefore;if(this.reverse){modelToInsertBefore=this.collection.at(pos-1)}else{modelToInsertBefore=this.collection.at(pos+1)}viewToInsertBefore=this._getViewByModel(modelToInsertBefore);if(viewToInsertBefore){this.el.insertBefore(view.el,viewToInsertBefore&&viewToInsertBefore.el)}else{this.el.appendChild(view.el)}}},_insertView:function(view){if(!view.insertSelf){if(this.reverse&&this.el.firstChild){this.el.insertBefore(view.el,this.el.firstChild)}else{this.el.appendChild(view.el)}}},_removeViewForModel:function(model){var view=this._getViewByModel(model);if(!view){return}var index=this.views.indexOf(view);if(index!==-1){view=this.views.splice(index,1)[0];this._removeView(view);if(this.views.length===0){this._renderEmptyView()}}},_removeView:function(view){if(view.animateRemove){view.animateRemove()}else{view.remove()}},_renderAll:function(){this.collection.each(this._addViewForModel,this);if(this.views.length===0){this._renderEmptyView()}},_rerenderAll:function(collection,options){options=options||{};this.collection.each(function(model){this._addViewForModel(model,this,assign(options,{rerender:true}))},this)},_renderEmptyView:function(){if(this.emptyView&&!this.renderedEmptyView){var view=this.renderedEmptyView=new this.emptyView({parent:this});this.el.appendChild(view.render().el)}},_reset:function(){var newViews=this.collection.map(this._getOrCreateByModel,this);var toRemove=difference(this.views,newViews);toRemove.forEach(this._removeView,this);this.views=newViews;this._rerenderAll();if(this.views.length===0){this._renderEmptyView()}}});CollectionView.extend=ampExtend;module.exports=CollectionView},{"ampersand-class-extend":2,"ampersand-events":3,"lodash.assign":118,"lodash.difference":14,"lodash.find":24,"lodash.invoke":151,"lodash.pick":164}],2:[function(require,module,exports){var assign=require("lodash.assign");var extend=function(protoProps){var parent=this;var child;var args=[].slice.call(arguments);if(protoProps&&protoProps.hasOwnProperty("constructor")){child=protoProps.constructor}else{child=function(){return parent.apply(this,arguments)}}assign(child,parent);var Surrogate=function(){this.constructor=child};Surrogate.prototype=parent.prototype;child.prototype=new Surrogate;if(protoProps){args.unshift(child.prototype);assign.apply(null,args)}child.__super__=parent.prototype;return child};module.exports=extend},{"lodash.assign":118}],3:[function(require,module,exports){if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-events"]=window.ampersand["ampersand-events"]||[];window.ampersand["ampersand-events"].push("1.1.1")}var runOnce=require("lodash.once");var uniqueId=require("lodash.uniqueid");var keys=require("lodash.keys");var isEmpty=require("lodash.isempty");var each=require("lodash.foreach");var bind=require("lodash.bind");var assign=require("lodash.assign");var slice=Array.prototype.slice;var eventSplitter=/\s+/;var Events={on:function(name,callback,context){if(!eventsApi(this,"on",name,[callback,context])||!callback)return this;this._events||(this._events={});var events=this._events[name]||(this._events[name]=[]);events.push({callback:callback,context:context,ctx:context||this});return this},once:function(name,callback,context){if(!eventsApi(this,"once",name,[callback,context])||!callback)return this;var self=this;var once=runOnce(function(){self.off(name,once);callback.apply(this,arguments)});once._callback=callback;return this.on(name,once,context)},off:function(name,callback,context){var retain,ev,events,names,i,l,j,k;if(!this._events||!eventsApi(this,"off",name,[callback,context]))return this;if(!name&&!callback&&!context){this._events=void 0;return this}names=name?[name]:keys(this._events);for(i=0,l=names.length;i<l;i++){name=names[i];if(events=this._events[name]){this._events[name]=retain=[];if(callback||context){for(j=0,k=events.length;j<k;j++){ev=events[j];if(callback&&callback!==ev.callback&&callback!==ev.callback._callback||context&&context!==ev.context){retain.push(ev)}}}if(!retain.length)delete this._events[name]}}return this},trigger:function(name){if(!this._events)return this;var args=slice.call(arguments,1);if(!eventsApi(this,"trigger",name,args))return this;var events=this._events[name];var allEvents=this._events.all;if(events)triggerEvents(events,args);if(allEvents)triggerEvents(allEvents,arguments);return this},stopListening:function(obj,name,callback){var listeningTo=this._listeningTo;if(!listeningTo)return this;var remove=!name&&!callback;if(!callback&&typeof name==="object")callback=this;if(obj)(listeningTo={})[obj._listenId]=obj;for(var id in listeningTo){obj=listeningTo[id];obj.off(name,callback,this);if(remove||isEmpty(obj._events))delete this._listeningTo[id]}return this},createEmitter:function(obj){return assign(obj||{},Events)}};Events.bind=Events.on;Events.unbind=Events.off;var eventsApi=function(obj,action,name,rest){if(!name)return true;if(typeof name==="object"){for(var key in name){obj[action].apply(obj,[key,name[key]].concat(rest))}return false}if(eventSplitter.test(name)){var names=name.split(eventSplitter);for(var i=0,l=names.length;i<l;i++){obj[action].apply(obj,[names[i]].concat(rest))}return false}return true};var triggerEvents=function(events,args){var ev;var i=-1;var l=events.length;var a1=args[0];var a2=args[1];var a3=args[2];switch(args.length){case 0:while(++i<l)(ev=events[i]).callback.call(ev.ctx);return;case 1:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1);return;case 2:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1,a2);return;case 3:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1,a2,a3);return;default:while(++i<l)(ev=events[i]).callback.apply(ev.ctx,args);return}};var listenMethods={listenTo:"on",listenToOnce:"once"};each(listenMethods,function(implementation,method){Events[method]=function(obj,name,callback,run){var listeningTo=this._listeningTo||(this._listeningTo={});var id=obj._listenId||(obj._listenId=uniqueId("l"));listeningTo[id]=obj;if(!callback&&typeof name==="object")callback=this;obj[implementation](name,callback,this);return this}});Events.listenToAndRun=function(obj,name,callback){Events.listenTo.apply(this,arguments);if(!callback&&typeof name==="object")callback=this;callback.apply(this);return this};module.exports=Events},{"lodash.assign":118,"lodash.bind":129,"lodash.foreach":139,"lodash.isempty":4,"lodash.keys":8,"lodash.once":12,"lodash.uniqueid":182}],4:[function(require,module,exports){var isArguments=require("lodash.isarguments"),isArray=require("lodash.isarray"),isFunction=require("lodash.isfunction"),isString=require("lodash.isstring"),keys=require("lodash.keys");function isObjectLike(value){return!!value&&typeof value=="object"}var MAX_SAFE_INTEGER=9007199254740991;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArrayLike(value){return value!=null&&isLength(getLength(value))}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isEmpty(value){if(value==null){return true}if(isArrayLike(value)&&(isArray(value)||isString(value)||isArguments(value)||isObjectLike(value)&&isFunction(value.splice))){return!value.length}return!keys(value).length}module.exports=isEmpty},{"lodash.isarguments":5,"lodash.isarray":6,"lodash.isfunction":7,"lodash.isstring":162,"lodash.keys":8}],5:[function(require,module,exports){var MAX_SAFE_INTEGER=9007199254740991;var argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]";var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var objectToString=objectProto.toString;var propertyIsEnumerable=objectProto.propertyIsEnumerable;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}function isArrayLike(value){return value!=null&&!(typeof value=="function"&&isFunction(value))&&isLength(getLength(value))}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function isObjectLike(value){return!!value&&typeof value=="object"}module.exports=isArguments},{}],6:[function(require,module,exports){var arrayTag="[object Array]",funcTag="[object Function]";var reIsHostCtor=/^\[object .+?Constructor\]$/;function isObjectLike(value){return!!value&&typeof value=="object"}var objectProto=Object.prototype;var fnToString=Function.prototype.toString;var hasOwnProperty=objectProto.hasOwnProperty;var objToString=objectProto.toString;var reIsNative=RegExp("^"+fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var nativeIsArray=getNative(Array,"isArray");var MAX_SAFE_INTEGER=9007199254740991;function getNative(object,key){var value=object==null?undefined:object[key];return isNative(value)?value:undefined}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}var isArray=nativeIsArray||function(value){return isObjectLike(value)&&isLength(value.length)&&objToString.call(value)==arrayTag};function isFunction(value){return isObject(value)&&objToString.call(value)==funcTag}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function isNative(value){if(value==null){return false}if(isFunction(value)){return reIsNative.test(fnToString.call(value))}return isObjectLike(value)&&reIsHostCtor.test(value)}module.exports=isArray},{}],7:[function(require,module,exports){var funcTag="[object Function]",genTag="[object GeneratorFunction]";var objectProto=Object.prototype;var objectToString=objectProto.toString;function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=isFunction},{}],8:[function(require,module,exports){var getNative=require("lodash._getnative"),isArguments=require("lodash.isarguments"),isArray=require("lodash.isarray");var reIsUint=/^\d+$/;var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var nativeKeys=getNative(Object,"keys");var MAX_SAFE_INTEGER=9007199254740991;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArrayLike(value){return value!=null&&isLength(getLength(value))}function isIndex(value,length){value=typeof value=="number"||reIsUint.test(value)?+value:-1;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function shimKeys(object){var props=keysIn(object),propsLength=props.length,length=propsLength&&object.length;var allowIndexes=!!length&&isLength(length)&&(isArray(object)||isArguments(object));var index=-1,result=[];while(++index<propsLength){var key=props[index];if(allowIndexes&&isIndex(key,length)||hasOwnProperty.call(object,key)){result.push(key)}}return result}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}var keys=!nativeKeys?shimKeys:function(object){var Ctor=object==null?undefined:object.constructor;if(typeof Ctor=="function"&&Ctor.prototype===object||typeof object!="function"&&isArrayLike(object)){return shimKeys(object)}return isObject(object)?nativeKeys(object):[]};function keysIn(object){if(object==null){return[]}if(!isObject(object)){object=Object(object)}var length=object.length;length=length&&isLength(length)&&(isArray(object)||isArguments(object))&&length||0;var Ctor=object.constructor,index=-1,isProto=typeof Ctor=="function"&&Ctor.prototype===object,result=Array(length),skipIndexes=length>0;while(++index<length){result[index]=index+""}for(var key in object){if(!(skipIndexes&&isIndex(key,length))&&!(key=="constructor"&&(isProto||!hasOwnProperty.call(object,key)))){result.push(key)}}return result}module.exports=keys},{"lodash._getnative":9,"lodash.isarguments":10,"lodash.isarray":11}],9:[function(require,module,exports){var funcTag="[object Function]";var reIsHostCtor=/^\[object .+?Constructor\]$/;function isObjectLike(value){return!!value&&typeof value=="object"}var objectProto=Object.prototype;var fnToString=Function.prototype.toString;var hasOwnProperty=objectProto.hasOwnProperty;var objToString=objectProto.toString;var reIsNative=RegExp("^"+fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function getNative(object,key){var value=object==null?undefined:object[key];return isNative(value)?value:undefined}function isFunction(value){return isObject(value)&&objToString.call(value)==funcTag}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function isNative(value){if(value==null){return false}if(isFunction(value)){return reIsNative.test(fnToString.call(value))}return isObjectLike(value)&&reIsHostCtor.test(value)}module.exports=getNative},{}],10:[function(require,module,exports){module.exports=require(5)},{}],11:[function(require,module,exports){module.exports=require(6)},{}],12:[function(require,module,exports){var before=require("lodash.before");function once(func){return before(2,func)}module.exports=once},{"lodash.before":13}],13:[function(require,module,exports){var FUNC_ERROR_TEXT="Expected a function";function before(n,func){var result;if(typeof func!="function"){if(typeof n=="function"){var temp=n;n=func;func=temp}else{throw new TypeError(FUNC_ERROR_TEXT)}}return function(){if(--n>0){result=func.apply(this,arguments)}if(n<=1){func=undefined}return result}}module.exports=before},{}],14:[function(require,module,exports){var baseDifference=require("lodash._basedifference"),baseFlatten=require("lodash._baseflatten"),restParam=require("lodash.restparam");function isObjectLike(value){return!!value&&typeof value=="object"}var MAX_SAFE_INTEGER=9007199254740991;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArrayLike(value){return value!=null&&isLength(getLength(value))}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}var difference=restParam(function(array,values){return isObjectLike(array)&&isArrayLike(array)?baseDifference(array,baseFlatten(values,false,true)):[]});module.exports=difference},{"lodash._basedifference":15,"lodash._baseflatten":20,"lodash.restparam":23}],15:[function(require,module,exports){var baseIndexOf=require("lodash._baseindexof"),cacheIndexOf=require("lodash._cacheindexof"),createCache=require("lodash._createcache");var LARGE_ARRAY_SIZE=200;function baseDifference(array,values){var length=array?array.length:0,result=[];if(!length){return result}var index=-1,indexOf=baseIndexOf,isCommon=true,cache=isCommon&&values.length>=LARGE_ARRAY_SIZE?createCache(values):null,valuesLength=values.length;if(cache){indexOf=cacheIndexOf;isCommon=false;values=cache}outer:while(++index<length){var value=array[index];if(isCommon&&value===value){var valuesIndex=valuesLength;while(valuesIndex--){if(values[valuesIndex]===value){continue outer}}result.push(value)}else if(indexOf(values,value,0)<0){result.push(value)}}return result}module.exports=baseDifference},{"lodash._baseindexof":16,"lodash._cacheindexof":17,"lodash._createcache":18}],16:[function(require,module,exports){
function baseIndexOf(array,value,fromIndex){if(value!==value){return indexOfNaN(array,fromIndex)}var index=fromIndex-1,length=array.length;while(++index<length){if(array[index]===value){return index}}return-1}function indexOfNaN(array,fromIndex,fromRight){var length=array.length,index=fromIndex+(fromRight?0:-1);while(fromRight?index--:++index<length){var other=array[index];if(other!==other){return index}}return-1}module.exports=baseIndexOf},{}],17:[function(require,module,exports){function cacheIndexOf(cache,value){var data=cache.data,result=typeof value=="string"||isObject(value)?data.set.has(value):data.hash[value];return result?0:-1}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=cacheIndexOf},{}],18:[function(require,module,exports){(function(global){var getNative=require("lodash._getnative");var Set=getNative(global,"Set");var nativeCreate=getNative(Object,"create");function SetCache(values){var length=values?values.length:0;this.data={hash:nativeCreate(null),set:new Set};while(length--){this.push(values[length])}}function cachePush(value){var data=this.data;if(typeof value=="string"||isObject(value)){data.set.add(value)}else{data.hash[value]=true}}function createCache(values){return nativeCreate&&Set?new SetCache(values):null}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}SetCache.prototype.push=cachePush;module.exports=createCache}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"lodash._getnative":19}],19:[function(require,module,exports){module.exports=require(9)},{}],20:[function(require,module,exports){var isArguments=require("lodash.isarguments"),isArray=require("lodash.isarray");function isObjectLike(value){return!!value&&typeof value=="object"}var MAX_SAFE_INTEGER=9007199254740991;function arrayPush(array,values){var index=-1,length=values.length,offset=array.length;while(++index<length){array[offset+index]=values[index]}return array}function baseFlatten(array,isDeep,isStrict,result){result||(result=[]);var index=-1,length=array.length;while(++index<length){var value=array[index];if(isObjectLike(value)&&isArrayLike(value)&&(isStrict||isArray(value)||isArguments(value))){if(isDeep){baseFlatten(value,isDeep,isStrict,result)}else{arrayPush(result,value)}}else if(!isStrict){result[result.length]=value}}return result}function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArrayLike(value){return value!=null&&isLength(getLength(value))}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}module.exports=baseFlatten},{"lodash.isarguments":21,"lodash.isarray":22}],21:[function(require,module,exports){module.exports=require(5)},{}],22:[function(require,module,exports){module.exports=require(6)},{}],23:[function(require,module,exports){var FUNC_ERROR_TEXT="Expected a function";var nativeMax=Math.max;function restParam(func,start){if(typeof func!="function"){throw new TypeError(FUNC_ERROR_TEXT)}start=nativeMax(start===undefined?func.length-1:+start||0,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),rest=Array(length);while(++index<length){rest[index]=args[start+index]}switch(start){case 0:return func.call(this,rest);case 1:return func.call(this,args[0],rest);case 2:return func.call(this,args[0],args[1],rest)}var otherArgs=Array(start+1);index=-1;while(++index<start){otherArgs[index]=args[index]}otherArgs[start]=rest;return func.apply(this,otherArgs)}}module.exports=restParam},{}],24:[function(require,module,exports){var baseCallback=require("lodash._basecallback"),baseEach=require("lodash._baseeach"),baseFind=require("lodash._basefind"),baseFindIndex=require("lodash._basefindindex"),isArray=require("lodash.isarray");function createFind(eachFunc,fromRight){return function(collection,predicate,thisArg){predicate=baseCallback(predicate,thisArg,3);if(isArray(collection)){var index=baseFindIndex(collection,predicate,fromRight);return index>-1?collection[index]:undefined}return baseFind(collection,predicate,eachFunc)}}var find=createFind(baseEach);module.exports=find},{"lodash._basecallback":25,"lodash._baseeach":30,"lodash._basefind":31,"lodash._basefindindex":32,"lodash.isarray":33}],25:[function(require,module,exports){var baseIsEqual=require("lodash._baseisequal"),bindCallback=require("lodash._bindcallback"),isArray=require("lodash.isarray"),pairs=require("lodash.pairs");var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;var reEscapeChar=/\\(\\)?/g;function baseToString(value){return value==null?"":value+""}function baseCallback(func,thisArg,argCount){var type=typeof func;if(type=="function"){return thisArg===undefined?func:bindCallback(func,thisArg,argCount)}if(func==null){return identity}if(type=="object"){return baseMatches(func)}return thisArg===undefined?property(func):baseMatchesProperty(func,thisArg)}function baseGet(object,path,pathKey){if(object==null){return}if(pathKey!==undefined&&pathKey in toObject(object)){path=[pathKey]}var index=0,length=path.length;while(object!=null&&index<length){object=object[path[index++]]}return index&&index==length?object:undefined}function baseIsMatch(object,matchData,customizer){var index=matchData.length,length=index,noCustomizer=!customizer;if(object==null){return!length}object=toObject(object);while(index--){var data=matchData[index];if(noCustomizer&&data[2]?data[1]!==object[data[0]]:!(data[0]in object)){return false}}while(++index<length){data=matchData[index];var key=data[0],objValue=object[key],srcValue=data[1];if(noCustomizer&&data[2]){if(objValue===undefined&&!(key in object)){return false}}else{var result=customizer?customizer(objValue,srcValue,key):undefined;if(!(result===undefined?baseIsEqual(srcValue,objValue,customizer,true):result)){return false}}}return true}function baseMatches(source){var matchData=getMatchData(source);if(matchData.length==1&&matchData[0][2]){var key=matchData[0][0],value=matchData[0][1];return function(object){if(object==null){return false}return object[key]===value&&(value!==undefined||key in toObject(object))}}return function(object){return baseIsMatch(object,matchData)}}function baseMatchesProperty(path,srcValue){var isArr=isArray(path),isCommon=isKey(path)&&isStrictComparable(srcValue),pathKey=path+"";path=toPath(path);return function(object){if(object==null){return false}var key=pathKey;object=toObject(object);if((isArr||!isCommon)&&!(key in object)){object=path.length==1?object:baseGet(object,baseSlice(path,0,-1));if(object==null){return false}key=last(path);object=toObject(object)}return object[key]===srcValue?srcValue!==undefined||key in object:baseIsEqual(srcValue,object[key],undefined,true)}}function baseProperty(key){return function(object){return object==null?undefined:object[key]}}function basePropertyDeep(path){var pathKey=path+"";path=toPath(path);return function(object){return baseGet(object,path,pathKey)}}function baseSlice(array,start,end){var index=-1,length=array.length;start=start==null?0:+start||0;if(start<0){start=-start>length?0:length+start}end=end===undefined||end>length?length:+end||0;if(end<0){end+=length}length=start>end?0:end-start>>>0;start>>>=0;var result=Array(length);while(++index<length){result[index]=array[index+start]}return result}function getMatchData(object){var result=pairs(object),length=result.length;while(length--){result[length][2]=isStrictComparable(result[length][1])}return result}function isKey(value,object){var type=typeof value;if(type=="string"&&reIsPlainProp.test(value)||type=="number"){return true}if(isArray(value)){return false}var result=!reIsDeepProp.test(value);return result||object!=null&&value in toObject(object)}function isStrictComparable(value){return value===value&&!isObject(value)}function toObject(value){return isObject(value)?value:Object(value)}function toPath(value){if(isArray(value)){return value}var result=[];baseToString(value).replace(rePropName,function(match,number,quote,string){result.push(quote?string.replace(reEscapeChar,"$1"):number||match)});return result}function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function identity(value){return value}function property(path){return isKey(path)?baseProperty(path):basePropertyDeep(path)}module.exports=baseCallback},{"lodash._baseisequal":26,"lodash._bindcallback":28,"lodash.isarray":33,"lodash.pairs":29}],26:[function(require,module,exports){var isArray=require("lodash.isarray"),isTypedArray=require("lodash.istypedarray"),keys=require("lodash.keys");var argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",stringTag="[object String]";function isObjectLike(value){return!!value&&typeof value=="object"}var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var objToString=objectProto.toString;function arraySome(array,predicate){var index=-1,length=array.length;while(++index<length){if(predicate(array[index],index,array)){return true}}return false}function baseIsEqual(value,other,customizer,isLoose,stackA,stackB){if(value===other){return true}if(value==null||other==null||!isObject(value)&&!isObjectLike(other)){return value!==value&&other!==other}return baseIsEqualDeep(value,other,baseIsEqual,customizer,isLoose,stackA,stackB)}function baseIsEqualDeep(object,other,equalFunc,customizer,isLoose,stackA,stackB){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=arrayTag,othTag=arrayTag;if(!objIsArr){objTag=objToString.call(object);if(objTag==argsTag){objTag=objectTag}else if(objTag!=objectTag){objIsArr=isTypedArray(object)}}if(!othIsArr){othTag=objToString.call(other);if(othTag==argsTag){othTag=objectTag}else if(othTag!=objectTag){othIsArr=isTypedArray(other)}}var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&!(objIsArr||objIsObj)){return equalByTag(object,other,objTag)}if(!isLoose){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){return equalFunc(objIsWrapped?object.value():object,othIsWrapped?other.value():other,customizer,isLoose,stackA,stackB)}}if(!isSameTag){return false}stackA||(stackA=[]);stackB||(stackB=[]);var length=stackA.length;while(length--){if(stackA[length]==object){return stackB[length]==other}}stackA.push(object);stackB.push(other);var result=(objIsArr?equalArrays:equalObjects)(object,other,equalFunc,customizer,isLoose,stackA,stackB);stackA.pop();stackB.pop();return result}function equalArrays(array,other,equalFunc,customizer,isLoose,stackA,stackB){var index=-1,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isLoose&&othLength>arrLength)){return false}while(++index<arrLength){var arrValue=array[index],othValue=other[index],result=customizer?customizer(isLoose?othValue:arrValue,isLoose?arrValue:othValue,index):undefined;if(result!==undefined){if(result){continue}return false}if(isLoose){if(!arraySome(other,function(othValue){return arrValue===othValue||equalFunc(arrValue,othValue,customizer,isLoose,stackA,stackB)})){return false}}else if(!(arrValue===othValue||equalFunc(arrValue,othValue,customizer,isLoose,stackA,stackB))){return false}}return true}function equalByTag(object,other,tag){switch(tag){case boolTag:case dateTag:return+object==+other;case errorTag:return object.name==other.name&&object.message==other.message;case numberTag:return object!=+object?other!=+other:object==+other;case regexpTag:case stringTag:return object==other+""}return false}function equalObjects(object,other,equalFunc,customizer,isLoose,stackA,stackB){var objProps=keys(object),objLength=objProps.length,othProps=keys(other),othLength=othProps.length;if(objLength!=othLength&&!isLoose){return false}var index=objLength;while(index--){var key=objProps[index];if(!(isLoose?key in other:hasOwnProperty.call(other,key))){return false}}var skipCtor=isLoose;while(++index<objLength){key=objProps[index];var objValue=object[key],othValue=other[key],result=customizer?customizer(isLoose?othValue:objValue,isLoose?objValue:othValue,key):undefined;if(!(result===undefined?equalFunc(objValue,othValue,customizer,isLoose,stackA,stackB):result)){return false}skipCtor||(skipCtor=key=="constructor")}if(!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;if(objCtor!=othCtor&&("constructor"in object&&"constructor"in other)&&!(typeof objCtor=="function"&&objCtor instanceof objCtor&&typeof othCtor=="function"&&othCtor instanceof othCtor)){return false}}return true}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=baseIsEqual},{"lodash.isarray":33,"lodash.istypedarray":27,"lodash.keys":34}],27:[function(require,module,exports){var MAX_SAFE_INTEGER=9007199254740991;var argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]";var arrayBufferTag="[object ArrayBuffer]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]";var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;var objectProto=Object.prototype;var objectToString=objectProto.toString;function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObjectLike(value){return!!value&&typeof value=="object"}function isTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[objectToString.call(value)]}module.exports=isTypedArray},{}],28:[function(require,module,exports){function bindCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(thisArg===undefined){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)};case 5:return function(value,other,key,object,source){return func.call(thisArg,value,other,key,object,source)}}return function(){return func.apply(thisArg,arguments)}}function identity(value){return value}module.exports=bindCallback},{}],29:[function(require,module,exports){var keys=require("lodash.keys");function toObject(value){return isObject(value)?value:Object(value)}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function pairs(object){object=toObject(object);var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}module.exports=pairs},{"lodash.keys":34}],30:[function(require,module,exports){var keys=require("lodash.keys");var MAX_SAFE_INTEGER=9007199254740991;var baseEach=createBaseEach(baseForOwn);var baseFor=createBaseFor();function baseForOwn(object,iteratee){return baseFor(object,iteratee,keys)}function baseProperty(key){return function(object){return object==null?undefined:object[key]}}function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){var length=collection?getLength(collection):0;if(!isLength(length)){return eachFunc(collection,iteratee)}var index=fromRight?length:-1,iterable=toObject(collection);while(fromRight?index--:++index<length){if(iteratee(iterable[index],index,iterable)===false){break}}return collection}}function createBaseFor(fromRight){return function(object,iteratee,keysFunc){var iterable=toObject(object),props=keysFunc(object),length=props.length,index=fromRight?length:-1;while(fromRight?index--:++index<length){var key=props[index];if(iteratee(iterable[key],key,iterable)===false){break}}return object}}var getLength=baseProperty("length");function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function toObject(value){return isObject(value)?value:Object(value)}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=baseEach},{"lodash.keys":34}],31:[function(require,module,exports){function baseFind(collection,predicate,eachFunc,retKey){var result;eachFunc(collection,function(value,key,collection){if(predicate(value,key,collection)){result=retKey?key:value;return false}});return result}module.exports=baseFind},{}],32:[function(require,module,exports){function baseFindIndex(array,predicate,fromRight){var length=array.length,index=fromRight?length:-1;while(fromRight?index--:++index<length){if(predicate(array[index],index,array)){return index}}return-1}module.exports=baseFindIndex},{}],33:[function(require,module,exports){module.exports=require(6)},{}],34:[function(require,module,exports){module.exports=require(8)},{"lodash._getnative":35,"lodash.isarguments":36,"lodash.isarray":33}],35:[function(require,module,exports){module.exports=require(9)},{}],36:[function(require,module,exports){module.exports=require(5)},{}],37:[function(require,module,exports){if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-dom-bindings"]=window.ampersand["ampersand-dom-bindings"]||[];window.ampersand["ampersand-dom-bindings"].push("3.8.0")}var Store=require("key-tree-store");var dom=require("ampersand-dom");var matchesSelector=require("matches-selector");var partial=require("lodash.partial");var slice=Array.prototype.slice;function getMatches(el,selector){if(selector==="")return[el];var matches=[];if(matchesSelector(el,selector))matches.push(el);return matches.concat(slice.call(el.querySelectorAll(selector)))}function setAttributes(el,attrs){for(var name in attrs){dom.setAttribute(el,name,attrs[name])}}function removeAttributes(el,attrs){for(var name in attrs){dom.removeAttribute(el,name)}}function makeArray(val){return Array.isArray(val)?val:[val]}function switchHandler(binding,el,value){var showValue=binding.cases[value];for(var item in binding.cases){var curValue=binding.cases[item];if(value!==item&&curValue!==showValue){getMatches(el,curValue).forEach(function(match){dom.hide(match)})}}getMatches(el,showValue).forEach(function(match){dom.show(match)})}function getSelector(binding){if(typeof binding.selector==="string"){return binding.selector}else if(binding.hook){return'[data-hook~="'+binding.hook+'"]'}else{return""}}function getBindingFunc(binding,context){var type=binding.type||"text";var isCustomBinding=typeof type==="function";var selector=getSelector(binding);var yes=binding.yes;var no=binding.no;var hasYesNo=!!(yes||no);var previousValue;if(isCustomBinding){return function(el,value){getMatches(el,selector).forEach(function(match){type.call(context,match,value,previousValue)});previousValue=value}}else if(type==="text"){return function(el,value){getMatches(el,selector).forEach(function(match){dom.text(match,value)})}}else if(type==="class"){return function(el,value){getMatches(el,selector).forEach(function(match){dom.switchClass(match,previousValue,value)});previousValue=value}}else if(type==="attribute"){if(!binding.name)throw Error('attribute bindings must have a "name"');return function(el,value){var names=makeArray(binding.name);getMatches(el,selector).forEach(function(match){names.forEach(function(name){dom.setAttribute(match,name,value)})});previousValue=value}}else if(type==="value"){return function(el,value){getMatches(el,selector).forEach(function(match){if(!value&&value!==0)value="";if(document.activeElement!==match)match.value=value});previousValue=value}}else if(type==="booleanClass"){if(hasYesNo){yes=makeArray(yes||"");no=makeArray(no||"");return function(el,value){var prevClass=value?no:yes;var newClass=value?yes:no;getMatches(el,selector).forEach(function(match){prevClass.forEach(function(pc){dom.removeClass(match,pc)});newClass.forEach(function(nc){dom.addClass(match,nc)})})}}else{return function(el,value,keyName){var name=makeArray(binding.name||keyName);var invert=binding.invert||false;value=invert?value?false:true:value;getMatches(el,selector).forEach(function(match){name.forEach(function(className){dom[value?"addClass":"removeClass"](match,className)})})}}}else if(type==="booleanAttribute"){if(hasYesNo){yes=makeArray(yes||"");no=makeArray(no||"");return function(el,value){var prevAttribute=value?no:yes;var newAttribute=value?yes:no;getMatches(el,selector).forEach(function(match){prevAttribute.forEach(function(pa){if(pa){dom.removeAttribute(match,pa)}});newAttribute.forEach(function(na){if(na){dom.addAttribute(match,na)}})})}}else{return function(el,value,keyName){var name=makeArray(binding.name||keyName);var invert=binding.invert||false;value=invert?value?false:true:value;getMatches(el,selector).forEach(function(match){name.forEach(function(attr){dom[value?"addAttribute":"removeAttribute"](match,attr)})})}}}else if(type==="toggle"){var mode=binding.mode||"display";var invert=binding.invert||false;if(hasYesNo){return function(el,value){getMatches(el,yes).forEach(function(match){dom[value?"show":"hide"](match,mode)});getMatches(el,no).forEach(function(match){dom[value?"hide":"show"](match,mode)})}}else{return function(el,value){value=invert?value?false:true:value;getMatches(el,selector).forEach(function(match){dom[value?"show":"hide"](match,mode)})}}}else if(type==="switch"){if(!binding.cases)throw Error('switch bindings must have "cases"');return partial(switchHandler,binding)}else if(type==="innerHTML"){return function(el,value){getMatches(el,selector).forEach(function(match){dom.html(match,value)})}}else if(type==="switchClass"){if(!binding.cases)throw Error('switchClass bindings must have "cases"');return function(el,value,keyName){var name=makeArray(binding.name||keyName);for(var item in binding.cases){getMatches(el,binding.cases[item]).forEach(function(match){name.forEach(function(className){dom[value===item?"addClass":"removeClass"](match,className)})})}}}else if(type==="switchAttribute"){if(!binding.cases)throw Error('switchAttribute bindings must have "cases"');return function(el,value,keyName){getMatches(el,selector).forEach(function(match){if(previousValue){removeAttributes(match,previousValue)}if(value in binding.cases){var attrs=binding.cases[value];if(typeof attrs==="string"){attrs={};attrs[binding.name||keyName]=binding.cases[value]}setAttributes(match,attrs);previousValue=attrs}})}}else{throw new Error("no such binding type: "+type)}}module.exports=function(bindings,context){var store=new Store;var key,current;for(key in bindings){current=bindings[key];if(typeof current==="string"){store.add(key,getBindingFunc({type:"text",selector:current}))}else if(current.forEach){current.forEach(function(binding){store.add(key,getBindingFunc(binding,context))})}else{store.add(key,getBindingFunc(current,context))}}return store}},{"ampersand-dom":38,"key-tree-store":39,"lodash.partial":40,"matches-selector":184}],38:[function(require,module,exports){if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-dom"]=window.ampersand["ampersand-dom"]||[];window.ampersand["ampersand-dom"].push("1.5.0")}var dom=module.exports={text:function(el,val){el.textContent=getString(val)},addClass:function(el,cls){cls=getString(cls);if(!cls)return;if(Array.isArray(cls)){cls.forEach(function(c){dom.addClass(el,c)})}else if(el.classList){el.classList.add(cls)}else{if(!hasClass(el,cls)){if(el.classList){el.classList.add(cls)}else{el.className+=" "+cls}}}},removeClass:function(el,cls){if(Array.isArray(cls)){cls.forEach(function(c){dom.removeClass(el,c)})}else if(el.classList){cls=getString(cls);if(cls)el.classList.remove(cls)}else{el.className=el.className.replace(new RegExp("(^|\\b)"+cls.split(" ").join("|")+"(\\b|$)","gi")," ")}},hasClass:hasClass,switchClass:function(el,prevCls,newCls){if(prevCls)this.removeClass(el,prevCls);this.addClass(el,newCls)},addAttribute:function(el,attr){el.setAttribute(attr,"");if(hasBooleanProperty(el,attr))el[attr]=true},removeAttribute:function(el,attr){el.removeAttribute(attr);if(hasBooleanProperty(el,attr))el[attr]=false},setAttribute:function(el,attr,value){el.setAttribute(attr,getString(value))},getAttribute:function(el,attr){return el.getAttribute(attr)},hasAttribute:function(el,attr){return el.hasAttribute(attr)},hide:function(el,mode){if(!mode)mode="display";if(!isHidden(el)){storeDisplayStyle(el,mode);hide(el,mode)}},show:function(el,mode){if(!mode)mode="display";show(el,mode)},toggle:function(el,mode){if(!isHidden(el)){dom.hide(el,mode)}else{dom.show(el,mode)}},html:function(el,content){el.innerHTML=content}};function getString(val){if(!val&&val!==0){return""}else{return val}}function hasClass(el,cls){if(el.classList){return el.classList.contains(cls)}else{return new RegExp("(^| )"+cls+"( |$)","gi").test(el.className)}}function hasBooleanProperty(el,prop){var val=el[prop];return prop in el&&(val===true||val===false)}function isHidden(el){return dom.getAttribute(el,"data-anddom-hidden")==="true"}function storeDisplayStyle(el,mode){dom.setAttribute(el,"data-anddom-"+mode,el.style[mode])}function show(el,mode){el.style[mode]=dom.getAttribute(el,"data-anddom-"+mode)||"";dom.removeAttribute(el,"data-anddom-hidden")}function hide(el,mode){dom.setAttribute(el,"data-anddom-hidden","true");el.style[mode]=mode==="visibility"?"hidden":"none"}},{}],39:[function(require,module,exports){var slice=Array.prototype.slice;function KeyTreeStore(options){options=options||{};if(typeof options!=="object"){throw new TypeError("Options must be an object")}var DEFAULT_SEPARATOR=".";this.storage={};this.separator=options.separator||DEFAULT_SEPARATOR}KeyTreeStore.prototype.add=function(keypath,obj){var arr=this.storage[keypath]||(this.storage[keypath]=[]);arr.push(obj)};KeyTreeStore.prototype.remove=function(obj){var path,arr;for(path in this.storage){arr=this.storage[path];arr.some(function(item,index){if(item===obj){arr.splice(index,1);return true}})}};KeyTreeStore.prototype.get=function(keypath){var res=[];var key;for(key in this.storage){if(!keypath||keypath===key||key.indexOf(keypath+this.separator)===0){res=res.concat(this.storage[key])}}return res};KeyTreeStore.prototype.getGrouped=function(keypath){var res={};var key;for(key in this.storage){if(!keypath||keypath===key||key.indexOf(keypath+this.separator)===0){res[key]=slice.call(this.storage[key])}}return res};KeyTreeStore.prototype.getAll=function(keypath){var res={};var key;for(key in this.storage){if(keypath===key||key.indexOf(keypath+this.separator)===0){res[key]=slice.call(this.storage[key])}}return res};KeyTreeStore.prototype.run=function(keypath,context){var args=slice.call(arguments,2);this.get(keypath).forEach(function(fn){fn.apply(context||this,args)})};module.exports=KeyTreeStore},{}],40:[function(require,module,exports){var createWrapper=require("lodash._createwrapper"),replaceHolders=require("lodash._replaceholders"),restParam=require("lodash.restparam");var PARTIAL_FLAG=32;function createPartial(flag){var partialFunc=restParam(function(func,partials){var holders=replaceHolders(partials,partialFunc.placeholder);return createWrapper(func,flag,undefined,partials,holders)});return partialFunc}var partial=createPartial(PARTIAL_FLAG);partial.placeholder={};module.exports=partial},{"lodash._createwrapper":41,"lodash._replaceholders":43,"lodash.restparam":44}],41:[function(require,module,exports){var root=require("lodash._root");var BIND_FLAG=1,BIND_KEY_FLAG=2,CURRY_BOUND_FLAG=4,CURRY_FLAG=8,CURRY_RIGHT_FLAG=16,PARTIAL_FLAG=32,PARTIAL_RIGHT_FLAG=64,ARY_FLAG=128,FLIP_FLAG=512;var FUNC_ERROR_TEXT="Expected a function";var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=0/0;var PLACEHOLDER="__lodash_placeholder__";var funcTag="[object Function]",genTag="[object GeneratorFunction]";var reTrim=/^\s+|\s+$/g;var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;var reIsBinary=/^0b[01]+$/i;var reIsOctal=/^0o[0-7]+$/i;var reIsUint=/^(?:0|[1-9]\d*)$/;var freeParseInt=parseInt;function apply(func,thisArg,args){var length=args.length;switch(length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function isIndex(value,length){value=typeof value=="number"||reIsUint.test(value)?+value:-1;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=-1,result=[];while(++index<length){if(array[index]===placeholder){array[index]=PLACEHOLDER;result[++resIndex]=index}}return result}var objectProto=Object.prototype;var objectToString=objectProto.toString;var nativeMax=Math.max,nativeMin=Math.min;var baseCreate=function(){function object(){}return function(prototype){if(isObject(prototype)){object.prototype=prototype;var result=new object;object.prototype=undefined}return result||{}}}();function composeArgs(args,partials,holders){var holdersLength=holders.length,argsIndex=-1,argsLength=nativeMax(args.length-holdersLength,0),leftIndex=-1,leftLength=partials.length,result=Array(leftLength+argsLength);while(++leftIndex<leftLength){result[leftIndex]=partials[leftIndex]}while(++argsIndex<holdersLength){result[holders[argsIndex]]=args[argsIndex]}while(argsLength--){result[leftIndex++]=args[argsIndex++]}return result}function composeArgsRight(args,partials,holders){var holdersIndex=-1,holdersLength=holders.length,argsIndex=-1,argsLength=nativeMax(args.length-holdersLength,0),rightIndex=-1,rightLength=partials.length,result=Array(argsLength+rightLength);while(++argsIndex<argsLength){result[argsIndex]=args[argsIndex]}var offset=argsIndex;while(++rightIndex<rightLength){result[offset+rightIndex]=partials[rightIndex]}while(++holdersIndex<holdersLength){result[offset+holders[holdersIndex]]=args[argsIndex++]}return result}function copyArray(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index<length){array[index]=source[index]}return array}function createBaseWrapper(func,bitmask,thisArg){var isBind=bitmask&BIND_FLAG,Ctor=createCtorWrapper(func);function wrapper(){var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return fn.apply(isBind?thisArg:this,arguments)}return wrapper}function createCtorWrapper(Ctor){return function(){var args=arguments;switch(args.length){case 0:return new Ctor;case 1:return new Ctor(args[0]);case 2:return new Ctor(args[0],args[1]);case 3:return new Ctor(args[0],args[1],args[2]);case 4:return new Ctor(args[0],args[1],args[2],args[3]);
case 5:return new Ctor(args[0],args[1],args[2],args[3],args[4]);case 6:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5]);case 7:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5],args[6])}var thisBinding=baseCreate(Ctor.prototype),result=Ctor.apply(thisBinding,args);return isObject(result)?result:thisBinding}}function createCurryWrapper(func,bitmask,arity){var Ctor=createCtorWrapper(func);function wrapper(){var length=arguments.length,index=length,args=Array(length),fn=this&&this!==root&&this instanceof wrapper?Ctor:func,placeholder=wrapper.placeholder;while(index--){args[index]=arguments[index]}var holders=length<3&&args[0]!==placeholder&&args[length-1]!==placeholder?[]:replaceHolders(args,placeholder);length-=holders.length;return length<arity?createRecurryWrapper(func,bitmask,createHybridWrapper,placeholder,undefined,args,holders,undefined,undefined,arity-length):apply(fn,this,args)}return wrapper}function createHybridWrapper(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){var isAry=bitmask&ARY_FLAG,isBind=bitmask&BIND_FLAG,isBindKey=bitmask&BIND_KEY_FLAG,isCurry=bitmask&CURRY_FLAG,isCurryRight=bitmask&CURRY_RIGHT_FLAG,isFlip=bitmask&FLIP_FLAG,Ctor=isBindKey?undefined:createCtorWrapper(func);function wrapper(){var length=arguments.length,index=length,args=Array(length);while(index--){args[index]=arguments[index]}if(partials){args=composeArgs(args,partials,holders)}if(partialsRight){args=composeArgsRight(args,partialsRight,holdersRight)}if(isCurry||isCurryRight){var placeholder=wrapper.placeholder,argsHolders=replaceHolders(args,placeholder);length-=argsHolders.length;if(length<arity){return createRecurryWrapper(func,bitmask,createHybridWrapper,placeholder,thisArg,args,argsHolders,argPos,ary,arity-length)}}var thisBinding=isBind?thisArg:this,fn=isBindKey?thisBinding[func]:func;if(argPos){args=reorder(args,argPos)}else if(isFlip&&args.length>1){args.reverse()}if(isAry&&ary<args.length){args.length=ary}if(this&&this!==root&&this instanceof wrapper){fn=Ctor||createCtorWrapper(fn)}return fn.apply(thisBinding,args)}return wrapper}function createPartialWrapper(func,bitmask,thisArg,partials){var isBind=bitmask&BIND_FLAG,Ctor=createCtorWrapper(func);function wrapper(){var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength),fn=this&&this!==root&&this instanceof wrapper?Ctor:func;while(++leftIndex<leftLength){args[leftIndex]=partials[leftIndex]}while(argsLength--){args[leftIndex++]=arguments[++argsIndex]}return apply(fn,isBind?thisArg:this,args)}return wrapper}function createRecurryWrapper(func,bitmask,wrapFunc,placeholder,thisArg,partials,holders,argPos,ary,arity){var isCurry=bitmask&CURRY_FLAG,newArgPos=argPos?copyArray(argPos):undefined,newsHolders=isCurry?holders:undefined,newHoldersRight=isCurry?undefined:holders,newPartials=isCurry?partials:undefined,newPartialsRight=isCurry?undefined:partials;bitmask|=isCurry?PARTIAL_FLAG:PARTIAL_RIGHT_FLAG;bitmask&=~(isCurry?PARTIAL_RIGHT_FLAG:PARTIAL_FLAG);if(!(bitmask&CURRY_BOUND_FLAG)){bitmask&=~(BIND_FLAG|BIND_KEY_FLAG)}var result=wrapFunc(func,bitmask,thisArg,newPartials,newsHolders,newPartialsRight,newHoldersRight,newArgPos,ary,arity);result.placeholder=placeholder;return result}function createWrapper(func,bitmask,thisArg,partials,holders,argPos,ary,arity){var isBindKey=bitmask&BIND_KEY_FLAG;if(!isBindKey&&typeof func!="function"){throw new TypeError(FUNC_ERROR_TEXT)}var length=partials?partials.length:0;if(!length){bitmask&=~(PARTIAL_FLAG|PARTIAL_RIGHT_FLAG);partials=holders=undefined}ary=ary===undefined?ary:nativeMax(toInteger(ary),0);arity=arity===undefined?arity:toInteger(arity);length-=holders?holders.length:0;if(bitmask&PARTIAL_RIGHT_FLAG){var partialsRight=partials,holdersRight=holders;partials=holders=undefined}var newData=[func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity];func=newData[0];bitmask=newData[1];thisArg=newData[2];partials=newData[3];holders=newData[4];arity=newData[9]=newData[9]==null?isBindKey?0:func.length:nativeMax(newData[9]-length,0);if(!arity&&bitmask&(CURRY_FLAG|CURRY_RIGHT_FLAG)){bitmask&=~(CURRY_FLAG|CURRY_RIGHT_FLAG)}if(!bitmask||bitmask==BIND_FLAG){var result=createBaseWrapper(func,bitmask,thisArg)}else if(bitmask==CURRY_FLAG||bitmask==CURRY_RIGHT_FLAG){result=createCurryWrapper(func,bitmask,arity)}else if((bitmask==PARTIAL_FLAG||bitmask==(BIND_FLAG|PARTIAL_FLAG))&&!holders.length){result=createPartialWrapper(func,bitmask,thisArg,partials)}else{result=createHybridWrapper.apply(undefined,newData)}return result}function reorder(array,indexes){var arrLength=array.length,length=nativeMin(indexes.length,arrLength),oldArray=copyArray(array);while(length--){var index=indexes[length];array[length]=isIndex(index,arrLength)?oldArray[index]:undefined}return array}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function toInteger(value){if(!value){return value===0?value:0}value=toNumber(value);if(value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER}var remainder=value%1;return value===value?remainder?value-remainder:value:0}function toNumber(value){if(isObject(value)){var other=isFunction(value.valueOf)?value.valueOf():value;value=isObject(other)?other+"":other}if(typeof value!="string"){return value===0?value:+value}value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}module.exports=createWrapper},{"lodash._root":42}],42:[function(require,module,exports){(function(global){var objectTypes={"function":true,object:true};var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType?exports:null;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType?module:null;var freeGlobal=checkGlobal(freeExports&&freeModule&&typeof global=="object"&&global);var freeSelf=checkGlobal(objectTypes[typeof self]&&self);var freeWindow=checkGlobal(objectTypes[typeof window]&&window);var thisGlobal=checkGlobal(objectTypes[typeof this]&&this);var root=freeGlobal||freeWindow!==(thisGlobal&&thisGlobal.window)&&freeWindow||freeSelf||thisGlobal||Function("return this")();function checkGlobal(value){return value&&value.Object===Object?value:null}module.exports=root}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],43:[function(require,module,exports){var PLACEHOLDER="__lodash_placeholder__";function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=-1,result=[];while(++index<length){if(array[index]===placeholder){array[index]=PLACEHOLDER;result[++resIndex]=index}}return result}module.exports=replaceHolders},{}],44:[function(require,module,exports){module.exports=require(23)},{}],45:[function(require,module,exports){"use strict";if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-state"]=window.ampersand["ampersand-state"]||[];window.ampersand["ampersand-state"].push("4.9.1")}var uniqueId=require("lodash.uniqueid");var assign=require("lodash.assign");var cloneObj=function(obj){return assign({},obj)};var omit=require("lodash.omit");var escape=require("lodash.escape");var forOwn=require("lodash.forown");var includes=require("lodash.includes");var isString=require("lodash.isstring");var isObject=require("lodash.isobject");var isDate=require("lodash.isdate");var isFunction=require("lodash.isfunction");var _isEqual=require("lodash.isequal");var has=require("lodash.has");var result=require("lodash.result");var bind=require("lodash.bind");var union=require("lodash.union");var Events=require("ampersand-events");var KeyTree=require("key-tree-store");var arrayNext=require("array-next");var changeRE=/^change:/;var noop=function(){};function Base(attrs,options){options||(options={});this.cid||(this.cid=uniqueId("state"));this._events={};this._values={};this._definition=Object.create(this._definition);if(options.parse)attrs=this.parse(attrs,options);this.parent=options.parent;this.collection=options.collection;this._keyTree=new KeyTree;this._initCollections();this._initChildren();this._cache={};this._previousAttributes={};if(attrs)this.set(attrs,assign({silent:true,initial:true},options));this._changed={};if(this._derived)this._initDerived();if(options.init!==false)this.initialize.apply(this,arguments)}assign(Base.prototype,Events,{extraProperties:"ignore",idAttribute:"id",namespaceAttribute:"namespace",typeAttribute:"modelType",initialize:function(){return this},getId:function(){return this[this.idAttribute]},getNamespace:function(){return this[this.namespaceAttribute]},getType:function(){return this[this.typeAttribute]},isNew:function(){return this.getId()==null},escape:function(attr){return escape(this.get(attr))},isValid:function(options){return this._validate({},assign(options||{},{validate:true}))},parse:function(resp,options){return resp},serialize:function(options){var attrOpts=assign({props:true},options);var res=this.getAttributes(attrOpts,true);forOwn(this._children,function(value,key){res[key]=this[key].serialize()},this);forOwn(this._collections,function(value,key){res[key]=this[key].serialize()},this);return res},set:function(key,value,options){var self=this;var extraProperties=this.extraProperties;var wasChanging,changeEvents,newType,newVal,def,cast,err,attr,attrs,dataType,silent,unset,currentVal,initial,hasChanged,isEqual,onChange;if(isObject(key)||key===null){attrs=key;options=value}else{attrs={};attrs[key]=value}options=options||{};if(!this._validate(attrs,options))return false;unset=options.unset;silent=options.silent;initial=options.initial;wasChanging=this._changing;this._changing=true;changeEvents=[];if(initial){this._previousAttributes={}}else if(!wasChanging){this._previousAttributes=this.attributes;this._changed={}}for(var i=0,keys=Object.keys(attrs),len=keys.length;i<len;i++){attr=keys[i];newVal=attrs[attr];newType=typeof newVal;currentVal=this._values[attr];def=this._definition[attr];if(!def){if(this._children[attr]||this._collections[attr]){if(!isObject(newVal)){newVal={}}this[attr].set(newVal,options);continue}else if(extraProperties==="ignore"){continue}else if(extraProperties==="reject"){throw new TypeError('No "'+attr+'" property defined on '+(this.type||"this")+' model and extraProperties not set to "ignore" or "allow"')}else if(extraProperties==="allow"){def=this._createPropertyDefinition(attr,"any")}else if(extraProperties){throw new TypeError('Invalid value for extraProperties: "'+extraProperties+'"')}}isEqual=this._getCompareForType(def.type);onChange=this._getOnChangeForType(def.type);dataType=this._dataTypes[def.type];if(dataType&&dataType.set){cast=dataType.set(newVal);newVal=cast.val;newType=cast.type}if(def.test){err=def.test.call(this,newVal,newType);if(err){throw new TypeError("Property '"+attr+"' failed validation with error: "+err)}}if(newVal===undefined&&def.required){throw new TypeError("Required property '"+attr+"' must be of type "+def.type+". Tried to set "+newVal)}if(newVal===null&&def.required&&!def.allowNull){throw new TypeError("Property '"+attr+"' must be of type "+def.type+" (cannot be null). Tried to set "+newVal)}if(def.type&&def.type!=="any"&&def.type!==newType&&newVal!==null&&newVal!==undefined){throw new TypeError("Property '"+attr+"' must be of type "+def.type+". Tried to set "+newVal)}if(def.values&&!includes(def.values,newVal)){var defaultValue=result(def,"default");if(unset&&defaultValue!==undefined){newVal=defaultValue}else if(!unset||unset&&newVal!==undefined){throw new TypeError("Property '"+attr+"' must be one of values: "+def.values.join(", ")+". Tried to set "+newVal)}}hasChanged=initial||!isEqual(currentVal,newVal,attr);if(def.setOnce&&currentVal!==undefined&&hasChanged){throw new TypeError("Property '"+attr+"' can only be set once.")}if(hasChanged){onChange(newVal,currentVal,attr);if(!initial){this._changed[attr]=newVal;this._previousAttributes[attr]=currentVal;if(unset){delete this._values[attr]}if(!silent){changeEvents.push({prev:currentVal,val:newVal,key:attr})}}if(!unset){this._values[attr]=newVal}}else{delete this._changed[attr]}}if(changeEvents.length)this._pending=true;changeEvents.forEach(function(change){self.trigger("change:"+change.key,self,change.val,options)});if(wasChanging)return this;while(this._pending){this._pending=false;this.trigger("change",this,options)}this._pending=false;this._changing=false;return this},get:function(attr){return this[attr]},toggle:function(property){var def=this._definition[property];if(def.type==="boolean"){this[property]=!this[property]}else if(def&&def.values){this[property]=arrayNext(def.values,this[property])}else{throw new TypeError("Can only toggle properties that are type `boolean` or have `values` array.")}return this},previousAttributes:function(){return cloneObj(this._previousAttributes)},hasChanged:function(attr){if(attr==null)return!!Object.keys(this._changed).length;if(has(this._derived,attr)){return this._derived[attr].depList.some(function(dep){return this.hasChanged(dep)},this)}return has(this._changed,attr)},changedAttributes:function(diff){if(!diff)return this.hasChanged()?cloneObj(this._changed):false;var val,changed=false;var old=this._changing?this._previousAttributes:this.attributes;var def,isEqual;for(var attr in diff){def=this._definition[attr];if(!def)continue;isEqual=this._getCompareForType(def.type);if(isEqual(old[attr],val=diff[attr]))continue;(changed||(changed={}))[attr]=val}return changed},toJSON:function(){return this.serialize()},unset:function(attrs,options){var self=this;attrs=Array.isArray(attrs)?attrs:[attrs];attrs.forEach(function(key){var def=self._definition[key];if(!def)return;var val;if(def.required){val=result(def,"default");return self.set(key,val,options)}else{return self.set(key,val,assign({},options,{unset:true}))}})},clear:function(options){var self=this;Object.keys(this.attributes).forEach(function(key){self.unset(key,options)});return this},previous:function(attr){if(attr==null||!Object.keys(this._previousAttributes).length)return null;return this._previousAttributes[attr]},_getDefaultForType:function(type){var dataType=this._dataTypes[type];return dataType&&dataType["default"]},_getCompareForType:function(type){var dataType=this._dataTypes[type];if(dataType&&dataType.compare)return bind(dataType.compare,this);return _isEqual},_getOnChangeForType:function(type){var dataType=this._dataTypes[type];if(dataType&&dataType.onChange)return bind(dataType.onChange,this);return noop},_validate:function(attrs,options){if(!options.validate||!this.validate)return true;attrs=assign({},this.attributes,attrs);var error=this.validationError=this.validate(attrs,options)||null;if(!error)return true;this.trigger("invalid",this,error,assign(options||{},{validationError:error}));return false},_createPropertyDefinition:function(name,desc,isSession){return createPropertyDefinition(this,name,desc,isSession)},_ensureValidType:function(type){return includes(["string","number","boolean","array","object","date","state","any"].concat(Object.keys(this._dataTypes)),type)?type:undefined},getAttributes:function(options,raw){options=assign({session:false,props:false,derived:false},options||{});var res={};var val,def;for(var item in this._definition){def=this._definition[item];if(options.session&&def.session||options.props&&!def.session){val=raw?this._values[item]:this[item];if(raw&&val&&isFunction(val.serialize))val=val.serialize();if(typeof val==="undefined")val=result(def,"default");if(typeof val!=="undefined")res[item]=val}}if(options.derived){for(var derivedItem in this._derived)res[derivedItem]=this[derivedItem]}return res},_initDerived:function(){var self=this;forOwn(this._derived,function(value,name){var def=self._derived[name];def.deps=def.depList;var update=function(options){options=options||{};var newVal=def.fn.call(self);if(self._cache[name]!==newVal||!def.cache){if(def.cache){self._previousAttributes[name]=self._cache[name]}self._cache[name]=newVal;self.trigger("change:"+name,self,self._cache[name])}};def.deps.forEach(function(propString){self._keyTree.add(propString,update)})});this.on("all",function(eventName){if(changeRE.test(eventName)){self._keyTree.get(eventName.split(":")[1]).forEach(function(fn){fn()})}},this)},_getDerivedProperty:function(name,flushCache){if(this._derived[name].cache){if(flushCache||!this._cache.hasOwnProperty(name)){this._cache[name]=this._derived[name].fn.apply(this)}return this._cache[name]}else{return this._derived[name].fn.apply(this)}},_initCollections:function(){var coll;if(!this._collections)return;for(coll in this._collections){this._safeSet(coll,new this._collections[coll](null,{parent:this}))}},_initChildren:function(){var child;if(!this._children)return;for(child in this._children){this._safeSet(child,new this._children[child]({},{parent:this}));this.listenTo(this[child],"all",this._getEventBubblingHandler(child))}},_getEventBubblingHandler:function(propertyName){return bind(function(name,model,newValue){if(changeRE.test(name)){this.trigger("change:"+propertyName+"."+name.split(":")[1],model,newValue)}else if(name==="change"){this.trigger("change",this)}},this)},_verifyRequired:function(){var attrs=this.attributes;for(var def in this._definition){if(this._definition[def].required&&typeof attrs[def]==="undefined"){return false}}return true},_safeSet:function safeSet(property,value){if(property in this){throw new Error("Encountered namespace collision while setting instance property `"+property+"`")}this[property]=value;return this}});Object.defineProperties(Base.prototype,{attributes:{get:function(){return this.getAttributes({props:true,session:true})}},all:{get:function(){return this.getAttributes({session:true,props:true,derived:true})}},isState:{get:function(){return true},set:function(){}}});function createPropertyDefinition(object,name,desc,isSession){var def=object._definition[name]={};var type,descArray;if(isString(desc)){type=object._ensureValidType(desc);if(type)def.type=type}else{if(Array.isArray(desc)){descArray=desc;desc={type:descArray[0],required:descArray[1],"default":descArray[2]}}type=object._ensureValidType(desc.type);if(type)def.type=type;if(desc.required)def.required=true;if(desc["default"]&&typeof desc["default"]==="object"){throw new TypeError("The default value for "+name+" cannot be an object/array, must be a value or a function which returns a value/object/array")}def["default"]=desc["default"];def.allowNull=desc.allowNull?desc.allowNull:false;if(desc.setOnce)def.setOnce=true;if(def.required&&def["default"]===undefined&&!def.setOnce)def["default"]=object._getDefaultForType(type);def.test=desc.test;def.values=desc.values}if(isSession)def.session=true;if(!type){type=isString(desc)?desc:desc.type;console.warn("Invalid data type of `"+type+"` for `"+name+"` property. Use one of the default types or define your own")}Object.defineProperty(object,name,{set:function(val){this.set(name,val)},get:function(){if(!this._values){throw Error('You may be trying to `extend` a state object with "'+name+'" which has been defined in `props` on the object being extended')}var value=this._values[name];var typeDef=this._dataTypes[def.type];if(typeof value!=="undefined"){if(typeDef&&typeDef.get){value=typeDef.get(value)}return value}var defaultValue=result(def,"default");this._values[name]=defaultValue;if(typeof defaultValue!=="undefined"){var onChange=this._getOnChangeForType(def.type);onChange(defaultValue,value,name)}return defaultValue}});return def}function createDerivedProperty(modelProto,name,definition){var def=modelProto._derived[name]={fn:isFunction(definition)?definition:definition.fn,cache:definition.cache!==false,depList:definition.deps||[]};def.depList.forEach(function(dep){modelProto._deps[dep]=union(modelProto._deps[dep]||[],[name])});Object.defineProperty(modelProto,name,{get:function(){return this._getDerivedProperty(name)},set:function(){throw new TypeError("`"+name+"` is a derived property, it can't be set directly.")}})}var dataTypes={string:{"default":function(){return""}},date:{set:function(newVal){var newType;if(newVal==null){newType=typeof null}else if(!isDate(newVal)){var err=null;var dateVal=new Date(newVal).valueOf();if(isNaN(dateVal)){dateVal=new Date(parseInt(newVal,10)).valueOf();if(isNaN(dateVal))err=true}newVal=dateVal;newType="date";if(err){newType=typeof newVal}}else{newType="date";newVal=newVal.valueOf()}return{val:newVal,type:newType}},get:function(val){if(val==null){return val}return new Date(val)},"default":function(){return new Date}},array:{set:function(newVal){return{val:newVal,type:Array.isArray(newVal)?"array":typeof newVal}},"default":function(){return[]}},object:{set:function(newVal){var newType=typeof newVal;if(newType!=="object"&&newVal===undefined){newVal=null;newType="object"}return{val:newVal,type:newType}},"default":function(){return{}}},state:{set:function(newVal){var isInstance=newVal instanceof Base||newVal&&newVal.isState;if(isInstance){return{val:newVal,type:"state"}}else{return{val:newVal,type:typeof newVal}}},compare:function(currentVal,newVal){return currentVal===newVal},onChange:function(newVal,previousVal,attributeName){if(previousVal){this.stopListening(previousVal)}if(newVal!=null){this.listenTo(newVal,"all",this._getEventBubblingHandler(attributeName))}}}};function extend(protoProps){var parent=this;var child;if(protoProps&&protoProps.hasOwnProperty("constructor")){child=protoProps.constructor}else{child=function(){return parent.apply(this,arguments)}}assign(child,parent);var Surrogate=function(){this.constructor=child};Surrogate.prototype=parent.prototype;child.prototype=new Surrogate;child.prototype._derived=assign({},parent.prototype._derived);child.prototype._deps=assign({},parent.prototype._deps);child.prototype._definition=assign({},parent.prototype._definition);child.prototype._collections=assign({},parent.prototype._collections);child.prototype._children=assign({},parent.prototype._children);child.prototype._dataTypes=assign({},parent.prototype._dataTypes||dataTypes);if(protoProps){var omitFromExtend=["dataTypes","props","session","derived","collections","children"];for(var i=0;i<arguments.length;i++){var def=arguments[i];if(def.dataTypes){forOwn(def.dataTypes,function(def,name){child.prototype._dataTypes[name]=def})}if(def.props){forOwn(def.props,function(def,name){createPropertyDefinition(child.prototype,name,def)})}if(def.session){forOwn(def.session,function(def,name){createPropertyDefinition(child.prototype,name,def,true)})}if(def.derived){forOwn(def.derived,function(def,name){createDerivedProperty(child.prototype,name,def)})}if(def.collections){forOwn(def.collections,function(constructor,name){child.prototype._collections[name]=constructor})}if(def.children){forOwn(def.children,function(constructor,name){child.prototype._children[name]=constructor})}assign(child.prototype,omit(def,omitFromExtend))}}child.__super__=parent.prototype;return child}Base.extend=extend;module.exports=Base},{"ampersand-events":46,"array-next":54,"key-tree-store":55,"lodash.assign":118,"lodash.bind":129,"lodash.escape":56,"lodash.forown":58,"lodash.has":64,"lodash.includes":69,"lodash.isdate":77,"lodash.isequal":78,"lodash.isfunction":85,"lodash.isobject":86,"lodash.isstring":162,"lodash.omit":87,"lodash.result":176,"lodash.union":103,"lodash.uniqueid":182}],46:[function(require,module,exports){module.exports=require(3)},{"lodash.assign":118,"lodash.bind":129,"lodash.foreach":139,"lodash.isempty":47,"lodash.keys":49,"lodash.once":52,"lodash.uniqueid":182}],47:[function(require,module,exports){module.exports=require(4)},{"lodash.isarguments":48,"lodash.isarray":76,"lodash.isfunction":85,"lodash.isstring":162,"lodash.keys":49}],48:[function(require,module,exports){module.exports=require(5)},{}],49:[function(require,module,exports){module.exports=require(8)},{"lodash._getnative":50,"lodash.isarguments":51,"lodash.isarray":76}],50:[function(require,module,exports){module.exports=require(9)},{}],51:[function(require,module,exports){module.exports=require(5)},{}],52:[function(require,module,exports){module.exports=require(12)},{"lodash.before":53}],53:[function(require,module,exports){module.exports=require(13)},{}],54:[function(require,module,exports){module.exports=function arrayNext(array,currentItem){var len=array.length;var newIndex=array.indexOf(currentItem)+1;if(newIndex>len-1)newIndex=0;return array[newIndex]}},{}],55:[function(require,module,exports){module.exports=require(39)},{}],56:[function(require,module,exports){var root=require("lodash._root");var INFINITY=1/0;var symbolTag="[object Symbol]";var reUnescapedHtml=/[&<>"'`]/g,reHasUnescapedHtml=RegExp(reUnescapedHtml.source);var htmlEscapes={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"};function escapeHtmlChar(chr){return htmlEscapes[chr]}var objectProto=Object.prototype;var objectToString=objectProto.toString;var Symbol=root.Symbol;var symbolProto=Symbol?Symbol.prototype:undefined,symbolToString=Symbol?symbolProto.toString:undefined;function isObjectLike(value){return!!value&&typeof value=="object"}function isSymbol(value){return typeof value=="symbol"||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){if(typeof value=="string"){return value}if(value==null){return""}if(isSymbol(value)){return Symbol?symbolToString.call(value):""}var result=value+"";return result=="0"&&1/value==-INFINITY?"-0":result}function escape(string){string=toString(string);return string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string}module.exports=escape},{"lodash._root":57}],57:[function(require,module,exports){module.exports=require(42)},{}],58:[function(require,module,exports){var baseFor=require("lodash._basefor"),bindCallback=require("lodash._bindcallback"),keys=require("lodash.keys");function baseForOwn(object,iteratee){return baseFor(object,iteratee,keys)}function createForOwn(objectFunc){return function(object,iteratee,thisArg){if(typeof iteratee!="function"||thisArg!==undefined){iteratee=bindCallback(iteratee,thisArg,3)}return objectFunc(object,iteratee)}}var forOwn=createForOwn(baseForOwn);module.exports=forOwn},{"lodash._basefor":59,"lodash._bindcallback":60,"lodash.keys":61}],59:[function(require,module,exports){var baseFor=createBaseFor();function createBaseFor(fromRight){return function(object,iteratee,keysFunc){var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;while(length--){var key=props[fromRight?length:++index];if(iteratee(iterable[key],key,iterable)===false){break}}return object}}module.exports=baseFor},{}],60:[function(require,module,exports){module.exports=require(28)},{}],61:[function(require,module,exports){module.exports=require(8)},{"lodash._getnative":62,"lodash.isarguments":63,"lodash.isarray":76}],62:[function(require,module,exports){module.exports=require(9)},{}],63:[function(require,module,exports){module.exports=require(5)},{}],64:[function(require,module,exports){var baseGet=require("lodash._baseget"),baseSlice=require("lodash._baseslice"),toPath=require("lodash._topath"),isArguments=require("lodash.isarguments"),isArray=require("lodash.isarray");var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;var reIsUint=/^\d+$/;var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var MAX_SAFE_INTEGER=9007199254740991;function isIndex(value,length){value=typeof value=="number"||reIsUint.test(value)?+value:-1;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function isKey(value,object){var type=typeof value;if(type=="string"&&reIsPlainProp.test(value)||type=="number"){return true}if(isArray(value)){return false}var result=!reIsDeepProp.test(value);return result||object!=null&&value in toObject(object)}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function toObject(value){return isObject(value)?value:Object(value)}function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function has(object,path){if(object==null){return false}var result=hasOwnProperty.call(object,path);if(!result&&!isKey(path)){path=toPath(path);object=path.length==1?object:baseGet(object,baseSlice(path,0,-1));if(object==null){return false}path=last(path);result=hasOwnProperty.call(object,path)}return result||isLength(object.length)&&isIndex(path,object.length)&&(isArray(object)||isArguments(object))}module.exports=has},{"lodash._baseget":65,"lodash._baseslice":66,"lodash._topath":67,"lodash.isarguments":68,"lodash.isarray":76}],65:[function(require,module,exports){function baseGet(object,path,pathKey){if(object==null){return}if(pathKey!==undefined&&pathKey in toObject(object)){path=[pathKey]}var index=0,length=path.length;while(object!=null&&index<length){object=object[path[index++]]}return index&&index==length?object:undefined}function toObject(value){return isObject(value)?value:Object(value)}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=baseGet},{}],66:[function(require,module,exports){function baseSlice(array,start,end){var index=-1,length=array.length;start=start==null?0:+start||0;if(start<0){start=-start>length?0:length+start}end=end===undefined||end>length?length:+end||0;if(end<0){end+=length}length=start>end?0:end-start>>>0;start>>>=0;var result=Array(length);while(++index<length){result[index]=array[index+start]}return result}module.exports=baseSlice},{}],67:[function(require,module,exports){var isArray=require("lodash.isarray");var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;var reEscapeChar=/\\(\\)?/g;function baseToString(value){return value==null?"":value+""}function toPath(value){if(isArray(value)){return value}var result=[];baseToString(value).replace(rePropName,function(match,number,quote,string){result.push(quote?string.replace(reEscapeChar,"$1"):number||match)});return result}module.exports=toPath},{"lodash.isarray":76}],68:[function(require,module,exports){module.exports=require(5)},{}],69:[function(require,module,exports){var baseIndexOf=require("lodash._baseindexof"),baseValues=require("lodash._basevalues"),isIterateeCall=require("lodash._isiterateecall"),isArray=require("lodash.isarray"),isString=require("lodash.isstring"),keys=require("lodash.keys");var nativeMax=Math.max;var MAX_SAFE_INTEGER=9007199254740991;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function includes(collection,target,fromIndex,guard){var length=collection?getLength(collection):0;if(!isLength(length)){collection=values(collection);length=collection.length}if(typeof fromIndex!="number"||guard&&isIterateeCall(target,fromIndex,guard)){fromIndex=0}else{fromIndex=fromIndex<0?nativeMax(length+fromIndex,0):fromIndex||0}return typeof collection=="string"||!isArray(collection)&&isString(collection)?fromIndex<=length&&collection.indexOf(target,fromIndex)>-1:!!length&&baseIndexOf(collection,target,fromIndex)>-1}function values(object){return baseValues(object,keys(object))}module.exports=includes},{"lodash._baseindexof":70,"lodash._basevalues":71,"lodash._isiterateecall":72,"lodash.isarray":76,"lodash.isstring":162,"lodash.keys":73}],70:[function(require,module,exports){module.exports=require(16)},{}],71:[function(require,module,exports){function baseValues(object,props){var index=-1,length=props.length,result=Array(length);
while(++index<length){result[index]=object[props[index]]}return result}module.exports=baseValues},{}],72:[function(require,module,exports){var reIsUint=/^\d+$/;var MAX_SAFE_INTEGER=9007199254740991;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArrayLike(value){return value!=null&&isLength(getLength(value))}function isIndex(value,length){value=typeof value=="number"||reIsUint.test(value)?+value:-1;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function isIterateeCall(value,index,object){if(!isObject(object)){return false}var type=typeof index;if(type=="number"?isArrayLike(object)&&isIndex(index,object.length):type=="string"&&index in object){var other=object[index];return value===value?value===other:other!==other}return false}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=isIterateeCall},{}],73:[function(require,module,exports){module.exports=require(8)},{"lodash._getnative":74,"lodash.isarguments":75,"lodash.isarray":76}],74:[function(require,module,exports){module.exports=require(9)},{}],75:[function(require,module,exports){module.exports=require(5)},{}],76:[function(require,module,exports){module.exports=require(6)},{}],77:[function(require,module,exports){var dateTag="[object Date]";var objectProto=Object.prototype;var objectToString=objectProto.toString;function isDate(value){return isObjectLike(value)&&objectToString.call(value)==dateTag}function isObjectLike(value){return!!value&&typeof value=="object"}module.exports=isDate},{}],78:[function(require,module,exports){var baseIsEqual=require("lodash._baseisequal"),bindCallback=require("lodash._bindcallback");function isEqual(value,other,customizer,thisArg){customizer=typeof customizer=="function"?bindCallback(customizer,thisArg,3):undefined;var result=customizer?customizer(value,other):undefined;return result===undefined?baseIsEqual(value,other,customizer):!!result}module.exports=isEqual},{"lodash._baseisequal":79,"lodash._bindcallback":84}],79:[function(require,module,exports){module.exports=require(26)},{"lodash.isarray":76,"lodash.istypedarray":80,"lodash.keys":81}],80:[function(require,module,exports){module.exports=require(27)},{}],81:[function(require,module,exports){module.exports=require(8)},{"lodash._getnative":82,"lodash.isarguments":83,"lodash.isarray":76}],82:[function(require,module,exports){module.exports=require(9)},{}],83:[function(require,module,exports){module.exports=require(5)},{}],84:[function(require,module,exports){module.exports=require(28)},{}],85:[function(require,module,exports){module.exports=require(7)},{}],86:[function(require,module,exports){function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=isObject},{}],87:[function(require,module,exports){var arrayMap=require("lodash._arraymap"),baseDifference=require("lodash._basedifference"),baseFlatten=require("lodash._baseflatten"),bindCallback=require("lodash._bindcallback"),pickByArray=require("lodash._pickbyarray"),pickByCallback=require("lodash._pickbycallback"),keysIn=require("lodash.keysin"),restParam=require("lodash.restparam");var omit=restParam(function(object,props){if(object==null){return{}}if(typeof props[0]!="function"){var props=arrayMap(baseFlatten(props),String);return pickByArray(object,baseDifference(keysIn(object),props))}var predicate=bindCallback(props[0],props[1],3);return pickByCallback(object,function(value,key,object){return!predicate(value,key,object)})});module.exports=omit},{"lodash._arraymap":88,"lodash._basedifference":89,"lodash._baseflatten":94,"lodash._bindcallback":96,"lodash._pickbyarray":97,"lodash._pickbycallback":98,"lodash.keysin":100,"lodash.restparam":102}],88:[function(require,module,exports){function arrayMap(array,iteratee){var index=-1,length=array.length,result=Array(length);while(++index<length){result[index]=iteratee(array[index],index,array)}return result}module.exports=arrayMap},{}],89:[function(require,module,exports){module.exports=require(15)},{"lodash._baseindexof":90,"lodash._cacheindexof":91,"lodash._createcache":92}],90:[function(require,module,exports){module.exports=require(16)},{}],91:[function(require,module,exports){module.exports=require(17)},{}],92:[function(require,module,exports){module.exports=require(18)},{"lodash._getnative":93}],93:[function(require,module,exports){module.exports=require(9)},{}],94:[function(require,module,exports){module.exports=require(20)},{"lodash.isarguments":95,"lodash.isarray":76}],95:[function(require,module,exports){module.exports=require(5)},{}],96:[function(require,module,exports){module.exports=require(28)},{}],97:[function(require,module,exports){function pickByArray(object,props){object=toObject(object);var index=-1,length=props.length,result={};while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}return result}function toObject(value){return isObject(value)?value:Object(value)}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=pickByArray},{}],98:[function(require,module,exports){var baseFor=require("lodash._basefor"),keysIn=require("lodash.keysin");function baseForIn(object,iteratee){return baseFor(object,iteratee,keysIn)}function pickByCallback(object,predicate){var result={};baseForIn(object,function(value,key,object){if(predicate(value,key,object)){result[key]=value}});return result}module.exports=pickByCallback},{"lodash._basefor":99,"lodash.keysin":100}],99:[function(require,module,exports){module.exports=require(59)},{}],100:[function(require,module,exports){var isArguments=require("lodash.isarguments"),isArray=require("lodash.isarray");var reIsUint=/^\d+$/;var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var MAX_SAFE_INTEGER=9007199254740991;function isIndex(value,length){value=typeof value=="number"||reIsUint.test(value)?+value:-1;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function keysIn(object){if(object==null){return[]}if(!isObject(object)){object=Object(object)}var length=object.length;length=length&&isLength(length)&&(isArray(object)||isArguments(object))&&length||0;var Ctor=object.constructor,index=-1,isProto=typeof Ctor=="function"&&Ctor.prototype===object,result=Array(length),skipIndexes=length>0;while(++index<length){result[index]=index+""}for(var key in object){if(!(skipIndexes&&isIndex(key,length))&&!(key=="constructor"&&(isProto||!hasOwnProperty.call(object,key)))){result.push(key)}}return result}module.exports=keysIn},{"lodash.isarguments":101,"lodash.isarray":76}],101:[function(require,module,exports){module.exports=require(5)},{}],102:[function(require,module,exports){module.exports=require(23)},{}],103:[function(require,module,exports){var baseFlatten=require("lodash._baseflatten"),baseUniq=require("lodash._baseuniq"),restParam=require("lodash.restparam");var union=restParam(function(arrays){return baseUniq(baseFlatten(arrays,false,true))});module.exports=union},{"lodash._baseflatten":104,"lodash._baseuniq":106,"lodash.restparam":111}],104:[function(require,module,exports){module.exports=require(20)},{"lodash.isarguments":105,"lodash.isarray":76}],105:[function(require,module,exports){module.exports=require(5)},{}],106:[function(require,module,exports){var baseIndexOf=require("lodash._baseindexof"),cacheIndexOf=require("lodash._cacheindexof"),createCache=require("lodash._createcache");var LARGE_ARRAY_SIZE=200;function baseUniq(array,iteratee){var index=-1,indexOf=baseIndexOf,length=array.length,isCommon=true,isLarge=isCommon&&length>=LARGE_ARRAY_SIZE,seen=isLarge?createCache():null,result=[];if(seen){indexOf=cacheIndexOf;isCommon=false}else{isLarge=false;seen=iteratee?[]:result}outer:while(++index<length){var value=array[index],computed=iteratee?iteratee(value,index,array):value;if(isCommon&&value===value){var seenIndex=seen.length;while(seenIndex--){if(seen[seenIndex]===computed){continue outer}}if(iteratee){seen.push(computed)}result.push(value)}else if(indexOf(seen,computed,0)<0){if(iteratee||isLarge){seen.push(computed)}result.push(value)}}return result}module.exports=baseUniq},{"lodash._baseindexof":107,"lodash._cacheindexof":108,"lodash._createcache":109}],107:[function(require,module,exports){module.exports=require(16)},{}],108:[function(require,module,exports){module.exports=require(17)},{}],109:[function(require,module,exports){module.exports=require(18)},{"lodash._getnative":110}],110:[function(require,module,exports){module.exports=require(9)},{}],111:[function(require,module,exports){module.exports=require(23)},{}],112:[function(require,module,exports){module.exports=parse;var innerHTMLBug=false;var bugTestDiv;if(typeof document!=="undefined"){bugTestDiv=document.createElement("div");bugTestDiv.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';innerHTMLBug=!bugTestDiv.getElementsByTagName("link").length;bugTestDiv=undefined}var map={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:innerHTMLBug?[1,"X<div>","</div>"]:[0,"",""]};map.td=map.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];map.option=map.optgroup=[1,'<select multiple="multiple">',"</select>"];map.thead=map.tbody=map.colgroup=map.caption=map.tfoot=[1,"<table>","</table>"];map.polyline=map.ellipse=map.polygon=map.circle=map.text=map.line=map.path=map.rect=map.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function parse(html,doc){if("string"!=typeof html)throw new TypeError("String expected");if(!doc)doc=document;var m=/<([\w:]+)/.exec(html);if(!m)return doc.createTextNode(html);html=html.replace(/^\s+|\s+$/g,"");var tag=m[1];if(tag=="body"){var el=doc.createElement("html");el.innerHTML=html;return el.removeChild(el.lastChild)}var wrap=map[tag]||map._default;var depth=wrap[0];var prefix=wrap[1];var suffix=wrap[2];var el=doc.createElement("div");el.innerHTML=prefix+html+suffix;while(depth--)el=el.lastChild;if(el.firstChild==el.lastChild){return el.removeChild(el.firstChild)}var fragment=doc.createDocumentFragment();while(el.firstChild){fragment.appendChild(el.removeChild(el.firstChild))}return fragment}},{}],113:[function(require,module,exports){var events=require("component-event");var delegate=require("delegate-events");var forceCaptureEvents=["focus","blur"];module.exports=Events;function Events(el,obj){if(!(this instanceof Events))return new Events(el,obj);if(!el)throw new Error("element required");if(!obj)throw new Error("object required");this.el=el;this.obj=obj;this._events={}}Events.prototype.sub=function(event,method,cb){this._events[event]=this._events[event]||{};this._events[event][method]=cb};Events.prototype.bind=function(arg1,arg2){var bindEvent=function(event,method){var e=parse(event);var el=this.el;var obj=this.obj;var name=e.name;var method=method||"on"+name;var args=[].slice.call(arguments,2);function cb(){var a=[].slice.call(arguments).concat(args);if(typeof method==="function"){method.apply(obj,a);return}if(!obj[method]){throw new Error(method+" method is not defined")}else{obj[method].apply(obj,a)}}if(e.selector){cb=delegate.bind(el,e.selector,name,cb)}else{events.bind(el,name,cb)}this.sub(name,method,cb);return cb};if(typeof arg1=="string"){bindEvent.apply(this,arguments)}else{for(var key in arg1){if(arg1.hasOwnProperty(key)){bindEvent.call(this,key,arg1[key])}}}};Events.prototype.unbind=function(event,method){if(0==arguments.length)return this.unbindAll();if(1==arguments.length)return this.unbindAllOf(event);var bindings=this._events[event];var capture=forceCaptureEvents.indexOf(event)!==-1;if(!bindings)return;var cb=bindings[method];if(!cb)return;events.unbind(this.el,event,cb,capture)};Events.prototype.unbindAll=function(){for(var event in this._events){this.unbindAllOf(event)}};Events.prototype.unbindAllOf=function(event){var bindings=this._events[event];if(!bindings)return;for(var method in bindings){this.unbind(event,method)}};function parse(event){var parts=event.split(/ +/);return{name:parts.shift(),selector:parts.join(" ")}}},{"component-event":114,"delegate-events":115}],114:[function(require,module,exports){var bind=window.addEventListener?"addEventListener":"attachEvent",unbind=window.removeEventListener?"removeEventListener":"detachEvent",prefix=bind!=="addEventListener"?"on":"";exports.bind=function(el,type,fn,capture){el[bind](prefix+type,fn,capture||false);return fn};exports.unbind=function(el,type,fn,capture){el[unbind](prefix+type,fn,capture||false);return fn}},{}],115:[function(require,module,exports){var closest=require("closest"),event=require("component-event");var forceCaptureEvents=["focus","blur"];exports.bind=function(el,selector,type,fn,capture){if(forceCaptureEvents.indexOf(type)!==-1)capture=true;return event.bind(el,type,function(e){var target=e.target||e.srcElement;e.delegateTarget=closest(target,selector,true,el);if(e.delegateTarget)fn.call(el,e)},capture)};exports.unbind=function(el,type,fn,capture){if(forceCaptureEvents.indexOf(type)!==-1)capture=true;event.unbind(el,type,fn,capture)}},{closest:116,"component-event":114}],116:[function(require,module,exports){var matches=require("matches-selector");module.exports=function(element,selector,checkYoSelf){var parent=checkYoSelf?element:element.parentNode;while(parent&&parent!==document){if(matches(parent,selector))return parent;parent=parent.parentNode}}},{"matches-selector":117}],117:[function(require,module,exports){var proto=Element.prototype;var vendor=proto.matchesSelector||proto.webkitMatchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector;module.exports=match;function match(el,selector){if(vendor)return vendor.call(el,selector);var nodes=el.parentNode.querySelectorAll(selector);for(var i=0;i<nodes.length;++i){if(nodes[i]==el)return true}return false}},{}],118:[function(require,module,exports){var baseAssign=require("lodash._baseassign"),createAssigner=require("lodash._createassigner"),keys=require("lodash.keys");function assignWith(object,source,customizer){var index=-1,props=keys(source),length=props.length;while(++index<length){var key=props[index],value=object[key],result=customizer(value,source[key],key,object,source);if((result===result?result!==value:value===value)||value===undefined&&!(key in object)){object[key]=result}}return object}var assign=createAssigner(function(object,source,customizer){return customizer?assignWith(object,source,customizer):baseAssign(object,source)});module.exports=assign},{"lodash._baseassign":119,"lodash._createassigner":121,"lodash.keys":125}],119:[function(require,module,exports){var baseCopy=require("lodash._basecopy"),keys=require("lodash.keys");function baseAssign(object,source){return source==null?object:baseCopy(source,keys(source),object)}module.exports=baseAssign},{"lodash._basecopy":120,"lodash.keys":125}],120:[function(require,module,exports){function baseCopy(source,props,object){object||(object={});var index=-1,length=props.length;while(++index<length){var key=props[index];object[key]=source[key]}return object}module.exports=baseCopy},{}],121:[function(require,module,exports){var bindCallback=require("lodash._bindcallback"),isIterateeCall=require("lodash._isiterateecall"),restParam=require("lodash.restparam");function createAssigner(assigner){return restParam(function(object,sources){var index=-1,length=object==null?0:sources.length,customizer=length>2?sources[length-2]:undefined,guard=length>2?sources[2]:undefined,thisArg=length>1?sources[length-1]:undefined;if(typeof customizer=="function"){customizer=bindCallback(customizer,thisArg,5);length-=2}else{customizer=typeof thisArg=="function"?thisArg:undefined;length-=customizer?1:0}if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1}while(++index<length){var source=sources[index];if(source){assigner(object,source,customizer)}}return object})}module.exports=createAssigner},{"lodash._bindcallback":122,"lodash._isiterateecall":123,"lodash.restparam":124}],122:[function(require,module,exports){module.exports=require(28)},{}],123:[function(require,module,exports){module.exports=require(72)},{}],124:[function(require,module,exports){module.exports=require(23)},{}],125:[function(require,module,exports){module.exports=require(8)},{"lodash._getnative":126,"lodash.isarguments":127,"lodash.isarray":128}],126:[function(require,module,exports){module.exports=require(9)},{}],127:[function(require,module,exports){module.exports=require(5)},{}],128:[function(require,module,exports){module.exports=require(6)},{}],129:[function(require,module,exports){var createWrapper=require("lodash._createwrapper"),replaceHolders=require("lodash._replaceholders"),restParam=require("lodash.restparam");var BIND_FLAG=1,PARTIAL_FLAG=32;var bind=restParam(function(func,thisArg,partials){var bitmask=BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,bind.placeholder);bitmask|=PARTIAL_FLAG}return createWrapper(func,bitmask,thisArg,partials,holders)});bind.placeholder={};module.exports=bind},{"lodash._createwrapper":130,"lodash._replaceholders":132,"lodash.restparam":133}],130:[function(require,module,exports){module.exports=require(41)},{"lodash._root":131}],131:[function(require,module,exports){module.exports=require(42)},{}],132:[function(require,module,exports){module.exports=require(43)},{}],133:[function(require,module,exports){module.exports=require(23)},{}],134:[function(require,module,exports){var baseFlatten=require("lodash._baseflatten"),isIterateeCall=require("lodash._isiterateecall");function flatten(array,isDeep,guard){var length=array?array.length:0;if(guard&&isIterateeCall(array,isDeep,guard)){isDeep=false}return length?baseFlatten(array,isDeep):[]}module.exports=flatten},{"lodash._baseflatten":135,"lodash._isiterateecall":138}],135:[function(require,module,exports){module.exports=require(20)},{"lodash.isarguments":136,"lodash.isarray":137}],136:[function(require,module,exports){module.exports=require(5)},{}],137:[function(require,module,exports){module.exports=require(6)},{}],138:[function(require,module,exports){module.exports=require(72)},{}],139:[function(require,module,exports){var arrayEach=require("lodash._arrayeach"),baseEach=require("lodash._baseeach"),bindCallback=require("lodash._bindcallback"),isArray=require("lodash.isarray");function createForEach(arrayFunc,eachFunc){return function(collection,iteratee,thisArg){return typeof iteratee=="function"&&thisArg===undefined&&isArray(collection)?arrayFunc(collection,iteratee):eachFunc(collection,bindCallback(iteratee,thisArg,3))}}var forEach=createForEach(arrayEach,baseEach);module.exports=forEach},{"lodash._arrayeach":140,"lodash._baseeach":141,"lodash._bindcallback":145,"lodash.isarray":146}],140:[function(require,module,exports){function arrayEach(array,iteratee){var index=-1,length=array.length;while(++index<length){if(iteratee(array[index],index,array)===false){break}}return array}module.exports=arrayEach},{}],141:[function(require,module,exports){module.exports=require(30)},{"lodash.keys":142}],142:[function(require,module,exports){module.exports=require(8)},{"lodash._getnative":143,"lodash.isarguments":144,"lodash.isarray":146}],143:[function(require,module,exports){module.exports=require(9)},{}],144:[function(require,module,exports){module.exports=require(5)},{}],145:[function(require,module,exports){module.exports=require(28)},{}],146:[function(require,module,exports){module.exports=require(6)},{}],147:[function(require,module,exports){var baseGet=require("lodash._baseget"),toPath=require("lodash._topath");function get(object,path,defaultValue){var result=object==null?undefined:baseGet(object,toPath(path),path+"");return result===undefined?defaultValue:result}module.exports=get},{"lodash._baseget":148,"lodash._topath":149}],148:[function(require,module,exports){module.exports=require(65)},{}],149:[function(require,module,exports){module.exports=require(67)},{"lodash.isarray":150}],150:[function(require,module,exports){module.exports=require(6)},{}],151:[function(require,module,exports){var baseEach=require("lodash._baseeach"),invokePath=require("lodash._invokepath"),isArray=require("lodash.isarray"),restParam=require("lodash.restparam");var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;var MAX_SAFE_INTEGER=9007199254740991;function baseProperty(key){return function(object){return object==null?undefined:object[key]}}var getLength=baseProperty("length");function isArrayLike(value){return value!=null&&isLength(getLength(value))}function isKey(value,object){var type=typeof value;if(type=="string"&&reIsPlainProp.test(value)||type=="number"){return true}if(isArray(value)){return false}var result=!reIsDeepProp.test(value);return result||object!=null&&value in toObject(object)}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function toObject(value){return isObject(value)?value:Object(value)}var invoke=restParam(function(collection,path,args){var index=-1,isFunc=typeof path=="function",isProp=isKey(path),result=isArrayLike(collection)?Array(collection.length):[];baseEach(collection,function(value){var func=isFunc?path:isProp&&value!=null?value[path]:undefined;result[++index]=func?func.apply(value,args):invokePath(value,path,args)});return result});function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=invoke},{"lodash._baseeach":152,"lodash._invokepath":156,"lodash.isarray":160,"lodash.restparam":161}],152:[function(require,module,exports){module.exports=require(30)},{"lodash.keys":153}],153:[function(require,module,exports){module.exports=require(8)},{"lodash._getnative":154,"lodash.isarguments":155,"lodash.isarray":160}],154:[function(require,module,exports){module.exports=require(9)},{}],155:[function(require,module,exports){module.exports=require(5)},{}],156:[function(require,module,exports){var baseGet=require("lodash._baseget"),baseSlice=require("lodash._baseslice"),toPath=require("lodash._topath"),isArray=require("lodash.isarray");var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function invokePath(object,path,args){if(object!=null&&!isKey(path,object)){path=toPath(path);object=path.length==1?object:baseGet(object,baseSlice(path,0,-1));path=last(path)}var func=object==null?object:object[path];return func==null?undefined:func.apply(object,args)}function isKey(value,object){var type=typeof value;if(type=="string"&&reIsPlainProp.test(value)||type=="number"){return true}if(isArray(value)){return false}var result=!reIsDeepProp.test(value);return result||object!=null&&value in toObject(object)}function toObject(value){return isObject(value)?value:Object(value)}function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=invokePath},{"lodash._baseget":157,"lodash._baseslice":158,"lodash._topath":159,"lodash.isarray":160}],157:[function(require,module,exports){module.exports=require(65)},{}],158:[function(require,module,exports){module.exports=require(66)},{}],159:[function(require,module,exports){module.exports=require(67)},{"lodash.isarray":160}],160:[function(require,module,exports){module.exports=require(6)},{}],161:[function(require,module,exports){module.exports=require(23)},{}],162:[function(require,module,exports){var stringTag="[object String]";function isObjectLike(value){return!!value&&typeof value=="object"}var objectProto=Object.prototype;var objToString=objectProto.toString;function isString(value){return typeof value=="string"||isObjectLike(value)&&objToString.call(value)==stringTag}module.exports=isString},{}],163:[function(require,module,exports){function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}module.exports=last},{}],164:[function(require,module,exports){var baseFlatten=require("lodash._baseflatten"),bindCallback=require("lodash._bindcallback"),pickByArray=require("lodash._pickbyarray"),pickByCallback=require("lodash._pickbycallback"),restParam=require("lodash.restparam");var pick=restParam(function(object,props){if(object==null){return{}}return typeof props[0]=="function"?pickByCallback(object,bindCallback(props[0],props[1],3)):pickByArray(object,baseFlatten(props))});module.exports=pick},{"lodash._baseflatten":165,"lodash._bindcallback":168,"lodash._pickbyarray":169,"lodash._pickbycallback":170,"lodash.restparam":175}],165:[function(require,module,exports){module.exports=require(20)},{"lodash.isarguments":166,"lodash.isarray":167}],166:[function(require,module,exports){module.exports=require(5)},{}],167:[function(require,module,exports){module.exports=require(6)},{}],168:[function(require,module,exports){module.exports=require(28)},{}],169:[function(require,module,exports){module.exports=require(97)},{}],170:[function(require,module,exports){module.exports=require(98)},{"lodash._basefor":171,"lodash.keysin":172}],171:[function(require,module,exports){module.exports=require(59)},{}],172:[function(require,module,exports){module.exports=require(100)},{"lodash.isarguments":173,"lodash.isarray":174}],173:[function(require,module,exports){module.exports=require(5)},{}],174:[function(require,module,exports){module.exports=require(6)},{}],175:[function(require,module,exports){module.exports=require(23)},{}],176:[function(require,module,exports){var baseGet=require("lodash._baseget"),baseSlice=require("lodash._baseslice"),toPath=require("lodash._topath"),isArray=require("lodash.isarray"),isFunction=require("lodash.isfunction");var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(value,object){var type=typeof value;if(type=="string"&&reIsPlainProp.test(value)||type=="number"){return true}if(isArray(value)){return false}var result=!reIsDeepProp.test(value);return result||object!=null&&value in toObject(object)}function toObject(value){return isObject(value)?value:Object(value)}function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function result(object,path,defaultValue){var result=object==null?undefined:object[path];if(result===undefined){if(object!=null&&!isKey(path,object)){path=toPath(path);object=path.length==1?object:baseGet(object,baseSlice(path,0,-1));result=object==null?undefined:object[last(path)]}result=result===undefined?defaultValue:result}return isFunction(result)?result.call(object):result}module.exports=result},{"lodash._baseget":177,"lodash._baseslice":178,"lodash._topath":179,"lodash.isarray":180,"lodash.isfunction":181}],177:[function(require,module,exports){module.exports=require(65)},{}],178:[function(require,module,exports){module.exports=require(66)},{}],179:[function(require,module,exports){module.exports=require(67)},{"lodash.isarray":180}],180:[function(require,module,exports){module.exports=require(6)},{}],181:[function(require,module,exports){module.exports=require(7)},{}],182:[function(require,module,exports){var root=require("lodash._root");var INFINITY=1/0;var symbolTag="[object Symbol]";var objectProto=Object.prototype;var idCounter=0;var objectToString=objectProto.toString;var Symbol=root.Symbol;var symbolProto=Symbol?Symbol.prototype:undefined,symbolToString=Symbol?symbolProto.toString:undefined;function isObjectLike(value){return!!value&&typeof value=="object"}function isSymbol(value){return typeof value=="symbol"||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){if(typeof value=="string"){return value}if(value==null){return""}if(isSymbol(value)){return Symbol?symbolToString.call(value):""}var result=value+"";return result=="0"&&1/value==-INFINITY?"-0":result}function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id}module.exports=uniqueId},{"lodash._root":183}],183:[function(require,module,exports){module.exports=require(42)},{}],184:[function(require,module,exports){"use strict";var proto=Element.prototype;var vendor=proto.matches||proto.matchesSelector||proto.webkitMatchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector;module.exports=match;function match(el,selector){if(vendor)return vendor.call(el,selector);var nodes=el.parentNode.querySelectorAll(selector);for(var i=0;i<nodes.length;i++){if(nodes[i]==el)return true}return false}},{}],"ampersand-view":[function(require,module,exports){if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-view"]=window.ampersand["ampersand-view"]||[];window.ampersand["ampersand-view"].push("9.0.2")}var State=require("ampersand-state");var CollectionView=require("ampersand-collection-view");var domify=require("domify");var uniqueId=require("lodash.uniqueid");var pick=require("lodash.pick");var assign=require("lodash.assign");var forEach=require("lodash.foreach");var result=require("lodash.result");var last=require("lodash.last");var isString=require("lodash.isstring");var bind=require("lodash.bind");var flatten=require("lodash.flatten");var invoke=require("lodash.invoke");var events=require("events-mixin");var matches=require("matches-selector");var bindings=require("ampersand-dom-bindings");var getPath=require("lodash.get");function View(attrs){this.cid=uniqueId("view");attrs||(attrs={});var parent=attrs.parent;delete attrs.parent;BaseState.call(this,attrs,{init:false,parent:parent});this.on("change:el",this._handleElementChange,this);this._upsertBindings();this.template=attrs.template||this.template;this._cache.rendered=false;this.initialize.apply(this,arguments);if(this.autoRender&&this.template){this.render()}}var BaseState=State.extend({dataTypes:{element:{set:function(newVal){return{val:newVal,type:newVal instanceof Element?"element":typeof newVal}},compare:function(el1,el2){return el1===el2}},collection:{set:function(newVal){return{val:newVal,type:newVal&&newVal.isCollection?"collection":typeof newVal}},compare:function(currentVal,newVal){return currentVal===newVal}}},props:{model:"state",el:"element",collection:"collection"},session:{_rendered:["boolean",true,false]},derived:{hasData:{deps:["model"],fn:function(){return!!this.model}},rendered:{deps:["_rendered"],fn:function(){if(this._rendered){this.trigger("render",this);return true}this.trigger("remove",this);return false}}}});var delegateEventSplitter=/^(\S+)\s*(.*)$/;View.prototype=Object.create(BaseState.prototype);var queryNoElMsg="Query cannot be performed as this.el is not defined. Ensure that the view has been rendered.";assign(View.prototype,{query:function(selector){if(!this.el){throw new Error(queryNoElMsg)}if(!selector)return this.el;if(typeof selector==="string"){if(matches(this.el,selector))return this.el;return this.el.querySelector(selector)||undefined}return selector},queryAll:function(selector){if(!this.el){throw new Error(queryNoElMsg)}if(!selector)return[this.el];var res=[];if(matches(this.el,selector))res.push(this.el);return res.concat(Array.prototype.slice.call(this.el.querySelectorAll(selector)))},queryByHook:function(hook){return this.query('[data-hook~="'+hook+'"]')},queryAllByHook:function(hook){return this.queryAll('[data-hook~="'+hook+'"]')},initialize:function(){},_render:function(){this._upsertBindings();
this.renderWithTemplate(this);this._rendered=true;return this},_remove:function(){if(this.el&&this.el.parentNode)this.el.parentNode.removeChild(this.el);this._rendered=false;this._downsertBindings();return this},_handleElementChange:function(element,delegate){if(this.eventManager)this.eventManager.unbind();this.eventManager=events(this.el,this);this.delegateEvents();this._applyBindingsForKey();return this},delegateEvents:function(events){if(!(events||(events=result(this,"events"))))return this;this.undelegateEvents();for(var key in events){this.eventManager.bind(key,events[key])}return this},undelegateEvents:function(){this.eventManager.unbind();return this},registerSubview:function(view){this._subviews||(this._subviews=[]);this._subviews.push(view);if(!view.parent)view.parent=this;return view},renderSubview:function(view,container){if(typeof container==="string"){container=this.query(container)}if(!container)container=this.el;this.registerSubview(view);container.appendChild(view.render().el);return view},_applyBindingsForKey:function(name){if(!this.el)return;var fns=this._parsedBindings.getGrouped(name);var item;for(item in fns){fns[item].forEach(function(fn){fn(this.el,getPath(this,item),last(item.split(".")))},this)}},_initializeBindings:function(){if(!this.bindings)return;this.on("all",function(eventName){if(eventName.slice(0,7)==="change:"){this._applyBindingsForKey(eventName.split(":")[1])}},this)},_initializeSubviews:function(){if(!this.subviews)return;for(var item in this.subviews){this._parseSubview(this.subviews[item],item)}},_parseSubview:function(subview,name){if(subview.container){subview.selector=subview.container}var opts=this._parseSubviewOpts(subview);function action(){var el,subview;if(!this.el||!(el=this.query(opts.selector)))return;if(!opts.waitFor||getPath(this,opts.waitFor)){subview=this[name]=opts.prepareView.call(this,el);if(!subview.el){this.renderSubview(subview,el)}else{subview.render();this.registerSubview(subview)}this.off("change",action)}}this.on("change",action,this)},_parseSubviewOpts:function(subview){var self=this;var opts={selector:subview.selector||'[data-hook="'+subview.hook+'"]',waitFor:subview.waitFor||"",prepareView:subview.prepareView||function(){return new subview.constructor({parent:self})}};return opts},renderWithTemplate:function(context,templateArg){var template=templateArg||this.template;if(!template)throw new Error("Template string or function needed.");var newDom=isString(template)?template:template.call(this,context||this);if(isString(newDom))newDom=domify(newDom);var parent=this.el&&this.el.parentNode;if(parent)parent.replaceChild(newDom,this.el);if(newDom.nodeName==="#document-fragment")throw new Error("Views can only have one root element, including comment nodes.");this.el=newDom;return this},cacheElements:function(hash){for(var item in hash){this[item]=this.query(hash[item])}return this},listenToAndRun:function(object,events,handler){var bound=bind(handler,this);this.listenTo(object,events,bound);bound()},animateRemove:function(){this.remove()},renderCollection:function(collection,ViewClass,container,opts){var containerEl=typeof container==="string"?this.query(container):container;var config=assign({collection:collection,el:containerEl||this.el,view:ViewClass,parent:this,viewOptions:{parent:this}},opts);var collectionView=new CollectionView(config);collectionView.render();return this.registerSubview(collectionView)},_setRender:function(obj){Object.defineProperty(obj,"render",{get:function(){return this._render},set:function(fn){this._render=function(){fn.apply(this,arguments);this._rendered=true;return this}}})},_setRemove:function(obj){Object.defineProperty(obj,"remove",{get:function(){return this._remove},set:function(fn){this._remove=function(){fn.apply(this,arguments);this._rendered=false;return this}}})},_downsertBindings:function(){var parsedBindings=this._parsedBindings;if(!this.bindingsSet)return;if(this._subviews)invoke(flatten(this._subviews),"remove");this.stopListening();forEach(parsedBindings,function(properties,modelName){forEach(properties,function(value,key){delete parsedBindings[modelName][key]});delete parsedBindings[modelName]});this.bindingsSet=false},_upsertBindings:function(attrs){attrs=attrs||this;if(this.bindingsSet)return;this._parsedBindings=bindings(this.bindings,this);this._initializeBindings();if(attrs.el&&!this.autoRender){this._handleElementChange()}this._initializeSubviews();this.bindingsSet=true}});View.prototype._setRender(View.prototype);View.prototype._setRemove(View.prototype);View.extend=BaseState.extend;module.exports=View},{"ampersand-collection-view":1,"ampersand-dom-bindings":37,"ampersand-state":45,domify:112,"events-mixin":113,"lodash.assign":118,"lodash.bind":129,"lodash.flatten":134,"lodash.foreach":139,"lodash.get":147,"lodash.invoke":151,"lodash.isstring":162,"lodash.last":163,"lodash.pick":164,"lodash.result":176,"lodash.uniqueid":182,"matches-selector":184}]},{},[]);var Model=require("ampersand-model");var View=require("ampersand-view");var FormTemplate=document.getElementById("form-template").innerHTML;var FormModel=Model.extend({props:{firstName:"string",lastName:"string"}});var FormView=View.extend({template:FormTemplate,events:{"change [data-hook=firstNameInput]":function(e){this.model.firstName=e.target.value},"change [data-hook=lastNameInput]":function(e){this.model.lastName=e.target.value}},bindings:{"model.firstName":{hook:"firstNameOutput",type:"value"},"model.lastName":{hook:"lastNameOutput",type:"value"}}});var formModel=new FormModel;var formView=new FormView({model:formModel});document.querySelector("#main").appendChild(formView.render().el);
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"ampersand-model": "6.0.2",
"ampersand-view": "9.0.2"
}
}
<!-- contents of this file will be placed inside the <body> -->
<div id="main"></div>
<script type="text/template" id="form-template">
<div>
<h1>Input</h1>
<form>
<div class="form-group">
<label>First name</label>
<input data-hook="firstNameInput" class="form-control">
</div>
<div class="form-group">
<label>Last name</label>
<input data-hook="lastNameInput" class="form-control">
</div>
</form>
<h1>Output</h1>
<form>
<div class="form-group">
<label>First name</label>
<input data-hook="firstNameOutput" class="form-control"></dd>
</div>
<div class="form-group">
<label>Last name</label>
<input data-hook="lastNameOutput" class="form-control"></dd>
</div>
</form>
</div>
</script>
<!-- contents of this file will be placed inside the <head> -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment