!function(global){function Fuse(list,options){this.list=list,this.options=options=options||{};var i,len,key,keys;for(i=0,keys=["sort","includeScore","shouldSort"],len=keys.length;len>i;i++)key=keys[i],this.options[key]=key in options?options[key]:Fuse.defaultOptions[key];for(i=0,keys=["searchFn","sortFn","keys","getFn"],len=keys.length;len>i;i++)key=keys[i],this.options[key]=options[key]||Fuse.defaultOptions[key]}var BitapSearcher=function(pattern,options){if(options=options||{},this.options=options,this.options.location=options.location||BitapSearcher.defaultOptions.location,this.options.distance="distance"in options?options.distance:BitapSearcher.defaultOptions.distance,this.options.threshold="threshold"in options?options.threshold:BitapSearcher.defaultOptions.threshold,this.options.maxPatternLength=options.maxPatternLength||BitapSearcher.defaultOptions.maxPatternLength,this.pattern=options.caseSensitive?pattern:pattern.toLowerCase(),this.patternLen=pattern.length,this.patternLen>this.options.maxPatternLength)throw new Error("Pattern length is too long");this.matchmask=1<binMin;)this._bitapScore(i,LOCATION+binMid)<=THRESHOLD?binMin=binMid:binMax=binMid,binMid=Math.floor((binMax-binMin)/2+binMin);for(binMax=binMid,start=Math.max(1,LOCATION-binMid+1),finish=Math.min(LOCATION+binMid,textLen)+this.patternLen,bitArr=Array(finish+2),bitArr[finish+1]=(1<=start;j--)if(charMatch=this.patternAlphabet[text.charAt(j-1)],0===i?bitArr[j]=(bitArr[j+1]<<1|1)&charMatch:bitArr[j]=(bitArr[j+1]<<1|1)&charMatch|((lastBitArr[j+1]|lastBitArr[j])<<1|1)|lastBitArr[j+1],bitArr[j]&this.matchmask&&(score=this._bitapScore(i,j-1),THRESHOLD>=score)){if(THRESHOLD=score,bestLoc=j-1,locations.push(bestLoc),!(bestLoc>LOCATION))break;start=Math.max(1,2*LOCATION-bestLoc)}if(this._bitapScore(i+1,LOCATION)>THRESHOLD)break;lastBitArr=bitArr}return{isMatch:bestLoc>=0,score:score}};var deepValueHelper=function(obj,path,list){var firstSegment,remaining,dotIndex;if(path){dotIndex=path.indexOf("."),-1!==dotIndex?(firstSegment=path.slice(0,dotIndex),remaining=path.slice(dotIndex+1)):firstSegment=path;var value=obj[firstSegment];if(value)if(remaining||"string"!=typeof value&&"number"!=typeof value)if(Utils.isArray(value))for(var i=0,len=value.length;len>i;i++)deepValueHelper(value[i],remaining,list);else remaining&&deepValueHelper(value,remaining,list);else list.push(value)}else list.push(obj);return list},Utils={deepValue:function(obj,path){return deepValueHelper(obj,path,[])},isArray:function(obj){return"[object Array]"===Object.prototype.toString.call(obj)}};Fuse.defaultOptions={id:null,caseSensitive:!1,includeScore:!1,shouldSort:!0,searchFn:BitapSearcher,sortFn:function(a,b){return a.score-b.score},getFn:Utils.deepValue,keys:[]},Fuse.prototype.set=function(list){return this.list=list,list},Fuse.prototype.search=function(pattern){var j,item,bitapResult,existingResult,searcher=new this.options.searchFn(pattern,this.options),list=this.list,dataLen=list.length,options=this.options,searchKeys=this.options.keys,searchKeysLen=searchKeys.length,rawResults=[],resultMap={},results=[],analyzeText=function(text,entity,index){if(void 0!==text&&null!==text)if("string"==typeof text)bitapResult=searcher.search(text),bitapResult.isMatch&&(existingResult=resultMap[index],existingResult?existingResult.score=Math.min(existingResult.score,bitapResult.score):(resultMap[index]={item:entity,score:bitapResult.score},rawResults.push(resultMap[index])));else if(Utils.isArray(text))for(var i=0;ii;i++)analyzeText(list[i],i,i);else for(var i=0;dataLen>i;i++)for(item=list[i],j=0;searchKeysLen>j;j++)analyzeText(options.getFn(item,searchKeys[j]),item,i);options.shouldSort&&rawResults.sort(options.sortFn);for(var getItem=options.includeScore?function(i){return rawResults[i]}:function(i){return rawResults[i].item},replaceValue=options.id?function(i){rawResults[i].item=options.getFn(rawResults[i].item,options.id)[0]}:function(){},i=0,len=rawResults.length;len>i;i++)replaceValue(i),results.push(getItem(i));return results},"object"==typeof exports?module.exports=Fuse:"function"==typeof define&&define.amd?define(function(){return Fuse}):global.Fuse=Fuse}(this),function(window,document,undefined){function _addEvent(object,type,callback){return object.addEventListener?void object.addEventListener(type,callback,!1):void object.attachEvent("on"+type,callback)}function _characterFromEvent(e){if("keypress"==e.type){var character=String.fromCharCode(e.which);return e.shiftKey||(character=character.toLowerCase()),character}return _MAP[e.which]?_MAP[e.which]:_KEYCODE_MAP[e.which]?_KEYCODE_MAP[e.which]:String.fromCharCode(e.which).toLowerCase()}function _modifiersMatch(modifiers1,modifiers2){return modifiers1.sort().join(",")===modifiers2.sort().join(",")}function _eventModifiers(e){var modifiers=[];return e.shiftKey&&modifiers.push("shift"),e.altKey&&modifiers.push("alt"),e.ctrlKey&&modifiers.push("ctrl"),e.metaKey&&modifiers.push("meta"),modifiers}function _preventDefault(e){return e.preventDefault?void e.preventDefault():void(e.returnValue=!1)}function _stopPropagation(e){return e.stopPropagation?void e.stopPropagation():void(e.cancelBubble=!0)}function _isModifier(key){return"shift"==key||"ctrl"==key||"alt"==key||"meta"==key}function _getReverseMap(){if(!_REVERSE_MAP){_REVERSE_MAP={};for(var key in _MAP)key>95&&112>key||_MAP.hasOwnProperty(key)&&(_REVERSE_MAP[_MAP[key]]=key)}return _REVERSE_MAP}function _pickBestAction(key,modifiers,action){return action||(action=_getReverseMap()[key]?"keydown":"keypress"),"keypress"==action&&modifiers.length&&(action="keydown"),action}function _keysFromString(combination){return"+"===combination?["+"]:(combination=combination.replace(/\+{2}/g,"+plus"),combination.split("+"))}function _getKeyInfo(combination,action){var keys,key,i,modifiers=[];for(keys=_keysFromString(combination),i=0;i1?void _bindSequence(combination,sequence,callback,action):(info=_getKeyInfo(combination,action),self._callbacks[info.key]=self._callbacks[info.key]||[],_getMatches(info.key,info.modifiers,{type:info.action},sequenceName,combination,level),void self._callbacks[info.key][sequenceName?"unshift":"push"]({callback:callback,modifiers:info.modifiers,action:info.action,seq:sequenceName,level:level,combo:combination}))}var self=this;if(targetElement=targetElement||document,!(self instanceof Mousetrap))return new Mousetrap(targetElement);self.target=targetElement,self._callbacks={},self._directMap={};var _resetTimer,_sequenceLevels={},_ignoreNextKeyup=!1,_ignoreNextKeypress=!1,_nextExpectedAction=!1;self._handleKey=function(character,modifiers,e){var i,callbacks=_getMatches(character,modifiers,e),doNotReset={},maxLevel=0,processedSequenceCallback=!1;for(i=0;i":".","?":"/","|":"\\"},_SPECIAL_ALIASES={option:"alt",command:"meta","return":"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},i=1;20>i;++i)_MAP[111+i]="f"+i;for(i=0;9>=i;++i)_MAP[i+96]=i;Mousetrap.prototype.bind=function(keys,callback,action){var self=this;return keys=keys instanceof Array?keys:[keys],self._bindMultiple.call(self,keys,callback,action),self},Mousetrap.prototype.unbind=function(keys,action){var self=this;return self.bind.call(self,keys,function(){},action)},Mousetrap.prototype.trigger=function(keys,action){var self=this;return self._directMap[keys+":"+action]&&self._directMap[keys+":"+action]({},keys),self},Mousetrap.prototype.reset=function(){var self=this;return self._callbacks={},self._directMap={},self},Mousetrap.prototype.stopCallback=function(e,element){var self=this;return(" "+element.className+" ").indexOf(" mousetrap ")>-1?!1:_belongsTo(element,self.target)?!1:"INPUT"==element.tagName||"SELECT"==element.tagName||"TEXTAREA"==element.tagName||element.isContentEditable},Mousetrap.prototype.handleKey=function(){var self=this;return self._handleKey.apply(self,arguments)},Mousetrap.init=function(){var documentMousetrap=Mousetrap(document);for(var method in documentMousetrap)"_"!==method.charAt(0)&&(Mousetrap[method]=function(method){return function(){return documentMousetrap[method].apply(documentMousetrap,arguments)}}(method))},Mousetrap.init(),window.Mousetrap=Mousetrap,"undefined"!=typeof module&&module.exports&&(module.exports=Mousetrap),"function"==typeof define&&define.amd&&define(function(){return Mousetrap})}(window,document),function(Mousetrap){var _globalCallbacks={},_originalStopCallback=Mousetrap.prototype.stopCallback;Mousetrap.prototype.stopCallback=function(e,element,combo,sequence){var self=this;return self.paused?!0:_globalCallbacks[combo]||_globalCallbacks[sequence]?!1:_originalStopCallback.call(self,e,element,combo)},Mousetrap.prototype.bindGlobal=function(keys,callback,action){var self=this;if(self.bind(keys,callback,action),keys instanceof Array)for(var i=0;i1?_len-1:0),_key=1;_len>_key;_key++)sources[_key-1]=arguments[_key];for(var prop,source;source=sources.shift();)for(prop in source)hasOwn.call(source,prop)&&(target[prop]=source[prop]);return target}function fillGaps(target){for(var _len=arguments.length,sources=Array(_len>1?_len-1:0),_key=1;_len>_key;_key++)sources[_key-1]=arguments[_key];return sources.forEach(function(s){for(var key in s)!s.hasOwnProperty(key)||key in target||(target[key]=s[key])}),target}function isArray(thing){return"[object Array]"===is__toString.call(thing)}function isArrayLike(obj){return arrayLikePattern.test(is__toString.call(obj))}function isEqual(a,b){return null===a&&null===b?!0:"object"==typeof a||"object"==typeof b?!1:a===b}function is__isNumeric(thing){return!isNaN(parseFloat(thing))&&isFinite(thing)}function isObject(thing){return thing&&"[object Object]"===is__toString.call(thing)}function format(message,args){return message.replace(/%s/g,function(){return args.shift()})}function fatal(message){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_len>_key;_key++)args[_key-1]=arguments[_key];throw message=format(message,args),new Error(message)}function logIfDebug(){_Ractive.DEBUG&&log.apply(null,arguments)}function warn(message){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_len>_key;_key++)args[_key-1]=arguments[_key];message=format(message,args),printWarning(message,args)}function warnOnce(message){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_len>_key;_key++)args[_key-1]=arguments[_key];message=format(message,args),alreadyWarned[message]||(alreadyWarned[message]=!0,printWarning(message,args))}function warnIfDebug(){_Ractive.DEBUG&&warn.apply(null,arguments)}function warnOnceIfDebug(){_Ractive.DEBUG&&warnOnce.apply(null,arguments)}function findInViewHierarchy(registryName,ractive,name){var instance=findInstance(registryName,ractive,name);return instance?instance[registryName][name]:null}function findInstance(registryName,ractive,name){for(;ractive;){if(name in ractive[registryName])return ractive;if(ractive.isolated)return null;ractive=ractive.parent}}function snap(to){return function(){return to}}function getPotentialWildcardMatches(keypath){var keys,starMap,mapper,i,result,wildcardKeypath;for(keys=keypath.split("."),(starMap=starMaps[keys.length])||(starMap=getStarMap(keys.length)),result=[],mapper=function(star,i){return star?"*":keys[i]},i=starMap.length;i--;)wildcardKeypath=starMap[i].map(mapper).join("."),result.hasOwnProperty(wildcardKeypath)||(result.push(wildcardKeypath),result[wildcardKeypath]=!0);return result}function getStarMap(num){var max,binary,starMap,mapper,i,j,l,map,ones="";if(!starMaps[num]){for(starMap=[];ones.length=i;i+=1){for(binary=i.toString(2);binary.lengthj;j++)map.push(mapper(binary[j]));starMap[i]=map}starMaps[num]=starMap}return starMaps[num]}function assignNewKeypath(target,property,oldKeypath,newKeypath){var existingKeypath=target[property];if(!existingKeypath||!existingKeypath.equalsOrStartsWith(newKeypath)&&existingKeypath.equalsOrStartsWith(oldKeypath))return target[property]=existingKeypath?existingKeypath.replace(oldKeypath,newKeypath):newKeypath,!0}function decodeKeypath(keypath){var value=keypath.slice(2);return"i"===keypath[1]&&is__isNumeric(value)?+value:value}function getKeypath(str){return null==str?str:(keypathCache.hasOwnProperty(str)||(keypathCache[str]=new Keypath(str)),keypathCache[str])}function getMatchingKeypaths(ractive,keypath){function expand(matchingKeypaths,keypath){var wrapper,value,keys;return keypath.isRoot?keys=[].concat(Object.keys(ractive.viewmodel.data),Object.keys(ractive.viewmodel.mappings),Object.keys(ractive.viewmodel.computations)):(wrapper=ractive.viewmodel.wrapped[keypath.str],value=wrapper?wrapper.get():ractive.viewmodel.get(keypath),keys=value?Object.keys(value):null),keys&&keys.forEach(function(key){"_ractive"===key&&isArray(value)||matchingKeypaths.push(keypath.join(key))}),matchingKeypaths}var keys,key,matchingKeypaths;for(keys=keypath.str.split("."),matchingKeypaths=[rootKeypath];key=keys.shift();)"*"===key?matchingKeypaths=matchingKeypaths.reduce(expand,[]):matchingKeypaths[0]===rootKeypath?matchingKeypaths[0]=getKeypath(key):matchingKeypaths=matchingKeypaths.map(concatenate(key));return matchingKeypaths}function concatenate(key){return function(keypath){return keypath.join(key)}}function normalise(ref){return ref?ref.replace(refPattern,".$1"):""}function add(root,keypath,d){if("string"!=typeof keypath||!is__isNumeric(d))throw new Error("Bad arguments");var value=void 0,changes=void 0;if(/\*/.test(keypath))return changes={},getMatchingKeypaths(root,getKeypath(normalise(keypath))).forEach(function(keypath){var value=root.viewmodel.get(keypath);if(!is__isNumeric(value))throw new Error(shared_add__errorMessage);changes[keypath.str]=value+d}),root.set(changes);if(value=root.get(keypath),!is__isNumeric(value))throw new Error(shared_add__errorMessage);return root.set(keypath,+value+d)}function Ractive$add(keypath,d){return shared_add(this,keypath,void 0===d?1:+d)}function Hook(event){this.event=event,this.method="on"+event,this.deprecate=deprecations[event]}function addToArray(array,value){var index=array.indexOf(value);-1===index&&array.push(value)}function arrayContains(array,value){for(var i=0,c=array.length;c>i;i++)if(array[i]==value)return!0;return!1}function arrayContentsMatch(a,b){var i;if(!isArray(a)||!isArray(b))return!1;if(a.length!==b.length)return!1;for(i=a.length;i--;)if(a[i]!==b[i])return!1;return!0}function ensureArray(x){return"string"==typeof x?[x]:void 0===x?[]:x}function lastItem(array){return array[array.length-1]}function removeFromArray(array,member){var index=array.indexOf(member);-1!==index&&array.splice(index,1)}function toArray(arrayLike){for(var array=[],i=arrayLike.length;i--;)array[i]=arrayLike[i];return array}function wait(callback){setTimeout(callback,0)}function makeDispatcher(handlers,result){return function(){for(var handler;handler=handlers.shift();)handler(result)}}function utils_Promise__resolve(promise,x,fulfil,reject){var then;if(x===promise)throw new TypeError("A promise's fulfillment handler cannot return the same promise");if(x instanceof _Promise)x.then(fulfil,reject);else if(!x||"object"!=typeof x&&"function"!=typeof x)fulfil(x);else{try{then=x.then}catch(e){return void reject(e)}if("function"==typeof then){var called,resolvePromise,rejectPromise;resolvePromise=function(y){called||(called=!0,utils_Promise__resolve(promise,y,fulfil,reject))},rejectPromise=function(r){called||(called=!0,reject(r))};try{then.call(x,resolvePromise,rejectPromise)}catch(e){if(!called)return reject(e),void(called=!0)}}else fulfil(x)}}function resolveRef(ractive,ref,fragment){var keypath;return ref=normalise(ref),"~/"===ref.substr(0,2)?(keypath=getKeypath(ref.substring(2)),createMappingIfNecessary(ractive,keypath.firstKey,fragment)):"."===ref[0]?(keypath=resolveAncestorRef(getInnerContext(fragment),ref),keypath&&createMappingIfNecessary(ractive,keypath.firstKey,fragment)):keypath=resolveAmbiguousReference(ractive,getKeypath(ref),fragment),keypath}function resolveAncestorRef(baseContext,ref){var contextKeys;if(void 0!=baseContext&&"string"!=typeof baseContext&&(baseContext=baseContext.str),"."===ref)return getKeypath(baseContext);if(contextKeys=baseContext?baseContext.split("."):[],"../"===ref.substr(0,3)){for(;"../"===ref.substr(0,3);){if(!contextKeys.length)throw new Error('Could not resolve reference - too many "../" prefixes');contextKeys.pop(),ref=ref.substring(3)}return contextKeys.push(ref),getKeypath(contextKeys.join("."))}return getKeypath(baseContext?baseContext+ref.replace(/^\.\//,"."):ref.replace(/^\.\/?/,""))}function resolveAmbiguousReference(ractive,ref,fragment,isParentLookup){var context,key,parentValue,hasContextChain,parentKeypath;if(ref.isRoot)return ref;for(key=ref.firstKey;fragment;)if(context=fragment.context,fragment=fragment.parent,context&&(hasContextChain=!0,parentValue=ractive.viewmodel.get(context),parentValue&&("object"==typeof parentValue||"function"==typeof parentValue)&&key in parentValue))return context.join(ref.str);return isRootProperty(ractive.viewmodel,key)?ref:ractive.parent&&!ractive.isolated&&(hasContextChain=!0,fragment=ractive.component.parentFragment,key=getKeypath(key),parentKeypath=resolveAmbiguousReference(ractive.parent,key,fragment,!0))?(ractive.viewmodel.map(key,{origin:ractive.parent.viewmodel,keypath:parentKeypath}),ref):isParentLookup||hasContextChain?void 0:(ractive.viewmodel.set(ref,void 0),ref)}function createMappingIfNecessary(ractive,key){var parentKeypath;!ractive.parent||ractive.isolated||isRootProperty(ractive.viewmodel,key)||(key=getKeypath(key),(parentKeypath=resolveAmbiguousReference(ractive.parent,key,ractive.component.parentFragment,!0))&&ractive.viewmodel.map(key,{origin:ractive.parent.viewmodel,keypath:parentKeypath}))}function isRootProperty(viewmodel,key){return""===key||key in viewmodel.data||key in viewmodel.computations||key in viewmodel.mappings}function teardown(x){x.teardown()}function methodCallers__unbind(x){x.unbind()}function methodCallers__unrender(x){x.unrender()}function cancel(x){x.cancel()}function detach(element){element.detach()}function detachNodes(tm){tm.detachNodes()}function check(tm){!tm.ready||tm.outros.length||tm.outroChildren||(tm.outrosComplete||(tm.parent?tm.parent.decrementOutros(tm):tm.detachNodes(),tm.outrosComplete=!0),tm.intros.length||tm.totalChildren||("function"==typeof tm.callback&&tm.callback(),tm.parent&&tm.parent.decrementTotal()))}function flushChanges(){for(var i,thing,changeHash;batch.ractives.length;)thing=batch.ractives.pop(),changeHash=thing.viewmodel.applyChanges(),changeHash&&changeHook.fire(thing,changeHash);for(attemptKeypathResolution(),i=0;i=0;i--)subscribers=ractive._subs[eventNames[i]],subscribers&&(bubble=notifySubscribers(ractive,subscribers,event,args)&&bubble);if(shared_eventStack.dequeue(ractive),ractive.parent&&bubble){if(initialFire&&ractive.component){var fullName=ractive.component.name+"."+eventNames[eventNames.length-1];eventNames=getKeypath(fullName).wildcardMatches(),event&&(event.component=ractive)}fireEventAs(ractive.parent,eventNames,event,args)}}function notifySubscribers(ractive,subscribers,event,args){var originalEvent=null,stopEvent=!1;event&&!event._noArg&&(args=[event].concat(args)),subscribers=subscribers.slice();for(var i=0,len=subscribers.length;len>i;i+=1)subscribers[i].apply(ractive,args)===!1&&(stopEvent=!0); return event&&!event._noArg&&stopEvent&&(originalEvent=event.original)&&(originalEvent.preventDefault&&originalEvent.preventDefault(),originalEvent.stopPropagation&&originalEvent.stopPropagation()),!stopEvent}function Ractive$fire(eventName){var options={args:Array.prototype.slice.call(arguments,1)};shared_fireEvent(this,eventName,options)}function Ractive$get(keypath){var value;return keypath=getKeypath(normalise(keypath)),value=this.viewmodel.get(keypath,options),void 0===value&&this.parent&&!this.isolated&&shared_resolveRef(this,keypath.str,this.component.parentFragment)&&(value=this.viewmodel.get(keypath)),value}function Ractive$insert(target,anchor){if(!this.fragment.rendered)throw new Error("The API has changed - you must call `ractive.render(target[, anchor])` to render your Ractive instance. Once rendered you can use `ractive.insert()`.");if(target=getElement(target),anchor=getElement(anchor)||null,!target)throw new Error("You must specify a valid target to insert into");target.insertBefore(this.detach(),anchor),this.el=target,(target.__ractive_instances__||(target.__ractive_instances__=[])).push(this),this.detached=null,fireInsertHook(this)}function fireInsertHook(ractive){insertHook.fire(ractive),ractive.findAllComponents("*").forEach(function(child){fireInsertHook(child.instance)})}function Ractive$merge(keypath,array,options){var currentArray,promise;return keypath=getKeypath(normalise(keypath)),currentArray=this.viewmodel.get(keypath),isArray(currentArray)&&isArray(array)?(promise=global_runloop.start(this,!0),this.viewmodel.merge(keypath,currentArray,array,options),global_runloop.end(),promise):this.set(keypath,array,options&&options.complete)}function getPattern(ractive,pattern){var matchingKeypaths,values;return matchingKeypaths=getMatchingKeypaths(ractive,pattern),values={},matchingKeypaths.forEach(function(keypath){values[keypath.str]=ractive.get(keypath.str)}),values}function getObserverFacade(ractive,keypath,callback,options){var observer,isPatternObserver,cancelled;keypath=getKeypath(normalise(keypath)),options=options||emptyObject,keypath.isPattern?(observer=new observe_PatternObserver(ractive,keypath,callback,options),ractive.viewmodel.patternObservers.push(observer),isPatternObserver=!0):observer=new observe_Observer(ractive,keypath,callback,options),observer.init(options.init),ractive.viewmodel.register(keypath,observer,isPatternObserver?"patternObservers":"observers"),observer.ready=!0;var facade={cancel:function(){var index;cancelled||(isPatternObserver?(index=ractive.viewmodel.patternObservers.indexOf(observer),ractive.viewmodel.patternObservers.splice(index,1),ractive.viewmodel.unregister(keypath,observer,"patternObservers")):ractive.viewmodel.unregister(keypath,observer,"observers"),cancelled=!0)}};return ractive._observers.push(facade),facade}function Ractive$observe(keypath,callback,options){var observers,map,keypaths,i;if(isObject(keypath)){options=callback,map=keypath,observers=[];for(keypath in map)map.hasOwnProperty(keypath)&&(callback=map[keypath],observers.push(this.observe(keypath,callback,options)));return{cancel:function(){for(;observers.length;)observers.pop().cancel()}}}if("function"==typeof keypath)return options=callback,callback=keypath,keypath="",observe_getObserverFacade(this,keypath,callback,options);if(keypaths=keypath.split(" "),1===keypaths.length)return observe_getObserverFacade(this,keypath,callback,options);for(observers=[],i=keypaths.length;i--;)keypath=keypaths[i],keypath&&observers.push(observe_getObserverFacade(this,keypath,callback,options));return{cancel:function(){for(;observers.length;)observers.pop().cancel()}}}function Ractive$observeOnce(property,callback,options){var observer=this.observe(property,function(){callback.apply(this,arguments),observer.cancel()},{init:!1,defer:options&&options.defer});return observer}function Ractive$off(eventName,callback){var eventNames,_this=this;if(eventName)eventNames=eventName.split(" ").map(shared_trim).filter(notEmptyString),eventNames.forEach(function(eventName){var subscribers,index;(subscribers=_this._subs[eventName])&&(callback?(index=subscribers.indexOf(callback),-1!==index&&subscribers.splice(index,1)):_this._subs[eventName]=[])});else for(eventName in this._subs)delete this._subs[eventName];return this}function Ractive$on(eventName,callback){var listeners,n,eventNames,_this=this;if("object"==typeof eventName){listeners=[];for(n in eventName)eventName.hasOwnProperty(n)&&listeners.push(this.on(n,eventName[n]));return{cancel:function(){for(var listener;listener=listeners.pop();)listener.cancel()}}}return eventNames=eventName.split(" ").map(shared_trim).filter(notEmptyString),eventNames.forEach(function(eventName){(_this._subs[eventName]||(_this._subs[eventName]=[])).push(callback)}),{cancel:function(){return _this.off(eventName,callback)}}}function Ractive$once(eventName,handler){var listener=this.on(eventName,function(){handler.apply(this,arguments),listener.cancel()});return listener}function getNewIndices(array,methodName,args){var spliceArguments,len,removeStart,removeEnd,balance,i,newIndices=[];if(spliceArguments=getSpliceEquivalent(array,methodName,args),!spliceArguments)return null;for(len=array.length,balance=spliceArguments.length-2-spliceArguments[1],removeStart=Math.min(len,spliceArguments[0]),removeEnd=removeStart+spliceArguments[1],i=0;removeStart>i;i+=1)newIndices.push(i);for(;removeEnd>i;i+=1)newIndices.push(-1);for(;len>i;i+=1)newIndices.push(i+balance);return 0!==balance?newIndices.touchedFrom=spliceArguments[0]:newIndices.touchedFrom=array.length,newIndices}function getSpliceEquivalent(array,methodName,args){switch(methodName){case"splice":for(void 0!==args[0]&&args[0]<0&&(args[0]=array.length+Math.max(args[0],-array.length));args.length<2;)args.push(0);return args[1]=Math.min(args[1],array.length-args[0]),args;case"sort":case"reverse":return null;case"pop":return array.length?[array.length-1,1]:[0,0];case"push":return[array.length,0].concat(args);case"shift":return[0,array.length?1:0];case"unshift":return[0,0].concat(args)}}function Ractive$render(target,anchor){var promise,instances,transitionsEnabled,_this=this;if(transitionsEnabled=this.transitionsEnabled,this.noIntro&&(this.transitionsEnabled=!1),promise=global_runloop.start(this,!0),global_runloop.scheduleTask(function(){return renderHook.fire(_this)},!0),this.fragment.rendered)throw new Error("You cannot call ractive.render() on an already rendered instance! Call ractive.unrender() first");if(target=getElement(target)||this.el,anchor=getElement(anchor)||this.anchor,this.el=target,this.anchor=anchor,!this.append&&target){var others=target.__ractive_instances__;others&&others.length&&removeOtherInstances(others),target.innerHTML=""}return this.cssId&&global_css.apply(),target&&((instances=target.__ractive_instances__)?instances.push(this):target.__ractive_instances__=[this],anchor?target.insertBefore(this.fragment.render(),anchor):target.appendChild(this.fragment.render())),global_runloop.end(),this.transitionsEnabled=transitionsEnabled,promise.then(function(){return completeHook.fire(_this)})}function removeOtherInstances(others){others.splice(0,others.length).forEach(teardown)}function custom_adapt__combine(a,b){for(var c=a.slice(),i=b.length;i--;)~c.indexOf(b[i])||c.push(b[i]);return c}function transformCss(css,id){var transformed,dataAttr,addGuid;return dataAttr='[data-ractive-css~="{'+id+'}"]',addGuid=function(selector){var selectorUnits,match,unit,base,prepended,appended,i,transformed=[];for(selectorUnits=[];match=selectorUnitPattern.exec(selector);)selectorUnits.push({str:match[0],base:match[1],modifiers:match[2]});for(base=selectorUnits.map(extractString),i=selectorUnits.length;i--;)appended=base.slice(),unit=selectorUnits[i],appended[i]=unit.base+dataAttr+unit.modifiers||"",prepended=base.slice(),prepended[i]=dataAttr+" "+prepended[i],transformed.push(appended.join(" "),prepended.join(" "));return transformed.join(", ")},transformed=dataRvcGuidPattern.test(css)?css.replace(dataRvcGuidPattern,dataAttr):css.replace(commentsPattern,"").replace(selectorsPattern,function(match,$1){var selectors,transformed;return mediaQueryPattern.test($1)?match:(selectors=$1.split(",").map(trim),transformed=selectors.map(addGuid).join(", ")+" ",match.replace($1,transformed))})}function trim(str){return str.trim?str.trim():str.replace(/^\s+/,"").replace(/\s+$/,"")}function extractString(unit){return unit.str}function validate(data){data&&data.constructor!==Object&&("function"==typeof data||("object"!=typeof data?fatal("data option must be an object or a function, `"+data+"` is not valid"):warnIfDebug("If supplied, options.data should be a plain JavaScript object - using a non-POJO as the root object may work, but is discouraged")))}function custom_data__combine(parentValue,childValue){validate(childValue);var parentIsFn="function"==typeof parentValue,childIsFn="function"==typeof childValue;return childValue||parentIsFn||(childValue={}),parentIsFn||childIsFn?function(){var child=childIsFn?callDataFunction(childValue,this):childValue,parent=parentIsFn?callDataFunction(parentValue,this):parentValue;return fromProperties(child,parent)}:fromProperties(childValue,parentValue)}function callDataFunction(fn,context){var data=fn.call(context);if(data)return"object"!=typeof data&&fatal("Data function must return an object"),data.constructor!==Object&&warnOnceIfDebug("Data function returned something other than a plain JavaScript object. This might work, but is strongly discouraged"),data}function fromProperties(primary,secondary){if(primary&&secondary){for(var key in secondary)key in primary||(primary[key]=secondary[key]);return primary}return primary||secondary}function readDelimiterChange(parser){var start,opening,closing;return parser.matchString("=")?(start=parser.pos,parser.allowWhitespace(),(opening=parser.matchPattern(delimiterChangePattern))?parser.matchPattern(whitespacePattern)?(closing=parser.matchPattern(delimiterChangePattern))?(parser.allowWhitespace(),parser.matchString("=")?[opening,closing]:(parser.pos=start,null)):(parser.pos=start,null):null:(parser.pos=start,null)):null}function readRegexpLiteral__readNumberLiteral(parser){var result;return(result=parser.matchPattern(regexpPattern))?{t:REGEXP_LITERAL,v:result}:null}function readMustache(parser){var mustache,i;if(parser.interpolate[parser.inside]===!1)return null;for(i=0;i")?(parser.allowWhitespace(),nameStart=parser.pos,parser.relaxedNames=!0,expression=converters_readExpression(parser),parser.relaxedNames=!1,parser.allowWhitespace(),context=converters_readExpression(parser),parser.allowWhitespace(),expression?(partial={t:PARTIAL},utils_refineExpression(expression,partial),parser.allowWhitespace(),context&&(partial={t:SECTION,n:SECTION_WITH,f:[partial]},utils_refineExpression(context,partial)),parser.matchString(tag.close)||parser.error("Expected closing delimiter '"+tag.close+"'"),partial):null):null}function readComment(parser,tag){var index;return parser.matchString("!")?(index=parser.remaining().indexOf(tag.close),-1!==index?(parser.pos+=index+tag.close.length,{t:COMMENT}):void 0):null}function readExpressionOrReference(parser,expectedFollowers){var start,expression,i;if(start=parser.pos,expression=converters_readExpression(parser),!expression)return null;for(i=0;i')"),content=remaining.substr(0,endIndex),parser.pos+=endIndex+3,comment={t:COMMENT,c:content},parser.includeLinePositions&&(comment.p=parser.getLinePos(start)),comment):null}function decodeCharacterReferences(html){return html.replace(entityPattern,function(match,entity){var code;return code="#"!==entity[0]?htmlEntities[entity]:"x"===entity[1]?parseInt(entity.substring(2),16):parseInt(entity.substring(1),10),code?String.fromCharCode(validateCode(code)):match})}function validateCode(code){return code?10===code?32:128>code?code:159>=code?controlCharacters[code-128]:55296>code?code:57343>=code?65533:65535>=code?code:65533:65533}function escapeHtml(str){return str.replace(amp,"&").replace(lessThan,"<").replace(greaterThan,">")}function isString(item){return"string"==typeof item}function isComment(item){return item.t===COMMENT||item.t===DELIMCHANGE}function isSection(item){return(item.t===SECTION||item.t===INVERTED)&&item.f}function cleanup(items,stripComments,preserveWhitespace,removeLeadingWhitespace,removeTrailingWhitespace){var i,item,previousItem,nextItem,preserveWhitespaceInsideFragment,removeLeadingWhitespaceInsideFragment,removeTrailingWhitespaceInsideFragment,key;for(stripStandalones(items),i=items.length;i--;)item=items[i],item.exclude?items.splice(i,1):stripComments&&item.t===COMMENT&&items.splice(i,1);for(trimWhitespace(items,removeLeadingWhitespace?utils_cleanup__leadingWhitespace:null,removeTrailingWhitespace?trailingWhitespace:null),i=items.length;i--;){if(item=items[i],item.f){var isPreserveWhitespaceElement=item.t===ELEMENT&&preserveWhitespaceElements.test(item.e);preserveWhitespaceInsideFragment=preserveWhitespace||isPreserveWhitespaceElement,!preserveWhitespace&&isPreserveWhitespaceElement&&trimWhitespace(item.f,leadingNewLine,trailingNewLine),preserveWhitespaceInsideFragment||(previousItem=items[i-1],nextItem=items[i+1],(!previousItem||"string"==typeof previousItem&&trailingWhitespace.test(previousItem))&&(removeLeadingWhitespaceInsideFragment=!0),(!nextItem||"string"==typeof nextItem&&utils_cleanup__leadingWhitespace.test(nextItem))&&(removeTrailingWhitespaceInsideFragment=!0)),cleanup(item.f,stripComments,preserveWhitespaceInsideFragment,removeLeadingWhitespaceInsideFragment,removeTrailingWhitespaceInsideFragment)}if(item.l&&(cleanup(item.l.f,stripComments,preserveWhitespace,removeLeadingWhitespaceInsideFragment,removeTrailingWhitespaceInsideFragment),items.splice(i+1,0,item.l),delete item.l),item.a)for(key in item.a)item.a.hasOwnProperty(key)&&"string"!=typeof item.a[key]&&cleanup(item.a[key],stripComments,preserveWhitespace,removeLeadingWhitespaceInsideFragment,removeTrailingWhitespaceInsideFragment);if(item.m&&cleanup(item.m,stripComments,preserveWhitespace,removeLeadingWhitespaceInsideFragment,removeTrailingWhitespaceInsideFragment),item.v)for(key in item.v)item.v.hasOwnProperty(key)&&(isArray(item.v[key].n)&&cleanup(item.v[key].n,stripComments,preserveWhitespace,removeLeadingWhitespaceInsideFragment,removeTrailingWhitespaceInsideFragment),isArray(item.v[key].d)&&cleanup(item.v[key].d,stripComments,preserveWhitespace,removeLeadingWhitespaceInsideFragment,removeTrailingWhitespaceInsideFragment))}for(i=items.length;i--;)"string"==typeof items[i]&&("string"==typeof items[i+1]&&(items[i]=items[i]+items[i+1],items.splice(i+1,1)),preserveWhitespace||(items[i]=items[i].replace(contiguousWhitespace," ")),""===items[i]&&items.splice(i,1))}function readClosingTag(parser){var start,tag;return start=parser.pos,parser.matchString("\s]/.test(parser.nextChar())||parser.error("Expected `=`, `/`, `>` or whitespace"),parser.allowWhitespace(),parser.matchString("=")?(parser.allowWhitespace(),valueStart=parser.pos,startDepth=parser.sectionDepth,value=readQuotedAttributeValue(parser,"'")||readQuotedAttributeValue(parser,'"')||readUnquotedAttributeValue(parser),null===value&&parser.error("Expected valid attribute value"),parser.sectionDepth!==startDepth&&(parser.pos=valueStart,parser.error("An attribute value must contain as many opening section tags as closing section tags")),value.length?1===value.length&&"string"==typeof value[0]?decodeCharacterReferences(value[0]):value:""):(parser.pos=start,null)}function readUnquotedAttributeValueToken(parser){var start,text,haystack,needles,index;return start=parser.pos,(text=parser.matchPattern(unquotedAttributeValueTextPattern))?(haystack=text,needles=parser.tags.map(function(t){return t.open}),-1!==(index=getLowestIndex(haystack,needles))&&(text=text.substr(0,index),parser.pos=start+text.length),text):null}function readUnquotedAttributeValue(parser){var tokens,token;for(parser.inAttribute=!0,tokens=[],token=converters_readMustache(parser)||readUnquotedAttributeValueToken(parser);null!==token;)tokens.push(token),token=converters_readMustache(parser)||readUnquotedAttributeValueToken(parser);return tokens.length?(parser.inAttribute=!1,tokens):null}function readQuotedAttributeValue(parser,quoteMark){var start,tokens,token;if(start=parser.pos,!parser.matchString(quoteMark))return null;for(parser.inAttribute=quoteMark,tokens=[],token=converters_readMustache(parser)||readQuotedStringToken(parser,quoteMark);null!==token;)tokens.push(token),token=converters_readMustache(parser)||readQuotedStringToken(parser,quoteMark);return parser.matchString(quoteMark)?(parser.inAttribute=!1,tokens):(parser.pos=start,null)}function readQuotedStringToken(parser,quoteMark){var start,index,haystack,needles;return start=parser.pos,haystack=parser.remaining(),needles=parser.tags.map(function(t){return t.open}),needles.push(quoteMark),index=getLowestIndex(haystack,needles),-1===index&&parser.error("Quoted attribute value must have a closing quote"),index?(parser.pos+=index,haystack.substr(0,index)):null}function getKeyValuePair(parser){var key,valueToken,pair;return parser.allowWhitespace(),(key=shared_readKey(parser))?(pair={key:key},parser.allowWhitespace(),parser.matchString(":")?(parser.allowWhitespace(),(valueToken=parser.read())?(pair.value=valueToken.v,pair):null):null):null}function processDirective(tokens,parentParser){var result,match,parser,args,token,colonIndex,directiveName,directiveArgs,parsed;if("string"==typeof tokens){if(match=methodCallPattern.exec(tokens)){ var end=tokens.lastIndexOf(")");return methodCallExcessPattern.test(tokens)||parentParser.error("Invalid input after method call expression '"+tokens.slice(end+1)+"'"),result={m:match[1]},args="["+tokens.slice(result.m.length+1,end)+"]",parser=new ExpressionParser(args),result.a=utils_flattenExpression(parser.result[0]),result}if(-1===tokens.indexOf(":"))return tokens.trim();tokens=[tokens]}if(result={},directiveName=[],directiveArgs=[],tokens){for(;tokens.length;)if(token=tokens.shift(),"string"==typeof token){if(colonIndex=token.indexOf(":"),-1!==colonIndex){colonIndex&&directiveName.push(token.substr(0,colonIndex)),token.length>colonIndex+1&&(directiveArgs[0]=token.substring(colonIndex+1));break}directiveName.push(token)}else directiveName.push(token);directiveArgs=directiveArgs.concat(tokens)}return directiveName.length?directiveArgs.length||"string"!=typeof directiveName?(result={n:1===directiveName.length&&"string"==typeof directiveName[0]?directiveName[0]:directiveName},1===directiveArgs.length&&"string"==typeof directiveArgs[0]?(parsed=parseJSON("["+directiveArgs[0]+"]"),result.a=parsed?parsed.value:directiveArgs[0].trim()):result.d=directiveArgs):result=directiveName:result="",result}function readElement(parser){var start,element,directiveName,match,addProxyEvent,attribute,directive,selfClosing,children,partials,hasPartials,child,closed,pos,remaining,closingTag;if(start=parser.pos,parser.inside||parser.inAttribute)return null;if(!parser.matchString("<"))return null;if("/"===parser.nextChar())return null;if(element={},parser.includeLinePositions&&(element.p=parser.getLinePos(start)),parser.matchString("!"))return element.t=DOCTYPE,parser.matchPattern(/^doctype/i)||parser.error("Expected DOCTYPE declaration"),element.a=parser.matchPattern(/^(.+?)>/),element;if(element.t=ELEMENT,element.e=parser.matchPattern(tagNamePattern),!element.e)return null;for(validTagNameFollower.test(parser.nextChar())||parser.error("Illegal tag name"),addProxyEvent=function(name,directive){var directiveName=directive.n||directive;reservedEventNames.test(directiveName)&&(parser.pos-=directiveName.length,parser.error("Cannot use reserved event names (change, reset, teardown, update, construct, config, init, render, unrender, detach, insert)")),element.v[name]=directive},parser.allowWhitespace();attribute=converters_readMustache(parser)||element_readAttribute(parser);)attribute.name?(directiveName=directives[attribute.name])?element[directiveName]=element_processDirective(attribute.value,parser):(match=proxyEventPattern.exec(attribute.name))?(element.v||(element.v={}),directive=element_processDirective(attribute.value,parser),addProxyEvent(match[1],directive)):parser.sanitizeEventAttributes&&onPattern.test(attribute.name)||(element.a||(element.a={}),element.a[attribute.name]=attribute.value||(""===attribute.value?"":0)):(element.m||(element.m=[]),element.m.push(attribute)),parser.allowWhitespace();if(parser.allowWhitespace(),parser.matchString("/")&&(selfClosing=!0),!parser.matchString(">"))return null;var lowerCaseName=element.e.toLowerCase(),preserveWhitespace=parser.preserveWhitespace;if(!selfClosing&&!voidElementNames.test(element.e)){parser.elementStack.push(lowerCaseName),("script"===lowerCaseName||"style"===lowerCaseName)&&(parser.inside=lowerCaseName),children=[],partials=create(null);do if(pos=parser.pos,remaining=parser.remaining(),canContain(lowerCaseName,remaining))if(closingTag=element_readClosingTag(parser)){closed=!0;var closingTagName=closingTag.e.toLowerCase();if(closingTagName!==lowerCaseName&&(parser.pos=pos,!~parser.elementStack.indexOf(closingTagName))){var errorMessage="Unexpected closing tag";voidElementNames.test(closingTagName)&&(errorMessage+=" (<"+closingTagName+"> is a void element - it cannot contain children)"),parser.error(errorMessage)}}else(child=section_readClosing(parser,{open:parser.standardDelimiters[0],close:parser.standardDelimiters[1]}))?(closed=!0,parser.pos=pos):(child=parser.read(PARTIAL_READERS))?(partials[child.n]&&(parser.pos=pos,parser.error("Duplicate partial definition")),utils_cleanup(child.f,parser.stripComments,preserveWhitespace,!preserveWhitespace,!preserveWhitespace),partials[child.n]=child.f,hasPartials=!0):(child=parser.read(READERS))?children.push(child):closed=!0;else closed=!0;while(!closed);children.length&&(element.f=children),hasPartials&&(element.p=partials),parser.elementStack.pop()}return parser.inside=null,parser.sanitizeElements&&-1!==parser.sanitizeElements.indexOf(lowerCaseName)?exclude:element}function canContain(name,remaining){var match,disallowed;return match=/^<([a-zA-Z][a-zA-Z0-9]*)/.exec(remaining),disallowed=disallowedContents[name],match&&disallowed?!~disallowed.indexOf(match[1].toLowerCase()):!0}function readText(parser){var index,remaining,disallowed,barrier;return remaining=parser.remaining(),barrier=parser.inside?"","`"):parser.inAttribute?disallowed.push(parser.inAttribute):disallowed.push(barrier),index=getLowestIndex(remaining,disallowed)),index?(-1===index&&(index=remaining.length),parser.pos+=index,parser.inside?remaining.substr(0,index):decodeCharacterReferences(remaining.substr(0,index))):null}function escapeRegExp(str){return str.replace(utils_escapeRegExp__pattern,"\\$&")}function readPartialDefinitionComment(parser){var firstPos=parser.pos,open=parser.standardDelimiters[0],close=parser.standardDelimiters[1],content=void 0,closed=void 0;if(!parser.matchPattern(startPattern)||!parser.matchString(open))return parser.pos=firstPos,null;var name=parser.matchPattern(namePattern);if(warnOnceIfDebug("Inline partial comments are deprecated.\nUse this...\n {{#partial "+name+"}} ... {{/partial}}\n\n...instead of this:\n ... '"),!parser.matchString(close)||!parser.matchPattern(finishPattern))return parser.pos=firstPos,null;content=[];var endPattern=new RegExp("^");do parser.matchPattern(endPattern)?closed=!0:(child=parser.read(READERS),child||parser.error("expected closing comment ('')"),content.push(child));while(!closed);return{t:INLINE_PARTIAL,f:content,n:name}}function readPartialDefinitionSection(parser){var start,name,content,child,closed;start=parser.pos;var delimiters=parser.standardDelimiters;if(!parser.matchString(delimiters[0]))return null;if(!parser.matchPattern(partialDefinitionSectionPattern))return parser.pos=start,null;name=parser.matchPattern(/^[a-zA-Z_$][a-zA-Z_$0-9\-]*/),name||parser.error("expected legal partial name"),parser.matchString(delimiters[1])||parser.error("Expected closing delimiter '"+delimiters[1]+"'"),content=[];do(child=section_readClosing(parser,{open:parser.standardDelimiters[0],close:parser.standardDelimiters[1]}))?("partial"===!child.r&&parser.error("Expected "+delimiters[0]+"/partial"+delimiters[1]),closed=!0):(child=parser.read(READERS),child||parser.error("Expected "+delimiters[0]+"/partial"+delimiters[1]),content.push(child));while(!closed);return{t:INLINE_PARTIAL,n:name,f:content}}function readTemplate(parser){for(var fragment=[],partials=create(null),hasPartials=!1,preserveWhitespace=parser.preserveWhitespace;parser.pos element")}return"textContent"in template?template.textContent:template.innerHTML}function isHashedId(id){return id&&"#"===id[0]}function isParsed(template){return!("string"==typeof template)}function getParseOptions(ractive){return ractive.defaults&&(ractive=ractive.defaults),parseOptions.reduce(function(val,key){return val[key]=ractive[key],val},{})}function resetValue(ractive){var result,initial=ractive._config.template;if(initial&&initial.fn)return result=getDynamicTemplate(ractive,initial.fn),result!==initial.result?(initial.result=result,result=parseIfString(result,ractive)):void 0}function getDynamicTemplate(ractive,fn){var helper=template_template__createHelper(template_parser.getParseOptions(ractive));return fn.call(ractive,helper)}function template_template__createHelper(parseOptions){var helper=create(template_parser);return helper.parse=function(template,options){return template_parser.parse(template,options||parseOptions)},helper}function parseIfString(template,ractive){if("string"==typeof template)"#"===template[0]&&(template=template_parser.fromId(template)),template=_parse(template,template_parser.getParseOptions(ractive));else{if(void 0==template)throw new Error("The template cannot be "+template+".");if("number"!=typeof template.v)throw new Error("The template parser was passed a non-string template, but the template doesn't have a version. Make sure you're passing in the template you think you are.");if(template.v!==TEMPLATE_VERSION)throw new Error("Mismatched template version (expected "+TEMPLATE_VERSION+", got "+template.v+") Please ensure you are using the latest version of Ractive.js in your build process as well as in your app")}return template}function extendPartials(existingPartials,newPartials,overwrite){if(newPartials)for(var key in newPartials)(overwrite||!existingPartials.hasOwnProperty(key))&&(existingPartials[key]=newPartials[key])}function wrap(parent,name,method){if(!/_super/.test(method))return method;var wrapper=function(){var result,superMethod=getSuperMethod(wrapper._parent,name),hasSuper="_super"in this,oldSuper=this._super;return this._super=superMethod,result=method.apply(this,arguments),hasSuper?this._super=oldSuper:delete this._super,result};return wrapper._parent=parent,wrapper._method=method,wrapper}function getSuperMethod(parent,name){var value,method;return name in parent?(value=parent[name],method="function"==typeof value?value:function(){return value}):method=noop,method}function getMessage(deprecated,correct,isError){return"options."+deprecated+" has been deprecated in favour of options."+correct+"."+(isError?" You cannot specify both options, please use options."+correct+".":"")}function deprecateOption(options,deprecatedOption,correct){if(deprecatedOption in options){if(correct in options)throw new Error(getMessage(deprecatedOption,correct,!0));warnIfDebug(getMessage(deprecatedOption,correct)),options[correct]=options[deprecatedOption]}}function deprecate(options){deprecateOption(options,"beforeInit","onconstruct"),deprecateOption(options,"init","onrender"),deprecateOption(options,"complete","oncomplete"),deprecateOption(options,"eventDefinitions","events"),isArray(options.adaptors)&&deprecateOption(options,"adaptors","adapt")}function configure(method,Parent,target,options){config_deprecate(options);for(var key in options)if(isStandardKey.hasOwnProperty(key)){var value=options[key];"el"!==key&&"function"==typeof value?warnIfDebug(""+key+" is a Ractive option that does not expect a function and will be ignored","init"===method?target:null):target[key]=value}config_registries.forEach(function(registry){registry[method](Parent,target,options)}),custom_adapt[method](Parent,target,options),template_template[method](Parent,target,options),css_css[method](Parent,target,options),extendOtherMethods(Parent.prototype,target,options)}function extendOtherMethods(parent,target,options){for(var key in options)if(!isBlacklisted[key]&&options.hasOwnProperty(key)){var member=options[key];"function"==typeof member&&(member=wrapPrototype(parent,key,member)),target[key]=member}}function makeObj(array){var obj={};return array.forEach(function(x){return obj[x]=!0}),obj}function Fragment$bubble(){this.dirtyValue=this.dirtyArgs=!0,this.bound&&"function"==typeof this.owner.bubble&&this.owner.bubble()}function Fragment$detach(){var docFrag;return 1===this.items.length?this.items[0].detach():(docFrag=document.createDocumentFragment(),this.items.forEach(function(item){var node=item.detach();node&&docFrag.appendChild(node)}),docFrag)}function Fragment$find(selector){var i,len,item,queryResult;if(this.items){for(len=this.items.length,i=0;len>i;i+=1)if(item=this.items[i],item.find&&(queryResult=item.find(selector)))return queryResult;return null}}function Fragment$findAll(selector,query){var i,len,item;if(this.items)for(len=this.items.length,i=0;len>i;i+=1)item=this.items[i],item.findAll&&item.findAll(selector,query);return query}function Fragment$findAllComponents(selector,query){var i,len,item;if(this.items)for(len=this.items.length,i=0;len>i;i+=1)item=this.items[i],item.findAllComponents&&item.findAllComponents(selector,query);return query}function Fragment$findComponent(selector){var len,i,item,queryResult;if(this.items){for(len=this.items.length,i=0;len>i;i+=1)if(item=this.items[i],item.findComponent&&(queryResult=item.findComponent(selector)))return queryResult;return null}}function Fragment$findNextNode(item){var node,index=item.index;return node=this.items[index+1]?this.items[index+1].firstNode():this.owner===this.root?this.owner.component?this.owner.component.findNextNode():null:this.owner.findNextNode(this)}function Fragment$firstNode(){return this.items&&this.items[0]?this.items[0].firstNode():null}function processItems(items,values,guid,counter){return counter=counter||0,items.map(function(item){var placeholderId,wrapped,value;return item.text?item.text:item.fragments?item.fragments.map(function(fragment){return processItems(fragment.items,values,guid,counter)}).join(""):(placeholderId=guid+"-"+counter++,value=item.keypath&&(wrapped=item.root.viewmodel.wrapped[item.keypath.str])?wrapped.value:item.getValue(),values[placeholderId]=value,"${"+placeholderId+"}")}).join("")}function Fragment$getArgsList(){var values,source,parsed,result;return this.dirtyArgs&&(source=shared_processItems(this.items,values={},this.root._guid),parsed=parseJSON("["+source+"]",values),result=parsed?parsed.value:[this.toString()],this.argsList=result,this.dirtyArgs=!1),this.argsList}function Fragment$getNode(){var fragment=this;do if(fragment.pElement)return fragment.pElement.node;while(fragment=fragment.parent);return this.root.detached||this.root.el}function Fragment$getValue(){var values,source,parsed,result;return this.dirtyValue&&(source=shared_processItems(this.items,values={},this.root._guid),parsed=parseJSON(source,values),result=parsed?parsed.value:this.toString(),this.value=result,this.dirtyValue=!1),this.value}function shared_unbind__unbind(){this.registered&&this.root.viewmodel.unregister(this.keypath,this),this.resolver&&this.resolver.unbind()}function Mustache$getValue(){return this.value}function getProp(target,prop){for(var value,i=0;i=keypaths.length?"_"+$1:(keypath=keypaths[$1],void 0===keypath?"undefined":keypath.isSpecial?(value=keypath.value,"number"==typeof value?value:'"'+value+'"'):keypath.str)})}function createExpressionKeypath(uniqueString){return getKeypath("${"+uniqueString.replace(/[\.\[\]]/g,"-").replace(/\*/,"#MUL#")+"}")}function isValidDependency(keypath){return void 0!==keypath&&"@"!==keypath[0]}function wrapFunction(fn,ractive){var wrapped,prop,key;if(fn.__ractive_nowrap)return fn;if(prop="__ractive_"+ractive._guid,wrapped=fn[prop])return wrapped;if(/this/.test(fn.toString())){defineProperty(fn,prop,{value:Resolvers_ExpressionResolver__bind.call(fn,ractive),configurable:!0});for(key in fn)fn.hasOwnProperty(key)&&(fn[prop][key]=fn[key]);return ractive._boundFunctions.push({fn:fn,prop:prop}),fn[prop]}return defineProperty(fn,"__ractive_nowrap",{value:fn}),fn.__ractive_nowrap}function ReferenceExpressionResolver_ReferenceExpressionResolver__getValue(member){return member.value}function isDefined(value){return void 0!=value}function forceResolution(member){member.forceResolution()}function Mustache$init(mustache,options){function resolve(keypath){mustache.resolve(keypath)}function resolveAndRebindChildren(newKeypath){var oldKeypath=mustache.keypath;newKeypath!=oldKeypath&&(mustache.resolve(newKeypath),void 0!==oldKeypath&&mustache.fragments&&mustache.fragments.forEach(function(f){f.rebind(oldKeypath,newKeypath)}))}var ref,parentFragment,template;parentFragment=options.parentFragment,template=options.template,mustache.root=parentFragment.root,mustache.parentFragment=parentFragment,mustache.pElement=parentFragment.pElement,mustache.template=options.template,mustache.index=options.index||0,mustache.isStatic=options.template.s,mustache.type=options.template.t,mustache.registered=!1,(ref=template.r)&&(mustache.resolver=Resolvers_createReferenceResolver(mustache,ref,resolve)),options.template.x&&(mustache.resolver=new Resolvers_ExpressionResolver(mustache,parentFragment,options.template.x,resolveAndRebindChildren)),options.template.rx&&(mustache.resolver=new ReferenceExpressionResolver_ReferenceExpressionResolver(mustache,options.template.rx,resolveAndRebindChildren)),mustache.template.n!==SECTION_UNLESS||mustache.hasOwnProperty("value")||mustache.setValue(void 0)}function Mustache$resolve(keypath){var wasResolved,value,twowayBinding;return keypath&&keypath.isSpecial?(this.keypath=keypath,void this.setValue(keypath.value)):(this.registered&&(this.root.viewmodel.unregister(this.keypath,this),this.registered=!1,wasResolved=!0),this.keypath=keypath,void 0!=keypath&&(value=this.root.viewmodel.get(keypath),this.root.viewmodel.register(keypath,this),this.registered=!0),this.setValue(value),void(wasResolved&&(twowayBinding=this.twowayBinding)&&twowayBinding.rebound()))}function Mustache$rebind(oldKeypath,newKeypath){this.fragments&&this.fragments.forEach(function(f){return f.rebind(oldKeypath,newKeypath)}),this.resolver&&this.resolver.rebind(oldKeypath,newKeypath)}function Section$bubble(){this.parentFragment.bubble()}function Section$detach(){var docFrag;return 1===this.fragments.length?this.fragments[0].detach():(docFrag=document.createDocumentFragment(),this.fragments.forEach(function(item){docFrag.appendChild(item.detach())}),docFrag)}function Section$find(selector){var i,len,queryResult;for(len=this.fragments.length,i=0;len>i;i+=1)if(queryResult=this.fragments[i].find(selector))return queryResult;return null}function Section$findAll(selector,query){var i,len;for(len=this.fragments.length,i=0;len>i;i+=1)this.fragments[i].findAll(selector,query)}function Section$findAllComponents(selector,query){var i,len;for(len=this.fragments.length,i=0;len>i;i+=1)this.fragments[i].findAllComponents(selector,query)}function Section$findComponent(selector){var i,len,queryResult;for(len=this.fragments.length,i=0;len>i;i+=1)if(queryResult=this.fragments[i].findComponent(selector))return queryResult;return null}function Section$findNextNode(fragment){return this.fragments[fragment.index+1]?this.fragments[fragment.index+1].firstNode():this.parentFragment.findNextNode(this)}function Section$firstNode(){var len,i,node;if(len=this.fragments.length)for(i=0;len>i;i+=1)if(node=this.fragments[i].firstNode())return node;return this.parentFragment.findNextNode(this)}function Section$shuffle(newIndices){var parentFragment,firstChange,i,newLength,reboundFragments,fragmentOptions,fragment,_this=this;if(!this.shuffling&&!this.unbound&&this.currentSubtype===SECTION_EACH){if(this.shuffling=!0,global_runloop.scheduleTask(function(){return _this.shuffling=!1}),parentFragment=this.parentFragment,reboundFragments=[],newIndices.forEach(function(newIndex,oldIndex){var fragment,by,oldKeypath,newKeypath,deps;return newIndex===oldIndex?void(reboundFragments[newIndex]=_this.fragments[oldIndex]):(fragment=_this.fragments[oldIndex],void 0===firstChange&&(firstChange=oldIndex),-1===newIndex?(_this.fragmentsToUnrender.push(fragment),void fragment.unbind()):(by=newIndex-oldIndex,oldKeypath=_this.keypath.join(oldIndex),newKeypath=_this.keypath.join(newIndex),fragment.index=newIndex,(deps=fragment.registeredIndexRefs)&&deps.forEach(shuffle__blindRebind),fragment.rebind(oldKeypath,newKeypath),void(reboundFragments[newIndex]=fragment)))}),newLength=this.root.viewmodel.get(this.keypath).length,void 0===firstChange){if(this.length===newLength)return;firstChange=this.length}for(this.length=this.fragments.length=newLength,this.rendered&&global_runloop.addView(this),fragmentOptions={template:this.template.f,root:this.root,owner:this},i=firstChange;newLength>i;i+=1)fragment=reboundFragments[i],fragment||this.fragmentsToCreate.push(i),this.fragments[i]=fragment}}function shuffle__blindRebind(dep){dep.rebind("","")}function Section$render(){var _this=this;return this.docFrag=document.createDocumentFragment(),this.fragments.forEach(function(f){return _this.docFrag.appendChild(f.render())}),this.renderedFragments=this.fragments.slice(),this.fragmentsToRender=[],this.rendered=!0,this.docFrag}function Section$setValue(value){var wrapper,fragmentOptions,_this=this;this.updating||(this.updating=!0,this.keypath&&(wrapper=this.root.viewmodel.wrapped[this.keypath.str])&&(value=wrapper.get()),this.fragmentsToCreate.length?(fragmentOptions={template:this.template.f||[],root:this.root,pElement:this.pElement,owner:this},this.fragmentsToCreate.forEach(function(index){var fragment;fragmentOptions.context=_this.keypath.join(index),fragmentOptions.index=index,fragment=new virtualdom_Fragment(fragmentOptions),_this.fragmentsToRender.push(_this.fragments[index]=fragment)}),this.fragmentsToCreate.length=0):reevaluateSection(this,value)&&(this.bubble(),this.rendered&&global_runloop.addView(this)),this.value=value,this.updating=!1)}function changeCurrentSubtype(section,value,obj){if(value===SECTION_EACH&§ion.indexRefs&§ion.indexRefs[0]){var ref=section.indexRefs[0];(obj&&"i"===ref.t||!obj&&"k"===ref.t)&&(obj||(section.length=0,section.fragmentsToUnrender=section.fragments.slice(0),section.fragmentsToUnrender.forEach(function(f){return f.unbind()}))),ref.t=obj?"k":"i"}section.currentSubtype=value}function reevaluateSection(section,value){var fragmentOptions={template:section.template.f||[],root:section.root,pElement:section.parentFragment.pElement,owner:section};if(section.hasContext=!0,section.subtype)switch(section.subtype){case SECTION_IF:return section.hasContext=!1,reevaluateConditionalSection(section,value,!1,fragmentOptions);case SECTION_UNLESS:return section.hasContext=!1,reevaluateConditionalSection(section,value,!0,fragmentOptions);case SECTION_WITH:return reevaluateContextSection(section,fragmentOptions);case SECTION_IF_WITH:return reevaluateConditionalContextSection(section,value,fragmentOptions);case SECTION_EACH:if(isObject(value))return changeCurrentSubtype(section,section.subtype,!0),reevaluateListObjectSection(section,value,fragmentOptions)}return section.ordered=!!isArrayLike(value),section.ordered?(changeCurrentSubtype(section,SECTION_EACH,!1),reevaluateListSection(section,value,fragmentOptions)):isObject(value)||"function"==typeof value?section.template.i?(changeCurrentSubtype(section,SECTION_EACH,!0),reevaluateListObjectSection(section,value,fragmentOptions)):(changeCurrentSubtype(section,SECTION_WITH,!1),reevaluateContextSection(section,fragmentOptions)):(changeCurrentSubtype(section,SECTION_IF,!1),section.hasContext=!1,reevaluateConditionalSection(section,value,!1,fragmentOptions))}function reevaluateListSection(section,value,fragmentOptions){var i,length,fragment;if(length=value.length,length===section.length)return!1;if(lengthsection.length)for(i=section.length;length>i;i+=1)fragmentOptions.context=section.keypath.join(i),fragmentOptions.index=i,fragment=new virtualdom_Fragment(fragmentOptions),section.fragmentsToRender.push(section.fragments[i]=fragment);return section.length=length,!0}function reevaluateListObjectSection(section,value,fragmentOptions){var id,i,hasKey,fragment,changed,deps;for(hasKey=section.hasKey||(section.hasKey={}),i=section.fragments.length;i--;)fragment=section.fragments[i],fragment.key in value||(changed=!0,fragment.unbind(),section.fragmentsToUnrender.push(fragment),section.fragments.splice(i,1),hasKey[fragment.key]=!1);for(i=section.fragments.length;i--;)fragment=section.fragments[i],fragment.index!==i&&(fragment.index=i,(deps=fragment.registeredIndexRefs)&&deps.forEach(setValue__blindRebind));i=section.fragments.length;for(id in value)hasKey[id]||(changed=!0,fragmentOptions.context=section.keypath.join(id),fragmentOptions.key=id,fragmentOptions.index=i++,fragment=new virtualdom_Fragment(fragmentOptions),section.fragmentsToRender.push(fragment),section.fragments.push(fragment),hasKey[id]=!0);return section.length=section.fragments.length,changed}function reevaluateConditionalContextSection(section,value,fragmentOptions){return value?reevaluateContextSection(section,fragmentOptions):removeSectionFragments(section)}function reevaluateContextSection(section,fragmentOptions){var fragment;return section.length?void 0:(fragmentOptions.context=section.keypath,fragmentOptions.index=0,fragment=new virtualdom_Fragment(fragmentOptions),section.fragmentsToRender.push(section.fragments[0]=fragment),section.length=1,!0)}function reevaluateConditionalSection(section,value,inverted,fragmentOptions){var doRender,emptyArray,emptyObject,fragment,name;if(emptyArray=isArrayLike(value)&&0===value.length,emptyObject=!1,!isArrayLike(value)&&isObject(value)){emptyObject=!0;for(name in value){emptyObject=!1;break}}return doRender=inverted?emptyArray||emptyObject||!value:value&&!emptyArray&&!emptyObject,doRender?section.length?section.length>1?(section.fragmentsToUnrender=section.fragments.splice(1),section.fragmentsToUnrender.forEach(methodCallers__unbind),!0):void 0:(fragmentOptions.index=0,fragment=new virtualdom_Fragment(fragmentOptions),section.fragmentsToRender.push(section.fragments[0]=fragment),section.length=1,!0):removeSectionFragments(section)}function removeSectionFragments(section){return section.length?(section.fragmentsToUnrender=section.fragments.splice(0,section.fragments.length).filter(isRendered),section.fragmentsToUnrender.forEach(methodCallers__unbind),section.length=section.fragmentsToRender.length=0,!0):void 0}function isRendered(fragment){return fragment.rendered}function setValue__blindRebind(dep){dep.rebind("","")}function Section$toString(escape){var str,i,len;for(str="",i=0,len=this.length,i=0;len>i;i+=1)str+=this.fragments[i].toString(escape);return str}function Section$unbind(){var _this=this;this.fragments.forEach(methodCallers__unbind),this.fragmentsToRender.forEach(function(f){return removeFromArray(_this.fragments,f)}),this.fragmentsToRender=[],shared_unbind.call(this),this.length=0,this.unbound=!0}function Section$unrender(shouldDestroy){this.fragments.forEach(shouldDestroy?unrenderAndDestroy:prototype_unrender__unrender),this.renderedFragments=[],this.rendered=!1}function unrenderAndDestroy(fragment){fragment.unrender(!0)}function prototype_unrender__unrender(fragment){fragment.unrender(!1)}function Section$update(){var fragment,renderIndex,renderedFragments,anchor,target,i,len;for(renderedFragments=this.renderedFragments;fragment=this.fragmentsToUnrender.pop();)fragment.unrender(!0),renderedFragments.splice(renderedFragments.indexOf(fragment),1);for(;fragment=this.fragmentsToRender.shift();)fragment.render();for(this.rendered&&(target=this.parentFragment.getNode()),len=this.fragments.length,i=0;len>i;i+=1)fragment=this.fragments[i],renderIndex=renderedFragments.indexOf(fragment,i),renderIndex!==i?(this.docFrag.appendChild(fragment.detach()),-1!==renderIndex&&renderedFragments.splice(renderIndex,1),renderedFragments.splice(i,0,fragment)):this.docFrag.childNodes.length&&(anchor=fragment.firstNode(),target.insertBefore(this.docFrag,anchor));this.rendered&&this.docFrag.childNodes.length&&(anchor=this.parentFragment.findNextNode(this),target.insertBefore(this.docFrag,anchor)),this.renderedFragments=this.fragments.slice()}function Triple$detach(){var len,i;if(this.docFrag){for(len=this.nodes.length,i=0;len>i;i+=1)this.docFrag.appendChild(this.nodes[i]);return this.docFrag}}function Triple$find(selector){var i,len,node,queryResult;for(len=this.nodes.length,i=0;len>i;i+=1)if(node=this.nodes[i],1===node.nodeType){if(matches(node,selector))return node;if(queryResult=node.querySelector(selector))return queryResult}return null}function Triple$findAll(selector,queryResult){var i,len,node,queryAllResult,numNodes,j;for(len=this.nodes.length,i=0;len>i;i+=1)if(node=this.nodes[i],1===node.nodeType&&(matches(node,selector)&&queryResult.push(node),queryAllResult=node.querySelectorAll(selector)))for(numNodes=queryAllResult.length,j=0;numNodes>j;j+=1)queryResult.push(queryAllResult[j])}function Triple$firstNode(){return this.rendered&&this.nodes[0]?this.nodes[0]:this.parentFragment.findNextNode(this)}function element(tagName){return elementCache[tagName]||(elementCache[tagName]=createElement(tagName))}function updateSelect(parentElement){var selectedOptions,option,value;parentElement&&"select"===parentElement.name&&parentElement.binding&&(selectedOptions=toArray(parentElement.node.options).filter(isSelected), parentElement.getAttribute("multiple")?value=selectedOptions.map(function(o){return o.value}):(option=selectedOptions[0])&&(value=option.value),void 0!==value&&parentElement.binding.setValue(value),parentElement.bubble())}function isSelected(option){return option.selected}function Triple$render(){if(this.rendered)throw new Error("Attempted to render an item that was already rendered");return this.docFrag=document.createDocumentFragment(),this.nodes=insertHtml(this.value,this.parentFragment.getNode(),this.docFrag),helpers_updateSelect(this.pElement),this.rendered=!0,this.docFrag}function Triple$setValue(value){var wrapper;(wrapper=this.root.viewmodel.wrapped[this.keypath.str])&&(value=wrapper.get()),value!==this.value&&(this.value=value,this.parentFragment.bubble(),this.rendered&&global_runloop.addView(this))}function Triple$toString(){return void 0!=this.value?decodeCharacterReferences(""+this.value):""}function Triple$unrender(shouldDestroy){this.rendered&&shouldDestroy&&(this.nodes.forEach(detachNode),this.rendered=!1)}function Triple$update(){var node,parentNode;if(this.rendered){for(;this.nodes&&this.nodes.length;)node=this.nodes.pop(),node.parentNode.removeChild(node);parentNode=this.parentFragment.getNode(),this.nodes=insertHtml(this.value,parentNode,this.docFrag),parentNode.insertBefore(this.docFrag,this.parentFragment.findNextNode(this)),helpers_updateSelect(this.pElement)}}function Element$detach(){var parentNode,node=this.node;return node?((parentNode=node.parentNode)&&parentNode.removeChild(node),node):void 0}function Element$findNextNode(){return null}function Element$firstNode(){return this.node}function Element$getAttribute(name){return this.attributes&&this.attributes[name]?this.attributes[name].value:void 0}function Attribute$bubble(){var value=this.useProperty||!this.rendered?this.fragment.getValue():this.fragment.toString();isEqual(value,this.value)||("id"===this.name&&this.value&&delete this.root.nodes[this.value],this.value=value,"value"===this.name&&this.node&&(this.node._ractive.value=value),this.rendered&&global_runloop.addView(this))}function getInterpolator(attribute){var items=attribute.fragment.items;if(1===items.length)return items[0].type===INTERPOLATOR?items[0]:void 0}function Attribute$init(options){return this.type=ATTRIBUTE,this.element=options.element,this.root=options.root,determineNameAndNamespace(this,options.name),this.isBoolean=booleanAttributes.test(this.name),options.value&&"string"!=typeof options.value?(this.parentFragment=this.element.parentFragment,this.fragment=new virtualdom_Fragment({template:options.value,root:this.root,owner:this}),this.value=this.fragment.getValue(),this.interpolator=helpers_getInterpolator(this),this.isBindable=!!this.interpolator&&!this.interpolator.isStatic,void(this.ready=!0)):void(this.value=this.isBoolean?!0:options.value||"")}function Attribute$rebind(oldKeypath,newKeypath){this.fragment&&this.fragment.rebind(oldKeypath,newKeypath)}function Attribute$render(node){var propertyName;this.node=node,node.namespaceURI&&node.namespaceURI!==namespaces.html||(propertyName=propertyNames[this.name]||this.name,void 0!==node[propertyName]&&(this.propertyName=propertyName),(this.isBoolean||this.isTwoway)&&(this.useProperty=!0),"value"===propertyName&&(node._ractive.value=this.value)),this.rendered=!0,this.update()}function Attribute$toString(){var _ref=this,name=_ref.name,namespacePrefix=_ref.namespacePrefix,value=_ref.value,interpolator=_ref.interpolator,fragment=_ref.fragment;if(("value"!==name||"select"!==this.element.name&&"textarea"!==this.element.name)&&("value"!==name||void 0===this.element.getAttribute("contenteditable"))){if("name"===name&&"input"===this.element.name&&interpolator)return"name={{"+(interpolator.keypath.str||interpolator.ref)+"}}";if(this.isBoolean)return value?name:"";if(fragment){if(1===fragment.items.length&&null==fragment.items[0].value)return"";value=fragment.toString()}return namespacePrefix&&(name=namespacePrefix+":"+name),value?name+'="'+Attribute_prototype_toString__escape(value)+'"':name}}function Attribute_prototype_toString__escape(value){return value.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'")}function Attribute$unbind(){this.fragment&&this.fragment.unbind(),"id"===this.name&&delete this.root.nodes[this.value]}function Attribute$updateSelect(){var options,option,optionValue,i,value=this.value;if(!this.locked)for(this.node._ractive.value=value,options=this.node.options,i=options.length;i--;)if(option=options[i],optionValue=option._ractive?option._ractive.value:option.value,optionValue==value){option.selected=!0;break}}function Attribute$updateMultipleSelect(){var options,i,option,optionValue,value=this.value;for(isArray(value)||(value=[value]),options=this.node.options,i=options.length;i--;)option=options[i],optionValue=option._ractive?option._ractive.value:option.value,option.selected=arrayContains(value,optionValue)}function Attribute$updateRadioName(){var _ref=this,node=_ref.node,value=_ref.value;node.checked=value==node._ractive.value}function Attribute$updateRadioValue(){var wasChecked,binding,bindings,i,node=this.node;if(wasChecked=node.checked,node.value=this.element.getAttribute("value"),node.checked=this.element.getAttribute("value")===this.element.getAttribute("name"),wasChecked&&!node.checked&&this.element.binding&&(bindings=this.element.binding.siblings,i=bindings.length)){for(;i--;){if(binding=bindings[i],!binding.element.node)return;if(binding.element.node.checked)return global_runloop.addRactive(binding.root),binding.handleChange()}this.root.viewmodel.set(binding.keypath,void 0)}}function Attribute$updateCheckboxName(){var valueAttribute,i,_ref=this,element=_ref.element,node=_ref.node,value=_ref.value,binding=element.binding;if(valueAttribute=element.getAttribute("value"),isArray(value)){for(i=value.length;i--;)if(valueAttribute==value[i])return void(binding.isChecked=node.checked=!0);binding.isChecked=node.checked=!1}else binding.isChecked=node.checked=value==valueAttribute}function Attribute$updateClassName(){this.node.className=safeToStringValue(this.value)}function Attribute$updateIdAttribute(){var _ref=this,node=_ref.node,value=_ref.value;this.root.nodes[value]=node,node.id=value}function Attribute$updateIEStyleAttribute(){var node,value;node=this.node,value=this.value,void 0===value&&(value=""),node.style.setAttribute("cssText",value)}function Attribute$updateContentEditableValue(){var value=this.value;void 0===value&&(value=""),this.locked||(this.node.innerHTML=value)}function Attribute$updateValue(){var _ref=this,node=_ref.node,value=_ref.value;node._ractive.value=value,this.locked||(node.value=void 0==value?"":value)}function Attribute$updateBooleanAttribute(){this.locked||(this.node[this.propertyName]=this.value)}function Attribute$updateEverythingElse(){var _ref=this,node=_ref.node,namespace=_ref.namespace,name=_ref.name,value=_ref.value,fragment=_ref.fragment;namespace?node.setAttributeNS(namespace,name,(fragment||value).toString()):this.isBoolean?value?node.setAttribute(name,""):node.removeAttribute(name):null==value?node.removeAttribute(name):node.setAttribute(name,(fragment||value).toString())}function Attribute$update(){var type,updateMethod,_ref=this,name=_ref.name,element=_ref.element,node=_ref.node;"id"===name?updateMethod=updateIdAttribute:"value"===name?"select"===element.name&&"value"===name?updateMethod=element.getAttribute("multiple")?updateMultipleSelectValue:updateSelectValue:"textarea"===element.name?updateMethod=updateValue:null!=element.getAttribute("contenteditable")?updateMethod=updateContentEditableValue:"input"===element.name&&(type=element.getAttribute("type"),updateMethod="file"===type?noop:"radio"===type&&element.binding&&"name"===element.binding.name?updateRadioValue:updateValue):this.isTwoway&&"name"===name?"radio"===node.type?updateMethod=updateRadioName:"checkbox"===node.type&&(updateMethod=updateCheckboxName):"style"===name&&node.style.setAttribute?updateMethod=updateIEStyleAttribute:"class"!==name||node.namespaceURI&&node.namespaceURI!==namespaces.html?this.useProperty&&(updateMethod=updateBoolean):updateMethod=updateClassName,updateMethod||(updateMethod=updateEverythingElse),this.update=updateMethod,this.update()}function parseAttributes(str,isSvg){var tag=isSvg?"svg":"div";return _ConditionalAttribute__div.innerHTML="<"+tag+" "+str+">",toArray(_ConditionalAttribute__div.childNodes[0].attributes)}function notIn(haystack,needle){for(var i=haystack.length;i--;)if(haystack[i].name===needle.name)return!1;return!0}function findParentForm(element){for(;element=element.parent;)if("form"===element.name)return element}function handleChange(){this._ractive.binding.handleChange()}function handleBlur(){var value;handleDomEvent.call(this),value=this._ractive.root.viewmodel.get(this._ractive.binding.keypath),this.value=void 0==value?"":value}function handleDelay(){var binding=this._ractive.binding,el=this;binding._timeout&&clearTimeout(binding._timeout),binding._timeout=setTimeout(function(){binding.rendered&&handleDomEvent.call(el),binding._timeout=void 0},binding.element.lazy)}function getSiblings(id,group,keypath){var hash=id+group+keypath;return sets[hash]||(sets[hash]=[])}function isChecked(binding){return binding.isChecked}function Binding_CheckboxNameBinding__getValue(binding){return binding.element.getAttribute("value")}function createTwowayBinding(element){var type,Binding,bindName,bindChecked,binding,attributes=element.attributes;return element.binding&&(element.binding.teardown(),element.binding=null),(element.getAttribute("contenteditable")||attributes.contenteditable&&isBindable(attributes.contenteditable))&&isBindable(attributes.value)?Binding=Binding_ContentEditableBinding:"input"===element.name?(type=element.getAttribute("type"),"radio"===type||"checkbox"===type?(bindName=isBindable(attributes.name),bindChecked=isBindable(attributes.checked),bindName&&bindChecked&&warnIfDebug("A radio input can have two-way binding on its name attribute, or its checked attribute - not both",{ractive:element.root}),bindName?Binding="radio"===type?Binding_RadioNameBinding:Binding_CheckboxNameBinding:bindChecked&&(Binding="radio"===type?Binding_RadioBinding:Binding_CheckboxBinding)):"file"===type&&isBindable(attributes.value)?Binding=Binding_FileListBinding:isBindable(attributes.value)&&(Binding="number"===type||"range"===type?NumericBinding:Binding_GenericBinding)):"select"===element.name&&isBindable(attributes.value)?Binding=element.getAttribute("multiple")?Binding_MultipleSelectBinding:Binding_SelectBinding:"textarea"===element.name&&isBindable(attributes.value)&&(Binding=Binding_GenericBinding),Binding&&(binding=new Binding(element))&&binding.keypath?binding:void 0}function isBindable(attribute){return attribute&&attribute.isBindable}function EventHandler$bubble(){var hasAction=this.getAction();hasAction&&!this.hasListener?this.listen():!hasAction&&this.hasListener&&this.unrender()}function EventHandler$fire(event){shared_fireEvent(this.root,this.getAction(),{event:event})}function EventHandler$getAction(){return this.action.toString().trim()}function EventHandler$init(element,name,template){var action,refs,ractive,_this=this;this.element=element,this.root=element.root,this.parentFragment=element.parentFragment,this.name=name,-1!==name.indexOf("*")&&(fatal('Only component proxy-events may contain "*" wildcards, <%s on-%s="..."/> is not valid',element.name,name),this.invalid=!0),template.m?(refs=template.a.r,this.method=template.m,this.keypaths=[],this.fn=shared_getFunctionFromString(template.a.s,refs.length),this.parentFragment=element.parentFragment,ractive=this.root,this.refResolvers=[],refs.forEach(function(ref,i){var match=void 0;(match=eventPattern.exec(ref))?_this.keypaths[i]={eventObject:!0,refinements:match[1]?match[1].split("."):[]}:_this.refResolvers.push(Resolvers_createReferenceResolver(_this,ref,function(keypath){return _this.resolve(i,keypath)}))}),this.fire=fireMethodCall):(action=template.n||template,"string"!=typeof action&&(action=new virtualdom_Fragment({template:action,root:this.root,owner:this})),this.action=action,template.d?(this.dynamicParams=new virtualdom_Fragment({template:template.d,root:this.root,owner:this.element}),this.fire=fireEventWithDynamicParams):template.a&&(this.params=template.a,this.fire=fireEventWithParams))}function fireMethodCall(event){var ractive,values,args;if(ractive=this.root,"function"!=typeof ractive[this.method])throw new Error('Attempted to call a non-existent method ("'+this.method+'")');values=this.keypaths.map(function(keypath){var value,len,i;if(void 0===keypath)return void 0;if(keypath.eventObject){if(value=event,len=keypath.refinements.length)for(i=0;len>i;i+=1)value=value[keypath.refinements[i]]}else value=ractive.viewmodel.get(keypath);return value}),shared_eventStack.enqueue(ractive,event),args=this.fn.apply(null,values),ractive[this.method].apply(ractive,args),shared_eventStack.dequeue(ractive)}function fireEventWithParams(event){shared_fireEvent(this.root,this.getAction(),{event:event,args:this.params})}function fireEventWithDynamicParams(event){var args=this.dynamicParams.getArgsList();"string"==typeof args&&(args=args.substr(1,args.length-2)),shared_fireEvent(this.root,this.getAction(),{event:event,args:args})}function genericHandler(event){var storage,handler,indices,index={};storage=this._ractive,handler=storage.events[event.type],(indices=Resolvers_findIndexRefs(handler.element.parentFragment))&&(index=Resolvers_findIndexRefs.resolve(indices)),handler.fire({node:this,original:event,index:index,keypath:storage.keypath.str,context:storage.root.viewmodel.get(storage.keypath)})}function EventHandler$listen(){var definition,name=this.name;if(!this.invalid){if(definition=findInViewHierarchy("events",this.root,name))this.custom=definition(this.node,getCustomHandler(name));else{if(!("on"+name in this.node||window&&"on"+name in window||isJsdom))return void(touchEvents[name]||warnOnceIfDebug(missingPlugin(name,"event"),{node:this.node}));this.node.addEventListener(name,shared_genericHandler,!1)}this.hasListener=!0}}function getCustomHandler(name){return customHandlers[name]||(customHandlers[name]=function(event){var storage=event.node._ractive;event.index=storage.index,event.keypath=storage.keypath.str,event.context=storage.root.viewmodel.get(storage.keypath),storage.events[name].fire(event)}),customHandlers[name]}function EventHandler$rebind(oldKeypath,newKeypath){function rebind(thing){thing&&thing.rebind(oldKeypath,newKeypath)}var fragment;return this.method?(fragment=this.element.parentFragment,void this.refResolvers.forEach(rebind)):("string"!=typeof this.action&&rebind(this.action),void(this.dynamicParams&&rebind(this.dynamicParams)))}function EventHandler$render(){this.node=this.element.node,this.node._ractive.events[this.name]=this,(this.method||this.getAction())&&this.listen()}function EventHandler$resolve(index,keypath){this.keypaths[index]=keypath}function EventHandler$unbind(){return this.method?void this.refResolvers.forEach(methodCallers__unbind):("string"!=typeof this.action&&this.action.unbind(),void(this.dynamicParams&&this.dynamicParams.unbind()))}function EventHandler$unrender(){this.custom?this.custom.teardown():this.node.removeEventListener(this.name,shared_genericHandler,!1),this.hasListener=!1}function select__bubble(){var _this=this;this.dirty||(this.dirty=!0,global_runloop.scheduleTask(function(){sync(_this),_this.dirty=!1})),this.parentFragment.bubble()}function sync(selectElement){var selectNode,selectValue,isMultiple,options,optionWasSelected;selectNode=selectElement.node,selectNode&&(options=toArray(selectNode.options),selectValue=selectElement.getAttribute("value"),isMultiple=selectElement.getAttribute("multiple"),void 0!==selectValue?(options.forEach(function(o){var optionValue,shouldSelect;optionValue=o._ractive?o._ractive.value:o.value,shouldSelect=isMultiple?valueContains(selectValue,optionValue):selectValue==optionValue,shouldSelect&&(optionWasSelected=!0),o.selected=shouldSelect}),optionWasSelected||(options[0]&&(options[0].selected=!0),selectElement.binding&&selectElement.binding.forceUpdate())):selectElement.binding&&selectElement.binding.forceUpdate())}function valueContains(selectValue,optionValue){for(var i=selectValue.length;i--;)if(selectValue[i]==optionValue)return!0}function special_option__init(option,template){option.select=findParentSelect(option.parent),option.select&&(option.select.options.push(option),template.a||(template.a={}),void 0!==template.a.value||template.a.hasOwnProperty("disabled")||(template.a.value=template.f),"selected"in template.a&&void 0!==option.select.getAttribute("value")&&delete template.a.selected)}function special_option__unbind(option){option.select&&removeFromArray(option.select.options,option)}function findParentSelect(element){if(element)do if("select"===element.name)return element;while(element=element.parent)}function Element$init(options){var parentFragment,template,ractive,binding,bindings,twoway,bindingAttrs;this.type=ELEMENT,parentFragment=this.parentFragment=options.parentFragment,template=this.template=options.template,this.parent=options.pElement||parentFragment.pElement,this.root=ractive=parentFragment.root,this.index=options.index,this.key=options.key,this.name=enforceCase(template.e),"option"===this.name&&special_option__init(this,template),"select"===this.name&&(this.options=[],this.bubble=select__bubble),"form"===this.name&&(this.formBindings=[]),bindingAttrs=processBindingAttributes(this,template),this.attributes=createAttributes(this,template.a),this.conditionalAttributes=createConditionalAttributes(this,template.m),template.f&&(this.fragment=new virtualdom_Fragment({template:template.f,root:ractive,owner:this,pElement:this,cssIds:null})),twoway=ractive.twoway,bindingAttrs.twoway===!1?twoway=!1:bindingAttrs.twoway===!0&&(twoway=!0),this.twoway=twoway,this.lazy=bindingAttrs.lazy,twoway&&(binding=init_createTwowayBinding(this,template.a))&&(this.binding=binding,bindings=this.root._twowayBindings[binding.keypath.str]||(this.root._twowayBindings[binding.keypath.str]=[]),bindings.push(binding)),template.v&&(this.eventHandlers=createEventHandlers(this,template.v)),template.o&&(this.decorator=new _Decorator(this,template.o)),this.intro=template.t0||template.t1,this.outro=template.t0||template.t2}function Element$rebind(oldKeypath,newKeypath){function rebind(thing){thing.rebind(oldKeypath,newKeypath)}var i,storage,liveQueries,ractive;if(this.attributes&&this.attributes.forEach(rebind),this.conditionalAttributes&&this.conditionalAttributes.forEach(rebind),this.eventHandlers&&this.eventHandlers.forEach(rebind),this.decorator&&rebind(this.decorator),this.fragment&&rebind(this.fragment),liveQueries=this.liveQueries)for(ractive=this.root,i=liveQueries.length;i--;)liveQueries[i]._makeDirty();this.node&&(storage=this.node._ractive)&&assignNewKeypath(storage,"keypath",oldKeypath,newKeypath)}function special_img__render(img){var loadHandler;(img.attributes.width||img.attributes.height)&&img.node.addEventListener("load",loadHandler=function(){var width=img.getAttribute("width"),height=img.getAttribute("height");void 0!==width&&img.node.setAttribute("width",width),void 0!==height&&img.node.setAttribute("height",height),img.node.removeEventListener("load",loadHandler,!1)},!1)}function form__render(element){element.node.addEventListener("reset",handleReset,!1)}function form__unrender(element){element.node.removeEventListener("reset",handleReset,!1)}function handleReset(){var element=this._ractive.proxy;global_runloop.start(),element.formBindings.forEach(updateModel),global_runloop.end()}function updateModel(binding){binding.root.viewmodel.set(binding.keypath,binding.resetValue)}function Transition$init(element,template,isIntro){var ractive,name,fragment;this.element=element,this.root=ractive=element.root,this.isIntro=isIntro,name=template.n||template,("string"==typeof name||(fragment=new virtualdom_Fragment({template:name,root:ractive,owner:element}),name=fragment.toString(),fragment.unbind(),""!==name))&&(this.name=name,template.a?this.params=template.a:template.d&&(fragment=new virtualdom_Fragment({template:template.d,root:ractive,owner:element}),this.params=fragment.getArgsList(),fragment.unbind()),this._fn=findInViewHierarchy("transitions",ractive,name),this._fn||warnOnceIfDebug(missingPlugin(name,"transition"),{ractive:this.root}))}function linear(t){return t}function onChange(){visibility.hidden=document[hidden]}function onHide(){visibility.hidden=!0}function onShow(){visibility.hidden=!1}function Transition$start(){var node,originalStyle,completed,_this=this;return node=this.node=this.element.node,originalStyle=node.getAttribute("style"),this.complete=function(noReset){completed||(!noReset&&_this.isIntro&&resetStyle(node,originalStyle),node._ractive.transition=null,_this._manager.remove(_this),completed=!0)},this._fn?void this._fn.apply(this.root,[this].concat(this.params)):void this.complete()}function resetStyle(node,style){style?node.setAttribute("style",style):(node.getAttribute("style"),node.removeAttribute("style"))}function Element$render(){var namespace,node,transition,_this=this,root=this.root;return namespace=getNamespace(this),node=this.node=createElement(this.name,namespace),this.parentFragment.cssIds&&this.node.setAttribute("data-ractive-css",this.parentFragment.cssIds.map(function(x){return"{"+x+"}"}).join(" ")),defineProperty(this.node,"_ractive",{value:{proxy:this,keypath:getInnerContext(this.parentFragment),events:create(null),root:root}}),this.attributes.forEach(function(a){return a.render(node)}),this.conditionalAttributes.forEach(function(a){return a.render(node)}),this.fragment&&("script"===this.name?(this.bubble=updateScript,this.node.text=this.fragment.toString(!1),this.fragment.unrender=noop):"style"===this.name?(this.bubble=updateCss,this.bubble(),this.fragment.unrender=noop):this.binding&&this.getAttribute("contenteditable")?this.fragment.unrender=noop:this.node.appendChild(this.fragment.render())),this.binding&&(this.binding.render(),this.node._ractive.binding=this.binding),this.eventHandlers&&this.eventHandlers.forEach(function(h){return h.render()}),"option"===this.name&&processOption(this),"img"===this.name?special_img__render(this):"form"===this.name?form__render(this):"input"===this.name||"textarea"===this.name?this.node.defaultValue=this.node.value:"option"===this.name&&(this.node.defaultSelected=this.node.selected),this.decorator&&this.decorator.fn&&global_runloop.scheduleTask(function(){_this.decorator.torndown||_this.decorator.init()},!0),root.transitionsEnabled&&this.intro&&(transition=new _Transition(this,this.intro,!0),global_runloop.registerTransition(transition),global_runloop.scheduleTask(function(){return transition.start()},!0),this.transition=transition),this.node.autofocus&&global_runloop.scheduleTask(function(){return _this.node.focus()},!0),updateLiveQueries(this),this.node}function getNamespace(element){var namespace,xmlns,parent;return namespace=(xmlns=element.getAttribute("xmlns"))?xmlns:"svg"===element.name?namespaces.svg:(parent=element.parent)?"foreignObject"===parent.name?namespaces.html:parent.node.namespaceURI:element.root.el.namespaceURI}function processOption(option){var optionValue,selectValue,i;if(option.select&&(selectValue=option.select.getAttribute("value"),void 0!==selectValue))if(optionValue=option.getAttribute("value"),option.select.node.multiple&&isArray(selectValue)){for(i=selectValue.length;i--;)if(optionValue==selectValue[i]){option.node.selected=!0;break}}else option.node.selected=optionValue==selectValue}function updateLiveQueries(element){var instance,liveQueries,i,selector,query;instance=element.root;do for(liveQueries=instance._liveQueries,i=liveQueries.length;i--;)selector=liveQueries[i],query=liveQueries["_"+selector],query._test(element)&&(element.liveQueries||(element.liveQueries=[])).push(query);while(instance=instance.parent)}function optionIsSelected(element){var optionValue,selectValue,i;if(optionValue=element.getAttribute("value"),void 0===optionValue||!element.select)return!1;if(selectValue=element.select.getAttribute("value"),selectValue==optionValue)return!0;if(element.select.getAttribute("multiple")&&isArray(selectValue))for(i=selectValue.length;i--;)if(selectValue[i]==optionValue)return!0}function inputIsCheckedRadio(element){var attributes,typeAttribute,valueAttribute,nameAttribute;return attributes=element.attributes,typeAttribute=attributes.type,valueAttribute=attributes.value,nameAttribute=attributes.name,typeAttribute&&"radio"===typeAttribute.value&&valueAttribute&&nameAttribute.interpolator&&valueAttribute.value===nameAttribute.interpolator.value?!0:void 0}function stringifyAttribute(attribute){var str=attribute.toString();return str?" "+str:""}function Element$unbind(){this.fragment&&this.fragment.unbind(),this.binding&&this.binding.unbind(),this.eventHandlers&&this.eventHandlers.forEach(methodCallers__unbind),"option"===this.name&&special_option__unbind(this),this.attributes.forEach(methodCallers__unbind),this.conditionalAttributes.forEach(methodCallers__unbind)}function Element$unrender(shouldDestroy){var binding,bindings,transition;(transition=this.transition)&&transition.complete(),"option"===this.name?this.detach():shouldDestroy&&global_runloop.detachWhenReady(this),this.fragment&&this.fragment.unrender(!1),(binding=this.binding)&&(this.binding.unrender(),this.node._ractive.binding=null,bindings=this.root._twowayBindings[binding.keypath.str],bindings.splice(bindings.indexOf(binding),1)),this.eventHandlers&&this.eventHandlers.forEach(methodCallers__unrender),this.decorator&&global_runloop.registerDecorator(this.decorator),this.root.transitionsEnabled&&this.outro&&(transition=new _Transition(this,this.outro,!1),global_runloop.registerTransition(transition),global_runloop.scheduleTask(function(){return transition.start()})),this.liveQueries&&removeFromLiveQueries(this),"form"===this.name&&form__unrender(this)}function removeFromLiveQueries(element){var query,selector,i;for(i=element.liveQueries.length;i--;)query=element.liveQueries[i],selector=query.selector,query._remove(element.node)}function reducer(previous,line){var lineIndent=deIndent__leadingWhitespace.exec(line)[0];return null===previous||lineIndent.length%s}}) cannot contain nested inline partials",name,{ractive:ractive});var target=fn?instance:findOwner(instance,name);target.partials[name]=partial=parsed.t}return fn&&(partial._fn=fn),partial.v?partial.t:partial}}function findOwner(ractive,key){return ractive.partials.hasOwnProperty(key)?ractive:findConstructor(ractive.constructor,key)}function findConstructor(constructor,key){return constructor?constructor.partials.hasOwnProperty(key)?constructor:findConstructor(constructor._Parent,key):void 0}function findParentPartial(name,parent){if(parent){if(parent.template&&parent.template.p&&parent.template.p[name])return parent.template.p[name];if(parent.parentFragment&&parent.parentFragment.owner)return findParentPartial(name,parent.parentFragment.owner)}}function getComponent(ractive,name){var Component,instance=findInstance("components",ractive,name);if(instance&&(Component=instance.components[name],!Component._Parent)){var fn=Component.bind(instance);if(fn.isOwner=instance.components.hasOwnProperty(name),Component=fn(),!Component)return void warnIfDebug(noRegistryFunctionReturn,name,"component","component",{ractive:ractive});"string"==typeof Component&&(Component=getComponent(ractive,Component)),Component._fn=fn,instance.components[name]=Component}return Component}function Component$detach(){var detached=this.instance.fragment.detach();return Component_prototype_detach__detachHook.fire(this.instance),detached}function Component$find(selector){return this.instance.fragment.find(selector)}function Component$findAll(selector,query){return this.instance.fragment.findAll(selector,query)}function Component$findAllComponents(selector,query){query._test(this,!0),this.instance.fragment&&this.instance.fragment.findAllComponents(selector,query)}function Component$findComponent(selector){return selector&&selector!==this.name?this.instance.fragment?this.instance.fragment.findComponent(selector):null:this.instance}function Component$findNextNode(){return this.parentFragment.findNextNode(this)}function Component$firstNode(){return this.rendered?this.instance.fragment.firstNode():null}function createAccessors(originalWrapper,value,template){function updateWrapper(wrapper){var keypath,ractive;wrapper.value=value,wrapper.updating||(ractive=wrapper.ractive,keypath=wrapper.keypath,wrapper.updating=!0,global_runloop.start(ractive),ractive.viewmodel.mark(keypath),global_runloop.end(),wrapper.updating=!1)}var object,property,oldGet,oldSet,get,set;if(object=originalWrapper.obj,property=originalWrapper.prop,template&&!template.configurable){if("length"===property)return;throw new Error('Cannot use magic mode with property "'+property+'" - object is not configurable')}template&&(oldGet=template.get,oldSet=template.set),get=oldGet||function(){return value},set=function(v){oldSet&&oldSet(v),value=oldGet?oldGet():v,set._ractiveWrappers.forEach(updateWrapper)},set._ractiveWrappers=[originalWrapper],Object.defineProperty(object,property,{get:get,set:set,enumerable:!0,configurable:!0})}function Viewmodel$adapt(keypath,value){var len,i,adaptor,wrapped;if(this.adaptors)for(len=this.adaptors.length,i=0;len>i;i+=1)if(adaptor=this.adaptors[i],adaptor.filter(value,keypath,this.ractive))return wrapped=this.wrapped[keypath]=adaptor.wrap(this.ractive,value,keypath,getPrefixer(keypath)),void(wrapped.value=value)}function prefixKeypath(obj,prefix){var key,prefixed={};if(!prefix)return obj;prefix+=".";for(key in obj)obj.hasOwnProperty(key)&&(prefixed[prefix+key]=obj[key]);return prefixed}function getPrefixer(rootKeypath){var rootDot;return prefixers[rootKeypath]||(rootDot=rootKeypath?rootKeypath+".":"",prefixers[rootKeypath]=function(relativeKeypath,value){var obj;return"string"==typeof relativeKeypath?(obj={},obj[rootDot+relativeKeypath]=value,obj):"object"==typeof relativeKeypath?rootDot?prefixKeypath(relativeKeypath,rootKeypath):relativeKeypath:void 0}),prefixers[rootKeypath]}function getUpstreamChanges(changes){var i,keypath,upstreamChanges=[rootKeypath];for(i=changes.length;i--;)for(keypath=changes[i].parent;keypath&&!keypath.isRoot;)-1===changes.indexOf(keypath)&&addToArray(upstreamChanges,keypath),keypath=keypath.parent;return upstreamChanges}function notifyPatternObservers(viewmodel,keypath,onlyDirect){var potentialWildcardMatches;updateMatchingPatternObservers(viewmodel,keypath),onlyDirect||(potentialWildcardMatches=keypath.wildcardMatches(),potentialWildcardMatches.forEach(function(upstreamPattern){cascade(viewmodel,upstreamPattern,keypath)}))}function cascade(viewmodel,upstreamPattern,keypath){var group,map,actualChildKeypath;upstreamPattern=upstreamPattern.str||upstreamPattern, group=viewmodel.depsMap.patternObservers,map=group&&group[upstreamPattern],map&&map.forEach(function(childKeypath){actualChildKeypath=keypath.join(childKeypath.lastKey),updateMatchingPatternObservers(viewmodel,actualChildKeypath),cascade(viewmodel,childKeypath,actualChildKeypath)})}function updateMatchingPatternObservers(viewmodel,keypath){viewmodel.patternObservers.forEach(function(observer){observer.regex.test(keypath.str)&&observer.update(keypath)})}function Viewmodel$applyChanges(){function invalidateComputation(computation){var key=computation.key;computation.viewmodel===self?(self.clearCache(key.str),computation.invalidate(),changes.push(key),cascade(key)):computation.viewmodel.mark(key)}function cascade(keypath){var map,computations;self.noCascade.hasOwnProperty(keypath.str)||((computations=self.deps.computed[keypath.str])&&computations.forEach(invalidateComputation),(map=self.depsMap.computed[keypath.str])&&map.forEach(cascade))}var changes,upstreamChanges,bindings,_this=this,self=this,hash={};return changes=this.changes,changes.length?(changes.slice().forEach(cascade),upstreamChanges=helpers_getUpstreamChanges(changes),upstreamChanges.forEach(function(keypath){var computations;-1===changes.indexOf(keypath)&&(computations=self.deps.computed[keypath.str])&&computations.forEach(invalidateComputation)}),this.changes=[],this.patternObservers.length&&(upstreamChanges.forEach(function(keypath){return applyChanges_notifyPatternObservers(_this,keypath,!0)}),changes.forEach(function(keypath){return applyChanges_notifyPatternObservers(_this,keypath)})),this.deps.observers&&(upstreamChanges.forEach(function(keypath){return notifyUpstreamDependants(_this,null,keypath,"observers")}),notifyAllDependants(this,changes,"observers")),this.deps["default"]&&(bindings=[],upstreamChanges.forEach(function(keypath){return notifyUpstreamDependants(_this,bindings,keypath,"default")}),bindings.length&¬ifyBindings(this,bindings,changes),notifyAllDependants(this,changes,"default")),changes.forEach(function(keypath){hash[keypath.str]=_this.get(keypath)}),this.implicitChanges={},this.noCascade={},hash):void 0}function notifyUpstreamDependants(viewmodel,bindings,keypath,groupName){var dependants,value;(dependants=findDependants(viewmodel,keypath,groupName))&&(value=viewmodel.get(keypath),dependants.forEach(function(d){bindings&&d.refineValue?bindings.push(d):d.setValue(value)}))}function notifyBindings(viewmodel,bindings,changes){bindings.forEach(function(binding){for(var useSet=!1,i=0,length=changes.length,refinements=[];length>i;){var keypath=changes[i];if(keypath===binding.keypath){useSet=!0;break}keypath.slice(0,binding.keypath.length)===binding.keypath&&refinements.push(keypath),i++}useSet&&binding.setValue(viewmodel.get(binding.keypath)),refinements.length&&binding.refineValue(refinements)})}function notifyAllDependants(viewmodel,keypaths,groupName){function addKeypaths(keypaths){keypaths.forEach(addKeypath),keypaths.forEach(cascade)}function addKeypath(keypath){var deps=findDependants(viewmodel,keypath,groupName);deps&&queue.push({keypath:keypath,deps:deps})}function cascade(keypath){var childDeps;(childDeps=viewmodel.depsMap[groupName][keypath.str])&&addKeypaths(childDeps)}function dispatch(set){var value=viewmodel.get(set.keypath);set.deps.forEach(function(d){return d.setValue(value)})}var queue=[];addKeypaths(keypaths),queue.forEach(dispatch)}function findDependants(viewmodel,keypath,groupName){var group=viewmodel.deps[groupName];return group?group[keypath.str]:null}function Viewmodel$capture(){this.captureGroups.push([])}function Viewmodel$clearCache(keypath,keepExistingWrapper){var cacheMap,wrapper;if(keepExistingWrapper||(wrapper=this.wrapped[keypath])&&wrapper.teardown()!==!1&&(this.wrapped[keypath]=null),this.cache[keypath]=void 0,cacheMap=this.cacheMap[keypath])for(;cacheMap.length;)this.clearCache(cacheMap.pop())}function isUnresolved(viewmodel,keypath){var key=keypath.firstKey;return!(key in viewmodel.data||key in viewmodel.computations||key in viewmodel.mappings)}function Viewmodel$compute(key,signature){var computation=new Computation_Computation(key,signature);return this.ready&&computation.init(this),this.computations[key.str]=computation}function Viewmodel$get(keypath,options){var value,computation,wrapped,captureGroup,key,cache=this.cache,keypathStr=keypath.str;if(options=options||viewmodel_prototype_get__empty,options.capture&&(captureGroup=lastItem(this.captureGroups))&&(~captureGroup.indexOf(keypath)||captureGroup.push(keypath)),hasOwn.call(this.mappings,keypath.firstKey))return this.mappings[keypath.firstKey].get(keypath,options);if(keypath.isSpecial)return keypath.value;if(void 0===cache[keypathStr]?((computation=this.computations[keypathStr])&&!computation.bypass?(value=computation.get(),this.adapt(keypathStr,value)):(wrapped=this.wrapped[keypathStr])?value=wrapped.value:keypath.isRoot?(this.adapt("",this.data),value=this.data):value=retrieve(this,keypath),cache[keypathStr]=value):value=cache[keypathStr],!options.noUnwrap&&(wrapped=this.wrapped[keypathStr])&&(value=wrapped.get()),keypath.isRoot&&options.fullRootGet)for(key in this.mappings)value[key]=this.mappings[key].getValue();return value===FAILED_LOOKUP?void 0:value}function retrieve(viewmodel,keypath){var parentValue,cacheMap,value,wrapped;return parentValue=viewmodel.get(keypath.parent),(wrapped=viewmodel.wrapped[keypath.parent.str])&&(parentValue=wrapped.get()),null!==parentValue&&void 0!==parentValue?((cacheMap=viewmodel.cacheMap[keypath.parent.str])?-1===cacheMap.indexOf(keypath.str)&&cacheMap.push(keypath.str):viewmodel.cacheMap[keypath.parent.str]=[keypath.str],"object"!=typeof parentValue||keypath.lastKey in parentValue?(value=parentValue[keypath.lastKey],viewmodel.adapt(keypath.str,value,!1),viewmodel.cache[keypath.str]=value,value):viewmodel.cache[keypath.str]=FAILED_LOOKUP):void 0}function Viewmodel$init(){var key;for(key in this.computations)this.computations[key].init(this)}function Viewmodel$map(key,options){var mapping=this.mappings[key.str]=new Mapping(key,options);return mapping.initViewmodel(this),mapping}function Viewmodel$mark(keypath,options){var computation,keypathStr=keypath.str;options&&(options.implicit&&(this.implicitChanges[keypathStr]=!0),options.noCascade&&(this.noCascade[keypathStr]=!0)),(computation=this.computations[keypathStr])&&computation.invalidate(),-1===this.changes.indexOf(keypath)&&this.changes.push(keypath);var keepExistingWrapper=options?options.keepExistingWrapper:!1;this.clearCache(keypathStr,keepExistingWrapper),this.ready&&this.onchange()}function Viewmodel$merge(keypath,currentArray,array,options){var oldArray,newArray,comparator,newIndices;if(this.mark(keypath),options&&options.compare){comparator=getComparatorFunction(options.compare);try{oldArray=currentArray.map(comparator),newArray=array.map(comparator)}catch(err){warnIfDebug('merge(): "%s" comparison failed. Falling back to identity checking',keypath),oldArray=currentArray,newArray=array}}else oldArray=currentArray,newArray=array;newIndices=mapOldToNewIndex(oldArray,newArray),this.smartUpdate(keypath,array,newIndices,currentArray.length!==array.length)}function stringify(item){return JSON.stringify(item)}function getComparatorFunction(comparator){if(comparator===!0)return stringify;if("string"==typeof comparator)return comparators[comparator]||(comparators[comparator]=function(item){return item[comparator]}),comparators[comparator];if("function"==typeof comparator)return comparator;throw new Error("The `compare` option must be a function, or a string representing an identifying field (or `true` to use JSON.stringify)")}function Viewmodel$register(keypath,dependant){var mapping,depsByKeypath,deps,group=void 0===arguments[2]?"default":arguments[2];dependant.isStatic||((mapping=this.mappings[keypath.firstKey])?mapping.register(keypath,dependant,group):(depsByKeypath=this.deps[group]||(this.deps[group]={}),deps=depsByKeypath[keypath.str]||(depsByKeypath[keypath.str]=[]),deps.push(dependant),this.depsMap[group]||(this.depsMap[group]={}),keypath.isRoot||register__updateDependantsMap(this,keypath,group)))}function register__updateDependantsMap(viewmodel,keypath,group){for(var map,parent,keypathStr;!keypath.isRoot;)map=viewmodel.depsMap[group],parent=map[keypath.parent.str]||(map[keypath.parent.str]=[]),keypathStr=keypath.str,void 0===parent["_"+keypathStr]&&(parent["_"+keypathStr]=0,parent.push(keypath)),parent["_"+keypathStr]+=1,keypath=keypath.parent}function Viewmodel$release(){return this.captureGroups.pop()}function Viewmodel$reset(data){this.data=data,this.clearCache("")}function Viewmodel$set(keypath,value){var mapping,computation,wrapper,keepExistingWrapper,options=void 0===arguments[2]?{}:arguments[2];if(!options.noMapping&&(mapping=this.mappings[keypath.firstKey]))return mapping.set(keypath,value);if(computation=this.computations[keypath.str]){if(computation.setting)return;computation.set(value),value=computation.get()}isEqual(this.cache[keypath.str],value)||(wrapper=this.wrapped[keypath.str],wrapper&&wrapper.reset&&(keepExistingWrapper=wrapper.reset(value)!==!1,keepExistingWrapper&&(value=wrapper.get())),computation||keepExistingWrapper||resolveSet(this,keypath,value),options.silent?this.clearCache(keypath.str):this.mark(keypath))}function resolveSet(viewmodel,keypath,value){var wrapper,parentValue,wrapperSet,valueSet;wrapperSet=function(){wrapper.set?wrapper.set(keypath.lastKey,value):(parentValue=wrapper.get(),valueSet())},valueSet=function(){parentValue||(parentValue=createBranch(keypath.lastKey),viewmodel.set(keypath.parent,parentValue,{silent:!0})),parentValue[keypath.lastKey]=value},wrapper=viewmodel.wrapped[keypath.parent.str],wrapper?wrapperSet():(parentValue=viewmodel.get(keypath.parent),(wrapper=viewmodel.wrapped[keypath.parent.str])?wrapperSet():valueSet())}function Viewmodel$smartUpdate(keypath,array,newIndices){var dependants,oldLength,i,_this=this;if(oldLength=newIndices.length,newIndices.forEach(function(newIndex,oldIndex){-1===newIndex&&_this.mark(keypath.join(oldIndex),noCascadeOption)}),this.set(keypath,array,{silent:!0}),(dependants=this.deps["default"][keypath.str])&&dependants.filter(canShuffle).forEach(function(d){return d.shuffle(newIndices,array)}),oldLength!==array.length){for(this.mark(keypath.join("length"),implicitOption),i=newIndices.touchedFrom;ii;i+=1)this.mark(keypath.join(i),noCascadeOption)}}function canShuffle(dependant){return"function"==typeof dependant.shuffle}function Viewmodel$teardown(){var unresolvedImplicitDependency,_this=this;for(Object.keys(this.cache).forEach(function(keypath){return _this.clearCache(keypath)});unresolvedImplicitDependency=this.unresolvedImplicitDependencies.pop();)unresolvedImplicitDependency.teardown()}function Viewmodel$unregister(keypath,dependant){var mapping,deps,index,group=void 0===arguments[2]?"default":arguments[2];if(!dependant.isStatic){if(mapping=this.mappings[keypath.firstKey])return mapping.unregister(keypath,dependant,group);if(deps=this.deps[group][keypath.str],index=deps.indexOf(dependant),-1===index)throw new Error("Attempted to remove a dependant that was no longer registered! This should not happen. If you are seeing this bug in development please raise an issue at https://github.com/RactiveJS/Ractive/issues - thanks");deps.splice(index,1),keypath.isRoot||unregister__updateDependantsMap(this,keypath,group)}}function unregister__updateDependantsMap(viewmodel,keypath,group){for(var map,parent;!keypath.isRoot;)map=viewmodel.depsMap[group],parent=map[keypath.parent.str],parent["_"+keypath.str]-=1,parent["_"+keypath.str]||(removeFromArray(parent,keypath),parent["_"+keypath.str]=void 0),keypath=keypath.parent}function HookQueue(event){this.hook=new hooks_Hook(event),this.inProcess={},this.queue={}}function getChildQueue(queue,ractive){return queue[ractive._guid]||(queue[ractive._guid]=[])}function fire(hookQueue,ractive){var childQueue=getChildQueue(hookQueue.queue,ractive);for(hookQueue.hook.fire(ractive);childQueue.length;)fire(hookQueue,childQueue.shift());delete hookQueue.queue[ractive._guid]}function getComputationSignatures(ractive,computed){var key,signatures={};for(key in computed)signatures[key]=getComputationSignature(ractive,key,computed[key]);return signatures}function getComputationSignature(ractive,key,signature){var getter,setter;return"function"==typeof signature&&(getter=helpers_getComputationSignatures__bind(signature,ractive)),"string"==typeof signature&&(getter=createFunctionFromString(ractive,signature)),"object"==typeof signature&&("string"==typeof signature.get?getter=createFunctionFromString(ractive,signature.get):"function"==typeof signature.get?getter=helpers_getComputationSignatures__bind(signature.get,ractive):fatal("`%s` computation must have a `get()` method",key),"function"==typeof signature.set&&(setter=helpers_getComputationSignatures__bind(signature.set,ractive))),{getter:getter,setter:setter}}function createFunctionFromString(ractive,str){var functionBody,hasThis,fn;return functionBody="return ("+str.replace(helpers_getComputationSignatures__pattern,function(match,keypath){return hasThis=!0,'__ractive.get("'+keypath+'")'})+");",hasThis&&(functionBody="var __ractive = this; "+functionBody),fn=new Function(functionBody),hasThis?fn.bind(ractive):fn}function helpers_getComputationSignatures__bind(fn,context){return/this/.test(fn.toString())?fn.bind(context):fn}function initialiseRactiveInstance(ractive){var el,viewmodel,userOptions=void 0===arguments[1]?{}:arguments[1],options=void 0===arguments[2]?{}:arguments[2];if(_Ractive.DEBUG&&welcome(),initialiseProperties(ractive,options),defineProperty(ractive,"data",{get:deprecateRactiveData}),constructHook.fire(ractive,userOptions),initialise__registryNames.forEach(function(name){ractive[name]=utils_object__extend(create(ractive.constructor[name]||null),userOptions[name])}),viewmodel=new viewmodel_Viewmodel({adapt:getAdaptors(ractive,ractive.adapt,userOptions),data:custom_data.init(ractive.constructor,ractive,userOptions),computed:helpers_getComputationSignatures(ractive,utils_object__extend(create(ractive.constructor.prototype.computed),userOptions.computed)),mappings:options.mappings,ractive:ractive,onchange:function(){return global_runloop.addRactive(ractive)}}),ractive.viewmodel=viewmodel,viewmodel.init(),config_config.init(ractive.constructor,ractive,userOptions),configHook.fire(ractive),initHook.begin(ractive),ractive.template){var cssIds=void 0;(options.cssIds||ractive.cssId)&&(cssIds=options.cssIds?options.cssIds.slice():[],ractive.cssId&&cssIds.push(ractive.cssId)),ractive.fragment=new virtualdom_Fragment({template:ractive.template,root:ractive,owner:ractive,cssIds:cssIds})}if(initHook.end(ractive),el=getElement(ractive.el)){var promise=ractive.render(el,ractive.append);_Ractive.DEBUG_PROMISES&&promise["catch"](function(err){throw warnOnceIfDebug("Promise debugging is enabled, to help solve errors that happen asynchronously. Some browsers will log unhandled promise rejections, in which case you can safely disable promise debugging:\n Ractive.DEBUG_PROMISES = false;"),warnIfDebug("An error happened during rendering",{ractive:ractive}),err.stack&&logIfDebug(err.stack),err})}}function getAdaptors(ractive,protoAdapt,userOptions){function lookup(adaptor){return"string"==typeof adaptor&&(adaptor=findInViewHierarchy("adaptors",ractive,adaptor),adaptor||fatal(missingPlugin(adaptor,"adaptor"))),adaptor}var adapt,magic,modifyArrays;if(protoAdapt=protoAdapt.map(lookup),adapt=ensureArray(userOptions.adapt).map(lookup),adapt=initialise__combine(protoAdapt,adapt),magic="magic"in userOptions?userOptions.magic:ractive.magic,modifyArrays="modifyArrays"in userOptions?userOptions.modifyArrays:ractive.modifyArrays,magic){if(!environment__magic)throw new Error("Getters and setters (magic mode) are not supported in this browser");modifyArrays&&adapt.push(magicArray),adapt.push(adaptors_magic)}return modifyArrays&&adapt.push(array_index),adapt}function initialise__combine(a,b){for(var c=a.slice(),i=b.length;i--;)~c.indexOf(b[i])||c.push(b[i]);return c}function initialiseProperties(ractive,options){ractive._guid="r-"+initialise__uid++,ractive._subs=create(null),ractive._config={},ractive._twowayBindings=create(null),ractive._animations=[],ractive.nodes={},ractive._liveQueries=[],ractive._liveComponentQueries=[],ractive._boundFunctions=[],ractive._observers=[],options.component?(ractive.parent=options.parent,ractive.container=options.container||null,ractive.root=ractive.parent.root,ractive.component=options.component,options.component.instance=ractive,ractive._inlinePartials=options.inlinePartials):(ractive.root=ractive,ractive.parent=ractive.container=null)}function deprecateRactiveData(){throw new Error("Using `ractive.data` is no longer supported - you must use the `ractive.get()` API instead")}function ComplexParameter(component,template,callback){this.parentFragment=component.parentFragment,this.callback=callback,this.fragment=new virtualdom_Fragment({template:template,root:component.root,owner:this}),this.update()}function createResolver(component,template,callback){var resolver;return template.r?resolver=Resolvers_createReferenceResolver(component,template.r,callback):template.x?resolver=new Resolvers_ExpressionResolver(component,component.parentFragment,template.x,callback):template.rx&&(resolver=new ReferenceExpressionResolver_ReferenceExpressionResolver(component,template.rx,callback)),resolver}function isSingleInterpolator(template){return 1===template.length&&template[0].t===INTERPOLATOR}function propagateEvents(component,eventsDescriptor){var eventName;for(eventName in eventsDescriptor)eventsDescriptor.hasOwnProperty(eventName)&&propagateEvent(component.instance,component.root,eventName,eventsDescriptor[eventName])}function propagateEvent(childInstance,parentInstance,eventName,proxyEventName){"string"!=typeof proxyEventName&&fatal("Components currently only support simple events - you cannot include arguments. Sorry!"),childInstance.on(eventName,function(){var event,args;return arguments.length&&arguments[0]&&arguments[0].node&&(event=Array.prototype.shift.call(arguments)),args=Array.prototype.slice.call(arguments),shared_fireEvent(parentInstance,proxyEventName,{event:event,args:args}),!1})}function Component$init(options,Component){var parentFragment,root;if(!Component)throw new Error('Component "'+this.name+'" not found');parentFragment=this.parentFragment=options.parentFragment,root=parentFragment.root,this.root=root,this.type=COMPONENT,this.name=options.template.e,this.index=options.index,this.indexRefBindings={},this.yielders={},this.resolvers=[],createInstance(this,Component,options.template.a,options.template.f,options.template.p),initialise_propagateEvents(this,options.template.v),(options.template.t0||options.template.t1||options.template.t2||options.template.o)&&warnIfDebug('The "intro", "outro" and "decorator" directives have no effect on components',{ractive:this.instance}),initialise_updateLiveQueries(this)}function Component$rebind(oldKeypath,newKeypath){function rebind(x){x.rebind(oldKeypath,newKeypath)}var query;this.resolvers.forEach(rebind);for(var k in this.yielders)this.yielders[k][0]&&rebind(this.yielders[k][0]);(query=this.root._liveComponentQueries["_"+this.name])&&query._makeDirty()}function Component$render(){var instance=this.instance;return instance.render(this.parentFragment.getNode()),this.rendered=!0,instance.fragment.detach()}function Component$toString(){return this.instance.fragment.toString()}function Component$unbind(){var instance=this.instance;this.resolvers.forEach(methodCallers__unbind),removeFromLiveComponentQueries(this),instance._observers.forEach(cancel),instance.fragment.unbind(),instance.viewmodel.teardown(),instance.fragment.rendered&&instance.el.__ractive_instances__&&removeFromArray(instance.el.__ractive_instances__,instance),Component_prototype_unbind__teardownHook.fire(instance)}function removeFromLiveComponentQueries(component){var instance,query;instance=component.root;do(query=instance._liveComponentQueries["_"+component.name])&&query._remove(component);while(instance=instance.parent)}function Component$unrender(shouldDestroy){this.shouldDestroy=shouldDestroy,this.instance.unrender()}function Fragment$init(options){var _this=this;this.owner=options.owner,this.parent=this.owner.parentFragment,this.root=options.root,this.pElement=options.pElement,this.context=options.context,this.index=options.index,this.key=options.key,this.registeredIndexRefs=[],this.cssIds="cssIds"in options?options.cssIds:this.parent?this.parent.cssIds:null,this.items=options.template.map(function(template,i){return createItem({parentFragment:_this,pElement:options.pElement,template:template,index:i})}),this.value=this.argsList=null,this.dirtyArgs=this.dirtyValue=!0,this.bound=!0}function createItem(options){if("string"==typeof options.template)return new items_Text(options);switch(options.template.t){case YIELDER:return new items_Yielder(options);case INTERPOLATOR:return new items_Interpolator(options);case SECTION:return new _Section(options);case TRIPLE:return new _Triple(options);case ELEMENT:var constructor=void 0;return(constructor=Component_getComponent(options.parentFragment.root,options.template.e))?new _Component(options,constructor):new _Element(options);case PARTIAL:return new _Partial(options);case COMMENT:return new items_Comment(options);case DOCTYPE:return new items_Doctype(options);default:throw new Error("Something very strange happened. Please file an issue at https://github.com/ractivejs/ractive/issues. Thanks!")}}function Fragment$rebind(oldKeypath,newKeypath){(!this.owner||this.owner.hasContext)&&assignNewKeypath(this,"context",oldKeypath,newKeypath),this.items.forEach(function(item){item.rebind&&item.rebind(oldKeypath,newKeypath)})}function Fragment$render(){var result;return 1===this.items.length?result=this.items[0].render():(result=document.createDocumentFragment(),this.items.forEach(function(item){result.appendChild(item.render())})),this.rendered=!0,result}function Fragment$toString(escape){return this.items?this.items.map(escape?toEscapedString:Fragment_prototype_toString__toString).join(""):""}function Fragment_prototype_toString__toString(item){return item.toString()}function toEscapedString(item){return item.toString(!0)}function Fragment$unbind(){this.bound&&(this.items.forEach(unbindItem),this.bound=!1)}function unbindItem(item){item.unbind&&item.unbind()}function Fragment$unrender(shouldDestroy){if(!this.rendered)throw new Error("Attempted to unrender a fragment that was not rendered");this.items.forEach(function(i){return i.unrender(shouldDestroy)}),this.rendered=!1}function Ractive$reset(data){var promise,wrapper,changes,i,rerender;if(data=data||{},"object"!=typeof data)throw new Error("The reset method takes either no arguments, or an object containing new data");for((wrapper=this.viewmodel.wrapped[""])&&wrapper.reset?wrapper.reset(data)===!1&&this.viewmodel.reset(data):this.viewmodel.reset(data),changes=config_config.reset(this),i=changes.length;i--;)if(shouldRerender.indexOf(changes[i])>-1){rerender=!0;break}if(rerender){var component=void 0;this.viewmodel.mark(rootKeypath),(component=this.component)&&(component.shouldDestroy=!0),this.unrender(),component&&(component.shouldDestroy=!1),this.fragment.template!==this.template&&(this.fragment.unbind(),this.fragment=new virtualdom_Fragment({template:this.template,root:this,owner:this})),promise=this.render(this.el,this.anchor)}else promise=global_runloop.start(this,!0),this.viewmodel.mark(rootKeypath),global_runloop.end();return resetHook.fire(this,data),promise}function Ractive$resetTemplate(template){var transitionsEnabled,component;template_template.init(null,this,{template:template}),transitionsEnabled=this.transitionsEnabled,this.transitionsEnabled=!1,(component=this.component)&&(component.shouldDestroy=!0),this.unrender(),component&&(component.shouldDestroy=!1),this.fragment.unbind(),this.fragment=new virtualdom_Fragment({template:this.template,root:this,owner:this}),this.render(this.el,this.anchor),this.transitionsEnabled=transitionsEnabled}function Ractive$set(keypath,value){var map,promise;if(promise=global_runloop.start(this,!0),isObject(keypath)){map=keypath;for(keypath in map)map.hasOwnProperty(keypath)&&(value=map[keypath],set(this,keypath,value))}else set(this,keypath,value);return global_runloop.end(),promise}function set(ractive,keypath,value){keypath=getKeypath(normalise(keypath)),keypath.isPattern?getMatchingKeypaths(ractive,keypath).forEach(function(keypath){ractive.viewmodel.set(keypath,value)}):ractive.viewmodel.set(keypath,value)}function Ractive$subtract(keypath,d){return shared_add(this,keypath,void 0===d?-1:-d)}function Ractive$teardown(){var promise;return this.fragment.unbind(),this.viewmodel.teardown(),this._observers.forEach(cancel),this.fragment.rendered&&this.el.__ractive_instances__&&removeFromArray(this.el.__ractive_instances__,this),this.shouldDestroy=!0,promise=this.fragment.rendered?this.unrender():utils_Promise.resolve(),Ractive_prototype_teardown__teardownHook.fire(this),this._boundFunctions.forEach(deleteFunctionCopy),promise}function deleteFunctionCopy(bound){delete bound.fn[bound.prop]}function Ractive$toggle(keypath){var _this=this;if("string"!=typeof keypath)throw new TypeError(badArguments);var changes=void 0;return/\*/.test(keypath)?(changes={},getMatchingKeypaths(this,getKeypath(normalise(keypath))).forEach(function(keypath){changes[keypath.str]=!_this.viewmodel.get(keypath)}),this.set(changes)):this.set(keypath,!this.get(keypath))}function Ractive$toHTML(){return this.fragment.toString(!0)}function Ractive$unrender(){var promise,shouldDestroy;if(!this.fragment.rendered)return warnIfDebug("ractive.unrender() was called on a Ractive instance that was not rendered"),utils_Promise.resolve();for(promise=global_runloop.start(this,!0),shouldDestroy=!this.component||this.component.shouldDestroy||this.shouldDestroy;this._animations[0];)this._animations[0].stop();return this.fragment.unrender(shouldDestroy),removeFromArray(this.el.__ractive_instances__,this),unrenderHook.fire(this),global_runloop.end(),promise}function Ractive$update(keypath){var promise;return keypath=getKeypath(keypath)||rootKeypath,promise=global_runloop.start(this,!0),this.viewmodel.mark(keypath),global_runloop.end(),updateHook.fire(this,keypath),promise}function Ractive$updateModel(keypath,cascade){var values,key,bindings;if("string"!=typeof keypath||cascade){bindings=[];for(key in this._twowayBindings)(!keypath||getKeypath(key).equalsOrStartsWith(keypath))&&bindings.push.apply(bindings,this._twowayBindings[key])}else bindings=this._twowayBindings[keypath];return values=consolidate(this,bindings),this.set(values)}function consolidate(ractive,bindings){var values={},checkboxGroups=[];return bindings.forEach(function(b){var oldValue,newValue;if(!b.radioName||b.element.node.checked){if(b.checkboxName)return void(checkboxGroups[b.keypath.str]||b.changed()||(checkboxGroups.push(b.keypath),checkboxGroups[b.keypath.str]=b));oldValue=b.attribute.value,newValue=b.getValue(),arrayContentsMatch(oldValue,newValue)||isEqual(oldValue,newValue)||(values[b.keypath.str]=newValue)}}),checkboxGroups.length&&checkboxGroups.forEach(function(keypath){var binding,oldValue,newValue;binding=checkboxGroups[keypath.str],oldValue=binding.attribute.value,newValue=binding.getValue(),arrayContentsMatch(oldValue,newValue)||(values[keypath.str]=newValue)}),values}function needsSuper(method,superMethod){return"function"==typeof superMethod&&/_super/.test(method)}function unwrap(Child){for(var options={};Child;)addRegistries(Child,options),addOtherOptions(Child,options),Child=Child._Parent!==_Ractive?Child._Parent:!1;return options}function addRegistries(Child,options){config_registries.forEach(function(r){addRegistry(r.useDefaults?Child.prototype:Child,options,r.name)})}function addRegistry(target,options,name){var registry,keys=Object.keys(target[name]);keys.length&&((registry=options[name])||(registry=options[name]={}),keys.filter(function(key){return!(key in registry)}).forEach(function(key){return registry[key]=target[name][key]}))}function addOtherOptions(Child,options){Object.keys(Child.prototype).forEach(function(key){if("computed"!==key){var value=Child.prototype[key];if(key in options){if("function"==typeof options[key]&&"function"==typeof value&&options[key]._method){var result=void 0,needsSuper=value._method;needsSuper&&(value=value._method),result=wrapMethod(options[key]._method,value),needsSuper&&(result._method=result),options[key]=result}}else options[key]=value._method?value._method:value}})}function _extend__extend(){for(var _len=arguments.length,options=Array(_len),_key=0;_len>_key;_key++)options[_key]=arguments[_key];return options.length?options.reduce(extendOne,this):extendOne(this)}function extendOne(Parent){var Child,proto,options=void 0===arguments[1]?{}:arguments[1];return options.prototype instanceof _Ractive&&(options=unwrapExtended(options)),Child=function(options){return this instanceof Child?void initialise(this,options):new Child(options)},proto=create(Parent.prototype),proto.constructor=Child,defineProperties(Child,{defaults:{value:proto},extend:{value:_extend__extend,writable:!0,configurable:!0},_Parent:{value:Parent}}),config_config.extend(Parent,proto,options),custom_data.extend(Parent,proto,options),options.computed&&(proto.computed=utils_object__extend(create(Parent.prototype.computed),options.computed)),Child.prototype=proto,Child}var isClient,isJsdom,hasConsole,environment__magic,namespaces,svg,vendors,TEMPLATE_VERSION=3,defaultOptions={el:void 0,append:!1,template:{v:TEMPLATE_VERSION,t:[]},preserveWhitespace:!1,sanitize:!1,stripComments:!0,delimiters:["{{","}}"],tripleDelimiters:["{{{","}}}"],interpolate:!1,data:{},computed:{},magic:!1,modifyArrays:!0,adapt:[],isolated:!1,twoway:!0,lazy:!1,noIntro:!1,transitionsEnabled:!0,complete:void 0,css:null,noCssTransform:!1},config_defaults=defaultOptions,static_easing={linear:function(pos){return pos},easeIn:function(pos){return Math.pow(pos,3)},easeOut:function(pos){return Math.pow(pos-1,3)+1},easeInOut:function(pos){return(pos/=.5)<1?.5*Math.pow(pos,3):.5*(Math.pow(pos-2,3)+2)}};isClient="object"==typeof document,isJsdom="undefined"!=typeof navigator&&/jsDom/.test(navigator.appName),hasConsole="undefined"!=typeof console&&"function"==typeof console.warn&&"function"==typeof console.warn.apply;try{Object.defineProperty({},"test",{value:0}),environment__magic=!0}catch(e){environment__magic=!1}namespaces={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},svg="undefined"==typeof document?!1:document&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),vendors=["o","ms","moz","webkit"];var createElement,matches,dom__div,methodNames,unprefixed,prefixed,dom__i,j,makeFunction;if(createElement=svg?function(type,ns){return ns&&ns!==namespaces.html?document.createElementNS(ns,type):document.createElement(type)}:function(type,ns){if(ns&&ns!==namespaces.html)throw"This browser does not support namespaces other than http://www.w3.org/1999/xhtml. The most likely cause of this error is that you're trying to render SVG in an older browser. See http://docs.ractivejs.org/latest/svg-and-older-browsers for more information";return document.createElement(type)},isClient){for(dom__div=createElement("div"),methodNames=["matches","matchesSelector"],makeFunction=function(methodName){return function(node,selector){return node[methodName](selector)}},dom__i=methodNames.length;dom__i--&&!matches;)if(unprefixed=methodNames[dom__i],dom__div[unprefixed])matches=makeFunction(unprefixed);else for(j=vendors.length;j--;)if(prefixed=vendors[dom__i]+unprefixed.substr(0,1).toUpperCase()+unprefixed.substring(1), dom__div[prefixed]){matches=makeFunction(prefixed);break}matches||(matches=function(node,selector){var nodes,parentNode,i;for(parentNode=node.parentNode,parentNode||(dom__div.innerHTML="",parentNode=dom__div,node=node.cloneNode(),dom__div.appendChild(node)),nodes=parentNode.querySelectorAll(selector),i=nodes.length;i--;)if(nodes[i]===node)return!0;return!1})}else matches=null;var create,defineProperty,defineProperties,legacy=null;try{Object.defineProperty({},"test",{value:0}),isClient&&Object.defineProperty(document.createElement("div"),"test",{value:0}),defineProperty=Object.defineProperty}catch(err){defineProperty=function(obj,prop,desc){obj[prop]=desc.value}}try{try{Object.defineProperties({},{test:{value:0}})}catch(err){throw err}isClient&&Object.defineProperties(createElement("div"),{test:{value:0}}),defineProperties=Object.defineProperties}catch(err){defineProperties=function(obj,props){var prop;for(prop in props)props.hasOwnProperty(prop)&&defineProperty(obj,prop,props[prop])}}try{Object.create(null),create=Object.create}catch(err){create=function(){var F=function(){};return function(proto,props){var obj;return null===proto?{}:(F.prototype=proto,obj=new F,props&&Object.defineProperties(obj,props),obj)}}()}var log,printWarning,welcome,hasOwn=Object.prototype.hasOwnProperty,is__toString=Object.prototype.toString,arrayLikePattern=/^\[object (?:Array|FileList)\]$/,noop=function(){},alreadyWarned={};hasConsole?!function(){var welcomeIntro=["%cRactive.js %c0.7.3 %cin debug mode, %cmore...","color: rgb(114, 157, 52); font-weight: normal;","color: rgb(85, 85, 85); font-weight: normal;","color: rgb(85, 85, 85); font-weight: normal;","color: rgb(82, 140, 224); font-weight: normal; text-decoration: underline;"],welcomeMessage="You're running Ractive 0.7.3 in debug mode - messages will be printed to the console to help you fix problems and optimise your application.\n\nTo disable debug mode, add this line at the start of your app:\n Ractive.DEBUG = false;\n\nTo disable debug mode when your app is minified, add this snippet:\n Ractive.DEBUG = /unminified/.test(function(){/*unminified*/});\n\nGet help and support:\n http://docs.ractivejs.org\n http://stackoverflow.com/questions/tagged/ractivejs\n http://groups.google.com/forum/#!forum/ractive-js\n http://twitter.com/ractivejs\n\nFound a bug? Raise an issue:\n https://github.com/ractivejs/ractive/issues\n\n";welcome=function(){var hasGroup=!!console.groupCollapsed;console[hasGroup?"groupCollapsed":"log"].apply(console,welcomeIntro),console.log(welcomeMessage),hasGroup&&console.groupEnd(welcomeIntro),welcome=noop},printWarning=function(message,args){if(welcome(),"object"==typeof args[args.length-1]){var options=args.pop(),ractive=options?options.ractive:null;if(ractive){var _name=void 0;ractive.component&&(_name=ractive.component.name)&&(message="<"+_name+"> "+message);var node=void 0;(node=options.node||ractive.fragment&&ractive.fragment.rendered&&ractive.find("*"))&&args.push(node)}}console.warn.apply(console,["%cRactive.js: %c"+message,"color: rgb(114, 157, 52);","color: rgb(85, 85, 85);"].concat(args))},log=function(){console.log.apply(console,arguments)}}():printWarning=log=welcome=noop;var badArguments="Bad arguments",noRegistryFunctionReturn='A function was specified for "%s" %s, but no %s was returned',missingPlugin=function(name,type){return'Missing "'+name+'" '+type+" plugin. You may need to download a plugin via http://docs.ractivejs.org/latest/plugins#"+type+"s"},interpolate=function(from,to,ractive,type){if(from===to)return snap(to);if(type){var interpol=findInViewHierarchy("interpolators",ractive,type);if(interpol)return interpol(from,to)||snap(to);fatal(missingPlugin(type,"interpolator"))}return static_interpolators.number(from,to)||static_interpolators.array(from,to)||static_interpolators.object(from,to)||snap(to)},shared_interpolate=interpolate,interpolators={number:function(from,to){var delta;return is__isNumeric(from)&&is__isNumeric(to)?(from=+from,to=+to,delta=to-from,delta?function(t){return from+t*delta}:function(){return from}):null},array:function(from,to){var intermediate,interpolators,len,i;if(!isArray(from)||!isArray(to))return null;for(intermediate=[],interpolators=[],i=len=Math.min(from.length,to.length);i--;)interpolators[i]=shared_interpolate(from[i],to[i]);for(i=len;i=this.duration?(null!==keypath&&(global_runloop.start(this.root),this.root.viewmodel.set(keypath,this.to),global_runloop.end()),this.step&&this.step(1,this.to),this.complete(this.to),index=this.root._animations.indexOf(this),-1===index&&warnIfDebug("Animation was not found"),this.root._animations.splice(index,1),this.running=!1,!1):(t=this.easing?this.easing(elapsed/this.duration):elapsed/this.duration,null!==keypath&&(value=this.interpolator(t),global_runloop.start(this.root),this.root.viewmodel.set(keypath,value),global_runloop.end()),this.step&&this.step(t,value),!0)):!1},stop:function(){var index;this.running=!1,index=this.root._animations.indexOf(this),-1===index&&warnIfDebug("Animation was not found"),this.root._animations.splice(index,1)}};var animate_Animation=Animation,prototype_animate=Ractive$animate,noAnimation={stop:noop},prototype_detach=Ractive$detach,prototype_detach__detachHook=new hooks_Hook("detach"),prototype_find=Ractive$find,test=Query$test,makeQuery_cancel=function(){var liveQueries,selector,index;liveQueries=this._root[this._isComponentQuery?"liveComponentQueries":"liveQueries"],selector=this.selector,index=liveQueries.indexOf(selector),-1!==index&&(liveQueries.splice(index,1),liveQueries[selector]=null)},sortByItemPosition=function(a,b){var ancestryA,ancestryB,oldestA,oldestB,mutualAncestor,indexA,indexB,fragments,fragmentA,fragmentB;for(ancestryA=getAncestry(a.component||a._ractive.proxy),ancestryB=getAncestry(b.component||b._ractive.proxy),oldestA=lastItem(ancestryA),oldestB=lastItem(ancestryB);oldestA&&oldestA===oldestB;)ancestryA.pop(),ancestryB.pop(),mutualAncestor=oldestA,oldestA=lastItem(ancestryA),oldestB=lastItem(ancestryB);if(oldestA=oldestA.component||oldestA,oldestB=oldestB.component||oldestB,fragmentA=oldestA.parentFragment,fragmentB=oldestB.parentFragment,fragmentA===fragmentB)return indexA=fragmentA.items.indexOf(oldestA),indexB=fragmentB.items.indexOf(oldestB),indexA-indexB||ancestryA.length-ancestryB.length;if(fragments=mutualAncestor.fragments)return indexA=fragments.indexOf(fragmentA),indexB=fragments.indexOf(fragmentB),indexA-indexB||ancestryA.length-ancestryB.length;throw new Error("An unexpected condition was met while comparing the position of two components. Please file an issue at https://github.com/RactiveJS/Ractive/issues - thanks!")},sortByDocumentPosition=function(node,otherNode){var bitmask;return node.compareDocumentPosition?(bitmask=node.compareDocumentPosition(otherNode),2&bitmask?1:-1):sortByItemPosition(node,otherNode)},sort=function(){this.sort(this._isComponentQuery?sortByItemPosition:sortByDocumentPosition),this._dirty=!1},makeQuery_dirty=function(){var _this=this;this._dirty||(this._dirty=!0,global_runloop.scheduleTask(function(){_this._sort()}))},remove=function(nodeOrComponent){var index=this.indexOf(this._isComponentQuery?nodeOrComponent.instance:nodeOrComponent);-1!==index&&this.splice(index,1)},_makeQuery=makeQuery,prototype_findAll=Ractive$findAll,prototype_findAllComponents=Ractive$findAllComponents,prototype_findComponent=Ractive$findComponent,findContainer=Ractive$findContainer,findParent=Ractive$findParent,eventStack={enqueue:function(ractive,event){ractive.event&&(ractive._eventQueue=ractive._eventQueue||[],ractive._eventQueue.push(ractive.event)),ractive.event=event},dequeue:function(ractive){ractive._eventQueue&&ractive._eventQueue.length?ractive.event=ractive._eventQueue.pop():delete ractive.event}},shared_eventStack=eventStack,shared_fireEvent=fireEvent,prototype_fire=Ractive$fire,prototype_get=Ractive$get,options={capture:!0,noUnwrap:!0,fullRootGet:!0},insert=Ractive$insert,insertHook=new hooks_Hook("insert"),prototype_merge=Ractive$merge,Observer=function(ractive,keypath,callback,options){this.root=ractive,this.keypath=keypath,this.callback=callback,this.defer=options.defer,this.context=options&&options.context?options.context:ractive};Observer.prototype={init:function(immediate){this.value=this.root.get(this.keypath.str),immediate!==!1?this.update():this.oldValue=this.value},setValue:function(value){var _this=this;isEqual(value,this.value)||(this.value=value,this.defer&&this.ready?global_runloop.scheduleTask(function(){return _this.update()}):this.update())},update:function(){this.updating||(this.updating=!0,this.callback.call(this.context,this.value,this.oldValue,this.keypath.str),this.oldValue=this.value,this.updating=!1)}};var PatternObserver,observe_Observer=Observer,observe_getPattern=getPattern,slice=Array.prototype.slice;PatternObserver=function(ractive,keypath,callback,options){this.root=ractive,this.callback=callback,this.defer=options.defer,this.keypath=keypath,this.regex=new RegExp("^"+keypath.str.replace(/\./g,"\\.").replace(/\*/g,"([^\\.]+)")+"$"),this.values={},this.defer&&(this.proxies=[]),this.context=options&&options.context?options.context:ractive},PatternObserver.prototype={init:function(immediate){var values,keypath;if(values=observe_getPattern(this.root,this.keypath),immediate!==!1)for(keypath in values)values.hasOwnProperty(keypath)&&this.update(getKeypath(keypath));else this.values=values},update:function(keypath){var values,_this=this;if(keypath.isPattern){values=observe_getPattern(this.root,keypath);for(keypath in values)values.hasOwnProperty(keypath)&&this.update(getKeypath(keypath))}else if(!this.root.viewmodel.implicitChanges[keypath.str])return this.defer&&this.ready?void global_runloop.scheduleTask(function(){return _this.getProxy(keypath).update()}):void this.reallyUpdate(keypath)},reallyUpdate:function(keypath){var keypathStr,value,keys,args;return keypathStr=keypath.str,value=this.root.viewmodel.get(keypath),this.updating?void(this.values[keypathStr]=value):(this.updating=!0,isEqual(value,this.values[keypathStr])&&this.ready||(keys=slice.call(this.regex.exec(keypathStr),1),args=[value,this.values[keypathStr],keypathStr].concat(keys),this.values[keypathStr]=value,this.callback.apply(this.context,args)),void(this.updating=!1))},getProxy:function(keypath){var _this=this;return this.proxies[keypath.str]||(this.proxies[keypath.str]={update:function(){return _this.reallyUpdate(keypath)}}),this.proxies[keypath.str]}};var css,update,styleElement,head,styleSheet,inDom,observe_PatternObserver=PatternObserver,observe_getObserverFacade=getObserverFacade,emptyObject={},observe=Ractive$observe,observeOnce=Ractive$observeOnce,shared_trim=function(str){return str.trim()},notEmptyString=function(str){return""!==str},off=Ractive$off,on=Ractive$on,once=Ractive$once,shared_getNewIndices=getNewIndices,arrayProto=Array.prototype,makeArrayMethod=function(methodName){return function(keypath){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_len>_key;_key++)args[_key-1]=arguments[_key];var array,len,promise,result,newIndices=[];if(keypath=getKeypath(normalise(keypath)),array=this.viewmodel.get(keypath),len=array.length,!isArray(array))throw new Error("Called ractive."+methodName+"('"+keypath.str+"'), but '"+keypath.str+"' does not refer to an array");return newIndices=shared_getNewIndices(array,methodName,args),result=arrayProto[methodName].apply(array,args),promise=global_runloop.start(this,!0).then(function(){return result}),newIndices?this.viewmodel.smartUpdate(keypath,array,newIndices):this.viewmodel.mark(keypath),global_runloop.end(),promise}},pop=makeArrayMethod("pop"),push=makeArrayMethod("push"),global_css__prefix="/* Ractive.js component styles */\n",styles=[],dirty=!1;isClient?(styleElement=document.createElement("style"),styleElement.type="text/css",head=document.getElementsByTagName("head")[0],inDom=!1,styleSheet=styleElement.styleSheet,update=function(){var css=global_css__prefix+styles.map(function(s){return"\n/* {"+s.id+"} */\n"+s.styles}).join("\n");styleSheet?styleSheet.cssText=css:styleElement.innerHTML=css,inDom||(head.appendChild(styleElement),inDom=!0)},css={add:function(s){styles.push(s),dirty=!0},apply:function(){dirty&&(update(),dirty=!1)}}):css={add:noop,apply:noop};var Parser,ParseError,global_css=css,prototype_render=Ractive$render,renderHook=new hooks_Hook("render"),completeHook=new hooks_Hook("complete"),adaptConfigurator={extend:function(Parent,proto,options){proto.adapt=custom_adapt__combine(proto.adapt,ensureArray(options.adapt))},init:function(){}},custom_adapt=adaptConfigurator,transform=transformCss,selectorsPattern=/(?:^|\})?\s*([^\{\}]+)\s*\{/g,commentsPattern=/\/\*.*?\*\//g,selectorUnitPattern=/((?:(?:\[[^\]+]\])|(?:[^\s\+\>\~:]))+)((?::[^\s\+\>\~\(]+(?:\([^\)]+\))?)?\s*[\s\+\>\~]?)\s*/g,mediaQueryPattern=/^@media/,dataRvcGuidPattern=/\[data-ractive-css~="\{[a-z0-9-]+\}"]/g,css_css__uid=1,cssConfigurator={name:"css",extend:function(Parent,proto,options){if(options.css){var id=css_css__uid++,styles=options.noCssTransform?options.css:transform(options.css,id);proto.cssId=id,global_css.add({id:id,styles:styles})}},init:function(){}},css_css=cssConfigurator,dataConfigurator={name:"data",extend:function(Parent,proto,options){var key=void 0,value=void 0;if(options.data&&isObject(options.data))for(key in options.data)value=options.data[key],value&&"object"==typeof value&&(isObject(value)||isArray(value))&&warnIfDebug("Passing a `data` option with object and array properties to Ractive.extend() is discouraged, as mutating them is likely to cause bugs. Consider using a data function instead:\n\n // this...\n data: function () {\n return {\n myObject: {}\n };\n })\n\n // instead of this:\n data: {\n myObject: {}\n }");proto.data=custom_data__combine(proto.data,options.data)},init:function(Parent,ractive,options){var result=custom_data__combine(Parent.prototype.data,options.data);return"function"==typeof result&&(result=result.call(ractive)),result||{}},reset:function(ractive){var result=this.init(ractive.constructor,ractive,ractive.viewmodel);return ractive.viewmodel.reset(result),!0}},custom_data=dataConfigurator,parse_Parser__leadingWhitespace=/^\s+/;ParseError=function(message){this.name="ParseError",this.message=message;try{throw new Error(message)}catch(e){this.stack=e.stack}},ParseError.prototype=Error.prototype,Parser=function(str,options){var items,item,lineStart=0;for(this.str=str,this.options=options||{},this.pos=0,this.lines=this.str.split("\n"),this.lineEnds=this.lines.map(function(line){var lineEnd=lineStart+line.length+1;return lineStart=lineEnd,lineEnd},0),this.init&&this.init(str,options),items=[];this.posi;i+=1)if(this.pos=pos,item=converters[i](this))return item;return null},getLinePos:function(char){for(var columnNum,lineNum=0,lineStart=0;char>=this.lineEnds[lineNum];)lineStart=this.lineEnds[lineNum],lineNum+=1;return columnNum=char-lineStart,[lineNum+1,columnNum+1,char]},error:function(message){var pos=this.getLinePos(this.pos),lineNum=pos[0],columnNum=pos[1],line=this.lines[pos[0]-1],numTabs=0,annotation=line.replace(/\t/g,function(match,char){return chari;i+=1)matcher=makePrefixSequenceMatcher(prefixOperators[i],fallthrough),fallthrough=matcher;readTypeOf=fallthrough}();var readLogicalOr,makeInfixSequenceMatcher,readTypeof=readTypeOf;makeInfixSequenceMatcher=function(symbol,fallthrough){return function(parser){var start,left,right;if(left=fallthrough(parser),!left)return null;for(;;){if(start=parser.pos,parser.allowWhitespace(),!parser.matchString(symbol))return parser.pos=start,left;if("in"===symbol&&/[a-zA-Z_$0-9]/.test(parser.remaining().charAt(0)))return parser.pos=start,left;if(parser.allowWhitespace(),right=fallthrough(parser),!right)return parser.pos=start,left;left={t:INFIX_OPERATOR,s:symbol,o:[left,right]}}}},function(){ var i,len,matcher,infixOperators,fallthrough;for(infixOperators="* / % + - << >> >>> < <= > >= in instanceof == != === !== & ^ | && ||".split(" "),fallthrough=readTypeof,i=0,len=infixOperators.length;len>i;i+=1)matcher=makeInfixSequenceMatcher(infixOperators[i],fallthrough),fallthrough=matcher;readLogicalOr=fallthrough}();var booleanAttributes,voidElementNames,htmlEntities,controlCharacters,entityPattern,lessThan,greaterThan,amp,expressions_readLogicalOr=readLogicalOr,readConditional=getConditional,converters_readExpression=readExpression,utils_flattenExpression=flattenExpression,utils_refineExpression=refineExpression,arrayMemberPattern=/^[0-9][1-9]*$/,mustache_readTriple=readTriple,mustache_readUnescaped=readUnescaped,mustache_readPartial=readPartial,readMustacheComment=readComment,converters_readExpressionOrReference=readExpressionOrReference,mustache_readInterpolator=readInterpolator,mustache_readYielder=readYielder,yieldPattern=/^yield\s*/,section_readClosing=readClosing,section_readElse=section_readElse__readElse,section_readElse__elsePattern=/^\s*else\s*/,readElseIf=readElseIf__readElse,readElseIf__elsePattern=/^\s*elseif\s+/,handlebarsBlockCodes={each:SECTION_EACH,"if":SECTION_IF,"if-with":SECTION_IF_WITH,"with":SECTION_WITH,unless:SECTION_UNLESS},mustache_readSection=readSection,indexRefPattern=/^\s*:\s*([a-zA-Z_$][a-zA-Z_$0-9]*)/,keyIndexRefPattern=/^\s*,\s*([a-zA-Z_$][a-zA-Z_$0-9]*)/,handlebarsBlockPattern=new RegExp("^("+Object.keys(handlebarsBlockCodes).join("|")+")\\b"),converters_readHtmlComment=readHtmlComment,OPEN_COMMENT="";booleanAttributes=/^(allowFullscreen|async|autofocus|autoplay|checked|compact|controls|declare|default|defaultChecked|defaultMuted|defaultSelected|defer|disabled|enabled|formNoValidate|hidden|indeterminate|inert|isMap|itemScope|loop|multiple|muted|noHref|noResize|noShade|noValidate|noWrap|open|pauseOnExit|readOnly|required|reversed|scoped|seamless|selected|sortable|translate|trueSpeed|typeMustMatch|visible)$/i,voidElementNames=/^(?:area|base|br|col|command|doctype|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/i,htmlEntities={quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},controlCharacters=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376],entityPattern=new RegExp("&(#?(?:x[\\w\\d]+|\\d+|"+Object.keys(htmlEntities).join("|")+"));?","g"),lessThan=//g,amp=/&/g;var JsonParser,specials,specialsPattern,parseJSON__numberPattern,placeholderPattern,placeholderAtStartPattern,onlyWhitespace,leadingLinebreak=/^\s*\r?\n/,trailingLinebreak=/\r?\n\s*$/,stripStandalones=function(items){var i,current,backOne,backTwo,lastSectionItem;for(i=1;i/,getLowestIndex=function(haystack,needles){var i,index,lowest;for(i=needles.length;i--;){if(index=haystack.indexOf(needles[i]),!index)return 0;-1!==index&&(!lowest||lowest>index)&&(lowest=index)}return lowest||-1},element_readAttribute=readAttribute,attributeNamePattern=/^[^\s"'>\/=]+/,unquotedAttributeValueTextPattern=/^[^\s"'=<>`]+/;specials={"true":!0,"false":!1,undefined:void 0,"null":null},specialsPattern=new RegExp("^(?:"+Object.keys(specials).join("|")+")"),parseJSON__numberPattern=/^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/,placeholderPattern=/\$\{([^\}]+)\}/g,placeholderAtStartPattern=/^\$\{([^\}]+)\}/,onlyWhitespace=/^\s*$/,JsonParser=parse_Parser.extend({init:function(str,options){this.values=options.values,this.allowWhitespace()},postProcess:function(result){return 1===result.length&&onlyWhitespace.test(this.leftover)?{value:result[0].v}:null},converters:[function(parser){var placeholder;return parser.values?(placeholder=parser.matchPattern(placeholderAtStartPattern),placeholder&&parser.values.hasOwnProperty(placeholder)?{v:parser.values[placeholder]}:void 0):null},function(parser){var special;return(special=parser.matchPattern(specialsPattern))?{v:specials[special]}:void 0},function(parser){var number;return(number=parser.matchPattern(parseJSON__numberPattern))?{v:+number}:void 0},function(parser){var values,stringLiteral=readStringLiteral(parser);return stringLiteral&&(values=parser.values)?{v:stringLiteral.v.replace(placeholderPattern,function(match,$1){return $1 in values?values[$1]:$1})}:stringLiteral},function(parser){var result,pair;if(!parser.matchString("{"))return null;if(result={},parser.allowWhitespace(),parser.matchString("}"))return{v:result};for(;pair=getKeyValuePair(parser);){if(result[pair.key]=pair.value,parser.allowWhitespace(),parser.matchString("}"))return{v:result};if(!parser.matchString(","))return null}return null},function(parser){var result,valueToken;if(!parser.matchString("["))return null;if(result=[],parser.allowWhitespace(),parser.matchString("]"))return{v:result};for(;valueToken=parser.read();){if(result.push(valueToken.v),parser.allowWhitespace(),parser.matchString("]"))return{v:result};if(!parser.matchString(","))return null;parser.allowWhitespace()}return null}]});var ExpressionParser,parseJSON=function(str,values){var parser=new JsonParser(str,{values:values});return parser.result},element_processDirective=processDirective,methodCallPattern=/^([a-zA-Z_$][a-zA-Z_$0-9]*)\(/,methodCallExcessPattern=/\)\s*$/;ExpressionParser=parse_Parser.extend({converters:[converters_readExpression]});var disallowedContents,tagNamePattern=/^[a-zA-Z]{1,}:?[a-zA-Z0-9\-]*/,validTagNameFollower=/^[\s\n\/>]/,onPattern=/^on/,proxyEventPattern=/^on-([a-zA-Z\\*\\.$_][a-zA-Z\\*\\.$_0-9\-]+)$/,reservedEventNames=/^(?:change|reset|teardown|update|construct|config|init|render|unrender|detach|insert)$/,directives={"intro-outro":"t0",intro:"t1",outro:"t2",decorator:"o"},exclude={exclude:!0};disallowedContents={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]};var child,converters_readElement=readElement,converters_readText=readText,utils_escapeRegExp=escapeRegExp,utils_escapeRegExp__pattern=/[-/\\^$*+?.()|[\]{}]/g,converters_readPartialDefinitionComment=readPartialDefinitionComment,startPattern=/^/,converters_readPartialDefinitionSection=readPartialDefinitionSection,partialDefinitionSectionPattern=/^#\s*partial\s+/,converters_readTemplate=readTemplate,_parse=parse,STANDARD_READERS=[mustache_readPartial,mustache_readUnescaped,mustache_readSection,mustache_readYielder,mustache_readInterpolator,readMustacheComment],TRIPLE_READERS=[mustache_readTriple],STATIC_READERS=[mustache_readUnescaped,mustache_readSection,mustache_readInterpolator],StandardParser=void 0,READERS=[converters_readMustache,converters_readHtmlComment,converters_readElement,converters_readText],PARTIAL_READERS=[converters_readPartialDefinitionComment,converters_readPartialDefinitionSection];StandardParser=parse_Parser.extend({init:function(str,options){var tripleDelimiters=options.tripleDelimiters||["{{{","}}}"],staticDelimiters=options.staticDelimiters||["[[","]]"],staticTripleDelimiters=options.staticTripleDelimiters||["[[[","]]]"];this.standardDelimiters=options.delimiters||["{{","}}"],this.tags=[{isStatic:!1,isTriple:!1,open:this.standardDelimiters[0],close:this.standardDelimiters[1],readers:STANDARD_READERS},{isStatic:!1,isTriple:!0,open:tripleDelimiters[0],close:tripleDelimiters[1],readers:TRIPLE_READERS},{isStatic:!0,isTriple:!1,open:staticDelimiters[0],close:staticDelimiters[1],readers:STATIC_READERS},{isStatic:!0,isTriple:!0,open:staticTripleDelimiters[0],close:staticTripleDelimiters[1],readers:TRIPLE_READERS}],this.sortMustacheTags(),this.sectionDepth=0,this.elementStack=[],this.interpolate={script:!options.interpolate||options.interpolate.script!==!1,style:!options.interpolate||options.interpolate.style!==!1},options.sanitize===!0&&(options.sanitize={elements:"applet base basefont body frame frameset head html isindex link meta noframes noscript object param script style title".split(" "),eventAttributes:!0}),this.stripComments=options.stripComments!==!1,this.preserveWhitespace=options.preserveWhitespace,this.sanitizeElements=options.sanitize&&options.sanitize.elements,this.sanitizeEventAttributes=options.sanitize&&options.sanitize.eventAttributes,this.includeLinePositions=options.includeLinePositions},postProcess:function(result){return result.length?(this.sectionDepth>0&&this.error("A section was left open"),utils_cleanup(result[0].t,this.stripComments,this.preserveWhitespace,!this.preserveWhitespace,!this.preserveWhitespace),result[0]):{t:[],v:TEMPLATE_VERSION}},converters:[converters_readTemplate],sortMustacheTags:function(){this.tags.sort(function(a,b){return b.open.length-a.open.length})}});var config_registries__registryNames,Registry,registries,parseOptions=["preserveWhitespace","sanitize","stripComments","delimiters","tripleDelimiters","interpolate"],parser={fromId:fromId,isHashedId:isHashedId,isParsed:isParsed,getParseOptions:getParseOptions,createHelper:template_parser__createHelper,parse:doParse},template_parser=parser,templateConfigurator={name:"template",extend:function(Parent,proto,options){var template;"template"in options&&(template=options.template,"function"==typeof template?proto.template=template:proto.template=parseIfString(template,proto))},init:function(Parent,ractive,options){var template,fn;template="template"in options?options.template:Parent.prototype.template,"function"==typeof template&&(fn=template,template=getDynamicTemplate(ractive,fn),ractive._config.template={fn:fn,result:template}),template=parseIfString(template,ractive),ractive.template=template.t,template.p&&extendPartials(ractive.partials,template.p)},reset:function(ractive){var parsed,result=resetValue(ractive);return result?(parsed=parseIfString(result,ractive),ractive.template=parsed.t,extendPartials(ractive.partials,parsed.p,!0),!0):void 0}},template_template=templateConfigurator;config_registries__registryNames=["adaptors","components","computed","decorators","easing","events","interpolators","partials","transitions"],Registry=function(name,useDefaults){this.name=name,this.useDefaults=useDefaults},Registry.prototype={constructor:Registry,extend:function(Parent,proto,options){this.configure(this.useDefaults?Parent.defaults:Parent,this.useDefaults?proto:proto.constructor,options)},init:function(){},configure:function(Parent,target,options){var registry,name=this.name,option=options[name];registry=create(Parent[name]);for(var key in option)registry[key]=option[key];target[name]=registry},reset:function(ractive){var registry=ractive[this.name],changed=!1;return Object.keys(registry).forEach(function(key){var item=registry[key];item._fn&&(item._fn.isOwner?registry[key]=item._fn:delete registry[key],changed=!0)}),changed}},registries=config_registries__registryNames.map(function(name){return new Registry(name,"computed"===name)});var config,order,defaultKeys,custom,isBlacklisted,isStandardKey,config_registries=registries,wrapPrototype=wrap,config_deprecate=deprecate;custom={adapt:custom_adapt,css:css_css,data:custom_data,template:template_template},defaultKeys=Object.keys(config_defaults),isStandardKey=makeObj(defaultKeys.filter(function(key){return!custom[key]})),isBlacklisted=makeObj(defaultKeys.concat(config_registries.map(function(r){return r.name}))),order=[].concat(defaultKeys.filter(function(key){return!config_registries[key]&&!custom[key]}),config_registries,custom.data,custom.template,custom.css),config={extend:function(Parent,proto,options){return configure("extend",Parent,proto,options)},init:function(Parent,ractive,options){return configure("init",Parent,ractive,options)},reset:function(ractive){return order.filter(function(c){return c.reset&&c.reset(ractive)}).map(function(c){return c.name})},order:order};var config_config=config,prototype_bubble=Fragment$bubble,Fragment_prototype_detach=Fragment$detach,Fragment_prototype_find=Fragment$find,Fragment_prototype_findAll=Fragment$findAll,Fragment_prototype_findAllComponents=Fragment$findAllComponents,Fragment_prototype_findComponent=Fragment$findComponent,prototype_findNextNode=Fragment$findNextNode,prototype_firstNode=Fragment$firstNode,shared_processItems=processItems,getArgsList=Fragment$getArgsList,getNode=Fragment$getNode,prototype_getValue=Fragment$getValue,shared_detach=function(){return detachNode(this.node)},Text=function(options){this.type=TEXT,this.text=options.template};Text.prototype={detach:shared_detach,firstNode:function(){return this.node},render:function(){return this.node||(this.node=document.createTextNode(this.text)),this.node},toString:function(escape){return escape?escapeHtml(this.text):this.text},unrender:function(shouldDestroy){return shouldDestroy?this.detach():void 0}};var items_Text=Text,shared_unbind=shared_unbind__unbind,Mustache_getValue=Mustache$getValue,ReferenceResolver=function(owner,ref,callback){var keypath;this.ref=ref,this.resolved=!1,this.root=owner.root,this.parentFragment=owner.parentFragment,this.callback=callback,keypath=shared_resolveRef(owner.root,ref,owner.parentFragment),void 0!=keypath?this.resolve(keypath):global_runloop.addUnresolved(this)};ReferenceResolver.prototype={resolve:function(keypath){this.keypath&&!keypath&&global_runloop.addUnresolved(this),this.resolved=!0,this.keypath=keypath,this.callback(keypath)},forceResolution:function(){this.resolve(getKeypath(this.ref))},rebind:function(oldKeypath,newKeypath){var keypath;void 0!=this.keypath&&(keypath=this.keypath.replace(oldKeypath,newKeypath),void 0!==keypath&&this.resolve(keypath))},unbind:function(){this.resolved||global_runloop.removeUnresolved(this)}};var Resolvers_ReferenceResolver=ReferenceResolver,SpecialResolver=function(owner,ref,callback){this.parentFragment=owner.parentFragment,this.ref=ref,this.callback=callback,this.rebind()},props={"@keypath":{prefix:"c",prop:["context"]},"@index":{prefix:"i",prop:["index"]},"@key":{prefix:"k",prop:["key","index"]}};SpecialResolver.prototype={rebind:function(){var value,ref=this.ref,fragment=this.parentFragment,prop=props[ref];if(!prop)throw new Error('Unknown special reference "'+ref+'" - valid references are @index, @key and @keypath');if(this.cached)return this.callback(getKeypath("@"+prop.prefix+getProp(this.cached,prop)));if(-1!==prop.prop.indexOf("index")||-1!==prop.prop.indexOf("key"))for(;fragment;){if(fragment.owner.currentSubtype===SECTION_EACH&&void 0!==(value=getProp(fragment,prop)))return this.cached=fragment,fragment.registerIndexRef(this),this.callback(getKeypath("@"+prop.prefix+value));fragment=!fragment.parent&&fragment.owner&&fragment.owner.component&&fragment.owner.component.parentFragment&&!fragment.owner.component.instance.isolated?fragment.owner.component.parentFragment:fragment.parent}else for(;fragment;){if(void 0!==(value=getProp(fragment,prop)))return this.callback(getKeypath("@"+prop.prefix+value.str));fragment=fragment.parent}},unbind:function(){this.cached&&this.cached.unregisterIndexRef(this)}};var Resolvers_SpecialResolver=SpecialResolver,IndexResolver=function(owner,ref,callback){this.parentFragment=owner.parentFragment,this.ref=ref,this.callback=callback,ref.ref.fragment.registerIndexRef(this),this.rebind()};IndexResolver.prototype={rebind:function(){var index,ref=this.ref.ref;index="k"===ref.ref.t?"k"+ref.fragment.key:"i"+ref.fragment.index,void 0!==index&&this.callback(getKeypath("@"+index))},unbind:function(){this.ref.ref.fragment.unregisterIndexRef(this)}};var Resolvers_IndexResolver=IndexResolver,Resolvers_findIndexRefs=findIndexRefs;findIndexRefs.resolve=function(indices){var k,ref,refs={};for(k in indices.refs)ref=indices.refs[k],refs[ref.ref.n]="k"===ref.ref.t?ref.fragment.key:ref.fragment.index;return refs};var ExpressionResolver,Resolvers_createReferenceResolver=createReferenceResolver,shared_getFunctionFromString=getFunctionFromString,cache={},Resolvers_ExpressionResolver__bind=Function.prototype.bind;ExpressionResolver=function(owner,parentFragment,expression,callback){var ractive,_this=this;ractive=owner.root,this.root=ractive,this.parentFragment=parentFragment,this.callback=callback,this.owner=owner,this.str=expression.s,this.keypaths=[],this.pending=expression.r.length,this.refResolvers=expression.r.map(function(ref,i){return Resolvers_createReferenceResolver(_this,ref,function(keypath){_this.resolve(i,keypath)})}),this.ready=!0,this.bubble()},ExpressionResolver.prototype={bubble:function(){this.ready&&(this.uniqueString=getUniqueString(this.str,this.keypaths),this.keypath=createExpressionKeypath(this.uniqueString),this.createEvaluator(),this.callback(this.keypath))},unbind:function(){for(var resolver;resolver=this.refResolvers.pop();)resolver.unbind()},resolve:function(index,keypath){this.keypaths[index]=keypath,this.bubble()},createEvaluator:function(){var computation,valueGetters,signature,keypath,fn,_this=this;keypath=this.keypath,computation=this.root.viewmodel.computations[keypath.str],computation?this.root.viewmodel.mark(keypath):(fn=shared_getFunctionFromString(this.str,this.refResolvers.length),valueGetters=this.keypaths.map(function(keypath){var value;return"undefined"===keypath?function(){return void 0}:keypath.isSpecial?(value=keypath.value,function(){return value}):function(){var value=_this.root.viewmodel.get(keypath,{noUnwrap:!0,fullRootGet:!0});return"function"==typeof value&&(value=wrapFunction(value,_this.root)),value}}),signature={deps:this.keypaths.filter(isValidDependency),getter:function(){var args=valueGetters.map(call);return fn.apply(null,args)}},computation=this.root.viewmodel.compute(keypath,signature))},rebind:function(oldKeypath,newKeypath){this.refResolvers.forEach(function(r){return r.rebind(oldKeypath,newKeypath)})}};var Resolvers_ExpressionResolver=ExpressionResolver,MemberResolver=function(template,resolver,parentFragment){var _this=this;this.resolver=resolver,this.root=resolver.root,this.parentFragment=parentFragment,this.viewmodel=resolver.root.viewmodel,"string"==typeof template?this.value=template:template.t===REFERENCE?this.refResolver=Resolvers_createReferenceResolver(this,template.n,function(keypath){_this.resolve(keypath)}):new Resolvers_ExpressionResolver(resolver,parentFragment,template,function(keypath){_this.resolve(keypath)})};MemberResolver.prototype={resolve:function(keypath){this.keypath&&this.viewmodel.unregister(this.keypath,this),this.keypath=keypath,this.value=this.viewmodel.get(keypath),this.bind(),this.resolver.bubble()},bind:function(){this.viewmodel.register(this.keypath,this)},rebind:function(oldKeypath,newKeypath){this.refResolver&&this.refResolver.rebind(oldKeypath,newKeypath)},setValue:function(value){this.value=value,this.resolver.bubble()},unbind:function(){this.keypath&&this.viewmodel.unregister(this.keypath,this),this.refResolver&&this.refResolver.unbind()},forceResolution:function(){this.refResolver&&this.refResolver.forceResolution()}};var ReferenceExpressionResolver_MemberResolver=MemberResolver,ReferenceExpressionResolver=function(mustache,template,callback){var ractive,ref,keypath,parentFragment,_this=this;this.parentFragment=parentFragment=mustache.parentFragment,this.root=ractive=mustache.root,this.mustache=mustache,this.ref=ref=template.r,this.callback=callback,this.unresolved=[],(keypath=shared_resolveRef(ractive,ref,parentFragment))?this.base=keypath:this.baseResolver=new Resolvers_ReferenceResolver(this,ref,function(keypath){_this.base=keypath,_this.baseResolver=null,_this.bubble()}),this.members=template.m.map(function(template){return new ReferenceExpressionResolver_MemberResolver(template,_this,parentFragment)}),this.ready=!0,this.bubble()};ReferenceExpressionResolver.prototype={getKeypath:function(){var values=this.members.map(ReferenceExpressionResolver_ReferenceExpressionResolver__getValue);return!values.every(isDefined)||this.baseResolver?null:this.base.join(values.join("."))},bubble:function(){this.ready&&!this.baseResolver&&this.callback(this.getKeypath())},unbind:function(){this.members.forEach(methodCallers__unbind)},rebind:function(oldKeypath,newKeypath){var changed;if(this.base){var newBase=this.base.replace(oldKeypath,newKeypath);newBase&&newBase!==this.base&&(this.base=newBase,changed=!0)}this.members.forEach(function(members){members.rebind(oldKeypath,newKeypath)&&(changed=!0)}),changed&&this.bubble()},forceResolution:function(){this.baseResolver&&(this.base=getKeypath(this.ref),this.baseResolver.unbind(),this.baseResolver=null),this.members.forEach(forceResolution),this.bubble()}};var ReferenceExpressionResolver_ReferenceExpressionResolver=ReferenceExpressionResolver,Mustache_initialise=Mustache$init,Mustache_resolve=Mustache$resolve,Mustache_rebind=Mustache$rebind,Mustache={getValue:Mustache_getValue,init:Mustache_initialise,resolve:Mustache_resolve,rebind:Mustache_rebind},Interpolator=function(options){this.type=INTERPOLATOR,Mustache.init(this,options)};Interpolator.prototype={update:function(){this.node.data=void 0==this.value?"":this.value},resolve:Mustache.resolve,rebind:Mustache.rebind,detach:shared_detach,unbind:shared_unbind,render:function(){return this.node||(this.node=document.createTextNode(safeToStringValue(this.value))),this.node},unrender:function(shouldDestroy){shouldDestroy&&detachNode(this.node)},getValue:Mustache.getValue,setValue:function(value){var wrapper;this.keypath&&(wrapper=this.root.viewmodel.wrapped[this.keypath.str])&&(value=wrapper.get()),isEqual(value,this.value)||(this.value=value,this.parentFragment.bubble(),this.node&&global_runloop.addView(this))},firstNode:function(){return this.node},toString:function(escape){var string=""+safeToStringValue(this.value);return escape?escapeHtml(string):string}};var items_Interpolator=Interpolator,Section_prototype_bubble=Section$bubble,Section_prototype_detach=Section$detach,find=Section$find,findAll=Section$findAll,findAllComponents=Section$findAllComponents,findComponent=Section$findComponent,findNextNode=Section$findNextNode,firstNode=Section$firstNode,shuffle=Section$shuffle,prototype_rebind=function(oldKeypath,newKeypath){Mustache.rebind.call(this,oldKeypath,newKeypath)},Section_prototype_render=Section$render,setValue=Section$setValue,prototype_toString=Section$toString,prototype_unbind=Section$unbind,prototype_unrender=Section$unrender,prototype_update=Section$update,Section=function(options){this.type=SECTION,this.subtype=this.currentSubtype=options.template.n,this.inverted=this.subtype===SECTION_UNLESS,this.pElement=options.pElement,this.fragments=[],this.fragmentsToCreate=[],this.fragmentsToRender=[],this.fragmentsToUnrender=[],options.template.i&&(this.indexRefs=options.template.i.split(",").map(function(k,i){return{n:k,t:0===i?"k":"i"}})),this.renderedFragments=[],this.length=0,Mustache.init(this,options)};Section.prototype={bubble:Section_prototype_bubble,detach:Section_prototype_detach,find:find,findAll:findAll,findAllComponents:findAllComponents,findComponent:findComponent,findNextNode:findNextNode,firstNode:firstNode,getIndexRef:function(name){if(this.indexRefs)for(var i=this.indexRefs.length;i--;){var ref=this.indexRefs[i];if(ref.n===name)return ref}},getValue:Mustache.getValue,shuffle:shuffle,rebind:prototype_rebind,render:Section_prototype_render,resolve:Mustache.resolve,setValue:setValue,toString:prototype_toString,unbind:prototype_unbind,unrender:prototype_unrender,update:prototype_update};var ieBug,ieBlacklist,_Section=Section,Triple_prototype_detach=Triple$detach,Triple_prototype_find=Triple$find,Triple_prototype_findAll=Triple$findAll,Triple_prototype_firstNode=Triple$firstNode,elementCache={};try{createElement("table").innerHTML="foo"}catch(err){ieBug=!0,ieBlacklist={TABLE:['',"
"],THEAD:['',"
"],TBODY:['',"
"],TR:['',"
"],SELECT:['"]}}var insertHtml=function(html,node,docFrag){var container,wrapper,selectedOption,child,i,nodes=[];if(null!=html&&""!==html){for(ieBug&&(wrapper=ieBlacklist[node.tagName])?(container=element("DIV"),container.innerHTML=wrapper[0]+html+wrapper[1],container=container.querySelector(".x"),"SELECT"===container.tagName&&(selectedOption=container.options[container.selectedIndex])):node.namespaceURI===namespaces.svg?(container=element("DIV"),container.innerHTML=''+html+"",container=container.querySelector(".x")):(container=element(node.tagName),container.innerHTML=html,"SELECT"===container.tagName&&(selectedOption=container.options[container.selectedIndex]));child=container.firstChild;)nodes.push(child),docFrag.appendChild(child);if("SELECT"===node.tagName)for(i=nodes.length;i--;)nodes[i]!==selectedOption&&(nodes[i].selected=!1)}return nodes},helpers_updateSelect=updateSelect,Triple_prototype_render=Triple$render,prototype_setValue=Triple$setValue,Triple_prototype_toString=Triple$toString,Triple_prototype_unrender=Triple$unrender,Triple_prototype_update=Triple$update,Triple=function(options){this.type=TRIPLE,Mustache.init(this,options)};Triple.prototype={detach:Triple_prototype_detach,find:Triple_prototype_find,findAll:Triple_prototype_findAll,firstNode:Triple_prototype_firstNode,getValue:Mustache.getValue,rebind:Mustache.rebind,render:Triple_prototype_render,resolve:Mustache.resolve,setValue:prototype_setValue,toString:Triple_prototype_toString,unbind:shared_unbind,unrender:Triple_prototype_unrender,update:Triple_prototype_update};var svgCamelCaseElements,svgCamelCaseAttributes,createMap,map,_Triple=Triple,Element_prototype_bubble=function(){this.parentFragment.bubble()},Element_prototype_detach=Element$detach,Element_prototype_find=function(selector){return this.node?matches(this.node,selector)?this.node:this.fragment&&this.fragment.find?this.fragment.find(selector):void 0:null},Element_prototype_findAll=function(selector,query){query._test(this,!0)&&query.live&&(this.liveQueries||(this.liveQueries=[])).push(query),this.fragment&&this.fragment.findAll(selector,query)},Element_prototype_findAllComponents=function(selector,query){this.fragment&&this.fragment.findAllComponents(selector,query)},Element_prototype_findComponent=function(selector){return this.fragment?this.fragment.findComponent(selector):void 0},Element_prototype_findNextNode=Element$findNextNode,Element_prototype_firstNode=Element$firstNode,getAttribute=Element$getAttribute,truthy=/^true|on|yes|1$/i,processBindingAttributes__isNumeric=/^[0-9]+$/,processBindingAttributes=function(element,template){var val,attrs,attributes;return attributes=template.a||{},attrs={},val=attributes.twoway,void 0!==val&&(attrs.twoway=0===val||truthy.test(val)),val=attributes.lazy,void 0!==val&&(0!==val&&processBindingAttributes__isNumeric.test(val)?attrs.lazy=parseInt(val):attrs.lazy=0===val||truthy.test(val)),attrs},Attribute_prototype_bubble=Attribute$bubble;svgCamelCaseElements="altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath vkern".split(" "),svgCamelCaseAttributes="attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits contentScriptType contentStyleType diffuseConstant edgeMode externalResourcesRequired filterRes filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves pathLength patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan".split(" "), createMap=function(items){for(var map={},i=items.length;i--;)map[items[i].toLowerCase()]=items[i];return map},map=createMap(svgCamelCaseElements.concat(svgCamelCaseAttributes));var enforceCase=function(elementName){var lowerCaseElementName=elementName.toLowerCase();return map[lowerCaseElementName]||lowerCaseElementName},determineNameAndNamespace=function(attribute,name){var colonIndex,namespacePrefix;if(colonIndex=name.indexOf(":"),-1===colonIndex||(namespacePrefix=name.substr(0,colonIndex),"xmlns"===namespacePrefix))attribute.name=attribute.element.namespace!==namespaces.html?enforceCase(name):name;else if(name=name.substring(colonIndex+1),attribute.name=enforceCase(name),attribute.namespace=namespaces[namespacePrefix.toLowerCase()],attribute.namespacePrefix=namespacePrefix,!attribute.namespace)throw'Unknown namespace ("'+namespacePrefix+'")'},helpers_getInterpolator=getInterpolator,prototype_init=Attribute$init,Attribute_prototype_rebind=Attribute$rebind,Attribute_prototype_render=Attribute$render,propertyNames={"accept-charset":"acceptCharset",accesskey:"accessKey",bgcolor:"bgColor","class":"className",codebase:"codeBase",colspan:"colSpan",contenteditable:"contentEditable",datetime:"dateTime",dirname:"dirName","for":"htmlFor","http-equiv":"httpEquiv",ismap:"isMap",maxlength:"maxLength",novalidate:"noValidate",pubdate:"pubDate",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"},Attribute_prototype_toString=Attribute$toString,Attribute_prototype_unbind=Attribute$unbind,updateSelectValue=Attribute$updateSelect,updateMultipleSelectValue=Attribute$updateMultipleSelect,updateRadioName=Attribute$updateRadioName,updateRadioValue=Attribute$updateRadioValue,updateCheckboxName=Attribute$updateCheckboxName,updateClassName=Attribute$updateClassName,updateIdAttribute=Attribute$updateIdAttribute,updateIEStyleAttribute=Attribute$updateIEStyleAttribute,updateContentEditableValue=Attribute$updateContentEditableValue,updateValue=Attribute$updateValue,updateBoolean=Attribute$updateBooleanAttribute,updateEverythingElse=Attribute$updateEverythingElse,Attribute_prototype_update=Attribute$update,Attribute=function(options){this.init(options)};Attribute.prototype={bubble:Attribute_prototype_bubble,init:prototype_init,rebind:Attribute_prototype_rebind,render:Attribute_prototype_render,toString:Attribute_prototype_toString,unbind:Attribute_prototype_unbind,update:Attribute_prototype_update};var _ConditionalAttribute__div,_Attribute=Attribute,createAttributes=function(element,attributes){var name,attribute,result=[];for(name in attributes)"twoway"!==name&&"lazy"!==name&&attributes.hasOwnProperty(name)&&(attribute=new _Attribute({element:element,name:name,value:attributes[name],root:element.root}),result[name]=attribute,"value"!==name&&result.push(attribute));return(attribute=result.value)&&result.push(attribute),result};"undefined"!=typeof document&&(_ConditionalAttribute__div=createElement("div"));var ConditionalAttribute=function(element,template){this.element=element,this.root=element.root,this.parentFragment=element.parentFragment,this.attributes=[],this.fragment=new virtualdom_Fragment({root:element.root,owner:this,template:[template]})};ConditionalAttribute.prototype={bubble:function(){this.node&&this.update(),this.element.bubble()},rebind:function(oldKeypath,newKeypath){this.fragment.rebind(oldKeypath,newKeypath)},render:function(node){this.node=node,this.isSvg=node.namespaceURI===namespaces.svg,this.update()},unbind:function(){this.fragment.unbind()},update:function(){var str,attrs,_this=this;str=this.fragment.toString(),attrs=parseAttributes(str,this.isSvg),this.attributes.filter(function(a){return notIn(attrs,a)}).forEach(function(a){_this.node.removeAttribute(a.name)}),attrs.forEach(function(a){_this.node.setAttribute(a.name,a.value)}),this.attributes=attrs},toString:function(){return this.fragment.toString()}};var _ConditionalAttribute=ConditionalAttribute,createConditionalAttributes=function(element,attributes){return attributes?attributes.map(function(a){return new _ConditionalAttribute(element,a)}):[]},Binding=function(element){var interpolator,keypath,value,parentForm;if(this.element=element,this.root=element.root,this.attribute=element.attributes[this.name||"value"],interpolator=this.attribute.interpolator,interpolator.twowayBinding=this,keypath=interpolator.keypath){if("}"===keypath.str.slice(-1))return warnOnceIfDebug("Two-way binding does not work with expressions (`%s` on <%s>)",interpolator.resolver.uniqueString,element.name,{ractive:this.root}),!1;if(keypath.isSpecial)return warnOnceIfDebug("Two-way binding does not work with %s",interpolator.resolver.ref,{ractive:this.root}),!1}else{var ref=interpolator.template.r?"'"+interpolator.template.r+"' reference":"expression";warnIfDebug("The %s being used for two-way binding is ambiguous, and may cause unexpected results. Consider initialising your data to eliminate the ambiguity",ref,{ractive:this.root}),interpolator.resolver.forceResolution(),keypath=interpolator.keypath}this.attribute.isTwoway=!0,this.keypath=keypath,value=this.root.viewmodel.get(keypath),void 0===value&&this.getInitialValue&&(value=this.getInitialValue(),void 0!==value&&this.root.viewmodel.set(keypath,value)),(parentForm=findParentForm(element))&&(this.resetValue=value,parentForm.formBindings.push(this))};Binding.prototype={handleChange:function(){var _this=this;global_runloop.start(this.root),this.attribute.locked=!0,this.root.viewmodel.set(this.keypath,this.getValue()),global_runloop.scheduleTask(function(){return _this.attribute.locked=!1}),global_runloop.end()},rebound:function(){var bindings,oldKeypath,newKeypath;oldKeypath=this.keypath,newKeypath=this.attribute.interpolator.keypath,oldKeypath!==newKeypath&&(removeFromArray(this.root._twowayBindings[oldKeypath.str],this),this.keypath=newKeypath,bindings=this.root._twowayBindings[newKeypath.str]||(this.root._twowayBindings[newKeypath.str]=[]),bindings.push(this))},unbind:function(){}},Binding.extend=function(properties){var SpecialisedBinding,Parent=this;return SpecialisedBinding=function(element){Binding.call(this,element),this.init&&this.init()},SpecialisedBinding.prototype=create(Parent.prototype),utils_object__extend(SpecialisedBinding.prototype,properties),SpecialisedBinding.extend=Binding.extend,SpecialisedBinding};var GenericBinding,Binding_Binding=Binding,handleDomEvent=handleChange;GenericBinding=Binding_Binding.extend({getInitialValue:function(){return""},getValue:function(){return this.element.node.value},render:function(){var lazy,node=this.element.node,timeout=!1;this.rendered=!0,lazy=this.root.lazy,this.element.lazy===!0?lazy=!0:this.element.lazy===!1?lazy=!1:is__isNumeric(this.element.lazy)?(lazy=!1,timeout=+this.element.lazy):is__isNumeric(lazy||"")&&(timeout=+lazy,lazy=!1,this.element.lazy=timeout),this.handler=timeout?handleDelay:handleDomEvent,node.addEventListener("change",handleDomEvent,!1),lazy||(node.addEventListener("input",this.handler,!1),node.attachEvent&&node.addEventListener("keyup",this.handler,!1)),node.addEventListener("blur",handleBlur,!1)},unrender:function(){var node=this.element.node;this.rendered=!1,node.removeEventListener("change",handleDomEvent,!1),node.removeEventListener("input",this.handler,!1),node.removeEventListener("keyup",this.handler,!1),node.removeEventListener("blur",handleBlur,!1)}});var Binding_GenericBinding=GenericBinding,ContentEditableBinding=Binding_GenericBinding.extend({getInitialValue:function(){return this.element.fragment?this.element.fragment.toString():""},getValue:function(){return this.element.node.innerHTML}}),Binding_ContentEditableBinding=ContentEditableBinding,shared_getSiblings=getSiblings,sets={},RadioBinding=Binding_Binding.extend({name:"checked",init:function(){this.siblings=shared_getSiblings(this.root._guid,"radio",this.element.getAttribute("name")),this.siblings.push(this)},render:function(){var node=this.element.node;node.addEventListener("change",handleDomEvent,!1),node.attachEvent&&node.addEventListener("click",handleDomEvent,!1)},unrender:function(){var node=this.element.node;node.removeEventListener("change",handleDomEvent,!1),node.removeEventListener("click",handleDomEvent,!1)},handleChange:function(){global_runloop.start(this.root),this.siblings.forEach(function(binding){binding.root.viewmodel.set(binding.keypath,binding.getValue())}),global_runloop.end()},getValue:function(){return this.element.node.checked},unbind:function(){removeFromArray(this.siblings,this)}}),Binding_RadioBinding=RadioBinding,RadioNameBinding=Binding_Binding.extend({name:"name",init:function(){this.siblings=shared_getSiblings(this.root._guid,"radioname",this.keypath.str),this.siblings.push(this),this.radioName=!0},getInitialValue:function(){return this.element.getAttribute("checked")?this.element.getAttribute("value"):void 0},render:function(){var node=this.element.node;node.name="{{"+this.keypath.str+"}}",node.checked=this.root.viewmodel.get(this.keypath)==this.element.getAttribute("value"),node.addEventListener("change",handleDomEvent,!1),node.attachEvent&&node.addEventListener("click",handleDomEvent,!1)},unrender:function(){var node=this.element.node;node.removeEventListener("change",handleDomEvent,!1),node.removeEventListener("click",handleDomEvent,!1)},getValue:function(){var node=this.element.node;return node._ractive?node._ractive.value:node.value},handleChange:function(){this.element.node.checked&&Binding_Binding.prototype.handleChange.call(this)},rebound:function(oldKeypath,newKeypath){var node;Binding_Binding.prototype.rebound.call(this,oldKeypath,newKeypath),(node=this.element.node)&&(node.name="{{"+this.keypath.str+"}}")},unbind:function(){removeFromArray(this.siblings,this)}}),Binding_RadioNameBinding=RadioNameBinding,CheckboxNameBinding=Binding_Binding.extend({name:"name",getInitialValue:function(){return this.noInitialValue=!0,[]},init:function(){var existingValue,bindingValue;this.checkboxName=!0,this.siblings=shared_getSiblings(this.root._guid,"checkboxes",this.keypath.str),this.siblings.push(this),this.noInitialValue&&(this.siblings.noInitialValue=!0),this.siblings.noInitialValue&&this.element.getAttribute("checked")&&(existingValue=this.root.viewmodel.get(this.keypath),bindingValue=this.element.getAttribute("value"),existingValue.push(bindingValue))},unbind:function(){removeFromArray(this.siblings,this)},render:function(){var existingValue,bindingValue,node=this.element.node;existingValue=this.root.viewmodel.get(this.keypath),bindingValue=this.element.getAttribute("value"),isArray(existingValue)?this.isChecked=arrayContains(existingValue,bindingValue):this.isChecked=existingValue==bindingValue,node.name="{{"+this.keypath.str+"}}",node.checked=this.isChecked,node.addEventListener("change",handleDomEvent,!1),node.attachEvent&&node.addEventListener("click",handleDomEvent,!1)},unrender:function(){var node=this.element.node;node.removeEventListener("change",handleDomEvent,!1),node.removeEventListener("click",handleDomEvent,!1)},changed:function(){var wasChecked=!!this.isChecked;return this.isChecked=this.element.node.checked,this.isChecked===wasChecked},handleChange:function(){this.isChecked=this.element.node.checked,Binding_Binding.prototype.handleChange.call(this)},getValue:function(){return this.siblings.filter(isChecked).map(Binding_CheckboxNameBinding__getValue)}}),Binding_CheckboxNameBinding=CheckboxNameBinding,CheckboxBinding=Binding_Binding.extend({name:"checked",render:function(){var node=this.element.node;node.addEventListener("change",handleDomEvent,!1),node.attachEvent&&node.addEventListener("click",handleDomEvent,!1)},unrender:function(){var node=this.element.node;node.removeEventListener("change",handleDomEvent,!1),node.removeEventListener("click",handleDomEvent,!1)},getValue:function(){return this.element.node.checked}}),Binding_CheckboxBinding=CheckboxBinding,SelectBinding=Binding_Binding.extend({getInitialValue:function(){var len,i,value,optionWasSelected,options=this.element.options;if(void 0===this.element.getAttribute("value")&&(i=len=options.length,len)){for(;i--;)if(options[i].getAttribute("selected")){value=options[i].getAttribute("value"),optionWasSelected=!0;break}if(!optionWasSelected)for(;++ii;i+=1)if(option=options[i],options[i].selected)return optionValue=option._ractive?option._ractive.value:option.value},forceUpdate:function(){var _this=this,value=this.getValue();void 0!==value&&(this.attribute.locked=!0,global_runloop.scheduleTask(function(){return _this.attribute.locked=!1}),this.root.viewmodel.set(this.keypath,value))}}),Binding_SelectBinding=SelectBinding,MultipleSelectBinding=Binding_SelectBinding.extend({getInitialValue:function(){return this.element.options.filter(function(option){return option.getAttribute("selected")}).map(function(option){return option.getAttribute("value")})},render:function(){var valueFromModel;this.element.node.addEventListener("change",handleDomEvent,!1),valueFromModel=this.root.viewmodel.get(this.keypath),void 0===valueFromModel&&this.handleChange()},unrender:function(){this.element.node.removeEventListener("change",handleDomEvent,!1)},setValue:function(){throw new Error("TODO not implemented yet")},getValue:function(){var selectedValues,options,i,len,option,optionValue;for(selectedValues=[],options=this.element.node.options,len=options.length,i=0;len>i;i+=1)option=options[i],option.selected&&(optionValue=option._ractive?option._ractive.value:option.value,selectedValues.push(optionValue));return selectedValues},handleChange:function(){var attribute,previousValue,value;return attribute=this.attribute,previousValue=attribute.value,value=this.getValue(),void 0!==previousValue&&arrayContentsMatch(value,previousValue)||Binding_SelectBinding.prototype.handleChange.call(this),this},forceUpdate:function(){var _this=this,value=this.getValue();void 0!==value&&(this.attribute.locked=!0,global_runloop.scheduleTask(function(){return _this.attribute.locked=!1}),this.root.viewmodel.set(this.keypath,value))},updateModel:function(){void 0!==this.attribute.value&&this.attribute.value.length||this.root.viewmodel.set(this.keypath,this.initialValue)}}),Binding_MultipleSelectBinding=MultipleSelectBinding,FileListBinding=Binding_Binding.extend({render:function(){this.element.node.addEventListener("change",handleDomEvent,!1)},unrender:function(){this.element.node.removeEventListener("change",handleDomEvent,!1)},getValue:function(){return this.element.node.files}}),Binding_FileListBinding=FileListBinding,NumericBinding=Binding_GenericBinding.extend({getInitialValue:function(){return void 0},getValue:function(){var value=parseFloat(this.element.node.value);return isNaN(value)?void 0:value}}),init_createTwowayBinding=createTwowayBinding,EventHandler_prototype_bubble=EventHandler$bubble,EventHandler_prototype_fire=EventHandler$fire,getAction=EventHandler$getAction,EventHandler_prototype_init=EventHandler$init,eventPattern=/^event(?:\.(.+))?/,shared_genericHandler=genericHandler,listen=EventHandler$listen,customHandlers={},touchEvents={touchstart:!0,touchmove:!0,touchend:!0,touchcancel:!0,touchleave:!0},EventHandler_prototype_rebind=EventHandler$rebind,EventHandler_prototype_render=EventHandler$render,prototype_resolve=EventHandler$resolve,EventHandler_prototype_unbind=EventHandler$unbind,EventHandler_prototype_unrender=EventHandler$unrender,EventHandler=function(element,name,template){this.init(element,name,template)};EventHandler.prototype={bubble:EventHandler_prototype_bubble,fire:EventHandler_prototype_fire,getAction:getAction,init:EventHandler_prototype_init,listen:listen,rebind:EventHandler_prototype_rebind,render:EventHandler_prototype_render,resolve:prototype_resolve,unbind:EventHandler_prototype_unbind,unrender:EventHandler_prototype_unrender};var _EventHandler=EventHandler,createEventHandlers=function(element,template){var i,name,names,handler,result=[];for(name in template)if(template.hasOwnProperty(name))for(names=name.split("-"),i=names.length;i--;)handler=new _EventHandler(element,names[i],template[name]),result.push(handler);return result},Decorator=function(element,template){var ractive,name,fragment,self=this;this.element=element,this.root=ractive=element.root,name=template.n||template,("string"==typeof name||(fragment=new virtualdom_Fragment({template:name,root:ractive,owner:element}),name=fragment.toString(),fragment.unbind(),""!==name))&&(template.a?this.params=template.a:template.d&&(this.fragment=new virtualdom_Fragment({template:template.d,root:ractive,owner:element}),this.params=this.fragment.getArgsList(),this.fragment.bubble=function(){this.dirtyArgs=this.dirtyValue=!0,self.params=this.getArgsList(),self.ready&&self.update()}),this.fn=findInViewHierarchy("decorators",ractive,name),this.fn||fatal(missingPlugin(name,"decorator")))};Decorator.prototype={init:function(){var node,result,args;if(node=this.element.node,this.params?(args=[node].concat(this.params),result=this.fn.apply(this.root,args)):result=this.fn.call(this.root,node),!result||!result.teardown)throw new Error("Decorator definition must return an object with a teardown method");this.actual=result,this.ready=!0},update:function(){this.actual.update?this.actual.update.apply(this.root,this.params):(this.actual.teardown(!0),this.init())},rebind:function(oldKeypath,newKeypath){this.fragment&&this.fragment.rebind(oldKeypath,newKeypath)},teardown:function(updating){this.torndown=!0,this.ready&&this.actual.teardown(),!updating&&this.fragment&&this.fragment.unbind()}};var helpers_prefix__prefix,prefixCache,helpers_prefix__testStyle,_Decorator=Decorator,Element_prototype_init=Element$init,Element_prototype_rebind=Element$rebind,Transition_prototype_init=Transition$init,camelCase=function(hyphenatedStr){return hyphenatedStr.replace(/-([a-zA-Z])/g,function(match,$1){return $1.toUpperCase()})};isClient?(prefixCache={},helpers_prefix__testStyle=createElement("div").style,helpers_prefix__prefix=function(prop){var i,vendor,capped;if(prop=camelCase(prop),!prefixCache[prop])if(void 0!==helpers_prefix__testStyle[prop])prefixCache[prop]=prop;else for(capped=prop.charAt(0).toUpperCase()+prop.substring(1),i=vendors.length;i--;)if(vendor=vendors[i],void 0!==helpers_prefix__testStyle[vendor+capped]){prefixCache[prop]=vendor+capped;break}return prefixCache[prop]}):helpers_prefix__prefix=null;var getStyle,prototype_getStyle__getComputedStyle,helpers_prefix=helpers_prefix__prefix;isClient?(prototype_getStyle__getComputedStyle=window.getComputedStyle||legacy.getComputedStyle,getStyle=function(props){var computedStyle,styles,i,prop,value;if(computedStyle=prototype_getStyle__getComputedStyle(this.node),"string"==typeof props)return value=computedStyle[helpers_prefix(props)],"0px"===value&&(value=0),value;if(!isArray(props))throw new Error("Transition$getStyle must be passed a string, or an array of strings representing CSS properties");for(styles={},i=props.length;i--;)prop=props[i],value=computedStyle[helpers_prefix(prop)],"0px"===value&&(value=0),styles[prop]=value;return styles}):getStyle=null;var prototype_getStyle=getStyle,setStyle=function(style,value){var prop;if("string"==typeof style)this.node.style[helpers_prefix(style)]=value;else for(prop in style)style.hasOwnProperty(prop)&&(this.node.style[helpers_prefix(prop)]=style[prop]);return this},Ticker=function(options){var easing;this.duration=options.duration,this.step=options.step,this.complete=options.complete,"string"==typeof options.easing?(easing=options.root.easing[options.easing],easing||(warnOnceIfDebug(missingPlugin(options.easing,"easing")),easing=linear)):easing="function"==typeof options.easing?options.easing:linear,this.easing=easing,this.start=utils_getTime(),this.end=this.start+this.duration,this.running=!0,shared_animations.add(this)};Ticker.prototype={tick:function(now){var elapsed,eased;return this.running?now>this.end?(this.step&&this.step(1),this.complete&&this.complete(1),!1):(elapsed=now-this.start,eased=this.easing(elapsed/this.duration),this.step&&this.step(eased),!0):!1},stop:function(){this.abort&&this.abort(),this.running=!1}};var createTransitions,animateStyle_createTransitions__testStyle,TRANSITION,TRANSITIONEND,CSS_TRANSITIONS_ENABLED,TRANSITION_DURATION,TRANSITION_PROPERTY,TRANSITION_TIMING_FUNCTION,shared_Ticker=Ticker,unprefixPattern=new RegExp("^-(?:"+vendors.join("|")+")-"),unprefix=function(prop){return prop.replace(unprefixPattern,"")},vendorPattern=new RegExp("^(?:"+vendors.join("|")+")([A-Z])"),hyphenate=function(str){var hyphenated;return str?(vendorPattern.test(str)&&(str="-"+str),hyphenated=str.replace(/[A-Z]/g,function(match){return"-"+match.toLowerCase()})):""},canUseCssTransitions={},cannotUseCssTransitions={};isClient?(animateStyle_createTransitions__testStyle=createElement("div").style,function(){void 0!==animateStyle_createTransitions__testStyle.transition?(TRANSITION="transition",TRANSITIONEND="transitionend",CSS_TRANSITIONS_ENABLED=!0):void 0!==animateStyle_createTransitions__testStyle.webkitTransition?(TRANSITION="webkitTransition",TRANSITIONEND="webkitTransitionEnd",CSS_TRANSITIONS_ENABLED=!0):CSS_TRANSITIONS_ENABLED=!1}(),TRANSITION&&(TRANSITION_DURATION=TRANSITION+"Duration",TRANSITION_PROPERTY=TRANSITION+"Property",TRANSITION_TIMING_FUNCTION=TRANSITION+"TimingFunction"),createTransitions=function(t,to,options,changedProperties,resolve){setTimeout(function(){var hashPrefix,jsTransitionsComplete,cssTransitionsComplete,checkComplete,transitionEndHandler;checkComplete=function(){jsTransitionsComplete&&cssTransitionsComplete&&(t.root.fire(t.name+":end",t.node,t.isIntro),resolve())},hashPrefix=(t.node.namespaceURI||"")+t.node.tagName,t.node.style[TRANSITION_PROPERTY]=changedProperties.map(helpers_prefix).map(hyphenate).join(","),t.node.style[TRANSITION_TIMING_FUNCTION]=hyphenate(options.easing||"linear"),t.node.style[TRANSITION_DURATION]=options.duration/1e3+"s",transitionEndHandler=function(event){var index;index=changedProperties.indexOf(camelCase(unprefix(event.propertyName))),-1!==index&&changedProperties.splice(index,1),changedProperties.length||(t.node.removeEventListener(TRANSITIONEND,transitionEndHandler,!1),cssTransitionsComplete=!0,checkComplete())},t.node.addEventListener(TRANSITIONEND,transitionEndHandler,!1),setTimeout(function(){for(var hash,originalValue,index,prop,suffix,i=changedProperties.length,propertiesToTransitionInJs=[];i--;)prop=changedProperties[i],hash=hashPrefix+prop,CSS_TRANSITIONS_ENABLED&&!cannotUseCssTransitions[hash]&&(t.node.style[helpers_prefix(prop)]=to[prop],canUseCssTransitions[hash]||(originalValue=t.getStyle(prop),canUseCssTransitions[hash]=t.getStyle(prop)!=to[prop],cannotUseCssTransitions[hash]=!canUseCssTransitions[hash],cannotUseCssTransitions[hash]&&(t.node.style[helpers_prefix(prop)]=originalValue))),(!CSS_TRANSITIONS_ENABLED||cannotUseCssTransitions[hash])&&(void 0===originalValue&&(originalValue=t.getStyle(prop)),index=changedProperties.indexOf(prop),-1===index?warnIfDebug("Something very strange happened with transitions. Please raise an issue at https://github.com/ractivejs/ractive/issues - thanks!",{node:t.node}):changedProperties.splice(index,1),suffix=/[^\d]*$/.exec(to[prop])[0],propertiesToTransitionInJs.push({name:helpers_prefix(prop),interpolator:shared_interpolate(parseFloat(originalValue),parseFloat(to[prop])),suffix:suffix}));propertiesToTransitionInJs.length?new shared_Ticker({root:t.root,duration:options.duration,easing:camelCase(options.easing||""),step:function(pos){var prop,i;for(i=propertiesToTransitionInJs.length;i--;)prop=propertiesToTransitionInJs[i],t.node.style[prop.name]=prop.interpolator(pos)+prop.suffix},complete:function(){jsTransitionsComplete=!0,checkComplete()}}):jsTransitionsComplete=!0,changedProperties.length||(t.node.removeEventListener(TRANSITIONEND,transitionEndHandler,!1),cssTransitionsComplete=!0,checkComplete())},0)},options.delay||0)}):createTransitions=null;var hidden,vendor,animateStyle_visibility__prefix,animateStyle_visibility__i,visibility,animateStyle_createTransitions=createTransitions;if("undefined"!=typeof document){if(hidden="hidden",visibility={},hidden in document)animateStyle_visibility__prefix="";else for(animateStyle_visibility__i=vendors.length;animateStyle_visibility__i--;)vendor=vendors[animateStyle_visibility__i],hidden=vendor+"Hidden",hidden in document&&(animateStyle_visibility__prefix=vendor);void 0!==animateStyle_visibility__prefix?(document.addEventListener(animateStyle_visibility__prefix+"visibilitychange",onChange),onChange()):("onfocusout"in document?(document.addEventListener("focusout",onHide),document.addEventListener("focusin",onShow)):(window.addEventListener("pagehide",onHide),window.addEventListener("blur",onHide),window.addEventListener("pageshow",onShow),window.addEventListener("focus",onShow)),visibility.hidden=!1)}var animateStyle,_animateStyle__getComputedStyle,resolved,animateStyle_visibility=visibility;isClient?(_animateStyle__getComputedStyle=window.getComputedStyle||legacy.getComputedStyle,animateStyle=function(style,value,options){var to,_this=this;if(4===arguments.length)throw new Error("t.animateStyle() returns a promise - use .then() instead of passing a callback");if(animateStyle_visibility.hidden)return this.setStyle(style,value),resolved||(resolved=utils_Promise.resolve());"string"==typeof style?(to={},to[style]=value):(to=style,options=value),options||(warnOnceIfDebug('The "%s" transition does not supply an options object to `t.animateStyle()`. This will break in a future version of Ractive. For more info see https://github.com/RactiveJS/Ractive/issues/340',this.name),options=this);var promise=new utils_Promise(function(resolve){var propertyNames,changedProperties,computedStyle,current,from,i,prop;if(!options.duration)return _this.setStyle(to),void resolve();for(propertyNames=Object.keys(to),changedProperties=[],computedStyle=_animateStyle__getComputedStyle(_this.node),from={},i=propertyNames.length;i--;)prop=propertyNames[i],current=computedStyle[helpers_prefix(prop)],"0px"===current&&(current=0),current!=to[prop]&&(changedProperties.push(prop),_this.node.style[helpers_prefix(prop)]=current);return changedProperties.length?void animateStyle_createTransitions(_this,to,options,changedProperties,resolve):void resolve()});return promise}):animateStyle=null;var _animateStyle=animateStyle,processParams=function(params,defaults){return"number"==typeof params?params={duration:params}:"string"==typeof params?params="slow"===params?{duration:600}:"fast"===params?{duration:200}:{duration:400}:params||(params={}),fillGaps({},params,defaults)},prototype_start=Transition$start,Transition=function(owner,template,isIntro){this.init(owner,template,isIntro)};Transition.prototype={init:Transition_prototype_init,start:prototype_start,getStyle:prototype_getStyle,setStyle:setStyle,animateStyle:_animateStyle,processParams:processParams};var updateCss,updateScript,_Transition=Transition,Element_prototype_render=Element$render;updateCss=function(){var node=this.node,content=this.fragment.toString(!1);if(window&&window.appearsToBeIELessEqual8&&(node.type="text/css"),node.styleSheet)node.styleSheet.cssText=content;else{for(;node.hasChildNodes();)node.removeChild(node.firstChild);node.appendChild(document.createTextNode(content))}},updateScript=function(){this.node.type&&"text/javascript"!==this.node.type||warnIfDebug("Script tag was updated. This does not cause the code to be re-evaluated!",{ractive:this.root}),this.node.text=this.fragment.toString(!1)};var Element_prototype_toString=function(){var str,escape;return this.template.y?"":(str="<"+this.template.e,str+=this.attributes.map(stringifyAttribute).join("")+this.conditionalAttributes.map(stringifyAttribute).join(""),"option"===this.name&&optionIsSelected(this)&&(str+=" selected"),"input"===this.name&&inputIsCheckedRadio(this)&&(str+=" checked"),str+=">","textarea"===this.name&&void 0!==this.getAttribute("value")?str+=escapeHtml(this.getAttribute("value")):void 0!==this.getAttribute("contenteditable")&&(str+=this.getAttribute("value")||""),this.fragment&&(escape="script"!==this.name&&"style"!==this.name,str+=this.fragment.toString(escape)),voidElementNames.test(this.template.e)||(str+=""),str)},Element_prototype_unbind=Element$unbind,Element_prototype_unrender=Element$unrender,Element=function(options){this.init(options)};Element.prototype={bubble:Element_prototype_bubble,detach:Element_prototype_detach,find:Element_prototype_find,findAll:Element_prototype_findAll,findAllComponents:Element_prototype_findAllComponents,findComponent:Element_prototype_findComponent,findNextNode:Element_prototype_findNextNode,firstNode:Element_prototype_firstNode,getAttribute:getAttribute,init:Element_prototype_init,rebind:Element_prototype_rebind,render:Element_prototype_render,toString:Element_prototype_toString,unbind:Element_prototype_unbind,unrender:Element_prototype_unrender};var _Element=Element,deIndent__empty=/^\s*$/,deIndent__leadingWhitespace=/^\s*/,deIndent=function(str){var lines,firstLine,lastLine,minIndent;return lines=str.split("\n"),firstLine=lines[0],void 0!==firstLine&&deIndent__empty.test(firstLine)&&lines.shift(),lastLine=lastItem(lines),void 0!==lastLine&&deIndent__empty.test(lastLine)&&lines.pop(),minIndent=lines.reduce(reducer,null),minIndent&&(str=lines.map(function(line){return line.replace(minIndent,"")}).join("\n")),str},Partial_getPartialTemplate=getPartialTemplate,applyIndent=function(string,indent){var indented;return indent?indented=string.split("\n").map(function(line,notFirstLine){return notFirstLine?indent+line:line}).join("\n"):string},missingPartialMessage='Could not find template for partial "%s"',Partial=function(options){var parentFragment,template;parentFragment=this.parentFragment=options.parentFragment,this.root=parentFragment.root,this.type=PARTIAL,this.index=options.index,this.name=options.template.r,this.rendered=!1,this.fragment=this.fragmentToRender=this.fragmentToUnrender=null,Mustache.init(this,options),this.keypath||((template=Partial_getPartialTemplate(this.root,this.name,parentFragment))?(shared_unbind.call(this),this.isNamed=!0,this.setTemplate(template)):warnOnceIfDebug(missingPartialMessage,this.name))};Partial.prototype={bubble:function(){this.parentFragment.bubble()},detach:function(){return this.fragment.detach()},find:function(selector){return this.fragment.find(selector)},findAll:function(selector,query){return this.fragment.findAll(selector,query)},findComponent:function(selector){return this.fragment.findComponent(selector)},findAllComponents:function(selector,query){return this.fragment.findAllComponents(selector,query)},firstNode:function(){return this.fragment.firstNode()},findNextNode:function(){return this.parentFragment.findNextNode(this)},getPartialName:function(){return this.isNamed&&this.name?this.name:void 0===this.value?this.name:this.value},getValue:function(){return this.fragment.getValue()},rebind:function(oldKeypath,newKeypath){this.isNamed||Mustache_rebind.call(this,oldKeypath,newKeypath),this.fragment&&this.fragment.rebind(oldKeypath,newKeypath)},render:function(){return this.docFrag=document.createDocumentFragment(),this.update(),this.rendered=!0,this.docFrag},resolve:Mustache.resolve,setValue:function(value){var template;(void 0===value||value!==this.value)&&(void 0!==value&&(template=Partial_getPartialTemplate(this.root,""+value,this.parentFragment)),!template&&this.name&&(template=Partial_getPartialTemplate(this.root,this.name,this.parentFragment))&&(shared_unbind.call(this), this.isNamed=!0),template||warnOnceIfDebug(missingPartialMessage,this.name,{ractive:this.root}),this.value=value,this.setTemplate(template||[]),this.bubble(),this.rendered&&global_runloop.addView(this))},setTemplate:function(template){this.fragment&&(this.fragment.unbind(),this.rendered&&(this.fragmentToUnrender=this.fragment)),this.fragment=new virtualdom_Fragment({template:template,root:this.root,owner:this,pElement:this.parentFragment.pElement}),this.fragmentToRender=this.fragment},toString:function(toString){var string,previousItem,lastLine,match;return string=this.fragment.toString(toString),previousItem=this.parentFragment.items[this.index-1],previousItem&&previousItem.type===TEXT?(lastLine=previousItem.text.split("\n").pop(),(match=/^\s+$/.exec(lastLine))?applyIndent(string,match[0]):string):string},unbind:function(){this.isNamed||shared_unbind.call(this),this.fragment&&this.fragment.unbind()},unrender:function(shouldDestroy){this.rendered&&(this.fragment&&this.fragment.unrender(shouldDestroy),this.rendered=!1)},update:function(){var target,anchor;this.fragmentToUnrender&&(this.fragmentToUnrender.unrender(!0),this.fragmentToUnrender=null),this.fragmentToRender&&(this.docFrag.appendChild(this.fragmentToRender.render()),this.fragmentToRender=null),this.rendered&&(target=this.parentFragment.getNode(),anchor=this.parentFragment.findNextNode(this),target.insertBefore(this.docFrag,anchor))}};var testObj,patchArrayMethods,unpatchArrayMethods,_Partial=Partial,Component_getComponent=getComponent,Component_prototype_detach=Component$detach,Component_prototype_detach__detachHook=new hooks_Hook("detach"),Component_prototype_find=Component$find,Component_prototype_findAll=Component$findAll,Component_prototype_findAllComponents=Component$findAllComponents,Component_prototype_findComponent=Component$findComponent,Component_prototype_findNextNode=Component$findNextNode,Component_prototype_firstNode=Component$firstNode,processWrapper=function(wrapper,array,methodName,newIndices){var root=wrapper.root,keypath=wrapper.keypath;newIndices?root.viewmodel.smartUpdate(keypath,array,newIndices):root.viewmodel.mark(keypath)},patchedArrayProto=[],mutatorMethods=["pop","push","reverse","shift","sort","splice","unshift"];mutatorMethods.forEach(function(methodName){var method=function(){for(var _len=arguments.length,args=Array(_len),_key=0;_len>_key;_key++)args[_key]=arguments[_key];var newIndices,result,wrapper,i;for(newIndices=shared_getNewIndices(this,methodName,args),result=Array.prototype[methodName].apply(this,arguments),global_runloop.start(),this._ractive.setting=!0,i=this._ractive.wrappers.length;i--;)wrapper=this._ractive.wrappers[i],global_runloop.addRactive(wrapper.root),processWrapper(wrapper,this,methodName,newIndices);return global_runloop.end(),this._ractive.setting=!1,result};defineProperty(patchedArrayProto,methodName,{value:method})}),testObj={},testObj.__proto__?(patchArrayMethods=function(array){array.__proto__=patchedArrayProto},unpatchArrayMethods=function(array){array.__proto__=Array.prototype}):(patchArrayMethods=function(array){var i,methodName;for(i=mutatorMethods.length;i--;)methodName=mutatorMethods[i],defineProperty(array,methodName,{value:patchedArrayProto[methodName],configurable:!0})},unpatchArrayMethods=function(array){var i;for(i=mutatorMethods.length;i--;)delete array[mutatorMethods[i]]}),patchArrayMethods.unpatch=unpatchArrayMethods;var arrayAdaptor,ArrayWrapper,array_index__errorMessage,patch=patchArrayMethods;arrayAdaptor={filter:function(object){return isArray(object)&&(!object._ractive||!object._ractive.setting)},wrap:function(ractive,array,keypath){return new ArrayWrapper(ractive,array,keypath)}},ArrayWrapper=function(ractive,array,keypath){this.root=ractive,this.value=array,this.keypath=getKeypath(keypath),array._ractive||(defineProperty(array,"_ractive",{value:{wrappers:[],instances:[],setting:!1},configurable:!0}),patch(array)),array._ractive.instances[ractive._guid]||(array._ractive.instances[ractive._guid]=0,array._ractive.instances.push(ractive)),array._ractive.instances[ractive._guid]+=1,array._ractive.wrappers.push(this)},ArrayWrapper.prototype={get:function(){return this.value},teardown:function(){var array,storage,wrappers,instances,index;if(array=this.value,storage=array._ractive,wrappers=storage.wrappers,instances=storage.instances,storage.setting)return!1;if(index=wrappers.indexOf(this),-1===index)throw new Error(array_index__errorMessage);if(wrappers.splice(index,1),wrappers.length){if(instances[this.root._guid]-=1,!instances[this.root._guid]){if(index=instances.indexOf(this.root),-1===index)throw new Error(array_index__errorMessage);instances.splice(index,1)}}else delete array._ractive,patch.unpatch(this.value)}},array_index__errorMessage="Something went wrong in a rather interesting way";var magicAdaptor,MagicWrapper,array_index=arrayAdaptor,numeric=/^\s*[0-9]+\s*$/,createBranch=function(key){return numeric.test(key)?[]:{}};try{Object.defineProperty({},"test",{value:0}),magicAdaptor={filter:function(object,keypath,ractive){var parentWrapper,parentValue;return keypath?(keypath=getKeypath(keypath),(parentWrapper=ractive.viewmodel.wrapped[keypath.parent.str])&&!parentWrapper.magic?!1:(parentValue=ractive.viewmodel.get(keypath.parent),isArray(parentValue)&&/^[0-9]+$/.test(keypath.lastKey)?!1:parentValue&&("object"==typeof parentValue||"function"==typeof parentValue))):!1},wrap:function(ractive,property,keypath){return new MagicWrapper(ractive,property,keypath)}},MagicWrapper=function(ractive,value,keypath){var objKeypath,template,siblings;return keypath=getKeypath(keypath),this.magic=!0,this.ractive=ractive,this.keypath=keypath,this.value=value,this.prop=keypath.lastKey,objKeypath=keypath.parent,this.obj=objKeypath.isRoot?ractive.viewmodel.data:ractive.viewmodel.get(objKeypath),template=this.originalDescriptor=Object.getOwnPropertyDescriptor(this.obj,this.prop),template&&template.set&&(siblings=template.set._ractiveWrappers)?void(-1===siblings.indexOf(this)&&siblings.push(this)):void createAccessors(this,value,template)},MagicWrapper.prototype={get:function(){return this.value},reset:function(value){return this.updating?void 0:(this.updating=!0,this.obj[this.prop]=value,global_runloop.addRactive(this.ractive),this.ractive.viewmodel.mark(this.keypath,{keepExistingWrapper:!0}),this.updating=!1,!0)},set:function(key,value){this.updating||(this.obj[this.prop]||(this.updating=!0,this.obj[this.prop]=createBranch(key),this.updating=!1),this.obj[this.prop][key]=value)},teardown:function(){var template,set,value,wrappers,index;return this.updating?!1:(template=Object.getOwnPropertyDescriptor(this.obj,this.prop),set=template&&template.set,void(set&&(wrappers=set._ractiveWrappers,index=wrappers.indexOf(this),-1!==index&&wrappers.splice(index,1),wrappers.length||(value=this.obj[this.prop],Object.defineProperty(this.obj,this.prop,this.originalDescriptor||{writable:!0,enumerable:!0,configurable:!0}),this.obj[this.prop]=value))))}}}catch(err){magicAdaptor=!1}var magicArrayAdaptor,MagicArrayWrapper,adaptors_magic=magicAdaptor;adaptors_magic&&(magicArrayAdaptor={filter:function(object,keypath,ractive){return adaptors_magic.filter(object,keypath,ractive)&&array_index.filter(object)},wrap:function(ractive,array,keypath){return new MagicArrayWrapper(ractive,array,keypath)}},MagicArrayWrapper=function(ractive,array,keypath){this.value=array,this.magic=!0,this.magicWrapper=adaptors_magic.wrap(ractive,array,keypath),this.arrayWrapper=array_index.wrap(ractive,array,keypath)},MagicArrayWrapper.prototype={get:function(){return this.value},teardown:function(){this.arrayWrapper.teardown(),this.magicWrapper.teardown()},reset:function(value){return this.magicWrapper.reset(value)}});var magicArray=magicArrayAdaptor,prototype_adapt=Viewmodel$adapt,prefixers={},helpers_getUpstreamChanges=getUpstreamChanges,applyChanges_notifyPatternObservers=notifyPatternObservers,applyChanges=Viewmodel$applyChanges,capture=Viewmodel$capture,clearCache=Viewmodel$clearCache,UnresolvedDependency=function(computation,ref){this.computation=computation,this.viewmodel=computation.viewmodel,this.ref=ref,this.root=this.viewmodel.ractive,this.parentFragment=this.root.component&&this.root.component.parentFragment};UnresolvedDependency.prototype={resolve:function(keypath){this.computation.softDeps.push(keypath),this.computation.unresolvedDeps[keypath.str]=null,this.viewmodel.register(keypath,this.computation,"computed")}};var Computation_UnresolvedDependency=UnresolvedDependency,Computation=function(key,signature){this.key=key,this.getter=signature.getter,this.setter=signature.setter,this.hardDeps=signature.deps||[],this.softDeps=[],this.unresolvedDeps={},this.depValues={},this._dirty=this._firstRun=!0};Computation.prototype={constructor:Computation,init:function(viewmodel){var initial,_this=this;this.viewmodel=viewmodel,this.bypass=!0,initial=viewmodel.get(this.key),viewmodel.clearCache(this.key.str),this.bypass=!1,this.setter&&void 0!==initial&&this.set(initial),this.hardDeps&&this.hardDeps.forEach(function(d){return viewmodel.register(d,_this,"computed")})},invalidate:function(){this._dirty=!0},get:function(){var newDeps,dependenciesChanged,_this=this,dependencyValuesChanged=!1;if(this.getting){var msg="The "+this.key.str+" computation indirectly called itself. This probably indicates a bug in the computation. It is commonly caused by `array.sort(...)` - if that's the case, clone the array first with `array.slice().sort(...)`";return warnOnce(msg),this.value}if(this.getting=!0,this._dirty){if(this._firstRun||!this.hardDeps.length&&!this.softDeps.length?dependencyValuesChanged=!0:[this.hardDeps,this.softDeps].forEach(function(deps){var keypath,value,i;if(!dependencyValuesChanged)for(i=deps.length;i--;)if(keypath=deps[i],value=_this.viewmodel.get(keypath),!isEqual(value,_this.depValues[keypath.str]))return _this.depValues[keypath.str]=value,void(dependencyValuesChanged=!0)}),dependencyValuesChanged){this.viewmodel.capture();try{this.value=this.getter()}catch(err){warnIfDebug('Failed to compute "%s"',this.key.str),logIfDebug(err.stack||err),this.value=void 0}newDeps=this.viewmodel.release(),dependenciesChanged=this.updateDependencies(newDeps),dependenciesChanged&&[this.hardDeps,this.softDeps].forEach(function(deps){deps.forEach(function(keypath){_this.depValues[keypath.str]=_this.viewmodel.get(keypath)})})}this._dirty=!1}return this.getting=this._firstRun=!1,this.value},set:function(value){if(this.setting)return void(this.value=value);if(!this.setter)throw new Error("Computed properties without setters are read-only. (This may change in a future version of Ractive!)");this.setter(value)},updateDependencies:function(newDeps){var i,oldDeps,keypath,dependenciesChanged,unresolved;for(oldDeps=this.softDeps,i=oldDeps.length;i--;)keypath=oldDeps[i],-1===newDeps.indexOf(keypath)&&(dependenciesChanged=!0,this.viewmodel.unregister(keypath,this,"computed"));for(i=newDeps.length;i--;)keypath=newDeps[i],-1!==oldDeps.indexOf(keypath)||this.hardDeps&&-1!==this.hardDeps.indexOf(keypath)||(dependenciesChanged=!0,isUnresolved(this.viewmodel,keypath)&&!this.unresolvedDeps[keypath.str]?(unresolved=new Computation_UnresolvedDependency(this,keypath.str),newDeps.splice(i,1),this.unresolvedDeps[keypath.str]=unresolved,global_runloop.addUnresolved(unresolved)):this.viewmodel.register(keypath,this,"computed"));return dependenciesChanged&&(this.softDeps=newDeps.slice()),dependenciesChanged}};var Computation_Computation=Computation,compute=Viewmodel$compute,FAILED_LOOKUP={FAILED_LOOKUP:!0},viewmodel_prototype_get=Viewmodel$get,viewmodel_prototype_get__empty={},viewmodel_prototype_init=Viewmodel$init,prototype_map=Viewmodel$map,Mapping=function(localKey,options){this.localKey=localKey,this.keypath=options.keypath,this.origin=options.origin,this.deps=[],this.unresolved=[],this.resolved=!1};Mapping.prototype={forceResolution:function(){this.keypath=this.localKey,this.setup()},get:function(keypath,options){return this.resolved?this.origin.get(this.map(keypath),options):void 0},getValue:function(){return this.keypath?this.origin.get(this.keypath):void 0},initViewmodel:function(viewmodel){this.local=viewmodel,this.setup()},map:function(keypath){return void 0===typeof this.keypath?this.localKey:keypath.replace(this.localKey,this.keypath)},register:function(keypath,dependant,group){this.deps.push({keypath:keypath,dep:dependant,group:group}),this.resolved&&this.origin.register(this.map(keypath),dependant,group)},resolve:function(keypath){void 0!==this.keypath&&this.unbind(!0),this.keypath=keypath,this.setup()},set:function(keypath,value){this.resolved||this.forceResolution(),this.origin.set(this.map(keypath),value)},setup:function(){var _this=this;void 0!==this.keypath&&(this.resolved=!0,this.deps.length&&(this.deps.forEach(function(d){var keypath=_this.map(d.keypath);if(_this.origin.register(keypath,d.dep,d.group),d.dep.setValue)d.dep.setValue(_this.origin.get(keypath));else{if(!d.dep.invalidate)throw new Error("An unexpected error occurred. Please raise an issue at https://github.com/ractivejs/ractive/issues - thanks!");d.dep.invalidate()}}),this.origin.mark(this.keypath)))},setValue:function(value){if(!this.keypath)throw new Error("Mapping does not have keypath, cannot set value. Please raise an issue at https://github.com/ractivejs/ractive/issues - thanks!");this.origin.set(this.keypath,value)},unbind:function(keepLocal){var _this=this;keepLocal||delete this.local.mappings[this.localKey],this.resolved&&(this.deps.forEach(function(d){_this.origin.unregister(_this.map(d.keypath),d.dep,d.group)}),this.tracker&&this.origin.unregister(this.keypath,this.tracker))},unregister:function(keypath,dependant,group){var deps,i;if(this.resolved){for(deps=this.deps,i=deps.length;i--;)if(deps[i].dep===dependant){deps.splice(i,1);break}this.origin.unregister(this.map(keypath),dependant,group)}}};var mark=Viewmodel$mark,mapOldToNewIndex=function(oldArray,newArray){var usedIndices,firstUnusedIndex,newIndices,changed;return usedIndices={},firstUnusedIndex=0,newIndices=oldArray.map(function(item,i){var index,start,len;start=firstUnusedIndex,len=newArray.length;do{if(index=newArray.indexOf(item,start),-1===index)return changed=!0,-1;start=index+1}while(usedIndices[index]&&len>start);return index===firstUnusedIndex&&(firstUnusedIndex+=1),index!==i&&(changed=!0),usedIndices[index]=!0,index})},merge=Viewmodel$merge,comparators={},register=Viewmodel$register,release=Viewmodel$release,reset=Viewmodel$reset,prototype_set=Viewmodel$set,smartUpdate=Viewmodel$smartUpdate,implicitOption={implicit:!0},noCascadeOption={noCascade:!0},prototype_teardown=Viewmodel$teardown,unregister=Viewmodel$unregister,Viewmodel=function(options){var key,mapping,adapt=options.adapt,data=options.data,ractive=options.ractive,computed=options.computed,mappings=options.mappings;this.ractive=ractive,this.adaptors=adapt,this.onchange=options.onchange,this.cache={},this.cacheMap=create(null),this.deps={computed:create(null),"default":create(null)},this.depsMap={computed:create(null),"default":create(null)},this.patternObservers=[],this.specials=create(null),this.wrapped=create(null),this.computations=create(null),this.captureGroups=[],this.unresolvedImplicitDependencies=[],this.changes=[],this.implicitChanges={},this.noCascade={},this.data=data,this.mappings=create(null);for(key in mappings)this.map(getKeypath(key),mappings[key]);if(data)for(key in data)(mapping=this.mappings[key])&&void 0===mapping.getValue()&&mapping.setValue(data[key]);for(key in computed)mappings&&key in mappings&&fatal("Cannot map to a computed property ('%s')",key),this.compute(getKeypath(key),computed[key]);this.ready=!0};Viewmodel.prototype={adapt:prototype_adapt,applyChanges:applyChanges,capture:capture,clearCache:clearCache,compute:compute,get:viewmodel_prototype_get,init:viewmodel_prototype_init,map:prototype_map,mark:mark,merge:merge,register:register,release:release,reset:reset,set:prototype_set,smartUpdate:smartUpdate,teardown:prototype_teardown,unregister:unregister};var viewmodel_Viewmodel=Viewmodel;HookQueue.prototype={constructor:HookQueue,begin:function(ractive){this.inProcess[ractive._guid]=!0},end:function(ractive){var parent=ractive.parent;parent&&this.inProcess[parent._guid]?getChildQueue(this.queue,parent).push(ractive):fire(this,ractive),delete this.inProcess[ractive._guid]}};var hooks_HookQueue=HookQueue,helpers_getComputationSignatures=getComputationSignatures,helpers_getComputationSignatures__pattern=/\$\{([^\}]+)\}/g,constructHook=new hooks_Hook("construct"),configHook=new hooks_Hook("config"),initHook=new hooks_HookQueue("init"),initialise__uid=0,initialise__registryNames=["adaptors","components","decorators","easing","events","interpolators","partials","transitions"],initialise=initialiseRactiveInstance,initialise_ComplexParameter=ComplexParameter;ComplexParameter.prototype={bubble:function(){this.dirty||(this.dirty=!0,global_runloop.addView(this))},update:function(){this.callback(this.fragment.getValue()),this.dirty=!1},rebind:function(oldKeypath,newKeypath){this.fragment.rebind(oldKeypath,newKeypath)},unbind:function(){this.fragment.unbind()}};var createInstance=function(component,Component,attributes,yieldTemplate,partials){var instance,parentFragment,ractive,fragment,container,ready,inlinePartials={},data={},mappings={},resolvers=[];for(parentFragment=component.parentFragment,ractive=component.root,partials=partials||{},utils_object__extend(inlinePartials,partials),partials.content=yieldTemplate||[],inlinePartials[""]=partials.content,Component.defaults.el&&warnIfDebug("The <%s/> component has a default `el` property; it has been disregarded",component.name),fragment=parentFragment;fragment;){if(fragment.owner.type===YIELDER){container=fragment.owner.container;break}fragment=fragment.parent}return attributes&&Object.keys(attributes).forEach(function(key){var parsed,resolver,attribute=attributes[key];if("string"==typeof attribute)parsed=parseJSON(attribute),data[key]=parsed?parsed.value:attribute;else if(0===attribute)data[key]=!0;else{if(!isArray(attribute))throw new Error("erm wut");isSingleInterpolator(attribute)?(mappings[key]={origin:component.root.viewmodel,keypath:void 0},resolver=createResolver(component,attribute[0],function(keypath){keypath.isSpecial?ready?instance.set(key,keypath.value):(data[key]=keypath.value,delete mappings[key]):ready?instance.viewmodel.mappings[key].resolve(keypath):mappings[key].keypath=keypath})):resolver=new initialise_ComplexParameter(component,attribute,function(value){ready?instance.set(key,value):data[key]=value}),resolvers.push(resolver)}}),instance=create(Component.prototype),initialise(instance,{el:null,append:!0,data:data,partials:partials,magic:ractive.magic||Component.defaults.magic,modifyArrays:ractive.modifyArrays,adapt:ractive.adapt},{parent:ractive,component:component,container:container,mappings:mappings,inlinePartials:inlinePartials,cssIds:parentFragment.cssIds}),ready=!0,component.resolvers=resolvers,instance},initialise_propagateEvents=propagateEvents,initialise_updateLiveQueries=function(component){var ancestor,query;for(ancestor=component.root;ancestor;)(query=ancestor._liveComponentQueries["_"+component.name])&&query.push(component.instance),ancestor=ancestor.parent},Component_prototype_init=Component$init,Component_prototype_rebind=Component$rebind,Component_prototype_render=Component$render,Component_prototype_toString=Component$toString,Component_prototype_unbind=Component$unbind,Component_prototype_unbind__teardownHook=new hooks_Hook("teardown"),Component_prototype_unrender=Component$unrender,Component=function(options,Constructor){this.init(options,Constructor)};Component.prototype={detach:Component_prototype_detach,find:Component_prototype_find,findAll:Component_prototype_findAll,findAllComponents:Component_prototype_findAllComponents,findComponent:Component_prototype_findComponent,findNextNode:Component_prototype_findNextNode,firstNode:Component_prototype_firstNode,init:Component_prototype_init,rebind:Component_prototype_rebind,render:Component_prototype_render,toString:Component_prototype_toString,unbind:Component_prototype_unbind,unrender:Component_prototype_unrender};var _Component=Component,Comment=function(options){this.type=COMMENT,this.value=options.template.c};Comment.prototype={detach:shared_detach,firstNode:function(){return this.node},render:function(){return this.node||(this.node=document.createComment(this.value)),this.node},toString:function(){return""},unrender:function(shouldDestroy){shouldDestroy&&this.node.parentNode.removeChild(this.node)}};var items_Comment=Comment,Yielder=function(options){var container,component;this.type=YIELDER,this.container=container=options.parentFragment.root,this.component=component=container.component,this.container=container,this.containerFragment=options.parentFragment,this.parentFragment=component.parentFragment;var name=this.name=options.template.n||"",template=container._inlinePartials[name];template||(warnIfDebug('Could not find template for partial "'+name+'"',{ractive:options.root}),template=[]),this.fragment=new virtualdom_Fragment({owner:this,root:container.parent,template:template,pElement:this.containerFragment.pElement}),isArray(component.yielders[name])?component.yielders[name].push(this):component.yielders[name]=[this],global_runloop.scheduleTask(function(){if(component.yielders[name].length>1)throw new Error("A component template can only have one {{yield"+(name?" "+name:"")+"}} declaration at a time")})};Yielder.prototype={detach:function(){return this.fragment.detach()},find:function(selector){return this.fragment.find(selector)},findAll:function(selector,query){return this.fragment.findAll(selector,query)},findComponent:function(selector){return this.fragment.findComponent(selector)},findAllComponents:function(selector,query){return this.fragment.findAllComponents(selector,query)},findNextNode:function(){return this.containerFragment.findNextNode(this)},firstNode:function(){return this.fragment.firstNode()},getValue:function(options){return this.fragment.getValue(options)},render:function(){return this.fragment.render()},unbind:function(){this.fragment.unbind()},unrender:function(shouldDestroy){this.fragment.unrender(shouldDestroy),removeFromArray(this.component.yielders[this.name],this)},rebind:function(oldKeypath,newKeypath){this.fragment.rebind(oldKeypath,newKeypath)},toString:function(){return this.fragment.toString()}};var items_Yielder=Yielder,Doctype=function(options){this.declaration=options.template.a};Doctype.prototype={init:noop,render:noop,unrender:noop,teardown:noop,toString:function(){return""}};var items_Doctype=Doctype,Fragment_prototype_init=Fragment$init,Fragment_prototype_rebind=Fragment$rebind,Fragment_prototype_render=Fragment$render,Fragment_prototype_toString=Fragment$toString,Fragment_prototype_unbind=Fragment$unbind,Fragment_prototype_unrender=Fragment$unrender,Fragment=function(options){this.init(options)};Fragment.prototype={bubble:prototype_bubble,detach:Fragment_prototype_detach,find:Fragment_prototype_find,findAll:Fragment_prototype_findAll,findAllComponents:Fragment_prototype_findAllComponents,findComponent:Fragment_prototype_findComponent,findNextNode:prototype_findNextNode,firstNode:prototype_firstNode,getArgsList:getArgsList,getNode:getNode,getValue:prototype_getValue,init:Fragment_prototype_init,rebind:Fragment_prototype_rebind,registerIndexRef:function(idx){var idxs=this.registeredIndexRefs;-1===idxs.indexOf(idx)&&idxs.push(idx)},render:Fragment_prototype_render,toString:Fragment_prototype_toString,unbind:Fragment_prototype_unbind,unregisterIndexRef:function(idx){var idxs=this.registeredIndexRefs;idxs.splice(idxs.indexOf(idx),1)},unrender:Fragment_prototype_unrender};var Ractive,properties,virtualdom_Fragment=Fragment,prototype_reset=Ractive$reset,shouldRerender=["template","partials","components","decorators","events"],resetHook=new hooks_Hook("reset"),resetPartial=function(name,partial){function collect(source,dest,ractive){ractive&&ractive.partials[name]||source.forEach(function(item){item.type===PARTIAL&&item.getPartialName()===name&&dest.push(item),item.fragment&&collect(item.fragment.items,dest,ractive),isArray(item.fragments)?collect(item.fragments,dest,ractive):isArray(item.items)?collect(item.items,dest,ractive):item.type===COMPONENT&&item.instance&&collect(item.instance.fragment.items,dest,item.instance),item.type===ELEMENT&&(isArray(item.attributes)&&collect(item.attributes,dest,ractive),isArray(item.conditionalAttributes)&&collect(item.conditionalAttributes,dest,ractive))})}var promise,collection=[];return collect(this.fragment.items,collection),this.partials[name]=partial,promise=global_runloop.start(this,!0),collection.forEach(function(item){item.value=void 0,item.setValue(name)}),global_runloop.end(),promise},resetTemplate=Ractive$resetTemplate,reverse=makeArrayMethod("reverse"),Ractive_prototype_set=Ractive$set,shift=makeArrayMethod("shift"),prototype_sort=makeArrayMethod("sort"),splice=makeArrayMethod("splice"),subtract=Ractive$subtract,Ractive_prototype_teardown=Ractive$teardown,Ractive_prototype_teardown__teardownHook=new hooks_Hook("teardown"),toggle=Ractive$toggle,toHTML=Ractive$toHTML,Ractive_prototype_unrender=Ractive$unrender,unrenderHook=new hooks_Hook("unrender"),unshift=makeArrayMethod("unshift"),Ractive_prototype_update=Ractive$update,updateHook=new hooks_Hook("update"),prototype_updateModel=Ractive$updateModel,prototype={add:prototype_add,animate:prototype_animate,detach:prototype_detach,find:prototype_find,findAll:prototype_findAll,findAllComponents:prototype_findAllComponents,findComponent:prototype_findComponent,findContainer:findContainer,findParent:findParent,fire:prototype_fire,get:prototype_get,insert:insert,merge:prototype_merge,observe:observe,observeOnce:observeOnce,off:off,on:on,once:once,pop:pop,push:push,render:prototype_render,reset:prototype_reset,resetPartial:resetPartial,resetTemplate:resetTemplate,reverse:reverse,set:Ractive_prototype_set,shift:shift,sort:prototype_sort,splice:splice,subtract:subtract,teardown:Ractive_prototype_teardown,toggle:toggle,toHTML:toHTML,toHtml:toHTML,unrender:Ractive_prototype_unrender,unshift:unshift,update:Ractive_prototype_update,updateModel:prototype_updateModel},wrapMethod=function(method,superMethod,force){return force||needsSuper(method,superMethod)?function(){var result,hasSuper="_super"in this,_super=this._super;return this._super=superMethod,result=method.apply(this,arguments),hasSuper&&(this._super=_super),result}:method},unwrapExtended=unwrap,_extend=_extend__extend,getNodeInfo=function(node){var priv,indices,info={};return node&&(priv=node._ractive)?(info.ractive=priv.root,info.keypath=priv.keypath.str,info.index={},(indices=Resolvers_findIndexRefs(priv.proxy.parentFragment))&&(info.index=Resolvers_findIndexRefs.resolve(indices)),info):info};Ractive=function(options){return this instanceof Ractive?void initialise(this,options):new Ractive(options)},properties={DEBUG:{writable:!0,value:!0},DEBUG_PROMISES:{writable:!0,value:!0},extend:{value:_extend},getNodeInfo:{value:getNodeInfo},parse:{value:_parse},Promise:{value:utils_Promise},svg:{value:svg},magic:{value:environment__magic},VERSION:{value:"0.7.3"},adaptors:{writable:!0,value:{}},components:{writable:!0,value:{}},decorators:{writable:!0,value:{}},easing:{writable:!0,value:static_easing},events:{writable:!0,value:{}},interpolators:{writable:!0,value:static_interpolators},partials:{writable:!0,value:{}},transitions:{writable:!0,value:{}}},defineProperties(Ractive,properties),Ractive.prototype=utils_object__extend(prototype,config_defaults),Ractive.prototype.constructor=Ractive,Ractive.defaults=Ractive.prototype;var FUNCTION="function";if(typeof Date.now!==FUNCTION||typeof String.prototype.trim!==FUNCTION||typeof Object.keys!==FUNCTION||typeof Array.prototype.indexOf!==FUNCTION||typeof Array.prototype.forEach!==FUNCTION||typeof Array.prototype.map!==FUNCTION||typeof Array.prototype.filter!==FUNCTION||"undefined"!=typeof window&&typeof window.addEventListener!==FUNCTION)throw new Error("It looks like you're attempting to use Ractive.js in an older browser. You'll need to use one of the 'legacy builds' in order to continue - see http://docs.ractivejs.org/latest/legacy-builds for more information.");var _Ractive=Ractive;return _Ractive}),function($){function resultsFlat(acp_result){var i,array=acp_result.splice(0,acp_fuse_options.max_results_per_type),data=[];for(i=0;i{{title}} {{shortcut}}{{/results}}');var data=results[key],current_count=parseInt($(".acp-count-info .amount").attr("data-amount"));"undefined"==typeof current_count&&(current_count=0);var updated_count=current_count+data.length;$(".acp-count-info .amount").attr("data-amount",updated_count),$(".acp-count-info .amount").html(updated_count);var section=".acp-results[data-name="+key+"]";$(section).removeClass("hide");var list=section+" .acp-list";new Ractive({el:list,template:template,data:{results:data}})}}var AcpModal;window.AcpModal=AcpModal||{},AcpModal={modal:$(".acp"),inputField:$(".acp input[type=search]"),isOpen:function(){return AcpModal.modal.hasClass("open")},init:function(){var Mousetrap=window.Mousetrap||{};Mousetrap.bindGlobal("shift shift",function(){AcpModal.toggle()}),Mousetrap.bindGlobal("esc",function(){AcpModal.close()}),$("body").on("click",".acp-overlay.open",function(){AcpModal.close()})},toggle:function(){AcpModal.isOpen()?AcpModal.close():AcpModal.open()},open:function(){AcpModal.isOpen()||(AcpModal.modal.addClass("open"),AcpModal.inputField.focus())},close:function(){AcpModal.isOpen()&&(AcpModal.inputField.blur(),AcpModal.inputField.val(""),AcpModal.modal.removeClass("open"),$(".acp-results").addClass("hide"),$(".acp-list").html(""),$(".acp-count-info .amount").attr("data-amount",0).html(""),$(".acp-results-count").addClass("hide"))}},AcpModal.init();var acp_search_data,acp_fuse_options={keys:["title"],threshold:".3",max_results_per_type:"5",includeScore:!0,shouldSort:!0};$.ajax({url:acpAjax.ajaxurl,data:{action:"acp_gad"},success:function(response){acp_search_data=response}});var results_format="flat";"undefined"!=typeof acp_user_options&&(""!==acp_user_options.threshold&&(acp_fuse_options.threshold=acp_user_options.threshold),""!==acp_user_options.max_results_per_type&&(acp_fuse_options.max_results_per_type=acp_user_options.max_results_per_type),"grouped"===acp_user_options.results_format&&(results_format="grouped"));var ajaxTimer,queryLength=0;$(".acp input[type=search]").keyup(function(e){var $input=$(this);clearTimeout(ajaxTimer),ajaxTimer=setTimeout(function(){ if(queryLength!==$input.val().length){queryLength=$input.val().length,$(".acp-count-info .amount").attr("data-amount",0).html(""),$(".acp-results").addClass("hide"),$(".acp-list").html("");var query=$input.val();if(0!==query.length){$(".acp-results-count").removeClass("hide"),40!==e.keyCode&&38!==e.keyCode&&$(".acp-results-count .loader").removeClass("invisible");var acp_search=new Fuse(acp_search_data,acp_fuse_options),acp_result=acp_search.search(query);switch(results_format){case"flat":resultsFlat(acp_result);break;case"grouped":resultsGrouped(acp_result)}setTimeout(function(){$(".acp-results-count .loader").addClass("invisible"),$(".acp-list li").eq(0).addClass("selected")},10)}}},500)}),$(document).keydown(function(e){if($(".acp-modal").hasClass("open")){var key=e.keyCode;if(27===key&&AcpModal.close(),13===key||38===key||40===key){$(".acp input[type=search]").blur();var $current,$listItems=$(".acp-list li"),$selected=$listItems.filter(".selected"),$selectedIndex=$listItems.index($selected);if(13===key){if(-1===$selectedIndex)return;var target,action=$selected.find("a").attr("href");return void("undefined"!=typeof action?window.location=action:(target=$selected.attr("data-target"),"undefined"!==target&&$(target)[0].click()))}38===key?(e.preventDefault(),$current=-1===$selectedIndex||0===$selectedIndex?$listItems.eq($listItems.length-1):$listItems.eq($selectedIndex-1)):40===key&&(e.preventDefault(),$current=-1===$selectedIndex||$selectedIndex===$listItems.length-1?$listItems.eq(0):$listItems.eq($selectedIndex+1)),$listItems.removeClass("selected"),$current.addClass("selected")}}}),$("body").on("click",".acp-list [data-target]",function(){var target=$(this).attr("data-target");"undefined"!==target&&$(target)[0].click()}),Mousetrap.bind("esc",function(){1===$(".acp input:focus").length&&AcpModal.close(),$("input").trigger("blur")}),0<$('a[href*="post-new.php"]').length&&Mousetrap.bind("shift+n",function(){1!==$("input:focus").length&&window.location.replace($('a[href*="post-new.php"]').attr("href"))}),Mousetrap.bind("shift+v",function(){if(1!==$("input:focus").length){var url=$("#view-post-btn a").attr("href");window.open(url,"_blank")}}),Mousetrap.bind("shift+p",function(){1!==$("input:focus").length&&1===$(".preview").length&&$(".preview")[0].click()}),Mousetrap.bind("shift+s",function(){1!==$("input:focus").length&&(1===$("#publish").length?$("#publish")[0].click():1===$("#submit").length?$("#submit")[0].click():1===$("#createusersub").length?$("#createusersub")[0].click():1===$("a.button-primary").length&&$("a.button-primary")[0].click())}),Mousetrap.bind("shift+t",function(){1!==$("input:focus").length&&$(".submitdelete")[0].click()}),Mousetrap.bind("shift+f",function(){1!==$("input:focus").length&&$(".set-post-thumbnail")[0].click()}),0!==$(".pagination-links").length&&(Mousetrap.bind("shift+right",function(){1!==$("input:focus").length&&$("a.last-page")[0].click()}),Mousetrap.bind("right",function(){1!==$("input:focus").length&&$("a.next-page")[0].click()}),Mousetrap.bind("shift+left",function(){1!==$("input:focus").length&&$("a.first-page")[0].click()}),Mousetrap.bind("left",function(){1!==$("input:focus").length&&$("a.prev-page")[0].click()}))}(jQuery);