-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRactive.min.js
4 lines (4 loc) · 117 KB
/
Ractive.min.js
1
2
3
4
!function(a){var b=function(){return"undefined"!=typeof document?document&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"):void 0}(),c=function(){var a;try{Object.create(null),a=Object.create}catch(b){a=function(){var a=function(){};return function(b,c){var d;return null===b?{}:(a.prototype=b,d=new a,c&&Object.defineProperties(d,c),d)}}()}return a}(),d={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/"},e=function(a,b){return a?function(a,b){return b?document.createElementNS(b,a):document.createElement(a)}:function(a,c){if(c&&c!==b.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 https://github.com/RactiveJS/Ractive/wiki/SVG-and-older-browsers for more information";return document.createElement(a)}}(b,d),f=function(){return"object"==typeof document?!0:!1}(),g=function(a){try{return Object.defineProperty({},"test",{value:0}),a&&Object.defineProperty(document.createElement("div"),"test",{value:0}),Object.defineProperty}catch(b){return function(a,b,c){a[b]=c.value}}}(f),h=function(a,b,c){try{try{Object.defineProperties({},{test:{value:0}})}catch(d){throw d}return c&&Object.defineProperties(a("div"),{test:{value:0}}),Object.defineProperties}catch(d){return function(a,c){var d;for(d in c)c.hasOwnProperty(d)&&b(a,d,c[d])}}}(e,g,f),i=function(){var a=/\[\s*(\*|[0-9]|[1-9][0-9]+)\s*\]/g;return function(b){return(b||"").replace(a,".$1")}}(),j={},k={TEXT:1,INTERPOLATOR:2,TRIPLE:3,SECTION:4,INVERTED:5,CLOSING:6,ELEMENT:7,PARTIAL:8,COMMENT:9,DELIMCHANGE:10,MUSTACHE:11,TAG:12,ATTRIBUTE:13,COMPONENT:15,NUMBER_LITERAL:20,STRING_LITERAL:21,ARRAY_LITERAL:22,OBJECT_LITERAL:23,BOOLEAN_LITERAL:24,GLOBAL:26,KEY_VALUE_PAIR:27,REFERENCE:30,REFINEMENT:31,MEMBER:32,PREFIX_OPERATOR:33,BRACKETED:34,CONDITIONAL:35,INFIX_OPERATOR:36,INVOCATION:40},l=function(){var a=Object.prototype.toString;return function(b){return"[object Array]"===a.call(b)}}(),m=function(){return function a(b,c){var d,e;if((e=b._wrapped[c])&&e.teardown()!==!1&&(b._wrapped[c]=null),b._cache[c]=void 0,d=b._cacheMap[c])for(;d.length;)a(b,d.pop())}}(),n=function(){return function(a,b){var c,d,e,f,g,h;for(c=[],h=a.rendered?a.el:a.fragment.docFrag,d=h.querySelectorAll('input[type="checkbox"][name="{{'+b+'}}"]'),f=d.length,g=0;f>g;g+=1)e=d[g],(e.hasAttribute("checked")||e.checked)&&(c[c.length]=e._ractive.value);return c}}(),o=function(a){return function(b){var c,d,e,f,g,h;for(c=b._deferred;d=c.evals.pop();)d.update().deferred=!1;for(;e=c.selectValues.pop();)e.deferredUpdate();for(;f=c.attrs.pop();)f.update().deferred=!1;for(;g=c.checkboxes.pop();)b.set(g,a(b,g));for(;h=c.radios.pop();)h.update()}}(n),p=function(){return function(a){var b,c,d,e,f,g;for(b=a._deferred,(c=b.focusable)&&(c.focus(),b.focusable=null);d=b.liveQueries.pop();)d._sort();for(;e=b.decorators.pop();)e.init();for(;f=b.transitions.pop();)f.init();for(;g=b.observers.pop();)g.update()}}(),q=function(){var a=function(a,b){var c,d,e,f;return a._parent&&a._parent._transitionManager?a._parent._transitionManager:(d=[],e=function(){var a,b;for(a=d.length;a--;)b=d[a],f(b.node)&&(b.detach(),d.splice(a,1))},f=function(a){var b,d;for(b=c.active.length;b--;)if(d=c.active[b],a.contains(d))return!1;return!0},c={active:[],push:function(a){c.active[c.active.length]=a},pop:function(a){var b;b=c.active.indexOf(a),-1!==b&&(c.active.splice(b,1),e(),!c.active.length&&c._ready&&c.complete())},complete:function(){b&&b.call(a)},ready:function(){e(),c._ready=!0,c.active.length||c.complete()},detachWhenReady:function(a){d[d.length]=a}})};return a}(),r=function(){function a(a,d,e,f){var g=a._deps[e];g&&(b(g[d]),f||c(a._depsMap[d],a,e))}function b(a){var b,c;if(a)for(c=a.length,b=0;c>b;b+=1)a[b].update()}function c(b,c,d,e){var f;if(b)for(f=b.length;f--;)a(c,b[f],d,e)}function d(a,b,c,f,g){var i,j,k,l,m,n,o,p;for(i=a._patternObservers.length;i--;)j=a._patternObservers[i],j.regex.test(c)&&j.update(c);f||(p=function(b){if(k=a._depsMap[b])for(i=k.length;i--;)l=k[i],m=h.exec(l)[0],n=c+"."+m,d(a,l,n)},g?(o=e(c),o.forEach(p)):p(b))}function e(a){var b,c,d,e,g,h;for(b=a.split("."),c=f(b.length),g=[],d=function(a,c){return a?"*":b[c]},e=c.length;e--;)h=c[e].map(d).join("."),g[h]||(g[g.length]=h,g[h]=!0);return g}function f(a){var b,c,d,e,f,g="";if(!i[a]){for(d=[];g.length<a;)g+=1;for(b=parseInt(g,2),e=function(a){return"1"===a},f=0;b>=f;f+=1){for(c=f.toString(2);c.length<a;)c="0"+c;d[f]=Array.prototype.map.call(c,e)}i[a]=d}return i[a]}var g,h,i={};return h=/[^\.]+$/,g=function(b,c,e){var f;for(b._patternObservers.length&&d(b,c,c,e,!0),f=0;f<b._deps.length;f+=1)a(b,c,f,e)},g.multiple=function(b,c,e){var f,g,h;if(h=c.length,b._patternObservers.length)for(f=h;f--;)d(b,c[f],c[f],e,!0);for(f=0;f<b._deps.length;f+=1)if(b._deps[f])for(g=h;g--;)a(b,c[g],f,e)},g}(),s=function(a,b,c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q,r;return i={filter:function(a){return c(a)&&(!a._ractive||!a._ractive.setting)},wrap:function(a,b,c){return new k(a,b,c)}},k=function(a,c,d){this.root=a,this.value=c,this.keypath=d,c._ractive||(b(c,"_ractive",{value:{wrappers:[],instances:[],setting:!1},configurable:!0}),l(c)),c._ractive.instances[a._guid]||(c._ractive.instances[a._guid]=0,c._ractive.instances.push(a)),c._ractive.instances[a._guid]+=1,c._ractive.wrappers.push(this)},k.prototype={get:function(){return this.value},teardown:function(){var a,b,c,d,e;if(a=this.value,b=a._ractive,c=b.wrappers,d=b.instances,b.setting)return!1;if(e=c.indexOf(this),-1===e)throw new Error(r);if(c.splice(e,1),c.length){if(d[this.root._guid]-=1,!d[this.root._guid]){if(e=d.indexOf(this.root),-1===e)throw new Error(r);d.splice(e,1)}}else delete a._ractive,m(this.value)}},j=function(b,c,f){var g,i,j,k,l;for(g=function(a,g){var j,k,l,m,n,o,p,q,r,s,t,u;if("sort"===c||"reverse"===c)return a.set(g,b),void 0;for(d(a,g),n=[],o=[],p=0;p<a._deps.length;p+=1)if(j=a._deps[p],j&&(k=j[g])){for(i(g,k,n,o),e(a);n.length;)n.pop().smartUpdate(c,f);for(;o.length;)o.pop().update()}if("splice"===c&&f.length>2&&f[1])for(q=Math.min(f[1],f.length-2),r=f[0],s=r+q,f[1]===f.length-2&&(u=!0),p=r;s>p;p+=1)t=g+"."+p,h(a,t);for(e(a),m=[],l=g.split(".");l.length;)l.pop(),m[m.length]=l.join(".");h.multiple(a,m,!0),u||h(a,g+".length",!0)},i=function(b,c,d,e){var f,g;for(f=c.length;f--;)g=c[f],g.type===a.REFERENCE?g.update():g.keypath===b&&g.type===a.SECTION&&!g.inverted&&g.docFrag?d[d.length]=g:e[e.length]=g},j=b._ractive.wrappers,l=j.length;l--;)k=j[l],g(k.root,k.keypath)},n=[],p=["pop","push","reverse","shift","sort","splice","unshift"],q=function(){},p.forEach(function(a){var c=function(){var b,c,d,h,i={},k={};for(b=Array.prototype[a].apply(this,arguments),c=this._ractive.instances,h=c.length;h--;)d=c[h],i[d._guid]=d._transitionManager,d._transitionManager=k[d._guid]=g(d,q);for(this._ractive.setting=!0,j(this,a,arguments),this._ractive.setting=!1,h=c.length;h--;)d=c[h],d._transitionManager=i[d._guid],k[d._guid].ready(),e(d),f(d);return b};b(n,a,{value:c})}),o={},o.__proto__?(l=function(a){a.__proto__=n},m=function(a){a.__proto__=Array.prototype}):(l=function(a){var c,d;for(c=p.length;c--;)d=p[c],b(a,d,{value:n[d],configurable:!0})},m=function(a){var b;for(b=p.length;b--;)delete a[p[b]]}),r="Something went wrong in a rather interesting way",i}(k,g,l,m,o,p,q,r),t=function(){var a,b;try{Object.defineProperty({},"test",{value:0})}catch(c){return!1}return a={filter:function(a,b){return!!b},wrap:function(a,c,d){return new b(a,c,d)}},b=function(a,b,c){var d,e,f,g,h,i,j,k,l,m=this;if(this.ractive=a,this.keypath=c,d=c.split("."),this.prop=d.pop(),f=d.join("."),this.obj=f?a.get(f):a.data,g=this.originalDescriptor=Object.getOwnPropertyDescriptor(this.obj,this.prop),g&&g.set&&(h=g.set._ractiveWrappers))return-1===h.indexOf(this)&&h.push(this),void 0;if(g&&!g.configurable)throw new Error('Cannot use magic mode with property "'+e+'" - object is not configurable');g&&(this.value=g.value,i=g.get,j=g.set),k=i||function(){return m.value},l=function(a){var b,c,d;for(j&&j(a),b=l._ractiveWrappers,d=b.length;d--;)c=b[d],c.resetting||c.ractive.set(c.keypath,a)},l._ractiveWrappers=[this],Object.defineProperty(this.obj,this.prop,{get:k,set:l,enumerable:!0,configurable:!0})},b.prototype={get:function(){return this.value},reset:function(a){this.resetting=!0,this.value=a,this.resetting=!1},teardown:function(){var a,b,c,d;a=Object.getOwnPropertyDescriptor(this.obj,this.prop),b=a.set,d=b._ractiveWrappers,d.splice(d.indexOf(this),1),d.length||(c=this.obj[this.prop],Object.defineProperty(this.obj,this.prop,this.originalDescriptor||{writable:!0,enumerable:!0,configrable:!0}),this.obj[this.prop]=c)}},a}(),u=function(a,b,c){function d(a,b){var c,d={};if(!b)return a;b+=".";for(c in a)a.hasOwnProperty(c)&&(d[b+c]=a[c]);return d}function e(a){var b;return f[a]||(b=a?a+".":"",f[a]=function(c,e){var f;return"string"==typeof c?(f={},f[b+c]=e,f):"object"==typeof c?b?d(c,a):c:void 0}),f[a]}var f={};return function(d,f,g,h){var i,j,k,l;for(i=d.adaptors.length,j=0;i>j;j+=1){if(k=d.adaptors[j],"string"==typeof k){if(!a[k])throw new Error('Missing adaptor "'+k+'"');k=d.adaptors[j]=a[k]}if(k.filter(g,f,d))return l=d._wrapped[f]=k.wrap(d,g,f,e(f)),l.value=g,void 0}h||(d.magic&&c.filter(g,f,d)?d._wrapped[f]=c.wrap(d,g,f):d.modifyArrays&&b.filter(g,f,d)&&(d._wrapped[f]=b.wrap(d,g,f)))}}(j,s,t),v=function(a,b,c){var d,e,f;return d=function(a){return this._captured&&!this._captured[a]&&(this._captured.push(a),this._captured[a]=!0),e(this,a)},e=function(b,d){var e,g,h,i,j;return d=a(d),e=b._cache,void 0!==(g=e[d])?g:((i=b._wrapped[d])?h=i.value:d?h=(j=b._evaluators[d])?j.value:f(b,d):(c(b,"",b.data),h=b.data),e[d]=h,h)},f=function(a,b){var d,f,g,h,i,j,k;return d=b.split("."),f=d.pop(),g=d.join("."),h=e(a,g),(k=a._wrapped[g])&&(h=k.get()),null!==h&&void 0!==h?((i=a._cacheMap[g])?-1===i.indexOf(b)&&(i[i.length]=b):a._cacheMap[g]=[b],j=h[f],c(a,b,j),a._cache[b]=j,j):void 0},d}(i,j,u),w=function(){var a=Object.prototype.toString;return function(b){return"object"==typeof b&&"[object Object]"===a.call(b)}}(),x=function(){return function(a,b){return null===a&&null===b?!0:"object"==typeof a||"object"==typeof b?!1:a===b}}(),y=function(){var a;return a=function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n;if(n='Could not resolve reference - too many "../" prefixes',"."===b){if(!c.length)return"";d=c[c.length-1]}else if("."===b.charAt(0))if(m=c[c.length-1],g=m?m.split("."):[],"../"===b.substr(0,3)){for(;"../"===b.substr(0,3);){if(!g.length)throw new Error(n);g.pop(),b=b.substring(3)}g.push(b),d=g.join(".")}else d=m?m+b:b.substring(1);else{for(e=b.split("."),f=e.pop(),i=e.length?"."+e.join("."):"",c=c.concat();c.length;)if(h=c.pop(),j=h+i,k=a.get(j),(l=a._wrapped[j])&&(k=l.get()),"object"==typeof k&&null!==k&&k.hasOwnProperty(f)){d=h+"."+b;break}d||void 0===a.get(b)||(d=b)}return d?d.replace(/^\./,""):d}}(),z=function(a){var b=Array.prototype.push;return function(c){for(var d,e,f;d=c._pendingResolution.pop();)e=a(c,d.ref,d.contextStack),void 0!==e?d.resolve(e):(f||(f=[])).push(d);f&&b.apply(c._pendingResolution,f)}}(y),A=function(a,b){return function(c){a(c),b(c)}}(o,p),B=function(){return function(a,b,c){var d,e,f,g,h,i,j;for(d=b.split("."),e=[],(f=a._wrapped[""])?(f.set&&f.set(d.join("."),c),g=f.get()):g=a.data;d.length>1;)h=e[e.length]=d.shift(),i=e.join("."),(f=a._wrapped[i])?(f.set&&f.set(d.join("."),c),g=f.get()):(g.hasOwnProperty(h)||(j||(j=i),g[h]=/^\s*[0-9]+\s*$/.test(d[0])?[]:{}),g=g[h]);return h=d[0],g[h]=c,j}}(),C=function(a,b,c,d,e,f,g,h,i){var j,k,l,m;return j=function(b,d,i){var j,m,n,o,p,q,r;if(m=[],a(b)&&(j=b,i=d),j)for(b in j)j.hasOwnProperty(b)&&(d=j[b],b=c(b),k(this,b,d,m));else b=c(b),k(this,b,d,m);if(m.length){if(o=this._transitionManager,this._transitionManager=p=g(this,i),n=l(m),n.length&&e.multiple(this,n,!0),e.multiple(this,m),this._pendingResolution.length&&f(this),h(this),this._transitionManager=o,p.ready(),!this.firingChangeEvent){for(this.firingChangeEvent=!0,r={},q=m.length;q--;)r[m[q]]=this.get(m[q]);this.fire("change",r),this.firingChangeEvent=!1}return this}},k=function(a,b,c,e){var f,g,h,j,k;if(!(h=a._wrapped[b])||!h.reset||m(a,b,c,h,e)===!1){if((k=a._evaluators[b])&&(k.value=c),f=a._cache[b],g=a.get(b),g===c||k){if(c===f&&"object"!=typeof c)return}else j=i(a,b,c);d(a,j||b),e[e.length]=b}},l=function(a){var b,c,d,e,f=[""];for(b=a.length;b--;)for(c=a[b],d=c.split(".");d.length>1;)d.pop(),e=d.join("."),f[e]||(f[f.length]=e,f[e]=!0);return f},m=function(a,c,e,f,g){var h,i,j,k;if(h=f.get(),!b(h,e)&&f.reset(e)===!1)return!1;if(e=f.get(),i=a._cache[c],!b(i,e)){if(a._cache[c]=e,j=a._cacheMap[c])for(k=j.length;k--;)d(a,j[k]);g[g.length]=c}},j}(w,x,i,m,r,z,q,A,B),D=function(a,b,c,d,e){return function(f,g){var h,i;return"function"==typeof f&&(g=f,f=""),i=this._transitionManager,this._transitionManager=h=a(this,g),b(this),c(this,f||""),d(this,f||""),e(this),this._transitionManager=i,h.ready(),"string"==typeof f?this.fire("update",f):this.fire("update"),this}}(q,z,m,r,A),E=function(a){return function(b,c){var d;if(!a(b)||!a(c))return!1;if(b.length!==c.length)return!1;for(d=b.length;d--;)if(b[d]!==c[d])return!1;return!0}}(l),F=function(a,b,c){function d(a,e,f,g,h){var i,j,k,l,m,n;if(i=a._twowayBindings[e])for(k=i.length;k--;)l=i[k],(!l.radioName||l.node.checked)&&(l.checkboxName?l.changed()&&!g[e]&&(g[e]=!0,g[g.length]=e):(m=l.attr.value,n=l.value(),b(m,n)||c(m,n)||(f[e]=n)));if(h&&(j=a._depsMap[e]))for(k=j.length;k--;)d(a,j[k],f,g,h)}return function(b,c){var e,f,g;if("string"!=typeof b&&(b="",c=!0),d(this,b,e={},f=[],c),g=f.length)for(;g--;)b=f[g],e[b]=a(this,b);this.set(e)}}(n,E,x),G=function(){return"undefined"!=typeof window?(function(a,b,c){var d,e;if(!c.requestAnimationFrame){for(d=0;d<a.length&&!c.requestAnimationFrame;++d)c.requestAnimationFrame=c[a[d]+"RequestAnimationFrame"];c.requestAnimationFrame||(e=c.setTimeout,c.requestAnimationFrame=function(a){var c,d,f;return c=Date.now(),d=Math.max(0,16-(c-b)),f=e(function(){a(c+d)},d),b=c+d,f})}}(["ms","moz","webkit","o"],0,window),window.requestAnimationFrame):void 0}(),H=function(a){var b=[],c={tick:function(){var d,e;for(d=0;d<b.length;d+=1)e=b[d],e.tick()||b.splice(d--,1);b.length?a(c.tick):c.running=!1},add:function(a){b[b.length]=a,c.running||(c.running=!0,c.tick())},abort:function(a,c){for(var d,e=b.length;e--;)d=b[e],d.root===c&&d.keypath===a&&d.stop()}};return c}(G),I=function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&"function"==typeof console.warn.apply?function(){console.warn.apply(console,arguments)}:function(){}}(),J=function(){return function(a){return!isNaN(parseFloat(a))&&isFinite(a)}}(),K=function(a,b,c){function d(a,b){var c=b-a;return c?function(b){return a+b*c}:function(){return a}}function e(a,b){var c,d,e,f;for(c=[],d=[],f=e=Math.min(a.length,b.length);f--;)d[f]=g(a[f],b[f]);for(f=e;f<a.length;f+=1)c[f]=a[f];for(f=e;f<b.length;f+=1)c[f]=b[f];return function(a){for(var b=e;b--;)c[b]=d[b](a);return c}}function f(a,b){var c,d,e,f,h=[];e={},d={};for(f in a)a.hasOwnProperty(f)&&(b.hasOwnProperty(f)?(h[h.length]=f,d[f]=g(a[f],b[f])):e[f]=a[f]);for(f in b)b.hasOwnProperty(f)&&!a.hasOwnProperty(f)&&(e[f]=b[f]);return c=h.length,function(a){for(var b,f=c;f--;)b=h[f],e[b]=d[b](a);return e}}var g=function(g,h){return c(g)&&c(h)?d(+g,+h):a(g)&&a(h)?e(g,h):b(g)&&b(h)?f(g,h):function(){return h}};return g}(l,w,J),L=function(a,b){var c=function(a){var c;this.startTime=Date.now();for(c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);this.interpolator=b(this.from,this.to),this.running=!0};return c.prototype={tick:function(){var b,c,d,e,f,g;return g=this.keypath,this.running?(e=Date.now(),b=e-this.startTime,b>=this.duration?(null!==g&&this.root.set(g,this.to),this.step&&this.step(1,this.to),this.complete&&this.complete(1,this.to),f=this.root._animations.indexOf(this),-1===f&&a("Animation was not found"),this.root._animations.splice(f,1),this.running=!1,!1):(c=this.easing?this.easing(b/this.duration):b/this.duration,null!==g&&(d=this.interpolator(c),this.root.set(g,d)),this.step&&this.step(c,d),!0)):!1},stop:function(){var b;this.running=!1,b=this.root._animations.indexOf(this),-1===b&&a("Animation was not found"),this.root._animations.splice(b,1)}},c}(I,K),M=function(){return{linear:function(a){return a},easeIn:function(a){return Math.pow(a,3)},easeOut:function(a){return Math.pow(a-1,3)+1},easeInOut:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)}}}(),N=function(a,b,c,d){function e(e,g,h,i){var j,k,l,m;return null!==g&&(m=e.get(g)),b.abort(g,e),a(m,h)?(i.complete&&i.complete(1,i.to),f):(i.easing&&(j="function"==typeof i.easing?i.easing:e.easing&&e.easing[i.easing]?e.easing[i.easing]:d[i.easing],"function"!=typeof j&&(j=null)),k=void 0===i.duration?400:i.duration,l=new c({keypath:g,from:m,to:h,root:e,duration:k,easing:j,step:i.step,complete:i.complete}),b.add(l),e._animations[e._animations.length]=l,l)}var f={stop:function(){}};return function(a,b,c){var d,f,g,h,i,j,k,l,m,n,o,p;if("object"==typeof a){c=b||{},h=c.easing,i=c.duration,g=[],j=c.step,k=c.complete,(j||k)&&(m={},c.step=null,c.complete=null,l=function(a){return function(b,c){m[a]=c}});for(d in a)a.hasOwnProperty(d)&&((j||k)&&(n=l(d),c={easing:h,duration:i},j&&(c.step=n),k&&(c.complete=n)),g[g.length]=e(this,d,a[d],c));return(j||k)&&(p={easing:h,duration:i},j&&(p.step=function(a){j(a,m)}),k&&(p.complete=function(a){k(a,m)}),g[g.length]=o=e(this,null,null,p)),{stop:function(){for(;g.length;)g.pop().stop();o&&o.stop()}}}return c=c||{},f=e(this,a,b,c),{stop:function(){f.stop()}}}}(x,H,L,M),O=function(){return function(a,b){var c,d,e=this;if("object"==typeof a){c=[];for(d in a)a.hasOwnProperty(d)&&(c[c.length]=this.on(d,a[d]));return{cancel:function(){for(;c.length;)c.pop().cancel()}}}return this._subs[a]?this._subs[a].push(b):this._subs[a]=[b],{cancel:function(){e.off(a,b)}}}}(),P=function(){return function(a,b){var c,d;if(!b)if(a)this._subs[a]=[];else for(a in this._subs)delete this._subs[a];c=this._subs[a],c&&(d=c.indexOf(b),-1!==d&&c.splice(d,1))}}(),Q=function(){return function(a){var b,c,d,e,f,g,h,i;if(g=a.root,h=a.keypath,i=a.priority,b=g._deps[i]||(g._deps[i]={}),c=b[h]||(b[h]=[]),c[c.length]=a,a.registered=!0,h)for(d=h.split(".");d.length;)d.pop(),e=d.join("."),f=g._depsMap[e]||(g._depsMap[e]=[]),void 0===f[h]&&(f[h]=0,f[f.length]=h),f[h]+=1,h=e}}(),R=function(){return function(a){var b,c,d,e,f,g,h,i;if(g=a.root,h=a.keypath,i=a.priority,b=g._deps[i][h],c=b.indexOf(a),-1===c||!a.registered)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");if(b.splice(c,1),a.registered=!1,h)for(d=h.split(".");d.length;)d.pop(),e=d.join("."),f=g._depsMap[e],f[h]-=1,f[h]||(f.splice(f.indexOf(h),1),f[h]=void 0),h=e}}(),S=function(a){var b=function(a,b,c,d){var e=this;this.root=a,this.keypath=b,this.callback=c,this.defer=d.defer,this.debug=d.debug,this.proxy={update:function(){e.reallyUpdate()}},this.priority=0,this.context=d&&d.context?d.context:a};return b.prototype={init:function(a){a!==!1?this.update():this.value=this.root.get(this.keypath)},update:function(){return this.defer&&this.ready?(this.root._deferred.observers.push(this.proxy),void 0):(this.reallyUpdate(),void 0)},reallyUpdate:function(){var b,c;if(b=this.value,c=this.root.get(this.keypath),this.value=c,!this.updating){if(this.updating=!0,!a(c,b)||!this.ready)try{this.callback.call(this.context,c,b,this.keypath)}catch(d){if(this.debug||this.root.debug)throw d}this.updating=!1}}},b}(x),T=function(){return function(a,b){var c,d,e,f,g,h,i;for(c=b.split("."),f=[],h=function(b){var c,d;c=a._wrapped[b]?a._wrapped[b].get():a.get(b);for(d in c)g.push(b+"."+d)},i=function(a){return a+"."+d};d=c.shift();)"*"===d?(g=[],f.forEach(h),f=g):f[0]?f=f.map(i):f[0]=d;return e={},f.forEach(function(b){e[b]=a.get(b)}),e}}(),U=function(a,b){var c,d=/\*/;return c=function(a,b,c,d){this.root=a,this.callback=c,this.defer=d.defer,this.debug=d.debug,this.keypath=b,this.regex=new RegExp("^"+b.replace(/\./g,"\\.").replace(/\*/g,"[^\\.]+")+"$"),this.values={},this.defer&&(this.proxies=[]),this.priority="pattern",this.context=d&&d.context?d.context:a},c.prototype={init:function(a){var c,d;if(c=b(this.root,this.keypath),a!==!1)for(d in c)c.hasOwnProperty(d)&&this.update(d);else this.values=c},update:function(a){var c;{if(!d.test(a))return this.defer&&this.ready?(this.root._deferred.observers.push(this.getProxy(a)),void 0):(this.reallyUpdate(a),void 0);c=b(this.root,a);for(a in c)c.hasOwnProperty(a)&&this.update(a)}},reallyUpdate:function(b){var c=this.root.get(b);if(this.updating)return this.values[b]=c,void 0;if(this.updating=!0,!a(c,this.values[b])||!this.ready){try{this.callback.call(this.context,c,this.values[b],b)}catch(d){if(this.debug||this.root.debug)throw d}this.values[b]=c}this.updating=!1},getProxy:function(a){var b=this;return this.proxies[a]||(this.proxies[a]={update:function(){b.reallyUpdate(a)}}),this.proxies[a]}},c}(x,T),V=function(a,b,c,d,e){var f=/\*/,g={};return function(h,i,j,k){var l,m;return i=a(i),k=k||g,f.test(i)?(l=new e(h,i,j,k),h._patternObservers.push(l),m=!0):l=new d(h,i,j,k),b(l),l.init(k.init),l.ready=!0,{cancel:function(){var a;m&&(a=h._patternObservers.indexOf(l),-1!==a&&h._patternObservers.splice(a,1)),c(l)}}}}(i,Q,R,S,U),W=function(a,b){return function(c,d,e){var f,g=[];if(a(c)){e=d;for(f in c)c.hasOwnProperty(f)&&(d=c[f],g[g.length]=b(this,f,d,e));return{cancel:function(){for(;g.length;)g.pop().cancel()}}}return b(this,c,d,e)}}(w,V),X=function(){return function(a){var b,c,d,e=this._subs[a];if(e)for(b=Array.prototype.slice.call(arguments,1),c=0,d=e.length;d>c;c+=1)e[c].apply(this,b)}}(),Y=function(){return function(a){return this.el?this.fragment.find(a):null}}(),Z=function(a,b){var c,d,e,f,g,h,i,j;if(a){for(c=b("div"),d=["matches","matchesSelector"],g=["o","ms","moz","webkit"],j=function(a){return function(b,c){return b[a](c)}},h=d.length;h--;){if(e=d[h],c[e])return j(e);for(i=g.length;i--;)if(f=g[h]+e.substr(0,1).toUpperCase()+e.substring(1),c[f])return j(f)}return function(a,b){var c,d;for(c=(a.parentNode||a.document).querySelectorAll(b),d=c.length;d--;)if(c[d]===a)return!0;return!1}}}(f,e),$=function(a){return function(b,c){var d=this._isComponentQuery?!this.selector||b.name===this.selector:a(b.node,this.selector);return d?(this.push(b.node||b.instance),c||this._makeDirty(),!0):void 0}}(Z),_=function(){return function(){var a,b,c;a=this._root[this._isComponentQuery?"liveComponentQueries":"liveQueries"],b=this.selector,c=a.indexOf(b),-1!==c&&(a.splice(c,1),a[b]=null)}}(),ab=function(){function a(a){var b;return(b=a.parentFragment)?b.owner:a.component&&(b=a.component.parentFragment)?b.owner:void 0}function b(b){var c,d;for(c=[b],d=a(b);d;)c.push(d),d=a(d);return c}return function(a,c){var d,e,f,g,h,i,j,k,l,m;for(d=b(a.component||a._ractive.proxy),e=b(c.component||c._ractive.proxy),f=d[d.length-1],g=e[e.length-1];f&&f===g;)d.pop(),e.pop(),h=f,f=d[d.length-1],g=e[e.length-1];if(f=f.component||f,g=g.component||g,l=f.parentFragment,m=g.parentFragment,l===m)return i=l.items.indexOf(f),j=m.items.indexOf(g),i-j||d.length-e.length;if(k=h.fragments)return i=k.indexOf(l),j=k.indexOf(m),i-j||d.length-e.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!")}}(),bb=function(a){return function(b,c){var d;return b.compareDocumentPosition?(d=b.compareDocumentPosition(c),2&d?1:-1):a(b,c)}}(ab),cb=function(a,b){return function(){this.sort(this._isComponentQuery?b:a),this._dirty=!1}}(bb,ab),db=function(){return function(){this._dirty||(this._root._deferred.liveQueries.push(this),this._dirty=!0)}}(),eb=function(){return function(a){var b=this.indexOf(this._isComponentQuery?a.instance:a.node);-1!==b&&this.splice(b,1)}}(),fb=function(a,b,c,d,e,f){return function(g,h,i,j){var k;return k=[],a(k,{selector:{value:h},live:{value:i},_isComponentQuery:{value:j},_test:{value:b}}),i?(a(k,{cancel:{value:c},_root:{value:g},_sort:{value:d},_makeDirty:{value:e},_remove:{value:f},_dirty:{value:!1,writable:!0}}),k):k}}(h,$,_,cb,db,eb),gb=function(a,b,c,d){return function(a,b){var c,e;return this.el?(b=b||{},c=this._liveQueries,(e=c[a])?b&&b.live?e:e.slice():(e=d(this,a,!!b.live,!1),e.live&&(c.push(a),c[a]=e),this.fragment.findAll(a,e),e)):[]}}(I,Z,h,fb),hb=function(){return function(a){return this.fragment.findComponent(a)}}(),ib=function(a,b,c,d){return function(a,b){var c,e;return b=b||{},c=this._liveComponentQueries,(e=c[a])?b&&b.live?e:e.slice():(e=d(this,a,!!b.live,!0),e.live&&(c.push(a),c[a]=e),this.fragment.findAllComponents(a,e),e)}}(I,Z,h,fb),jb=function(){return function(a){var b;return"undefined"!=typeof window&&document&&a?a.nodeType?a:"string"==typeof a&&(b=document.getElementById(a),!b&&document.querySelector&&(b=document.querySelector(a)),b&&b.nodeType)?b:a[0]&&a[0].nodeType?a[0]:null:null}}(),kb=function(a,b){return function(c,d){var e,f,g,h,i;if(c.owner=d.owner,g=c.owner.parentFragment,c.root=d.root,c.pNode=d.pNode,c.contextStack=d.contextStack||[],c.owner.type===a.SECTION&&(c.index=d.index),g&&(h=g.indexRefs)){c.indexRefs=b(null);for(i in h)c.indexRefs[i]=h[i]}for(c.priority=g?g.priority+1:1,d.indexRef&&(c.indexRefs||(c.indexRefs={}),c.indexRefs[d.indexRef]=d.index),c.items=[],e=d.descriptor?d.descriptor.length:0,f=0;e>f;f+=1)c.items[c.items.length]=c.createItem({parentFragment:c,descriptor:d.descriptor[f],index:f})}}(k,c),lb=function(a){var b={};return function(c,d,e){var f,g=[];if(c)for(f=b[d]||(b[d]=a(d)),f.innerHTML=c;f.firstChild;)g[g.length]=f.firstChild,e.appendChild(f.firstChild);return g}}(e),mb=function(a){var b,c,d;return c=/</g,d=/>/g,b=function(b,c){this.type=a.TEXT,this.descriptor=b.descriptor,c&&(this.node=document.createTextNode(b.descriptor),c.appendChild(this.node))},b.prototype={detach:function(){return this.node.parentNode.removeChild(this.node),this.node},teardown:function(a){a&&this.detach()},firstNode:function(){return this.node},toString:function(){return(""+this.descriptor).replace(c,"<").replace(d,">")}},b}(k),nb=function(a){return function(b){if(b.keypath)a(b);else{var c=b.root._pendingResolution.indexOf(b);-1!==c&&b.root._pendingResolution.splice(c,1)}}}(R),ob=function(a,b,c,d,e){function f(a,b,d){var e,f,g;if(!h.test(a.toString()))return c(a,"_nowrap",{value:!0}),a;if(!a["_"+b._guid]){c(a,"_"+b._guid,{value:function(){var c,d,e,g;if(c=b._captured,c||(b._captured=[]),d=a.apply(b,arguments),b._captured.length)for(e=f.length;e--;)g=f[e],g.updateSoftDependencies(b._captured);return b._captured=c,d},writable:!0});for(e in a)a.hasOwnProperty(e)&&(a["_"+b._guid][e]=a[e]);a["_"+b._guid+"_evaluators"]=[]}return f=a["_"+b._guid+"_evaluators"],g=f.indexOf(d),-1===g&&f.push(d),a["_"+b._guid]}var g,h;return h=/this/,g=function(b,c,e,g,h){var i;this.evaluator=e,this.keypath=c,this.root=b,this.argNum=g,this.type=a.REFERENCE,this.priority=h,i=b.get(c),"function"==typeof i&&(i=f(i,b,e)),this.value=e.values[g]=i,d(this)},g.prototype={update:function(){var a=this.root.get(this.keypath);"function"!=typeof a||a._nowrap||(a=f(a,this.root,this.evaluator)),b(a,this.value)||(this.evaluator.values[this.argNum]=a,this.evaluator.bubble(),this.value=a)},teardown:function(){e(this)}},g}(k,x,g,Q,R),pb=function(a,b,c){var d=function(a,c,d){this.root=a,this.keypath=c,this.priority=d.priority,this.evaluator=d,b(this)};return d.prototype={update:function(){var b=this.root.get(this.keypath);a(b,this.value)||(this.evaluator.bubble(),this.value=b)},teardown:function(){c(this)}},d}(x,Q,R),qb=function(a,b,c,d,e,f,g,h,i){function j(a,b){var c,d;if(a=a.replace(/\$\{([0-9]+)\}/g,"_$1"),l[a])return l[a];for(d=[];b--;)d[b]="_"+b;return c=new Function(d.join(","),"return("+a+")"),l[a]=c,c}var k,l={};return k=function(a,b,c,d,e){var f,g;for(this.root=a,this.keypath=b,this.priority=e,this.fn=j(c,d.length),this.values=[],this.refs=[],f=d.length;f--;)(g=d[f])?g[0]?this.values[f]=g[1]:this.refs[this.refs.length]=new h(a,g[1],this,f,e):this.values[f]=void 0;this.selfUpdating=this.refs.length<=1,this.update()},k.prototype={bubble:function(){this.selfUpdating?this.update():this.deferred||(this.root._deferred.evals.push(this),this.deferred=!0)},update:function(){var b;if(this.evaluating)return this;this.evaluating=!0;try{b=this.fn.apply(null,this.values)}catch(e){if(this.root.debug)throw e;b=void 0}return a(b,this.value)||(c(this.root,this.keypath),this.root._cache[this.keypath]=b,g(this.root,this.keypath,b,!0),this.value=b,d(this.root,this.keypath)),this.evaluating=!1,this},teardown:function(){for(;this.refs.length;)this.refs.pop().teardown();c(this.root,this.keypath),this.root._evaluators[this.keypath]=null},refresh:function(){this.selfUpdating||(this.deferred=!0);for(var a=this.refs.length;a--;)this.refs[a].update();this.deferred&&(this.update(),this.deferred=!1)},updateSoftDependencies:function(a){var b,c,d;for(this.softRefs||(this.softRefs=[]),b=this.softRefs.length;b--;)d=this.softRefs[b],a[d.keypath]||(this.softRefs.splice(b,1),this.softRefs[d.keypath]=!1,d.teardown());for(b=a.length;b--;)c=a[b],this.softRefs[c]||(d=new i(this.root,c,this),this.softRefs[this.softRefs.length]=d,this.softRefs[c]=!0);this.selfUpdating=this.refs.length+this.softRefs.length<=1}},k}(x,g,m,r,Q,R,u,ob,pb),rb=function(a,b){var c=function(b,c,d,e){var f,g;g=this.root=b.root,f=a(g,c,d),void 0!==f?b.resolveRef(e,!1,f):(this.ref=c,this.argNum=e,this.resolver=b,this.contextStack=d,g._pendingResolution[g._pendingResolution.length]=this)};return c.prototype={resolve:function(a){this.keypath=a,this.resolver.resolveRef(this.argNum,!1,a)},teardown:function(){this.keypath||b(this)}},c}(y,nb),sb=function(){var a=/^(?:(?:[a-zA-Z$_][a-zA-Z$_0-9]*)|(?:[0-9]|[1-9][0-9]+))$/;return function(b){var c,d,e;for(c=b.split("."),e=c.length;e--;)if(d=c[e],"undefined"===d||!a.test(d))return!1;return!0}}(),tb=function(a,b){return function(c,d){var e,f;return e=c.replace(/\$\{([0-9]+)\}/g,function(a,b){return d[b]?d[b][1]:"undefined"}),f=a(e),b(f)?f:"${"+e.replace(/[\.\[\]]/g,"-")+"}"}}(i,sb),ub=function(a,b){function c(a,b,c){var e,f;if(e=a._depsMap[b])for(f=e.length;f--;)d(a,e[f],c)}function d(a,b,d){var e,f,g,h;for(e=a._deps.length;e--;)if(f=a._deps[e],f&&(g=f[b]))for(h=g.length;h--;)d.push(g[h]);c(a,b,d)}return function(c,e,f){var g,h,i;for(g=[],d(c,e,g),h=g.length;h--;)i=g[h],b(i),i.keypath=i.keypath.replace(e,f),a(i),i.update()}}(Q,R),vb=function(a,b,c,d){var e=function(a){var c,d,e,f,g;if(this.root=a.root,this.mustache=a,this.args=[],this.scouts=[],c=a.descriptor.x,g=a.parentFragment.indexRefs,this.str=c.s,e=this.unresolved=this.args.length=c.r?c.r.length:0,!e)return this.resolved=this.ready=!0,this.bubble(),void 0;for(d=0;e>d;d+=1)f=c.r[d],g&&void 0!==g[f]?this.resolveRef(d,!0,g[f]):this.scouts[this.scouts.length]=new b(this,f,a.contextStack,d);this.ready=!0,this.bubble()};return e.prototype={bubble:function(){var a;this.ready&&(a=this.keypath,this.keypath=c(this.str,this.args),"${"===this.keypath.substr(0,2)&&this.createEvaluator(),a?d(this.root,a,this.keypath):this.mustache.resolve(this.keypath))},teardown:function(){for(;this.scouts.length;)this.scouts.pop().teardown()},resolveRef:function(a,b,c){this.args[a]=[b,c],this.bubble(),this.resolved=!--this.unresolved},createEvaluator:function(){this.root._evaluators[this.keypath]?this.root._evaluators[this.keypath].refresh():this.root._evaluators[this.keypath]=new a(this.root,this.keypath,this.str,this.args,this.mustache.priority)}},e}(qb,rb,tb,ub),wb=function(a,b){return function(c,d){var e,f,g;g=c.parentFragment=d.parentFragment,c.root=g.root,c.contextStack=g.contextStack,c.descriptor=d.descriptor,c.index=d.index||0,c.priority=g.priority,c.type=d.descriptor.t,d.descriptor.r&&(g.indexRefs&&void 0!==g.indexRefs[d.descriptor.r]?(f=g.indexRefs[d.descriptor.r],c.indexRef=d.descriptor.r,c.value=f,c.render(c.value)):(e=a(c.root,d.descriptor.r,c.contextStack),void 0!==e?c.resolve(e):(c.ref=d.descriptor.r,c.root._pendingResolution[c.root._pendingResolution.length]=c))),d.descriptor.x&&(c.expressionResolver=new b(c)),c.descriptor.n&&!c.hasOwnProperty("value")&&c.render(void 0)
}}(y,vb),xb=function(a,b,c){return function(d){d!==this.keypath&&(this.registered&&c(this),this.keypath=d,b(this),this.update(),this.root.twoway&&this.parentFragment.owner.type===a.ATTRIBUTE&&this.parentFragment.owner.element.bind(),this.expressionResolver&&this.expressionResolver.resolved&&(this.expressionResolver=null))}}(k,Q,R),yb=function(a){return function(){var b,c;c=this.root.get(this.keypath),(b=this.root._wrapped[this.keypath])&&(c=b.get()),a(c,this.value)||(this.render(c),this.value=c)}}(x),zb=function(a,b,c,d,e){var f,g,h;return g=/</g,h=/>/g,f=function(b,d){this.type=a.INTERPOLATOR,d&&(this.node=document.createTextNode(""),d.appendChild(this.node)),c(this,b)},f.prototype={update:e,resolve:d,detach:function(){return this.node.parentNode.removeChild(this.node),this.node},teardown:function(a){a&&this.detach(),b(this)},render:function(a){this.node&&(this.node.data=void 0==a?"":a)},firstNode:function(){return this.node},toString:function(){var a=void 0!=this.value?""+this.value:"";return a.replace(g,"<").replace(h,">")}},f}(k,nb,wb,xb,yb),Ab=function(a,b,c){function d(a,b,c){var d,e,f;if(e=b.length,e<a.length)for(f=a.fragments.splice(e,a.length-e);f.length;)f.pop().teardown(!0);else if(e>a.length)for(d=a.length;e>d;d+=1)c.contextStack=a.contextStack.concat(a.keypath+"."+d),c.index=d,a.descriptor.i&&(c.indexRef=a.descriptor.i),a.fragments[d]=a.createFragment(c);a.length=e}function e(a,b,d){var e,f;f=a.fragmentsById||(a.fragmentsById=c(null));for(e in f)void 0===b[e]&&f[e]&&(f[e].teardown(!0),f[e]=null);for(e in b)void 0===b[e]||f[e]||(d.contextStack=a.contextStack.concat(a.keypath+"."+e),d.index=e,a.descriptor.i&&(d.indexRef=a.descriptor.i),f[e]=a.createFragment(d))}function f(a,b){a.length||(b.contextStack=a.contextStack.concat(a.keypath),b.index=0,a.fragments[0]=a.createFragment(b),a.length=1)}function g(b,c,d,e){var f,g,h,i;if(g=a(c)&&0===c.length,f=d?g||!c:c&&!g){if(b.length||(e.contextStack=b.contextStack,e.index=0,b.fragments[0]=b.createFragment(e),b.length=1),b.length>1)for(h=b.fragments.splice(1);i=h.pop();)i.teardown(!0)}else b.length&&(b.teardownFragments(!0),b.length=0)}return function(c,h){var i;return i={descriptor:c.descriptor.f,root:c.root,pNode:c.parentFragment.pNode,owner:c},c.descriptor.n?(g(c,h,!0,i),void 0):(a(h)?d(c,h,i):b(h)?c.descriptor.i?e(c,h,i):f(c,i):g(c,h,!1,i),void 0)}}(l,w,c),Bb=function(a,b,c){function d(b,c,g,h,i,j,k){var l,m,n,o;if(!b.html){for(b.indexRefs&&void 0!==b.indexRefs[c]&&(b.indexRefs[c]=h),l=b.contextStack.length;l--;)n=b.contextStack[l],n.substr(0,j.length)===j&&(b.contextStack[l]=n.replace(j,k));for(l=b.items.length;l--;)switch(m=b.items[l],m.type){case a.ELEMENT:e(m,c,g,h,i,j,k);break;case a.PARTIAL:d(m.fragment,c,g,h,i,j,k);break;case a.COMPONENT:d(m.instance.fragment,c,g,h,i,j,k),(o=b.root._liveComponentQueries[m.name])&&o._makeDirty();break;case a.SECTION:case a.INTERPOLATOR:case a.TRIPLE:f(m,c,g,h,i,j,k)}}}function e(a,b,c,e,f,g,h){var i,j,k,l,m,n,o,p,q,r;for(i=a.attributes.length;i--;)j=a.attributes[i],j.fragment&&(d(j.fragment,b,c,e,f,g,h),j.twoway&&j.updateBindings());if(k=a.node._ractive){k.keypath.substr(0,g.length)===g&&(k.keypath=k.keypath.replace(g,h)),void 0!==b&&(k.index[b]=e);for(l in k.events)for(m=k.events[l].proxies,i=m.length;i--;)n=m[i],"object"==typeof n.n&&d(n.a,b,c,e,f,g,h),n.d&&d(n.d,b,c,e,f,g,h);(o=k.binding)&&o.keypath.substr(0,g.length)===g&&(p=k.root._twowayBindings[o.keypath],p.splice(p.indexOf(o),1),o.keypath=o.keypath.replace(g,h),p=k.root._twowayBindings[o.keypath]||(k.root._twowayBindings[o.keypath]=[]),p.push(o))}if(a.fragment&&d(a.fragment,b,c,e,f,g,h),q=a.liveQueries)for(r=a.root,i=q.length;i--;)r._liveQueries[q[i]]._makeDirty()}function f(a,b,e,f,g,h,i){var j;if(a.descriptor.x&&(a.expressionResolver&&a.expressionResolver.teardown(),a.expressionResolver=new c(a)),a.keypath?a.keypath.substr(0,h.length)===h&&a.resolve(a.keypath.replace(h,i)):a.indexRef===b&&(a.value=f,a.render(f)),a.fragments)for(j=a.fragments.length;j--;)d(a.fragments[j],b,e,f,g,h,i)}return d}(k,R,vb),Cb=function(a,b,c){return function(a,d,e,f,g){var h,i,j,k,l,m,n;for(j=d.descriptor.i,h=e;f>h;h+=1)i=d.fragments[h],k=h-g,l=h,m=d.keypath+"."+(h-g),n=d.keypath+"."+h,i.index+=g,b(i,j,k,l,g,m,n);c(a)}}(k,Bb,o),Db=function(a){return function(b){var c,d,e,f,g,h,i,j,k,l,m=this;if(c=this.parentFragment,h=[],b.forEach(function(b,c){var f,g,j;return b===c?(h[b]=m.fragments[c],void 0):(void 0===d&&(d=c),-1===b?((i||(i=[])).push(m.fragments[c]),void 0):(f=b-c,g=m.keypath+"."+c,j=m.keypath+"."+b,a(m.fragments[c],m.descriptor.i,c,b,f,g,j),h[b]=m.fragments[c],e=!0,void 0))}),i)for(;k=i.pop();)k.teardown(!0);if(void 0===d&&(d=this.length),g=this.root.get(this.keypath).length,g!==d){for(j={descriptor:this.descriptor.f,root:this.root,pNode:c.pNode,owner:this},this.descriptor.i&&(j.indexRef=this.descriptor.i),f=d;g>f;f+=1)(k=h[f])?this.docFrag.appendChild(k.detach(!1)):(j.contextStack=this.contextStack.concat(this.keypath+"."+f),j.index=f,k=this.createFragment(j)),this.fragments[f]=k;l=c.findNextNode(this),c.pNode.insertBefore(this.docFrag,l),this.length=g}}}(Bb),Eb=function(){return[]}(),Fb=function(a,b,c,d,e,f,g,h,i,j,k){var l,m;return k.push(function(){m=k.DomFragment}),l=function(b,d){this.type=a.SECTION,this.inverted=!!b.descriptor.n,this.fragments=[],this.length=0,d&&(this.docFrag=document.createDocumentFragment()),this.initialising=!0,c(this,b),d&&d.appendChild(this.docFrag),this.initialising=!1},l.prototype={update:d,resolve:e,smartUpdate:function(a,b){var c;("push"===a||"unshift"===a||"splice"===a)&&(c={descriptor:this.descriptor.f,root:this.root,pNode:this.parentFragment.pNode,owner:this},this.descriptor.i&&(c.indexRef=this.descriptor.i)),this[a]&&(this.rendering=!0,this[a](c,b),this.rendering=!1)},pop:function(){this.length&&(this.fragments.pop().teardown(!0),this.length-=1)},push:function(a,b){var c,d,e;for(c=this.length,d=c+b.length,e=c;d>e;e+=1)a.contextStack=this.contextStack.concat(this.keypath+"."+e),a.index=e,this.fragments[e]=this.createFragment(a);this.length+=b.length,this.parentFragment.pNode.insertBefore(this.docFrag,this.parentFragment.findNextNode(this))},shift:function(){this.splice(null,[0,1])},unshift:function(a,b){this.splice(a,[0,0].concat(new Array(b.length)))},splice:function(a,b){var c,d,e,f,g,i,j,k,l;if(b.length&&(i=+(b[0]<0?this.length+b[0]:b[0]),d=Math.max(0,b.length-2),e=void 0!==b[1]?b[1]:this.length-i,e=Math.min(e,this.length-i),f=d-e)){if(0>f){for(j=i-f,g=i;j>g;g+=1)this.fragments[g].teardown(!0);this.fragments.splice(i,-f)}else{for(j=i+f,c=this.fragments[i]?this.fragments[i].firstNode():this.parentFragment.findNextNode(this),k=[i,0].concat(new Array(f)),this.fragments.splice.apply(this.fragments,k),g=i;j>g;g+=1)a.contextStack=this.contextStack.concat(this.keypath+"."+g),a.index=g,this.fragments[g]=this.createFragment(a);this.parentFragment.pNode.insertBefore(this.docFrag,c)}this.length+=f,l=i+d,h(this.root,this,l,this.length,f)}},merge:i,detach:function(){var a,b;for(b=this.fragments.length,a=0;b>a;a+=1)this.docFrag.appendChild(this.fragments[a].detach());return this.docFrag},teardown:function(a){this.teardownFragments(a),j(this)},firstNode:function(){return this.fragments[0]?this.fragments[0].firstNode():this.parentFragment.findNextNode(this)},findNextNode:function(a){return this.fragments[a.index+1]?this.fragments[a.index+1].firstNode():this.parentFragment.findNextNode(this)},teardownFragments:function(a){for(var b,c;c=this.fragments.shift();)c.teardown(a);if(this.fragmentsById)for(b in this.fragmentsById)this.fragments[b]&&(this.fragmentsById[b].teardown(a),this.fragmentsById[b]=null)},render:function(a){var c,d;(d=this.root._wrapped[this.keypath])&&(a=d.get()),this.rendering||(this.rendering=!0,f(this,a),this.rendering=!1,(!this.docFrag||this.docFrag.childNodes.length)&&!this.initialising&&b&&(c=this.parentFragment.findNextNode(this),c&&c.parentNode===this.parentFragment.pNode?this.parentFragment.pNode.insertBefore(this.docFrag,c):this.parentFragment.pNode.appendChild(this.docFrag)))},createFragment:function(a){var b=new m(a);return this.docFrag&&this.docFrag.appendChild(b.docFrag),b},toString:function(){var a,b,c,d;for(a="",b=0,d=this.length,b=0;d>b;b+=1)a+=this.fragments[b].toString();if(this.fragmentsById)for(c in this.fragmentsById)this.fragmentsById[c]&&(a+=this.fragmentsById[c].toString());return a},find:function(a){var b,c,d;for(c=this.fragments.length,b=0;c>b;b+=1)if(d=this.fragments[b].find(a))return d;return null},findAll:function(a,b){var c,d;for(d=this.fragments.length,c=0;d>c;c+=1)this.fragments[c].findAll(a,b)},findComponent:function(a){var b,c,d;for(c=this.fragments.length,b=0;c>b;b+=1)if(d=this.fragments[b].findComponent(a))return d;return null},findAllComponents:function(a,b){var c,d;for(d=this.fragments.length,c=0;d>c;c+=1)this.fragments[c].findAllComponents(a,b)}},l}(k,f,wb,yb,xb,Ab,Bb,Cb,Db,nb,Eb),Gb=function(a,b,c,d,e,f,g){var h=function(b,d){this.type=a.TRIPLE,d&&(this.nodes=[],this.docFrag=document.createDocumentFragment()),this.initialising=!0,c(this,b),d&&d.appendChild(this.docFrag),this.initialising=!1};return h.prototype={update:d,resolve:e,detach:function(){for(var a=this.nodes.length;a--;)this.docFrag.appendChild(this.nodes[a]);return this.docFrag},teardown:function(a){a&&(this.detach(),this.docFrag=this.nodes=null),g(this)},firstNode:function(){return this.nodes[0]?this.nodes[0]:this.parentFragment.findNextNode(this)},render:function(a){var b,c;if(this.nodes){for(;this.nodes.length;)b=this.nodes.pop(),b.parentNode.removeChild(b);if(!a)return this.nodes=[],void 0;c=this.parentFragment.pNode,this.nodes=f(a,c.tagName,this.docFrag),this.initialising||c.insertBefore(this.docFrag,this.parentFragment.findNextNode(this))}},toString:function(){return void 0!=this.value?this.value:""},find:function(a){var c,d,e,f;for(d=this.nodes.length,c=0;d>c;c+=1)if(e=this.nodes[c],1===e.nodeType){if(b(e,a))return e;if(f=e.querySelector(a))return f}return null},findAll:function(a,c){var d,e,f,g,h,i;for(e=this.nodes.length,d=0;e>d;d+=1)if(f=this.nodes[d],1===f.nodeType&&(b(f,a)&&c.push(f),g=f.querySelectorAll(a)))for(h=g.length,i=0;h>i;i+=1)c.push(g[i])}},h}(k,Z,wb,yb,xb,lb,nb),Hb=function(a){return function(b,c){return b.a&&b.a.xmlns?b.a.xmlns:"svg"===b.e?a.svg:c.namespaceURI||a.html}}(d),Ib=function(){var a,b,c,d;return a="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(" "),b="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(" "),c=function(a){for(var b={},c=a.length;c--;)b[a[c].toLowerCase()]=a[c];return b},d=c(a.concat(b)),function(a){var b=a.toLowerCase();return d[b]||b}}(),Jb=function(a,b){return function(c,d){var e,f;if(e=d.indexOf(":"),-1===e||(f=d.substr(0,e),"xmlns"===f))c.name=c.element.namespace!==a.html?b(d):d,c.lcName=c.name.toLowerCase();else if(d=d.substring(e+1),c.name=b(d),c.lcName=c.name.toLowerCase(),c.namespace=a[f.toLowerCase()],!c.namespace)throw'Unknown namespace ("'+f+'")'}}(d,Ib),Kb=function(a){return function(b,c){var d,e=null===c.value?"":c.value;(d=c.pNode)&&(b.namespace?d.setAttributeNS(b.namespace,c.name,e):"style"===c.name&&d.style.setAttribute?d.style.setAttribute("cssText",e):"class"!==c.name||d.namespaceURI&&d.namespaceURI!==a.html?d.setAttribute(c.name,e):d.className=e,"id"===b.name&&(c.root.nodes[c.value]=d),"value"===b.name&&(d._ractive.value=c.value)),b.value=c.value}}(d),Lb=function(a){var b={"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"};return function(c,d){var e;!c.pNode||c.namespace||d.pNode.namespaceURI&&d.pNode.namespaceURI!==a.html||(e=b[c.name]||c.name,void 0!==d.pNode[e]&&(c.propertyName=e),("boolean"==typeof d.pNode[e]||"value"===e)&&(c.useProperty=!0))}}(d),Mb=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r;return e=function(){var a,b,c,d=this.pNode;return this.fragment?(a=f(this))?(this.interpolator=a,this.keypath=a.keypath||a.descriptor.r,(b=i(this))?(d._ractive.binding=this.element.binding=b,this.twoway=!0,c=this.root._twowayBindings[this.keypath]||(this.root._twowayBindings[this.keypath]=[]),c[c.length]=b,!0):!1):!1:!1},g=function(){this._ractive.binding.update()},h=function(){var a=this._ractive.root.get(this._ractive.binding.keypath);this.value=void 0==a?"":a},f=function(c){var d,e;return 1!==c.fragment.items.length?null:(d=c.fragment.items[0],d.type!==a.INTERPOLATOR?null:d.keypath||d.ref?d.keypath&&"${"===d.keypath.substr(0,2)?(e="You cannot set up two-way binding against an expression "+d.keypath,c.root.debug&&b(e),null):d:null)},i=function(a){var c=a.pNode;if("SELECT"===c.tagName)return c.multiple?new k(a,c):new l(a,c);if("checkbox"===c.type||"radio"===c.type){if("name"===a.propertyName){if("checkbox"===c.type)return new n(a,c);if("radio"===c.type)return new m(a,c)}return"checked"===a.propertyName?new o(a,c):null}return"value"!==a.lcName&&b("This is... odd"),"file"===c.type?new p(a,c):c.getAttribute("contenteditable")?new q(a,c):new r(a,c)},k=function(a,b){var c;j(this,a,b),b.addEventListener("change",g,!1),c=this.root.get(this.keypath),void 0===c&&this.update()},k.prototype={value:function(){var a,b,c,d;for(a=[],b=this.node.options,d=b.length,c=0;d>c;c+=1)b[c].selected&&(a[a.length]=b[c]._ractive.value);return a},update:function(){var a,b,d;return a=this.attr,b=a.value,d=this.value(),void 0!==b&&c(d,b)||(a.receiving=!0,a.value=d,this.root.set(this.keypath,d),a.receiving=!1),this},deferUpdate:function(){this.deferred!==!0&&(this.root._deferred.attrs.push(this),this.deferred=!0)},teardown:function(){this.node.removeEventListener("change",g,!1)}},l=function(a,b){var c;j(this,a,b),b.addEventListener("change",g,!1),c=this.root.get(this.keypath),void 0===c&&this.update()},l.prototype={value:function(){var a,b,c;for(a=this.node.options,c=a.length,b=0;c>b;b+=1)if(a[b].selected)return a[b]._ractive.value},update:function(){var a=this.value();return this.attr.receiving=!0,this.attr.value=a,this.root.set(this.keypath,a),this.attr.receiving=!1,this},deferUpdate:function(){this.deferred!==!0&&(this.root._deferred.attrs.push(this),this.deferred=!0)},teardown:function(){this.node.removeEventListener("change",g,!1)}},m=function(a,b){var c;this.radioName=!0,j(this,a,b),b.name="{{"+a.keypath+"}}",b.addEventListener("change",g,!1),b.attachEvent&&b.addEventListener("click",g,!1),c=this.root.get(this.keypath),void 0!==c?b.checked=c==b._ractive.value:this.root._deferred.radios.push(this)},m.prototype={value:function(){return this.node._ractive?this.node._ractive.value:this.node.value},update:function(){var a=this.node;a.checked&&(this.attr.receiving=!0,this.root.set(this.keypath,this.value()),this.attr.receiving=!1)},teardown:function(){this.node.removeEventListener("change",g,!1),this.node.removeEventListener("click",g,!1)}},n=function(a,b){var c,d;this.checkboxName=!0,j(this,a,b),b.name="{{"+this.keypath+"}}",b.addEventListener("change",g,!1),b.attachEvent&&b.addEventListener("click",g,!1),c=this.root.get(this.keypath),void 0!==c?(d=-1!==c.indexOf(b._ractive.value),b.checked=d):-1===this.root._deferred.checkboxes.indexOf(this.keypath)&&this.root._deferred.checkboxes.push(this.keypath)},n.prototype={changed:function(){return this.node.checked!==!!this.checked},update:function(){this.checked=this.node.checked,this.attr.receiving=!0,this.root.set(this.keypath,d(this.root,this.keypath)),this.attr.receiving=!1},teardown:function(){this.node.removeEventListener("change",g,!1),this.node.removeEventListener("click",g,!1)}},o=function(a,b){j(this,a,b),b.addEventListener("change",g,!1),b.attachEvent&&b.addEventListener("click",g,!1)},o.prototype={value:function(){return this.node.checked},update:function(){this.attr.receiving=!0,this.root.set(this.keypath,this.value()),this.attr.receiving=!1},teardown:function(){this.node.removeEventListener("change",g,!1),this.node.removeEventListener("click",g,!1)}},p=function(a,b){j(this,a,b),b.addEventListener("change",g,!1)},p.prototype={value:function(){return this.attr.pNode.files},update:function(){this.attr.root.set(this.attr.keypath,this.value())},teardown:function(){this.node.removeEventListener("change",g,!1)}},q=function(a,b){j(this,a,b),b.addEventListener("change",g,!1),this.root.lazy||(b.addEventListener("input",g,!1),b.attachEvent&&b.addEventListener("keyup",g,!1))},q.prototype={update:function(){this.attr.receiving=!0,this.root.set(this.keypath,this.node.innerHTML),this.attr.receiving=!1},teardown:function(){this.node.removeEventListener("change",g,!1),this.node.removeEventListener("input",g,!1),this.node.removeEventListener("keyup",g,!1)}},r=function(a,b){j(this,a,b),b.addEventListener("change",g,!1),this.root.lazy||(b.addEventListener("input",g,!1),b.attachEvent&&b.addEventListener("keyup",g,!1)),this.node.addEventListener("blur",h,!1)},r.prototype={value:function(){var a=this.attr.pNode.value;return+a+""===a&&-1===a.indexOf("e")&&(a=+a),a},update:function(){var a=this.attr,b=this.value();a.receiving=!0,a.root.set(a.keypath,b),a.receiving=!1},teardown:function(){this.node.removeEventListener("change",g,!1),this.node.removeEventListener("input",g,!1),this.node.removeEventListener("keyup",g,!1),this.node.removeEventListener("blur",h,!1)}},j=function(a,b,c){a.attr=b,a.node=c,a.root=b.root,a.keypath=b.keypath},e}(k,I,E,n),Nb=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n;return c=function(){var a;if(!this.ready)return this;if(a=this.pNode,"SELECT"===a.tagName&&"value"===this.lcName)return this.update=e,this.deferredUpdate=f,this.update();if(this.isFileInputValue)return this.update=d,this;if(this.twoway&&"name"===this.lcName){if("radio"===a.type)return this.update=i,this.update();if("checkbox"===a.type)return this.update=j,this.update()}return"style"===this.lcName&&a.style.setAttribute?(this.update=k,this.update()):"class"!==this.lcName||a.namespaceURI&&a.namespaceURI!==b.html?a.getAttribute("contenteditable")&&"value"===this.lcName?(this.update=m,this.update()):(this.update=n,this.update()):(this.update=l,this.update())},d=function(){return this},f=function(){this.deferredUpdate=this.pNode.multiple?h:g,this.deferredUpdate()},e=function(){return this.root._deferred.selectValues.push(this),this},g=function(){var a,b,c,d=this.fragment.getValue();for(this.value=this.pNode._ractive.value=d,a=this.pNode.options,c=a.length;c--;)if(b=a[c],b._ractive.value==d)return b.selected=!0,this;return this},h=function(){var b,c,d=this.fragment.getValue();for(a(d)||(d=[d]),b=this.pNode.options,c=b.length;c--;)b[c].selected=-1!==d.indexOf(b[c]._ractive.value);return this.value=d,this},i=function(){var a,b;return a=this.pNode,b=this.fragment.getValue(),a.checked=b==a._ractive.value,this},j=function(){var b,c;return b=this.pNode,c=this.fragment.getValue(),a(c)?(b.checked=-1!==c.indexOf(b._ractive.value),this):(b.checked=c==b._ractive.value,this)},k=function(){var a,b;return a=this.pNode,b=this.fragment.getValue(),void 0===b&&(b=""),b!==this.value&&(a.style.setAttribute("cssText",b),this.value=b),this},l=function(){var a,b;return a=this.pNode,b=this.fragment.getValue(),void 0===b&&(b=""),b!==this.value&&(a.className=b,this.value=b),this},m=function(){var a,b;return a=this.pNode,b=this.fragment.getValue(),void 0===b&&(b=""),b!==this.value&&(this.receiving||(a.innerHTML=b),this.value=b),this},n=function(){var a,b;if(a=this.pNode,b=this.fragment.getValue(),this.isValueAttribute&&(a._ractive.value=b),void 0===b&&(b=""),b!==this.value){if(this.useProperty)return this.receiving||(a[this.propertyName]=b),this.value=b,this;if(this.namespace)return a.setAttributeNS(this.namespace,this.name,b),this.value=b,this;"id"===this.lcName&&(void 0!==this.value&&(this.root.nodes[this.value]=void 0),this.root.nodes[b]=a),a.setAttribute(this.name,b),this.value=b}return this},c}(l,d),Ob=function(){return function(a){var b;return b=this.str.substr(this.pos,a.length),b===a?(this.pos+=a.length,a):null}}(),Pb=function(){var a=/^\s+/;return function(){var b=a.exec(this.remaining());return b?(this.pos+=b[0].length,b[0]):null}}(),Qb=function(){return function(a){return function(b){var c=a.exec(b.str.substring(b.pos));return c?(b.pos+=c[0].length,c[1]||c[0]):null}}}(),Rb=function(){function a(a){var b;return a.getStringMatch("\\")?(b=a.str.charAt(a.pos),a.pos+=1,b):null}return function(b){var c,d="";for(c=a(b);c;)d+=c,c=a(b);return d||null}}(),Sb=function(a,b){var c=a(/^[^\\"]+/),d=a(/^[^\\']+/);return function e(a,f){var g,h,i,j,k,l;if(g=a.pos,h="",l=f?d:c,i=b(a),i&&(h+=i),j=l(a),j&&(h+=j),!h)return"";for(k=e(a,f);""!==k;)h+=k;return h}}(Qb,Rb),Tb=function(a,b){return function(c){var d,e;return d=c.pos,c.getStringMatch('"')?(e=b(c,!1),c.getStringMatch('"')?{t:a.STRING_LITERAL,v:e}:(c.pos=d,null)):c.getStringMatch("'")?(e=b(c,!0),c.getStringMatch("'")?{t:a.STRING_LITERAL,v:e}:(c.pos=d,null)):null}}(k,Sb),Ub=function(a,b){var c=b(/^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/);return function(b){var d;return(d=c(b))?{t:a.NUMBER_LITERAL,v:d}:null}}(k,Qb),Vb=function(a){return a(/^[a-zA-Z_$][a-zA-Z_$0-9]*/)}(Qb),Wb=function(a,b,c){var d=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;return function(e){var f;return(f=a(e))?d.test(f.v)?f.v:'"'+f.v.replace(/"/g,'\\"')+'"':(f=b(e))?f.v:(f=c(e))?f:void 0}}(Tb,Ub,Vb),Xb=function(a,b,c,d){function e(a){var b,c,e;return a.allowWhitespace(),(b=d(a))?(e={key:b},a.allowWhitespace(),a.getStringMatch(":")?(a.allowWhitespace(),(c=a.getToken())?(e.value=c.v,e):null):null):null}var f,g,h,i,j,k;return g={"true":!0,"false":!1,undefined:void 0,"null":null},h=new RegExp("^(?:"+Object.keys(g).join("|")+")"),i=/^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/,j=/\$\{([^\}]+)\}/g,k=/^\$\{([^\}]+)\}/,f=function(a,b){this.str=a,this.values=b,this.pos=0,this.result=this.getToken()},f.prototype={remaining:function(){return this.str.substring(this.pos)},getStringMatch:a,getToken:function(){return this.allowWhitespace(),this.getPlaceholder()||this.getSpecial()||this.getNumber()||this.getString()||this.getObject()||this.getArray()},getPlaceholder:function(){var a;return this.values?(a=k.exec(this.remaining()))&&this.values.hasOwnProperty(a[1])?(this.pos+=a[0].length,{v:this.values[a[1]]}):void 0:null},getSpecial:function(){var a;return(a=h.exec(this.remaining()))?(this.pos+=a[0].length,{v:g[a[0]]}):void 0},getNumber:function(){var a;return(a=i.exec(this.remaining()))?(this.pos+=a[0].length,{v:+a[0]}):void 0},getString:function(){var a,b=c(this);return b&&(a=this.values)?{v:b.v.replace(j,function(b,c){return a[c]||c})}:b},getObject:function(){var a,b;if(!this.getStringMatch("{"))return null;for(a={};b=e(this);){if(a[b.key]=b.value,this.allowWhitespace(),this.getStringMatch("}"))return{v:a};if(!this.getStringMatch(","))return null}return null},getArray:function(){var a,b;if(!this.getStringMatch("["))return null;for(a=[];b=this.getToken();){if(a.push(b.v),this.getStringMatch("]"))return{v:a};if(!this.getStringMatch(","))return null}return null},allowWhitespace:b},function(a,b){var c=new f(a,b);return c.result?{value:c.result.v,remaining:c.remaining()}:null}}(Ob,Pb,Tb,Wb),Yb=function(a,b,c,d,e){function f(a){return"string"==typeof a?a:JSON.stringify(a)}var g=function(b){this.type=a.INTERPOLATOR,c(this,b)};return g.prototype={update:d,resolve:e,render:function(a){this.value=a,this.parentFragment.bubble()},teardown:function(){b(this)},toString:function(){return void 0==this.value?"":f(this.value)}},g}(k,nb,wb,yb,xb),Zb=function(a,b,c,d,e,f,g){var h,i;return g.push(function(){i=g.StringFragment}),h=function(c){this.type=a.SECTION,this.fragments=[],this.length=0,b(this,c)},h.prototype={update:c,resolve:d,teardown:function(){this.teardownFragments(),f(this)},teardownFragments:function(){for(;this.fragments.length;)this.fragments.shift().teardown();this.length=0},bubble:function(){this.value=this.fragments.join(""),this.parentFragment.bubble()},render:function(a){var b;(b=this.root._wrapped[this.keypath])&&(a=b.get()),e(this,a),this.parentFragment.bubble()},createFragment:function(a){return new i(a)},toString:function(){return this.fragments.join("")}},h}(k,wb,yb,xb,Ab,nb,Eb),$b=function(a){var b=function(b){this.type=a.TEXT,this.text=b};return b.prototype={toString:function(){return this.text},teardown:function(){}},b}(k),_b=function(a,b){return function(){var c,d,e,f,g,h,i;if(!this.argsList||this.dirty){if(c={},d=0,f=this.root._guid,i=function(a){return a.map(function(a){var b,e,g;return a.text?a.text:a.fragments?a.fragments.map(function(a){return i(a.items)}).join(""):(b=f+"-"+d++,g=(e=a.root._wrapped[a.keypath])?e.value:a.value,c[b]=g,"${"+b+"}")}).join("")},e=i(this.items),h=b("["+e+"]",c))this.argsList=h.value;else{if(g="Could not parse directive arguments ("+this.toString()+"). If you think this is a bug, please file an issue at http://github.com/RactiveJS/Ractive/issues",this.root.debug)throw new Error(g);a(g),this.argsList=[e]}this.dirty=!1}return this.argsList}}(I,Xb),ac=function(a,b,c,d,e,f,g,h){var i=function(a){c(this,a)};return i.prototype={createItem:function(b){if("string"==typeof b.descriptor)return new f(b.descriptor);switch(b.descriptor.t){case a.INTERPOLATOR:return new d(b);case a.TRIPLE:return new d(b);case a.SECTION:return new e(b);default:throw"Something went wrong in a rather interesting way"}},bubble:function(){this.dirty=!0,this.owner.bubble()},teardown:function(){var a,b;for(a=this.items.length,b=0;a>b;b+=1)this.items[b].teardown()},getValue:function(){var b;return 1===this.items.length&&this.items[0].type===a.INTERPOLATOR&&(b=this.items[0].value,void 0!==b)?b:this.toString()},isSimple:function(){var b,c,d;if(void 0!==this.simple)return this.simple;for(b=this.items.length;b--;)if(c=this.items[b],c.type!==a.TEXT){if(c.type!==a.INTERPOLATOR)return this.simple=!1;if(d)return!1;d=!0}return this.simple=!0},toString:function(){return this.items.join("")},toJSON:function(){var a,c=this.getValue();return"string"==typeof c&&(a=b(c),c=a?a.value:c),c},toArgsList:g},h.StringFragment=i,i}(k,Xb,kb,Yb,Zb,$b,_b,Eb),bc=function(a,b,c,d,e,f,g){var h=function(e){return this.type=a.ATTRIBUTE,this.element=e.element,b(this,e.name),null===e.value||"string"==typeof e.value?(c(this,e),void 0):(this.root=e.root,this.pNode=e.pNode,this.parentFragment=this.element.parentFragment,this.fragment=new g({descriptor:e.value,root:this.root,owner:this,contextStack:e.contextStack}),this.pNode&&("value"===this.name&&(this.isValueAttribute=!0,"INPUT"===this.pNode.tagName&&"file"===this.pNode.type&&(this.isFileInputValue=!0)),d(this,e),this.selfUpdating=this.fragment.isSimple(),this.ready=!0),void 0)};return h.prototype={bind:e,update:f,updateBindings:function(){this.keypath=this.interpolator.keypath||this.interpolator.ref,"name"===this.propertyName&&(this.pNode.name="{{"+this.keypath+"}}")},teardown:function(){var a;if(this.boundEvents)for(a=this.boundEvents.length;a--;)this.pNode.removeEventListener(this.boundEvents[a],this.updateModel,!1);this.fragment&&this.fragment.teardown()},bubble:function(){this.selfUpdating?this.update():!this.deferred&&this.ready&&(this.root._deferred.attrs.push(this),this.deferred=!0)},toString:function(){var a;return null===this.value?this.name:this.fragment?(a=this.fragment.toString(),this.name+"="+JSON.stringify(a)):this.name+"="+JSON.stringify(this.value)}},h}(k,Jb,Kb,Lb,Mb,Nb,ac),cc=function(a){return function(b,c){var d,e,f;b.attributes=[];for(d in c)c.hasOwnProperty(d)&&(e=c[d],f=new a({element:b,name:d,value:e,root:b.root,pNode:b.node,contextStack:b.parentFragment.contextStack}),b.attributes[b.attributes.length]=b.attributes[d]=f,"name"!==d&&f.update());return b.attributes}}(bc),dc=function(a,b,c,d){var e,f,g;return d.push(function(){e=d.DomFragment}),f=function(){var a=this.node,b=this.fragment.toString();a.styleSheet&&(a.styleSheet.cssText=b),a.innerHTML=b},g=function(){this.node.type&&"text/javascript"!==this.node.type||a("Script tag was updated. This does not cause the code to be re-evaluated!"),this.node.innerHTML=this.fragment.toString()},function(a,d,h,i){var j,k,l,m,n;if("script"===a.lcName||"style"===a.lcName)return a.fragment=new c({descriptor:h.f,root:a.root,contextStack:a.parentFragment.contextStack,owner:a}),i&&("script"===a.lcName?(a.bubble=g,a.node.innerHTML=a.fragment.toString()):(a.bubble=f,a.bubble())),void 0;if("string"!=typeof h.f||d&&d.namespaceURI&&d.namespaceURI!==b.html)a.fragment=new e({descriptor:h.f,root:a.root,pNode:d,contextStack:a.parentFragment.contextStack,owner:a}),i&&d.appendChild(a.fragment.docFrag);else if(a.html=h.f,i)for(d.innerHTML=a.html,j=a.root._liveQueries,k=j.length;k--;)if(l=j[k],(m=d.querySelectorAll(l))&&(n=m.length))for((a.liveQueries||(a.liveQueries=[])).push(l),a.liveQueries[l]=[];n--;)a.liveQueries[l][n]=m[n]}}(I,d,ac,Eb),ec=function(a,b){var c=function(c,d,e,f){var g,h,i;if(this.root=d,this.node=e.node,g=c.n||c,"string"!=typeof g&&(h=new b({descriptor:g,root:this.root,owner:e,contextStack:f}),g=h.toString(),h.teardown()),c.a?this.params=c.a:c.d&&(h=new b({descriptor:c.d,root:this.root,owner:e,contextStack:f}),this.params=h.toArgsList(),h.teardown()),this.fn=d.decorators[g],!this.fn){if(i='Missing "'+g+'" decorator. You may need to download a plugin via https://github.com/RactiveJS/Ractive/wiki/Plugins#decorators',d.debug)throw new Error(i);a(i)}};return c.prototype={init:function(){var a,b;if(this.params?(b=[this.node].concat(this.params),a=this.fn.apply(this.root,b)):a=this.fn.call(this.root,this.node),!a||!a.teardown)throw new Error("Decorator definition must return an object with a teardown method");this.teardown=a.teardown}},c}(I,ac),fc=function(a){return function(b,c,d,e){d.decorator=new a(b,c,d,e),d.decorator.fn&&c._deferred.decorators.push(d.decorator)}}(ec),gc=function(a,b){var c,d,e,f,g,h,i,j,k;return c=function(a,b,c,e,f){var g,h;g=a.node._ractive.events,h=g[b]||(g[b]=new d(a,b,e,f)),h.add(c)},d=function(b,c,d){var e;this.element=b,this.root=b.root,this.node=b.node,this.name=c,this.contextStack=d,this.proxies=[],(e=this.root.events[c])?this.custom=e(this.node,k(c)):("on"+c in this.node||a('Missing "'+this.name+'" event. You may need to download a plugin via https://github.com/RactiveJS/Ractive/wiki/Plugins#events'),this.node.addEventListener(c,j,!1))},d.prototype={add:function(a){this.proxies[this.proxies.length]=new e(this.element,this.root,a,this.contextStack)},teardown:function(){var a;for(this.custom?this.custom.teardown():this.node.removeEventListener(this.name,j,!1),a=this.proxies.length;a--;)this.proxies[a].teardown()},fire:function(a){for(var b=this.proxies.length;b--;)this.proxies[b].fire(a)}},e=function(a,c,d,e){var i;return this.root=c,i=d.n||d,this.n="string"==typeof i?i:new b({descriptor:d.n,root:this.root,owner:a,contextStack:e}),d.a?(this.a=d.a,this.fire=g,void 0):d.d?(this.d=new b({descriptor:d.d,root:this.root,owner:a,contextStack:e}),this.fire=h,void 0):(this.fire=f,void 0)
},e.prototype={teardown:function(){this.n.teardown&&this.n.teardown(),this.d&&this.d.teardown()},bubble:function(){}},f=function(a){this.root.fire(this.n.toString(),a)},g=function(a){this.root.fire.apply(this.root,[this.n.toString(),a].concat(this.a))},h=function(a){var b=this.d.toArgsList();"string"==typeof b&&(b=b.substr(1,b.length-2)),this.root.fire.apply(this.root,[this.n.toString(),a].concat(b))},j=function(a){var b=this._ractive;b.events[a.type].fire({node:this,original:a,index:b.index,keypath:b.keypath,context:b.root.get(b.keypath)})},i={},k=function(a){return i[a]?i[a]:i[a]=function(b){var c=b.node._ractive;b.index=c.index,b.keypath=c.keypath,b.context=c.root.get(c.keypath),c.events[a].fire(b)}},c}(I,ac),hc=function(a){return function(b,c){var d,e,f;for(e in c)if(c.hasOwnProperty(e))for(f=e.split("-"),d=f.length;d--;)a(b,f[d],c[e],b.parentFragment.contextStack)}}(gc),ic=function(){return function(a){var b,c,d,e,f;for(b=a.root,c=b._liveQueries,d=c.length;d--;)e=c[d],f=c[e],f._test(a)&&((a.liveQueries||(a.liveQueries=[])).push(e),a.liveQueries[e]=[a.node])}}(),jc=function(){return function(a){return a.replace(/-([a-zA-Z])/g,function(a,b){return b.toUpperCase()})}}(),kc=function(){return function(a,b){var c;for(c in b)b.hasOwnProperty(c)&&!a.hasOwnProperty(c)&&(a[c]=b[c]);return a}}(),lc=function(a,b,c,d,e,f,g,h){function i(a){var b,c,d;if(!q[a])if(void 0!==m[a])q[a]=a;else for(d=a.charAt(0).toUpperCase()+a.substring(1),b=n.length;b--;)if(c=n[b],void 0!==m[c+d]){q[a]=c+d;break}return q[a]}function j(a){return a.replace(p,"")}function k(a){var b;return o.test(a)&&(a="-"+a),b=a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})}var l,m,n,o,p,q,r,s,t,u,v,w;if(a)return m=b("div").style,function(){void 0!==m.transition?(s="transition",w="transitionend",r=!0):void 0!==m.webkitTransition?(s="webkitTransition",w="webkitTransitionEnd",r=!0):r=!1}(),s&&(t=s+"Duration",u=s+"Property",v=s+"TimingFunction"),l=function(a,b,d,e,f){var g,i,j,k=this;if(this.root=b,this.node=d.node,this.isIntro=f,this.originalStyle=this.node.getAttribute("style"),this.complete=function(a){!a&&k.isIntro&&k.resetStyle(),k._manager.pop(k.node),k.node._ractive.transition=null},g=a.n||a,"string"!=typeof g&&(i=new h({descriptor:g,root:this.root,owner:d,contextStack:e}),g=i.toString(),i.teardown()),this.name=g,a.a?this.params=a.a:a.d&&(i=new h({descriptor:a.d,root:this.root,owner:d,contextStack:e}),this.params=i.toArgsList(),i.teardown()),this._fn=b.transitions[g],!this._fn){if(j='Missing "'+g+'" transition. You may need to download a plugin via https://github.com/RactiveJS/Ractive/wiki/Plugins#transitions',b.debug)throw new Error(j);return c(j),void 0}},l.prototype={init:function(){if(this._inited)throw new Error("Cannot initialize a transition more than once");this._inited=!0,this._fn.apply(this.root,[this].concat(this.params))},getStyle:function(a){var b,c,d,f,g;if(b=window.getComputedStyle(this.node),"string"==typeof a)return g=b[i(a)],"0px"===g&&(g=0),g;if(!e(a))throw new Error("Transition#getStyle must be passed a string, or an array of strings representing CSS properties");for(c={},d=a.length;d--;)f=a[d],g=b[i(f)],"0px"===g&&(g=0),c[f]=g;return c},setStyle:function(a,b){var c;if("string"==typeof a)this.node.style[i(a)]=b;else for(c in a)a.hasOwnProperty(c)&&(this.node.style[i(c)]=a[c]);return this},animateStyle:function(a,b,d,e){var g,h,l,m,n,o,p,q,r,s=this;for("string"==typeof a?(n={},n[a]=b):(n=a,e=d,d=b),d||(c('The "'+s.name+'" 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'),d=s,e=s.complete),d.duration||(s.setStyle(n),e&&e()),g=Object.keys(n),h=[],l=window.getComputedStyle(s.node),o={},q=g.length;q--;)r=g[q],m=l[i(r)],"0px"===m&&(m=0),m!=n[r]&&(h[h.length]=r,s.node.style[i(r)]=m);return h.length?(setTimeout(function(){s.node.style[u]=g.map(i).map(k).join(","),s.node.style[v]=k(d.easing||"linear"),s.node.style[t]=d.duration/1e3+"s",p=function(a){var b;b=h.indexOf(f(j(a.propertyName))),-1!==b&&h.splice(b,1),h.length||(s.root.fire(s.name+":end"),s.node.removeEventListener(w,p,!1),e&&e())},s.node.addEventListener(w,p,!1),setTimeout(function(){for(var a=h.length;a--;)r=h[a],s.node.style[i(r)]=n[r]},0)},d.delay||0),void 0):(e&&e(),void 0)},resetStyle:function(){this.originalStyle?this.node.setAttribute("style",this.originalStyle):(this.node.getAttribute("style"),this.node.removeAttribute("style"))},processParams:function(a,b){return"number"==typeof a?a={duration:a}:"string"==typeof a?a="slow"===a?{duration:600}:"fast"===a?{duration:200}:{duration:400}:a||(a={}),g(a,b)}},n=["o","ms","moz","webkit"],o=new RegExp("^(?:"+n.join("|")+")([A-Z])"),p=new RegExp("^-(?:"+n.join("|")+")-"),q={},l}(f,e,I,J,l,jc,kc,ac),mc=function(a,b){return function(a,c,d,e,f){var g,h,i;!c.transitionsEnabled||c._parent&&!c._parent.transitionsEnabled||(g=new b(a,c,d,e,f),g._fn&&(h=g.node,g._manager=c._transitionManager,(i=h._ractive.transition)&&i.complete(),h._ractive.transition=g,g._manager.push(h),f?c._deferred.transitions.push(g):g.init()))}}(I,lc),nc=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){return function(e,p,q){var r,s,t,u,v,w,x,y,z,A,B,C,D;if(e.type=a.ELEMENT,r=e.parentFragment=p.parentFragment,s=r.pNode,t=r.contextStack,u=e.descriptor=p.descriptor,e.root=B=r.root,e.index=p.index,e.lcName=u.e.toLowerCase(),e.eventListeners=[],e.customEventListeners=[],s&&(v=e.namespace=h(u,s),w=v!==b.html?o(u.e):u.e,e.node=g(w,v),d(e.node,"_ractive",{value:{proxy:e,keypath:t.length?t[t.length-1]:"",index:r.indexRefs,events:c(null),root:B}})),x=i(e,u.a),u.f){if(e.node&&e.node.getAttribute("contenteditable")&&e.node.innerHTML){if(D="A pre-populated contenteditable element should not have children",B.debug)throw new Error(D);f(D)}j(e,e.node,u,q)}q&&u.v&&l(e,u.v),q&&(B.twoway&&(e.bind(),e.node.getAttribute("contenteditable")&&e.node._ractive.binding&&e.node._ractive.binding.update()),x.name&&!x.name.twoway&&x.name.update(),"IMG"===e.node.tagName&&((y=e.attributes.width)||(z=e.attributes.height))&&e.node.addEventListener("load",A=function(){y&&(e.node.width=y.value),z&&(e.node.height=z.value),e.node.removeEventListener("load",A,!1)},!1),q.appendChild(e.node),u.o&&k(u.o,B,e,t),u.t1&&n(u.t1,B,e,t,!0),"OPTION"===e.node.tagName&&("SELECT"===s.tagName&&(C=s._ractive.binding)&&C.deferUpdate(),e.node._ractive.value==s._ractive.value&&(e.node.selected=!0)),e.node.autofocus&&(B._deferred.focusable=e.node)),m(e)}}(k,d,c,g,Z,I,e,Hb,cc,dc,fc,hc,ic,mc,Ib),oc=function(a){return function(b){var c,d,e,f,g,h,i,j,k;for(this.fragment&&this.fragment.teardown(!1);this.attributes.length;)this.attributes.pop().teardown();if(this.node){for(c in this.node._ractive.events)this.node._ractive.events[c].teardown();(d=this.node._ractive.binding)&&(d.teardown(),e=this.root._twowayBindings[d.attr.keypath],e.splice(e.indexOf(d),1))}if(this.decorator&&this.decorator.teardown(),this.descriptor.t2&&a(this.descriptor.t2,this.root,this,this.parentFragment.contextStack,!1),b&&this.root._transitionManager.detachWhenReady(this),g=this.liveQueries)for(f=g.length;f--;)if(h=g[f],j=this.liveQueries[h])for(k=j.length,i=this.root._liveQueries[h];k--;)i._remove(j[k])}}(mc),pc=function(){return"area base br col command doctype embed hr img input keygen link meta param source track wbr".split(" ")}(),qc=function(a){return function(){var b,c,d;for(b="<"+(this.descriptor.y?"!doctype":this.descriptor.e),d=this.attributes.length,c=0;d>c;c+=1)b+=" "+this.attributes[c].toString();return b+=">",this.html?b+=this.html:this.fragment&&(b+=this.fragment.toString()),-1===a.indexOf(this.descriptor.e)&&(b+="</"+this.descriptor.e+">"),b}}(pc),rc=function(a){return function(b){var c;return a(this.node,b)?this.node:this.html&&(c=this.node.querySelector(b))?c:this.fragment&&this.fragment.find?this.fragment.find(b):void 0}}(Z),sc=function(){return function(a,b){var c,d,e,f,g;if(b._test(this,!0)&&b.live&&((this.liveQueries||(this.liveQueries=[])).push(a),this.liveQueries[a]=[this.node]),this.html&&(c=this.node.querySelectorAll(a))&&(e=c.length))for(b.live&&(this.liveQueries[a]||((this.liveQueries||(this.liveQueries=[])).push(a),this.liveQueries[a]=[]),g=this.liveQueries[a]),d=0;e>d;d+=1)f=c[d],b.push(f),b.live&&g.push(f);this.fragment&&this.fragment.findAll(a,b)}}(),tc=function(){return function(a){return this.fragment?this.fragment.findComponent(a):void 0}}(),uc=function(){return function(a,b){this.fragment&&this.fragment.findAllComponents(a,b)}}(),vc=function(){return function(){var a=this.attributes;if(this.node&&(this.binding&&(this.binding.teardown(),this.binding=null),!(this.node.getAttribute("contenteditable")&&a.value&&a.value.bind())))switch(this.descriptor.e){case"select":case"textarea":return a.value&&a.value.bind(),void 0;case"input":if("radio"===this.node.type||"checkbox"===this.node.type){if(a.name&&a.name.bind())return;if(a.checked&&a.checked.bind())return}if(a.value&&a.value.bind())return}}}(),wc=function(a,b,c,d,e,f,g,h){var i=function(b,c){a(this,b,c)};return i.prototype={detach:function(){return this.node?(this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node):void 0},teardown:b,firstNode:function(){return this.node},findNextNode:function(){return null},bubble:function(){},toString:c,find:d,findAll:e,findComponent:f,findAllComponents:g,bind:h},i}(nc,oc,qc,rc,sc,tc,uc,vc),xc={missingParser:"Missing Ractive.parse - cannot parse template. Either preparse or use the version that includes the parser"},yc={},zc=function(){return function(a){var b,c,d;for(d="";a.length;){if(b=a.indexOf("<!--"),c=a.indexOf("-->"),-1===b&&-1===c){d+=a;break}if(-1!==b&&-1===c)throw"Illegal HTML - expected closing comment sequence ('-->')";if(-1!==c&&-1===b||b>c)throw"Illegal HTML - unexpected closing comment sequence ('-->')";d+=a.substr(0,b),a=a.substring(c+3)}return d}}(),Ac=function(a){return function(b){var c,d,e,f,g,h;for(g=/^\s*\r?\n/,h=/\r?\n\s*$/,c=2;c<b.length;c+=1)d=b[c],e=b[c-1],f=b[c-2],d.type===a.TEXT&&e.type===a.MUSTACHE&&f.type===a.TEXT&&h.test(f.value)&&g.test(d.value)&&(e.mustacheType!==a.INTERPOLATOR&&e.mustacheType!==a.TRIPLE&&(f.value=f.value.replace(h,"\n")),d.value=d.value.replace(g,""),""===d.value&&b.splice(c--,1));return b}}(k),Bc=function(a){return function(b){var c,d,e,f;for(c=0;c<b.length;c+=1)d=b[c],e=b[c-1],f=b[c+1],(d.mustacheType===a.COMMENT||d.mustacheType===a.DELIMCHANGE)&&(b.splice(c,1),e&&f&&e.type===a.TEXT&&f.type===a.TEXT&&(e.value+=f.value,b.splice(c,1)),c-=1);return b}}(k),Cc=function(a){var b=a(/^[^\s=]+/);return function(a){var c,d,e;return a.getStringMatch("=")?(c=a.pos,a.allowWhitespace(),(d=b(a))?(a.allowWhitespace(),(e=b(a))?(a.allowWhitespace(),a.getStringMatch("=")?[d,e]:(a.pos=c,null)):(a.pos=c,null)):(a.pos=c,null)):null}}(Qb),Dc=function(a){var b={"#":a.SECTION,"^":a.INVERTED,"/":a.CLOSING,">":a.PARTIAL,"!":a.COMMENT,"&":a.TRIPLE};return function(a){var c=b[a.str.charAt(a.pos)];return c?(a.pos+=1,c):null}}(k),Ec=function(a,b,c){var d=b(/^\s*:\s*([a-zA-Z_$][a-zA-Z_$0-9]*)/),e=/^[0-9][1-9]*$/;return function(b,f){var g,h,i,j,k,l,m;if(g=b.pos,h={type:f?a.TRIPLE:a.MUSTACHE},!(f||((j=b.getExpression())&&(h.mustacheType=a.INTERPOLATOR,b.allowWhitespace(),b.getStringMatch(b.delimiters[1])?b.pos-=b.delimiters[1].length:(b.pos=g,j=null)),j||(i=c(b),i===a.TRIPLE?h={type:a.TRIPLE}:h.mustacheType=i||a.INTERPOLATOR,i!==a.COMMENT&&i!==a.CLOSING||(l=b.remaining(),m=l.indexOf(b.delimiters[1]),-1===m)))))return h.ref=l.substr(0,m),b.pos+=m,h;for(j||(b.allowWhitespace(),j=b.getExpression());j.t===a.BRACKETED&&j.x;)j=j.x;return j.t===a.REFERENCE?h.ref=j.n:j.t===a.NUMBER_LITERAL&&e.test(j.v)?h.ref=j.v:h.expression=j,k=d(b),null!==k&&(h.indexRef=k),h}}(k,Qb,Dc),Fc=function(a,b,c){function d(d,e){var f,g,h=d.pos;return g=e?d.tripleDelimiters:d.delimiters,d.getStringMatch(g[0])?(f=b(d))?d.getStringMatch(g[1])?(d[e?"tripleDelimiters":"delimiters"]=f,{type:a.MUSTACHE,mustacheType:a.DELIMCHANGE}):(d.pos=h,null):(d.allowWhitespace(),f=c(d,e),null===f?(d.pos=h,null):(d.allowWhitespace(),d.getStringMatch(g[1])?f:(d.pos=h,null))):null}return function(){var a=this.tripleDelimiters[0].length>this.delimiters[0].length;return d(this,a)||d(this,!a)}}(k,Cc,Ec),Gc=function(a){return function(){var b,c,d;if(!this.getStringMatch("<!--"))return null;if(c=this.remaining(),d=c.indexOf("-->"),-1===d)throw new Error('Unexpected end of input (expected "-->" to close comment)');return b=c.substr(0,d),this.pos+=d+3,{type:a.COMMENT,content:b}}}(k),Hc=function(){return function(a,b){var c,d,e;for(c=b.length;c--;){if(d=a.indexOf(b[c]),!d)return 0;-1!==d&&(!e||e>d)&&(e=d)}return e||-1}}(),Ic=function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p;return d=function(){return e(this)||f(this)},e=function(b){var c,d,e,f;return c=b.pos,b.inside?null:b.getStringMatch("<")?(d={type:a.TAG},b.getStringMatch("!")&&(d.doctype=!0),d.name=g(b),d.name?(e=h(b),e&&(d.attrs=e),b.allowWhitespace(),b.getStringMatch("/")&&(d.selfClosing=!0),b.getStringMatch(">")?(f=d.name.toLowerCase(),("script"===f||"style"===f)&&(b.inside=f),d):(b.pos=c,null)):(b.pos=c,null)):null},f=function(b){var c,d,e;if(c=b.pos,e=function(a){throw new Error("Unexpected character "+b.remaining().charAt(0)+" (expected "+a+")")},!b.getStringMatch("<"))return null;if(d={type:a.TAG,closing:!0},b.getStringMatch("/")||e('"/"'),d.name=g(b),d.name||e("tag name"),b.getStringMatch(">")||e('">"'),b.inside){if(d.name.toLowerCase()!==b.inside)return b.pos=c,null;b.inside=null}return d},g=b(/^[a-zA-Z]{1,}:?[a-zA-Z0-9\-]*/),h=function(a){var b,c,d;if(b=a.pos,a.allowWhitespace(),d=i(a),!d)return a.pos=b,null;for(c=[];null!==d;)c[c.length]=d,a.allowWhitespace(),d=i(a);return c},i=function(a){var b,c,d;return(c=j(a))?(b={name:c},d=k(a),d&&(b.value=d),b):null},j=b(/^[^\s"'>\/=]+/),k=function(a){var b,c;return b=a.pos,a.allowWhitespace(),a.getStringMatch("=")?(a.allowWhitespace(),c=p(a,"'")||p(a,'"')||l(a),null===c?(a.pos=b,null):c):(a.pos=b,null)},n=b(/^[^\s"'=<>`]+/),m=function(b){var c,d,e;return c=b.pos,(d=n(b))?(-1!==(e=d.indexOf(b.delimiters[0]))&&(d=d.substr(0,e),b.pos=c+d.length),{type:a.TEXT,value:d}):null},l=function(a){var b,c;for(b=[],c=a.getMustache()||m(a);null!==c;)b[b.length]=c,c=a.getMustache()||m(a);return b.length?b:null},p=function(a,b){var c,d,e;if(c=a.pos,!a.getStringMatch(b))return null;for(d=[],e=a.getMustache()||o(a,b);null!==e;)d[d.length]=e,e=a.getMustache()||o(a,b);return a.getStringMatch(b)?d:(a.pos=c,null)},o=function(b,d){var e,f,g;if(e=b.pos,g=b.remaining(),f=c(g,[d,b.delimiters[0],b.delimiters[1]]),-1===f)throw new Error("Quoted attribute value must have a closing quote");return f?(b.pos+=f,{type:a.TEXT,value:g.substr(0,f)}):null},d}(k,Qb,Hc),Jc=function(a,b){return function(){var c,d,e;return d=this.remaining(),e=this.inside?"</"+this.inside:"<",(c=b(d,[e,this.delimiters[0],this.tripleDelimiters[0]]))?(-1===c&&(c=d.length),this.pos+=c,{type:a.TEXT,value:d.substr(0,c)}):null}}(k,Hc),Kc=function(a){return function(b){var c=b.remaining();return"true"===c.substr(0,4)?(b.pos+=4,{t:a.BOOLEAN_LITERAL,v:"true"}):"false"===c.substr(0,5)?(b.pos+=5,{t:a.BOOLEAN_LITERAL,v:"false"}):null}}(k),Lc=function(a,b){return function(c){var d,e,f;return d=c.pos,c.allowWhitespace(),e=b(c),null===e?(c.pos=d,null):(c.allowWhitespace(),c.getStringMatch(":")?(c.allowWhitespace(),f=c.getExpression(),null===f?(c.pos=d,null):{t:a.KEY_VALUE_PAIR,k:e,v:f}):(c.pos=d,null))}}(k,Wb),Mc=function(a){return function b(c){var d,e,f,g;return d=c.pos,f=a(c),null===f?null:(e=[f],c.getStringMatch(",")?(g=b(c),g?e.concat(g):(c.pos=d,null)):e)}}(Lc),Nc=function(a,b){return function(c){var d,e;return d=c.pos,c.allowWhitespace(),c.getStringMatch("{")?(e=b(c),c.allowWhitespace(),c.getStringMatch("}")?{t:a.OBJECT_LITERAL,m:e}:(c.pos=d,null)):(c.pos=d,null)}}(k,Mc),Oc=function(){return function a(b){var c,d,e,f;if(c=b.pos,b.allowWhitespace(),e=b.getExpression(),null===e)return null;if(d=[e],b.allowWhitespace(),b.getStringMatch(",")){if(f=a(b),null===f)return b.pos=c,null;d=d.concat(f)}return d}}(),Pc=function(a,b){return function(c){var d,e;return d=c.pos,c.allowWhitespace(),c.getStringMatch("[")?(e=b(c),c.getStringMatch("]")?{t:a.ARRAY_LITERAL,m:e}:(c.pos=d,null)):(c.pos=d,null)}}(k,Oc),Qc=function(a,b,c,d,e){return function(f){var g=a(f)||b(f)||c(f)||d(f)||e(f);return g}}(Ub,Kc,Tb,Nc,Pc),Rc=function(a,b,c){var d,e,f,g;return d=b(/^\.[a-zA-Z_$0-9]+/),e=function(a){var b=f(a);return b?"."+b:null},f=b(/^\[(0|[1-9][0-9]*)\]/),g=/^(?:Array|Date|RegExp|decodeURIComponent|decodeURI|encodeURIComponent|encodeURI|isFinite|isNaN|parseFloat|parseInt|JSON|Math|NaN|undefined|null)$/,function(b){var f,h,i,j,k,l,m;for(f=b.pos,h="";b.getStringMatch("../");)h+="../";if(h||(j=b.getStringMatch(".")||""),i=c(b)||"",!h&&!j&&g.test(i))return{t:a.GLOBAL,v:i};if("this"!==i||h||j||(i=".",f+=3),k=(h||j)+i,!k)return null;for(;l=d(b)||e(b);)k+=l;return b.getStringMatch("(")&&(m=k.lastIndexOf("."),-1!==m?(k=k.substr(0,m),b.pos=f+k.length):b.pos-=1),{t:a.REFERENCE,n:k}}}(k,Qb,Vb),Sc=function(a){return function(b){var c,d;return c=b.pos,b.getStringMatch("(")?(b.allowWhitespace(),(d=b.getExpression())?(b.allowWhitespace(),b.getStringMatch(")")?{t:a.BRACKETED,x:d}:(b.pos=c,null)):(b.pos=c,null)):null}}(k),Tc=function(a,b,c){return function(d){return a(d)||b(d)||c(d)}}(Qc,Rc,Sc),Uc=function(a,b){return function(c){var d,e,f;if(d=c.pos,c.allowWhitespace(),c.getStringMatch(".")){if(c.allowWhitespace(),e=b(c))return{t:a.REFINEMENT,n:e};c.expected("a property name")}return c.getStringMatch("[")?(c.allowWhitespace(),f=c.getExpression(),f||c.expected("an expression"),c.allowWhitespace(),c.getStringMatch("]")||c.expected('"]"'),{t:a.REFINEMENT,x:f}):null}}(k,Vb),Vc=function(a,b,c,d){return function(e){var f,g,h,i;if(g=b(e),!g)return null;for(;g;)if(f=e.pos,h=d(e))g={t:a.MEMBER,x:g,r:h};else{if(!e.getStringMatch("("))break;if(e.allowWhitespace(),i=c(e),e.allowWhitespace(),!e.getStringMatch(")")){e.pos=f;break}g={t:a.INVOCATION,x:g},i&&(g.o=i)}return g}}(k,Tc,Oc,Uc),Wc=function(a,b){var c,d;return d=function(b,c){return function(d){var e,f;return d.getStringMatch(b)?(e=d.pos,d.allowWhitespace(),f=d.getExpression(),f||d.expected("an expression"),{s:b,o:f,t:a.PREFIX_OPERATOR}):c(d)}},function(){var a,e,f,g,h;for(g="! ~ + - typeof".split(" "),h=b,a=0,e=g.length;e>a;a+=1)f=d(g[a],h),h=f;c=h}(),c}(k,Vc),Xc=function(a,b){var c,d;return d=function(b,c){return function(d){var e,f,g;return(f=c(d))?(e=d.pos,d.allowWhitespace(),d.getStringMatch(b)?"in"===b&&/[a-zA-Z_$0-9]/.test(d.remaining().charAt(0))?(d.pos=e,f):(d.allowWhitespace(),g=d.getExpression(),g?{t:a.INFIX_OPERATOR,s:b,o:[f,g]}:(d.pos=e,f)):(d.pos=e,f)):null}},function(){var a,e,f,g,h;for(g="* / % + - << >> >>> < <= > >= in instanceof == != === !== & ^ | && ||".split(" "),h=b,a=0,e=g.length;e>a;a+=1)f=d(g[a],h),h=f;c=h}(),c}(k,Wc),Yc=function(a,b){return function(c){var d,e,f,g;return(e=b(c))?(d=c.pos,c.allowWhitespace(),c.getStringMatch("?")?(c.allowWhitespace(),(f=c.getExpression())?(c.allowWhitespace(),c.getStringMatch(":")?(c.allowWhitespace(),g=c.getExpression(),g?{t:a.CONDITIONAL,o:[e,f,g]}:(c.pos=d,e)):(c.pos=d,e)):(c.pos=d,e)):(c.pos=d,e)):null}}(k,Xc),Zc=function(a){return function(){return a(this)}}(Yc),$c=function(a,b,c,d,e,f,g){var h;return h=function(a,b){var c;for(this.str=a,this.pos=0,this.delimiters=b.delimiters,this.tripleDelimiters=b.tripleDelimiters,this.tokens=[];this.pos<this.str.length;)c=this.getToken(),null===c&&this.remaining()&&this.fail(),this.tokens.push(c)},h.prototype={getToken:function(){var a=this.getMustache()||this.getComment()||this.getTag()||this.getText();return a},getMustache:a,getComment:b,getTag:c,getText:d,getExpression:e,allowWhitespace:f,getStringMatch:g,remaining:function(){return this.str.substring(this.pos)},fail:function(){var a,b;throw a=this.str.substr(0,this.pos).substr(-20),20===a.length&&(a="..."+a),b=this.remaining().substr(0,20),20===b.length&&(b+="..."),new Error("Could not parse template: "+(a?a+"<- ":"")+"failed at character "+this.pos+" ->"+b)},expected:function(a){var b=this.remaining().substr(0,40);throw 40===b.length&&(b+="..."),new Error('Tokenizer failed: unexpected string "'+b+'" (expected '+a+")")}},h}(Fc,Gc,Ic,Jc,Zc,Pb,Ob),_c=function(a,b,c,d,e){var f,g;return e.push(function(){g=e.Ractive}),f=function(e,f){var h,i;return f=f||{},f.stripComments!==!1&&(e=a(e)),h=new d(e,{delimiters:f.delimiters||(g?g.delimiters:["{{","}}"]),tripleDelimiters:f.tripleDelimiters||(g?g.tripleDelimiters:["{{{","}}}"])}),i=h.tokens,b(i),c(i),i}}(zc,Ac,Bc,$c,Eb),ad=function(a){var b,c,d,e,f,g,h,i,j;return b=function(a,b){this.text=b?a.value:a.value.replace(j," ")},b.prototype={type:a.TEXT,toJSON:function(){return this.decoded||(this.decoded=i(this.text))},toString:function(){return this.text}},c={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},d=[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],e=new RegExp("&("+Object.keys(c).join("|")+");?","g"),f=/&#x([0-9]+);?/g,g=/&#([0-9]+);?/g,h=function(a){return a?10===a?32:128>a?a:159>=a?d[a-128]:55296>a?a:57343>=a?65533:65535>=a?a:65533:65533},i=function(a){var b;return b=a.replace(e,function(a,b){return c[b]?String.fromCharCode(c[b]):a}),b=b.replace(f,function(a,b){return String.fromCharCode(h(parseInt(b,16)))}),b=b.replace(g,function(a,b){return String.fromCharCode(h(b))})},j=/\s+/g,b}(k),bd=function(a,b){return function(c){return c.type===a.TEXT?(this.pos+=1,new b(c,this.preserveWhitespace)):null}}(k,ad),cd=function(a){var b;return b=function(a){this.content=a.content},b.prototype={toJSON:function(){return{t:a.COMMENT,f:this.content}},toString:function(){return"<!--"+this.content+"-->"}},b}(k),dd=function(a,b){return function(c){return c.type===a.COMMENT?(this.pos+=1,new b(c,this.preserveWhitespace)):null}}(k,cd),ed=function(a,b){var c,d,e;return c=function(a){this.refs=[],d(a,this.refs),this.str=e(a,this.refs)},c.prototype={toJSON:function(){return this.json?this.json:(this.json={r:this.refs,s:this.str},this.json)}},d=function(c,e){var f,g;if(c.t===a.REFERENCE&&-1===e.indexOf(c.n)&&e.unshift(c.n),g=c.o||c.m)if(b(g))d(g,e);else for(f=g.length;f--;)d(g[f],e);c.x&&d(c.x,e),c.r&&d(c.r,e),c.v&&d(c.v,e)},e=function(b,c){var d=function(a){return e(a,c)};switch(b.t){case a.BOOLEAN_LITERAL:case a.GLOBAL:case a.NUMBER_LITERAL:return b.v;case a.STRING_LITERAL:return"'"+b.v.replace(/'/g,"\\'")+"'";case a.ARRAY_LITERAL:return"["+(b.m?b.m.map(d).join(","):"")+"]";case a.OBJECT_LITERAL:return"{"+(b.m?b.m.map(d).join(","):"")+"}";case a.KEY_VALUE_PAIR:return b.k+":"+e(b.v,c);case a.PREFIX_OPERATOR:return("typeof"===b.s?"typeof ":b.s)+e(b.o,c);case a.INFIX_OPERATOR:return e(b.o[0],c)+("in"===b.s.substr(0,2)?" "+b.s+" ":b.s)+e(b.o[1],c);case a.INVOCATION:return e(b.x,c)+"("+(b.o?b.o.map(d).join(","):"")+")";case a.BRACKETED:return"("+e(b.x,c)+")";case a.MEMBER:return e(b.x,c)+e(b.r,c);case a.REFINEMENT:return b.n?"."+b.n:"["+e(b.x,c)+"]";case a.CONDITIONAL:return e(b.o[0],c)+"?"+e(b.o[1],c)+":"+e(b.o[2],c);case a.REFERENCE:return"${"+c.indexOf(b.n)+"}";default:throw new Error("Could not stringify expression token. This error is unexpected")}},c}(k,w),fd=function(a,b){var c=function(c,d){this.type=c.type===a.TRIPLE?a.TRIPLE:c.mustacheType,c.ref&&(this.ref=c.ref),c.expression&&(this.expr=new b(c.expression)),d.pos+=1};return c.prototype={toJSON:function(){var a;return this.json?this.json:(a={t:this.type},this.ref&&(a.r=this.ref),this.expr&&(a.x=this.expr.toJSON()),this.json=a,a)},toString:function(){return!1}},c}(k,ed),gd=function(){return function(a){var b,c,d,e="";if(!a)return"";for(c=0,d=a.length;d>c;c+=1){if(b=a[c].toString(),b===!1)return!1;e+=b}return e}}(),hd=function(a){return function(b,c){var d,e;return c||(d=a(b),d===!1)?e=b.map(function(a){return a.toJSON(c)}):d}}(gd),id=function(a,b,c){var d=function(b,d){var e;for(this.ref=b.ref,this.indexRef=b.indexRef,this.inverted=b.mustacheType===a.INVERTED,b.expression&&(this.expr=new c(b.expression)),d.pos+=1,this.items=[],e=d.next();e;){if(e.mustacheType===a.CLOSING){if(e.ref.trim()===this.ref||this.expr){d.pos+=1;break}throw new Error("Could not parse template: Illegal closing section")}this.items[this.items.length]=d.getStub(),e=d.next()}};return d.prototype={toJSON:function(c){var d;return this.json?this.json:(d={t:a.SECTION},this.ref&&(d.r=this.ref),this.indexRef&&(d.i=this.indexRef),this.inverted&&(d.n=!0),this.expr&&(d.x=this.expr.toJSON()),this.items.length&&(d.f=b(this.items,c)),this.json=d,d)},toString:function(){return!1}},d}(k,hd,ed),jd=function(a,b,c){return function(d){return d.type===a.MUSTACHE||d.type===a.TRIPLE?d.mustacheType===a.SECTION||d.mustacheType===a.INVERTED?new c(d,this):new b(d,this):void 0}}(k,fd,id),kd=function(){return{li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote dir div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rp","rt"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tr:["tr"],td:["td","th"],th:["td","th"]}}(),ld=function(a){function b(c){var d,e;if("object"!=typeof c)return c;if(a(c))return c.map(b);d={};for(e in c)c.hasOwnProperty(e)&&(d[e]=b(c[e]));return d}return function(a){var c,d,e,f,g,h;for(e={},c=[],d=[],g=a.length,f=0;g>f;f+=1)if(h=a[f],"intro"===h.name){if(e.intro)throw new Error("An element can only have one intro transition");e.intro=h}else if("outro"===h.name){if(e.outro)throw new Error("An element can only have one outro transition");e.outro=h}else if("intro-outro"===h.name){if(e.intro||e.outro)throw new Error("An element can only have one intro and one outro transition");e.intro=h,e.outro=b(h)}else"proxy-"===h.name.substr(0,6)?(h.name=h.name.substring(6),d[d.length]=h):"on-"===h.name.substr(0,3)?(h.name=h.name.substring(3),d[d.length]=h):"decorator"===h.name?e.decorator=h:c[c.length]=h;return e.attrs=c,e.proxies=d,e}}(l),md=function(a,b){return function(c){var d,e,f,g,h,i,j,k;for(h=function(){throw new Error("Illegal directive")},c.name&&c.value||h(),d={directiveType:c.name},e=c.value,i=[],j=[];e.length;)if(f=e.shift(),f.type===a.TEXT){if(g=f.value.indexOf(":"),-1!==g){g&&(i[i.length]={type:a.TEXT,value:f.value.substr(0,g)}),f.value.length>g+1&&(j[0]={type:a.TEXT,value:f.value.substring(g+1)});break}i[i.length]=f}else i[i.length]=f;return j=j.concat(e),d.name=1===i.length&&i[0].type===a.TEXT?i[0].value:i,j.length&&(1===j.length&&j[0].type===a.TEXT?(k=b("["+j[0].value+"]"),d.args=k?k.value:j[0].value):d.dynamicArgs=j),d}}(k,Xb),nd=function(a,b){var c;return c=function(a,b){var c;for(this.tokens=a||[],this.pos=0,this.options=b,this.result=[];c=this.getStub();)this.result.push(c)},c.prototype={getStub:function(){var a=this.next();return a?this.getText(a)||this.getMustache(a):null},getText:a,getMustache:b,next:function(){return this.tokens[this.pos]}},c}(bd,jd),od=function(a,b,c){var d;return d=function(b){var c=new a(b);this.stubs=c.result},d.prototype={toJSON:function(a){var b;return this["json_"+a]?this["json_"+a]:b=this["json_"+a]=c(this.stubs,a)},toString:function(){return void 0!==this.str?this.str:(this.str=b(this.stubs),this.str)}},d}(nd,gd,hd),pd=function(a){return function(b){var c,d;if("string"==typeof b.name){if(!b.args&&!b.dynamicArgs)return b.name;d=b.name}else d=new a(b.name).toJSON();return c={n:d},b.args?(c.a=b.args,c):(b.dynamicArgs&&(c.d=new a(b.dynamicArgs).toJSON()),c)}}(od),qd=function(a,b,c){return function(d){var e,f,g,h,i,j,k;if(this["json_"+d])return this["json_"+d];if(e=this.component?{t:a.COMPONENT,e:this.component}:{t:a.ELEMENT,e:this.tag},this.doctype&&(e.y=1),this.attributes&&this.attributes.length)for(e.a={},j=this.attributes.length,i=0;j>i;i+=1){if(k=this.attributes[i],f=k.name,e.a[f])throw new Error("You cannot have multiple attributes with the same name");g=null===k.value?null:k.value.toJSON(d),e.a[f]=g}if(this.items&&this.items.length&&(e.f=b(this.items,d)),this.proxies&&this.proxies.length)for(e.v={},j=this.proxies.length,i=0;j>i;i+=1)h=this.proxies[i],e.v[h.directiveType]=c(h);return this.intro&&(e.t1=c(this.intro)),this.outro&&(e.t2=c(this.outro)),this.decorator&&(e.o=c(this.decorator)),this["json_"+d]=e,e}}(k,hd,pd),rd=function(a,b){var c;return c="a abbr acronym address applet area b base basefont bdo big blockquote body br button caption center cite code col colgroup dd del dfn dir div dl dt em fieldset font form frame frameset h1 h2 h3 h4 h5 h6 head hr html i iframe img input ins isindex kbd label legend li link map menu meta noframes noscript object ol p param pre q s samp script select small span strike strong style sub sup textarea title tt u ul var article aside audio bdi canvas command data datagrid datalist details embed eventsource figcaption figure footer header hgroup keygen mark meter nav output progress ruby rp rt section source summary time track video wbr".split(" "),function(){var d,e,f,g,h,i,j,k;if(void 0!==this.str)return this.str;if(this.component)return this.str=!1;if(-1===c.indexOf(this.tag.toLowerCase()))return this.str=!1;if(this.proxies||this.intro||this.outro||this.decorator)return this.str=!1;if(j=a(this.items),j===!1)return this.str=!1;if(k=-1!==b.indexOf(this.tag.toLowerCase()),d="<"+this.tag,this.attributes)for(e=0,f=this.attributes.length;f>e;e+=1){if(h=this.attributes[e].name,-1!==h.indexOf(":"))return this.str=!1;if("id"===h||"intro"===h||"outro"===h)return this.str=!1;if(g=" "+h,null!==this.attributes[e].value){if(i=this.attributes[e].value.toString(),i===!1)return this.str=!1;
""!==i&&(g+="=",g+=/[\s"'=<>`]/.test(i)?'"'+i.replace(/"/g,""")+'"':i)}d+=g}return this.selfClosing&&!k?(d+="/>",this.str=d):(d+=">",k?this.str=d:(d+=j,d+="</"+this.tag+">",this.str=d))}}(gd,pc),sd=function(a,b,c,d,e,f,g,h,i,j,k){var l,m,n,o,p,q=/^\s+/,r=/\s+$/;return l=function(d,e,i){var j,l,m,n,o,s,t;if(e.pos+=1,s=function(a){return{name:a.name,value:a.value?new k(a.value):null}},this.tag=d.name,t=d.name.toLowerCase(),"rv-"===t.substr(0,3)&&(c('The "rv-" prefix for components has been deprecated. Support will be removed in a future version'),this.tag=this.tag.substring(3)),i=i||"pre"===t,d.attrs&&(m=g(d.attrs),l=m.attrs,n=m.proxies,e.options.sanitize&&e.options.sanitize.eventAttributes&&(l=l.filter(p)),l.length&&(this.attributes=l.map(s)),n.length&&(this.proxies=n.map(h)),m.intro&&(this.intro=h(m.intro)),m.outro&&(this.outro=h(m.outro)),m.decorator&&(this.decorator=h(m.decorator))),d.doctype&&(this.doctype=!0),d.selfClosing&&(this.selfClosing=!0),-1!==b.indexOf(t)&&(this.isVoid=!0),!this.selfClosing&&!this.isVoid){for(this.siblings=f[t],this.items=[],j=e.next();j&&j.mustacheType!==a.CLOSING;){if(j.type===a.TAG){if(j.closing){j.name.toLowerCase()===t&&(e.pos+=1);break}if(this.siblings&&-1!==this.siblings.indexOf(j.name.toLowerCase()))break}this.items[this.items.length]=e.getStub(),j=e.next()}i||(o=this.items[0],o&&o.type===a.TEXT&&(o.text=o.text.replace(q,""),o.text||this.items.shift()),o=this.items[this.items.length-1],o&&o.type===a.TEXT&&(o.text=o.text.replace(r,""),o.text||this.items.pop()))}},l.prototype={toJSON:i,toString:j},m="a abbr acronym address applet area b base basefont bdo big blockquote body br button caption center cite code col colgroup dd del dfn dir div dl dt em fieldset font form frame frameset h1 h2 h3 h4 h5 h6 head hr html i iframe img input ins isindex kbd label legend li link map menu meta noframes noscript object ol p param pre q s samp script select small span strike strong style sub sup textarea title tt u ul var article aside audio bdi canvas command data datagrid datalist details embed eventsource figcaption figure footer header hgroup keygen mark meter nav output progress ruby rp rt section source summary time track video wbr".split(" "),n="li dd rt rp optgroup option tbody tfoot tr td th".split(" "),o=/^on[a-zA-Z]/,p=function(a){var b=!o.test(a.name);return b},l}(k,pc,I,jc,gd,kd,ld,md,qd,rd,od),td=function(a,b){return function(a){return this.options.sanitize&&this.options.sanitize.elements&&-1!==this.options.sanitize.elements.indexOf(a.name.toLowerCase())?null:new b(a,this)}}(k,sd),ud=function(a,b,c,d,e){var f;return f=function(a,b){var c,d;for(this.tokens=a||[],this.pos=0,this.options=b,this.preserveWhitespace=b.preserveWhitespace,d=[];c=this.getStub();)d.push(c);this.result=e(d)},f.prototype={getStub:function(){var a=this.next();return a?this.getText(a)||this.getComment(a)||this.getMustache(a)||this.getElement(a):null},getText:a,getComment:b,getMustache:c,getElement:d,next:function(){return this.tokens[this.pos]}},f}(bd,dd,jd,td,hd),vd=function(a,b,c){var d,e,f,g,h;return e=/^\s*$/,f=/<!--\s*\{\{\s*>\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*}\}\s*-->/,g=/<!--\s*\{\{\s*\/\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*}\}\s*-->/,d=function(d,g){var i,j,k;return g=g||{},f.test(d)?h(d,g):(g.sanitize===!0&&(g.sanitize={elements:"applet base basefont body frame frameset head html isindex link meta noframes noscript object param script style title".split(" "),eventAttributes:!0}),i=a(d,g),g.preserveWhitespace||(k=i[0],k&&k.type===b.TEXT&&e.test(k.value)&&i.shift(),k=i[i.length-1],k&&k.type===b.TEXT&&e.test(k.value)&&i.pop()),j=new c(i,g).result,"string"==typeof j?[j]:j)},h=function(a,b){var c,e,h,i,j,k;for(h={},c="",e=a;j=f.exec(e);){if(i=j[1],c+=e.substr(0,j.index),e=e.substring(j.index+j[0].length),k=g.exec(e),!k||k[1]!==i)throw new Error("Inline partials must have a closing delimiter, and cannot be nested");h[i]=d(e.substr(0,k.index),b),e=e.substring(k.index+k[0].length)}return{main:d(c,b),partials:h}},d}(_c,k,ud),wd=function(a,b,c,d,e,f){var g,h,i,j;return g=function(d,g){var k,l,m;if(l=i(d,g))return l;if(b&&(k=document.getElementById(g),k&&"SCRIPT"===k.tagName)){if(!f)throw new Error(a.missingParser);h(f(k.innerHTML),g,e)}if(l=e[g],!l){if(m='Could not find descriptor for partial "'+g+'"',d.debug)throw new Error(m);return c(m),[]}return j(l)},i=function(b,c){var d;if(b.partials[c]){if("string"==typeof b.partials[c]){if(!f)throw new Error(a.missingParser);d=f(b.partials[c],b.parseOptions),h(d,c,b.partials)}return j(b.partials[c])}},h=function(a,b,c){var e;if(d(a)){c[b]=a.main;for(e in a.partials)a.partials.hasOwnProperty(e)&&(c[e]=a.partials[e])}else c[b]=a},j=function(a){return 1===a.length&&"string"==typeof a[0]?a[0]:a},g}(xc,f,I,w,yc,vd),xd=function(a,b,c){var d,e;return c.push(function(){e=c.DomFragment}),d=function(c,d){var f,g=this.parentFragment=c.parentFragment;if(this.type=a.PARTIAL,this.name=c.descriptor.r,this.index=c.index,!c.descriptor.r)throw new Error("Partials must have a static reference (no expressions). This may change in a future version of Ractive.");f=b(g.root,c.descriptor.r),this.fragment=new e({descriptor:f,root:g.root,pNode:g.pNode,contextStack:g.contextStack,owner:this}),d&&d.appendChild(this.fragment.docFrag)},d.prototype={firstNode:function(){return this.fragment.firstNode()},findNextNode:function(){return this.parentFragment.findNextNode(this)},detach:function(){return this.fragment.detach()},teardown:function(a){this.fragment.teardown(a)},toString:function(){return this.fragment.toString()},find:function(a){return this.fragment.find(a)},findAll:function(a,b){return this.fragment.findAll(a,b)},findComponent:function(a){return this.fragment.findComponent(a)},findAllComponents:function(a,b){return this.fragment.findAllComponents(a,b)}},d}(k,wd,Eb),yd=function(a){var b=function(b,c,d){this.parentFragment=b.parentFragment,this.component=b,this.key=c,this.fragment=new a({descriptor:d,root:b.root,owner:this,contextStack:b.parentFragment.contextStack}),this.selfUpdating=this.fragment.isSimple(),this.value=this.fragment.getValue()};return b.prototype={bubble:function(){this.selfUpdating?this.update():!this.deferred&&this.ready&&(this.root._deferred.attrs.push(this),this.deferred=!0)},update:function(){var a=this.fragment.getValue();this.component.instance.set(this.key,a),this.value=a},teardown:function(){this.fragment.teardown()}},b}(ac),zd=function(a,b,c,d){function e(e,f,g,h){var i,j,k,l,m;return k=e.root,l=e.parentFragment,"string"==typeof g?(j=b(g),j?j.value:g):null===g?!0:1===g.length&&g[0].t===a.INTERPOLATOR&&g[0].r?l.indexRefs&&void 0!==l.indexRefs[g[0].r]?l.indexRefs[g[0].r]:(m=c(k,g[0].r,l.contextStack)||g[0].r,h.push({childKeypath:f,parentKeypath:m}),k.get(m)):(i=new d(e,f,g),e.complexParameters.push(i),i.value)}return function(a,b,c){var d,f,g;d={},a.complexParameters=[];for(f in b)b.hasOwnProperty(f)&&(g=e(a,f,b[f],c),void 0!==g&&(d[f]=g));return d}}(k,Xb,y,yd),Ad=function(){return function(a,b,c,d,e){var f,g,h,i;return g=a.parentFragment,i=a.root,h={content:e||[]},f=new b({el:g.pNode.cloneNode(!1),data:c,partials:h,_parent:i,adaptors:i.adaptors}),f.component=a,a.instance=f,f.insert(d),f.fragment.pNode=g.pNode,f}}(),Bd=function(){function a(a,c,d){var e,f,g,h,i,j,k;e=a.root,f=a.instance,i=a.observers,j=e.observe(c,function(a){g||e._wrapped[c]||(h=!0,f.set(d,a),h=!1)},b),i.push(j),f.twoway&&(j=f.observe(d,function(a){h||(g=!0,e.set(c,a),g=!1)},b),i.push(j),k=f.get(d),void 0!==k&&e.set(c,k))}var b={init:!1,debug:!0};return function(b,c){var d,e;for(b.observers=[],e=c.length;e--;)d=c[e],a(b,d.parentKeypath,d.childKeypath)}}(),Cd=function(a){function b(b,d,e,f){if("string"!=typeof f){if(d.debug)throw new Error(c);return a(c),void 0}b.on(e,function(){var a=Array.prototype.slice.call(arguments);a.unshift(f),d.fire.apply(d,a)})}var c="Components currently only support simple events - you cannot include arguments. Sorry!";return function(a,c){var d;for(d in c)c.hasOwnProperty(d)&&b(a.instance,a.root,d,c[d])}}(I),Dd=function(){return function(a){var b,c;for(b=a.root;b;)(c=b._liveComponentQueries[a.name])&&c.push(a.instance),b=b._parent}}(),Ed=function(a,b,c,d,e,f,g){return function(h,i,j){var k,l,m,n,o;if(k=h.parentFragment=i.parentFragment,l=k.root,h.root=l,h.type=a.COMPONENT,h.name=i.descriptor.e,h.index=i.index,h.observers=[],m=l.components[i.descriptor.e],!m)throw new Error('Component "'+i.descriptor.e+'" not found');o=[],n=c(h,i.descriptor.a,o),d(h,m,n,j,i.descriptor.f),e(h,o),f(h,i.descriptor.v),(i.descriptor.t1||i.descriptor.t2||i.descriptor.o)&&b('The "intro", "outro" and "decorator" directives have no effect on components'),g(h)}}(k,I,zd,Ad,Bd,Cd,Dd),Fd=function(a){var b=function(b,c){a(this,b,c)};return b.prototype={firstNode:function(){return this.instance.fragment.firstNode()},findNextNode:function(){return this.parentFragment.findNextNode(this)},detach:function(){return this.instance.fragment.detach()},teardown:function(){for(var a;this.complexParameters.length;)this.complexParameters.pop().teardown();for(;this.observers.length;)this.observers.pop().cancel();(a=this.root._liveComponentQueries[this.name])&&a._remove(this),this.instance.teardown()},toString:function(){return this.instance.fragment.toString()},find:function(a){return this.instance.fragment.find(a)},findAll:function(a,b){return this.instance.fragment.findAll(a,b)},findComponent:function(a){return a&&a!==this.name?null:this.instance},findAllComponents:function(a,b){b._test(this,!0),this.instance.fragment&&this.instance.fragment.findAllComponents(a,b)}},b}(Ed),Gd=function(a){var b=function(b,c){this.type=a.COMMENT,this.descriptor=b.descriptor,c&&(this.node=document.createComment(b.descriptor.f),c.appendChild(this.node))};return b.prototype={detach:function(){return this.node.parentNode.removeChild(this.node),this.node},teardown:function(a){a&&this.detach()},firstNode:function(){return this.node},toString:function(){return"<!--"+this.descriptor.f+"-->"}},b}(k),Hd=function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n=function(a){a.pNode&&(this.docFrag=document.createDocumentFragment()),"string"==typeof a.descriptor?(this.html=a.descriptor,this.docFrag&&(this.nodes=d(this.html,a.pNode.tagName,this.docFrag))):c(this,a)};return n.prototype={detach:function(){var a,b;if(this.nodes)for(b=this.nodes.length;b--;)this.docFrag.appendChild(this.nodes[b]);else if(this.items)for(a=this.items.length,b=0;a>b;b+=1)this.docFrag.appendChild(this.items[b].detach());return this.docFrag},createItem:function(b){if("string"==typeof b.descriptor)return new e(b,this.docFrag);switch(b.descriptor.t){case a.INTERPOLATOR:return new f(b,this.docFrag);case a.SECTION:return new g(b,this.docFrag);case a.TRIPLE:return new h(b,this.docFrag);case a.ELEMENT:return this.root.components[b.descriptor.e]?new k(b,this.docFrag):new i(b,this.docFrag);case a.PARTIAL:return new j(b,this.docFrag);case a.COMMENT:return new l(b,this.docFrag);default:throw new Error("Something very strange happened. Please file an issue at https://github.com/RactiveJS/Ractive/issues. Thanks!")}},teardown:function(a){var b;if(this.nodes&&a)for(;b=this.nodes.pop();)b.parentNode.removeChild(b);else if(this.items)for(;this.items.length;)this.items.pop().teardown(a);this.nodes=this.items=this.docFrag=null},firstNode:function(){return this.items&&this.items[0]?this.items[0].firstNode():this.nodes?this.nodes[0]||null:null},findNextNode:function(a){var b=a.index;return this.items[b+1]?this.items[b+1].firstNode():this.owner===this.root?this.owner.component?this.owner.component.findNextNode():null:this.owner.findNextNode(this)},toString:function(){var a,b,c,d;if(this.html)return this.html;if(a="",!this.items)return a;for(c=this.items.length,b=0;c>b;b+=1)d=this.items[b],a+=d.toString();return a},find:function(a){var c,d,e,f,g;if(this.nodes){for(d=this.nodes.length,c=0;d>c;c+=1)if(f=this.nodes[c],1===f.nodeType){if(b(f,a))return f;if(g=f.querySelector(a))return g}return null}if(this.items){for(d=this.items.length,c=0;d>c;c+=1)if(e=this.items[c],e.find&&(g=e.find(a)))return g;return null}},findAll:function(a,c){var d,e,f,g,h,i,j;if(this.nodes){for(e=this.nodes.length,d=0;e>d;d+=1)if(g=this.nodes[d],1===g.nodeType&&(b(g,a)&&c.push(g),h=g.querySelectorAll(a)))for(i=h.length,j=0;i>j;j+=1)c.push(h[j])}else if(this.items)for(e=this.items.length,d=0;e>d;d+=1)f=this.items[d],f.findAll&&f.findAll(a,c);return c},findComponent:function(a){var b,c,d,e;if(this.items){for(b=this.items.length,c=0;b>c;c+=1)if(d=this.items[c],d.findComponent&&(e=d.findComponent(a)))return e;return null}},findAllComponents:function(a,b){var c,d,e;if(this.items)for(d=this.items.length,c=0;d>c;c+=1)e=this.items[c],e.findAllComponents&&e.findAllComponents(a,b);return b}},m.DomFragment=n,n}(k,Z,kb,lb,mb,zb,Fb,Gb,wc,xd,Fd,Gd,Eb),Id=function(a,b,c,d,e){return function(a,f){var g;if(!this._initing)throw new Error("You cannot call ractive.render() directly!");this._transitionManager=g=b(this,f),this.fragment=new e({descriptor:this.template,root:this,owner:this,pNode:a}),c(this),a&&a.appendChild(this.fragment.docFrag),d(this),this._transitionManager=null,g.ready(),this.rendered=!0}}(jb,q,o,p,Hd),Jd=function(a){return function(){return a("renderHTML() has been deprecated and will be removed in a future version. Please use toHTML() instead"),this.toHTML()}}(I),Kd=function(){return function(){return this.fragment.toString()}}(),Ld=function(a,b){return function(c){var d,e,f;for(this.fire("teardown"),f=this._transitionManager,this._transitionManager=e=a(this,c),this.fragment.teardown(!0);this._animations[0];)this._animations[0].stop();for(d in this._cache)b(this,d);this._transitionManager=f,e.ready()}}(q,m),Md=function(a){return function(b,c,d){var e;if("string"==typeof c&&a(d)){if(e=b.get(c),void 0===e&&(e=0),a(e))b.set(c,e+d);else if(b.debug)throw new Error("Cannot add to a non-numeric value")}else if(b.debug)throw new Error("Bad arguments")}}(J),Nd=function(a){return function(b,c){a(this,b,void 0===c?1:c)}}(Md),Od=function(a){return function(b,c){a(this,b,void 0===c?-1:-c)}}(Md),Pd=function(){return function(a){var b;if("string"==typeof a)b=this.get(a),this.set(a,!b);else if(this.debug)throw new Error("Bad arguments")}}(),Qd=function(){return function(a,b){var c,d,e,f,g;return c={},e=0,d=function(a,d){var f,h,i;h=e,i=b.length;do{if(f=b.indexOf(a,h),-1===f)return g=!0,-1;h=f+1}while(c[f]&&i>h);return f===e&&(e+=1),f!==d&&(g=!0),c[f]=!0,f},f=a.map(d),f.unchanged=!g,f}}(),Rd=function(a){return function(b,c,d,e){var f,g;for(f=c.length;f--;)g=c[f],g.type===a.REFERENCE?g.update():g.keypath===b&&g.type===a.SECTION&&!g.inverted&&g.docFrag?d[d.length]=g:e[e.length]=g}}(k),Sd=function(a,b,c,d,e,f,g,h,i,j){function k(a){return JSON.stringify(a)}function l(a){return m[a]||(m[a]=function(b){return b[a]}),m[a]}var m={};return function(m,n,o){var p,q,r,s,t,u,v,w,x,y,z,A,B,C,D;if(p=this.get(m),!b(p)||!b(n))return this.set(m,n,o&&o.complete);if(t=p.length===n.length,o&&o.compare){if(o.compare===!0)s=k;else if("string"==typeof o.compare)s=l(o.compare);else{if("function"!=typeof o.compare)throw new Error("The `compare` option must be a function, or a string representing an identifying field (or `true` to use JSON.stringify)");s=o.compare}try{q=p.map(s),r=n.map(s)}catch(E){if(this.debug)throw E;a("Merge operation: comparison failed. Falling back to identity checking"),q=p,r=n}}else q=p,r=n;if(v=i(q,r),c(this,m),h(this,m,n),!v.unchanged||!t){for(B=this._transitionManager,this._transitionManager=A=f(this,o&&o.complete),w=[],x=[],u=0;u<this._deps.length;u+=1)if(y=this._deps[u],y&&(z=y[m])){for(j(m,z,w,x),d(this);w.length;)w.pop().merge(v);for(;x.length;)x.pop().update()}for(e(this),C=[],D=m.split(".");D.length;)D.pop(),C[C.length]=D.join(".");g.multiple(this,C,!0),q.length!==r.length&&g(this,m+".length",!0),this._transitionManager=B,A.ready()}}}(I,l,m,o,A,q,r,B,Qd,Rd),Td=function(){return function(){return this.fragment.detach()}}(),Ud=function(a){return function(b,c){if(b=a(b),c=a(c)||null,!b)throw new Error("You must specify a valid target to insert into");b.insertBefore(this.detach(),c),this.fragment.pNode=b}}(jb),Vd=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){return{get:a,set:b,update:c,updateModel:d,animate:e,on:f,off:g,observe:h,fire:i,find:j,findAll:k,findComponent:l,findAllComponents:m,renderHTML:o,toHTML:p,render:n,teardown:q,add:r,subtract:s,toggle:t,merge:u,detach:v,insert:w}}(v,C,D,F,N,O,P,W,X,Y,gb,hb,ib,Id,Jd,Kd,Ld,Nd,Od,Pd,Sd,Td,Ud),Wd=function(){return["partials","transitions","events","components","decorators","data"]}(),Xd=function(){return["el","template","complete","modifyArrays","magic","twoway","lazy","append","preserveWhitespace","sanitize","stripComments","noIntro","transitionsEnabled","adaptors"]}(),Yd=function(a,b,c){return function(d,e){a.forEach(function(a){e[a]&&(d[a]=c(e[a]))}),b.forEach(function(a){d[a]=e[a]})}}(Wd,Xd,c),Zd=function(){return function(a,b){return/_super/.test(a)?function(){var c,d=this._super;return this._super=b,c=a.apply(this,arguments),this._super=d,c}:a}}(),$d=function(){return function(a,b){var c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}}(),_d=function(a,b,c,d){var e,f;return e=a.concat(b),f={},e.forEach(function(a){f[a]=!0}),function(e,g){var h,i;a.forEach(function(a){var b=g[a];b&&(e[a]?d(e[a],b):e[a]=b)}),b.forEach(function(a){var b=g[a];void 0!==b&&(e[a]="function"==typeof b&&"function"==typeof e[a]?c(b,e[a]):g[a])});for(h in g)g.hasOwnProperty(h)&&!f[h]&&(i=g[h],e.prototype[h]="function"==typeof i&&"function"==typeof e.prototype[h]?c(i,e.prototype[h]):i)}}(Wd,Xd,Zd,$d),ae=function(a,b){return function(c,d){a(c.template)&&(c.partials||(c.partials={}),b(c.partials,c.template.partials),d.partials&&b(c.partials,d.partials),c.template=c.template.main)}}(w,$d),be=function(a,b,c){return function(d){var e;if("string"==typeof d.template){if(!c)throw new Error(a.missingParser);if("#"===d.template.charAt(0)&&b){if(e=document.getElementById(d.template.substring(1)),!e||"SCRIPT"!==e.tagName)throw new Error("Could not find template element ("+d.template+")");d.template=c(e.innerHTML,d)}else d.template=c(d.template,d)}}}(xc,f,vd),ce=function(a,b){return function(c){var d;if(c.partials)for(d in c.partials)if(c.partials.hasOwnProperty(d)&&"string"==typeof c.partials[d]){if(!b)throw new Error(a.missingParser);c.partials[d]=b(c.partials[d],c)}}}(xc,vd),de=function(){return function(a){var b,c={};for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c}}(),ee=function(){return function(a){for(var b,c,d=Array.prototype.slice.call(arguments,1);c=d.shift();)for(b in c)c.hasOwnProperty(b)&&(a[b]=c[b]);return a}}(),fe=function(a,b,c,d,e,f,g,h,i,j,k){var l,m,n,o;return l=function(){return{}},m=function(){return[]},n=d(null),g(n,{preserveWhitespace:{enumerable:!0,value:!1},append:{enumerable:!0,value:!1},twoway:{enumerable:!0,value:!0},modifyArrays:{enumerable:!0,value:!0},data:{enumerable:!0,value:l},lazy:{enumerable:!0,value:!1},debug:{enumerable:!0,value:!1},transitions:{enumerable:!0,value:l},decorators:{enumerable:!0,value:l},events:{enumerable:!0,value:l},noIntro:{enumerable:!0,value:!1},transitionsEnabled:{enumerable:!0,value:!0},magic:{enumerable:!0,value:!1},adaptors:{enumerable:!0,value:m}}),o=["components","decorators","events","partials","transitions","data"],function(l,m){var p,q,r,s;for(p in n)void 0===m[p]&&(m[p]="function"==typeof n[p]?n[p]():n[p]);if(g(l,{_initing:{value:!0,writable:!0},_guid:{value:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b,c;return b=16*Math.random()|0,c="x"==a?b:3&b|8,c.toString(16)})},_subs:{value:d(null),configurable:!0},_cache:{value:{}},_cacheMap:{value:d(null)},_deps:{value:[]},_depsMap:{value:d(null)},_patternObservers:{value:[]},_pendingResolution:{value:[]},_deferred:{value:{}},_evaluators:{value:d(null)},_twowayBindings:{value:{}},_transitionManager:{value:null,writable:!0},_animations:{value:[]},nodes:{value:{}},_wrapped:{value:d(null)},_liveQueries:{value:[]},_liveComponentQueries:{value:[]}}),g(l._deferred,{attrs:{value:[]},evals:{value:[]},selectValues:{value:[]},checkboxes:{value:[]},radios:{value:[]},observers:{value:[]},transitions:{value:[]},liveQueries:{value:[]},decorators:{value:[]},focusable:{value:null,writable:!0}}),l.adaptors=m.adaptors,l.modifyArrays=m.modifyArrays,l.magic=m.magic,l.twoway=m.twoway,l.lazy=m.lazy,l.debug=m.debug,l.magic&&!j)throw new Error("Getters and setters (magic mode) are not supported in this browser");if(m._parent&&f(l,"_parent",{value:m._parent}),m.el&&(l.el=h(m.el),!l.el&&l.debug))throw new Error("Could not find container element");if(m.eventDefinitions&&(c("ractive.eventDefinitions has been deprecated in favour of ractive.events. Support will be removed in future versions"),m.events=m.eventDefinitions),o.forEach(function(a){l.constructor[a]?l[a]=e(d(l.constructor[a]||{}),m[a]):m[a]&&(l[a]=m[a])}),q=m.template,"string"==typeof q){if(!k)throw new Error(b.missingParser);if("#"===q.charAt(0)&&a){if(r=document.getElementById(q.substring(1)),!r)throw new Error("Could not find template element ("+q+")");s=k(r.innerHTML,m)}else s=k(q,m)}else s=q;i(s)&&(e(l.partials,s.partials),s=s.main),s&&1===s.length&&"string"==typeof s[0]&&(s=s[0]),l.template=s,e(l.partials,m.partials),l.parseOptions={preserveWhitespace:m.preserveWhitespace,sanitize:m.sanitize,stripComments:m.stripComments},l.transitionsEnabled=m.noIntro?!1:m.transitionsEnabled,a&&!l.el&&(l.el=document.createDocumentFragment()),l.el&&!m.append&&(l.el.innerHTML=""),l.render(l.el,m.complete),l.transitionsEnabled=m.transitionsEnabled,l._initing=!1}}(f,xc,I,c,ee,g,h,jb,w,t,vd),ge=function(a,b,c,d,e){return function(a,c,f){b.forEach(function(a){var b=f[a],e=c[a];"function"==typeof b&&"function"==typeof e?f[a]=d(b,e):void 0===b&&void 0!==e&&(f[a]=e)}),a.beforeInit&&a.beforeInit(f),e(a,f),a.init&&a.init(f)}}(kc,Xd,de,Zd,fe),he=function(a,b,c,d,e,f,g,h){var i;return h.push(function(){i=h.Ractive}),function(h){var i,j=this;return i=function(a){g(this,i,a||{})},i.prototype=a(j.prototype),i.prototype.constructor=i,b(i,j),c(i,h),e(i),d(i,h),f(i),i.extend=j.extend,i}}(c,Yd,_d,ae,be,ce,ge,Eb),ie=function(a,b,c,d,e,f,g,h,i,j,k){var l=function(a){j(this,a)};return c(l,{prototype:{value:d},partials:{value:e},adaptors:{value:f},easing:{value:g},transitions:{value:{}},events:{value:{}},components:{value:{}},decorators:{value:{}},svg:{value:a},VERSION:{value:"0.3.9"}}),l.eventDefinitions=l.events,l.prototype.constructor=l,l.delimiters=["{{","}}"],l.tripleDelimiters=["{{{","}}}"],l.extend=h,l.parse=i,k.Ractive=l,l}(b,c,h,Vd,yc,j,M,he,vd,fe,Eb),je=function(a,b){for("undefined"!=typeof window&&window.Node&&!window.Node.prototype.contains&&window.HTMLElement&&window.HTMLElement.prototype.contains&&(window.Node.prototype.contains=window.HTMLElement.prototype.contains);b.length;)b.pop()();return a}(ie,Eb);"undefined"!=typeof module&&module.exports?module.exports=je:"function"==typeof define&&define.amd?define(function(){return je}):a.Ractive=je}("undefined"!=typeof window?window:this);