')),0<=P.call(this.options.hideTriggers,"closeButton")&&(this.closeButtonElement=this.adapter.create('Close'),this.adapter.append(t,this.closeButtonElement)),this.adapter.append(this.container,this.backgroundCanvas),this.adapter.append(this.container,this.tooltipElement),this.adapter.append(document.body,this.container),this._newContent=!0,this.redraw=!0},C.prototype.setContent=function(t){if(this.content=t,this._newContent=!0,"function"==typeof this.content?(this._contentFunction=this.content,this.content=""):this._contentFunction=null,this.visible)return this._updateElementContent()},C.prototype._updateElementContent=function(){var t;return(this._newContent||!this.options.cache&&this._contentFunction)&&(null!=(t=this.adapter.find(this.container,"."+this.class.content))&&(this._contentFunction&&(this.debug("Executing content function."),this.content=this._contentFunction(this)),this.adapter.update(t,this.content,this.options.escapeContent)),this._newContent=!1),this._storeAndLockDimensions(),this.reposition()},C.prototype._storeAndLockDimensions=function(){var t;if(this.container)return t=this.dimensions,this.adapter.css(this.container,{width:"auto",left:"0px",top:"0px"}),this.dimensions=this.adapter.dimensions(this.container),this.dimensions.width+=1,this.adapter.css(this.container,{width:this.dimensions.width+"px",top:this.currentPosition.top+"px",left:this.currentPosition.left+"px"}),this._dimensionsEqual(this.dimensions,t)?void 0:(this.redraw=!0,this._draw())},C.prototype.activate=function(){return this._setupObservers("hidden","hiding")},C.prototype.deactivate=function(){return this.debug("Deactivating tooltip."),this.hide(),this._setupObservers("-showing","-visible","-hidden","-hiding")},C.prototype._setupObservers=function(){for(var t,n,e,r,i,o,a,s,u,c,l,h,f,d=this,p=1<=arguments.length?v.call(arguments,0):[],g=0,m=p.length;g=this.dimensions.width&&r[0])switch(n=!0,r[0]){case this.STICKS_OUT_LEFT:o.setHorizontal("left"),this.options.targetJoint&&i.setHorizontal("right");break;case this.STICKS_OUT_RIGHT:o.setHorizontal("right"),this.options.targetJoint&&i.setHorizontal("left")}if(a.height>=this.dimensions.height&&r[1])switch(n=!0,r[1]){case this.STICKS_OUT_TOP:o.setVertical("top"),this.options.targetJoint&&i.setVertical("bottom");break;case this.STICKS_OUT_BOTTOM:o.setVertical("bottom"),this.options.targetJoint&&i.setVertical("top")}return!n||(this.options.stem&&(s=o),t=this.getPosition(o,i,s),n=a=!1,(e=this._sticksOut(t))[0]&&e[0]!==r[0]&&(a=!0,o.setHorizontal(this.options.tipJoint.horizontal),this.options.targetJoint)&&i.setHorizontal(this.options.targetJoint.horizontal),e[1]&&e[1]!==r[1]&&(n=!0,o.setVertical(this.options.tipJoint.vertical),this.options.targetJoint)&&i.setVertical(this.options.targetJoint.vertical),a&&n)?u:((a||n)&&(this.options.stem&&(s=o),t=this.getPosition(o,i,s)),{position:t,stem:s})},C.prototype._sticksOut=function(t){var e=this.adapter.scrollOffset(),n=this.adapter.viewportDimensions(),t=[t.left-e[0],t.top-e[1]],e=[!1,!1];return t[0]<0?e[0]=this.STICKS_OUT_LEFT:t[0]+this.dimensions.width>n.width&&(e[0]=this.STICKS_OUT_RIGHT),t[1]<0?e[1]=this.STICKS_OUT_TOP:t[1]+this.dimensions.height>n.height&&(e[1]=this.STICKS_OUT_BOTTOM),e},C.prototype._draw=function(){var t,e,n,i,o,r,a,s,u,c,l,h,f,d,p=this;if(this.backgroundCanvas&&this.redraw){if(this.debug("Drawing background."),this.redraw=!1,this.currentStem){for(l=0,h=(f=["top","right","bottom","left"]).length;l "+t)),i=n.node||r.fragment&&r.fragment.rendered&&r.find("*"))&&e.push(i),console.warn.apply(console,["%cRactive.js: %c"+t,"color: rgb(114, 157, 52);","color: rgb(85, 85, 85);"].concat(e))},ot=function(){console.log.apply(console,arguments)}):at=ot=st=v;var dt='A function was specified for "%s" %s, but no %s was returned',pt=function(t,e){return'Missing "'+t+'" '+e+" plugin. You may need to download a plugin via http://docs.ractivejs.org/latest/plugins#"+e+"s"};function gt(t,e,n){e=mt(t,e,n);return e?e[t][n]:null}function mt(t,e,n){for(;e;){if(n in e[t])return e;if(e.isolated)return null;e=e.parent}}var yt=function(t,e,n,r){if(t===e)return vt(e);if(r){n=gt("interpolators",n,r);if(n)return n(t,e)||vt(e);h(pt(r,"interpolator"))}return _t.number(t,e)||_t.array(t,e)||_t.object(t,e)||vt(e)};function vt(t){return function(){return t}}var _t={number:function(e,t){var n;return s(e)&&s(t)?(n=(t=+t)-(e=+e))?function(t){return e+t*n}:function(){return e}:null},array:function(t,e){var n,r,i,o;if(!g(t)||!g(e))return null;for(n=[],r=[],o=i=Math.min(t.length,e.length);o--;)r[o]=yt(t[o],e[o]);for(o=i;o=this.duration?(null!==r&&(A.start(this.root),this.root.viewmodel.set(r,this.to),A.end()),this.step&&this.step(1,this.to),this.complete(this.to),-1===(n=this.root._animations.indexOf(this))&&m("Animation was not found"),this.root._animations.splice(n,1),this.running=!1):(n=this.easing?this.easing(t/this.duration):t/this.duration,null!==r&&(e=this.interpolator(n),A.start(this.root),this.root.viewmodel.set(r,e),A.end()),this.step&&this.step(n,e),!0))},stop:function(){var t;this.running=!1,-1===(t=this.root._animations.indexOf(this))&&m("Animation was not found"),this.root._animations.splice(t,1)}},pe),be={stop:v};function we(t,e,n,r){var i,o,a;return null!==(e=e&&p(_(e)))&&(a=t.viewmodel.get(e)),ve.abort(e,t),f(a,n)?(r.complete&&r.complete(r.to),be):(r.easing&&"function"!=typeof(i="function"==typeof r.easing?r.easing:t.easing[r.easing])&&(i=null),o=void 0===r.duration?400:r.duration,e=new _e({keypath:e,from:a,to:n,root:t,duration:o,easing:i,interpolator:r.interpolator,step:r.step,complete:r.complete}),ve.add(e),t._animations.push(e),e)}function xe(){return this.detached||(this.el&&w(this.el.__ractive_instances__,this),this.detached=this.fragment.detach(),Se.fire(this)),this.detached}var Se=new e("detach");function Te(t){return this.el?this.fragment.find(t):null}function Ae(t,e){if(this._isComponentQuery?!this.selector||t.name===this.selector:t.node?u(t.node,this.selector):null)return this.push(t.node||t.instance),e||this._makeDirty(),!0}function ke(){var t=this._root[this._isComponentQuery?"liveComponentQueries":"liveQueries"],e=this.selector,n=t.indexOf(e);-1!==n&&(t.splice(n,1),t[e]=null)}var Pe=function(t,e){for(var n,r,i=Ee(t.component||t._ractive.proxy),o=Ee(e.component||e._ractive.proxy),a=b(i),s=b(o);a&&a===s;)i.pop(),o.pop(),n=a,a=b(i),s=b(o);if(a=a.component||a,s=s.component||s,(t=a.parentFragment)===(e=s.parentFragment))return t.items.indexOf(a)-e.items.indexOf(s)||i.length-o.length;if(r=n.fragments)return r.indexOf(t)-r.indexOf(e)||i.length-o.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!")};function Ce(t){var e;return(e=t.parentFragment)||t.component&&(e=t.component.parentFragment)?e.owner:void 0}function Ee(t){for(var e=[t],n=Ce(t);n;)e.push(n),n=Ce(n);return e}function Oe(){this.sort(this._isComponentQuery?Pe:Re),this._dirty=!1}function Me(){var t=this;this._dirty||(this._dirty=!0,A.scheduleTask(function(){t._sort()}))}function Le(t){-1!==(t=this.indexOf(this._isComponentQuery?t.instance:t))&&this.splice(t,1)}var Re=function(t,e){return t.compareDocumentPosition?2&t.compareDocumentPosition(e)?1:-1:Pe(t,e)},De=function(t,e,n,r){var i=[];return J(i,{selector:{value:e},live:{value:n},_isComponentQuery:{value:r},_test:{value:Ae}}),n&&J(i,{cancel:{value:ke},_root:{value:t},_sort:{value:Oe},_makeDirty:{value:Me},_remove:{value:Le},_dirty:{value:!1,writable:!0}}),i};function Ne(t,e){var n,r;return this.el?(e=e||{},n=this._liveQueries,(r=n[t])?e&&e.live?r:r.slice():((r=De(this,t,!!e.live,!1)).live&&(n.push(t),n["_"+t]=r),this.fragment.findAll(t,r),r)):[]}function je(t,e){var n,r;return e=e||{},n=this._liveComponentQueries,(r=n[t])?e&&e.live?r:r.slice():((r=De(this,t,!!e.live,!0)).live&&(n.push(t),n["_"+t]=r),this.fragment.findAllComponents(t,r),r)}function Ie(t){return this.fragment.findComponent(t)}function Ve(t){return this.container?this.container.component&&this.container.component.name===t?this.container:this.container.findContainer(t):null}function Fe(t){return this.parent?this.parent.component&&this.parent.component.name===t?this.parent:this.parent.findParent(t):null}var Ge={enqueue:function(t,e){t.event&&(t._eventQueue=t._eventQueue||[],t._eventQueue.push(t.event)),t.event=e},dequeue:function(t){t._eventQueue&&t._eventQueue.length?t.event=t._eventQueue.pop():delete t.event}},ze=function(t,e){var n=void 0===arguments[2]?{}:arguments[2];e&&(n.event?n.event.name=e:n.event={name:e,_noArg:!0},e=p(e).wildcardMatches(),function t(e,n,r,i){var o=void 0!==arguments[4]&&arguments[4];var a,s,u=!0;Ge.enqueue(e,r);for(s=n.length;0<=s;s--)(a=e._subs[n[s]])&&(u=Ye(e,a,r,i)&&u);Ge.dequeue(e);e.parent&&u&&(o&&e.component&&(o=e.component.name+"."+n[n.length-1],n=p(o).wildcardMatches(),r)&&(r.component=e),t(e.parent,n,r,i))}(t,e,n.event,n.args,!0))};function Ye(t,e,n,r){var i=null,o=!1;n&&!n._noArg&&(r=[n].concat(r));for(var a=0,s=(e=e.slice()).length;a\~:]))+)((?::[^\s\+\>\~\(]+(?:\([^\)]+\))?)?\s*[\s\+\>\~]?)\s*/g,En=/^@media/,On=/\[data-ractive-css~="\{[a-z0-9-]+\}"]/g;function Mn(t){return t.trim?t.trim():t.replace(/^\s+/,"").replace(/\s+$/,"")}function Ln(t){return t.str}var Rn=1,Dn={name:"css",extend:function(t,e,n){var r;n.css&&(r=Rn++,n=n.noCssTransform?n.css:An(n.css,r),e.cssId=r,wn.add({id:r,styles:n}))},init:function(){}};var Nn={name:"data",extend:function(t,e,n){var r,i=void 0;if(n.data&&l(n.data))for(i in n.data)(r=n.data[i])&&"object"==typeof r&&(l(r)||g(r))&&m("Passing a `data` option with object and array properties to Ractive.extend() is discouraged, as mutating them is likely to cause bugs. Consider using a data function instead:\n\n // this...\n data: function () {\n return {\n myObject: {}\n };\n })\n\n // instead of this:\n data: {\n myObject: {}\n }");e.data=jn(e.data,n.data)},init:function(t,e,n){t=jn(t.prototype.data,n.data);return(t="function"==typeof t?t.call(e):t)||{}},reset:function(t){var e=this.init(t.constructor,t,t.viewmodel);return t.viewmodel.reset(e),!0}};function jn(t,e){(n=e)&&n.constructor!==Object&&"function"!=typeof n&&("object"!=typeof n?h("data option must be an object or a function, `"+n+"` is not valid"):m("If supplied, options.data should be a plain JavaScript object - using a non-POJO as the root object may work, but is discouraged"));var n,r="function"==typeof t,i="function"==typeof e;return e||r||(e={}),r||i?function(){return Vn(i?In(e,this):e,r?In(t,this):t)}:Vn(e,t)}function In(t,e){t=t.call(e);if(t)return"object"!=typeof t&&h("Data function must return an object"),t.constructor!==Object&&d("Data function returned something other than a plain JavaScript object. This might work, but is strongly discouraged"),t}function Vn(t,e){if(t&&e){for(var n in e)n in t||(t[n]=e[n]);return t}return t||e}var Fn,Gn=/^\s+/,zn=function(t){this.name="ParseError",this.message=t;try{throw new Error(t)}catch(t){this.stack=t.stack}},n=(zn.prototype=Error.prototype,(Fn=function(t,e){var n,r,i=0;for(this.str=t,this.options=e||{},this.pos=0,this.lines=this.str.split("\n"),this.lineEnds=this.lines.map(function(t){t=i+t.length+1;return i=t},0),this.init&&this.init(t,e),n=[];this.pos=this.lineEnds[e];)n=this.lineEnds[e],e+=1;return[e+1,1+(t-n),t]},error:function(t){var n=this.getLinePos(this.pos),e=n[0],r=n[1],i=this.lines[n[0]-1],o=0,i=i.replace(/\t/g,function(t,e){return e> >>> < <= > >= in instanceof == != === !== & ^ | && ||".split(" "),Zr=C,Jr=0,Kr=$r.length;Jr")&&(t.allowWhitespace(),t.pos,t.relaxedNames=!0,r=E(t),t.relaxedNames=!1,t.allowWhitespace(),n=E(t),t.allowWhitespace(),r)?(ri(r,r={t:Wn}),t.allowWhitespace(),n&&ri(n,r={t:k,n:ur,f:[r]}),t.matchString(e.close)||t.error("Expected closing delimiter '"+e.close+"'"),r):null}function ui(t,e){var n;return t.matchString("!")?-1!==(n=t.remaining().indexOf(e.close))?(t.pos+=n+e.close.length,{t:qn}):void 0:null}var ci=function(t,e){var n,r,i;if(n=t.pos,!(r=E(t)))return null;for(i=0;i/g,Gi=/&/g,zi=/^\s*\r?\n/,Yi=/\r?\n\s*$/;function Ui(t){return"string"==typeof t}function Bi(t){return(t.t===k||t.t===Bn)&&t.f}function Hi(t,e,n){var r;e&&"string"==typeof(r=t[0])&&((r=r.replace(e,""))?t[0]=r:t.shift()),n&&"string"==typeof(r=b(t))&&((r=r.replace(n,""))?t[t.length-1]=r:t.pop())}var Wi=function t(e,n,r,i,o){var a,s,u,c,l,h,f;Li(e);a=e.length;for(;a--;)((s=e[a]).exclude||n&&s.t===qn)&&e.splice(a,1);Hi(e,i?Qi:null,o?$i:null);a=e.length;for(;a--;){var d;if((s=e[a]).f&&(d=s.t===Hn&&Xi.test(s.e),c=r||d,!r&&d&&Hi(s.f,Zi,Ji),!c&&(d=e[a-1],u=e[a+1],(!d||"string"==typeof d&&$i.test(d))&&(l=!0),!u||"string"==typeof u&&Qi.test(u))&&(h=!0),t(s.f,n,c,l,h)),s.l&&(t(s.l.f,n,r,l,h),e.splice(a+1,0,s.l),delete s.l),s.a)for(f in s.a)s.a.hasOwnProperty(f)&&"string"!=typeof s.a[f]&&t(s.a[f],n,r,l,h);if(s.m&&t(s.m,n,r,l,h),s.v)for(f in s.v)s.v.hasOwnProperty(f)&&(g(s.v[f].n)&&t(s.v[f].n,n,r,l,h),g(s.v[f].d))&&t(s.v[f].d,n,r,l,h)}a=e.length;for(;a--;)"string"==typeof e[a]&&("string"==typeof e[a+1]&&(e[a]=e[a]+e[a+1],e.splice(a+1,1)),r||(e[a]=e[a].replace(qi," ")),""===e[a])&&e.splice(a,1)},qi=/[ \t\f\r\n]+/g,Xi=/^(?:pre|script|style|textarea)$/i,Qi=/^[ \t\f\r\n]+/,$i=/[ \t\f\r\n]+$/,Zi=/^(?:\r\n|\r|\n)/,Ji=/(?:\r\n|\r|\n)$/;var Ki=function(t){var e,n;if(e=t.pos,!t.matchString(""))return null;if(n=t.matchPattern(to))return t.inside&&n!==t.inside?(t.pos=e,null):{t:14,e:n};t.pos-=2,t.error("Illegal closing tag")},to=/^([a-zA-Z]{1,}:?[a-zA-Z0-9\-]*)\s*\>/;var eo=function(t,e){for(var n,r,i=e.length;i--;){if(!(n=t.indexOf(e[i])))return 0;-1!==n&&(!r||n\s]/.test(t.nextChar())||t.error("Expected `=`, `/`, `>` or whitespace");if(t.allowWhitespace(),!t.matchString("="))return t.pos=e,null;t.allowWhitespace(),e=t.pos,n=t.sectionDepth,null===(r=ao(t,"'")||ao(t,'"')||function(t){var e,n;t.inAttribute=!0,e=[],n=gr(t)||oo(t);for(;null!==n;)e.push(n),n=gr(t)||oo(t);return e.length?(t.inAttribute=!1,e):null}(t))&&t.error("Expected valid attribute value");t.sectionDepth!==n&&(t.pos=e,t.error("An attribute value must contain as many opening section tags as closing section tags"));return r.length?1!==r.length||"string"!=typeof r[0]?r:Oi(r[0]):""}(t))&&(e.value=t);return e},ro=/^[^\s"'>\/=]+/,io=/^[^\s"'=<>`]+/;function oo(t){var e,n,r=t.pos,i=t.matchPattern(io);return i?(n=i,e=t.tags.map(function(t){return t.open}),-1!==(n=eo(n,e))&&(i=i.substr(0,n),t.pos=r+i.length),i):null}function ao(t,e){var n,r,i=t.pos;if(!t.matchString(e))return null;for(t.inAttribute=e,n=[],r=gr(t)||so(t,e);null!==r;)n.push(r),r=gr(t)||so(t,e);return t.matchString(e)?(t.inAttribute=!1,n):(t.pos=i,null)}function so(t,e){t.pos;var n=t.remaining(),r=t.tags.map(function(t){return t.open});return r.push(e),-1===(e=eo(n,r))&&t.error("Quoted attribute value must have a closing quote"),e?(t.pos+=e,n.substr(0,e)):null}var uo={true:!0,false:!1,undefined:void 0,null:null},co=new RegExp("^(?:"+Object.keys(uo).join("|")+")"),lo=/^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/,ho=/\$\{([^\}]+)\}/g,fo=/^\$\{([^\}]+)\}/,po=/^\s*$/,go=n.extend({init:function(t,e){this.values=e.values,this.allowWhitespace()},postProcess:function(t){return 1===t.length&&po.test(this.leftover)?{value:t[0].v}:null},converters:[function(t){var e;return t.values?(e=t.matchPattern(fo))&&t.values.hasOwnProperty(e)?{v:t.values[e]}:void 0:null},function(t){if(t=t.matchPattern(co))return{v:uo[t]}},function(t){if(t=t.matchPattern(lo))return{v:+t}},function(t){var n,e=Sr(t);return e&&(n=t.values)?{v:e.v.replace(ho,function(t,e){return e in n?n[e]:e})}:e},function(t){var e,n,r;if(t.matchString("{")){if(e={},t.allowWhitespace(),t.matchString("}"))return{v:e};for(;r=void 0,(n=t).allowWhitespace(),n=(r=Or(n))&&(r={key:r},n.allowWhitespace(),n.matchString(":"))&&(n.allowWhitespace(),n=n.read())?(r.value=n.v,r):null;){if(e[n.key]=n.value,t.allowWhitespace(),t.matchString("}"))return{v:e};if(!t.matchString(","))return null}}return null},function(t){var e,n;if(t.matchString("[")){if(e=[],t.allowWhitespace(),t.matchString("]"))return{v:e};for(;n=t.read();){if(e.push(n.v),t.allowWhitespace(),t.matchString("]"))return{v:e};if(!t.matchString(","))return null;t.allowWhitespace()}}return null}]}),mo=function(t,e){return new go(t,{values:e}).result},yo=function(t,e){var n,r,i,o,a,s;if("string"==typeof t){var u;if(r=vo.exec(t))return u=t.lastIndexOf(")"),_o.test(t)||e.error("Invalid input after method call expression '"+t.slice(u+1)+"'"),n={m:r[1]},e="["+t.slice(n.m.length+1,u)+"]",r=new bo(e),n.a=ni(r.result[0]),n;if(-1===t.indexOf(":"))return t.trim();t=[t]}if(n={},a=[],s=[],t){for(;t.length;){if("string"==typeof(i=t.shift())&&-1!==(o=i.indexOf(":"))){o&&a.push(i.substr(0,o)),i.length>o+1&&(s[0]=i.substring(o+1));break}a.push(i)}s=s.concat(t)}a.length?s.length||"string"!=typeof a?(n={n:1===a.length&&"string"==typeof a[0]?a[0]:a},1===s.length&&"string"==typeof s[0]?(u=mo("["+s[0]+"]"),n.a=u?u.value:s[0].trim()):n.d=s):n=a:n="";return n},vo=/^([a-zA-Z_$][a-zA-Z_$0-9]*)\(/,_o=/\)\s*$/;var bo=n.extend({converters:[E]}),wo=/^[a-zA-Z]{1,}:?[a-zA-Z0-9\-]*/,xo=/^[\s\n\/>]/,So=/^on/,To=/^on-([a-zA-Z\\*\\.$_][a-zA-Z\\*\\.$_0-9\-]+)$/,Ao=/^(?:change|reset|teardown|update|construct|config|init|render|unrender|detach|insert)$/,ko={"intro-outro":"t0",intro:"t1",outro:"t2",decorator:"o"},Po={exclude:!0},Co={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]};var Eo=function(t){return t.replace(Oo,"\\$&")},Oo=/[-/\\^$*+?.()|[\]{}]/g;var Mo,Lo=/^/;var No=/^#\s*partial\s+/;var jo=function(t,e){return new Go(t,e||{}).result},Io=[si,ai,vi,hi,li,ui],Vo=[oi],Fo=[ai,vi,li],Go=void 0;var zo=[gr,Pi,function(r){var t,i,e,n,o,a,s,u,c,l,h,f;if(t=r.pos,r.inside||r.inAttribute)return null;if(!r.matchString("<"))return null;if("/"===r.nextChar())return null;i={},r.includeLinePositions&&(i.p=r.getLinePos(t));if(r.matchString("!"))i.t=$n,r.matchPattern(/^doctype/i)||r.error("Expected DOCTYPE declaration"),i.a=r.matchPattern(/^(.+?)>/);else{if(i.t=Hn,i.e=r.matchPattern(wo),!i.e)return null;for(xo.test(r.nextChar())||r.error("Illegal tag name"),n=function(t,e){var n=e.n||e;Ao.test(n)&&(r.pos-=n.length,r.error("Cannot use reserved event names (change, reset, teardown, update, construct, config, init, render, unrender, detach, insert)")),i.v[t]=e},r.allowWhitespace();o=gr(r)||no(r);)o.name?(e=ko[o.name])?i[e]=yo(o.value,r):(e=To.exec(o.name))?(i.v||(i.v={}),a=yo(o.value,r),n(e[1],a)):r.sanitizeEventAttributes&&So.test(o.name)||(i.a||(i.a={}),i.a[o.name]=o.value||(""===o.value?"":0)):(i.m||(i.m=[]),i.m.push(o)),r.allowWhitespace();if(r.allowWhitespace(),r.matchString("/")&&(s=!0),!r.matchString(">"))return null;var d,p,g=i.e.toLowerCase(),m=r.preserveWhitespace;if(!s&&!Di.test(i.e)){r.elementStack.push(g),"script"!==g&&"style"!==g||(r.inside=g),u=[],c=y(null);do{f=r.pos,d=r.remaining(),!function(t,e){return e=/^<([a-zA-Z][a-zA-Z0-9]*)/.exec(e),t=Co[t],!e||!t||!~t.indexOf(e[1].toLowerCase())}(g,d)?h=!0:(d=Ki(r))?(h=!0,(d=d.e.toLowerCase())!==g&&(r.pos=f,~r.elementStack.indexOf(d)||(p="Unexpected closing tag",Di.test(d)&&(p+=" (<"+d+"> is a void element - it cannot contain children)"),r.error(p)))):(d=di(r,{open:r.standardDelimiters[0],close:r.standardDelimiters[1]}))?(h=!0,r.pos=f):(d=r.read(Yo))?(c[d.n]&&(r.pos=f,r.error("Duplicate partial definition")),Wi(d.f,r.stripComments,m,!m,!m),c[d.n]=d.f,l=!0):(d=r.read(zo))?u.push(d):h=!0}while(!h);u.length&&(i.f=u),l&&(i.p=c),r.elementStack.pop()}if(r.inside=null,r.sanitizeElements&&-1!==r.sanitizeElements.indexOf(g))return Po}return i},function(t){var e,n,r;e=t.remaining(),r=t.inside?""+t.inside:"<",r=t.inside&&!t.interpolate[t.inside]?e.indexOf(r):(n=(n=t.tags.map(function(t){return t.open})).concat(t.tags.map(function(t){return"\\"+t.open})),!0===t.inAttribute?n.push('"',"'","=","<",">","`"):t.inAttribute?n.push(t.inAttribute):n.push(r),eo(e,n));if(!r)return null;-1===r&&(r=e.length);return t.pos+=r,t.inside?e.substr(0,r):Oi(e.substr(0,r))}],Yo=[function(t){var e=t.pos,n=t.standardDelimiters[0],r=t.standardDelimiters[1],i=void 0,o=void 0;if(!t.matchPattern(Lo)||!t.matchString(n))return t.pos=e,null;var a=t.matchPattern(Ro);if(d("Inline partial comments are deprecated.\nUse this...\n {{#partial "+a+"}} ... {{/partial}}\n\n...instead of this:\n \x3c!-- {{>"+a+"}} --\x3e ... \x3c!-- {{/"+a+"}} --\x3e'"),!t.matchString(r)||!t.matchPattern(Do))return t.pos=e,null;i=[];var s=new RegExp("^\x3c!--\\s*"+Eo(n)+"\\s*\\/\\s*"+a+"\\s*"+Eo(r)+"\\s*--\x3e");for(;t.matchPattern(s)?o=!0:((Mo=t.read(zo))||t.error("expected closing comment ('\x3c!-- "+n+"/"+a+r+" --\x3e')"),i.push(Mo)),!o;);return{t:17,f:i,n:a}},function(t){e=t.pos;var e,n,r,i,o=t.standardDelimiters;if(!t.matchString(o[0]))return null;if(!t.matchPattern(No))return t.pos=e,null;(e=t.matchPattern(/^[a-zA-Z_$][a-zA-Z_$0-9\-]*/))||t.error("expected legal partial name");t.matchString(o[1])||t.error("Expected closing delimiter '"+o[1]+"'");n=[];for(;(r=di(t,{open:t.standardDelimiters[0],close:t.standardDelimiters[1]}))?("partial"===!r.r&&t.error("Expected "+o[0]+"/partial"+o[1]),i=!0):((r=t.read(zo))||t.error("Expected "+o[0]+"/partial"+o[1]),n.push(r)),!i;);return{t:17,n:e,f:n}}],Go=n.extend({init:function(t,e){var n=e.tripleDelimiters||["{{{","}}}"],r=e.staticDelimiters||["[[","]]"],i=e.staticTripleDelimiters||["[[[","]]]"];this.standardDelimiters=e.delimiters||["{{","}}"],this.tags=[{isStatic:!1,isTriple:!1,open:this.standardDelimiters[0],close:this.standardDelimiters[1],readers:Io},{isStatic:!1,isTriple:!0,open:n[0],close:n[1],readers:Vo},{isStatic:!0,isTriple:!1,open:r[0],close:r[1],readers:Fo},{isStatic:!0,isTriple:!0,open:i[0],close:i[1],readers:Vo}],this.sortMustacheTags(),this.sectionDepth=0,this.elementStack=[],this.interpolate={script:!e.interpolate||!1!==e.interpolate.script,style:!e.interpolate||!1!==e.interpolate.style},!0===e.sanitize&&(e.sanitize={elements:"applet base basefont body frame frameset head html isindex link meta noframes noscript object param script style title".split(" "),eventAttributes:!0}),this.stripComments=!1!==e.stripComments,this.preserveWhitespace=e.preserveWhitespace,this.sanitizeElements=e.sanitize&&e.sanitize.elements,this.sanitizeEventAttributes=e.sanitize&&e.sanitize.eventAttributes,this.includeLinePositions=e.includeLinePositions},postProcess:function(t){return t.length?(0 element")},isHashedId:Wo,isParsed:function(t){return!("string"==typeof t)},getParseOptions:function(n){n.defaults&&(n=n.defaults);return Uo.reduce(function(t,e){return t[e]=n[e],t},{})},createHelper:function(n){var t=y(Bo);return t.parse=function(t,e){return Ho(t,e||n)},t},parse:Ho};function Ho(t,e){if(jo)return jo(t,e||this.options);throw new Error("Missing Ractive.parse - cannot parse template. Either preparse or use the version that includes the parser")}function Wo(t){return t&&"#"===t[0]}var O=Bo;function qo(t,e){n=O.getParseOptions(t),(r=y(O)).parse=function(t,e){return O.parse(t,e||n)};var n,r;return e.call(t,r)}function Xo(t,e){if("string"==typeof t)"#"===t[0]&&(t=O.fromId(t)),t=jo(t,O.getParseOptions(e));else{if(null==t)throw new Error("The template cannot be "+t+".");if("number"!=typeof t.v)throw new Error("The template parser was passed a non-string template, but the template doesn't have a version. Make sure you're passing in the template you think you are.");if(3!==t.v)throw new Error("Mismatched template version (expected 3, got "+t.v+") Please ensure you are using the latest version of Ractive.js in your build process as well as in your app")}return t}function Qo(t,e,n){if(e)for(var r in e)!n&&t.hasOwnProperty(r)||(t[r]=e[r])}var $o={name:"template",extend:function(t,e,n){"template"in n&&(n=n.template,e.template="function"==typeof n?n:Xo(n,e))},init:function(t,e,n){n=("template"in n?n:t.prototype).template;"function"==typeof n&&(n=qo(e,t=n),e._config.template={fn:t,result:n}),n=Xo(n,e),e.template=n.t,n.p&&Qo(e.partials,n.p)},reset:function(t){var e=function(t){var e,n=t._config.template;if(n&&n.fn&&(e=qo(t,n.fn))!==n.result)return e=Xo(n.result=e,t)}(t);if(e)return e=Xo(e,t),t.template=e.t,Qo(t.partials,e.p,!0),!0}},C=["adaptors","components","computed","decorators","easing","events","interpolators","partials","transitions"],Zo=function(t,e){this.name=t,this.useDefaults=e};Zo.prototype={constructor:Zo,extend:function(t,e,n){this.configure(this.useDefaults?t.defaults:t,this.useDefaults?e:e.constructor,n)},init:function(){},configure:function(t,e,n){var r,i=this.name,o=n[i],a=y(t[i]);for(r in o)a[r]=o[r];e[i]=a},reset:function(t){var n=t[this.name],r=!1;return Object.keys(n).forEach(function(t){var e=n[t];e._fn&&(e._fn.isOwner?n[t]=e._fn:delete n[t],r=!0)}),r}};var Jo=C.map(function(t){return new Zo(t,"computed"===t)}),Ko=function(t,r,i){var o;return/_super/.test(i)?((o=function(){var t=function(t,e){var n;t=e in t?(n=t[e],"function"==typeof n?n:function(){return n}):v;return t}(o._parent,r),e="_super"in this,n=this._super;return this._super=t,t=i.apply(this,arguments),e?this._super=n:delete this._super,t})._parent=t,o._method=i,o):i};var ta=function(t){na(t,"beforeInit","onconstruct"),na(t,"init","onrender"),na(t,"complete","oncomplete"),na(t,"eventDefinitions","events"),g(t.adaptors)&&na(t,"adaptors","adapt")};function ea(t,e,n){return"options."+t+" has been deprecated in favour of options."+e+"."+(n?" You cannot specify both options, please use options."+e+".":"")}function na(t,e,n){if(e in t){if(n in t)throw new Error(ea(e,n,!0));m(ea(e,n)),t[n]=t[e]}}function ra(e,n,r,i){for(var t in ta(i),i){var o;ua.hasOwnProperty(t)&&(o=i[t],"el"!==t&&"function"==typeof o?m(t+" is a Ractive option that does not expect a function and will be ignored","init"===e?r:null):r[t]=o)}Jo.forEach(function(t){t[e](n,r,i)}),Tn[e](n,r,i),$o[e](n,r,i),Dn[e](n,r,i);var a,s,u=n.prototype,c=r,l=i;for(a in l)!ca[a]&&l.hasOwnProperty(a)&&("function"==typeof(s=l[a])&&(s=Ko(u,a,s)),c[a]=s)}function ia(t){var e={};return t.forEach(function(t){return e[t]=!0}),e}function oa(){this.dirtyValue=this.dirtyArgs=!0,this.bound&&"function"==typeof this.owner.bubble&&this.owner.bubble()}var aa,sa={adapt:Tn,css:Dn,data:Nn,template:$o},ua=ia((n=Object.keys(H)).filter(function(t){return!sa[t]})),ca=ia(n.concat(Jo.map(function(t){return t.name}))),la={extend:function(t,e,n){return ra("extend",t,e,n)},init:function(t,e,n){return ra("init",t,e,n)},reset:function(e){return aa.filter(function(t){return t.reset&&t.reset(e)}).map(function(t){return t.name})},order:aa=[].concat(n.filter(function(t){return!Jo[t]&&!sa[t]}),Jo,sa.data,sa.template,sa.css)};function ha(){var e;return 1!==this.items.length?(e=document.createDocumentFragment(),this.items.forEach(function(t){t=t.detach();t&&e.appendChild(t)}),e):this.items[0].detach()}function fa(t){var e,n,r;if(this.items){for(n=this.items.length,e=0;e=r.length?"_"+e:void 0===(e=r[e])?"undefined":e.isSpecial?"number"==typeof(n=e.value)?n:'"'+n+'"':e.str})),this.keypath=p("${"+this.uniqueString.replace(/[\.\[\]]/g,"-").replace(/\*/,"#MUL#")+"}"),this.createEvaluator(),this.callback(this.keypath))},unbind:function(){for(var t;t=this.refResolvers.pop();)t.unbind()},resolve:function(t,e){this.keypaths[t]=e,this.bubble()},createEvaluator:function(){var e,n,r=this,t=this.keypath,i=this.root.viewmodel.computations[t.str];i?this.root.viewmodel.mark(t):(n=Va(this.str,this.refResolvers.length),e=this.keypaths.map(function(e){var t;return"undefined"===e?function(){}:e.isSpecial?(t=e.value,function(){return t}):function(){var t=r.root.viewmodel.get(e,{noUnwrap:!0,fullRootGet:!0});return t="function"==typeof t?function(t,e){var n,r,i;if(t.__ractive_nowrap)return t;{if(r="__ractive_"+e._guid,n=t[r])return n;if(/this/.test(t.toString())){for(i in a(t,r,{value:Ga.call(t,e),configurable:!0}),t)t.hasOwnProperty(i)&&(t[r][i]=t[i]);return e._boundFunctions.push({fn:t,prop:r}),t[r]}}return a(t,"__ractive_nowrap",{value:t}),t.__ractive_nowrap}(t,r.root):t}}),i={deps:this.keypaths.filter(Ua),getter:function(){var t=e.map(Ya);return n.apply(null,t)}},this.root.viewmodel.compute(t,i))},rebind:function(e,n){this.refResolvers.forEach(function(t){return t.rebind(e,n)})}},C);function Ya(t){return t.call()}function Ua(t){return void 0!==t&&"@"!==t[0]}function Ba(t,e,n){var r=this;this.resolver=e,this.root=e.root,this.parentFragment=n,this.viewmodel=e.root.viewmodel,"string"==typeof t?this.value=t:t.t===tr?this.refResolver=Ia(this,t.n,function(t){r.resolve(t)}):new za(e,n,t,function(t){r.resolve(t)})}function Ha(t,e,n){var r,i,o=this;this.parentFragment=i=t.parentFragment,this.root=r=t.root,this.mustache=t,this.ref=t=e.r,this.callback=n,this.unresolved=[],(n=Jt(r,t,i))?this.base=n:this.baseResolver=new Ea(this,t,function(t){o.base=t,o.baseResolver=null,o.bubble()}),this.members=e.m.map(function(t){return new Wa(t,o,i)}),this.ready=!0,this.bubble()}Ba.prototype={resolve:function(t){this.keypath&&this.viewmodel.unregister(this.keypath,this),this.keypath=t,this.value=this.viewmodel.get(t),this.bind(),this.resolver.bubble()},bind:function(){this.viewmodel.register(this.keypath,this)},rebind:function(t,e){this.refResolver&&this.refResolver.rebind(t,e)},setValue:function(t){this.value=t,this.resolver.bubble()},unbind:function(){this.keypath&&this.viewmodel.unregister(this.keypath,this),this.refResolver&&this.refResolver.unbind()},forceResolution:function(){this.refResolver&&this.refResolver.forceResolution()}};var Wa=Ba;function qa(t){return t.value}function Xa(t){return null!=t}function Qa(t){t.forceResolution()}Ha.prototype={getKeypath:function(){var t=this.members.map(qa);return!t.every(Xa)||this.baseResolver?null:this.base.join(t.join("."))},bubble:function(){this.ready&&!this.baseResolver&&this.callback(this.getKeypath())},unbind:function(){this.members.forEach(S)},rebind:function(e,n){var r,t;this.base&&(t=this.base.replace(e,n))&&t!==this.base&&(this.base=t,r=!0),this.members.forEach(function(t){t.rebind(e,n)&&(r=!0)}),r&&this.bubble()},forceResolution:function(){this.baseResolver&&(this.base=p(this.ref),this.baseResolver.unbind(),this.baseResolver=null),this.members.forEach(Qa),this.bubble()}};var $a=Ha;var Za=function(e,n){this.fragments&&this.fragments.forEach(function(t){return t.rebind(e,n)});this.resolver&&this.resolver.rebind(e,n)};function Ja(t){this.type=Yn,M.init(this,t)}var M={getValue:ka,init:function(r,t){var e,n;e=t.parentFragment,n=t.template,r.root=e.root,r.parentFragment=e,r.pElement=e.pElement,r.template=t.template,r.index=t.index||0,r.isStatic=t.template.s,r.type=t.template.t,r.registered=!1,(n=n.r)&&(r.resolver=Ia(r,n,function(t){r.resolve(t)}));t.template.x&&(r.resolver=new za(r,e,t.template.x,i));t.template.rx&&(r.resolver=new $a(r,t.template.rx,i));r.template.n!==P||r.hasOwnProperty("value")||r.setValue(void 0);function i(e){var n=r.keypath;e!=n&&(r.resolve(e),void 0!==n)&&r.fragments&&r.fragments.forEach(function(t){t.rebind(n,e)})}},resolve:function(t){var e,n;t&&t.isSpecial?(this.keypath=t,this.setValue(t.value)):(this.registered&&(this.root.viewmodel.unregister(this.keypath,this),this.registered=!1,e=!0),null!=(this.keypath=t)&&(n=this.root.viewmodel.get(t),this.root.viewmodel.register(t,this),this.registered=!0),this.setValue(n),e&&(t=this.twowayBinding)&&t.rebound())},rebind:Za},Ka=(Ja.prototype={update:function(){this.node.data=null==this.value?"":this.value},resolve:M.resolve,rebind:M.rebind,detach:xa,unbind:Aa,render:function(){return this.node||(this.node=document.createTextNode(Z(this.value))),this.node},unrender:function(t){t&&$(this.node)},getValue:M.getValue,setValue:function(t){var e;f(t=this.keypath&&(e=this.root.viewmodel.wrapped[this.keypath.str])?e.get():t,this.value)||(this.value=t,this.parentFragment.bubble(),this.node&&A.addView(this))},firstNode:function(){return this.node},toString:function(t){var e=""+Z(this.value);return t?Mi(e):e}},Ja);function ts(t){t.rebind("","")}function es(t,e,n){var r;e===sr&&t.indexRefs&&t.indexRefs[0]&&(r=t.indexRefs[0],(n&&"i"===r.t||!n&&"k"===r.t)&&!n&&(t.length=0,t.fragmentsToUnrender=t.fragments.slice(0),t.fragmentsToUnrender.forEach(function(t){return t.unbind()})),r.t=n?"k":"i"),t.currentSubtype=e}function ns(t,e,n){for(var r,i,o,a,s=t.hasKey||(t.hasKey={}),u=t.fragments.length;u--;)(i=t.fragments[u]).key in e||(o=!0,i.unbind(),t.fragmentsToUnrender.push(i),t.fragments.splice(u,1),s[i.key]=!1);for(u=t.fragments.length;u--;)(i=t.fragments[u]).index!==u&&(i.index=u,a=i.registeredIndexRefs)&&a.forEach(ss);for(r in u=t.fragments.length,e)s[r]||(o=!0,n.context=t.keypath.join(r),n.key=r,n.index=u++,i=new N(n),t.fragmentsToRender.push(i),t.fragments.push(i),s[r]=!0);return t.length=t.fragments.length,o}function rs(t,e){if(!t.length)return e.context=t.keypath,e.index=0,e=new N(e),t.fragmentsToRender.push(t.fragments[0]=e),t.length=1,!0}function is(t,e,n,r){var i,o=it(e)&&0===e.length,a=!1;if(!it(e)&&l(e))for(i in a=!0,e){a=!1;break}return(n?o||a||!e:e&&!o&&!a)?t.length?1t.length)for(r=t.length;r',""],THEAD:['
',"
"],TBODY:['
',"
"],TR:['
',"
"],SELECT:['"]}}function _s(t,e,n){var r,i,o,a,s,u=[];if(null!=t&&""!==t){for(ms&&(i=ys[e.tagName])?((r=bs("DIV")).innerHTML=i[0]+t+i[1],"SELECT"===(r=r.querySelector(".x")).tagName&&(o=r.options[r.selectedIndex])):e.namespaceURI===c.svg?((r=bs("DIV")).innerHTML='",r=r.querySelector(".x")):((r=bs(e.tagName)).innerHTML=t,"SELECT"===r.tagName&&(o=r.options[r.selectedIndex]));a=r.firstChild;)u.push(a),n.appendChild(a);if("SELECT"===e.tagName)for(s=u.length;s--;)u[s]!==o&&(u[s].selected=!1)}return u}function bs(t){return vs[t]||(vs[t]=o(t))}var ws=function(t){var e,n;t&&"select"===t.name&&t.binding&&(e=Ht(t.node.options).filter(xs),t.getAttribute("multiple")?n=e.map(function(t){return t.value}):(e=e[0])&&(n=e.value),void 0!==n&&t.binding.setValue(n),t.bubble())};function xs(t){return t.selected}function Ss(t){this.type=Un,M.init(this,t)}function Ts(){var t,e=this.node;if(e)return(t=e.parentNode)&&t.removeChild(e),e}Ss.prototype={detach:hs,find:ds,findAll:ps,firstNode:gs,getValue:M.getValue,rebind:M.rebind,render:function(){if(this.rendered)throw new Error("Attempted to render an item that was already rendered");return this.docFrag=document.createDocumentFragment(),this.nodes=_s(this.value,this.parentFragment.getNode(),this.docFrag),ws(this.pElement),this.rendered=!0,this.docFrag},resolve:M.resolve,setValue:function(t){var e;(e=this.root.viewmodel.wrapped[this.keypath.str])&&(t=e.get());t!==this.value&&(this.value=t,this.parentFragment.bubble(),this.rendered)&&A.addView(this)},toString:function(){return null!=this.value?Oi(""+this.value):""},unbind:Aa,unrender:function(t){this.rendered&&t&&(this.nodes.forEach($),this.rendered=!1)},update:function(){var t,e;if(this.rendered){for(;this.nodes&&this.nodes.length;)(t=this.nodes.pop()).parentNode.removeChild(t);e=this.parentFragment.getNode(),this.nodes=_s(this.value,e,this.docFrag),e.insertBefore(this.docFrag,this.parentFragment.findNextNode(this)),ws(this.pElement)}}};var As=Ss;function ks(){return null}function Ps(){return this.node}function Cs(t){if(this.attributes&&this.attributes[t])return this.attributes[t].value}function Es(){var t=this.useProperty||!this.rendered?this.fragment.getValue():this.fragment.toString();f(t,this.value)||("id"===this.name&&this.value&&delete this.root.nodes[this.value],this.value=t,"value"===this.name&&this.node&&(this.node._ractive.value=t),this.rendered&&A.addView(this))}var Os=/^true|on|yes|1$/i,Ms=/^[0-9]+$/;var n="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(" "),C="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(" "),Ls=function(t){for(var e={},n=t.length;n--;)e[t[n].toLowerCase()]=t[n];return e}(n.concat(C)),Rs=function(t){t=t.toLowerCase();return Ls[t]||t},Ds=function(t){t=t.fragment.items;if(1===t.length&&t[0].type===Yn)return t[0]};var Ns={"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"};function js(){var t,e,n,r=this.value;if(!this.locked)for(this.node._ractive.value=r,t=this.node.options,n=t.length;n--;)if(((e=t[n])._ractive||e).value==r){e.selected=!0;break}}function Is(){var t,e,n,r,i=this.value;for(g(i)||(i=[i]),t=this.node.options,e=t.length;e--;)n=t[e],r=(n._ractive||n).value,n.selected=Yt(i,r)}function Vs(){var t=this.node,e=this.value;t.checked=e==t._ractive.value}function Fs(){var t,e,n,r,i=this.node;if(t=i.checked,i.value=this.element.getAttribute("value"),i.checked=this.element.getAttribute("value")===this.element.getAttribute("name"),t&&!i.checked&&this.element.binding&&(n=this.element.binding.siblings,r=n.length)){for(;r--;){if(!(e=n[r]).element.node)return;if(e.element.node.checked)return A.addRactive(e.root),e.handleChange()}this.root.viewmodel.set(e.keypath,void 0)}}function Gs(){var t,e,n=this.element,r=this.node,i=this.value,o=n.binding;if(t=n.getAttribute("value"),g(i)){for(e=i.length;e--;)if(t==i[e])return void(o.isChecked=r.checked=!0);o.isChecked=r.checked=!1}else o.isChecked=r.checked=i==t}function zs(){this.node.className=Z(this.value)}function Ys(){var t=this.node,e=this.value;(this.root.nodes[e]=t).id=e}function Us(){var t,e;t=this.node,void 0===(e=this.value)&&(e=""),t.style.setAttribute("cssText",e)}function Bs(){var t=this.value;void 0===t&&(t=""),this.locked||(this.node.innerHTML=t)}function Hs(){var t=this.node,e=this.value;t._ractive.value=e,this.locked||(t.value=null==e?"":e)}function Ws(){this.locked||(this.node[this.propertyName]=this.value)}function qs(){var t=this.node,e=this.namespace,n=this.name,r=this.value,i=this.fragment;e?t.setAttributeNS(e,n,(i||r).toString()):this.isBoolean?r?t.setAttribute(n,""):t.removeAttribute(n):null==r?t.removeAttribute(n):t.setAttribute(n,(i||r).toString())}function Xs(t){this.init(t)}function Qs(t,e){this.element=t,this.root=t.root,this.parentFragment=t.parentFragment,this.attributes=[],this.fragment=new N({root:t.root,owner:this,template:[e]})}Xs.prototype={bubble:Es,init:function(t){this.type=13,this.element=t.element,this.root=t.root,function(t,e){var n,r=e.indexOf(":");if(-1!==r&&"xmlns"!==(n=e.substr(0,r))){if(e=e.substring(r+1),t.name=Rs(e),t.namespace=c[n.toLowerCase()],t.namespacePrefix=n,t.namespace)return;throw'Unknown namespace ("'+n+'")'}t.name=t.element.namespace!==c.html?Rs(e):e}(this,t.name),this.isBoolean=Ri.test(this.name),t.value&&"string"!=typeof t.value?(this.parentFragment=this.element.parentFragment,this.fragment=new N({template:t.value,root:this.root,owner:this}),this.value=this.fragment.getValue(),this.interpolator=Ds(this),this.isBindable=!!this.interpolator&&!this.interpolator.isStatic,this.ready=!0):this.value=!!this.isBoolean||t.value||""},rebind:function(t,e){this.fragment&&this.fragment.rebind(t,e)},render:function(t){var e;(this.node=t).namespaceURI&&t.namespaceURI!==c.html||(e=Ns[this.name]||this.name,void 0!==t[e]&&(this.propertyName=e),(this.isBoolean||this.isTwoway)&&(this.useProperty=!0),"value"===e&&(t._ractive.value=this.value));this.rendered=!0,this.update()},toString:function(){var t=this.name,e=this.namespacePrefix,n=this.value,r=this.interpolator,i=this.fragment;if(("value"!==t||"select"!==this.element.name&&"textarea"!==this.element.name)&&("value"!==t||void 0===this.element.getAttribute("contenteditable"))){if("name"===t&&"input"===this.element.name&&r)return"name={{"+(r.keypath.str||r.ref)+"}}";if(this.isBoolean)return n?t:"";if(i){if(1===i.items.length&&null==i.items[0].value)return"";n=i.toString()}return e&&(t=e+":"+t),n?t+'="'+n.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'")+'"':t}},unbind:function(){this.fragment&&this.fragment.unbind();"id"===this.name&&delete this.root.nodes[this.value]},update:function(){var t,e,n=this.name,r=this.element,i=this.node;"id"===n?e=Ys:"value"===n?"select"===r.name&&"value"===n?e=r.getAttribute("multiple")?Is:js:"textarea"===r.name?e=Hs:null!=r.getAttribute("contenteditable")?e=Bs:"input"===r.name&&(t=r.getAttribute("type"),e="file"===t?v:"radio"===t&&r.binding&&"name"===r.binding.name?Fs:Hs):this.isTwoway&&"name"===n?"radio"===i.type?e=Vs:"checkbox"===i.type&&(e=Gs):"style"===n&&i.style.setAttribute?e=Us:"class"!==n||i.namespaceURI&&i.namespaceURI!==c.html?this.useProperty&&(e=Ws):e=zs;e=e||qs;this.update=e,this.update()}};var $s,Zs=Xs,Js=("undefined"!=typeof document&&($s=o("div")),Qs.prototype={bubble:function(){this.node&&this.update(),this.element.bubble()},rebind:function(t,e){this.fragment.rebind(t,e)},render:function(t){this.node=t,this.isSvg=t.namespaceURI===c.svg,this.update()},unbind:function(){this.fragment.unbind()},update:function(){var e=this,i=function(t,e){e=e?"svg":"div";return $s.innerHTML="<"+e+" "+t+">"+e+">",Ht($s.childNodes[0].attributes)}(this.fragment.toString(),this.isSvg);this.attributes.filter(function(t){for(var e=i,n=t,r=e.length;r--;)if(e[r].name===n.name)return!1;return!0}).forEach(function(t){e.node.removeAttribute(t.name)}),i.forEach(function(t){e.node.setAttribute(t.name,t.value)}),this.attributes=i},toString:function(){return this.fragment.toString()}},Qs);function Ks(t){var e,n;if(this.element=t,this.root=t.root,this.attribute=t.attributes[this.name||"value"],(e=this.attribute.interpolator).twowayBinding=this,n=e.keypath){if("}"===n.str.slice(-1))return d("Two-way binding does not work with expressions (`%s` on <%s>)",e.resolver.uniqueString,t.name,{ractive:this.root}),!1;if(n.isSpecial)return d("Two-way binding does not work with %s",e.resolver.ref,{ractive:this.root}),!1}else m("The %s being used for two-way binding is ambiguous, and may cause unexpected results. Consider initialising your data to eliminate the ambiguity",e.template.r?"'"+e.template.r+"' reference":"expression",{ractive:this.root}),e.resolver.forceResolution(),n=e.keypath;this.attribute.isTwoway=!0,this.keypath=n,void 0===(e=this.root.viewmodel.get(n))&&this.getInitialValue&&void 0!==(e=this.getInitialValue())&&this.root.viewmodel.set(n,e),(n=function(t){for(;t=t.parent;)if("form"===t.name)return t}(t))&&(this.resetValue=e,n.formBindings.push(this))}Ks.prototype={handleChange:function(){var t=this;A.start(this.root),this.attribute.locked=!0,this.root.viewmodel.set(this.keypath,this.getValue()),A.scheduleTask(function(){return t.attribute.locked=!1}),A.end()},rebound:function(){var t=this.keypath,e=this.attribute.interpolator.keypath;t!==e&&(w(this.root._twowayBindings[t.str],this),this.keypath=e,(this.root._twowayBindings[e.str]||(this.root._twowayBindings[e.str]=[])).push(this))},unbind:function(){}},Ks.extend=function(t){var e=function(t){Ks.call(this,t),this.init&&this.init()};return tt(e.prototype=y(this.prototype),t),e.extend=Ks.extend,e};var L=Ks;var R=function(){this._ractive.binding.handleChange()};var tu=L.extend({getInitialValue:function(){return""},getValue:function(){return this.element.node.value},render:function(){var t,e=this.element.node,n=!1;this.rendered=!0,t=this.root.lazy,!0===this.element.lazy?t=!0:!1===this.element.lazy?t=!1:s(this.element.lazy)?(t=!1,n=+this.element.lazy):s(t||"")&&(n=+t,t=!1,this.element.lazy=n),this.handler=n?nu:R,e.addEventListener("change",R,!1),t||(e.addEventListener("input",this.handler,!1),e.attachEvent&&e.addEventListener("keyup",this.handler,!1)),e.addEventListener("blur",eu,!1)},unrender:function(){var t=this.element.node;this.rendered=!1,t.removeEventListener("change",R,!1),t.removeEventListener("input",this.handler,!1),t.removeEventListener("keyup",this.handler,!1),t.removeEventListener("blur",eu,!1)}});function eu(){var t;R.call(this),t=this._ractive.root.viewmodel.get(this._ractive.binding.keypath),this.value=null==t?"":t}function nu(){var t=this._ractive.binding,e=this;t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.rendered&&R.call(e),t._timeout=void 0},t.element.lazy)}var ru=tu.extend({getInitialValue:function(){return this.element.fragment?this.element.fragment.toString():""},getValue:function(){return this.element.node.innerHTML}}),iu=function(t,e,n){t=t+e+n;return ou[t]||(ou[t]=[])},ou={};var au=L.extend({name:"checked",init:function(){this.siblings=iu(this.root._guid,"radio",this.element.getAttribute("name")),this.siblings.push(this)},render:function(){var t=this.element.node;t.addEventListener("change",R,!1),t.attachEvent&&t.addEventListener("click",R,!1)},unrender:function(){var t=this.element.node;t.removeEventListener("change",R,!1),t.removeEventListener("click",R,!1)},handleChange:function(){A.start(this.root),this.siblings.forEach(function(t){t.root.viewmodel.set(t.keypath,t.getValue())}),A.end()},getValue:function(){return this.element.node.checked},unbind:function(){w(this.siblings,this)}}),su=L.extend({name:"name",init:function(){this.siblings=iu(this.root._guid,"radioname",this.keypath.str),this.siblings.push(this),this.radioName=!0},getInitialValue:function(){if(this.element.getAttribute("checked"))return this.element.getAttribute("value")},render:function(){var t=this.element.node;t.name="{{"+this.keypath.str+"}}",t.checked=this.root.viewmodel.get(this.keypath)==this.element.getAttribute("value"),t.addEventListener("change",R,!1),t.attachEvent&&t.addEventListener("click",R,!1)},unrender:function(){var t=this.element.node;t.removeEventListener("change",R,!1),t.removeEventListener("click",R,!1)},getValue:function(){var t=this.element.node;return(t._ractive||t).value},handleChange:function(){this.element.node.checked&&L.prototype.handleChange.call(this)},rebound:function(t,e){L.prototype.rebound.call(this,t,e),(t=this.element.node)&&(t.name="{{"+this.keypath.str+"}}")},unbind:function(){w(this.siblings,this)}});function uu(t){return t.isChecked}function cu(t){return t.element.getAttribute("value")}var lu=L.extend({name:"name",getInitialValue:function(){return this.noInitialValue=!0,[]},init:function(){var t,e;this.checkboxName=!0,this.siblings=iu(this.root._guid,"checkboxes",this.keypath.str),this.siblings.push(this),this.noInitialValue&&(this.siblings.noInitialValue=!0),this.siblings.noInitialValue&&this.element.getAttribute("checked")&&(t=this.root.viewmodel.get(this.keypath),e=this.element.getAttribute("value"),t.push(e))},unbind:function(){w(this.siblings,this)},render:function(){var t=this.element.node,e=this.root.viewmodel.get(this.keypath),n=this.element.getAttribute("value");g(e)?this.isChecked=Yt(e,n):this.isChecked=e==n,t.name="{{"+this.keypath.str+"}}",t.checked=this.isChecked,t.addEventListener("change",R,!1),t.attachEvent&&t.addEventListener("click",R,!1)},unrender:function(){var t=this.element.node;t.removeEventListener("change",R,!1),t.removeEventListener("click",R,!1)},changed:function(){var t=!!this.isChecked;return this.isChecked=this.element.node.checked,this.isChecked===t},handleChange:function(){this.isChecked=this.element.node.checked,L.prototype.handleChange.call(this)},getValue:function(){return this.siblings.filter(uu).map(cu)}}),hu=L.extend({name:"checked",render:function(){var t=this.element.node;t.addEventListener("change",R,!1),t.attachEvent&&t.addEventListener("click",R,!1)},unrender:function(){var t=this.element.node;t.removeEventListener("change",R,!1),t.removeEventListener("click",R,!1)},getValue:function(){return this.element.node.checked}}),fu=L.extend({getInitialValue:function(){var t,e,n,r,i=this.element.options;if(void 0===this.element.getAttribute("value")&&(e=t=i.length,t)){for(;e--;)if(i[e].getAttribute("selected")){n=i[e].getAttribute("value"),r=!0;break}if(!r)for(;++e is not valid',t.name,e),this.invalid=!0);n.m?(e=n.a.r,this.method=n.m,this.keypaths=[],this.fn=Va(n.a.s,e.length),this.parentFragment=t.parentFragment,this.root,this.refResolvers=[],e.forEach(function(t,e){var n=void 0;(n=vu.exec(t))?r.keypaths[e]={eventObject:!0,refinements:n[1]?n[1].split("."):[]}:r.refResolvers.push(Ia(r,t,function(t){return r.resolve(e,t)}))}),this.fire=_u):("string"!=typeof(t=n.n||n)&&(t=new N({template:t,root:this.root,owner:this})),this.action=t,n.d?(this.dynamicParams=new N({template:n.d,root:this.root,owner:this.element}),this.fire=wu):n.a&&(this.params=n.a,this.fire=bu))},listen:function(){var t,e=this.name;if(!this.invalid){if(t=gt("events",this.root,e))this.custom=t(this.node,function(n){Su[n]||(Su[n]=function(t){var e=t.node._ractive;t.index=e.index,t.keypath=e.keypath.str,t.context=e.root.viewmodel.get(e.keypath),e.events[n].fire(t)});return Su[n]}(e));else{if(!("on"+e in this.node||window&&"on"+e in window||q))return void(Tu[e]||d(pt(e,"event"),{node:this.node}));this.node.addEventListener(e,xu,!1)}this.hasListener=!0}},rebind:function(e,n){function t(t){t&&t.rebind(e,n)}this.method?(this.element.parentFragment,this.refResolvers.forEach(t)):("string"!=typeof this.action&&t(this.action),this.dynamicParams&&t(this.dynamicParams))},render:function(){this.node=this.element.node,((this.node._ractive.events[this.name]=this).method||this.getAction())&&this.listen()},resolve:function(t,e){this.keypaths[t]=e},unbind:function(){this.method?this.refResolvers.forEach(S):("string"!=typeof this.action&&this.action.unbind(),this.dynamicParams&&this.dynamicParams.unbind())},unrender:function(){this.custom?this.custom.teardown():this.node.removeEventListener(this.name,xu,!1);this.hasListener=!1}};var Pu=Au,Cu=(ku.prototype={init:function(){var t=this.element.node,e=this.params?(e=[t].concat(this.params),this.fn.apply(this.root,e)):this.fn.call(this.root,t);if(!e||!e.teardown)throw new Error("Decorator definition must return an object with a teardown method");this.actual=e,this.ready=!0},update:function(){this.actual.update?this.actual.update.apply(this.root,this.params):(this.actual.teardown(!0),this.init())},rebind:function(t,e){this.fragment&&this.fragment.rebind(t,e)},teardown:function(t){this.torndown=!0,this.ready&&this.actual.teardown(),!t&&this.fragment&&this.fragment.unbind()}},ku);function Eu(){var o=this;this.dirty||(this.dirty=!0,A.scheduleTask(function(){var t,n,r,e,i;(e=(t=o).node)&&(e=Ht(e.options),n=t.getAttribute("value"),r=t.getAttribute("multiple"),void 0!==n?(e.forEach(function(t){var e=(t._ractive||t).value,e=r?function(t,e){var n=t.length;for(;n--;)if(t[n]==e)return!0}(n,e):n==e;e&&(i=!0),t.selected=e}),i||(e[0]&&(e[0].selected=!0),t.binding&&t.binding.forceUpdate())):t.binding&&t.binding.forceUpdate()),o.dirty=!1})),this.parentFragment.bubble()}function Ou(t,e){t.select=function(t){if(t)do{if("select"===t.name)return t}while(t=t.parent)}(t.parent),t.select&&(t.select.options.push(t),e.a||(e.a={}),void 0!==e.a.value||e.a.hasOwnProperty("disabled")||(e.a.value=e.f),"selected"in e.a)&&void 0!==t.select.getAttribute("value")&&delete e.a.selected}function Mu(t){var e,n;this.type=Hn,n=this.parentFragment=t.parentFragment,e=this.template=t.template,this.parent=t.pElement||n.pElement,this.root=n=n.root,this.index=t.index,this.key=t.key,this.name=Rs(e.e),"option"===this.name&&Ou(this,e),"select"===this.name&&(this.options=[],this.bubble=Eu),"form"===this.name&&(this.formBindings=[]),t=function(t){var t=t.a||{},e={},n=t.twoway;return void 0!==n&&(e.twoway=0===n||Os.test(n)),void 0!==(n=t.lazy)&&(0!==n&&Ms.test(n)?e.lazy=parseInt(n):e.lazy=0===n||Os.test(n)),e}(e),this.attributes=function(t,e){var n,r,i=[];for(n in e)"twoway"!==n&&"lazy"!==n&&e.hasOwnProperty(n)&&(r=new Zs({element:t,name:n,value:e[n],root:t.root}),i[n]=r,"value"!==n)&&i.push(r);return(r=i.value)&&i.push(r),i}(this,e.a),this.conditionalAttributes=function(e,t){return t?t.map(function(t){return new Js(e,t)}):[]}(this,e.m),e.f&&(this.fragment=new N({template:e.f,root:n,owner:this,pElement:this,cssIds:null})),n=n.twoway,!1===t.twoway?n=!1:!0===t.twoway&&(n=!0),this.twoway=n,this.lazy=t.lazy,n&&(t=mu(this,e.a))&&(this.binding=t,(this.root._twowayBindings[t.keypath.str]||(this.root._twowayBindings[t.keypath.str]=[])).push(t)),e.v&&(this.eventHandlers=function(t,e){var n,r,i,o,a=[];for(r in e)if(e.hasOwnProperty(r))for(n=(i=r.split("-")).length;n--;)o=new Pu(t,i[n],e[r]),a.push(o);return a}(this,e.v)),e.o&&(this.decorator=new Cu(this,e.o)),this.intro=e.t0||e.t1,this.outro=e.t0||e.t2}function Lu(e,n){var t,r,i;if(this.attributes&&this.attributes.forEach(o),this.conditionalAttributes&&this.conditionalAttributes.forEach(o),this.eventHandlers&&this.eventHandlers.forEach(o),this.decorator&&o(this.decorator),this.fragment&&o(this.fragment),i=this.liveQueries)for(this.root,t=i.length;t--;)i[t]._makeDirty();function o(t){t.rebind(e,n)}this.node&&(r=this.node._ractive)&&kt(r,"keypath",e,n)}function Ru(){var t=this._ractive.proxy;A.start(),t.formBindings.forEach(Du),A.end()}function Du(t){t.root.viewmodel.set(t.keypath,t.resetValue)}function Nu(t,e,n){var r,i;this.element=t,this.root=r=t.root,this.isIntro=n,"string"!=typeof(n=e.n||e)&&(i=new N({template:n,root:r,owner:t}),n=i.toString(),i.unbind(),""===n)||(this.name=n,e.a?this.params=e.a:e.d&&(i=new N({template:e.d,root:r,owner:t}),this.params=i.getArgsList(),i.unbind()),this._fn=gt("transitions",r,n),this._fn)||d(pt(n,"transition"),{ractive:this.root})}function ju(t){return t.replace(/-([a-zA-Z])/g,function(t,e){return e.toUpperCase()})}function Iu(t){var e;this.duration=t.duration,this.step=t.step,this.complete=t.complete,"string"==typeof t.easing?(e=t.root.easing[t.easing])||(d(pt(t.easing,"easing")),e=Yu):e="function"==typeof t.easing?t.easing:Yu,this.easing=e,this.start=Vt(),this.end=this.start+this.duration,this.running=!0,ve.add(this)}var Vu,Fu,Gu,n=r?(Vu={},Fu=o("div").style,function(t){var e,n,r;if(t=ju(t),!Vu[t])if(void 0!==Fu[t])Vu[t]=t;else for(r=t.charAt(0).toUpperCase()+t.substring(1),e=i.length;e--;)if(n=i[e],void 0!==Fu[n+r]){Vu[t]=n+r;break}return Vu[t]}):null,D=n,C=r?(Gu=window.getComputedStyle||null.getComputedStyle,function(t){var e,n,r,i,o=Gu(this.node);if("string"==typeof t)return i="0px"===(i=o[D(t)])?0:i;if(!g(t))throw new Error("Transition$getStyle must be passed a string, or an array of strings representing CSS properties");for(e={},n=t.length;n--;)r=t[n],i=o[D(r)],e[r]=i="0px"===i?0:i;return e}):null,n=C,zu=(Iu.prototype={tick:function(t){return!!this.running&&(t>this.end?(this.step&&this.step(1),this.complete&&this.complete(1),!1):(t=t-this.start,t=this.easing(t/this.duration),this.step&&this.step(t),!0))},stop:function(){this.abort&&this.abort(),this.running=!1}},Iu);function Yu(t){return t}function Uu(t){return t?(t=nc.test(t)?"-"+t:t).replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()}):""}var Bu,Hu,Wu,qu,Xu,Qu,$u,Zu,Ju,Ku,tc,ec=new RegExp("^-(?:"+i.join("|")+")-"),nc=new RegExp("^(?:"+i.join("|")+")([A-Z])"),rc={},ic={},C=r?(C=o("div").style,Wu=void 0!==C.transition?(Bu="transition",Hu="transitionend",!0):void 0!==C.webkitTransition&&(Bu="webkitTransition",Hu="webkitTransitionEnd",!0),Bu&&(qu=Bu+"Duration",Xu=Bu+"Property",Qu=Bu+"TimingFunction"),function(l,h,f,d,t){setTimeout(function(){var o,a,s,u=function(){o&&a&&(l.root.fire(l.name+":end",l.node,l.isIntro),t())},c=(l.node.namespaceURI||"")+l.node.tagName;l.node.style[Xu]=d.map(D).map(Uu).join(","),l.node.style[Qu]=Uu(f.easing||"linear"),l.node.style[qu]=f.duration/1e3+"s",s=function(t){t=d.indexOf(ju(t.propertyName.replace(ec,"")));-1!==t&&d.splice(t,1),d.length||(l.node.removeEventListener(Hu,s,!1),a=!0,u())},l.node.addEventListener(Hu,s,!1),setTimeout(function(){for(var t,e,n,r=d.length,i=[];r--;)e=d[r],n=c+e,Wu&&!ic[n]&&(l.node.style[D(e)]=h[e],rc[n]||(t=l.getStyle(e),rc[n]=l.getStyle(e)!=h[e],ic[n]=!rc[n],ic[n]&&(l.node.style[D(e)]=t))),Wu&&!ic[n]||(void 0===t&&(t=l.getStyle(e)),-1===(n=d.indexOf(e))?m("Something very strange happened with transitions. Please raise an issue at https://github.com/ractivejs/ractive/issues - thanks!",{node:l.node}):d.splice(n,1),n=/[^\d]*$/.exec(h[e])[0],i.push({name:D(e),interpolator:yt(parseFloat(t),parseFloat(h[e])),suffix:n}));i.length?new zu({root:l.root,duration:f.duration,easing:ju(f.easing||""),step:function(t){for(var e,n=i.length;n--;)l.node.style[(e=i[n]).name]=e.interpolator(t)+e.suffix},complete:function(){o=!0,u()}}):o=!0,d.length||(l.node.removeEventListener(Hu,s,!1),a=!0,u())},0)},f.delay||0)}):null,oc=C;if("undefined"!=typeof document){if(tc={},($u="hidden")in document)Ju="";else for(Ku=i.length;Ku--;)Zu=i[Ku],($u=Zu+"Hidden")in document&&(Ju=Zu);void 0!==Ju?(document.addEventListener(Ju+"visibilitychange",ac),ac()):("onfocusout"in document?(document.addEventListener("focusout",sc),document.addEventListener("focusin",uc)):(window.addEventListener("pagehide",sc),window.addEventListener("blur",sc),window.addEventListener("pageshow",uc),window.addEventListener("focus",uc)),tc.hidden=!1)}function ac(){tc.hidden=document[$u]}function sc(){tc.hidden=!0}function uc(){tc.hidden=!1}var cc,lc,hc=tc,C=r?(cc=window.getComputedStyle||null.getComputedStyle,function(t,e,s){var u,c=this;if(4===arguments.length)throw new Error("t.animateStyle() returns a promise - use .then() instead of passing a callback");return hc.hidden?(this.setStyle(t,e),lc=lc||Qt.resolve()):("string"==typeof t?(u={})[t]=e:(u=t,s=e),s||(d('The "%s" transition does not supply an options object to `t.animateStyle()`. This will break in a future version of Ractive. For more info see https://github.com/RactiveJS/Ractive/issues/340',this.name),s=this),new Qt(function(t){var e,n,r,i,o,a;if(s.duration){for(e=Object.keys(u),n=[],r=cc(c.node),o=e.length;o--;)a=e[o],(i="0px"===(i=r[D(a)])?0:i)!=u[a]&&(n.push(a),c.node.style[D(a)]=i);n.length?oc(c,u,s,n,t):t()}else c.setStyle(u),t()}))}):null;function fc(t,e,n){this.init(t,e,n)}fc.prototype={init:Nu,start:function(){var n,r,i,o=this;n=this.node=this.element.node,r=n.getAttribute("style"),this.complete=function(t){var e;i||(!t&&o.isIntro&&(t=n,(e=r)?t.setAttribute("style",e):(t.getAttribute("style"),t.removeAttribute("style"))),n._ractive.transition=null,o._manager.remove(o),i=!0)},this._fn?this._fn.apply(this.root,[this].concat(this.params)):this.complete()},getStyle:n,setStyle:function(t,e){if("string"==typeof t)this.node.style[D(t)]=e;else for(var n in t)t.hasOwnProperty(n)&&(this.node.style[D(n)]=t[n]);return this},animateStyle:C,processParams:function(t,e){return function(n){for(var t=arguments.length,e=Array(1":(t="<"+this.template.e,t+=this.attributes.map(mc).join("")+this.conditionalAttributes.map(mc).join(""),"option"===this.name&&function(t){var e,n,r;if(void 0===(e=t.getAttribute("value"))||!t.select)return;if((n=t.select.getAttribute("value"))==e)return 1;if(t.select.getAttribute("multiple")&&g(n))for(r=n.length;r--;)if(n[r]==e)return 1}(this)&&(t+=" selected"),"input"===this.name&&function(t){var e,n;if(t=t.attributes,e=t.type,n=t.value,t=t.name,e&&"radio"===e.value&&n&&t.interpolator&&n.value===t.interpolator.value)return 1}(this)&&(t+=" checked"),t+=">","textarea"===this.name&&void 0!==this.getAttribute("value")?t+=Mi(this.getAttribute("value")):void 0!==this.getAttribute("contenteditable")&&(t+=this.getAttribute("value")||""),this.fragment&&(e="script"!==this.name&&"style"!==this.name,t+=this.fragment.toString(e)),Di.test(this.template.e)||(t+=""+this.template.e+">"),t)},unbind:function(){this.fragment&&this.fragment.unbind();this.binding&&this.binding.unbind();this.eventHandlers&&this.eventHandlers.forEach(S);"option"===this.name&&!function(t){t.select&&w(t.select.options,t)}(this);this.attributes.forEach(S),this.conditionalAttributes.forEach(S)},unrender:function(t){var e,n;(n=this.transition)&&n.complete();"option"===this.name?this.detach():t&&A.detachWhenReady(this);this.fragment&&this.fragment.unrender(!1);(t=this.binding)&&(this.binding.unrender(),this.node._ractive.binding=null,(e=this.root._twowayBindings[t.keypath.str]).splice(e.indexOf(t),1));this.eventHandlers&&this.eventHandlers.forEach(re);this.decorator&&A.registerDecorator(this.decorator);this.root.transitionsEnabled&&this.outro&&(n=new dc(this,this.outro,!1),A.registerTransition(n),A.scheduleTask(function(){return n.start()}));this.liveQueries&&!function(t){var e,n;n=t.liveQueries.length;for(;n--;)e=t.liveQueries[n],e.selector,e._remove(t.node)}(this);"form"===this.name&&!function(t){t.node.removeEventListener("reset",Ru,!1)}(this)}};var vc=yc,_c=/^\s*$/,bc=/^\s*/;function wc(t,e){e=bc.exec(e)[0];return null===t||e.length%s}}) cannot contain nested inline partials",e,{ractive:t}),(r?o:function(t,e){return t.partials.hasOwnProperty(e)?t:function t(e,n){if(!e)return;return e.partials.hasOwnProperty(n)?e:t(e._Parent,n)}(t.constructor,e)}(o,e)).partials[e]=n=i.t),r&&(n._fn=r),n.v?n.t:n;m(dt,e,"partial","partial",{ractive:t})}}(t,e,n||{}))return n;if(n=O.fromId(e,{noThrow:!0}))return n=function(t){var e,n=t.split("\n"),r=n[0];return void 0!==r&&_c.test(r)&&n.shift(),void 0!==(r=b(n))&&_c.test(r)&&n.pop(),t=(e=n.reduce(wc,null))?n.map(function(t){return t.replace(e,"")}).join("\n"):t}(n),n=O.parse(n,O.getParseOptions(t)),t.partials[e]=n.t};function Sc(t){var e=this.parentFragment=t.parentFragment;this.root=e.root,this.type=Wn,this.index=t.index,this.name=t.template.r,this.rendered=!1,this.fragment=this.fragmentToRender=this.fragmentToUnrender=null,M.init(this,t),this.keypath||((t=xc(this.root,this.name,e))?(Aa.call(this),this.isNamed=!0,this.setTemplate(t)):d(Tc,this.name))}var Tc='Could not find template for partial "%s"',Ac=(Sc.prototype={bubble:function(){this.parentFragment.bubble()},detach:function(){return this.fragment.detach()},find:function(t){return this.fragment.find(t)},findAll:function(t,e){return this.fragment.findAll(t,e)},findComponent:function(t){return this.fragment.findComponent(t)},findAllComponents:function(t,e){return this.fragment.findAllComponents(t,e)},firstNode:function(){return this.fragment.firstNode()},findNextNode:function(){return this.parentFragment.findNextNode(this)},getPartialName:function(){return this.isNamed&&this.name||void 0===this.value?this.name:this.value},getValue:function(){return this.fragment.getValue()},rebind:function(t,e){this.isNamed||Za.call(this,t,e),this.fragment&&this.fragment.rebind(t,e)},render:function(){return this.docFrag=document.createDocumentFragment(),this.update(),this.rendered=!0,this.docFrag},resolve:M.resolve,setValue:function(t){var e;void 0!==t&&t===this.value||(!(e=void 0!==t?xc(this.root,""+t,this.parentFragment):e)&&this.name&&(e=xc(this.root,this.name,this.parentFragment))&&(Aa.call(this),this.isNamed=!0),e||d(Tc,this.name,{ractive:this.root}),this.value=t,this.setTemplate(e||[]),this.bubble(),this.rendered&&A.addView(this))},setTemplate:function(t){this.fragment&&(this.fragment.unbind(),this.rendered)&&(this.fragmentToUnrender=this.fragment),this.fragment=new N({template:t,root:this.root,owner:this,pElement:this.parentFragment.pElement}),this.fragmentToRender=this.fragment},toString:function(t){var e,n,t=this.fragment.toString(t),r=this.parentFragment.items[this.index-1];return r&&1===r.type&&(r=r.text.split("\n").pop(),r=/^\s+$/.exec(r))?(e=t,(n=r[0])?e.split("\n").map(function(t,e){return e?n+t:t}).join("\n"):e):t},unbind:function(){this.isNamed||Aa.call(this),this.fragment&&this.fragment.unbind()},unrender:function(t){this.rendered&&(this.fragment&&this.fragment.unrender(t),this.rendered=!1)},update:function(){var t,e;this.fragmentToUnrender&&(this.fragmentToUnrender.unrender(!0),this.fragmentToUnrender=null),this.fragmentToRender&&(this.docFrag.appendChild(this.fragmentToRender.render()),this.fragmentToRender=null),this.rendered&&(t=this.parentFragment.getNode(),e=this.parentFragment.findNextNode(this),t.insertBefore(this.docFrag,e))}},Sc),kc=function t(e,n){var r,i=mt("components",e,n);if(i&&!(r=i.components[n])._Parent){var o=r.bind(i);if(o.isOwner=i.components.hasOwnProperty(n),!(r=o()))return void m(dt,n,"component","component",{ractive:e});(r="string"==typeof r?t(e,r):r)._fn=o,i.components[n]=r}return r};function Pc(){var t=this.instance.fragment.detach();return Cc.fire(this.instance),t}var Cc=new e("detach");function Ec(t){return this.instance.fragment.find(t)}function Oc(t,e){return this.instance.fragment.findAll(t,e)}function Mc(t,e){e._test(this,!0),this.instance.fragment&&this.instance.fragment.findAllComponents(t,e)}function Lc(t){return t&&t!==this.name?this.instance.fragment?this.instance.fragment.findComponent(t):null:this.instance}function Rc(){return this.parentFragment.findNextNode(this)}function Dc(){return this.rendered?this.instance.fragment.firstNode():null}var Nc,jc=[],Ic=["pop","push","reverse","shift","sort","splice","unshift"],Vc=(Ic.forEach(function(l){a(jc,l,{value:function(){for(var t,e,n,r,i,o,a,s=arguments.length,u=Array(s),c=0;c component has a default `el` property; it has been disregarded",r.name),a=d;a;){if(a.owner.type===Qn){s=a.owner.container;break}a=a.parent}i&&Object.keys(i).forEach(function(e){var t,n=i[e];if("string"==typeof n)t=mo(n),l[e]=t?t.value:n;else if(0===n)l[e]=!0;else{if(!g(n))throw new Error("erm wut");n=1===(t=n).length&&t[0].t===Yn?(h[e]={origin:r.root.viewmodel,keypath:void 0},function(t,e,n){var r;e.r?r=Ia(t,e.r,n):e.x?r=new za(t,t.parentFragment,e.x,n):e.rx&&(r=new $a(t,e.rx,n));return r}(r,n[0],function(t){t.isSpecial?u?o.set(e,t.value):(l[e]=t.value,delete h[e]):u?o.viewmodel.mappings[e].resolve(t):h[e].keypath=t})):new Il(r,n,function(t){u?o.set(e,t):l[e]=t}),f.push(n)}}),o=y(t.prototype),Rl(o,{el:null,append:!0,data:l,partials:n,magic:p.magic||t.defaults.magic,modifyArrays:p.modifyArrays,adapt:p.adapt},{parent:p,component:r,container:s,mappings:h,inlinePartials:c,cssIds:d.cssIds}),u=!0,r.resolvers=f}var Il=Nl;Nl.prototype={bubble:function(){this.dirty||(this.dirty=!0,A.addView(this))},update:function(){this.callback(this.fragment.getValue()),this.dirty=!1},rebind:function(t,e){this.fragment.rebind(t,e)},unbind:function(){this.fragment.unbind()}};var Vl=function(t,e){for(var n in e)e.hasOwnProperty(n)&&!function(t,n,e,r){"string"!=typeof r&&h("Components currently only support simple events - you cannot include arguments. Sorry!");t.on(e,function(){var t,e;return arguments.length&&arguments[0]&&arguments[0].node&&(t=Array.prototype.shift.call(arguments)),e=Array.prototype.slice.call(arguments),ze(n,r,{event:t,args:e}),!1})}(t.instance,t.root,n,e[n])};function Fl(t,e){var n;if(!e)throw new Error('Component "'+this.name+'" not found');n=(n=this.parentFragment=t.parentFragment).root,this.root=n,this.type=15,this.name=t.template.e,this.index=t.index,this.indexRefBindings={},this.yielders={},this.resolvers=[],jl(this,e,t.template.a,t.template.f,t.template.p),Vl(this,t.template.v),(t.template.t0||t.template.t1||t.template.t2||t.template.o)&&m('The "intro", "outro" and "decorator" directives have no effect on components',{ractive:this.instance});for(var r,i=this,o=i.root;o;)(r=o._liveComponentQueries["_"+i.name])&&r.push(i.instance),o=o.parent}function Gl(e,n){var t,r;for(r in this.resolvers.forEach(i),this.yielders)this.yielders[r][0]&&i(this.yielders[r][0]);function i(t){t.rebind(e,n)}(t=this.root._liveComponentQueries["_"+this.name])&&t._makeDirty()}function zl(){var t=this.instance;return t.render(this.parentFragment.getNode()),this.rendered=!0,t.fragment.detach()}function Yl(){return this.instance.fragment.toString()}function Ul(){var t,e,n=this.instance,r=(this.resolvers.forEach(S),this);for(t=r.root;(e=t._liveComponentQueries["_"+r.name])&&e._remove(r),t=t.parent;);n._observers.forEach(ie),n.fragment.unbind(),n.viewmodel.teardown(),n.fragment.rendered&&n.el.__ractive_instances__&&w(n.el.__ractive_instances__,n),Bl.fire(n)}var Bl=new e("teardown");function Hl(t,e){this.init(t,e)}function Wl(t){this.type=qn,this.value=t.template.c}function ql(t){this.type=Qn,this.container=e=t.parentFragment.root,this.component=n=e.component,this.container=e,this.containerFragment=t.parentFragment,this.parentFragment=n.parentFragment;var e,n,r=this.name=t.template.n||"",i=e._inlinePartials[r];i||(m('Could not find template for partial "'+r+'"',{ractive:t.root}),i=[]),this.fragment=new N({owner:this,root:e.parent,template:i,pElement:this.containerFragment.pElement}),g(n.yielders[r])?n.yielders[r].push(this):n.yielders[r]=[this],A.scheduleTask(function(){if(1"}},Xl);function Kl(t){return t.toString()}function th(t){return t.toString(!0)}function eh(t){t.unbind&&t.unbind()}function nh(t){this.init(t)}function rh(t){var e,n,r,i,o;if("object"!=typeof(t=t||{}))throw new Error("The reset method takes either no arguments, or an object containing new data");for((!(o=this.viewmodel.wrapped[""])||!o.reset||!1===o.reset(t))&&this.viewmodel.reset(t),n=la.reset(this),r=n.length;r--;)if(-1>>=5)&&(e|=32),n+=c.encode(e),0>1,1==(1&s)?-o:o),n.rest=e}},{"./base64":50}],50:[function(t,e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(t){if(0<=t&&t=this._sources.size()&&!this.sourcesContent.some(function(t){return null==t})},f.prototype.sourceContentFor=function(t,e){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(t=v.relative(this.sourceRoot,t)),this._sources.has(t))return this.sourcesContent[this._sources.indexOf(t)];var n;if(null!=this.sourceRoot&&(n=v.urlParse(this.sourceRoot))){var r=t.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!n.path||"/"==n.path)&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}if(e)return null;throw new Error('"'+t+'" is not in the SourceMap.')},f.prototype.generatedPositionFor=function(t){var e=v.getArg(t,"source");if(null!=this.sourceRoot&&(e=v.relative(this.sourceRoot,e)),this._sources.has(e)){e={source:e=this._sources.indexOf(e),originalLine:v.getArg(t,"line"),originalColumn:v.getArg(t,"column")},t=this._findMapping(e,this._originalMappings,"originalLine","originalColumn",v.compareByOriginalPositions,v.getArg(t,"bias",o.GREATEST_LOWER_BOUND));if(0<=t){t=this._originalMappings[t];if(t.source===e.source)return{line:v.getArg(t,"generatedLine",null),column:v.getArg(t,"generatedColumn",null),lastColumn:v.getArg(t,"lastGeneratedColumn",null)}}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=f,(r.prototype=Object.create(o.prototype)).constructor=o,r.prototype._version=3,Object.defineProperty(r.prototype,"sources",{get:function(){for(var t=[],e=0;e/],r=t.split("\n"),i="",o=Math.min(e,20),a=0;a=t.length-1||(e=t.lastIndexOf(".",r-1))<=0||r-1<=e||!(n=i.list[t.slice(r+1)]))&&0<=n.indexOf(" "+t.slice(e+1,r)+" ")},is:function(t){var e,n=t.lastIndexOf(".");return!(n<=0||n>=t.length-1||0<=t.lastIndexOf(".",n-1)||!(e=i.list[t.slice(n+1)]))&&0<=e.indexOf(" "+t.slice(0,n)+" ")},get:function(t){var e,n,r=t.lastIndexOf(".");return r<=0||r>=t.length-1||(e=t.lastIndexOf(".",r-1))<=0||r-1<=e||!(n=i.list[t.slice(r+1)])||n.indexOf(" "+t.slice(e+1,r)+" ")<0?null:t.slice(e+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return i})},{}],61:[function(n,r,t){!function(t,e){"use strict";"object"==typeof r&&r.exports?r.exports=e(n("./punycode"),n("./IPv6"),n("./SecondLevelDomains")):"function"==typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],e):t.URI=e(t.punycode,t.IPv6,t.SecondLevelDomains,t)}(this,function(s,e,c,n){"use strict";var r=n&&n.URI;function p(t,e){var n=1<=arguments.length;if(!(this instanceof p))return n?2<=arguments.length?new p(t,e):new p(t):new p;if(void 0===t){if(n)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&n)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}p.version="1.19.11";var t=p.prototype,u=Object.prototype.hasOwnProperty;function o(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function a(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function l(t){return"Array"===a(t)}function h(t,e){var n,r,i={};if("RegExp"===a(e))i=null;else if(l(e))for(n=0,r=e.length;n]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,p.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},p.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,p.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,p.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},p.hostProtocols=["http","https"],p.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,p.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},p.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return p.domAttributes[e]}},p.encode=m,p.decode=decodeURIComponent,p.iso8859=function(){p.encode=escape,p.decode=unescape},p.unicode=function(){p.encode=m,p.decode=decodeURIComponent},p.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},p.encodeQuery=function(t,e){t=p.encode(t+"");return(e=void 0===e?p.escapeQuerySpace:e)?t.replace(/%20/g,"+"):t},p.decodeQuery=function(e,t){e+="",void 0===t&&(t=p.escapeQuerySpace);try{return p.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};function y(n,r){return function(e){try{return p[r](e+"").replace(p.characters[n][r].expression,function(t){return p.characters[n][r].map[t]})}catch(t){return e}}}var v,_={encode:"encode",decode:"decode"};for(v in _)p[v+"PathSegment"]=y("pathname",_[v]),p[v+"UrnPathSegment"]=y("urnpath",_[v]);function b(o,a,s){return function(t){for(var e=s?function(t){return p[a](p[s](t))}:p[a],n=(t+"").split(o),r=0,i=n.length;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=y-1,_=Math.floor,b=String.fromCharCode;function w(t){throw new RangeError(h[t])}function d(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function p(t,e){var n=t.split("@"),r="",n=(1>>10&1023|55296),t=56320|1023&t),e+=b(t)}).join("")}function S(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function T(t,e,n){var r=0;for(t=n?_(t/s):t>>1,t+=_(t/e);f*v>>1_((m-l)/o))&&w("overflow"),l+=s*o,!(s<(s=a<=f?1:f+v<=a?v:a-f));a+=y)o>_(m/(s=y-s))&&w("overflow"),o*=s;f=T(l-i,e=u.length+1,0==i),_(l/e)>m-h&&w("overflow"),h+=_(l/e),l%=e,u.splice(l++,0,h)}return g(u)}function k(t){for(var e,n,r,i,o,a,s,u,c,l,h=[],f=(t=x(t)).length,d=128,p=72,g=e=0;g_((m-e)/(u=n+1))&&w("overflow"),e+=(i-d)*u,d=i,g=0;gm&&w("overflow"),s==d){for(o=e,a=y;!(o<(c=a<=p?1:p+v<=a?v:a-p));a+=y)h.push(b(S(c+(l=o-c)%(c=y-c),0))),o=_(l/c);h.push(b(S(o,0))),p=T(e,u,n==r),e=0,++n}++e,++d}return h.join("")}if(i={version:"1.3.2",ucs2:{decode:x,encode:g},decode:A,encode:k,toASCII:function(t){return p(t,function(t){return c.test(t)?"xn--"+k(t):t})},toUnicode:function(t){return p(t,function(t){return u.test(t)?A(t.slice(4).toLowerCase()):t})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return i});else if(e&&n)if(C.exports==e)n.exports=i;else for(o in i)i.hasOwnProperty(o)&&(e[o]=i[o]);else t.punycode=i}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],63:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,e){var n;if(t)return"string"==typeof t?c(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nl&&(l=_.count)}}catch(t){v.e(t)}finally{v.f()}}else this._log("curve '".concat(g.curve.id,"' in terms not found")),n[g.curve.id]=null,r[g.curve.id]=null,i.push(g.curve.id),this._log("curve '".concat(g.curve.id,"' takes no name")),this._log("curve '".concat(g.curve.id,"' takes no color")),this._log("curve '".concat(g.curve.id,"' is hidding"));h.push([g.curve.id])}}catch(t){f.e(t)}finally{f.f()}this._log("".concat(l," is new max y")),e.y2=e.y=l;var w,x=G(c);try{for(x.s();!(w=x.n()).done;){var S,T=F(w.value,2),A=T[0],k=T[1],P=[],C=G(this._application.resources.entries());try{for(C.s();!(S=C.n()).done;){var E=F(S.value,1)[0],O=0;k[E]&&(O=k[E].count),P[E]=O}}catch(t){C.e(t)}finally{C.f()}h[0].push(new Date(A));var M,L=G(P.entries());try{for(L.s();!(M=L.n()).done;){var R=F(M.value,2),j=R[0],I=R[1];h[j+1].push(I)}}catch(t){L.e(t)}finally{L.f()}}}catch(t){x.e(t)}finally{x.f()}if(1===h[0].length){h[0].push(new Date);var D,N=G(this._application.resources.entries());try{for(N.s();!(D=N.n()).done;)h[F(D.value,1)[0]+1].push(0)}catch(t){N.e(t)}finally{N.f()}this._log("padded by zeros")}return this._canvas.show(),this._canvas.axis.max(e),this._canvas.data.names(n),this._canvas.data.colors(r),i.length&&(this._log("curves ".concat(i.map(function(t){return"'".concat(t,"'")}).join(", ")," will be hidden")),this._canvas.hide(i)),this._canvas.load({columns:h}),this._log("canvas rendered"),this}},{key:"toString",value:function(){return""}}])&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),V}(t.default),t=n;g(n,"NAME","Graph"),g(n,"ANIMATION_DURATION",300),g(n,"POINT_RADIUS",4),g(n,"POINT_STROKE_WIDTH",2),g(n,"X_ID","dates"),g(n,"Y_MAX",7),g(n,"log",(0,r.default)(t.NAME))},{Base:63,debug:35,"decorators/canvas":70,ractive:47}],68:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(t("debug")),o=i(t("ractive")),t=i(t("Base"));function i(t){return t&&t.__esModule?t:{default:t}}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){var n;if(t)return"string"==typeof t?S(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(t,e):void 0}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(t,e){var n;if(t)return"string"==typeof t?d(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ni.MAX_NAME_CHAR_COUNT?"".concat(this._name.substr(0,i.MAX_NAME_CHAR_COUNT-1).trim(),"…"):this._name}},{key:"uriSearch",get:function(){var t=new o.default("");return t.addSearch("term",this._name.toLowerCase()),t}},{key:"confirmTemporaryName",value:function(){this._name=this._temporaryName,this._temporaryName=""}},{key:"copyTemporaryName",value:function(){this._temporaryName=this._name}},{key:"borrowResource",value:function(){this._log("borrowing resource");var t,e=h(this._application.resources);try{for(e.s();!(t=e.n()).done;){var n=t.value;if(n.isFree)return n.isFree=!1,this._resource=n,this._log("resource with '".concat(this._resource.color.id,"' color id borrowed")),this}}catch(t){e.e(t)}finally{e.f()}return this._resource={},this._log("no resource borrowed"),this}},{key:"putResourceBack",value:function(){this._log("putting resource with '".concat(this._resource.color.id,"' color id back"));var t,e=h(this._application.resources);try{for(e.s();!(t=e.n()).done;){var n=t.value;if(n===this._resource)return n.isFree=!0,this._log("resource with '".concat(this._resource.color.id,"' color id put back")),this}}catch(t){e.e(t)}finally{e.f()}return this._resource={},this._log("no resource put back"),this}},{key:"freePeriods",value:function(){return this._log("freeing periods"),this._periods.length=0,this._log("periods freed"),this}},{key:"pushPeriodData",value:function(t){var e,t=t.data,n=(this._log("pushing period data"),h(t));try{for(n.s();!(e=n.n()).done;){var r=e.value,i=new a.default({application:this._application});i.pushData(r),this._periods.push(i)}}catch(t){n.e(t)}finally{n.f()}return this._log("period data pushed"),this}},{key:"freeQueries",value:function(){return this._log("freeing queries"),this._queries.length=0,this._log("queries freed"),this}},{key:"pushQueryData",value:function(t){var e,t=t.data,n=(this._log("pushing query data"),h(t.entries()));try{for(n.s();!(e=n.n()).done;){var r=l(e.value,2),i=r[0],o=r[1],a=this._query;(a=i?new s.default({application:this._application,term:this}):a).pushData(o).pushPeriodData({data:o.trend}),i&&this._queries.push(a)}}catch(t){n.e(t)}finally{n.f()}return this._log("query data pushed"),this}},{key:"toString",value:function(){return this._name||"?"}}])&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(i.default),n=t;_(t,"NAME","Term"),_(t,"MAX_NAME_CHAR_COUNT",22),_(t,"log",(0,r.default)(n.NAME))},{Base:63,debug:35,"models/Period":81,"models/Query":82,urijs:61}]},{},[64]);