!function(n,s){var t;"function"==typeof define&&define.amd?define(["underscore","jquery","exports"],function(t,e,i){n.Backbone=s(n,i,t,e)}):"undefined"!=typeof exports?(t=require("underscore"),s(n,exports,t)):n.Backbone=s(n,{},n._,n.jQuery||n.Zepto||n.ender||n.$)}(this,function(t,o,w,e){var i=t.Backbone,n=[],s=(n.push,n.slice);n.splice;o.VERSION="1.1.2",o.$=e,o.noConflict=function(){return t.Backbone=i,this},o.emulateHTTP=!1,o.emulateJSON=!1;var r=o.Events={on:function(t,e,i){return l(this,"on",t,[e,i])&&e&&(this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push({callback:e,context:i,ctx:i||this})),this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var n=this,s=w.once(function(){n.off(t,s),e.apply(this,arguments)});return s._callback=e,this.on(t,s,i)},off:function(t,e,i){var n,s,r,o,a,h,c,u;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i)return this._events=void 0,this;for(a=0,h=(o=t?[t]:w.keys(this._events)).length;a").attr(t),this.setElement(t,!1))}}),o.sync=function(t,e,i){var n=g[t];w.defaults(i=i||{},{emulateHTTP:o.emulateHTTP,emulateJSON:o.emulateJSON});var s,r={type:n,dataType:"json"};i.url||(r.url=w.result(e,"url")||A()),null!=i.data||!e||"create"!==t&&"update"!==t&&"patch"!==t||(r.contentType="application/json",r.data=JSON.stringify(i.attrs||e.toJSON(i))),i.emulateJSON&&(r.contentType="application/x-www-form-urlencoded",r.data=r.data?{model:r.data}:{}),!i.emulateHTTP||"PUT"!==n&&"DELETE"!==n&&"PATCH"!==n||(r.type="POST",i.emulateJSON&&(r.data._method=n),s=i.beforeSend,i.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",n),s)return s.apply(this,arguments)}),"GET"===r.type||i.emulateJSON||(r.processData=!1),"PATCH"===r.type&&p&&(r.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});r=i.xhr=o.ajax(w.extend(r,i));return e.trigger("request",e,r,i),r};var p=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),g={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};o.ajax=function(){return o.$.ajax.apply(o.$,arguments)};var e=o.Router=function(t){(t=t||{}).routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},v=/\((.*?)\)/g,m=/(\(\?)?:\w+/g,y=/\*\w+/g,_=/[\-{}\[\]+?.,\\\^$|#\s]/g;w.extend(e.prototype,r,{initialize:function(){},route:function(e,i,n){w.isRegExp(e)||(e=this._routeToRegExp(e)),w.isFunction(i)&&(n=i,i=""),n=n||this[i];var s=this;return o.history.route(e,function(t){t=s._extractParameters(e,t);s.execute(n,t),s.trigger.apply(s,["route:"+i].concat(t)),s.trigger("route",i,t),o.history.trigger("route",s,i,t)}),this},execute:function(t,e){t&&t.apply(this,e)},navigate:function(t,e){return o.history.navigate(t,e),this},_bindRoutes:function(){if(this.routes){this.routes=w.result(this,"routes");for(var t,e=w.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(_,"\\$&").replace(v,"(?:$1)?").replace(m,function(t,e){return e?t:"([^/?]+)"}).replace(y,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return w.map(i,function(t,e){return e===i.length-1?t||null:t?decodeURIComponent(t):null})}});var b=o.History=function(){this.handlers=[],w.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},k=/^[#\/]|\s+$/g,T=/^\/+|\/+$/g,$=/msie [\w.]+/,S=/\/$/,H=/#.*$/;b.started=!1,w.extend(b.prototype,r,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){t=(t||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(t,e){return null==t&&(this._hasPushState||!this._wantsHashChange||e?(t=decodeURI(this.location.pathname+this.location.search),e=this.root.replace(S,""),t.indexOf(e)||(t=t.slice(e.length))):t=this.getHash()),t.replace(k,"")},start:function(t){if(b.started)throw new Error("Backbone.history has already been started");b.started=!0,this.options=w.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var e=this.getFragment(),i=document.documentMode,t=$.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(T,"/"),t&&this._wantsHashChange&&(i=o.$('