((function(){var a,b=[].slice;a=function(){var c;return c=1<=arguments.length?b.call(arguments,0):[],function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b),f=typeof e;return f=="object"||f=="function"?e||d:d}(a.Object,c,function(){})},a.version="0.10.0",a.config={pathPrefix:"/",usePushState:!1,minificationErrors:!0},(a.container=function(){return this}()).Batman=a,typeof define=="function"&&define("batman",[],function(){return a}),a.exportHelpers=function(b){var c,d,e,f;f=["mixin","extend","unmixin","redirect","typeOf","redirect","setImmediate","clearImmediate"];for(d=0,e=f.length;d=0)return a+"th";switch(c%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd";default:return a+"th"}},c.prototype.pluralize=function(a){var b,c,d,e,f,g,h,i,j,k;i=this._uncountable;for(e=0,g=i.length;e=0?(Batman.setImmediate=function(a){var b,c;return b=f(),c=document.createElement("script"),c.onreadystatechange=function(){var a;return typeof (a=i.get(b))=="function"&&a(),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},document.documentElement.appendChild(c),b},Batman.clearImmediate=function(a){return i.unset(a)}):(typeof process!="undefined"&&process!==null?process.nextTick:void 0)?(d={},Batman.setImmediate=function(a){var b;return b=f(),d[b]=a,process.nextTick(function(){return typeof d[b]=="function"&&d[b](),delete d[b]}),b},Batman.clearImmediate=function(a){return delete d[a]}):(Batman.setImmediate=function(a){return setTimeout(a,0)},Batman.clearImmediate=function(a){return clearTimeout(a)}),Batman.setImmediate=Batman.setImmediate,Batman.clearImmediate=Batman.clearImmediate},Batman.setImmediate=function(){return a(Batman.container),Batman.setImmediate.apply(this,arguments)},Batman.clearImmediate=function(){return a(Batman.container),Batman.clearImmediate.apply(this,arguments)},Batman.forEach=function(a,b,c){var d,e,f,g,h,i,j,k;if(a.forEach)return a.forEach(b,c);if(a.indexOf){j=[];for(e=h=0,i=a.length;h=0:typeof a.has=="function"?a.has(b):Batman.objectHasKey(a,b)},Batman.get=function(a,b){return typeof a.get=="function"?a.get(b):Batman.Property.forBaseAndKey(a,b).getValue()},Batman.getPath=function(a,b){var c,d,e;for(d=0,e=b.length;d":">",'"':""","'":"'"},function(b){return(""+b).replace(/[&<>'"]/g,function(b){return a[b]})}}(),Batman.translate=function(a,b){return b==null&&(b={}),Batman.helpers.interpolate(Batman.get(Batman.translate.messages,a),b)},Batman.translate.messages={},Batman.t=function(){return Batman.translate.apply(Batman,arguments)},Batman.redirect=function(a){var b;return(b=Batman.navigator)!=null?b.redirect(a):void 0},Batman.initializeObject=function(a){return a._batman!=null?a._batman.check(a):a._batman=new Batman._Batman(a)}}.call(this),function(){}.call(this),function(){var a;Batman._Batman=a=function(){function a(a){this.object=a}return a.prototype.check=function(a){return a!==this.object?(a._batman=new Batman._Batman(a),!1):!0},a.prototype.get=function(a){var b,c;c=this.getAll(a);switch(c.length){case 0:return void 0;case 1:return c[0];default:return b=c[0].concat!=null?function(a,b){return a.concat(b)}:c[0].merge!=null?function(a,b){return a.merge(b)}:c.every(function(a){return typeof a=="object"})?(c.unshift({}),function(a,b){return Batman.extend(a,b)}):void 0,b?c.reduceRight(b):c}},a.prototype.getFirst=function(a){var b;return b=this.getAll(a),b[0]},a.prototype.getAll=function(a){var b,c,d;return typeof a=="function"?b=a:b=function(b){var c;return(c=b._batman)!=null?c[a]:void 0},c=this.ancestors(b),(d=b(this.object))&&c.unshift(d),c},a.prototype.ancestors=function(a){var b,c,d,e,f,g,h;return a==null&&(a=function(a){return a}),e=[],b=!!this.object.prototype,c=b?(g=this.object.__super__)!=null?g.constructor:void 0:(d=Object.getPrototypeOf(this.object))===this.object?this.object.constructor.__super__:d,c!=null&&((h=c._batman)!=null&&h.check(c),f=a(c),f!=null&&e.push(f),c._batman!=null&&(e=e.concat(c._batman.ancestors(a)))),e},a.prototype.set=function(a,b){return this[a]=b},a}()}.call(this),function(){Batman.Event=function(){function a(a,b){this.base=a,this.key=b,this.handlers=[],this._preventCount=0}return a.forBaseAndKey=function(a,b){return a.isEventEmitter?a.event(b):new Batman.Event(a,b)},a.prototype.isEvent=!0,a.prototype.isEqual=function(a){return this.constructor===a.constructor&&this.base===a.base&&this.key===a.key},a.prototype.hashKey=function(){var a;return this.hashKey=function(){return a},a="'},a.prototype.addHandler=function(a){return this.handlers.indexOf(a)===-1&&this.handlers.push(a),this.oneShot&&this.autofireHandler(a),this},a.prototype.removeHandler=function(a){var b;return(b=this.handlers.indexOf(a))!==-1&&this.handlers.splice(b,1),this},a.prototype.eachHandler=function(a){var b,c,d;this.handlers.slice().forEach(a);if((c=this.base)!=null?c.isEventEmitter:void 0)return b=this.key,(d=this.base._batman)!=null?d.ancestors(function(c){var d,e,f;if(c.isEventEmitter&&((e=c._batman)!=null?(f=e.events)!=null?f.hasOwnProperty(b):void 0:void 0))return d=c.event(b).handlers,d.slice().forEach(a)}):void 0},a.prototype.clearHandlers=function(){return this.handlers=[]},a.prototype.handlerContext=function(){return this.base},a.prototype.prevent=function(){return++this._preventCount},a.prototype.allow=function(){return this._preventCount&&--this._preventCount,this._preventCount},a.prototype.isPrevented=function(){return this._preventCount>0},a.prototype.autofireHandler=function(a){if(this._oneShotFired&&this._oneShotArgs!=null)return a.apply(this.handlerContext(),this._oneShotArgs)},a.prototype.resetOneShot=function(){return this._oneShotFired=!1,this._oneShotArgs=null},a.prototype.fire=function(){var a,b;return this.isPrevented()||this._oneShotFired?!1:(b=this.handlerContext(),a=arguments,this.oneShot&&(this._oneShotFired=!0,this._oneShotArgs=arguments),this.eachHandler(function(c){return c.apply(b,a)}))},a.prototype.allowAndFire=function(){return this.allow(),this.fire.apply(this,arguments)},a}()}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.PropertyEvent=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.eachHandler=function(a){return this.base.eachObserver(a)},c.prototype.handlerContext=function(){return this.base.base},c}(Batman.Event)}.call(this),function(){var a=[].slice;Batman.EventEmitter={isEventEmitter:!0,hasEvent:function(a){var b,c;return(b=this._batman)!=null?typeof b.get=="function"?(c=b.get("events"))!=null?c.hasOwnProperty(a):void 0:void 0:void 0},event:function(a){var b,c,d,e,f;return Batman.initializeObject(this),b=this.eventClass||Batman.Event,c=(f=this._batman).events||(f.events={}),c.hasOwnProperty(a)?d=c[a]:(this._batman.ancestors(function(b){var c,e;return d||(d=(c=b._batman)!=null?(e=c.events)!=null?e[a]:void 0:void 0)}),e=c[a]=new b(this,a),e.oneShot=d!=null?d.oneShot:void 0,e)},on:function(a,b){return this.event(a).addHandler(b)},once:function(a,b){var c,d;return c=this.event(a),d=function(){return b.apply(this,arguments),c.removeHandler(d)},c.addHandler(d)},registerAsMutableSource:function(){return Batman.Property.registerSource(this)},mutation:function(a){return function(){var b;return b=a.apply(this,arguments),this.event("change").fire(this,this),b}},prevent:function(a){return this.event(a).prevent(),this},allow:function(a){return this.event(a).allow(),this},isPrevented:function(a){return this.event(a).isPrevented()},fire:function(){var b,c,d;return c=arguments[0],b=2<=arguments.length?a.call(arguments,1):[],(d=this.event(c)).fire.apply(d,b)},allowAndFire:function(){var b,c,d;return c=arguments[0],b=2<=arguments.length?a.call(arguments,1):[],(d=this.event(c)).allowAndFire.apply(d,b)}}}.call(this),function(){var a=[].slice;Batman.Enumerable={isEnumerable:!0,map:function(a,b){var c;return b==null&&(b=Batman.container),c=[],this.forEach(function(){return c.push(a.apply(b,arguments))}),c},mapToProperty:function(a){var b;return b=[],this.forEach(function(c){return b.push(c.get(a))}),b},every:function(a,b){var c;return b==null&&(b=Batman.container),c=!0,this.forEach(function(){return c=c&&a.apply(b,arguments)}),c},some:function(a,b){var c;return b==null&&(b=Batman.container),c=!1,this.forEach(function(){return c=c||a.apply(b,arguments)}),c},reduce:function(b,c){var d,e;return d=0,e=this,this.forEach(function(){return c!=null?c=b.apply(null,[c].concat(a.call(arguments),[d],[e])):c=arguments[0]}),c},filter:function(a){var b,c;return b=new this.constructor,b.add?c=function(b,c){return a(c)&&b.add(c),b}:b.set?c=function(b,c,d){return a(c,d)&&b.set(c,d),b}:(b.push||(b=[]),c=function(b,c){return a(c)&&b.push(c),b}),this.reduce(c,b)},inGroupsOf:function(a){var b,c,d;return d=[],b=!1,c=0,this.forEach(function(e){return c++%a===0&&(b=[],d.push(b)),b.push(e)}),d}}}.call(this),function(){var a=[].slice;Batman.SimpleHash=function(){function b(a){this._storage={},this.length=0,a!=null&&this.update(a)}return Batman.extend(b.prototype,Batman.Enumerable),b.prototype.propertyClass=Batman.Property,b.prototype.hasKey=function(a){var b,c,d,e;if(this.objectKey(a)){if(!this._objectStorage)return!1;if(c=this._objectStorage[this.hashKeyFor(a)])for(d=0,e=c.length;d0&&this.add.apply(this,arguments)}return Batman.extend(b.prototype,Batman.Enumerable),b.prototype.has=function(a){return!!~this._indexOfItem(a)},b.prototype.add=function(){var b,c,d,e,f;d=1<=arguments.length?a.call(arguments,0):[],b=[];for(e=0,f=d.length;e'},b.prototype.event=function(a){var b,c;return b=this.eventClass||Batman.Event,this.events||(this.events={}),(c=this.events)[a]||(c[a]=new b(this,a)),this.events[a]},b.prototype.changeEvent=function(){var a;return a=this.event("change"),this.changeEvent=function(){return a},a},b.prototype.accessor=function(){var a;return a=this.constructor.accessorForBaseAndKey(this.base,this.key),this.accessor=function(){return a},a},b.prototype.eachObserver=function(a){var b;b=this.key,this.changeEvent().handlers.slice().forEach(a);if(this.base.isObservable)return this.base._batman.ancestors(function(c){var d,e;if(c.isObservable&&c.hasProperty(b))return e=c.property(b),d=e.changeEvent().handlers,d.slice().forEach(a)})},b.prototype.observers=function(){var a;return a=[],this.eachObserver(function(b){return a.push(b)}),a},b.prototype.hasObservers=function(){return this.observers().length>0},b.prototype.updateSourcesFromTracker=function(){var a,b;return b=this.constructor.popSourceTracker(),a=this.sourceChangeHandler(),this._eachSourceChangeEvent(function(b){return b.removeHandler(a)}),this.sources=b,this._eachSourceChangeEvent(function(b){return b.addHandler(a)})},b.prototype._eachSourceChangeEvent=function(a){if(this.sources==null)return;return this.sources.forEach(function(b){return a(b.event("change"))})},b.prototype.getValue=function(){this.registerAsMutableSource();if(!this.isCached()){this.constructor.pushSourceTracker();try{this.value=this.valueFromAccessor(),this.cached=!0}finally{this.updateSourcesFromTracker()}}return this.value},b.prototype.isCachable=function(){var a;return this.isFinal()?!0:(a=this.accessor().cache,a!=null?!!a:!0)},b.prototype.isCached=function(){return this.isCachable()&&this.cached},b.prototype.isFinal=function(){return!!this.accessor()["final"]},b.prototype.refresh=function(){var a,b;this.cached=!1,a=this.value,b=this.getValue(),b!==a&&!this.isIsolated()&&this.fire(b,a);if(this.value!==void 0&&this.isFinal())return this.lockValue()},b.prototype.sourceChangeHandler=function(){var a,b=this;return a=this._handleSourceChange.bind(this),this.sourceChangeHandler=function(){return a},a},b.prototype._handleSourceChange=function(){return this.isIsolated()?this._needsRefresh=!0:!this.isFinal()&&!this.hasObservers()?this.cached=!1:this.refresh()},b.prototype.valueFromAccessor=function(){var a;return(a=this.accessor().get)!=null?a.call(this.base,this.key):void 0},b.prototype.setValue=function(a){var b;if(!(b=this.accessor().set))return;return this._changeValue(function(){return b.call(this.base,this.key,a)})},b.prototype.unsetValue=function(){var a;if(!(a=this.accessor().unset))return;return this._changeValue(function(){return a.call(this.base,this.key)})},b.prototype._changeValue=function(a){var b;this.cached=!1,this.constructor.pushDummySourceTracker();try{b=a.apply(this),this.refresh()}finally{this.constructor.popSourceTracker()}return!this.isCached()&&!this.hasObservers()&&this.die(),b},b.prototype.forget=function(a){return a!=null?this.changeEvent().removeHandler(a):this.changeEvent().clearHandlers()},b.prototype.observeAndFire=function(a){return this.observe(a),a.call(this.base,this.value,this.value,this.key)},b.prototype.observe=function(a){return this.changeEvent().addHandler(a),this.sources==null&&this.getValue(),this},b.prototype.observeOnce=function(a){var b,c;return b=this.changeEvent(),c=function(){return a.apply(this,arguments),b.removeHandler(c)},b.addHandler(c),this.sources==null&&this.getValue(),this},b.prototype._removeHandlers=function(){var a;return a=this.sourceChangeHandler(),this._eachSourceChangeEvent(function(b){return b.removeHandler(a)}),delete this.sources,this.changeEvent().clearHandlers()},b.prototype.lockValue=function(){return this._removeHandlers(),this.getValue=function(){return this.value},this.setValue=this.unsetValue=this.refresh=this.observe=function(){}},b.prototype.die=function(){var a,b;return this._removeHandlers(),(a=this.base._batman)!=null&&(b=a.properties)!=null&&b.unset(this.key),this.isDead=!0},b.prototype.fire=function(){var b;return(b=this.changeEvent()).fire.apply(b,a.call(arguments).concat([this.key]))},b.prototype.isolate=function(){return this._isolationCount===0&&(this._preIsolationValue=this.getValue()),this._isolationCount++},b.prototype.expose=function(){if(this._isolationCount===1)return this._isolationCount--,this._needsRefresh?(this.value=this._preIsolationValue,this.refresh()):this.value!==this._preIsolationValue&&this.fire(this.value,this._preIsolationValue),this._preIsolationValue=null;if(this._isolationCount>0)return this._isolationCount--},b.prototype.isIsolated=function(){return this._isolationCount>0},b}()}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.Keypath=function(a){function c(a,b){typeof b=="string"?(this.segments=b.split("."),this.depth=this.segments.length):(this.segments=[b],this.depth=1),c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.isCachable=function(){return this.depth===1?c.__super__.isCachable.apply(this,arguments):!0},c.prototype.terminalProperty=function(){var a;a=Batman.getPath(this.base,this.segments.slice(0,-1));if(a==null)return;return Batman.Keypath.forBaseAndKey(a,this.segments[this.depth-1])},c.prototype.valueFromAccessor=function(){return this.depth===1?c.__super__.valueFromAccessor.apply(this,arguments):Batman.getPath(this.base,this.segments)},c.prototype.setValue=function(a){var b;return this.depth===1?c.__super__.setValue.apply(this,arguments):(b=this.terminalProperty())!=null?b.setValue(a):void 0},c.prototype.unsetValue=function(){var a;return this.depth===1?c.__super__.unsetValue.apply(this,arguments):(a=this.terminalProperty())!=null?a.unsetValue():void 0},c}(Batman.Property)}.call(this),function(){var a=[].slice;Batman.Observable={isObservable:!0,hasProperty:function(a){var b,c;return(b=this._batman)!=null?(c=b.properties)!=null?typeof c.hasKey=="function"?c.hasKey(a):void 0:void 0:void 0},property:function(a){var b,c,d;return Batman.initializeObject(this),c=this.propertyClass||Batman.Keypath,b=(d=this._batman).properties||(d.properties=new Batman.SimpleHash),b.get(a)||b.set(a,new c(this,a))},get:function(a){return this.property(a).getValue()},set:function(a,b){return this.property(a).setValue(b)},unset:function(a){return this.property(a).unsetValue()},getOrSet:Batman.SimpleHash.prototype.getOrSet,forget:function(a,b){var c;return a?this.property(a).forget(b):(c=this._batman.properties)!=null&&c.forEach(function(a,b){return b.forget()}),this},observe:function(){var b,c,d;return c=arguments[0],b=2<=arguments.length?a.call(arguments,1):[],(d=this.property(c)).observe.apply(d,b),this},observeAndFire:function(){var b,c,d;return c=arguments[0],b=2<=arguments.length?a.call(arguments,1):[],(d=this.property(c)).observeAndFire.apply(d,b),this},observeOnce:function(){var b,c,d;return c=arguments[0],b=2<=arguments.length?a.call(arguments,1):[],(d=this.property(c)).observeOnce.apply(d,b),this}}}.call(this),function(){Batman.DOM={textInputTypes:["text","search","tel","url","email","password"],scrollIntoView:function(a){var b;return(b=document.getElementById(a))!=null?typeof b.scrollIntoView=="function"?b.scrollIntoView():void 0:void 0},querySelectorAll:(typeof window!=="undefined"&&window!==null?window.jQuery:void 0)!=null?function(a,b){return jQuery(b,a)}:(typeof document!=="undefined"&&document!==null?document.querySelectorAll:void 0)!=null?function(a,b){return a.querySelectorAll(b)}:function(){},querySelector:(typeof window!=="undefined"&&window!==null?window.jQuery:void 0)!=null?function(a,b){return jQuery(b,a)[0]}:(typeof document!=="undefined"&&document!==null?document.querySelector:void 0)!=null?function(a,b){return a.querySelector(b)}:function(){},partial:function(a,b,c,d){var e;return d.prevent("rendered"),e=new Batman.View({source:b,context:c}),e.on("ready",function(){return Batman.setInnerHTML(a,""),Batman.appendChild(a,e.get("node")),d.allowAndFire("rendered")})},propagateBindingEvent:Batman.propagateBindingEvent=function(a,b){var c,d,e,f,g;while(c=(c||b).parentNode){e=Batman._data(c,"bindings");if(e!=null)for(f=0,g=e.length;f1;switch(a.nodeName.toUpperCase()){case"INPUT":case"TEXTAREA":return d?a.value=b:a.value;case"SELECT":if(d)return a.value=b;break;default:return d?Batman.setInnerHTML(a,c?Batman.escapeHTML(b):b):a.innerHTML}},nodeIsEditable:function(a){var b;return(b=a.nodeName.toUpperCase())==="INPUT"||b==="TEXTAREA"||b==="SELECT"},addEventListener:Batman.addEventListener=function(a,b,c){var d;return(d=Batman._data(a,"listeners"))||(d=Batman._data(a,"listeners",{})),d[b]||(d[b]=[]),d[b].push(c),Batman.hasAddEventListener?a.addEventListener(b,c,!1):a.attachEvent("on"+b,c)},removeEventListener:Batman.removeEventListener=function(a,b,c){var d,e,f;if(f=Batman._data(a,"listeners"))if(d=f[b])e=d.indexOf(c),e!==-1&&d.splice(e,1);return Batman.hasAddEventListener?a.removeEventListener(b,c,!1):a.detachEvent("on"+b,c)},hasAddEventListener:Batman.hasAddEventListener=typeof window!="undefined"&&window!==null?!!window.addEventListener:!!void 0,preventDefault:Batman.preventDefault=function(a){return typeof a.preventDefault=="function"?a.preventDefault():a.returnValue=!1},stopPropagation:Batman.stopPropagation=function(a){return a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},willInsertNode:function(a){var b,c,d,e,f,g;c=Batman._data(a,"view"),c!=null&&c.fire("beforeAppear",a),(f=Batman.data(a,"show"))!=null&&f.call(a),g=a.childNodes;for(d=0,e=g.length;d=0)?(h=d,d=function(a,b){if(b.type==="keyup"&&Batman.DOM.events.isEnter(b))return;return h.apply(null,arguments)},["input","keyup","change"]):["input","change"];default:return["change"]}}(),k=[];for(i=0,j=g.length;i"},i.prototype.toJSON=function(){var a,c,d;c={};for(a in this){if(!b.call(this,a))continue;d=this[a],a!=="_batman"&&a!=="hashKey"&&a!=="_batmanID"&&(c[a]=(d!=null?d.toJSON:void 0)?d.toJSON():d)}return c},f=function(a,b){var c,d,e,f;typeof b=="function"&&(b={get:b}),f=["cachable","cacheable"];for(d=0,e=f.length;dd?1:d>c?-1:a[0]>b[0]?1:b[0]>a[0]?-1:0},o.prototype.parseNode=function(a){var b,c,e,f,g,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w=this;if(this.deferEvery&&new Date-this.startTime>this.deferEvery){this.resumeNode=a,this.timeout=Batman.setImmediate(this.resume);return}if(a.getAttribute&&a.attributes){e=[],s=a.attributes;for(o=0,q=s.length;o1?[g[0],g.slice(1,g.length+1||9e9).join("-"),c.value]:[h,void 0,c.value])}u=e.sort(this._sortBindings);for(p=0,r=u.length;p0?(b=this.filterFunctions.reduce(function(b,d,e){var f;f=c.filterArguments[e].map(function(a){return a._keypath?c.renderContext.get(a._keypath):a}),f.unshift(b);while(f.length\n
  • \n'},d}(Batman.DOM.AbstractAttributeBinding)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.DOM.EventBinding=function(a){function c(a,b,d,e){var f,g,h,i=this;c.__super__.constructor.apply(this,arguments),h=this.node.getAttribute("data-confirm"),g=function(){var a;if(h&&!confirm(h))return;return(a=i.get("filteredValue"))!=null?a.apply(i.get("callbackContext"),arguments):void 0},(f=Batman.DOM.events[this.attributeName])?f(this.node,g,e):Batman.DOM.events.other(this.node,this.attributeName,g,e),this.bind()}return b(c,a),c.prototype.bindImmediately=!1,c.accessor("callbackContext",function(){var a;return a=this.key.split("."),a.pop(),a.length>0?this.get("keyContext").get(a.join(".")):this.get("keyContext")}),c.wrapAccessor("unfilteredValue",function(a){return{get:function(){var b,c,d,e;if(c=this.get("key")){e=c.split(".");if(e.length>1){b=e.pop(),d=Batman.getPath(this,["keyContext"].concat(e));if(d!=null)return d=Batman.RenderContext.deProxy(d),d[b]}}return a.get.apply(this,arguments)}}}),c}(Batman.DOM.AbstractAttributeBinding)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.DOM.NodeAttributeBinding=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.dataChange=function(a){return a==null&&(a=""),this.node[this.attributeName]=a},c.prototype.nodeChange=function(a){if(this.isTwoWay())return this.set("filteredValue",Batman.DOM.attrReaders._parseAttribute(a[this.attributeName]))},c}(Batman.DOM.AbstractAttributeBinding)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.DOM.CheckedBinding=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.isInputBinding=!0,c.prototype.dataChange=function(a){return this.node[this.attributeName]=!!a},c}(Batman.DOM.NodeAttributeBinding)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.DOM.AttributeBinding=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.dataChange=function(a){return this.node.setAttribute(this.attributeName,a)},c.prototype.nodeChange=function(a){if(this.isTwoWay())return this.set("filteredValue",Batman.DOM.attrReaders._parseAttribute(a.getAttribute(this.attributeName)))},c}(Batman.DOM.AbstractAttributeBinding)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.DOM.AddClassBinding=function(a){function c(a,b,d,e,f,g,h){var i,j;this.invert=h!=null?h:!1,j=b.split("|"),this.classes=function(){var a,b,c;c=[];for(a=0,b=j.length;a=0)&&(a+="/"+b.action.toLowerCase()),a},k.prototype.urlForRecord=function(a,b){var c,d;if(a.url)d=this._execWithOptions(a,"url",b.options);else{d=a.constructor.url?this._execWithOptions(a.constructor,"url",b.options):this._defaultCollectionUrl(a.constructor);if(b.action!=="create"){if((c=a.get("id"))==null)throw new this.constructor.StorageError("Couldn't get/set record primary key on "+b.action+"!");d=d+"/"+c}}return d=this._addParams(d,b.options),this.urlPrefix(a,b)+d+this.urlSuffix(a,b)},k.prototype.urlForCollection=function(a,b){var c;return c=a.url?this._execWithOptions(a,"url",b.options):this._defaultCollectionUrl(a,b.options),c=this._addParams(c,b.options),this.urlPrefix(a,b)+c+this.urlSuffix(a,b)},k.prototype.urlPrefix=function(a,b){return this._execWithOptions(a,"urlPrefix",b.options)||""},k.prototype.urlSuffix=function(a,b){return this._execWithOptions(a,"urlSuffix",b.options)||""},k.prototype.request=function(a,b){var c;return c=Batman.extend(a.options,{autosend:!1,success:function(b){return a.data=b},error:function(b){return a.error=b},loaded:function(){return a.response=a.request.get("response"),b()}}),a.request=new Batman.Request(c),a.request.send()},k.prototype.perform=function(a,b,c,d){return c||(c={}),Batman.extend(c,this.defaultRequestOptions),k.__super__.perform.call(this,a,b,c,d)},k.prototype.before("all",k.skipIfError(function(a,b){if(!a.options.url)try{a.options.url=a.subject.prototype?this.urlForCollection(a.subject,a):this.urlForRecord(a.subject,a)}catch(c){a.error=c}return b()})),k.prototype.before("get","put","post","delete",k.skipIfError(function(a,b){return a.options.method=a.action.toUpperCase(),b()})),k.prototype.before("create","update",k.skipIfError(function(a,b){var c,d,e;return d=a.subject.toJSON(),(e=this.recordJsonNamespace(a.subject))?(c={},c[e]=d):c=d,a.options.data=c,b()})),k.prototype.before("create","update","put","post",k.skipIfError(function(a,b){return this.serializeAsForm?a.options.contentType=this.constructor.PostBodyContentType:a.options.data!=null&&(a.options.data=JSON.stringify(a.options.data),a.options.contentType=this.constructor.JSONContentType),b()})),k.prototype.after("all",k.skipIfError(function(a,b){var c;if(a.data==null)return b();if(typeof a.data=="string"){if(a.data.length>0)try{c=this._jsonToAttributes(a.data)}catch(d){return a.error=d,b()}}else typeof a.data=="object"&&(c=a.data);return c!=null&&(a.json=c),b()})),k.prototype.extractFromNamespace=function(a,b){return b&&a[b]!=null?a[b]:a},k.prototype.after("create","read","update",k.skipIfError(function(a,b){var c;return a.json!=null&&(c=this.extractFromNamespace(a.json,this.recordJsonNamespace(a.subject)),a.subject._withoutDirtyTracking(function(){return this.fromJSON(c)})),a.result=a.subject,b()})),k.prototype.after("readAll",k.skipIfError(function(a,b){var c,d;return d=this.collectionJsonNamespace(a.subject),a.recordsAttributes=this.extractFromNamespace(a.json,d),Batman.typeOf(a.recordsAttributes)!=="Array"&&(d=this.recordJsonNamespace(a.subject.prototype),a.recordsAttributes=[this.extractFromNamespace(a.json,d)]),a.result=a.records=function(){var b,d,e,f;e=a.recordsAttributes,f=[];for(b=0,d=e.length;be;b=0<=e?++d:--d)c=this.storage.key(b),a.call(this,c,this.storage.getItem(c));return!0},c.prototype._storageEntriesMatching=function(a,b){var c,d;return c=this.storageRegExpForRecord(a.prototype),d=[],this._forAllStorageEntries(function(e,f){var g,h;if(h=c.exec(e)){g=this._jsonToAttributes(f),g[a.primaryKey]=h[1];if(this._dataMatches(b,g))return d.push(g)}}),d},c.prototype._dataMatches=function(a,b){var c,d,e;d=!0;for(c in a){e=a[c];if(b[c]!==e){d=!1;break}}return d},c.prototype.before("read","create","update","destroy",c.skipIfError(function(a,b){var c=this;return a.action==="create"?a.id=a.subject.get("id")||a.subject._withoutDirtyTracking(function(){return a.subject.set("id",c.nextIdForRecord(a.subject))}):a.id=a.subject.get("id"),a.id==null?a.error=new this.constructor.StorageError("Couldn't get/set record primary key on "+a.action+"!"):a.key=this.storageKey(a.subject)+a.id,b()})),c.prototype.before("create","update",c.skipIfError(function(a,b){return a.recordAttributes=JSON.stringify(a.subject),b()})),c.prototype.after("read",c.skipIfError(function(a,b){if(typeof a.recordAttributes=="string")try{a.recordAttributes=this._jsonToAttributes(a.recordAttributes)}catch(c){return a.error=c,b()}return a.subject._withoutDirtyTracking(function(){return this.fromJSON(a.recordAttributes)}),b()})),c.prototype.after("read","create","update","destroy",c.skipIfError(function(a,b){return a.result=a.subject,b()})),c.prototype.after("readAll",c.skipIfError(function(a,b){var c;return a.result=a.records=function(){var b,d,e,f;e=a.recordsAttributes,f=[];for(b=0,d=e.length;b"+b,c)},d.prototype.onEnter=function(a,b){return this.on("enter "+a,b)},d.prototype.onExit=function(a,b){return this.on("exit "+a,b)},d.prototype.startTransition=Batman.Property.wrapTrackingPrevention(function(a){var b,c;if(this.isTransitioning){this.nextEvents.push(a);return}return c=this.get("state"),b=this.nextStateForEvent(a),b?(this.isTransitioning=!0,this.fire("exit "+c),this.set("_state",b),this.fire(""+c+"->"+b),this.fire("enter "+b),this.fire(a),this.isTransitioning=!1,this.nextEvents.length>0&&this.startTransition(this.nextEvents.shift()),!0):!1}),d.prototype.canStartTransition=function(a,b){return b==null&&(b=this.get("state")),!!this.nextStateForEvent(a,b)},d.prototype.nextStateForEvent=function(a,b){var c;return b==null&&(b=this.get("state")),(c=this.transitionTable[a])!=null?c[b]:void 0},d}(Batman.Object),Batman.DelegatingStateMachine=function(a){function c(a,b){this.base=b,c.__super__.constructor.call(this,a)}return b(c,a),c.prototype.fire=function(){var a,b;return a=c.__super__.fire.apply(this,arguments),(b=this.base).fire.apply(b,arguments),a},c}(Batman.StateMachine)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a},d=[].slice;Batman.Model=function(b){function l(b){b==null&&(b={}),this.destroy=a(this.destroy,this),this.save=a(this.save,this),this.load=a(this.load,this),Batman.typeOf(b)==="Object"?l.__super__.constructor.call(this,b):(l.__super__.constructor.call(this),this.set("id",b))}var e,f,g,h,i,j,k;c(l,b),l.primaryKey="id",l.storageKey=null,l.persist=function(a,b){return Batman.initializeObject(this.prototype),a=a.isStorageAdapter?a:new a(this),b&&Batman.mixin(a,b),this.prototype._batman.storage=a,a},l.storageAdapter=function(){return Batman.initializeObject(this.prototype),this.prototype._batman.storage},l.encode=function(){var a,b,c,e,f,g,h,i,j;f=2<=arguments.length?d.call(arguments,0,h=arguments.length-1):(h=0,[]),c=arguments[h++],Batman.initializeObject(this.prototype),(g=this.prototype._batman).encoders||(g.encoders=new Batman.SimpleHash),a={};switch(Batman.typeOf(c)){case"String":f.push(c);break;case"Function":a.encode=c;break;default:a=c}for(i=0,j=f.length;i0)return this.fire.apply(this,["itemsWereAdded"].concat(c.call(b)))}),m.prototype.replace=m.mutation(function(a){var b,d;b=[],d=[],this._preventMutationEvents(function(){var c=this;return this.forEach(function(b,e){if(!Batman.objectHasKey(a,b))return c.unset(b),d.push(b)}),Batman.forEach(a,function(a,d){return c.hasKey(a)||b.push(a),c.set(a,d)})}),b.length>0&&this.fire.apply(this,["itemsWereAdded"].concat(c.call(b)));if(d.length>0)return this.fire.apply(this,["itemsWereRemoved"].concat(c.call(d)))}),j=["equality","hashKeyFor","objectKey","prefixedKey","unprefixedKey"];for(f=0,h=j.length;fthis.maximumLength){a=this.keyQueue.slice(0);for(b=d=e=this.maximumLength,f=a.length;e<=f?df;b=e<=f?++d:--d)c=a[b],this.get(c).isInDOM()||this.unset(c)}},c}(Batman.Hash)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a},d=[].indexOf||function(a){for(var b=0,c=this.length;b=0)return;return g=e.block,typeof g=="function"?g.call(f,b):typeof f[g]=="function"?f[g](b):void 0})},f}(Batman.Object)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.Set=function(a){function l(){Batman.SimpleSet.apply(this,arguments)}var c,d,e,f,g,h,i,j,k=this;b(l,a),Batman.extend(l.prototype,Batman.Enumerable),l._applySetAccessors=function(a){var b,c,d,e;c={first:function(){return this.toArray()[0]},last:function(){return this.toArray()[this.length-1]},isEmpty:function(){return this.isEmpty()},toArray:function(){return this.toArray()},length:function(){return this.registerAsMutableSource(),this.length},indexedBy:function(){var a=this;return new Batman.TerminalAccessible(function(b){return a.indexedBy(b)})},indexedByUnique:function(){var a=this;return new Batman.TerminalAccessible(function(b){return a.indexedByUnique(b)})},sortedBy:function(){var a=this;return new Batman.TerminalAccessible(function(b){return a.sortedBy(b)})},sortedByDescending:function(){var a=this;return new Batman.TerminalAccessible(function(b){return a.sortedBy(b,"desc")})}},e=[];for(d in c)b=c[d],e.push(a.accessor(d,b));return e},l._applySetAccessors(l),i=["add","remove","clear","replace","indexedBy","indexedByUnique","sortedBy","equality","_indexOfItem"];for(e=0,g=i.length;eb?1:a0)return a.call(b,d,e,c)})},d.prototype.toArray=function(){var a;return a=[],this._storage.forEach(function(b,c){if(c.get("length")>0)return a.push(b)}),a},d.prototype._addItem=function(a){return this._addItemToKey(a,this._keyForItem(a))},d.prototype._addItemToKey=function(a,b){return this._resultSetForKey(b).add(a)},d.prototype._removeItem=function(a){return this._removeItemFromKey(a,this._keyForItem(a))},d.prototype._removeItemFromKey=function(a,b){return this._resultSetForKey(b).remove(a)},d.prototype._resultSetForKey=function(a){return this._storage.getOrSet(a,function(){return new Batman.Set})},d.prototype._keyForItem=function(a){return Batman.Keypath.forBaseAndKey(a,this.key).getValue()},d}(Batman.Object)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.PolymorphicAssociationSetIndex=function(a){function c(a,b,d){this.association=a,this.type=b,c.__super__.constructor.call(this,this.association.getRelatedModelForType(b).get("loaded"),d)}return b(c,a),c.prototype._resultSetForKey=function(a){var b=this;return this._storage.getOrSet(a,function(){return new b.association.proxyClass(a,b.type,b.association)})},c}(Batman.SetIndex)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.AssociationSetIndex=function(a){function c(a,b){this.association=a,c.__super__.constructor.call(this,this.association.getRelatedModel().get("loaded"),b)}return b(c,a),c.prototype._resultSetForKey=function(a){var b=this;return this._storage.getOrSet(a,function(){return new b.association.proxyClass(a,b.association)})},c.prototype._setResultSet=function(a,b){return this._storage.set(a,b)},c}(Batman.SetIndex)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.UniqueSetIndex=function(a){function c(){this._uniqueIndex=new Batman.Hash,c.__super__.constructor.apply(this,arguments)}return b(c,a),c.accessor(function(a){return this._uniqueIndex.get(a)}),c.prototype._addItemToKey=function(a,b){this._resultSetForKey(b).add(a);if(!this._uniqueIndex.hasKey(b))return this._uniqueIndex.set(b,a)},c.prototype._removeItemFromKey=function(a,b){var d;return d=this._resultSetForKey(b),c.__super__._removeItemFromKey.apply(this,arguments),d.isEmpty()?this._uniqueIndex.unset(b):this._uniqueIndex.set(b,d.toArray()[0])},c}(Batman.SetIndex)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.UniqueAssociationSetIndex=function(a){function c(a,b){this.association=a,c.__super__.constructor.call(this,this.association.getRelatedModel().get("loaded"),b)}return b(c,a),c}(Batman.UniqueSetIndex)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.PolymorphicUniqueAssociationSetIndex=function(a){function c(a,b,d){this.association=a,this.type=b,c.__super__.constructor.call(this,this.association.getRelatedModelForType(b).get("loaded"),d)}return b(c,a),c}(Batman.UniqueSetIndex)}.call(this),function(){Batman.URI=function(){function m(b){var c,d;d=l.exec(b),c=14;while(c--)this[a[c]]=d[c]||"";this.queryParams=this.constructor.paramsFromQuery(this.query),delete this.authority,delete this.userInfo,delete this.relative,delete this.directory,delete this.file,delete this.query}var a,b,c,d,e,f,g,h,i,j,k,l;return l=/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,a=["source","protocol","authority","userInfo","user","password","hostname","port","relative","path","directory","file","query","hash"],m.prototype.queryString=function(){return this.constructor.queryFromParams(this.queryParams)},m.prototype.toString=function(){return[this.protocol?""+this.protocol+":":void 0,this.authority()?"//":void 0,this.authority(),this.relative()].join("")},m.prototype.userInfo=function(){return[this.user,this.password?":"+this.password:void 0].join("")},m.prototype.authority=function(){return[this.userInfo(),this.user||this.password?"@":void 0,this.hostname,this.port?":"+this.port:void 0].join("")},m.prototype.relative=function(){var a;return a=this.queryString(),[this.path,a?"?"+a:void 0,this.hash?"#"+this.hash:void 0].join("")},m.prototype.directory=function(){var a;return a=this.path.split("/"),a.length>1?a.slice(0,a.length-1).join("/")+"/":""},m.prototype.file=function(){var a;return a=this.path.split("/"),a[a.length-1]},m.paramsFromQuery=function(a){var b,d,e,g,i,j;d={},j=a.split("&");for(g=0,i=j.length;g0?this.autosend&&this.send():this.observe("url",function(a){if(a!=null)return this.send()})}var c;return b(d,a),d.objectToFormData=function(a){var b,c,d,e,f,g,h,i;d=function(a,b,c){var e,f,g;return c==null&&(c=!1),f=function(){switch(Batman.typeOf(b)){case"Object":return f=function(){var f;f=[];for(e in b)g=b[e],f.push(d(c?e:""+a+"["+e+"]",g));return f}(),f.reduce(function(a,b){return a.concat(b)},[]);case"Array":return b.reduce(function(b,c){return b.concat(d(""+a+"[]",c))},[]);default:return[[a,b!=null?b:""]]}}()},b=new Batman.container.FormData,h=d("",a,!0);for(f=0,g=h.length;f0&&(d=a.split(".")).length>0?(c=d.shift(),this.childrenByName[c]||(this.childrenByName[c]=new Batman.RouteMap),this.childrenByName[c].addRoute(d.join("."),b)):b.get("member")?this.memberRoute=b:this.collectionRoute=b,!0},a}()}.call(this),function(){var a=[].slice;Batman.RouteMapBuilder=function(){function b(a,b,c,d){this.app=a,this.routeMap=b,this.parent=c,this.baseOptions=d!=null?d:{},this.parent?(this.rootPath=this.parent._nestingPath(),this.rootName=this.parent._nestingName()):(this.rootPath="",this.rootName="")}return b.BUILDER_FUNCTIONS=["resources","member","collection","route","root"],b.ROUTES={index:{cardinality:"collection",path:function(a){return a},name:function(a){return a}},"new":{cardinality:"collection",path:function(a){return""+a+"/new"},name:function(a){return""+a+".new"}},show:{cardinality:"member",path:function(a){return""+a+"/:id"},name:function(a){return a}},edit:{cardinality:"member",path:function(a){return""+a+"/:id/edit"},name:function(a){return""+a+".edit"}},collection:{cardinality:"collection",path:function(a,b){return""+a+"/"+b},name:function(a,b){return""+a+"."+b}},member:{cardinality:"member",path:function(a,b){return""+a+"/:id/"+b},name:function(a,b){return""+a+"."+b}}},b.prototype.resources=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;e=1<=arguments.length?a.call(arguments,0):[],o=function(){var a,b,c;c=[];for(a=0,b=e.length;a0)return Batman.navigator.start()})),this.observe("layout",function(a){return a!=null?a.on("ready",function(){return c.fire("ready")}):void 0}),a=this.get("layout"),a?typeof a=="string"&&(b=this[Batman.helpers.camelize(a)+"View"]):a!==null&&(b=Batman.View),b&&(a=this.set("layout",new b({context:this,node:document}))),this.hasRun=!0,this.fire("run"),this)},i.event("ready").oneShot=!0,i.event("stop").oneShot=!0,i.stop=function(){var a;return(a=this.navigator)!=null&&a.stop(),Batman.navigator=null,this.hasRun=!1,this.fire("stop"),this},i}.call(this,Batman.Object)}.call(this),function(){Batman.Association=function(){function a(a,b,c){var d,e,f,g;this.model=a,this.label=b,c==null&&(c={}),d={namespace:Batman.currentApp,name:Batman.helpers.camelize(Batman.helpers.singularize(this.label))},this.options=Batman.extend(d,this.defaultOptions,c),this.options.nestUrl&&(this.model.urlNestsUnder!=null,this.model.urlNestsUnder(Batman.helpers.underscore(this.getRelatedModel().get("resourceName")))),this.options.extend!=null&&Batman.extend(this,this.options.extend),e={encode:this.options.saveInline?this.encoder():!1,decode:this.decoder()},this.model.encode(this.label,e),g=this,f=function(){return g.getAccessor.call(this,g,this.model,this.label)},this.model.accessor(this.label,{get:f,set:a.defaultAccessor.set,unset:a.defaultAccessor.unset})}return a.prototype.associationType="",a.prototype.isPolymorphic=!1,a.prototype.defaultOptions={saveInline:!0,autoload:!0,nestUrl:!1},a.prototype.getRelatedModel=function(){var a,b,c;return c=this.options.namespace||Batman.currentApp,a=this.options.name,b=c!=null?c[a]:void 0,b},a.prototype.getFromAttributes=function(a){return a.get("attributes."+this.label)},a.prototype.setIntoAttributes=function(a,b){return a.get("attributes").set(this.label,b)},a.prototype.inverse=function(){var a,b,c=this;if(b=this.getRelatedModel()._batman.get("associations"))return this.options.inverseOf?b.getByLabel(this.options.inverseOf):(a=null,b.forEach(function(b,d){if(d.getRelatedModel()===c.model)return a=d}),a)},a.prototype.reset=function(){return delete this.index,!0},a}()}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.PluralAssociation=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.proxyClass=Batman.AssociationSet,c.prototype.isSingular=!1,c.prototype.setForRecord=Batman.Property.wrapTrackingPrevention(function(a){var b;return(b=a.get(this.primaryKey))?this.setIndex().get(b):new this.proxyClass(void 0,this)}),c.prototype.getAccessor=function(a,b,c){var d,e,f=this;if(!a.getRelatedModel())return;return(e=a.getFromAttributes(this))?e:(d=a.setForRecord(this),a.setIntoAttributes(this,d),Batman.Property.withoutTracking(function(){if(a.options.autoload&&!f.isNew()&&!d.loaded)return d.load(function(a,b){if(a)throw a})}),d)},c.prototype.setIndex=function(){return this.index||(this.index=new Batman.AssociationSetIndex(this,this[this.indexRelatedModelOn])),this.index},c}(Batman.Association)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.HasManyAssociation=function(a){function c(a,b,d){if(d!=null?d.as:void 0)return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b),f=typeof e;return f=="object"||f=="function"?e||d:d}(Batman.PolymorphicHasManyAssociation,arguments,function(){});c.__super__.constructor.apply(this,arguments),this.primaryKey=this.options.primaryKey||"id",this.foreignKey=this.options.foreignKey||""+Batman.helpers.underscore(a.get("resourceName"))+"_id"}return b(c,a),c.prototype.associationType="hasMany",c.prototype.indexRelatedModelOn="foreignKey",c.prototype.apply=function(a,b){var c,d,e=this;if(!a){(c=this.getFromAttributes(b))&&c.forEach(function(a){return a.set(e.foreignKey,b.get(e.primaryKey))}),b.set(this.label,d=this.setForRecord(b));if(b.lifecycle.get("state")==="creating")return d.markAsLoaded()}},c.prototype.encoder=function(){var a;return a=this,function(b,c,d,e){var f;return b!=null&&(f=[],b.forEach(function(b){var c;c=b.toJSON();if(!a.inverse()||a.inverse().options.encodeForeignKey)c[a.foreignKey]=e.get(a.primaryKey);return f.push(c)})),f}},c.prototype.decoder=function(){var a;return a=this,function(b,c,d,e,f){var g,h,i,j,k,l,m,n,o;if(l=a.getRelatedModel()){h=a.getFromAttributes(f)||a.setForRecord(f),j=h.filter(function(a){return a.isNew()}).toArray();for(n=0,o=b.length;n0&&(m=j.shift(),m._withoutDirtyTracking(function(){return this.fromJSON(i)}),k=m),k=l._mapIdentity(k),h.add(k),a.options.inverseOf&&k.set(a.options.inverseOf,f);h.markAsLoaded()}return h}},c}(Batman.PluralAssociation)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.PolymorphicHasManyAssociation=function(a){function c(a,b,d){d.inverseOf=this.foreignLabel=d.as,delete d.as,d.foreignKey||(d.foreignKey=""+this.foreignLabel+"_id"),c.__super__.constructor.call(this,a,b,d),this.foreignTypeKey=d.foreignTypeKey||""+this.foreignLabel+"_type",this.model.encode(this.foreignTypeKey)}return b(c,a),c.prototype.proxyClass=Batman.PolymorphicAssociationSet,c.prototype.isPolymorphic=!0,c.prototype.apply=function(a,b){var d,e=this;return!a&&(d=this.getFromAttributes(b))&&(c.__super__.apply.apply(this,arguments),d.forEach(function(a){return a.set(e.foreignTypeKey,e.modelType())})),!0},c.prototype.getRelatedModelForType=function(){return this.getRelatedModel()},c.prototype.modelType=function(){return this.model.get("resourceName")},c.prototype.setIndex=function(){return this.typeIndex||(this.typeIndex=new Batman.PolymorphicAssociationSetIndex(this,this.modelType(),this[this.indexRelatedModelOn])),this.typeIndex},c.prototype.encoder=function(){var a;return a=this,function(b,c,d,e){var f;return b!=null&&(f=[],b.forEach(function(b){var c;return c=b.toJSON(),c[a.foreignKey]=e.get(a.primaryKey),c[a.foreignTypeKey]=a.modelType(),f.push(c)})),f}},c}(Batman.HasManyAssociation)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.SingularAssociation=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.isSingular=!0,c.prototype.getAccessor=function(a,b,c){var d,e;if(e=a.getFromAttributes(this))return e;if(a.getRelatedModel())return d=this.associationProxy(a),Batman.Property.withoutTracking(function(){if(!d.get("loaded")&&a.options.autoload)return d.load()}),d},c.prototype.setIndex=function(){return this.index||(this.index=new Batman.UniqueAssociationSetIndex(this,this[this.indexRelatedModelOn])),this.index},c}(Batman.Association)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.HasOneAssociation=function(a){function c(){c.__super__.constructor.apply(this,arguments),this.primaryKey=this.options.primaryKey||"id",this.foreignKey=this.options.foreignKey||""+Batman.helpers.underscore(this.model.get("resourceName"))+"_id"}return b(c,a),c.prototype.associationType="hasOne",c.prototype.proxyClass=Batman.HasOneProxy,c.prototype.indexRelatedModelOn="foreignKey",c.prototype.apply=function(a,b){var c;if(c=this.getFromAttributes(b))return c.set(this.foreignKey,b.get(this.primaryKey))},c.prototype.encoder=function(){var a;return a=this,function(b,c,d,e){var f;if(!a.options.saveInline)return;if(f=b.toJSON())f[a.foreignKey]=e.get(a.primaryKey);return f}},c.prototype.decoder=function(){var a;return a=this,function(b,c,d,e,f){var g,h;return h=a.getRelatedModel(),g=new h,g._withoutDirtyTracking(function(){return this.fromJSON(b)}),a.options.inverseOf&&g.set(a.options.inverseOf,f),g=h._mapIdentity(g),g}},c}(Batman.SingularAssociation)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.BelongsToAssociation=function(a){function c(a,b,d){if(d!=null?d.polymorphic:void 0)return delete d.polymorphic,function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b),f=typeof e;return f=="object"||f=="function"?e||d:d}(Batman.PolymorphicBelongsToAssociation,arguments,function(){});c.__super__.constructor.apply(this,arguments),this.foreignKey=this.options.foreignKey||""+this.label+"_id",this.primaryKey=this.options.primaryKey||"id",this.options.encodeForeignKey&&this.model.encode(this.foreignKey)}return b(c,a),c.prototype.associationType="belongsTo",c.prototype.proxyClass=Batman.BelongsToProxy,c.prototype.indexRelatedModelOn="primaryKey",c.prototype.defaultOptions={saveInline:!1,autoload:!0,encodeForeignKey:!0},c.prototype.encoder=function(){return function(a){return a.toJSON()}},c.prototype.decoder=function(){var a;return a=this,function(b,c,d,e,f){var g,h,i;return i=a.getRelatedModel(),h=new i,h._withoutDirtyTracking(function(){return this.fromJSON(b)}),h=i._mapIdentity(h),a.options.inverseOf&&(g=a.inverse())&&(g instanceof Batman.HasManyAssociation?f.set(a.foreignKey,h.get(a.primaryKey)):h.set(g.label,f)),f.set(a.label,h),h}},c.prototype.apply=function(a){var b,c;if(c=a.get(this.label)){b=c.get(this.primaryKey);if(b!==void 0)return a.set(this.foreignKey,b)}},c}(Batman.SingularAssociation)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.PolymorphicBelongsToAssociation=function(a){function c(){c.__super__.constructor.apply(this,arguments),this.foreignTypeKey=this.options.foreignTypeKey||""+this.label+"_type",this.options.encodeForeignTypeKey&&this.model.encode(this.foreignTypeKey),this.typeIndicies={}}return b(c,a),c.prototype.isPolymorphic=!0,c.prototype.proxyClass=Batman.PolymorphicBelongsToProxy,c.prototype.defaultOptions=Batman.mixin({},Batman.BelongsToAssociation.prototype.defaultOptions,{encodeForeignTypeKey:!0}),c.prototype.getRelatedModel=!1,c.prototype.setIndex=!1,c.prototype.inverse=!1,c.prototype.apply=function(a){var b,d,e;c.__super__.apply.apply(this,arguments);if(d=a.get(this.label))return d instanceof Batman.AssociationProxy?e=d.association.model:e=d.constructor,b=e.get("resourceName"),a.set(this.foreignTypeKey,b)},c.prototype.getAccessor=function(a,b,c){var d,e;if(e=a.getFromAttributes(this))return e;if(a.getRelatedModelForType(this.get(a.foreignTypeKey)))return d=this.associationProxy(a),Batman.Property.withoutTracking(function(){if(!d.get("loaded")&&a.options.autoload)return d.load()}),d},c.prototype.url=function(a){var b,c,d,e,f,g,h,i;g=(h=a.data)!=null?h[this.foreignTypeKey]:void 0;if(g&&(e=this.inverseForType(g)))return f=Batman.helpers.pluralize(g).toLowerCase(),d=(i=a.data)!=null?i[this.foreignKey]:void 0,c=e.isSingular?"singularize":"pluralize",b=Batman.helpers[c](e.label),"/"+f+"/"+d+"/"+b},c.prototype.getRelatedModelForType=function(a){var b,c;return c=this.options.namespace||Batman.currentApp,a&&(b=c!=null?c[a]:void 0,b||(b=c!=null?c[Batman.helpers.camelize(a)]:void 0)),b},c.prototype.setIndexForType=function(a){var b;return(b=this.typeIndicies)[a]||(b[a]=new Batman.PolymorphicUniqueAssociationSetIndex(this,a,this.primaryKey)),this.typeIndicies[a]},c.prototype.inverseForType=function(a){var b,c,d,e=this;if(c=(d=this.getRelatedModelForType(a))!=null?d._batman.get("associations"):void 0)return this.options.inverseOf?c.getByLabel(this.options.inverseOf):(b=null,c.forEach(function(a,c){if(c.getRelatedModel()===e.model)return b=c}),b)},c.prototype.decoder=function(){var a;return a=this,function(b,c,d,e,f){var g,h,i,j;return g=d[a.foreignTypeKey]||f.get(a.foreignTypeKey),j=a.getRelatedModelForType(g),i=new j,i._withoutDirtyTracking(function(){return this.fromJSON(b)}),i=j._mapIdentity(i),a.options.inverseOf&&(h=a.inverseForType(g))&&(h instanceof Batman.PolymorphicHasManyAssociation?(f.set(a.foreignKey,i.get(a.primaryKey)),f.set(a.foreignTypeKey,g)):i.set(h.label,f)),f.set(a.label,i),i}},c}(Batman.BelongsToAssociation)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b},c=[].slice;Batman.Validator=function(a){function d(){var a,b;b=arguments[0],a=2<=arguments.length?c.call(arguments,1):[],this.options=b,d.__super__.constructor.apply(this,a)}return b(d,a),d.prototype.validate=function(a){},d.prototype.format=function(a,b,c){return Batman.t("errors.messages."+b,c)},d.options=function(){var a;return a=1<=arguments.length?c.call(arguments,0):[],Batman.initializeObject(this),this._batman.options?this._batman.options.concat(a):this._batman.options=a},d.matches=function(a){var b,c,d,e,f,g;c={},d=!1;for(b in a)e=a[b],~((f=this._batman)!=null?(g=f.options)!=null?g.indexOf(b):void 0:void 0)&&(c[b]=e,d=!0);if(d)return c},d}(Batman.Object)}.call(this),function(){Batman.Validators=[],Batman.extend(Batman.translate.messages,{errors:{format:"%{attribute} %{message}",messages:{too_short:"must be at least %{count} characters",too_long:"must be less than %{count} characters",wrong_length:"must be %{count} characters",blank:"can't be blank",not_numeric:"must be a number",not_matching:"is not valid"}}})}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.RegExpValidator=function(a){function c(a){var b;this.regexp=(b=a.regexp)!=null?b:a.pattern,c.__super__.constructor.apply(this,arguments)}return b(c,a),c.options("regexp","pattern"),c.prototype.validateEach=function(a,b,c,d){var e;return e=b.get(c),e!=null&&e!==""&&(this.regexp.test(e)||a.add(c,this.format(c,"not_matching"))),d()},c}(Batman.Validator),Batman.Validators.push(Batman.RegExpValidator)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.PresenceValidator=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.options("presence"),c.prototype.validateEach=function(a,b,c,d){var e;return e=b.get(c),this.options.presence&&(e==null||e==="")&&a.add(c,this.format(c,"blank")),d()},c}(Batman.Validator),Batman.Validators.push(Batman.PresenceValidator)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.NumericValidator=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.options("numeric"),c.prototype.validateEach=function(a,b,c,d){var e;return e=b.get(c),this.options.numeric&&isNaN(parseFloat(e))&&a.add(c,this.format(c,"not_numeric")),d()},c}(Batman.Validator),Batman.Validators.push(Batman.NumericValidator)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.LengthValidator=function(a){function c(a){var b;if(b=a.lengthIn||a.lengthWithin)a.minLength=b[0],a.maxLength=b[1]||-1,delete a.lengthWithin,delete a.lengthIn;c.__super__.constructor.apply(this,arguments)}return b(c,a),c.options("minLength","maxLength","length","lengthWithin","lengthIn"),c.prototype.validateEach=function(a,b,c,d){var e,f,g;return e=this.options,f=(g=b.get(c))!=null?g:[],e.minLength&&f.lengthe.maxLength&&a.add(c,this.format(c,"too_long",{count:e.maxLength})),e.length&&f.length!==e.length&&a.add(c,this.format(c,"wrong_length",{count:e.length})),d()},c}(Batman.Validator),Batman.Validators.push(Batman.LengthValidator)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.ControllerActionFrame=function(a){function c(a,b){c.__super__.constructor.call(this,a),this.on("complete",b)}return b(c,a),c.prototype.operationOccurred=!1,c.prototype.remainingOperations=0,c.prototype.event("complete").oneShot=!0,c.prototype.startOperation=function(a){return a==null&&(a={}),a.internal||(this.operationOccurred=!0),this._changeOperationsCounter(1),!0},c.prototype.finishOperation=function(){return this._changeOperationsCounter(-1),!0},c.prototype.startAndFinishOperation=function(a){return this.startOperation(a),this.finishOperation(a),!0},c.prototype._changeOperationsCounter=function(a){var b;this.remainingOperations+=a,this.remainingOperations===0&&this.fire("complete"),(b=this.parentFrame)!=null&&b._changeOperationsCounter(a)},c}(Batman.Object)}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};Batman.DOM.InsertionBinding=function(a){function c(a,b,d,e,f,g){var h,i=this;this.invert=g!=null?g:!1,this.placeholderNode=document.createComment("detached node "+this.get("_batmanID")),h=c.__super__.constructor.apply(this,arguments),Batman.DOM.onParseExit(this.node,function(){i.bind();if(i.placeholderNode!=null)return Batman.DOM.trackBinding(i,i.placeholderNode)}),h}return b(c,a),c.prototype.isTwoWay=!1,c.prototype.bindImmediately=!1,c.prototype.dataChange=function(a){var b;b=this.placeholderNode.parentNode||this.node.parentNode;if(!!a!=!this.invert)return b.insertBefore(this.placeholderNode,this.node),Batman.DOM.removeNode(this.node);if(this.node.parentNode==null)return Batman.DOM.insertBefore(b,this.node,this.placeholderNode),b.removeChild(this.placeholderNode)},c.prototype.die=function(){if(this.dead)return;return c.__super__.die.apply(this,arguments),!!this.get("filteredValue")==!this.invert?Batman.DOM.destroyNode(this.placeholderNode):Batman.DOM.destroyNode(this.node)},c}(Batman.DOM.AbstractBinding)}.call(this),function(){var a;a=function(a){var b;for(b in a)return!1;return!0},Batman.extend(Batman,{cache:{},uuid:0,expando:"batman"+Math.random().toString().replace(/\D/g,""),canDeleteExpando:function(){var a;try{return a=document.createElement("div"),delete a.test}catch(b){return Batman.canDeleteExpando=!1}}(),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(b){return b=b.nodeType?Batman.cache[b[Batman.expando]]:b[Batman.expando],!!b&&!a(b)},data:function(a,b,c,d){var e,f,g,h,i,j;if(!Batman.acceptData(a))return;h=Batman.expando,f=typeof b=="string",e=Batman.cache,g=a[Batman.expando];if((!g||d&&g&&e[g]&&!e[g][h])&&f&&c===void 0)return;g||(a.nodeType!==3?a[Batman.expando]=g=++Batman.uuid:g=Batman.expando),e[g]||(e[g]={});if(typeof b=="object"||typeof b=="function")d?e[g][h]=Batman.extend(e[g][h],b):e[g]=Batman.extend(e[g],b);return j=e[g],d&&(j[h]||(j[h]={}),j=j[h]),c!==void 0&&(j[b]=c),f?i=j[b]:i=j,i},removeData:function(b,c,d){var e,f,g,h,i,j;if(!Batman.acceptData(b))return;h=Batman.expando,i=b.nodeType,e=Batman.cache,f=b[Batman.expando];if(!e[f])return;if(c){j=d?e[f][h]:e[f];if(j){delete j[c];if(!a(j))return}}if(d){delete e[f][h];if(!a(e[f]))return}return g=e[f][h],Batman.canDeleteExpando||!e.setInterval?delete e[f]:e[f]=null,g?(e[f]={},e[f][h]=g):Batman.canDeleteExpando?delete b[Batman.expando]:b.removeAttribute?b.removeAttribute(Batman.expando):b[Batman.expando]=null},_data:function(a,b,c){return Batman.data(a,b,c,!0)},acceptData:function(a){var b;if(a.nodeName){b=Batman.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}})}.call(this),function(){var a,b,c=[].slice;a=function(a){return function(b){return typeof b=="undefined"?void 0:a.apply(this,arguments)}},b=function(a,b){return a||b},Batman.Filters={raw:a(function(a,b){return b.escapeValue=!1,a}),get:a(function(a,b){return a.get!=null?a.get(b):a[b]}),equals:a(function(a,b,c){return a===b}),and:function(a,b){return a&&b},or:function(a,b,c){return a||b},not:function(a,b){return!a},matches:a(function(a,b){return a.indexOf(b)!==-1}),truncate:a(function(a,b,c,d){return c==null&&(c="..."),d||(d=c,c="..."),a.length>b&&(a=a.substr(0,b-c.length)+c),a}),"default":function(a,b,c){return a!=null&&a!==""?a:b},prepend:function(a,b,c){return b+a},append:function(a,b,c){return a+b},replace:a(function(a,b,c,d,e){return e||(e=d,d=void 0),d===void 0?a.replace(b,c):a.replace(b,c,d)}),downcase:a(function(a){return a.toLowerCase()}),upcase:a(function(a){return a.toUpperCase()}),pluralize:a(function(a,b,c,d){return d||(d=c,c=!0,d||(d=b,b=void 0)),b?Batman.helpers.pluralize(b,a,void 0,c):Batman.helpers.pluralize(a)}),humanize:a(function(a,b){return Batman.helpers.humanize(a)}),join:a(function(a,b,c){return b==null&&(b=""),c||(c=b,b=""),a.join(b)}),sort:a(function(a){return a.sort()}),map:a(function(a,b){return a.map(function(a){return Batman.get(a,b)})}),has:function(a,b){return a==null?!1:Batman.contains(a,b)},first:a(function(a){return a[0]}),meta:a(function(a,b){return a.meta.get(b)}),interpolate:function(a,b,c){var d,e,f;c||(c=b,b=void 0);if(!a)return;f={};for(d in b)e=b[d],f[d]=this.get(e),f[d]==null&&(f[d]="");return Batman.helpers.interpolate(a,f)},withArguments:function(){var a,b,d,e;b=arguments[0],d=3<=arguments.length?c.call(arguments,1,e=arguments.length-1):(e=1,[]),a=arguments[e++];if(!b)return;return function(){var a;return a=1<=arguments.length?c.call(arguments,0):[],b.call.apply(b,[this].concat(c.call(d),c.call(a)))}},routeToAction:a(function(a,b){var c;return c=Batman.Dispatcher.paramsFromArgument(a),c.action=b,c}),escape:a(Batman.escapeHTML)},function(){var b,c,d,e,f;e=["capitalize","singularize","underscore","camelize"],f=[];for(c=0,d=e.length;c0)return this.html;if(!(a=this.get("source")))return;return a=Batman.Navigator.normalizePath(a),this.html=this.constructor.store.get(a)},set:function(a,b){return this.html=b}}),d.accessor("node",{get:function(){var a;if(this.node==null){a=this.get("html");if(!(a&&a.length>0))return;this.node=document.createElement("div"),this._setNodeOwner(this.node),Batman.setInnerHTML(this.node,a)}return this.node},set:function(a,b){var c,d=this;return this.node=b,this._setNodeOwner(b),c=function(a){if(a!=null)return Batman.setInnerHTML(d.node,a),d.forget("html",c)},this.observeAndFire("html",c),b}}),d.YieldStorage=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.wrapAccessor(function(a){return{get:function(b){var c;return c=a.get.call(this,b),c==null&&(c=this.set(b,[])),c}}}),c}(Batman.Hash),d.accessor("yields",function(){return new this.constructor.YieldStorage}),d.prototype.render=function(a){var b=this;if(this._rendered)return;this._rendered=!0,this.event("ready").resetOneShot();if(a)return this._renderer=new Batman.Renderer(a,this.context,this),this._renderer.on("rendered",function(){return b.fire("ready",a)})},d.prototype.isInDOM=function(){var a;return(a=this.get("node"))?a.parentNode!=null||this.get("yields").some(function(b,c){var d,e;for(d=0,e=c.length;d