ironsmith/web/js/ractive.min.js

10 lines
161 KiB
JavaScript
Raw Normal View History

2016-04-06 11:31:22 -05:00
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Ractive=e()}(this,function(){"use strict";function t(t){var e;if(t&&"boolean"!=typeof t)return"undefined"!=typeof window&&document&&t?t.nodeType?t:"string"==typeof t&&(e=document.getElementById(t),!e&&document.querySelector&&(e=document.querySelector(t)),e&&e.nodeType)?e:t[0]&&t[0].nodeType?t[0]:null:null}function e(t){return t&&"unknown"!=typeof t.parentNode&&t.parentNode&&t.parentNode.removeChild(t),t}function n(t){return null!=t&&t.toString?t:""}function i(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];for(var r,s;s=n.shift();)for(r in s)Oa.call(s,r)&&(t[r]=s[r]);return t}function r(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];return n.forEach(function(e){for(var n in e)!e.hasOwnProperty(n)||n in t||(t[n]=e[n])}),t}function s(t){return"[object Array]"===Pa.call(t)}function o(t){return Ta.test(Pa.call(t))}function a(t,e){return null===t&&null===e?!0:"object"==typeof t||"object"==typeof e?!1:t===e}function u(t){return!isNaN(parseFloat(t))&&isFinite(t)}function h(t){return t&&"[object Object]"===Pa.call(t)}function c(t,e){return t.replace(/%s/g,function(){return e.shift()})}function l(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];throw t=c(t,n),new Error(t)}function f(){Qb.DEBUG&&Aa.apply(null,arguments)}function d(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];t=c(t,n),Sa(t,n)}function p(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];t=c(t,n),Ra[t]||(Ra[t]=!0,Sa(t,n))}function m(){Qb.DEBUG&&d.apply(null,arguments)}function v(){Qb.DEBUG&&p.apply(null,arguments)}function g(t,e,n){var i=y(t,e,n);return i?i[t][n]:null}function y(t,e,n){for(;e;){if(n in e[t])return e;if(e.isolated)return null;e=e.parent}}function b(t){return function(){return t}}function w(t){var e,n,i,r,s,o;for(e=t.split("."),(n=Wa[e.length])||(n=x(e.length)),s=[],i=function(t,n){return t?"*":e[n]},r=n.length;r--;)o=n[r].map(i).join("."),s.hasOwnProperty(o)||(s.push(o),s[o]=!0);return s}function x(t){var e,n,i,r,s,o,a,u,h="";if(!Wa[t]){for(i=[];h.length<t;)h+=1;for(e=parseInt(h,2),r=function(t){return"1"===t},s=0;e>=s;s+=1){for(n=s.toString(2);n.length<t;)n="0"+n;for(u=[],a=n.length,o=0;a>o;o++)u.push(r(n[o]));i[s]=u}Wa[t]=i}return Wa[t]}function k(t,e,n,i){var r=t[e];if(!r||!r.equalsOrStartsWith(i)&&r.equalsOrStartsWith(n))return t[e]=r?r.replace(n,i):i,!0}function E(t){var e=t.slice(2);return"i"===t[1]&&u(e)?+e:e}function _(t){return null==t?t:(qa.hasOwnProperty(t)||(qa[t]=new $a(t)),qa[t])}function A(t,e){function n(e,n){var i,r,o;return n.isRoot?o=[].concat(Object.keys(t.viewmodel.data),Object.keys(t.viewmodel.mappings),Object.keys(t.viewmodel.computations)):(i=t.viewmodel.wrapped[n.str],r=i?i.get():t.viewmodel.get(n),o=r?Object.keys(r):null),o&&o.forEach(function(t){"_ractive"===t&&s(r)||e.push(n.join(t))}),e}var i,r,o;for(i=e.str.split("."),o=[Za];r=i.shift();)"*"===r?o=o.reduce(n,[]):o[0]===Za?o[0]=_(r):o=o.map(S(r));return o}function S(t){return function(e){return e.join(t)}}function C(t){return t?t.replace(za,".$1"):""}function O(t,e,n){if("string"!=typeof e||!u(n))throw new Error("Bad arguments");var i=void 0,r=void 0;if(/\*/.test(e))return r={},A(t,_(C(e))).forEach(function(e){var i=t.viewmodel.get(e);if(!u(i))throw new Error(Ka);r[e.str]=i+n}),t.set(r);if(i=t.get(e),!u(i))throw new Error(Ka);return t.set(e,+i+n)}function P(t,e){return Ha(this,t,void 0===e?1:+e)}function T(t){this.event=t,this.method="on"+t,this.deprecate=tu[t]}function F(t,e){var n=t.indexOf(e);-1===n&&t.push(e)}function R(t,e){for(var n=0,i=t.length;i>n;n++)if(t[n]==e)return!0;return!1}function j(t,e){var n;if(!s(t)||!s(e))return!1;if(t.length!==e.length)return!1;for(n=t.length;n--;)if(t[n]!==e[n])return!1;return!0}function N(t){return"string"==typeof t?[t]:void 0===t?[]:t}function D(t){return t[t.length-1]}function I(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}function
}var u={v:oa,t:e};return i&&(u.p=n),u}function Ze(t,e){return new Xf(t,e||{}).result}function He(t){var e=wa(od);return e.parse=function(e,n){return Ke(e,n||t)},e}function Ke(t,e){if(!Kf)throw new Error("Missing Ractive.parse - cannot parse template. Either preparse or use the version that includes the parser");return Kf(t,e||this.options)}function Ge(t,e){var n;if(!Xo){if(e&&e.noThrow)return;throw new Error("Cannot retrieve template #"+t+" as Ractive is not running in a browser.")}if(Ye(t)&&(t=t.substring(1)),!(n=document.getElementById(t))){if(e&&e.noThrow)return;throw new Error("Could not find template element with id #"+t)}if("SCRIPT"!==n.tagName.toUpperCase()){if(e&&e.noThrow)return;throw new Error("Template element with id #"+t+", must be a <script> element")}return"textContent"in n?n.textContent:n.innerHTML}function Ye(t){return t&&"#"===t[0]}function Je(t){return!("string"==typeof t)}function Xe(t){return t.defaults&&(t=t.defaults),sd.reduce(function(e,n){return e[n]=t[n],e},{})}function tn(t){var e,n=t._config.template;if(n&&n.fn)return e=en(t,n.fn),e!==n.result?(n.result=e,e=rn(e,t)):void 0}function en(t,e){var n=nn(ad.getParseOptions(t));return e.call(t,n)}function nn(t){var e=wa(ad);return e.parse=function(e,n){return ad.parse(e,n||t)},e}function rn(t,e){if("string"==typeof t)"#"===t[0]&&(t=ad.fromId(t)),t=Kf(t,ad.getParseOptions(e));else{if(void 0==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(t.v!==oa)throw new Error("Mismatched template version (expected "+oa+", 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 sn(t,e,n){if(e)for(var i in e)(n||!t.hasOwnProperty(i))&&(t[i]=e[i])}function on(t,e,n){if(!/_super/.test(n))return n;var i=function(){var t,r=an(i._parent,e),s="_super"in this,o=this._super;return this._super=r,t=n.apply(this,arguments),s?this._super=o:delete this._super,t};return i._parent=t,i._method=n,i}function an(t,e){var n,i;return e in t?(n=t[e],i="function"==typeof n?n:function(){return n}):i=Fa,i}function un(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 hn(t,e,n){if(e in t){if(n in t)throw new Error(un(e,n,!0));m(un(e,n)),t[n]=t[e]}}function cn(t){hn(t,"beforeInit","onconstruct"),hn(t,"init","onrender"),hn(t,"complete","oncomplete"),hn(t,"eventDefinitions","events"),s(t.adaptors)&&hn(t,"adaptors","adapt")}function ln(t,e,n,i){yd(i);for(var r in i)if(md.hasOwnProperty(r)){var s=i[r];"el"!==r&&"function"==typeof s?m(""+r+" is a Ractive option that does not expect a function and will be ignored","init"===t?n:null):n[r]=s}vd.forEach(function(r){r[t](e,n,i)}),Th[t](e,n,i),hd[t](e,n,i),Mh[t](e,n,i),fn(e.prototype,n,i)}function fn(t,e,n){for(var i in n)if(!pd[i]&&n.hasOwnProperty(i)){var r=n[i];"function"==typeof r&&(r=gd(t,i,r)),e[i]=r}}function dn(t){var e={};return t.forEach(function(t){return e[t]=!0}),e}function pn(){this.dirtyValue=this.dirtyArgs=!0,this.bound&&"function"==typeof this.owner.bubble&&this.owner.bubble()}function mn(){var t;return 1===this.items.length?this.items[0].detach():(t=document.createDocumentFragment(),this.items.forEach(function(e){var n=e.detach();n&&t.appendChild(n)}),t)}function vn(t){var e,n,i,r;if(this.items){for(n=this.items.length,e=0;n>e;e+=1)if(i=this.items[e],i.find&&(r=i.find(t)))return r;return null}}function gn(t,e){var n,i,r;if(this.items)for(i=this.items.length,n=0;i>n;n+=1)r=this.items[n],r.findAll&&r.findAll(t,e);return e}function yn(t,e){var n,i,r;if(this.items)for(i=this.items.length,n=0;i>n;n+=1)r=this.items[n],r.findAllComponents&&r.findAllComponents(t,e);return e}function bn(t){var e,n,i,r;if(this.items){for(e=this.items.length,n=0;e>n;n+=1)if(i=this.items[n],i.findComponent&&(r=i.findComponent(t)))return r;return null}}function wn(t){var e,n=t.in
}}function rs(t,e,n){var i=void 0,r=as(e,n.owner);if(r)return r;var s=y("partials",t,e);if(s){if(r=s.partials[e],"function"==typeof r&&(i=r.bind(s),i.isOwner=s.partials.hasOwnProperty(e),r=i.call(t,ad)),!r&&""!==r)return void m(Na,e,"partial","partial",{ractive:t});if(!ad.isParsed(r)){var o=ad.parse(r,ad.getParseOptions(s));o.p&&m("Partials ({{>%s}}) cannot contain nested inline partials",e,{ractive:t});var a=i?s:ss(s,e);a.partials[e]=r=o.t}return i&&(r._fn=i),r.v?r.t:r}}function ss(t,e){return t.partials.hasOwnProperty(e)?t:os(t.constructor,e)}function os(t,e){return t?t.partials.hasOwnProperty(e)?t:os(t._Parent,e):void 0}function as(t,e){if(e){if(e.template&&e.template.p&&e.template.p[t])return e.template.p[t];if(e.parentFragment&&e.parentFragment.owner)return as(t,e.parentFragment.owner)}}function us(t,e){var n,i=y("components",t,e);if(i&&(n=i.components[e],!n._Parent)){var r=n.bind(i);if(r.isOwner=i.components.hasOwnProperty(e),n=r(),!n)return void m(Na,e,"component","component",{ractive:t});"string"==typeof n&&(n=us(t,n)),n._fn=r,i.components[e]=n}return n}function hs(){var t=this.instance.fragment.detach();return jg.fire(this.instance),t}function cs(t){return this.instance.fragment.find(t)}function ls(t,e){return this.instance.fragment.findAll(t,e)}function fs(t,e){e._test(this,!0),this.instance.fragment&&this.instance.fragment.findAllComponents(t,e)}function ds(t){return t&&t!==this.name?this.instance.fragment?this.instance.fragment.findComponent(t):null:this.instance}function ps(){return this.parentFragment.findNextNode(this)}function ms(){return this.rendered?this.instance.fragment.firstNode():null}function vs(t,e,n){function i(t){var n,i;t.value=e,t.updating||(i=t.ractive,n=t.keypath,t.updating=!0,mu.start(i),i.viewmodel.mark(n),mu.end(),t.updating=!1)}var r,s,o,a,u,h;if(r=t.obj,s=t.prop,n&&!n.configurable){if("length"===s)return;throw new Error('Cannot use magic mode with property "'+s+'" - object is not configurable')}n&&(o=n.get,a=n.set),u=o||function(){return e},h=function(t){a&&a(t),e=o?o():t,h._ractiveWrappers.forEach(i)},h._ractiveWrappers=[t],Object.defineProperty(r,s,{get:u,set:h,enumerable:!0,configurable:!0})}function gs(t,e){var n,i,r,s;if(this.adaptors)for(n=this.adaptors.length,i=0;n>i;i+=1)if(r=this.adaptors[i],r.filter(e,t,this.ractive))return s=this.wrapped[t]=r.wrap(this.ractive,e,t,bs(t)),void(s.value=e)}function ys(t,e){var n,i={};if(!e)return t;e+=".";for(n in t)t.hasOwnProperty(n)&&(i[e+n]=t[n]);return i}function bs(t){var e;return iy[t]||(e=t?t+".":"",iy[t]=function(n,i){var r;return"string"==typeof n?(r={},r[e+n]=i,r):"object"==typeof n?e?ys(n,t):n:void 0}),iy[t]}function ws(t){var e,n,i=[Za];for(e=t.length;e--;)for(n=t[e].parent;n&&!n.isRoot;)-1===t.indexOf(n)&&F(i,n),n=n.parent;return i}function xs(t,e,n){var i;Es(t,e),n||(i=e.wildcardMatches(),i.forEach(function(n){ks(t,n,e)}))}function ks(t,e,n){var i,r,s;e=e.str||e,i=t.depsMap.patternObservers,r=i&&i[e],r&&r.forEach(function(e){s=n.join(e.lastKey),Es(t,s),ks(t,e,s)})}function Es(t,e){t.patternObservers.forEach(function(t){t.regex.test(e.str)&&t.update(e)})}function _s(){function t(t){var i=t.key;t.viewmodel===o?(o.clearCache(i.str),t.invalidate(),n.push(i),e(i)):t.viewmodel.mark(i)}function e(n){var i,r;o.noCascade.hasOwnProperty(n.str)||((r=o.deps.computed[n.str])&&r.forEach(t),(i=o.depsMap.computed[n.str])&&i.forEach(e))}var n,i,r,s=this,o=this,a={};return n=this.changes,n.length?(n.slice().forEach(e),i=ry(n),i.forEach(function(e){var i;-1===n.indexOf(e)&&(i=o.deps.computed[e.str])&&i.forEach(t)}),this.changes=[],this.patternObservers.length&&(i.forEach(function(t){return sy(s,t,!0)}),n.forEach(function(t){return sy(s,t)})),this.deps.observers&&(i.forEach(function(t){return As(s,null,t,"observers")}),Cs(this,n,"observers")),this.deps["default"]&&(r=[],i.forEach(function(t){return As(s,r,t,"default")}),r.length&&Ss(this,r,n),Cs(this,n,"default")),n.forEach(function(t){a[t.str]=s.get(t)}),this.implicitChanges={},this.noCascade={},a):void 0}function As(t,e,n,i){var r,s;(r=Os(t,n,i))&&(s=t.get(n),r.forEach(function(t){e&&t.refineValu
null!==s&&(n=this.interpolator(e),mu.start(this.root),this.root.viewmodel.set(s,n),mu.end()),this.step&&this.step(e,n),!0)):!1},stop:function(){var t;this.running=!1,t=this.root._animations.indexOf(this),-1===t&&m("Animation was not found"),this.root._animations.splice(t,1)}};var wu=bu,xu=nt,ku={stop:Fa},Eu=rt,_u=new nu("detach"),Au=st,Su=ot,Cu=function(){var t,e,n;t=this._root[this._isComponentQuery?"liveComponentQueries":"liveQueries"],e=this.selector,n=t.indexOf(e),-1!==n&&(t.splice(n,1),t[e]=null)},Ou=function(t,e){var n,i,r,s,o,a,u,h,c,l;for(n=ut(t.component||t._ractive.proxy),i=ut(e.component||e._ractive.proxy),r=D(n),s=D(i);r&&r===s;)n.pop(),i.pop(),o=r,r=D(n),s=D(i);if(r=r.component||r,s=s.component||s,c=r.parentFragment,l=s.parentFragment,c===l)return a=c.items.indexOf(r),u=l.items.indexOf(s),a-u||n.length-i.length;if(h=o.fragments)return a=h.indexOf(c),u=h.indexOf(l),a-u||n.length-i.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!")},Pu=function(t,e){var n;return t.compareDocumentPosition?(n=t.compareDocumentPosition(e),2&n?1:-1):Ou(t,e)},Tu=function(){this.sort(this._isComponentQuery?Ou:Pu),this._dirty=!1},Fu=function(){var t=this;this._dirty||(this._dirty=!0,mu.scheduleTask(function(){t._sort()}))},Ru=function(t){var e=this.indexOf(this._isComponentQuery?t.instance:t);-1!==e&&this.splice(e,1)},ju=ht,Nu=ct,Du=lt,Iu=ft,Lu=dt,Vu=pt,Mu={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}},Uu=Mu,Wu=mt,zu=yt,Bu=bt,qu={capture:!0,noUnwrap:!0,fullRootGet:!0},$u=wt,Qu=new nu("insert"),Zu=kt,Hu=function(t,e,n,i){this.root=t,this.keypath=e,this.callback=n,this.defer=i.defer,this.context=i&&i.context?i.context:t};Hu.prototype={init:function(t){this.value=this.root.get(this.keypath.str),t!==!1?this.update():this.oldValue=this.value},setValue:function(t){var e=this;a(t,this.value)||(this.value=t,this.defer&&this.ready?mu.scheduleTask(function(){return e.update()}):this.update())},update:function(){this.updating||(this.updating=!0,this.callback.call(this.context,this.value,this.oldValue,this.keypath.str),this.oldValue=this.value,this.updating=!1)}};var Ku,Gu=Hu,Yu=Et,Ju=Array.prototype.slice;Ku=function(t,e,n,i){this.root=t,this.callback=n,this.defer=i.defer,this.keypath=e,this.regex=new RegExp("^"+e.str.replace(/\./g,"\\.").replace(/\*/g,"([^\\.]+)")+"$"),this.values={},this.defer&&(this.proxies=[]),this.context=i&&i.context?i.context:t},Ku.prototype={init:function(t){var e,n;if(e=Yu(this.root,this.keypath),t!==!1)for(n in e)e.hasOwnProperty(n)&&this.update(_(n));else this.values=e},update:function(t){var e,n=this;if(t.isPattern){e=Yu(this.root,t);for(t in e)e.hasOwnProperty(t)&&this.update(_(t))}else if(!this.root.viewmodel.implicitChanges[t.str])return this.defer&&this.ready?void mu.scheduleTask(function(){return n.getProxy(t).update()}):void this.reallyUpdate(t)},reallyUpdate:function(t){var e,n,i,r;return e=t.str,n=this.root.viewmodel.get(t),this.updating?void(this.values[e]=n):(this.updating=!0,a(n,this.values[e])&&this.ready||(i=Ju.call(this.regex.exec(e),1),r=[n,this.values[e],e].concat(i),this.values[e]=n,this.callback.apply(this.context,r)),void(this.updating=!1))},getProxy:function(t){var e=this;return this.proxies[t.str]||(this.proxies[t.str]={update:function(){return e.reallyUpdate(t)}}),this.proxies[t.str]}};var Xu,th,eh,nh,ih,rh,sh=Ku,oh=_t,ah={},uh=At,hh=St,ch=function(t){return t.trim()},lh=function(t){return""!==t},fh=Ct,dh=Ot,ph=Pt,mh=Tt,vh=Array.prototype,gh=function(t){return function(e){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;n>r;r++)i[r-1]=arguments[r];var o,a,u,h,c=[];if(e=_(C(e)),o=this.viewmodel.get(e),a=o.length,!s(o))throw new Error("Called ractive."+t+"('"+e.str+"'), but '"+e.str+"' does not refer to an array");return c=mh(o,t,i),h=vh[t].apply(o,i),u=mu.start(this,!0).then(function(){return h}),c?this.vie
novalidate:"noValidate",pubdate:"pubDate",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"},lm=Vi,fm=Ui,dm=Wi,pm=zi,mm=Bi,vm=qi,gm=$i,ym=Qi,bm=Zi,wm=Hi,xm=Ki,km=Gi,Em=Yi,_m=Ji,Am=Xi,Sm=function(t){this.init(t)};Sm.prototype={bubble:im,init:am,rebind:um,render:hm,toString:lm,unbind:fm,update:Am};var Cm,Om=Sm,Pm=function(t,e){var n,i,r=[];for(n in e)"twoway"!==n&&"lazy"!==n&&e.hasOwnProperty(n)&&(i=new Om({element:t,name:n,value:e[n],root:t.root}),r[n]=i,"value"!==n&&r.push(i));return(i=r.value)&&r.push(i),r};"undefined"!=typeof document&&(Cm=la("div"));var Tm=function(t,e){this.element=t,this.root=t.root,this.parentFragment=t.parentFragment,this.attributes=[],this.fragment=new yb({root:t.root,owner:this,template:[e]})};Tm.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===ia.svg,this.update()},unbind:function(){this.fragment.unbind()},update:function(){var t,e,n=this;t=this.fragment.toString(),e=tr(t,this.isSvg),this.attributes.filter(function(t){return er(e,t)}).forEach(function(t){n.node.removeAttribute(t.name)}),e.forEach(function(t){n.node.setAttribute(t.name,t.value)}),this.attributes=e},toString:function(){return this.fragment.toString()}};var Fm=Tm,Rm=function(t,e){return e?e.map(function(e){return new Fm(t,e)}):[]},jm=function(t){var e,n,i,r;if(this.element=t,this.root=t.root,this.attribute=t.attributes[this.name||"value"],e=this.attribute.interpolator,e.twowayBinding=this,n=e.keypath){if("}"===n.str.slice(-1))return v("Two-way binding does not work with expressions (`%s` on <%s>)",e.resolver.uniqueString,t.name,{ractive:this.root}),!1;if(n.isSpecial)return v("Two-way binding does not work with %s",e.resolver.ref,{ractive:this.root}),!1}else{var s=e.template.r?"'"+e.template.r+"' reference":"expression";m("The %s being used for two-way binding is ambiguous, and may cause unexpected results. Consider initialising your data to eliminate the ambiguity",s,{ractive:this.root}),e.resolver.forceResolution(),n=e.keypath}this.attribute.isTwoway=!0,this.keypath=n,i=this.root.viewmodel.get(n),void 0===i&&this.getInitialValue&&(i=this.getInitialValue(),void 0!==i&&this.root.viewmodel.set(n,i)),(r=nr(t))&&(this.resetValue=i,r.formBindings.push(this))};jm.prototype={handleChange:function(){var t=this;mu.start(this.root),this.attribute.locked=!0,this.root.viewmodel.set(this.keypath,this.getValue()),mu.scheduleTask(function(){return t.attribute.locked=!1}),mu.end()},rebound:function(){var t,e,n;e=this.keypath,n=this.attribute.interpolator.keypath,e!==n&&(I(this.root._twowayBindings[e.str],this),this.keypath=n,t=this.root._twowayBindings[n.str]||(this.root._twowayBindings[n.str]=[]),t.push(this))},unbind:function(){}},jm.extend=function(t){var e,n=this;return e=function(t){jm.call(this,t),this.init&&this.init()},e.prototype=wa(n.prototype),i(e.prototype,t),e.extend=jm.extend,e};var Nm,Dm=jm,Im=ir;Nm=Dm.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,this.element.lazy===!0?t=!0:this.element.lazy===!1?t=!1:u(this.element.lazy)?(t=!1,n=+this.element.lazy):u(t||"")&&(n=+t,t=!1,this.element.lazy=n),this.handler=n?sr:Im,e.addEventListener("change",Im,!1),t||(e.addEventListener("input",this.handler,!1),e.attachEvent&&e.addEventListener("keyup",this.handler,!1)),e.addEventListener("blur",rr,!1)},unrender:function(){var t=this.element.node;this.rendered=!1,t.removeEventListener("change",Im,!1),t.removeEventListener("input",this.handler,!1),t.removeEventListener("keyup",this.handler,!1),t.removeEventListener("blur",rr,!1)}});var Lm=Nm,Vm=Lm.extend({getInitialValue:function(){return this.element.fragment?this.element.fragment.toString():""},getValue:function(){return this.element.node.innerHTML}}),Mm=Vm,Um=or,Wm={},zm=Dm.extend({name:"checked",init:function(){this.siblings=Um(this.root._guid,"radio",this.element.getAttribute("name")),this.siblings.push(thi
this.node},toString:function(){return"<!--"+this.value+"-->"},unrender:function(t){t&&this.node.parentNode.removeChild(this.node)}};var rb=ib,sb=function(t){var e,n;this.type=oc,this.container=e=t.parentFragment.root,this.component=n=e.component,this.container=e,this.containerFragment=t.parentFragment,this.parentFragment=n.parentFragment;var i=this.name=t.template.n||"",r=e._inlinePartials[i];r||(m('Could not find template for partial "'+i+'"',{ractive:t.root}),r=[]),this.fragment=new yb({owner:this,root:e.parent,template:r,pElement:this.containerFragment.pElement}),s(n.yielders[i])?n.yielders[i].push(this):n.yielders[i]=[this],mu.scheduleTask(function(){if(n.yielders[i].length>1)throw new Error("A component template can only have one {{yield"+(i?" "+i:"")+"}} declaration at a time")})};sb.prototype={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)},findNextNode:function(){return this.containerFragment.findNextNode(this)},firstNode:function(){return this.fragment.firstNode()},getValue:function(t){return this.fragment.getValue(t)},render:function(){return this.fragment.render()},unbind:function(){this.fragment.unbind()},unrender:function(t){this.fragment.unrender(t),I(this.component.yielders[this.name],this)},rebind:function(t,e){this.fragment.rebind(t,e)},toString:function(){return this.fragment.toString()}};var ob=sb,ab=function(t){this.declaration=t.template.a};ab.prototype={init:Fa,render:Fa,unrender:Fa,teardown:Fa,toString:function(){return"<!DOCTYPE"+this.declaration+">"}};var ub=ab,hb=Eo,cb=Ao,lb=So,fb=Co,db=To,pb=Ro,mb=function(t){this.init(t)};mb.prototype={bubble:wd,detach:xd,find:kd,findAll:Ed,findAllComponents:_d,findComponent:Ad,findNextNode:Sd,firstNode:Cd,getArgsList:Pd,getNode:Td,getValue:Fd,init:hb,rebind:cb,registerIndexRef:function(t){var e=this.registeredIndexRefs;-1===e.indexOf(t)&&e.push(t)},render:lb,toString:fb,unbind:db,unregisterIndexRef:function(t){var e=this.registeredIndexRefs;e.splice(e.indexOf(t),1)},unrender:pb};var vb,gb,yb=mb,bb=jo,wb=["template","partials","components","decorators","events"],xb=new nu("reset"),kb=function(t,e){function n(e,i,r){r&&r.partials[t]||e.forEach(function(e){e.type===tc&&e.getPartialName()===t&&i.push(e),e.fragment&&n(e.fragment.items,i,r),s(e.fragments)?n(e.fragments,i,r):s(e.items)?n(e.items,i,r):e.type===sc&&e.instance&&n(e.instance.fragment.items,i,e.instance),e.type===Xh&&(s(e.attributes)&&n(e.attributes,i,r),s(e.conditionalAttributes)&&n(e.conditionalAttributes,i,r))})}var i,r=[];return n(this.fragment.items,r),this.partials[t]=e,i=mu.start(this,!0),r.forEach(function(e){e.value=void 0,e.setValue(t)}),mu.end(),i},Eb=No,_b=gh("reverse"),Ab=Do,Sb=gh("shift"),Cb=gh("sort"),Ob=gh("splice"),Pb=Lo,Tb=Vo,Fb=new nu("teardown"),Rb=Uo,jb=Wo,Nb=zo,Db=new nu("unrender"),Ib=gh("unshift"),Lb=Bo,Vb=new nu("update"),Mb=qo,Ub={add:Ga,animate:xu,detach:Eu,find:Au,findAll:Nu,findAllComponents:Du,findComponent:Iu,findContainer:Lu,findParent:Vu,fire:zu,get:Bu,insert:$u,merge:Zu,observe:uh,observeOnce:hh,off:fh,on:dh,once:ph,pop:yh,push:bh,render:Sh,reset:bb,resetPartial:kb,resetTemplate:Eb,reverse:_b,set:Ab,shift:Sb,sort:Cb,splice:Ob,subtract:Pb,teardown:Tb,toggle:Rb,toHTML:jb,toHtml:jb,unrender:Nb,unshift:Ib,update:Lb,updateModel:Mb},Wb=function(t,e,n){return n||Qo(t,e)?function(){var n,i="_super"in this,r=this._super;return this._super=e,n=t.apply(this,arguments),i&&(this._super=r),n}:t},zb=Zo,Bb=Yo,qb=function(t){var e,n,i={};return t&&(e=t._ractive)?(i.ractive=e.root,i.keypath=e.keypath.str,i.index={},(n=qd(e.proxy.parentFragment))&&(i.index=qd.resolve(n)),i):i};vb=function(t){return this instanceof vb?void By(this,t):new vb(t)},gb={DEBUG:{writable:!0,value:!0},DEBUG_PROMISES:{writable:!0,value:!0},extend:{value:Bb},getNodeInfo:{value:qb},parse:{value:Kf},Promise:{value:ou},svg:{value:ra},magic:{value:na},VERSION:{value:"0.7.3"},ad
//# sourceMappingURL=ractive.min.js.map